Post

Replies

Boosts

Views

Activity

Reply to Picker with Unexpected Results
Consider this: struct PickColorView: View { @State private var number1: Int = 4 @State private var number2: Int = 0 let range: ClosedRange<Int> = 0...20 let array: Array<Int> = [14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60] var body: some View { NavigationView { Form { Picker(selection: $number1, label: Text("Number1")) { ForEach(range, id: \.self) { number in Text("\(number)") } } .onChange(of: number1) { newNumber1 in print("newNumber1: \(newNumber1)") } Picker(selection: $number2, label: Text("Number2")) { ForEach(array, id: \.self) { number in Text("\(number)") } } .onChange(of: number2) { newNumber2 in print("newNumber2: \(newNumber2)") } } .navigationBarTitle("Settings") .navigationBarHidden(false) } .navigationViewStyle(StackNavigationViewStyle()) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to Problems Updating a View
In NFCReader, the "data" that you are adding the new item to is not the same as the "data" in your ContentView. They are two separate objects. So the addition will never show up in your UI. You need to use a single "data", and pass it to wherever it is needed. For example... In ContentView, you could remove data, make NFCReader the StateObject, publish NFCReader's data, and refer to that data in your View.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to JSON DATA CORRUPTED ERROR
Can you share the equivalent of this screenshot, to check the details of the json file?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to JSON DATA CORRUPTED ERROR
Is it possible to upload the json data file, like this? data.json
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Installing app from TestFlight into Simulator
Have you tried it?
Replies
Boosts
Views
Activity
Jan ’22
Reply to Installing app from TestFlight into Simulator
It looks like it is not possible. But there is a possible workaround here: https://www.webdigi.co.uk/blog/2016/how-to-transfer-your-app-to-an-ios-simulator-on-another-machine-using-app-file-and-xcrun/ Is that any help?
Replies
Boosts
Views
Activity
Jan ’22
Reply to Xcode 3.2.1 new projects not including info.plis
Yep. See Target > Info
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Xcode error
Is there a question here... embedded in this mass of text?
Replies
Boosts
Views
Activity
Jan ’22
Reply to Let people post external links in answers
I agree.
Replies
Boosts
Views
Activity
Jan ’22
Reply to How to enable UIFileSharingEnabled in XCode13?
In Xcode, go to Target > Info Under Custom iOS Target Properties, add a new row, then: Type UIFileSharingEnabled, and press Return... ...it changes to "Application supports iTunes file sharing" Enter the value "YES"
Replies
Boosts
Views
Activity
Jan ’22
Reply to Picker with Unexpected Results
Consider this: struct PickColorView: View { @State private var number1: Int = 4 @State private var number2: Int = 0 let range: ClosedRange<Int> = 0...20 let array: Array<Int> = [14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60] var body: some View { NavigationView { Form { Picker(selection: $number1, label: Text("Number1")) { ForEach(range, id: \.self) { number in Text("\(number)") } } .onChange(of: number1) { newNumber1 in print("newNumber1: \(newNumber1)") } Picker(selection: $number2, label: Text("Number2")) { ForEach(array, id: \.self) { number in Text("\(number)") } } .onChange(of: number2) { newNumber2 in print("newNumber2: \(newNumber2)") } } .navigationBarTitle("Settings") .navigationBarHidden(false) } .navigationViewStyle(StackNavigationViewStyle()) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to CoreLocation data across multiple apps
On iOS, it isn't the app that triggers the location update, it's the system. The update is then passed on to any app that is listening for that update. So in that sense, yes, if Google Maps receives a location update, your app can also receive it.
Replies
Boosts
Views
Activity
Jan ’22
Reply to What is Ready for review?
The sequence is: Ready for Review You submit it for Review Waiting for Review ...In Review... etc.
Replies
Boosts
Views
Activity
Jan ’22
Reply to Problems Updating a View
In NFCReader, the "data" that you are adding the new item to is not the same as the "data" in your ContentView. They are two separate objects. So the addition will never show up in your UI. You need to use a single "data", and pass it to wherever it is needed. For example... In ContentView, you could remove data, make NFCReader the StateObject, publish NFCReader's data, and refer to that data in your View.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Problems Updating a View
I tried that and it still does not seem to work Can you show your code?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to function doesnt return a value
The function cannot return the value retrieved by your dataTask, as the function returns before the dataTask finishes. The dataTask completion should set some value in the wider environment, or itself call a passed-in completion closure.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Is it proper to add an extension to UIViewController class, or is there a preferred way of adding another method to an established Swift Class?
You are using an Extension to add functionality to an existing class (UIViewController) that you don't "own". This is exactly what Extension is for. A fuller explanation: https://www.hackingwithswift.com/quick-start/understanding-swift/when-should-you-use-extensions-in-swift
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22