Commit baa54bba by Daniel Dahan

development: progression commit for Capture updates

parent d7bea33c
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_camera_front_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_camera_front_white@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_camera_front_white@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_camera_rear_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_camera_rear_white@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_camera_rear_white@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_flash_auto_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_flash_auto_white@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_flash_auto_white@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_flash_off_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_flash_off_white@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_flash_off_white@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_flash_on_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_flash_on_white@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_flash_on_white@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_photo_camera_white_36pt.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_photo_camera_white_36pt@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_photo_camera_white_36pt@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_videocam_white_36pt.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_videocam_white_36pt@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_videocam_white_36pt@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -135,88 +135,8 @@ open class Capture: View, UIGestureRecognizerDelegate { ...@@ -135,88 +135,8 @@ open class Capture: View, UIGestureRecognizerDelegate {
/// A delegation reference. /// A delegation reference.
open weak var delegate: CaptureDelegate? open weak var delegate: CaptureDelegate?
/// A Timer reference for when recording is enabled.
private var timer: Timer?
/// A tap gesture reference for focus events.
private var tapToFocusGesture: UITapGestureRecognizer?
/// A tap gesture reference for exposure events.
private var tapToExposeGesture: UITapGestureRecognizer?
/// A tap gesture reference for reset events.
private var tapToResetGesture: UITapGestureRecognizer?
/// A reference to the capture mode. /// A reference to the capture mode.
open var captureMode = CaptureMode.video open var mode = CaptureMode.video
/// A boolean indicating whether to enable tap to focus.
@IBInspectable
open var isTapToFocusEnabled = false {
didSet {
guard isTapToFocusEnabled else {
removeTapGesture(gesture: &tapToFocusGesture)
focusView?.removeFromSuperview()
focusView = nil
return
}
isTapToResetEnabled = true
prepareFocusLayer()
prepareTapGesture(gesture: &tapToFocusGesture, numberOfTapsRequired: 1, numberOfTouchesRequired: 1, selector: #selector(handleTapToFocusGesture))
if let v = tapToExposeGesture {
tapToFocusGesture!.require(toFail: v)
}
}
}
/// A boolean indicating whether to enable tap to expose.
@IBInspectable
open var isTapToExposeEnabled = false {
didSet {
guard isTapToExposeEnabled else {
removeTapGesture(gesture: &tapToExposeGesture)
exposureView?.removeFromSuperview()
exposureView = nil
return
}
isTapToResetEnabled = true
prepareExposureLayer()
prepareTapGesture(gesture: &tapToExposeGesture, numberOfTapsRequired: 2, numberOfTouchesRequired: 1, selector: #selector(handleTapToExposeGesture))
if let v = tapToFocusGesture {
v.require(toFail: tapToExposeGesture!)
}
}
}
/// A boolean indicating whether to enable tap to reset.
@IBInspectable
open var isTapToResetEnabled = false {
didSet {
guard isTapToResetEnabled else {
removeTapGesture(gesture: &tapToResetGesture)
resetView?.removeFromSuperview()
resetView = nil
return
}
prepareResetLayer()
prepareTapGesture(gesture: &tapToResetGesture, numberOfTapsRequired: 2, numberOfTouchesRequired: 2, selector: #selector(handleTapToResetGesture))
if let v = tapToFocusGesture {
v.require(toFail: tapToResetGesture!)
}
if let v = tapToExposeGesture {
v.require(toFail: tapToResetGesture!)
}
}
}
/// Insets preset value for content. /// Insets preset value for content.
open var contentEdgeInsetsPreset = EdgeInsetsPreset.none { open var contentEdgeInsetsPreset = EdgeInsetsPreset.none {
...@@ -229,7 +149,7 @@ open class Capture: View, UIGestureRecognizerDelegate { ...@@ -229,7 +149,7 @@ open class Capture: View, UIGestureRecognizerDelegate {
@IBInspectable @IBInspectable
open var contentEdgeInsets = EdgeInsets.zero { open var contentEdgeInsets = EdgeInsets.zero {
didSet { didSet {
reloadView() layoutSubviews()
} }
} }
...@@ -249,53 +169,19 @@ open class Capture: View, UIGestureRecognizerDelegate { ...@@ -249,53 +169,19 @@ open class Capture: View, UIGestureRecognizerDelegate {
open internal(set) var resetView: UIView? open internal(set) var resetView: UIView?
/// A reference to the cameraButton. /// A reference to the cameraButton.
open private(set) var cameraButton: IconButton! { open private(set) var cameraButton: IconButton!
didSet {
if let v = cameraButton {
v.addTarget(self, action: #selector(handleCameraButton), for: .touchUpInside)
}
reloadView()
}
}
/// A reference to the captureButton. /// A reference to the captureButton.
open private(set) var captureButton: FabButton! { open private(set) var captureButton: FabButton!
didSet {
if let v = captureButton {
v.addTarget(self, action: #selector(handleCaptureButton), for: .touchUpInside)
}
reloadView()
}
}
/// A reference to the videoButton. /// A reference to the videoButton.
open private(set) var videoButton: IconButton! { open private(set) var videoButton: IconButton!
didSet {
if let v = videoButton {
v.addTarget(self, action: #selector(handleVideoButton), for: .touchUpInside)
}
reloadView()
}
}
/// A reference to the switchCameraButton. /// A reference to the switchCameraButton.
open private(set) var switchCamerasButton: IconButton! { open private(set) var switchCamerasButton: IconButton!
didSet {
if let v = switchCamerasButton {
v.addTarget(self, action: #selector(handleSwitchCamerasButton), for: .touchUpInside)
}
}
}
/// A reference to the flashButton. /// A reference to the flashButton.
open private(set) var flashButton: IconButton! { open private(set) var flashButton: IconButton!
didSet {
if let v = flashButton {
v.addTarget(self, action: #selector(handleFlashButton), for: .touchUpInside)
}
}
}
/// A convenience initializer. /// A convenience initializer.
public convenience init() { public convenience init() {
...@@ -304,26 +190,7 @@ open class Capture: View, UIGestureRecognizerDelegate { ...@@ -304,26 +190,7 @@ open class Capture: View, UIGestureRecognizerDelegate {
open override func layoutSubviews() { open override func layoutSubviews() {
super.layoutSubviews() super.layoutSubviews()
preview.frame = bounds reload()
if let v = cameraButton {
v.y = bounds.height - contentEdgeInsets.bottom - v.bounds.height
v.x = contentEdgeInsets.left
}
if let v = captureButton {
v.y = bounds.height - contentEdgeInsets.bottom - v.bounds.height
v.x = (bounds.width - v.width) / 2
}
if let v = videoButton {
v.y = bounds.height - contentEdgeInsets.bottom - v.bounds.height
v.x = bounds.width - v.width - contentEdgeInsets.right
}
if let v = (preview.layer as! AVCaptureVideoPreviewLayer).connection {
v.videoOrientation = session.videoOrientation
}
} }
/** /**
...@@ -336,75 +203,20 @@ open class Capture: View, UIGestureRecognizerDelegate { ...@@ -336,75 +203,20 @@ open class Capture: View, UIGestureRecognizerDelegate {
open override func prepare() { open override func prepare() {
super.prepare() super.prepare()
backgroundColor = .black backgroundColor = .black
contentEdgeInsetsPreset = .square4
prepareCaptureSession() prepareCaptureSession()
preparePreviewView() preparePreview()
prepareCaptureButton() prepareCaptureButton()
prepareCameraButton() prepareCameraButton()
prepareVideoButton() prepareVideoButton()
prepareSwitchCamerasButton() prepareSwitchCamerasButton()
prepareFlashButton() prepareFlashButton()
isTapToFocusEnabled = true
isTapToExposeEnabled = true
} }
/// Reloads the view. /// Reloads the view.
open func reloadView() { open func reload() {
// clear constraints so new ones do not conflict preview.frame = bounds
removeConstraints(constraints)
for v in subviews {
v.removeFromSuperview()
}
insertSubview(preview, at: 0)
if let v = captureButton {
insertSubview(v, at: 1)
}
if let v = cameraButton {
insertSubview(v, at: 2)
}
if let v = videoButton {
insertSubview(v, at: 3)
}
}
/// Starts the timer for recording.
internal func startTimer() {
timer?.invalidate()
timer = Timer(timeInterval: 0.5, target: self, selector: #selector(updateTimer), userInfo: nil, repeats: true)
RunLoop.main.add(timer!, forMode: .commonModes)
delegate?.captureDidStartRecordTimer?(capture: self)
}
/// Updates the timer when recording.
internal func updateTimer() {
let duration = session.recordedDuration
let time = CMTimeGetSeconds(duration)
let hours = Int(time / 3600)
let minutes = Int((time / 60).truncatingRemainder(dividingBy: 60))
let seconds = Int(time.truncatingRemainder(dividingBy: 60))
delegate?.captureDidUpdateRecordTimer?(capture: self, hours: hours, minutes: minutes, seconds: seconds)
}
/// Stops the timer when recording.
internal func stopTimer() {
let duration = session.recordedDuration
let time = CMTimeGetSeconds(duration)
let hours = Int(time / 3600)
let minutes = Int((time / 60).truncatingRemainder(dividingBy: 60))
let seconds = Int(time.truncatingRemainder(dividingBy: 60))
timer?.invalidate()
timer = nil
delegate?.captureDidStopRecordTimer?(capture: self, hours: hours, minutes: minutes, seconds: seconds)
} }
/** /**
...@@ -432,20 +244,7 @@ open class Capture: View, UIGestureRecognizerDelegate { ...@@ -432,20 +244,7 @@ open class Capture: View, UIGestureRecognizerDelegate {
*/ */
@objc @objc
internal func handleCaptureButton(button: UIButton) { internal func handleCaptureButton(button: UIButton) {
switch captureMode { delegate?.captureDidPressCaptureButton?(capture: self, button: button)
case .photo:
session.captureStillImage()
case .video:
if session.isRecording {
session.stopRecording()
stopTimer()
} else {
session.startRecording()
startTimer()
}
}
delegate?.captureDidPressCaptureButton?(capture: self, button: button)
} }
/** /**
...@@ -454,7 +253,7 @@ open class Capture: View, UIGestureRecognizerDelegate { ...@@ -454,7 +253,7 @@ open class Capture: View, UIGestureRecognizerDelegate {
*/ */
@objc @objc
internal func handleCameraButton(button: UIButton) { internal func handleCameraButton(button: UIButton) {
captureMode = .photo mode = .photo
delegate?.captureDidPressCameraButton?(capture: self, button: button) delegate?.captureDidPressCameraButton?(capture: self, button: button)
} }
...@@ -464,7 +263,7 @@ open class Capture: View, UIGestureRecognizerDelegate { ...@@ -464,7 +263,7 @@ open class Capture: View, UIGestureRecognizerDelegate {
*/ */
@objc @objc
internal func handleVideoButton(button: UIButton) { internal func handleVideoButton(button: UIButton) {
captureMode = .video mode = .video
delegate?.captureDidPressVideoButton?(capture: self, button: button) delegate?.captureDidPressVideoButton?(capture: self, button: button)
} }
...@@ -478,7 +277,7 @@ open class Capture: View, UIGestureRecognizerDelegate { ...@@ -478,7 +277,7 @@ open class Capture: View, UIGestureRecognizerDelegate {
return return
} }
let point: CGPoint = recognizer.location(in: self) let point = recognizer.location(in: self)
session.focus(at: preview.captureDevicePointOfInterestForPoint(point: point)) session.focus(at: preview.captureDevicePointOfInterestForPoint(point: point))
animateTap(view: focusView!, point: point) animateTap(view: focusView!, point: point)
delegate?.captureDidTapToFocusAtPoint?(capture: self, point: point) delegate?.captureDidTapToFocusAtPoint?(capture: self, point: point)
...@@ -494,7 +293,7 @@ open class Capture: View, UIGestureRecognizerDelegate { ...@@ -494,7 +293,7 @@ open class Capture: View, UIGestureRecognizerDelegate {
return return
} }
let point: CGPoint = recognizer.location(in: self) let point = recognizer.location(in: self)
session.expose(at: preview.captureDevicePointOfInterestForPoint(point: point)) session.expose(at: preview.captureDevicePointOfInterestForPoint(point: point))
animateTap(view: exposureView!, point: point) animateTap(view: exposureView!, point: point)
delegate?.captureDidTapToExposeAtPoint?(capture: self, point: point) delegate?.captureDidTapToExposeAtPoint?(capture: self, point: point)
...@@ -512,7 +311,7 @@ open class Capture: View, UIGestureRecognizerDelegate { ...@@ -512,7 +311,7 @@ open class Capture: View, UIGestureRecognizerDelegate {
session.reset() session.reset()
let point: CGPoint = preview.pointForCaptureDevicePointOfInterest(point: CGPoint(x: 0.5, y: 0.5)) let point = preview.pointForCaptureDevicePointOfInterest(point: CGPoint(x: 0.5, y: 0.5))
animateTap(view: resetView!, point: point) animateTap(view: resetView!, point: point)
delegate?.captureDidTapToResetAtPoint?(capture: self, point: point) delegate?.captureDidTapToResetAtPoint?(capture: self, point: point)
} }
...@@ -527,8 +326,11 @@ open class Capture: View, UIGestureRecognizerDelegate { ...@@ -527,8 +326,11 @@ open class Capture: View, UIGestureRecognizerDelegate {
- Parameter selector: A Selector to handle the event. - Parameter selector: A Selector to handle the event.
*/ */
private func prepareTapGesture(gesture: inout UITapGestureRecognizer?, numberOfTapsRequired: Int, numberOfTouchesRequired: Int, selector: Selector) { private func prepareTapGesture(gesture: inout UITapGestureRecognizer?, numberOfTapsRequired: Int, numberOfTouchesRequired: Int, selector: Selector) {
removeTapGesture(gesture: &gesture) guard nil == gesture else {
gesture = UITapGestureRecognizer(target: self, action: selector) return
}
gesture = UITapGestureRecognizer(target: self, action: selector)
gesture!.delegate = self gesture!.delegate = self
gesture!.numberOfTapsRequired = numberOfTapsRequired gesture!.numberOfTapsRequired = numberOfTapsRequired
gesture!.numberOfTouchesRequired = numberOfTouchesRequired gesture!.numberOfTouchesRequired = numberOfTouchesRequired
...@@ -554,8 +356,10 @@ open class Capture: View, UIGestureRecognizerDelegate { ...@@ -554,8 +356,10 @@ open class Capture: View, UIGestureRecognizerDelegate {
} }
/// Prepares the preview. /// Prepares the preview.
private func preparePreviewView() { private func preparePreview() {
preview = CapturePreview() preview = CapturePreview()
addSubview(preview)
(preview.layer as! AVCaptureVideoPreviewLayer).session = session.session (preview.layer as! AVCaptureVideoPreviewLayer).session = session.session
session.startSession() session.startSession()
} }
...@@ -563,26 +367,31 @@ open class Capture: View, UIGestureRecognizerDelegate { ...@@ -563,26 +367,31 @@ open class Capture: View, UIGestureRecognizerDelegate {
/// Prepares the captureButton. /// Prepares the captureButton.
private func prepareCaptureButton() { private func prepareCaptureButton() {
captureButton = FabButton() captureButton = FabButton()
captureButton.addTarget(self, action: #selector(handleCaptureButton), for: .touchUpInside)
} }
/// Prepares the cameraButton. /// Prepares the cameraButton.
private func prepareCameraButton() { private func prepareCameraButton() {
cameraButton = IconButton(image: Icon.cm.photoCamera, tintColor: .white) cameraButton = IconButton(image: Icon.cm.photoCamera, tintColor: .white)
cameraButton.addTarget(self, action: #selector(handleCameraButton), for: .touchUpInside)
} }
/// Preapres the videoButton. /// Preapres the videoButton.
private func prepareVideoButton() { private func prepareVideoButton() {
videoButton = IconButton(image: Icon.cm.videocam, tintColor: .white) videoButton = IconButton(image: Icon.cm.videocam, tintColor: .white)
videoButton.addTarget(self, action: #selector(handleVideoButton), for: .touchUpInside)
} }
/// Prepares the switchCameraButton. /// Prepares the switchCameraButton.
private func prepareSwitchCamerasButton() { private func prepareSwitchCamerasButton() {
switchCamerasButton = IconButton(image: UIImage(named: "ic_camera_front_white"), tintColor: .white) switchCamerasButton = IconButton(image: Icon.cameraFront, tintColor: .white)
switchCamerasButton.addTarget(self, action: #selector(handleSwitchCamerasButton), for: .touchUpInside)
} }
/// Prepares the flashButton. /// Prepares the flashButton.
private func prepareFlashButton() { private func prepareFlashButton() {
flashButton = IconButton(image: UIImage(named: "ic_flash_auto_white"), tintColor: .white) flashButton = IconButton(image: UIImage(named: Icon.flashAuto, tintColor: .white)
flashButton.addTarget(self, action: #selector(handleFlashButton), for: .touchUpInside)
session.flashMode = .auto session.flashMode = .auto
} }
......
...@@ -52,6 +52,83 @@ open class CaptureController: ToolbarController, CaptureDelegate, CaptureSession ...@@ -52,6 +52,83 @@ open class CaptureController: ToolbarController, CaptureDelegate, CaptureSession
/// A reference to the Capture instance. /// A reference to the Capture instance.
open private(set) lazy var capture: Capture = Capture() open private(set) lazy var capture: Capture = Capture()
/// A tap gesture reference for focus events.
private var tapToFocusGesture: UITapGestureRecognizer?
/// A tap gesture reference for exposure events.
private var tapToExposeGesture: UITapGestureRecognizer?
/// A tap gesture reference for reset events.
private var tapToResetGesture: UITapGestureRecognizer?
/// A boolean indicating whether to enable tap to focus.
@IBInspectable
open var isTapToFocusEnabled = false {
didSet {
guard isTapToFocusEnabled else {
removeTapGesture(gesture: &tapToFocusGesture)
focusView?.removeFromSuperview()
focusView = nil
return
}
isTapToResetEnabled = true
prepareFocusLayer()
prepareTapGesture(gesture: &tapToFocusGesture, numberOfTapsRequired: 1, numberOfTouchesRequired: 1, selector: #selector(handleTapToFocusGesture))
if let v = tapToExposeGesture {
tapToFocusGesture!.require(toFail: v)
}
}
}
/// A boolean indicating whether to enable tap to expose.
@IBInspectable
open var isTapToExposeEnabled = false {
didSet {
guard isTapToExposeEnabled else {
removeTapGesture(gesture: &tapToExposeGesture)
exposureView?.removeFromSuperview()
exposureView = nil
return
}
isTapToResetEnabled = true
prepareExposureLayer()
prepareTapGesture(gesture: &tapToExposeGesture, numberOfTapsRequired: 2, numberOfTouchesRequired: 1, selector: #selector(handleTapToExposeGesture))
if let v = tapToFocusGesture {
v.require(toFail: tapToExposeGesture!)
}
}
}
/// A boolean indicating whether to enable tap to reset.
@IBInspectable
open var isTapToResetEnabled = false {
didSet {
guard isTapToResetEnabled else {
removeTapGesture(gesture: &tapToResetGesture)
resetView?.removeFromSuperview()
resetView = nil
return
}
prepareResetLayer()
prepareTapGesture(gesture: &tapToResetGesture, numberOfTapsRequired: 2, numberOfTouchesRequired: 2, selector: #selector(handleTapToResetGesture))
if let v = tapToFocusGesture {
v.require(toFail: tapToResetGesture!)
}
if let v = tapToExposeGesture {
v.require(toFail: tapToResetGesture!)
}
}
}
/// A reference to capture's cameraButton. /// A reference to capture's cameraButton.
open var cameraButton: IconButton { open var cameraButton: IconButton {
return capture.cameraButton return capture.cameraButton
...@@ -77,6 +154,29 @@ open class CaptureController: ToolbarController, CaptureDelegate, CaptureSession ...@@ -77,6 +154,29 @@ open class CaptureController: ToolbarController, CaptureDelegate, CaptureSession
return capture.captureButton return capture.captureButton
} }
open override func layoutSubviews() {
super.layoutSubviews()
if let v = cameraButton {
v.y = bounds.height - contentEdgeInsets.bottom - v.bounds.height
v.x = contentEdgeInsets.left
}
if let v = captureButton {
v.y = bounds.height - contentEdgeInsets.bottom - v.bounds.height
v.x = (bounds.width - v.width) / 2
}
if let v = videoButton {
v.y = bounds.height - contentEdgeInsets.bottom - v.bounds.height
v.x = bounds.width - v.width - contentEdgeInsets.right
}
if let v = (preview.layer as! AVCaptureVideoPreviewLayer).connection {
v.videoOrientation = session.videoOrientation
}
}
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepare method it is recommended to override the prepare method
...@@ -109,5 +209,59 @@ open class CaptureController: ToolbarController, CaptureDelegate, CaptureSession ...@@ -109,5 +209,59 @@ open class CaptureController: ToolbarController, CaptureDelegate, CaptureSession
private func prepareCapture() { private func prepareCapture() {
capture.delegate = self capture.delegate = self
capture.session.delegate = self capture.session.delegate = self
capture.isTapToFocusEnabled = true
capture.isTapToExposeEnabled = true
}
}
extension CaptureController {
/// Starts the timer for recording.
internal func startTimer() {
timer?.invalidate()
timer = Timer(timeInterval: 0.5, target: self, selector: #selector(updateTimer), userInfo: nil, repeats: true)
RunLoop.main.add(timer!, forMode: .commonModes)
delegate?.captureDidStartRecordTimer?(capture: self)
}
/// Updates the timer when recording.
internal func updateTimer() {
let duration = session.recordedDuration
let time = CMTimeGetSeconds(duration)
let hours = Int(time / 3600)
let minutes = Int((time / 60).truncatingRemainder(dividingBy: 60))
let seconds = Int(time.truncatingRemainder(dividingBy: 60))
delegate?.captureDidUpdateRecordTimer?(capture: self, hours: hours, minutes: minutes, seconds: seconds)
}
/// Stops the timer when recording.
internal func stopTimer() {
let duration = session.recordedDuration
let time = CMTimeGetSeconds(duration)
let hours = Int(time / 3600)
let minutes = Int((time / 60).truncatingRemainder(dividingBy: 60))
let seconds = Int(time.truncatingRemainder(dividingBy: 60))
timer?.invalidate()
timer = nil
delegate?.captureDidStopRecordTimer?(capture: self, hours: hours, minutes: minutes, seconds: seconds)
}
func captureDidPressCaptureButton(capture: Capture, button: UIButton) {
switch captureMode {
case .photo:
session.captureStillImage()
case .video:
if session.isRecording {
session.stopRecording()
stopTimer()
} else {
session.startRecording()
startTimer()
}
}
} }
} }
...@@ -40,6 +40,7 @@ open class CapturePreview: View { ...@@ -40,6 +40,7 @@ open class CapturePreview: View {
Converts a point in layer coordinates to a point of interest Converts a point in layer coordinates to a point of interest
in the coordinate space of the capture device providing input in the coordinate space of the capture device providing input
to the layer. to the layer.
- Parameter point: A CGPoint.
- Returns: A CGPoint that is converted. - Returns: A CGPoint that is converted.
*/ */
open func captureDevicePointOfInterestForPoint(point: CGPoint) -> CGPoint { open func captureDevicePointOfInterestForPoint(point: CGPoint) -> CGPoint {
...@@ -50,6 +51,7 @@ open class CapturePreview: View { ...@@ -50,6 +51,7 @@ open class CapturePreview: View {
Converts a point of interest in the coordinate space of the Converts a point of interest in the coordinate space of the
capture device providing input to the layer to a point in capture device providing input to the layer to a point in
layer coordinates. layer coordinates.
- Parameter point: A CGPoint.
- Returns: A CGPoint that is converted. - Returns: A CGPoint that is converted.
*/ */
open func pointForCaptureDevicePointOfInterest(point: CGPoint) -> CGPoint { open func pointForCaptureDevicePointOfInterest(point: CGPoint) -> CGPoint {
......
...@@ -94,7 +94,7 @@ public protocol CaptureSessionDelegate { ...@@ -94,7 +94,7 @@ public protocol CaptureSessionDelegate {
- Parameter error: A Error corresponding to the error. - Parameter error: A Error corresponding to the error.
*/ */
@objc @objc
optional func sessionFailedWithError(session: CaptureSession, error: Error) optional func captureSessionFailedWithError(session: CaptureSession, error: Error)
/** /**
A delegation method that is fired when the camera has been switched to another. A delegation method that is fired when the camera has been switched to another.
...@@ -102,7 +102,7 @@ public protocol CaptureSessionDelegate { ...@@ -102,7 +102,7 @@ public protocol CaptureSessionDelegate {
- Parameter position: An AVCaptureDevicePosition that the camera has switched to. - Parameter position: An AVCaptureDevicePosition that the camera has switched to.
*/ */
@objc @objc
optional func sessionDidSwitchCameras(session: CaptureSession, position: AVCaptureDevicePosition) optional func captureSessionDidSwitchCameras(session: CaptureSession, position: AVCaptureDevicePosition)
/** /**
A delegation method that is fired before the camera has been switched to another. A delegation method that is fired before the camera has been switched to another.
...@@ -110,7 +110,7 @@ public protocol CaptureSessionDelegate { ...@@ -110,7 +110,7 @@ public protocol CaptureSessionDelegate {
- Parameter position: An AVCaptureDevicePosition that the camera will switch to. - Parameter position: An AVCaptureDevicePosition that the camera will switch to.
*/ */
@objc @objc
optional func sessionWillSwitchCameras(session: CaptureSession, position: AVCaptureDevicePosition) optional func captureSessionWillSwitchCameras(session: CaptureSession, position: AVCaptureDevicePosition)
/** /**
A delegation method that is fired when an image has been captured asynchronously. A delegation method that is fired when an image has been captured asynchronously.
...@@ -118,7 +118,7 @@ public protocol CaptureSessionDelegate { ...@@ -118,7 +118,7 @@ public protocol CaptureSessionDelegate {
- Parameter image: An image that has been captured. - Parameter image: An image that has been captured.
*/ */
@objc @objc
optional func sessionStillImageAsynchronously(session: CaptureSession, image: UIImage) optional func captureSessionStillImageAsynchronously(session: CaptureSession, image: UIImage)
/** /**
A delegation method that is fired when capturing an image asynchronously has failed. A delegation method that is fired when capturing an image asynchronously has failed.
...@@ -126,7 +126,7 @@ public protocol CaptureSessionDelegate { ...@@ -126,7 +126,7 @@ public protocol CaptureSessionDelegate {
- Parameter error: A Error corresponding to the error. - Parameter error: A Error corresponding to the error.
*/ */
@objc @objc
optional func sessionStillImageAsynchronouslyFailedWithError(session: CaptureSession, error: Error) optional func captureSessionStillImageAsynchronouslyFailedWithError(session: CaptureSession, error: Error)
/** /**
A delegation method that is fired when creating a movie file has failed. A delegation method that is fired when creating a movie file has failed.
...@@ -134,7 +134,7 @@ public protocol CaptureSessionDelegate { ...@@ -134,7 +134,7 @@ public protocol CaptureSessionDelegate {
- Parameter error: A Error corresponding to the error. - Parameter error: A Error corresponding to the error.
*/ */
@objc @objc
optional func sessionCreateMovieFileFailedWithError(session: CaptureSession, error: Error) optional func captureSessionCreateMovieFileFailedWithError(session: CaptureSession, error: Error)
/** /**
A delegation method that is fired when capturing a movie has failed. A delegation method that is fired when capturing a movie has failed.
...@@ -142,7 +142,7 @@ public protocol CaptureSessionDelegate { ...@@ -142,7 +142,7 @@ public protocol CaptureSessionDelegate {
- Parameter error: A Error corresponding to the error. - Parameter error: A Error corresponding to the error.
*/ */
@objc @objc
optional func sessionMovieFailedWithError(session: CaptureSession, error: Error) optional func captureSessionMovieFailedWithError(session: CaptureSession, error: Error)
/** /**
A delegation method that is fired when a session started recording and writing A delegation method that is fired when a session started recording and writing
...@@ -153,7 +153,7 @@ public protocol CaptureSessionDelegate { ...@@ -153,7 +153,7 @@ public protocol CaptureSessionDelegate {
- Parameter fromConnections: An array of Anys. - Parameter fromConnections: An array of Anys.
*/ */
@objc @objc
optional func sessionDidStartRecordingToOutputFileAtURL(session: CaptureSession, captureOutput: AVCaptureFileOutput, fileURL: NSURL, fromConnections connections: [Any]) optional func captureSessionDidStartRecordingToOutputFileAtURL(session: CaptureSession, captureOutput: AVCaptureFileOutput, fileURL: NSURL, fromConnections connections: [Any])
/** /**
A delegation method that is fired when a session finished recording and writing A delegation method that is fired when a session finished recording and writing
...@@ -165,7 +165,7 @@ public protocol CaptureSessionDelegate { ...@@ -165,7 +165,7 @@ public protocol CaptureSessionDelegate {
- Parameter error: A Error corresponding to an error. - Parameter error: A Error corresponding to an error.
*/ */
@objc @objc
optional func sessionDidFinishRecordingToOutputFileAtURL(session: CaptureSession, captureOutput: AVCaptureFileOutput, outputFileURL: NSURL, fromConnections connections: [Any], error: Error!) optional func captureSessionDidFinishRecordingToOutputFileAtURL(session: CaptureSession, captureOutput: AVCaptureFileOutput, outputFileURL: NSURL, fromConnections connections: [Any], error: Error!)
} }
@objc(CaptureSession) @objc(CaptureSession)
...@@ -241,12 +241,12 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -241,12 +241,12 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
} }
/// A boolean indicating if the active camera has flash. /// A boolean indicating if the active camera has flash.
open var hasFlash: Bool { open var isFlashAvailable: Bool {
return nil == activeCamera ? false : activeCamera!.hasFlash return nil == activeCamera ? false : activeCamera!.hasFlash
} }
/// A boolean indicating if the active camera has a torch. /// A boolean indicating if the active camera has a torch.
open var hasTorch: Bool { open var isTorchAvailable: Bool {
return nil == activeCamera ? false : activeCamera!.hasTorch return nil == activeCamera ? false : activeCamera!.hasTorch
} }
...@@ -280,7 +280,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -280,7 +280,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
} }
if let e = error { if let e = error {
delegate?.sessionFailedWithError?(session: self, error: e) delegate?.captureSessionFailedWithError?(session: self, error: e)
} }
} }
} }
...@@ -310,7 +310,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -310,7 +310,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
} }
if let e = error { if let e = error {
delegate?.sessionFailedWithError?(session: self, error: e) delegate?.captureSessionFailedWithError?(session: self, error: e)
} }
} }
} }
...@@ -340,7 +340,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -340,7 +340,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
} }
if let e = error { if let e = error {
delegate?.sessionFailedWithError?(session: self, error: e) delegate?.captureSessionFailedWithError?(session: self, error: e)
} }
} }
} }
...@@ -417,7 +417,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -417,7 +417,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
return return
} }
delegate?.sessionWillSwitchCameras?(session: self, position: v) delegate?.captureSessionWillSwitchCameras?(session: self, position: v)
let videoInput: AVCaptureDeviceInput? = try AVCaptureDeviceInput(device: inactiveCamera!) let videoInput: AVCaptureDeviceInput? = try AVCaptureDeviceInput(device: inactiveCamera!)
session.beginConfiguration() session.beginConfiguration()
...@@ -431,9 +431,9 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -431,9 +431,9 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
} }
session.commitConfiguration() session.commitConfiguration()
delegate?.sessionDidSwitchCameras?(session: self, position: position!) delegate?.captureSessionDidSwitchCameras?(session: self, position: position!)
} catch let e as NSError { } catch let e as NSError {
delegate?.sessionFailedWithError?(session: self, error: e) delegate?.captureSessionFailedWithError?(session: self, error: e)
} }
} }
...@@ -481,7 +481,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -481,7 +481,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
var error: NSError? var error: NSError?
if isFocusPointOfInterestSupported && isFocusModeSupported(focusMode: .autoFocus) { if isFocusPointOfInterestSupported && isFocusModeSupported(focusMode: .autoFocus) {
do { do {
let device: AVCaptureDevice = activeCamera! let device = activeCamera!
try device.lockForConfiguration() try device.lockForConfiguration()
device.focusPointOfInterest = point device.focusPointOfInterest = point
device.focusMode = .autoFocus device.focusMode = .autoFocus
...@@ -490,7 +490,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -490,7 +490,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
error = e error = e
} }
} else { } else {
var userInfo: Dictionary<String, Any> = Dictionary<String, Any>() var userInfo = [String: Any]()
userInfo[NSLocalizedDescriptionKey] = "[Material Error: Unsupported focus.]" userInfo[NSLocalizedDescriptionKey] = "[Material Error: Unsupported focus.]"
userInfo[NSLocalizedFailureReasonErrorKey] = "[Material Error: Unsupported focus.]" userInfo[NSLocalizedFailureReasonErrorKey] = "[Material Error: Unsupported focus.]"
error = NSError(domain: "io.cosmicmind.Material.Capture", code: 0004, userInfo: userInfo) error = NSError(domain: "io.cosmicmind.Material.Capture", code: 0004, userInfo: userInfo)
...@@ -498,7 +498,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -498,7 +498,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
} }
if let e = error { if let e = error {
delegate?.sessionFailedWithError?(session: self, error: e) delegate?.captureSessionFailedWithError?(session: self, error: e)
} }
} }
...@@ -510,7 +510,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -510,7 +510,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
var error: NSError? var error: NSError?
if isExposurePointOfInterestSupported && isExposureModeSupported(exposureMode: .continuousAutoExposure) { if isExposurePointOfInterestSupported && isExposureModeSupported(exposureMode: .continuousAutoExposure) {
do { do {
let device: AVCaptureDevice = activeCamera! let device = activeCamera!
try device.lockForConfiguration() try device.lockForConfiguration()
device.exposurePointOfInterest = point device.exposurePointOfInterest = point
device.exposureMode = .continuousAutoExposure device.exposureMode = .continuousAutoExposure
...@@ -522,7 +522,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -522,7 +522,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
error = e error = e
} }
} else { } else {
var userInfo: Dictionary<String, Any> = Dictionary<String, Any>() var userInfo = [String: Any]()
userInfo[NSLocalizedDescriptionKey] = "[Material Error: Unsupported expose.]" userInfo[NSLocalizedDescriptionKey] = "[Material Error: Unsupported expose.]"
userInfo[NSLocalizedFailureReasonErrorKey] = "[Material Error: Unsupported expose.]" userInfo[NSLocalizedFailureReasonErrorKey] = "[Material Error: Unsupported expose.]"
error = NSError(domain: "io.cosmicmind.Material.Capture", code: 0005, userInfo: userInfo) error = NSError(domain: "io.cosmicmind.Material.Capture", code: 0005, userInfo: userInfo)
...@@ -530,13 +530,13 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -530,13 +530,13 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
} }
if let e = error { if let e = error {
delegate?.sessionFailedWithError?(session: self, error: e) delegate?.captureSessionFailedWithError?(session: self, error: e)
} }
} }
open override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) { open override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) {
if context == &CaptureSessionAdjustingExposureContext { if context == &CaptureSessionAdjustingExposureContext {
let device: AVCaptureDevice = object as! AVCaptureDevice let device = object as! AVCaptureDevice
if !device.isAdjustingExposure && device.isExposureModeSupported(.locked) { if !device.isAdjustingExposure && device.isExposureModeSupported(.locked) {
(object! as AnyObject).removeObserver(self, forKeyPath: "adjustingExposure", context: &CaptureSessionAdjustingExposureContext) (object! as AnyObject).removeObserver(self, forKeyPath: "adjustingExposure", context: &CaptureSessionAdjustingExposureContext)
DispatchQueue.main.async() { DispatchQueue.main.async() {
...@@ -545,7 +545,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -545,7 +545,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
device.exposureMode = .locked device.exposureMode = .locked
device.unlockForConfiguration() device.unlockForConfiguration()
} catch let e as NSError { } catch let e as NSError {
self.delegate?.sessionFailedWithError?(session: self, error: e) self.delegate?.captureSessionFailedWithError?(session: self, error: e)
} }
} }
} }
...@@ -560,10 +560,10 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -560,10 +560,10 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
- Parameter exposure: A boolean indicating to reset the exposure. - Parameter exposure: A boolean indicating to reset the exposure.
*/ */
open func reset(focus: Bool = true, exposure: Bool = true) { open func reset(focus: Bool = true, exposure: Bool = true) {
let device: AVCaptureDevice = activeCamera! let device = activeCamera!
let canResetFocus: Bool = device.isFocusPointOfInterestSupported && device.isFocusModeSupported(.continuousAutoFocus) let canResetFocus = device.isFocusPointOfInterestSupported && device.isFocusModeSupported(.continuousAutoFocus)
let canResetExposure: Bool = device.isExposurePointOfInterestSupported && device.isExposureModeSupported(.continuousAutoExposure) let canResetExposure = device.isExposurePointOfInterestSupported && device.isExposureModeSupported(.continuousAutoExposure)
let centerPoint: CGPoint = CGPoint(x: 0.5, y: 0.5) let centerPoint = CGPoint(x: 0.5, y: 0.5)
do { do {
try device.lockForConfiguration() try device.lockForConfiguration()
...@@ -579,7 +579,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -579,7 +579,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
device.unlockForConfiguration() device.unlockForConfiguration()
} catch let e as NSError { } catch let e as NSError {
delegate?.sessionFailedWithError?(session: self, error: e) delegate?.captureSessionFailedWithError?(session: self, error: e)
} }
} }
...@@ -606,7 +606,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -606,7 +606,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
if let image1 = UIImage(data: data) { if let image1 = UIImage(data: data) {
if let image2 = image1.adjustOrientation() { if let image2 = image1.adjustOrientation() {
s.delegate?.sessionStillImageAsynchronously?(session: s, image: image2) s.delegate?.captureSessionStillImageAsynchronously?(session: s, image: image2)
} else { } else {
var userInfo = [String: Any]() var userInfo = [String: Any]()
userInfo[NSLocalizedDescriptionKey] = "[Material Error: Cannot fix image orientation.]" userInfo[NSLocalizedDescriptionKey] = "[Material Error: Cannot fix image orientation.]"
...@@ -624,7 +624,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -624,7 +624,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
} }
if let e = captureError { if let e = captureError {
s.delegate?.sessionStillImageAsynchronouslyFailedWithError?(session: s, error: e) s.delegate?.captureSessionStillImageAsynchronouslyFailedWithError?(session: s, error: e)
} }
} }
} }
...@@ -653,7 +653,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -653,7 +653,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
v.isSmoothAutoFocusEnabled = true v.isSmoothAutoFocusEnabled = true
v.unlockForConfiguration() v.unlockForConfiguration()
} catch let e as NSError { } catch let e as NSError {
s.delegate?.sessionFailedWithError?(session: s, error: e) s.delegate?.captureSessionFailedWithError?(session: s, error: e)
} }
} }
...@@ -676,12 +676,12 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -676,12 +676,12 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
public func capture(_ captureOutput: AVCaptureFileOutput!, didStartRecordingToOutputFileAt fileURL: URL!, fromConnections connections: [Any]!) { public func capture(_ captureOutput: AVCaptureFileOutput!, didStartRecordingToOutputFileAt fileURL: URL!, fromConnections connections: [Any]!) {
isRecording = true isRecording = true
delegate?.sessionDidStartRecordingToOutputFileAtURL?(session: self, captureOutput: captureOutput, fileURL: fileURL as NSURL, fromConnections: connections) delegate?.captureSessionDidStartRecordingToOutputFileAtURL?(session: self, captureOutput: captureOutput, fileURL: fileURL as NSURL, fromConnections: connections)
} }
public func capture(_ captureOutput: AVCaptureFileOutput!, didFinishRecordingToOutputFileAt outputFileURL: URL!, fromConnections connections: [Any]!, error: Error!) { public func capture(_ captureOutput: AVCaptureFileOutput!, didFinishRecordingToOutputFileAt outputFileURL: URL!, fromConnections connections: [Any]!, error: Error!) {
isRecording = false isRecording = false
delegate?.sessionDidFinishRecordingToOutputFileAtURL?(session: self, captureOutput: captureOutput, outputFileURL: outputFileURL as NSURL, fromConnections: connections, error: error) delegate?.captureSessionDidFinishRecordingToOutputFileAtURL?(session: self, captureOutput: captureOutput, outputFileURL: outputFileURL as NSURL, fromConnections: connections, error: error)
} }
/// Prepares the sessionQueue. /// Prepares the sessionQueue.
...@@ -705,7 +705,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -705,7 +705,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
session.addInput(activeVideoInput) session.addInput(activeVideoInput)
} catch let e as NSError { } catch let e as NSError {
delegate?.sessionFailedWithError?(session: self, error: e) delegate?.captureSessionFailedWithError?(session: self, error: e)
} }
} }
...@@ -720,7 +720,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -720,7 +720,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
session.addInput(activeAudioInput) session.addInput(activeAudioInput)
} catch let e as NSError { } catch let e as NSError {
delegate?.sessionFailedWithError?(session: self, error: e) delegate?.captureSessionFailedWithError?(session: self, error: e)
} }
} }
...@@ -776,7 +776,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -776,7 +776,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
return directory.appendingPathComponent(dateFormatter.string(from: NSDate() as Date) + ".mov") return directory.appendingPathComponent(dateFormatter.string(from: NSDate() as Date) + ".mov")
} catch let e as NSError { } catch let e as NSError {
delegate?.sessionCreateMovieFileFailedWithError?(session: self, error: e) delegate?.captureSessionCreateMovieFileFailedWithError?(session: self, error: e)
} }
return nil return nil
} }
......
...@@ -63,14 +63,19 @@ public struct Icon { ...@@ -63,14 +63,19 @@ public struct Icon {
public static let arrowDownward = Icon.icon("ic_arrow_downward_white") public static let arrowDownward = Icon.icon("ic_arrow_downward_white")
public static let audio = Icon.icon("ic_audiotrack_white") public static let audio = Icon.icon("ic_audiotrack_white")
public static let bell = Icon.icon("cm_bell_white") public static let bell = Icon.icon("cm_bell_white")
public static let check = Icon.icon("ic_check_white") public static let cameraFront = Icon.icon("ic_camera_front_white")
public static let cameraRear = Icon.icon("ic_camera_rear_white")
public static let check = Icon.icon("ic_check_white")
public static let clear = Icon.icon("ic_close_white") public static let clear = Icon.icon("ic_close_white")
public static let close = Icon.icon("ic_close_white") public static let close = Icon.icon("ic_close_white")
public static let edit = Icon.icon("ic_edit_white") public static let edit = Icon.icon("ic_edit_white")
public static let email = Icon.icon("ic_email_white") public static let email = Icon.icon("ic_email_white")
public static let favorite = Icon.icon("ic_favorite_white") public static let favorite = Icon.icon("ic_favorite_white")
public static let favoriteBorder = Icon.icon("ic_favorite_border_white") public static let favoriteBorder = Icon.icon("ic_favorite_border_white")
public static let history = Icon.icon("ic_history_white") public static let flashAuto = Icon.icon("ic_flash_auto_white")
public static let flashOff = Icon.icon("ic_flash_off_white")
public static let flashOn = Icon.icon("ic_flash_on_white")
public static let history = Icon.icon("ic_history_white")
public static let home = Icon.icon("ic_home_white") public static let home = Icon.icon("ic_home_white")
public static let image = Icon.icon("ic_image_white") public static let image = Icon.icon("ic_image_white")
public static let menu = Icon.icon("ic_menu_white") public static let menu = Icon.icon("ic_menu_white")
...@@ -81,6 +86,7 @@ public struct Icon { ...@@ -81,6 +86,7 @@ public struct Icon {
public static let place = Icon.icon("ic_place_white") public static let place = Icon.icon("ic_place_white")
public static let phone = Icon.icon("ic_phone_white") public static let phone = Icon.icon("ic_phone_white")
public static let photoCamera = Icon.icon("ic_photo_camera_white") public static let photoCamera = Icon.icon("ic_photo_camera_white")
public static let photoCameraLarge = Icon.icon("ic_photo_camera_white_36pt")
public static let photoLibrary = Icon.icon("ic_photo_library_white") public static let photoLibrary = Icon.icon("ic_photo_library_white")
public static let search = Icon.icon("ic_search_white") public static let search = Icon.icon("ic_search_white")
public static let settings = Icon.icon("ic_settings_white") public static let settings = Icon.icon("ic_settings_white")
...@@ -89,6 +95,7 @@ public struct Icon { ...@@ -89,6 +95,7 @@ public struct Icon {
public static let starBorder = Icon.icon("ic_star_border_white") public static let starBorder = Icon.icon("ic_star_border_white")
public static let starHalf = Icon.icon("ic_star_half_white") public static let starHalf = Icon.icon("ic_star_half_white")
public static let videocam = Icon.icon("ic_videocam_white") public static let videocam = Icon.icon("ic_videocam_white")
public static let videocamLarge = Icon.icon("ic_videocam_white_36pt")
public static let visibility = Icon.icon("ic_visibility_white") public static let visibility = Icon.icon("ic_visibility_white")
/// CosmicMind icons. /// CosmicMind icons.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment