├── .gitignore
├── ComponentSwitch
├── ComponentSwitch-Bridging-Header.h
├── ViewController.h
├── AppDelegate.h
├── main.m
├── Images.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── AppDelegate.m
├── ViewControllerSwift.swift
├── ViewController.m
└── Base.lproj
│ ├── LaunchScreen.xib
│ └── Main.storyboard
├── ComponentSwitch.xcodeproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
├── xcuserdata
│ └── mikewoelmer.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── ComponentSwitch.xcscheme
└── project.pbxproj
├── README.md
└── ComponentSwitchTests
├── Info.plist
└── ComponentSwitchTests.m
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | ComponentSwitch.xcodeproj
3 |
--------------------------------------------------------------------------------
/ComponentSwitch/ComponentSwitch-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Use this file to import your target's public headers that you would like to expose to Swift.
3 | //
4 |
5 |
--------------------------------------------------------------------------------
/ComponentSwitch.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Switch Child View Controllers with Auto Layout
2 | In this [post](http://spin.atomicobject.com/2015/10/13/switching-child-view-controllers-ios-auto-layout), I will show you how to switch between two child view controllers that are constrained with auto layout.
3 |
4 | This is the sample code from that blog post.
--------------------------------------------------------------------------------
/ComponentSwitch/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // ComponentSwitch
4 | //
5 | // Created by Mike Woelmer on 7/13/15.
6 | // Copyright (c) 2015 atomicobject. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/ComponentSwitch/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // ComponentSwitch
4 | //
5 | // Created by Mike Woelmer on 7/13/15.
6 | // Copyright (c) 2015 atomicobject. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/ComponentSwitch/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // ComponentSwitch
4 | //
5 | // Created by Mike Woelmer on 7/13/15.
6 | // Copyright (c) 2015 atomicobject. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ComponentSwitch.xcodeproj/xcuserdata/mikewoelmer.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | ComponentSwitch.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | CB3A63B11B5474AE00E21A2D
16 |
17 | primary
18 |
19 |
20 | CB3A63CA1B5474AE00E21A2D
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ComponentSwitch/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/ComponentSwitchTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/ComponentSwitchTests/ComponentSwitchTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // ComponentSwitchTests.m
3 | // ComponentSwitchTests
4 | //
5 | // Created by Mike Woelmer on 7/13/15.
6 | // Copyright (c) 2015 atomicobject. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface ComponentSwitchTests : XCTestCase
13 |
14 | @end
15 |
16 | @implementation ComponentSwitchTests
17 |
18 | - (void)setUp {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown {
24 | // Put teardown code here. This method is called after the invocation of each test method in the class.
25 | [super tearDown];
26 | }
27 |
28 | - (void)testExample {
29 | // This is an example of a functional test case.
30 | XCTAssert(YES, @"Pass");
31 | }
32 |
33 | - (void)testPerformanceExample {
34 | // This is an example of a performance test case.
35 | [self measureBlock:^{
36 | // Put the code you want to measure the time of here.
37 | }];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/ComponentSwitch/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/ComponentSwitch/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // ComponentSwitch
4 | //
5 | // Created by Mike Woelmer on 7/13/15.
6 | // Copyright (c) 2015 atomicobject. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 | - (void)applicationWillResignActive:(UIApplication *)application {
24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
26 | }
27 |
28 | - (void)applicationDidEnterBackground:(UIApplication *)application {
29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
31 | }
32 |
33 | - (void)applicationWillEnterForeground:(UIApplication *)application {
34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
35 | }
36 |
37 | - (void)applicationDidBecomeActive:(UIApplication *)application {
38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
39 | }
40 |
41 | - (void)applicationWillTerminate:(UIApplication *)application {
42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/ComponentSwitch/ViewControllerSwift.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewControllerSwift.swift
3 | // ComponentSwitch
4 | //
5 | // Created by Mike Woelmer on 8/27/15.
6 | // Copyright (c) 2015 atomicobject. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ViewControllerSwift: UIViewController {
12 | @IBOutlet weak var containerView: UIView!
13 | weak var currentViewController: UIViewController?
14 |
15 | override func viewDidLoad() {
16 | self.currentViewController = self.storyboard?.instantiateViewControllerWithIdentifier("ComponentA")
17 | self.currentViewController!.view.translatesAutoresizingMaskIntoConstraints = false
18 | self.addChildViewController(self.currentViewController!)
19 | self.addSubview(self.currentViewController!.view, toView: self.containerView)
20 | super.viewDidLoad()
21 | }
22 |
23 | @IBAction func showComponent(sender: UISegmentedControl) {
24 | if sender.selectedSegmentIndex == 0 {
25 | let newViewController = self.storyboard?.instantiateViewControllerWithIdentifier("ComponentA")
26 | newViewController!.view.translatesAutoresizingMaskIntoConstraints = false
27 | self.cycleFromViewController(self.currentViewController!, toViewController: newViewController!)
28 | self.currentViewController = newViewController
29 | } else {
30 | let newViewController = self.storyboard?.instantiateViewControllerWithIdentifier("ComponentB")
31 | newViewController!.view.translatesAutoresizingMaskIntoConstraints = false
32 | self.cycleFromViewController(self.currentViewController!, toViewController: newViewController!)
33 | self.currentViewController = newViewController
34 | }
35 | }
36 |
37 | func cycleFromViewController(oldViewController: UIViewController, toViewController newViewController: UIViewController) {
38 | oldViewController.willMoveToParentViewController(nil)
39 | self.addChildViewController(newViewController)
40 | self.addSubview(newViewController.view, toView:self.containerView!)
41 | newViewController.view.alpha = 0
42 | newViewController.view.layoutIfNeeded()
43 | UIView.animateWithDuration(0.5, animations: {
44 | newViewController.view.alpha = 1
45 | oldViewController.view.alpha = 0
46 | },
47 | completion: { finished in
48 | oldViewController.view.removeFromSuperview()
49 | oldViewController.removeFromParentViewController()
50 | newViewController.didMoveToParentViewController(self)
51 | })
52 | }
53 |
54 | func addSubview(subView:UIView, toView parentView:UIView) {
55 | parentView.addSubview(subView)
56 |
57 | var viewBindingsDict = [String: AnyObject]()
58 | viewBindingsDict["subView"] = subView
59 | parentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[subView]|",
60 | options: [], metrics: nil, views: viewBindingsDict))
61 | parentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[subView]|",
62 | options: [], metrics: nil, views: viewBindingsDict))
63 | }
64 | }
--------------------------------------------------------------------------------
/ComponentSwitch/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // ComponentSwitch
4 | //
5 | // Created by Mike Woelmer on 7/13/15.
6 | // Copyright (c) 2015 atomicobject. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | @interface ViewController ()
12 | @property (weak, nonatomic) IBOutlet UIView *containerView;
13 | @property (weak, nonatomic) UIViewController *currentViewController;
14 |
15 | @end
16 |
17 | @implementation ViewController
18 |
19 | - (void)viewDidLoad {
20 | self.currentViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"ComponentA"];
21 | self.currentViewController.view.translatesAutoresizingMaskIntoConstraints = NO;
22 | [self addChildViewController:self.currentViewController];
23 | [self addSubview:self.currentViewController.view toView:self.containerView];
24 | [super viewDidLoad];
25 | }
26 |
27 | - (IBAction)showComponent:(UISegmentedControl *)sender {
28 | if (sender.selectedSegmentIndex == 0) {
29 | UIViewController *newViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"ComponentA"];
30 | newViewController.view.translatesAutoresizingMaskIntoConstraints = NO;
31 | [self cycleFromViewController:self.currentViewController toViewController:newViewController];
32 | self.currentViewController = newViewController;
33 | } else {
34 | UIViewController *newViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"ComponentB"];
35 | newViewController.view.translatesAutoresizingMaskIntoConstraints = NO;
36 | [self cycleFromViewController:self.currentViewController toViewController:newViewController];
37 | self.currentViewController = newViewController;
38 | }
39 | }
40 |
41 | - (void)cycleFromViewController:(UIViewController*) oldViewController
42 | toViewController:(UIViewController*) newViewController {
43 | [oldViewController willMoveToParentViewController:nil];
44 | [self addChildViewController:newViewController];
45 | [self addSubview:newViewController.view toView:self.containerView];
46 | newViewController.view.alpha = 0;
47 | [newViewController.view layoutIfNeeded];
48 |
49 | [UIView animateWithDuration:0.5
50 | animations:^{
51 | newViewController.view.alpha = 1;
52 | oldViewController.view.alpha = 0;
53 | }
54 | completion:^(BOOL finished) {
55 | [oldViewController.view removeFromSuperview];
56 | [oldViewController removeFromParentViewController];
57 | [newViewController didMoveToParentViewController:self];
58 | }];
59 | }
60 |
61 | - (void)addSubview:(UIView *)subView toView:(UIView*)parentView {
62 | [parentView addSubview:subView];
63 |
64 | NSDictionary * views = @{@"subView" : subView,};
65 | NSArray *constraints = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|[subView]|"
66 | options:0
67 | metrics:0
68 | views:views];
69 | [parentView addConstraints:constraints];
70 | constraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[subView]|"
71 | options:0
72 | metrics:0
73 | views:views];
74 | [parentView addConstraints:constraints];
75 | }
76 |
77 | @end
78 |
--------------------------------------------------------------------------------
/ComponentSwitch/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/ComponentSwitch.xcodeproj/xcuserdata/mikewoelmer.xcuserdatad/xcschemes/ComponentSwitch.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
67 |
68 |
78 |
80 |
86 |
87 |
88 |
89 |
90 |
91 |
97 |
99 |
105 |
106 |
107 |
108 |
110 |
111 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/ComponentSwitch/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
--------------------------------------------------------------------------------
/ComponentSwitch.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | CB3A63B81B5474AE00E21A2D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CB3A63B71B5474AE00E21A2D /* main.m */; };
11 | CB3A63BB1B5474AE00E21A2D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CB3A63BA1B5474AE00E21A2D /* AppDelegate.m */; };
12 | CB3A63BE1B5474AE00E21A2D /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CB3A63BD1B5474AE00E21A2D /* ViewController.m */; };
13 | CB3A63C11B5474AE00E21A2D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CB3A63BF1B5474AE00E21A2D /* Main.storyboard */; };
14 | CB3A63C31B5474AE00E21A2D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CB3A63C21B5474AE00E21A2D /* Images.xcassets */; };
15 | CB3A63C61B5474AE00E21A2D /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = CB3A63C41B5474AE00E21A2D /* LaunchScreen.xib */; };
16 | CB3A63D21B5474AE00E21A2D /* ComponentSwitchTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CB3A63D11B5474AE00E21A2D /* ComponentSwitchTests.m */; };
17 | CB69B2ED1B8F5780006099EB /* ViewControllerSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB69B2EC1B8F5780006099EB /* ViewControllerSwift.swift */; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXContainerItemProxy section */
21 | CB3A63CC1B5474AE00E21A2D /* PBXContainerItemProxy */ = {
22 | isa = PBXContainerItemProxy;
23 | containerPortal = CB3A63AA1B5474AE00E21A2D /* Project object */;
24 | proxyType = 1;
25 | remoteGlobalIDString = CB3A63B11B5474AE00E21A2D;
26 | remoteInfo = ComponentSwitch;
27 | };
28 | /* End PBXContainerItemProxy section */
29 |
30 | /* Begin PBXFileReference section */
31 | CB3A63B21B5474AE00E21A2D /* ComponentSwitch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ComponentSwitch.app; sourceTree = BUILT_PRODUCTS_DIR; };
32 | CB3A63B61B5474AE00E21A2D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
33 | CB3A63B71B5474AE00E21A2D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
34 | CB3A63B91B5474AE00E21A2D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
35 | CB3A63BA1B5474AE00E21A2D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
36 | CB3A63BC1B5474AE00E21A2D /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
37 | CB3A63BD1B5474AE00E21A2D /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
38 | CB3A63C01B5474AE00E21A2D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
39 | CB3A63C21B5474AE00E21A2D /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
40 | CB3A63C51B5474AE00E21A2D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
41 | CB3A63CB1B5474AE00E21A2D /* ComponentSwitchTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ComponentSwitchTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
42 | CB3A63D01B5474AE00E21A2D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
43 | CB3A63D11B5474AE00E21A2D /* ComponentSwitchTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ComponentSwitchTests.m; sourceTree = ""; };
44 | CB69B2EB1B8F5780006099EB /* ComponentSwitch-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ComponentSwitch-Bridging-Header.h"; sourceTree = ""; };
45 | CB69B2EC1B8F5780006099EB /* ViewControllerSwift.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewControllerSwift.swift; sourceTree = ""; };
46 | /* End PBXFileReference section */
47 |
48 | /* Begin PBXFrameworksBuildPhase section */
49 | CB3A63AF1B5474AE00E21A2D /* Frameworks */ = {
50 | isa = PBXFrameworksBuildPhase;
51 | buildActionMask = 2147483647;
52 | files = (
53 | );
54 | runOnlyForDeploymentPostprocessing = 0;
55 | };
56 | CB3A63C81B5474AE00E21A2D /* Frameworks */ = {
57 | isa = PBXFrameworksBuildPhase;
58 | buildActionMask = 2147483647;
59 | files = (
60 | );
61 | runOnlyForDeploymentPostprocessing = 0;
62 | };
63 | /* End PBXFrameworksBuildPhase section */
64 |
65 | /* Begin PBXGroup section */
66 | CB3A63A91B5474AE00E21A2D = {
67 | isa = PBXGroup;
68 | children = (
69 | CB3A63B41B5474AE00E21A2D /* ComponentSwitch */,
70 | CB3A63CE1B5474AE00E21A2D /* ComponentSwitchTests */,
71 | CB3A63B31B5474AE00E21A2D /* Products */,
72 | );
73 | sourceTree = "";
74 | };
75 | CB3A63B31B5474AE00E21A2D /* Products */ = {
76 | isa = PBXGroup;
77 | children = (
78 | CB3A63B21B5474AE00E21A2D /* ComponentSwitch.app */,
79 | CB3A63CB1B5474AE00E21A2D /* ComponentSwitchTests.xctest */,
80 | );
81 | name = Products;
82 | sourceTree = "";
83 | };
84 | CB3A63B41B5474AE00E21A2D /* ComponentSwitch */ = {
85 | isa = PBXGroup;
86 | children = (
87 | CB3A63B91B5474AE00E21A2D /* AppDelegate.h */,
88 | CB3A63BA1B5474AE00E21A2D /* AppDelegate.m */,
89 | CB3A63BC1B5474AE00E21A2D /* ViewController.h */,
90 | CB3A63BD1B5474AE00E21A2D /* ViewController.m */,
91 | CB69B2EC1B8F5780006099EB /* ViewControllerSwift.swift */,
92 | CB3A63BF1B5474AE00E21A2D /* Main.storyboard */,
93 | CB3A63C21B5474AE00E21A2D /* Images.xcassets */,
94 | CB3A63C41B5474AE00E21A2D /* LaunchScreen.xib */,
95 | CB3A63B51B5474AE00E21A2D /* Supporting Files */,
96 | CB69B2EB1B8F5780006099EB /* ComponentSwitch-Bridging-Header.h */,
97 | );
98 | path = ComponentSwitch;
99 | sourceTree = "";
100 | };
101 | CB3A63B51B5474AE00E21A2D /* Supporting Files */ = {
102 | isa = PBXGroup;
103 | children = (
104 | CB3A63B61B5474AE00E21A2D /* Info.plist */,
105 | CB3A63B71B5474AE00E21A2D /* main.m */,
106 | );
107 | name = "Supporting Files";
108 | sourceTree = "";
109 | };
110 | CB3A63CE1B5474AE00E21A2D /* ComponentSwitchTests */ = {
111 | isa = PBXGroup;
112 | children = (
113 | CB3A63D11B5474AE00E21A2D /* ComponentSwitchTests.m */,
114 | CB3A63CF1B5474AE00E21A2D /* Supporting Files */,
115 | );
116 | path = ComponentSwitchTests;
117 | sourceTree = "";
118 | };
119 | CB3A63CF1B5474AE00E21A2D /* Supporting Files */ = {
120 | isa = PBXGroup;
121 | children = (
122 | CB3A63D01B5474AE00E21A2D /* Info.plist */,
123 | );
124 | name = "Supporting Files";
125 | sourceTree = "";
126 | };
127 | /* End PBXGroup section */
128 |
129 | /* Begin PBXNativeTarget section */
130 | CB3A63B11B5474AE00E21A2D /* ComponentSwitch */ = {
131 | isa = PBXNativeTarget;
132 | buildConfigurationList = CB3A63D51B5474AE00E21A2D /* Build configuration list for PBXNativeTarget "ComponentSwitch" */;
133 | buildPhases = (
134 | CB3A63AE1B5474AE00E21A2D /* Sources */,
135 | CB3A63AF1B5474AE00E21A2D /* Frameworks */,
136 | CB3A63B01B5474AE00E21A2D /* Resources */,
137 | );
138 | buildRules = (
139 | );
140 | dependencies = (
141 | );
142 | name = ComponentSwitch;
143 | productName = ComponentSwitch;
144 | productReference = CB3A63B21B5474AE00E21A2D /* ComponentSwitch.app */;
145 | productType = "com.apple.product-type.application";
146 | };
147 | CB3A63CA1B5474AE00E21A2D /* ComponentSwitchTests */ = {
148 | isa = PBXNativeTarget;
149 | buildConfigurationList = CB3A63D81B5474AE00E21A2D /* Build configuration list for PBXNativeTarget "ComponentSwitchTests" */;
150 | buildPhases = (
151 | CB3A63C71B5474AE00E21A2D /* Sources */,
152 | CB3A63C81B5474AE00E21A2D /* Frameworks */,
153 | CB3A63C91B5474AE00E21A2D /* Resources */,
154 | );
155 | buildRules = (
156 | );
157 | dependencies = (
158 | CB3A63CD1B5474AE00E21A2D /* PBXTargetDependency */,
159 | );
160 | name = ComponentSwitchTests;
161 | productName = ComponentSwitchTests;
162 | productReference = CB3A63CB1B5474AE00E21A2D /* ComponentSwitchTests.xctest */;
163 | productType = "com.apple.product-type.bundle.unit-test";
164 | };
165 | /* End PBXNativeTarget section */
166 |
167 | /* Begin PBXProject section */
168 | CB3A63AA1B5474AE00E21A2D /* Project object */ = {
169 | isa = PBXProject;
170 | attributes = {
171 | LastSwiftMigration = 0700;
172 | LastSwiftUpdateCheck = 0700;
173 | LastUpgradeCheck = 0730;
174 | ORGANIZATIONNAME = atomicobject;
175 | TargetAttributes = {
176 | CB3A63B11B5474AE00E21A2D = {
177 | CreatedOnToolsVersion = 6.4;
178 | DevelopmentTeam = 322SA5VGT8;
179 | };
180 | CB3A63CA1B5474AE00E21A2D = {
181 | CreatedOnToolsVersion = 6.4;
182 | TestTargetID = CB3A63B11B5474AE00E21A2D;
183 | };
184 | };
185 | };
186 | buildConfigurationList = CB3A63AD1B5474AE00E21A2D /* Build configuration list for PBXProject "ComponentSwitch" */;
187 | compatibilityVersion = "Xcode 3.2";
188 | developmentRegion = English;
189 | hasScannedForEncodings = 0;
190 | knownRegions = (
191 | en,
192 | Base,
193 | );
194 | mainGroup = CB3A63A91B5474AE00E21A2D;
195 | productRefGroup = CB3A63B31B5474AE00E21A2D /* Products */;
196 | projectDirPath = "";
197 | projectRoot = "";
198 | targets = (
199 | CB3A63B11B5474AE00E21A2D /* ComponentSwitch */,
200 | CB3A63CA1B5474AE00E21A2D /* ComponentSwitchTests */,
201 | );
202 | };
203 | /* End PBXProject section */
204 |
205 | /* Begin PBXResourcesBuildPhase section */
206 | CB3A63B01B5474AE00E21A2D /* Resources */ = {
207 | isa = PBXResourcesBuildPhase;
208 | buildActionMask = 2147483647;
209 | files = (
210 | CB3A63C11B5474AE00E21A2D /* Main.storyboard in Resources */,
211 | CB3A63C61B5474AE00E21A2D /* LaunchScreen.xib in Resources */,
212 | CB3A63C31B5474AE00E21A2D /* Images.xcassets in Resources */,
213 | );
214 | runOnlyForDeploymentPostprocessing = 0;
215 | };
216 | CB3A63C91B5474AE00E21A2D /* Resources */ = {
217 | isa = PBXResourcesBuildPhase;
218 | buildActionMask = 2147483647;
219 | files = (
220 | );
221 | runOnlyForDeploymentPostprocessing = 0;
222 | };
223 | /* End PBXResourcesBuildPhase section */
224 |
225 | /* Begin PBXSourcesBuildPhase section */
226 | CB3A63AE1B5474AE00E21A2D /* Sources */ = {
227 | isa = PBXSourcesBuildPhase;
228 | buildActionMask = 2147483647;
229 | files = (
230 | CB69B2ED1B8F5780006099EB /* ViewControllerSwift.swift in Sources */,
231 | CB3A63BE1B5474AE00E21A2D /* ViewController.m in Sources */,
232 | CB3A63BB1B5474AE00E21A2D /* AppDelegate.m in Sources */,
233 | CB3A63B81B5474AE00E21A2D /* main.m in Sources */,
234 | );
235 | runOnlyForDeploymentPostprocessing = 0;
236 | };
237 | CB3A63C71B5474AE00E21A2D /* Sources */ = {
238 | isa = PBXSourcesBuildPhase;
239 | buildActionMask = 2147483647;
240 | files = (
241 | CB3A63D21B5474AE00E21A2D /* ComponentSwitchTests.m in Sources */,
242 | );
243 | runOnlyForDeploymentPostprocessing = 0;
244 | };
245 | /* End PBXSourcesBuildPhase section */
246 |
247 | /* Begin PBXTargetDependency section */
248 | CB3A63CD1B5474AE00E21A2D /* PBXTargetDependency */ = {
249 | isa = PBXTargetDependency;
250 | target = CB3A63B11B5474AE00E21A2D /* ComponentSwitch */;
251 | targetProxy = CB3A63CC1B5474AE00E21A2D /* PBXContainerItemProxy */;
252 | };
253 | /* End PBXTargetDependency section */
254 |
255 | /* Begin PBXVariantGroup section */
256 | CB3A63BF1B5474AE00E21A2D /* Main.storyboard */ = {
257 | isa = PBXVariantGroup;
258 | children = (
259 | CB3A63C01B5474AE00E21A2D /* Base */,
260 | );
261 | name = Main.storyboard;
262 | sourceTree = "";
263 | };
264 | CB3A63C41B5474AE00E21A2D /* LaunchScreen.xib */ = {
265 | isa = PBXVariantGroup;
266 | children = (
267 | CB3A63C51B5474AE00E21A2D /* Base */,
268 | );
269 | name = LaunchScreen.xib;
270 | sourceTree = "";
271 | };
272 | /* End PBXVariantGroup section */
273 |
274 | /* Begin XCBuildConfiguration section */
275 | CB3A63D31B5474AE00E21A2D /* Debug */ = {
276 | isa = XCBuildConfiguration;
277 | buildSettings = {
278 | ALWAYS_SEARCH_USER_PATHS = NO;
279 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
280 | CLANG_CXX_LIBRARY = "libc++";
281 | CLANG_ENABLE_MODULES = YES;
282 | CLANG_ENABLE_OBJC_ARC = YES;
283 | CLANG_WARN_BOOL_CONVERSION = YES;
284 | CLANG_WARN_CONSTANT_CONVERSION = YES;
285 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
286 | CLANG_WARN_EMPTY_BODY = YES;
287 | CLANG_WARN_ENUM_CONVERSION = YES;
288 | CLANG_WARN_INT_CONVERSION = YES;
289 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
290 | CLANG_WARN_UNREACHABLE_CODE = YES;
291 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
292 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
293 | COPY_PHASE_STRIP = NO;
294 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
295 | ENABLE_STRICT_OBJC_MSGSEND = YES;
296 | ENABLE_TESTABILITY = YES;
297 | GCC_C_LANGUAGE_STANDARD = gnu99;
298 | GCC_DYNAMIC_NO_PIC = NO;
299 | GCC_NO_COMMON_BLOCKS = YES;
300 | GCC_OPTIMIZATION_LEVEL = 0;
301 | GCC_PREPROCESSOR_DEFINITIONS = (
302 | "DEBUG=1",
303 | "$(inherited)",
304 | );
305 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
306 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
307 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
308 | GCC_WARN_UNDECLARED_SELECTOR = YES;
309 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
310 | GCC_WARN_UNUSED_FUNCTION = YES;
311 | GCC_WARN_UNUSED_VARIABLE = YES;
312 | IPHONEOS_DEPLOYMENT_TARGET = 8.4;
313 | MTL_ENABLE_DEBUG_INFO = YES;
314 | ONLY_ACTIVE_ARCH = YES;
315 | SDKROOT = iphoneos;
316 | };
317 | name = Debug;
318 | };
319 | CB3A63D41B5474AE00E21A2D /* Release */ = {
320 | isa = XCBuildConfiguration;
321 | buildSettings = {
322 | ALWAYS_SEARCH_USER_PATHS = NO;
323 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
324 | CLANG_CXX_LIBRARY = "libc++";
325 | CLANG_ENABLE_MODULES = YES;
326 | CLANG_ENABLE_OBJC_ARC = YES;
327 | CLANG_WARN_BOOL_CONVERSION = YES;
328 | CLANG_WARN_CONSTANT_CONVERSION = YES;
329 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
330 | CLANG_WARN_EMPTY_BODY = YES;
331 | CLANG_WARN_ENUM_CONVERSION = YES;
332 | CLANG_WARN_INT_CONVERSION = YES;
333 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
334 | CLANG_WARN_UNREACHABLE_CODE = YES;
335 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
336 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
337 | COPY_PHASE_STRIP = NO;
338 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
339 | ENABLE_NS_ASSERTIONS = NO;
340 | ENABLE_STRICT_OBJC_MSGSEND = YES;
341 | GCC_C_LANGUAGE_STANDARD = gnu99;
342 | GCC_NO_COMMON_BLOCKS = YES;
343 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
344 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
345 | GCC_WARN_UNDECLARED_SELECTOR = YES;
346 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
347 | GCC_WARN_UNUSED_FUNCTION = YES;
348 | GCC_WARN_UNUSED_VARIABLE = YES;
349 | IPHONEOS_DEPLOYMENT_TARGET = 8.4;
350 | MTL_ENABLE_DEBUG_INFO = NO;
351 | SDKROOT = iphoneos;
352 | VALIDATE_PRODUCT = YES;
353 | };
354 | name = Release;
355 | };
356 | CB3A63D61B5474AE00E21A2D /* Debug */ = {
357 | isa = XCBuildConfiguration;
358 | buildSettings = {
359 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
360 | CLANG_ENABLE_MODULES = YES;
361 | CODE_SIGN_IDENTITY = "iPhone Developer";
362 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
363 | INFOPLIST_FILE = ComponentSwitch/Info.plist;
364 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
365 | PRODUCT_BUNDLE_IDENTIFIER = "com.atomicobject.$(PRODUCT_NAME:rfc1034identifier)";
366 | PRODUCT_NAME = "$(TARGET_NAME)";
367 | PROVISIONING_PROFILE = "";
368 | SWIFT_OBJC_BRIDGING_HEADER = "ComponentSwitch/ComponentSwitch-Bridging-Header.h";
369 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
370 | };
371 | name = Debug;
372 | };
373 | CB3A63D71B5474AE00E21A2D /* Release */ = {
374 | isa = XCBuildConfiguration;
375 | buildSettings = {
376 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
377 | CLANG_ENABLE_MODULES = YES;
378 | CODE_SIGN_IDENTITY = "iPhone Developer";
379 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
380 | INFOPLIST_FILE = ComponentSwitch/Info.plist;
381 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
382 | PRODUCT_BUNDLE_IDENTIFIER = "com.atomicobject.$(PRODUCT_NAME:rfc1034identifier)";
383 | PRODUCT_NAME = "$(TARGET_NAME)";
384 | PROVISIONING_PROFILE = "";
385 | SWIFT_OBJC_BRIDGING_HEADER = "ComponentSwitch/ComponentSwitch-Bridging-Header.h";
386 | };
387 | name = Release;
388 | };
389 | CB3A63D91B5474AE00E21A2D /* Debug */ = {
390 | isa = XCBuildConfiguration;
391 | buildSettings = {
392 | BUNDLE_LOADER = "$(TEST_HOST)";
393 | FRAMEWORK_SEARCH_PATHS = (
394 | "$(SDKROOT)/Developer/Library/Frameworks",
395 | "$(inherited)",
396 | );
397 | GCC_PREPROCESSOR_DEFINITIONS = (
398 | "DEBUG=1",
399 | "$(inherited)",
400 | );
401 | INFOPLIST_FILE = ComponentSwitchTests/Info.plist;
402 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
403 | PRODUCT_BUNDLE_IDENTIFIER = "com.atomicobject.$(PRODUCT_NAME:rfc1034identifier)";
404 | PRODUCT_NAME = "$(TARGET_NAME)";
405 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ComponentSwitch.app/ComponentSwitch";
406 | };
407 | name = Debug;
408 | };
409 | CB3A63DA1B5474AE00E21A2D /* Release */ = {
410 | isa = XCBuildConfiguration;
411 | buildSettings = {
412 | BUNDLE_LOADER = "$(TEST_HOST)";
413 | FRAMEWORK_SEARCH_PATHS = (
414 | "$(SDKROOT)/Developer/Library/Frameworks",
415 | "$(inherited)",
416 | );
417 | INFOPLIST_FILE = ComponentSwitchTests/Info.plist;
418 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
419 | PRODUCT_BUNDLE_IDENTIFIER = "com.atomicobject.$(PRODUCT_NAME:rfc1034identifier)";
420 | PRODUCT_NAME = "$(TARGET_NAME)";
421 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ComponentSwitch.app/ComponentSwitch";
422 | };
423 | name = Release;
424 | };
425 | /* End XCBuildConfiguration section */
426 |
427 | /* Begin XCConfigurationList section */
428 | CB3A63AD1B5474AE00E21A2D /* Build configuration list for PBXProject "ComponentSwitch" */ = {
429 | isa = XCConfigurationList;
430 | buildConfigurations = (
431 | CB3A63D31B5474AE00E21A2D /* Debug */,
432 | CB3A63D41B5474AE00E21A2D /* Release */,
433 | );
434 | defaultConfigurationIsVisible = 0;
435 | defaultConfigurationName = Release;
436 | };
437 | CB3A63D51B5474AE00E21A2D /* Build configuration list for PBXNativeTarget "ComponentSwitch" */ = {
438 | isa = XCConfigurationList;
439 | buildConfigurations = (
440 | CB3A63D61B5474AE00E21A2D /* Debug */,
441 | CB3A63D71B5474AE00E21A2D /* Release */,
442 | );
443 | defaultConfigurationIsVisible = 0;
444 | defaultConfigurationName = Release;
445 | };
446 | CB3A63D81B5474AE00E21A2D /* Build configuration list for PBXNativeTarget "ComponentSwitchTests" */ = {
447 | isa = XCConfigurationList;
448 | buildConfigurations = (
449 | CB3A63D91B5474AE00E21A2D /* Debug */,
450 | CB3A63DA1B5474AE00E21A2D /* Release */,
451 | );
452 | defaultConfigurationIsVisible = 0;
453 | defaultConfigurationName = Release;
454 | };
455 | /* End XCConfigurationList section */
456 | };
457 | rootObject = CB3A63AA1B5474AE00E21A2D /* Project object */;
458 | }
459 |
--------------------------------------------------------------------------------