Chess represented in swift

What's New

Release 1.0.8


This is the version for the initial app store release.


This package provides UI components and game logic for standard chess play.

The code presents a unified pattern for the game interactions using Combine and SwiftUI. A chess game, the board, players etc are all housed in a ChessStore

Here's an example of creating a ChessStore that would allow two people to play.

let white = Chess.HumanPlayer(side: .white)
let black = Chess.HumanPlayer(side: . black)
let game = Chess.Game(white, against: black)
let store = ChessStore(game: game)

You might then use the store as the environment variable for a BoardView.

There is a lot to discover, you will find previews in the code, this can be helpful to get a visual guide.

Here's XCode showing the preview of SquareTargeted.swift.

When a user taps a square we show the possible moves on the board.

TODO: This readme should have a better ending.


  • Swift Tools 5.3.0
View More Packages from this Author


Last updated: Fri Dec 01 2023 02:24:15 GMT-1000 (Hawaii-Aleutian Standard Time)