Post

Replies

Boosts

Views

Activity

Reply to SwiftUI Preview crashes on simple code
"padding()" should be ".padding()" As in: struct ContentView: View { var body: some View { VStack { Text("Hello, world!") .padding() Text("Another Line") } } } "padding()" is an instance method, so calling it without the leading ".", as you do, probably causes something horrible to happen, which causes the crash. (Since it will return a function, not a View)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to Result of 'Text' initializer is unused
my goal is to change the text "hello" to number 1 when I click on it Your code is a long way from achieving that. It may be best to work through some tutorials first? Are you studying anything, at the moment? (There is no point my just writing the solution for you, as I think your current code demonstrates a number of misunderstandings.)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21
Reply to Popping application from background state
Typically, you would use a Notification. When the user responds to the notification, that can launch your app, and trigger an action. (Note though, it is also possible for the user to dismiss the notification, and not launch your app.) Other techniques (than Notification) might be possible, but as I understand it, Notification is the only "legal" one, and any other method would risk App Store rejection.
Topic: App & System Services SubTopic: Core OS Tags:
Dec ’21