Skip to content
This repository has been archived by the owner on Mar 4, 2023. It is now read-only.

(DEPRECATED) A swift library for creating and saving Live Photos

License

Notifications You must be signed in to change notification settings

OlegAba/LPLivePhotoGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEPRECATED

This project is deprecated and will no longer be supported. I recommend using LimitPoint/LivePhoto instead.

LPLivePhotoGenerator

GitHub release GitHub license CocoaPods

A Swift library for creating and saving Live Photos

Installation

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

Manual Installation (Framework):

  1. Drag the LPLivePhotoGenerator.xcodeproj file into your Xcode project.
  2. Add LPLivePhotoGenerator.framework to "Embedded Binaries" in the "General" tab of your target.

Usage

1. Import LPLivePhotoGenerator

Import LPLivePhotoGenerator module wherever you want to use it:

import LPLivePhotoGenerator

2. Creating and Saving a Live Photo:

// 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 {
            ...
          }
        })
    }
}

3. Extra Tool (LPLivePhoto Method):

// Move paired image and video to new path
livePhoto.movePairedImageAndVideoTo(path: path, completion: { (success: Bool, error: Error?) in

    if success {
        ...
    }
})

Demo Application

The "Demo" is a basic reference application created to show how to install LPLivePhotoGenerator using CocoaPods and develop applications using this library.

Installation

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

License

This project is licensed under the MIT License - see the LICENSE file for details

About

(DEPRECATED) A swift library for creating and saving Live Photos

Resources

License

Stars

Watchers

Forks

Packages

No packages published