Skip to content

toupper/Wyler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wyler

Carthage CocoaPods PRs Welcome Medium: @toupper

Welcome to Wyler — A light library written in Swift that makes easy the process of Screen Recording for IOS. You can record your app video screen, access to the recorded video, and save it to the Photo Library.

Features

  • App Screen Recording
  • Set Video Size
  • Access to the Video
  • Save the video to the Photo Library

Requirements

  • iOS 11.0+
  • Xcode 11.0+

Installation

Since Wyler is implemented within a single file, the easiest way to use it is to simply drag and drop it into your Xcode project. If anyways you want to use a dependency manager:

CocoaPods

You can use CocoaPods to install Wyler by adding it to your Podfile:

platform :ios, '11.0'
use_frameworks!
pod 'Wyler'

To get the full benefits import Wyler wherever you use it

import Wyler

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate Alamofire into your Xcode project using Carthage, specify it in your Cartfile:

github "toupper/Wyler"

Manually

You can also integrate Wyler into your project manually.

Embedded Framework

  • Open up Terminal, cd into your top-level project directory, and run the following command "if" your project is not initialized as a git repository:

    $ git init
  • Add Wyler as a git submodule by running the following command:

    $ git submodule add https://github.com/toupper/Wyler.git
  • Open the new Wyler folder, and drag the Wyler.xcodeproj into the Project Navigator of your application's Xcode project.

  • And that's it!

Usage example

Recording

Import Wyler in the file you are going to use it. Create an instance of ScreenRecorder, and call it to start recording whenever you want:

import Wyler

screenRecorder.startRecording(saveToCameraRoll: true, errorHandler: { error in
  debugPrint("Error when recording \(error)")
})

If you want to access the video, turn off audio recording, or set a different size than the App screen, you can pass these parameters:

import Wyler

screenRecorder.startRecording(to: yourInternalURL,
                              size: yourSize,
                              saveToCameraRoll: true, 
                              recordAudio: shouldRecordAudio,
                              errorHandler: { error in
                                debugPrint("Error when recording \(error)")
                              })

When you want to stop recording, you just have to call the recorder with stop recording:

import Wyler

screenRecorder.stoprecording(errorHandler: { error in
  debugPrint("Error when stop recording \(error)")
})

If you want to save the video to the camera, do not forget to add the Privacy - Photo Library Usage Description to the Info.plist

Contribute

We would love you for the contribution to Wyler, check the LICENSE file for more info.

Credits

Created and maintained with love by César Vargas Casaseca. You can follow me on Medium @toupper for project updates, releases and more stories.

License

Wyler is released under the MIT license. See LICENSE for details.