Post

Replies

Boosts

Views

Activity

Reply to VStack initialization without parentheses
More details here, in Swift Programming language (functions & closures): « A closure passed as the last argument to a function can appear immediately after the parentheses. When a closure is the only argument to a function, you can omit the parentheses entirely. » The Swift Programming Language (Swift 5.7)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’24
Reply to VStack initialization without parentheses
The init is defined as: init( alignment: HorizontalAlignment = .center, spacing: CGFloat? = nil, @ViewBuilder content: () -> Content ) So, you can also call struct ContentView: View { var body: some View { VStack(content: { Text("sth") }) } } The Stack { } where the content (closure) is outside the parameters list, is just a writing facility. You can do the same in other Swift functions: array.map() { closure } or array.map { closure}
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’24
Reply to When using index in a ForEach loop in SwiftUI, you might encounter an "index out of range" error.
So, when you try: ForEach(Array(viewModel.testValues.enumerated()), id:\.offset) { index, data in What is the index value that causes crash ? Could you also add a print and show what you get: .onAppear { print("index", index) // <<-- ADD THIS if !viewModel.isLoading, viewModel.testValues.count - 2 == index { viewModel.fetch() print("fetch. index", index, viewModel.testValues.count) // <<-- ADD THIS } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’24
Reply to Urgent: Help Needed with App Store Submission Issue
We recently encountered an issue What issue ???   As I'm not entirely familiar with app development/coding, I'm reaching out to seek help with this. The forum is the right place… But Help on what ? What is your question ?   We also want to know if the issue we're experiencing Which issue ? When you post a question, please provide detailed information if you want to get help.
Apr ’24
Reply to ForEach creates Views twice
That's an old problem, as reported here: https://developer.apple.com/forums/thread/718281 That's caused by ForEach effectively, as no error here: var body: some View { // ForEach(1...1, id: \.self) { i in subview(0) // } Some explanation here: it is due to the way SwiftUI performs init. https://www.reddit.com/r/SwiftUI/comments/166m0tn/double_initiation_in_foreach_loop/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to XCode 15 warnings
For sure, Xcode may be very verbose and some warnings are hard to solve (even impossible). But you can silence the warnings and just keep errors. In the Issues navigator click on x at the bottom on the Filter line Could you show the real and more complete code, so that we can understand these "hang pont" (???) messages
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’24
Reply to VStack initialization without parentheses
More details here, in Swift Programming language (functions & closures): « A closure passed as the last argument to a function can appear immediately after the parentheses. When a closure is the only argument to a function, you can omit the parentheses entirely. » The Swift Programming Language (Swift 5.7)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to VStack initialization without parentheses
The init is defined as: init( alignment: HorizontalAlignment = .center, spacing: CGFloat? = nil, @ViewBuilder content: () -> Content ) So, you can also call struct ContentView: View { var body: some View { VStack(content: { Text("sth") }) } } The Stack { } where the content (closure) is outside the parameters list, is just a writing facility. You can do the same in other Swift functions: array.map() { closure } or array.map { closure}
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to Can't Select UITextField in UITableView
Check that userInteraction is enabled. For instance, in private func configure() self.isUserInteractionEnabled = true
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to How to get around asking for DOB
As Scott outlined, why do you need the exact Date of Birth ? You have no way to check it anyway. What would you miss by asking whether or not user is more than 18 ? It also seems you ask for gender. Why do you need ?
Replies
Boosts
Views
Activity
May ’24
Reply to Due to Bluetooth i can't simulate my apps workflows - so how do i get the screen shots ?
Have you looked at this, for screenshot generation ? https://github.com/NordicSemiconductor/IOS-CoreBluetooth-Mock
Replies
Boosts
Views
Activity
May ’24
Reply to When using index in a ForEach loop in SwiftUI, you might encounter an "index out of range" error.
So, when you try: ForEach(Array(viewModel.testValues.enumerated()), id:\.offset) { index, data in What is the index value that causes crash ? Could you also add a print and show what you get: .onAppear { print("index", index) // <<-- ADD THIS if !viewModel.isLoading, viewModel.testValues.count - 2 == index { viewModel.fetch() print("fetch. index", index, viewModel.testValues.count) // <<-- ADD THIS } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to Urgent: Help Needed with App Store Submission Issue
We recently encountered an issue What issue ???   As I'm not entirely familiar with app development/coding, I'm reaching out to seek help with this. The forum is the right place… But Help on what ? What is your question ?   We also want to know if the issue we're experiencing Which issue ? When you post a question, please provide detailed information if you want to get help.
Replies
Boosts
Views
Activity
Apr ’24
Reply to When using index in a ForEach loop in SwiftUI, you might encounter an "index out of range" error.
The way I do it is by using enumerated and .offset: ForEach(Array(data.enumerated()), id: \.offset) { (index, d) in Why do you zip ? Try to replace: ForEach(Array(zip(viewModel.testValues.indices, viewModel.testValues)), id:\.1) { index, data in by ForEach(Array(viewModel.testValues.enumerated()), id:\.offset) { index, data in
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to Where to find XCode13?
You can download any release here: https://xcodereleases.com Note: you should even be able to install Xcode 14.2.
Replies
Boosts
Views
Activity
Apr ’24
Reply to Apple Care tells users who cannot download/update app from App Store that the third-party developer is responsible
Does the problem repeats with different users ? If so, just an idea: did you check their OS version ? Is it compatible with your deployment target ?
Replies
Boosts
Views
Activity
Apr ’24
Reply to History and your help
Except regretting the good ol'days, what is the purpose of your long post ? What do you expect other developers to do for you ?
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to ForEach creates Views twice
That's an old problem, as reported here: https://developer.apple.com/forums/thread/718281 That's caused by ForEach effectively, as no error here: var body: some View { // ForEach(1...1, id: \.self) { i in subview(0) // } Some explanation here: it is due to the way SwiftUI performs init. https://www.reddit.com/r/SwiftUI/comments/166m0tn/double_initiation_in_foreach_loop/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to XCode 15 warnings
For sure, Xcode may be very verbose and some warnings are hard to solve (even impossible). But you can silence the warnings and just keep errors. In the Issues navigator click on x at the bottom on the Filter line Could you show the real and more complete code, so that we can understand these "hang pont" (???) messages
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to When are Storyboards getting ditched?
That's your point of view. Many others find UIKit going (at least now) more flexibility and control over the app execution. In some cases, that's critical.
Replies
Boosts
Views
Activity
Apr ’24
Reply to Will apple reject my app if i redirect users to general settings?
AFAIK, it is authorised to redirect to settings as well as to the app's settings. If going to settings, user will have to select General by itself.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’24