Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/natmark/ProcessingKit

Visual designing library for iOS & OSX
https://github.com/natmark/ProcessingKit

ios processing processingkit swift

Last synced: about 1 month ago
JSON representation

Visual designing library for iOS & OSX

Awesome Lists containing this project

README

        

![Header](https://github.com/natmark/ProcessingKit/blob/master/Resources/ProcessingKit-Header.png?raw=true)



Build Status


Pods Version


Platforms


Swift


Carthage Compatible


codecov

----------------

# ProcessingKit
ProcessingKit is a Visual designing library for iOS & OSX.
ProcessingKit written in Swift🐧 and you can write like [processing](https://github.com/processing/processing).

## Demo
![Demo](https://github.com/natmark/ProcessingKit/blob/master/Resources/demo.gif?raw=true)

### Demo Apps
- [iOS Official Demo](https://github.com/natmark/ProcessingKit/tree/master/ProcessingKitExample)
- [OSX Official Demo](https://github.com/natmark/ProcessingKit/tree/master/ProcessingKitOSXExample)

#### [iPad Demo App (Developed for Open Source Conference)](https://github.com/natmark/OSCProcessingKitDemo)

|Sketch Runner|Code Comparison (between Processing and ProcessingKit)|
|:------------:|:----------------------------------------------------:|
|![](https://raw.githubusercontent.com/natmark/OSCProcessingKitDemo/master/Resources/screenshot1.png)|![](https://raw.githubusercontent.com/natmark/OSCProcessingKitDemo/master/Resources/screenshot2.png)|

## Example
|OS|gif|code|
|:---:|:------:|:------:|
|iOS| gif | ![code](https://raw.githubusercontent.com/natmark/ProcessingKit/master/Resources/iOS_ExampleCode.png)|
|OSX| ![gif](https://raw.githubusercontent.com/natmark/ProcessingKit/master/Resources/OSX_Example.gif) | ![code](https://raw.githubusercontent.com/natmark/ProcessingKit/master/Resources/OSX_ExampleCode.png)|

## Requirements
- Swift 3.0 or later
- iOS 10.0 or later
- OSX 10.11 or later

If you use Swift 3.x, try [ProcessingKit 0.6.0](https://github.com/natmark/ProcessingKit/releases/tag/0.6.0).

## Usage
1. Create custom class that inherits from ProcessingView

```Swift
import ProcessingKit

class SampleView: ProcessingView {
func setup() {
// The setup() function is run once, when the view instantiated.
}
func draw() {
// Called directly after setup(), the draw() function continuously executes the lines of code contained inside its block until the program is stopped or noLoop() is called.
}
}
```

2. Create a SampleView instance
### Create programmatically
```Swift
lazy var sampleView: SampleView = {
let sampleView = SampleView(frame: frame)
sampleView.isUserInteractionEnabled = true // If you want to use touch events (default true)
return sampleView
}()
```

### Use InterfaceBuilder

1. Add UIView to ViewController
2. Select UIView & Open Identity inspector
3. Set SampleView to Custom class field
4. Add outlet connection

```Swift
@IBOutlet weak var sampleView: SampleView!

override func viewDidLoad() {
super.viewDidLoad()
sampleView.isUserInteractionEnabled = true // If you want to use touch events (default true)
}
```

## Installation

### [CocoaPods](http://cocoadocs.org/docsets/ProcessingKit/)
Add the following to your `Podfile`:
```
pod "ProcessingKit"
```

- (Example project here: [PKPodsExample](https://github.com/natmark/PKPodsExample))

### [Carthage](https://github.com/Carthage/Carthage)
Add the following to your `Cartfile`:
```
github "natmark/ProcessingKit"
```

- (Example project here: [PKExample](https://github.com/natmark/PKExample))

## Xcode File Template
- `ProcessingKit.xctemplate` is available.
- Use [Donut](https://github.com/natmark/Donut)(Xcode file template manager) to install.

`$ donut install https://github.com/natmark/ProcessingKit`

## Documentation
- [ProcessingKit/wiki](https://github.com/natmark/ProcessingKit/wiki)

## License
ProcessingKit is available under the MIT license. See the LICENSE file for more info.