Post

Replies

Boosts

Views

Activity

UISlider valueChanged has uninitialized UIEvent
This issue was in the first iOS 26 beta and it still there with Xcode 26 beta 6 (17A5305f). Feedback is FB18581605 and contains sample project to reproduce the issue. I assign a target and action to a UISlider for the UIControl.Event.valueChanged value: addTarget(self, action: #selector(sliderValueDidChange), for: .valueChanged) Here’s the function. @objc func sliderValueDidChange(_ sender: UISlider, event: UIEvent) { print(event) } When printing the event value, there is a crash. When checking the event value with lldb, it appears uninitialized.
Topic: UI Frameworks SubTopic: UIKit Tags:
7
3
278
3w
UITabBarController bottom accessory doesn't resize properly when horizontal size class changes from compact to regular
A bottom accessory view is set on the UITabBarController. When changing the window size either by dragging the resizing grip or when going to portrait mode, the accessory view shrinks down to the smaller width. When resizing the window to make it larger, the accessory view doesn’t resize to the full available width. During a workshop setup by Apple, folks from Apple told me that the view set as the content view of the UITabAccessory should not have its frame changed, either by using Auto Layout or by setting the frame. It seems logical since the view in the bottom accessory is supposed to resize accordingly to several factors, like when going inline inside the tab bar. Am I missing something? Maybe there is additional setup required not mentioned in the dedicated video. Feedback is FB19017330. It contains a sample project and videos demonstrating the issue. Reproduced on Xcode 26 beta 6 (17A5305f) I copy and paste the sample code that setups the bottom accessory for good measure. final class MiniPlayer: UIView { let label = UILabel() override init(frame: CGRect) { super.init(frame: frame) label.text = "Mini Player" label.numberOfLines = 0 label.textAlignment = .center addSubview(label) label.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ label.centerXAnchor.constraint(equalTo: centerXAnchor), label.centerYAnchor.constraint(equalTo: centerYAnchor) ]) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } } // MARK: - View Controller class ViewController: UIViewController { let rootTabBarController = UITabBarController() let miniPlayer = MiniPlayer() override func viewDidLoad() { super.viewDidLoad() let items: [UITab] = [ UITab(title: "Tab 1", image: UIImage(systemName: "archivebox.fill"), identifier: "tab-1") { _ in UIViewController() }, UITab(title: "Tab 2", image: UIImage(systemName: "books.vertical.fill"), identifier: "tab-2") { _ in UIViewController() }, UISearchTab { _ in UIViewController() } ] rootTabBarController.tabs = items rootTabBarController.view.backgroundColor = .secondarySystemBackground view.addSubview(rootTabBarController.view) rootTabBarController.view.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ rootTabBarController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), rootTabBarController.view.topAnchor.constraint(equalTo: view.topAnchor), rootTabBarController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), rootTabBarController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor) ]) rootTabBarController.bottomAccessory = UITabAccessory(contentView: miniPlayer) } }
0
0
154
3w
`accessibilityUserInputLabels` is ignored on `UIBarButtonItem`
accessibilityUserInputLabels is working fine with any view I tried this on. Meaning that the control can be toggled with the provided alternative names when using Voice Control. When setting this property on any UIBarButtonItem though, it seems Voice Control ignores the alternative names provided by setting accessibilityUserInputLabels. For comparison, accessibilityLabel works perfectly when set on UIBarButtonItem. Is anyone facing the same issue? Using Xcode 16.0 (16A242) on iOS 18
3
0
537
3w
SF Symbol variable draw doesn't work in UIKit
I tried playing with SF Symbols variable value draw from the first iOS 26 beta and it has never been working, whereas the SwiftUI version works properly. I just copied and pasted the code from the related video What’s new in SF Symbols 7 and it simply doesn't work (screenshot attached). Full view controller code is at the end of the post. imageView.image = UIImage(systemName: "thermometer.high", variableValue: 0.5) imageView.preferredSymbolConfiguration = UIImage.SymbolConfiguration(variableValueMode: .draw) Am I missing something? Or is it still not ready? I reproduced the issue with Xcode 26 beta 6 (17A5305f). The release candidates are approaching fast and I am worried this will not be working by then. The feedback ID is FB18898182. class ViewController: UIViewController { let imageView = UIImageView() override func viewDidLoad() { super.viewDidLoad() imageView.image = UIImage(systemName: "thermometer.high", variableValue: 0.5) imageView.preferredSymbolConfiguration = UIImage.SymbolConfiguration(variableValueMode: .draw) .applying(UIImage.SymbolConfiguration(font: .systemFont(ofSize: 40))) view.addSubview(imageView) imageView.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ imageView.centerXAnchor.constraint(equalTo: view.centerXAnchor), imageView.centerYAnchor.constraint(equalTo: view.centerYAnchor) ]) } }
1
0
121
3w
tvOS search: grid keyboard will not slide when search results are focused
Hi there! I am working on a tvOS application with a UISearchController. I have a problem when the grid keyboard is selected in the settings (Settings->General->Keyboard Layout). When the search results are focused, I expect the keyboard to slide to the leading edge to let the search results fill all the available width. This is the standard behavior in all Apple applications. But I can't get that behavior. The keyboard will stay when the search results are focused: Missing image. I'll retry to upload it hoping that it will work this time I followed the video Discover search suggestions for Apple TV (the only one I could find where this topic was dealt with) and did everything mentioned: Embed the UISearchController inside a UISearchContainerViewController Set the collection view of the search results controller as the observed one with setContentScrollView in the search results controller (as explained in the doc) In the video, the behavior I expect is mentioned, and it seems that no additional steps are required to obtain it (~ 9'52''): Our keyboard is highly adaptable to various languages and input methods. You should consider this when laying out your search results. Here are a few examples of alternate layouts. For people using IR remotes, we'll display a grid keyboard. While typing, the search results will only occupy some of the screen width, and then they'll slide in to fill the screen when focused. Is there something I am missing? Or is this a bug and I should file a radar? Environment tvOS 15 UIKit The problem exists on the Simulator as well as on the Apple TVs I tested: 4K (2nd generation) and HD Note I could not find a 3rd party application that gets this behavior. All applications using a UISearchController I could try have the same problem.
4
6
2.6k
Dec ’22