Post

Replies

Boosts

Views

Activity

SwiftUI OpenURLAction not working withs link to my own app store app.
Can anyone explain why this code is failing? The link itself works in the Safari browser, but when I try to use it in this code below it gives me errors. import SwiftUI struct OpenURLActionView: View {     @Environment(\.openURL) var openURL     var body: some View {         Button(action: contactSupport) {             Text("Email Support")             Image(systemName: "envelope.open")         }     }     func contactSupport() {         //guard let url = URL(string: "https://apple.com") else {         guard let url = URL(string: "https://apps.apple.com/us/app/mealtime-prayers/id1299492959?ls=1") else {             return         }         openURL(url)     } } struct OpenURLActionView_Previews: PreviewProvider {     static var previews: some View {         OpenURLActionView()     } } code-block And the error I get is:
0
0
1k
Oct ’21
Xcode 12.0 B2 SwiftUI - Bottom toolbar after List in ContentView no longer displays.
This code worked in Xcode 12.0 B1 but no longer works in B2. struct ContentView: View {     var body: some View {         NavigationView {             List {                 ForEach (1..<10) {                     row in                     Text("\(row) - Test").foregroundColor(Color.white).fontWeight(.bold)                 }                 .listRowBackground(Color.burgundy)             }                         .navigationTitle(Text("List Background Color Test"))             .navigationBarTitleDisplayMode(.inline)             .toolbar {                 ToolbarItem(placement: .bottomBar) {                     HStack {                         Button(action: {}, label: {                             Text("One").foregroundColor(Color.white)                         })                         Spacer()                         Button(action: {}, label: {                             Text("Two").foregroundColor(Color.white)                         })                         Spacer()                         Button(action: {}, label: {                             Text("Three").foregroundColor(Color.white)                         }).foregroundColor(.blue)                     }                 }             }                     }                            } }
3
0
2k
Dec ’21
SwiftData Predicate not working.
My predicate: #Predicate{ transaction in transaction.date! >= startDate && transaction.date! <= endDate && transaction.category! == "Income" && transaction.ttype! == "Business" } is failing with: The operation couldn’t be completed. (SwiftData.SwiftDataError error 1.) The release notes for iOS 17 State: Fixed: #Predicate does not support UUID, Date, and URL properties. (109539652) Does anyone have any suggestions?
1
0
1.2k
Dec ’23
'scanLocation was deprecated in iOS 13.0'
I have this code giving me the deprecated warning. How do I fix this?: // Retrieve the unscanned remainder of the string if textScanner.scanLocation < textScanner.string.count { textToScan = (textScanner.string as NSString).substring(from: textScanner.scanLocation + 1) }
Replies
0
Boosts
0
Views
1k
Activity
Sep ’21
SwiftUI OpenURLAction not working withs link to my own app store app.
Can anyone explain why this code is failing? The link itself works in the Safari browser, but when I try to use it in this code below it gives me errors. import SwiftUI struct OpenURLActionView: View {     @Environment(\.openURL) var openURL     var body: some View {         Button(action: contactSupport) {             Text("Email Support")             Image(systemName: "envelope.open")         }     }     func contactSupport() {         //guard let url = URL(string: "https://apple.com") else {         guard let url = URL(string: "https://apps.apple.com/us/app/mealtime-prayers/id1299492959?ls=1") else {             return         }         openURL(url)     } } struct OpenURLActionView_Previews: PreviewProvider {     static var previews: some View {         OpenURLActionView()     } } code-block And the error I get is:
Replies
0
Boosts
0
Views
1k
Activity
Oct ’21
Beta testing Mac app compiled from iOS in Xcode
Now that I have created a Mac app from Xcode from iOS, how do I beta test it? Is there TestFlight for Mac? Where do I invite testers? What is the workflow for this?
Replies
2
Boosts
0
Views
841
Activity
Aug ’21
Xcode 12.0 B2 SwiftUI - Bottom toolbar after List in ContentView no longer displays.
This code worked in Xcode 12.0 B1 but no longer works in B2. struct ContentView: View {     var body: some View {         NavigationView {             List {                 ForEach (1..<10) {                     row in                     Text("\(row) - Test").foregroundColor(Color.white).fontWeight(.bold)                 }                 .listRowBackground(Color.burgundy)             }                         .navigationTitle(Text("List Background Color Test"))             .navigationBarTitleDisplayMode(.inline)             .toolbar {                 ToolbarItem(placement: .bottomBar) {                     HStack {                         Button(action: {}, label: {                             Text("One").foregroundColor(Color.white)                         })                         Spacer()                         Button(action: {}, label: {                             Text("Two").foregroundColor(Color.white)                         })                         Spacer()                         Button(action: {}, label: {                             Text("Three").foregroundColor(Color.white)                         }).foregroundColor(.blue)                     }                 }             }                     }                            } }
Replies
3
Boosts
0
Views
2k
Activity
Dec ’21
SwiftData Predicate not working.
My predicate: #Predicate{ transaction in transaction.date! >= startDate && transaction.date! <= endDate && transaction.category! == "Income" && transaction.ttype! == "Business" } is failing with: The operation couldn’t be completed. (SwiftData.SwiftDataError error 1.) The release notes for iOS 17 State: Fixed: #Predicate does not support UUID, Date, and URL properties. (109539652) Does anyone have any suggestions?
Replies
1
Boosts
0
Views
1.2k
Activity
Dec ’23
In SwiftUI, how do I stop a TextField from always beginning with initial caps?
In SwiftUI, I have several TextFields in a Form and they always begin with initial caps when data is entered? How do I prevent this? I want the field to be all lowercase.
Replies
3
Boosts
1
Views
5.9k
Activity
Jun ’22