Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ind.ie Projects
Handle
Commits
9902025b
Commit
9902025b
authored
Aug 14, 2016
by
Aral Balkan
Browse files
Update to Xcode Beta 5
parent
7693664d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Handle/Handle.xcodeproj/xcshareddata/xcschemes/Handle.xcscheme
View file @
9902025b
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"0
73
0"
LastUpgradeVersion =
"0
80
0"
version =
"1.3"
>
<BuildAction
parallelizeBuildables =
"YES"
...
...
Handle/Handle/Handle.swift
View file @
9902025b
...
...
@@ -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
)
}
...
...
Handle/Handle/NSNotificationCenterExtensions.swift
View file @
9902025b
...
...
@@ -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
}
...
...
HandleDemo-OSX/HandleDemo-OSX.xcodeproj/project.pbxproj
View file @
9902025b
...
...
@@ -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.1
1
;
MACOSX_DEPLOYMENT_TARGET
=
10.1
2
;
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.1
1
;
MACOSX_DEPLOYMENT_TARGET
=
10.1
2
;
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 */
};
...
...
HandleDemo-OSX/HandleDemo-OSX/AppDelegate.swift
View file @
9902025b
...
...
@@ -13,11 +13,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
func
applicationDidFinishLaunching
(
aNotification
:
NS
Notification
)
{
func
applicationDidFinishLaunching
(
_
aNotification
:
Notification
)
{
// Insert code here to initialize your application
}
func
applicationWillTerminate
(
aNotification
:
NS
Notification
)
{
func
applicationWillTerminate
(
_
aNotification
:
Notification
)
{
// Insert code here to tear down your application
}
...
...
HandleDemo-OSX/HandleDemo-OSX/OSXViewController.swift
View file @
9902025b
...
...
@@ -20,7 +20,7 @@ class OSXViewController: NSViewController
{
super
.
viewDidLoad
()
windowDidMoveHandler
=
windowDidMoveHandler
??
handle
(
NSWindowDidMove
Notification
)
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."
...
...
HandleDemo-iOS/HandleDemo-iOS.xcodeproj/project.pbxproj
View file @
9902025b
...
...
@@ -111,7 +111,7 @@
isa
=
PBXProject
;
attributes
=
{
LastSwiftUpdateCheck
=
0720
;
LastUpgradeCheck
=
0
72
0
;
LastUpgradeCheck
=
0
80
0
;
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
;
...
...
HandleDemo-iOS/HandleDemo-iOS/ViewController.swift
View file @
9902025b
...
...
@@ -23,7 +23,7 @@ class ViewController: UIViewController
{
super
.
viewDidLoad
()
orientationWillChangeHandler
=
orientationWillChangeHandler
??
handle
(
NS
Notification
.
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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment