Posts

Post not yet marked as solved
1 Replies
586 Views
Description of Problem: I have a flight logging app and log all date and time in UTC timezone. The pseudo code is as follows: datePicker.preferredDatePickerStyle = .compact datePicker.date = Date.now datePicker.timeZone = TimeZone(identifier: "UTC") Most of the time, when I click the label, it opens the calendar-style view as the current month. However, if the "local date" of the device is +1 day of the UTC date. It opens the calendar-style view as the "last month". For example, if current time is January 15th, 2023 1:05 (AM) in Japan/Tokyo, the UTC time will be January 14th, 2023 16:05. The bug will appear. How to reproduce: Set the device timezone to Tokyo/Japan (UTC+0900). Set the local time to 1:05AM of January 15th, 2023. Create a UIDatePicker with style .compact, date to "now", and its timezone to "UTC". Click the datepicker, and a calendar-style view will show. Result expected: The view shows the month of January 2023, with January 15th selected. Result actually shown: The view shows month of "last" month (December 2022). However, when I scroll to next month, January 15th is already selected anyway. If you're timezone is Tokyo/Japan (UTC+0900), you can expect this bug when the time is between 12:00AM-08:59AM. Since during this 9 hours period, the date is +1 later then UTC date. I believe it's a bug, so I filed a bug report with ID FB11946646
Posted
by benck.
Last updated
.
Post not yet marked as solved
1 Replies
1.9k Views
I'm implementing the iOS 14 (iPadOS 14) sidebar (UISplitViewController with TripleColumn) and having strange "sidebar toggle icon" behavior. In iOS 13 I'm using the tab bar with tabs with "split views" and tab with only "table view" so I need the Triple Column instead of the Double Column to work. In iOS 13, there is one tab with only a table view, so I set the supplementary view to nil, and hide the view by calling "hide" method implemented in UISplitViewController in iOS 14. (See below for code). The "sidebar toggle icon" on the upper left is automatically displayed. After clicking the toggle icon, the sidebar hides correctly but an "back button" was created on my secondary view(a UITableViewController embedded in a UINavigationController). Selecting the back button has no response at all. However, user can still swipe from the left edge of the screen to make sidebar reappear but the "back button" is confusing. My expected behavior is, after the toggle icon selected in sidebar, display the "sidebar toggle icon" instead of the "back button" in the secondary view. And after pressing the "sidebar toggle icon" in secondary view, the sidebar reappears. Like the Photos app in iPadOS 14, the toggle button is shown instead of the back button in the secondary view. And clicking the toggle icon will make the sidebar shown again. (but it's a double column split view though, not a triple column split view.)  SceneDelegate.swift: func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 		if let windowScene = scene as? UIWindowScene { 				let window = UIWindow(windowScene: windowScene) 				if #available(iOS 14.0, *) { 						let main = UIStoryboard(name: "Main", bundle: nil) 						 						let splitViewController = UISplitViewController(style: .tripleColumn) 						splitViewController.preferredDisplayMode = .twoBesideSecondary 						splitViewController.preferredSplitBehavior = .tile 						splitViewController.setViewController(SideBarViewController(), for: .primary) 						// fall back for compact screen 						splitViewController.setViewController(main.instantiateInitialViewController(), for: .compact) 						window.rootViewController = splitViewController 						self.window = window 						window.makeKeyAndVisible() 				} 		} } SideBarViewController.swift: // if the first tab (dashboard) was selected private func selectDashboardTab() { 		if #available(iOS 14.0, *) { 				 				let dashboardVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "DashboardTab") as? UINavigationController 				splitViewController?.preferredPrimaryColumnWidth = 250.0 				splitViewController?.preferredDisplayMode = .twoBesideSecondary 				splitViewController?.preferredSplitBehavior = .tile 				splitViewController?.setViewController(dashboardVC, for: .secondary) 				splitViewController?.setViewController(nil, for: .supplementary) 				splitViewController?.hide(.supplementary) 		} }
Posted
by benck.
Last updated
.