Skip to content

Commit

Permalink
Add Swift target
Browse files Browse the repository at this point in the history
  • Loading branch information
kharrison committed Jun 10, 2015
1 parent 772a59a commit 0601b77
Show file tree
Hide file tree
Showing 10 changed files with 555 additions and 4 deletions.
137 changes: 137 additions & 0 deletions Designable/Designable.xcodeproj/project.pbxproj
Expand Up @@ -14,6 +14,12 @@
538022021B20EC3900434436 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 538022001B20EC3900434436 /* Main.storyboard */; };
538022041B20EC3900434436 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 538022031B20EC3900434436 /* Images.xcassets */; };
538022071B20EC3900434436 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 538022051B20EC3900434436 /* LaunchScreen.xib */; };
53C515ED1B2786EE0062905B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53C515EC1B2786EE0062905B /* AppDelegate.swift */; };
53C515F21B2786EE0062905B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 53C515F01B2786EE0062905B /* Main.storyboard */; };
53C515F41B2786EE0062905B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 53C515F31B2786EE0062905B /* Images.xcassets */; };
53C515F71B2786EE0062905B /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 53C515F51B2786EE0062905B /* LaunchScreen.xib */; };
53C5160B1B2788110062905B /* LevelViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53C5160A1B2788110062905B /* LevelViewController.swift */; };
53C5160D1B2789A40062905B /* LevelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53C5160C1B2789A40062905B /* LevelView.swift */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -43,6 +49,14 @@
538022011B20EC3900434436 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
538022031B20EC3900434436 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
538022061B20EC3900434436 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
53C515E81B2786ED0062905B /* DesignableSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DesignableSwift.app; sourceTree = BUILT_PRODUCTS_DIR; };
53C515EB1B2786EE0062905B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
53C515EC1B2786EE0062905B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
53C515F11B2786EE0062905B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
53C515F31B2786EE0062905B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
53C515F61B2786EE0062905B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
53C5160A1B2788110062905B /* LevelViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LevelViewController.swift; sourceTree = "<group>"; };
53C5160C1B2789A40062905B /* LevelView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LevelView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -53,6 +67,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
53C515E51B2786ED0062905B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
Expand All @@ -61,6 +82,7 @@
children = (
5321CAA61B26506100CE5924 /* README */,
538021F51B20EC3900434436 /* Designable */,
53C515E91B2786EE0062905B /* DesignableSwift */,
538021F41B20EC3900434436 /* Products */,
);
sourceTree = "<group>";
Expand All @@ -69,6 +91,7 @@
isa = PBXGroup;
children = (
538021F31B20EC3900434436 /* Designable.app */,
53C515E81B2786ED0062905B /* DesignableSwift.app */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -99,6 +122,28 @@
name = "Supporting Files";
sourceTree = "<group>";
};
53C515E91B2786EE0062905B /* DesignableSwift */ = {
isa = PBXGroup;
children = (
53C5160C1B2789A40062905B /* LevelView.swift */,
53C5160A1B2788110062905B /* LevelViewController.swift */,
53C515F01B2786EE0062905B /* Main.storyboard */,
53C515EA1B2786EE0062905B /* Supporting Files */,
);
path = DesignableSwift;
sourceTree = "<group>";
};
53C515EA1B2786EE0062905B /* Supporting Files */ = {
isa = PBXGroup;
children = (
53C515F51B2786EE0062905B /* LaunchScreen.xib */,
53C515F31B2786EE0062905B /* Images.xcassets */,
53C515EC1B2786EE0062905B /* AppDelegate.swift */,
53C515EB1B2786EE0062905B /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -120,18 +165,39 @@
productReference = 538021F31B20EC3900434436 /* Designable.app */;
productType = "com.apple.product-type.application";
};
53C515E71B2786ED0062905B /* DesignableSwift */ = {
isa = PBXNativeTarget;
buildConfigurationList = 53C516081B2786EE0062905B /* Build configuration list for PBXNativeTarget "DesignableSwift" */;
buildPhases = (
53C515E41B2786ED0062905B /* Sources */,
53C515E51B2786ED0062905B /* Frameworks */,
53C515E61B2786ED0062905B /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = DesignableSwift;
productName = DesignableSwift;
productReference = 53C515E81B2786ED0062905B /* DesignableSwift.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
538021EB1B20EC3900434436 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0630;
ORGANIZATIONNAME = "Keith Harrison";
TargetAttributes = {
538021F21B20EC3900434436 = {
CreatedOnToolsVersion = 6.3.2;
};
53C515E71B2786ED0062905B = {
CreatedOnToolsVersion = 6.3.2;
};
};
};
buildConfigurationList = 538021EE1B20EC3900434436 /* Build configuration list for PBXProject "Designable" */;
Expand All @@ -148,6 +214,7 @@
projectRoot = "";
targets = (
538021F21B20EC3900434436 /* Designable */,
53C515E71B2786ED0062905B /* DesignableSwift */,
);
};
/* End PBXProject section */
Expand All @@ -163,6 +230,16 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
53C515E61B2786ED0062905B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
53C515F21B2786EE0062905B /* Main.storyboard in Resources */,
53C515F71B2786EE0062905B /* LaunchScreen.xib in Resources */,
53C515F41B2786EE0062905B /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand All @@ -177,6 +254,16 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
53C515E41B2786ED0062905B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
53C515ED1B2786EE0062905B /* AppDelegate.swift in Sources */,
53C5160D1B2789A40062905B /* LevelView.swift in Sources */,
53C5160B1B2788110062905B /* LevelViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
Expand All @@ -196,6 +283,22 @@
name = LaunchScreen.xib;
sourceTree = "<group>";
};
53C515F01B2786EE0062905B /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
53C515F11B2786EE0062905B /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
53C515F51B2786EE0062905B /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
53C515F61B2786EE0062905B /* Base */,
);
name = LaunchScreen.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
Expand Down Expand Up @@ -301,6 +404,31 @@
};
name = Release;
};
53C516041B2786EE0062905B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = DesignableSwift/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
53C516051B2786EE0062905B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = DesignableSwift/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
Expand All @@ -322,6 +450,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
53C516081B2786EE0062905B /* Build configuration list for PBXNativeTarget "DesignableSwift" */ = {
isa = XCConfigurationList;
buildConfigurations = (
53C516041B2786EE0062905B /* Debug */,
53C516051B2786EE0062905B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 538021EB1B20EC3900434436 /* Project object */;
Expand Down
8 changes: 4 additions & 4 deletions Designable/Designable/LevelView.m
Expand Up @@ -41,6 +41,10 @@ @interface LevelView ()
@implementation LevelView

- (void)setupDefaults {
if (self.barLayer == nil) {
self.barLayer = [CAShapeLayer layer];
[self.layer addSublayer:self.barLayer];
}
self.value = 1.0f;
self.threshold = 0.3f;
self.borderWidth = 2.0f;
Expand Down Expand Up @@ -69,10 +73,6 @@ - (instancetype)initWithCoder:(NSCoder *)coder

- (void)layoutSubviews {
[super layoutSubviews];
if (self.barLayer == nil) {
self.barLayer = [CAShapeLayer layer];
[self.layer addSublayer:self.barLayer];
}
[self updateLayerProperties];
}

Expand Down
12 changes: 12 additions & 0 deletions Designable/DesignableSwift/AppDelegate.swift
@@ -0,0 +1,12 @@
//
// AppDelegate.swift
// DesignableSwift
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
}

41 changes: 41 additions & 0 deletions Designable/DesignableSwift/Base.lproj/LaunchScreen.xib
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 Keith Harrison. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="DesignableSwift" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="548" y="455"/>
</view>
</objects>
</document>
61 changes: 61 additions & 0 deletions Designable/DesignableSwift/Base.lproj/Main.storyboard
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="tSH-PG-yq0">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
<!--Level View Controller-->
<scene sceneID="DMX-Ud-Dnr">
<objects>
<viewController id="tSH-PG-yq0" customClass="LevelViewController" customModule="DesignableSwift" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="bgz-eM-WuN"/>
<viewControllerLayoutGuide type="bottom" id="se1-kV-R9n"/>
</layoutGuides>
<view key="view" contentMode="redraw" id="IMd-N4-LNH">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Power Level" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eb8-Vi-ovw">
<rect key="frame" x="254" y="260" width="92" height="20"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="04p-xx-gU4" customClass="LevelView" customModule="DesignableSwift" customModuleProvider="target">
<rect key="frame" x="16" y="288" width="568" height="24"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="24" id="hSg-0u-Wev"/>
</constraints>
</view>
<stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" maximumValue="1" stepValue="0.10000000000000001" translatesAutoresizingMaskIntoConstraints="NO" id="dgT-EZ-aS6">
<rect key="frame" x="253" y="320" width="94" height="29"/>
<connections>
<action selector="valueChanged:" destination="tSH-PG-yq0" eventType="valueChanged" id="Rs3-f5-cNC"/>
</connections>
</stepper>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="dgT-EZ-aS6" firstAttribute="top" secondItem="04p-xx-gU4" secondAttribute="bottom" constant="8" symbolic="YES" id="6Fo-nV-hbN"/>
<constraint firstItem="04p-xx-gU4" firstAttribute="leading" secondItem="IMd-N4-LNH" secondAttribute="leadingMargin" id="G33-N0-ldb"/>
<constraint firstItem="04p-xx-gU4" firstAttribute="centerX" secondItem="eb8-Vi-ovw" secondAttribute="centerX" id="Ldt-se-A0c"/>
<constraint firstItem="04p-xx-gU4" firstAttribute="top" secondItem="eb8-Vi-ovw" secondAttribute="bottom" constant="8" symbolic="YES" id="Pta-Tv-FHW"/>
<constraint firstItem="04p-xx-gU4" firstAttribute="trailing" secondItem="IMd-N4-LNH" secondAttribute="trailingMargin" id="Slf-t7-RcS"/>
<constraint firstItem="04p-xx-gU4" firstAttribute="centerX" secondItem="dgT-EZ-aS6" secondAttribute="centerX" id="cOx-YQ-xub"/>
<constraint firstAttribute="centerY" secondItem="04p-xx-gU4" secondAttribute="centerY" id="i5Z-gn-Vp0"/>
</constraints>
</view>
<connections>
<outlet property="levelView" destination="04p-xx-gU4" id="MxM-lu-uZf"/>
<outlet property="stepper" destination="dgT-EZ-aS6" id="DXh-dU-n1o"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="AVj-88-FVS" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="478" y="423"/>
</scene>
</scenes>
</document>

0 comments on commit 0601b77

Please sign in to comment.