Skip to content

omkarsantoshraut/FlagIdentificationGame-iOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

FlagIdentificationGame-iOS

Index

FlagIdentification is a game developed using swift programming language. I build this application to solve the challenge as a part of 100DaysOfSwiftUI. As we know, the SwiftUI is the popular iOS framework right now to build high quality iOS applications which supports responsive layouts. With such iOS application, moving my feet deeper into the SwiftUI framework.

As i already mentioned that this project is a challege which has following few requirements.

  • The game should have only one screen which shows following views.
  • Three buttons should be there on the screen which will display three flags.
  • The country name should be there in the navigation bar and have to select correct option from those three buttons/options.
  • The game should able to show current score and moves on the screen.
  • The game should show alert with correct/wrong selection of flag with score on it.
  • The game app should show final alert with final score when it reaches to 10 moves.
  • The game should start again after 10 moves.

I started coding and building iOS applications using SwiftUI with this project. Got to learn following few points of SwiftUI while developing this project:

  • UIButtons: Got to learn how to use UIButton and how to add it's target which will be called after click.
  • Constraints: Used constraints to make the view responsive on all types of screens.
  • CALayer: Used CALayer to give border width and color to buttons.
  • Random Number: To show the random flags on the screen, used random function available in Swift.
  • Array Shuffle: Shuffled the array everytime before showing new move onto the screen.
  • Navigation Bar: Used properties of navigation bar to show country name in title. Also, added moves and score in the navigation bar.

Please refer the following screenshots and testing video to verify the behavior of an application.
FlagIdentificationGame-p1 FlagIdentificationGame-p2 FlagIdentificationGame-p3 FlagIdentificationGame-p4

FlagIdentificationGame-Testing.mov