Stipop Image Editor SDK provides over 150,000 stickers that can be easily integrated into mobile app. Bring fun to your mobile app with stickers loved by millions of users worldwide.
- Swift 5.4+
- XCode 12.5+
- iOS 11.0+
- Contact us to download StipopImageEditor.plist file. (tech-support@stipop.io)
- Download(or Clone) Demo App (SPM or Cocoapods Adjustment is not necessary)
git clone https://github.com/stipop-development/stipop-image-editor-ios-sdk
-
Add StipopImageEditor.plist file into the project
-
Run demo app
Go to File > Swift Packages > Add Package Dependency...
Enter https://github.com/stipop-development/stipop-image-editor-ios-sdk
. Then select a version you want to use.
If you have a Swift Package, add dependency into Package.swift
dependencies: [
.package(url: "https://github.com/stipop-development/stipop-image-editor-ios-sdk.git", .upToNextMajor(from: "0.0.2"))
]
Copy & Paste below into Podfile
. Then, run pod install
.
pod 'StipopImageEditorUIKit', '0.0.2'
- Add StipopImageEditor.plist file into the project.
- Import 'StipopImageEditor' and Use 'SEStipopImageEditor.showEditor()' method when image editing is needed.
import UIKit
import StipopImageEditor
class MainView: UIView {
...
}
extension MainView: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
...
func editImage(_ image: UIImage) {
guard let owningController = self.getOwningViewController() else { return }
/**
* You can show StipopImageEditor by using this method.
* @params
* _ controller: controller that shows ImageEditor.
* delegate: set delegate which can observe editor's working.
* fileName: You can set StipopImageEditor.plist's fileName. (defValue: StipopImageEditor)
* image: the image to edit.
* userId: if you want, you can set user's id (defValue: -1)
*/
SEStipopImageEditor.showEditor(owningController,
delegate: self, image: image)
}
}
- With (process 2), implement 'SEDelegate'.
import UIKit
import StipopImageEditor
class MainView: UIView {
...
}
extension MainView: SEDelegate {
/**
* When editing is canceled, this method is called.
*/
func editorCanceled() {
print("editorCanceled")
}
/**
* When editing is finished, this method is called.
* @params
* image: editing finished image.
*/
func editorFinished(image: UIImage) {
print("editorFinished")
self.imageView.image = image
}
}
- If you use 'SAuth', additionally imeplement 'httpError()' method.
import UIKit
import StipopImageEditor
class MainView: UIView {
let semaphore = DispatchSemaphore(value: 1)
...
}
extension MainView: SEDelegate {
/**
* When editing is canceled, this method is called.
*/
func editorCanceled() {
print("editorCanceled")
}
/**
* When editing is finished, this method is called.
* @params
* image: editing finished image.
*/
func editorFinished(image: UIImage) {
print("editorFinished")
self.imageView.image = image
}
/**
* If you use SAuth, additionally implement this method.
* when this method is called, refresh AccessToken and reRequest with 'apiEnum' & 'properties'.
* @params
* apiEnum: error occured api type.
* error: error info.
* properties: dictionary that contains data for recall api.
*/
func httpError(apiEnum: SEAPIEnum, error: SEError, properties: Dictionary<String, Any>?) {
print("⚡️Stipop: HTTP Error => \(apiEnum)")
DispatchQueue.global().async {
self.semaphore.wait()
let userId = SEStipopImageEditor.getUser()?.userID ?? SEStipopImageEditor.getCommonUser().userID
DemoSAuthManager.getAccessTokenIfOverExpiryTime(userId: userId,
completion: { accessToken in
self.semaphore.signal()
guard let accessToken = accessToken else { return }
SEStipopImageEditor.setAccessToken(accessToken: accessToken)
SEAuthManager.reRequest(api: apiEnum, properties: properties)
})
}
}
}
- Email us at tech-support@stipop.io if you need any help.