Post

Replies

Boosts

Views

Activity

Reply to How to add Images to Swift Playground for iPad?
I tested this out on my iPad with playgrounds 3.4, and for me, it also didn't work except that it said that there was a problem and check the code for mistakes. I added resizable and frame modifiers to the Image view which allowed it to load inside the app. For the image, I just added it using the blue plus in the upper right corner of the app. Image(uiImage: #imageLiteral(resourceName: "Photo.png")) .resizable() .frame(width: 200, height: 200) .clipShape(Circle())
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’20
Reply to How do I react to changes on `FileDocument`
Unsure if you meant the command for undo like shaking the phone or just text, but if you are just wanting to react to changes on the document via text, you could just add an observer to the text variable in the *Document.swift file. var text: String {   didSet { print("Document changed") } } Anytime the text changes in the document, the didSet observer will be called. I tried messing around with some custom Bindings, but it wasn't as straightforward/elegant.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’20