آلَحـ🇾🇪ᬼ⃝⃡Wٌـّاج
this string cause a crash on iOS 26 when sett label.text
Crashed: com.apple.main-thread
0 CoreText 0xf720c std::__1::__hash_table<std::__1::__hash_value_type<long, CGPoint>, std::__1::__unordered_map_hasher<long, std::__1::__hash_value_type<long, CGPoint>, std::__1::hash, std::__1::equal_to, true>, std::__1::__unordered_map_equal<long, std::__1::__hash_value_type<long, CGPoint>, std::__1::equal_to, std::__1::hash, true>, std::__1::allocator<std::__1::__hash_value_type<long, CGPoint>>>::erase(std::__1::__hash_const_iterator<std::__1::__hash_node<std::__1::__hash_value_type<long, CGPoint>, void*>>) + 300
1 CoreText 0xf63d4 TGlyphComposer::ComposeGlyphs(long, TInlineVector<unsigned short, 30ul> const&, TInlineVector<long, 30ul> const&) + 2896
2 CoreText 0x8b018 TCombiningEngine::ResolveCombiningMarks(TCombiningEngine::CombiningFlag, bool, bool*) + 2232
3 CoreText 0x4edf0 TKerningEngine::PositionGlyphs(TRunGlue&, TCharStream const&, signed char) + 1108
4 CoreText 0x4eee8 TTypesetter::FinishLayout(std::__1::tuple<TLine const*, TCharStream const*, void const* ()(__CTRun const, __CFString const*, void*), void*, std::__1::shared_ptr, unsigned int, unsigned char, bool, long> const&, TRunGlue&, signed char, SyncState) + 64
5 CoreText 0x34608 TTypesetterAttrString::Initialize(__CFAttributedString const*, bool) + 3300
6 CoreText 0x34d88 TTypesetterAttrString::TTypesetterAttrString(__CFAttributedString const*, __CFDictionary const*, bool) + 160
7 CoreText 0x34c38 CTLineCreateWithAttributedString + 84
8 UIFoundation 0x6204 __NSCoreTypesetterCreateBaseLineFromAttributedString + 704
9 UIFoundation 0xafd38 -[NSCoreTypesetter _stringDrawingCoreTextEngineWithOriginalString:rect:padding:graphicsContext:forceClipping:attributes:stringDrawingOptions:drawingContext:stringDrawingInterface:] + 2652
10 UIFoundation 0x26bc __NSStringDrawingEngine + 1592
11 UIFoundation 0xab308 -[NSString(NSExtendedStringDrawing) boundingRectWithSize:options:attributes:context:] + 164
12 UIKitCore 0x186a978 + 132
13 UIKitCore 0x48a7c + 668
14 UIKitCore 0x186b35c + 444
15 UIKitCore 0x186eb30 + 408
16 UIKitCore 0x486d4 + 136
17 UIKitCore 0x47c1c + 80
18 UIKitCore 0x1b68e4 + 80
19 UIKitCore 0x1867c08 + 760
20 UIKitCore 0x18678ec + 72
21 UIKitCore 0x186be30 + 104
.......
28 UIKitCore 0xa894e0 + 52
29 UIKitCore 0x19047fc + 76
30 UIKitCore 0xa88b0c + 1196
31 UIKitCore 0xa91ce0 + 524
32 UIKitCore 0xa9222c + 280
33 UIKitCore 0xa90550 + 3036
34 UIKitCore 0x1e1604 + 280
35 UIKitCore 0x27078 + 912
36 UIKitCore 0x27b38 + 40
37 UIKitCore 0x190df68 + 2532
38 QuartzCore 0xac8bc + 116
39 QuartzCore 0x8f2fc + 600
40 QuartzCore 0xadf84 + 200
41 QuartzCore 0x6ef78 + 536
42 QuartzCore 0x9bab0 + 644
43 QuartzCore 0xa93c0 + 88
44 UIKitCore 0x780f0 + 52
45 UIKitCore 0x78024 + 352
46 UIKitCore 0x85ee8 + 128
47 UIKitCore 0x85378 + 60
48 UpdateCycle 0x15f8 UC::DriverCore::continueProcessing() + 84
49 CoreFoundation 0x6a230 + 28
50 CoreFoundation 0x6a1a4 + 172
51 CoreFoundation 0x47c6c + 232
52 CoreFoundation 0x1d8b0 + 820
53 CoreFoundation 0x1cc44 + 532
54 GraphicsServices 0x1498 GSEventRunModal + 120
55 UIKitCore 0xa9ddc + 792
56 UIKitCore 0x4eb0c UIApplicationMain + 336
57 UIKitCore 0x18a860 + 588
59 ??? 0x18c7cae28 (缺少)
UIKit
RSS for tagConstruct and manage graphical, event-driven user interfaces for iOS or tvOS apps using UIKit.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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)
])
}
}
Summary: On iOS 26.0, iPad apps ignore standard interface orientation controls (shouldAutorotate, supportedInterfaceOrientations, Info.plist settings) and rotate to landscape despite being configured for portrait-only.
Steps to Reproduce:
Create iPad app with portrait-only configuration
Implement shouldAutorotate returning NO
Implement supportedInterfaceOrientations returning UIInterfaceOrientationMaskPortrait
Set Info.plist UISupportedInterfaceOrientations~ipad to UIInterfaceOrientationPortrait only
Run on iPad with iOS 26.0
Rotate device physically
Expected Result: App should remain locked in portrait orientation
Actual Result: Entire app interface rotates to landscape, ignoring all orientation controls
Additional Information:
Same code works correctly on iOS 18.4 (stays portrait-only)
Problem affects entire UI including status bar and all view controllers
All standard orientation control methods are implemented correctly
Issue occurs on both simulator and physical devices
Code Sample:
objc
-(BOOL)shouldAutorotate {
return NO;
}
(UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return UIInterfaceOrientationMaskPortrait;
}
Configuration:
iOS Version: 26.0
Device: iPad (all models affected)
Xcode Version: 16.x
Deployment Target: iOS 16.6+
Topic:
UI Frameworks
SubTopic:
UIKit
Dear Apple Developer Support,
I am reporting a critical bug in iOS 26.0 that affects the entire system's keyboard functionality and device performance.
Issue Description:
When a UIInputView is displayed and a new ViewController is presented, the UIInputView loses focus and disappears. After the presented ViewController is dismissed, the UIInputView regains focus and reappears. However, in this specific scenario, the app becomes completely unresponsive without any error logs or crashes.
Critical System Impact:
The device becomes sluggish and performance degrades significantly
Other apps' keyboard functionality is completely broken - text fields cannot activate keyboards
This is a system-level issue that persists even after the affected app is terminated
Device performance remains degraded until restart
Technical Details:
The issue appears to be related to First Responder chain corruption during UIInputView focus transitions
No crashes or error logs are generated, making it difficult to debug
The problem affects the entire iOS keyboard subsystem, not just the specific app
This suggests a potential memory leak or resource management issue at the system level
Version Information:
iOS Version: 26.0
Previous versions: No such issues reported
Affected devices: Multiple devices tested
Evidence of System-Level Bug:
The fact that other apps' keyboard functionality is affected and device performance degrades system-wide strongly indicates this is an iOS 26.0 system bug rather than an application-specific issue. The First Responder chain corruption appears to be preventing proper cleanup of keyboard-related resources.
This issue is blocking production releases and requires urgent attention as it affects the core iOS keyboard functionality.
Thank you for your prompt attention to this critical issue.
[https://youtube.com/shorts/1Hc7S3aasAw?feature=share]
Topic:
UI Frameworks
SubTopic:
UIKit
Same PDF renders differently when open in Chrome, Safari; Apple Preview, Acrobat.
on Apple Preview, Safari - the PDF appears correctly for a second or two and then appears washed out.
Our app uses Safari to render PDFs and our users are complaining that scanned PDFs are not rendering properly.
How do I fix this issue (Swift, Obj-C)?
Description:
1. When initiating the print flow via UIPrintInteractionController, and no printer is initially connected, iOS displays all possible paper sizes in the paper selection UI. However, if a printer connects in the background after this view is shown, the list of paper sizes does not automatically refresh to reflect only the options supported by the connected printer.
2. If the user selects an incompatible paper size (one not supported by the printer that has just connected), the app crashes due to an invalid configuration.
Steps to Reproduce:
Launch the app and navigate to the print functionality.
Tap the Print button to invoke UIPrintInteractionController.
At this point, no printer is yet connected. iOS displays all available paper sizes.
While the paper selection UI is visible, the AirPrint-compatible printer connects in the background.
Without dismissing the controller, the user selects a paper size (e.g., one that is not supported by the printer).
The app crashes.
Expected Result: App should not crash
Once the printer becomes available (connected in the background), the paper size options should refresh automatically.
The list should be filtered to only include sizes that are compatible with the connected printer.
This prevents the user from selecting an invalid option, avoiding crashes.
Actual Result: App crashes
The paper size list remains unfiltered.
The user can still select unsupported paper sizes.
Selecting an incompatible option causes the app to crash, due to a mismatch between UI selection and printer capability.
Demo App Crash : https://drive.google.com/file/d/19PV02wzOJhc2DYI6kAe-uxHuR1Qg15Bu/view?usp=sharing
Apple Files App Crash: https://drive.google.com/file/d/1flHKuU_xaxHSzRun1dYlh8w7nBPJZeRb/view?usp=sharing
After iOS 26 was released to the public and our build began rollout, we started seeing a strange crash affect users immediately after the app goes to the background. According to the symbolication provided in Xcode, this appears to be the result of a UICollectionView potentially related to the keyboard and a UIAlertController. I’m not sure how an error somewhere else can cause a crash in our app which does not use UIKit in the background.
The feedback associated with this post is: FB20305833.
I will attach a sample of the crash report in my next comment.
On iPad running iOS 26, UIKeyboardType.decimalPad sometimes appears as a floating keypad (compact panel) instead of the docked, full-width keyboard. Our app attaches a custom toolbar via inputAccessoryView, so the floating keypad hides the toolbar and breaks the flow. We’d like to opt out of the floating keypad or force the keyboard to remain docked when a toolbar is present.
Environment
Device: iPad (multiple models)
OS: iPadOS 26.0
App type: UIKit
Field: UITextField with keyboardType = .decimalPad
We present a custom toolbar via inputAccessoryView
Expected
Docked (full-width) keyboard so the inputAccessoryView toolbar is visible and sized correctly.
Actual
A floating decimal keypad appears and covers content; our accessory toolbar isn’t visible/attached to it.
Why this matters
Our toolbar contains required domain actions (Done/Next, Previous). When the keypad floats, the user loses these controls.
Questions
Is there a supported way to opt out of the floating numeric keypad on iPad when using decimalPad?
Is there an API/trait to prefer docked keyboard (e.g., when an inputAccessoryView is present)?
I have an App which supports multiple windows on the iPad. The App can receive URLs from other Apps (via application.openURL()) and also files via "share sheet" (via UIActivityViewController).
When receiving a URL from another App the delegate method
scene(_ scene: UIScene, openURLContexts URLContexts: Set)
will be called on an existing UIScene, however when a file is received through the share sheet from another App, a new UIScene is created and therefore also a new window (eg the delegates
application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions)
and
scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions)
are called).
In both cases I do get the URL and file just fine, however I do not want to get new UIScenes and windows created when receiving a file via share sheet.
How can I prevent to get a new UIScene or window? The received files should be used in the existing windows and should not create new ones.
using renderInContext fetch pixel faild if subviews contains WKWebView, the code is as follows:
self.contentView = [SimpleClearContentView alloc] initWithFrame:CGRectMake(0, 100, 100, 100)];
contentView.backgroundColor = [UIColor clearColor];
self.contentView.webView = [[WKWebView alloc] init];
self.contentView.webView.frame = CGRectMake(0, 0, 50, 100);
// make web view clear bg color
self.contentView.webView.backgroundColor = [UIColor clearColor];
self.contentView.webView.scrollView.backgroundColor = [UIColor clearColor];
// webView load clear background webpage
[self.contentView.webView loadRequest:xxx];
[self.view addSubView:contentView];
// this method still return 0.0f anywhere
-(CGFloat)getPixelAlphaAtPoint:(CGPoint)point {
unsigned char pixel[4] = {0};
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(pixel, 1, 1, 8, 4, colorSpace, kCGBitmapAlphaInfoMask & kCGImageAlphaPremultipliedLast);
CGContextTranslateCTM(context, -point.x, -point.y);
WKWebView *webView = self.contentView.webView;
[webView.layer renderInContext:context];
CGContextRelease(context);
CGColorSpaceRelease(colorSpace);
CGFloat alpha = pixel[3]/255.0;
return alpha;
}
In the WWDC 2025 session "Build a UIKit app with the with the new design", at the 23:22 mark, the presenter says:
And finally, when you no longer need the glass on screen animate it out by setting the effect to nil.
The video shows a UIVisualEffectView whose effect is set to a UIGlassEffect animating away as its effect is set to nil. But when I do this in my app (or a sample app), setting effect to nil does not remove the glass appearance. Is this expected? Is the video out of date? Or is this a bug?
Scenario: Typing Chinese Zhuyin “ㄨㄤ” and then selecting the candidate word “王”.
On iOS 18, the delegate (textField:shouldChangeCharactersInRange:replacementString:) is called with:
range: {0, 2}
replacementString: "王"
On iOS 26, the delegate (textField:shouldChangeCharactersInRanges:replacementString:) instead provides:
ranges: [{2, 0}]
replacementString: "王"
This results in inconsistent text input handling compared to earlier system versions.
Implement: Limit user input to a maximum of 100 Chinese characters.
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
if ([textField markedTextRange]) {
return YES;
}
NSString *changedString = [textField.text stringByReplacingCharactersInRange:range withString:string];
if (changedString.length > 100) {
return NO;
}
return YES;
}
Questions:
Is this an intentional change in iOS 26?
If intentional, what is the recommended way to handle such cases in order to support both iOS 18 and iOS 26 consistently?
On an iPad running iOS26, there is an issue with the numberPad keyboard
I have a UITextField with a keyboard type of .numberPad
When I first tap in the field, a new number pad with just numbers (similar to the one that shows up on iPhone) shows up.
When I tap again in the field, that number pad goes away.
When I tap in the field again, the full keyboard with numbers etc shows up (this is the one that used to always show up pre-iOS26)
Topic:
UI Frameworks
SubTopic:
UIKit
How does one know the fitting width of a UIDatePicker in a selector hooked up with UIControlEventValueChanged? By fitting width, I mean the width of the grey background rounded box displayed with the date -- I need to get the width of that whenever the date is changed.
import UIKit
class KeyboardViewController: UIInputViewController {
// MARK: - Properties
private var keyboardView: KeyboardView!
private var heightConstraint: NSLayoutConstraint!
private var hasInitialLayout = false
// 存储系统键盘高度和动画参数
private var systemKeyboardHeight: CGFloat = 300
private var keyboardAnimationDuration: Double = 0.25
private var keyboardAnimationCurve: UIView.AnimationOptions = .curveEaseInOut
// MARK: - Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
setupKeyboard()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// 在视图显示前更新键盘高度,避免闪动
if !hasInitialLayout {
hasInitialLayout = true
}
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
}
// MARK: - Setup
private func setupKeyboard() {
// 创建键盘视图
keyboardView = KeyboardView()
keyboardView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(keyboardView)
// 设置约束 - 确保键盘贴紧屏幕底部
NSLayoutConstraint.activate([
keyboardView.leftAnchor.constraint(equalTo: view.leftAnchor),
keyboardView.rightAnchor.constraint(equalTo: view.rightAnchor),
keyboardView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
])
// 设置初始高度约束(使用系统键盘高度或默认值)
let initialHeight = systemKeyboardHeight
heightConstraint = keyboardView.heightAnchor.constraint(equalToConstant: initialHeight)
heightConstraint.isActive = true
}
// MARK: - Layout Events
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
}
override func viewSafeAreaInsetsDidChange() {
super.viewSafeAreaInsetsDidChange()
}
// MARK: - 键盘高度请求
// 这个方法可以确保键盘扩展报告正确的高度给系统
override func updateViewConstraints() {
super.updateViewConstraints()
// 确保我们的高度约束是最新的
if heightConstraint == nil {
let height = systemKeyboardHeight > 0 ? systemKeyboardHeight : 216
heightConstraint = NSLayoutConstraint(
item: self.view!,
attribute: .height,
relatedBy: .equal,
toItem: nil,
attribute: .notAnAttribute,
multiplier: 0.0,
constant: height
)
heightConstraint.priority = UILayoutPriority(999)
view.addConstraint(heightConstraint)
} else {
let height = systemKeyboardHeight > 0 ? systemKeyboardHeight : 216
heightConstraint.constant = height
}
}
}
// MARK: - Keyboard View Implementation
class KeyboardView: UIView {
private var keysContainer: UIStackView!
override init(frame: CGRect) {
super.init(frame: frame)
setupView()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
setupView()
}
private func setupView() {
backgroundColor = UIColor(red: 0.82, green: 0.84, blue: 0.86, alpha: 1.0)
// 创建按键容器
keysContainer = UIStackView()
keysContainer.axis = .vertical
keysContainer.distribution = .fillEqually
keysContainer.spacing = 8
keysContainer.translatesAutoresizingMaskIntoConstraints = false
addSubview(keysContainer)
// 添加约束 - 确保内容在安全区域内
NSLayoutConstraint.activate([
keysContainer.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor, constant: 8),
keysContainer.leftAnchor.constraint(equalTo: safeAreaLayoutGuide.leftAnchor, constant: 8),
keysContainer.rightAnchor.constraint(equalTo: safeAreaLayoutGuide.rightAnchor, constant: -8),
keysContainer.bottomAnchor.constraint(equalTo: safeAreaLayoutGuide.bottomAnchor, constant: -8)
])
// 添加键盘行
}
}
When trying to use a UISearchController setup with a UISearchBar that has scope buttons, the search controller's scopeBarActivation property is set to .onSearchActivation, the navigation item's preferredSearchBarPlacement property is set to .integrated. or .integratedButton, and the search bar/button appears in the navigation bar, then the scope buttons never appear. But space is made for where they should appear.
Some relevant code in a UIViewController shown as the root view controller of a UINavigationController:
private func setupSearch() {
let sc = UISearchController(searchResultsController: UIViewController())
sc.delegate = self
sc.obscuresBackgroundDuringPresentation = true
// Setup search bar with scope buttons
let bar = sc.searchBar
bar.scopeButtonTitles = [ "One", "Two", "Three", "Four" ]
bar.selectedScopeButtonIndex = 0
bar.delegate = self
// Apply the search controller to the nav bar
navigationItem.searchController = sc
// BUG - Under iOS/iPadOS 26 RC, using .onSearchActivation results in the scope buttons never appearing at all
// when using integrated placement in the nav bar.
// Ensure the scope buttons appear immediately upon activating the search controller
sc.scopeBarActivation = .onSearchActivation
// This works but doesn't show the scope buttons until the user starts typing - that's too late for my needs
//sc.scopeBarActivation = .automatic
if #available(iOS 26.0, *) {
// Under iOS 26 put the search icon in the nav bar - same issue for .integrated and .integratedButton
navigationItem.preferredSearchBarPlacement = .integrated // .integratedButton
// My toolbar is full so I need the search in the navigation bar
navigationItem.searchBarPlacementAllowsToolbarIntegration = false // Ensure it's in the nav bar
} else {
// Under iOS 18 put the search bar in the nav bar below the title
navigationItem.preferredSearchBarPlacement = .stacked
}
}
I need the search bar in the navigation bar since the toolbar is full. And I need the scope buttons to appear immediately upon search activation.
This problem happens on any real or simulated iPhone or iPad running iOS/iPadOS 26 RC.
This is really odd. If you setup a UISearchController with a preferredSearchBarPlacement of .stacked and you setup the search bar with scope buttons, then when the view controller is initially displayed, the currently hidden scope buttons block touch events from reaching the main view just below the search bar. But once the search is activated and dismissed, then the freshly hidden scope buttons no longer cause an issue.
This is easily demonstrated by putting a UITableViewController in a UINavigationController. Setup the table view to show a few simple rows. Then setup a search controller using the following code:
func setupSearch() {
// Setup a stacked search bar with scope buttons
// Before the search is ever activated, the hidden scope buttons block any touches in the main view controller
// in the area just below the search bar.
// Once the search is activated and dismissed, the problem goes away. It seems that displaying and hiding the
// scope buttons at least once fixes the issue that exists beforehand.
// This issue only exists in iOS/iPadOS 26, not iOS/iPadOS 18 or earlier.
let search = UISearchController(searchResultsController: UIViewController())
search.hidesNavigationBarDuringPresentation = true
search.obscuresBackgroundDuringPresentation = true
search.scopeBarActivation = .onSearchActivation // Ensure button appear immediately
let searchBar = search.searchBar
searchBar.scopeButtonTitles = [ "One", "Two", "Three" ]
self.navigationItem.searchController = search
self.navigationItem.hidesSearchBarWhenScrolling = false // Issue appears even if this is true
self.navigationItem.preferredSearchBarPlacement = .stacked
}
When first shown, before any attempt is made to activate the search, any attempt to tap on the upper 2/3 of the first row in the table view (which is just below the search bar) fails. If you tap on the lower 1/3 of the first row it works fine. If you then activate the search (now the scope buttons appear) and then dismiss the search (now the scope buttons are hidden again), then there is no issue tapping anywhere on the first row of the table. But if you restart the app, the problem starts over again.
This problem happens on any iPhone or iPad, real or simulated, running iOS/iPadOS 26 RC. This is a regression from iOS 18 or earlier.
I have a customized navigationbar, the back button does not receive any touches after I add clearGlassButtonConfiguration for iOS26, also there is no touch effects for clearGlassButtonConfiguration
when I remove this UIButtonConfiguration setting,everything workes.
- (UIButton *)backButton {
if (!_backButton) {
_backButton = [UIButton buttonWithType:UIButtonTypeCustom];
_backButton.frame = CGRectMake(0, 0, 44, 44);
UIImage * img = [[UIImage imageNamed:@"IVC_back"]imageWithColor:HEXCOLOR(0xFFFFFF)];
[_backButton setImage:img forState:UIControlStateNormal];
[_backButton addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)];
if (@available(iOS 26.0, *)){
_backButton.configuration = UIButtonConfiguration.clearGlassButtonConfiguration;
}
}
return _backButton;
}
Topic:
UI Frameworks
SubTopic:
UIKit
I have a few view controllers in a large UIKit application that previously started showing content right below the bottom of the top navigation toolbar.
When testing the same code on iOS 26, these same views have their content extend under the navigation bar and toolbar. I was able to fix it with:
if #available(iOS 26, *, *) {
self.edgesForExtendedLayout = [.bottom]
}
when running on iOS 26. I also fixed one or two places where the main view was anchored to self.view.topAnchor instead of self.view.safeAreaLayoutGuide.topAnchor.
Although this seems to work, I wonder if this was an intended change in iOS 26 or just a temporary bug in the beta that will be resolved.
Were changes made to the safe area and edgesForExtendedLayout logic in iOS 26? If so, is there a place I can see what the specific changes were, so I know my code is handling it properly?
Thanks!
Topic:
UI Frameworks
SubTopic:
UIKit
I created a tableview with two cells and configured a left-swipe action for each cell.
When I swipe left, the cell displays normally.
When I swipe the cell back to its original position, the view displays normally.
When I quickly swipe right after the cell has been reset, the view displays noticeably abnormally.
import UIKit
import Vision
import CoreImage
import CoreImage.CIFilterBuiltins
class ViewController: UIViewController {
var tasks = ["学习 Swift", "阅读文档", "编写代码", "测试应用", "提交审核"]
private let tableView: UITableView = {
let table = UITableView()
table.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
return table
}()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(tableView)
tableView.frame = view.bounds
tableView.dataSource = self
tableView.delegate = self
// 关键设置
tableView.estimatedRowHeight = 0
tableView.estimatedSectionHeaderHeight = 0
tableView.estimatedSectionFooterHeight = 0
tableView.rowHeight = 60 // 固定高度
}
}
// MARK: - UITableViewDataSource
extension ViewController: UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return tasks.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
cell.textLabel?.text = tasks[indexPath.row]
cell.textLabel?.numberOfLines = 0 // 允许多行文本
return cell
}
}
// MARK: - UITableViewDelegate
extension ViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let deleteAction = UIContextualAction(style: .destructive, title: nil) { [weak self] (_, _, completionHandler) in
guard let self = self else { return }
}
deleteAction.image = UIImage(systemName: "trash")
deleteAction.backgroundColor = .systemRed
let configuration = UISwipeActionsConfiguration(actions: [deleteAction])
configuration.performsFirstActionWithFullSwipe = false
return configuration
}
// 可选:精确控制行高(二选一)
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 60 // 固定高度,或者根据内容计算
}
}
Topic:
UI Frameworks
SubTopic:
UIKit