Skip to content

Commit

Permalink
Add SPM support (#5)
Browse files Browse the repository at this point in the history
- Add SPM support
- Fix README
- Fix Github Workflow
  • Loading branch information
ky1vstar authored Nov 11, 2019
1 parent 821eecd commit 5f213c1
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 27 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
name: CI

on:
push:
branches:
- master

jobs:
build:
runs-on: macOS-latest

runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
- name: Publish to CocoaPod register
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
pod trunk push imglyKit2.podspec
pod trunk push imglyKit2.podspec --allow-warnings
Binary file added Assets/Example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Identity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// swift-tools-version:5.1

import PackageDescription

let package = Package(
name: "imglyKit",
platforms: [
.iOS(.v8),
.macOS(.v10_10)
],
products: [
.library(
name: "imglyKit",
targets: ["imglyKit"]
)
],
dependencies: []
)
60 changes: 36 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
![img.ly](http://i.imgur.com/EC8walN.png)
![img.ly](Assets/Logo.png)

## Foreword

This project was [originally](https://github.com/chenzeyu/imgly-sdk-ios) created by [@9elements](https://twitter.com/9elements). Since it was compatible only with Swift 2 I've decided to convert it to modern Swift syntax and share it with you.

| imglyKit2 version | Swift version |
|:-----------------:|:-----------------:|
| 1.1.0 | 5 |
| 1.1.0 - 1.2.0 | 5 |
| 1.0.0 | 4 |

## img.ly SDK for iOS
Expand All @@ -21,7 +21,7 @@ img.ly SDK provides tools for creating photo applications for iOS with a big var

* 40 stunning build in filters to choose from.
* Open source, need anything? Want to change anything? Go ahead, we provide the full source code.
* Native code. Our backend is Core Image based, therefore we dodge all the nasty OpenGL problems other frameworks face. Also its easier to add new filters. Just derive from `CIFilter` override the `outputImage` property and you are good to go.
* Native code. Our backend is Core Image based, therefore we dodge all the nasty OpenGL problems other frameworks face. Also its easier to add new filters. Just derive from `CIFilter` override the `outputImage` imageproperty and you are good to go.
* iPad support.
* Design filters in photoshop! Before you had to tweak values in code or copy & paste them from photoshop or your favorite image editor. With our response technology that is a thing of the past. Design your filter in photoshop, once you are done apply it onto the provided identity image. That will 'record' the filter response. Save it, add it as new filter, done!
* Swift. Keeping up with time, we used Swift to code the img.ly SDK, leading to leaner easier code.
Expand All @@ -30,7 +30,7 @@ img.ly SDK provides tools for creating photo applications for iOS with a big var
* Non-destructive. Don't like what you did? No problem, just redo or even discard it.
* In addition to adding beautiful filters to your photos, you can now also record videos and add the same filters.

![Example](http://i.imgur.com/EorDrpS.png)
![Example](Assets/Example.png)

## Requirements

Expand Down Expand Up @@ -66,6 +66,18 @@ To integrate imglyKit into your Xcode project using [Carthage](https://github.co
github "ky1vstar/imgly-sdk-ios-2"
```

### Swift Package Manager (thanks to [MoveUpwardsDev](https://github.com/MoveUpwardsDev))

The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.

Once you have your Swift package set up, adding imglyKit as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.

```swift
dependencies: [
.package(url: "https://github.com/ky1vstar/imgly-sdk-ios-2.git", from: "1.2.0")
]
```

### Manually

If you prefer not to use either of the aforementioned dependency managers, you can integrate imglyKit into your project manually.
Expand Down Expand Up @@ -131,17 +143,17 @@ The `IMGLYMainEditorViewController` can be used without the `IMGLYCameraViewCont

```
func callEditorViewController() {
var editorViewController = IMGLYMainEditorViewController()
editorViewController.highResolutionImage = image
editorViewController.initialFilterType = .none
editorViewController.initialFilterIntensity = 0.5
editorViewController.completionBlock = editorCompletionBlock
var editorViewController = IMGLYMainEditorViewController()
editorViewController.highResolutionImage = image
editorViewController.initialFilterType = .none
editorViewController.initialFilterIntensity = 0.5
editorViewController.completionBlock = editorCompletionBlock
}
...
func editorCompletionBlock(result: IMGLYEditorResult, image: UIImage?) {
...
...
}
```

Expand Down Expand Up @@ -177,7 +189,7 @@ The resulting image represents the response of the colors to the effect.
To use the filter in you project you need to:

* Apply the desired modifications to this image <br /> <br />
![identity](http://i.imgur.com/s15Q10X.png)
![identity](Assets/Identity.png)

* Add the resulting image to the `Filter Responses` group in the project. Note: the image must be saved in PNG format.
* Create a new class that derives from `IMGLYResponseFilter`.
Expand All @@ -191,19 +203,19 @@ Here is an example of a response filter

```
class IMGLYSteelTypeFilter: IMGLYResponseFilter {
override init() {
super.init()
self.responseName = "Steel"
self.imgly_displayName = "steel"
}
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
override var filterType: FilterType {
return IMGLYFilterType.steel
}
override init() {
super.init()
self.responseName = "Steel"
self.imgly_displayName = "steel"
}
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
override var filterType: FilterType {
return IMGLYFilterType.steel
}
}
```

Expand Down
2 changes: 2 additions & 0 deletions imglyKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -1581,6 +1582,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down
2 changes: 1 addition & 1 deletion imglyKit2.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "imglyKit2"
s.version = "1.1.0"
s.version = "1.2.0"
s.license = { :type => 'Copyright', :file => 'LICENSE' }
s.summary = "Creates stunning images with a nice selection of premium filters."
s.homepage = "https://github.com/ky1vstar/imgly-sdk-ios-2"
Expand Down

0 comments on commit 5f213c1

Please sign in to comment.