Post

Replies

Boosts

Views

Activity

Reply to @State not updating when set via .init([...]) parameter
But if you change __internalNumber from @State to @Binding it will bind to any changes as a result of any external @State side effects. public struct TestView: View {     var number: Int     @Binding private var _internalNumber: Int     public init(number: Int) {         self.number = number         self.__internalNumber = Binding.constant(number) // bind __internalNumber to changes of the external @State variable     }   public var body: some View {     VStack(alignment: .leading) {       Text("number: \(number)")       Text("internal: \(_internalNumber)")     }     .debugAction {       Self._printChanges()       print("number: \(number)")       print("_internalNumber: \(_internalNumber)")     }   } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’22
Reply to Menu Picker .onChange (doesn't work for the first selection)
This example shows that it does print on the first selection: import SwiftUI struct ContentView: View {     @State var fruitName: String = "none"     var body: some View {         VStack {             Menu {                 PickFruit(fruitName: $fruitName)             } label: {Text("Select A Fruit")}             Text(fruitName)         }         .onChange(of: fruitName) { [fruitName] newValue in // move onchange to here             print(newValue)             print(fruitName)         }     } } struct PickFruit: View {     let myFruits: [String] = ["Apple","Banana","Grape","Peach"]     @Binding var fruitName: String     var body: some View {         VStack {             Text(fruitName)             Picker("Select", selection: $fruitName) {                 ForEach(myFruits, id: \.self) { myFruits in                     Text(myFruits)                 }             }         }     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’22
Reply to SecKeyCreateRandomKey for SecureEnclave crash on iOS 13 simulator
If running on the simulator the MacBook must be equipped with a touch bar or touch id otherwise should be supported on an A7 or later A-series CPU. To prevent the crash on a sim with a touch bar or touch id remove kSecAttrTokenID as String: kSecAttrTokenIDSecureEnclave, or exclude it from sim builds. https://developer.apple.com/documentation/security/certificate_key_and_trust_services/keys/storing_keys_in_the_secure_enclave
Topic: Privacy & Security SubTopic: General Tags:
May ’22
Reply to Framework ProximityReader
Follow the entitlement request URL in the documentation
Topic: Code Signing SubTopic: Entitlements Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Get Wifi List to connect Wifi Bridge to internet via React Native App
And sample code here (entitlement to use services is required from Apple) https://developer.apple.com/documentation/networkextension/configuring_a_wi-fi_accessory_to_join_the_user_s_network
Replies
Boosts
Views
Activity
Jun ’22
Reply to Get Wifi List to connect Wifi Bridge to internet via React Native App
See here -> https://developer.apple.com/documentation/networkextension
Replies
Boosts
Views
Activity
Jun ’22
Reply to Swift Playground - Round up the switches (using While & if conditions)
I'm here wondering as well, I don't see a prior question but it seems they're assuming someone else is doing the same exercise as them.
Replies
Boosts
Views
Activity
Jun ’22
Reply to @State not updating when set via .init([...]) parameter
But if you change __internalNumber from @State to @Binding it will bind to any changes as a result of any external @State side effects. public struct TestView: View {     var number: Int     @Binding private var _internalNumber: Int     public init(number: Int) {         self.number = number         self.__internalNumber = Binding.constant(number) // bind __internalNumber to changes of the external @State variable     }   public var body: some View {     VStack(alignment: .leading) {       Text("number: \(number)")       Text("internal: \(_internalNumber)")     }     .debugAction {       Self._printChanges()       print("number: \(number)")       print("_internalNumber: \(_internalNumber)")     }   } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Menu Picker .onChange (doesn't work for the first selection)
This example shows that it does print on the first selection: import SwiftUI struct ContentView: View {     @State var fruitName: String = "none"     var body: some View {         VStack {             Menu {                 PickFruit(fruitName: $fruitName)             } label: {Text("Select A Fruit")}             Text(fruitName)         }         .onChange(of: fruitName) { [fruitName] newValue in // move onchange to here             print(newValue)             print(fruitName)         }     } } struct PickFruit: View {     let myFruits: [String] = ["Apple","Banana","Grape","Peach"]     @Binding var fruitName: String     var body: some View {         VStack {             Text(fruitName)             Picker("Select", selection: $fruitName) {                 ForEach(myFruits, id: \.self) { myFruits in                     Text(myFruits)                 }             }         }     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to 169.254.255.255 doesn't broadcast ?
It still has to find the broadcaster by mac-address by asking who is the broadcaster.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to react native app crashs on launch testFlight
Ask this question on the React Native github project.
Replies
Boosts
Views
Activity
Jun ’22
Reply to Apple 403 detected - Access forbidden - EXPO React Native
Post your question here https://github.com/facebook/react-native/issues react is not an apple product.
Replies
Boosts
Views
Activity
May ’22
Reply to Xamarin.iOS loading xaml hangs randomly
Xamarin is not an Apple product please post your question at microsoft.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to React Native App crashing on ios 15.4.1
Please post your issue on the React Native github site: https://github.com/facebook/react-native/issues
Replies
Boosts
Views
Activity
May ’22
Reply to SecKeyCreateRandomKey for SecureEnclave crash on iOS 13 simulator
If running on the simulator the MacBook must be equipped with a touch bar or touch id otherwise should be supported on an A7 or later A-series CPU. To prevent the crash on a sim with a touch bar or touch id remove kSecAttrTokenID as String: kSecAttrTokenIDSecureEnclave, or exclude it from sim builds. https://developer.apple.com/documentation/security/certificate_key_and_trust_services/keys/storing_keys_in_the_secure_enclave
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to swift mac swift app fails to show image view crashes on first run
Are the sandbox entitlements under capabilities enabled and any permission request implemented?
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to In App Purchase for Membership
What specific App technology of the device will your app be implementing? If none then stick to a website?
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to Offering subscription for specific countries
Do you see the ability to do so anywhere in the API frameworks, app-purchase setups or anywhere else unless you only permit your in the target stores?
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
May ’22