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
import AVFoundation | |
import UIKit | |
class ScannerViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate { | |
var captureSession: AVCaptureSession! | |
var previewLayer: AVCaptureVideoPreviewLayer! | |
override func viewDidLoad() { | |
super.viewDidLoad() |
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
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
Parse.enableLocalDatastore() | |
Parse.setApplicationId("asd", | |
clientKey: "asdasd") | |
let completionBlock: () -> Void = { |
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
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 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
// | |
// FacebookSocialMediaManager.swift | |
// | |
// | |
// Created by Erison Veshi<Bashta> on 2/25/16. | |
// | |
import FBSDKCoreKit | |
import FBSDKLoginKit | |
import Parse |
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
import UIKit | |
final class SignUpViewController: UIViewController { | |
static let storybuardId = "signUpViewController" | |
@IBOutlet private weak var signUpButton: UIButton? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
setupUI() |
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
public protocol HasAsoluteValue { | |
func absolute() -> Self | |
} | |
public func test<T: HasAsoluteValue>(x: T) -> T { | |
return x.absolute() | |
} |
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
Parse.Cloud.job("incomingEventNotification", function () { | |
Parse.Cloud.useMasterKey(); | |
var query = new Parse.Query("Event"); | |
query.greaterThan("limit", 1); | |
query.equalTo("notifiedAboutUpcomingEvent", false); | |
query.find().then(function(results) { | |
//get the event | |
for (var event in results) { |
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
func createNewChatSessionForCurrentUser(otherUserId: String) -> String? { | |
guard let currentUserUsername = Backendless.sharedInstance().userService.currentUser.name else { | |
return nil | |
} | |
let chatId = Backendless.sharedInstance().randomString(36) | |
let curentUserChatDictionary = ["groupChat" : false, "singleChatMember" : otherUserId] | |
let otherUserChatDictionary = ["groupChat" : false, "singleChatMember" : currentUserUsername] | |
let chatDictionary = [otherUserId : 0, currentUserUsername : 0] | |
let chatIdDictionary = ["chatId" : chatId] |
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
let userProfileRequestParams = [ "fields" : "id, gender, name, picture, about"] | |
let userProfileRequest = FBSDKGraphRequest(graphPath: "me", parameters: userProfileRequestParams) | |
let graphConnection = FBSDKGraphRequestConnection() | |
graphConnection.addRequest(userProfileRequest, completionHandler: { (connection: FBSDKGraphRequestConnection!, result: AnyObject!, error: NSError!) -> Void in | |
} | |
graphConnection.start() |