Skip to content

Commit

Permalink
Update project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
PSchmiedmayer committed Aug 8, 2023
1 parent 2316c7f commit 753792a
Show file tree
Hide file tree
Showing 14 changed files with 109 additions and 55 deletions.
16 changes: 9 additions & 7 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
#
# SPDX-License-Identifier: MIT
#



# The whitelist_rules configuration also includes rules that are enabled by default to provide a good overview of all rules.
only_rules:
# All Images that provide context should have an accessibility label. Purely decorative images can be hidden from accessibility.
- accessibility_label_for_image
# Attributes should be on their own lines in functions and types, but on the same line as variables and imports.
- attributes
# Prefer using Array(seq) over seq.map { $0 } to convert a sequence into an Array.
- array_init
# Prefer the new block based KVO API with keypaths when using Swift 3.2 or later.
Expand Down Expand Up @@ -139,8 +142,6 @@ only_rules:
- implicitly_unwrapped_optional
# Identifiers should use inclusive language that avoids discrimination against groups of people based on race, gender, or socioeconomic status
- inclusive_language
# If defer is at the end of its parent scope, it will be executed right where it is anyway.
- inert_defer
# Prefer using Set.isDisjoint(with:) over Set.intersection(_:).isEmpty.
- is_disjoint
# Discouraged explicit usage of the default separator.
Expand Down Expand Up @@ -329,8 +330,6 @@ only_rules:
- unowned_variable_capture
# Catch statements should not declare error variables without type casting.
- untyped_error_in_catch
# Unused reference in a capture list should be removed.
- unused_capture_list
# Unused parameter in a closure should be replaced with _.
- unused_closure_parameter
# Unused control flow label should be removed.
Expand Down Expand Up @@ -371,6 +370,9 @@ only_rules:
# The variable should be placed on the left, the constant on the right of a comparison operator.
- yoda_condition

attributes:
attributes_with_arguments_always_on_line_above: false

deployment_target: # Availability checks or attributes shouldn’t be using older versions that are satisfied by the deployment target.
iOSApplicationExtension_deployment_target: 16.0
iOS_deployment_target: 16.0
Expand All @@ -381,8 +383,8 @@ excluded: # paths to ignore during linting. Takes precedence over `included`.
- .derivedData

closure_body_length: # Closure bodies should not span too many lines.
- 100 # warning - default: 20
- 100 # error - default: 100
- 35 # warning - default: 20
- 35 # error - default: 100

enum_case_associated_values_count: # Number of associated values in an enum case should be low
- 5 # warning - default: 5
Expand Down
75 changes: 58 additions & 17 deletions OwnYourData.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@

/* Begin PBXBuildFile section */
27DD24A429CCE56400A6EEBC /* WebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27DD24A329CCE56300A6EEBC /* WebView.swift */; };
2F2146F12A82AF05007CB929 /* Spezi in Frameworks */ = {isa = PBXBuildFile; productRef = 2F2146F02A82AF05007CB929 /* Spezi */; };
2F2146F42A82AF7F007CB929 /* SpeziOpenAI in Frameworks */ = {isa = PBXBuildFile; productRef = 2F2146F32A82AF7F007CB929 /* SpeziOpenAI */; };
2F2146F72A82AF9B007CB929 /* SpeziOnboarding in Frameworks */ = {isa = PBXBuildFile; productRef = 2F2146F62A82AF9B007CB929 /* SpeziOnboarding */; };
2F2146FB2A82B02D007CB929 /* OwnYourDateStandard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F2146FA2A82B02D007CB929 /* OwnYourDateStandard.swift */; };
2F2146FE2A82B236007CB929 /* SpeziFirebaseAccount in Frameworks */ = {isa = PBXBuildFile; productRef = 2F2146FD2A82B236007CB929 /* SpeziFirebaseAccount */; };
2F2147002A82B236007CB929 /* SpeziFirebaseConfiguration in Frameworks */ = {isa = PBXBuildFile; productRef = 2F2146FF2A82B236007CB929 /* SpeziFirebaseConfiguration */; };
2F2147022A82B236007CB929 /* SpeziFirestore in Frameworks */ = {isa = PBXBuildFile; productRef = 2F2147012A82B236007CB929 /* SpeziFirestore */; };
2F2147052A82B6BB007CB929 /* Spezi in Frameworks */ = {isa = PBXBuildFile; productRef = 2F2147042A82B6BB007CB929 /* Spezi */; };
2F46BA1B2A82B80A000AE87D /* SpeziHealthKit in Frameworks */ = {isa = PBXBuildFile; productRef = 2F46BA1A2A82B80A000AE87D /* SpeziHealthKit */; };
2F4E237E2989A2FE0013F3D9 /* OnboardingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F4E237D2989A2FE0013F3D9 /* OnboardingTests.swift */; };
2F4E23812989C5930013F3D9 /* XCTHealthKit in Frameworks */ = {isa = PBXBuildFile; productRef = 2F4E23802989C5930013F3D9 /* XCTHealthKit */; };
2F4E23832989D51F0013F3D9 /* TemplateAppTestingSetup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F4E23822989D51F0013F3D9 /* TemplateAppTestingSetup.swift */; };
Expand Down Expand Up @@ -143,10 +147,14 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
2F2146F12A82AF05007CB929 /* Spezi in Frameworks */,
2F2147052A82B6BB007CB929 /* Spezi in Frameworks */,
2F46BA1B2A82B80A000AE87D /* SpeziHealthKit in Frameworks */,
2F6025D029BBEC610045459E /* FirebaseAuth in Frameworks */,
2F2146F42A82AF7F007CB929 /* SpeziOpenAI in Frameworks */,
2F2146FE2A82B236007CB929 /* SpeziFirebaseAccount in Frameworks */,
2F2147022A82B236007CB929 /* SpeziFirestore in Frameworks */,
2F2146F72A82AF9B007CB929 /* SpeziOnboarding in Frameworks */,
2F2147002A82B236007CB929 /* SpeziFirebaseConfiguration in Frameworks */,
2FB2944029CBA4AE00EE91A0 /* ImageSource in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -363,9 +371,13 @@
packageProductDependencies = (
2F6025CF29BBEC610045459E /* FirebaseAuth */,
2FB2943F29CBA4AE00EE91A0 /* ImageSource */,
2F2146F02A82AF05007CB929 /* Spezi */,
2F2146F32A82AF7F007CB929 /* SpeziOpenAI */,
2F2146F62A82AF9B007CB929 /* SpeziOnboarding */,
2F2146FD2A82B236007CB929 /* SpeziFirebaseAccount */,
2F2146FF2A82B236007CB929 /* SpeziFirebaseConfiguration */,
2F2147012A82B236007CB929 /* SpeziFirestore */,
2F2147042A82B6BB007CB929 /* Spezi */,
2F46BA1A2A82B80A000AE87D /* SpeziHealthKit */,
);
productName = TemplateApplication;
productReference = 653A254D283387FE005D4D48 /* OwnYourData.app */;
Expand Down Expand Up @@ -448,11 +460,12 @@
2FEE103B2998E580000822E1 /* XCRemoteSwiftPackageReference "XCTestExtensions" */,
2F6025CE29BBEC610045459E /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
2FB2943E29CBA4AE00EE91A0 /* XCRemoteSwiftPackageReference "ImageSource" */,
2F2146EF2A82AF05007CB929 /* XCRemoteSwiftPackageReference "Spezi" */,
2F2146F22A82AF7F007CB929 /* XCRemoteSwiftPackageReference "SpeziML" */,
2F2146F52A82AF9B007CB929 /* XCRemoteSwiftPackageReference "SpeziOnboarding" */,
2F2146F82A82AFB1007CB929 /* XCRemoteSwiftPackageReference "SpeziAccount" */,
2F2146F92A82AFE1007CB929 /* XCRemoteSwiftPackageReference "SpeziHealthKit" */,
2F2146FC2A82B236007CB929 /* XCRemoteSwiftPackageReference "SpeziFirebase" */,
2F2147032A82B6BB007CB929 /* XCRemoteSwiftPackageReference "Spezi" */,
);
productRefGroup = 653A254E283387FE005D4D48 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -1063,14 +1076,6 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
2F2146EF2A82AF05007CB929 /* XCRemoteSwiftPackageReference "Spezi" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordSpezi/Spezi.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.7.0;
};
};
2F2146F22A82AF7F007CB929 /* XCRemoteSwiftPackageReference "SpeziML" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordSpezi/SpeziML.git";
Expand Down Expand Up @@ -1103,6 +1108,22 @@
kind = branch;
};
};
2F2146FC2A82B236007CB929 /* XCRemoteSwiftPackageReference "SpeziFirebase" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordSpezi/SpeziFirebase.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.4.0;
};
};
2F2147032A82B6BB007CB929 /* XCRemoteSwiftPackageReference "Spezi" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordSpezi/Spezi.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.7.0;
};
};
2F4E237F2989C5930013F3D9 /* XCRemoteSwiftPackageReference "XCTHealthKit" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordBDHG/XCTHealthKit";
Expand Down Expand Up @@ -1138,11 +1159,6 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
2F2146F02A82AF05007CB929 /* Spezi */ = {
isa = XCSwiftPackageProductDependency;
package = 2F2146EF2A82AF05007CB929 /* XCRemoteSwiftPackageReference "Spezi" */;
productName = Spezi;
};
2F2146F32A82AF7F007CB929 /* SpeziOpenAI */ = {
isa = XCSwiftPackageProductDependency;
package = 2F2146F22A82AF7F007CB929 /* XCRemoteSwiftPackageReference "SpeziML" */;
Expand All @@ -1153,6 +1169,31 @@
package = 2F2146F52A82AF9B007CB929 /* XCRemoteSwiftPackageReference "SpeziOnboarding" */;
productName = SpeziOnboarding;
};
2F2146FD2A82B236007CB929 /* SpeziFirebaseAccount */ = {
isa = XCSwiftPackageProductDependency;
package = 2F2146FC2A82B236007CB929 /* XCRemoteSwiftPackageReference "SpeziFirebase" */;
productName = SpeziFirebaseAccount;
};
2F2146FF2A82B236007CB929 /* SpeziFirebaseConfiguration */ = {
isa = XCSwiftPackageProductDependency;
package = 2F2146FC2A82B236007CB929 /* XCRemoteSwiftPackageReference "SpeziFirebase" */;
productName = SpeziFirebaseConfiguration;
};
2F2147012A82B236007CB929 /* SpeziFirestore */ = {
isa = XCSwiftPackageProductDependency;
package = 2F2146FC2A82B236007CB929 /* XCRemoteSwiftPackageReference "SpeziFirebase" */;
productName = SpeziFirestore;
};
2F2147042A82B6BB007CB929 /* Spezi */ = {
isa = XCSwiftPackageProductDependency;
package = 2F2147032A82B6BB007CB929 /* XCRemoteSwiftPackageReference "Spezi" */;
productName = Spezi;
};
2F46BA1A2A82B80A000AE87D /* SpeziHealthKit */ = {
isa = XCSwiftPackageProductDependency;
package = 2F2146F92A82AFE1007CB929 /* XCRemoteSwiftPackageReference "SpeziHealthKit" */;
productName = SpeziHealthKit;
};
2F4E23802989C5930013F3D9 /* XCTHealthKit */ = {
isa = XCSwiftPackageProductDependency;
package = 2F4E237F2989C5930013F3D9 /* XCRemoteSwiftPackageReference "XCTHealthKit" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@
"version" : "0.4.0"
}
},
{
"identity" : "spezifirebase",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziFirebase.git",
"state" : {
"revision" : "d57ddfb71d7ece1e5fecf1a1df34dc93e2c7c58d",
"version" : "0.4.0"
}
},
{
"identity" : "spezihealthkit",
"kind" : "remoteSourceControl",
Expand Down
15 changes: 6 additions & 9 deletions TemplateApplication/Onboarding/AccountSetup/AccountSetup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
// SPDX-License-Identifier: MIT
//

import Account
import FirebaseAccount
import FirebaseAuth
import FirebaseFirestore
import Onboarding
import SpeziAccount
import SpeziFirebaseAccount
import SpeziOnboarding
import SwiftUI


Expand Down Expand Up @@ -74,8 +74,7 @@ struct AccountSetup: View {
}
}

@ViewBuilder
private var accountImage: some View {
@ViewBuilder private var accountImage: some View {
Group {
if account.signedIn {
Image(systemName: "person.badge.shield.checkmark.fill")
Expand All @@ -87,8 +86,7 @@ struct AccountSetup: View {
.foregroundColor(.accentColor)
}

@ViewBuilder
private var accountDescription: some View {
@ViewBuilder private var accountDescription: some View {
VStack {
Group {
if account.signedIn {
Expand All @@ -109,8 +107,7 @@ struct AccountSetup: View {
}
}

@ViewBuilder
private var actionView: some View {
@ViewBuilder private var actionView: some View {
if account.signedIn {
OnboardingActionsView(
"ACCOUNT_NEXT".moduleLocalized,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-License-Identifier: MIT
//

import Account
import Onboarding
import SpeziAccount
import SpeziOnboarding
import SwiftUI


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-License-Identifier: MIT
//

import Account
import Onboarding
import SpeziAccount
import SpeziOnboarding
import SwiftUI


Expand Down
9 changes: 4 additions & 5 deletions TemplateApplication/Onboarding/AccountSetup/UserView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
// SPDX-License-Identifier: MIT
//

import Account
import FirebaseAccount
import Foundation
import SpeziAccount
import SpeziFirebaseAccount
import SpeziViews
import SwiftUI
import Views


struct UserView: View {
Expand All @@ -29,8 +29,7 @@ struct UserView: View {
}


@ViewBuilder
private var userInformation: some View {
@ViewBuilder private var userInformation: some View {
HStack(spacing: 16) {
if account.signedIn,
let user = firebaseAccountConfiguration.user,
Expand Down
2 changes: 1 addition & 1 deletion TemplateApplication/Onboarding/Consent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// SPDX-License-Identifier: MIT
//

import Onboarding
import SpeziOnboarding
import SwiftUI


Expand Down
2 changes: 1 addition & 1 deletion TemplateApplication/Onboarding/InterestingModules.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// SPDX-License-Identifier: MIT
//

import Onboarding
import SpeziOnboarding
import SwiftUI


Expand Down
2 changes: 1 addition & 1 deletion TemplateApplication/Onboarding/Welcome.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// SPDX-License-Identifier: MIT
//

import Onboarding
import SpeziOnboarding
import SwiftUI


Expand Down
9 changes: 8 additions & 1 deletion TemplateApplication/OwnYourDateStandard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@
// SPDX-License-Identifier: MIT
//

import HealthKit
import Spezi
import SpeziHealthKit


actor OwnYourDateStandard: Standard {
actor OwnYourDateStandard: Standard, HealthKitConstraint {
func add(_ response: HKSample) async {
print(response)
}

func remove(removalContext: SpeziHealthKit.HKSampleRemovalContext) {
print(removalContext)
}
}
2 changes: 1 addition & 1 deletion TemplateApplication/Tabs/Home.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-License-Identifier: MIT
//

import FirebaseAccount
import FirebaseAuth
import SpeziFirebaseAccount
import SwiftUI


Expand Down
2 changes: 1 addition & 1 deletion TemplateApplication/Tabs/ProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
// SPDX-License-Identifier: MIT
//

import FirebaseAccount
import FirebaseAuth
import FirebaseFirestore
import SpeziFirebaseAccount
import SwiftUI


Expand Down
Loading

0 comments on commit 753792a

Please sign in to comment.