Refactor the BullsEye project to make it conform to the Model-View-Controller architecture. The app can be used with any iPhone that supports iOS 13
- Refactor the ViewController in BullsEye Game to create a UI-independent model.
- Test UI-independent model on RGBullsEye Game replace Int() type with RGB() type.
- modify slider’s minimum track tint color in BullsEye Game to provide a visual hint to the player
- “Reverse” the BullsEye game to use a text field.
- Modify slider’s minimum track tint color in RevBullsEye Game to provide a visual hint to the player
- Prevent the user from submitting text that won’t work, either because
- The text isn’t a number
- The Number outside the slider’s range
- User can dismiss the keyboard using two methods for the RevBullsEye
- Tap screen
- Tap done button
- Groups all game projects and packages under one Xcode workspace so it's easier to work on them together
- Model code for games BullsEye & RevBullsEye moved to Swift Package to avoid duplicating code.
- As an SPM Package model code can be distributed to other developers to make their version of BullsEye
- Use Apples Combine framework so UI can listen for changes in the model.
- Show animation when the user has a high score.
My personal preference is always to start with a struct. why you wonder?
Because Crusty said so.
All joking aside,
The reason I prefer structs is the value semantics especially immutability. But as game model required mutation I changed the model to a class to avoid adding mutation keyword to all my model functions. The next version of the 3 games could be rewritten for MVVM so the model is a struct & the view model is a class.
The shared game assets could also be moved from the individual game project to Swift Package. The feature SE-0271: Package Manager Resources will be available in swift 5.3. So the next version of BullsEye & RevBullsEye can take advantage of that.
Game Background Image created by upklyak
- If you have a feature request, open an issue
- If you want to contribute, submit a pull request