实效API

本文讨论了iOS6中废弃的presentModalViewController及dismissModalViewControllerAnimated方法,介绍了替代API:presentViewController:animated:completion:与dismissViewControllerAnimated:completion:。同时提及了iOS6带来的其他变化,如Auto Layout在Xcode 4.5中的应用。

iOS6 之后

presentModalViewController  实效,过期了

 

Presents a modal view managed by the given view controller to the user. (Deprecated in iOS 6.0. UsepresentViewController:animated:completion: instead.)

Parameters
viewControllerToPresent

The view controller being presented.

flag

Pass YES to animate the presentation; otherwise, pass NO.

completion

A completion handler or NULL.

苹果支持最新的api,在iOS 5中推出来的,并且之前的设置

dismissModalViewControllerAnimated:

也过期了,

替代的是Dismisses the view controller that was presented by the receiver. (Deprecated in iOS 6.0. UsedismissViewControllerAnimated:completion: instead.)


Parameters
flag

Pass YES to animate the transition.

completion

A block called after the view controller has been dismissed.

 

 

不过在这些测试当中,也就是在iOS 5之前,一直可以使用的[[self parentViewController] dismissModalViewControllerAnimated:YES];

 这里面也不能使用了,是在iOS 5之后修改的。

取而代之的写法是[self dismissModalViewControllerAnimated:YES];

 

中间一直没用,发现奇怪了,怎么实效了按钮,这才明白,总值iOS 6的到来,改变了很多api的使用

而且xcode 4.5 的时候,在ib 里面 use autolayout 这个选项针对的就是iPhone 5大屏幕的出现,

在后乔布什时代,这个布局很头痛,IB和代码的界面 的确不好控制。

 

希望在正式颁布,中修改好。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值