             present(imagePickerController, animated: true, completion: nil)
         }
     }
-    
-    //MARK: - UITextViewDelegate
-    
+}
+
+extension MomentPostViewController: UITextViewDelegate {
+
     func textViewDidBeginEditing(_ textView: UITextView) {
         if textView.textColor == UIColor.lightGray {
             textView.text = nil

            fatalError("Expected a dictionary containing an image, but was provided the following: \(info)")
        }
        
        // Add uploaded image to array
        uploadedImages.append(selectedImage)
        
        // Dismiss the picker.
        dismiss(animated: true, completion: nil)
        
        momentImageCollectionView.reloadData()
    }
    
    //MARK: - UICollectionViewDelegate
    
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        
        // response to tapping at the add button

        // Dispose of any resources that can be recreated.
    }
    
    //MARK: - Action
    @IBAction func postButtonTapped(_ sender: UIBarButtonItem) {
        
        logger.log("按下发布（点滴）按钮")
        
        //TODO: Actual send moment post to server
        /*
 MeowAPIProvider.shared.request(.uploadToken)
            .mapTo(type: UploadToken.self)
            .flatMap {
                [weak self]
                (uploadToken) -> Observable<String> in
                Observable.from(uploadedImageUrls)
                .map((url)->String(url))
            }
 */
  
        dismiss(animated: true, completion: nil)
        
    }
    
    @IBAction func cancelButtonTapped(_ sender: UIBarButtonItem) {
        
        logger.log("按下取消（发布点滴）按钮")
        
        dismiss(animated: true, completion: nil)
    }
    
    /*
     // MARK: - Navigation
     
     // In a storyboard-based application, you will often want to do a little preparation before navigation
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
     // Get the new view controller using segue.destinationViewController.
     // Pass the selected object to the new view controller.
     }
     */
}
extension MomentPostViewController: UICollectionViewDataSource {
    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return uploadedImages.count + 1;
    }
