{"id":17969590,"url":"https://github.com/fulldecent/fdchessboardview","last_synced_at":"2025-09-26T11:30:39.219Z","repository":{"id":20691121,"uuid":"23974461","full_name":"fulldecent/FDChessboardView","owner":"fulldecent","description":"An iOS / Mac view controller for chess boards","archived":false,"fork":false,"pushed_at":"2019-11-13T21:49:43.000Z","size":270,"stargazers_count":78,"open_issues_count":1,"forks_count":21,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-01-14T23:12:16.637Z","etag":null,"topics":["chess","chessboard","cocoapods","control","ios","swift","xcode"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fulldecent.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["fulldecent"],"custom":["https://www.paypal.me/fulldecent","https://amazon.com/hz/wishlist/ls/EE78A23EEGQB"]}},"created_at":"2014-09-12T19:45:42.000Z","updated_at":"2025-01-11T11:35:40.000Z","dependencies_parsed_at":"2022-08-05T09:15:35.608Z","dependency_job_id":null,"html_url":"https://github.com/fulldecent/FDChessboardView","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulldecent%2FFDChessboardView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulldecent%2FFDChessboardView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulldecent%2FFDChessboardView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulldecent%2FFDChessboardView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fulldecent","download_url":"https://codeload.github.com/fulldecent/FDChessboardView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234304835,"owners_count":18811265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chess","chessboard","cocoapods","control","ios","swift","xcode"],"created_at":"2024-10-29T15:00:34.376Z","updated_at":"2025-09-26T11:30:33.965Z","avatar_url":"https://github.com/fulldecent.png","language":"Swift","funding_links":["https://github.com/sponsors/fulldecent","https://www.paypal.me/fulldecent","https://amazon.com/hz/wishlist/ls/EE78A23EEGQB"],"categories":[],"sub_categories":[],"readme":"FDChessboardView\n================\n\n[![CI Status](http://img.shields.io/travis/fulldecent/FDChessboardView.svg?style=flat)](https://travis-ci.org/fulldecent/FDChessboardView)\n[![Version](https://img.shields.io/cocoapods/v/FDChessboardView.svg?style=flat)](http://cocoadocs.org/docsets/FDChessboardView)\n[![License](https://img.shields.io/cocoapods/l/FDChessboardView.svg?style=flat)](http://cocoadocs.org/docsets/FDChessboardView)\n[![Platform](https://img.shields.io/cocoapods/p/FDChessboardView.svg?style=flat)](http://cocoadocs.org/docsets/FDChessboardView)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n\u003ca href=\"http://imgur.com/kcBBESo\"\u003e\u003cimg width=200 height=200 src=\"http://i.imgur.com/kcBBESo.png\" title=\"Hosted by imgur.com\" /\u003e\u003c/a\u003e\n\nFeatures\n--------\n\n * High resolution graphics\n * Customizable themes and game graphics\n * Supports all single board chess variants: suicide, losers, atomic, etc.\n * Supports games with odd piece arrangement and non-standard castling (Fisher 960)\n * Very clean API, this is just a view\n * Supports a minimum deployment target of iOS 8 or OS X Mavericks (10.9)\n\n## Installation\n\nAdd FDChessboardView to your project using Swift Package Manager. In Xcode that is simply: File \u003e Swift Packages \u003e Add Package Dependency... and you're done. Alternative installations options are shown below for legacy projects.\n\n### CocoaPods\n\nIf you are already using [CocoaPods](http://cocoapods.org), just add 'FDChessboardView' to your `Podfile` then run `pod install`.\n\n### Carthage\n\nIf you are already using [Carthage](https://github.com/Carthage/Carthage), just add to your `Cartfile`:\n\n```ogdl\ngithub \"fulldecent/FDChessboardView\" ~\u003e 0.1\n```\n\nThen run `carthage update` to build the framework and drag the built FDChessboardView.framework into your Xcode project.\n\n\nUsage\n-----\n\nImport the project and implement a data source:\n\n```swift\nimport FDChessboardView\n\npublic protocol FDChessboardViewDataSource: class {\n    /// What piece is on the square?\n    func chessboardView(_ board: FDChessboardView, pieceForSquare square: FDChessboardSquare) -\u003e FDChessboardPiece?\n\n    /// The last move\n    func chessboardViewLastMove(_ board: FDChessboardView) -\u003e (from:FDChessboardSquare, to:FDChessboardSquare)?\n\n    /// The premove\n    func chessboardViewPremove(_ board: FDChessboardView) -\u003e (from:FDChessboardSquare, to:FDChessboardSquare)?\n}\n```\n\nIf your application will allow the pieces to be moved, implement a delegate:\n\n```swift\npublic protocol FDChessboardViewDelegate: class {\n    /// Where can this piece move to?\n    func chessboardView(_ board: FDChessboardView, legalDestinationsForPieceAtSquare from: FDChessboardSquare) -\u003e [FDChessboardSquare]\n\n    /// Before a move happenes\n    func chessboardView(_ board: FDChessboardView, canMoveFrom from: FDChessboardSquare, to: FDChessboardSquare, withPromotion promotion: FDChessboardPiece?) -\u003e Bool\n\n    /// After a move happened\n    func chessboardView(_ board: FDChessboardView, didMoveFrom from: FDChessboardSquare, to: FDChessboardSquare, withPromotion promotion: FDChessboardPiece?)\n}\n```\n\nThen you can customize the view or call certain actions:\n\n```swift\n/// The location of a square on a chess board\npublic struct FDChessboardSquare: Hashable {\n    /// From 0...7 (a...h)\n    public let file: Int\n    \n    /// From 0...7 (white king starting position to black king starting position)\n    public let rank: Int\n}\n\n/// The pieces on a chess board\npublic enum FDChessboardPiece: String {\n    case WhitePawn\n    case BlackPawn\n    case WhiteKnight\n    case BlackKnight\n    case WhiteBishop\n    case BlackBishop\n    case WhiteRook\n    case BlackRook\n    case WhiteQueen\n    case BlackQueen\n    case WhiteKing\n    case BlackKing\n}\n\n/// Display for a chess board\n@IBDesignable open class FDChessboardView: UIView {\n    @IBInspectable open var lightBackgroundColor: UIColor\n    @IBInspectable open var darkBackgroundColor: UIColor\n    open var targetBackgroundColor: UIColor\n    open var legalBackgroundColor: UIColor\n    open var lastMoveColor: UIColor\n    open var premoveColor: UIColor\n    open weak var dataSource: FDChessboardViewDataSource?\n    open weak var delegate: FDChessboardViewDelegate?\n    open var doesAnimate: Bool\n    open var doesShowLegalSquares: Bool\n    open var doesShowLastMove: Bool\n    open var doesShowPremove: Bool\n\n    /// Add a piece onto the board\n    open func setPiece(_ piece: FDChessboardPiece?, forSquare square: FDChessboardSquare)\n\n    /// Repull all board information from data source\n    open func reloadData()\n\n    /// Move a piece on the board, clears any prior premove\n    open func move(_ piece: FDChessboardPiece, from: FDChessboardSquare, to: FDChessboardSquare, promotedTo promoted: FDChessboardPiece?)\n    \n    /// Premove a piece on the board, clears any prior premove\n    open func premove(_ piece: FDChessboardPiece, from: FDChessboardSquare, to: FDChessboardSquare, promotedTo promoted: FDChessboardPiece?)\n    \n    /// Removes any premove on the board\n    open func clearPremove()\n    \n    /// Move a piece on the board, clears any prior premove\n    open func unmove(_ piece: FDChessboardPiece, from: FDChessboardSquare, to: FDChessboardSquare, promotedTo promoted: FDChessboardPiece?, capturing: FDChessboardPiece)\n}\n```\n\nUpcoming features\n-----------------\n\nThese following items are in the API for discussion and awaiting implementation:\n\n * Display for last move\n * Mutable game state (i.e. can move the pieces)\n * Animation for piece moves\n * Highlighting of legal squares for a piece after begin dragging\n * Premove\n\n\nSee also\n-----------\n\nSee also Kibitz for Mac which is making a comeback https://github.com/fulldecent/kibitz\n\n\n## License\n\nFDChessboardView is available under the MIT license. See [the LICENSE file](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffulldecent%2Ffdchessboardview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffulldecent%2Ffdchessboardview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffulldecent%2Ffdchessboardview/lists"}