mirror of
https://github.com/louisdh/panelkit.git
synced 2024-09-11 08:15:24 +03:00
Added unit tests
This commit is contained in:
parent
9b1fc96198
commit
acf978772a
@ -10,7 +10,7 @@ env:
|
||||
- EXAMPLE_SCHEME="Example"
|
||||
matrix:
|
||||
|
||||
- DESTINATION="OS=10.2,name=iPad Pro (9.7 inch)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" CODE_COV="NO"
|
||||
- DESTINATION="OS=10.2,name=iPad Pro (9.7 inch)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" CODE_COV="YES"
|
||||
- DESTINATION="OS=9.0,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="NO" BUILD_EXAMPLE="YES" CODE_COV="NO"
|
||||
|
||||
script:
|
||||
|
21
PanelKit Test Host/AppDelegate.swift
Normal file
21
PanelKit Test Host/AppDelegate.swift
Normal file
@ -0,0 +1,21 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// PanelKit Test Host
|
||||
//
|
||||
// Created by Louis D'hauwe on 09/03/2017.
|
||||
// Copyright © 2017 Silver Fox. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
27
PanelKit Test Host/Base.lproj/LaunchScreen.storyboard
Normal file
27
PanelKit Test Host/Base.lproj/LaunchScreen.storyboard
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
26
PanelKit Test Host/Base.lproj/Main.storyboard
Normal file
26
PanelKit Test Host/Base.lproj/Main.storyboard
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<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"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
45
PanelKit Test Host/Info.plist
Normal file
45
PanelKit Test Host/Info.plist
Normal file
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
13
PanelKit Test Host/ViewController.swift
Normal file
13
PanelKit Test Host/ViewController.swift
Normal file
@ -0,0 +1,13 @@
|
||||
//
|
||||
// ViewController.swift
|
||||
// PanelKit Test Host
|
||||
//
|
||||
// Created by Louis D'hauwe on 09/03/2017.
|
||||
// Copyright © 2017 Silver Fox. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class ViewController: UIViewController {
|
||||
|
||||
}
|
@ -28,6 +28,16 @@
|
||||
BEBE2F431E71DED600DEDF21 /* PanelViewController+Keyboard.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEBE2F421E71DED600DEDF21 /* PanelViewController+Keyboard.swift */; };
|
||||
BEBE2F451E71DFC100DEDF21 /* PanelViewController+Dragging.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEBE2F441E71DFC100DEDF21 /* PanelViewController+Dragging.swift */; };
|
||||
BEBE2F471E71ED0300DEDF21 /* PanelViewController+Offscreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEBE2F461E71ED0300DEDF21 /* PanelViewController+Offscreen.swift */; };
|
||||
BEBE2F4F1E71FC0B00DEDF21 /* PanelKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEBE2F4E1E71FC0B00DEDF21 /* PanelKitTests.swift */; };
|
||||
BEBE2F511E71FC0B00DEDF21 /* PanelKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE24AD031E4F6B11008892A2 /* PanelKit.framework */; };
|
||||
BEBE2F5A1E71FCC500DEDF21 /* MapPanelContentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEBE2F581E71FCC500DEDF21 /* MapPanelContentViewController.swift */; };
|
||||
BEBE2F5B1E71FCC500DEDF21 /* TextPanelContentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEBE2F591E71FCC500DEDF21 /* TextPanelContentViewController.swift */; };
|
||||
BEBE2F5D1E71FE1900DEDF21 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEBE2F5C1E71FE1900DEDF21 /* ViewController.swift */; };
|
||||
BEBE2F651E7208C800DEDF21 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEBE2F641E7208C800DEDF21 /* AppDelegate.swift */; };
|
||||
BEBE2F671E7208C800DEDF21 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEBE2F661E7208C800DEDF21 /* ViewController.swift */; };
|
||||
BEBE2F6A1E7208C800DEDF21 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BEBE2F681E7208C800DEDF21 /* Main.storyboard */; };
|
||||
BEBE2F6C1E7208C800DEDF21 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BEBE2F6B1E7208C800DEDF21 /* Assets.xcassets */; };
|
||||
BEBE2F6F1E7208C800DEDF21 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BEBE2F6D1E7208C800DEDF21 /* LaunchScreen.storyboard */; };
|
||||
BECEE6131E6E225800AB2B25 /* PanelManager+Dragging.swift in Sources */ = {isa = PBXBuildFile; fileRef = BECEE6121E6E225800AB2B25 /* PanelManager+Dragging.swift */; };
|
||||
BECEE6151E6E234D00AB2B25 /* PanelManager+Default.swift in Sources */ = {isa = PBXBuildFile; fileRef = BECEE6141E6E234D00AB2B25 /* PanelManager+Default.swift */; };
|
||||
BED541DF1E676172002A5459 /* PanelKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE24AD031E4F6B11008892A2 /* PanelKit.framework */; };
|
||||
@ -45,6 +55,20 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
BEBE2F521E71FC0B00DEDF21 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = BE24ACFA1E4F6B11008892A2 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = BE24AD021E4F6B11008892A2;
|
||||
remoteInfo = PanelKit;
|
||||
};
|
||||
BEBE2F741E7208DE00DEDF21 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = BE24ACFA1E4F6B11008892A2 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = BEBE2F611E7208C800DEDF21;
|
||||
remoteInfo = "PanelKit Test Host";
|
||||
};
|
||||
BED541E11E676172002A5459 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = BE24ACFA1E4F6B11008892A2 /* Project object */;
|
||||
@ -99,6 +123,19 @@
|
||||
BEBE2F421E71DED600DEDF21 /* PanelViewController+Keyboard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "PanelViewController+Keyboard.swift"; path = "Controller/PanelViewController+Keyboard.swift"; sourceTree = "<group>"; };
|
||||
BEBE2F441E71DFC100DEDF21 /* PanelViewController+Dragging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "PanelViewController+Dragging.swift"; path = "Controller/PanelViewController+Dragging.swift"; sourceTree = "<group>"; };
|
||||
BEBE2F461E71ED0300DEDF21 /* PanelViewController+Offscreen.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "PanelViewController+Offscreen.swift"; path = "Controller/PanelViewController+Offscreen.swift"; sourceTree = "<group>"; };
|
||||
BEBE2F4C1E71FC0A00DEDF21 /* PanelKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PanelKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
BEBE2F4E1E71FC0B00DEDF21 /* PanelKitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PanelKitTests.swift; sourceTree = "<group>"; };
|
||||
BEBE2F501E71FC0B00DEDF21 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
BEBE2F581E71FCC500DEDF21 /* MapPanelContentViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MapPanelContentViewController.swift; path = Panels/MapPanelContentViewController.swift; sourceTree = "<group>"; };
|
||||
BEBE2F591E71FCC500DEDF21 /* TextPanelContentViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TextPanelContentViewController.swift; path = Panels/TextPanelContentViewController.swift; sourceTree = "<group>"; };
|
||||
BEBE2F5C1E71FE1900DEDF21 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
BEBE2F621E7208C800DEDF21 /* PanelKit Test Host.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "PanelKit Test Host.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
BEBE2F641E7208C800DEDF21 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
BEBE2F661E7208C800DEDF21 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
BEBE2F691E7208C800DEDF21 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
BEBE2F6B1E7208C800DEDF21 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
BEBE2F6E1E7208C800DEDF21 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
BEBE2F701E7208C800DEDF21 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
BECEE6121E6E225800AB2B25 /* PanelManager+Dragging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "PanelManager+Dragging.swift"; path = "PanelManager/PanelManager+Dragging.swift"; sourceTree = "<group>"; };
|
||||
BECEE6141E6E234D00AB2B25 /* PanelManager+Default.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "PanelManager+Default.swift"; path = "PanelManager/PanelManager+Default.swift"; sourceTree = "<group>"; };
|
||||
BEF8014A1E50F0C4007D3CEE /* UIViewController+Popover.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIViewController+Popover.swift"; path = "Utils/UIViewController+Popover.swift"; sourceTree = "<group>"; };
|
||||
@ -125,6 +162,21 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
BEBE2F491E71FC0A00DEDF21 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
BEBE2F511E71FC0B00DEDF21 /* PanelKit.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
BEBE2F5F1E7208C800DEDF21 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
BEFCF7631E6759F800BC95ED /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@ -149,6 +201,8 @@
|
||||
BE24AD051E4F6B11008892A2 /* PanelKit */,
|
||||
BEFCF7731E675D0600BC95ED /* PanelKit UI Test Host */,
|
||||
BEFCF7671E6759F800BC95ED /* PanelKit UI Tests */,
|
||||
BEBE2F631E7208C800DEDF21 /* PanelKit Test Host */,
|
||||
BEBE2F4D1E71FC0A00DEDF21 /* PanelKit Tests */,
|
||||
BE24AD041E4F6B11008892A2 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
@ -159,6 +213,8 @@
|
||||
BE24AD031E4F6B11008892A2 /* PanelKit.framework */,
|
||||
BEFCF7661E6759F800BC95ED /* PanelKit UI Tests.xctest */,
|
||||
BEFCF7721E675D0600BC95ED /* PanelKit UI Test Host.app */,
|
||||
BEBE2F4C1E71FC0A00DEDF21 /* PanelKitTests.xctest */,
|
||||
BEBE2F621E7208C800DEDF21 /* PanelKit Test Host.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@ -217,6 +273,40 @@
|
||||
name = PanelManager;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
BEBE2F4D1E71FC0A00DEDF21 /* PanelKit Tests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BEBE2F5C1E71FE1900DEDF21 /* ViewController.swift */,
|
||||
BEBE2F571E71FCA300DEDF21 /* Panels */,
|
||||
BEBE2F4E1E71FC0B00DEDF21 /* PanelKitTests.swift */,
|
||||
BEBE2F501E71FC0B00DEDF21 /* Info.plist */,
|
||||
);
|
||||
name = "PanelKit Tests";
|
||||
path = PanelKitTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
BEBE2F571E71FCA300DEDF21 /* Panels */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BEBE2F581E71FCC500DEDF21 /* MapPanelContentViewController.swift */,
|
||||
BEBE2F591E71FCC500DEDF21 /* TextPanelContentViewController.swift */,
|
||||
);
|
||||
name = Panels;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
BEBE2F631E7208C800DEDF21 /* PanelKit Test Host */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BEBE2F641E7208C800DEDF21 /* AppDelegate.swift */,
|
||||
BEBE2F661E7208C800DEDF21 /* ViewController.swift */,
|
||||
BEBE2F681E7208C800DEDF21 /* Main.storyboard */,
|
||||
BEBE2F6B1E7208C800DEDF21 /* Assets.xcassets */,
|
||||
BEBE2F6D1E7208C800DEDF21 /* LaunchScreen.storyboard */,
|
||||
BEBE2F701E7208C800DEDF21 /* Info.plist */,
|
||||
);
|
||||
path = "PanelKit Test Host";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
BEF801491E50F0A1007D3CEE /* Utils */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -292,6 +382,42 @@
|
||||
productReference = BE24AD031E4F6B11008892A2 /* PanelKit.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
BEBE2F4B1E71FC0A00DEDF21 /* PanelKitTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = BEBE2F541E71FC0B00DEDF21 /* Build configuration list for PBXNativeTarget "PanelKitTests" */;
|
||||
buildPhases = (
|
||||
BEBE2F481E71FC0A00DEDF21 /* Sources */,
|
||||
BEBE2F491E71FC0A00DEDF21 /* Frameworks */,
|
||||
BEBE2F4A1E71FC0A00DEDF21 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
BEBE2F531E71FC0B00DEDF21 /* PBXTargetDependency */,
|
||||
BEBE2F751E7208DE00DEDF21 /* PBXTargetDependency */,
|
||||
);
|
||||
name = PanelKitTests;
|
||||
productName = PanelKitTests;
|
||||
productReference = BEBE2F4C1E71FC0A00DEDF21 /* PanelKitTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
BEBE2F611E7208C800DEDF21 /* PanelKit Test Host */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = BEBE2F711E7208C800DEDF21 /* Build configuration list for PBXNativeTarget "PanelKit Test Host" */;
|
||||
buildPhases = (
|
||||
BEBE2F5E1E7208C800DEDF21 /* Sources */,
|
||||
BEBE2F5F1E7208C800DEDF21 /* Frameworks */,
|
||||
BEBE2F601E7208C800DEDF21 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "PanelKit Test Host";
|
||||
productName = "PanelKit Test Host";
|
||||
productReference = BEBE2F621E7208C800DEDF21 /* PanelKit Test Host.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
BEFCF7651E6759F800BC95ED /* PanelKit UI Tests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = BEFCF76D1E6759F800BC95ED /* Build configuration list for PBXNativeTarget "PanelKit UI Tests" */;
|
||||
@ -344,6 +470,17 @@
|
||||
LastSwiftMigration = 0820;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
BEBE2F4B1E71FC0A00DEDF21 = {
|
||||
CreatedOnToolsVersion = 8.2.1;
|
||||
DevelopmentTeam = 6G5LMQ72D8;
|
||||
ProvisioningStyle = Automatic;
|
||||
TestTargetID = BEBE2F611E7208C800DEDF21;
|
||||
};
|
||||
BEBE2F611E7208C800DEDF21 = {
|
||||
CreatedOnToolsVersion = 8.2.1;
|
||||
DevelopmentTeam = 6G5LMQ72D8;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
BEFCF7651E6759F800BC95ED = {
|
||||
CreatedOnToolsVersion = 8.2.1;
|
||||
DevelopmentTeam = 6G5LMQ72D8;
|
||||
@ -373,6 +510,8 @@
|
||||
BE24AD021E4F6B11008892A2 /* PanelKit */,
|
||||
BEFCF7651E6759F800BC95ED /* PanelKit UI Tests */,
|
||||
BEFCF7711E675D0600BC95ED /* PanelKit UI Test Host */,
|
||||
BEBE2F4B1E71FC0A00DEDF21 /* PanelKitTests */,
|
||||
BEBE2F611E7208C800DEDF21 /* PanelKit Test Host */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
@ -385,6 +524,23 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
BEBE2F4A1E71FC0A00DEDF21 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
BEBE2F601E7208C800DEDF21 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
BEBE2F6F1E7208C800DEDF21 /* LaunchScreen.storyboard in Resources */,
|
||||
BEBE2F6C1E7208C800DEDF21 /* Assets.xcassets in Resources */,
|
||||
BEBE2F6A1E7208C800DEDF21 /* Main.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
BEFCF7641E6759F800BC95ED /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@ -436,6 +592,26 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
BEBE2F481E71FC0A00DEDF21 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
BEBE2F5A1E71FCC500DEDF21 /* MapPanelContentViewController.swift in Sources */,
|
||||
BEBE2F5B1E71FCC500DEDF21 /* TextPanelContentViewController.swift in Sources */,
|
||||
BEBE2F5D1E71FE1900DEDF21 /* ViewController.swift in Sources */,
|
||||
BEBE2F4F1E71FC0B00DEDF21 /* PanelKitTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
BEBE2F5E1E7208C800DEDF21 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
BEBE2F671E7208C800DEDF21 /* ViewController.swift in Sources */,
|
||||
BEBE2F651E7208C800DEDF21 /* AppDelegate.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
BEFCF7621E6759F800BC95ED /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@ -458,6 +634,16 @@
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
BEBE2F531E71FC0B00DEDF21 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = BE24AD021E4F6B11008892A2 /* PanelKit */;
|
||||
targetProxy = BEBE2F521E71FC0B00DEDF21 /* PBXContainerItemProxy */;
|
||||
};
|
||||
BEBE2F751E7208DE00DEDF21 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = BEBE2F611E7208C800DEDF21 /* PanelKit Test Host */;
|
||||
targetProxy = BEBE2F741E7208DE00DEDF21 /* PBXContainerItemProxy */;
|
||||
};
|
||||
BED541E21E676172002A5459 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = BE24AD021E4F6B11008892A2 /* PanelKit */;
|
||||
@ -471,6 +657,22 @@
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
BEBE2F681E7208C800DEDF21 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
BEBE2F691E7208C800DEDF21 /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
BEBE2F6D1E7208C800DEDF21 /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
BEBE2F6E1E7208C800DEDF21 /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
BEFCF7781E675D0600BC95ED /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
@ -630,6 +832,62 @@
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
BEBE2F551E71FC0B00DEDF21 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
DEVELOPMENT_TEAM = 6G5LMQ72D8;
|
||||
INFOPLIST_FILE = PanelKitTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = be.silverfox.PanelKitTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PanelKit Test Host.app/PanelKit Test Host";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
BEBE2F561E71FC0B00DEDF21 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
DEVELOPMENT_TEAM = 6G5LMQ72D8;
|
||||
INFOPLIST_FILE = PanelKitTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = be.silverfox.PanelKitTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PanelKit Test Host.app/PanelKit Test Host";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
BEBE2F721E7208C800DEDF21 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
DEVELOPMENT_TEAM = 6G5LMQ72D8;
|
||||
INFOPLIST_FILE = "PanelKit Test Host/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "be.silverfox.PanelKit-Test-Host";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
BEBE2F731E7208C800DEDF21 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
DEVELOPMENT_TEAM = 6G5LMQ72D8;
|
||||
INFOPLIST_FILE = "PanelKit Test Host/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "be.silverfox.PanelKit-Test-Host";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
BEFCF76B1E6759F800BC95ED /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@ -709,6 +967,22 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
BEBE2F541E71FC0B00DEDF21 /* Build configuration list for PBXNativeTarget "PanelKitTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
BEBE2F551E71FC0B00DEDF21 /* Debug */,
|
||||
BEBE2F561E71FC0B00DEDF21 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
};
|
||||
BEBE2F711E7208C800DEDF21 /* Build configuration list for PBXNativeTarget "PanelKit Test Host" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
BEBE2F721E7208C800DEDF21 /* Debug */,
|
||||
BEBE2F731E7208C800DEDF21 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
};
|
||||
BEFCF76D1E6759F800BC95ED /* Build configuration list for PBXNativeTarget "PanelKit UI Tests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
@ -38,6 +38,16 @@
|
||||
ReferencedContainer = "container:PanelKit.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "BEBE2F4B1E71FC0A00DEDF21"
|
||||
BuildableName = "PanelKitTests.xctest"
|
||||
BlueprintName = "PanelKitTests"
|
||||
ReferencedContainer = "container:PanelKit.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
|
22
PanelKitTests/Info.plist
Normal file
22
PanelKitTests/Info.plist
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
71
PanelKitTests/PanelKitTests.swift
Normal file
71
PanelKitTests/PanelKitTests.swift
Normal file
@ -0,0 +1,71 @@
|
||||
//
|
||||
// PanelKitTests.swift
|
||||
// PanelKitTests
|
||||
//
|
||||
// Created by Louis D'hauwe on 09/03/2017.
|
||||
// Copyright © 2017 Silver Fox. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
@testable import PanelKit
|
||||
|
||||
class PanelKitTests: XCTestCase {
|
||||
|
||||
var viewController: ViewController!
|
||||
var navigationController: UINavigationController!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
viewController = ViewController()
|
||||
navigationController = UINavigationController(rootViewController: viewController)
|
||||
navigationController.view.frame = CGRect(origin: .zero, size: CGSize(width: 1024, height: 768))
|
||||
|
||||
UIApplication.shared.keyWindow!.rootViewController!.present(navigationController, animated: false, completion: nil)
|
||||
|
||||
XCTAssertNotNil(navigationController.view)
|
||||
XCTAssertNotNil(viewController.view)
|
||||
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
func testFloating() {
|
||||
|
||||
let mapPanel = viewController.mapPanelVC!
|
||||
|
||||
assert(!mapPanel.isFloating)
|
||||
assert(!mapPanel.isPinned)
|
||||
assert(!mapPanel.isPresentedModally)
|
||||
assert(!mapPanel.isPresentedAsPopover)
|
||||
|
||||
let popoverExp = self.expectation(description: "popover")
|
||||
let popExp = self.expectation(description: "pop")
|
||||
|
||||
viewController.showMapPanelFromBarButton {
|
||||
|
||||
assert(mapPanel.isPresentedAsPopover)
|
||||
|
||||
self.viewController.toggleFloatStatus(for: mapPanel, completion: {
|
||||
|
||||
assert(mapPanel.isFloating)
|
||||
popExp.fulfill()
|
||||
|
||||
})
|
||||
|
||||
popoverExp.fulfill()
|
||||
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10.0) { (error) in
|
||||
if let error = error {
|
||||
XCTFail(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
29
PanelKitTests/Panels/MapPanelContentViewController.swift
Normal file
29
PanelKitTests/Panels/MapPanelContentViewController.swift
Normal file
@ -0,0 +1,29 @@
|
||||
//
|
||||
// MapPanelContentViewController.swift
|
||||
// PanelKitTests
|
||||
//
|
||||
// Created by Louis D'hauwe on 09/03/2017.
|
||||
// Copyright © 2017 Silver Fox. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import PanelKit
|
||||
import MapKit
|
||||
|
||||
class MapPanelContentViewController: PanelContentViewController {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
let mapView = MKMapView(frame: view.bounds)
|
||||
self.view.addSubview(mapView)
|
||||
|
||||
self.title = "Map"
|
||||
|
||||
}
|
||||
|
||||
override var preferredPanelContentSize: CGSize {
|
||||
return CGSize(width: 320, height: 500)
|
||||
}
|
||||
|
||||
}
|
34
PanelKitTests/Panels/TextPanelContentViewController.swift
Normal file
34
PanelKitTests/Panels/TextPanelContentViewController.swift
Normal file
@ -0,0 +1,34 @@
|
||||
//
|
||||
// TextPanelContentViewController.swift
|
||||
// PanelKitTests
|
||||
//
|
||||
// Created by Louis D'hauwe on 09/03/2017.
|
||||
// Copyright © 2017 Silver Fox. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import PanelKit
|
||||
|
||||
class TextPanelContentViewController: PanelContentViewController {
|
||||
|
||||
weak var textView: UITextView!
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
textView = UITextView(frame: view.bounds)
|
||||
self.view.addSubview(textView)
|
||||
|
||||
self.title = "TextView"
|
||||
|
||||
}
|
||||
|
||||
override var shouldAdjustForKeyboard: Bool {
|
||||
return textView.isFirstResponder
|
||||
}
|
||||
|
||||
override var preferredPanelContentSize: CGSize {
|
||||
return CGSize(width: 320, height: 400)
|
||||
}
|
||||
|
||||
}
|
126
PanelKitTests/ViewController.swift
Normal file
126
PanelKitTests/ViewController.swift
Normal file
@ -0,0 +1,126 @@
|
||||
//
|
||||
// ViewController.swift
|
||||
// PanelKit
|
||||
//
|
||||
// Created by Louis D'hauwe on 09/03/2017.
|
||||
// Copyright © 2017 Silver Fox. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
import PanelKit
|
||||
|
||||
class ViewController: UIViewController, PanelManager {
|
||||
|
||||
var mapPanelContentVC: MapPanelContentViewController!
|
||||
var mapPanelVC: PanelViewController!
|
||||
|
||||
var textPanelContentVC: TextPanelContentViewController!
|
||||
var textPanelVC: PanelViewController!
|
||||
|
||||
var contentWrapperView: UIView!
|
||||
var contentView: UIView!
|
||||
|
||||
var mapPanelBarBtn: UIBarButtonItem!
|
||||
var textPanelBarBtn: UIBarButtonItem!
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
contentWrapperView = UIView(frame: view.bounds)
|
||||
view.addSubview(contentWrapperView)
|
||||
|
||||
contentView = UIView(frame: contentWrapperView.bounds)
|
||||
contentWrapperView.addSubview(contentView)
|
||||
|
||||
mapPanelContentVC = MapPanelContentViewController()
|
||||
|
||||
mapPanelVC = PanelViewController(with: mapPanelContentVC, in: self)
|
||||
|
||||
textPanelContentVC = TextPanelContentViewController()
|
||||
|
||||
textPanelVC = PanelViewController(with: textPanelContentVC, in: self)
|
||||
|
||||
enableTripleTapExposeActivation()
|
||||
|
||||
mapPanelBarBtn = UIBarButtonItem(title: "Map", style: .done, target: self, action: #selector(showMap(_:)))
|
||||
textPanelBarBtn = UIBarButtonItem(title: "Text", style: .done, target: self, action: #selector(showTextViewPanel(_:)))
|
||||
|
||||
self.navigationItem.title = "Test"
|
||||
self.navigationItem.rightBarButtonItems = [mapPanelBarBtn, textPanelBarBtn]
|
||||
|
||||
}
|
||||
|
||||
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
|
||||
super.viewWillTransition(to: size, with: coordinator)
|
||||
|
||||
coordinator.animate(alongsideTransition: { (context) in
|
||||
|
||||
}) { (context) in
|
||||
|
||||
if !self.allowFloatingPanels {
|
||||
self.closeAllFloatingPanels()
|
||||
}
|
||||
|
||||
if !self.allowPanelPinning {
|
||||
self.closeAllPinnedPanels()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Exposé
|
||||
|
||||
@IBAction func toggleExpose(_ sender: UIBarButtonItem) {
|
||||
|
||||
toggleExpose()
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Popover
|
||||
|
||||
func showMap(_ sender: UIBarButtonItem) {
|
||||
|
||||
showPopover(mapPanelVC, from: sender)
|
||||
|
||||
}
|
||||
|
||||
func showTextViewPanel(_ sender: UIBarButtonItem) {
|
||||
|
||||
showPopover(textPanelVC, from: sender)
|
||||
|
||||
}
|
||||
|
||||
func showMapPanelFromBarButton(completion: @escaping (() -> Void)) {
|
||||
showPopover(mapPanelVC, from: mapPanelBarBtn, completion: completion)
|
||||
}
|
||||
|
||||
func showTextPanelFromBarButton(completion: @escaping (() -> Void)) {
|
||||
showPopover(textPanelVC, from: textPanelBarBtn, completion: completion)
|
||||
}
|
||||
|
||||
func showPopover(_ vc: UIViewController, from barButtonItem: UIBarButtonItem, completion: (() -> Void)? = nil) {
|
||||
|
||||
vc.modalPresentationStyle = .popover
|
||||
vc.popoverPresentationController?.barButtonItem = barButtonItem
|
||||
|
||||
present(vc, animated: false, completion: completion)
|
||||
|
||||
}
|
||||
|
||||
// MARK: - PanelManager
|
||||
|
||||
var panelContentWrapperView: UIView {
|
||||
return contentWrapperView
|
||||
}
|
||||
|
||||
var panelContentView: UIView {
|
||||
return contentView
|
||||
}
|
||||
|
||||
var panels: [PanelViewController] {
|
||||
return [mapPanelVC, textPanelVC]
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user