     
     var posts = [Post]()
     var imagePicker: UIImagePickerController!
-    static var imageCache: NSCache<NSString, UIImage> = NSCache()    
+    static var imageCache: NSCache<NSString, UIImage> = NSCache()
+    var imageSelected = false
+    
     override func viewDidLoad() {
         super.viewDidLoad()
         

    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
        if let image = info[UIImagePickerControllerEditedImage] as? UIImage {
            imageAdd.image = image
        } else {
            print("-----: A valid image wasn't selected.")
        }

            print("-----: Text must be entered.")
            return
        }
        guard let img = imageAdd.image, imageSelected == true else {
            print("-----: An image must be selected.")
            return
        }
