Skip to content

Commit d16de83

Browse files
committed
ForceTouchCatalog: Version 1.2, 2016-09-28
Updated to Swift 3 Demonstrates how to use the Force Touch Trackpad APIs. This sample is divided into three levels of mastery through which you’ll learn how to process pressure events, perform spring loading, configure the trackpad, and perform feedback.
1 parent 2a92c00 commit d16de83

27 files changed

+3205
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,326 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 46;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
872E0FC01B11104B00F6E445 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 872E0FBF1B11104B00F6E445 /* AppDelegate.swift */; };
11+
872E0FC21B11104B00F6E445 /* SquireViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 872E0FC11B11104B00F6E445 /* SquireViewController.swift */; };
12+
872E0FC41B11104B00F6E445 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 872E0FC31B11104B00F6E445 /* Assets.xcassets */; };
13+
872E0FC71B11104B00F6E445 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 872E0FC51B11104B00F6E445 /* Main.storyboard */; };
14+
872E0FD31B11175900F6E445 /* Lola1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 872E0FCF1B11175900F6E445 /* Lola1.jpg */; };
15+
872E0FD41B11175900F6E445 /* Lola2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 872E0FD01B11175900F6E445 /* Lola2.jpg */; };
16+
872E0FD51B11175900F6E445 /* Lola3.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 872E0FD11B11175900F6E445 /* Lola3.jpg */; };
17+
872E0FD61B11175900F6E445 /* Lola4.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 872E0FD21B11175900F6E445 /* Lola4.jpg */; };
18+
872E0FD81B11263D00F6E445 /* KnightViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 872E0FD71B11263D00F6E445 /* KnightViewController.swift */; };
19+
872E0FDA1B11266C00F6E445 /* MasterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 872E0FD91B11266C00F6E445 /* MasterViewController.swift */; };
20+
87BACCC61B15689B00733551 /* DrawingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87BACCC51B15689B00733551 /* DrawingView.swift */; };
21+
/* End PBXBuildFile section */
22+
23+
/* Begin PBXFileReference section */
24+
3EB05B7C1B1B851A00AA6D78 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
25+
872E0FBC1B11104B00F6E445 /* ForceTouchCatalog.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ForceTouchCatalog.app; sourceTree = BUILT_PRODUCTS_DIR; };
26+
872E0FBF1B11104B00F6E445 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
27+
872E0FC11B11104B00F6E445 /* SquireViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SquireViewController.swift; sourceTree = "<group>"; };
28+
872E0FC31B11104B00F6E445 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
29+
872E0FC61B11104B00F6E445 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
30+
872E0FC81B11104B00F6E445 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
31+
872E0FCF1B11175900F6E445 /* Lola1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Lola1.jpg; sourceTree = "<group>"; };
32+
872E0FD01B11175900F6E445 /* Lola2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Lola2.jpg; sourceTree = "<group>"; };
33+
872E0FD11B11175900F6E445 /* Lola3.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Lola3.jpg; sourceTree = "<group>"; };
34+
872E0FD21B11175900F6E445 /* Lola4.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Lola4.jpg; sourceTree = "<group>"; };
35+
872E0FD71B11263D00F6E445 /* KnightViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KnightViewController.swift; sourceTree = "<group>"; };
36+
872E0FD91B11266C00F6E445 /* MasterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterViewController.swift; sourceTree = "<group>"; };
37+
87BACCC51B15689B00733551 /* DrawingView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DrawingView.swift; sourceTree = "<group>"; };
38+
/* End PBXFileReference section */
39+
40+
/* Begin PBXFrameworksBuildPhase section */
41+
872E0FB91B11104B00F6E445 /* Frameworks */ = {
42+
isa = PBXFrameworksBuildPhase;
43+
buildActionMask = 2147483647;
44+
files = (
45+
);
46+
runOnlyForDeploymentPostprocessing = 0;
47+
};
48+
/* End PBXFrameworksBuildPhase section */
49+
50+
/* Begin PBXGroup section */
51+
872E0FB31B11104B00F6E445 = {
52+
isa = PBXGroup;
53+
children = (
54+
3EB05B7C1B1B851A00AA6D78 /* README.md */,
55+
872E0FBE1B11104B00F6E445 /* ForceTouchCatalog */,
56+
872E0FBD1B11104B00F6E445 /* Products */,
57+
);
58+
sourceTree = "<group>";
59+
};
60+
872E0FBD1B11104B00F6E445 /* Products */ = {
61+
isa = PBXGroup;
62+
children = (
63+
872E0FBC1B11104B00F6E445 /* ForceTouchCatalog.app */,
64+
);
65+
name = Products;
66+
sourceTree = "<group>";
67+
};
68+
872E0FBE1B11104B00F6E445 /* ForceTouchCatalog */ = {
69+
isa = PBXGroup;
70+
children = (
71+
872E0FBF1B11104B00F6E445 /* AppDelegate.swift */,
72+
872E0FC11B11104B00F6E445 /* SquireViewController.swift */,
73+
872E0FD71B11263D00F6E445 /* KnightViewController.swift */,
74+
872E0FD91B11266C00F6E445 /* MasterViewController.swift */,
75+
87BACCC51B15689B00733551 /* DrawingView.swift */,
76+
872E0FC31B11104B00F6E445 /* Assets.xcassets */,
77+
872E0FC51B11104B00F6E445 /* Main.storyboard */,
78+
872E0FC81B11104B00F6E445 /* Info.plist */,
79+
872E0FCE1B11175900F6E445 /* Lola */,
80+
);
81+
path = ForceTouchCatalog;
82+
sourceTree = "<group>";
83+
};
84+
872E0FCE1B11175900F6E445 /* Lola */ = {
85+
isa = PBXGroup;
86+
children = (
87+
872E0FCF1B11175900F6E445 /* Lola1.jpg */,
88+
872E0FD01B11175900F6E445 /* Lola2.jpg */,
89+
872E0FD11B11175900F6E445 /* Lola3.jpg */,
90+
872E0FD21B11175900F6E445 /* Lola4.jpg */,
91+
);
92+
path = Lola;
93+
sourceTree = "<group>";
94+
};
95+
/* End PBXGroup section */
96+
97+
/* Begin PBXNativeTarget section */
98+
872E0FBB1B11104B00F6E445 /* ForceTouchCatalog */ = {
99+
isa = PBXNativeTarget;
100+
buildConfigurationList = 872E0FCB1B11104B00F6E445 /* Build configuration list for PBXNativeTarget "ForceTouchCatalog" */;
101+
buildPhases = (
102+
872E0FB81B11104B00F6E445 /* Sources */,
103+
872E0FB91B11104B00F6E445 /* Frameworks */,
104+
872E0FBA1B11104B00F6E445 /* Resources */,
105+
);
106+
buildRules = (
107+
);
108+
dependencies = (
109+
);
110+
name = ForceTouchCatalog;
111+
productName = ForceTouchCatalog;
112+
productReference = 872E0FBC1B11104B00F6E445 /* ForceTouchCatalog.app */;
113+
productType = "com.apple.product-type.application";
114+
};
115+
/* End PBXNativeTarget section */
116+
117+
/* Begin PBXProject section */
118+
872E0FB41B11104B00F6E445 /* Project object */ = {
119+
isa = PBXProject;
120+
attributes = {
121+
LastUpgradeCheck = 0800;
122+
ORGANIZATIONNAME = "Apple, Inc.";
123+
TargetAttributes = {
124+
872E0FBB1B11104B00F6E445 = {
125+
CreatedOnToolsVersion = 7.0;
126+
LastSwiftMigration = 0800;
127+
};
128+
};
129+
};
130+
buildConfigurationList = 872E0FB71B11104B00F6E445 /* Build configuration list for PBXProject "ForceTouchCatalog" */;
131+
compatibilityVersion = "Xcode 3.2";
132+
developmentRegion = English;
133+
hasScannedForEncodings = 0;
134+
knownRegions = (
135+
en,
136+
Base,
137+
);
138+
mainGroup = 872E0FB31B11104B00F6E445;
139+
productRefGroup = 872E0FBD1B11104B00F6E445 /* Products */;
140+
projectDirPath = "";
141+
projectRoot = "";
142+
targets = (
143+
872E0FBB1B11104B00F6E445 /* ForceTouchCatalog */,
144+
);
145+
};
146+
/* End PBXProject section */
147+
148+
/* Begin PBXResourcesBuildPhase section */
149+
872E0FBA1B11104B00F6E445 /* Resources */ = {
150+
isa = PBXResourcesBuildPhase;
151+
buildActionMask = 2147483647;
152+
files = (
153+
872E0FC41B11104B00F6E445 /* Assets.xcassets in Resources */,
154+
872E0FD51B11175900F6E445 /* Lola3.jpg in Resources */,
155+
872E0FD61B11175900F6E445 /* Lola4.jpg in Resources */,
156+
872E0FC71B11104B00F6E445 /* Main.storyboard in Resources */,
157+
872E0FD41B11175900F6E445 /* Lola2.jpg in Resources */,
158+
872E0FD31B11175900F6E445 /* Lola1.jpg in Resources */,
159+
);
160+
runOnlyForDeploymentPostprocessing = 0;
161+
};
162+
/* End PBXResourcesBuildPhase section */
163+
164+
/* Begin PBXSourcesBuildPhase section */
165+
872E0FB81B11104B00F6E445 /* Sources */ = {
166+
isa = PBXSourcesBuildPhase;
167+
buildActionMask = 2147483647;
168+
files = (
169+
872E0FDA1B11266C00F6E445 /* MasterViewController.swift in Sources */,
170+
872E0FD81B11263D00F6E445 /* KnightViewController.swift in Sources */,
171+
87BACCC61B15689B00733551 /* DrawingView.swift in Sources */,
172+
872E0FC21B11104B00F6E445 /* SquireViewController.swift in Sources */,
173+
872E0FC01B11104B00F6E445 /* AppDelegate.swift in Sources */,
174+
);
175+
runOnlyForDeploymentPostprocessing = 0;
176+
};
177+
/* End PBXSourcesBuildPhase section */
178+
179+
/* Begin PBXVariantGroup section */
180+
872E0FC51B11104B00F6E445 /* Main.storyboard */ = {
181+
isa = PBXVariantGroup;
182+
children = (
183+
872E0FC61B11104B00F6E445 /* Base */,
184+
);
185+
name = Main.storyboard;
186+
sourceTree = "<group>";
187+
};
188+
/* End PBXVariantGroup section */
189+
190+
/* Begin XCBuildConfiguration section */
191+
872E0FC91B11104B00F6E445 /* Debug */ = {
192+
isa = XCBuildConfiguration;
193+
buildSettings = {
194+
ALWAYS_SEARCH_USER_PATHS = NO;
195+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
196+
CLANG_CXX_LIBRARY = "libc++";
197+
CLANG_ENABLE_MODULES = YES;
198+
CLANG_ENABLE_OBJC_ARC = YES;
199+
CLANG_WARN_BOOL_CONVERSION = YES;
200+
CLANG_WARN_CONSTANT_CONVERSION = YES;
201+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
202+
CLANG_WARN_EMPTY_BODY = YES;
203+
CLANG_WARN_ENUM_CONVERSION = YES;
204+
CLANG_WARN_INFINITE_RECURSION = YES;
205+
CLANG_WARN_INT_CONVERSION = YES;
206+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
207+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
208+
CLANG_WARN_UNREACHABLE_CODE = YES;
209+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
210+
CODE_SIGN_IDENTITY = "-";
211+
COPY_PHASE_STRIP = NO;
212+
DEBUG_INFORMATION_FORMAT = dwarf;
213+
ENABLE_STRICT_OBJC_MSGSEND = YES;
214+
ENABLE_TESTABILITY = YES;
215+
GCC_C_LANGUAGE_STANDARD = gnu99;
216+
GCC_DYNAMIC_NO_PIC = NO;
217+
GCC_NO_COMMON_BLOCKS = YES;
218+
GCC_OPTIMIZATION_LEVEL = 0;
219+
GCC_PREPROCESSOR_DEFINITIONS = (
220+
"DEBUG=1",
221+
"$(inherited)",
222+
);
223+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
224+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
225+
GCC_WARN_UNDECLARED_SELECTOR = YES;
226+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
227+
GCC_WARN_UNUSED_FUNCTION = YES;
228+
GCC_WARN_UNUSED_VARIABLE = YES;
229+
MACOSX_DEPLOYMENT_TARGET = 10.11;
230+
MTL_ENABLE_DEBUG_INFO = YES;
231+
ONLY_ACTIVE_ARCH = YES;
232+
SDKROOT = macosx;
233+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
234+
};
235+
name = Debug;
236+
};
237+
872E0FCA1B11104B00F6E445 /* Release */ = {
238+
isa = XCBuildConfiguration;
239+
buildSettings = {
240+
ALWAYS_SEARCH_USER_PATHS = NO;
241+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
242+
CLANG_CXX_LIBRARY = "libc++";
243+
CLANG_ENABLE_MODULES = YES;
244+
CLANG_ENABLE_OBJC_ARC = YES;
245+
CLANG_WARN_BOOL_CONVERSION = YES;
246+
CLANG_WARN_CONSTANT_CONVERSION = YES;
247+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
248+
CLANG_WARN_EMPTY_BODY = YES;
249+
CLANG_WARN_ENUM_CONVERSION = YES;
250+
CLANG_WARN_INFINITE_RECURSION = YES;
251+
CLANG_WARN_INT_CONVERSION = YES;
252+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
253+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
254+
CLANG_WARN_UNREACHABLE_CODE = YES;
255+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
256+
CODE_SIGN_IDENTITY = "-";
257+
COPY_PHASE_STRIP = NO;
258+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
259+
ENABLE_NS_ASSERTIONS = NO;
260+
ENABLE_STRICT_OBJC_MSGSEND = YES;
261+
GCC_C_LANGUAGE_STANDARD = gnu99;
262+
GCC_NO_COMMON_BLOCKS = YES;
263+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
264+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
265+
GCC_WARN_UNDECLARED_SELECTOR = YES;
266+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
267+
GCC_WARN_UNUSED_FUNCTION = YES;
268+
GCC_WARN_UNUSED_VARIABLE = YES;
269+
MACOSX_DEPLOYMENT_TARGET = 10.11;
270+
MTL_ENABLE_DEBUG_INFO = NO;
271+
SDKROOT = macosx;
272+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
273+
};
274+
name = Release;
275+
};
276+
872E0FCC1B11104B00F6E445 /* Debug */ = {
277+
isa = XCBuildConfiguration;
278+
buildSettings = {
279+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
280+
COMBINE_HIDPI_IMAGES = YES;
281+
INFOPLIST_FILE = ForceTouchCatalog/Info.plist;
282+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
283+
PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.ForceTouchCatalog";
284+
PRODUCT_NAME = "$(TARGET_NAME)";
285+
SWIFT_VERSION = 3.0;
286+
};
287+
name = Debug;
288+
};
289+
872E0FCD1B11104B00F6E445 /* Release */ = {
290+
isa = XCBuildConfiguration;
291+
buildSettings = {
292+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
293+
COMBINE_HIDPI_IMAGES = YES;
294+
INFOPLIST_FILE = ForceTouchCatalog/Info.plist;
295+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
296+
PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.ForceTouchCatalog";
297+
PRODUCT_NAME = "$(TARGET_NAME)";
298+
SWIFT_VERSION = 3.0;
299+
};
300+
name = Release;
301+
};
302+
/* End XCBuildConfiguration section */
303+
304+
/* Begin XCConfigurationList section */
305+
872E0FB71B11104B00F6E445 /* Build configuration list for PBXProject "ForceTouchCatalog" */ = {
306+
isa = XCConfigurationList;
307+
buildConfigurations = (
308+
872E0FC91B11104B00F6E445 /* Debug */,
309+
872E0FCA1B11104B00F6E445 /* Release */,
310+
);
311+
defaultConfigurationIsVisible = 0;
312+
defaultConfigurationName = Release;
313+
};
314+
872E0FCB1B11104B00F6E445 /* Build configuration list for PBXNativeTarget "ForceTouchCatalog" */ = {
315+
isa = XCConfigurationList;
316+
buildConfigurations = (
317+
872E0FCC1B11104B00F6E445 /* Debug */,
318+
872E0FCD1B11104B00F6E445 /* Release */,
319+
);
320+
defaultConfigurationIsVisible = 0;
321+
defaultConfigurationName = Release;
322+
};
323+
/* End XCConfigurationList section */
324+
};
325+
rootObject = 872E0FB41B11104B00F6E445 /* Project object */;
326+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
Copyright (C) 2016 Apple Inc. All Rights Reserved.
3+
See LICENSE.txt for this sample’s licensing information
4+
5+
Abstract:
6+
Main application entry point.
7+
*/
8+
9+
import Cocoa
10+
11+
@NSApplicationMain
12+
class AppDelegate: NSObject, NSApplicationDelegate { }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "mac",
5+
"size" : "16x16",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "mac",
10+
"size" : "16x16",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "mac",
15+
"size" : "32x32",
16+
"scale" : "1x"
17+
},
18+
{
19+
"idiom" : "mac",
20+
"size" : "32x32",
21+
"scale" : "2x"
22+
},
23+
{
24+
"idiom" : "mac",
25+
"size" : "128x128",
26+
"scale" : "1x"
27+
},
28+
{
29+
"idiom" : "mac",
30+
"size" : "128x128",
31+
"scale" : "2x"
32+
},
33+
{
34+
"idiom" : "mac",
35+
"size" : "256x256",
36+
"scale" : "1x"
37+
},
38+
{
39+
"idiom" : "mac",
40+
"size" : "256x256",
41+
"scale" : "2x"
42+
},
43+
{
44+
"idiom" : "mac",
45+
"size" : "512x512",
46+
"scale" : "1x"
47+
},
48+
{
49+
"idiom" : "mac",
50+
"size" : "512x512",
51+
"scale" : "2x"
52+
}
53+
],
54+
"info" : {
55+
"version" : 1,
56+
"author" : "xcode"
57+
}
58+
}

0 commit comments

Comments
 (0)