https://github.com/mcfarhat/actifit-ios
I have been contributing to the Actifit iOS Application development with my past contribution link posts Post 1 and Post 2. This contribution holds new features into the iOS App like support for lower iOS versions, allowing the user to post activity once a day and adding new leaderboard screen displaying daily top 5 scorers posting from Actifit App.
Actifit is one of the SMT(Smart Media Token) on the top of Steemit blockchain which rewards you Actifit tokens based on your activity posted to Steemit via App. You can then use these tokens to buy sports pieces of equipment. Actifit also rewards you STEEM via upvotes on your posts on Steemit.
Daily Leaderboard (Top 5) Commmit Link
The above image showing the Leaderboard screen with Actifitian Steemit username and the number of activities user has performed before posting it to the Steemit blockchain.
Allow a user to post only once a day Commit Link
Adding Activity tracking support for older iPhone devices(support for iOS 9 or later)
Commit link 1
private func checkAuthorizationStatus() {
if #available(iOS 11.0, *) {
switch CMMotionActivityManager.authorizationStatus() {
case CMAuthorizationStatus.denied:
onStop()
stepsCountLabel.text = "Not available"
default:break
}
} else {
// Fallback on earlier versions
self.activityManager.queryActivityStarting(from: Date(), to: Date(), to: OperationQueue.main, withHandler: { (activities: [CMMotionActivity]?, error: Error?) -> () in
if error != nil {
let errorCode = (error! as NSError).code
if errorCode == Int(CMErrorMotionActivityNotAuthorized.rawValue) {
self.onStop()
self.stepsCountLabel.text = "Not available"
}
} else {
print("Authorized")
}
})
}
}
The above code is for checking if the user allow the App to track user activity or not. As you can see for iOS 11.0 CMMotionActivityManager class can directly check if the user has allowed the App to track the activity. But for lower versions, we have to query activity manager for data between two dates, if there is an error CMErrorMotionActivityNotAuthorized then we stop tracking the activity otherwise we proceed tracking the activity.
Commit Link 2
Commit Link 3
Commit Link 4
On iPhones with a smaller screen size like iPhone 5S and iPhone SE, the above image showing measurement fields which fits the whole screen width.
On iPhones with bigger screens like iPhone 6, iPhone 6s, iPhone 7 and of similar category, the measurement fields which are bound in a single container have some space left on the right of the screen.