Latest 1.2.1
Homepage https://github.com/PGSSoft/PuzzleMaker
License MIT
Platforms ios 8.4
Authors

pgssoft-logo.png

PuzzleMaker is a library written in Swift, which dynamically generates set of puzzles from the image.

Swift 5.0
Travis
CocoaPods Compatible
Carthage Compatible
Platform
License

PuzzleMaker.gif

Installation

The most convenient way to install it is by using Cocoapods with Podfile:

pod 'PuzzleMaker'

or using Carthage and add a line to Cartfile:

github "PGSSoft/PuzzleMaker"

Requirements

iOS 8.4

Usage

import PuzzleMaker
let puzzleMaker = PuzzleMaker(image: UIImage(named: "image")!, numRows: ViewController.numRows, numColumns: ViewController.numColumns)
        puzzleMaker.generatePuzzles { throwableClosure in
            do {
                let puzzleElements = try throwableClosure()
                for row in 0 ..< ViewController.numRows {
                    for column in 0 ..< ViewController.numColumns {
                        guard let puzzleElement = puzzleElements[row][column] else { continue }
                        let position = puzzleElement.position
                        let image = puzzleElement.image
                        let imgView = UIImageView(frame: CGRect(x: position.x, y: position.y, width: image.size.width, height: image.size.height))
                        imgView.image = image
                        self.view.addSubview(imgView)
                    }
                }

            } catch {
                debugPrint(error)
            }
    }
}

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/PGSSoft/PuzzleMaker.

License

The project is available as open source under the terms of the MIT License.

About

The project maintained by software development agency PGS Software.
See our other open-source projects or contact us to develop your product.

Follow us

Twitter URL
Twitter Follow

Latest podspec

{
    "name": "PuzzleMaker",
    "version": "1.2.1",
    "license": "MIT",
    "summary": "Swift framework responsible for generating puzzles from the image",
    "homepage": "https://github.com/PGSSoft/PuzzleMaker",
    "authors": {
        "Paweu0142 Kania": "[email protected]"
    },
    "source": {
        "git": "https://github.com/PGSSoft/PuzzleMaker.git",
        "tag": "1.2.1"
    },
    "platforms": {
        "ios": "8.4"
    },
    "source_files": "Sources/{*.swift}"
}

Pin It on Pinterest

Share This