Browse Source

PDFView(ios)-sdk演示demo xib 优化一

yangliuhua 2 years ago
parent
commit
b9307ecfa8

+ 1 - 1
PDFViewer/AppDelegate.m

@@ -35,7 +35,7 @@
  // [CPDFKit setLicenseKey:@"YOUR_LICENSE_KEY_GOES_HERE" secret:@"YOUR_LICENSE_SECRET_GOES_HERE"];
     
     // com.compdfkit.pdfviewer
-    [CPDFKit setLicenseKey:@"d2rW7BdT+peaa/hxOm4N/PYo5lotThkuHWjzZs4IXTOdY7Wss9Vk/lZni8H4rKu7t/RMjwDlJIXKIqzwOO0h2IakMBU5cy12KJhwgKRGBL2rBSN7GpOoZTufmlxsrj6RWP60/mQ39ZQiTAjx4eTVL9VwudIk/2Zj7YfhVweCJN0=" secret:@"mG0c3O3Mzeu5dkZJW3gpql8+jBucojBtBSjI3YJz2gAQurxTxGuBlGAhs0P1mD3XKqvsLa4npVLfI/mo45dkJ5QFcNndGDskT70Jc2iwVo5hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1367/WkJ00tM7U7tttD6ccsvUiEnSpVC16x66CLYBR9nL4G5ayY1Yw9IbVniEuzaCCVg1bqAdLSXAjS4mxI/QshmpPEP0qS8yPf877NfXnm6gW/UFOMJ5eWQQ5IO+aCVQ=="];
+    [CPDFKit setLicenseKey:@"onNEoKiO7LoeaqbuxmqgdjgppXBMO/rw6wZFJJeJx9GM1kVzFIixr4J9NBUshFyyT3OUgE6PYL31GcaOiPidmfqwCQhMuSQlvs07DjzQLlmjY2PaBHwG4QvHneyElXU8Jp6AgBVVPL9Qb9bGfBIsdqbBwX8flHuHQQ5bEMKOPFw=" secret:@"mG0c3O3Mzeu5dkZJW3gpql8+jBucojBtBSjI3YJz2gB9ms/F1zY6gZ1RBu8mNJH8idoLDJapQzJJ1HR8a/MFd/uuwijAWJZJuvsTcRTp1Sdhrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBwyVLBY93oKLBB8UJg4t07605BGbaBKUlDopA0iGq1HSncUNNe38VRnoTm6ibgXyIG6+4UZPyBS1/6qLCcC9xQUtBaPhaWhE5XcAFbE1TZu+6KtsUUbXgEJiImZf6bVjCvA=="];
     
     NSString *tAnnotateAuther = CPDFKitShareConfig.annotationAuthor;
     NSLog(@"CPDFKit Annotation Author: \t %@", tAnnotateAuther);

+ 166 - 0
PDFViewer/Source/PDFBackground/BackgroundSettingView.xib

@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PDFBackgroundSettingView" colorLabel="IBBuiltInLabel-Green"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view autoresizesSubviews="NO" contentMode="scaleToFill" id="iN0-l3-epB" customClass="PDFBackgroundSettingView">
+            <rect key="frame" x="0.0" y="0.0" width="330" height="320"/>
+            <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
+            <subviews>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Opacity" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WzV-AY-Gmd">
+                    <rect key="frame" x="10" y="59" width="59" height="21"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Scale" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gxS-Xa-sdx">
+                    <rect key="frame" x="10" y="95" width="42" height="21"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="FG7-FK-rLP">
+                    <rect key="frame" x="77" y="90" width="245" height="31"/>
+                </slider>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rotation" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UVv-uU-lIu">
+                    <rect key="frame" x="10" y="131" width="64" height="21"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" minValue="0.0" maxValue="3" translatesAutoresizingMaskIntoConstraints="NO" id="kwi-8Q-0jD">
+                    <rect key="frame" x="76" y="126" width="246" height="31"/>
+                </slider>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zIC-E3-Ras">
+                    <rect key="frame" x="205" y="163" width="115" height="35"/>
+                    <state key="normal" title="Button"/>
+                    <buttonConfiguration key="configuration" style="plain" title="Page Range"/>
+                </button>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="X:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ucs-qK-tvu">
+                    <rect key="frame" x="10" y="206" width="16" height="21"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="PXh-R1-2qc">
+                    <rect key="frame" x="40" y="201" width="113" height="34"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="113" id="X8r-uX-KZK"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                    <textInputTraits key="textInputTraits"/>
+                </textField>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Y:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="S1T-te-l2h">
+                    <rect key="frame" x="178" y="208" width="15" height="21"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Background Edit" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TFr-MM-SNq">
+                    <rect key="frame" x="10" y="17" width="126" height="20.333333333333329"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Page Range" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FdA-Y1-Zhi">
+                    <rect key="frame" x="10" y="171" width="91" height="20"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tca-CK-pt5">
+                    <rect key="frame" x="127" y="245" width="77" height="35"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="77" id="lF7-ho-1SM"/>
+                    </constraints>
+                    <state key="normal" title="Button"/>
+                    <buttonConfiguration key="configuration" style="plain" title="Cancel"/>
+                </button>
+                <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" placeholderIntrinsicWidth="113" placeholderIntrinsicHeight="34" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="S1l-fS-lWs">
+                    <rect key="frame" x="207" y="201" width="113" height="34"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="113" id="J65-E9-MV5"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                    <textInputTraits key="textInputTraits"/>
+                </textField>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fIH-xy-g3a">
+                    <rect key="frame" x="242" y="244" width="65" height="35"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="65" id="1YF-5U-fn2"/>
+                    </constraints>
+                    <state key="normal" title="Button"/>
+                    <buttonConfiguration key="configuration" style="plain" title="Done"/>
+                </button>
+                <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="SAd-wR-TuX">
+                    <rect key="frame" x="77" y="54" width="245" height="31"/>
+                </slider>
+            </subviews>
+            <viewLayoutGuide key="safeArea" id="jgR-aY-L4e"/>
+            <color key="backgroundColor" systemColor="opaqueSeparatorColor"/>
+            <rect key="contentStretch" x="0.0" y="0.0" width="0.0" height="1"/>
+            <constraints>
+                <constraint firstItem="jgR-aY-L4e" firstAttribute="trailing" secondItem="SAd-wR-TuX" secondAttribute="trailing" constant="10" id="3It-S4-DIp"/>
+                <constraint firstItem="FdA-Y1-Zhi" firstAttribute="top" secondItem="kwi-8Q-0jD" secondAttribute="bottom" constant="15" id="45H-YV-lxO"/>
+                <constraint firstItem="S1l-fS-lWs" firstAttribute="top" secondItem="zIC-E3-Ras" secondAttribute="bottom" constant="3" id="4fx-xj-ZFV"/>
+                <constraint firstItem="FG7-FK-rLP" firstAttribute="leading" secondItem="gxS-Xa-sdx" secondAttribute="trailing" constant="27" id="6hO-mq-W67"/>
+                <constraint firstItem="S1T-te-l2h" firstAttribute="leading" secondItem="PXh-R1-2qc" secondAttribute="trailing" constant="25" id="Alr-8j-zDp"/>
+                <constraint firstItem="PXh-R1-2qc" firstAttribute="leading" secondItem="ucs-qK-tvu" secondAttribute="trailing" constant="14" id="Bib-MD-CA6"/>
+                <constraint firstItem="UVv-uU-lIu" firstAttribute="top" secondItem="gxS-Xa-sdx" secondAttribute="bottom" constant="15" id="Fc4-Nf-sWo"/>
+                <constraint firstItem="gxS-Xa-sdx" firstAttribute="leading" secondItem="jgR-aY-L4e" secondAttribute="leading" constant="10" id="GtN-x3-CSB"/>
+                <constraint firstItem="jgR-aY-L4e" firstAttribute="trailing" secondItem="kwi-8Q-0jD" secondAttribute="trailing" constant="10" id="HiC-Qh-nNA"/>
+                <constraint firstItem="UVv-uU-lIu" firstAttribute="leading" secondItem="jgR-aY-L4e" secondAttribute="leading" constant="10" id="JrO-A3-wR8"/>
+                <constraint firstItem="gxS-Xa-sdx" firstAttribute="top" secondItem="WzV-AY-Gmd" secondAttribute="bottom" constant="15" id="LWs-HF-Xrs"/>
+                <constraint firstItem="jgR-aY-L4e" firstAttribute="trailing" secondItem="zIC-E3-Ras" secondAttribute="trailing" constant="10" id="M68-ry-YIv"/>
+                <constraint firstItem="kwi-8Q-0jD" firstAttribute="top" secondItem="FG7-FK-rLP" secondAttribute="bottom" constant="6" id="NcW-p3-ZdJ"/>
+                <constraint firstItem="zIC-E3-Ras" firstAttribute="top" secondItem="kwi-8Q-0jD" secondAttribute="bottom" constant="7" id="PdL-Ad-vvU"/>
+                <constraint firstItem="ucs-qK-tvu" firstAttribute="leading" secondItem="jgR-aY-L4e" secondAttribute="leading" constant="10" id="RGY-x5-9j6"/>
+                <constraint firstItem="PXh-R1-2qc" firstAttribute="top" secondItem="FdA-Y1-Zhi" secondAttribute="bottom" constant="10" id="SDP-RB-SpD"/>
+                <constraint firstItem="kwi-8Q-0jD" firstAttribute="leading" secondItem="UVv-uU-lIu" secondAttribute="trailing" constant="4" id="Seg-VL-uIr"/>
+                <constraint firstItem="SAd-wR-TuX" firstAttribute="leading" secondItem="WzV-AY-Gmd" secondAttribute="trailing" constant="10" id="T8K-js-kqV"/>
+                <constraint firstItem="FdA-Y1-Zhi" firstAttribute="leading" secondItem="jgR-aY-L4e" secondAttribute="leading" constant="10" id="TEt-Oc-foH"/>
+                <constraint firstItem="TFr-MM-SNq" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="Tjc-7F-fZh"/>
+                <constraint firstItem="TFr-MM-SNq" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="17" id="Tto-9x-erg"/>
+                <constraint firstItem="ucs-qK-tvu" firstAttribute="top" secondItem="FdA-Y1-Zhi" secondAttribute="bottom" constant="15" id="Uvc-ju-tkA"/>
+                <constraint firstItem="jgR-aY-L4e" firstAttribute="trailing" secondItem="FG7-FK-rLP" secondAttribute="trailing" constant="10" id="Wy6-Bp-fJc"/>
+                <constraint firstItem="fIH-xy-g3a" firstAttribute="top" secondItem="S1l-fS-lWs" secondAttribute="bottom" constant="9" id="Yg8-la-YQm"/>
+                <constraint firstItem="tca-CK-pt5" firstAttribute="top" secondItem="PXh-R1-2qc" secondAttribute="bottom" constant="10" id="aLE-Pg-BaQ"/>
+                <constraint firstItem="S1l-fS-lWs" firstAttribute="leading" secondItem="S1T-te-l2h" secondAttribute="trailing" constant="14" id="bph-kc-JIW"/>
+                <constraint firstItem="WzV-AY-Gmd" firstAttribute="leading" secondItem="jgR-aY-L4e" secondAttribute="leading" constant="10" id="fXV-ee-ZX5"/>
+                <constraint firstItem="WzV-AY-Gmd" firstAttribute="top" secondItem="SAd-wR-TuX" secondAttribute="top" constant="5" id="hcd-qf-RHF"/>
+                <constraint firstItem="FG7-FK-rLP" firstAttribute="top" secondItem="SAd-wR-TuX" secondAttribute="bottom" constant="6" id="ktj-9L-d4O"/>
+                <constraint firstItem="jgR-aY-L4e" firstAttribute="trailing" secondItem="fIH-xy-g3a" secondAttribute="trailing" constant="23" id="o6t-0f-iBm"/>
+                <constraint firstItem="SAd-wR-TuX" firstAttribute="top" secondItem="TFr-MM-SNq" secondAttribute="bottom" constant="16.670000000000002" id="ubm-Xn-eaQ"/>
+                <constraint firstItem="S1T-te-l2h" firstAttribute="top" secondItem="kwi-8Q-0jD" secondAttribute="bottom" constant="52" id="vW4-hr-3sV"/>
+                <constraint firstItem="tca-CK-pt5" firstAttribute="leading" secondItem="jgR-aY-L4e" secondAttribute="leading" constant="127" id="xoJ-nX-YlF"/>
+            </constraints>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <connections>
+                <outlet property="cancelBtn" destination="tca-CK-pt5" id="YQe-Jf-gU0"/>
+                <outlet property="doneBtn" destination="fIH-xy-g3a" id="cFl-v7-MHj"/>
+                <outlet property="horizontalField" destination="PXh-R1-2qc" id="ukd-KI-obX"/>
+                <outlet property="opacitySlider" destination="SAd-wR-TuX" id="v60-X6-LdD"/>
+                <outlet property="pageBtn" destination="zIC-E3-Ras" id="srD-Qd-lHo"/>
+                <outlet property="rangeLabel" destination="FdA-Y1-Zhi" id="HFV-8b-3Vf"/>
+                <outlet property="rotationSlider" destination="kwi-8Q-0jD" id="atb-xW-RNL"/>
+                <outlet property="scaleSlider" destination="FG7-FK-rLP" id="ADw-2d-kWe"/>
+                <outlet property="titleLabel" destination="TFr-MM-SNq" id="bxV-6u-fc7"/>
+                <outlet property="verticalField" destination="S1l-fS-lWs" id="SSa-D0-8IH"/>
+            </connections>
+            <point key="canvasLocation" x="53.435114503816791" y="37.323943661971832"/>
+        </view>
+    </objects>
+    <resources>
+        <systemColor name="opaqueSeparatorColor">
+            <color red="0.77647058823529413" green="0.77647058823529413" blue="0.78431372549019607" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </systemColor>
+    </resources>
+</document>

+ 233 - 0
PDFViewer/Source/PDFBackground/BackgroundView.xib

@@ -0,0 +1,233 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PDFBackgroundView"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="PDFBackgroundView">
+            <rect key="frame" x="0.0" y="0.0" width="393" height="80"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Color" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Asj-Uy-gnl">
+                    <rect key="frame" x="10" y="5" width="50" height="30"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="30" id="ZmZ-ri-Alw"/>
+                        <constraint firstAttribute="width" constant="50" id="uDa-92-bau"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Image" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="flL-Wj-qvU">
+                    <rect key="frame" x="20" y="40" width="140" height="30"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="140" id="jky-Ox-ecJ"/>
+                        <constraint firstAttribute="height" constant="30" id="sWi-8f-vx9"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ilf-hc-vDz">
+                    <rect key="frame" x="355" y="5" width="28" height="28"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="28" id="CWi-mv-IPJ"/>
+                        <constraint firstAttribute="width" constant="28" id="o4m-06-FPb"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                    <buttonConfiguration key="configuration" style="filled">
+                        <backgroundConfiguration key="background" cornerRadius="14">
+                            <color key="backgroundColor" systemColor="systemPinkColor"/>
+                        </backgroundConfiguration>
+                        <fontDescription key="titleFontDescription" type="system" pointSize="15"/>
+                    </buttonConfiguration>
+                </button>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="oel-2u-BwM">
+                    <rect key="frame" x="317" y="5" width="28" height="28"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="28" id="AiU-sc-hZs"/>
+                        <constraint firstAttribute="width" constant="28" id="ghQ-GR-fum"/>
+                    </constraints>
+                    <state key="normal" title="Button"/>
+                    <buttonConfiguration key="configuration" style="filled">
+                        <backgroundConfiguration key="background" cornerRadius="14">
+                            <color key="backgroundColor" systemColor="systemOrangeColor"/>
+                        </backgroundConfiguration>
+                    </buttonConfiguration>
+                </button>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5Bx-Z5-1mL">
+                    <rect key="frame" x="279" y="5" width="28" height="28"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="28" id="6KJ-yL-LRE"/>
+                        <constraint firstAttribute="width" constant="28" id="D5G-Zm-19h"/>
+                    </constraints>
+                    <state key="normal" title="Button"/>
+                    <buttonConfiguration key="configuration" style="filled">
+                        <backgroundConfiguration key="background" cornerRadius="14">
+                            <color key="backgroundColor" systemColor="systemYellowColor"/>
+                        </backgroundConfiguration>
+                    </buttonConfiguration>
+                </button>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DT2-6t-Yve">
+                    <rect key="frame" x="241" y="5" width="28" height="28"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="28" id="5Ub-AJ-C65"/>
+                        <constraint firstAttribute="width" constant="28" id="Icc-0o-nxi"/>
+                    </constraints>
+                    <state key="normal" title="Button"/>
+                    <buttonConfiguration key="configuration" style="filled">
+                        <backgroundConfiguration key="background" cornerRadius="14">
+                            <color key="backgroundColor" systemColor="systemGreenColor"/>
+                        </backgroundConfiguration>
+                    </buttonConfiguration>
+                </button>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ofq-RN-o4S">
+                    <rect key="frame" x="203" y="5" width="28" height="28"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="28" id="75f-GH-3Le"/>
+                        <constraint firstAttribute="width" constant="28" id="jg9-oA-YpQ"/>
+                    </constraints>
+                    <state key="normal" title="Button"/>
+                    <buttonConfiguration key="configuration" style="filled">
+                        <backgroundConfiguration key="background" cornerRadius="14">
+                            <color key="backgroundColor" systemColor="systemBlueColor"/>
+                        </backgroundConfiguration>
+                    </buttonConfiguration>
+                </button>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TQ4-ke-8H9">
+                    <rect key="frame" x="165" y="5" width="28" height="28"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="28" id="o32-Xf-L1Q"/>
+                        <constraint firstAttribute="width" constant="28" id="pNY-34-Irw"/>
+                    </constraints>
+                    <state key="normal" title="Button"/>
+                    <buttonConfiguration key="configuration" style="filled">
+                        <backgroundConfiguration key="background" cornerRadius="14">
+                            <color key="backgroundColor" systemColor="systemBrownColor"/>
+                        </backgroundConfiguration>
+                    </buttonConfiguration>
+                </button>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xMA-9j-ihI">
+                    <rect key="frame" x="127" y="5" width="28" height="28"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="28" id="UaX-cg-WYt"/>
+                        <constraint firstAttribute="width" constant="28" id="V6Z-Vs-qv9"/>
+                    </constraints>
+                    <state key="normal" title="Button"/>
+                    <buttonConfiguration key="configuration" style="filled">
+                        <backgroundConfiguration key="background" cornerRadius="14">
+                            <color key="backgroundColor" systemColor="systemPurpleColor"/>
+                        </backgroundConfiguration>
+                    </buttonConfiguration>
+                </button>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ws2-Yk-jgk">
+                    <rect key="frame" x="89" y="5" width="28" height="28"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="28" id="Zd0-M1-hAv"/>
+                        <constraint firstAttribute="height" constant="28" id="aRt-Oc-8LH"/>
+                    </constraints>
+                    <state key="normal" title="Button"/>
+                    <buttonConfiguration key="configuration" style="filled">
+                        <backgroundConfiguration key="background" cornerRadius="14">
+                            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <color key="strokeColor" systemColor="labelColor"/>
+                        </backgroundConfiguration>
+                    </buttonConfiguration>
+                </button>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="erY-n4-1j4">
+                    <rect key="frame" x="188" y="38" width="180" height="35"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="180" id="IMe-mW-tDp"/>
+                        <constraint firstAttribute="height" constant="35" id="hKV-0t-qvg"/>
+                    </constraints>
+                    <state key="normal" title="Button"/>
+                    <buttonConfiguration key="configuration" style="plain" title="Select Image">
+                        <backgroundConfiguration key="background">
+                            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                            <color key="strokeColor" systemColor="labelColor"/>
+                        </backgroundConfiguration>
+                        <color key="baseForegroundColor" systemColor="labelColor"/>
+                    </buttonConfiguration>
+                </button>
+            </subviews>
+            <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
+            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+            <constraints>
+                <constraint firstItem="Ws2-Yk-jgk" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="5" id="4Rh-Ke-aNY"/>
+                <constraint firstItem="Ilf-hc-vDz" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="5" id="572-HX-Qlx"/>
+                <constraint firstItem="TQ4-ke-8H9" firstAttribute="leading" secondItem="xMA-9j-ihI" secondAttribute="trailing" constant="10" id="7om-Xd-tEV"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="erY-n4-1j4" secondAttribute="trailing" constant="25" id="AWv-rQ-36c"/>
+                <constraint firstItem="oel-2u-BwM" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="5" id="AtF-se-fqq"/>
+                <constraint firstItem="erY-n4-1j4" firstAttribute="top" secondItem="5Bx-Z5-1mL" secondAttribute="bottom" constant="5" id="DYa-P3-Rq1"/>
+                <constraint firstItem="Ofq-RN-o4S" firstAttribute="leading" secondItem="TQ4-ke-8H9" secondAttribute="trailing" constant="10" id="EFZ-4T-Ztn"/>
+                <constraint firstItem="xMA-9j-ihI" firstAttribute="leading" secondItem="Ws2-Yk-jgk" secondAttribute="trailing" constant="10" id="Fq6-OK-x64"/>
+                <constraint firstItem="DT2-6t-Yve" firstAttribute="leading" secondItem="Ofq-RN-o4S" secondAttribute="trailing" constant="10" id="IO0-q7-oEe"/>
+                <constraint firstItem="DT2-6t-Yve" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="5" id="NE1-zf-jKU"/>
+                <constraint firstItem="5Bx-Z5-1mL" firstAttribute="leading" secondItem="DT2-6t-Yve" secondAttribute="trailing" constant="10" id="PsZ-6B-3Yl"/>
+                <constraint firstItem="Ilf-hc-vDz" firstAttribute="leading" secondItem="oel-2u-BwM" secondAttribute="trailing" constant="10" id="T17-oR-9rs"/>
+                <constraint firstItem="oel-2u-BwM" firstAttribute="leading" secondItem="5Bx-Z5-1mL" secondAttribute="trailing" constant="10" id="V6q-Rx-ggH"/>
+                <constraint firstItem="Asj-Uy-gnl" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="5" id="W0L-eE-GgI"/>
+                <constraint firstItem="xMA-9j-ihI" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="5" id="gx6-Qg-8B5"/>
+                <constraint firstAttribute="trailing" secondItem="Ilf-hc-vDz" secondAttribute="trailing" constant="10" id="kUq-Xl-jqQ"/>
+                <constraint firstItem="flL-Wj-qvU" firstAttribute="top" secondItem="Asj-Uy-gnl" secondAttribute="bottom" constant="5" id="ldA-sS-ZHL"/>
+                <constraint firstItem="TQ4-ke-8H9" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="5" id="npv-Hi-rdw"/>
+                <constraint firstItem="flL-Wj-qvU" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="20" id="rWc-dB-ym6"/>
+                <constraint firstItem="5Bx-Z5-1mL" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="5" id="uG7-vj-DOA"/>
+                <constraint firstItem="Asj-Uy-gnl" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="usP-Zx-6we"/>
+                <constraint firstItem="Ofq-RN-o4S" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="5" id="vjq-lV-KKh"/>
+            </constraints>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <connections>
+                <outlet property="colorBtn1" destination="Ilf-hc-vDz" id="Q5P-eo-kjG"/>
+                <outlet property="colorBtn2" destination="oel-2u-BwM" id="ZGt-9y-cdH"/>
+                <outlet property="colorBtn3" destination="5Bx-Z5-1mL" id="zvY-SL-BOE"/>
+                <outlet property="colorBtn4" destination="DT2-6t-Yve" id="PAn-Q6-nnN"/>
+                <outlet property="colorBtn5" destination="Ofq-RN-o4S" id="7or-FS-Yf6"/>
+                <outlet property="colorBtn6" destination="TQ4-ke-8H9" id="rlg-IE-LP2"/>
+                <outlet property="colorBtn7" destination="xMA-9j-ihI" id="Ntz-if-rfz"/>
+                <outlet property="colorBtn8" destination="Ws2-Yk-jgk" id="1TB-1i-b3L"/>
+                <outlet property="colorLabel" destination="Asj-Uy-gnl" id="Set-Ly-6Jh"/>
+                <outlet property="imageLabel" destination="flL-Wj-qvU" id="8Zw-x1-L6n"/>
+                <outlet property="selectBtn" destination="erY-n4-1j4" id="wbl-4S-Ley"/>
+            </connections>
+            <point key="canvasLocation" x="130.53435114503816" y="-12.67605633802817"/>
+        </view>
+    </objects>
+    <resources>
+        <systemColor name="labelColor">
+            <color red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </systemColor>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+        <systemColor name="systemBlueColor">
+            <color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </systemColor>
+        <systemColor name="systemBrownColor">
+            <color red="0.63529411764705879" green="0.51764705882352946" blue="0.36862745098039218" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </systemColor>
+        <systemColor name="systemGreenColor">
+            <color red="0.20392156862745098" green="0.7803921568627451" blue="0.34901960784313724" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </systemColor>
+        <systemColor name="systemOrangeColor">
+            <color red="1" green="0.58431372549019611" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </systemColor>
+        <systemColor name="systemPinkColor">
+            <color red="1" green="0.17647058823529413" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </systemColor>
+        <systemColor name="systemPurpleColor">
+            <color red="0.68627450980392157" green="0.32156862745098042" blue="0.87058823529411766" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </systemColor>
+        <systemColor name="systemYellowColor">
+            <color red="1" green="0.80000000000000004" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </systemColor>
+    </resources>
+</document>

+ 0 - 1
PDFViewer/Source/PDFBackground/PDFBackgroundModel.h

@@ -13,7 +13,6 @@ NS_ASSUME_NONNULL_BEGIN
 @interface PDFBackgroundModel : NSObject
 
 @property (nonatomic,strong) UIColor *backgroundColor;
-
 @property (nonatomic,assign) CGFloat backgroundOpacity;
 @property (nonatomic,assign) CGFloat backgroudScale;
 @property (nonatomic,assign) NSString *pageString;

+ 25 - 15
PDFViewer/Source/PDFBackground/PDFBackgroundSettingView.h

@@ -10,22 +10,32 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @interface PDFBackgroundSettingView : UIView
+@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
+@property (weak, nonatomic) IBOutlet UISlider *scaleSlider;
+@property (weak, nonatomic) IBOutlet UISlider *opacitySlider;
+@property (weak, nonatomic) IBOutlet UISlider *rotationSlider;
+@property (weak, nonatomic) IBOutlet UIButton *pageBtn;
+@property (weak, nonatomic) IBOutlet UILabel *rangeLabel;
+@property (weak, nonatomic) IBOutlet UITextField *horizontalField;
+@property (weak, nonatomic) IBOutlet UITextField *verticalField;
+@property (weak, nonatomic) IBOutlet UIButton *doneBtn;
+@property (weak, nonatomic) IBOutlet UIButton *cancelBtn;
 
-@property (nonatomic,strong) UILabel *titleLabel;
-@property (nonatomic,strong) UISlider *scaleSlider;
-@property (nonatomic,strong) UISlider *opacitySlider;
-@property (nonatomic,strong) UISlider *rotationSlider;
-@property (nonatomic,strong) UILabel *rotationlabel;
-@property (nonatomic,strong) UILabel *textLabel;
-@property (nonatomic,strong) UILabel *opacityLabel;
-@property (nonatomic,strong) UILabel *rangeLabel;
-@property (nonatomic,strong) UITextField *verticalField;
-@property (nonatomic,strong) UITextField *horizontalField;
-@property (nonatomic,strong) UILabel *verticalLabel;
-@property (nonatomic,strong) UILabel *horizontalLabel;
-@property (nonatomic,strong) UIButton *pageBtn;
-@property (nonatomic,strong) UIButton *doneBtn;
-@property (nonatomic,strong) UIButton *cancelBtn;
+//@property (nonatomic,strong) UILabel *titleLabel;
+//@property (nonatomic,strong) UISlider *scaleSlider;
+//@property (nonatomic,strong) UISlider *opacitySlider;
+//@property (nonatomic,strong) UISlider *rotationSlider;
+//@property (nonatomic,strong) UILabel *rotationlabel;
+//@property (nonatomic,strong) UILabel *textLabel;
+//@property (nonatomic,strong) UILabel *opacityLabel;
+//@property (nonatomic,strong) UILabel *rangeLabel;
+//@property (nonatomic,strong) UITextField *verticalField;
+//@property (nonatomic,strong) UITextField *horizontalField;
+//@property (nonatomic,strong) UILabel *verticalLabel;
+//@property (nonatomic,strong) UILabel *horizontalLabel;
+//@property (nonatomic,strong) UIButton *pageBtn;
+//@property (nonatomic,strong) UIButton *doneBtn;
+//@property (nonatomic,strong) UIButton *cancelBtn;
 
 @end
 

+ 142 - 141
PDFViewer/Source/PDFBackground/PDFBackgroundSettingView.m

@@ -13,153 +13,154 @@
 - (instancetype)initWithFrame:(CGRect)frame {
     self = [super initWithFrame:frame];
     if (self) {
-        _opacitySlider = [[UISlider alloc] init];
-        _scaleSlider = [[UISlider alloc] init];
-        _rotationSlider = [[UISlider alloc] init];
-        
-        [self addSubview:_opacitySlider];
-        [self addSubview:_scaleSlider];
-        [self addSubview:_rotationSlider];
-        
-        _rotationlabel = [[UILabel alloc] init];
-        _rangeLabel = [[UILabel alloc] init];
-        _textLabel = [[UILabel alloc] init];
-        _opacityLabel = [[UILabel alloc] init];
-        _titleLabel = [[UILabel alloc] init];
-        
-        [self addSubview:_textLabel];
-        [self addSubview:_opacityLabel];
-        [self addSubview:_rangeLabel];
-        [self addSubview:_rotationlabel];
-        [self addSubview:_titleLabel];
-        
-        _verticalField = [[UITextField alloc] init];
-        _verticalField.borderStyle = UITextBorderStyleRoundedRect;
-        _verticalLabel = [[UILabel alloc] init];
-        _horizontalField = [[UITextField alloc] init];
-        _horizontalField.borderStyle = UITextBorderStyleRoundedRect;
-        _horizontalLabel = [[UILabel alloc] init];
-        _pageBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
-        
-        [self addSubview:_verticalLabel];
-        [self addSubview:_verticalField];
-        [self addSubview:_horizontalField];
-        [self addSubview:_horizontalLabel];
-        [self addSubview:_pageBtn];
-        
-        _doneBtn = [[UIButton alloc] init];
-        _cancelBtn = [[UIButton alloc] init];
-        
-        [self addSubview:_doneBtn];
-        [self addSubview:_cancelBtn];
-        
-        self.backgroundColor = [UIColor grayColor];
+//        _opacitySlider = [[UISlider alloc] init];
+//        _scaleSlider = [[UISlider alloc] init];
+//        _rotationSlider = [[UISlider alloc] init];
+//
+//        [self addSubview:_opacitySlider];
+//        [self addSubview:_scaleSlider];
+//        [self addSubview:_rotationSlider];
+//
+//        _rotationlabel = [[UILabel alloc] init];
+//        _rangeLabel = [[UILabel alloc] init];
+//        _textLabel = [[UILabel alloc] init];
+//        _opacityLabel = [[UILabel alloc] init];
+//        _titleLabel = [[UILabel alloc] init];
+//
+//        [self addSubview:_textLabel];
+//        [self addSubview:_opacityLabel];
+//        [self addSubview:_rangeLabel];
+//        [self addSubview:_rotationlabel];
+//        [self addSubview:_titleLabel];
+//
+//        _verticalField = [[UITextField alloc] init];
+//        _verticalField.borderStyle = UITextBorderStyleRoundedRect;
+//        _verticalLabel = [[UILabel alloc] init];
+//        _horizontalField = [[UITextField alloc] init];
+//        _horizontalField.borderStyle = UITextBorderStyleRoundedRect;
+//        _horizontalLabel = [[UILabel alloc] init];
+//        _pageBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
+//
+//        [self addSubview:_verticalLabel];
+//        [self addSubview:_verticalField];
+//        [self addSubview:_horizontalField];
+//        [self addSubview:_horizontalLabel];
+//        [self addSubview:_pageBtn];
+//
+//        _doneBtn = [[UIButton alloc] init];
+//        _cancelBtn = [[UIButton alloc] init];
+//
+//        [self addSubview:_doneBtn];
+//        [self addSubview:_cancelBtn];
+//
+//        self.backgroundColor = [UIColor grayColor];
+        self = [[NSBundle mainBundle] loadNibNamed:@"BackgroundSettingView" owner:nil options:nil].firstObject;
     }
     
     return self;
 }
 
-- (void)drawRect:(CGRect)rect {
-    
-    _titleLabel.frame = CGRectMake(5, 5, 180, 50);
-    _rangeLabel.frame = CGRectMake(5, 165, 150, 30);
-    _textLabel.frame = CGRectMake(5, 95, 90, 30);
-    _opacityLabel.frame = CGRectMake(5, 60, 90, 30);
-    _rotationlabel.frame = CGRectMake(5, 130, 90, 30);
-    
-    [self addConstraint];
-    [self assignData];
-}
+//- (void)drawRect:(CGRect)rect {
+//
+//    _titleLabel.frame = CGRectMake(5, 5, 180, 50);
+//    _rangeLabel.frame = CGRectMake(5, 165, 150, 30);
+//    _textLabel.frame = CGRectMake(5, 95, 90, 30);
+//    _opacityLabel.frame = CGRectMake(5, 60, 90, 30);
+//    _rotationlabel.frame = CGRectMake(5, 130, 90, 30);
+//
+//    [self addConstraint];
+//    [self assignData];
+//}
 
-- (void)addConstraint {
-    [_verticalField mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.right.equalTo(self.mas_right).offset(-15);
-        make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
-        make.width.equalTo(@80);
-        make.height.equalTo(@30);
-    }];
-    [_verticalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.right.equalTo(self.mas_right).offset(-95);
-        make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
-        make.width.equalTo(@20);
-        make.height.equalTo(@30);
-    }];
-    [_horizontalField mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.equalTo(self.mas_left).offset(25);
-        make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
-        make.width.equalTo(@80);
-        make.height.equalTo(@30);
-    }];
-    [_horizontalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.equalTo(self.mas_left).offset(5);
-        make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
-        make.width.equalTo(@20);
-        make.height.equalTo(@30);
-    }];
-    [_scaleSlider mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.right.equalTo(self.mas_right).offset(-15);
-        make.left.equalTo(_textLabel.mas_right).offset(0);
-        make.top.equalTo(self.mas_top).offset(95);
-        make.height.equalTo(@30);
-    }];
-    [_opacitySlider mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.right.equalTo(self.mas_right).offset(-15);
-        make.left.equalTo(_opacityLabel.mas_right).offset(0);
-        make.top.equalTo(self.mas_top).offset(60);
-        make.height.equalTo(@30);
-    }];
-    [_rotationSlider mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.right.equalTo(self.mas_right).offset(-15);
-        make.left.equalTo(_rotationlabel.mas_right).offset(0);
-        make.top.equalTo(_scaleSlider.mas_bottom).offset(5);
-    }];
-    
-    [_pageBtn mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.right.equalTo(self.mas_right).offset(-15);
-        make.top.equalTo(self.rotationSlider.mas_bottom).offset(5);
-        make.left.equalTo(_rangeLabel.mas_right);
-        make.height.equalTo(@35);
-    }];
-    
-    [_doneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.right.equalTo(self.mas_right).offset(-15);
-        make.top.equalTo(_horizontalField.mas_bottom).offset(25);
-        make.height.mas_equalTo(30);
-        make.width.mas_equalTo(80);
-    }];
-    
-    [_cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.right.equalTo(self.mas_right).offset(-110);
-        make.top.equalTo(_horizontalField.mas_bottom).offset(25);
-        make.height.mas_equalTo(30);
-        make.width.mas_equalTo(80);
-    }];
-}
+//- (void)addConstraint {
+//    [_verticalField mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.right.equalTo(self.mas_right).offset(-15);
+//        make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
+//        make.width.equalTo(@80);
+//        make.height.equalTo(@30);
+//    }];
+//    [_verticalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.right.equalTo(self.mas_right).offset(-95);
+//        make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
+//        make.width.equalTo(@20);
+//        make.height.equalTo(@30);
+//    }];
+//    [_horizontalField mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.left.equalTo(self.mas_left).offset(25);
+//        make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
+//        make.width.equalTo(@80);
+//        make.height.equalTo(@30);
+//    }];
+//    [_horizontalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.left.equalTo(self.mas_left).offset(5);
+//        make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
+//        make.width.equalTo(@20);
+//        make.height.equalTo(@30);
+//    }];
+//    [_scaleSlider mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.right.equalTo(self.mas_right).offset(-15);
+//        make.left.equalTo(_textLabel.mas_right).offset(0);
+//        make.top.equalTo(self.mas_top).offset(95);
+//        make.height.equalTo(@30);
+//    }];
+//    [_opacitySlider mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.right.equalTo(self.mas_right).offset(-15);
+//        make.left.equalTo(_opacityLabel.mas_right).offset(0);
+//        make.top.equalTo(self.mas_top).offset(60);
+//        make.height.equalTo(@30);
+//    }];
+//    [_rotationSlider mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.right.equalTo(self.mas_right).offset(-15);
+//        make.left.equalTo(_rotationlabel.mas_right).offset(0);
+//        make.top.equalTo(_scaleSlider.mas_bottom).offset(5);
+//    }];
+//
+//    [_pageBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.right.equalTo(self.mas_right).offset(-15);
+//        make.top.equalTo(self.rotationSlider.mas_bottom).offset(5);
+//        make.left.equalTo(_rangeLabel.mas_right);
+//        make.height.equalTo(@35);
+//    }];
+//
+//    [_doneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.right.equalTo(self.mas_right).offset(-15);
+//        make.top.equalTo(_horizontalField.mas_bottom).offset(25);
+//        make.height.mas_equalTo(30);
+//        make.width.mas_equalTo(80);
+//    }];
+//
+//    [_cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.right.equalTo(self.mas_right).offset(-110);
+//        make.top.equalTo(_horizontalField.mas_bottom).offset(25);
+//        make.height.mas_equalTo(30);
+//        make.width.mas_equalTo(80);
+//    }];
+//}
 
-- (void)assignData {
-    _rangeLabel.text = NSLocalizedString(@"Page Range", nil);
-    _rangeLabel.font = [UIFont systemFontOfSize:15];
-    _titleLabel.text = NSLocalizedString(@"Background Edit", nil);
-    _rotationlabel.text = NSLocalizedString(@"Rotation", nil);
-    _textLabel.text = NSLocalizedString(@"Scale", nil);
-    _opacityLabel.text = NSLocalizedString(@"Opacity", nil);
-    _verticalLabel.text = @"Y:";
-    _horizontalLabel.text = @"X:";
-    _verticalField.text = NSLocalizedString(@"100", nil);
-    _horizontalField.text = NSLocalizedString(@"100", nil);
-    
-    _scaleSlider.minimumValue = 0.2;
-    _scaleSlider.maximumValue = 1;
-    _scaleSlider.value = 1;
-    
-    _rotationSlider.minimumValue = 0;
-    _rotationSlider.maximumValue = M_PI;
-    
-    [_pageBtn setTitle:NSLocalizedString(@"Page Range", nil) forState:UIControlStateNormal];
-    [_doneBtn setTitle:NSLocalizedString(@"Done", nil) forState:UIControlStateNormal];
-    [_doneBtn setTitleColor:UIColor.systemBlueColor forState:UIControlStateNormal];
-    [_cancelBtn setTitle:NSLocalizedString(@"Cancel", nil) forState:UIControlStateNormal];
-    [_cancelBtn setTitleColor:UIColor.systemBlueColor forState:UIControlStateNormal];
-}
+//- (void)assignData {
+//    _rangeLabel.text = NSLocalizedString(@"Page Range", nil);
+//    _rangeLabel.font = [UIFont systemFontOfSize:15];
+//    _titleLabel.text = NSLocalizedString(@"Background Edit", nil);
+//    _rotationlabel.text = NSLocalizedString(@"Rotation", nil);
+//    _textLabel.text = NSLocalizedString(@"Scale", nil);
+//    _opacityLabel.text = NSLocalizedString(@"Opacity", nil);
+//    _verticalLabel.text = @"Y:";
+//    _horizontalLabel.text = @"X:";
+//    _verticalField.text = NSLocalizedString(@"100", nil);
+//    _horizontalField.text = NSLocalizedString(@"100", nil);
+//
+//    _scaleSlider.minimumValue = 0.2;
+//    _scaleSlider.maximumValue = 1;
+//    _scaleSlider.value = 1;
+//
+//    _rotationSlider.minimumValue = 0;
+//    _rotationSlider.maximumValue = M_PI;
+//
+//    [_pageBtn setTitle:NSLocalizedString(@"Page Range", nil) forState:UIControlStateNormal];
+//    [_doneBtn setTitle:NSLocalizedString(@"Done", nil) forState:UIControlStateNormal];
+//    [_doneBtn setTitleColor:UIColor.systemBlueColor forState:UIControlStateNormal];
+//    [_cancelBtn setTitle:NSLocalizedString(@"Cancel", nil) forState:UIControlStateNormal];
+//    [_cancelBtn setTitleColor:UIColor.systemBlueColor forState:UIControlStateNormal];
+//}
 
 @end

+ 3 - 3
PDFViewer/Source/PDFBackground/PDFBackgroundSettingViewController.m

@@ -105,9 +105,9 @@
 - (void)addTargets {
     [_backgroundView.selectBtn addTarget:self action:@selector(onSelectBtnClicked:) forControlEvents:UIControlEventTouchDown];
     
-    for (NSInteger i = 0; i < _backgroundView.colorArray.count; ++i) {
-        [_backgroundView.colorArray[i] addTarget:self action:@selector(onColorBtnClicked:) forControlEvents:UIControlEventTouchDown];
-    }
+//    for (NSInteger i = 0; i < _backgroundView.colorArray.count; ++i) {
+//        [_backgroundView.colorArray[i] addTarget:self action:@selector(onColorBtnClicked:) forControlEvents:UIControlEventTouchDown];
+//    }
 }
 
 #pragma mark - Actions

+ 17 - 5
PDFViewer/Source/PDFBackground/PDFBackgroundView.h

@@ -11,11 +11,23 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface PDFBackgroundView : UIView
 
-@property (nonatomic,strong) UIButton *colorBtn;
-@property (nonatomic,strong) UILabel *colorLabel;
-@property (nonatomic,strong) UIButton *selectBtn;
-@property (nonatomic,strong) UILabel *imageLabel;
-@property (nonatomic,strong) NSMutableArray *colorArray;
+@property (retain, nonatomic) IBOutlet UILabel *imageLabel;
+@property (retain, nonatomic) IBOutlet UILabel *colorLabel;
+@property (retain, nonatomic) IBOutlet UIButton *selectBtn;
+@property (retain, nonatomic) IBOutlet UIButton *colorBtn1;
+@property (retain, nonatomic) IBOutlet UIButton *colorBtn2;
+@property (retain, nonatomic) IBOutlet UIButton *colorBtn3;
+@property (retain, nonatomic) IBOutlet UIButton *colorBtn4;
+@property (retain, nonatomic) IBOutlet UIButton *colorBtn5;
+@property (retain, nonatomic) IBOutlet UIButton *colorBtn6;
+@property (retain, nonatomic) IBOutlet UIButton *colorBtn7;
+@property (retain, nonatomic) IBOutlet UIButton *colorBtn8;
+
+//@property (nonatomic,strong) UIButton *colorBtn;
+//@property (nonatomic,strong) UILabel *colorLabel;
+//@property (nonatomic,strong) UIButton *selectBtn;
+//@property (nonatomic,strong) UILabel *imageLabel;
+//@property (nonatomic,strong) NSMutableArray *colorArray;
 
 @end
 

+ 73 - 61
PDFViewer/Source/PDFBackground/PDFBackgroundView.m

@@ -17,77 +17,89 @@
     self = [super initWithFrame:frame];
     
     if (self) {
-        _imageLabel = [[UILabel alloc] init];
-        [self addSubview:_imageLabel];
-        
-        _selectBtn = [[UIButton alloc] init];
-        [self addSubview:_selectBtn];
+//        _imageLabel = [[UILabel alloc] init];
+//        [self addSubview:_imageLabel];
+//
+//        _selectBtn = [[UIButton alloc] init];
+//        [self addSubview:_selectBtn];
+//
+//        _colorLabel = [[UILabel alloc] init];
+//        [self addSubview:_colorLabel];
         
-        _colorLabel = [[UILabel alloc] init];
-        [self addSubview:_colorLabel];
+//        _colorArray = [NSMutableArray array];
+//
+//        [_colorArray addObject:_colorBtn1];
+//        [_colorArray addObject:_colorBtn2];
+//        [_colorArray addObject:_colorBtn3];
+//        [_colorArray addObject:_colorBtn4];
+//        [_colorArray addObject:_colorBtn5];
+//        [_colorArray addObject:_colorBtn6];
+//        [_colorArray addObject:_colorBtn7];
+//        [_colorArray addObject:_colorBtn8];
+//        for (NSInteger i = 0; i < 8; ++i) {
+////            _colorBtn = [UIButton buttonWithType:UIButtonTypeSystem];
+////            [_colorArray addObject:_colorBtn];
+////            [self addSubview:_colorBtn];
+//
+//        }
         
-        _colorArray = [NSMutableArray array];
-        for (NSInteger i = 0; i < 8; ++i) {
-            _colorBtn = [UIButton buttonWithType:UIButtonTypeSystem];
-            [_colorArray addObject:_colorBtn];
-            [self addSubview:_colorBtn];
-        }
+        self = [[NSBundle mainBundle] loadNibNamed:@"BackgroundView" owner:nil options:nil].firstObject;
     }
     
     return self;
 }
 
-- (void)drawRect:(CGRect)rect {
-    [super drawRect:rect];
-    
-    _colorLabel.frame = CGRectMake(10, 5, 50, 30);
-    _colorLabel.text = NSLocalizedString(@"Color", nil);
-    _imageLabel.frame = CGRectMake(20, 40, 140, 30);
-    _imageLabel.text = NSLocalizedString(@"Image", nil);
-    
-    for (NSInteger i = 0; i < _colorArray.count; i++) {
-        [[[self colorArray][i] layer] setCornerRadius:KBUTTON_WIDTH / 2];
-        [[[self colorArray][i] layer] setMasksToBounds:YES];
-        [[_colorArray[i] layer] setBorderWidth:0.5f];
-        [[_colorArray[i] layer] setBorderColor:UIColor.grayColor.CGColor];
-    }
+//- (void)drawRect:(CGRect)rect {
+//    [super drawRect:rect];
     
-    [_colorArray[0] setBackgroundColor:[UIColor redColor]];
-    [_colorArray[1] setBackgroundColor:[UIColor orangeColor]];
-    [_colorArray[2] setBackgroundColor:[UIColor yellowColor]];
-    [_colorArray[3] setBackgroundColor:[UIColor greenColor]];
-    [_colorArray[4] setBackgroundColor:[UIColor blueColor]];
-    [_colorArray[5] setBackgroundColor:[UIColor brownColor]];
-    [_colorArray[6] setBackgroundColor:[UIColor purpleColor]];
-    [_colorArray[7] setBackgroundColor:[UIColor whiteColor]];
+//    _colorLabel.frame = CGRectMake(10, 5, 50, 30);
+//    _colorLabel.text = NSLocalizedString(@"Color", nil);
+//    _imageLabel.frame = CGRectMake(20, 40, 140, 30);
+//    _imageLabel.text = NSLocalizedString(@"Image", nil);
     
-    _selectBtn.layer.borderWidth = 1.0;
-    _selectBtn.layer.borderColor = UIColor.grayColor.CGColor;
-    [_selectBtn setTitle:NSLocalizedString(@"Select Image", nil) forState:UIControlStateNormal];
-    [_selectBtn setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
-    _selectBtn.layer.cornerRadius = 7;
+//    for (NSInteger i = 0; i < _colorArray.count; i++) {
+//        [[[self colorArray][i] layer] setCornerRadius:KBUTTON_WIDTH / 2];
+//        [[[self colorArray][i] layer] setMasksToBounds:YES];
+//        [[_colorArray[i] layer] setBorderWidth:0.5f];
+//        [[_colorArray[i] layer] setBorderColor:UIColor.grayColor.CGColor];
+//    }
+//
+//    [_colorArray[0] setBackgroundColor:[UIColor redColor]];
+//    [_colorArray[1] setBackgroundColor:[UIColor orangeColor]];
+//    [_colorArray[2] setBackgroundColor:[UIColor yellowColor]];
+//    [_colorArray[3] setBackgroundColor:[UIColor greenColor]];
+//    [_colorArray[4] setBackgroundColor:[UIColor blueColor]];
+//    [_colorArray[5] setBackgroundColor:[UIColor brownColor]];
+//    [_colorArray[6] setBackgroundColor:[UIColor purpleColor]];
+//    [_colorArray[7] setBackgroundColor:[UIColor whiteColor]];
+//
+//    _selectBtn.layer.borderWidth = 1.0;
+//    _selectBtn.layer.borderColor = UIColor.grayColor.CGColor;
+//    [_selectBtn setTitle:NSLocalizedString(@"Select Image", nil) forState:UIControlStateNormal];
+//    [_selectBtn setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
+//    _selectBtn.layer.cornerRadius = 7;
     
-    [self addConstraint];
-}
+//    [self addConstraint];
+//}
  
-- (void)addConstraint {
-    NSInteger offset = 10;
-    for (NSInteger i = 0; i < _colorArray.count; ++i) {
-        [_colorArray[i] mas_makeConstraints:^(MASConstraintMaker *make) {
-            make.right.equalTo(self.mas_right).offset( - offset);
-            make.top.equalTo(self.mas_top).offset(5);
-            make.width.equalTo(@KBUTTON_WIDTH);
-            make.height.equalTo(@KBUTTON_HEIGHT);
-        }];
-        offset += 40;
-    }
-    
-    [_selectBtn mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.right.equalTo(self.mas_right).offset(-25);
-        make.top.equalTo(self.colorLabel.mas_bottom).offset(5);
-        make.width.mas_equalTo(180);
-        make.height.equalTo(@35);
-    }];
-}
+//- (void)addConstraint {
+//    NSInteger offset = 10;
+//    for (NSInteger i = 0; i < _colorArray.count; ++i) {
+//        [_colorArray[i] mas_makeConstraints:^(MASConstraintMaker *make) {
+//            make.right.equalTo(self.mas_right).offset( - offset);
+//            make.top.equalTo(self.mas_top).offset(5);
+//            make.width.equalTo(@KBUTTON_WIDTH);
+//            make.height.equalTo(@KBUTTON_HEIGHT);
+//        }];
+//        offset += 40;
+//    }
+//
+//    [_selectBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.right.equalTo(self.mas_right).offset(-25);
+//        make.top.equalTo(self.colorLabel.mas_bottom).offset(5);
+//        make.width.mas_equalTo(180);
+//        make.height.equalTo(@35);
+//    }];
+//}
 
 @end

+ 204 - 0
PDFViewer/Source/PDFHeaderFooter/HeaderFooterAddView.xib

@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PDFHeaderFooterAddView"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="PDFHeaderFooterAddView">
+            <rect key="frame" x="0.0" y="0.0" width="393" height="400"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Page number position" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Pa8-sr-VBM">
+                    <rect key="frame" x="3.6666666666666714" y="3.6666666666666661" width="150" height="22"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="150" id="cQh-8c-RJR"/>
+                        <constraint firstAttribute="height" constant="22" id="cdr-Z5-Gbz"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="4Ie-tI-UGu">
+                    <rect key="frame" x="14" y="29" width="365" height="45"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="44" id="nvJ-nK-gAd"/>
+                    </constraints>
+                    <segments>
+                        <segment title="Header"/>
+                        <segment title="Footer"/>
+                    </segments>
+                </segmentedControl>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Alignment" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="T2T-4P-PHz">
+                    <rect key="frame" x="3.6666666666666643" y="76.666666666666671" width="100" height="22"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="100" id="KOR-fq-geR"/>
+                        <constraint firstAttribute="height" constant="22" id="yGE-RV-vwD"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="Pgo-u2-Uzd">
+                    <rect key="frame" x="14" y="102" width="365" height="45"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="44" id="yob-hs-maY"/>
+                    </constraints>
+                    <segments>
+                        <segment title="Left"/>
+                        <segment title="Center"/>
+                        <segment title="Right"/>
+                    </segments>
+                </segmentedControl>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Font Color" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6g2-Ho-CAf">
+                    <rect key="frame" x="3.6666666666666643" y="149.66666666666666" width="100" height="22"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="22" id="LIX-uB-tR6"/>
+                        <constraint firstAttribute="width" constant="100" id="fMH-Uz-k9T"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="text_color_bar.png" translatesAutoresizingMaskIntoConstraints="NO" id="m5R-2i-k4g">
+                    <rect key="frame" x="14" y="175" width="365" height="44"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="44" id="0kI-c9-DPo"/>
+                    </constraints>
+                </imageView>
+                <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="5" minValue="0.0" maxValue="100" translatesAutoresizingMaskIntoConstraints="NO" id="Au3-nx-T9q">
+                    <rect key="frame" x="12" y="222.66666666666666" width="369" height="34.999999999999972"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="34" id="u4L-zU-FGt"/>
+                    </constraints>
+                </slider>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Page Text" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4qN-ZG-Qn9">
+                    <rect key="frame" x="3.6666666666666643" y="260" width="73" height="34"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="73" id="Tko-Wy-X8W"/>
+                        <constraint firstAttribute="height" constant="34" id="kJQ-gh-aWB"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Font Size" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FdT-9Y-rvt">
+                    <rect key="frame" x="196.66666666666666" y="260" width="72.999999999999972" height="34"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="73" id="z3T-5H-DUf"/>
+                        <constraint firstAttribute="height" constant="34" id="zlO-WV-P2l"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="18.0" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="BKU-8v-RMa">
+                    <rect key="frame" x="273" y="260" width="93" height="34"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="93" id="Rp4-kO-m4m"/>
+                        <constraint firstAttribute="height" constant="34" id="jKv-bt-W3K"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                    <textInputTraits key="textInputTraits"/>
+                    <connections>
+                        <outlet property="delegate" destination="-1" id="Jug-TB-h1t"/>
+                    </connections>
+                </textField>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Page Start" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RSV-T2-mPl">
+                    <rect key="frame" x="3.6666666666666643" y="297.66666666666669" width="73" height="34"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="34" id="c6g-WC-ok8"/>
+                        <constraint firstAttribute="width" constant="73" id="fDA-Ca-T9u"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="1" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Vcp-4b-Hvh">
+                    <rect key="frame" x="80" y="302.66666666666669" width="93" height="34"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="34" id="oCW-Du-6cR"/>
+                        <constraint firstAttribute="width" constant="93" id="oun-bR-fQr"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                    <textInputTraits key="textInputTraits"/>
+                    <connections>
+                        <outlet property="delegate" destination="-1" id="01m-xN-o7V"/>
+                    </connections>
+                </textField>
+                <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="text" minimumFontSize="11" translatesAutoresizingMaskIntoConstraints="NO" id="fC3-nC-OC0">
+                    <rect key="frame" x="80" y="260" width="93" height="34"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="34" id="AR2-K1-yCI"/>
+                        <constraint firstAttribute="width" constant="93" id="XID-b1-y9I"/>
+                    </constraints>
+                    <nil key="textColor"/>
+                    <textInputTraits key="textInputTraits"/>
+                </textField>
+            </subviews>
+            <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
+            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+            <constraints>
+                <constraint firstItem="6g2-Ho-CAf" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="3.5" id="0XY-RM-cGa"/>
+                <constraint firstItem="m5R-2i-k4g" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="14" id="0pg-Ys-rQe"/>
+                <constraint firstItem="BKU-8v-RMa" firstAttribute="leading" secondItem="FdT-9Y-rvt" secondAttribute="trailing" constant="3.5" id="3FC-K9-msz"/>
+                <constraint firstItem="4Ie-tI-UGu" firstAttribute="top" secondItem="Pa8-sr-VBM" secondAttribute="bottom" constant="3.5" id="AcV-TY-7mu"/>
+                <constraint firstItem="Pa8-sr-VBM" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="3.5" id="D7y-hn-XyZ"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="Au3-nx-T9q" secondAttribute="trailing" constant="14" id="Dai-0y-ANS"/>
+                <constraint firstItem="T2T-4P-PHz" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="3.5" id="Em8-CB-Ry8"/>
+                <constraint firstItem="fC3-nC-OC0" firstAttribute="leading" secondItem="4qN-ZG-Qn9" secondAttribute="trailing" constant="3.5" id="Fow-5I-1ua"/>
+                <constraint firstItem="Pgo-u2-Uzd" firstAttribute="top" secondItem="T2T-4P-PHz" secondAttribute="bottom" constant="3.5" id="JR2-En-XD3"/>
+                <constraint firstItem="RSV-T2-mPl" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="3.5" id="NZ3-is-aSx"/>
+                <constraint firstItem="FdT-9Y-rvt" firstAttribute="leading" secondItem="fC3-nC-OC0" secondAttribute="trailing" constant="23.5" id="O9c-GF-J2k"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="4Ie-tI-UGu" secondAttribute="trailing" constant="14" id="RC6-4V-9C7"/>
+                <constraint firstItem="BKU-8v-RMa" firstAttribute="top" secondItem="Au3-nx-T9q" secondAttribute="bottom" constant="3.5" id="Txn-vw-5cG"/>
+                <constraint firstItem="Vcp-4b-Hvh" firstAttribute="top" secondItem="fC3-nC-OC0" secondAttribute="bottom" constant="8.5" id="XIm-8L-mmt"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="Pgo-u2-Uzd" secondAttribute="trailing" constant="14" id="YPc-WO-cpf"/>
+                <constraint firstItem="Au3-nx-T9q" firstAttribute="top" secondItem="m5R-2i-k4g" secondAttribute="bottom" constant="3.5" id="ZZT-Ja-7bX"/>
+                <constraint firstItem="4Ie-tI-UGu" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="14" id="aiN-Yn-hpV"/>
+                <constraint firstItem="Pa8-sr-VBM" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="3.5" id="duW-7U-wn4"/>
+                <constraint firstItem="Pgo-u2-Uzd" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="14" id="fhs-Yu-0fK"/>
+                <constraint firstItem="FdT-9Y-rvt" firstAttribute="top" secondItem="Au3-nx-T9q" secondAttribute="bottom" constant="3.5" id="g4H-V0-0kh"/>
+                <constraint firstItem="RSV-T2-mPl" firstAttribute="top" secondItem="4qN-ZG-Qn9" secondAttribute="bottom" constant="3.5" id="hbw-j9-GYw"/>
+                <constraint firstItem="Au3-nx-T9q" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="14" id="jTK-Sv-Dop"/>
+                <constraint firstItem="4qN-ZG-Qn9" firstAttribute="top" secondItem="Au3-nx-T9q" secondAttribute="bottom" constant="3.5" id="jXW-bq-wMv"/>
+                <constraint firstItem="Vcp-4b-Hvh" firstAttribute="leading" secondItem="RSV-T2-mPl" secondAttribute="trailing" constant="3.5" id="lNe-n4-cBE"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="m5R-2i-k4g" secondAttribute="trailing" constant="14" id="okD-Cx-aQM"/>
+                <constraint firstItem="fC3-nC-OC0" firstAttribute="top" secondItem="Au3-nx-T9q" secondAttribute="bottom" constant="3.5" id="pDV-mY-F0S"/>
+                <constraint firstItem="4qN-ZG-Qn9" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="3.5" id="pnZ-3C-dxT"/>
+                <constraint firstItem="T2T-4P-PHz" firstAttribute="top" secondItem="4Ie-tI-UGu" secondAttribute="bottom" constant="3.5" id="tVF-hU-wiV"/>
+                <constraint firstItem="m5R-2i-k4g" firstAttribute="top" secondItem="6g2-Ho-CAf" secondAttribute="bottom" constant="3.5" id="u4T-rb-Apb"/>
+                <constraint firstItem="6g2-Ho-CAf" firstAttribute="top" secondItem="Pgo-u2-Uzd" secondAttribute="bottom" constant="3.5" id="uOz-U3-25c"/>
+            </constraints>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <connections>
+                <outlet property="aligbmentSegment" destination="Pgo-u2-Uzd" id="qTt-nx-hng"/>
+                <outlet property="alignmentLabel" destination="T2T-4P-PHz" id="eFH-OZ-kuy"/>
+                <outlet property="colerImage" destination="m5R-2i-k4g" id="asv-Hn-ezr"/>
+                <outlet property="colorLabel" destination="6g2-Ho-CAf" id="xak-yv-gDo"/>
+                <outlet property="colorSlider" destination="Au3-nx-T9q" id="a4E-yg-38d"/>
+                <outlet property="fontSizeLabel" destination="FdT-9Y-rvt" id="ab8-a9-I8z"/>
+                <outlet property="fontSizeText" destination="BKU-8v-RMa" id="i9Y-Z2-9od"/>
+                <outlet property="localLabel" destination="Pa8-sr-VBM" id="uhM-GR-IAr"/>
+                <outlet property="localSegment" destination="4Ie-tI-UGu" id="bvm-JC-9rU"/>
+                <outlet property="pageIndexLabel" destination="RSV-T2-mPl" id="fyI-NC-u4i"/>
+                <outlet property="pageIndexNumberText" destination="Vcp-4b-Hvh" id="OgJ-9K-FMR"/>
+                <outlet property="pageNumberLabel" destination="4qN-ZG-Qn9" id="uKT-em-txl"/>
+                <outlet property="pageNumberText" destination="fC3-nC-OC0" id="fpa-VR-vC3"/>
+            </connections>
+            <point key="canvasLocation" x="55.725190839694655" y="-12.67605633802817"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="text_color_bar.png" width="244.5" height="34.5"/>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 69 - 0
PDFViewer/Source/PDFHeaderFooter/HeaderFooterTextTableView.xib

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PDFHeaderFooterTextTableView"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="PDFHeaderFooterTextTableView">
+            <rect key="frame" x="0.0" y="0.0" width="393" height="400"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Format Selection" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="REi-Xc-XV1">
+                    <rect key="frame" x="0.0" y="0.0" width="393" height="55"/>
+                    <color key="backgroundColor" systemColor="opaqueSeparatorColor"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="55" id="oQ3-lT-N6S"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZjA-vB-vXl">
+                    <rect key="frame" x="0.0" y="5" width="60" height="44"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="44" id="afj-8s-scT"/>
+                        <constraint firstAttribute="width" constant="60" id="xgv-8u-Bh3"/>
+                    </constraints>
+                    <color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <state key="normal" title="Button"/>
+                    <buttonConfiguration key="configuration" style="plain" image="btn_frontpage.png" title="Back"/>
+                </button>
+                <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="55" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="MO1-Dv-k5X">
+                    <rect key="frame" x="0.0" y="59" width="393" height="297"/>
+                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                </tableView>
+            </subviews>
+            <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
+            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+            <constraints>
+                <constraint firstAttribute="trailing" secondItem="REi-Xc-XV1" secondAttribute="trailing" id="7tk-6A-ufg"/>
+                <constraint firstItem="REi-Xc-XV1" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="BZu-Ws-wJ5"/>
+                <constraint firstItem="MO1-Dv-k5X" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="FIU-k9-ZDh"/>
+                <constraint firstItem="ZjA-vB-vXl" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="5" id="Mva-MU-MLj"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="MO1-Dv-k5X" secondAttribute="bottom" constant="44" id="Pab-x5-gXi"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="MO1-Dv-k5X" secondAttribute="trailing" id="cIK-L2-JrZ"/>
+                <constraint firstItem="REi-Xc-XV1" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="eLh-vr-Vhn"/>
+                <constraint firstItem="MO1-Dv-k5X" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" id="ggm-n1-6mJ"/>
+                <constraint firstItem="ZjA-vB-vXl" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="wOH-fr-UOs"/>
+            </constraints>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <point key="canvasLocation" x="77.099236641221367" y="-4.2253521126760569"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="btn_frontpage.png" width="32" height="32"/>
+        <systemColor name="opaqueSeparatorColor">
+            <color red="0.77647058823529413" green="0.77647058823529413" blue="0.78431372549019607" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </systemColor>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 1 - 1
PDFViewer/Source/PDFHeaderFooter/PDFHeaderFooterAddController.m

@@ -39,7 +39,7 @@
 
 - (void)initBttonmView {
     _headerFooterview = [[PDFHeaderFooterAddView alloc] init];
-    [_headerFooterview setText];
+//    [_headerFooterview setText];
     [self.view addSubview:_headerFooterview];
     
     if (([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight) || ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeLeft) || ([UIDevice currentDevice].orientation == UIDeviceOrientationPortraitUpsideDown) || (self.view.frame.size.width > self.view.frame.size.height)) {

+ 25 - 9
PDFViewer/Source/PDFHeaderFooter/PDFHeaderFooterAddView.h

@@ -10,17 +10,33 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface PDFHeaderFooterAddView : PDFAddView  <UITextFieldDelegate>
+@interface PDFHeaderFooterAddView : UIView <UITextFieldDelegate>
 
-@property (nonatomic,strong) UILabel *pageNumberLabel;
-@property (nonatomic,strong) UITextField *pageNumberText;
-@property (nonatomic,strong) UILabel *fontSizeLabel;
-@property (nonatomic,strong) UITextField *fontSizeText;
-@property (nonatomic,strong) UILabel *pageIndexLabel;
-@property (nonatomic,strong) UITextField *pageIndexNumberText;
-@property (nonatomic,strong) UIStepper *pageIndexNumberStepper;
+@property (retain, nonatomic) IBOutlet UILabel *localLabel;
+@property (retain, nonatomic) IBOutlet UISegmentedControl *localSegment;
+@property (retain, nonatomic) IBOutlet UILabel *alignmentLabel;
+@property (retain, nonatomic) IBOutlet UISegmentedControl *aligbmentSegment;
+@property (retain, nonatomic) IBOutlet UILabel *colorLabel;
+@property (retain, nonatomic) IBOutlet UIImageView *colerImage;
+@property (retain, nonatomic) IBOutlet UISlider *colorSlider;
 
-- (void)setText;
+@property (retain, nonatomic) IBOutlet UILabel *pageNumberLabel;
+@property (retain, nonatomic) IBOutlet UITextField *pageNumberText;
+@property (retain, nonatomic) IBOutlet UILabel *fontSizeLabel;
+@property (retain, nonatomic) IBOutlet UITextField *fontSizeText;
+@property (retain, nonatomic) IBOutlet UILabel *pageIndexLabel;
+@property (retain, nonatomic) IBOutlet UITextField *pageIndexNumberText;
+
+
+//@property (nonatomic,strong) UILabel *pageNumberLabel;
+//@property (nonatomic,strong) UITextField *pageNumberText;
+//@property (nonatomic,strong) UILabel *fontSizeLabel;
+//@property (nonatomic,strong) UITextField *fontSizeText;
+//@property (nonatomic,strong) UILabel *pageIndexLabel;
+//@property (nonatomic,strong) UITextField *pageIndexNumberText;
+//@property (nonatomic,strong) UIStepper *pageIndexNumberStepper;
+
+//- (void)setText;
 
 @end
 

+ 138 - 132
PDFViewer/Source/PDFHeaderFooter/PDFHeaderFooterAddView.m

@@ -6,148 +6,154 @@
 //
 
 #import "PDFHeaderFooterAddView.h"
-#import "Masonry.h"
+//#import "Masonry.h"
 
 @implementation PDFHeaderFooterAddView
 
 - (instancetype)initWithFrame:(CGRect)frame {
     self = [super initWithFrame:frame];
     if (self) {
-        // Page number
-        _pageNumberLabel = [[UILabel alloc] init];
-        _pageNumberText = [[UITextField alloc] init];
-        
-        [self addSubview:_pageNumberLabel];
-        [self addSubview:_pageNumberText];
-        
-        // Font size
-        _fontSizeLabel = [[UILabel alloc] init];
-        _fontSizeText = [[UITextField alloc] init];
-        
-        [self addSubview:_fontSizeLabel];
-        [self addSubview:_fontSizeText];
-        
-        // Page index
-        _pageIndexLabel = [[UILabel alloc] init];
-        _pageIndexNumberText = [[UITextField alloc] init];
-        
-        [self addSubview:_pageIndexLabel];
-        [self addSubview:_pageIndexNumberText];
-        
-        self.backgroundColor = [UIColor whiteColor];
+//        // Page number
+//        _pageNumberLabel = [[UILabel alloc] init];
+//        _pageNumberText = [[UITextField alloc] init];
+//
+//        [self addSubview:_pageNumberLabel];
+//        [self addSubview:_pageNumberText];
+//
+//        // Font size
+//        _fontSizeLabel = [[UILabel alloc] init];
+//        _fontSizeText = [[UITextField alloc] init];
+//
+//        [self addSubview:_fontSizeLabel];
+//        [self addSubview:_fontSizeText];
+//
+//        // Page index
+//        _pageIndexLabel = [[UILabel alloc] init];
+//        _pageIndexNumberText = [[UITextField alloc] init];
+//
+//        [self addSubview:_pageIndexLabel];
+//        [self addSubview:_pageIndexNumberText];
+//
+//        self.backgroundColor = [UIColor whiteColor];
+
+        self = [[NSBundle mainBundle] loadNibNamed:@"HeaderFooterAddView" owner:nil options:nil].firstObject;
+        _pageIndexNumberText.delegate = self;
+        _fontSizeText.delegate = self;
+        _pageNumberText.inputView = [[UIView alloc] initWithFrame:CGRectZero];
+        _pageNumberText.inputAccessoryView = [[UIView alloc] initWithFrame:CGRectZero];
     }
     return  self;
 }
 
-#pragma mark - Layout
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    CGFloat offsetx = 3.5;
-    
-    // Page number
-    [_pageNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
-        make.left.equalTo(self.mas_left).offset(offsetx);
-        make.height.mas_equalTo(34);
-        make.width.mas_equalTo(73);
-    }];
-    
-    [_pageNumberText mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
-        make.left.equalTo(_pageNumberLabel.mas_right).offset(offsetx);
-        make.height.mas_equalTo(34);
-        make.width.mas_equalTo(93);
-    }];
-    
-    // Font size
-    [_fontSizeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
-        make.left.equalTo(_pageNumberText.mas_right).offset(offsetx + 20);
-        make.height.mas_equalTo(34);
-        make.width.mas_equalTo(73);
-    }];
-    
-    [_fontSizeText mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
-        make.left.equalTo(_fontSizeLabel.mas_right).offset(offsetx);
-        make.height.mas_equalTo(34);
-        make.width.mas_equalTo(93);
-    }];
-    
-    // Page index
-    [_pageIndexLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(_pageNumberLabel.mas_bottom).offset(offsetx);
-        make.left.equalTo(self.mas_left).offset(offsetx);
-        make.height.mas_equalTo(34);
-        make.width.mas_equalTo(73);
-    }];
-    
-    [_pageIndexNumberText mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(_pageNumberText.mas_bottom).offset(offsetx+5);
-        make.left.equalTo(_pageIndexLabel.mas_right).offset(offsetx);
-        make.height.mas_equalTo(33);
-        make.width.mas_equalTo(93);
-    }];
-}
-
-#pragma mark - Assignment
-
-- (void)setText {
-    // Page number location
-    [self.localLabel setText:NSLocalizedString(@"Page number position", nil)];
-    self.localLabel.font = [UIFont boldSystemFontOfSize:12];
-    
-    // Alignment
-    [self.alignmentLabel setText:NSLocalizedString(@"alignment", nil)];
-    self.alignmentLabel.font = [UIFont boldSystemFontOfSize:12];
-    
-    // Font color
-    [self.colorLabel setText:NSLocalizedString(@"Font Color", nil)];
-    self.colorLabel.font = [UIFont boldSystemFontOfSize:12];
-    
-    CALayer *layer = [self.colerImage layer];
-    layer.borderColor = [[UIColor blackColor] CGColor];
-    layer.borderWidth = 0.5f;
-    self.colerImage.image = [UIImage imageNamed:@"text_color_bar"];
-    
-    self.colorSlider.minimumValue = 0;
-    self.colorSlider.maximumValue = 100;
-    self.colorSlider.value = 5;
-    
-    // Page number
-    [_pageNumberLabel setText:NSLocalizedString(@"Page Text", nil)];
-    _pageNumberLabel.font = [UIFont boldSystemFontOfSize:14];
-    
-    _pageNumberText.inputView = [[UIView alloc] initWithFrame:CGRectZero];
-    _pageNumberText.inputAccessoryView = [[UIView alloc] initWithFrame:CGRectZero];
-    _pageNumberText.delegate = self;
-    _pageNumberText.adjustsFontSizeToFitWidth = YES;
-    _pageNumberText.tintColor = [UIColor clearColor];
-    _pageNumberText.borderStyle = UITextBorderStyleRoundedRect;
-    _pageNumberText.placeholder = @"text";
-    
-    // Font size
-    [_fontSizeLabel setText:NSLocalizedString(@"Font Szie", nil)];
-    _fontSizeLabel.font = [UIFont boldSystemFontOfSize:14];
-    
-    _fontSizeText.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
-    _fontSizeText.clearsOnBeginEditing = YES;
-    _fontSizeText.borderStyle = UITextBorderStyleRoundedRect;
-    _fontSizeText.placeholder = @"18.0";
-    _fontSizeText.delegate = self;
-    _fontSizeText.keyboardType = UIKeyboardTypeDefault;
-    
-    // Page index
-    [_pageIndexLabel setText:NSLocalizedString(@"Page Start", nil)];
-    _pageIndexLabel.font = [UIFont boldSystemFontOfSize:12];
-    
-    _pageIndexNumberText.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
-    _pageIndexNumberText.clearsOnBeginEditing = YES;
-    _pageIndexNumberText.delegate = self;
-    _pageIndexNumberText.borderStyle = UITextBorderStyleRoundedRect;
-    _pageIndexNumberText.placeholder = @"1";
-}
+//#pragma mark - Layout
+//
+//- (void)layoutSubviews {
+//    [super layoutSubviews];
+//    CGFloat offsetx = 3.5;
+//
+//    // Page number
+//    [_pageNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
+//        make.left.equalTo(self.mas_left).offset(offsetx);
+//        make.height.mas_equalTo(34);
+//        make.width.mas_equalTo(73);
+//    }];
+//
+//    [_pageNumberText mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
+//        make.left.equalTo(_pageNumberLabel.mas_right).offset(offsetx);
+//        make.height.mas_equalTo(34);
+//        make.width.mas_equalTo(93);
+//    }];
+//
+//    // Font size
+//    [_fontSizeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
+//        make.left.equalTo(_pageNumberText.mas_right).offset(offsetx + 20);
+//        make.height.mas_equalTo(34);
+//        make.width.mas_equalTo(73);
+//    }];
+//
+//    [_fontSizeText mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
+//        make.left.equalTo(_fontSizeLabel.mas_right).offset(offsetx);
+//        make.height.mas_equalTo(34);
+//        make.width.mas_equalTo(93);
+//    }];
+//
+//    // Page index
+//    [_pageIndexLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.top.equalTo(_pageNumberLabel.mas_bottom).offset(offsetx);
+//        make.left.equalTo(self.mas_left).offset(offsetx);
+//        make.height.mas_equalTo(34);
+//        make.width.mas_equalTo(73);
+//    }];
+//
+//    [_pageIndexNumberText mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.top.equalTo(_pageNumberText.mas_bottom).offset(offsetx+5);
+//        make.left.equalTo(_pageIndexLabel.mas_right).offset(offsetx);
+//        make.height.mas_equalTo(33);
+//        make.width.mas_equalTo(93);
+//    }];
+//}
+//
+//#pragma mark - Assignment
+//
+//- (void)setText {
+//    // Page number location
+//    [self.localLabel setText:NSLocalizedString(@"Page number position", nil)];
+//    self.localLabel.font = [UIFont boldSystemFontOfSize:12];
+//
+//    // Alignment
+//    [self.alignmentLabel setText:NSLocalizedString(@"alignment", nil)];
+//    self.alignmentLabel.font = [UIFont boldSystemFontOfSize:12];
+//
+//    // Font color
+//    [self.colorLabel setText:NSLocalizedString(@"Font Color", nil)];
+//    self.colorLabel.font = [UIFont boldSystemFontOfSize:12];
+//
+//    CALayer *layer = [self.colerImage layer];
+//    layer.borderColor = [[UIColor blackColor] CGColor];
+//    layer.borderWidth = 0.5f;
+//    self.colerImage.image = [UIImage imageNamed:@"text_color_bar"];
+//
+//    self.colorSlider.minimumValue = 0;
+//    self.colorSlider.maximumValue = 100;
+//    self.colorSlider.value = 5;
+//
+//    // Page number
+//    [_pageNumberLabel setText:NSLocalizedString(@"Page Text", nil)];
+//    _pageNumberLabel.font = [UIFont boldSystemFontOfSize:14];
+//
+//    _pageNumberText.inputView = [[UIView alloc] initWithFrame:CGRectZero];
+//    _pageNumberText.inputAccessoryView = [[UIView alloc] initWithFrame:CGRectZero];
+//    _pageNumberText.delegate = self;
+//    _pageNumberText.adjustsFontSizeToFitWidth = YES;
+//    _pageNumberText.tintColor = [UIColor clearColor];
+//    _pageNumberText.borderStyle = UITextBorderStyleRoundedRect;
+//    _pageNumberText.placeholder = @"text";
+//
+//    // Font size
+//    [_fontSizeLabel setText:NSLocalizedString(@"Font Szie", nil)];
+//    _fontSizeLabel.font = [UIFont boldSystemFontOfSize:14];
+//
+//    _fontSizeText.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
+//    _fontSizeText.clearsOnBeginEditing = YES;
+//    _fontSizeText.borderStyle = UITextBorderStyleRoundedRect;
+//    _fontSizeText.placeholder = @"18.0";
+//    _fontSizeText.delegate = self;
+//    _fontSizeText.keyboardType = UIKeyboardTypeDefault;
+//
+//    // Page index
+//    [_pageIndexLabel setText:NSLocalizedString(@"Page Start", nil)];
+//    _pageIndexLabel.font = [UIFont boldSystemFontOfSize:12];
+//
+//    _pageIndexNumberText.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
+//    _pageIndexNumberText.clearsOnBeginEditing = YES;
+//    _pageIndexNumberText.delegate = self;
+//    _pageIndexNumberText.borderStyle = UITextBorderStyleRoundedRect;
+//    _pageIndexNumberText.placeholder = @"1";
+//}
 
 #pragma mark - UITextFieldDelegate
 

+ 13 - 11
PDFViewer/Source/PDFViewerMode/PDFSettingsColorViewController.xib

@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
     <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -17,17 +19,17 @@
         </placeholder>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
-            <rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
+            <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Custom Background" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9bW-7D-FSg">
-                    <rect key="frame" x="94.5" y="10" width="131.5" height="17"/>
+                    <rect key="frame" x="131" y="10" width="131.33333333333337" height="17"/>
                     <fontDescription key="fontDescription" type="system" pointSize="14"/>
                     <nil key="textColor"/>
                     <nil key="highlightedColor"/>
                 </label>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Yvp-Js-Jdc">
-                    <rect key="frame" x="131" y="34" width="58" height="58"/>
+                    <rect key="frame" x="167.66666666666666" y="34" width="58" height="58"/>
                     <subviews>
                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jKb-uc-5pu">
                             <rect key="frame" x="4" y="4" width="50" height="50"/>
@@ -47,13 +49,13 @@
                     </constraints>
                 </view>
                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Hue" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="leJ-EH-Vfn">
-                    <rect key="frame" x="30" y="104.5" width="23" height="14.5"/>
+                    <rect key="frame" x="66.666666666666671" y="104.66666666666667" width="23" height="14.333333333333329"/>
                     <fontDescription key="fontDescription" type="system" pointSize="12"/>
                     <nil key="textColor"/>
                     <nil key="highlightedColor"/>
                 </label>
                 <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" continuous="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vje-ne-wF3" customClass="PDFViewColorSlider">
-                    <rect key="frame" x="28" y="124" width="264" height="31"/>
+                    <rect key="frame" x="64.666666666666686" y="124" width="264" height="31"/>
                     <constraints>
                         <constraint firstAttribute="width" constant="260" id="PXb-4Y-01M"/>
                     </constraints>
@@ -62,13 +64,13 @@
                     </connections>
                 </slider>
                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Saturation" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lY6-4B-zda">
-                    <rect key="frame" x="30" y="179" width="59" height="15"/>
+                    <rect key="frame" x="66.666666666666671" y="179" width="59" height="15"/>
                     <fontDescription key="fontDescription" type="system" pointSize="12"/>
                     <nil key="textColor"/>
                     <nil key="highlightedColor"/>
                 </label>
                 <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" continuous="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9IV-3d-mQV" customClass="PDFViewColorSlider">
-                    <rect key="frame" x="28" y="199" width="264" height="31"/>
+                    <rect key="frame" x="64.666666666666686" y="199" width="264" height="31"/>
                     <constraints>
                         <constraint firstAttribute="width" constant="260" id="vk9-9m-PXI"/>
                     </constraints>
@@ -77,13 +79,13 @@
                     </connections>
                 </slider>
                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Brightness" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HeR-Qa-3DO">
-                    <rect key="frame" x="30" y="254" width="61" height="15"/>
+                    <rect key="frame" x="66.666666666666671" y="254" width="61" height="15"/>
                     <fontDescription key="fontDescription" type="system" pointSize="12"/>
                     <nil key="textColor"/>
                     <nil key="highlightedColor"/>
                 </label>
                 <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" continuous="NO" translatesAutoresizingMaskIntoConstraints="NO" id="X8K-ml-2f6" customClass="PDFViewColorSlider">
-                    <rect key="frame" x="28" y="274" width="264" height="31"/>
+                    <rect key="frame" x="64.666666666666686" y="274" width="264" height="31"/>
                     <constraints>
                         <constraint firstAttribute="width" constant="260" id="SbY-Pz-6Uk"/>
                     </constraints>