         
     }
     
-    //    @IBAction func onLaunchClicked(sender: AnyObject) {
-    //        let acController = GMSAutocompleteViewController()
-    //        acController.delegate = self
-    //        self.presentViewController(acController, animated: true, completion: nil)
-    //    }
-    
+    // MARK: View Life Cycle
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        
+        self.tableView.dataSource = self
+        self.tableView.delegate = self
+        
+        
+        // Country Picker
+        for code in NSLocale.ISOCountryCodes() as [String] {
+            
+            let name = NSLocale.currentLocale().displayNameForKey(NSLocaleCountryCode, value: code) ?? "Country not found for code: \(code)"
+            
+            countryArray.append(name)
+            countryArray.sortInPlace({ ( name1, name2) -> Bool in
+                name1 < name2
+            })
+            
+        }
+        
+        
+        
+        // Picker View UI
+        setUpPickerViewUI()
+        
+        saveButton.enabled = false
+        
+        // Longpress to Reorder Cell
+        let longpress = UILongPressGestureRecognizer(target: self, action: #selector(AddViewController.longPressGestureRecognized(_:)))
+        tableView.addGestureRecognizer(longpress)
+        
+    }
+    
+    // MARK: Function
     func onLaunchClicked(sender: UIButton) {
         
         if let sender = sender.superview?.superview as? AttractionTableViewCell{

                return cell
            }
            

            
        case .accommodation:
            


            if allArray.count - 1 >= indexPath.row{
                
                let cell = NSBundle.mainBundle().loadNibNamed("AccommodationTableViewCell", owner: UITableViewCell.self, options: nil).first as! AccommodationTableViewCell
                cell.checkinDateTextField.delegate = self

                        
                        // Set the post to be passed to HomeTableViewController after the unwind segue.
                        post = Post(postID: postIDKey, indexPathRow: indexPathRow, title: title, country: country, startDate: startDate, returnDate: returnDate)
                        
                    } else {
                        print("prepareForSegue: title cast wrong")
                        return
                    }
                    
                    //                    // Trip Title Cell
                    //                    let title = cell.titleTextField.text ?? ""
                    //                    let country = cell.countryTextField.text ?? ""
                    //
                    //                    // needs to be re-designed > Date Picker
                    //                    let startDate = cell.startDateTextField.text ?? ""
                    //                    let returnDate = cell.returnDateTextField.text ?? ""
                    //
                    //                    // Store tripTitle in Firebase
                    //                    let titleOnFire: [String: AnyObject] = ["uid": userID!,
                    //                                                            "postID": postIDKey,
                    //                                                            "indexPathRow": indexPathRow,
                    //                                                            "timestamp": timeStamp,
                    //                                                            "title": title,
                    //                                                            "country": country,
                    //                                                            "startDate": startDate,
                    //                                                            "returnDate": returnDate ]
                    //
                    //                    databaseRef.child("posts").child(postIDKey).setValue(titleOnFire)
                    //
                    //                    // Set the post to be passed to HomeTableViewController after the unwind segue.
                    //                    post = Post(postID: postIDKey, indexPathRow: indexPathRow, title: title, country: country, startDate: startDate, returnDate: returnDate)
                    
                case .transportation:
                    
                    let indexPath = NSIndexPath(forRow: index, inSection: 0)
                    let indexPathRow = indexPath.row
                    let transportationIDKey = FIRDatabase.database().reference().childByAutoId().key
                    
                    if let cell = allArray[indexPathRow] as? TransportationTableViewCell {
                        
                        // Transportation Cell
                        let type = cell.typeTextField.text ?? ""
                        let airlineCom = cell.airlineComTextField.text ?? ""
                        let flightNo = cell.flightNoTextField.text ?? ""
                        let bookingRef = cell.bookingRefTextField.text ?? ""
                        let departFrom = cell.departFromTextField.text ?? ""
                        let arriveAt = cell.arriveAtTextField.text ?? ""
                        let departDate = cell.departDateTextField.text ?? ""
                        let arriveDate = cell.arriveDateTextField.text ?? ""
                        
                        let transportationOnFire: [String: AnyObject] = [ "uid": userID!,
                                                                          "postID": postIDKey,
                                                                          "transportationID": transportationIDKey,
                                                                          "indexPathRow": indexPathRow,
                                                                          "timestamp": timeStamp,
                                                                          "type": type,
                                                                          "airlineCom": airlineCom,
                                                                          "flightNo": flightNo,
                                                                          "bookingRef": bookingRef,
                                                                          "departFrom": departFrom,
                                                                          "arriveAt": arriveAt,
                                                                          "departDate": departDate,
                                                                          "arriveDate": arriveDate ]
                        
                        databaseRef.child("transportations").child(transportationIDKey).setValue(transportationOnFire)
                        
                    } else {
                        
                        print("prepareForSegue: TransportationTableViewCell cast wrong")
                        return
                    }
                    
                case .attraction:
                    
