Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pgssoft/puzzlemaker
Swift framework responsible for generating puzzles from the image
https://github.com/pgssoft/puzzlemaker
carthage cocoapods ios jigsaw puzzle swift
Last synced: 6 days ago
JSON representation
Swift framework responsible for generating puzzles from the image
- Host: GitHub
- URL: https://github.com/pgssoft/puzzlemaker
- Owner: PGSSoft
- License: mit
- Created: 2016-09-16T10:31:03.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-05T09:45:31.000Z (over 5 years ago)
- Last Synced: 2024-10-31T15:41:19.425Z (16 days ago)
- Topics: carthage, cocoapods, ios, jigsaw, puzzle, swift
- Language: Swift
- Size: 11.9 MB
- Stars: 128
- Watchers: 10
- Forks: 24
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![pgssoft-logo.png](pgssoft-logo.png)
# PuzzleMaker
`PuzzleMaker` is a library written in Swift, which dynamically generates set of puzzles from the image.
[![Swift 5.0](https://img.shields.io/badge/Swift-5.0-green.svg?style=flat)](https://swift.org/)
[![Travis](https://travis-ci.org/PGSSoft/PuzzleMaker.svg?branch=master)](https://travis-ci.org/PGSSoft/PuzzleMaker.svg?branch=master)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/PuzzleMaker.svg)](https://cocoapods.org/pods/PuzzleMaker)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Platform](https://img.shields.io/cocoapods/p/PuzzleMaker.svg)](http://cocoadocs.org/docsets/PuzzleMaker)
[![License](https://img.shields.io/cocoapods/l/PuzzleMaker.svg)](https://github.com/PGSSoft/PuzzleMaker)![PuzzleMaker.gif](PuzzleMaker.gif)
## Installation
The most convenient way to install it is by using [Cocoapods](https://cocoapods.org/) with Podfile:
```ruby
pod 'PuzzleMaker'
```or using [Carthage](https://github.com/Carthage/Carthage) and add a line to `Cartfile`:
```
github "PGSSoft/PuzzleMaker"
```## Requirements
iOS 8.4
## Usage
```swift
import PuzzleMaker
``````swift
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](https://github.com/PGSSoft/PuzzleMaker).
## License
The project is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
## About
The project maintained by [software development agency](https://www.pgs-soft.com/) [PGS Software](https://www.pgs-soft.com/).
See our other [open-source projects](https://github.com/PGSSoft) or [contact us](https://www.pgs-soft.com/contact-us/) to develop your product.## Follow us
[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=https://github.com/PGSSoft/PuzzleMaker)
[![Twitter Follow](https://img.shields.io/twitter/follow/pgssoftware.svg?style=social&label=Follow)](https://twitter.com/pgssoftware)