Skip to content

Commit

Permalink
fix: Update ParseCareKit to 1.0.0-beta (#117)
Browse files Browse the repository at this point in the history
* fix: Update ParseCareKit to 1.0.0-beta

* update swiftlint

* bump dependencies

* improve navigation transitions

* deps

* update deps

* fix header

* Updare project settings

* nit

* update CI to Xcode 15
  • Loading branch information
cbaker6 authored Sep 24, 2023
1 parent 47365cd commit 4ee03a2
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:
branches: [ main ]

env:
CI_XCODE: '/Applications/Xcode_14.2.app/Contents/Developer'
CI_XCODE: '/Applications/Xcode_15.0.app/Contents/Developer'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: macos-latest
runs-on: macos-13
strategy:
matrix:
destination: ['-destination platform\=iOS\ Simulator,name\=iPhone\ 14\ Pro\ Max test', 'CODE_SIGNING_ALLOWED="NO"']
Expand Down
2 changes: 2 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ disabled_rules:
- weak_delegate
- file_length
- function_body_length
- blanket_disable_command
- multiple_closures_with_trailing_closure

12 changes: 8 additions & 4 deletions OCKSample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1200;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1500;
ORGANIZATIONNAME = "Network Reconnaissance Lab";
TargetAttributes = {
5173CB8623C3A846007655A0 = {
Expand Down Expand Up @@ -864,6 +864,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down Expand Up @@ -899,6 +900,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down Expand Up @@ -1093,6 +1095,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down Expand Up @@ -1128,6 +1131,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -1229,23 +1233,23 @@
repositoryURL = "https://github.com/cbaker6/CareKit.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = "3.0.0-alpha.22";
minimumVersion = "3.0.0-beta.2";
};
};
703616FD29CA194900B50BC5 /* XCRemoteSwiftPackageReference "CareKitUtilities" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/netreconlab/CareKitUtilities.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = "1.0.0-alpha.2";
minimumVersion = 0.1.1;
};
};
918FDEAD271B3F8F0045A0EF /* XCRemoteSwiftPackageReference "ParseCareKit" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/netreconlab/ParseCareKit.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = "1.0.0-alpha.80";
minimumVersion = "1.0.0-beta.3";
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,44 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/cbaker6/CareKit.git",
"state" : {
"revision" : "698176a292e3077f7a30496c42f9e8392328930e",
"version" : "3.0.0-alpha.22"
"revision" : "ed05957648de96d7ad8a81bd24edff3ee712f20e",
"version" : "3.0.0-beta.2"
}
},
{
"identity" : "carekitutilities",
"kind" : "remoteSourceControl",
"location" : "https://github.com/netreconlab/CareKitUtilities.git",
"state" : {
"revision" : "7c7be19c8f652589fe97692df92cd7ffb634c41c",
"version" : "1.0.0-alpha.2"
"revision" : "741d8964126c03b7035d1e416fe143ec31415773",
"version" : "0.1.1"
}
},
{
"identity" : "fhirmodels",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/FHIRModels.git",
"state" : {
"revision" : "c91e5bb74397136f79656bebdfda76a523d3e88c",
"version" : "0.3.2"
"revision" : "e115442fb3c5d44ffb1dc9b4e039b77fd143ad96",
"version" : "0.4.0"
}
},
{
"identity" : "parse-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/netreconlab/Parse-Swift.git",
"state" : {
"revision" : "a746db0bf4e9a2b3b33bc0a7f9dbcaf79feb0c8b",
"version" : "5.4.2"
"revision" : "fc516a6e48c1c150a0ecac94910bc8dcedfc2e71",
"version" : "5.8.1"
}
},
{
"identity" : "parsecarekit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/netreconlab/ParseCareKit.git",
"state" : {
"revision" : "566f68ef230e4285eb9e19a3d1045947d5a74eef",
"version" : "1.0.0-alpha.80"
"revision" : "1b4bb74e48b49851803d861a53cfb9790d5757d5",
"version" : "1.0.0-beta.3"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1500"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion OCKSample/Extensions/PCKUtility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ extension PCKUtility {
- throws: `ParseError`.
*/
static func isServerAvailable() async throws -> Bool {
try await ParseHealth.check() == .ok
try await ParseServer.health() == .ok
}
}
2 changes: 1 addition & 1 deletion OCKSample/Main/Care/CareView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct CareView: UIViewControllerRepresentable {
guard careViewController.store !== careStore ||
appDelegate?.isFirstTimeLogin == true else {
// No need to replace view
// careViewController.events = events
careViewController.events = events
return
}
navigationController.setViewControllers([createViewController()], animated: false)
Expand Down
4 changes: 2 additions & 2 deletions OCKSample/Main/Care/CareViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class CareViewController: OCKDailyPageViewController {
event.computeProgress(by: .checkingOutcomeExists)
}) {
super.init(store: store, computeProgress: computeProgress)
// self.events = events
self.events = events
}

override func viewDidLoad() {
Expand Down Expand Up @@ -207,7 +207,7 @@ class CareViewController: OCKDailyPageViewController {
guard let event = getStoreFetchRequestEvent(for: task.id) else {
return nil
}
let view = NumericProgressTaskView(event: event)
let view = NumericProgressTaskView<_NumericProgressTaskViewHeader>(event: event, numberFormatter: .none)
.careKitStyle(CustomStylerKey.defaultValue)

return [view.formattedHostingController()]
Expand Down
15 changes: 10 additions & 5 deletions OCKSample/Main/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ struct MainView: View {
}
.onAppear {
guard isSyncingWithRemote else {
path = [.tabs]
updatePath([.tabs])
return
}
guard !loginViewModel.isLoggedOut else {
path = []
updatePath([])
return
}
path = [.tabs]
updatePath([.tabs])
}
}
.environment(\.careStore, storeCoordinator)
.onReceive(loginViewModel.$isLoggedOut, perform: { isLoggedOut in
guard !isLoggedOut else {
path = []
updatePath([])
return
}
path = [.tabs]
updatePath([.tabs])
})
.onReceive(appDelegate.$storeCoordinator) { newStoreCoordinator in
guard storeCoordinator !== newStoreCoordinator else {
Expand All @@ -58,6 +58,11 @@ struct MainView: View {
storeCoordinator = newStoreCoordinator
}
}

@MainActor
func updatePath(_ path: [MainViewPath]) {
self.path = path
}
}

struct MainView_Previews: PreviewProvider {
Expand Down
21 changes: 13 additions & 8 deletions OCKWatchSample Extension/Main/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,27 @@ struct MainView: View {
.navigationBarHidden(true)
.onAppear {
guard isSyncingWithRemote else {
path = [.tabs]
updatePath([.tabs])
return
}
guard !loginViewModel.isLoggedOut else {
path = []
updatePath([])
return
}
path = [.tabs]
updatePath([.tabs])
}
}
.environment(\.careStore, store)
.onReceive(loginViewModel.$isLoggedOut, perform: { isLoggedOut in
guard isSyncingWithRemote else {
path = [.tabs]
updatePath([.tabs])
return
}
guard !isLoggedOut else {
path = []
updatePath([])
return
}
path = [.tabs]
updatePath([.tabs])
})
.onReceive(appDelegate.$store) { newStore in
Task {
Expand All @@ -62,12 +62,17 @@ struct MainView: View {
}
store = newStore
guard isSyncingWithRemote else {
path = [.tabs]
updatePath([.tabs])
return
}
path = [.tabs]
updatePath([.tabs])
}
}

@MainActor
func updatePath(_ path: [MainViewPath]) {
self.path = path
}
}

struct MainView_Previews: PreviewProvider {
Expand Down

0 comments on commit 4ee03a2

Please sign in to comment.