 //
 
 import UIKit
-
+import pop
 class EPMComposeView: UIView {
 
+    var target:UIViewController?
+    
     override init(frame: CGRect) {
         super.init(frame: UIScreen.main.bounds)
         setupUI()


            btn.frame = CGRect(x: btnMargine+(btnMargine+btnWidth)*col, y: (btnMargine+btnHeight)*row, width: btnWidth, height: btnHeight+screenHeight)
            btn.composeModel = model
                        btn.addTarget(self, action: #selector(clickBtnAction(btn:)), for: .touchUpOutside)
            addSubview(btn)
        }
        
    }
    
    
}
extension EPMComposeView{

    @objc fileprivate func clickBtnAction(btn:EPMComposeButton) {
        
        
        
        
    }
}




    }()
 
    lazy var imgAds:UIImageView = UIImageView(image: UIImage(named: "compose_slogan"))
    lazy var btnArr:[EPMComposeButton] = [EPMComposeButton]()
}
extension EPMComposeView{
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        btnAnimation(isUP: false)
        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.4) {
            self.removeFromSuperview()
        }
    }
}


//MARKE: 对外接口
extension EPMComposeView{
    
    func showView(target:UIViewController) {
        let composeView = EPMComposeView()
         composeView.target = target
        target.view.addSubview(composeView)
        btnAnimation(isUP: true)
    }
    
}
