ios13

iOS 13: Swift - 'Set application root view controller programmatically' does not work

旧城冷巷雨未停 提交于 2020-01-10 18:44:06
问题 I have following code in my AppDelegate.swift to setup root view controller for an iOS application. But it does not work. It follows Target structure (defined under General tab) and ignores this code. (Xcode 11, Swift 5.1, iOS 13) class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { window = UIWindow(frame: UIScreen.main.bounds)

UISegmentedControl iOS 13 clear color

南楼画角 提交于 2020-01-10 16:15:46
问题 On iOS 12, to get a UISegmentedControl with clear border, clear divider line, everything clear was easy. All I did was this: settingControl.tintColor = .clear let font = myFont let boldfont = myBoldFont settingControl.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.white, NSAttributedString.Key.font:font], for: .normal) settingControl.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.red, NSAttributedString.Key.font:boldfont], for: .selected)

UISplitViewController will not correctly collapse at launch on iPad iOS 13

我是研究僧i 提交于 2020-01-10 10:07:12
问题 I am transitioning my app to iOS 13, and the UISplitViewController collapses onto the detail view, rather than the master at launch — only on iPad. Also, the back button is not shown - as if it is the root view controller. My app consists of a UISplitViewController which has been subclassed, conforming to UISplitViewControllerDelegate . The split view contains two children — both UINavigationControllers , and is embedded in a UITabBarController (subclassed TabViewController ) In the split

SwiftUI How to push to next screen when tapping on Button

依然范特西╮ 提交于 2020-01-10 06:01:17
问题 I can navigate to next screen by using NavigationButton (push) or present with PresentationButton (present) but i want to push when i tap on Buttton() Button(action: { // move to next screen }) { Text("See More") } is there a way to do it? 回答1: You can do using NavigationLink Note: Please try in real device. in simulator sometimes not work properly. struct MasterView: View { @State var selection: Int? = nil var body: some View { NavigationView { VStack { NavigationLink(destination:

UINavigationBar turns white and won't close when using navigationItem.searchController in iOS 13

北城以北 提交于 2020-01-06 08:13:01
问题 I am having trouble using navigationItem.searchController in iOS 13. The search bar of the search controller is initially closed, but it won't collapse back after I scroll the table view. It 'bounces' back when I try to hide the bar. Also, the navigation bar turns white after the search bar appears. (The navigation bar has a custom tint color; see the attached screenshots.) Note that this wasn't the case in iOS < 13. Is this a bug in iOS 13? If it is, is there a work around to keep the tint

UINavigationBar turns white and won't close when using navigationItem.searchController in iOS 13

自闭症网瘾萝莉.ら 提交于 2020-01-06 08:12:35
问题 I am having trouble using navigationItem.searchController in iOS 13. The search bar of the search controller is initially closed, but it won't collapse back after I scroll the table view. It 'bounces' back when I try to hide the bar. Also, the navigation bar turns white after the search bar appears. (The navigation bar has a custom tint color; see the attached screenshots.) Note that this wasn't the case in iOS < 13. Is this a bug in iOS 13? If it is, is there a work around to keep the tint

Disable gesture to pull down form/page sheet modal presentation

半世苍凉 提交于 2020-01-05 08:24:15
问题 In iOS 13 modal presentations using the form and page sheet style can be dismissed with a pan down gesture. This is problematic in one of my form sheets because the user draws into this box which interferes with the gesture. It pulls the screen down instead of drawing a vertical line. How can you disable the vertical swipe to dismiss gesture in a modal view controller presented as a sheet? Setting isModalInPresentation = true still allows the sheet to be pulled down, it just won't dismiss.

iOS 13 Voice Control Accessibility Feature - is there a way to do more custom actions (rather than just linking to accessibility labels)?

梦想与她 提交于 2020-01-05 04:27:21
问题 The new Voice Control API is super cool, it's the one where you can speak to your iOS device and perform actions. (Video from Apple) My only gripe is that finding information on it is kinda difficult. I don't see any WWDC videos out there on it, and I can't find any other documentation. It's basically powered by accessibilityLabels. Since each accessibilityElement can really only have one accessibilityLabel it's (from what I can see) limited to that. Is that accurate? Is there a way to

Shortcut item on app icon not working with iOS 13

我是研究僧i 提交于 2020-01-05 04:17:15
问题 To support shortcut items on the app icon we've implemented the following method in SceneDelegate : func windowScene(_ windowScene: UIWindowScene, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) This method does not get called when the app is killed and launched through such an shortcut item (it just shows the main screen). However when the app is running and in the background this method gets called and everything works as expected. I've

iOS13 share sheet: how to set preview thumbnail when sharing UIImage

烂漫一生 提交于 2020-01-04 09:02:19
问题 The new share sheet on iOS13 shows a preview/thumbnail of the item being shared on its top left corner. When sharing an UIImage using an UIActivityViewController I would expect a preview/thumbnail of the image being shared to be displayed there (like e.g. when sharing an image attached to the built in Mail app), but instead the share sheet is showing my app's icon. What code/settings are required to show a thumbnail of the image being exported in the share sheet? I have set up the