Skip to content
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
30 changes: 26 additions & 4 deletions ChangingBackground.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
001809EC171C6764002D3E93 /* blue@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 001809E8171C6764002D3E93 /* blue@2x.png */; };
001809ED171C6764002D3E93 /* green.png in Resources */ = {isa = PBXBuildFile; fileRef = 001809E9171C6764002D3E93 /* green.png */; };
001809EE171C6764002D3E93 /* green@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 001809EA171C6764002D3E93 /* green@2x.png */; };
6458B71718230A4E0079E60D /* UINavigationController+Retro.m in Sources */ = {isa = PBXBuildFile; fileRef = 6458B71618230A4E0079E60D /* UINavigationController+Retro.m */; };
647617291822C12B002D52E5 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 647617281822C12B002D52E5 /* QuartzCore.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -50,13 +52,17 @@
001809E8171C6764002D3E93 /* blue@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "blue@2x.png"; sourceTree = "<group>"; };
001809E9171C6764002D3E93 /* green.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = green.png; sourceTree = "<group>"; };
001809EA171C6764002D3E93 /* green@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "green@2x.png"; sourceTree = "<group>"; };
6458B71518230A4E0079E60D /* UINavigationController+Retro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UINavigationController+Retro.h"; sourceTree = "<group>"; };
6458B71618230A4E0079E60D /* UINavigationController+Retro.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UINavigationController+Retro.m"; sourceTree = "<group>"; };
647617281822C12B002D52E5 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
001809B2171C637E002D3E93 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
647617291822C12B002D52E5 /* QuartzCore.framework in Frameworks */,
001809B9171C637E002D3E93 /* UIKit.framework in Frameworks */,
001809BB171C637E002D3E93 /* Foundation.framework in Frameworks */,
001809BD171C637E002D3E93 /* CoreGraphics.framework in Frameworks */,
Expand All @@ -70,6 +76,7 @@
isa = PBXGroup;
children = (
001809BE171C637E002D3E93 /* ChangingBackground */,
6458B70F182305EA0079E60D /* vendor */,
001809B7171C637E002D3E93 /* Frameworks */,
001809B6171C637E002D3E93 /* Products */,
);
Expand All @@ -86,6 +93,7 @@
001809B7171C637E002D3E93 /* Frameworks */ = {
isa = PBXGroup;
children = (
647617281822C12B002D52E5 /* QuartzCore.framework */,
001809B8171C637E002D3E93 /* UIKit.framework */,
001809BA171C637E002D3E93 /* Foundation.framework */,
001809BC171C637E002D3E93 /* CoreGraphics.framework */,
Expand Down Expand Up @@ -167,6 +175,16 @@
name = BackgroundImages;
sourceTree = "<group>";
};
6458B70F182305EA0079E60D /* vendor */ = {
isa = PBXGroup;
children = (
6458B71518230A4E0079E60D /* UINavigationController+Retro.h */,
6458B71618230A4E0079E60D /* UINavigationController+Retro.m */,
);
name = vendor;
path = ChangingBackground;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -238,6 +256,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6458B71718230A4E0079E60D /* UINavigationController+Retro.m in Sources */,
001809C5171C637E002D3E93 /* main.m in Sources */,
001809C9171C637E002D3E93 /* AppDelegate.m in Sources */,
001809D9171C6448002D3E93 /* FirstViewController.m in Sources */,
Expand Down Expand Up @@ -284,9 +303,9 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SDKROOT = iphoneos7.0;
};
name = Debug;
};
Expand All @@ -308,9 +327,9 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
SDKROOT = iphoneos7.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -321,6 +340,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ChangingBackground/ChangingBackground-Prefix.pch";
INFOPLIST_FILE = "ChangingBackground/ChangingBackground-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -332,6 +352,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ChangingBackground/ChangingBackground-Prefix.pch";
INFOPLIST_FILE = "ChangingBackground/ChangingBackground-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -356,6 +377,7 @@
001809D4171C637E002D3E93 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
13 changes: 12 additions & 1 deletion ChangingBackground/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,22 @@ @interface AppDelegate () {
}
@end


@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
window = [UIWindow.alloc initWithFrame:UIScreen.mainScreen.bounds];

UIImage* blueBackgroundImage = [UIImage imageNamed:@"blue.png"];
UIImageView* blueBackground = [[UIImageView alloc] initWithImage:blueBackgroundImage];
blueBackground.alpha = 0.8;

UIImage* greenBackgroundImage = [UIImage imageNamed:@"green.png"];
UIImageView* greenBackground = [[UIImageView alloc] initWithImage:greenBackgroundImage];
greenBackground.alpha = 0.2;

[window addSubview:blueBackground];
[window addSubview:greenBackground];

[window makeKeyAndVisible];

FirstViewController *firstViewController = FirstViewController.new;
Expand Down
6 changes: 6 additions & 0 deletions ChangingBackground/ChangingBackground-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIStatusBarHidden</key>
<false/>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
Expand Down
27 changes: 26 additions & 1 deletion ChangingBackground/FirstViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
// Copyright (c) 2013 Ora Interactive. All rights reserved.
//

#import <QuartzCore/QuartzCore.h>

#import "FirstViewController.h"
#import "SecondViewController.h"
#import "UINavigationController+Retro.h"

@interface FirstViewController ()

Expand All @@ -17,7 +20,29 @@ @implementation FirstViewController

- (IBAction)goForwardButtonPressed {
SecondViewController *secondViewController = SecondViewController.new;
[self.navigationController pushViewController:secondViewController animated:YES];
[self.navigationController pushViewControllerRetro:secondViewController];
}

- (void) viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor clearColor];
}

- (void) viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];

UIWindow* window = [UIApplication sharedApplication].keyWindow;

//(WW) UIImageView window subviews added in AppDelegate
UIImageView* blueBackground = [[window subviews] objectAtIndex:0];
UIImageView* greenBackground = [[window subviews] objectAtIndex:1];

if (blueBackground.alpha < 0.8) {
[UIView animateWithDuration:1.5 delay:0.3 options:UIViewAnimationOptionTransitionNone animations:^{
blueBackground.alpha = 0.8;
greenBackground.alpha = 0.2;
} completion:NULL];
}
}

@end
Loading