TTUrlMap 用法

 

  // Any URL that doesn't match will fall back on this one, and open in the web browser

  [map from:@"*" toViewController:[TTWebController class]];

 

  // The tab bar controller is shared, meaning there will only ever be one created.  Loading

  // This URL will make the existing tab bar controller appear if it was not visible.

  [map from:@"tt://tabBar" toSharedViewController:[TabBarController class]];

 

  // Menu controllers are also shared - we only create one to show in each tab, so opening

  // these URLs will switch to the tab containing the menu

    //菜单控制器是被共享的控制器,这意味着它只能被创建一次,

    //所以打开这个url,就会选择包含这个控制器的标签。

    //如果URL中有函数的时候MenuController alloc后,会调用initWithMenu,如果没有则调用init

  [map from:@"tt://menu/(initWithMenu:)" toSharedViewController:[MenuController class]];

 

  // A new food controllers will be created each time you open a food URL

    //一个新的控制器将要被创建,在你每次打开这个url的时候

  [map from:@"tt://food/(initWithFood:)" toViewController:[ContentController class]];

 

  // By specifying the parent URL, we are saying that the tab containing menu #5 will be

  // selected before opening this URL, ensuring that about controllers are only pushed

  // inside the tab containing the about menu

    //当我们调用这个url的时候,他首先会选中@"tt://menu/5"对应的标签,然后吧这个视图push进去

  [map from:@"tt://about/(initWithAbout:)" parent:@"tt://menu/5"

       toViewController:[ContentController class] selector:nil transition:3];

 

  // This is an example of how to use a transition.  Opening the nutrition page will do a flip

    //引用这个例子的主要的目的是,为了说明动画的时候方法。

    //这是为了传递多个参数

  [map from:@"tt://food/(initWithNutrition:)/nutrition" toViewController:[ContentController class]

       transition:UIViewAnimationTransitionFlipFromLeft];

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值