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

    @IBOutlet weak var txtIncompleteFieldsMessage: UILabel!
    
    
    @IBAction func submitStoryfields(sender: AnyObject) {
        var themeEntered = theme.text
        var clipDurationEntered = clipDuration.text.toInt()
        var numOfClipsEntered = numOfClips.text.toInt()
        
        func createStory(){
            var currentUser = PFUser.currentUser()
            
            var story = PFObject(className: "Story")
            story["theme"] = themeEntered
            story["clipDuration"] = clipDurationEntered
            story["numOfClips"] = numOfClipsEntered
            story["owner"] = currentUser.username
            story["sender"] = currentUser.username
            story["receiver"] = ""
            story.addUniqueObjectsFromArray([url], forKey:"videos")
            
            story.saveInBackgroundWithBlock {
                (success: Bool, error: NSError!) -> Void in
                if (success) {
                    println("Sucessfully saved story")
                } else {
                    println("Story did not save")
                }
            }
        }
        
        if themeEntered != "" && clipDurationEntered != nil && numOfClipsEntered != nil {
            createStory()
            self.navigationController?.popToRootViewControllerAnimated(true)
        } else {
            self.txtIncompleteFieldsMessage.text = "All Fields Required"


import UIKit

class PerspectiveFieldsVC: UIViewController, UITextFieldDelegate {
    
    @IBOutlet weak var theme: UITextField!
    @IBOutlet weak var numOfClips: UITextField!
    @IBOutlet weak var searchFriends: UISearchBar!
    var url: String!
