ios13 xcode11.0更新之后的一些问题记录

1.UISearchController

设置UISearchController上取消按钮的文字格式时 UISearchController.searchBar.setValue(“取消”, forKey:"_cancelButtonText")这是未更新之前的写法更新后不能这么写 会直接崩溃,更新之后的写法 UISearchController.searchBar.setValue(“取消”, forKey:“cancelButtonText”)

模态弹出默认交互改变

iOS 13 的 presentViewController 默认有视差效果,模态出来的界面现在默认都下滑返回。 一些页面必须要点确认才能消失的,需要适配。如果项目中页面高度全部是屏幕尺寸,那么多出来的导航高度会出现问题。
// Swift
self.modalPresentationStyle = .fullScreen
// Objective-C
self.modalPresentationStyle = UIModalPresentationFullScreen;

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
     
        self.view.addSubview(btton)
        btton.frame = CGRect(x: 100, y: 100, width: 100, height: 100)
    }
    lazy var btton:UIButton = {
           let button = UIButton()
        button.setTitle("跳转页面2", for: .normal)
        button.setTitleColor(UIColor.black, for: .normal)
        button.addTarget(self, action: #selector(click), for: .touchUpInside)
        return button
          }()

    @objc func click(){
        let second = ViewController2()
        second.modalPresentationStyle = .fullScreen
        second.bao = { (str) -> Void in
            print(str)
          self.btton.titleLabel?.text = str
        }
        self.present(second, animated: false, completion: nil)
    }
}

UIViewController 增加一个了属性 isModalInPresentation,默认为 false,当该属性为 false 时,用户下拉可以 dismiss 控制器,为 true 时,下拉不可以 dismiss控制器。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值