The FIT SDK documentation is available at https://developer.garmin.com/fit.
Share your knowledge, ask questions, and get the latest FIT SDK news in the FIT SDK Developer Forum.
In an Xcode project, select File > Add Package Dependency and enter the source control repository URL: https://github.com/garmin/fit-objective-c-sdk
After the FIT Objective-C SDK package has been added as dependency, it can be used by importing the ObjcFIT module into the appropriate source files.
import ObjcFIT // Swift
@import ObjcFIT // Objective C
When using the FITListener and FITMessages classes, the SwiftFIT module also needs to be imported. These classes are available for Swift projects only.
import SwiftFIT // Swift
The package includes tests that demonstrate how to use the SDK. These test programs are similar to the Cookbook recipes.
- ActivityEncodeTests.swift: Demonstrates how to encode Activity Files.
- DecodeWithBroadcasterTests.swift: Demonstrates decoding a FIT file using the Message Broadcaster and delegate methods.
- SwiftDecoderTests.swift: Demonstrates how to decode FIT files with just a few lines of code by using the FITListener and FITMessages classes. These classes are available for Swift projects only.
- FITDateTests.swift: Demonstrates how to work with the FITDate class.
- FITTests.swift: Demonstrates using arrays, enums, strings, and subfields.
To run the tests, open /path/to/fit/sdk/objcpp/package.swift in Xcode. Then goto to the Test navigator and press ⌘U to run all of the tests.