萤石云 iOSSDK,移植跨平台相关工程
EZSDK/EZSDK/EZ/UIViewControllers/EZDeviceTableViewController.m
@@ -20,7 +20,7 @@
#import "EZAreaInfo.h"
#import "EZUserInfo.h"
#import "Toast+UIView.h"
#import "EZVideoTalkViewcontroller.h"
//#import "EZVideoTalkViewcontroller.h"
#import "EZMultiChannelRealPlayVC.h"
#import "EZHubDebugViewController.h"
#import "GlobalKit.h"
@@ -43,9 +43,17 @@
@implementation EZDeviceTableViewController
-(void)viewWillDisappear:(BOOL)animated
{
    //    self.navigationController.navigationBarHidden = YES;//2021-02-01 添加隐藏navigationBarHidden
}
- (void)viewDidLoad
{
    [super viewDidLoad];
//    [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60)
//     forBarMetrics:UIBarMetricsDefault];
    
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
@@ -58,14 +66,23 @@
    //    self.title.
    
    self.logoutBtn.title = NSLocalizedString(@"Logout", @"注销");
    self.logoutBtn.title = @"";
    [self.logoutBtn setEnabled: NO];
    
    [self checkEZIsLogin];
//    self.addButton=nil;
    self.addButton=[[UIBarButtonItem alloc] init];
//    self.addButton=[UIImage imageNamed:@""];
}
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = NO;//2021-02-01
    if (_needRefresh)
    {
        _needRefresh = NO;
@@ -240,7 +257,17 @@
                        return;
                    }
                    [weakSelf.deviceList removeAllObjects];
                    [weakSelf.deviceList addObjectsFromArray:deviceList];
                    HDLEZLog(@"获取到的设备列表:%@",deviceList);
                    NSMutableArray *finalDeviceList=[NSMutableArray arrayWithArray:deviceList];
                    if (self.filterTypes&&self.filterTypes.count!=0) {//判断是否需要过滤
                        for (EZDeviceInfo *deviceInfo in deviceList) {
                            HDLEZLog(@"获取到的设备列表category:%@",deviceInfo.category);
                            if ([self.filterTypes containsObject:[HDLEZConstants turnNil:deviceInfo.category]]) {
                                [finalDeviceList removeObject:deviceInfo];
                            }
                        }
                    }
                    [weakSelf.deviceList addObjectsFromArray:finalDeviceList];
                    [weakSelf.tableView reloadData];
                    [weakSelf.tableView.header endRefreshing];
                    if (weakSelf.deviceList.count == totalCount)
@@ -297,7 +324,17 @@
//                    [weakSelf.view makeToast:error.description duration:2.0 position:@"bottom"];
//                    return;
//                }
                [weakSelf.deviceList addObjectsFromArray:deviceList];
                NSMutableArray *finalDeviceList=[NSMutableArray arrayWithArray:deviceList];
                if (self.filterTypes&&self.filterTypes.count!=0) {//判断是否需要过滤
                    for (EZDeviceInfo *deviceInfo in deviceList) {
                        if ([self.filterTypes containsObject:[HDLEZConstants turnNil:deviceInfo.category]]) {
                            [finalDeviceList removeObject:deviceInfo];
                        }
                    }
                }
                [weakSelf.deviceList addObjectsFromArray:finalDeviceList];
//                [weakSelf.deviceList addObjectsFromArray:deviceList];
                [weakSelf.tableView reloadData];
                [weakSelf.tableView.footer endRefreshing];
                if (weakSelf.deviceList.count == totalCount)
@@ -377,9 +414,9 @@
}
- (void) go2VideoTalk:(EZDeviceInfo *)deviceInfo {
    EZVideoTalkViewcontroller *vc = [EZVideoTalkViewcontroller videoTalkVC];
    vc.deviceInfo = deviceInfo;
    [self.navigationController pushViewController:vc animated:YES];
//    EZVideoTalkViewcontroller *vc = [EZVideoTalkViewcontroller videoTalkVC];
//    vc.deviceInfo = deviceInfo;
//    [self.navigationController pushViewController:vc animated:YES];
}
- (IBAction)go2MultiPlay:(id)sender {