//
|
// NoNetworkView.m
|
// BuWanVideo2.0
|
//
|
// Created by 重庆迈尖科技有限公司 on 2018/8/28.
|
// Copyright © 2018年 com.yeshi.buwansheque.ios. All rights reserved.
|
//
|
|
#import "NoNetworkView.h"
|
|
@implementation NoNetworkView
|
|
- (instancetype)initWithFrame:(CGRect)frame{
|
self = [super initWithFrame:frame];
|
if (self) {
|
self.backgroundColor = SJColor(254, 212 , 67, 1);
|
[self addSubview:self.titleLabel];
|
[self addSubview:self.jumpButton];
|
}
|
return self;
|
}
|
|
- (void)jumpSetting:(UIButton *)sender{
|
|
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
|
}
|
|
#pragma mark - getter
|
- (UILabel *)titleLabel{
|
if (_titleLabel) {
|
return _titleLabel;
|
}
|
_titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(25, 0, self.frame.size.width, self.frame.size.height)];
|
_titleLabel.textColor = SJColor(30, 144, 255, 1);
|
_titleLabel.text = @"网络不可用,请检查网络";
|
_titleLabel.font = [UIFont systemFontOfSize:15];
|
|
return _titleLabel;
|
}
|
- (UIButton *)jumpButton{
|
if (_jumpButton) {
|
return _jumpButton;
|
}
|
_jumpButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
_jumpButton.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
|
[_jumpButton addTarget:self action:@selector(jumpSetting:) forControlEvents:UIControlEventTouchUpInside];
|
return _jumpButton;
|
}
|
@end
|