Created
January 27, 2017 13:02
-
-
Save leoneparise/fee982fa247217f20dbcb99c551edc96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Notifications { | |
struct openUserProfile:NotificationType { | |
var userId:String | |
static var name: Notification.Name { | |
return Notification.Name(“LP_openUserProfile”) | |
} | |
var name:Notification.Name { | |
return openUserProfile.name | |
} | |
var userInfo: [String : Any] { | |
return [ “userId” : userId] | |
} | |
init(userId: String) { | |
self.userI = userId | |
} | |
init?(notification: Notification?) { | |
guard | |
let name = notification?.name, | |
let userId = notification?.userInfo?[“userId”] as? String, | |
name == openUserProfile.name | |
else { return nil } | |
self.userId = userId | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment