TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Ideas for Implementing User Awards in App

Forums > SwiftUI

@DaveC  

Hey everyone! Working on my first iOS app ever. I'm currently on Day 57 of the 100 Days of SwiftUI course on this site (which is extremely helpful!). I am trying to come up with a framework (i.e. data model and logic) for implementing a system of user awards or acheivements in my app. The closest example I can think of off the top of my head is the Apple Activity app where you can earn awards for x number of workouts in a month, x number of consecutive days with a workout, x number of excercise minutes in a week, etc. I've tried lots of different search terms in Google, this forum, and other places, and I can't seem to find the right words to give me meaningful results.

Does anyone have any experience with this type of thing? Or any thoughts on where I can find any helpful info, tutorials, etc. to help me get started. I know I can come up with something on my own, but I'm also fairly certain that anything I think of, somebody else has already done it 10 different ways that are more logical and efficient than what I could come up with.

Any thoughts, recommendations, etc. much appreciated!

3      

Hey,

have you tried searches for "achievements" or perhaps "trophies"? These are terms primarily used in games for what you describe, that could perhaps give you better results.

If I were to implement this I would first look at computing these "on the fly", for example when user launches the app, you could query existing workouts for the last week and if it has more than 10, you would give the user an award (which would be saved and later used in this same logic to not give it again).

The awards history + timestamps for the actual data should be enough for most achievements I think. Otherwise you can have custom counters that are incremented - ideally in Core Data so you can save increment + timestamp. Then you can query the number of such occurrences in week, month etc.

3      

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.