Skip to content

Commit 9626ad9

Browse files
committed
Convert sample project to Swift
1 parent 79773b7 commit 9626ad9

16 files changed

+345
-629
lines changed

TableViewCellWithAutoLayout.xcodeproj/project.pbxproj

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@
1111
99BCDCA718008C0000B8E66B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99BCDCA618008C0000B8E66B /* CoreGraphics.framework */; };
1212
99BCDCA918008C0000B8E66B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99BCDCA818008C0000B8E66B /* UIKit.framework */; };
1313
99BCDCAF18008C0000B8E66B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 99BCDCAD18008C0000B8E66B /* InfoPlist.strings */; };
14-
99BCDCB118008C0000B8E66B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 99BCDCB018008C0000B8E66B /* main.m */; };
15-
99BCDCB518008C0000B8E66B /* RJAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 99BCDCB418008C0000B8E66B /* RJAppDelegate.m */; };
1614
99BCDCB718008C0000B8E66B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 99BCDCB618008C0000B8E66B /* Images.xcassets */; };
1715
99BCDCBE18008C0000B8E66B /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99BCDCBD18008C0000B8E66B /* XCTest.framework */; };
1816
99BCDCBF18008C0000B8E66B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99BCDCA418008C0000B8E66B /* Foundation.framework */; };
1917
99BCDCC018008C0000B8E66B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99BCDCA818008C0000B8E66B /* UIKit.framework */; };
2018
99BCDCC818008C0000B8E66B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 99BCDCC618008C0000B8E66B /* InfoPlist.strings */; };
2119
99BCDCCA18008C0000B8E66B /* TableViewCellWithAutoLayoutTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 99BCDCC918008C0000B8E66B /* TableViewCellWithAutoLayoutTests.m */; };
22-
99BCDCDA18008C1700B8E66B /* RJModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 99BCDCD518008C1700B8E66B /* RJModel.m */; };
23-
99BCDCDB18008C1700B8E66B /* RJTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 99BCDCD718008C1700B8E66B /* RJTableViewCell.m */; };
24-
99BCDCDC18008C1700B8E66B /* RJTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 99BCDCD918008C1700B8E66B /* RJTableViewController.m */; };
20+
A7C103221943F73D006A9720 /* TableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C103211943F73D006A9720 /* TableViewCell.swift */; };
21+
A7F5DDAA194408D9008E238B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F5DDA9194408D9008E238B /* AppDelegate.swift */; };
22+
A7F5DDAC19440B7B008E238B /* Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F5DDAB19440B7B008E238B /* Model.swift */; };
23+
A7F5DDAE194417DC008E238B /* TableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F5DDAD194417DC008E238B /* TableViewController.swift */; };
2524
B147F1841867A715002B0C25 /* UIView+AutoLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = B147F1831867A715002B0C25 /* UIView+AutoLayout.m */; };
2625
/* End PBXBuildFile section */
2726

@@ -42,22 +41,18 @@
4241
99BCDCA818008C0000B8E66B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
4342
99BCDCAC18008C0000B8E66B /* TableViewCellWithAutoLayout-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TableViewCellWithAutoLayout-Info.plist"; sourceTree = "<group>"; };
4443
99BCDCAE18008C0000B8E66B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
45-
99BCDCB018008C0000B8E66B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
4644
99BCDCB218008C0000B8E66B /* TableViewCellWithAutoLayout-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TableViewCellWithAutoLayout-Prefix.pch"; sourceTree = "<group>"; };
47-
99BCDCB318008C0000B8E66B /* RJAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RJAppDelegate.h; sourceTree = "<group>"; };
48-
99BCDCB418008C0000B8E66B /* RJAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RJAppDelegate.m; sourceTree = "<group>"; };
4945
99BCDCB618008C0000B8E66B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
5046
99BCDCBC18008C0000B8E66B /* TableViewCellWithAutoLayoutTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TableViewCellWithAutoLayoutTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
5147
99BCDCBD18008C0000B8E66B /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
5248
99BCDCC518008C0000B8E66B /* TableViewCellWithAutoLayoutTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TableViewCellWithAutoLayoutTests-Info.plist"; sourceTree = "<group>"; };
5349
99BCDCC718008C0000B8E66B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
5450
99BCDCC918008C0000B8E66B /* TableViewCellWithAutoLayoutTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TableViewCellWithAutoLayoutTests.m; sourceTree = "<group>"; };
55-
99BCDCD418008C1700B8E66B /* RJModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RJModel.h; sourceTree = "<group>"; };
56-
99BCDCD518008C1700B8E66B /* RJModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RJModel.m; sourceTree = "<group>"; };
57-
99BCDCD618008C1700B8E66B /* RJTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RJTableViewCell.h; sourceTree = "<group>"; };
58-
99BCDCD718008C1700B8E66B /* RJTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RJTableViewCell.m; sourceTree = "<group>"; };
59-
99BCDCD818008C1700B8E66B /* RJTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RJTableViewController.h; sourceTree = "<group>"; };
60-
99BCDCD918008C1700B8E66B /* RJTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RJTableViewController.m; sourceTree = "<group>"; };
51+
A7C103201943F73C006A9720 /* TableViewCellWithAutoLayout-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TableViewCellWithAutoLayout-Bridging-Header.h"; sourceTree = "<group>"; };
52+
A7C103211943F73D006A9720 /* TableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableViewCell.swift; sourceTree = "<group>"; };
53+
A7F5DDA9194408D9008E238B /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
54+
A7F5DDAB19440B7B008E238B /* Model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Model.swift; sourceTree = "<group>"; };
55+
A7F5DDAD194417DC008E238B /* TableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableViewController.swift; sourceTree = "<group>"; };
6156
B147F1821867A715002B0C25 /* UIView+AutoLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+AutoLayout.h"; sourceTree = "<group>"; };
6257
B147F1831867A715002B0C25 /* UIView+AutoLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+AutoLayout.m"; sourceTree = "<group>"; };
6358
/* End PBXFileReference section */
@@ -120,8 +115,7 @@
120115
isa = PBXGroup;
121116
children = (
122117
B147F1811867A715002B0C25 /* UIView+AutoLayout */,
123-
99BCDCB318008C0000B8E66B /* RJAppDelegate.h */,
124-
99BCDCB418008C0000B8E66B /* RJAppDelegate.m */,
118+
A7F5DDA9194408D9008E238B /* AppDelegate.swift */,
125119
99BCDCB618008C0000B8E66B /* Images.xcassets */,
126120
99BCDCD318008C1700B8E66B /* TableViewController */,
127121
99BCDCAB18008C0000B8E66B /* Supporting Files */,
@@ -134,7 +128,6 @@
134128
children = (
135129
99BCDCAC18008C0000B8E66B /* TableViewCellWithAutoLayout-Info.plist */,
136130
99BCDCAD18008C0000B8E66B /* InfoPlist.strings */,
137-
99BCDCB018008C0000B8E66B /* main.m */,
138131
99BCDCB218008C0000B8E66B /* TableViewCellWithAutoLayout-Prefix.pch */,
139132
);
140133
name = "Supporting Files";
@@ -161,12 +154,10 @@
161154
99BCDCD318008C1700B8E66B /* TableViewController */ = {
162155
isa = PBXGroup;
163156
children = (
164-
99BCDCD418008C1700B8E66B /* RJModel.h */,
165-
99BCDCD518008C1700B8E66B /* RJModel.m */,
166-
99BCDCD618008C1700B8E66B /* RJTableViewCell.h */,
167-
99BCDCD718008C1700B8E66B /* RJTableViewCell.m */,
168-
99BCDCD818008C1700B8E66B /* RJTableViewController.h */,
169-
99BCDCD918008C1700B8E66B /* RJTableViewController.m */,
157+
A7C103201943F73C006A9720 /* TableViewCellWithAutoLayout-Bridging-Header.h */,
158+
A7F5DDAB19440B7B008E238B /* Model.swift */,
159+
A7C103211943F73D006A9720 /* TableViewCell.swift */,
160+
A7F5DDAD194417DC008E238B /* TableViewController.swift */,
170161
);
171162
path = TableViewController;
172163
sourceTree = "<group>";
@@ -276,12 +267,11 @@
276267
isa = PBXSourcesBuildPhase;
277268
buildActionMask = 2147483647;
278269
files = (
279-
99BCDCB518008C0000B8E66B /* RJAppDelegate.m in Sources */,
280270
B147F1841867A715002B0C25 /* UIView+AutoLayout.m in Sources */,
281-
99BCDCDC18008C1700B8E66B /* RJTableViewController.m in Sources */,
282-
99BCDCB118008C0000B8E66B /* main.m in Sources */,
283-
99BCDCDA18008C1700B8E66B /* RJModel.m in Sources */,
284-
99BCDCDB18008C1700B8E66B /* RJTableViewCell.m in Sources */,
271+
A7F5DDAE194417DC008E238B /* TableViewController.swift in Sources */,
272+
A7F5DDAA194408D9008E238B /* AppDelegate.swift in Sources */,
273+
A7F5DDAC19440B7B008E238B /* Model.swift in Sources */,
274+
A7C103221943F73D006A9720 /* TableViewCell.swift in Sources */,
285275
);
286276
runOnlyForDeploymentPostprocessing = 0;
287277
};
@@ -402,11 +392,15 @@
402392
buildSettings = {
403393
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
404394
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
395+
CLANG_ENABLE_MODULES = YES;
405396
GCC_PRECOMPILE_PREFIX_HEADER = YES;
406397
GCC_PREFIX_HEADER = "TableViewCellWithAutoLayout/TableViewCellWithAutoLayout-Prefix.pch";
407398
INFOPLIST_FILE = "TableViewCellWithAutoLayout/TableViewCellWithAutoLayout-Info.plist";
408399
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
400+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
409401
PRODUCT_NAME = "$(TARGET_NAME)";
402+
SWIFT_OBJC_BRIDGING_HEADER = "TableViewCellWithAutoLayout/TableViewController/TableViewCellWithAutoLayout-Bridging-Header.h";
403+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
410404
WRAPPER_EXTENSION = app;
411405
};
412406
name = Debug;
@@ -416,11 +410,14 @@
416410
buildSettings = {
417411
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
418412
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
413+
CLANG_ENABLE_MODULES = YES;
419414
GCC_PRECOMPILE_PREFIX_HEADER = YES;
420415
GCC_PREFIX_HEADER = "TableViewCellWithAutoLayout/TableViewCellWithAutoLayout-Prefix.pch";
421416
INFOPLIST_FILE = "TableViewCellWithAutoLayout/TableViewCellWithAutoLayout-Info.plist";
422417
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
418+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
423419
PRODUCT_NAME = "$(TARGET_NAME)";
420+
SWIFT_OBJC_BRIDGING_HEADER = "TableViewCellWithAutoLayout/TableViewController/TableViewCellWithAutoLayout-Bridging-Header.h";
424421
WRAPPER_EXTENSION = app;
425422
};
426423
name = Release;
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
//
2+
// AppDelegate.swift
3+
// TableViewCellWithAutoLayout
4+
//
5+
// Copyright (c) 2014 Tyler Fox
6+
//
7+
8+
import UIKit
9+
10+
@UIApplicationMain
11+
class AppDelegate: UIResponder, UIApplicationDelegate
12+
{
13+
var window: UIWindow?
14+
15+
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool
16+
{
17+
// Override point for customization after application launch.
18+
window = UIWindow(frame: UIScreen.mainScreen().bounds)
19+
var viewController = TableViewController(style: .Plain)
20+
window!.rootViewController = UINavigationController(rootViewController: viewController)
21+
window!.makeKeyAndVisible()
22+
return true
23+
}
24+
25+
func applicationWillResignActive(application: UIApplication)
26+
{
27+
// 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.
28+
// 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.
29+
}
30+
31+
func applicationDidEnterBackground(application: UIApplication)
32+
{
33+
// 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.
34+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
35+
}
36+
37+
func applicationWillEnterForeground(application: UIApplication)
38+
{
39+
// 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.
40+
}
41+
42+
func applicationDidBecomeActive(application: UIApplication)
43+
{
44+
// 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.
45+
}
46+
47+
func applicationWillTerminate(application: UIApplication)
48+
{
49+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
50+
}
51+
}

TableViewCellWithAutoLayout/RJAppDelegate.h

Lines changed: 0 additions & 34 deletions
This file was deleted.

TableViewCellWithAutoLayout/RJAppDelegate.m

Lines changed: 0 additions & 70 deletions
This file was deleted.

TableViewCellWithAutoLayout/TableViewCellWithAutoLayout-Prefix.pch

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313
#ifdef __OBJC__
1414
#import <UIKit/UIKit.h>
1515
#import <Foundation/Foundation.h>
16-
#import "UIView+AutoLayout.h"
1716
#endif

0 commit comments

Comments
 (0)