My port of Minesweeper written in SwiftUI
Find a file
2025-11-02 21:30:27 +08:00
blocks.png Add files via upload 2025-06-21 22:02:32 +08:00
button.png Add files via upload 2025-06-21 22:02:32 +08:00
ContentView.swift Add files via upload 2025-06-21 22:02:32 +08:00
led.png Add files via upload 2025-06-21 22:02:32 +08:00
README.md Update README.md 2025-11-02 21:30:27 +08:00

Winmine SwiftUI

A Minesweeper clone for iOS, built with SwiftUI. This project aims to replicate the gameplay of Windows Minesweeper in a way that is playable on mobile.

Features

  • Multiple Difficulty Levels:
    • Beginner: 9x9 grid with 10 mines
    • Intermediate: 16x16 grid with 40 mines
    • Expert: 16x30 grid with 99 mines
    • Custom: Set your own grid size and number of mines.
  • Controls:
    • Tap: Reveal a cell.
    • Long Press: Cycle through flagging a cell, marking it as uncertain, and reverting it to normal.
  • Dynamic UI:
    • Floating Button: A draggable floating button provides access to settings. It can be snapped to 8 different positions on the screen.
    • Classic (ripped) Visuals: Utilizes sprite sheets for the classic block, smiley, and LED counter aesthetics.
  • Leaderboard:
    • Tracks and displays the best completion times for Beginner, Intermediate, and Expert difficulties.
    • Prompts for your name to save a new high score.

How to Play

  1. Download and install the latest release.

How to Build

  1. Open it in Swift Playground
    • Create a new app
    • Delete the MyApp file
    • Replace the contents of ContentView.swift with this
    • Import all image assets in this repository
    • Click play to run the app

Note

You can probably also build this using xCode, however I wrote and tested this entirely within Swift Playground, and I cannot provide instructions for device locked program I don't have the device for.