     
     var textViewIsShowing: Bool?
     
-    override public func viewDidLoad() {
+    override open func viewDidLoad() {
         super.viewDidLoad()
         setup()
-        self.view.backgroundColor = UIColor.clearColor()
-        self.navigationController?.navigationBarHidden = true
+        self.view.backgroundColor = UIColor.clear
+        self.navigationController?.isNavigationBarHidden = true
     }
     
     /// Set up the view
-    private func setup() {
-        
-        imageView = UIImageView(frame: UIScreen.mainScreen().bounds)
+    fileprivate func setup() {
+        
+        imageView = UIImageView(frame: UIScreen.main.bounds)
         imageView?.image = self.image
-        imageView?.autoresizingMask = UIViewAutoresizing([.FlexibleWidth, .FlexibleHeight])
-        imageView?.contentMode = UIViewContentMode.Center
+        imageView?.autoresizingMask = UIViewAutoresizing([.flexibleWidth, .flexibleHeight])
+        imageView?.contentMode = UIViewContentMode.center
         self.view.addSubview(imageView!)
         
         drawView = ButterflyDrawView()


extension ButterflyViewController: ButterflyDrawViewDelegate {

    func drawViewDidEndDrawingInView(drawView: ButterflyDrawView?) {
        topBar?.show()
        bottomBar?.show()
    }
    
    func drawViewDidStartDrawingInView(drawView: ButterflyDrawView?) {
        topBar?.hide()
        bottomBar?.hide()
    }

        bottomBar = ButterflyBottomBar()
        self.view.addSubview(bottomBar!)
        
        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)
    }

    @objc open func cancelButtonPressed(_ sender: UIButton?) {
        drawView?.enable()
        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.
    @objc open func sendButtonPressed(_ sender: UIButton?) {
        drawView?.enable()
        delegate?.ButterflyViewControllerDidPressedSendButton(drawView)
        imageWillUpload = ButterflyManager.sharedManager.takeScreenshot()
