MediaPickerViewController: prepare image/video capture

This commit is contained in:
giomfo
2015-09-02 09:43:52 +02:00
parent 589d470c1f
commit 708e6a589d
12 changed files with 597 additions and 79 deletions
@@ -4,18 +4,26 @@
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MediaPickerViewController">
<connections>
<outlet property="cameraActivityIndicator" destination="dxP-iB-dWk" id="HBu-hw-Cx9"/>
<outlet property="cameraCaptureButton" destination="uRG-b0-CjY" id="3Qc-PU-LUY"/>
<outlet property="cameraCaptureImageView" destination="pRT-iD-V8H" id="Zay-Q0-m1t"/>
<outlet property="cameraChooseButton" destination="PkX-yh-JhO" id="u4w-Ql-xte"/>
<outlet property="cameraModeButton" destination="sO8-Ds-mXZ" id="52I-ei-nX7"/>
<outlet property="cameraPreviewContainerAspectRatio" destination="pq0-bZ-KaJ" id="b5z-Tg-Mfn"/>
<outlet property="cameraPreviewContainerView" destination="w7z-f3-kdT" id="iqZ-I1-ZcW"/>
<outlet property="cameraRetakeButton" destination="uSU-qr-XnK" id="ei0-nR-e99"/>
<outlet property="cameraSwitchButton" destination="PXk-ZD-TYS" id="i6p-yB-8HG"/>
<outlet property="captureLabel" destination="uts-4w-rUd" id="PlQ-hG-6Ms"/>
<outlet property="captureViewContainer" destination="cE0-0g-Su5" id="cr5-6S-9rj"/>
<outlet property="captureViewContainerHeightConstraint" destination="wSV-4d-wK0" id="Icf-uj-RMG"/>
<outlet property="libraryAttachButton" destination="ioK-2h-a8C" id="W0u-DT-ddh"/>
<outlet property="libraryLabel" destination="peT-9h-pw6" id="r4c-oJ-QBj"/>
<outlet property="libraryOpenButton" destination="Iem-Jz-DfR" id="s87-yh-f9F"/>
<outlet property="libraryViewContainer" destination="QeN-lu-6hK" id="hHu-hn-fXS"/>
<outlet property="mainScrollView" destination="ZfS-wG-RjJ" id="Jjn-q7-ggw"/>
<outlet property="recentPictureCollectionViewHeightConstraint" destination="Hdu-9B-aYr" id="BgG-kA-oSz"/>
@@ -40,7 +48,7 @@
<constraint firstAttribute="height" constant="21" id="anL-vY-0ON"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="w7z-f3-kdT" userLabel="Preview Container View">
@@ -52,50 +60,108 @@
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PXk-ZD-TYS" userLabel="Camera Switch Button">
<rect key="frame" x="389" y="37" width="31" height="31"/>
<state key="normal" image="switch_camera.png">
<state key="normal" image="camera_switch.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted" image="camera_switch.png"/>
<connections>
<action selector="onButtonPressed:" destination="-1" eventType="touchUpInside" id="xHg-kl-L3w"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sO8-Ds-mXZ" userLabel="Camera Mode Button">
<rect key="frame" x="180" y="37" width="31" height="31"/>
<state key="normal" image="camera_mode.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted" image="camera_mode.png"/>
<connections>
<action selector="onButtonPressed:" destination="-1" eventType="touchUpInside" id="nvH-aw-ZJK"/>
</connections>
</button>
<imageView hidden="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="pRT-iD-V8H" userLabel="Capture Image View">
<rect key="frame" x="180" y="37" width="240" height="320"/>
</imageView>
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="dxP-iB-dWk" userLabel="Camera Activity Indicator">
<rect key="frame" x="290" y="190" width="20" height="20"/>
</activityIndicatorView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uRG-b0-CjY" userLabel="Capture Button">
<rect key="frame" x="283" y="362" width="35" height="35"/>
<constraints>
<constraint firstAttribute="height" constant="35" id="Aik-Gq-rvc"/>
<constraint firstAttribute="width" constant="35" id="gmN-48-HHd"/>
</constraints>
<state key="normal" image="camera_capture.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted" image="camera_capture.png"/>
<connections>
<action selector="onButtonPressed:" destination="-1" eventType="touchUpInside" id="R4P-UW-q4j"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uSU-qr-XnK" userLabel="Retake Button">
<rect key="frame" x="126" y="365" width="48" height="30"/>
<state key="normal" title="Retake">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted" title="Retake"/>
<connections>
<action selector="onButtonPressed:" destination="-1" eventType="touchUpInside" id="Ue0-sl-LyB"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PkX-yh-JhO" userLabel="Choose Button">
<rect key="frame" x="424" y="365" width="53" height="30"/>
<state key="normal" title="Choose">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted" title="Choose"/>
<connections>
<action selector="onButtonPressed:" destination="-1" eventType="touchUpInside" id="3bW-lf-ufF"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="uSU-qr-XnK" firstAttribute="centerX" secondItem="uRG-b0-CjY" secondAttribute="centerX" multiplier="0.5" id="Bum-4v-TdL"/>
<constraint firstItem="uts-4w-rUd" firstAttribute="top" secondItem="cE0-0g-Su5" secondAttribute="top" constant="8" id="Dua-l7-fL2"/>
<constraint firstAttribute="centerX" secondItem="w7z-f3-kdT" secondAttribute="centerX" id="F0v-GZ-U3n"/>
<constraint firstItem="w7z-f3-kdT" firstAttribute="top" secondItem="uts-4w-rUd" secondAttribute="bottom" constant="8" id="FX3-E3-rR4"/>
<constraint firstItem="pRT-iD-V8H" firstAttribute="height" secondItem="w7z-f3-kdT" secondAttribute="height" id="NBK-Lc-p8C"/>
<constraint firstItem="w7z-f3-kdT" firstAttribute="trailing" secondItem="PXk-ZD-TYS" secondAttribute="trailing" id="NBc-2m-4yz"/>
<constraint firstItem="uRG-b0-CjY" firstAttribute="centerY" secondItem="uSU-qr-XnK" secondAttribute="centerY" constant="-0.5" id="RqV-3a-gMc"/>
<constraint firstItem="pRT-iD-V8H" firstAttribute="centerX" secondItem="w7z-f3-kdT" secondAttribute="centerX" id="SYT-9H-EXd"/>
<constraint firstItem="pRT-iD-V8H" firstAttribute="width" secondItem="w7z-f3-kdT" secondAttribute="width" id="Uqt-Xp-hc6"/>
<constraint firstItem="w7z-f3-kdT" firstAttribute="centerY" secondItem="dxP-iB-dWk" secondAttribute="centerY" constant="-3" id="VJR-vg-mUx"/>
<constraint firstItem="PkX-yh-JhO" firstAttribute="centerX" secondItem="uRG-b0-CjY" secondAttribute="centerX" multiplier="3/2" id="X65-AQ-3jq"/>
<constraint firstItem="w7z-f3-kdT" firstAttribute="top" secondItem="PXk-ZD-TYS" secondAttribute="top" id="Yc4-hC-fc3"/>
<constraint firstItem="uRG-b0-CjY" firstAttribute="top" secondItem="w7z-f3-kdT" secondAttribute="bottom" constant="5" id="ZcV-Ea-NN1"/>
<constraint firstItem="pRT-iD-V8H" firstAttribute="centerY" secondItem="w7z-f3-kdT" secondAttribute="centerY" id="ao8-c3-cil"/>
<constraint firstItem="PkX-yh-JhO" firstAttribute="centerY" secondItem="uRG-b0-CjY" secondAttribute="centerY" constant="0.5" id="cAA-A1-uXM"/>
<constraint firstItem="w7z-f3-kdT" firstAttribute="centerX" secondItem="dxP-iB-dWk" secondAttribute="centerX" id="dhO-04-amL"/>
<constraint firstAttribute="trailing" secondItem="uts-4w-rUd" secondAttribute="trailing" constant="8" id="oLC-h9-pmq"/>
<constraint firstItem="uts-4w-rUd" firstAttribute="leading" secondItem="cE0-0g-Su5" secondAttribute="leading" constant="8" id="qrM-Rm-0IH"/>
<constraint firstAttribute="bottom" secondItem="w7z-f3-kdT" secondAttribute="bottom" constant="44" id="sFP-y1-o15"/>
<constraint firstAttribute="centerX" secondItem="uRG-b0-CjY" secondAttribute="centerX" id="sca-zF-zuj"/>
<constraint firstAttribute="height" constant="401" id="wSV-4d-wK0"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QeN-lu-6hK" userLabel="Library View">
<rect key="frame" x="0.0" y="401" width="600" height="300"/>
<rect key="frame" x="0.0" y="401" width="600" height="190"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="peT-9h-pw6" userLabel="Select Picture Label">
<rect key="frame" x="8" y="5" width="584" height="21"/>
<rect key="frame" x="8" y="15" width="584" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="9OI-yS-16S"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="Cnz-mP-gE5">
<rect key="frame" x="0.0" y="30" width="600" height="60"/>
<rect key="frame" x="0.0" y="40" width="600" height="100"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="Hdu-9B-aYr"/>
<constraint firstAttribute="height" constant="100" id="Hdu-9B-aYr"/>
</constraints>
<collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="10" minimumInteritemSpacing="10" id="wY5-ZF-Ge2">
<size key="itemSize" width="50" height="50"/>
<size key="itemSize" width="60" height="80"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
@@ -105,27 +171,50 @@
<outlet property="delegate" destination="-1" id="mW5-pj-ZDH"/>
</connections>
</collectionView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Iem-Jz-DfR" userLabel="Library Button">
<rect key="frame" x="125" y="150" width="48" height="30"/>
<state key="normal" title="Library">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted" title="Library"/>
<connections>
<action selector="onButtonPressed:" destination="-1" eventType="touchUpInside" id="h5r-0H-Rhm"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ioK-2h-a8C" userLabel="Attach Button">
<rect key="frame" x="432" y="150" width="45" height="30"/>
<state key="normal" title="Attach">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted" title="Attach"/>
<connections>
<action selector="onButtonPressed:" destination="-1" eventType="touchUpInside" id="PyK-xX-zEd"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="0.22481874390000001" green="0.40248149659999999" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="ioK-2h-a8C" secondAttribute="bottom" constant="10" id="Aj0-Vj-FTt"/>
<constraint firstAttribute="trailing" secondItem="Cnz-mP-gE5" secondAttribute="trailing" id="BJe-4u-jQP"/>
<constraint firstItem="peT-9h-pw6" firstAttribute="top" secondItem="QeN-lu-6hK" secondAttribute="top" constant="5" id="BWQ-EY-Oun"/>
<constraint firstItem="Cnz-mP-gE5" firstAttribute="top" secondItem="peT-9h-pw6" secondAttribute="bottom" constant="4" id="RBw-gb-qhI"/>
<constraint firstAttribute="height" constant="300" id="aRE-Ox-5IJ"/>
<constraint firstItem="peT-9h-pw6" firstAttribute="top" secondItem="QeN-lu-6hK" secondAttribute="top" constant="15" id="BWQ-EY-Oun"/>
<constraint firstItem="Cnz-mP-gE5" firstAttribute="bottom" secondItem="peT-9h-pw6" secondAttribute="bottom" constant="104" id="RBw-gb-qhI"/>
<constraint firstAttribute="height" constant="190" id="aRE-Ox-5IJ"/>
<constraint firstItem="peT-9h-pw6" firstAttribute="leading" secondItem="QeN-lu-6hK" secondAttribute="leading" constant="8" id="gjX-QW-MTM"/>
<constraint firstAttribute="bottom" secondItem="Iem-Jz-DfR" secondAttribute="bottom" constant="10" id="nWl-5v-GE4"/>
<constraint firstAttribute="trailing" secondItem="peT-9h-pw6" secondAttribute="trailing" constant="8" id="neB-S2-nGo"/>
<constraint firstItem="Cnz-mP-gE5" firstAttribute="leading" secondItem="QeN-lu-6hK" secondAttribute="leading" id="tZY-jP-C5K"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstItem="Iem-Jz-DfR" firstAttribute="centerX" secondItem="uSU-qr-XnK" secondAttribute="centerX" constant="-1" id="0bt-RV-j9W"/>
<constraint firstItem="cE0-0g-Su5" firstAttribute="top" secondItem="ZfS-wG-RjJ" secondAttribute="top" id="1Kz-qe-p3Y"/>
<constraint firstItem="QeN-lu-6hK" firstAttribute="top" secondItem="cE0-0g-Su5" secondAttribute="bottom" id="DVo-pQ-Dg5"/>
<constraint firstItem="cE0-0g-Su5" firstAttribute="centerX" secondItem="ZfS-wG-RjJ" secondAttribute="centerX" id="Fqd-7G-H68"/>
<constraint firstItem="cE0-0g-Su5" firstAttribute="leading" secondItem="ZfS-wG-RjJ" secondAttribute="leading" id="IZE-p0-8AN"/>
<constraint firstAttribute="bottom" secondItem="QeN-lu-6hK" secondAttribute="bottom" constant="12" id="XIT-bd-OlA"/>
<constraint firstAttribute="bottom" secondItem="QeN-lu-6hK" secondAttribute="bottom" id="XIT-bd-OlA"/>
<constraint firstAttribute="trailing" secondItem="cE0-0g-Su5" secondAttribute="trailing" id="c8a-IH-WgO"/>
<constraint firstItem="QeN-lu-6hK" firstAttribute="leading" secondItem="ZfS-wG-RjJ" secondAttribute="leading" id="e0b-PE-U5c"/>
<constraint firstItem="PkX-yh-JhO" firstAttribute="centerX" secondItem="ioK-2h-a8C" secondAttribute="centerX" constant="-3.5" id="f58-YA-4qh"/>
<constraint firstAttribute="trailing" secondItem="QeN-lu-6hK" secondAttribute="trailing" id="kbe-Uh-tug"/>
</constraints>
</scrollView>
@@ -140,6 +229,8 @@
</view>
</objects>
<resources>
<image name="switch_camera.png" width="31" height="31"/>
<image name="camera_capture.png" width="31" height="31"/>
<image name="camera_mode.png" width="31" height="31"/>
<image name="camera_switch.png" width="31" height="31"/>
</resources>
</document>