├── README.md ├── itjh_3dTouch.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── songlijun.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── songlijun.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── itjh_3dTouch.xcscheme │ └── xcschememanagement.plist └── itjh_3dTouch ├── AppDelegate.swift ├── ArticleShowViewController.swift ├── ArticleTableViewCell.swift ├── ArticlesTableViewController.swift ├── Assets.xcassets ├── AppIcon.appiconset │ ├── AppIcon-60@2x.png │ ├── AppIcon-60@3x.png │ ├── AppIcon-Small@2x.png │ ├── AppIcon-Small@3x.png │ ├── AppIcon-Spotlight-40@2x.png │ ├── AppIcon-Spotlight-40@3x.png │ └── Contents.json └── Contents.json ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Info.plist └── ViewController.swift /README.md: -------------------------------------------------------------------------------- 1 | #### 昨天闲来无事,对着自己的iPhone6s,准备给IT江湖加入3D Touch吧!! 2 | 3 | 没有6s的 模拟器也可以测试,按照@conradev 的SBShortcutMenuSimulator测试 4 | 5 | 项目地址:https://github.com/DeskConnect/SBShortcutMenuSimulator.git 6 | 7 | * icon 重按弹出菜单 8 | * tableView Cell 轻按按预览文章详情 9 | * tableView Cell 轻按按预览文章详情,上滑底部显示Action 10 | * tableView Cell 轻按按预览文章详情,重按进入文章详情页 11 | 12 | ### 效果图 13 |

14 | 15 | 16 | 17 | 18 |

19 | 20 | 完整的3D Touch 动画视频 21 | 22 | ## icon 重按弹出菜单 23 | 24 | 代码片段: 25 | 26 | 在`AppleDelegate`文件中 27 | 28 | ```swift 29 | 30 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 31 | // Override point for customization after application launch. 32 | 33 | //添加icon 3d Touch 34 | let firstItemIcon:UIApplicationShortcutIcon = UIApplicationShortcutIcon(type: .Share) 35 | let firstItem = UIMutableApplicationShortcutItem(type: "1", localizedTitle: "分享", localizedSubtitle: nil, icon: firstItemIcon, userInfo: nil) 36 | 37 | let firstItemIcon1:UIApplicationShortcutIcon = UIApplicationShortcutIcon(type: .Compose) 38 | let firstItem1 = UIMutableApplicationShortcutItem(type: "2", localizedTitle: "编辑", localizedSubtitle: nil, icon: firstItemIcon1, userInfo: nil) 39 | 40 | 41 | application.shortcutItems = [firstItem,firstItem1] 42 | 43 | return true 44 | } 45 | 46 | /** 47 | 3D Touch 跳转 48 | 49 | - parameter application: application 50 | - parameter shortcutItem: item 51 | - parameter completionHandler: handler 52 | */ 53 | func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem, completionHandler: (Bool) -> Void) { 54 | 55 | let handledShortCutItem = handleShortCutItem(shortcutItem) 56 | completionHandler(handledShortCutItem) 57 | 58 | } 59 | 60 | func handleShortCutItem(shortcutItem: UIApplicationShortcutItem) -> Bool { 61 | var handled = false 62 | 63 | if shortcutItem.type == "1" { //分享 64 | 65 | let rootNavigationViewController = window!.rootViewController as? UINavigationController 66 | let rootViewController = rootNavigationViewController?.viewControllers.first as UIViewController? 67 | 68 | rootNavigationViewController?.popToRootViewControllerAnimated(false) 69 | rootViewController?.performSegueWithIdentifier("toShare", sender: nil) 70 | handled = true 71 | 72 | } 73 | 74 | if shortcutItem.type == "2" { //编辑 75 | 76 | let rootNavigationViewController = window!.rootViewController as? UINavigationController 77 | let rootViewController = rootNavigationViewController?.viewControllers.first as UIViewController? 78 | 79 | rootNavigationViewController?.popToRootViewControllerAnimated(false) 80 | rootViewController?.performSegueWithIdentifier("toCompose", sender: nil) 81 | handled = true 82 | 83 | } 84 | return handled 85 | } 86 | ``` 87 | ## tableView Cell 轻按预览文章详情 重按进入详情页 88 | 89 | 代码片段: 90 | 91 | ```swift 92 | 93 | // MARK: 3D Touch Delegate 94 | 95 | /** 96 | 轻按进入浮动页面 97 | 98 | - parameter previewingContext: previewingContext description 99 | - parameter location: location description 100 | 101 | - returns: 文章详情页 浮动页 102 | */ 103 | func previewingContext(previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? { 104 | 105 | 106 | // Get indexPath for location (CGPoint) + cell (for sourceRect) 107 | guard let indexPath = tableView.indexPathForRowAtPoint(location), 108 | _ = tableView.cellForRowAtIndexPath(indexPath) else { return nil } 109 | 110 | // Instantiate VC with Identifier (Storyboard ID) 111 | guard let myVC = storyboard?.instantiateViewControllerWithIdentifier("ArtilceShowView") as? ArticleShowViewController else { return nil } 112 | 113 | myVC.urlStr = "https://www.baidu.com" 114 | 115 | let cellFrame = tableView.cellForRowAtIndexPath(indexPath)!.frame 116 | 117 | previewingContext.sourceRect = view.convertRect(cellFrame, fromView: tableView) 118 | 119 | return myVC 120 | } 121 | 122 | /** 123 | 重按进入文章详情页 124 | 125 | - parameter previewingContext: previewingContext description 126 | - parameter viewControllerToCommit: viewControllerToCommit description 127 | */ 128 | func previewingContext(previewingContext: UIViewControllerPreviewing, commitViewController viewControllerToCommit: UIViewController) { 129 | self.showViewController(viewControllerToCommit, sender: self) 130 | 131 | 132 | } 133 | ``` 134 | 更多代码查看`ArticlesTableViewController`文件 135 | 136 | ## 详情页 上滑出现 赞 分享 137 | 138 | ```swift 139 | override func previewActionItems() -> [UIPreviewActionItem] { 140 | 141 | let action1 = UIPreviewAction(title: "赞", style: .Default) { (_, _) -> Void in 142 | 143 | print("点击了赞") 144 | 145 | } 146 | 147 | let action2 = UIPreviewAction(title: "分享", style: .Default) { (_, _) -> Void in 148 | 149 | print("点击了分享") 150 | 151 | } 152 | 153 | let actions = [action1,action2] 154 | 155 | return actions 156 | 157 | } 158 | ``` 159 | 160 | 161 | -------------------------------------------------------------------------------- /itjh_3dTouch.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | AB7344B61BB919010073973D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB7344B51BB919010073973D /* AppDelegate.swift */; }; 11 | AB7344B81BB919010073973D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB7344B71BB919010073973D /* ViewController.swift */; }; 12 | AB7344BB1BB919010073973D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB7344B91BB919010073973D /* Main.storyboard */; }; 13 | AB7344BD1BB919010073973D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AB7344BC1BB919010073973D /* Assets.xcassets */; }; 14 | AB7344C01BB919010073973D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB7344BE1BB919010073973D /* LaunchScreen.storyboard */; }; 15 | AB7344C81BB919670073973D /* ArticlesTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB7344C71BB919670073973D /* ArticlesTableViewController.swift */; settings = {ASSET_TAGS = (); }; }; 16 | AB7344CA1BB91A910073973D /* ArticleTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB7344C91BB91A910073973D /* ArticleTableViewCell.swift */; settings = {ASSET_TAGS = (); }; }; 17 | AB7344CC1BB923E30073973D /* ArticleShowViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB7344CB1BB923E30073973D /* ArticleShowViewController.swift */; settings = {ASSET_TAGS = (); }; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | AB7344B21BB919010073973D /* itjh_3dTouch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = itjh_3dTouch.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | AB7344B51BB919010073973D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 23 | AB7344B71BB919010073973D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 24 | AB7344BA1BB919010073973D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 25 | AB7344BC1BB919010073973D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 26 | AB7344BF1BB919010073973D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 27 | AB7344C11BB919010073973D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 28 | AB7344C71BB919670073973D /* ArticlesTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArticlesTableViewController.swift; sourceTree = ""; }; 29 | AB7344C91BB91A910073973D /* ArticleTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArticleTableViewCell.swift; sourceTree = ""; }; 30 | AB7344CB1BB923E30073973D /* ArticleShowViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArticleShowViewController.swift; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | AB7344AF1BB919010073973D /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | ); 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXFrameworksBuildPhase section */ 42 | 43 | /* Begin PBXGroup section */ 44 | AB7344A91BB919010073973D = { 45 | isa = PBXGroup; 46 | children = ( 47 | AB7344B41BB919010073973D /* itjh_3dTouch */, 48 | AB7344B31BB919010073973D /* Products */, 49 | ); 50 | sourceTree = ""; 51 | }; 52 | AB7344B31BB919010073973D /* Products */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | AB7344B21BB919010073973D /* itjh_3dTouch.app */, 56 | ); 57 | name = Products; 58 | sourceTree = ""; 59 | }; 60 | AB7344B41BB919010073973D /* itjh_3dTouch */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | AB7344B51BB919010073973D /* AppDelegate.swift */, 64 | AB7344B71BB919010073973D /* ViewController.swift */, 65 | AB7344B91BB919010073973D /* Main.storyboard */, 66 | AB7344BC1BB919010073973D /* Assets.xcassets */, 67 | AB7344BE1BB919010073973D /* LaunchScreen.storyboard */, 68 | AB7344C11BB919010073973D /* Info.plist */, 69 | AB7344C71BB919670073973D /* ArticlesTableViewController.swift */, 70 | AB7344C91BB91A910073973D /* ArticleTableViewCell.swift */, 71 | AB7344CB1BB923E30073973D /* ArticleShowViewController.swift */, 72 | ); 73 | path = itjh_3dTouch; 74 | sourceTree = ""; 75 | }; 76 | /* End PBXGroup section */ 77 | 78 | /* Begin PBXNativeTarget section */ 79 | AB7344B11BB919010073973D /* itjh_3dTouch */ = { 80 | isa = PBXNativeTarget; 81 | buildConfigurationList = AB7344C41BB919010073973D /* Build configuration list for PBXNativeTarget "itjh_3dTouch" */; 82 | buildPhases = ( 83 | AB7344AE1BB919010073973D /* Sources */, 84 | AB7344AF1BB919010073973D /* Frameworks */, 85 | AB7344B01BB919010073973D /* Resources */, 86 | ); 87 | buildRules = ( 88 | ); 89 | dependencies = ( 90 | ); 91 | name = itjh_3dTouch; 92 | productName = itjh_3dTouch; 93 | productReference = AB7344B21BB919010073973D /* itjh_3dTouch.app */; 94 | productType = "com.apple.product-type.application"; 95 | }; 96 | /* End PBXNativeTarget section */ 97 | 98 | /* Begin PBXProject section */ 99 | AB7344AA1BB919010073973D /* Project object */ = { 100 | isa = PBXProject; 101 | attributes = { 102 | LastUpgradeCheck = 0700; 103 | ORGANIZATIONNAME = Songlijun; 104 | TargetAttributes = { 105 | AB7344B11BB919010073973D = { 106 | CreatedOnToolsVersion = 7.0; 107 | }; 108 | }; 109 | }; 110 | buildConfigurationList = AB7344AD1BB919010073973D /* Build configuration list for PBXProject "itjh_3dTouch" */; 111 | compatibilityVersion = "Xcode 3.2"; 112 | developmentRegion = English; 113 | hasScannedForEncodings = 0; 114 | knownRegions = ( 115 | en, 116 | Base, 117 | ); 118 | mainGroup = AB7344A91BB919010073973D; 119 | productRefGroup = AB7344B31BB919010073973D /* Products */; 120 | projectDirPath = ""; 121 | projectRoot = ""; 122 | targets = ( 123 | AB7344B11BB919010073973D /* itjh_3dTouch */, 124 | ); 125 | }; 126 | /* End PBXProject section */ 127 | 128 | /* Begin PBXResourcesBuildPhase section */ 129 | AB7344B01BB919010073973D /* Resources */ = { 130 | isa = PBXResourcesBuildPhase; 131 | buildActionMask = 2147483647; 132 | files = ( 133 | AB7344C01BB919010073973D /* LaunchScreen.storyboard in Resources */, 134 | AB7344BD1BB919010073973D /* Assets.xcassets in Resources */, 135 | AB7344BB1BB919010073973D /* Main.storyboard in Resources */, 136 | ); 137 | runOnlyForDeploymentPostprocessing = 0; 138 | }; 139 | /* End PBXResourcesBuildPhase section */ 140 | 141 | /* Begin PBXSourcesBuildPhase section */ 142 | AB7344AE1BB919010073973D /* Sources */ = { 143 | isa = PBXSourcesBuildPhase; 144 | buildActionMask = 2147483647; 145 | files = ( 146 | AB7344CA1BB91A910073973D /* ArticleTableViewCell.swift in Sources */, 147 | AB7344CC1BB923E30073973D /* ArticleShowViewController.swift in Sources */, 148 | AB7344C81BB919670073973D /* ArticlesTableViewController.swift in Sources */, 149 | AB7344B81BB919010073973D /* ViewController.swift in Sources */, 150 | AB7344B61BB919010073973D /* AppDelegate.swift in Sources */, 151 | ); 152 | runOnlyForDeploymentPostprocessing = 0; 153 | }; 154 | /* End PBXSourcesBuildPhase section */ 155 | 156 | /* Begin PBXVariantGroup section */ 157 | AB7344B91BB919010073973D /* Main.storyboard */ = { 158 | isa = PBXVariantGroup; 159 | children = ( 160 | AB7344BA1BB919010073973D /* Base */, 161 | ); 162 | name = Main.storyboard; 163 | sourceTree = ""; 164 | }; 165 | AB7344BE1BB919010073973D /* LaunchScreen.storyboard */ = { 166 | isa = PBXVariantGroup; 167 | children = ( 168 | AB7344BF1BB919010073973D /* Base */, 169 | ); 170 | name = LaunchScreen.storyboard; 171 | sourceTree = ""; 172 | }; 173 | /* End PBXVariantGroup section */ 174 | 175 | /* Begin XCBuildConfiguration section */ 176 | AB7344C21BB919010073973D /* Debug */ = { 177 | isa = XCBuildConfiguration; 178 | buildSettings = { 179 | ALWAYS_SEARCH_USER_PATHS = NO; 180 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 181 | CLANG_CXX_LIBRARY = "libc++"; 182 | CLANG_ENABLE_MODULES = YES; 183 | CLANG_ENABLE_OBJC_ARC = YES; 184 | CLANG_WARN_BOOL_CONVERSION = YES; 185 | CLANG_WARN_CONSTANT_CONVERSION = YES; 186 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 187 | CLANG_WARN_EMPTY_BODY = YES; 188 | CLANG_WARN_ENUM_CONVERSION = YES; 189 | CLANG_WARN_INT_CONVERSION = YES; 190 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 191 | CLANG_WARN_UNREACHABLE_CODE = YES; 192 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 193 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 194 | COPY_PHASE_STRIP = NO; 195 | DEBUG_INFORMATION_FORMAT = dwarf; 196 | ENABLE_STRICT_OBJC_MSGSEND = YES; 197 | ENABLE_TESTABILITY = YES; 198 | GCC_C_LANGUAGE_STANDARD = gnu99; 199 | GCC_DYNAMIC_NO_PIC = NO; 200 | GCC_NO_COMMON_BLOCKS = YES; 201 | GCC_OPTIMIZATION_LEVEL = 0; 202 | GCC_PREPROCESSOR_DEFINITIONS = ( 203 | "DEBUG=1", 204 | "$(inherited)", 205 | ); 206 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 207 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 208 | GCC_WARN_UNDECLARED_SELECTOR = YES; 209 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 210 | GCC_WARN_UNUSED_FUNCTION = YES; 211 | GCC_WARN_UNUSED_VARIABLE = YES; 212 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 213 | MTL_ENABLE_DEBUG_INFO = YES; 214 | ONLY_ACTIVE_ARCH = YES; 215 | SDKROOT = iphoneos; 216 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 217 | }; 218 | name = Debug; 219 | }; 220 | AB7344C31BB919010073973D /* Release */ = { 221 | isa = XCBuildConfiguration; 222 | buildSettings = { 223 | ALWAYS_SEARCH_USER_PATHS = NO; 224 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 225 | CLANG_CXX_LIBRARY = "libc++"; 226 | CLANG_ENABLE_MODULES = YES; 227 | CLANG_ENABLE_OBJC_ARC = YES; 228 | CLANG_WARN_BOOL_CONVERSION = YES; 229 | CLANG_WARN_CONSTANT_CONVERSION = YES; 230 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 231 | CLANG_WARN_EMPTY_BODY = YES; 232 | CLANG_WARN_ENUM_CONVERSION = YES; 233 | CLANG_WARN_INT_CONVERSION = YES; 234 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 235 | CLANG_WARN_UNREACHABLE_CODE = YES; 236 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 237 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 238 | COPY_PHASE_STRIP = NO; 239 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 240 | ENABLE_NS_ASSERTIONS = NO; 241 | ENABLE_STRICT_OBJC_MSGSEND = YES; 242 | GCC_C_LANGUAGE_STANDARD = gnu99; 243 | GCC_NO_COMMON_BLOCKS = YES; 244 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 245 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 246 | GCC_WARN_UNDECLARED_SELECTOR = YES; 247 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 248 | GCC_WARN_UNUSED_FUNCTION = YES; 249 | GCC_WARN_UNUSED_VARIABLE = YES; 250 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 251 | MTL_ENABLE_DEBUG_INFO = NO; 252 | SDKROOT = iphoneos; 253 | VALIDATE_PRODUCT = YES; 254 | }; 255 | name = Release; 256 | }; 257 | AB7344C51BB919010073973D /* Debug */ = { 258 | isa = XCBuildConfiguration; 259 | buildSettings = { 260 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 261 | INFOPLIST_FILE = itjh_3dTouch/Info.plist; 262 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 263 | PRODUCT_BUNDLE_IDENTIFIER = "net.itjh.itjh-3dTouch"; 264 | PRODUCT_NAME = "$(TARGET_NAME)"; 265 | }; 266 | name = Debug; 267 | }; 268 | AB7344C61BB919010073973D /* Release */ = { 269 | isa = XCBuildConfiguration; 270 | buildSettings = { 271 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 272 | INFOPLIST_FILE = itjh_3dTouch/Info.plist; 273 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 274 | PRODUCT_BUNDLE_IDENTIFIER = "net.itjh.itjh-3dTouch"; 275 | PRODUCT_NAME = "$(TARGET_NAME)"; 276 | }; 277 | name = Release; 278 | }; 279 | /* End XCBuildConfiguration section */ 280 | 281 | /* Begin XCConfigurationList section */ 282 | AB7344AD1BB919010073973D /* Build configuration list for PBXProject "itjh_3dTouch" */ = { 283 | isa = XCConfigurationList; 284 | buildConfigurations = ( 285 | AB7344C21BB919010073973D /* Debug */, 286 | AB7344C31BB919010073973D /* Release */, 287 | ); 288 | defaultConfigurationIsVisible = 0; 289 | defaultConfigurationName = Release; 290 | }; 291 | AB7344C41BB919010073973D /* Build configuration list for PBXNativeTarget "itjh_3dTouch" */ = { 292 | isa = XCConfigurationList; 293 | buildConfigurations = ( 294 | AB7344C51BB919010073973D /* Debug */, 295 | AB7344C61BB919010073973D /* Release */, 296 | ); 297 | defaultConfigurationIsVisible = 0; 298 | }; 299 | /* End XCConfigurationList section */ 300 | }; 301 | rootObject = AB7344AA1BB919010073973D /* Project object */; 302 | } 303 | -------------------------------------------------------------------------------- /itjh_3dTouch.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /itjh_3dTouch.xcodeproj/project.xcworkspace/xcuserdata/songlijun.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itjhDev/itjh_3DTouch/3ae4def2c766809d5667ed79353c0907367389b9/itjh_3dTouch.xcodeproj/project.xcworkspace/xcuserdata/songlijun.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /itjh_3dTouch.xcodeproj/xcuserdata/songlijun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /itjh_3dTouch.xcodeproj/xcuserdata/songlijun.xcuserdatad/xcschemes/itjh_3dTouch.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /itjh_3dTouch.xcodeproj/xcuserdata/songlijun.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | itjh_3dTouch.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | AB7344B11BB919010073973D 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /itjh_3dTouch/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // itjh_3dTouch 4 | // 5 | // Created by Songlijun on 15/9/28. 6 | // Copyright © 2015年 Songlijun. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | 20 | //添加icon 3d Touch 21 | let firstItemIcon:UIApplicationShortcutIcon = UIApplicationShortcutIcon(type: .Share) 22 | let firstItem = UIMutableApplicationShortcutItem(type: "1", localizedTitle: "分享", localizedSubtitle: nil, icon: firstItemIcon, userInfo: nil) 23 | 24 | let firstItemIcon1:UIApplicationShortcutIcon = UIApplicationShortcutIcon(type: .Compose) 25 | let firstItem1 = UIMutableApplicationShortcutItem(type: "2", localizedTitle: "编辑", localizedSubtitle: nil, icon: firstItemIcon1, userInfo: nil) 26 | 27 | 28 | application.shortcutItems = [firstItem,firstItem1] 29 | 30 | return true 31 | } 32 | 33 | /** 34 | 3D Touch 跳转 35 | 36 | - parameter application: application 37 | - parameter shortcutItem: item 38 | - parameter completionHandler: handler 39 | */ 40 | func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem, completionHandler: (Bool) -> Void) { 41 | 42 | let handledShortCutItem = handleShortCutItem(shortcutItem) 43 | completionHandler(handledShortCutItem) 44 | 45 | } 46 | 47 | func handleShortCutItem(shortcutItem: UIApplicationShortcutItem) -> Bool { 48 | var handled = false 49 | 50 | if shortcutItem.type == "1" { //分享 51 | 52 | let rootNavigationViewController = window!.rootViewController as? UINavigationController 53 | let rootViewController = rootNavigationViewController?.viewControllers.first as UIViewController? 54 | 55 | rootNavigationViewController?.popToRootViewControllerAnimated(false) 56 | rootViewController?.performSegueWithIdentifier("toShare", sender: nil) 57 | handled = true 58 | 59 | } 60 | 61 | if shortcutItem.type == "2" { //编辑 62 | 63 | let rootNavigationViewController = window!.rootViewController as? UINavigationController 64 | let rootViewController = rootNavigationViewController?.viewControllers.first as UIViewController? 65 | 66 | rootNavigationViewController?.popToRootViewControllerAnimated(false) 67 | rootViewController?.performSegueWithIdentifier("toCompose", sender: nil) 68 | handled = true 69 | 70 | } 71 | return handled 72 | } 73 | 74 | 75 | 76 | func applicationWillResignActive(application: UIApplication) { 77 | // 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. 78 | // 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. 79 | } 80 | 81 | func applicationDidEnterBackground(application: UIApplication) { 82 | // 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. 83 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 84 | } 85 | 86 | func applicationWillEnterForeground(application: UIApplication) { 87 | // 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. 88 | } 89 | 90 | func applicationDidBecomeActive(application: UIApplication) { 91 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 92 | } 93 | 94 | func applicationWillTerminate(application: UIApplication) { 95 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 96 | } 97 | 98 | 99 | } 100 | 101 | -------------------------------------------------------------------------------- /itjh_3dTouch/ArticleShowViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ArticleShowViewController.swift 3 | // itjh_3dTouch 4 | // 5 | // Created by Songlijun on 15/9/28. 6 | // Copyright © 2015年 Songlijun. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ArticleShowViewController: UIViewController { 12 | 13 | var urlStr = "" 14 | 15 | @IBOutlet weak var articleWebView: UIWebView! 16 | override func viewDidLoad() { 17 | super.viewDidLoad() 18 | 19 | self.check3DTouch() 20 | 21 | if urlStr.isEmpty { 22 | urlStr = "https://github.com" 23 | } 24 | 25 | let url = NSURL(string: urlStr) 26 | 27 | let request = NSURLRequest(URL: url!) 28 | 29 | articleWebView.loadRequest(request) 30 | 31 | // Do any additional setup after loading the view. 32 | } 33 | 34 | override func didReceiveMemoryWarning() { 35 | super.didReceiveMemoryWarning() 36 | // Dispose of any resources that can be recreated. 37 | } 38 | 39 | /** 40 | 检测3D Touch 41 | */ 42 | func check3DTouch() { 43 | if self.traitCollection.forceTouchCapability != UIForceTouchCapability.Available { 44 | 45 | let tap = UITapGestureRecognizer(target: self, action: "dismissMe:") 46 | self.view.addGestureRecognizer(tap) 47 | 48 | } 49 | 50 | } 51 | 52 | func dismissMe(){ 53 | 54 | self.dismissViewControllerAnimated(true, completion: nil) 55 | } 56 | 57 | 58 | 59 | override func previewActionItems() -> [UIPreviewActionItem] { 60 | 61 | let action1 = UIPreviewAction(title: "赞", style: .Default) { (_, _) -> Void in 62 | 63 | print("点击了赞") 64 | 65 | } 66 | 67 | let action2 = UIPreviewAction(title: "分享", style: .Default) { (_, _) -> Void in 68 | 69 | print("点击了分享") 70 | 71 | } 72 | 73 | let actions = [action1,action2] 74 | 75 | return actions 76 | 77 | } 78 | 79 | /* 80 | // MARK: - Navigation 81 | 82 | // In a storyboard-based application, you will often want to do a little preparation before navigation 83 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 84 | // Get the new view controller using segue.destinationViewController. 85 | // Pass the selected object to the new view controller. 86 | } 87 | */ 88 | 89 | } 90 | -------------------------------------------------------------------------------- /itjh_3dTouch/ArticleTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ArticleTableViewCell.swift 3 | // itjh_3dTouch 4 | // 5 | // Created by Songlijun on 15/9/28. 6 | // Copyright © 2015年 Songlijun. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ArticleTableViewCell: UITableViewCell { 12 | 13 | @IBOutlet weak var title: UILabel! 14 | 15 | 16 | override func awakeFromNib() { 17 | super.awakeFromNib() 18 | // Initialization code 19 | } 20 | 21 | override func setSelected(selected: Bool, animated: Bool) { 22 | super.setSelected(selected, animated: animated) 23 | 24 | // Configure the view for the selected state 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /itjh_3dTouch/ArticlesTableViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ArticlesTableViewController.swift 3 | // itjh_3dTouch 4 | // 5 | // Created by Songlijun on 15/9/28. 6 | // Copyright © 2015年 Songlijun. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | 13 | class ArticlesTableViewController: UITableViewController,UIViewControllerPreviewingDelegate { 14 | 15 | // UILongPressGestureRecognizer *longPress; 16 | 17 | // 长按手势 18 | var longPress = UILongPressGestureRecognizer() 19 | 20 | override func viewDidLoad() { 21 | super.viewDidLoad() 22 | 23 | // Uncomment the following line to preserve selection between presentations 24 | // self.clearsSelectionOnViewWillAppear = false 25 | 26 | // Uncomment the following line to display an Edit button in the navigation bar for this view controller. 27 | // self.navigationItem.rightBarButtonItem = self.editButtonItem() 28 | } 29 | 30 | 31 | 32 | override func viewWillAppear(animated: Bool) { 33 | //检测3D Touch 34 | 35 | check3DTouch() 36 | 37 | } 38 | 39 | /** 40 | 检测页面是否处于3DTouch 41 | */ 42 | func check3DTouch(){ 43 | 44 | if self.traitCollection.forceTouchCapability == UIForceTouchCapability.Available { 45 | 46 | self.registerForPreviewingWithDelegate(self, sourceView: self.view) 47 | print("3D Touch 开启") 48 | //长按停止 49 | self.longPress.enabled = false 50 | 51 | } else { 52 | print("3D Touch 没有开启") 53 | self.longPress.enabled = true 54 | } 55 | } 56 | 57 | 58 | // MARK: 3D Touch Delegate 59 | 60 | /** 61 | 轻按进入浮动页面 62 | 63 | - parameter previewingContext: previewingContext description 64 | - parameter location: location description 65 | 66 | - returns: 文章详情页 浮动页 67 | */ 68 | func previewingContext(previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? { 69 | 70 | 71 | // Get indexPath for location (CGPoint) + cell (for sourceRect) 72 | guard let indexPath = tableView.indexPathForRowAtPoint(location), 73 | _ = tableView.cellForRowAtIndexPath(indexPath) else { return nil } 74 | 75 | // Instantiate VC with Identifier (Storyboard ID) 76 | guard let myVC = storyboard?.instantiateViewControllerWithIdentifier("ArtilceShowView") as? ArticleShowViewController else { return nil } 77 | 78 | myVC.urlStr = "https://www.baidu.com" 79 | 80 | let cellFrame = tableView.cellForRowAtIndexPath(indexPath)!.frame 81 | 82 | previewingContext.sourceRect = view.convertRect(cellFrame, fromView: tableView) 83 | 84 | return myVC 85 | } 86 | 87 | /** 88 | 重按进入文章详情页 89 | 90 | - parameter previewingContext: previewingContext description 91 | - parameter viewControllerToCommit: viewControllerToCommit description 92 | */ 93 | func previewingContext(previewingContext: UIViewControllerPreviewing, commitViewController viewControllerToCommit: UIViewController) { 94 | self.showViewController(viewControllerToCommit, sender: self) 95 | 96 | 97 | } 98 | 99 | 100 | override func didReceiveMemoryWarning() { 101 | super.didReceiveMemoryWarning() 102 | // Dispose of any resources that can be recreated. 103 | } 104 | 105 | // MARK: - Table view data source 106 | 107 | override func numberOfSectionsInTableView(tableView: UITableView) -> Int { 108 | // #warning Incomplete implementation, return the number of sections 109 | return 1 110 | } 111 | 112 | override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 113 | // #warning Incomplete implementation, return the number of rows 114 | return 10 115 | } 116 | 117 | 118 | override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 119 | let cell = tableView.dequeueReusableCellWithIdentifier("ArticleCell", forIndexPath: indexPath) as! ArticleTableViewCell 120 | 121 | cell.title.text = "IT江湖,每一个IT人的江湖\(indexPath.row)" 122 | 123 | // Configure the cell... 124 | 125 | return cell 126 | } 127 | 128 | 129 | override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 130 | 131 | print("点击了\(indexPath.row)") 132 | 133 | check3DTouch() 134 | 135 | } 136 | 137 | 138 | //MARK: 3D Touch Alternative 139 | 140 | /** 141 | 显示Peek 142 | */ 143 | func showPeek(){ 144 | 145 | self.longPress.enabled = false 146 | let stotyboard = UIStoryboard(name: "Main", bundle: nil) 147 | 148 | let articleShowController = stotyboard.instantiateViewControllerWithIdentifier("ArtilceShowView") as! ArticleShowViewController 149 | 150 | let article = self.grabTopViewController() 151 | 152 | article.showViewController(articleShowController, sender: self) 153 | 154 | } 155 | 156 | 157 | /** 158 | 3D Touch top滑动 159 | 160 | - returns: top页面 161 | */ 162 | func grabTopViewController() -> UIViewController { 163 | 164 | var top = UIApplication.sharedApplication().keyWindow?.rootViewController 165 | 166 | while (top!.presentedViewController != nil) { 167 | top = top!.presentedViewController 168 | } 169 | 170 | return top! 171 | } 172 | 173 | 174 | 175 | /* 176 | // Override to support conditional editing of the table view. 177 | override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool { 178 | // Return false if you do not want the specified item to be editable. 179 | return true 180 | } 181 | */ 182 | 183 | /* 184 | // Override to support editing the table view. 185 | override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { 186 | if editingStyle == .Delete { 187 | // Delete the row from the data source 188 | tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) 189 | } else if editingStyle == .Insert { 190 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view 191 | } 192 | } 193 | */ 194 | 195 | /* 196 | // Override to support rearranging the table view. 197 | override func tableView(tableView: UITableView, moveRowAtIndexPath fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) { 198 | 199 | } 200 | */ 201 | 202 | /* 203 | // Override to support conditional rearranging of the table view. 204 | override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool { 205 | // Return false if you do not want the item to be re-orderable. 206 | return true 207 | } 208 | */ 209 | 210 | 211 | // MARK: - Navigation 212 | 213 | // In a storyboard-based application, you will often want to do a little preparation before navigation 214 | // override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 215 | // 216 | // if segue.identifier == "toArticleShow" { 217 | // check3DTouch() 218 | // } 219 | // 220 | // } 221 | 222 | 223 | } 224 | -------------------------------------------------------------------------------- /itjh_3dTouch/Assets.xcassets/AppIcon.appiconset/AppIcon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itjhDev/itjh_3DTouch/3ae4def2c766809d5667ed79353c0907367389b9/itjh_3dTouch/Assets.xcassets/AppIcon.appiconset/AppIcon-60@2x.png -------------------------------------------------------------------------------- /itjh_3dTouch/Assets.xcassets/AppIcon.appiconset/AppIcon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itjhDev/itjh_3DTouch/3ae4def2c766809d5667ed79353c0907367389b9/itjh_3dTouch/Assets.xcassets/AppIcon.appiconset/AppIcon-60@3x.png -------------------------------------------------------------------------------- /itjh_3dTouch/Assets.xcassets/AppIcon.appiconset/AppIcon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itjhDev/itjh_3DTouch/3ae4def2c766809d5667ed79353c0907367389b9/itjh_3dTouch/Assets.xcassets/AppIcon.appiconset/AppIcon-Small@2x.png -------------------------------------------------------------------------------- /itjh_3dTouch/Assets.xcassets/AppIcon.appiconset/AppIcon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itjhDev/itjh_3DTouch/3ae4def2c766809d5667ed79353c0907367389b9/itjh_3dTouch/Assets.xcassets/AppIcon.appiconset/AppIcon-Small@3x.png -------------------------------------------------------------------------------- /itjh_3dTouch/Assets.xcassets/AppIcon.appiconset/AppIcon-Spotlight-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itjhDev/itjh_3DTouch/3ae4def2c766809d5667ed79353c0907367389b9/itjh_3dTouch/Assets.xcassets/AppIcon.appiconset/AppIcon-Spotlight-40@2x.png -------------------------------------------------------------------------------- /itjh_3dTouch/Assets.xcassets/AppIcon.appiconset/AppIcon-Spotlight-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itjhDev/itjh_3DTouch/3ae4def2c766809d5667ed79353c0907367389b9/itjh_3dTouch/Assets.xcassets/AppIcon.appiconset/AppIcon-Spotlight-40@3x.png -------------------------------------------------------------------------------- /itjh_3dTouch/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "AppIcon-Small@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "AppIcon-Small@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "AppIcon-Spotlight-40@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "AppIcon-Spotlight-40@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "60x60", 29 | "idiom" : "iphone", 30 | "filename" : "AppIcon-60@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "AppIcon-60@3x.png", 37 | "scale" : "3x" 38 | } 39 | ], 40 | "info" : { 41 | "version" : 1, 42 | "author" : "xcode" 43 | } 44 | } -------------------------------------------------------------------------------- /itjh_3dTouch/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /itjh_3dTouch/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 | -------------------------------------------------------------------------------- /itjh_3dTouch/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 | 31 | 39 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 96 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | -------------------------------------------------------------------------------- /itjh_3dTouch/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 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | NSAppTransportSecurity 34 | 35 | NSAllowsArbitraryLoads 36 | 37 | 38 | UISupportedInterfaceOrientations 39 | 40 | UIInterfaceOrientationPortrait 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /itjh_3dTouch/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // itjh_3dTouch 4 | // 5 | // Created by Songlijun on 15/9/28. 6 | // Copyright © 2015年 Songlijun. 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 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | 24 | } 25 | 26 | --------------------------------------------------------------------------------