Skip to content

Commit

Permalink
Removed assertion failure actions for non critical errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mozharovsky committed Jan 17, 2017
1 parent 8dbe4e0 commit 6a9f985
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 21 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified Example/.DS_Store
Binary file not shown.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11542" systemVersion="16B2555" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="NrL-F7-tW6">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="NrL-F7-tW6">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
Expand Down Expand Up @@ -96,6 +96,7 @@
<!--Image Picker Controller-->
<scene sceneID="Ll4-eh-g9d">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="r4A-GL-Fcj" sceneMemberID="firstResponder"/>
<viewController id="mpd-HD-A2R" customClass="ImagePickerController" customModule="Athlee_ImagePicker" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="vsh-dw-Kbu"/>
Expand All @@ -117,11 +118,11 @@
<rect key="frame" x="0.0" y="28" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="x6A-lt-OB3" id="TO5-Ps-EWU">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Fbz-Ab-req">
<rect key="frame" x="15" y="0.0" width="345" height="43.5"/>
<rect key="frame" x="15" y="0.0" width="345" height="43"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand Down Expand Up @@ -155,9 +156,8 @@
<outlet property="tableView" destination="hmI-Qr-xeP" id="2PQ-WZ-1fC"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="r4A-GL-Fcj" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="135" y="1491"/>
<point key="canvasLocation" x="870" y="-400"/>
</scene>
<!--Select a photo-->
<scene sceneID="AkM-OA-26p">
Expand Down Expand Up @@ -315,7 +315,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ru6-hH-EWG" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1683" y="1006.5"/>
<point key="canvasLocation" x="1682" y="922"/>
</scene>
<!--Selection View Controller-->
<scene sceneID="F1Y-jP-aUQ">
Expand Down
27 changes: 13 additions & 14 deletions Source/Capturable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ public protocol Capturable: class {
/// A preview container view where the live camera record is shown.
var previewViewContainer: UIView { get set }

/// A default capture notification observer.
/// If you want to observe by yourself,
/// implement `registerForNotifications` method.
/// A default capture notification observer.
/// If you want to observe by yourself,
/// implement `registerForNotifications` method.
/// And do not forget to unregister on deinit.
var captureNotificationObserver: CaptureNotificationObserver<Self>? { get set }

///
/// Provides all necessary preparations for
///
/// Provides all necessary preparations for
/// the capture session.
///
func prepareForCapturing()
Expand Down Expand Up @@ -131,7 +131,7 @@ public extension Capturable {
session.startRunning()
}
} catch {
assertionFailure("Unable to connect to the device input....")
debugPrint("Unable to connect to the device input...")
}

setFlashMode(.auto)
Expand Down Expand Up @@ -233,7 +233,7 @@ public extension Capturable {

session?.commitConfiguration()
} catch {
assertionFailure("Unable to connect to the device input....")
debugPrint("Unable to connect to the device input...")
}

session?.startRunning()
Expand All @@ -255,7 +255,7 @@ public extension Capturable {
device.unlockForConfiguration()
}
} catch {
assertionFailure("Unable to lock device for configuration. Error: \(error)")
debugPrint("Unable to lock device for configuration. Error: \(error)")
device?.flashMode = .off
return
}
Expand Down Expand Up @@ -288,7 +288,7 @@ public extension Capturable {
do {
try device?.lockForConfiguration()
} catch {
assertionFailure("Unable to lock device for configuration. Error: \(error)")
debugPrint("Unable to lock device for configuration. Error: \(error)")
return
}

Expand Down Expand Up @@ -321,18 +321,18 @@ public extension Capturable {
animations: {
self.focusView!.alpha = 1.0
self.focusView!.transform = CGAffineTransform(scaleX: 0.7, y: 0.7)
},
},

completion: { _ in
self.focusView!.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
self.focusView!.alpha = 0
}
}
)
}

}

// MARK: - Internal helpers
// MARK: - Internal helpers

internal extension Capturable {
///
Expand All @@ -351,7 +351,7 @@ internal extension Capturable {
///
/// Stops and resumes current session depending on the foreground mode.
///
/// - parameter notification: A foregound entry notification.
/// - parameter notification: A foregound entry notification.
///
func willEnterForegroundNotification(_ notification: Notification) {
let status = AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo)
Expand All @@ -363,4 +363,3 @@ internal extension Capturable {
}
}
}

0 comments on commit 6a9f985

Please sign in to comment.