Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tumblr/kanvas-ios
Kanvas: a creation tool for iOS
https://github.com/tumblr/kanvas-ios
camera media-editing
Last synced: about 1 month ago
JSON representation
Kanvas: a creation tool for iOS
- Host: GitHub
- URL: https://github.com/tumblr/kanvas-ios
- Owner: tumblr
- License: mpl-2.0
- Created: 2020-09-02T02:15:49.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T21:45:40.000Z (about 2 months ago)
- Last Synced: 2024-10-26T02:33:48.558Z (about 2 months ago)
- Topics: camera, media-editing
- Language: Swift
- Homepage:
- Size: 40.9 MB
- Stars: 315
- Watchers: 18
- Forks: 43
- Open Issues: 70
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-swift - Kanvas - A iOS library for adding effects, drawings, text, stickers, and making GIFs from existing media or the camera. (Libs / Images)
- awesome-swift - Kanvas - Kanvas: a creation tool for iOS ` 📝 9 days ago ` (Images [🔝](#readme))
- awesome-swift - Kanvas - A iOS library for adding effects, drawings, text, stickers, and making GIFs from existing media or the camera. (Libs / Images)
README
# Kanvas
[![Build status](https://badge.buildkite.com/7c8558667703d6147550801644af0f394019d6e7b2daed739f.svg?branch=main)](https://buildkite.com/automattic/kanvas-ios)
[![Cocoapods](https://img.shields.io/cocoapods/v/Kanvas)](https://cocoapods.org/pods/Kanvas)
Kanvas is an [open-source](https://github.com/tumblr/kanvas-ios/blob/main/LICENSE) iOS library for adding effects, drawings, text, stickers, and making GIFs from existing media or the camera.
It is used in the [Tumblr iOS app](https://apps.apple.com/us/app/tumblr/id305343404) as a camera, media editor, GIF maker, and media posting tool.
## Setup
Add this to your `Podfile`:
```ruby
pod 'Kanvas', :git => 'https://github.com/tumblr/kanvas-ios.git'
```And run:
```bash
pod install
```## Usage
Kanvas is mainly two parts: [the Camera](https://github.com/tumblr/kanvas-ios/blob/main/Classes/Camera/CameraController.swift), and [the Editor](https://github.com/tumblr/kanvas-ios/blob/main/Classes/Editor/EditorViewController.swift). Both are just view controllers that you present, and have settings and delegates that help you customize their behavior.
To show the camera:
```swift
let settings = CameraSettings()
let camera = CameraController(settings: settings)
present(camera, animated: true)
```And to edit existing media, like a video:
```swift
let videoURL = URL(string: "path/to/video.mov")
let settings = CameraSettings()
let editor = EditorViewController.createEditor(for: videoURL, settings: settings)
present(editor, animated: true)
```Each view controller accepts a [`CameraSettings`](https://github.com/tumblr/kanvas-ios/blob/main/Classes/Settings/CameraSettings.swift) object, which provides fine-grained settings and feature togges. Each view controller also has a `delegate` property for providing your own handlers to creating media, performing editing operations, logging, or really anything else Kanvas can do.
Documentation is lacking at the moment, but contributions are welcome!
## Example App
[`Example`](https://github.com/tumblr/kanvas-ios/tree/main/Example) is an example app showing how to use Kanvas. Try it out!
1. Run `cd Example; bundle exec pod install`
2. Open `Example/KanvasExample.xcworkspace` in Xcode
3. Run the app on a device.