萤石云 iOSSDK,移植跨平台相关工程
JLChen
2021-02-02 9100afbe1805413504840e6957097be638579045
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
//
//  EZDeviceRestartTipsViewController.m
//  EZOpenSDKDemo
//
//  Created by DeJohn Dong on 15/10/29.
//  Copyright © 2015年 Ezviz. All rights reserved.
//
 
#import "EZDeviceRestartTipsViewController.h"
#import "Masonry.h"
#import "DDKit.h"
#import "EZWifiInfoViewController.h"
 
 
@interface EZDeviceRestartTipsViewController ()
 
@property (nonatomic, strong) UIImageView *deviceImageView;
@property (nonatomic, strong) UIButton *nextButton;
@property (nonatomic, strong) UILabel *tipsLabel;
 
@end
 
@implementation EZDeviceRestartTipsViewController
 
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.title = NSLocalizedString(@"ad_restart_title", @"重启设备");
    
    [self.view addSubview:self.tipsLabel];
    [self.tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(@10);
        make.trailing.mas_equalTo(@-10);
        if([UIScreen mainScreen].bounds.size.height == 480.0){
            make.top.mas_equalTo(@10);
        }else{
            make.top.mas_equalTo(@99);
        }
        make.height.mas_equalTo(@50);
    }];
    
    [self.view addSubview:self.deviceImageView];
    [self.deviceImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.tipsLabel.mas_bottom).offset(19);
        make.width.mas_equalTo(@174);
        make.height.mas_equalTo(@199);
        make.centerX.mas_equalTo(self.view.mas_centerX);
    }];
    
    [self.view addSubview:self.nextButton];
    [self.nextButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.deviceImageView.mas_bottom).offset(31);
        make.height.mas_equalTo(@38);
        make.width.mas_equalTo(@285);
        make.centerX.mas_equalTo(self.view.mas_centerX);
    }];
    
    self.deviceImageView.image = [UIImage imageNamed:@"device_reset"];
    self.tipsLabel.text = NSLocalizedString(@"ad_restart_tip", @"长按设备上的reset键10秒后松开,并等待大约30秒直到设备启动完成");
    [self.nextButton setTitle:NSLocalizedString(@"ad_restart_done", @"我已重启好") forState:UIControlStateNormal];
    
}
 
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
 
 
#pragma mark - Navigation
 
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([[segue destinationViewController] isKindOfClass:[EZWifiInfoViewController class]]) {
        EZWifiInfoViewController *vc = (EZWifiInfoViewController *)[segue destinationViewController];
        vc.supportApMode = self.supportApMode;
        vc.supportSmartMode = self.supportSmartMode;
        vc.supportSoundMode = self.supportSoundMode;
    }
}
 
 
- (void)nextAction:(id)sender
{
    [self performSegueWithIdentifier:@"go2WifiInfo2" sender:nil];
}
 
#pragma mark - Set & Get Methods
 
- (UILabel *)tipsLabel
{
    if(!_tipsLabel)
    {
        _tipsLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        _tipsLabel.backgroundColor = [UIColor clearColor];
        _tipsLabel.font = [UIFont systemFontOfSize:16.0f];
        _tipsLabel.textColor = [UIColor dd_hexStringToColor:@"0x333333"];
        _tipsLabel.numberOfLines = 2;
        _tipsLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _tipsLabel;
}
 
- (UIImageView *)deviceImageView
{
    if(!_deviceImageView)
    {
        _deviceImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"device"]];
    }
    return _deviceImageView;
}
 
- (UIButton *)nextButton
{
    if(!_nextButton)
    {
        _nextButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_nextButton addTarget:self action:@selector(nextAction:) forControlEvents:UIControlEventTouchUpInside];
        [_nextButton setBackgroundImage:[UIImage imageNamed:@"blue_button"] forState:UIControlStateNormal];
        [_nextButton setBackgroundImage:[UIImage imageNamed:@"blue_button_sel"] forState:UIControlStateHighlighted];
        _nextButton.titleLabel.font = [UIFont systemFontOfSize:15.0f];
    }
    return _nextButton;
}
 
@end