Camera styled capture button with 3D touch
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE Update issue templates Aug 31, 2018
DJCaptureButton Capture action changes Sep 1, 2018
Example Capture action changes Sep 1, 2018
ReadMeAssets Updated image Sep 1, 2018
.gitignore Initial commit Aug 31, 2018
DJCaptureButton.podspec Update DJCaptureButton.podspec Sep 2, 2018
LICENSE Initial commit Aug 31, 2018
README.md Update README.md Sep 2, 2018
_Pods.xcodeproj First commit of DJCaptureButton Aug 31, 2018

README.md

DJCaptureButton

Camera styled capture button with 3D touch.

Example

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

Requirements

iOS 10.0

Installation

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

pod 'DJCaptureButton'

Usage

Manual

let captureButton = DJCaptureButton(frame: .init(x: 0, y: 0, width: 60, height: 60))
captureButton.delegate = self

view.addSubview(captureButton)
Add delegate
extension ViewController: DJCaptureButtonDelegate {

    func captureButtonDidFire(captureButton: DJCaptureButton) {
        debugPrint("Capture button action")
    }
}

Customize

captureButton.borderWidth = 4
captureButton.borderColor = .yellow

captureButton.middleCircleOffset = 4
captureButton.middleCircleColor = .blue

Interface Builder

  1. Add a UIButton in Interface Builder.
  2. Set the "class" property to DJCaptureButton.
  3. Connect the delegate.

See the Example Project.

Customize

Additional properties are available in the Attribute inspector:

Result

Author

David Jonsén

License

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