Skip to content

Commit cab7292

Browse files
committed
new type erasure example
1 parent 55bc811 commit cab7292

File tree

7 files changed

+566
-0
lines changed

7 files changed

+566
-0
lines changed
Lines changed: 293 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,293 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 46;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
81ADAB351C91E1CF0066C683 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81ADAB341C91E1CF0066C683 /* AppDelegate.swift */; };
11+
81ADAB371C91E1CF0066C683 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81ADAB361C91E1CF0066C683 /* ViewController.swift */; };
12+
81ADAB3A1C91E1CF0066C683 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81ADAB381C91E1CF0066C683 /* Main.storyboard */; };
13+
81ADAB3C1C91E1CF0066C683 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 81ADAB3B1C91E1CF0066C683 /* Assets.xcassets */; };
14+
81ADAB3F1C91E1CF0066C683 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81ADAB3D1C91E1CF0066C683 /* LaunchScreen.storyboard */; };
15+
/* End PBXBuildFile section */
16+
17+
/* Begin PBXFileReference section */
18+
81ADAB311C91E1CF0066C683 /* TypeErasure.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TypeErasure.app; sourceTree = BUILT_PRODUCTS_DIR; };
19+
81ADAB341C91E1CF0066C683 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
20+
81ADAB361C91E1CF0066C683 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
21+
81ADAB391C91E1CF0066C683 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
22+
81ADAB3B1C91E1CF0066C683 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
23+
81ADAB3E1C91E1CF0066C683 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
24+
81ADAB401C91E1CF0066C683 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
25+
/* End PBXFileReference section */
26+
27+
/* Begin PBXFrameworksBuildPhase section */
28+
81ADAB2E1C91E1CF0066C683 /* Frameworks */ = {
29+
isa = PBXFrameworksBuildPhase;
30+
buildActionMask = 2147483647;
31+
files = (
32+
);
33+
runOnlyForDeploymentPostprocessing = 0;
34+
};
35+
/* End PBXFrameworksBuildPhase section */
36+
37+
/* Begin PBXGroup section */
38+
81ADAB281C91E1CF0066C683 = {
39+
isa = PBXGroup;
40+
children = (
41+
81ADAB331C91E1CF0066C683 /* TypeErasure */,
42+
81ADAB321C91E1CF0066C683 /* Products */,
43+
);
44+
sourceTree = "<group>";
45+
};
46+
81ADAB321C91E1CF0066C683 /* Products */ = {
47+
isa = PBXGroup;
48+
children = (
49+
81ADAB311C91E1CF0066C683 /* TypeErasure.app */,
50+
);
51+
name = Products;
52+
sourceTree = "<group>";
53+
};
54+
81ADAB331C91E1CF0066C683 /* TypeErasure */ = {
55+
isa = PBXGroup;
56+
children = (
57+
81ADAB341C91E1CF0066C683 /* AppDelegate.swift */,
58+
81ADAB361C91E1CF0066C683 /* ViewController.swift */,
59+
81ADAB381C91E1CF0066C683 /* Main.storyboard */,
60+
81ADAB3B1C91E1CF0066C683 /* Assets.xcassets */,
61+
81ADAB3D1C91E1CF0066C683 /* LaunchScreen.storyboard */,
62+
81ADAB401C91E1CF0066C683 /* Info.plist */,
63+
);
64+
path = TypeErasure;
65+
sourceTree = "<group>";
66+
};
67+
/* End PBXGroup section */
68+
69+
/* Begin PBXNativeTarget section */
70+
81ADAB301C91E1CF0066C683 /* TypeErasure */ = {
71+
isa = PBXNativeTarget;
72+
buildConfigurationList = 81ADAB431C91E1CF0066C683 /* Build configuration list for PBXNativeTarget "TypeErasure" */;
73+
buildPhases = (
74+
81ADAB2D1C91E1CF0066C683 /* Sources */,
75+
81ADAB2E1C91E1CF0066C683 /* Frameworks */,
76+
81ADAB2F1C91E1CF0066C683 /* Resources */,
77+
);
78+
buildRules = (
79+
);
80+
dependencies = (
81+
);
82+
name = TypeErasure;
83+
productName = TypeErasure;
84+
productReference = 81ADAB311C91E1CF0066C683 /* TypeErasure.app */;
85+
productType = "com.apple.product-type.application";
86+
};
87+
/* End PBXNativeTarget section */
88+
89+
/* Begin PBXProject section */
90+
81ADAB291C91E1CF0066C683 /* Project object */ = {
91+
isa = PBXProject;
92+
attributes = {
93+
LastSwiftUpdateCheck = 0730;
94+
LastUpgradeCheck = 0730;
95+
ORGANIZATIONNAME = "Matt Neuburg";
96+
TargetAttributes = {
97+
81ADAB301C91E1CF0066C683 = {
98+
CreatedOnToolsVersion = 7.3;
99+
};
100+
};
101+
};
102+
buildConfigurationList = 81ADAB2C1C91E1CF0066C683 /* Build configuration list for PBXProject "TypeErasure" */;
103+
compatibilityVersion = "Xcode 3.2";
104+
developmentRegion = English;
105+
hasScannedForEncodings = 0;
106+
knownRegions = (
107+
en,
108+
Base,
109+
);
110+
mainGroup = 81ADAB281C91E1CF0066C683;
111+
productRefGroup = 81ADAB321C91E1CF0066C683 /* Products */;
112+
projectDirPath = "";
113+
projectRoot = "";
114+
targets = (
115+
81ADAB301C91E1CF0066C683 /* TypeErasure */,
116+
);
117+
};
118+
/* End PBXProject section */
119+
120+
/* Begin PBXResourcesBuildPhase section */
121+
81ADAB2F1C91E1CF0066C683 /* Resources */ = {
122+
isa = PBXResourcesBuildPhase;
123+
buildActionMask = 2147483647;
124+
files = (
125+
81ADAB3F1C91E1CF0066C683 /* LaunchScreen.storyboard in Resources */,
126+
81ADAB3C1C91E1CF0066C683 /* Assets.xcassets in Resources */,
127+
81ADAB3A1C91E1CF0066C683 /* Main.storyboard in Resources */,
128+
);
129+
runOnlyForDeploymentPostprocessing = 0;
130+
};
131+
/* End PBXResourcesBuildPhase section */
132+
133+
/* Begin PBXSourcesBuildPhase section */
134+
81ADAB2D1C91E1CF0066C683 /* Sources */ = {
135+
isa = PBXSourcesBuildPhase;
136+
buildActionMask = 2147483647;
137+
files = (
138+
81ADAB371C91E1CF0066C683 /* ViewController.swift in Sources */,
139+
81ADAB351C91E1CF0066C683 /* AppDelegate.swift in Sources */,
140+
);
141+
runOnlyForDeploymentPostprocessing = 0;
142+
};
143+
/* End PBXSourcesBuildPhase section */
144+
145+
/* Begin PBXVariantGroup section */
146+
81ADAB381C91E1CF0066C683 /* Main.storyboard */ = {
147+
isa = PBXVariantGroup;
148+
children = (
149+
81ADAB391C91E1CF0066C683 /* Base */,
150+
);
151+
name = Main.storyboard;
152+
sourceTree = "<group>";
153+
};
154+
81ADAB3D1C91E1CF0066C683 /* LaunchScreen.storyboard */ = {
155+
isa = PBXVariantGroup;
156+
children = (
157+
81ADAB3E1C91E1CF0066C683 /* Base */,
158+
);
159+
name = LaunchScreen.storyboard;
160+
sourceTree = "<group>";
161+
};
162+
/* End PBXVariantGroup section */
163+
164+
/* Begin XCBuildConfiguration section */
165+
81ADAB411C91E1CF0066C683 /* Debug */ = {
166+
isa = XCBuildConfiguration;
167+
buildSettings = {
168+
ALWAYS_SEARCH_USER_PATHS = NO;
169+
CLANG_ANALYZER_NONNULL = YES;
170+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
171+
CLANG_CXX_LIBRARY = "libc++";
172+
CLANG_ENABLE_MODULES = YES;
173+
CLANG_ENABLE_OBJC_ARC = YES;
174+
CLANG_WARN_BOOL_CONVERSION = YES;
175+
CLANG_WARN_CONSTANT_CONVERSION = YES;
176+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
177+
CLANG_WARN_EMPTY_BODY = YES;
178+
CLANG_WARN_ENUM_CONVERSION = YES;
179+
CLANG_WARN_INT_CONVERSION = YES;
180+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
181+
CLANG_WARN_UNREACHABLE_CODE = YES;
182+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
183+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
184+
COPY_PHASE_STRIP = NO;
185+
DEBUG_INFORMATION_FORMAT = dwarf;
186+
ENABLE_STRICT_OBJC_MSGSEND = YES;
187+
ENABLE_TESTABILITY = YES;
188+
GCC_C_LANGUAGE_STANDARD = gnu99;
189+
GCC_DYNAMIC_NO_PIC = NO;
190+
GCC_NO_COMMON_BLOCKS = YES;
191+
GCC_OPTIMIZATION_LEVEL = 0;
192+
GCC_PREPROCESSOR_DEFINITIONS = (
193+
"DEBUG=1",
194+
"$(inherited)",
195+
);
196+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
197+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
198+
GCC_WARN_UNDECLARED_SELECTOR = YES;
199+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
200+
GCC_WARN_UNUSED_FUNCTION = YES;
201+
GCC_WARN_UNUSED_VARIABLE = YES;
202+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
203+
MTL_ENABLE_DEBUG_INFO = YES;
204+
ONLY_ACTIVE_ARCH = YES;
205+
SDKROOT = iphoneos;
206+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
207+
};
208+
name = Debug;
209+
};
210+
81ADAB421C91E1CF0066C683 /* Release */ = {
211+
isa = XCBuildConfiguration;
212+
buildSettings = {
213+
ALWAYS_SEARCH_USER_PATHS = NO;
214+
CLANG_ANALYZER_NONNULL = YES;
215+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
216+
CLANG_CXX_LIBRARY = "libc++";
217+
CLANG_ENABLE_MODULES = YES;
218+
CLANG_ENABLE_OBJC_ARC = YES;
219+
CLANG_WARN_BOOL_CONVERSION = YES;
220+
CLANG_WARN_CONSTANT_CONVERSION = YES;
221+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
222+
CLANG_WARN_EMPTY_BODY = YES;
223+
CLANG_WARN_ENUM_CONVERSION = YES;
224+
CLANG_WARN_INT_CONVERSION = YES;
225+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
226+
CLANG_WARN_UNREACHABLE_CODE = YES;
227+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
228+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
229+
COPY_PHASE_STRIP = NO;
230+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
231+
ENABLE_NS_ASSERTIONS = NO;
232+
ENABLE_STRICT_OBJC_MSGSEND = YES;
233+
GCC_C_LANGUAGE_STANDARD = gnu99;
234+
GCC_NO_COMMON_BLOCKS = YES;
235+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
236+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
237+
GCC_WARN_UNDECLARED_SELECTOR = YES;
238+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
239+
GCC_WARN_UNUSED_FUNCTION = YES;
240+
GCC_WARN_UNUSED_VARIABLE = YES;
241+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
242+
MTL_ENABLE_DEBUG_INFO = NO;
243+
SDKROOT = iphoneos;
244+
VALIDATE_PRODUCT = YES;
245+
};
246+
name = Release;
247+
};
248+
81ADAB441C91E1CF0066C683 /* Debug */ = {
249+
isa = XCBuildConfiguration;
250+
buildSettings = {
251+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
252+
INFOPLIST_FILE = TypeErasure/Info.plist;
253+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
254+
PRODUCT_BUNDLE_IDENTIFIER = com.neuburg.matt.TypeErasure;
255+
PRODUCT_NAME = "$(TARGET_NAME)";
256+
};
257+
name = Debug;
258+
};
259+
81ADAB451C91E1CF0066C683 /* Release */ = {
260+
isa = XCBuildConfiguration;
261+
buildSettings = {
262+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
263+
INFOPLIST_FILE = TypeErasure/Info.plist;
264+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
265+
PRODUCT_BUNDLE_IDENTIFIER = com.neuburg.matt.TypeErasure;
266+
PRODUCT_NAME = "$(TARGET_NAME)";
267+
};
268+
name = Release;
269+
};
270+
/* End XCBuildConfiguration section */
271+
272+
/* Begin XCConfigurationList section */
273+
81ADAB2C1C91E1CF0066C683 /* Build configuration list for PBXProject "TypeErasure" */ = {
274+
isa = XCConfigurationList;
275+
buildConfigurations = (
276+
81ADAB411C91E1CF0066C683 /* Debug */,
277+
81ADAB421C91E1CF0066C683 /* Release */,
278+
);
279+
defaultConfigurationIsVisible = 0;
280+
defaultConfigurationName = Release;
281+
};
282+
81ADAB431C91E1CF0066C683 /* Build configuration list for PBXNativeTarget "TypeErasure" */ = {
283+
isa = XCConfigurationList;
284+
buildConfigurations = (
285+
81ADAB441C91E1CF0066C683 /* Debug */,
286+
81ADAB451C91E1CF0066C683 /* Release */,
287+
);
288+
defaultConfigurationIsVisible = 0;
289+
};
290+
/* End XCConfigurationList section */
291+
};
292+
rootObject = 81ADAB291C91E1CF0066C683 /* Project object */;
293+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
3+
import UIKit
4+
5+
@UIApplicationMain
6+
class AppDelegate: UIResponder, UIApplicationDelegate {
7+
8+
var window: UIWindow?
9+
10+
11+
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
12+
// Override point for customization after application launch.
13+
return true
14+
}
15+
16+
17+
18+
}
19+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "29x29",
6+
"scale" : "2x"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "29x29",
11+
"scale" : "3x"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"size" : "40x40",
16+
"scale" : "2x"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"size" : "40x40",
21+
"scale" : "3x"
22+
},
23+
{
24+
"idiom" : "iphone",
25+
"size" : "60x60",
26+
"scale" : "2x"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"size" : "60x60",
31+
"scale" : "3x"
32+
}
33+
],
34+
"info" : {
35+
"version" : 1,
36+
"author" : "xcode"
37+
}
38+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
5+
</dependencies>
6+
<scenes>
7+
<!--View Controller-->
8+
<scene sceneID="EHf-IW-A2E">
9+
<objects>
10+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
11+
<layoutGuides>
12+
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
13+
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
14+
</layoutGuides>
15+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
16+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
17+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18+
<animations/>
19+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
20+
</view>
21+
</viewController>
22+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
23+
</objects>
24+
<point key="canvasLocation" x="53" y="375"/>
25+
</scene>
26+
</scenes>
27+
</document>

0 commit comments

Comments
 (0)