This file contains hidden or 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
| class Employee: NSManagedObject { | |
| init(context: NSManagedObjectContext, | |
| name: String, | |
| dateOfBirth: NSDate, | |
| salary: NSDecimalNumber, | |
| employeeId: String = NSUUID().UUIDString, | |
| email: String? = nil, | |
| address: String? = nil) { | |
| // init | |
| } |
This file contains hidden or 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
| // Examples | |
| /* | |
| let lock = NSLock() | |
| synchronized(lock) { | |
| println("This is synchronized") | |
| } | |
| let result: String = synchronizedResult(lock) { |
This file contains hidden or 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 String { | |
| subscript (i: Int) -> Character { | |
| return self[self.startIndex.advancedBy(i)] | |
| } | |
| subscript (i: Int) -> String { | |
| return String(self[i] as Character) | |
| } |
This file contains hidden or 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
| Parse.Cloud.define("sendMessage", function(request, response) { | |
| var senderProfileId = request.user.get("profile").id; | |
| var Message = Parse.Object.extend("Message"); | |
| var messageObject = new Message(); | |
| var recipientProfileId = request.params.receiverId; | |
| var messageText = request.params.message; | |
| messageObject.set("senderId", senderProfileId); | |
| messageObject.set("receiverId", recipientProfileId); | |
| messageObject.set("message", messageText); | |
| messageObject.set("isSeen", false); |
This file contains hidden or 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
| func fetchUserFriendsList() { | |
| FBSDKGraphRequest(graphPath: "/me/taggable_friends", parameters: ["fields":"id", "limit": 5000]).startWithCompletionHandler({ connection, results, error in | |
| guard let resutlsDictionary = results as? NSDictionary, | |
| let friends = resutlsDictionary.valueForKey("data") as? [NSDictionary] else { | |
| return | |
| } | |
| var friendsArray:[String] = [] | |
| for friend in friends { |
This file contains hidden or 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
| /** | |
| Custom setup fot the TermsAndPolicyLabel | |
| - Parameter label: The FRHyperLabel that will be customized. | |
| - Parameter navigationController: The navigation controller that will present the web view. | |
| - Parameter storyboard: The storybuard where the UIView is located. | |
| */ |
This file contains hidden or 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
| import UIKit | |
| import ParseFacebookUtilsV4 | |
| import FBSDKCoreKit | |
| import Parse | |
| @UIApplicationMain | |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| var window: UIWindow? |
This file contains hidden or 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 DataManager { | |
| //MARK: - Helpers | |
| /** | |
| Set the messages with given user as seen. | |
| - Parameter userProfileId: The profile id of the user with whom the message have to be set as seen. | |
| */ | |
| func setMessagesWithCurrentUserAsSeen(userProfileId: String) { |
This file contains hidden or 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
| final class InteractiveSwipe: UIPercentDrivenInteractiveTransition { | |
| var panGesture: UIPanGestureRecognizer? | |
| weak var viewController: UIViewController? | |
| private var shouldComplete = true | |
| func attachToViewController(viewController: UIViewController) { | |
| self.viewController = viewController | |
| panGesture = UIPanGestureRecognizer(target:self, action: "onPan:") |
This file contains hidden or 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
| // | |
| // UIImageExtensions.swift | |
| // Dating | |
| // | |
| // Created by Erison on 1/28/16. | |
| // Copyright © 2016 Yuriy Berdnikov. All rights reserved. | |
| // | |
| import UIKit |