         bottomBar = ButterflyBottomBar()
         self.view.addSubview(bottomBar!)
         
-        topBar?.sendButton?.addTarget(self, action: #selector(sendButtonPressed), forControlEvents: UIControlEvents.TouchUpInside)
-        topBar?.cancelButton?.addTarget(self, action: #selector(cancelButtonPressed), forControlEvents: UIControlEvents.TouchUpInside)
-        bottomBar?.colorChangedButton?.addTarget(self, action: #selector(colorChangedButtonPressed), forControlEvents: UIControlEvents.TouchUpInside)
-        bottomBar?.descriptionButton?.addTarget(self, action: #selector(inputDescriptionButtonPressed), forControlEvents: UIControlEvents.TouchUpInside)
-        bottomBar?.clearPathButton?.addTarget(self, action: #selector(clearButtonPressed), forControlEvents: UIControlEvents.TouchUpInside)
+        topBar?.sendButton?.addTarget(self, action: #selector(sendButtonPressed), for: UIControlEvents.touchUpInside)
+        topBar?.cancelButton?.addTarget(self, action: #selector(cancelButtonPressed), for: UIControlEvents.touchUpInside)
+        bottomBar?.colorChangedButton?.addTarget(self, action: #selector(colorChangedButtonPressed), for: UIControlEvents.touchUpInside)
+        bottomBar?.descriptionButton?.addTarget(self, action: #selector(inputDescriptionButtonPressed), for: UIControlEvents.touchUpInside)
+        bottomBar?.clearPathButton?.addTarget(self, action: #selector(clearButtonPressed), for: UIControlEvents.touchUpInside)
         
         textView.delegate = self
         view.addSubview(self.textView)
     }
 
-    public func cancelButtonPressed(sender: UIButton?) {
+    @objc open func cancelButtonPressed(_ sender: UIButton?) {
         drawView?.enable()
-        dismissViewControllerAnimated(false, completion: nil)
+        dismiss(animated: false, completion: nil)
     }
     
     /// Note: Always access or upload `imageWillUpload` and `textWillUpload` only after send button has been pressed, otherwise, these two optional properties may be nil.
     /// After that, you can upload image and text manually and properly.
-    public func sendButtonPressed(sender: UIButton?) {
+    @objc open func sendButtonPressed(_ sender: UIButton?) {
         drawView?.enable()
         delegate?.ButterflyViewControllerDidPressedSendButton(drawView)
         imageWillUpload = ButterflyManager.sharedManager.takeScreenshot()

        textWillUpload = textView.text
    }
    
    public func textView(textView: UITextView, shouldChangeTextInRange range: NSRange, replacementText text: String) -> Bool {
        if text == "\n" {
            textView.resignFirstResponder()
            return false


protocol ButterflyViewControllerDelegate: class {
    
    func ButterflyViewControllerDidPressedSendButton(_ drawView: ButterflyDrawView?)
}

/// This is the viewController combined Butterfly modules.
open class ButterflyViewController: UIViewController {
    
    /// The image reported by users that will upload to server.
    internal var imageWillUpload: UIImage?
