an image

26 Feb 2022

Set - SwiftUI


A fully functional game of 1-player Set built entirely from scratch as part of Stanford’s CS193p mid-term assisgment.


  • Functional UI programming using SwiftUI 2.0 and Swift 5.5
  • Data architecture using MVC
  • Motion using SwiftUI animation library


Deck and Discard Pile

Keep track of discraded cards from the game and deal new cards from the undealt pile.


Set Matching

An efficient alogrithm to identify a matching Set and help the player progress.



Architecting the app from scratch was particularly challening as there was no real road-map or implementation guidelines. The hints, however, did guide me through what I needed a head of implementing a particulary feature which helped me create a mental model of the implementation priority list. Animation took the longest to implement as I wasn’t well-wersed with the unique animation system of SwiftUI. The set matching alogrithm took many iterations to reach a fast, perfomant and functional state, but in the end I am extremely proud of the outcome I was able to achieve in 2 weeks after only having used Swift and SwiftUI for 2 weeks.