Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

Commit

Permalink
swift 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-dumit committed Mar 22, 2016
1 parent 38c92be commit 68fc174
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions PermissionScope/PermissionScope.swift
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ typealias resultsForConfigClosure = ([PermissionResult]) -> Void
baseView.frame = view.frame
baseView.addSubview(contentView)
if backgroundTapCancels {
let tap = UITapGestureRecognizer(target: self, action: Selector("cancel"))
let tap = UITapGestureRecognizer(target: self, action: #selector(PermissionScope.cancel))
tap.delegate = self
baseView.addGestureRecognizer(tap)
}
Expand Down Expand Up @@ -202,7 +202,7 @@ typealias resultsForConfigClosure = ([PermissionResult]) -> Void

// close button
closeButton.setTitle("Close".localized, forState: .Normal)
closeButton.addTarget(self, action: Selector("cancel"), forControlEvents: UIControlEvents.TouchUpInside)
closeButton.addTarget(self, action: #selector(PermissionScope.cancel), forControlEvents: UIControlEvents.TouchUpInside)

contentView.addSubview(closeButton)

Expand Down Expand Up @@ -574,7 +574,7 @@ typealias resultsForConfigClosure = ([PermissionResult]) -> Void
name: UIApplicationWillResignActiveNotification,
object: nil)
NSNotificationCenter.defaultCenter().addObserver(self,
selector: Selector("finishedShowingNotificationPermission"),
selector: #selector(PermissionScope.finishedShowingNotificationPermission),
name: UIApplicationDidBecomeActiveNotification, object: nil)
notificationTimer?.invalidate()
}
Expand Down Expand Up @@ -630,9 +630,9 @@ typealias resultsForConfigClosure = ([PermissionResult]) -> Void
.first { $0 is NotificationsPermission } as? NotificationsPermission
let notificationsPermissionSet = notificationsPermission?.notificationCategories

NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("showingNotificationPermission"), name: UIApplicationWillResignActiveNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(PermissionScope.showingNotificationPermission), name: UIApplicationWillResignActiveNotification, object: nil)

notificationTimer = NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: Selector("finishedShowingNotificationPermission"), userInfo: nil, repeats: false)
notificationTimer = NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: #selector(PermissionScope.finishedShowingNotificationPermission), userInfo: nil, repeats: false)

UIApplication.sharedApplication().registerUserNotificationSettings(
UIUserNotificationSettings(forTypes: [.Alert, .Sound, .Badge],
Expand Down Expand Up @@ -1140,7 +1140,7 @@ typealias resultsForConfigClosure = ([PermissionResult]) -> Void
alert.addAction(UIAlertAction(title: "Show me".localized,
style: .Default,
handler: { action in
NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("appForegroundedAfterSettings"), name: UIApplicationDidBecomeActiveNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(PermissionScope.appForegroundedAfterSettings), name: UIApplicationDidBecomeActiveNotification, object: nil)

let settingsUrl = NSURL(string: UIApplicationOpenSettingsURLString)
UIApplication.sharedApplication().openURL(settingsUrl!)
Expand Down Expand Up @@ -1174,7 +1174,7 @@ typealias resultsForConfigClosure = ([PermissionResult]) -> Void
alert.addAction(UIAlertAction(title: "Show me".localized,
style: .Default,
handler: { action in
NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("appForegroundedAfterSettings"), name: UIApplicationDidBecomeActiveNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(PermissionScope.appForegroundedAfterSettings), name: UIApplicationDidBecomeActiveNotification, object: nil)

let settingsUrl = NSURL(string: UIApplicationOpenSettingsURLString)
UIApplication.sharedApplication().openURL(settingsUrl!)
Expand Down

0 comments on commit 68fc174

Please sign in to comment.