TargetInfor.m 747 Bytes
//
//  TargetInfor.m
//  LifeLog
//
//  Created by Nguyen Van Phong on 8/13/17.
//  Copyright © 2017 PhongNV. All rights reserved.
//

#import "TargetInfor.h"

@implementation TargetInfor
-(id) initWithData : (NSDictionary *) dict {
    if([dict objectForKey:@"target_step"] != nil) {
        self.target_step = [dict[@"target_step"] intValue];
    }
    if([dict objectForKey:@"num_step"] != nil) {
        self.num_step = [dict[@"num_step"] intValue];
    }
    if([dict objectForKey:@"remaining_step"] != nil) {
        self.remaining_step = [dict[@"remaining_step"] intValue];
    }
    if([dict objectForKey:@"complete_percent"] != nil) {
        self.complete_percent = [dict[@"complete_percent"] floatValue];
    }
    return self;
}
@end