Skip to content

Test fix and other improvements #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PhotoData/DetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ @implementation DetailViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
self.navigationItem.title = self.key;
}

Expand Down
109 changes: 89 additions & 20 deletions PhotoData/PhotoViewController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1552</int>
<string key="IBDocument.SystemVersion">12D78</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
<string key="IBDocument.AppKitVersion">1187.37</string>
<string key="IBDocument.HIToolboxVersion">626.00</string>
<string key="IBDocument.SystemVersion">13F1077</string>
<string key="IBDocument.InterfaceBuilderVersion">6751</string>
<string key="IBDocument.AppKitVersion">1265.21</string>
<string key="IBDocument.HIToolboxVersion">698.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">2083</string>
<string key="NS.object.0">6736</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
Expand Down Expand Up @@ -38,9 +38,10 @@
<object class="IBUILabel" id="511916434">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{172, 70}, {32, 16}}</string>
<string key="NSFrame">{{182, 70}, {46, 16}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
Expand All @@ -51,7 +52,6 @@
<object class="NSColor" key="IBUITextColor" id="480321754">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
<string key="IBUIColorCocoaTouchKeyPath">darkTextColor</string>
</object>
<object class="NSColor" key="IBUIHighlightedColor" id="414499577">
<int key="NSColorSpace">3</int>
Expand All @@ -60,14 +60,16 @@
<int key="IBUIBaselineAdjustment">0</int>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="528559676">
<int key="type">1</int>
<int key="weightCategory">0</int>
<double key="pointSize">13</double>
</object>
<object class="NSFont" key="IBUIFont" id="971320175">
<string key="NSName">Helvetica</string>
<object class="NSFont" key="IBUIFont" id="586432058">
<string key="NSName">HelveticaNeue</string>
<double key="NSSize">13</double>
<int key="NSfFlags">16</int>
</object>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
<bool key="useAutomaticPreferredMaxLayoutWidth">YES</bool>
</object>
<object class="IBUILabel" id="622759446">
<reference key="NSNextResponder" ref="191373211"/>
Expand All @@ -88,19 +90,21 @@
<int key="IBUIBaselineAdjustment">0</int>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">2</int>
<int key="weightCategory">30</int>
<double key="pointSize">17</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<string key="NSName">HelveticaNeue</string>
<double key="NSSize">17</double>
<int key="NSfFlags">16</int>
</object>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
<bool key="useAutomaticPreferredMaxLayoutWidth">YES</bool>
</object>
<object class="IBUILabel" id="735049453">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{24, 70}, {143, 16}}</string>
<string key="NSFrame">{{24, 70}, {159, 16}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="511916434"/>
Expand All @@ -115,8 +119,9 @@
<reference key="IBUIHighlightedColor" ref="414499577"/>
<int key="IBUIBaselineAdjustment">0</int>
<reference key="IBUIFontDescription" ref="528559676"/>
<reference key="IBUIFont" ref="971320175"/>
<reference key="IBUIFont" ref="586432058"/>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
<bool key="useAutomaticPreferredMaxLayoutWidth">YES</bool>
</object>
<object class="IBUILabel" id="495014560">
<reference key="NSNextResponder" ref="191373211"/>
Expand All @@ -139,21 +144,24 @@
<reference key="IBUIHighlightedColor" ref="414499577"/>
<int key="IBUIBaselineAdjustment">0</int>
<reference key="IBUIFontDescription" ref="528559676"/>
<reference key="IBUIFont" ref="971320175"/>
<reference key="IBUIFont" ref="586432058"/>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
<bool key="useAutomaticPreferredMaxLayoutWidth">YES</bool>
</object>
</array>
<string key="NSFrame">{{0, 20}, {320, 548}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<reference key="NSNextKeyView" ref="495014560"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC45NwA</bytes>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUIScreenMetrics" key="IBUISimulatedDestinationMetrics">
<string key="IBUISimulatedSizeMetricsClass">IBUIScreenMetrics</string>
<string key="IBUITargetRuntime">IBCocoaTouchFramework</string>
<string key="IBUIDisplayName">iPhone 4-inch</string>
<object class="NSMutableDictionary" key="IBUINormalizedOrientationToSizeMap">
<bool key="EncodedWithXMLCoder">YES</bool>
<array key="dict.sortedKeys">
Expand All @@ -165,15 +173,13 @@
<string>{568, 320}</string>
</array>
</object>
<string key="IBUITargetRuntime">IBCocoaTouchFramework</string>
<string key="IBUIDisplayName">Retina 4 Full Screen</string>
<int key="IBUIType">2</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<array key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
Expand Down Expand Up @@ -211,10 +217,10 @@
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<array class="NSMutableArray" key="children">
<reference ref="511916434"/>
<reference ref="622759446"/>
<reference ref="735049453"/>
<reference ref="495014560"/>
<reference ref="511916434"/>
</array>
<reference key="parent" ref="0"/>
</object>
Expand Down Expand Up @@ -258,6 +264,7 @@
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<reference key="1.IBNSViewMetadataGestureRecognizers" ref="0"/>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
Expand Down Expand Up @@ -291,15 +298,77 @@
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/PhotoViewController.h</string>
<string key="minorKey">../PhotoData/PhotoViewController.h</string>
</object>
</object>
</array>
<array class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<object class="IBPartialClassDescription">
<string key="className">UIGestureRecognizer</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIGestureRecognizer.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UILabel</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIResponder</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISearchBar</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISearchDisplayController</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBDocument.previouslyAttemptedUpgradeToXcode5">NO</bool>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="4600" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">2083</string>
</data>
</archive>
3 changes: 2 additions & 1 deletion PhotoData/RatingCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

static const int MaximumNumberOfStars = 5;
static const float InactiveStarOpacity = .2;
static const int StarViewTagOffset = 100;


@implementation RatingCell
Expand All @@ -30,7 +31,7 @@ - (void)updateForRating:(double)rating
{
NSUInteger numberOfStars = (NSUInteger) ceilf((float) (rating * MaximumNumberOfStars));
for (NSUInteger idx = 0; idx < MaximumNumberOfStars; idx++) {
UIView *starView = self.contentView.subviews[idx];
UIView *starView = [self.contentView viewWithTag:StarViewTagOffset + idx];
starView.alpha = numberOfStars > idx ? 1 : InactiveStarOpacity;
}
}
Expand Down
Loading