Swiftpack.co -  asam139/SSegmentRecordingView as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
asam139/SSegmentRecordingView
View to show recording video segments as Instagram, TikTok, etc
.package(url: "https://github.com/asam139/SSegmentRecordingView.git", from: "0.1.6")

SSegmentRecordingView

CI Status codecov Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

SSegmentRecordingViewGif

// Set initials segments
segmentRecordingView.setInitialSegments(durations: [1.0])

// Start new segment
var duration: TimeInterval = 0.0
segmentRecordingView.startNewSegment()
var timer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: true) { timer in
    duration += 0.1
    self.segmentRecordingView.updateSegment(duration: duration)
}
timer.fire()

// Remove current segment
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 1.0) {
    timer.invalidate()
    self.segmentRecordingView.removeSegment()
}

// Start new segment
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 2.0) {
    self.segmentRecordingView.startNewSegment()
    duration = 0
    timer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: true) { timer in
        duration += 0.1
        self.segmentRecordingView.updateSegment(duration: duration)
    }
}

// Close current segment
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 5) {
    timer.invalidate()
    self.segmentRecordingView.closeSegment()
}

Installation

Cocoapods

  1. Add this line to your project's Podfile (for Swift 5.0)
pod 'SSegmentRecordingView'

  1. Install the pod
$ pod install

Swift Package Manager (available Xcode 11.2 and forward)

  1. In Xcode, select File > Swift Packages > Add Package Dependency.
  2. Follow the prompts using the URL for this repository.

Contributions

If you have an idea for a new SSegmentRecordingView feature/functionality and want to add it to this repository, feel free to fork the project and create a pull request!

Also, feel free to create an issue if you have any suggestions or need any help ☺️

License

SSegmentRecordingView Framework

Copyright 2020 Saúl Moreno Abril, 93sauu@gmail.com

SSegmentRecordingView is licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

GitHub

link
Stars: 6
Last commit: 3 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API