记录一下 以备以后用到的时候拿出来看看。
以前使用的:
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
}

分享功能使用的UIPopoverController在iOS9 过期,替换为popoverPresentationController的更多相关文章

  1. c#微信开发,使用JS-SDK自定义分享功能,分享朋友圈,分享给朋友等

    如果一个后端开发掌握了微信开发,甚至有微信开发上线项目,这在换工作的时候 还是有竞争力的. 微信开发的资料很多,但是用asp.net c#进行微信开发好像比较少,或者资料不够完整. 使用JS-SDK自 ...

  2. iOS快速集成友盟社会化分享功能(v6.1.1)

    1.  U-Share SDK集成 1.1 下载U-Share SDK 通过iOS社会化组件选择所需的社交平台后进行下载,下载链接http://dev.umeng.com/social/ios/sdk ...

  3. 第三方登录分享功能-ShareSDK for iOS适配问题记录

    最近app里需要添加第三方授权登陆和分享的功能,选择了ShareSDK,参考了ShareSDK文档对该SDK进行了适配,但遇到了一些问题 1.问题:分享功能点击不跳转  原因:适配iOS9添加白名单 ...

  4. 【微信开发】【Asp.net MVC】-- 微信分享功能

    内嵌在微信中的网页,右上角都会有一个默认的分享功能.如下图所示,第一个为自定义的效果,第二个为默认的效果.实现了自定义的分享链接是不是更让人有点击的欲望?下面讲解下开发的过程. 一.准备,设置js接口 ...

  5. H5分享功能

    web端分享功能 https://www.cnblogs.com/sdcs/p/8328367.html H5分享功能 公司里面做web开发经常会做H5页面,今天整理分享一下. 微信公众号平台 步骤一 ...

  6. 微信开发】【Asp.net MVC】-- 微信分享功能

    [微信开发][Asp.net MVC]-- 微信分享功能 2017-01-15 09:09 by stoneniqiu, 12886 阅读, 15 评论, 收藏, 编辑 内嵌在微信中的网页,右上角都会 ...

  7. 微信开发(一)基于Wx-java的微信分享功能

    最近在做微信服务号开发,简单总结一下,便于自己学习积累和分享给大家: 环境介绍: Spring+ Spring MVC +Mybatis 开发语言: JAVA 微信公众平台的开发中,微信只公布了一个基 ...

  8. 微信JS-SDK分享功能的.Net实现代码

    JS-SDK接口是什么? 为了方便开发者实现微信内的网页(基于微信浏览器访问的网页)功能,比如拍照.选图.语音.位置等手机系统的能力,并方便开发者直接使用微信分享.扫一扫等微信特有的能力,微信推出了J ...

  9. Android中使用ShareSDK集成分享功能

    引言      现在APP开发集成分享功能已经是非常普遍的需求了.其他集成分享技术我没有使用过,今天我就来介绍下使用ShareSDK来进行分享功能开发的一些基本步骤和注意点,帮助朋友们避免一些坑.好了 ...

随机推荐

  1. Android 图片从网页中获取并动态加载到listview中

    实现功能: 效果图: 代码:这里

  2. 使用 jQuery.i18n.properties 实现 Web 前端的国际化

    jQuery.i18n.properties 简介 在介绍 jQuery.i18n.properties 之前,我们先来看一下什么是国际化.国际化英文单词为:Internationalization, ...

  3. java.sizeOf

    Introduction With java.SizeOf you can measure the real memory size of your Java objects. Download it ...

  4. 手势识别官方教程(2)识别常见手势用GestureDetector+手势回调接口/手势抽象类

    简介 GestureDetector识别手势. GestureDetector.OnGestureListener是识别手势后的回调接口.GestureDetector.SimpleOnGesture ...

  5. WCF - IIS Hosting

    WCF - IIS Hosting Hosting a WCF service in IIS (Internet Information Services) is a step-by-step pro ...

  6. Eclipse设置、问题解决方案

    Eclipse设置: 1.如何把eclipse关闭提示调出来? 可以这样打开这个提示:选择 Windows --Preferences,在左边树上选择“General” --“Startup and ...

  7. (转载)SQL Server 2005 日志文件过大处理

    由于安装的时候没有计划好空间,默认装在系统盘,而且又没有做自动备份.截断事务日志等,很快LDF文件就达到十几G,或者几十G ,此时就不得不处理了. 备份和计划就不说了,现在就说下怎么把它先删除吧: 1 ...

  8. c#打印机设置,取得打印机列表及相应打印机的所有纸张格式

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  9. HDU 3342

    #include<stdio.h> #include<string.h> int degree[101],vis[101],map[101][101]; int main() ...

  10. HDU 1285

    #include<stdio.h> #include<string.h> int degree[505],vis[505],map[501][501]; int main() ...