Post

Replies

Boosts

Views

Activity

[SwiftUI] How to add a View dynamically via user interaction ?
I would like to create a Button that on tapped creates a draggable View on the screen using SwiftUI. Implementation in UIKit 				// UIKit 	     @IBAction func addTextBox(_ sender: UIButton) {         print("Add an Emoji")         let textView = UITextView() 				textView.text = "🇺🇸"         textView.addGestureRecognizer(gesture)         textView.addGestureRecognizer(pinchGesture)         textView.addGestureRecognizer(rotationGesture)         canvasView.addSubview(textView) 				} 				 How can I get a behavior similar to the one listed above in SwiftUI?
0
0
573
Jun ’20