Skip to content

Commit

Permalink
Small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
p2 committed Oct 13, 2016
1 parent c84e82c commit b02e445
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 112 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
Carthage

# Xcode user data
**.pbxuser
Expand Down
89 changes: 0 additions & 89 deletions C3PRO.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,7 @@
EEC5A8271D5CAF7200753852 /* CoreMotionStandardActivityInterpreter.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEC5A81C1D5CAF7200753852 /* CoreMotionStandardActivityInterpreter.swift */; };
EEC5A8281D5CAF7200753852 /* HealthKitReporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEC5A81D1D5CAF7200753852 /* HealthKitReporter.swift */; };
EEC5A8291D5CAF7200753852 /* InterpretedCoreMotionActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEC5A81E1D5CAF7200753852 /* InterpretedCoreMotionActivity.swift */; };
EEC5A8481D5CAFF200753852 /* fts3_tokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = EEC5A82F1D5CAFF200753852 /* fts3_tokenizer.h */; };
EEC5A8491D5CAFF200753852 /* SQLite-Bridging.h in Headers */ = {isa = PBXBuildFile; fileRef = EEC5A8301D5CAFF200753852 /* SQLite-Bridging.h */; };
EEC5A84A1D5CAFF200753852 /* SQLite-Bridging.m in Sources */ = {isa = PBXBuildFile; fileRef = EEC5A8311D5CAFF200753852 /* SQLite-Bridging.m */; };
EEC5A85E1D5CB19E00753852 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = EEC5A85D1D5CB19E00753852 /* libsqlite3.tbd */; };
EEC5A8601D5CB27000753852 /* sqlite3.h in Headers */ = {isa = PBXBuildFile; fileRef = EEC5A85F1D5CB27000753852 /* sqlite3.h */; };
EEC5A8621D5CB2CC00753852 /* SQLite.h in Headers */ = {isa = PBXBuildFile; fileRef = EEC5A8611D5CB2CC00753852 /* SQLite.h */; };
EEC6DC2B1C4D3CDD00A42E87 /* SystemPermissionTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEC6DC2A1C4D3CDD00A42E87 /* SystemPermissionTableViewController.swift */; };
EEC6DC3D1C4D4F0200A42E87 /* C3PRO.strings in Resources */ = {isa = PBXBuildFile; fileRef = EEC6DC3F1C4D4F0200A42E87 /* C3PRO.strings */; };
EEE091FE1D66105C00F1C829 /* EncryptionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEE091FD1D66105C00F1C829 /* EncryptionTests.swift */; };
Expand Down Expand Up @@ -154,30 +149,7 @@
EEC5A81C1D5CAF7200753852 /* CoreMotionStandardActivityInterpreter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreMotionStandardActivityInterpreter.swift; sourceTree = "<group>"; };
EEC5A81D1D5CAF7200753852 /* HealthKitReporter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HealthKitReporter.swift; sourceTree = "<group>"; };
EEC5A81E1D5CAF7200753852 /* InterpretedCoreMotionActivity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InterpretedCoreMotionActivity.swift; sourceTree = "<group>"; };
EEC5A82D1D5CAFF200753852 /* Blob.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Blob.swift; sourceTree = "<group>"; };
EEC5A82E1D5CAFF200753852 /* Connection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Connection.swift; sourceTree = "<group>"; };
EEC5A82F1D5CAFF200753852 /* fts3_tokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fts3_tokenizer.h; sourceTree = "<group>"; };
EEC5A8301D5CAFF200753852 /* SQLite-Bridging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SQLite-Bridging.h"; sourceTree = "<group>"; };
EEC5A8311D5CAFF200753852 /* SQLite-Bridging.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "SQLite-Bridging.m"; sourceTree = "<group>"; };
EEC5A8321D5CAFF200753852 /* Statement.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Statement.swift; sourceTree = "<group>"; };
EEC5A8331D5CAFF200753852 /* Value.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Value.swift; sourceTree = "<group>"; };
EEC5A8351D5CAFF200753852 /* FTS4.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FTS4.swift; sourceTree = "<group>"; };
EEC5A8361D5CAFF200753852 /* FTS5.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FTS5.swift; sourceTree = "<group>"; };
EEC5A8371D5CAFF200753852 /* R*Tree.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "R*Tree.swift"; sourceTree = "<group>"; };
EEC5A8381D5CAFF200753852 /* Foundation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Foundation.swift; sourceTree = "<group>"; };
EEC5A8391D5CAFF200753852 /* Helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Helpers.swift; sourceTree = "<group>"; };
EEC5A83D1D5CAFF200753852 /* AggregateFunctions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AggregateFunctions.swift; sourceTree = "<group>"; };
EEC5A83E1D5CAFF200753852 /* Collation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Collation.swift; sourceTree = "<group>"; };
EEC5A83F1D5CAFF200753852 /* CoreFunctions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreFunctions.swift; sourceTree = "<group>"; };
EEC5A8401D5CAFF200753852 /* CustomFunctions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomFunctions.swift; sourceTree = "<group>"; };
EEC5A8411D5CAFF200753852 /* Expression.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Expression.swift; sourceTree = "<group>"; };
EEC5A8421D5CAFF200753852 /* Operators.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Operators.swift; sourceTree = "<group>"; };
EEC5A8431D5CAFF200753852 /* Query.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Query.swift; sourceTree = "<group>"; };
EEC5A8441D5CAFF200753852 /* Schema.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Schema.swift; sourceTree = "<group>"; };
EEC5A8451D5CAFF200753852 /* Setter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Setter.swift; sourceTree = "<group>"; };
EEC5A85D1D5CB19E00753852 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; };
EEC5A85F1D5CB27000753852 /* sqlite3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sqlite3.h; path = ../iPhoneOS.sdk/usr/include/sqlite3.h; sourceTree = SDKROOT; };
EEC5A8611D5CB2CC00753852 /* SQLite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SQLite.h; path = SQLiteSwift/SQLite/SQLite.h; sourceTree = SOURCE_ROOT; };
EEC6DC2A1C4D3CDD00A42E87 /* SystemPermissionTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SystemPermissionTableViewController.swift; sourceTree = "<group>"; };
EEC6DC3E1C4D4F0200A42E87 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/C3PRO.strings; sourceTree = "<group>"; };
EEE091FD1D66105C00F1C829 /* EncryptionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EncryptionTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -346,61 +318,6 @@
path = Sources/Encryption;
sourceTree = "<group>";
};
EEC5A82B1D5CAFF200753852 /* SQLite DEACTIVATED FOR NOW */ = {
isa = PBXGroup;
children = (
EEC5A82C1D5CAFF200753852 /* Core */,
EEC5A8341D5CAFF200753852 /* Extensions */,
EEC5A83C1D5CAFF200753852 /* Typed */,
EEC5A8381D5CAFF200753852 /* Foundation.swift */,
EEC5A8391D5CAFF200753852 /* Helpers.swift */,
);
name = "SQLite DEACTIVATED FOR NOW";
path = SQLiteSwift/SQLite;
sourceTree = SOURCE_ROOT;
};
EEC5A82C1D5CAFF200753852 /* Core */ = {
isa = PBXGroup;
children = (
EEC5A85F1D5CB27000753852 /* sqlite3.h */,
EEC5A8611D5CB2CC00753852 /* SQLite.h */,
EEC5A82F1D5CAFF200753852 /* fts3_tokenizer.h */,
EEC5A8301D5CAFF200753852 /* SQLite-Bridging.h */,
EEC5A8311D5CAFF200753852 /* SQLite-Bridging.m */,
EEC5A82D1D5CAFF200753852 /* Blob.swift */,
EEC5A82E1D5CAFF200753852 /* Connection.swift */,
EEC5A8321D5CAFF200753852 /* Statement.swift */,
EEC5A8331D5CAFF200753852 /* Value.swift */,
);
path = Core;
sourceTree = "<group>";
};
EEC5A8341D5CAFF200753852 /* Extensions */ = {
isa = PBXGroup;
children = (
EEC5A8351D5CAFF200753852 /* FTS4.swift */,
EEC5A8361D5CAFF200753852 /* FTS5.swift */,
EEC5A8371D5CAFF200753852 /* R*Tree.swift */,
);
path = Extensions;
sourceTree = "<group>";
};
EEC5A83C1D5CAFF200753852 /* Typed */ = {
isa = PBXGroup;
children = (
EEC5A83D1D5CAFF200753852 /* AggregateFunctions.swift */,
EEC5A83E1D5CAFF200753852 /* Collation.swift */,
EEC5A83F1D5CAFF200753852 /* CoreFunctions.swift */,
EEC5A8401D5CAFF200753852 /* CustomFunctions.swift */,
EEC5A8411D5CAFF200753852 /* Expression.swift */,
EEC5A8421D5CAFF200753852 /* Operators.swift */,
EEC5A8431D5CAFF200753852 /* Query.swift */,
EEC5A8441D5CAFF200753852 /* Schema.swift */,
EEC5A8451D5CAFF200753852 /* Setter.swift */,
);
path = Typed;
sourceTree = "<group>";
};
EEEA7F3D1BD61E4B0089BF85 /* StudyIntro */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -453,7 +370,6 @@
EEB6DD211B5D3FA3006A3B9F /* DeIdentifier */,
EEEA7FC11BD784B20089BF85 /* ViewController & Views */,
EEEA7FC91BD784BA0089BF85 /* Extensions */,
EEC5A82B1D5CAFF200753852 /* SQLite DEACTIVATED FOR NOW */,
EEFA84BE1AE5C18B00E61006 /* Supporting Files */,
EEFA84CA1AE5C18B00E61006 /* Tests */,
EEFA84BC1AE5C18B00E61006 /* Products */,
Expand Down Expand Up @@ -525,10 +441,6 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
EEC5A8621D5CB2CC00753852 /* SQLite.h in Headers */,
EEC5A8491D5CAFF200753852 /* SQLite-Bridging.h in Headers */,
EEC5A8601D5CB27000753852 /* sqlite3.h in Headers */,
EEC5A8481D5CAFF200753852 /* fts3_tokenizer.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -685,7 +597,6 @@
EE8901171B7DF08300F1EDBF /* Contract+C3-PRO.swift in Sources */,
EE86C48D1C4AB47500B7D486 /* PermissionRequestTableViewCell.swift in Sources */,
EEC5A8271D5CAF7200753852 /* CoreMotionStandardActivityInterpreter.swift in Sources */,
EEC5A84A1D5CAFF200753852 /* SQLite-Bridging.m in Sources */,
EEFA84DB1AE5C25500E61006 /* QuestionnairePromise.swift in Sources */,
EEC6DC2B1C4D3CDD00A42E87 /* SystemPermissionTableViewController.swift in Sources */,
EEC5A8211D5CAF7200753852 /* ActivityReporter.swift in Sources */,
Expand Down
4 changes: 2 additions & 2 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# require ResearchKit
github "ResearchKit/ResearchKit" ~> 1.3.1
github "ResearchKit/ResearchKit" "master"

# require SMART
github "smart-on-fhir/Swift-SMART" "master"
github "smart-on-fhir/Swift-SMART" == 2.8.1

# require CryptoSwift
github "krzyzanowskim/CryptoSwift" ~> 0.6.0
Expand Down
39 changes: 27 additions & 12 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
Installation
============

There are two ways to use the _C3-PRO_ iOS framework: install via _CocoaPods_ or a _manual_ install.
There are two ways to use the _C3-PRO_ iOS framework: install via _Carthage_ or a _manual_ install.

The CocoaPods install is **not yet functional**, hope to resolve issues with it soon.

Carthage
--------

You can use [Carthage](https://github.com/Carthage/Carthage), a modern iOS framework manager, to use the C3-PRO iOS framework.
Put this in your `Cartfile`, then run `carthage update --platform "iOS"`:

```ogdl
github "C3-PRO/c3-pro-ios-framework.git" ~> 1.8
```

Check the matrix above to see which version you should be using.
Now, on your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”.
Create a Run Script in which you specify your shell (ex: bin/sh), add the following contents to the script area below the shell:

```bash
/usr/local/bin/carthage copy-frameworks

$(SRCROOT)/Carthage/Build/iOS/C3PRO.framework
$(SRCROOT)/Carthage/Build/iOS/ResearchKit/ResearchKit.framework
$(SRCROOT)/Carthage/Build/iOS/Swift-SMART/SwiftSMART.framework
$(SRCROOT)/Carthage/Build/iOS/CryptoSwift/CryptoSwift.framework
$(SRCROOT)/Carthage/Build/iOS/SQLiteSwift/SQLite.framework
```

Make sure you drag & drop these frameworks into the “Embedded Binaries” in the “General” settings tab of your app the first time you set up Carthage.


Manual Installation
Expand Down Expand Up @@ -65,16 +90,6 @@ Click on the <key>+</key> button and add:
You should now be able to build and run your app.


Carthage
--------

You can use [Carthage](https://github.com/Carthage/Carthage#installing-carthage) to install _C3-PRO_ using this `Cartfile`:

```
github "C3-PRO/c3-pro-ios-framework"
```


CocoaPods
---------

Expand Down
15 changes: 7 additions & 8 deletions Sources/Consent/ConsentController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ Callback used when signing the consent. Provides `Contract`, `Patient` and an op
public typealias ConsentSigningCallback = ((Contract, Patient, Error?) -> Void)

/// Name of notification sent when the user completes and agrees to consent.
public let C3UserDidConsentNotification = "C3UserDidConsentNotification"
public let C3UserDidConsentNotification = NSNotification.Name(rawValue: "C3UserDidConsentNotification")

/// Name of notification sent when the user cancels or declines to consent.
public let C3UserDidDeclineConsentNotification = "C3UserDidDeclineConsentNotification"
public let C3UserDidDeclineConsentNotification = NSNotification.Name(rawValue:"C3UserDidDeclineConsentNotification")

/// User info dictionary key containing the consenting result in a `C3UserDidConsentNotification` notification.
public let C3ConsentResultKey = "consent-result"
Expand Down Expand Up @@ -105,16 +105,15 @@ public class ConsentController {
Designated initializer.
You can optionally supply the name of a bundled JSON file (without extension) that represents a serialized FHIR Contract resource. This
uses the Bundle containing the C3PRO modules, so if you're calling the method from a different bundle (e.g. when unit testing), don't
provide a filename and assign `contract` manually by using `fhir_bundledResource(name:subdirectory:type:)`.
uses the main Bundle, so if you're calling the method from a different bundle (e.g. when unit testing), don't provide a filename and
assign `contract` manually by using `fhir_bundledResource(name:subdirectory:type:)`.
- parameter bundledContract: The filename (without ".json" of the Contract resource to read)
- parameter subdirectory: The subdirectory, if any, the Contract resource is located in
*/
public init(bundledContract: String? = nil, subdirectory: String? = nil) throws {
if let name = bundledContract {
let bundle = Bundle(for: type(of: self))
contract = try bundle.fhir_bundledResource(name, subdirectory: subdirectory, type: Contract.self)
contract = try Bundle.main.fhir_bundledResource(name, subdirectory: subdirectory, type: Contract.self)
}
}

Expand Down Expand Up @@ -323,7 +322,7 @@ public class ConsentController {
exec(taskViewController, result)
}
let userInfo = [C3ConsentResultKey: result]
NotificationCenter.default.post(name: Notification.Name(rawValue: C3UserDidConsentNotification), object: self, userInfo: userInfo)
NotificationCenter.default.post(name: C3UserDidConsentNotification, object: self, userInfo: userInfo)
}

/**
Expand All @@ -336,7 +335,7 @@ public class ConsentController {
if let exec = onUserDidDeclineConsent {
exec(taskViewController)
}
NotificationCenter.default.post(name: Notification.Name(rawValue: C3UserDidDeclineConsentNotification), object: self)
NotificationCenter.default.post(name: C3UserDidDeclineConsentNotification, object: self)
}


Expand Down
2 changes: 2 additions & 0 deletions Sources/HealthKit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Activity data interesting for research is available from two places from iOS: **
This module provides facilities to easily retrieve data from HealthKit, but more importantly helps persisting CoreMotion activity data beyond the 7 day OS default.
Minimal activity data preprocessing is included and can easily be customized.

**Note** that as of iOS 10, you must provide a short explanation for `NSHealthShareUsageDescription`, if you use HealthKit, and `NSMotionUsageDescription`, if you use CoreMotion, in your app's _Info.plist_.


Activity Reporter
=================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ open class PermissionRequestTableViewCell: UITableViewCell {
- parameter service: The system service that was affected
*/
open func indicateError(_ error: Error, for service: SystemService) {
commentLabel?.text = "\(error)."
commentLabel?.text = "\(error.localizedDescription)."
commentLabel?.textColor = UIColor.red
actionButton?.setTitle("Try Again".c3_localized("Button title"), for: UIControlState())
contentView.setNeedsLayout()
Expand Down
3 changes: 3 additions & 0 deletions Sources/SystemServices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ System Service Permissions
These classes provide facilities to prompt the user to allow certain system services, such as access to HealthKit, the device's current location, notifications and others.
These are represented as `SystemService` enums, some of which have associated values.

**Note** that as of iOS 10, you must provide a short explanation for `NSHealthShareUsageDescription`, if you use HealthKit, and `NSMotionUsageDescription`, if you use CoreMotion, in your app's _Info.plist_.


### Module Interface

#### IN
Expand Down

0 comments on commit b02e445

Please sign in to comment.