regex expressions a working sheet
Regular expressions (regex) are extremely useful in extracting information from any text by searching for one or more matches of a specific search pattern.
RealmSwift 10.1 framework not found realm-sync
Updating Realm and RealmSwift from 5.5.x to 10.0.0 brought in the following error
RealmSwift 10.1: framework not found realm-sync
The greatest clue I came across to solving this issue was on the Realm GitHub issues page for realm-sync error. However, updating Cocopods wasn't the only step required to correct this issue. The steps I took were:
Deployment error iPhoneOS
Post the recent update to Xcode 12.x (12A7300), I found opening an app returned the following deployment error
Cannot show Automatic Strong Passwords - iCloud Keychain is disabled
[AutoFill] Cannot show Automatic Strong Passwords for app bundleID: your.bundle.id due to error: iCloud Keychain is disabled
This error occurs when the system's user doesn't have iCloud Keychain enabled. This will often be the case on the Simulator. Try it on one of your devices and see what happens. I received this message on one of my devices where iCloud Keychain is enabled:
SwiftUI - initialiser without initialising and binding parameters errors
Whilst working through an edit person view in a SwiftUI project, I experienced the following two errors:
SwiftUI String to Binding<String> error
After creating a new view with a @Binding
string as follows
struct EditRival: View { @Environment(\.presentationMode) var presentationMode @EnvironmentObject var realmPerson: RealmPersons @Binding var uid: String
The previews struct had an error with the var previews
Validating email in Swift or SwiftUI
I'm currently working on a project that requires login, register, forget password functionality in SwiftUI. As I'm developing the code, I came across a great resource for validating an email address with Regex:
Contact list showing known contacts and the contacts in my phone
Building a contact list using SwiftUI has many challenges.
One challenge is having multiple lists displayed on the one screen. For example, known contacts using your app against contacts on the phone. Initially, I tried the following code
Realm object with NSPredicate
What to do when you want to filter a Realm object, using NSPredicate in SwiftUI or in Swift.
Applying the filter to a simple condition in one line
let exists = realm.objects(ExampleObj.self).filter(NSPredicate(format: "uid = %ld", uid))
Creating a variable predicate that will be injected as a condition
Uploading plist data to the server using an API
I had an instance where I needed to move content from a plist to the server database. To achieve this step, I added a few lines of code where the plist was called and added a call to the API so the data would be on the server.
The original code appeared as: