• 分享功能使用的UIPopoverController在iOS9 过期,替换为popoverPresentationController



    记录一下 以备以后用到的时候拿出来看看。
    以前使用的:
    1 if (UIDevice.currentDevice().userInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
    2  presentViewController(vc, animated: true, completion: nil)
    3 } else if (popover == nil || !popover!.popoverVisible) {
    4                 popover = UIPopoverController(contentViewController: vc)
    5              popover!.delegate = self                         popover?.presentPopoverFromRect(inviteView.frame, inView: self.view, permittedArrowDirections: UIPopoverArrowDirection.Any, animated: true) 

    现在使用:
    if #available(iOS 8.0, *) { vc.modalPresentationStyle = UIModalPresentationStyle.Popover vc.popoverPresentationController?.sourceView = inviteView vc.popoverPresentationController?.sourceRect = inviteView.bounds vc.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.Any presentViewController(vc, animated: true, completion: nil) } else { //DeviceUtils.isIOS7() if (UIDevice.currentDevice().userInterfaceIdiom == UIUserInterfaceIdiom.Phone) { presentViewController(vc, animated: true, completion: nil) } else if (popover == nil || !popover!.popoverVisible) { popover = UIPopoverController(contentViewController: vc) popover!.delegate = self popover?.presentPopoverFromRect(inviteView.frame, inView: self.view, permittedArrowDirections: UIPopoverArrowDirection.Any, animated: true) } // Fallback on earlier versions }
  • 相关阅读:
    Hadoop之hive 其他
    mac 安装mysql
    Mac OS X【快捷键组合】汇总
    一月一城市,一年一大洲
    自信的男生最有魅力
    Python之路
    Hadoop之伪分布环境搭建
    smb
    Maven 安装以及一些开发技巧
    Hadoop之 hdfs 系统
  • 原文地址:https://www.cnblogs.com/741162830qq/p/4981656.html
Copyright © 2020-2023  润新知