This project is deprecated and will no longer be supported. I recommend using LimitPoint/LivePhoto instead.
A Swift library for creating and saving Live Photos
As a CocoaPods Dependency:
Add the following to your Podfile:
pod 'LPLivePhotoGenerator'
cd
into the directory where your Podfile is present and install
pod install
- Drag the
LPLivePhotoGenerator.xcodeproj
file into your Xcode project. - Add
LPLivePhotoGenerator.framework
to "Embedded Binaries" in the "General" tab of your target.
Import LPLivePhotoGenerator module wherever you want to use it:
import LPLivePhotoGenerator
// Create a LivePhoto object with a image path and video path
LPLivePhotoGenerator.create(inputImagePath: imagePath, inputVideoPath: videoPath) { (livePhoto: LPLivePhoto?, error: Error?) in
// Unwrap object
if let livePhoto = livePhoto {
// Set the Live Photo in a PHLivePhotoView
let livePhotoView = PHLivePhotoView(frame: rect)
livePhotoView.livePhoto = livePhoto
// Save Live Photo to Photo Library
livePhoto.writeToPhotoLibrary(completion: { (livePhoto: LPLivePhoto, error: Error?) in
if error == nil {
...
}
})
}
}
// Move paired image and video to new path
livePhoto.movePairedImageAndVideoTo(path: path, completion: { (success: Bool, error: Error?) in
if success {
...
}
})
The "Demo" is a basic reference application created to show how to install LPLivePhotoGenerator using CocoaPods and develop applications using this library.
CocoaPods should be installed before continuing. To access the project, run the following:
git clone --recursive https://github.com/OlegAba/LPLivePhotoGenerator.git
cd LPLivePhotoGenerator/Demo/
pod install
open Demo.xcworkspace
You can also check out InstaQR and SuperSnapcode - open-source iOS applications that are built using this library
This project is licensed under the MIT License - see the LICENSE file for details