Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🎥 CameraButtonKit — A customizable camera record button for iOS with long-press recording, animated progress spinner, and tap gesture support. Ideal for short video apps and camera UIs.

License

NotificationsYou must be signed in to change notification settings

jaydeep-godhani/CameraButtonKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GitHub repo sizeGitHub starsGitHub forksPlatformLanguageLicense

A customizable and lightweight camera-style record button for iOS, with support for tap, long-press recording, progress spinner animation, and delegate callbacks.

Demo

Features

  • 🎥 Long-press to start recording
  • 🟢 Tap to trigger single-shot action
  • 🌀 Circular animated spinner around button
  • ⏱️ Auto-stop after max duration
  • ⚠️ Delegate warning if recording is too short
  • 🔁 Customizable sizes, colors, and timings

Requirements

  • iOS 13.0+
  • Swift 5
  • Xcode 12 or higher

Installation

This is an Xcode project, so you can directly clone or download the project into your workspace.

Clone the Repository

git clone https://github.com/jaydeep-godhani/CameraButtonKit.git

Alternatively, you can download the project as a ZIP file from the GitHub repository page.

Integrating into Your Project

To integrate theCameraButtonView into your own Xcode project:

  1. Download or clone the repository.
  2. Copy the contents of theSource folder into your project.
  3. AddCameraButtonView to your storyboard or use it programmatically in your view controllers.

Usage

import CameraButtonKitclassViewController:UIViewController,CameraButtonDelegate{overridefunc viewDidLoad(){     super.viewDidLoad()letcameraButton=CameraButtonView(frame:CGRect(x:0, y:0, width:100, height:100))     cameraButton.center= view.center     cameraButton.delegate=self     view.addSubview(cameraButton)} // MARK: - CameraButtonDelegate Methodsfunc onStartRecord(){print("Started recording")}func onEndRecord(){print("Finished recording")}func onDurationTooShortError(){print("Recording too short!")}func onSingleTap(){print("Single tap action")}func onCancelled(){print("Recording cancelled")}}

Customization

PropertyDescriptionDefault
lineWidthThickness of the spinner10
spinnerLineSpacingGap between button and spinner20
spinnerPaddingAdditional space outside the spinner15
minRecordDurationMinimum valid duration in seconds0.3
maxRecordDurationMaximum allowed duration60.0

You can also change the spinner color by updatingspinnerLayer.strokeColor.

Contributions

We welcome contributions! If you find a bug, have an idea for a new extension, or want to improve the documentation, feel free to fork the repo and create a pull request.

License

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

About

🎥 CameraButtonKit — A customizable camera record button for iOS with long-press recording, animated progress spinner, and tap gesture support. Ideal for short video apps and camera UIs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp