The UIResponderStandardEditActions protocol includes pasteAndMatchStyle:. UITextView conforms to UIResponderStandardEditActions. But I can't find a way to get that menu to appear. I get the standard "Paste" menu. I've tried overriding pasteAndMatchStyle: in a subclass of UITextView. I've overridden canPerformAction:withSender: but it never gets called with the pasteAndMatchStyle: selector. I've implemented the textView:editMenuForTextInRange:suggestedActions: delegate method. It's called but the suggested actions do not include the "Paste and Match Style" action (key command).
I came up with an ugly hack that involved overriding buildMenuWithBuilder: and adding my own key command after the paste command. But this shouldn't be necessary considering it's supposed to be a standard edit action.
So what's the trick to make the "Paste and Match Style" edit menu appear properly in a UITextView? I'm testing with iOS 17, 18, and 26.
UIKit
RSS for tagConstruct and manage graphical, event-driven user interfaces for iOS or tvOS apps using UIKit.
Posts under UIKit tag
200 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Fatal safeAreaInsets Error on Certain iOS/iPadOS 26 Devices
On certain devices that have updated to iOS/iPadOS 26, the safeAreaInsets value is displayed incorrectly when rotating.
On the iPhone SE3, the safeAreaInsets.top value is displayed inverted when rotating.
It should return 20.0 when rotated vertically and 0.0 when rotated horizontally.
Currently, the value is reversed.
(0.0 when rotated horizontally and 20.0 when rotated vertically.)
On iPad Pro devices, the safeAreaInsets.top value is always returned as 0.0 when the app is first launched.
(This issue is believed to occur on all iPad devices, including the iPad Pro.)
If the user subsequently rotates the iPad, the safeAreaInsets value is returned correctly.
On the iPhone 17 with dynamic islands, the safeAreaInsets value is displayed correctly.
My guess is that all devices running iOS/iPadOS 26 without dynamic islands will experience an issue where the safeAreaInsets value is displayed incorrectly.
This issue occurs when building with Xcode 26.
Apple, please issue an OS update as soon as possible. Or, if this is an Xcode issue, please update Xcode.
After compiling with Xcode 26, my UIKit view's title appears hugging the screen on the left when run on iOS 16-18 (as shown in the image below). It's fine when run on iOS 26, but not older iOS versions.
When I compile the same code with Xcode 16.4, the title aligns with the table rows.
Has anyone else seen this? Is this a bug in the frameworks or is there something I could do to resolve?
In our app we launch landscape only player view controller from portrait only view controller. This is done using present(playerViewController, animated:true) and it is dismissed using dismiss() api. This is working fine till iOS 18 but broken in iOS 26. Now when presenting the presented viewcontrollers UI is realigning / resizing after the view is visible and while dismissing the presenting view controller is realigning after the view is visible. Anyone else seeing it or how to fix this?
I think in the next updates of IOS 26 that Apple should add a setting to enable/disable Liquid Glass because we all know that everybody doesnt like the new update.
When tapping a UIButton I present a view controller like this:
let vc = ViewController()
present(vc, animated: true, completion: nil)
Inside, I set a clear background with a visual effect view with a blur effect, like this:
view.backgroundColor = .clear
blurEffectView = UIVisualEffectView(effect: UIBlurEffect(style: .regular))
//autolayout constraints for the blurEffectView
view.addSubview(blurEffectView)
But the background remains full white in iOS 26.
How can I bring the blur+transparency back like in iOS 18? What am I doing wrong?
We are observing that for devices with iPadOS 26, table views within apps are unexpectedly auto scrolling. The issue can be reproduced as follows:
The table view has enough cells to the point where not all cells can fit on the screen and the table view is scrollable
User has scrolled to the bottom of the tableView and tableView.reloadData() is called.
One of the following applies:
The ViewController containing the tableView is embedded in a UINavigationController, and ViewController sets self.edgesForExtendedLayout = .bottom
The ViewController containing the tableView is embedded in a UINavigationController, and UINavigationController sets navigationBar.isTranslucent = false
The following constraints are applied to the tableView:
tableView.topAnchor.constraint(equalTo: view.layoutMarginsGuide.topAnchor).isActive = true
tableView.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
tableView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
tableView.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true
After thorough testing, we've found that the bug is only present in iPads with iPadOS 26. It does not show for iPhone devices or for iPads on iPadOS 18. We are hoping that this can be fixed as it is causing poor user experience.
Full code needed to reproduce the issue:
Use this willConnectTo function in SceneDelegate:
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = scene as? UIWindowScene else { return }
window = UIWindow(windowScene: windowScene)
let navigationControllerWithVC = UINavigationController(rootViewController: ViewController())
// ⚠️ CASE 1 - Comment out the .isTranslucent setter below, or set the value to true, and the scrolling issue will be gone, granted that the other issue-causing lines in ViewController.swift
// are also commented.
navigationControllerWithVC.navigationBar.isTranslucent = false
window?.rootViewController = navigationControllerWithVC // Replace this line with window?.rootViewController = ViewController() to get rid of UINavigationController
window?.makeKeyAndVisible()
}
Use this ViewController class that is referenced from the SceneDelegate willConnectTo function:
import UIKit
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
var tableView: UITableView!
var safeArea: UILayoutGuide!
var timer: Timer!
override func viewDidLoad() {
super.viewDidLoad()
// ⚠️ CASE 2 - Uncomment the line below when this view is inside a UINavigationController to cause the scrolling issue.
//self.edgesForExtendedLayout = .bottom
tableView = UITableView()
safeArea = view.layoutMarginsGuide
setupTableView()
timer = Timer.scheduledTimer(timeInterval: 3.0, target: self, selector: #selector(fireTimer), userInfo: nil, repeats: true)
}
@objc public func fireTimer() {
tableView.reloadData()
print("Reloaded table")
}
func setupTableView() {
tableView.delegate = self
tableView.dataSource = self
view.addSubview(tableView)
tableView.translatesAutoresizingMaskIntoConstraints = false
// ⚠️ CASE 3 - Replace view.topAnchor in the next line below with safeArea.topAnchor to see the scrolling issue, regardless if view is inside a UINavigationController.
tableView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
tableView.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
tableView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
tableView.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
40
}
public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
50.0
}
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = UITableViewCell()
cell.textLabel?.text = indexPath.row == 39 ? "END" : "Row \(indexPath.row)"
return cell
}
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
}
}
For reproducing this on iPadOS 26 simulators, I can confirm that simulators under Xcode 26.0.1 (17A400) and Xcode 26.1 Beta (17B5025f) will show the issue. The issue is present in iPadOS 26 and iPadOS 26.1 beta.
I've also submitted Apple Feedback for this (FB20357980) with all this code in a Xcode project.
Hi everyone,
I’m running into a strange issue with UISearchController placement with iOS 26 SDK.
In one of my view controllers, I was able to move the search bar to the top of the navigation bar by setting:
navigationItem.searchController = searchController
navigationItem.hidesSearchBarWhenScrolling = false
navigationItem.preferredSearchBarPlacement = .stacked
This works as expected — the search bar is placed at the top.
However, in another view controller with almost identical configuration, the search bar always shows up at the bottom. If I delay the setup with DispatchQueue.main.async, it appears at the bottom; if I don’t, it doesn’t appear at all. Both VCs are wrapped in their own UINavigationController.
So my questions are:
Has anyone faced this issue where preferredSearchBarPlacement = .stacked is ignored?
Are there hidden requirements or limitations for placing the search bar at the top?
Why could the same setup behave differently in two controllers?
Any help or ideas would be appreciated!
آلَحـ🇾🇪ᬼ⃝⃡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 (缺少)
Hi all,
I’m working on a UIKit app where I embed a SwiftUI TextField using UIHostingController. I’m using an ObservableObject model to drive the textfield content:
class TextFieldModel: ObservableObject {
@Published var text: String
@Published var placeholder: String
@Published var isSecure: Bool
@Published var isFocused: Bool
init(pText: String, pPlaceholder: String, pIsSecure: Bool, pIsFocused: Bool) {
self.text = pText
self.placeholder = pPlaceholder
self.isSecure = pIsSecure
self.isFocused = pIsFocused
}
}
And my SwiftUI view:
struct TextFieldUI: View {
@ObservedObject var pModel: TextFieldModel
@FocusState private var pIsFocusedState: Bool
var body: some View {
TextField(pModel.placeholder, text: $pModel.text)
.focused($pIsFocusedState)
}
}
I embed it in UIKit like this:
let swiftUIContentView = TextFieldUI(pModel: model)
let hostingController = UIHostingController(rootView: swiftUIContentView)
addChild(hostingController)
view.addSubview(hostingController.view)
hostingController.didMove(toParent: self)
Question:
In UIKit, if I subclass UITextField, I can override insertText(_:) and choose not to call super, effectively preventing the textfield from updating when the user types.
Is there a SwiftUI equivalent to intercept and optionally prevent user input in a TextField, especially when it’s embedded inside UIKit?
What is the recommended approach in SwiftUI for this?
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
My app start up has became horrid. It takes 1 minute to open SQLlite database for my rust core. Impossible to work...
I have Address Sanitizer, Thread Perf Checker and Thread Sanitizer disabled...
Hello,
I'm experiencing a navigation bar positioning issue with my UIKit iPad app on iPadOS 26 (23A340) using Xcode 26 (17A321).
The navigation bar positions under the status bar initially, and after orientation changes to landscape, it positions incorrectly below its expected location. This occurs on both real device (iPad mini A17 Pro) and simulator. My app uses UIKit + Storyboard with a Root Navigation Controller.
A stack overflow post has reproduce the bug event if it's not in the same configuration: https://stackoverflow.com/questions/79752945/xcode-26-beta-6-ipados-26-statusbar-overlaps-with-navigationbar-after-presen
I have checked all safe areas and tried changing some constraints, but nothing works.
Have you encountered this bug before, or do you need additional information to investigate this issue?
We’ve been using the new Icon Composer–generated app icons for our existing universal bundle (iOS + Mac Catalyst) app. The icons work perfectly for iOS on the App Store.
On macOS Tahoe (macOS 26), however, the App Store listing doesn’t display the app icon — it just shows placeholder while downloading. After the app is installed, the icon displays fine everywhere (Dock, Finder, Launchpad, etc.).
Setup:
using .iconset generated via Icon Composer, bundled with .png inside the .icon file.
On older macOS App Stores, the app icon shows as expected.
On Tahoe App Store only, the issue appears.
Could this be because the App Store expects .svg variants inside the .icon file for proper display in the Store? Or is there any updated requirement for Mac App Store metadata icons vs. bundled app icons?
Any guidance would be much appreciated.
Our project using UISplitViewController as the root view controller for whole app. And when using the xocde26 to build app in iOS26, the layout of page is uncorrect.
for iPhone, when launch app and in portrait mode, the app only show a blank page:
and when rotate app to landscape, the first view controller of UISplitViewController's viewControllers will float on second view controller:
and this float behavior also happens in iPad:
below is the demo code:
AppDelegate.swift:
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
let window: UIWindow = UIWindow()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let vc = SplitViewController(primary: TabBarViewController(), secondary: ViewController())
window.rootViewController = vc
window.makeKeyAndVisible()
return true
}
}
SplitViewController:
import UIKit
class SplitViewController: UISplitViewController {
init(primary: UIViewController, secondary: UIViewController) {
super.init(nibName: nil, bundle: nil)
preferredDisplayMode = .oneBesideSecondary
presentsWithGesture = false
delegate = self
viewControllers = [primary, secondary]
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
}
}
extension SplitViewController: UISplitViewControllerDelegate {
}
TabBarViewController.swift:
import UIKit
class FirstViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .red
tabBarItem = UITabBarItem(title: "Home", image: UIImage(systemName: "house"), tag: 0)
}
}
class SecondViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .purple
tabBarItem = UITabBarItem(title: "Setting", image: UIImage(systemName: "gear"), tag: 1)
}
}
class TabBarViewController: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
let firstVC = FirstViewController()
let secondVC = SecondViewController()
tabBar.backgroundColor = .orange
viewControllers = [firstVC, secondVC]
}
}
ViewController.swift:
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .systemPink
}
}
And I have post a feedback in Feedback Assistant(id: FB18004520), the demo project code can be found there.
Area: Software Update
Type of Feedback: Application Bug
Description
Device: iPhone 13 Pro running iOS 26
Build environment: Xcode 16.4
Problem description:
When a text field has secureTextEntry = YES and Password Autofill / Passkeys is active, the autofill panel is not included in the rect reported from the keyboard notifications (UIKeyboardFrameEndUserInfoKey or others).
As a result, when calculating the offset to move the screen up and reveal the hidden input field, the field is not displayed correctly because the reported keyboard height is smaller than the actual visible height.
Observed behavior:
This only occurs on devices running iOS 26 built with Xcode 16.4.
On previous versions of iOS, with the same settings (secureTextEntry and Autofill active), the rect correctly includes the autofill panel height, and the UI works as expected.
I tested with both UIKeyboardDidShowNotification and UIKeyboardWillChangeFrameNotification, and in both cases the behavior is the same: the height is incorrect (smaller than expected with the autofill panel).
What I expect / questions:
That UIKeyboardFrameEndUserInfoKey (or the related notification) correctly reports the total area covered by the keyboard, including any password autofill panel, when secureTextEntry is active.
That the new behavior in iOS 26 be documented if this omission is intentional, or otherwise considered a bug if it is not.
If there is any official workaround suggested by Apple for developers affected by this issue while a fix is provided.
Thank you for your support.
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.
I'm working on an AppIcon selector and would like to do something like UIImage(named: "AppIcon-Alternate") to present the icon for the user to choose using the new IconComposer icons.
I've done a fair bit of research on this and it looks like this used to be possible (prior to .icon) with workarounds that were later 'fixed' / removed (appending 60x60 to the icon name).
The only 'solution' seems to be bundling the exported images into the app itself but this seems like a terrible idea as it massively bloats the app. Assuming we export from the new IconComposer tool and want to include dark mode that's roughly 3MB per icon which is absolutely shocking bloat and so a terrible solution.
Looking into the app the Assets.car actually generates png files for these alternate icons. These are in the json as "MultiSized Image" assets. Interestingly using UIImage(named: is actually attempting to load these but fails to resolve an kCSIElementSignature. Also the OS alert when switching alternate icon shows a preview of the icon so this must be privately possible and using Asset Catalog Tinkerer I'm able to see these pngs.
This feels like broken API; I'd guess the new icon format is not correctly generating the entry in the Asset.car to link the generated pngs for usage with UIImage(named:) API.
Does anyone have pointers for this? This feels like a developer API afterthought or bug but is it intentional?
Edit: I've submitted feedback for this FB20341182.