| | |
| | | self.image_qrCode.image = self.customerImage |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | let longPress = UILongPressGestureRecognizer(target: self, action: #selector(longPressCopyAction(_:))) |
| | | longPress.minimumPressDuration = 0.8 |
| | | image_qrCode.isUserInteractionEnabled = true |
| | | image_qrCode.addGestureRecognizer(longPress) |
| | | } |
| | | |
| | | @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: "保存成功") |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |