Skip to content

Commit

Permalink
Merge pull request #212 from WildAid/realm-beta3
Browse files Browse the repository at this point in the history
Port to Realm Sync Beta 3
  • Loading branch information
am-MongoDB authored Aug 31, 2020
2 parents fe217e4 + 6709a4b commit fd1e055
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 24 deletions.
8 changes: 4 additions & 4 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '13.5'

target 'o-fish-ios' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

pod 'RealmSwift', '= 10.0.0-beta.2'
pod 'RealmSwift', '= 10.0.0-beta.3'
pod 'SwiftLint'
end

target 'O-FISHTests' do
use_frameworks!

pod 'RealmSwift', '= 10.0.0-beta.2'
pod 'RealmSwift', '= 10.0.0-beta.3'
pod 'SwiftLint'
end
18 changes: 9 additions & 9 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
PODS:
- Realm (10.0.0-beta.2):
- Realm/Headers (= 10.0.0-beta.2)
- Realm/Headers (10.0.0-beta.2)
- RealmSwift (10.0.0-beta.2):
- Realm (= 10.0.0-beta.2)
- Realm (10.0.0-beta.3):
- Realm/Headers (= 10.0.0-beta.3)
- Realm/Headers (10.0.0-beta.3)
- RealmSwift (10.0.0-beta.3):
- Realm (= 10.0.0-beta.3)
- SwiftLint (0.39.2)

DEPENDENCIES:
- RealmSwift (= 10.0.0-beta.2)
- RealmSwift (= 10.0.0-beta.3)
- SwiftLint

SPEC REPOS:
Expand All @@ -17,10 +17,10 @@ SPEC REPOS:
- SwiftLint

SPEC CHECKSUMS:
Realm: 211e32e680c354c9b1a2bdc0e3aeb01c25849641
RealmSwift: f9043abf9b6821ad5c3032c2a36b5ddfc90b4ce3
Realm: f563a59a1016ce551fd87e39df79d393bd06e56d
RealmSwift: 4b79ee6f9b67bf71b8122370e2614892912f7172
SwiftLint: 22ccbbe3b8008684be5955693bab135e0ed6a447

PODFILE CHECKSUM: 9ec5f64302cf8c73a358708ff9d734779544293c
PODFILE CHECKSUM: 6b596eacc83719a9cb67b0065800238f8413879a

COCOAPODS: 1.9.3
4 changes: 2 additions & 2 deletions o-fish-ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1972,7 +1972,7 @@
DEVELOPMENT_TEAM = PH747F3726;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = "o-fish-ios/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
IPHONEOS_DEPLOYMENT_TARGET = 13.5;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -1995,7 +1995,7 @@
DEVELOPMENT_TEAM = PH747F3726;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = "o-fish-ios/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
IPHONEOS_DEPLOYMENT_TARGET = 13.5;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
15 changes: 10 additions & 5 deletions o-fish-ios/Helpers/RealmConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class RealmConnection {
return profilePic
}

private static let app = RealmApp(id: Constants.realmAppId)
private static let app = App(id: Constants.realmAppId)

static func logIn(username: String,
password: String,
Expand All @@ -89,14 +89,15 @@ class RealmConnection {
print("Already logged in")
completion(.success("User already logged in"))
} else {
let appCredentials = AppCredentials(username: username.lowercased(), password: password)
app.login(withCredential: appCredentials) { (user, error) in
let credentials = RealmSwift.Credentials(username: username.lowercased(), password: password)
app.login(credentials: credentials) { (user, error) in
if let error = error {
self.user = nil
print("\(RealmConnectionError.cannotLogin.localizedDescription) : \(error.localizedDescription)")
completion(.failure(RealmConnectionError.cannotLogin))
return
}

self.user = user
print("Logged into Realm")
completion(.success("Logged into Realm"))
Expand Down Expand Up @@ -124,11 +125,15 @@ class RealmConnection {
}

static func logout() {
app.logOut { error in
guard let user = user else {
print("Attempting to logout when no user logged in")
return
}
user.logOut { error in
if let error = error {
print("Failed to logout of Realm: \(error.localizedDescription)")
} else {
user = nil
self.user = nil
realm = nil
}
}
Expand Down
4 changes: 2 additions & 2 deletions o-fish-ios/Views/Components/BoardVesselButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ struct BoardVesselButton: View {
}),
secondaryButton: .cancel())
}

NavigationLink(destination: ReportNavigationRootView(report: prefilledReport,
prefilledVesselAvailable: true,
rootIsActive: $rootIsActive),
isActive: $showingReportRootView) {
EmptyView()
}

}
}

Expand Down
2 changes: 1 addition & 1 deletion o-fish-ios/Views/Components/ModalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct ModalViewButton: Identifiable {
}

extension ModalViewButton: Equatable {
public static func ==(lhs: ModalViewButton, rhs: ModalViewButton) -> Bool {
public static func == (lhs: ModalViewButton, rhs: ModalViewButton) -> Bool {
lhs.id == rhs.id
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct BusinessPickerData {
}

extension BusinessPickerData: Equatable {
static func ==(lhs: BusinessPickerData, rhs: BusinessPickerData) -> Bool {
static func == (lhs: BusinessPickerData, rhs: BusinessPickerData) -> Bool {
lhs.business == rhs.business && lhs.location == rhs.location
}
}
Expand Down

0 comments on commit fd1e055

Please sign in to comment.