Move Plugboard project into Enigma repo
This commit is contained in:
parent
00fbebcc1e
commit
77a6d5b299
8 changed files with 762 additions and 0 deletions
295
Plugboard.xcodeproj/project.pbxproj
Normal file
295
Plugboard.xcodeproj/project.pbxproj
Normal file
|
@ -0,0 +1,295 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
C0B915001B647D7400313376 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0B914FF1B647D7400313376 /* AppDelegate.swift */; };
|
||||
C0B915021B647D7400313376 /* PlugboardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0B915011B647D7400313376 /* PlugboardViewController.swift */; };
|
||||
C0B915051B647D7400313376 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C0B915031B647D7400313376 /* Main.storyboard */; };
|
||||
C0B915071B647D7400313376 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C0B915061B647D7400313376 /* Assets.xcassets */; };
|
||||
C0B9150A1B647D7400313376 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C0B915081B647D7400313376 /* LaunchScreen.storyboard */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
C0B914FC1B647D7400313376 /* Plugboard.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Plugboard.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C0B914FF1B647D7400313376 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
C0B915011B647D7400313376 /* PlugboardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlugboardViewController.swift; sourceTree = "<group>"; };
|
||||
C0B915041B647D7400313376 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
C0B915061B647D7400313376 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
C0B915091B647D7400313376 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
C0B9150B1B647D7400313376 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
C0B914F91B647D7400313376 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
C0B914F31B647D7400313376 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C0B914FE1B647D7400313376 /* Plugboard */,
|
||||
C0B914FD1B647D7400313376 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C0B914FD1B647D7400313376 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C0B914FC1B647D7400313376 /* Plugboard.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C0B914FE1B647D7400313376 /* Plugboard */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C0B914FF1B647D7400313376 /* AppDelegate.swift */,
|
||||
C0B915011B647D7400313376 /* PlugboardViewController.swift */,
|
||||
C0B915031B647D7400313376 /* Main.storyboard */,
|
||||
C0B915061B647D7400313376 /* Assets.xcassets */,
|
||||
C0B915081B647D7400313376 /* LaunchScreen.storyboard */,
|
||||
C0B9150B1B647D7400313376 /* Info.plist */,
|
||||
);
|
||||
path = Plugboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
C0B914FB1B647D7400313376 /* Plugboard */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = C0B9150E1B647D7400313376 /* Build configuration list for PBXNativeTarget "Plugboard" */;
|
||||
buildPhases = (
|
||||
C0B914F81B647D7400313376 /* Sources */,
|
||||
C0B914F91B647D7400313376 /* Frameworks */,
|
||||
C0B914FA1B647D7400313376 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Plugboard;
|
||||
productName = Plugboard;
|
||||
productReference = C0B914FC1B647D7400313376 /* Plugboard.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
C0B914F41B647D7400313376 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0700;
|
||||
ORGANIZATIONNAME = "Eryn Wells";
|
||||
TargetAttributes = {
|
||||
C0B914FB1B647D7400313376 = {
|
||||
CreatedOnToolsVersion = 7.0;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = C0B914F71B647D7400313376 /* Build configuration list for PBXProject "Plugboard" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = C0B914F31B647D7400313376;
|
||||
productRefGroup = C0B914FD1B647D7400313376 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
C0B914FB1B647D7400313376 /* Plugboard */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
C0B914FA1B647D7400313376 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C0B9150A1B647D7400313376 /* LaunchScreen.storyboard in Resources */,
|
||||
C0B915071B647D7400313376 /* Assets.xcassets in Resources */,
|
||||
C0B915051B647D7400313376 /* Main.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
C0B914F81B647D7400313376 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C0B915021B647D7400313376 /* PlugboardViewController.swift in Sources */,
|
||||
C0B915001B647D7400313376 /* AppDelegate.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
C0B915031B647D7400313376 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
C0B915041B647D7400313376 /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C0B915081B647D7400313376 /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
C0B915091B647D7400313376 /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
C0B9150C1B647D7400313376 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
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_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
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 = 9.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C0B9150D1B647D7400313376 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
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_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
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 = 9.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
C0B9150F1B647D7400313376 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
INFOPLIST_FILE = Plugboard/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ficustreesoftware.ios.Plugboard;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C0B915101B647D7400313376 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
INFOPLIST_FILE = Plugboard/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ficustreesoftware.ios.Plugboard;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
C0B914F71B647D7400313376 /* Build configuration list for PBXProject "Plugboard" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C0B9150C1B647D7400313376 /* Debug */,
|
||||
C0B9150D1B647D7400313376 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
C0B9150E1B647D7400313376 /* Build configuration list for PBXNativeTarget "Plugboard" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C0B9150F1B647D7400313376 /* Debug */,
|
||||
C0B915101B647D7400313376 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = C0B914F41B647D7400313376 /* Project object */;
|
||||
}
|
7
Plugboard.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
Plugboard.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:Plugboard.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
46
Plugboard/AppDelegate.swift
Normal file
46
Plugboard/AppDelegate.swift
Normal file
|
@ -0,0 +1,46 @@
|
|||
//
|
||||
// AppDelegate.swift
|
||||
// Plugboard
|
||||
//
|
||||
// Created by Eryn Wells on 7/25/15.
|
||||
// Copyright © 2015 Eryn Wells. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> 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 throttle down OpenGL ES frame rates. 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 inactive 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:.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
68
Plugboard/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal file
68
Plugboard/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal 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"
|
||||
}
|
||||
}
|
49
Plugboard/Base.lproj/LaunchScreen.storyboard
Normal file
49
Plugboard/Base.lproj/LaunchScreen.storyboard
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8076" systemVersion="14D121" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8063"/>
|
||||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
||||
</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="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright © 2015 Eryn Wells. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
|
||||
<rect key="frame" x="20" y="559" width="560" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Plugboard" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
|
||||
<rect key="frame" x="20" y="180" width="560" height="43"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
|
||||
<constraint firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
|
||||
<constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" constant="20" symbolic="YES" id="SfN-ll-jLj"/>
|
||||
<constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="20" id="Y44-ml-fuU"/>
|
||||
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
|
||||
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" constant="20" symbolic="YES" id="x7j-FC-K8j"/>
|
||||
</constraints>
|
||||
</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>
|
104
Plugboard/Base.lproj/Main.storyboard
Normal file
104
Plugboard/Base.lproj/Main.storyboard
Normal file
|
@ -0,0 +1,104 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8164.2" systemVersion="14E46" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="W0F-0W-RUo">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8135.1"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="yo4-EK-gOh">
|
||||
<objects>
|
||||
<viewController id="W0F-0W-RUo" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="UdN-Zv-OPM"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="9tK-vD-qBK"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="2ZE-Ui-rcr">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="v8N-9R-fP2">
|
||||
<rect key="frame" x="100" y="100" width="400" height="420"/>
|
||||
<connections>
|
||||
<segue destination="j7q-S3-Xi7" kind="embed" id="UgB-q1-YEm"/>
|
||||
</connections>
|
||||
</containerView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="v8N-9R-fP2" firstAttribute="leading" secondItem="2ZE-Ui-rcr" secondAttribute="leadingMargin" constant="80" id="KiE-1x-3Ut"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="v8N-9R-fP2" secondAttribute="trailing" constant="80" id="SlX-QB-Sgc"/>
|
||||
<constraint firstItem="v8N-9R-fP2" firstAttribute="top" secondItem="UdN-Zv-OPM" secondAttribute="bottom" constant="80" id="g6x-M2-oDZ"/>
|
||||
<constraint firstItem="9tK-vD-qBK" firstAttribute="top" secondItem="v8N-9R-fP2" secondAttribute="bottom" constant="80" id="vkC-dm-0m3"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="8tE-Vd-PHo" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="211" y="114"/>
|
||||
</scene>
|
||||
<!--Plugboard-->
|
||||
<scene sceneID="75j-VI-uYS">
|
||||
<objects>
|
||||
<collectionViewController title="Plugboard" id="j7q-S3-Xi7" customClass="PlugboardViewController" customModule="Plugboard" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<collectionView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" id="zWh-fk-F93">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="420"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="0.0" minimumInteritemSpacing="0.0" id="is8-C9-VQu">
|
||||
<size key="itemSize" width="50" height="50"/>
|
||||
<size key="headerReferenceSize" width="0.0" height="0.0"/>
|
||||
<size key="footerReferenceSize" width="0.0" height="0.0"/>
|
||||
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
</collectionViewFlowLayout>
|
||||
<cells>
|
||||
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="PlugCell" id="33f-rS-wUG" customClass="PlugCollectionViewCell" customModule="Plugboard" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
|
||||
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="A" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4W2-Tp-oUd">
|
||||
<rect key="frame" x="19" y="14" width="12" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailingMargin" relation="greaterThanOrEqual" secondItem="4W2-Tp-oUd" secondAttribute="trailing" id="Emw-8E-Pse"/>
|
||||
<constraint firstItem="4W2-Tp-oUd" firstAttribute="centerX" secondItem="33f-rS-wUG" secondAttribute="centerX" id="ifg-Y4-nBL"/>
|
||||
<constraint firstItem="4W2-Tp-oUd" firstAttribute="centerY" secondItem="33f-rS-wUG" secondAttribute="centerY" id="uJr-1D-Y5e"/>
|
||||
<constraint firstItem="4W2-Tp-oUd" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="33f-rS-wUG" secondAttribute="leadingMargin" id="ycD-kf-bvH"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="label" destination="4W2-Tp-oUd" id="I75-Rc-XC7"/>
|
||||
</connections>
|
||||
</collectionViewCell>
|
||||
</cells>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="j7q-S3-Xi7" id="dcg-Ms-6nw"/>
|
||||
<outlet property="delegate" destination="j7q-S3-Xi7" id="fg6-NK-6Cw"/>
|
||||
<outletCollection property="gestureRecognizers" destination="l6E-bd-IL3" appends="YES" id="0dk-vx-rog"/>
|
||||
</connections>
|
||||
</collectionView>
|
||||
<connections>
|
||||
<outlet property="collectionView" destination="zWh-fk-F93" id="xKW-Ez-UCG"/>
|
||||
<outlet property="panGestureRecognizer" destination="l6E-bd-IL3" id="6Tz-eZ-wZH"/>
|
||||
</connections>
|
||||
</collectionViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="MW1-LN-9Lf" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
<panGestureRecognizer minimumNumberOfTouches="1" id="l6E-bd-IL3">
|
||||
<connections>
|
||||
<action selector="connectPlugsPanGesture:" destination="j7q-S3-Xi7" id="0QL-8h-Yoq"/>
|
||||
</connections>
|
||||
</panGestureRecognizer>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="965" y="-444"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
46
Plugboard/Info.plist
Normal file
46
Plugboard/Info.plist
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?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>CFBundleSignature</key>
|
||||
<string>????</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>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>
|
147
Plugboard/PlugboardViewController.swift
Normal file
147
Plugboard/PlugboardViewController.swift
Normal file
|
@ -0,0 +1,147 @@
|
|||
//
|
||||
// PlugboardViewController.swift
|
||||
// Plugboard
|
||||
//
|
||||
// Created by Eryn Wells on 7/25/15.
|
||||
// Copyright © 2015 Eryn Wells. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class PlugboardViewController: UICollectionViewController, UICollectionViewDelegateFlowLayout {
|
||||
var alphabet: [Character]? = nil {
|
||||
didSet {
|
||||
collectionView?.collectionViewLayout.invalidateLayout()
|
||||
}
|
||||
}
|
||||
|
||||
@IBOutlet var panGestureRecognizer: UIPanGestureRecognizer!
|
||||
private var plugViews: [PlugLineView] = []
|
||||
|
||||
convenience init(alphabet: [Character]) {
|
||||
self.init(nibName: nil, bundle: nil)
|
||||
self.alphabet = alphabet
|
||||
}
|
||||
|
||||
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
|
||||
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
|
||||
alphabet = Array("ABCDEFGHIJKLMNOPQRSTUVWXYZ".characters)
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
alphabet = Array("ABCDEFGHIJKLMNOPQRSTUVWXYZ".characters)
|
||||
}
|
||||
|
||||
@IBAction func connectPlugsPanGesture(recognizer: UIPanGestureRecognizer) {
|
||||
switch recognizer.state {
|
||||
case .Began:
|
||||
let plugView = PlugLineView(frame: view.bounds)
|
||||
view.addSubview(plugView)
|
||||
plugViews.append(plugView)
|
||||
case .Changed:
|
||||
break
|
||||
case .Ended:
|
||||
break
|
||||
case .Failed:
|
||||
break
|
||||
case .Cancelled:
|
||||
print("drag cancelled")
|
||||
case .Possible:
|
||||
print("drag possible")
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - UICollectionViewDataSource
|
||||
|
||||
override func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
if let alphabet = alphabet {
|
||||
return alphabet.count
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(PlugCollectionViewCell.reuseIdentifier, forIndexPath: indexPath)
|
||||
if let plugCell = cell as? PlugCollectionViewCell, alphabet = alphabet {
|
||||
plugCell.label.text = String(alphabet[indexPath.row])
|
||||
}
|
||||
return cell
|
||||
}
|
||||
|
||||
// MARK: - UICollectionViewDelegateFlowLayout
|
||||
|
||||
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAtIndex section: Int) -> UIEdgeInsets {
|
||||
if let size = sizeOfCellInCollectionView(collectionView) {
|
||||
let lineSpacing = self.collectionView(collectionView, layout: collectionViewLayout, minimumLineSpacingForSectionAtIndex: section)
|
||||
let verticalInset = CGFloat(collectionView.bounds.height - lineSpacing - size.height * 2) / 2.0
|
||||
return UIEdgeInsets(top: verticalInset, left: 0.0, bottom: verticalInset, right: 0.0)
|
||||
}
|
||||
return UIEdgeInsets()
|
||||
}
|
||||
|
||||
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
|
||||
if let size = sizeOfCellInCollectionView(collectionView) {
|
||||
return size
|
||||
}
|
||||
return CGSize()
|
||||
}
|
||||
|
||||
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAtIndex section: Int) -> CGFloat {
|
||||
if sizeOfCellInCollectionView(collectionView) != nil {
|
||||
return 10
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
private func sizeOfCellInCollectionView(collectionView: UICollectionView) -> CGSize? {
|
||||
if let alphabet = alphabet {
|
||||
if alphabet.count == 0 {
|
||||
return nil
|
||||
}
|
||||
let columns = CGFloat(ceil(Double(alphabet.count) / 2.0))
|
||||
let size = floor(collectionView.bounds.width / columns)
|
||||
return CGSize(width: size, height: size)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class PlugCollectionViewCell: UICollectionViewCell {
|
||||
static let reuseIdentifier = "PlugCell"
|
||||
@IBOutlet weak var label: UILabel!
|
||||
}
|
||||
|
||||
|
||||
class PlugLineView: UIView {
|
||||
var startPoint: CGPoint?
|
||||
var endPoint: CGPoint?
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
initCommon()
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
initCommon()
|
||||
}
|
||||
|
||||
private func initCommon() {
|
||||
opaque = false
|
||||
backgroundColor = UIColor.clearColor()
|
||||
}
|
||||
|
||||
override func drawRect(rect: CGRect) {
|
||||
if let startPoint = startPoint, endPoint = endPoint {
|
||||
let path = UIBezierPath()
|
||||
path.moveToPoint(startPoint)
|
||||
path.addLineToPoint(endPoint)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue