-
创建管理器单例
+(instancetype)shared;
e.g.[HostsManager shared];
-
新增一个url
-(void)addHostsUrl:(NSString *)url default:(BOOL)isDefault;
e.g.[HostsManager shared] addHostsUrl:@"http://www.gitlab.com/" default:YES];
-
删除一个url
-(void)removeHostsUrl:(NSString *)url;
e.g.[HostsManager shared] removeHostsUrl:@"http://www.gitlab.com/"];
-
初始化
CustomHostsView *custonView = [[CustomHostsView alloc]init];
-
设置代理
custonView.delegate = self;
-
展示视图(默认全屏)
[custonView show];
-
隐藏/消失视图
[custonView dismiss];
- 设置了一个默认地址
-(void)setDefaultWithUrl:(NSString *)url;
- 自定义视图消失
-(void)customHostsViewDismiss;
pod 'HostsManager'
Mr_zhaohy, zhy1@erongdu.com
HostsManager is available under the MIT license. See the LICENSE file for more info.