Today Extension 研究
Layout
- self.view.frame是整个屏幕大小。
Life cycle
- 滑走后,会重新创建。
NEVPNManager
NEVPNManager是用来创建和管理VPN设置,并且处理VPN连接结果的。
每一个应用只允许创建一个VPA设置,所以NEVPNManager是一个单例。
由NEVPNManager创建的VPN称为私人VPN,在iOS和macOS上,非私人VPA的优先级高于私人VPN。
使用NEVPNManager需要com.apple.developer.networking.vpn.api entitlement,需要开启应用的Personal VPN权限。
在开启私人VPN前,必须从Network Extension preferences载入VPN设置,在修改VPN设置之后,必须写入Network Extension preferences。
NEVPNManager的对象是线程安全的。
#import <NetworkExtension/NEVPNManager.h>
NEVPNProtocol
NEVPNProtocol用来配置VPN。
NEVPNConnection
NEVPNConnection用来控制VPN连接。