Added example skeleton, made API public

This commit is contained in:
Louis D'hauwe 2017-02-12 13:35:51 +01:00
parent d44201e224
commit 105f801787
13 changed files with 654 additions and 28 deletions

View File

@ -0,0 +1,340 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
BE24AD271E508C49008892A2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE24AD261E508C49008892A2 /* AppDelegate.swift */; };
BE24AD291E508C49008892A2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE24AD281E508C49008892A2 /* ViewController.swift */; };
BE24AD2C1E508C49008892A2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BE24AD2A1E508C49008892A2 /* Main.storyboard */; };
BE24AD2E1E508C49008892A2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BE24AD2D1E508C49008892A2 /* Assets.xcassets */; };
BE24AD311E508C49008892A2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BE24AD2F1E508C49008892A2 /* LaunchScreen.storyboard */; };
BE24AD3A1E508C8F008892A2 /* PanelKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE24AD391E508C8F008892A2 /* PanelKit.framework */; };
BEF801401E508CA3007D3CEE /* PanelKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BE24AD391E508C8F008892A2 /* PanelKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
BEF801411E508CA3007D3CEE /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
BEF801401E508CA3007D3CEE /* PanelKit.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
BE24AD231E508C49008892A2 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
BE24AD261E508C49008892A2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
BE24AD281E508C49008892A2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
BE24AD2B1E508C49008892A2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
BE24AD2D1E508C49008892A2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
BE24AD301E508C49008892A2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
BE24AD321E508C49008892A2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
BE24AD391E508C8F008892A2 /* PanelKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PanelKit.framework; path = "../../../../Library/Developer/Xcode/DerivedData/PanelKit-bazukjpbanitzpeyxanllouvbgxh/Build/Products/Debug-iphoneos/PanelKit.framework"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
BE24AD201E508C49008892A2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
BE24AD3A1E508C8F008892A2 /* PanelKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
BE24AD1A1E508C49008892A2 = {
isa = PBXGroup;
children = (
BE24AD251E508C49008892A2 /* Example */,
BE24AD241E508C49008892A2 /* Products */,
BE24AD381E508C8E008892A2 /* Frameworks */,
);
sourceTree = "<group>";
};
BE24AD241E508C49008892A2 /* Products */ = {
isa = PBXGroup;
children = (
BE24AD231E508C49008892A2 /* Example.app */,
);
name = Products;
sourceTree = "<group>";
};
BE24AD251E508C49008892A2 /* Example */ = {
isa = PBXGroup;
children = (
BE24AD261E508C49008892A2 /* AppDelegate.swift */,
BE24AD281E508C49008892A2 /* ViewController.swift */,
BE24AD2A1E508C49008892A2 /* Main.storyboard */,
BE24AD2D1E508C49008892A2 /* Assets.xcassets */,
BE24AD2F1E508C49008892A2 /* LaunchScreen.storyboard */,
BE24AD321E508C49008892A2 /* Info.plist */,
);
path = Example;
sourceTree = "<group>";
};
BE24AD381E508C8E008892A2 /* Frameworks */ = {
isa = PBXGroup;
children = (
BE24AD391E508C8F008892A2 /* PanelKit.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
BE24AD221E508C49008892A2 /* Example */ = {
isa = PBXNativeTarget;
buildConfigurationList = BE24AD351E508C49008892A2 /* Build configuration list for PBXNativeTarget "Example" */;
buildPhases = (
BE24AD1F1E508C49008892A2 /* Sources */,
BE24AD201E508C49008892A2 /* Frameworks */,
BE24AD211E508C49008892A2 /* Resources */,
BEF801411E508CA3007D3CEE /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Example;
productName = Example;
productReference = BE24AD231E508C49008892A2 /* Example.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
BE24AD1B1E508C49008892A2 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0820;
ORGANIZATIONNAME = "Silver Fox";
TargetAttributes = {
BE24AD221E508C49008892A2 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 6G5LMQ72D8;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = BE24AD1E1E508C49008892A2 /* Build configuration list for PBXProject "Example" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = BE24AD1A1E508C49008892A2;
productRefGroup = BE24AD241E508C49008892A2 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
BE24AD221E508C49008892A2 /* Example */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
BE24AD211E508C49008892A2 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BE24AD311E508C49008892A2 /* LaunchScreen.storyboard in Resources */,
BE24AD2E1E508C49008892A2 /* Assets.xcassets in Resources */,
BE24AD2C1E508C49008892A2 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
BE24AD1F1E508C49008892A2 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BE24AD291E508C49008892A2 /* ViewController.swift in Sources */,
BE24AD271E508C49008892A2 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
BE24AD2A1E508C49008892A2 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
BE24AD2B1E508C49008892A2 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
BE24AD2F1E508C49008892A2 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
BE24AD301E508C49008892A2 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
BE24AD331E508C49008892A2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
BE24AD341E508C49008892A2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
BE24AD361E508C49008892A2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 6G5LMQ72D8;
INFOPLIST_FILE = Example/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = be.silverfox.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
BE24AD371E508C49008892A2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 6G5LMQ72D8;
INFOPLIST_FILE = Example/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = be.silverfox.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
BE24AD1E1E508C49008892A2 /* Build configuration list for PBXProject "Example" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BE24AD331E508C49008892A2 /* Debug */,
BE24AD341E508C49008892A2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
BE24AD351E508C49008892A2 /* Build configuration list for PBXNativeTarget "Example" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BE24AD361E508C49008892A2 /* Debug */,
BE24AD371E508C49008892A2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = BE24AD1B1E508C49008892A2 /* Project object */;
}

View File

@ -0,0 +1,46 @@
//
// AppDelegate.swift
// Example
//
// Created by Louis D'hauwe on 12/02/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
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}

View File

@ -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"
}
}

View 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>

View 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>

View 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>

View File

@ -0,0 +1,64 @@
//
// ViewController.swift
// Example
//
// Created by Louis D'hauwe on 12/02/2017.
// Copyright © 2017 Silver Fox. All rights reserved.
//
import UIKit
import PanelKit
class ViewController: UIViewController, PanelManager {
@IBOutlet weak var contentWrapperView: UIView!
@IBOutlet weak var contentView: UIView!
@IBOutlet weak var privatePanelPinnedPreviewView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
// MARK: PanelManager
var panelContentWrapperView: UIView {
return contentWrapperView
}
var panelContentView: UIView {
return contentView
}
var panelPinnedPreviewView: UIView? {
get {
return privatePanelPinnedPreviewView
}
set {
privatePanelPinnedPreviewView = newValue
}
}
var panels: [PanelViewController?] {
return []
}
var allowFloatingPanels: Bool {
return self.view.bounds.width > 800
}
var allowPanelPinning: Bool {
return self.view.bounds.width > 800
}
func didUpdatePinnedPanels() {
}
func enablePanelShadow(for panel: PanelViewController) -> Bool {
return true
}
}

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Example/Example.xcodeproj">
</FileRef>
<FileRef
location = "group:PanelKit.xcodeproj">
</FileRef>
</Workspace>

View File

@ -8,14 +8,14 @@
import UIKit
@objc protocol PanelContentViewControllerDelegate {
@objc public protocol PanelContentViewControllerDelegate {
func didToggle(_ panel: PanelViewController)
}
/// Needs to be presented as root view controller in a PanelNavigationController instance
@objc class PanelContentViewController: UIViewController {
@objc public class PanelContentViewController: UIViewController {
private var prevTouch: CGPoint?
@objc weak var panelDelegate: PanelContentViewControllerDelegate?
@ -32,7 +32,7 @@ import UIKit
// Default is false
internal(set) var isShownAsPanel = false
override func viewDidLoad() {
override public func viewDidLoad() {
super.viewDidLoad()
NotificationCenter.default.addObserver(self, selector: #selector(willShowKeyboard(_ :)), name: .UIKeyboardWillShow, object: nil)
@ -42,12 +42,12 @@ import UIKit
}
override func viewWillAppear(_ animated: Bool) {
override public func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
}
override func viewDidAppear(_ animated: Bool) {
override public func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
}

View File

@ -9,7 +9,7 @@
import Foundation
import UIKit
protocol PanelsFullscreenTransitionDelegate {
public protocol PanelsFullscreenTransitionDelegate {
func panelsPrepareMoveOffScreen()
func panelsPrepareMoveOnScreen()
@ -24,7 +24,7 @@ protocol PanelsFullscreenTransitionDelegate {
// MARK: -
protocol PanelManager: PanelViewControllerDelegate, PanelsFullscreenTransitionDelegate {
public protocol PanelManager: PanelViewControllerDelegate, PanelsFullscreenTransitionDelegate {
var panels: [PanelViewController?] { get }
@ -44,7 +44,7 @@ protocol PanelManager: PanelViewControllerDelegate, PanelsFullscreenTransitionDe
// MARK: -
extension PanelManager where Self: UIViewController {
public extension PanelManager where Self: UIViewController {
func closeAllPanels() {
@ -182,7 +182,7 @@ extension PanelManager where Self: UIViewController {
// MARK: -
extension PanelManager where Self: UIViewController {
public extension PanelManager where Self: UIViewController {
func didDragFree(_ panel: PanelViewController) {
@ -344,7 +344,7 @@ extension PanelManager where Self: UIViewController {
// MARK: -
extension PanelManager where Self: UIViewController {
public extension PanelManager where Self: UIViewController {
func panelsPrepareMoveOffScreen() {

View File

@ -8,7 +8,7 @@
import UIKit
@objc class PanelNavigationController: UINavigationController, UIGestureRecognizerDelegate {
@objc public class PanelNavigationController: UINavigationController, UIGestureRecognizerDelegate {
private var prevTouch: CGPoint?
weak var wrapperViewController: PanelViewController?
@ -16,7 +16,7 @@ import UIKit
/// Default is false
internal(set) var isShownAsPanel = false
override func viewDidLoad() {
override public func viewDidLoad() {
super.viewDidLoad()
let dragGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(dragOnBar(_ :)))
@ -34,7 +34,7 @@ import UIKit
print("deinit \(self)")
}
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
@ -151,7 +151,7 @@ import UIKit
}
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
override public func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
if !isShownAsPanel {
return
@ -178,14 +178,14 @@ import UIKit
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
override public func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
prevTouch = nil
wrapperViewController?.didEndDrag()
}
override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {
override public func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {
prevTouch = nil
wrapperViewController?.didEndDrag()

View File

@ -8,11 +8,11 @@
import Foundation
@objc enum PanelPinSide: Int, CustomStringConvertible {
@objc public enum PanelPinSide: Int, CustomStringConvertible {
case left
case right
var description: String {
public var description: String {
switch self {
case .left:
return "left"

View File

@ -8,7 +8,7 @@
import UIKit
protocol PanelViewControllerDelegate: class {
public protocol PanelViewControllerDelegate: class {
func didDrag(_ panel: PanelViewController, toEdgeOf side: PanelPinSide)
func didDragFree(_ panel: PanelViewController)
@ -22,7 +22,7 @@ protocol PanelViewControllerDelegate: class {
}
@objc class PanelViewController: UIViewController, UIAdaptivePresentationControllerDelegate {
@objc public class PanelViewController: UIViewController, UIAdaptivePresentationControllerDelegate {
// TODO: make internal?
@objc let panelNavigationController: PanelNavigationController
@ -91,18 +91,18 @@ protocol PanelViewControllerDelegate: class {
}
required init?(coder aDecoder: NSCoder) {
required public init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// MARK: -
override func viewDidLoad() {
override public func viewDidLoad() {
super.viewDidLoad()
}
override func viewWillAppear(_ animated: Bool) {
override public func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
contentViewController?.viewWillAppear(animated)
@ -110,7 +110,7 @@ protocol PanelViewControllerDelegate: class {
print("\(self) viewWillAppear")
}
override func viewDidAppear(_ animated: Bool) {
override public func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
contentViewController?.viewDidAppear(animated)
@ -118,12 +118,12 @@ protocol PanelViewControllerDelegate: class {
print("\(self) viewDidAppear")
}
override func viewWillLayoutSubviews() {
override public func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
}
override func viewDidLayoutSubviews() {
override public func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
if panelNavigationController.isShownAsPanel {
@ -367,13 +367,13 @@ protocol PanelViewControllerDelegate: class {
}
override var prefersStatusBarHidden: Bool {
override public var prefersStatusBarHidden: Bool {
// PanelViewController currently doesn't support status bar
// because it causes glitches when presented as a modal
return true
}
override var preferredStatusBarStyle: UIStatusBarStyle {
override public var preferredStatusBarStyle: UIStatusBarStyle {
if let contentViewController = contentViewController {
return contentViewController.preferredStatusBarStyle