diff --git a/Example.xcodeproj/project.pbxproj b/Example.xcodeproj/project.pbxproj
index d3f585e..82e24cf 100644
--- a/Example.xcodeproj/project.pbxproj
+++ b/Example.xcodeproj/project.pbxproj
@@ -88,7 +88,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
- LastUpgradeCheck = 0730;
+ LastUpgradeCheck = 1010;
ORGANIZATIONNAME = objc.io;
TargetAttributes = {
834EB8EC1CEB2819008A889B = {
@@ -167,13 +167,23 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -212,13 +222,23 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -237,6 +257,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
VALIDATE_PRODUCT = YES;
};
name = Release;
@@ -249,6 +270,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.objcio.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 4.2;
};
name = Debug;
};
@@ -260,6 +282,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.objcio.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 4.2;
};
name = Release;
};
@@ -282,6 +305,7 @@
834EB9011CEB2819008A889B /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
diff --git a/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/Example.xcodeproj/project.xcworkspace/xcuserdata/cagricolak.xcuserdatad/UserInterfaceState.xcuserstate b/Example.xcodeproj/project.xcworkspace/xcuserdata/cagricolak.xcuserdatad/UserInterfaceState.xcuserstate
new file mode 100644
index 0000000..a78c925
Binary files /dev/null and b/Example.xcodeproj/project.xcworkspace/xcuserdata/cagricolak.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/Example.xcodeproj/xcuserdata/cagricolak.xcuserdatad/xcschemes/xcschememanagement.plist b/Example.xcodeproj/xcuserdata/cagricolak.xcuserdatad/xcschemes/xcschememanagement.plist
new file mode 100644
index 0000000..329a244
--- /dev/null
+++ b/Example.xcodeproj/xcuserdata/cagricolak.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,14 @@
+
+
+
+
+ SchemeUserState
+
+ Example.xcscheme_^#shared#^_
+
+ orderHint
+ 0
+
+
+
+
diff --git a/Example/AppDelegate.swift b/Example/AppDelegate.swift
index 7ee68ef..3c36768 100644
--- a/Example/AppDelegate.swift
+++ b/Example/AppDelegate.swift
@@ -17,7 +17,7 @@ struct Episode {
class ProfileViewController: UIViewController {
var person: String = ""
var didTapClose: () -> () = {}
-
+
@IBAction func close(sender: AnyObject) {
didTapClose()
}
@@ -30,7 +30,7 @@ class DetailViewController: UIViewController {
label?.text = episode?.title
}
}
-
+
var episode: Episode?
}
@@ -40,17 +40,16 @@ class EpisodesViewController: UITableViewController {
var didSelect: (Episode) -> () = { _ in }
var didTapProfile: () -> () = {}
- override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
+ override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let episode = episodes[indexPath.row]
didSelect(episode)
}
-
- override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+ override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return episodes.count
}
- override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
- let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)
+ override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+ let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath as IndexPath)
let episode = episodes[indexPath.row]
cell.textLabel?.text = episode.title
return cell
@@ -65,7 +64,7 @@ class EpisodesViewController: UITableViewController {
final class App {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let navigationController: UINavigationController
-
+
init(window: UIWindow) {
navigationController = window.rootViewController as! UINavigationController
let episodesVC = navigationController.viewControllers[0] as! EpisodesViewController
@@ -74,18 +73,18 @@ final class App {
}
func showEpisode(episode: Episode) {
- let detailVC = storyboard.instantiateViewControllerWithIdentifier("Detail") as! DetailViewController
+ let detailVC = storyboard.instantiateViewController(withIdentifier: "Detail") as! DetailViewController
detailVC.episode = episode
navigationController.pushViewController(detailVC, animated: true)
}
func showProfile() {
- let profileNC = self.storyboard.instantiateViewControllerWithIdentifier("Profile") as! UINavigationController
+ let profileNC = self.storyboard.instantiateViewController(withIdentifier: "Profile") as! UINavigationController
let profileVC = profileNC.viewControllers[0] as! ProfileViewController
profileVC.didTapClose = {
- self.navigationController.dismissViewControllerAnimated(true, completion: nil)
+ self.navigationController.dismiss(animated: true, completion: nil)
}
- navigationController.presentViewController(profileNC, animated: true, completion: nil)
+ navigationController.present(profileNC, animated: true, completion: nil)
}
}
@@ -94,8 +93,8 @@ final class App {
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var app: App?
-
- func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
+
+ private func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
if let window = window {
app = App(window: window)
}