iOSSafari(瀏覽器)

凌浩雨發表於2018-01-25

開啟系統瀏覽器

#import "ViewController.h"
#import <SafariServices/SafariServices.h>

@implementation ViewController

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    // 如果公司沒有特殊的介面制定要求, 當彈出網頁的時候, 可以使用這裡的SFSafariViewController
    SFSafariViewController *sf = [[SFSafariViewController alloc] initWithURL:[NSURL URLWithString:@"https://www.baidu.com"]];
    [self presentViewController:sf animated:YES completion:nil];
}

@end


相關文章