//// MainViewController.m// ContainerManager//// Created by Pengt on 2020年9月22日.// Copyright © 2020 CMG Fintech Co., Ltd. All rights reserved.//#import "MainViewController.h"@import ContainerCenter;@interface MainViewController ()@property (nonatomic) UIButton *showPageBtn;@end@implementation MainViewController- (void)viewDidLoad {[super viewDidLoad];self.title = @"ContainerCenter";[self.view addSubview:self.showPageBtn];}- (void)viewDidLayoutSubviews {[super viewDidLayoutSubviews];self.showPageBtn.frame = CGRectMake(0, 0, 200, 50);self.showPageBtn.center = self.view.center;}- (void)showPage {int index = arc4random() % 5;NSString *pageId = [NSString stringWithFormat:@"page%d", index];id<CCPageAppProvider> provider = CCContainerManager.sharedManager.defaultPageAppProvider;[provider fetchPageAppWithId:@"" version:0 completion:^(id<CCPageApp> _Nullable app, NSError * _Nullable error) {}];NSDictionary *params = @{@"test":@"test"};UIViewController *vc = [CCContainerManager viewControllerInContainer:@"Waltz" withPageId:@"123" params:params completion:nil];[self.navigationController pushViewController:vc animated:YES];}- (UIButton *)showPageBtn {if (!_showPageBtn) {UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];[btn setTitle:@"ShowWaltzPage" forState:UIControlStateNormal];[btn setTitleColor:UIColor.blackColor forState:UIControlStateNormal];[btn addTarget:self action:@selector(showPage) forControlEvents:UIControlEventTouchUpInside];btn.layer.borderWidth = 1;btn.layer.borderColor = UIColor.blackColor.CGColor;_showPageBtn = btn;}return _showPageBtn;;}@end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。