ios13

How to change the status bar background color and text color on iOS 13?

只愿长相守 提交于 2019-11-26 22:14:41
问题 With the arrival of iOS 13 statusBar's view is no longer accessible trough: value(forKey: "statusBar") as? UIView Due to: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'App called -statusBar or -statusBarWindow on UIApplication: this code must be changed as there's no longer a status bar or status bar window. Use the statusBarManager object on the window scene instead.' But it's not clear how it should be used for changing colours as keyWindow?

Dark mode launch screen in iOS 13

点点圈 提交于 2019-11-26 22:00:36
问题 I've updated my iOS app to work in dark mode on iOS 13 but I am having trouble trying to get the launch screen to look good. Currently it is a bright white screen with the app logo which looks awful in dark mode. I have tried setting the background colour of the launch screen to be a colour asset that I made with "Any Appearance" being white and "Dark Appearance" being black - but the launch screen still always shows as white. Is there any way to get my launch screen to work properly in dark

UICollectionView and SwiftUI?

眉间皱痕 提交于 2019-11-26 19:24:35
问题 How to create grid of square items (for example like in iOS Photo Library) with SwiftUI? I tried this approach but it doesn't work: var body: some View { List(cellModels) { _ in Color.orange.frame(width: 100, height: 100) } } List still has UITableView style: 回答1: One of the possible solutions is to wrap your UICollectionView into UIViewRepresentable . See Combining and Creating Views SwiftUI Tutorial, where they wrap the MKMapView as an example. By now there isn’t an equivalent of

Xcode 11 - Opt out of UISceneDelegate/SwiftUI on iOS 13

℡╲_俬逩灬. 提交于 2019-11-26 16:49:12
问题 I'm currently using Xcode 11 Beta 5. Within my application, it runs fine on iOS 12 and under. However, on iOS 13 it looks like it's using the UIScene by default. This is causing my app to not do anything. When the app launches on fresh install, there is a terms and conditions the user must accept. After agreeing they go to a loading screen which then directs them to the main view. In the screenshot I posted, the view behind the current one in foreground is the splash loading screen. We will

Xcode 11 & iOS13, using UIKIT can't change background colour of UIViewController

房东的猫 提交于 2019-11-26 14:57:13
问题 So I created a new project in Xcode11, set the AppDelegate to my new VC and commented the code present in xxx scene delegate to not have the UIKit part: func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. window = UIWindow() window?.makeKeyAndVisible() let controller = MainVC() window?.rootViewController = controller return true } In my

iOS 13.1 Crash in AVAudio Player

我们两清 提交于 2019-11-26 12:46:40
问题 My App is crashing on iOS 13.1 when i trace a issue then found App is crashing because of AVAudioPlayer . Below Is My Player Setup. if let wrongURL = Bundle.main.url(forResource: \"wrongAudio\", withExtension: \"mp3\") { do { wrongMusicPlayer = try AVAudioPlayer(contentsOf: wrongURL) wrongMusicPlayer.prepareToPlay() } catch { print(error.localizedDescription) } } Here All things found correctly but crash when AVAudioPlayer try to initialise with URL . 回答1: I found a crash issue in

How to change the colors of a segment in a UISegmentedControl in iOS 13?

余生长醉 提交于 2019-11-26 11:57:27
问题 A UISegmentedControl has a new appearance in iOS 13 and existing code to alter the colors of the segmented control no longer work as they did. Prior to iOS 13 you could set the tintColor and that would be used for the border around the segmented control, the lines between the segments, and the background color of the selected segment. Then you could change the color of the titles of each segment using the foreground color attribute with titleTextAttributes . Under iOS 13, the tintColor does

In iOS13 the status bar background colour is different from the navigation bar in large text mode

拟墨画扇 提交于 2019-11-26 05:31:04
问题 Pre-conditions to reproduce the problem: Xcode 11 beta + iOS 13 (latest version until Jun. 12 2019) The navigation bar is in Large text mode Specify the colour of navigation bar. The status bar will remain in white in a real device, above the green navigation bar. Solutions I tried: Revert it back to iOS12 will solve it, but we will encounter iOS13 eventually... disabling the large text mode will solve it... hide the status bar will fix it, but it will cause status text overlapping with

Presenting modal in iOS 13 fullscreen

北城以北 提交于 2019-11-25 22:04:07
问题 In iOS 13 Beta 1 there is a new behaviour for modal view controller when being presented. Now it\'s not fullscreen by default and when I try to slide down, the app just dismiss the View Controller automatically. How can I prevent this behaviour and get back to the old good fullscreen modal vc? Thanks 回答1: With iOS 13, as stated in the Platforms State of the Union during the WWDC 2019, Apple introduced a new default card presentation. In order to force the fullscreen you have to specify it