Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Swift Package Manager (SPM) config #13

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 67 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,70 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

.DS_Store

# Xcode user data
**.pbxuser
**.mode?v?
**.perspectivev?
**.xccheckout
**.xcscmblueprint
xcuserdata
## Build generated
build/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
Packages/
Package.pins
Package.resolved
.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
Carthage/Checkouts

Carthage/Build

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 1 addition & 0 deletions App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let masterNavi = splitViewController.viewControllers[splitViewController.viewControllers.startIndex] as! UINavigationController
let master = masterNavi.topViewController as! MasterViewController
master.endpointProvider = endpointProvider
master.detailViewController = navigationController.topViewController as? DetailViewController

return true
}
Expand Down
4 changes: 0 additions & 4 deletions App/MasterViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ class MasterViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
didSelectEndpoint()

if let split = self.splitViewController {
detailViewController = (split.viewControllers.last as? UINavigationController)?.topViewController as? DetailViewController
}
}

override func viewWillAppear(_ animated: Bool) {
Expand Down
8 changes: 5 additions & 3 deletions App/ResourceListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,11 @@ class ResourceListViewController: UITableViewController {
// MARK: - UITableViewDelegate

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
detailViewController!.resource = resources?[indexPath.row]
if splitViewController?.isCollapsed ?? true {
navigationController?.pushViewController(detailViewController!, animated: true)
if let detailViewController = detailViewController {
detailViewController.resource = resources?[indexPath.row]
if splitViewController?.isCollapsed ?? true {
navigationController?.pushViewController(detailViewController, animated: true)
}
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Contributing
============

For fixes, improvements and ideas, fork the repository and issue a pull request.
To get a pull request accepted, please adhere to these two rules:

- Work from the latest `develop` branch, unless it's a very small fix
- Respect current code style (indent with tabs, compare to existing code for more clues)

Ideally, only work on one feature at a time.
If you've done work on the code (i.e. not just fixes to the README), add yourself to the top of [`CONTRIBUTORS.md`](./CONTRIBUTORS.md).

Happy coding!
8 changes: 8 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Contributors
============

Contributors to the codebase, in reverse chronological order:

- Dave Carlson, @drdavec
- Pascal Pfiffner, @p2

12 changes: 12 additions & 0 deletions Endpoints.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// SoF-MedList
//
// Created by Pascal Pfiffner on 12/5/16.
// Modified by Dave Carlson on 8/9/2019.
// Copyright © 2016 SMART Platforms. All rights reserved.
//

Expand Down Expand Up @@ -35,6 +36,17 @@ func configuredEndpoints() -> [Endpoint] {
hspc.authProperties.embedded = true
endpoints.append(Endpoint(client: hspc, name: "HSPC Sandbox"))

let hspc_oauth2 = LenientClient(
baseURL: URL(string: "https://api-v5-r4.hspconsortium.org/testr4/data")!,
settings: [
"client_name": "SMART on FHIR iOS Sample App",
"redirect": "smartapp://callback",
"logo_uri": "https://avatars1.githubusercontent.com/u/7401080",
])
hspc_oauth2.authProperties.granularity = .patientSelectNative
hspc_oauth2.authProperties.embedded = true
endpoints.append(Endpoint(client: hspc_oauth2, name: "HSPC Sandbox (OAuth2)"))

let fhirorg = LenientClient(
baseURL: URL(string: "http://test.fhir.org/r4")!,
settings: [
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
SMART on FHIR
=============

An **iOS sample app** using SMART on FHIR via our [iOS SMART on FHIR framework](https://github.com/p2/SMART-on-FHIR-Cocoa).
An **iOS sample app** using SMART on FHIR via the [iOS SMART on FHIR framework](https://github.com/smart-on-fhir/Swift-SMART).

This project requires XCode 11+ for use of Swift Package Manager (SPM).


## Installation
Expand All @@ -11,10 +13,10 @@ An **iOS sample app** using SMART on FHIR via our [iOS SMART on FHIR framework](
```bash
git clone --recursive https://github.com/smart-on-fhir/SoF-Demo.git
```
2. Open the project file `SoF-Demo.xcodeproj` in Xcode 8+.
2. Open the project file `SoF-Demo.xcodeproj` in Xcode 11+.
3. Select an iPhone simulator and press **Run**.

The `master` branch is currently on _Swift 4.2_ and the _R4_ (`4.0.0-a53ec6ee1b`) version of FHIR ([version `4.0.0` of the SMART framework](https://github.com/smart-on-fhir/Swift-SMART/releases/tag/4.0.0)).
The `master` branch is currently on _Swift 5.0_ and the _R4_ (`4.0.0-a53ec6ee1b`) version of FHIR ([version `4.0.0` of the SMART framework](https://github.com/smart-on-fhir/Swift-SMART/releases/tag/4.0.0)).
Check the `develop` branch for bleeding edge updates, if any, and the [tags](https://github.com/smart-on-fhir/SoF-Demo/releases) for older releases.


Expand Down
Loading