Getting Started
MyDataHelpsKit is a Cocoa Touch framework, linked to your app as a static library. It’s built with the latest Xcode, Swift, and iOS SDK versions, and supports iOS 13.6 and above. MyDataHelpsKit is self-contained; there are no dependencies on other frameworks or libraries, and requires no Apple frameworks other than Foundation (a few optional features use UIKit or SwiftUI).
Installation
Current version: 2.0.0
Based on your preferred installation process or dependency manager, choose from the below options to integrate MyDataHelpsKit.
Swift Package Manager
Add MyDataHelpsKit-iOS
as a Swift Package dependency to your project. For more information, see the Swift Package Manager documentation.
In your Xcode workspace, go to File > Swift Packages > Add Package Dependency and enter https://github.com/CareEvolution/MyDataHelpsKit-iOS
. Or edit your project’s Package.swift file:
`.package(url: "https://github.com/CareEvolution/MyDataHelpsKit-iOS", from: "2.0.0")`
Carthage
Use the standard Carthage workflow for static frameworks:
- Add
github "CareEvolution/MyDataHelpsKit-iOS"
to your Cartfile.
- Run
carthage update --use-xcframeworks
.
- Open your app target’s General settings tab in Xcode. In Finder, go to the
Carthage/Build
folder, and drag and drop MyDataHelpsKit.xcframework
from the Carthage/Build
folder into the “Frameworks, Libraries, and Embedded Content” section in Xcode.
To update MyDataHelpsKit to a newer version, run carthage update --use-xcframeworks
, optionally appending MyDataHelpsKit-iOS to the command to only update this SDK and not other Carthage dependencies.
Cocoapods
Use the standard Cocoapods workflow:
- Create a Podfile for your project using
pod init
if needed.
- Add
pod 'MyDataHelpsKit'
to your Podfile.
- Run
pod install
.
To update MyDataHelpsKit to a newer version, run pod update
, optionally appending MyDataHelpsKit
to the command to only update this SDK and not other Cocoapods dependencies.
Manual Integration
- Download and unzip the latest release.
- From Finder, drag
MyDataHelpsKit.xcodeproj
into your app’s Xcode workspace.
- Open your app target’s General settings tab in Xcode. In the project navigator pane, expand MyDataHelpsKit.xcodeproj > Products and drag MyDataHelpsKit.framework into the “Frameworks, Libraries, and Embedded Content” section.
To update to a newer version of MyDataHelpsKit, download and unzip the latest release, and then delete and replace the existing MyDataHelpsKit folder structure in your workspace.
Using MyDataHelpsKit in Your App
- Add MyDataHelpsKit to your Xcode workspace. See the installation section above for details.
- Create a
MyDataHelpsClient
object for communication with MyDataHelps. This object can be retained for the lifetime of your app.
- Obtain a participant access token for the authorized MyDataHelps participant. Note that your app is responsible for renewing the access token when it expires.
- Create a
ParticipantSession
using the access token. This is the primary interface for interacting with MyDataHelps. It can be retained for as long as the participant’s access token is valid; create a new ParticipantSession
when you renew the access token or when a different participant logs in.
- Use
ParticipantSession
functions to perform MyDataHelps operations and requests for the participant.
Example:
import MyDataHelpsKit
// Get participant access token for an authenticated MyDataHelps participant within your app.
let tokenString = ...
// Initialize a MyDataHelpsKit client and session using the access token.
let client = MyDataHelpsClient()
let token = ParticipantAccessToken(token: tokenString)
let session = ParticipantSession(client: client, accessToken: token)
// Example of using MyDataHelpsKit functionality:
Task {
do {
let info = try await session.getParticipantInfo()
let name = info.demographics.firstName ?? "Participant"
print("Hello, \(name)!")
} catch {
// Error is of type MyDataHelpsError:
print(error)
}
}
You can try out the SDK immediately by adding a Swift Playground to your Xcode project, obtaining a participant access token, and pasting and running the sample code above.
Tip
Most example code listings throughout this documentation are designed to be pasted into a Swift Playground to try out live in your project, by inserting the selected example code into the Task { }
block above.
Next Steps
Consult the programming guide to get the most out of this SDK. MyDataHelpsKit comes with an example app that you can immediately build and run to get familiar with the features and usage of MyDataHelpsKit within the context of your MyDataHelps project.
Browse the Features and User Experiences topics to guide your implementation of specific use cases. Finally, complete SDK reference is available on this site or via integrated Xcode symbol documentation.