zoukankan      html  css  js  c++  java
  • ios9 -3dtouch 手势添加到app上

    模拟器实现3dtouch参考以下网站:
    http://my.oschina.net/u/2340880/blog/511509



    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UIApplicationShortcutIcon *icon1 = [UIApplicationShortcutIcon iconWithTemplateImageName:@"app_c_s_1"]; UIApplicationShortcutIcon *icon2 = [UIApplicationShortcutIcon iconWithTemplateImageName:@"app_c_s_2"]; UIApplicationShortcutIcon *icon3 = [UIApplicationShortcutIcon iconWithTemplateImageName:@"app_c_s_3"]; UIMutableApplicationShortcutItem *item1 = [[UIMutableApplicationShortcutItem alloc]initWithType:@"1" localizedTitle:@"One" localizedSubtitle:@"" icon:icon1 userInfo:nil]; UIMutableApplicationShortcutItem *item2 = [[UIMutableApplicationShortcutItem alloc]initWithType:@"2" localizedTitle:@"Two" localizedSubtitle:@"" icon:icon2 userInfo:nil]; UIMutableApplicationShortcutItem *item3 = [[UIMutableApplicationShortcutItem alloc]initWithType:@"3" localizedTitle:@"Three" localizedSubtitle:@"" icon:icon3 userInfo:nil]; NSArray *items = @[item1, item2, item3]; [UIApplication sharedApplication].shortcutItems = items; } - (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler { if([shortcutItem.type isEqualToString:@"1"]){ NSLog(@"执行代码1"); } else if ([shortcutItem.type isEqualToString:@"2"]) { NSLog(@"执行代码2"); } else if ([shortcutItem.type isEqualToString:@"3"]) { NSLog(@"执行代码3"); } }

     

     

     

     

  • 相关阅读:
    Spring
    Spring
    Spring
    Spring
    JS 脱敏通用方法
    JS 实用技巧记录
    多快?好省!
    实战 | 如何使用微搭低代码实现按条件过滤数据
    2021腾讯数字生态大会落地武汉,微搭低代码专场等你来
    实战 | 如何使用微信云托管部署flask项目
  • 原文地址:https://www.cnblogs.com/thbbsky/p/4992320.html
Copyright © 2011-2022 走看看