         descriptionTextField.attributedPlaceholder = NSAttributedString(string: "Give a short description if you like", attributes: [NSForegroundColorAttributeName : UIColor.whiteColor()])
     }
     
-    func uploadCollection() {
-        
-        // prevent user from interacting with the app during creation of the cliq
-        UIApplication.sharedApplication().beginIgnoringInteractionEvents()
-        
-        // superimpose a spinning indicator while the cliq is being created
-        var activityIndicator : UIActivityIndicatorView = UIActivityIndicatorView(frame: CGRectMake(0, 0, 50, 50)) as UIActivityIndicatorView
-        activityIndicator.center = self.view.center
-        activityIndicator.hidesWhenStopped = true
-        activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge
-        view.addSubview(activityIndicator)
-        activityIndicator.startAnimating()
-        
-        // TODO: once cliq is created, revert user to home view controller
-        
-        var cliq = self.cliqGroup!
-        cliq["collectionName"] = nameCollectionTextField.text
-        cliq["description"] = descriptionTextField.text
-        cliq["private"] = privateCollectionSwitch.on
-        cliq["customDateTime"] = customDateTimeSwitch.on
-        cliq["inviteFriends"] = inviteFriendsAtLocationSwitch.on
-        cliq.saveInBackground()
-        
-        // [Anar] Upload photo and associated data to Parse
-        
-        var userPhoto : PFObject
-        
-        if let image = imageForCoverPhoto {
-            let imageData = UIImageJPEGRepresentation(image, 0.55)
-            let imageFile = PFFile(name: "image.jpeg", data: imageData)
-            userPhoto = PFObject(className: "UserPhoto")
+    func uploadPhotos() {
+        
+        for userPhoto in userPhotos {
+            
+//            let imageData = UIImageJPEGRepresentation(image, 0.55)
+//            let imageFile = PFFile(name: "image.jpeg", data: imageData)
             
             let user = PFUser.currentUser()! as PFObject
+            
+            
+            // TODO: [Anar] give each photo the cliqAlbum to which it belongs
+            var cliq = self.cliqGroup!
             
             userPhoto["creator"] = PFUser.currentUser()
             userPhoto["cliqGroup"] = cliq // [Anar] Pointer to the cliqGroup to which the photo belongs
-            userPhoto["imageFile"] = imageFile // [Anar] Save as binary on Parse
             userPhoto.saveInBackgroundWithBlock({ (success, error) -> Void in
                 if (success) {
                     println("Saved photo successfully")

                                var listPhotosVC : CliqListPhotosViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("ListPhotosVC") as! CliqListPhotosViewController
                                listPhotosVC.cliqId = cliq.objectId!
                                
                                let navController : UINavigationController = self.navigationController!
                                navController.popToRootViewControllerAnimated(false)
                                navController.pushViewController(listPhotosVC, animated: false) // [Anar] play around with true/false to your liking
                                
                            } else {
                                

    
    var userPhotos = [PFObject]()
    
    var activityIndicator : UIActivityIndicatorView?
    
    override func viewDidLoad() {
        
        coverPhotoImageView.image = imageForCoverPhoto
