Updating ActivityFeed sample app with fixes for Swift 3.0
Project: http://git-wip-us.apache.org/repos/asf/usergrid-swift/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid-swift/commit/28ff0e27 Tree: http://git-wip-us.apache.org/repos/asf/usergrid-swift/tree/28ff0e27 Diff: http://git-wip-us.apache.org/repos/asf/usergrid-swift/diff/28ff0e27 Branch: refs/heads/master Commit: 28ff0e275b5bd7777a2b927da5d5cf1cb4b660ab Parents: f120900 Author: Robert Walsh <rjwalsh1...@gmail.com> Authored: Fri Sep 16 10:30:22 2016 -0500 Committer: Robert Walsh <rjwalsh1...@gmail.com> Committed: Fri Sep 16 10:30:22 2016 -0500 ---------------------------------------------------------------------- Samples/ActivityFeed/Source/UsergridManager.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/usergrid-swift/blob/28ff0e27/Samples/ActivityFeed/Source/UsergridManager.swift ---------------------------------------------------------------------- diff --git a/Samples/ActivityFeed/Source/UsergridManager.swift b/Samples/ActivityFeed/Source/UsergridManager.swift index 7130490..b72d46e 100644 --- a/Samples/ActivityFeed/Source/UsergridManager.swift +++ b/Samples/ActivityFeed/Source/UsergridManager.swift @@ -40,23 +40,23 @@ public class UsergridManager { ActivityEntity.registerSubclass() } - static func loginUser(_ username:String, password:String, completion:UsergridUserAuthCompletionBlock) { + static func loginUser(_ username:String, password:String, completion:@escaping UsergridUserAuthCompletionBlock) { let userAuth = UsergridUserAuth(username: username, password: password) Usergrid.authenticateUser(userAuth, completion: completion) } - static func createUser(_ name:String, username:String, email:String, password:String, completion:UsergridResponseCompletion) { + static func createUser(_ name:String, username:String, email:String, password:String, completion:@escaping UsergridResponseCompletion) { let user = UsergridUser(name: name, propertyDict: [UsergridUserProperties.username.stringValue:username, UsergridUserProperties.email.stringValue:email, UsergridUserProperties.password.stringValue:password]) user.create(completion) } - static func getFeedMessages(_ completion:UsergridResponseCompletion) { + static func getFeedMessages(_ completion:@escaping UsergridResponseCompletion) { Usergrid.GET(UsergridQuery("users/me/feed").desc(UsergridEntityProperties.created.stringValue), queryCompletion: completion) } - static func postFeedMessage(_ text:String,completion:UsergridResponseCompletion) { + static func postFeedMessage(_ text:String,completion:@escaping UsergridResponseCompletion) { let currentUser = Usergrid.currentUser! let verb = "post" @@ -72,7 +72,7 @@ public class UsergridManager { Usergrid.POST("users/me/activities", jsonBody: ["actor":actorDictionary,"verb":verb,"content":content], completion: completion) } - static func followUser(_ username:String, completion:UsergridResponseCompletion) { + static func followUser(_ username:String, completion:@escaping UsergridResponseCompletion) { Usergrid.connect("users", entityID: "me", relationship: "following", toType: "users", toName: username, completion: completion) } }