Open WiiLin opened 4 years ago
testSVG.zip pod 'Macaw', :git => 'https://github.com/exyte/Macaw', :branch => 'master'
pod 'Macaw', :git => 'https://github.com/exyte/Macaw', :branch => 'master'
@IBOutlet weak var macawView: MacawView! { didSet { macawView.node = try! SVGParser.parse(resource: "table", fromBundle: Bundle.main) macawView.contentMode = .scaleToFill } } override func viewDidLoad() { super.viewDidLoad() let tap = UITapGestureRecognizer(target: self, action: #selector(ViewController.onClickBackground)) macawView.addGestureRecognizer(tap) } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) } @objc func onClickBackground(recognizer: UIGestureRecognizer) { let point = recognizer.location(in: recognizer.view) if let note = macawView.findNodeAt(location: point) { note.opacityVar.animation(from: 0.1, to: 1, during: 1, delay: 0).autoreversed().cycle().easing(.linear).play() } }
testSVG.zip
pod 'Macaw', :git => 'https://github.com/exyte/Macaw', :branch => 'master'