Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import UIKit
- protocol SendMessage {
- func didSendDraw(on image: UIImage)
- }
- class DrawViewController: UIViewController {
- @IBOutlet weak var magicScreen: UIView!
- var previousPoint = CGPoint(x: 0, y: 0)
- var currentDirection = ""
- var beganPoint: CGPoint?
- var timerX: Timer?
- var timerY: Timer?
- //MARK: - Deal with iMessage
- public var delegate: SendMessage?
- override func viewDidLoad() {
- super.viewDidLoad()
- previousPoint.y = self.magicScreen.frame.size.height+48
- }
- //MARK: - Action
- @IBAction func sendButtonPressed(_ sender: Any) {
- let newImage = UIImage(view: self.magicScreen)
- self.delegate?.didSendDraw(on: newImage)
- }
- }
Add Comment
Please, Sign In to add comment