      
     }
     
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        // Do any additional setup after loading the view.
-        println("the url is: \(self.url)")
-    }
-    
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-        // Dispose of any resources that can be recreated.
+    func createNotification(perspectiveId: String) {
+        var notification = PFObject(className: "Notification")
+        notification["fromUser"] = PFUser.currentUser().username
+        notification["toUser"] = "darrin"
+        notification["notificationType"] = "invite"
+        notification["perspectiveId"] = perspectiveId
+        notification.saveInBackgroundWithBlock {
+            (success: Bool, error: NSError!) -> Void in
+            if (success) {
+                println("Sucessfully saved Notification")
+            } else {
+                println("Notification did not save")
+            }
+        }
     }
     
     func textFieldShouldReturn(textField: UITextField) -> Bool {

        return true;
    }
    
    override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
        theme.endEditing(true)
        numOfClips.endEditing(true)
    }

    /*
    // MARK: - Navigation

    @IBOutlet weak var searchFriends: UISearchBar!
    @IBOutlet weak var submit: UIButton!
    var url: String!
    var toUser: String!

    @IBOutlet weak var txtIncompleteFieldsMessage: UILabel!
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
        theme.endEditing(true)
        numOfClips.endEditing(true)
    }
    
    @IBAction func submitPerspectiveFields(sender: AnyObject) {
        var themeEntered = theme.text
        var numOfClipsEntered = numOfClips.text.toInt()
        
        func createPerspective(){
            var perspective = PFObject(className: "Perspective")
            perspective["theme"] = themeEntered
            perspective["numOfClips"] = numOfClipsEntered
            perspective["collaborators"] = [PFUser.currentUser().username]
            perspective["videos"] = [url]
            
            perspective.saveInBackgroundWithBlock {
                (success: Bool, error: NSError!) -> Void in
                if (success) {
                    var perspectiveId = perspective.objectId
                    self.createNotification(perspectiveId)
                    println("Sucessfully saved Perspective")
                } else {
                    println("Perspective did not save")
