uitraitcollection Questions

2

In my initial view controller, I have have a UITabbarController as a child view controller. I want to have UITabbarController to display its UITabbar with traitCollection having horizontalSizeClas...
Workingman asked 28/12, 2019 at 10:11

1

Solved

I am trying to work with this function but it does not work with iOS 17. I want to make a change every time I switch between dark and light mode. This is my function: override func traitCollectionD...
Parry asked 13/11, 2023 at 15:43

1

Solved

I support dark mode. In some of my view controllers I use traitCollectionDidChange(_) for handling user interface style changes. override func traitCollectionDidChange(_ previousTraitCollection: UI...
Cudlip asked 12/8, 2020 at 8:21

4

Solved

Let's say I have a custom color in my app: extension UIColor { static var myControlBackground: UIColor { return UIColor(red: 0.3, green: 0.4, blue: 0.5, alpha: 1) } } I use this in a custom con...
Chiu asked 7/6, 2019 at 3:43

1

Solved

In my app I allow the user to override the appearance that is set on the device. Here's the class that handles updating the UI if they want to override the system-wide appearance: class UserInterf...
Hypoploid asked 4/3, 2020 at 18:55

0

I have a UITabBar which has to have a traitCollection with compact horizontalSizeClass. Because on a regular horizontalSizeClass, UITabBar renders TabBarIcon and Title side by side. I did subclass...
Monopetalous asked 12/12, 2019 at 6:44

3

Solved

Some of the UI setups not working automatically with the Dark/Light mode change as the UIColor. For example shadow in layer. As I need to remove and drop shadow in dark and light mode, I need somew...
Dentil asked 19/9, 2019 at 18:16

1

Solved

Apple recommends that we use traitCollectionDidChange and compare trait collections using hasDifferentColorAppearance to catch when dark mode is toggled, and act on it if we need to. Like this: ov...
Trichromatic asked 22/9, 2019 at 18:44

0

The new size classes based Autorotation is a pain if you want custom behavior. Here are my requirements and flow: View Controller 1(VC1) modally presents View Controller 2 (VC2) VC1 only supports...
Negris asked 18/11, 2018 at 19:9

1

Solved

My open source library needs to be able to call UIApplication.shared.preferredContentSizeCategory. But UIApplication.shared is unavailable in extensions. The build error suggests that I find a view...
Minutes asked 30/12, 2016 at 0:9

3

Solved

I'm moving over to UIPresentationController based presentations for my view controllers but have run into some confusion with the API. I have a custom sidebar style view controller presentation (s...

1

I am building my custom UIControl, a custom button built as an IBDesignable, which needs to change based on the size class in which it is being displayed. I have a method -setupForTraitCollection, ...
Nenitanenney asked 10/2, 2015 at 23:50

1

Solved

I am presenting a modal view controller using UIPresentationController. I am setting the frame of presentedView less than the containView's bounds using following method: override func frameOfPres...
1

© 2022 - 2024 — McMap. All rights reserved.