Skip to content

Commit 8d03c12

Browse files
committed
support swift 1.2 in demo project
1 parent c2c1e1a commit 8d03c12

3 files changed

Lines changed: 16 additions & 17 deletions

File tree

Example.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@
425425
);
426426
INFOPLIST_FILE = StatefulViewController/Info.plist;
427427
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
428-
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
428+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
429429
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
430430
PRODUCT_NAME = "$(TARGET_NAME)";
431431
SKIP_INSTALL = YES;
@@ -448,7 +448,7 @@
448448
DYLIB_INSTALL_NAME_BASE = "@rpath";
449449
INFOPLIST_FILE = StatefulViewController/Info.plist;
450450
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
451-
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
451+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
452452
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
453453
PRODUCT_NAME = "$(TARGET_NAME)";
454454
SKIP_INSTALL = YES;
@@ -470,7 +470,7 @@
470470
"$(inherited)",
471471
);
472472
INFOPLIST_FILE = StatefulViewControllerTests/Info.plist;
473-
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
473+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
474474
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
475475
PRODUCT_NAME = "$(TARGET_NAME)";
476476
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example";
@@ -486,7 +486,7 @@
486486
"$(inherited)",
487487
);
488488
INFOPLIST_FILE = StatefulViewControllerTests/Info.plist;
489-
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
489+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
490490
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
491491
PRODUCT_NAME = "$(TARGET_NAME)";
492492
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example";

Example/AppDelegate.swift

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1313

1414
var window: UIWindow?
1515

16+
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
17+
// Override point for customization after application launch.
18+
return true
19+
}
1620

17-
func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
18-
// Override point for customization after application launch.
19-
return true
20-
}
21-
22-
func applicationWillResignActive(application: UIApplication!) {
21+
func applicationWillResignActive(application: UIApplication) {
2322
// 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.
2423
// 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.
2524
}
2625

27-
func applicationDidEnterBackground(application: UIApplication!) {
26+
func applicationDidEnterBackground(application: UIApplication) {
2827
// 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.
2928
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
3029
}
3130

32-
func applicationWillEnterForeground(application: UIApplication!) {
31+
func applicationWillEnterForeground(application: UIApplication) {
3332
// 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.
3433
}
3534

36-
func applicationDidBecomeActive(application: UIApplication!) {
35+
func applicationDidBecomeActive(application: UIApplication) {
3736
// 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.
3837
}
3938

40-
func applicationWillTerminate(application: UIApplication!) {
39+
func applicationWillTerminate(application: UIApplication) {
4140
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
4241
}
4342

Example/ViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class ViewController: StatefulViewController {
6666

6767
extension ViewController: StatefulViewControllerDelegate {
6868
func hasContent() -> Bool {
69-
return countElements(dataArray) > 0
69+
return count(dataArray) > 0
7070
}
7171

7272
func handleErrorWhenContentAvailable(error: NSError) {
@@ -79,11 +79,11 @@ extension ViewController: StatefulViewControllerDelegate {
7979
extension ViewController: UITableViewDataSource {
8080

8181
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
82-
return countElements(dataArray)
82+
return count(dataArray)
8383
}
8484

8585
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
86-
let cell = tableView.dequeueReusableCellWithIdentifier("textCell", forIndexPath: indexPath) as UITableViewCell
86+
let cell = tableView.dequeueReusableCellWithIdentifier("textCell", forIndexPath: indexPath) as! UITableViewCell
8787
cell.textLabel?.text = dataArray[indexPath.row]
8888
return cell
8989
}

0 commit comments

Comments
 (0)