// 多window实现,同时存在2个window,1个在下面,1个在上面, 通过调用makeKeyAndVisible()让一个window称为要展示的那个 self.window = UIWindow(frame: UIScreen.main.bounds) let nav = UINavigationController(rootViewController: TabViewController()) window?.rootViewController = nav window?.makeKeyAndVisible() self.adWindow = UIWindow(frame: UIScreen.main.bounds) let adVC = adViewViewController() let nav = UINavigationController(rootViewController: adVC) adWindow?.rootViewController = nav adWindow?.makeKeyAndVisible()
window.rootVC = 广告VC window.rootVC = 主页VC 双方通过UIView.transition转场动画,切换显示。 UIView.transition(with: appDelegate.window!, duration: 0.5, options: .transitionCrossDissolve) { appDelegate.window?.rootViewController = appDelegate.rootNavController! } completion: { _ in // do something }
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url NS_DEPRECATED_IOS(2_0, 9_0, "Please use application:openURL:options:") __TVOS_PROHIBITED; - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(nullable NSString *)sourceApplication annotation:(id)annotation NS_DEPRECATED_IOS(4_2, 9_0, "Please use application:openURL:options:") __TVOS_PROHIBITED; - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options NS_AVAILABLE_IOS(9_0); // no equiv. notification. return NO if the application can't open for some reason
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options NS_AVAILABLE_IOS(9_0) func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { self.openUrl(url) return true }
<key>LSApplicationQueriesSchemes</key> <array> <!-- 微信 URL Scheme 白名单--> <string>wechat</string> <string>weixin</string> <!-- 新浪微博 URL Scheme 白名单--> <string>sinaweibohd</string> <string>sinaweibo</string> </array>
文章来源地址https://www.toymoban.com/news/detail-427280.html
文章来源:https://www.toymoban.com/news/detail-427280.html
到了这里,关于iOS APP启动广告实现方式 与 APP唤端调用的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!