HybridCamera
  • December 25, 2024

Lang platform codebeat badge Reviewed by Hound .github/workflows/swift.yml

Features:

Description
Records video πŸŽ₯
takes photos πŸ“·
Flash on/off ⚑
Front / Back camera ↕️
Hold to record video ✊
Tap to take photo πŸ‘‡
Tap to focus / set exposure πŸ”Ž
Pinch to zoom πŸ‘Œ
Looping video/photo preview πŸ”
Share button πŸ”—
Programatic UI πŸ€–
Doesn’t stop Spotify 🎢
Stores files in temporary πŸ’Ύ
Throw oriented code πŸ’£
Persistent app authorisation 🚫
Animated record button πŸ”΄
Callback based πŸ“ž

Why use this camera framework

  • High codebeat GPA
  • Low class scoped variable count (In order to better handle overall state)
  • Setup errors can be handled from the POV of the initiator
  • Operation errors is handled in the onCapture completion block
  • Callback based (as oppose to delegate based) More info
  • Easily styleable (The camera view is separate from the UI view)
  • No third-party libraries or Sugar
  • Entirely programatic (No storyboard)
  • Thoroughly documented (Artifacts and sideEffects etc)
  • Uses Sindre-lint style guide
  • Small footprint, only ~750 LOC (Lines of code)

Notes:

In order to keep things simple, The UI is CGRect based. Use your own Autolayout distro like SnapKit etc when adding additional UI

Install:

  • SPM: .package(url: "https://github.com/eonist/HybridCamera.git", .branch("master"))
  • Manual: Open HybridCamera.xcodeproj

    IMPORTANT: Make sure info.plist has these variables

Privacy – Microphone Usage Description
Privacy – Camera Usage Description
Privacy – Photo Library Additions Usage Description

Example:

Example code:

self.view = HybridCamView()
view.camView.onPhotoCaptureComplete = { (image: UIImage?, url: URL?, error: Error?) in
Swift.print(“On photo capture complete \(url)”)
}
hybridCamView.camView.onVideoCaptureComplete = { (url: URL?, error: Error?) in
Swift.print(“On Video capture complete \(url)”)
}

Todo:

 

  • Add support for more orientation modes (Currently only supports portrait)
  • Add support for error resolution from the POV of initiating the camera
  • Make UI with AutoLayout πŸ‘ˆ
  • Make lib carthage support βœ…
  • Fix AudioBug βœ…
  • Fix FontCamera bug w/ IphoneX βœ…
  • Add Spatial, Chaplin as an option to HybridCam πŸ‘ˆ
  • Add CI-Travis πŸ‘ˆ

Contributors:

GitHub


View Github

#ios #iosanimation #iosswift #swift #swiftui #ui
YOU MIGHT ALSO LIKE...
TvOSTextViewer

Light and scrollable view controller for tvOS to present blocks of text Description TvOSTextViewer is a view controller to present ...

TvOSSlider

TvOSSlider is an implementation ofΒ UISliderΒ for tvOS. Description and usage TvOSSlider palliates missing an implementation of UISlider for tvOS as part ...

TvOSScribble

TvOSScribble, based on CoreML, mitigates the lack of a physical numpad area in Siri Remote implementing a handwriting gesture recognizer. ...

TvOSPinKeyboard

PIN keyboard for tvOS Description TvOSPinKeyboard is a view controller that allows easily asking for PIN codes in tvOs Requirements ...

TvOSMoreButton

πŸ“Ί A tvOS button which truncates long text with '... More'. The TvOSMoreButton is a simple view which aims to ...