zoukankan      html  css  js  c++  java
  • 3D touch

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

        // Override point for customization after application launch.

        

        //判断是否支持3D Touch功能

        if (self.window.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable) {

            // 动态添加标签

            UIApplicationShortcutIcon *icon = [UIApplicationShortcutIcon iconWithTemplateImageName:@"扫码图标"];

            UIApplicationShortcutItem *shortItem1 = [[UIApplicationShortcutItem alloc] initWithType:@"扫码" localizedTitle:@"扫码" localizedSubtitle:nil icon:icon userInfo:nil];

            NSArray *shortItems = [[NSArray alloc] initWithObjects:shortItem1, nil];

            NSLog(@"%@", shortItems);

            [[UIApplication sharedApplication] setShortcutItems:shortItems];

        }

        

        return YES;

    }

     

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

        if ([shortcutItem.localizedTitle  isEqual: @"扫码"]) {

            

            NSLog(@"打开扫码界面");

            

            ViewController *controller = (ViewController *)self.window.rootViewController;

            [controller goScanne];

            

            return;

        }

    }

     

    其他链接:

    http://blog.csdn.net/a416863220/article/details/51217465

     

     

     

  • 相关阅读:
    Fixed Function Shader
    sqlserver 2014 数据库作业 通过脚本创建注意事项
    块存储、文件存储、对象存储意义及差异
    程序员如何成为架构师
    那些编程水平很高的程序员是怎么练成的?
    在ASP.NET Core调用WebService
    .net core 调用webservice同步方法
    Sqlserver中如何创建链接服务器
    JWT实现鉴权
    JWT原理实现代码
  • 原文地址:https://www.cnblogs.com/daxueshan/p/6542028.html
Copyright © 2011-2022 走看看