Several error's in Swift 3 Project, : The four error's I get are 

1:     // Use of undeclared type 'MemeImage'
        Line 46

2:     // Binary Operator '*' cannot be applied to operands of type '()' and 'Int'
        Line 85

3:        // Unexpected non-void return value in void function
        Line 113

4:        // Use of local variable 'makeMemedImage' before its declaration 
         Line 169

import UIKit

class ViewController: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UITextFieldDelegate {

    // Top of the storyboard
    @IBOutlet weak var topBar: UIToolbar!
    @IBOutlet weak var shareBtn: UIBarButtonItem!
    @IBOutlet weak var cancelBtn: UIBarButtonItem!
    
    // Middle of the storyboard
    @IBOutlet weak var topTextField: UITextField!
    @IBOutlet weak var imageView: UIImageView!
    @IBOutlet weak var bottomTextField: UITextField!
    
    // Bottom of the storyboard
    @IBOutlet weak var bottomBar: UIToolbar!
    @IBOutlet weak var cameraBtn: UIBarButtonItem!
    @IBOutlet weak var albumBtn: UIBarButtonItem!
    
    
    // text attributes
    let topTextDefault = "TOP TEXT"
    let bottomTextDefault = "BOTTOM TEXT"
    let noText = ""
    
    let topTextDelegate = TopTextDelegate()
    let bottomTextDelegate = BottomTextDelegate()
    
    
    // meme attributes
    let memeTextAttributes:[String: Any] = [NSStrokeColorAttributeName: UIColor.black, NSForegroundColorAttributeName: UIColor.white, NSFontAttributeName: UIFont( name: "HelveticaNeue-CondensedBlack", size: 40 )!, NSStrokeWidthAttributeName: NSNumber( value: -4.0 )]

    
    var isKeyboardVisible = false
    
    
    // Use of undeclared type 'MemeImage'
    var meme: MemeImage!
    


    override func viewDidLoad() {
        super.viewDidLoad()
        
        imageView.contentMode = UIViewContentMode.scaleAspectFit
        
    }
    
    
    override func viewDidAppear(_ animated: Bool) {
        cameraBtn.isEnabled = UIImagePickerController.isSourceTypeAvailable(.camera)
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.subscribeToKeyboardNotifications()
    }
    
    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
        unsubscribeFromKeyboardNotifications()
    }
    
    func initTextFields(textField: UITextField, initialText: String, delegate: UITextFieldDelegate) {
        
        textField.defaultTextAttributes = memeTextAttributes
        textField.textAlignment = NSTextAlignment.center
        textField.text = initialText
        textField.delegate = delegate
        
    }
    
    func keyboardWillShow(_ notification:Notification) {
        if bottomTextField.isFirstResponder {
            
            // Binary Operator '*' cannot be applied to operands of ttype '()' and 'Int' -----------
            view.frame.origin.y = getKeyboardHeight(notification) * -1
            
            
        }
    }
    
    func keyboardWillHide(_ notification:Notification) {
        if bottomTextField.isFirstResponder {
            view.frame.origin.y = 0.0
        }
    }
    
    func subscribeToKeyboardNotifications() {
        NotificationCenter.default.addObserver( self, selector: #selector(keyboardWillShow(_:)), name: .UIKeyboardWillShow, object: nil )
        
        NotificationCenter.default.addObserver( self, selector: #selector(keyboardWillHide(_:)), name: .UIKeyboardWillHide, object: nil )
    }
    
    func unsubscribeFromKeyboardNotifications() {
        NotificationCenter.default.removeObserver( self, name: .UIKeyboardWillShow, object: nil )
        NotificationCenter.default.removeObserver( self, name: .UIKeyboardWillHide, object: nil )
    }
    
    func getKeyboardHeight(_ notification:Notification) {
        let userInfo = notification.userInfo
        let keyboardSize = userInfo![UIKeyboardFrameEndUserInfoKey] as! NSValue
        
        // Unexpected non-void return value in void function---------
        return keyboardSize.cgRectValue.height

    }
    
    func imagePickCancel(_ picker: UIImagePickerController) {
        dismiss(animated: true, completion: nil)
    }
    
    func imageWasPicked(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
        if let image = info[UIImagePickerControllerOriginalImage] as? UIImage {
                imageView.contentMode = .scaleAspectFit
                imageView.image = image
                shareBtn.isEnabled = true
                cancelBtn.isEnabled = true
            
        } else {
            dismiss(animated: true, completion: nil)
        }
    }
    
    func pickImageType(sourceType: UIImagePickerControllerSourceType) {
        
        let pickerController = UIImagePickerController()
        pickerController.delegate = self
        pickerController.sourceType = sourceType
        
        self.present( pickerController, animated: true, completion: nil)
        
    }
    
    @IBAction func getImageFromCamera(_ sender: Any) {
        
        pickImageType(sourceType: UIImagePickerControllerSourceType.camera)
        
    }
    
    @IBAction func getImageFromAlbum(_ sender: Any) {
        
        pickImageType(sourceType: UIImagePickerControllerSourceType.photoLibrary)
        
    }
    
    @IBAction func cancel(_ sender: Any) {
        
        shareBtn.isEnabled = false
        imageView.image = nil
        topTextField.text = topTextDefault
        bottomTextField.text = bottomTextDefault
        
        meme = nil
        
    }
    
    @IBAction func share(_ sender: Any) {
        
        // Use of local variable 'makeMemedImage' before its declaration ------------
        let memedImage = makeMemedImage()
        let socialController = UIActivityViewController( activityItems: [memedImage], applicationActivities: nil )
        socialController.completionWithItemsHandler = {
            
            UIActivityType, completion, items, error in
            
            if completion {
                
                self.saveMemedImage(memedImage: memedImage) {
                }
                } else {
                    self.dismiss( animated: true, completion: nil )
                }
            self.present(socialController, animated: true, completion: nil)
            
            }
        
        func makeMemedImage() -> UIImage {
            
            topBar.isHidden = true
            bottomBar.isHidden = true
            
            UIGraphicsBeginImageContext(self.view.frame.size)
            view.drawHierarchy( in: self.view.frame, afterScreenUpdates: true )
            let memedImage:UIImage = UIGraphicsGetImageFromCurrentImageContext()!
            UIGraphicsEndImageContext()
            
            topBar.isHidden = false
            bottomBar.isHidden = false
            
            return memedImage
        }
        
        func save() {
            self.meme = memedImage.init(topText: self.txtTop.text!, bottomText: self.txtBottom.text!, origImage: self.imgView.image!, memedImage: memedImage)

        }

        
        }
        
    }
