Categories
SwiftUI

How to Create the Snake Game in SwiftUI

Create the classic snake game in SwiftUI without a grid Enum and Variables We are going to detect the swipe direction and have the snake move in that direction constantly until the direction changes. Let’s first create an enum for the directions: We will have a timer to control the snake’s speed. To make the […]

Categories
SwiftUI

Build a Chat App Interface With SwiftUI

Every app has messaging now. Here’s how you can quickly build messaging into your app Chat Model Let’s start by creating an enum for the bubble positions. Bubbles can be on the right or left side of the screen: Now, we can create our model that stores our messages, bubbles’ positions, and the user input […]