├── Item.png
├── UIApplicationShortcutItems.png
├── Simulator Screen Shot 2015年11月18日 下午9.08.39.png
├── 3DTouchDemo
├── Assets.xcassets
│ ├── Set.imageset
│ │ ├── set@1x.png
│ │ ├── set@2x.png
│ │ ├── set@3x.png
│ │ └── Contents.json
│ ├── CameraCut.imageset
│ │ ├── 1x.png
│ │ ├── 2x.png
│ │ ├── 3x.png
│ │ └── Contents.json
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── _DTouchDemo.xcdatamodeld
│ ├── .xccurrentversion
│ └── _DTouchDemo.xcdatamodel
│ │ └── contents
├── ViewController.swift
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── Info.plist
└── AppDelegate.swift
├── 3DTouchDemo.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── lu.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
├── xcuserdata
│ └── lu.xcuserdatad
│ │ ├── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── 3DTouchDemo.xcscheme
│ │ └── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
└── project.pbxproj
├── 3DTouchDemoTests
├── Info.plist
└── _DTouchDemoTests.swift
├── 3DTouchDemoUITests
├── Info.plist
└── _DTouchDemoUITests.swift
└── README.md
/Item.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzefeng/3DTouchDemo/HEAD/Item.png
--------------------------------------------------------------------------------
/UIApplicationShortcutItems.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzefeng/3DTouchDemo/HEAD/UIApplicationShortcutItems.png
--------------------------------------------------------------------------------
/Simulator Screen Shot 2015年11月18日 下午9.08.39.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzefeng/3DTouchDemo/HEAD/Simulator Screen Shot 2015年11月18日 下午9.08.39.png
--------------------------------------------------------------------------------
/3DTouchDemo/Assets.xcassets/Set.imageset/set@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzefeng/3DTouchDemo/HEAD/3DTouchDemo/Assets.xcassets/Set.imageset/set@1x.png
--------------------------------------------------------------------------------
/3DTouchDemo/Assets.xcassets/Set.imageset/set@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzefeng/3DTouchDemo/HEAD/3DTouchDemo/Assets.xcassets/Set.imageset/set@2x.png
--------------------------------------------------------------------------------
/3DTouchDemo/Assets.xcassets/Set.imageset/set@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzefeng/3DTouchDemo/HEAD/3DTouchDemo/Assets.xcassets/Set.imageset/set@3x.png
--------------------------------------------------------------------------------
/3DTouchDemo/Assets.xcassets/CameraCut.imageset/1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzefeng/3DTouchDemo/HEAD/3DTouchDemo/Assets.xcassets/CameraCut.imageset/1x.png
--------------------------------------------------------------------------------
/3DTouchDemo/Assets.xcassets/CameraCut.imageset/2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzefeng/3DTouchDemo/HEAD/3DTouchDemo/Assets.xcassets/CameraCut.imageset/2x.png
--------------------------------------------------------------------------------
/3DTouchDemo/Assets.xcassets/CameraCut.imageset/3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzefeng/3DTouchDemo/HEAD/3DTouchDemo/Assets.xcassets/CameraCut.imageset/3x.png
--------------------------------------------------------------------------------
/3DTouchDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/3DTouchDemo.xcodeproj/project.xcworkspace/xcuserdata/lu.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzefeng/3DTouchDemo/HEAD/3DTouchDemo.xcodeproj/project.xcworkspace/xcuserdata/lu.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/3DTouchDemo/_DTouchDemo.xcdatamodeld/.xccurrentversion:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | _XCCurrentVersionName
6 | _DTouchDemo.xcdatamodel
7 |
8 |
9 |
--------------------------------------------------------------------------------
/3DTouchDemo/_DTouchDemo.xcdatamodeld/_DTouchDemo.xcdatamodel/contents:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/3DTouchDemo/Assets.xcassets/CameraCut.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "1x.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/3DTouchDemo/Assets.xcassets/Set.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "set@1x.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "set@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "set@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/3DTouchDemo/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
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 | }
--------------------------------------------------------------------------------
/3DTouchDemoTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/3DTouchDemoUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/3DTouchDemo.xcodeproj/xcuserdata/lu.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | 3DTouchDemo.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 89BF580D1BFCAA11002D7831
16 |
17 | primary
18 |
19 |
20 | 89BF58241BFCAA11002D7831
21 |
22 | primary
23 |
24 |
25 | 89BF582F1BFCAA11002D7831
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/3DTouchDemoTests/_DTouchDemoTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // _DTouchDemoTests.swift
3 | // 3DTouchDemoTests
4 | //
5 | // Created by lu on 15/11/18.
6 | // Copyright © 2015年 lu. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import _DTouchDemo
11 |
12 | class _DTouchDemoTests: XCTestCase {
13 |
14 | override func setUp() {
15 | super.setUp()
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 | }
18 |
19 | override func tearDown() {
20 | // Put teardown code here. This method is called after the invocation of each test method in the class.
21 | super.tearDown()
22 | }
23 |
24 | func testExample() {
25 | // This is an example of a functional test case.
26 | // Use XCTAssert and related functions to verify your tests produce the correct results.
27 | }
28 |
29 | func testPerformanceExample() {
30 | // This is an example of a performance test case.
31 | self.measureBlock {
32 | // Put the code you want to measure the time of here.
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/3DTouchDemo/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // 3DTouchDemo
4 | //
5 | // Created by lu on 15/11/18.
6 | // Copyright © 2015年 lu. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ViewController: UIViewController {
12 |
13 | override func viewDidLoad() {
14 | super.viewDidLoad()
15 | // Do any additional setup after loading the view, typically from a nib.
16 | self.view.backgroundColor = UIColor.orangeColor()
17 | }
18 |
19 | override func didReceiveMemoryWarning() {
20 | super.didReceiveMemoryWarning()
21 | // Dispose of any resources that can be recreated.
22 | }
23 |
24 | func pressIconOne(){
25 | showAlert("You pressed Icon One")
26 | }
27 |
28 | func pressIconTwo(){
29 | showAlert("You pressed Icon Two")
30 | }
31 |
32 | func pressIconThree(){
33 | showAlert("You pressed Icon Three")
34 | }
35 |
36 | func showAlert(text: String) {
37 | let alertView = UIAlertView(title: "标题", message: text, delegate: self, cancelButtonTitle: "确定")
38 | alertView.show()
39 | }
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 3DTouchDemo
2 | -----
3 |
4 | 3d touch的小例子,入门
5 |
6 | 新入手iPhone6s,可以测试3D touch了,所以做了一个demo。
7 |
8 | 网上已经有了在模拟器上实现3d touch的效果:https://github.com/DeskConnect/SBShortcutMenuSimulator.git
9 |
10 | 
11 |
12 | 静态快捷方式
13 | -----
14 |
15 | 所谓静态快捷方式,就是在应用安装前预先设置好的不能够改变的菜单项,它的设置方式是在 Info.plist 里面添加一个 UIApplicationShortcutItems 字段,如下图
16 |
17 | 
18 |
19 |
20 | UIApplicationShortcutItems 为数组类型,里面的每一个数组项代表快捷菜单上面的一个菜单项。
21 |
22 | 每一个菜单项都有下面几个属性。示例:
23 |
24 | 
25 |
26 | - (必须)UIApplicationShortcutItemType:这个选项表示这个菜单项的唯一标识。
27 |
28 | - (必须)UIApplicationShortcutItemTitle:这个选项表示菜单项显示的标题。
29 |
30 | - (可选)UIApplicationShortcutItemSubtitle:这个表示菜单项的子标题。
31 |
32 | - (可选)UIApplicationShortcutItemIconType:这个属性表示菜单的图标,系统自带的图标。
33 |
34 | - (可选)UIApplicationShortcutItemIconFile:这个属性表示菜单图标的文件名,可以使用自定义的图标。
35 |
36 | - (可选)UIApplicationShortcutItemUserInfo:这个代表了菜单项点击后,传入的用户信息,也是可选的。
37 |
38 | ##至于代码的介绍我在项目里都有注释。
39 |
--------------------------------------------------------------------------------
/3DTouchDemoUITests/_DTouchDemoUITests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // _DTouchDemoUITests.swift
3 | // 3DTouchDemoUITests
4 | //
5 | // Created by lu on 15/11/18.
6 | // Copyright © 2015年 lu. All rights reserved.
7 | //
8 |
9 | import XCTest
10 |
11 | class _DTouchDemoUITests: XCTestCase {
12 |
13 | override func setUp() {
14 | super.setUp()
15 |
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 |
18 | // In UI tests it is usually best to stop immediately when a failure occurs.
19 | continueAfterFailure = false
20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
21 | XCUIApplication().launch()
22 |
23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
24 | }
25 |
26 | override func tearDown() {
27 | // Put teardown code here. This method is called after the invocation of each test method in the class.
28 | super.tearDown()
29 | }
30 |
31 | func testExample() {
32 | // Use recording to get started writing UI tests.
33 | // Use XCTAssert and related functions to verify your tests produce the correct results.
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/3DTouchDemo/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/3DTouchDemo/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/3DTouchDemo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UIApplicationShortcutItems
26 |
27 |
28 | UIApplicationShortcutItemIconFile
29 | CameraCut
30 | UIApplicationShortcutItemSubtitle
31 | 副标题1
32 | UIApplicationShortcutItemTitle
33 | 标题1
34 | UIApplicationShortcutItemType
35 | $(PRODUCT_BUNDLE_IDENTIFIER).First
36 | UIApplicationShortcutItemUserInfo
37 |
38 | firstShorcutKey1
39 | firstShortcutKeyValue1
40 |
41 |
42 |
43 | UIApplicationShortcutItemIconType
44 | UIApplicationShortcutIconTypeCompose
45 | UIApplicationShortcutItemSubtitle
46 | 副标题2
47 | UIApplicationShortcutItemTitle
48 | 标题2
49 | UIApplicationShortcutItemType
50 | $(PRODUCT_BUNDLE_IDENTIFIER).Second
51 | UIApplicationShortcutItemUserInfo
52 |
53 | secondShortcutKey1
54 | secondShortcutValue1
55 |
56 |
57 |
58 | UIApplicationShortcutItemIconFile
59 | Set
60 | UIApplicationShortcutItemSubtitle
61 | 副标题3
62 | UIApplicationShortcutItemTitle
63 | 标题3
64 | UIApplicationShortcutItemType
65 | $(PRODUCT_BUNDLE_IDENTIFIER).Third
66 | UIApplicationShortcutItemUserInfo
67 |
68 | secondShortcutKey1
69 | thirdShortcutValue1
70 |
71 |
72 |
73 | UILaunchStoryboardName
74 | LaunchScreen
75 | UIMainStoryboardFile
76 | Main
77 | UIRequiredDeviceCapabilities
78 |
79 | armv7
80 |
81 | UISupportedInterfaceOrientations
82 |
83 | UIInterfaceOrientationPortrait
84 | UIInterfaceOrientationLandscapeLeft
85 | UIInterfaceOrientationLandscapeRight
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/3DTouchDemo.xcodeproj/xcuserdata/lu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
20 |
21 |
22 |
24 |
36 |
37 |
38 |
40 |
52 |
53 |
54 |
56 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/3DTouchDemo.xcodeproj/xcuserdata/lu.xcuserdatad/xcschemes/3DTouchDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/3DTouchDemo/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // 时光相片
4 | //
5 | // Created by lu on 15/9/19.
6 | // Copyright © 2015年 lu. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import CoreData
11 |
12 | @available(iOS 9.0, *)
13 | @UIApplicationMain
14 | class AppDelegate: UIResponder, UIApplicationDelegate {
15 |
16 | enum ShortcutIdentifier: String {
17 | case First
18 | case Second
19 | case Third
20 | // case Fourth
21 |
22 | // MARK: Initializers
23 |
24 | init?(fullType: String) {
25 | guard let last = fullType.componentsSeparatedByString(".").last else { return nil }
26 |
27 | self.init(rawValue: last)
28 | }
29 |
30 | // MARK: Properties
31 |
32 | var type: String {
33 | return NSBundle.mainBundle().bundleIdentifier! + ".\(self.rawValue)"
34 | }
35 | }
36 |
37 | // MARK: Static Properties
38 |
39 | static let applicationShortcutUserInfoIconKey = "applicationShortcutUserInfoIconKey"
40 |
41 | var window: UIWindow?
42 |
43 | var launchedShortcutItem: UIApplicationShortcutItem?
44 |
45 | func handleShortCutItem(shortcutItem: UIApplicationShortcutItem) -> Bool {
46 | var handled = false
47 |
48 | // Verify that the provided `shortcutItem`'s `type` is one handled by the application.
49 | guard ShortcutIdentifier(fullType: shortcutItem.type) != nil else { return false }
50 |
51 | guard let shortCutType = shortcutItem.type as String? else { return false }
52 |
53 | //获取到需要的vc
54 | let rootNavigationViewController = window!.rootViewController as? UINavigationController
55 | let rootViewController = rootNavigationViewController?.viewControllers.first as! ViewController?
56 |
57 | switch (shortCutType) {
58 | case ShortcutIdentifier.First.type:
59 | // Handle shortcut 1 (static).
60 | handled = true
61 | rootNavigationViewController?.popToRootViewControllerAnimated(false)
62 | rootViewController?.pressIconOne()
63 | break
64 | case ShortcutIdentifier.Second.type:
65 | // Handle shortcut 2 (static).
66 | handled = true
67 | rootNavigationViewController?.popToRootViewControllerAnimated(false)
68 | rootViewController?.pressIconTwo()
69 | break
70 | case ShortcutIdentifier.Third.type:
71 | // Handle shortcut 3 (dynamic).
72 | handled = true
73 | rootNavigationViewController?.popToRootViewControllerAnimated(false)
74 | rootViewController?.pressIconThree()
75 | break
76 | // case ShortcutIdentifier.Fourth.type:
77 | // // Handle shortcut 4 (dynamic).
78 | // handled = true
79 | // break
80 | default:
81 | break
82 | }
83 |
84 | return handled
85 | }
86 |
87 | // MARK: Application Life Cycle
88 | //如果是第一次启动,即从关闭到启动,在didFinishLaunchingWithOptions赋值之后调用
89 | func applicationDidBecomeActive(application: UIApplication) {
90 | guard let shortcut = launchedShortcutItem else { return }
91 |
92 | handleShortCutItem(shortcut)
93 |
94 | launchedShortcutItem = nil
95 | }
96 |
97 | //当应用从关闭被打开时,调用该函数
98 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
99 | // Override point for customization after application launch.
100 | // Override point for customization after application launch.
101 | var shouldPerformAdditionalDelegateHandling = true
102 |
103 | //需要检测一下传入的信息,如果能够找到 UIApplicationShortcutItem 对象,就进行针对性的处理
104 |
105 | if let shortcutItem = launchOptions?[UIApplicationLaunchOptionsShortcutItemKey] as? UIApplicationShortcutItem {
106 |
107 | launchedShortcutItem = shortcutItem
108 | // This will block "performActionForShortcutItem:completionHandler" from being called.
109 | shouldPerformAdditionalDelegateHandling = false
110 | }
111 |
112 | return shouldPerformAdditionalDelegateHandling
113 | }
114 |
115 | //如果应用已经在后台打开,则调用performActionForShortcutItem
116 | func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem, completionHandler: Bool -> Void) {
117 | print("performActionForShortcutItem")
118 | let handledShortCutItem = handleShortCutItem(shortcutItem)
119 |
120 | completionHandler(handledShortCutItem)
121 | }
122 |
123 | func applicationWillResignActive(application: UIApplication) {
124 | // 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.
125 | // 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.
126 | }
127 |
128 | func applicationDidEnterBackground(application: UIApplication) {
129 | // 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.
130 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
131 | }
132 |
133 | func applicationWillEnterForeground(application: UIApplication) {
134 | // 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.
135 | }
136 |
137 | func applicationWillTerminate(application: UIApplication) {
138 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
139 | // Saves changes in the application's managed object context before the application terminates.
140 | self.saveContext()
141 | }
142 |
143 | // MARK: - Core Data stack
144 |
145 | lazy var applicationDocumentsDirectory: NSURL = {
146 | // The directory the application uses to store the Core Data store file. This code uses a directory named "com.luzefeng.____" in the application's documents Application Support directory.
147 | let urls = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)
148 | return urls[urls.count-1]
149 | }()
150 |
151 | lazy var managedObjectModel: NSManagedObjectModel = {
152 | // The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model.
153 | let modelURL = NSBundle.mainBundle().URLForResource("____", withExtension: "momd")!
154 | return NSManagedObjectModel(contentsOfURL: modelURL)!
155 | }()
156 |
157 | lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator = {
158 | // The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail.
159 | // Create the coordinator and store
160 | let coordinator = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel)
161 | let url = self.applicationDocumentsDirectory.URLByAppendingPathComponent("SingleViewCoreData.sqlite")
162 | var failureReason = "There was an error creating or loading the application's saved data."
163 | do {
164 | try coordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: nil)
165 | } catch {
166 | // Report any error we got.
167 | var dict = [String: AnyObject]()
168 | dict[NSLocalizedDescriptionKey] = "Failed to initialize the application's saved data"
169 | dict[NSLocalizedFailureReasonErrorKey] = failureReason
170 |
171 | dict[NSUnderlyingErrorKey] = error as NSError
172 | let wrappedError = NSError(domain: "YOUR_ERROR_DOMAIN", code: 9999, userInfo: dict)
173 | // Replace this with code to handle the error appropriately.
174 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
175 | NSLog("Unresolved error \(wrappedError), \(wrappedError.userInfo)")
176 | abort()
177 | }
178 |
179 | return coordinator
180 | }()
181 |
182 | lazy var managedObjectContext: NSManagedObjectContext = {
183 | // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) This property is optional since there are legitimate error conditions that could cause the creation of the context to fail.
184 | let coordinator = self.persistentStoreCoordinator
185 | var managedObjectContext = NSManagedObjectContext(concurrencyType: .MainQueueConcurrencyType)
186 | managedObjectContext.persistentStoreCoordinator = coordinator
187 | return managedObjectContext
188 | }()
189 |
190 | // MARK: - Core Data Saving support
191 |
192 | func saveContext () {
193 | if managedObjectContext.hasChanges {
194 | do {
195 | try managedObjectContext.save()
196 | } catch {
197 | // Replace this implementation with code to handle the error appropriately.
198 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
199 | let nserror = error as NSError
200 | NSLog("Unresolved error \(nserror), \(nserror.userInfo)")
201 | abort()
202 | }
203 | }
204 | }
205 |
206 | }
207 |
208 |
--------------------------------------------------------------------------------
/3DTouchDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 89BF58121BFCAA11002D7831 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89BF58111BFCAA11002D7831 /* AppDelegate.swift */; };
11 | 89BF58141BFCAA11002D7831 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89BF58131BFCAA11002D7831 /* ViewController.swift */; };
12 | 89BF58171BFCAA11002D7831 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 89BF58151BFCAA11002D7831 /* Main.storyboard */; };
13 | 89BF581A1BFCAA11002D7831 /* _DTouchDemo.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 89BF58181BFCAA11002D7831 /* _DTouchDemo.xcdatamodeld */; };
14 | 89BF581C1BFCAA11002D7831 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 89BF581B1BFCAA11002D7831 /* Assets.xcassets */; };
15 | 89BF581F1BFCAA11002D7831 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 89BF581D1BFCAA11002D7831 /* LaunchScreen.storyboard */; };
16 | 89BF582A1BFCAA11002D7831 /* _DTouchDemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89BF58291BFCAA11002D7831 /* _DTouchDemoTests.swift */; };
17 | 89BF58351BFCAA11002D7831 /* _DTouchDemoUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89BF58341BFCAA11002D7831 /* _DTouchDemoUITests.swift */; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXContainerItemProxy section */
21 | 89BF58261BFCAA11002D7831 /* PBXContainerItemProxy */ = {
22 | isa = PBXContainerItemProxy;
23 | containerPortal = 89BF58061BFCAA11002D7831 /* Project object */;
24 | proxyType = 1;
25 | remoteGlobalIDString = 89BF580D1BFCAA11002D7831;
26 | remoteInfo = 3DTouchDemo;
27 | };
28 | 89BF58311BFCAA11002D7831 /* PBXContainerItemProxy */ = {
29 | isa = PBXContainerItemProxy;
30 | containerPortal = 89BF58061BFCAA11002D7831 /* Project object */;
31 | proxyType = 1;
32 | remoteGlobalIDString = 89BF580D1BFCAA11002D7831;
33 | remoteInfo = 3DTouchDemo;
34 | };
35 | /* End PBXContainerItemProxy section */
36 |
37 | /* Begin PBXFileReference section */
38 | 89BF580E1BFCAA11002D7831 /* 3DTouchDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 3DTouchDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
39 | 89BF58111BFCAA11002D7831 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
40 | 89BF58131BFCAA11002D7831 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
41 | 89BF58161BFCAA11002D7831 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
42 | 89BF58191BFCAA11002D7831 /* _DTouchDemo.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = _DTouchDemo.xcdatamodel; sourceTree = ""; };
43 | 89BF581B1BFCAA11002D7831 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
44 | 89BF581E1BFCAA11002D7831 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
45 | 89BF58201BFCAA11002D7831 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
46 | 89BF58251BFCAA11002D7831 /* 3DTouchDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = 3DTouchDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
47 | 89BF58291BFCAA11002D7831 /* _DTouchDemoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = _DTouchDemoTests.swift; sourceTree = ""; };
48 | 89BF582B1BFCAA11002D7831 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
49 | 89BF58301BFCAA11002D7831 /* 3DTouchDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = 3DTouchDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
50 | 89BF58341BFCAA11002D7831 /* _DTouchDemoUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = _DTouchDemoUITests.swift; sourceTree = ""; };
51 | 89BF58361BFCAA11002D7831 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
52 | /* End PBXFileReference section */
53 |
54 | /* Begin PBXFrameworksBuildPhase section */
55 | 89BF580B1BFCAA11002D7831 /* Frameworks */ = {
56 | isa = PBXFrameworksBuildPhase;
57 | buildActionMask = 2147483647;
58 | files = (
59 | );
60 | runOnlyForDeploymentPostprocessing = 0;
61 | };
62 | 89BF58221BFCAA11002D7831 /* Frameworks */ = {
63 | isa = PBXFrameworksBuildPhase;
64 | buildActionMask = 2147483647;
65 | files = (
66 | );
67 | runOnlyForDeploymentPostprocessing = 0;
68 | };
69 | 89BF582D1BFCAA11002D7831 /* Frameworks */ = {
70 | isa = PBXFrameworksBuildPhase;
71 | buildActionMask = 2147483647;
72 | files = (
73 | );
74 | runOnlyForDeploymentPostprocessing = 0;
75 | };
76 | /* End PBXFrameworksBuildPhase section */
77 |
78 | /* Begin PBXGroup section */
79 | 89BF58051BFCAA11002D7831 = {
80 | isa = PBXGroup;
81 | children = (
82 | 89BF58101BFCAA11002D7831 /* 3DTouchDemo */,
83 | 89BF58281BFCAA11002D7831 /* 3DTouchDemoTests */,
84 | 89BF58331BFCAA11002D7831 /* 3DTouchDemoUITests */,
85 | 89BF580F1BFCAA11002D7831 /* Products */,
86 | );
87 | sourceTree = "";
88 | };
89 | 89BF580F1BFCAA11002D7831 /* Products */ = {
90 | isa = PBXGroup;
91 | children = (
92 | 89BF580E1BFCAA11002D7831 /* 3DTouchDemo.app */,
93 | 89BF58251BFCAA11002D7831 /* 3DTouchDemoTests.xctest */,
94 | 89BF58301BFCAA11002D7831 /* 3DTouchDemoUITests.xctest */,
95 | );
96 | name = Products;
97 | sourceTree = "";
98 | };
99 | 89BF58101BFCAA11002D7831 /* 3DTouchDemo */ = {
100 | isa = PBXGroup;
101 | children = (
102 | 89BF58111BFCAA11002D7831 /* AppDelegate.swift */,
103 | 89BF58131BFCAA11002D7831 /* ViewController.swift */,
104 | 89BF58151BFCAA11002D7831 /* Main.storyboard */,
105 | 89BF581B1BFCAA11002D7831 /* Assets.xcassets */,
106 | 89BF581D1BFCAA11002D7831 /* LaunchScreen.storyboard */,
107 | 89BF58201BFCAA11002D7831 /* Info.plist */,
108 | 89BF58181BFCAA11002D7831 /* _DTouchDemo.xcdatamodeld */,
109 | );
110 | path = 3DTouchDemo;
111 | sourceTree = "";
112 | };
113 | 89BF58281BFCAA11002D7831 /* 3DTouchDemoTests */ = {
114 | isa = PBXGroup;
115 | children = (
116 | 89BF58291BFCAA11002D7831 /* _DTouchDemoTests.swift */,
117 | 89BF582B1BFCAA11002D7831 /* Info.plist */,
118 | );
119 | path = 3DTouchDemoTests;
120 | sourceTree = "";
121 | };
122 | 89BF58331BFCAA11002D7831 /* 3DTouchDemoUITests */ = {
123 | isa = PBXGroup;
124 | children = (
125 | 89BF58341BFCAA11002D7831 /* _DTouchDemoUITests.swift */,
126 | 89BF58361BFCAA11002D7831 /* Info.plist */,
127 | );
128 | path = 3DTouchDemoUITests;
129 | sourceTree = "";
130 | };
131 | /* End PBXGroup section */
132 |
133 | /* Begin PBXNativeTarget section */
134 | 89BF580D1BFCAA11002D7831 /* 3DTouchDemo */ = {
135 | isa = PBXNativeTarget;
136 | buildConfigurationList = 89BF58391BFCAA11002D7831 /* Build configuration list for PBXNativeTarget "3DTouchDemo" */;
137 | buildPhases = (
138 | 89BF580A1BFCAA11002D7831 /* Sources */,
139 | 89BF580B1BFCAA11002D7831 /* Frameworks */,
140 | 89BF580C1BFCAA11002D7831 /* Resources */,
141 | );
142 | buildRules = (
143 | );
144 | dependencies = (
145 | );
146 | name = 3DTouchDemo;
147 | productName = 3DTouchDemo;
148 | productReference = 89BF580E1BFCAA11002D7831 /* 3DTouchDemo.app */;
149 | productType = "com.apple.product-type.application";
150 | };
151 | 89BF58241BFCAA11002D7831 /* 3DTouchDemoTests */ = {
152 | isa = PBXNativeTarget;
153 | buildConfigurationList = 89BF583C1BFCAA11002D7831 /* Build configuration list for PBXNativeTarget "3DTouchDemoTests" */;
154 | buildPhases = (
155 | 89BF58211BFCAA11002D7831 /* Sources */,
156 | 89BF58221BFCAA11002D7831 /* Frameworks */,
157 | 89BF58231BFCAA11002D7831 /* Resources */,
158 | );
159 | buildRules = (
160 | );
161 | dependencies = (
162 | 89BF58271BFCAA11002D7831 /* PBXTargetDependency */,
163 | );
164 | name = 3DTouchDemoTests;
165 | productName = 3DTouchDemoTests;
166 | productReference = 89BF58251BFCAA11002D7831 /* 3DTouchDemoTests.xctest */;
167 | productType = "com.apple.product-type.bundle.unit-test";
168 | };
169 | 89BF582F1BFCAA11002D7831 /* 3DTouchDemoUITests */ = {
170 | isa = PBXNativeTarget;
171 | buildConfigurationList = 89BF583F1BFCAA11002D7831 /* Build configuration list for PBXNativeTarget "3DTouchDemoUITests" */;
172 | buildPhases = (
173 | 89BF582C1BFCAA11002D7831 /* Sources */,
174 | 89BF582D1BFCAA11002D7831 /* Frameworks */,
175 | 89BF582E1BFCAA11002D7831 /* Resources */,
176 | );
177 | buildRules = (
178 | );
179 | dependencies = (
180 | 89BF58321BFCAA11002D7831 /* PBXTargetDependency */,
181 | );
182 | name = 3DTouchDemoUITests;
183 | productName = 3DTouchDemoUITests;
184 | productReference = 89BF58301BFCAA11002D7831 /* 3DTouchDemoUITests.xctest */;
185 | productType = "com.apple.product-type.bundle.ui-testing";
186 | };
187 | /* End PBXNativeTarget section */
188 |
189 | /* Begin PBXProject section */
190 | 89BF58061BFCAA11002D7831 /* Project object */ = {
191 | isa = PBXProject;
192 | attributes = {
193 | LastSwiftUpdateCheck = 0710;
194 | LastUpgradeCheck = 0710;
195 | ORGANIZATIONNAME = lu;
196 | TargetAttributes = {
197 | 89BF580D1BFCAA11002D7831 = {
198 | CreatedOnToolsVersion = 7.1;
199 | DevelopmentTeam = 557XX2G4GZ;
200 | };
201 | 89BF58241BFCAA11002D7831 = {
202 | CreatedOnToolsVersion = 7.1;
203 | TestTargetID = 89BF580D1BFCAA11002D7831;
204 | };
205 | 89BF582F1BFCAA11002D7831 = {
206 | CreatedOnToolsVersion = 7.1;
207 | TestTargetID = 89BF580D1BFCAA11002D7831;
208 | };
209 | };
210 | };
211 | buildConfigurationList = 89BF58091BFCAA11002D7831 /* Build configuration list for PBXProject "3DTouchDemo" */;
212 | compatibilityVersion = "Xcode 3.2";
213 | developmentRegion = English;
214 | hasScannedForEncodings = 0;
215 | knownRegions = (
216 | en,
217 | Base,
218 | );
219 | mainGroup = 89BF58051BFCAA11002D7831;
220 | productRefGroup = 89BF580F1BFCAA11002D7831 /* Products */;
221 | projectDirPath = "";
222 | projectRoot = "";
223 | targets = (
224 | 89BF580D1BFCAA11002D7831 /* 3DTouchDemo */,
225 | 89BF58241BFCAA11002D7831 /* 3DTouchDemoTests */,
226 | 89BF582F1BFCAA11002D7831 /* 3DTouchDemoUITests */,
227 | );
228 | };
229 | /* End PBXProject section */
230 |
231 | /* Begin PBXResourcesBuildPhase section */
232 | 89BF580C1BFCAA11002D7831 /* Resources */ = {
233 | isa = PBXResourcesBuildPhase;
234 | buildActionMask = 2147483647;
235 | files = (
236 | 89BF581F1BFCAA11002D7831 /* LaunchScreen.storyboard in Resources */,
237 | 89BF581C1BFCAA11002D7831 /* Assets.xcassets in Resources */,
238 | 89BF58171BFCAA11002D7831 /* Main.storyboard in Resources */,
239 | );
240 | runOnlyForDeploymentPostprocessing = 0;
241 | };
242 | 89BF58231BFCAA11002D7831 /* Resources */ = {
243 | isa = PBXResourcesBuildPhase;
244 | buildActionMask = 2147483647;
245 | files = (
246 | );
247 | runOnlyForDeploymentPostprocessing = 0;
248 | };
249 | 89BF582E1BFCAA11002D7831 /* Resources */ = {
250 | isa = PBXResourcesBuildPhase;
251 | buildActionMask = 2147483647;
252 | files = (
253 | );
254 | runOnlyForDeploymentPostprocessing = 0;
255 | };
256 | /* End PBXResourcesBuildPhase section */
257 |
258 | /* Begin PBXSourcesBuildPhase section */
259 | 89BF580A1BFCAA11002D7831 /* Sources */ = {
260 | isa = PBXSourcesBuildPhase;
261 | buildActionMask = 2147483647;
262 | files = (
263 | 89BF58141BFCAA11002D7831 /* ViewController.swift in Sources */,
264 | 89BF58121BFCAA11002D7831 /* AppDelegate.swift in Sources */,
265 | 89BF581A1BFCAA11002D7831 /* _DTouchDemo.xcdatamodeld in Sources */,
266 | );
267 | runOnlyForDeploymentPostprocessing = 0;
268 | };
269 | 89BF58211BFCAA11002D7831 /* Sources */ = {
270 | isa = PBXSourcesBuildPhase;
271 | buildActionMask = 2147483647;
272 | files = (
273 | 89BF582A1BFCAA11002D7831 /* _DTouchDemoTests.swift in Sources */,
274 | );
275 | runOnlyForDeploymentPostprocessing = 0;
276 | };
277 | 89BF582C1BFCAA11002D7831 /* Sources */ = {
278 | isa = PBXSourcesBuildPhase;
279 | buildActionMask = 2147483647;
280 | files = (
281 | 89BF58351BFCAA11002D7831 /* _DTouchDemoUITests.swift in Sources */,
282 | );
283 | runOnlyForDeploymentPostprocessing = 0;
284 | };
285 | /* End PBXSourcesBuildPhase section */
286 |
287 | /* Begin PBXTargetDependency section */
288 | 89BF58271BFCAA11002D7831 /* PBXTargetDependency */ = {
289 | isa = PBXTargetDependency;
290 | target = 89BF580D1BFCAA11002D7831 /* 3DTouchDemo */;
291 | targetProxy = 89BF58261BFCAA11002D7831 /* PBXContainerItemProxy */;
292 | };
293 | 89BF58321BFCAA11002D7831 /* PBXTargetDependency */ = {
294 | isa = PBXTargetDependency;
295 | target = 89BF580D1BFCAA11002D7831 /* 3DTouchDemo */;
296 | targetProxy = 89BF58311BFCAA11002D7831 /* PBXContainerItemProxy */;
297 | };
298 | /* End PBXTargetDependency section */
299 |
300 | /* Begin PBXVariantGroup section */
301 | 89BF58151BFCAA11002D7831 /* Main.storyboard */ = {
302 | isa = PBXVariantGroup;
303 | children = (
304 | 89BF58161BFCAA11002D7831 /* Base */,
305 | );
306 | name = Main.storyboard;
307 | sourceTree = "";
308 | };
309 | 89BF581D1BFCAA11002D7831 /* LaunchScreen.storyboard */ = {
310 | isa = PBXVariantGroup;
311 | children = (
312 | 89BF581E1BFCAA11002D7831 /* Base */,
313 | );
314 | name = LaunchScreen.storyboard;
315 | sourceTree = "";
316 | };
317 | /* End PBXVariantGroup section */
318 |
319 | /* Begin XCBuildConfiguration section */
320 | 89BF58371BFCAA11002D7831 /* Debug */ = {
321 | isa = XCBuildConfiguration;
322 | buildSettings = {
323 | ALWAYS_SEARCH_USER_PATHS = NO;
324 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
325 | CLANG_CXX_LIBRARY = "libc++";
326 | CLANG_ENABLE_MODULES = YES;
327 | CLANG_ENABLE_OBJC_ARC = YES;
328 | CLANG_WARN_BOOL_CONVERSION = YES;
329 | CLANG_WARN_CONSTANT_CONVERSION = YES;
330 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
331 | CLANG_WARN_EMPTY_BODY = YES;
332 | CLANG_WARN_ENUM_CONVERSION = YES;
333 | CLANG_WARN_INT_CONVERSION = YES;
334 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
335 | CLANG_WARN_UNREACHABLE_CODE = YES;
336 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
337 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
338 | COPY_PHASE_STRIP = NO;
339 | DEBUG_INFORMATION_FORMAT = dwarf;
340 | ENABLE_STRICT_OBJC_MSGSEND = YES;
341 | ENABLE_TESTABILITY = YES;
342 | GCC_C_LANGUAGE_STANDARD = gnu99;
343 | GCC_DYNAMIC_NO_PIC = NO;
344 | GCC_NO_COMMON_BLOCKS = YES;
345 | GCC_OPTIMIZATION_LEVEL = 0;
346 | GCC_PREPROCESSOR_DEFINITIONS = (
347 | "DEBUG=1",
348 | "$(inherited)",
349 | );
350 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
351 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
352 | GCC_WARN_UNDECLARED_SELECTOR = YES;
353 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
354 | GCC_WARN_UNUSED_FUNCTION = YES;
355 | GCC_WARN_UNUSED_VARIABLE = YES;
356 | IPHONEOS_DEPLOYMENT_TARGET = 9.1;
357 | MTL_ENABLE_DEBUG_INFO = YES;
358 | ONLY_ACTIVE_ARCH = YES;
359 | SDKROOT = iphoneos;
360 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
361 | };
362 | name = Debug;
363 | };
364 | 89BF58381BFCAA11002D7831 /* Release */ = {
365 | isa = XCBuildConfiguration;
366 | buildSettings = {
367 | ALWAYS_SEARCH_USER_PATHS = NO;
368 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
369 | CLANG_CXX_LIBRARY = "libc++";
370 | CLANG_ENABLE_MODULES = YES;
371 | CLANG_ENABLE_OBJC_ARC = YES;
372 | CLANG_WARN_BOOL_CONVERSION = YES;
373 | CLANG_WARN_CONSTANT_CONVERSION = YES;
374 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
375 | CLANG_WARN_EMPTY_BODY = YES;
376 | CLANG_WARN_ENUM_CONVERSION = YES;
377 | CLANG_WARN_INT_CONVERSION = YES;
378 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
379 | CLANG_WARN_UNREACHABLE_CODE = YES;
380 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
381 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
382 | COPY_PHASE_STRIP = NO;
383 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
384 | ENABLE_NS_ASSERTIONS = NO;
385 | ENABLE_STRICT_OBJC_MSGSEND = YES;
386 | GCC_C_LANGUAGE_STANDARD = gnu99;
387 | GCC_NO_COMMON_BLOCKS = YES;
388 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
389 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
390 | GCC_WARN_UNDECLARED_SELECTOR = YES;
391 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
392 | GCC_WARN_UNUSED_FUNCTION = YES;
393 | GCC_WARN_UNUSED_VARIABLE = YES;
394 | IPHONEOS_DEPLOYMENT_TARGET = 9.1;
395 | MTL_ENABLE_DEBUG_INFO = NO;
396 | SDKROOT = iphoneos;
397 | VALIDATE_PRODUCT = YES;
398 | };
399 | name = Release;
400 | };
401 | 89BF583A1BFCAA11002D7831 /* Debug */ = {
402 | isa = XCBuildConfiguration;
403 | buildSettings = {
404 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
405 | CODE_SIGN_IDENTITY = "iPhone Developer: Jimmy Lu (EKTN96KCU6)";
406 | INFOPLIST_FILE = 3DTouchDemo/Info.plist;
407 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
408 | PRODUCT_BUNDLE_IDENTIFIER = com.lu.free.test;
409 | PRODUCT_NAME = "$(TARGET_NAME)";
410 | PROVISIONING_PROFILE = "f1d2d8e9-d1ca-4e7e-98b6-4e27d7c4e1e4";
411 | };
412 | name = Debug;
413 | };
414 | 89BF583B1BFCAA11002D7831 /* Release */ = {
415 | isa = XCBuildConfiguration;
416 | buildSettings = {
417 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
418 | CODE_SIGN_IDENTITY = "iPhone Developer";
419 | INFOPLIST_FILE = 3DTouchDemo/Info.plist;
420 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
421 | PRODUCT_BUNDLE_IDENTIFIER = com.lu.free.test;
422 | PRODUCT_NAME = "$(TARGET_NAME)";
423 | };
424 | name = Release;
425 | };
426 | 89BF583D1BFCAA11002D7831 /* Debug */ = {
427 | isa = XCBuildConfiguration;
428 | buildSettings = {
429 | BUNDLE_LOADER = "$(TEST_HOST)";
430 | INFOPLIST_FILE = 3DTouchDemoTests/Info.plist;
431 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
432 | PRODUCT_BUNDLE_IDENTIFIER = "com.lu.free.test.-DTouchDemoTests";
433 | PRODUCT_NAME = "$(TARGET_NAME)";
434 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/3DTouchDemo.app/3DTouchDemo";
435 | };
436 | name = Debug;
437 | };
438 | 89BF583E1BFCAA11002D7831 /* Release */ = {
439 | isa = XCBuildConfiguration;
440 | buildSettings = {
441 | BUNDLE_LOADER = "$(TEST_HOST)";
442 | INFOPLIST_FILE = 3DTouchDemoTests/Info.plist;
443 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
444 | PRODUCT_BUNDLE_IDENTIFIER = "com.lu.free.test.-DTouchDemoTests";
445 | PRODUCT_NAME = "$(TARGET_NAME)";
446 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/3DTouchDemo.app/3DTouchDemo";
447 | };
448 | name = Release;
449 | };
450 | 89BF58401BFCAA11002D7831 /* Debug */ = {
451 | isa = XCBuildConfiguration;
452 | buildSettings = {
453 | INFOPLIST_FILE = 3DTouchDemoUITests/Info.plist;
454 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
455 | PRODUCT_BUNDLE_IDENTIFIER = "com.lu.free.test.-DTouchDemoUITests";
456 | PRODUCT_NAME = "$(TARGET_NAME)";
457 | TEST_TARGET_NAME = 3DTouchDemo;
458 | USES_XCTRUNNER = YES;
459 | };
460 | name = Debug;
461 | };
462 | 89BF58411BFCAA11002D7831 /* Release */ = {
463 | isa = XCBuildConfiguration;
464 | buildSettings = {
465 | INFOPLIST_FILE = 3DTouchDemoUITests/Info.plist;
466 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
467 | PRODUCT_BUNDLE_IDENTIFIER = "com.lu.free.test.-DTouchDemoUITests";
468 | PRODUCT_NAME = "$(TARGET_NAME)";
469 | TEST_TARGET_NAME = 3DTouchDemo;
470 | USES_XCTRUNNER = YES;
471 | };
472 | name = Release;
473 | };
474 | /* End XCBuildConfiguration section */
475 |
476 | /* Begin XCConfigurationList section */
477 | 89BF58091BFCAA11002D7831 /* Build configuration list for PBXProject "3DTouchDemo" */ = {
478 | isa = XCConfigurationList;
479 | buildConfigurations = (
480 | 89BF58371BFCAA11002D7831 /* Debug */,
481 | 89BF58381BFCAA11002D7831 /* Release */,
482 | );
483 | defaultConfigurationIsVisible = 0;
484 | defaultConfigurationName = Release;
485 | };
486 | 89BF58391BFCAA11002D7831 /* Build configuration list for PBXNativeTarget "3DTouchDemo" */ = {
487 | isa = XCConfigurationList;
488 | buildConfigurations = (
489 | 89BF583A1BFCAA11002D7831 /* Debug */,
490 | 89BF583B1BFCAA11002D7831 /* Release */,
491 | );
492 | defaultConfigurationIsVisible = 0;
493 | };
494 | 89BF583C1BFCAA11002D7831 /* Build configuration list for PBXNativeTarget "3DTouchDemoTests" */ = {
495 | isa = XCConfigurationList;
496 | buildConfigurations = (
497 | 89BF583D1BFCAA11002D7831 /* Debug */,
498 | 89BF583E1BFCAA11002D7831 /* Release */,
499 | );
500 | defaultConfigurationIsVisible = 0;
501 | };
502 | 89BF583F1BFCAA11002D7831 /* Build configuration list for PBXNativeTarget "3DTouchDemoUITests" */ = {
503 | isa = XCConfigurationList;
504 | buildConfigurations = (
505 | 89BF58401BFCAA11002D7831 /* Debug */,
506 | 89BF58411BFCAA11002D7831 /* Release */,
507 | );
508 | defaultConfigurationIsVisible = 0;
509 | };
510 | /* End XCConfigurationList section */
511 |
512 | /* Begin XCVersionGroup section */
513 | 89BF58181BFCAA11002D7831 /* _DTouchDemo.xcdatamodeld */ = {
514 | isa = XCVersionGroup;
515 | children = (
516 | 89BF58191BFCAA11002D7831 /* _DTouchDemo.xcdatamodel */,
517 | );
518 | currentVersion = 89BF58191BFCAA11002D7831 /* _DTouchDemo.xcdatamodel */;
519 | path = _DTouchDemo.xcdatamodeld;
520 | sourceTree = "";
521 | versionGroupType = wrapper.xcdatamodel;
522 | };
523 | /* End XCVersionGroup section */
524 | };
525 | rootObject = 89BF58061BFCAA11002D7831 /* Project object */;
526 | }
527 |
--------------------------------------------------------------------------------