AP102 2016/5/27

Title7 popView的定義視窗
類別smallViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    self.preferredContentSize = CGSizeMake(200, 200);

}
DetailViewController
解決錨點位置
//sourceRect 出現泡泡的地方
//bounds
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{

    // You may need to check id of segue
    UIViewController * vc =segue.destinationViewController;
    UIPopoverPresentationController*popoverPresentationController = vc.popoverPresentationController;

    popoverPresentationController.sourceRect = [sender bounds];

}
選擇Segue
可在main storyboard 可選擇方向

多重storyboard

一開始建立四個btn
然後分別為push 1 ,2
moodel 1,2
然後建立 push1跟model1 的IBAction
然後建立第二個storyboard
增加viewcontroller
調整Top bar改為TransLucent Navigation
增加一個navigation item
- (IBAction)push1BtnPressed:(id)sender {

UIStoryboard * push = [UIStoryboard storyboardWithName:@"Push" bundle:nil];
    UIViewController* targetVC = [push instantiateViewControllerWithIdentifier:@"pink"];

    [self.navigationController pushViewController:targetVC animated:true];

}
- (IBAction)backToMain:(UIStoryboardSegue*)sender {
    NSLog(@"backToMain executed.");
}
從逃生門拉到

Comments

Popular posts from this blog

MEGA 暫存檔案刪除

XAMPP 使用多PORT來執行不同網頁

IOS GCD多執行緒