Commit 9902025b authored by Aral Balkan's avatar Aral Balkan
Browse files

Update to Xcode Beta 5

parent 7693664d
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
......
......@@ -11,7 +11,7 @@
import Foundation
let 📡:NotificationCenter = NotificationCenter.default()
let 📡:NotificationCenter = NotificationCenter.default
public typealias NotificationBlock = (Notification!) -> Void
......@@ -76,7 +76,7 @@ public func handle(_ notificationName:String, with block:NotificationBlock) -> N
// object and return that for easy removing of the observer, etc.
//
let observer = NotificationHandler(handler: block)
📡.addObserver(observer, selector: #selector(observer.handlerProxy(_:)), name: notificationName, object: nil)
📡.addObserver(observer, selector: #selector(observer.handlerProxy(_:)), name: NSNotification.Name(rawValue: notificationName), object: nil)
return observer
}
......@@ -84,7 +84,7 @@ public func handle(_ notificationName:String, with block:NotificationBlock) -> N
public func handle(_ notificationName:String, from object:AnyObject?, with block:NotificationBlock) -> NotificationHandler
{
let observer = NotificationHandler(handler: block)
📡.addObserver(observer, selector: #selector(observer.handlerProxy(_:)), name: notificationName, object: object)
📡.addObserver(observer, selector: #selector(observer.handlerProxy(_:)), name: NSNotification.Name(rawValue: notificationName), object: object)
return observer
}
......@@ -126,13 +126,13 @@ public func post(_ notificationName:String)
public func handle(_ notificationName:String, with selector:Selector, on observer:AnyObject)
{
📡.addObserver(observer, selector: selector, name: notificationName, object: nil)
📡.addObserver(observer, selector: selector, name: NSNotification.Name(rawValue: notificationName), object: nil)
}
public func handle(_ notificationName:String, from object:AnyObject?, with selector:Selector, on observer:AnyObject)
{
📡.addObserver(observer, selector: selector, name: notificationName, object: object)
📡.addObserver(observer, selector: selector, name: NSNotification.Name(rawValue: notificationName), object: object)
}
......
......@@ -30,13 +30,13 @@ extension NotificationCenter
public func handle(_ notificationName:String, with selector:Selector, on observer:AnyObject)
{
self.addObserver(observer, selector: selector, name: notificationName, object: nil)
self.addObserver(observer, selector: selector, name: NSNotification.Name(rawValue: notificationName), object: nil)
}
public func handle(_ notificationName:String, from object:AnyObject?, with selector:Selector, on observer:AnyObject)
{
self.addObserver(observer, selector: selector, name: notificationName, object: object)
self.addObserver(observer, selector: selector, name: NSNotification.Name(rawValue: notificationName), object: object)
}
......@@ -82,9 +82,9 @@ extension NotificationCenter
public func post(_ notificationName:String)
{
#if os(OSX)
self.post(notificationName, from: NSApplication.shared(), with: /* userInfo as */ nil)
self.post(notificationName, from: NSApplication.shared, with: /* userInfo as */ nil)
#elseif os(iOS)
self.post(notificationName, from: UIApplication.shared(), with: /* userInfo as */ nil)
self.post(notificationName, from: UIApplication.shared, with: /* userInfo as */ nil)
#endif
}
......
......@@ -111,6 +111,7 @@
TargetAttributes = {
A7C0EB491C242CEE00110179 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
};
};
};
......@@ -204,7 +205,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
......@@ -242,7 +243,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
};
......@@ -257,6 +258,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "ind.ie.HandleDemo-OSX";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
......@@ -269,6 +271,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "ind.ie.HandleDemo-OSX";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
......@@ -291,6 +294,7 @@
A7C0EB5B1C242CEE00110179 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
......
......@@ -13,11 +13,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(aNotification: NSNotification) {
func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application
}
func applicationWillTerminate(aNotification: NSNotification) {
func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}
......
......@@ -20,7 +20,7 @@ class OSXViewController: NSViewController
{
super.viewDidLoad()
windowDidMoveHandler = windowDidMoveHandler ?? handle(NSWindowDidMoveNotification)
windowDidMoveHandler = windowDidMoveHandler ?? handle(NSNotification.Name.NSWindowDidMove.rawValue)
{
/* with */ notification in
......@@ -30,7 +30,7 @@ class OSXViewController: NSViewController
}
}
@IBAction func stopHandlingWindowMoves(sender: NSButton)
@IBAction func stopHandlingWindowMoves(_ sender: NSButton)
{
destroyNotificationHandler(&windowDidMoveHandler)
messageLabel.stringValue = "No longer handling notifications."
......
......@@ -111,7 +111,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0720;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = "Aral Balkan";
TargetAttributes = {
A7C0EB221C23513700110179 = {
......@@ -196,8 +196,10 @@
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_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
......@@ -241,8 +243,10 @@
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_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
......@@ -286,6 +290,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "ind.ie.HandleDemo-iOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
};
name = Release;
......
......@@ -23,7 +23,7 @@ class ViewController: UIViewController
{
super.viewDidLoad()
orientationWillChangeHandler = orientationWillChangeHandler ?? handle(NSNotification.Name.UIApplicationWillChangeStatusBarOrientation.rawValue)
orientationWillChangeHandler = orientationWillChangeHandler ?? handle(Notification.Name.UIApplicationWillChangeStatusBarOrientation.rawValue)
{
/* with */ notification in
......@@ -46,7 +46,7 @@ class ViewController: UIViewController
orientationLabel.text = "No longer handling notifications."
}
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask
override var supportedInterfaceOrientations: UIInterfaceOrientationMask
{
return .all
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment