Xcode7.0 iOS 9.0 Touch 3d demo

好久没有写文章,今天刚拿到iphone6s手机,写个demo  ,如题

     1.先用Xcode7.0新建一个项目,在plist里面  source code追加:


    

<key>UIApplicationShortcutItems</key>
	<array>
		<dict>
			<key>UIApplicationShortcutItemIconType</key>
			<string>UIApplicationShortcutIconTypePlay</string>
			<key>UIApplicationShortcutItemType</key>
			<string>modelId1</string>
			<key>UIApplicationShortcutItemTitle</key>
			<string>播放</string>
		</dict>
		<dict>
			<key>UIApplicationShortcutItemIconType</key>
			<string>UIApplicationShortcutIconTypeAdd</string>
			<key>UIApplicationShortcutItemType</key>
			<string>modelId2</string>
			<key>UIApplicationShortcutItemTitle</key>
			<string>添加</string>
		</dict>
	</array>


或者如图:



2.在appdelegate文件加入:

- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler
{

    if([shortcutItem.type isEqualToString:@"modelId1"]){
        
        //ToDo 业务逻辑
    }
}

如图:



3.别的我不说了,running

效果图如下:



ps: popview里面的图标是可以自定义的,毕竟系统太丑了


touch 3d 不错的链接     


版权声明:本文为Folish_Audi原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。