| | |
| | | |
| | | class TreeTeskExchangeSuccessView: UIView,JQNibView{ |
| | | @IBOutlet weak var view_container: UIView! |
| | | |
| | | @IBOutlet weak var image_qrCode: UIImageView! |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | | view_container.transform = .init(scaleX: 0.1, y: 0.1) |
| | | alpha = 0 |
| | | |
| | | let longPress = UILongPressGestureRecognizer(target: self, action: #selector(longPressCopyAction(_:))) |
| | | longPress.minimumPressDuration = 0.8 |
| | | image_qrCode.isUserInteractionEnabled = true |
| | | image_qrCode.addGestureRecognizer(longPress) |
| | | } |
| | | |
| | | static func show(){ |
| | |
| | | } |
| | | } |
| | | |
| | | @objc private func longPressCopyAction(_ gesture:UILongPressGestureRecognizer){ |
| | | if gesture.state == .began{ |
| | | if let img = image_qrCode.image{ |
| | | image_qrCode.isUserInteractionEnabled = false |
| | | UIImageWriteToSavedPhotosAlbum(img, nil,nil, nil) |
| | | alertSuccess(msg: "保存成功") |
| | | } |
| | | } |
| | | } |
| | | |
| | | @IBAction func closeAction(_ sender: UIButton) { |
| | | UIView.animate(withDuration: 0.3) { |
| | | self.view_container.transform = .init(scaleX: 0.1, y: 0.1) |