App之间的跳转

App之间的跳转

成都创新互联专注于新宾企业网站建设,响应式网站建设,商城网站制作。新宾网站建设公司,为新宾等地区提供建站服务。全流程定制设计,专业设计,全程项目跟踪,成都创新互联专业和态度为您提供的服务

1,添加URL Types项

a,打开项目中.xcodeproj下的info目录,增加一项URL Typs
 App之间的跳转

2,配置URL Scheme

a,将URL identifie选项为com.KeYi.lsf

b,将URL Scheme选项的内容修改为lsf


 - (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation
{
//抓取url
    if (!url) {
        return NO;
    }else {
        if ([[url host] isEqualToString:@"expert"]) {
            
            NSArray *codeArr = [[url query] componentsSeparatedByString:@"="];
            if (codeArr.count >0) {
                if (self.window.rootViewController) {
                    BaseTabBarController *tabBarController = (BaseTabBarController*)self.window.rootViewController;
                    BaseNavigationController * bnc = (BaseNavigationController*)tabBarController.selectedViewController;
                    HomeDetailController * hdc = [[HomeDetailController alloc]init];
                    hdc.expertInfoDic = @{@"expertUserId":codeArr[1]};
                    [bnc pushViewController:hdc animated:YES];
                }else {
                    
                }
            }
            return YES;
        }else if ([[url host] isEqualToString:@"topic"]) {
            NSArray *codeArray = [[url query] componentsSeparatedByString:@"&"];
            NSArray *codeArr = [codeArray[0] componentsSeparatedByString:@"="];
            NSArray *otherArr  = [codeArray[1] componentsSeparatedByString:@"="];
            if (codeArr.count > 0) {
                if (self.window.rootViewController) {
                    BaseTabBarController *tabBarController = (BaseTabBarController*)self.window.rootViewController;
                    BaseNavigationController * bnc = (BaseNavigationController*)tabBarController.selectedViewController;
                    ExpertDetailController * edc = [[ExpertDetailController alloc]init];
                    edc.topicInfo = @{@"topicId":codeArr[1],@"expertUserId":otherArr[1]};
                    [bnc pushViewController:edc animated:YES];
                }else {
                    
                }

            }
            return YES;
        }
            
    }
...
}


网页名称:App之间的跳转
URL链接:http://bzwzjz.com/article/jdjspp.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 手机网站设计 成都网站设计制作公司 温江网站设计 高端网站设计推广 成都营销网站制作 网站设计 手机网站建设 成都网站制作 四川成都网站制作 成都网站建设 成都网站制作 营销型网站建设 成都网站建设 高端网站设计 成都网站制作 网站制作 成都h5网站建设 成都网站建设 网站建设推广 专业网站建设 网站制作公司 宜宾网站设计