两折买改口袋样式

LZMWebDetailController.m 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. //
  2. // LZMWebDetailController.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/5/29.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LZMWebDetailController.h"
  9. #import <WebKit/WebKit.h>
  10. #import "WYWeakScriptMessageDelegate.h"
  11. #import "LZMLoginViewController.h"
  12. #import "WechatShareTool.h"
  13. #import <AlibcTradeSDK/AlibcTradeSDK.h>
  14. #import <AlibabaAuthSDK/ALBBSession.h>
  15. #import <AlibabaAuthSDK/ALBBSDK.h>
  16. static NSString *app_h5_close = @"app_h5_close";
  17. static NSString *app_h5_get_token = @"app_h5_get_token";
  18. static NSString *app_h5_wx_share = @"app_h5_wx_share";
  19. static NSString *app_h5_get_wechat_info = @"app_h5_get_wechat_info";
  20. static NSString *refresh_h5 = @"refresh_h5";
  21. static NSString *app_h5_login = @"app_h5_login"; //h5唤起原生的登录
  22. static NSString *app_h5_wx_share_url = @"app_h5_wx_share_url"; //分享url
  23. static NSString *app_h5_wx_share_image = @"app_h5_wx_share_image"; //分享到微信image
  24. static NSString *app_h5_wx_share_video = @"app_h5_wx_share_video"; //分享到微信video
  25. static NSString *app_h5_wx_share_min = @"app_h5_wx_share_min"; //分享微信小程序(只支持微信好友)
  26. static NSString *app_h5_open_taobao_url = @"app_h5_open_taobao_url"; //打开淘宝url
  27. @interface LZMWebDetailController ()<WKUIDelegate, WKNavigationDelegate,WKScriptMessageHandler>
  28. @property (nonatomic, strong) WKWebView *webView;
  29. /** 加载进度条 */
  30. @property (nonatomic, strong) UIProgressView *progressView;
  31. @property (nonatomic, strong) UIButton *backButton;
  32. @property (nonatomic, strong) UIButton *closeButton;
  33. @end
  34. @implementation LZMWebDetailController
  35. - (void)viewWillAppear:(BOOL)animated {
  36. [super viewWillAppear:animated];
  37. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
  38. }
  39. - (void)viewDidLoad {
  40. [super viewDidLoad];
  41. self.navigationController.navigationBar.hidden = YES;
  42. [self addNotification];
  43. [self configNavigationBar];
  44. [self addUserhandler];
  45. [self loadRequest];
  46. }
  47. - (void)addNotification {
  48. [[NSNotificationCenter defaultCenter] addObserver:self
  49. selector:@selector(refreshH5Action)
  50. name:UIApplicationDidBecomeActiveNotification object:nil];
  51. }
  52. - (void)configNavigationBar {
  53. self.view.backgroundColor = [UIColor whiteColor];
  54. [self.view addSubview:self.webView];
  55. [self.view addSubview:self.progressView];
  56. self.navigationBar.showNavigationBarBottomLine = YES;
  57. // [self.navigationBar setNavTitle:@"商品详情"];
  58. [self.navigationBar setCustomLeftButtons:@[self.backButton]];
  59. self.navigationBar.backgroundColor = [UIColor clearColor];
  60. if (@available(iOS 11.0, *)) {
  61. self.webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;//UIScrollView也适用
  62. }else {
  63. self.automaticallyAdjustsScrollViewInsets = NO;
  64. }
  65. }
  66. - (void)loadRequest {
  67. if (@available(iOS 9.0, *)) {
  68. NSArray * types=@[WKWebsiteDataTypeCookies,WKWebsiteDataTypeLocalStorage];
  69. NSSet *websiteDataTypes= [NSSet setWithArray:types];
  70. NSDate *dateFrom = [NSDate dateWithTimeIntervalSince1970:0];
  71. [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:websiteDataTypes modifiedSince:dateFrom completionHandler:^{
  72. }];
  73. }
  74. NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.url]];
  75. [self.webView loadRequest:request];
  76. }
  77. - (void)addUserhandler {
  78. [[self.webView configuration].userContentController addScriptMessageHandler:[[WYWeakScriptMessageDelegate alloc] initWithDelegate:self] name:app_h5_close];
  79. [[self.webView configuration].userContentController addScriptMessageHandler:[[WYWeakScriptMessageDelegate alloc] initWithDelegate:self] name:app_h5_get_token];
  80. [[self.webView configuration].userContentController addScriptMessageHandler:[[WYWeakScriptMessageDelegate alloc] initWithDelegate:self] name:app_h5_wx_share];
  81. [[self.webView configuration].userContentController addScriptMessageHandler:[[WYWeakScriptMessageDelegate alloc] initWithDelegate:self] name:app_h5_get_wechat_info];
  82. [[self.webView configuration].userContentController addScriptMessageHandler:[[WYWeakScriptMessageDelegate alloc] initWithDelegate:self] name:app_h5_login];
  83. [[self.webView configuration].userContentController addScriptMessageHandler:[[WYWeakScriptMessageDelegate alloc] initWithDelegate:self] name:app_h5_wx_share_url];
  84. [[self.webView configuration].userContentController addScriptMessageHandler:[[WYWeakScriptMessageDelegate alloc] initWithDelegate:self] name:app_h5_wx_share_image];
  85. [[self.webView configuration].userContentController addScriptMessageHandler:[[WYWeakScriptMessageDelegate alloc] initWithDelegate:self] name:app_h5_wx_share_video];
  86. [[self.webView configuration].userContentController addScriptMessageHandler:[[WYWeakScriptMessageDelegate alloc] initWithDelegate:self] name:app_h5_wx_share_min];
  87. [[self.webView configuration].userContentController addScriptMessageHandler:[[WYWeakScriptMessageDelegate alloc] initWithDelegate:self] name:app_h5_open_taobao_url];
  88. }
  89. #pragma mark --- WKScriptMessageHandler
  90. - (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
  91. if ([message.name isEqualToString:app_h5_close]) {
  92. //关闭页面
  93. [self.navigationController popViewControllerAnimated:YES];
  94. }
  95. else if ([message.name isEqualToString:app_h5_get_token]){
  96. //传token给js
  97. [self sendUserTokenToJS:message];
  98. }
  99. else if ([message.name isEqualToString:app_h5_wx_share]){
  100. //调起原生分享
  101. [self shareToNative:message];
  102. }
  103. else if ([message.name isEqualToString:app_h5_get_wechat_info]){
  104. //获取微信信息
  105. [self getWechatInfoWithMessage:message];
  106. }
  107. else if ([message.name isEqualToString:app_h5_wx_share_image]){
  108. //分享图片
  109. [self shareImage:message];
  110. }
  111. else if ([message.name isEqualToString:app_h5_wx_share_url]){
  112. //分享url
  113. [self shareURL:message];
  114. }
  115. else if ([message.name isEqualToString:app_h5_wx_share_video]){
  116. //分享video
  117. [self shareVideo:message];
  118. }
  119. else if ([message.name isEqualToString:app_h5_wx_share_min]){
  120. //分享小程序
  121. [self shareMinProgram:message];
  122. }else if ([message.name isEqualToString:app_h5_login]){
  123. //获取token
  124. [self gotoNativeLogin:message];
  125. }else if ([message.name isEqualToString:app_h5_open_taobao_url]){
  126. //打开淘宝
  127. [self openTaobao:message];
  128. }
  129. else {
  130. }
  131. }
  132. - (void)refreshH5Action {
  133. if (@available(iOS 9.0, *)) {
  134. NSArray * types=@[WKWebsiteDataTypeCookies,WKWebsiteDataTypeLocalStorage];
  135. NSSet *websiteDataTypes= [NSSet setWithArray:types];
  136. NSDate *dateFrom = [NSDate dateWithTimeIntervalSince1970:0];
  137. [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:websiteDataTypes modifiedSince:dateFrom completionHandler:^{
  138. }];
  139. }
  140. NSString *callBacKMethod = [NSString stringWithFormat:@"%@()",refresh_h5];
  141. [self.webView evaluateJavaScript:callBacKMethod completionHandler:^(id _Nullable value, NSError * _Nullable error) {
  142. }];
  143. }
  144. /**
  145. 传token给js
  146. */
  147. - (void)sendUserTokenToJS:(WKScriptMessage *)message {
  148. NSString *token = [AccountTool account].token;
  149. NSString *openid = [AccountTool account].openId;
  150. NSString *unionid = [AccountTool account].unionid;
  151. if (![AccountTool isLogin] || openid==nil || unionid ==nil) {
  152. LZMLoginViewController *login = [[LZMLoginViewController alloc] init];
  153. [self presentViewController:login animated:YES completion:nil];
  154. return;
  155. }
  156. NSDictionary *dict = [self dictionaryWithJsonString:message.body];
  157. NSString *jsMethod = dict[@"js_callback"];
  158. if (!token) {
  159. token = @"";
  160. }
  161. NSDictionary *tokenPara = @{@"token":token,
  162. @"openid":openid,
  163. @"unionid":unionid,
  164. };
  165. NSString *jsonDict = [self convertToJsonData:tokenPara];
  166. NSString *callBacKMethod = [NSString stringWithFormat:@"%@('%@')",jsMethod,jsonDict];
  167. [self.webView evaluateJavaScript:callBacKMethod completionHandler:^(id _Nullable value, NSError * _Nullable error) {
  168. }];
  169. }
  170. /**
  171. 唤起登录
  172. */
  173. - (void)gotoNativeLogin:(WKScriptMessage *)message {
  174. if (![AccountTool isLogin]) {
  175. LZMLoginViewController *login = [[LZMLoginViewController alloc] init];
  176. [self presentViewController:login animated:YES completion:nil];
  177. return;
  178. }
  179. NSDictionary *dict = [self dictionaryWithJsonString:message.body];
  180. NSString *jsMethod = dict[@"js_callback"];
  181. NSString *token = [AccountTool account].token;
  182. NSDictionary *param = @{@"token":token,
  183. };
  184. NSString *jsonDict = [self convertToJsonData:param];
  185. NSString *callBacKMethod = [NSString stringWithFormat:@"%@('%@')",jsMethod,jsonDict];
  186. [self.webView evaluateJavaScript:callBacKMethod completionHandler:^(id _Nullable value, NSError * _Nullable error) {
  187. }];
  188. }
  189. /**
  190. 获取微信信息
  191. */
  192. - (void)getWechatInfoWithMessage:(WKScriptMessage *)message {
  193. NSString *openid = [AccountTool account].openId;
  194. NSString *unionid = [AccountTool account].unionid;
  195. if (![AccountTool isLogin] || openid==nil || unionid ==nil) {
  196. LZMLoginViewController *login = [[LZMLoginViewController alloc] init];
  197. [self presentViewController:login animated:YES completion:nil];
  198. return;
  199. }
  200. NSDictionary *dict = [self dictionaryWithJsonString:message.body];
  201. NSString *jsMethod = dict[@"js_callback"];
  202. NSDictionary *param = @{@"openid":openid,
  203. @"unionid":unionid
  204. };
  205. NSString *jsonDict = [self convertToJsonData:param];
  206. NSString *callBacKMethod = [NSString stringWithFormat:@"%@('%@')",jsMethod,jsonDict];
  207. [self.webView evaluateJavaScript:callBacKMethod completionHandler:^(id _Nullable value, NSError * _Nullable error) {
  208. }];
  209. }
  210. /**
  211. 调起分享
  212. */
  213. - (void)shareToNative:(WKScriptMessage *)message {
  214. NSDictionary *dict = [self dictionaryWithJsonString:message.body];
  215. if ([dict[@"shareType"] isEqualToString:@"1"]) {
  216. [self shareImageWithplatformType:UMSocialPlatformType_WechatSession withDict:dict];
  217. }else {
  218. [self shareImageWithplatformType:UMSocialPlatformType_WechatTimeLine withDict:dict];
  219. }
  220. }
  221. - (void)shareImage:(WKScriptMessage *)message {
  222. NSDictionary *dict = [self dictionaryWithJsonString:message.body];
  223. if ([dict[@"shareType"] isEqualToString:@"1"]) {
  224. [WechatShareTool shareImageWithplatformType:UMSocialPlatformType_WechatSession withDict:dict];
  225. }else {
  226. [WechatShareTool shareImageWithplatformType:UMSocialPlatformType_WechatTimeLine withDict:dict];
  227. }
  228. }
  229. - (void)shareURL:(WKScriptMessage *)message {
  230. NSDictionary *dict = [self dictionaryWithJsonString:message.body];
  231. if ([dict[@"shareType"] isEqualToString:@"1"]) {
  232. [WechatShareTool shareURLWithplatformType:UMSocialPlatformType_WechatSession withDict:dict];
  233. }else {
  234. [WechatShareTool shareURLWithplatformType:UMSocialPlatformType_WechatTimeLine withDict:dict];
  235. }
  236. }
  237. - (void)shareVideo:(WKScriptMessage *)message {
  238. NSDictionary *dict = [self dictionaryWithJsonString:message.body];
  239. if ([dict[@"shareType"] isEqualToString:@"1"]) {
  240. [WechatShareTool shareVideoWithplatformType:UMSocialPlatformType_WechatSession withDict:dict];
  241. }else {
  242. [WechatShareTool shareVideoWithplatformType:UMSocialPlatformType_WechatTimeLine withDict:dict];
  243. }
  244. }
  245. - (void)shareMinProgram:(WKScriptMessage *)message {
  246. NSDictionary *dict = [self dictionaryWithJsonString:message.body];
  247. [WechatShareTool shareMinProgramWithplatformType:UMSocialPlatformType_WechatSession withDict:dict];
  248. }
  249. - (void)openTaobao:(WKScriptMessage *)message {
  250. NSDictionary *dict = [self dictionaryWithJsonString:message.body];
  251. NSString *url = dict[@"taobaoUrl"];
  252. [self jumpToTaobaoWithUrl:url];
  253. }
  254. - (void)jumpToTaobaoWithUrl:(NSString *)url {
  255. id<AlibcTradePage> page = [AlibcTradePageFactory page:url];
  256. //淘客信息
  257. AlibcTradeTaokeParams *taoKeParams=[[AlibcTradeTaokeParams alloc] init];
  258. taoKeParams.pid= ALTK_PID;
  259. //打开方式
  260. AlibcTradeShowParams* showParam = [[AlibcTradeShowParams alloc] init];
  261. showParam.openType = AlibcOpenTypeNative;
  262. [[AlibcTradeSDK sharedInstance].tradeService show:self.parentViewController page:page showParams:showParam taoKeParams:taoKeParams trackParam:nil tradeProcessSuccessCallback:^(AlibcTradeResult * _Nullable result) {
  263. } tradeProcessFailedCallback:^(NSError * _Nullable error) {
  264. }];
  265. }
  266. -(void)shareImageWithplatformType:(UMSocialPlatformType)platformType withDict:(NSDictionary *)dict{
  267. //创建分享消息对象
  268. UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
  269. //创建图片内容对象
  270. UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:dict[@"shareTitle"] descr:dict[@"shareDescirpt"] thumImage:dict[@"shareImageUrl"]];
  271. shareObject.webpageUrl = dict[@"shareUrl"];
  272. messageObject.shareObject = shareObject;
  273. [[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:nil completion:^(id data, NSError *error) {
  274. }];
  275. }
  276. /**
  277. kvo监听进度条
  278. @param keyPath keyPath description
  279. @param object object description
  280. @param change change description
  281. @param context context description
  282. */
  283. - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context{
  284. if ([keyPath isEqualToString:NSStringFromSelector(@selector(estimatedProgress))] && object == self.webView ) {
  285. [self.progressView setAlpha:1.0];
  286. [self.progressView setProgress:self.webView.estimatedProgress ];
  287. if (self.webView.estimatedProgress >= 1.0) {
  288. [UIView animateWithDuration:0.7 animations:^{
  289. [self.progressView setProgress:1.0 animated:YES];
  290. [self.progressView setAlpha:0.0];
  291. }];
  292. }
  293. }else{
  294. [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
  295. }
  296. }
  297. #pragma mark-
  298. #pragma mark- WKNavigationDelegate delegate
  299. /**
  300. 开始加载web的时候
  301. @param webView webView description
  302. @param navigation navigation description
  303. */
  304. - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{
  305. //开始加载的时候,让进度条显示
  306. self.progressView.hidden = NO;
  307. self.progressView.progress = 0;
  308. self.progressView.alpha = 1.0;
  309. [UIView animateWithDuration:0.8 animations:^{
  310. self.progressView.progress = 0.6;
  311. }];
  312. }
  313. /**
  314. 当网页加载完成的时候调用
  315. @param webView web描述
  316. @param navigation 导航的描述
  317. */
  318. - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{
  319. self.title = self.webView.title;
  320. [[UIApplication sharedApplication]setNetworkActivityIndicatorVisible:NO];
  321. [self updateNavigationBarButtons];
  322. }
  323. #pragma mark -----------
  324. - (void)updateNavigationBarButtons {
  325. if (self.webView.canGoBack) {
  326. [self.navigationBar setCustomLeftButtons:@[self.backButton,self.closeButton]];
  327. }else {
  328. [self.navigationBar setCustomLeftButtons:@[self.backButton]];
  329. }
  330. }
  331. - (void)backAction {
  332. if (self.webView.canGoBack) {
  333. [self.webView goBack];
  334. }else{
  335. [self.navigationController popViewControllerAnimated:YES];
  336. }
  337. }
  338. - (void)closeAction {
  339. [self.navigationController popViewControllerAnimated:YES];
  340. }
  341. - (WKWebView *)webView{
  342. if (!_webView) {
  343. _webView = [[WKWebView alloc]initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight)];
  344. _webView.backgroundColor = [UIColor colorWithRed:240.0/255 green:240.0/255 blue:240.0/255 alpha:1.0];
  345. _webView.navigationDelegate = self;
  346. _webView.UIDelegate = self;
  347. //使用kvo监听进度
  348. [_webView addObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress)) options:0 context:nil];
  349. //手势触摸滑动
  350. _webView.allowsBackForwardNavigationGestures = YES;
  351. //自适应
  352. [_webView sizeToFit];
  353. //自适应
  354. [_webView sizeToFit];
  355. }
  356. return _webView;
  357. }
  358. #pragma mark-
  359. #pragma mark- SetupConstraints
  360. /** 加载配置以及视图添加*/
  361. - (void)loadSubViewsConfiguration{
  362. [self.view addSubview:self.webView];
  363. }
  364. - (UIButton *)backButton {
  365. if (!_backButton) {
  366. _backButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
  367. [_backButton setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
  368. [_backButton addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
  369. }
  370. return _backButton;
  371. }
  372. - (UIButton *)closeButton {
  373. if (!_closeButton) {
  374. _closeButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
  375. [_closeButton setImage:[UIImage imageNamed:@"close_web"] forState:UIControlStateNormal];
  376. [_closeButton addTarget:self action:@selector(closeAction) forControlEvents:UIControlEventTouchUpInside];
  377. }
  378. return _closeButton;
  379. }
  380. - (UIProgressView *)progressView{
  381. if (!_progressView) {
  382. _progressView = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
  383. _progressView.frame = CGRectMake(0, NavBarHeight, self.view.frame.size.width, 2);
  384. //设置进度条的色彩
  385. [_progressView setTrackTintColor:[UIColor colorWithRed:240.0/255 green:240.0/255 blue:240.0/255 alpha:1.0]];
  386. _progressView.progressTintColor = [UIColor homeRedColor];
  387. }
  388. return _progressView;
  389. }
  390. //观察的移除
  391. - (void)dealloc{
  392. [self.webView removeObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress))];
  393. [[NSNotificationCenter defaultCenter] removeObserver:self];
  394. }
  395. /**
  396. json字符串转字典
  397. */
  398. - (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString
  399. {
  400. if (jsonString == nil) {
  401. return nil;
  402. }
  403. NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
  404. NSError *err;
  405. NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData
  406. options:NSJSONReadingMutableContainers
  407. error:&err];
  408. if(err)
  409. {
  410. NSLog(@"json解析失败:%@",err);
  411. return nil;
  412. }
  413. return dic;
  414. }
  415. /**
  416. 字典转json字符串
  417. */
  418. - (NSString *)convertToJsonData:(NSDictionary *)dict
  419. {
  420. NSError *error;
  421. NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:&error];
  422. NSString *jsonString;
  423. if (!jsonData) {
  424. NSLog(@"%@",error);
  425. }else{
  426. jsonString = [[NSString alloc]initWithData:jsonData encoding:NSUTF8StringEncoding];
  427. }
  428. NSMutableString *mutStr = [NSMutableString stringWithString:jsonString];
  429. NSRange range = {0,jsonString.length};
  430. //去掉字符串中的空格
  431. [mutStr replaceOccurrencesOfString:@" " withString:@"" options:NSLiteralSearch range:range];
  432. NSRange range2 = {0,mutStr.length};
  433. //去掉字符串中的换行符
  434. [mutStr replaceOccurrencesOfString:@"\n" withString:@"" options:NSLiteralSearch range:range2];
  435. return mutStr;
  436. }
  437. - (void)didReceiveMemoryWarning {
  438. [super didReceiveMemoryWarning];
  439. // Dispose of any resources that can be recreated.
  440. }
  441. /*
  442. #pragma mark - Navigation
  443. // In a storyboard-based application, you will often want to do a little preparation before navigation
  444. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  445. // Get the new view controller using [segue destinationViewController].
  446. // Pass the selected object to the new view controller.
  447. }
  448. */
  449. @end