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()
}
}
}
}
Post
Replies
Boosts
Views
Activity
How did you set the frame height for the Text ?
Text("some text")
.frame(height: 60) // Adjust as needed
Could you post the code (and indicate which language it is), so that we can make some tests ?
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Did you access through AppstoreConnect ?
May have a look at this old thread:
https://developer.apple.com/forums/thread/693841?answerId=693782022#693782022
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
¿Cual e su pregunta?
Topic:
Accessibility & Inclusion
SubTopic:
General
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.
Topic:
Accessibility & Inclusion
SubTopic:
General
Tags:
I reported another bug on the same issue (mail sent as 'Apple recommended' but does not show in the thread).
Jul 18, 2024 at 5:51 PM – FB14377820
Topic:
Developer Tools & Services
SubTopic:
Developer Forums
Tags:
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
Topic:
App & System Services
SubTopic:
Maps & Location
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.
What if you try with computed var ?
struct DataObject{
var item: [String:Any] {
JSONData serialized out of memory, and may have say, 12 fields
}
}
Topic:
Programming Languages
SubTopic:
Swift
Tags:
It seems that the flow of messages has stopped. Either the server was exhausted or the bug corrected ? 😉
Let's hope we'll have a short explanation of what happened.
Topic:
App Store Distribution & Marketing
SubTopic:
General
Apparently, the flow of mails has stopped …
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
File a bug report (I did it). https://developer.apple.com/forums/thread/759903
I feared the same (intrusion), but Apple support told it was not (but do they know for sure ?)
Topic:
App Store Distribution & Marketing
SubTopic:
General
Even if you are an individual, you are a trader.
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Tags:
As you are a developer (as you are on the forum), what is the problem to do it yourself ?
If you face technical issue, please tell, someone will surely help you.
But the forum is not for soliciting.
Topic:
Community
SubTopic:
Apple Developers
@9age There is a simple solution: develop the app yourself. If there is such a market, you'll become a billionaire.
PS: there are very good purely mechanical scales on the market (since a few milleniums). No need for electronic scale nor iPhone app… And low cost as well: https://www.amazon.com/Mechanical-Chemical-roberval-Laboratory-Teaching/dp/B0C3ZKRQBT
Topic:
App & System Services
SubTopic:
Health & Fitness
Tags:
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()
}
}
}
}
- Replies
- Boosts
- Views
- Activity
How did you set the frame height for the Text ?
Text("some text")
.frame(height: 60) // Adjust as needed
Could you post the code (and indicate which language it is), so that we can make some tests ?
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
- Replies
- Boosts
- Views
- Activity
Did you access through AppstoreConnect ?
May have a look at this old thread:
https://developer.apple.com/forums/thread/693841?answerId=693782022#693782022
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
- Replies
- Boosts
- Views
- Activity
¿Cual e su pregunta?
Topic:
Accessibility & Inclusion
SubTopic:
General
- Replies
- Boosts
- Views
- Activity
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.
Topic:
Accessibility & Inclusion
SubTopic:
General
Tags:
- Replies
- Boosts
- Views
- Activity
I reported another bug on the same issue (mail sent as 'Apple recommended' but does not show in the thread).
Jul 18, 2024 at 5:51 PM – FB14377820
Topic:
Developer Tools & Services
SubTopic:
Developer Forums
Tags:
- Replies
- Boosts
- Views
- Activity
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
Topic:
App & System Services
SubTopic:
Maps & Location
- Replies
- Boosts
- Views
- Activity
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.
- Replies
- Boosts
- Views
- Activity
What if you try with computed var ?
struct DataObject{
var item: [String:Any] {
JSONData serialized out of memory, and may have say, 12 fields
}
}
Topic:
Programming Languages
SubTopic:
Swift
Tags:
- Replies
- Boosts
- Views
- Activity
It seems that the flow of messages has stopped. Either the server was exhausted or the bug corrected ? 😉
Let's hope we'll have a short explanation of what happened.
Topic:
App Store Distribution & Marketing
SubTopic:
General
- Replies
- Boosts
- Views
- Activity
Apparently, the flow of mails has stopped …
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
- Replies
- Boosts
- Views
- Activity
File a bug report (I did it). https://developer.apple.com/forums/thread/759903
I feared the same (intrusion), but Apple support told it was not (but do they know for sure ?)
Topic:
App Store Distribution & Marketing
SubTopic:
General
- Replies
- Boosts
- Views
- Activity
Even if you are an individual, you are a trader.
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Tags:
- Replies
- Boosts
- Views
- Activity
As you are a developer (as you are on the forum), what is the problem to do it yourself ?
If you face technical issue, please tell, someone will surely help you.
But the forum is not for soliciting.
Topic:
Community
SubTopic:
Apple Developers
- Replies
- Boosts
- Views
- Activity
@9age There is a simple solution: develop the app yourself. If there is such a market, you'll become a billionaire.
PS: there are very good purely mechanical scales on the market (since a few milleniums). No need for electronic scale nor iPhone app… And low cost as well: https://www.amazon.com/Mechanical-Chemical-roberval-Laboratory-Teaching/dp/B0C3ZKRQBT
Topic:
App & System Services
SubTopic:
Health & Fitness
Tags:
- Replies
- Boosts
- Views
- Activity