| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- //
- // HomeHubViewController.m
- // kneet2
- //
- // Created by Jason Lee on 10/28/15.
- // Copyright © 2015 ntels. All rights reserved.
- //
- #import "HomeHubViewController.h"
- #import "RequestHandler.h"
- #import "DeviceModel.h"
- #import "CustomTableView.h"
- @implementation HomeHubTableViewCell
- @end
- @implementation HomeHubRegistTableViewCell
- @end
- @interface HomeHubViewController () {
- }
- @end
- #pragma mark - Class Definition
- @implementation HomeHubViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
-
- [self initUI];
- [self prepareViewDidLoad];
- }
- - (void)initUI {
- [self initTableViewAsDefaultStyle:_tableView];
- }
- - (void)prepareViewDidLoad {
- }
- - (void)updateHomeHubStatus {
- [_tableView reloadData];
- }
- #pragma mark - UITableView DataSource & Delegate
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
- return 1;
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- return 2;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
-
- CGFloat height = 86.0f;
-
- if (indexPath.row == 0) {
- height = 101.0f;
- }
-
- return height;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-
- UITableViewCell *cell = nil;
-
- if (indexPath.row == 0) {
- HomeHubTableViewCell *tcell = (HomeHubTableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"HubCellIdentifier"];
-
- if ([JDFacade facade].loginUser.isHomehubOnline) {
- tcell.lblStatus.text = @"온라인";
-
- tcell.imgvStatus.image = [UIImage imageNamed:@"img_homehub_icon_online"];
-
- } else {
- tcell.lblStatus.text = @"오프라인";
- tcell.imgvStatus.image = [UIImage imageNamed:@"img_homehub_icon_offline"];
- }
-
- cell = tcell;
- } else if (indexPath.row == 1) {
- HomeHubRegistTableViewCell *tcell = (HomeHubRegistTableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"RegistCellIdentifier"];
-
- tcell.lblDate.text = [CommonUtil formattedDate3:[JDFacade facade].loginUser.homehubCreateDatetime];
-
- cell = tcell;
- }
-
- return cell;
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
- [super tableView:tableView didSelectRowAtIndexPath:indexPath];
- }
- #pragma mark - UI Events
- - (IBAction)btnSecureTouched:(id)sender {
-
- }
- - (void)btnCloseTouched:(id)sender {
- [self dismissViewControllerAnimated:YES completion:nil];
- }
- #pragma mark - MemoryWarning
- - (void)didReceiveMemoryWarning
- {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- @end
|