// // aboutPaperController.m // ThePaperHD // // Created by liyuan on 15/4/13. // Copyright (c) 2015年 scar1900. All rights reserved. // #import "aboutPaperController.h" #import "MLNavigationController.h" @interface aboutPaperController () @property(nonatomic, strong)NSString *content; @property(nonatomic, strong)RTLabel *contentLabel; @end @implementation aboutPaperController - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor colorWithHexString:BackGroundColor]; self.titleStr = @"关于澎湃"; [self.view addSubview:self.contentLabel]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; __weak typeof(self) Self = self; [Remote doNoneJsonActionWithBlock:0 requestUrl:aboutURL parameter:nil withWaitCursor:YES completion:^(BOOL success, NSString *message, id responseData) { if (success) { NSString *responseString = responseData; NSArray *list = [responseString componentsSeparatedByRegex:@","]; [list enumerateObjectsUsingBlock:^(NSString* obj, NSUInteger idx, BOOL *stop) { if ([obj isMatchedByRegex:@"aboutInfo"]) { NSArray *strList = [obj componentsSeparatedByRegex:@"\":"]; Self.content = strList[2]; Self.content = [Self.content stringByReplacingOccurrencesOfString:@"\"" withString:@""]; Self.content = [Self.content stringByReplacingOccurrencesOfString:@"}" withString:@""]; Self.content = [Self.content stringByReplacingOccurrencesOfString:@"。\"" withString:@"。"]; } }]; Self.contentLabel.text = Self.content; }else { ShowTextMessage(message); } }]; } - (RTLabel*)contentLabel { if (!_contentLabel) { _contentLabel = [[RTLabel alloc]initWithFrame:CGRectMake(10, 36+self.barHeight, rect_screen.size.width-20, rect_screen.size.height)]; _contentLabel.textColor = [UIColor colorWithHexString:TextBlack]; _contentLabel.font = appFont(18, NO); _contentLabel.lineSpacing = 8; _contentLabel.backgroundColor = [UIColor clearColor]; _contentLabel.lineBreakMode = RTTextLineBreakModeWordWrapping; _contentLabel.textAlignment = RTTextAlignmentLeft; } return _contentLabel; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end