Skip to content

Commit

Permalink
Add fixes for animations on iPhone 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Gale committed Sep 12, 2012
1 parent 7f3b08e commit c19241f
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 15 deletions.
8 changes: 8 additions & 0 deletions Animations.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
0C9E50931518DBF800A599AA /* FirstViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0C9E50921518DBF800A599AA /* FirstViewController.m */; };
0C9E50981518DC3B00A599AA /* NavBarFavouriteActive.png in Resources */ = {isa = PBXBuildFile; fileRef = 0C9E50941518DC3B00A599AA /* NavBarFavouriteActive.png */; };
0C9E509A1518DC3B00A599AA /* NavBarFavouriteNonActive.png in Resources */ = {isa = PBXBuildFile; fileRef = 0C9E50961518DC3B00A599AA /* NavBarFavouriteNonActive.png */; };
0CD9D46716014B610062C6F3 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0CD9D46616014B610062C6F3 /* Default-568h@2x.png */; };
0CD9D47116014C420062C6F3 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0CD9D47016014C420062C6F3 /* Default@2x.png */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -76,6 +78,8 @@
0C9E50921518DBF800A599AA /* FirstViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FirstViewController.m; sourceTree = "<group>"; };
0C9E50941518DC3B00A599AA /* NavBarFavouriteActive.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = NavBarFavouriteActive.png; sourceTree = "<group>"; };
0C9E50961518DC3B00A599AA /* NavBarFavouriteNonActive.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = NavBarFavouriteNonActive.png; sourceTree = "<group>"; };
0CD9D46616014B610062C6F3 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
0CD9D47016014C420062C6F3 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -192,6 +196,8 @@
0C9E50771518D7E300A599AA /* Default-Landscape.png */,
0C9E50791518D7E300A599AA /* Default-Portrait.png */,
0C9E507B1518D7E300A599AA /* Default.png */,
0CD9D47016014C420062C6F3 /* Default@2x.png */,
0CD9D46616014B610062C6F3 /* Default-568h@2x.png */,
);
name = Images;
path = Animations/Images;
Expand Down Expand Up @@ -258,6 +264,8 @@
0C9E508C1518DA6300A599AA /* FavouriteGlow.png in Resources */,
0C9E50981518DC3B00A599AA /* NavBarFavouriteActive.png in Resources */,
0C9E509A1518DC3B00A599AA /* NavBarFavouriteNonActive.png in Resources */,
0CD9D46716014B610062C6F3 /* Default-568h@2x.png in Resources */,
0CD9D47116014C420062C6F3 /* Default@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
4 changes: 4 additions & 0 deletions Animations/FirstViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ - (IBAction)favouriteTapped:(id)sender

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
// This is unfortunate, but because are are dealing with this view in a non-standard way,
// we need code to handle iPhone 5 resolution it will just load the view as a 480-pixel tall view
favAnimationView.view.frame = appDelegate.window.frame;

[appDelegate.window addSubview:favAnimationView.view];
}
else
Expand Down
Binary file added Animations/Images/Default-568h@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Animations/Images/Default@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion Animations/SplashViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,16 @@ - (void)loadView

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
_animationBookCoverView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default.png"]];
if (([[UIScreen mainScreen] bounds].size.height > 480.1))
{
// iOS 6 doesn't seem to automatically pull out the iPhone 5 sized image so we manually need to load it
// if running on an iPhone 5.
_animationBookCoverView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default-568h.png"]];
}
else
{
_animationBookCoverView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default.png"]];
}
}
else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
Expand Down
90 changes: 76 additions & 14 deletions FavouriteAnimationViewController~iphone.xib
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1296</int>
<string key="IBDocument.SystemVersion">11D50b</string>
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
<string key="IBDocument.AppKitVersion">1138.32</string>
<string key="IBDocument.HIToolboxVersion">568.00</string>
<int key="IBDocument.SystemTarget">1536</int>
<string key="IBDocument.SystemVersion">12B19</string>
<string key="IBDocument.InterfaceBuilderVersion">2840</string>
<string key="IBDocument.AppKitVersion">1187</string>
<string key="IBDocument.HIToolboxVersion">624.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">1179</string>
<string key="NS.object.0">1926</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>IBProxyObject</string>
<string>IBUIView</string>
<string>IBUIImageView</string>
<string>IBUIView</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand Down Expand Up @@ -44,6 +44,7 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{278, 9}, {27, 27}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="589646887"/>
<object class="NSColor" key="IBUIBackgroundColor" id="475911540">
<int key="NSColorSpace">3</int>
Expand All @@ -59,14 +60,15 @@
</object>
<object class="IBUIView" id="589646887">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<int key="NSvFlags">268</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIView" id="527142489">
<reference key="NSNextResponder" ref="589646887"/>
<int key="NSvFlags">292</int>
<int key="NSvFlags">268</int>
<string key="NSFrameSize">{240, 49}</string>
<reference key="NSSuperview" ref="589646887"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="746388402"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
Expand All @@ -76,10 +78,10 @@
</object>
<object class="IBUIImageView" id="746388402">
<reference key="NSNextResponder" ref="589646887"/>
<int key="NSvFlags">256</int>
<int key="NSvFlags">265</int>
<string key="NSFrame">{{268, 5}, {24, 28}}</string>
<reference key="NSSuperview" ref="589646887"/>
<reference key="NSNextKeyView"/>
<reference key="NSWindow"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">4</int>
Expand All @@ -93,13 +95,15 @@
</object>
<string key="NSFrame">{{0, 431}, {320, 49}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="527142489"/>
<reference key="IBUIBackgroundColor" ref="475911540"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<string key="NSFrameSize">{320, 480}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="164771059"/>
<reference key="IBUIBackgroundColor" ref="475911540"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
Expand Down Expand Up @@ -253,12 +257,70 @@
<nil key="sourceID"/>
<int key="maxID">41</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">FavouriteAnimationViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>bottomView</string>
<string>favTabBlueStarGlowView</string>
<string>otherTabsFadeBlackView</string>
<string>starImageView</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIView</string>
<string>UIView</string>
<string>UIView</string>
<string>UIImageView</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>bottomView</string>
<string>favTabBlueStarGlowView</string>
<string>otherTabsFadeBlackView</string>
<string>starImageView</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">bottomView</string>
<string key="candidateClassName">UIView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">favTabBlueStarGlowView</string>
<string key="candidateClassName">UIView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">otherTabsFadeBlackView</string>
<string key="candidateClassName">UIView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">starImageView</string>
<string key="candidateClassName">UIImageView</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/FavouriteAnimationViewController.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<real value="1296" key="NS.object.0"/>
<real value="1536" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
Expand All @@ -279,6 +341,6 @@
<string>{27, 27}</string>
</object>
</object>
<string key="IBCocoaTouchPluginVersion">1179</string>
<string key="IBCocoaTouchPluginVersion">1926</string>
</data>
</archive>

0 comments on commit c19241f

Please sign in to comment.