Skip to content

Commit

Permalink
Add Example and Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniocasero committed Oct 14, 2018
1 parent c97ba42 commit 1d7b005
Show file tree
Hide file tree
Showing 42 changed files with 1,390 additions and 314 deletions.
36 changes: 30 additions & 6 deletions Example/Arrow_Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
/* Begin PBXBuildFile section */
77A57CD469D2FBFBC09AF6A0 /* Pods_Arrow_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D4B316A7616C5A0D1FF3F23 /* Pods_Arrow_Example.framework */; };
C469575E21669F6400F40A2F /* UIView+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = C469575D21669F6400F40A2F /* UIView+Utils.swift */; };
C48D94ED2172129E008A498D /* ExamplePanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C48D94EB2172129E008A498D /* ExamplePanel.swift */; };
C48D94EE2172129E008A498D /* ExamplePanel.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C48D94EC2172129E008A498D /* ExamplePanel.storyboard */; };
C4CAF6E1215EAF2500B71FA0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4CAF6E0215EAF2500B71FA0 /* AppDelegate.swift */; };
C4CAF6E3215EAF2500B71FA0 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4CAF6E2215EAF2500B71FA0 /* ViewController.swift */; };
C4CAF6E3215EAF2500B71FA0 /* ExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4CAF6E2215EAF2500B71FA0 /* ExampleViewController.swift */; };
C4CAF6E6215EAF2500B71FA0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C4CAF6E4215EAF2500B71FA0 /* Main.storyboard */; };
C4CAF6E8215EAF2800B71FA0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C4CAF6E7215EAF2800B71FA0 /* Assets.xcassets */; };
C4CAF6EB215EAF2800B71FA0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C4CAF6E9215EAF2800B71FA0 /* LaunchScreen.storyboard */; };
Expand All @@ -21,9 +23,11 @@
6DC5F1971A45A5AA4BF29822 /* Pods-Arrow_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Arrow_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Arrow_Example/Pods-Arrow_Example.release.xcconfig"; sourceTree = "<group>"; };
8DE5D5393F43F0D931F0416D /* Pods-Arrow_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Arrow_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Arrow_Example/Pods-Arrow_Example.debug.xcconfig"; sourceTree = "<group>"; };
C469575D21669F6400F40A2F /* UIView+Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Utils.swift"; sourceTree = "<group>"; };
C48D94EB2172129E008A498D /* ExamplePanel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExamplePanel.swift; sourceTree = "<group>"; };
C48D94EC2172129E008A498D /* ExamplePanel.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = ExamplePanel.storyboard; sourceTree = "<group>"; };
C4CAF6DD215EAF2500B71FA0 /* Arrow_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Arrow_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
C4CAF6E0215EAF2500B71FA0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
C4CAF6E2215EAF2500B71FA0 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
C4CAF6E2215EAF2500B71FA0 /* ExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleViewController.swift; sourceTree = "<group>"; };
C4CAF6E5215EAF2500B71FA0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
C4CAF6E7215EAF2800B71FA0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
C4CAF6EA215EAF2800B71FA0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
Expand Down Expand Up @@ -58,6 +62,15 @@
path = Extension;
sourceTree = "<group>";
};
C48D94EA2172129E008A498D /* Panel */ = {
isa = PBXGroup;
children = (
C48D94EB2172129E008A498D /* ExamplePanel.swift */,
C48D94EC2172129E008A498D /* ExamplePanel.storyboard */,
);
path = Panel;
sourceTree = "<group>";
};
C4CAF6D4215EAF2500B71FA0 = {
isa = PBXGroup;
children = (
Expand All @@ -79,9 +92,10 @@
C4CAF6DF215EAF2500B71FA0 /* Arrow_Example */ = {
isa = PBXGroup;
children = (
C48D94EA2172129E008A498D /* Panel */,
C469575C21669F5300F40A2F /* Extension */,
C4CAF6E0215EAF2500B71FA0 /* AppDelegate.swift */,
C4CAF6E2215EAF2500B71FA0 /* ViewController.swift */,
C4CAF6E2215EAF2500B71FA0 /* ExampleViewController.swift */,
C4CAF6E4215EAF2500B71FA0 /* Main.storyboard */,
C4CAF6E7215EAF2800B71FA0 /* Assets.xcassets */,
C4CAF6E9215EAF2800B71FA0 /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -161,6 +175,7 @@
files = (
C4CAF6EB215EAF2800B71FA0 /* LaunchScreen.storyboard in Resources */,
C4CAF6E8215EAF2800B71FA0 /* Assets.xcassets in Resources */,
C48D94EE2172129E008A498D /* ExamplePanel.storyboard in Resources */,
C4CAF6E6215EAF2500B71FA0 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -176,10 +191,12 @@
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Arrow_Example/Pods-Arrow_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Arrows/Arrows.framework",
"${BUILT_PRODUCTS_DIR}/Panels/Panels.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Arrows.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Panels.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -211,7 +228,8 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C4CAF6E3215EAF2500B71FA0 /* ViewController.swift in Sources */,
C4CAF6E3215EAF2500B71FA0 /* ExampleViewController.swift in Sources */,
C48D94ED2172129E008A498D /* ExamplePanel.swift in Sources */,
C469575E21669F6400F40A2F /* UIView+Utils.swift in Sources */,
C4CAF6E1215EAF2500B71FA0 /* AppDelegate.swift in Sources */,
);
Expand Down Expand Up @@ -362,7 +380,10 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Arrow_Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.Arrow-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
Expand All @@ -377,7 +398,10 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Arrow_Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.Arrow-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "list.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
15 changes: 15 additions & 0 deletions Example/Arrow_Example/Assets.xcassets/eeuu.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "eeuu.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "listCountries.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
93 changes: 34 additions & 59 deletions Example/Arrow_Example/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="HLu-vd-MiX">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
Expand All @@ -9,79 +9,54 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<!--VPN-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="Arrow_Example" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="ExampleViewController" customModule="Arrow_Example" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6JC-7w-SNx">
<rect key="frame" x="0.0" y="440" width="375" height="227"/>
<subviews>
<view clipsSubviews="YES" contentMode="scaleAspectFit" translatesAutoresizingMaskIntoConstraints="NO" id="eMJ-Of-fzQ" customClass="ArrowView" customModule="Arrows">
<rect key="frame" x="144" y="8" width="87" height="40"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="tintColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="Sd1-K3-oBK"/>
<constraint firstAttribute="width" constant="87" id="hxT-4R-p0x"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rd5-Gj-qpw">
<rect key="frame" x="147.5" y="98.5" width="80" height="30"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="80" id="MG8-eW-b8n"/>
</constraints>
<state key="normal" title="Change"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="10"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="changeArrowPosition" destination="BYZ-38-t0r" eventType="touchUpInside" id="AL0-Q9-xGy"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="eMJ-Of-fzQ" firstAttribute="centerX" secondItem="6JC-7w-SNx" secondAttribute="centerX" id="Hxw-88-KWQ"/>
<constraint firstItem="eMJ-Of-fzQ" firstAttribute="top" secondItem="6JC-7w-SNx" secondAttribute="top" constant="8" id="Vbd-lG-o1e"/>
<constraint firstAttribute="height" constant="227" id="Vc6-JA-diS"/>
<constraint firstItem="rd5-Gj-qpw" firstAttribute="centerX" secondItem="6JC-7w-SNx" secondAttribute="centerX" id="kfa-JN-UX6"/>
<constraint firstItem="rd5-Gj-qpw" firstAttribute="centerY" secondItem="6JC-7w-SNx" secondAttribute="centerY" id="sdm-te-xqm"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="20"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="center" translatesAutoresizingMaskIntoConstraints="NO" id="vBb-TU-IhU">
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
</imageView>
</subviews>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="tintColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<constraints>
<constraint firstItem="6JC-7w-SNx" firstAttribute="bottom" secondItem="8bC-Xf-vdC" secondAttribute="bottom" id="1Bw-YO-7BW"/>
<constraint firstItem="6JC-7w-SNx" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="V2a-Ne-ZM1"/>
<constraint firstItem="6JC-7w-SNx" firstAttribute="trailing" secondItem="6Tk-OE-BBY" secondAttribute="trailing" id="bAZ-6B-Igr"/>
<constraint firstItem="vBb-TU-IhU" firstAttribute="trailing" secondItem="6Tk-OE-BBY" secondAttribute="trailing" id="aBO-qu-Syy"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="bottom" secondItem="vBb-TU-IhU" secondAttribute="bottom" id="eNn-ea-ZAD"/>
<constraint firstItem="vBb-TU-IhU" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="liJ-t7-H4f"/>
<constraint firstItem="vBb-TU-IhU" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="pAB-r6-4VZ"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<connections>
<outlet property="arrow" destination="eMJ-Of-fzQ" id="S5t-Bs-qSB"/>
<outlet property="panel" destination="6JC-7w-SNx" id="wbj-Lp-c46"/>
</connections>
<navigationItem key="navigationItem" title="VPN" id="3xR-cm-nXE"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="992.79999999999995" y="69.715142428785612"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="tlS-pF-Ei7">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="HLu-vd-MiX" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="f1z-Ih-9GJ">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="QMw-aG-sQb"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="qTq-VO-35j" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53.600000000000001" y="69.715142428785612"/>
</scene>
</scenes>
<resources>
<image name="center" width="375" height="389"/>
</resources>
</document>
31 changes: 31 additions & 0 deletions Example/Arrow_Example/ExampleViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// ViewController.swift
// Arrow_Example
//
// Created by Antonio Casero on 28.09.18.
// Copyright © 2018 Antonio Casero. All rights reserved.
//

import UIKit
import Arrows
import Panels

class ExampleViewController: UIViewController {

@IBOutlet weak var panel: UIView!
var index = 1
lazy var panelManager = Panels(target: self)

override func viewDidLoad() {
super.viewDidLoad()
let panel = UIStoryboard.instantiatePanel(identifier: "ExamplePanel")
panelManager.delegate = panel as? PanelNotifications
panelManager.show(panel: panel)
}

// @IBAction func changeArrowPosition() {
// index = (index + 1 < ArrowPanel.Position.allCases.count) ? index + 1 : 0
// let next = ArrowPanel.Position.allCases[index]
// arrow.update(to: next, animated: true)
// }
}
19 changes: 19 additions & 0 deletions Example/Arrow_Example/Extension/UIView+Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,22 @@ import UIKit

}
}

extension UIViewController {
func curveTopCorners() {
let colorBorder = #colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 1)
let path = UIBezierPath(roundedRect: self.view.bounds,
byRoundingCorners: [.topLeft, .topRight],
cornerRadii: CGSize(width: 50, height: 0))
let maskLayer = CAShapeLayer()
let borderLayer = CAShapeLayer()
borderLayer.path = path.cgPath
borderLayer.fillColor = UIColor.clear.cgColor
borderLayer.strokeColor = colorBorder.cgColor
borderLayer.borderWidth = 10
maskLayer.frame = self.view.bounds
maskLayer.path = path.cgPath
self.view.layer.mask = maskLayer
self.view.layer.addSublayer(borderLayer)
}
}
Loading

0 comments on commit 1d7b005

Please sign in to comment.