Post

Replies

Boosts

Views

Activity

Reply to Most efficient way to call a function upon variable state change
It would be much simpler to explain if you posted the code you have tried with Binding. Is it what you are looking for ? struct TestButton: View { @Binding var isSelected: Bool var body: some View { Button(action: { self.isSelected.toggle() }) { Text("Change") } } } struct ContentView: View { @State var buttonState = false @State var someTextToDisplay = "no state defined yet" func forStateOn() { someTextToDisplay = "State is on" } func forStateOff() { someTextToDisplay = "State is off" } var body: some View { VStack { Text(buttonState ? "selected" : "unselected") TestButton(isSelected: $buttonState) Text(someTextToDisplay) } .onChange(of: buttonState) { oldState, newState in if newState { forStateOn() } else { forStateOff() } } } }
Topic: Design SubTopic: General Tags:
Jul ’24
Reply to planning to enroll on apple dev program without mac
No, you can't. You need a device or a recent Mac to get apple ID Before you begin, you’ll need: An iPhone or iPad with Touch ID, Face ID, or passcode enabled, or a Mac with the T2 Security Chip and Apple Silicon. See details here: https://developer.apple.com/support/app-account/#:~:text=Before%20you%20begin%2C%20you'll,for%20the%20entire%20enrollment%20process. And you'll need a Mac to run Xcode. If you enroll, that means you want to develop for Apple platforms. Hence you need those devices.
Jul ’24
Reply to Waze bug
That's not a question for the developers' forum which is about helping you to develop apps, not to use others' apps. You'd better contact Waze directly or look for their users forums. You may also ask on Apple Support Community https://discussions.apple.com/welcome
Jul ’24
Reply to What is the secret to good UI?
If there were a magic recipe, it would be known. You should read Apple UI guidelines, there is a lot to learn here. But a few points to pat attention for the UX: know who are your target users: very experienced or in a specific business or any one having an iPhone, put yourself in the user shoes or mind, and try to forget what you know about your code: what is obvious for you may be hard to guess or not natural for a casual user A good way is to test your UI and UX with a few target users, even before fully coding. Keep it as simple as possible, do not overcrowd the UI and to not require 10 screens to get to the point. Navigation between all your screens must be simple to understand. The storyboard approach of UIKit is a great way to check. More difficult with SwiftUI. Which means, when you design UX, try to imagine the user thinking when he/she looks at the specific screen. Avoid absolutely to get your user lost and provide a way to easily get back to a safe starting point (Home Screen often). try to make it fun to use your app. Hope that helps. PS: this damn editor is replacing the bullet numbers by 1 everywhere when it display (not in Preview). Bad UI.
Topic: Design SubTopic: General Tags:
Jul ’24