Posts

Post not yet marked as solved
1 Replies
376 Views
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?
Posted
by jpcoates.
Last updated
.
Post marked as solved
3 Replies
1.6k Views
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)                     }                 }             }                     }                            } }
Posted
by jpcoates.
Last updated
.
Post not yet marked as solved
0 Replies
612 Views
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:
Posted
by jpcoates.
Last updated
.
Post not yet marked as solved
0 Replies
899 Views
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) }
Posted
by jpcoates.
Last updated
.
Post marked as solved
1 Replies
562 Views
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?
Posted
by jpcoates.
Last updated
.
Post not yet marked as solved
1 Replies
786 Views
I currently have an iPad app that I am attempting to compile to Mac (macOS 10.15) in XCode 11.5. It uses code similar to code found here (https://programmingwithswift.com/add-uidatepicker-in-a-uitextfield-with-swift/). The problem is, that when compiled to Mac, and run on the Mac, it does not work for Mac.Any suggestions?
Posted
by jpcoates.
Last updated
.
Post not yet marked as solved
3 Replies
3.8k Views
I have code that loads an HTML page into a WKWebView and needs to call javascript functions in the HTML page to update font family and size. Now that WKPreferences.javaScriptEnabled has been deprecated, it does not seem to work anymore. How to I correctly create a struct WebView: UIViewRepresentable with makeUIView and updateUIView to be able to show the page and call the functions in the HTML page? Please help...
Posted
by jpcoates.
Last updated
.
Post not yet marked as solved
0 Replies
505 Views
How can I ceate the exact same functionality of the Page-Based application (formally Page-Based template) using SwiftUI to include these features:Portrait view single page turnLandscape view (in iPad) with two page view and page turnHere is an example video showing requested functionality:https://www.youtube.com/watch?v=9cl4slkXqyUSo far, the only examples I have seen in SwiftUI support single page Portrait view.Are there any tutorials that show all functionality supported.Jim
Posted
by jpcoates.
Last updated
.
Post not yet marked as solved
0 Replies
372 Views
How do I implement in SwiftUI:func pageViewController(_ pageViewController: UIPageViewController, spineLocationFor orientation: UIInterfaceOrientation) -&gt; UIPageViewController.SpineLocation { &lt;#code#&gt; }I am trying to show two pages in iPad Landscape orientation.Jim
Posted
by jpcoates.
Last updated
.
Post not yet marked as solved
3 Replies
1.8k Views
When I create a picker, for example font settings, it always show the values, but not with the last selected one preselected. How can I create a picker that has the last selected value shown selected the next time the view is viewed. I plan to store the last selected value in UserDefaults.Thank in advance for any help.
Posted
by jpcoates.
Last updated
.
Post marked as solved
4 Replies
5.2k Views
I have a SwiftUI Form() that I use to enter inital data using TextField()s. I use the data to record into Core Data. I want to be able to re-edit the data using a Form() but cannot figure out how to preset the TextField()s.How can I preset the TextField()s?
Posted
by jpcoates.
Last updated
.