version()
Returns a string that describes the movement disorder algorithm’s current version.
Declaration
class func version() -> String?Mentioned in
Discussion
Use this method to determine the algorithm used by the movement disorder manager. If the current device supports gathering movement disorder data, this method returns a string with the version number in <major>.<minor>.<fix> format. It returns nil anytime isAvailable() returns false. For information about the current version, see Movement disorder algorithm changelog.
To set up tests that notify you when the version changes, create a unit test that checks the current version against the expected value. You can then use continuous integration to automatically monitor this value with each new release.
func testForVersionChange() throws {
let expectedVersion = "1.0.0"
let currentVersion = CMMovementDisorderManager.version()
XCTAssertEqual(expectedVersion, currentVersion, "*** The version has changes to \(String(describing: currentVersion)). ***")
}