Post

Replies

Boosts

Views

Activity

macOS: Impossible to set focus on a textfield embedded in an alert
As of now, it seems impossible to set focus on a text field that is embedded in an alert on macOS. struct ContentView: View { @FocusState private var focusedField: FocusField? @State private var showingAlert = false @State private var name = "" enum FocusField { case folderName } var body: some View { VStack { Button { // focusedField = .folderName // Not working either showingAlert.toggle() } label: { Text("Show alert") } .alert("Alert", isPresented: $showingAlert, actions: { TextField("Name", text: $name) .font(.body) .autocorrectionDisabled() .focused($focusedField, equals: .folderName) Button("Cancel", role: .cancel, action: {}) }) #if os(macOS) .defaultFocus($focusedField, .folderName) #endif } .padding() } } When running this code on iOS, the text field does get focus automatically. Is it me that is doing something wrong or it's just a SwiftUI shortcoming on macOS?
1
0
709
Dec ’22
Generic parameter 'SelectionValue' could not be inferred
Hi! What is wrong with this code and why does this work for a Picker but not a List? struct ContentView: View {     enum FooBar: CaseIterable, Identifiable {         public var id : String { UUID().uuidString }                 case foo         case bar         case buzz         case bizz     }     @State var selectedFooBar: FooBar = .bar     var body: some View {         VStack {             Picker("Select", selection: $selectedFooBar) {                 ForEach(FooBar.allCases) { item in                     Text(self.string(from: item)).tag(item)                 }             }                         List(FooBar.allCases, selection: $selectedFooBar) { item in                 Text(self.string(from: item)).tag(item)             }                         Text("You selected: \(self.string(from: selectedFooBar))")         }     }     private func string(from item: FooBar) -> String {         var str = ""                  switch item {         case .foo:             str = "Foo"                      case .bar:             str = "Bar"                      case .buzz:             str = "Buzz"                      case .bizz:             str = "Bizz"         }         return str     } }
3
0
3.6k
Sep ’22
How to fix "contains disallowed nested bundles" and "contains disallowed file 'Frameworks'" errors
Hi,My iOS Swift app contains a in-house built framework (A), which is also using Swift. This framework includes 2 in-house built frameworks (B and C) using Objective-C."Embedded Content Contains Swift Code" is set to YES for the app and to NO for the A, B and C frameworks.When I try to submit the app to iTC, I get these errors:ERROR ITMS-90205: "Invalid Bundle. The bundle at 'yourapp.app/Frameworks/A.framework' contains disallowed nested bundles."...ERROR ITMS-90206: "Invalid Bundle. The bundle at 'yourapp.app/Frameworks/A.framework' contains disallowed file 'Frameworks'."...How can I fix those?
9
0
43k
May ’22
TestFlight for Mac: review required every single time a new build is pushed?
So I've started using TestFlight for Mac but unlike its iOS counterpart, it seems like every single build uploaded and pushed to testers has to be reviewed by Apple. This is not how that works on the iOS side. Ex: MyApp 4.1 build 1 -> Review required for both iOS and Mac MyApp 4.1 build 2 -> Review required for Mac, not iOS Is this a bug or by design? If so, this is crazy!
0
0
714
Nov ’21
macOS: Impossible to set focus on a textfield embedded in an alert
As of now, it seems impossible to set focus on a text field that is embedded in an alert on macOS. struct ContentView: View { @FocusState private var focusedField: FocusField? @State private var showingAlert = false @State private var name = "" enum FocusField { case folderName } var body: some View { VStack { Button { // focusedField = .folderName // Not working either showingAlert.toggle() } label: { Text("Show alert") } .alert("Alert", isPresented: $showingAlert, actions: { TextField("Name", text: $name) .font(.body) .autocorrectionDisabled() .focused($focusedField, equals: .folderName) Button("Cancel", role: .cancel, action: {}) }) #if os(macOS) .defaultFocus($focusedField, .folderName) #endif } .padding() } } When running this code on iOS, the text field does get focus automatically. Is it me that is doing something wrong or it's just a SwiftUI shortcoming on macOS?
Replies
1
Boosts
0
Views
709
Activity
Dec ’22
Files.app "On My ..." folder URL?
I'm able to retrieve the URL for iCloud Drive but what I want to do is store my app documents in the "On My iPad" / MyApp. Using FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) just returns the document folder for the app container. How can I access the public folder? Thanks!
Replies
1
Boosts
0
Views
1.5k
Activity
Nov ’22
Generic parameter 'SelectionValue' could not be inferred
Hi! What is wrong with this code and why does this work for a Picker but not a List? struct ContentView: View {     enum FooBar: CaseIterable, Identifiable {         public var id : String { UUID().uuidString }                 case foo         case bar         case buzz         case bizz     }     @State var selectedFooBar: FooBar = .bar     var body: some View {         VStack {             Picker("Select", selection: $selectedFooBar) {                 ForEach(FooBar.allCases) { item in                     Text(self.string(from: item)).tag(item)                 }             }                         List(FooBar.allCases, selection: $selectedFooBar) { item in                 Text(self.string(from: item)).tag(item)             }                         Text("You selected: \(self.string(from: selectedFooBar))")         }     }     private func string(from item: FooBar) -> String {         var str = ""                  switch item {         case .foo:             str = "Foo"                      case .bar:             str = "Bar"                      case .buzz:             str = "Buzz"                      case .bizz:             str = "Bizz"         }         return str     } }
Replies
3
Boosts
0
Views
3.6k
Activity
Sep ’22
How to fix "contains disallowed nested bundles" and "contains disallowed file 'Frameworks'" errors
Hi,My iOS Swift app contains a in-house built framework (A), which is also using Swift. This framework includes 2 in-house built frameworks (B and C) using Objective-C."Embedded Content Contains Swift Code" is set to YES for the app and to NO for the A, B and C frameworks.When I try to submit the app to iTC, I get these errors:ERROR ITMS-90205: "Invalid Bundle. The bundle at 'yourapp.app/Frameworks/A.framework' contains disallowed nested bundles."...ERROR ITMS-90206: "Invalid Bundle. The bundle at 'yourapp.app/Frameworks/A.framework' contains disallowed file 'Frameworks'."...How can I fix those?
Replies
9
Boosts
0
Views
43k
Activity
May ’22
DNSServiceNATPortMappingCreate now just fails on macOS 12
Calling DNSServiceNATPortMappingCreate returns kDNSServiceErr_NoError like expected but the port mapping actually fails right away in the callback. I'm calling this in a daemon via XPC. Are there new restrictions or permissions required?
Replies
13
Boosts
0
Views
2.9k
Activity
Nov ’21
TestFlight for Mac: review required every single time a new build is pushed?
So I've started using TestFlight for Mac but unlike its iOS counterpart, it seems like every single build uploaded and pushed to testers has to be reviewed by Apple. This is not how that works on the iOS side. Ex: MyApp 4.1 build 1 -> Review required for both iOS and Mac MyApp 4.1 build 2 -> Review required for Mac, not iOS Is this a bug or by design? If so, this is crazy!
Replies
0
Boosts
0
Views
714
Activity
Nov ’21