LaunchAdModel.m 828 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // LaunchAdModel.m
  3. // XHLaunchAdExample
  4. //
  5. // Created by zhuxiaohui on 2016/6/28.
  6. // Copyright © 2016年 it7090.com. All rights reserved.
  7. // 代码地址:https://github.com/CoderZhuXH/XHLaunchAd
  8. // 广告数据模型
  9. #import "LaunchAdModel.h"
  10. @implementation LaunchAdModel
  11. - (instancetype)initWithDict:(NSDictionary *)dict
  12. {
  13. self = [super init];
  14. if (self) {
  15. self.content = dict[@"content"];
  16. self.openUrl = dict[@"openUrl"];
  17. self.duration = [dict[@"duration"] integerValue];
  18. self.contentSize = dict[@"contentSize"];
  19. }
  20. return self;
  21. }
  22. -(CGFloat)width
  23. {
  24. return [[[self.contentSize componentsSeparatedByString:@"*"] firstObject] floatValue];
  25. }
  26. -(CGFloat)height
  27. {
  28. return [[[self.contentSize componentsSeparatedByString:@"*"] lastObject] floatValue];
  29. }
  30. @end