Skip to content

Commit

Permalink
Merge pull request auth0#153 from auth0/improve-wkwebview-controller
Browse files Browse the repository at this point in the history
Improve A0WebKitViewController UI and customisation options
  • Loading branch information
hzalaz committed Aug 11, 2015
2 parents be91e33 + 012ac55 commit 2c24d15
Show file tree
Hide file tree
Showing 31 changed files with 504 additions and 345 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -6,7 +6,7 @@ osx_image: xcode6.4
podfile: Lock/Podfile

before_install:
- brew update
- brew update; brew update
- if brew outdated | grep -qx xctool; then brew upgrade xctool; fi
- gem install cocoapods --no-ri --no-rdoc

Expand Down
4 changes: 2 additions & 2 deletions Pod/Assets/UI/A0LockViewController.xib
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6751" systemVersion="14C1510" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14E46" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="A0LockViewController">
Expand Down
6 changes: 3 additions & 3 deletions Pod/Assets/UI/A0TitleView.xib
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6751" systemVersion="14C1510" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14E46" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="A0TitleView">
Expand Down Expand Up @@ -46,7 +46,7 @@
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sign Up" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fzx-LI-4wX">
<rect key="frame" x="46" y="79" width="81" height="29"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Thin" family="Helvetica Neue" pointSize="24"/>
<color key="textColor" red="0.30196078430000001" green="0.30196078430000001" blue="0.30196078430000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.29803921568627451" green="0.29803921568627451" blue="0.29803921568627451" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="FFz-aG-OPE">
Expand Down
61 changes: 39 additions & 22 deletions Pod/Assets/WebView/A0WebKitViewController.xib
Expand Up @@ -7,9 +7,10 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="A0WebKitViewController">
<connections>
<outlet property="activityIndicator" destination="Jhf-Pg-mTB" id="9pI-em-Z4d"/>
<outlet property="cancelButton" destination="qB2-jl-yaZ" id="hTF-Mb-3S2"/>
<outlet property="titleView" destination="Ozw-uC-SsI" id="OF4-SV-gmM"/>
<outlet property="messageDescriptionLabel" destination="90Y-sQ-6YS" id="lHa-p5-LIm"/>
<outlet property="messageTitleLabel" destination="UAU-R6-x13" id="21K-Rq-zhq"/>
<outlet property="messageView" destination="5rZ-e4-YEQ" id="Aj3-fz-b0H"/>
<outlet property="retryButton" destination="sq1-yr-67q" id="GCv-8y-tVT"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
Expand All @@ -18,44 +19,60 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ozw-uC-SsI">
<rect key="frame" x="0.0" y="0.0" width="600" height="60"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5rZ-e4-YEQ">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qB2-jl-yaZ">
<rect key="frame" x="8" y="22" width="48" height="30"/>
<state key="normal" title="Cancel">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Could not connect to server" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UAU-R6-x13">
<rect key="frame" x="160" y="246" width="279" height="28.5"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Thin" family="Helvetica Neue" pointSize="24"/>
<color key="textColor" red="0.29803921568627451" green="0.29803921568627451" blue="0.29803921568627451" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="249" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" text="DEFAULT MESSAGE" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="5" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="90Y-sQ-6YS">
<rect key="frame" x="8" y="291" width="584" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="0.30196078431372547" green="0.30196078431372547" blue="0.30196078431372547" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sq1-yr-67q">
<rect key="frame" x="250" y="327" width="100" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="0D3-v5-75H"/>
</constraints>
<state key="normal" title="Retry">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="cancel:" destination="-1" eventType="touchUpInside" id="vlX-eN-bQD"/>
<action selector="retry:" destination="-1" eventType="touchUpInside" id="ftK-xL-nAY"/>
</connections>
</button>
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="Jhf-Pg-mTB">
<rect key="frame" x="572" y="27" width="20" height="20"/>
</activityIndicatorView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="qB2-jl-yaZ" firstAttribute="leading" secondItem="Ozw-uC-SsI" secondAttribute="leadingMargin" id="1Ue-xd-tr6"/>
<constraint firstItem="Jhf-Pg-mTB" firstAttribute="bottom" secondItem="Ozw-uC-SsI" secondAttribute="bottomMargin" id="Ici-kB-jhD"/>
<constraint firstItem="qB2-jl-yaZ" firstAttribute="bottom" secondItem="Ozw-uC-SsI" secondAttribute="bottomMargin" id="VeW-br-9CL"/>
<constraint firstItem="Jhf-Pg-mTB" firstAttribute="centerY" secondItem="qB2-jl-yaZ" secondAttribute="centerY" id="aNF-b2-vXk"/>
<constraint firstItem="Jhf-Pg-mTB" firstAttribute="trailing" secondItem="Ozw-uC-SsI" secondAttribute="trailingMargin" id="sTK-LY-JKW"/>
<constraint firstAttribute="height" constant="60" id="weE-tu-LiQ"/>
<constraint firstItem="90Y-sQ-6YS" firstAttribute="leading" secondItem="5rZ-e4-YEQ" secondAttribute="leadingMargin" id="C6H-Rr-d90"/>
<constraint firstItem="sq1-yr-67q" firstAttribute="top" secondItem="90Y-sQ-6YS" secondAttribute="bottom" constant="20" id="CdQ-4s-fPl"/>
<constraint firstAttribute="centerX" secondItem="UAU-R6-x13" secondAttribute="centerX" id="Ch0-qs-Jf3"/>
<constraint firstAttribute="trailingMargin" secondItem="90Y-sQ-6YS" secondAttribute="trailing" id="OLX-Nj-jzy"/>
<constraint firstItem="90Y-sQ-6YS" firstAttribute="top" secondItem="UAU-R6-x13" secondAttribute="bottom" constant="16" id="al3-ml-nyj"/>
<constraint firstAttribute="centerX" secondItem="sq1-yr-67q" secondAttribute="centerX" id="b5H-8p-g66"/>
<constraint firstAttribute="centerY" secondItem="90Y-sQ-6YS" secondAttribute="centerY" constant="0.5" id="sg0-Jq-bkz"/>
<constraint firstAttribute="centerX" secondItem="90Y-sQ-6YS" secondAttribute="centerX" id="tZP-jK-qft"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="Ici-kB-jhD"/>
<exclude reference="tZP-jK-qft"/>
</mask>
</variation>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="Ozw-uC-SsI" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="AIH-HJ-aOd"/>
<constraint firstAttribute="trailing" secondItem="Ozw-uC-SsI" secondAttribute="trailing" id="CQc-10-E2w"/>
<constraint firstItem="Ozw-uC-SsI" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="wMN-fg-T8D"/>
<constraint firstItem="5rZ-e4-YEQ" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="JPb-UJ-30z"/>
<constraint firstAttribute="trailing" secondItem="5rZ-e4-YEQ" secondAttribute="trailing" id="LUy-wq-DcV"/>
<constraint firstAttribute="bottom" secondItem="5rZ-e4-YEQ" secondAttribute="bottom" id="XtT-bJ-ksg"/>
<constraint firstItem="5rZ-e4-YEQ" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="fQm-Hj-x2H"/>
</constraints>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
</view>
</objects>
</document>
45 changes: 6 additions & 39 deletions Pod/Assets/WebView/A0WebViewController.xib
@@ -1,70 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14E46" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14E46" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="A0WebViewController">
<connections>
<outlet property="activityView" destination="Du8-pa-oeZ" id="G6i-zq-Uig"/>
<outlet property="view" destination="iN0-l3-epB" id="aRp-8N-9wr"/>
<outlet property="webview" destination="KPw-uk-hu8" id="VY0-pz-YNo"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<webView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KPw-uk-hu8">
<rect key="frame" x="0.0" y="60" width="320" height="508"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<outlet property="delegate" destination="-1" id="dpa-Un-Txe"/>
</connections>
</webView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Gua-bi-8rw">
<rect key="frame" x="0.0" y="0.0" width="320" height="60"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="88Q-G1-SXn">
<rect key="frame" x="10" y="25" width="48" height="30"/>
<state key="normal" title="Cancel">
<color key="titleColor" red="0.30196078430000001" green="0.30196078430000001" blue="0.30196078430000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="cancel:" destination="-1" eventType="touchUpInside" id="frR-Q4-fbc"/>
</connections>
</button>
<activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" animating="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="Du8-pa-oeZ">
<rect key="frame" x="290" y="30" width="20" height="20"/>
</activityIndicatorView>
</subviews>
<color key="backgroundColor" red="0.94117647058823528" green="0.94117647058823528" blue="0.94117647058823528" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="Du8-pa-oeZ" secondAttribute="trailing" constant="10" id="GeW-bf-AY8"/>
<constraint firstItem="88Q-G1-SXn" firstAttribute="leading" secondItem="Gua-bi-8rw" secondAttribute="leading" constant="10" id="MUV-wY-PK3"/>
<constraint firstAttribute="bottom" secondItem="88Q-G1-SXn" secondAttribute="bottom" constant="5" id="Stz-e9-N7z"/>
<constraint firstAttribute="height" constant="60" id="hDA-cl-f2t"/>
<constraint firstAttribute="bottom" secondItem="Du8-pa-oeZ" secondAttribute="bottom" constant="10" id="vFH-X1-KyA"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="Gua-bi-8rw" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="0K5-Ya-hOz"/>
<constraint firstAttribute="trailing" secondItem="KPw-uk-hu8" secondAttribute="trailing" id="PMl-nD-JBL"/>
<constraint firstItem="Gua-bi-8rw" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="QSD-bb-6ND"/>
<constraint firstAttribute="bottom" secondItem="KPw-uk-hu8" secondAttribute="bottom" id="Rlm-pa-b7Q"/>
<constraint firstAttribute="trailing" secondItem="Gua-bi-8rw" secondAttribute="trailing" id="VNb-li-pdI"/>
<constraint firstItem="KPw-uk-hu8" firstAttribute="top" secondItem="Gua-bi-8rw" secondAttribute="bottom" id="dfo-py-glQ"/>
<constraint firstItem="KPw-uk-hu8" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="gJR-tq-KhZ"/>
<constraint firstItem="KPw-uk-hu8" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="urb-zL-HuJ"/>
</constraints>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<point key="canvasLocation" x="479" y="350"/>
</view>
</objects>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

0 comments on commit 2c24d15

Please sign in to comment.