Latest 0.1.4
License MIT
Platforms ios 9.0
Frameworks UIKit, AVFoundation, Photos


CI Status


CaptureCenter is not a custom camera cature UI libray. It provides a simple interface layer to bridge functionalities of AVFoundation. CaptureCenter provides interfaces for AVCaptureDevice settings such as focusing, adjusting exposure, applying flash, etc. Moreover, CaptureCenter handles photo capture and video recoprding pipelines behind the scene. Developers can build their own camera UI with their own UI components or icons and map the UI actions with the interfaces provided from CaptureCenter.


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


Capture Center supports iOS 9.0 or up


CaptureCenter is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "CaptureCenter"

or via Carthage

In Cartfile

github "MingLoan/CaptureCenter"

then run

carthage update --platform iOS



let captureCenter = CaptureCenter(captureMode: .photo)

Only photo capture mode is supported right now, other modes view be supported soon.

public enum CaptureMode {
    case photo
    // unsupport now
    case video(size: VideoSize, location: URL, didStart: () -> (), progress: (CGFloat) -> (), willFinish: () -> (), completion: (AVAsset?) -> ())
    // unsupport now
    case stream

You can simply get the camera preview view from CaptureCenter instance and use it as a UIView.

captureCenter.previewView.frame = CGRect(...)

To start capture, call startCapturingWithDevicePosition, you can set device position in advanced.
cameraControlShouldOn enables camera control like tap to focus, pinch to zoom, default is false
The callback will be called after started capturing.

                fromVC: self,
                cameraControlShouldOn: true) { [weak self] finished in
                    guard let strongSelf = self else { return }
                    if finished {
                        // ...

To stop capture,


take photo

public func captureWithOptions(_ options: ImageOptions, completion: @escaping ((Data?) -> ()))

toggle camera

public func changeCameraWithStartBlock(_ startBlock: (() -> ()), finished endBlock: @escaping ((Bool) -> ()))

configure focus

public func focusWithMode(_ focusMode: AVCaptureFocusMode, exposureMode: AVCaptureExposureMode, at devicePoint: CGPoint, monitorSubjectAreaChange: Bool, showUI: @escaping ((Bool) -> ()))

configure exposure

public func exposeWithBias(_ exposureBias: CGFloat)

configure zoom

public func setZoomScale(_ scale: CGFloat)


  • support video recording
  • support streaming
  • support RAW capture
  • improve documentation
  • improve error handling


mingloan, [email protected]


CaptureCenter is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "CaptureCenter",
    "version": "0.1.4",
    "summary": "CaptureCenter is a camera capture library for iOS. CaptureCenter helps you to do everything besides UI.",
    "description": "CaptureCenter is a custom camera capture library for iOS. You can fit your custom capture layout with CaptureCenter, CaptureCenter helps you to do everything besides UI",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "mingloan": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.4"
    "social_media_url": "",
    "platforms": {
        "ios": "9.0"
    "source_files": "CaptureCenter/Classes/**/*",
    "ios": {
        "resource_bundles": {
            "CaptureCenter": "CaptureCenter/Assets/icon.xcassets"
    "frameworks": [
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This