Recently I was asked to work on the game of tic tac toe on iOS. Creating a game layout and rest of the business logic is straightforward, until it comes to detecting whether either side has won the game or not.
There are 2 ways of solving this problem -