iOS is the operating system for iPhone.

Posts under iOS tag

200 Posts

Post

Replies

Boosts

Views

Activity

Profile doesn't include the com.apple.application-identifier entitlement.
I have tried everything and still I am getting this. Just for a test I created a new app (Master-Detail template Xcode 11.5) I have created an entry in the iTunes Connect to receive the app upon archiving and uploading. I regenerated all new certificates for iOS Development and Distribution. I created all new Provisioning profiles. The Dev profile builds deploys and runs on my device The Dist profile builds but when I select the distribution profile I get the "Profile doesn't include the com.apple.application-identifier entitlement." error. When I download the profile within Xcode all looks good for the distribution profile: App ID: matches correctly Certificated: 1 Included includes the new signing certificate "iPhone Distribution...." Capabilities: 3 Included Includes Game Center, In-App Purchase, and Keychain Sharing Entitlements: 5 Included Includes application-identifier, keychain-access-groups, beta-reports-active, get-task-allow, and com.apple.developer.team-identifier. Im not sure what is going on. This is a standard process I have performed for quite a while. As a matter of fact I just submitted 3 applications last Sunday. Thank you for any suggestions.
22
1
14k
Oct ’25
Scroll TextEditor to cursor position
Hello. Is there a good SwiftUI approach on getting the TextEditor cursor position? I have a TextEditor and sometimes when we have a longer text inside it, the cursor is not seen because the keyboard is above covering the bottom of the TextEditor. I would like to somehow detect the position of the cursor, and if it's on the last line of the TextEditor, scroll to the bottom. I've already checked a bit and didn't find any good method of doing this in SwiftUI. If you have any ideas on how to do this, or even a different method any help would be highly appreciated. Thank you!
1
3
814
Oct ’25
[iOS26]UITableView drag bug
I encountered a bug with drag-and-drop sorting in ios 26. I created a UITableView for dragging and dropping to adjust the order of the list. However, when I set the height of the cells to a custom height, some cells were not displayed during the dragging process. The tools I use are the official version of Xcode16.1 and the ios 26 emulator And I can also reproduce the same problem on the real device. class ViewController: UIViewController { private let tableView: UITableView = { let tableView = UITableView.init(frame: .zero, style: .grouped) tableView.backgroundColor = .clear tableView.estimatedSectionHeaderHeight = 50 tableView.isEditing = true tableView.showsVerticalScrollIndicator = false tableView.allowsSelectionDuringEditing = true return tableView }() var content: [Int] = [] override func viewDidLoad() { super.viewDidLoad() tableView.register(FTWatchGroupPageCell.self, forCellReuseIdentifier: "FTWatchGroupPageCell") tableView.delegate = self tableView.dataSource = self view.addSubview(tableView) for i in 1...100 { content.append(i) } tableView.reloadData() } override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() var frame = view.bounds frame.origin.y = 200 frame.size.height = frame.size.height - 200 tableView.frame = frame } } extension ViewController: UITableViewDelegate, UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return content.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "FTWatchGroupPageCell", for: indexPath) as! FTWatchGroupPageCell cell.label.text = "\(content[indexPath.row])" cell.label.sizeToFit() return cell } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 52.66 } public func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { return 0.01 } public func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { return 0.01 } public func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { return true } public func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCell.EditingStyle { return .none } public func tableView(_ tableView: UITableView, shouldIndentWhileEditingRowAt indexPath: IndexPath) -> Bool { return false } public func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { return true } public func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) { let item = content.remove(at: sourceIndexPath.row) content.insert(item, at: destinationIndexPath.row) tableView.reloadData() } } class FTWatchGroupPageCell: UITableViewCell { private let contentBackView = UIView() let label = UILabel() override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) contentView.isHidden = true addSubview(contentBackView) contentBackView.backgroundColor = .red contentBackView.addSubview(label) label.textColor = .black label.font = .systemFont(ofSize: 14) contentBackView.frame = .init(x: 0, y: 0, width: 200, height: 30) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func layoutSubviews() { super.layoutSubviews() guard let reorderControlClass = NSClassFromString("UITableViewCellReorderControl"), let reorderControl = subviews.first(where: { $0.isKind(of: reorderControlClass) }) else { return } reorderControl.alpha = 0.02 reorderControl.subviews.forEach({ subView in if let imageView = subView as? UIImageView { imageView.image = UIImage() imageView.contentMode = .scaleAspectFit imageView.frame.size = CGSize(width: 20, height: 20) } }) } }
2
1
279
Oct ’25
On demand module download
I am working on an iOS app and I want to achieve on demand module download inside the app when the user clicks on the module icon which he wants to use. The idea is that we have a super app consisting of multiple modules say four independent apps/features and I want to separate each one so that when the user selects a specific app/feature, it’s downloaded on demand and then opened directly within the same super app resulting in a lower app size initially I want to upload all the code of all modules to app store connect but when the user downloads the app, then only one module's code should be available to the user, the rest of the module's code should be downloaded when the user wants to use that module. I know apple restricts downloading new code but in my case I want to upload all the code to app store for review but just give option to the user to get rest of the code when needed. Any guidance, architectural advice, or example implementations would be highly appreciated.
1
0
124
Oct ’25
CallKit requestTransaction error code 2
Hello, In production, a large number of users experience outgoing call reporting fails with the following error: com.apple.CallKit.error.requesttransaction Code=2 The iOS version doesn't matter, errors are present in v15-26 Details My CXProvider held as a global singleton, so it’s unlikely to be deinited. There is no explicit call to CXProvider.invalidate() in the app. If I manually invalidate the CXProvider, I observe the expected failure when trying to create an outgoing call (com.apple.CallKit.error.requesttransaction error 2). However, If I recreate the CXProvider after the error, outgoing calls are reported correctly. Many users trigger the providerDidReset delegate method (CXProviderDelegate) before this error. According to the documentation, providerDidReset can be called by the system, and we are supposed to end all active calls, but the documentation doesn't suggest recreating the CXProvider. Question Should I recreate CXProvider after providerDidReset and forget about that, or could this error be caused by something else?
3
0
252
Oct ’25
Issue with Fastlane match – "Couldn't decrypt the repo, Invalid password passed via 'MATCH_PASSWORD'"
Hi everyone, I’m running into an issue using Fastlane to upload my iOS app to TestFlight. When I run my ios beta lane, I get the following error: [18:12:27]: Couldn't decrypt the repo, please make sure you enter the right password! [18:12:27]: Invalid password passed via 'MATCH_PASSWORD' [18:12:27]: Called from Fastfile at line 7 [18:12:27]: 5: desc "Build and upload to TestFlight" [18:12:27]: 6: lane :beta do [18:12:27]: => 7: match( [18:12:27]: 8: type: "appstore", [18:12:27]: 9: readonly: true, [18:12:27]: ``` Fastlane summary: Step Action Time (s) 1 default_platform 0 💥 match 4 The error indicates that the password provided via MATCH_PASSWORD is invalid. I’ve double-checked that the password I’m using is correct. Has anyone else run into this issue, or can anyone suggest how to properly configure MATCH_PASSWORD so Fastlane can decrypt the repo successfully? Thanks in advance!
0
0
96
Oct ’25
FileHandle(forWritingTo:) crash
I am having a rare crash when calling FileHandle(forWritingTo:) initializer with a file that does not exist. In the documentation, I see that the expected behaviour is to return nil, but in my app, in rare cases I have a Crash. My code that causes the crash is if let handle = try? FileHandle(forWritingTo: logFile) { Is it a known behaviour ? should I test if the file exist before calling FileHandle(forWritingTo:) ? Shareable_2025-09-01_05-32-28.3051.crash
2
0
94
Oct ’25
Is it still possible to change the color of unselected icons in a TabView?
Hi. I‘m making an app with SwiftUI for iOS 26, and found that the old ways of changing unselected icons color seem not working as they did in old versions of iOS. I tried these methods: TabView() { Tab { // some view here } label: { Label(title: { Text("something") }, icon: { Image(systemName: "checkmark.seal.fill") .foregroundStyle(.blue) } } } I wrapped Image with an if-else, but itisn't able to change any color even without if; struct ParentView: View { init() { UITabBar.appearance() .unselectedItemTintColor = UIColor.red } var body: some View { TabView() { // some tabs here } } } and an extension of above struct ParentView: View { init() { let tabBarAppearance = UITabBarAppearance() tabBarAppearance.configureWithOpaqueBackground() tabBarAppearance.backgroundColor = UIColor.green tabBarAppearance.stackedLayoutAppearance .selected.titleTextAttributes = [.foregroundColor: UIColor.red] tabBarAppearance.stackedLayoutAppearance.normal .titleTextAttributes = [.foregroundColor: UIColor.black] tabBarAppearance.stackedLayoutAppearance .normal.iconColor = UIColor.black tabBarAppearance.stackedLayoutAppearance .selected.iconColor = UIColor.red UITabBar.appearance() .scrollEdgeAppearance = tabBarAppearance UITabBar.appearance() .standardAppearance = tabBarAppearance UITabBar.appearance() .unselectedItemTintColor = .black } var body: some View { TabView() { // some tabs here } } } I read about this from reddit https://www.reddit.com/r/iOSProgramming/comments/1ftmfoa/tabbartabview_icon_and_text_colors_in_ios_18/, it successfully changes the color of the texts in the tabbar, but not the icons. After these, GitHub Copilot suggested me to draw two versions of icons, for different colors, which does work, but out of my capabilities. Is there any other ways to do this on new systems? Thank you very much for any replies.
1
0
136
Oct ’25
Request: Restore Launchpad Functionality or Allow Customizable App Organization in macOS Tahoe
With macOS Tahoe, Launchpad has been replaced by an App Library–style mode within Spotlight. While the alleged intention is UX consistency across the Apple ecosystem, the result is both a catastrophic usability regression and a radical break in consistency with iOS and iPadOS. Predefined App Library categorization is functionally incoherent: On iOS and now macOS, Apple’s predefined App Library categories place apps with seemingly identical functionality into unrelated groups—for example, 3D scanning tools scattered across Education, Utilities, and Productivity. Instead of making apps easier to find, this effectively creates a labyrinth that users must traverse to locate apps whose names and icons they may not recall. However Apple defines its app categories, they are not only inconsistent but also hopelessly inadequate for the long tail of real-world applications and user workflows. Loss of user control: Launchpad enabled users to group and organize applications according to their workflows. This aligns with Apple’s own Human Interface Guidelines, which emphasize user control, discoverability, and predictable behavior. The new Spotlight interface removes that flexibility, locking users into predefined categories that both impede and mislead—and cannot be overridden. Consistency across platforms is broken: If the goal was to unify iOS, iPadOS, and macOS, this approach actually undermines consistency. On iOS and iPadOS, users can still rely on a customizable Home Screen—a Launchpad-like experience—as their primary way of launching apps. In Tahoe, that option has been removed. macOS now forces users to depend exclusively on Spotlight with App Library categories, while eliminating the very feature that was consistent across platforms. Catastrophic impact on my workflow: As an interdisciplinary artist working in 2D, 3D, and time-based media, as well as coding, I make extensive use of a constantly changing array of AI tools and experiment with many new apps and web services, which I often turn into Web Apps. I cannot possibly recall the names of every native and web app on my system. I need predictable access to groups of related tools. Tahoe’s new auto-categories split those apps apart arbitrarily, slowing me down and interrupting established workflows, forcing me to navigate the aforementioned labyrinth just to find what I need. Proposal: A constructive way forward High-level objective: Simply restore Launchpad—or restore the ability to customize app categories/folders and manually assign apps to them, overriding or augmenting the predefined categories. This ensures users can launch apps according to their workflow, without needing to remember exact names or icons. Possible solutions: Allow manual subfolders within Applications, represented hierarchically in Spotlight. Provide a fullscreen Launchpad-like organizer (with uninstall via long-click, etc.), either as a replacement or toggleable option. Retain Apple’s auto-categories for those who prefer them, but let users override or augment them with their own. In summary: Tahoe eliminates a working, consistent paradigm (Launchpad/Home Screen) and forces reliance on an App Library system that categorizes poorly and cannot be customized. This is both a step backwards in functionality and a break in cross-platform consistency. A constructive solution is to restore Launchpad—or at least restore the ability for users to organize apps in ways that fit their workflows.
2
3
601
Oct ’25
UISplitView with "sidebar" and Liquid Glass
I have a couple of (older) UIKit-based Apps using UISplitViewController on the iPad to have a two-column layout. I'm trying to edit the App so it will shows the left column as sidebar with liquid glass effect, similar to the one in the "Settings" App of iPadOS 26. But this seems to be almost impossible to do right now. "out of the box" the UISplitViewController already shows the left column somehow like a sidebar, with some margins to the sides, but missing the glass effect and with very little contrast to the background. If the left column contains a UITableViewController, I can try to get the glass effect this way within the UITableViewController: tableView.backgroundColor = .clear tableView.backgroundView = UIVisualEffectView(effect: UIGlassContainerEffect()) It is necessary to set the backgroundColor of the table view to the clear color because otherwise the default background color would completely cover the glass effect and so it's no longer visible. It is also necessary to set the background of all UITableViewCells to clear. If the window is in the foreground, this will now look very similar to the sidebar of the Settings App. However if the window is in the back, the sidebar is now much darker than the one of the Settings App. Not that nice looking, but for now acceptable. However whenever I navigate to another view controller in the side bar, all the clear backgrounds destroy the great look, because the transition to the new child controller overlaps with the old parent controller and you see both at the same time (because of the clear backgrounds). What is the best way to solve these issues and get a sidebar looking like the one of the Settings App under all conditions?
4
1
445
Oct ’25
How to display SegmentControl in tabViewBottomAccessory inline mode like iOS 26 Photos app?
Question I'm trying to replicate the iOS 26 Photos app behavior where a segmented control appears in the tab bar area when scrolling. Specifically, when the tab bar minimizes to inline mode, I want to show a Picker with .segmented style between the minimized tab button and search button. Expected Behavior (iOS 26 Photos App) When scrolling up in the Photos app: Tab bar minimizes to inline mode A segmented control (Years/Months/All) appears in the center Layout: [Tab Button] [Segmented Control] [Search Button] Current Implementation I'm using tabViewBottomAccessory with tabBarMinimizeBehavior: struct PhotosMainView: View { @Environment(ModelData.self) private var modelData @State private var searchText: String = "" var body: some View { @Bindable var modelData = modelData TabView { Tab("Library", systemImage: "photo.on.rectangle") { NavigationStack { PhotosGridView() .navigationTitle("Library") } } Tab("Albums", systemImage: "square.grid.2x2") { NavigationStack { AlbumsGridView() .navigationTitle("Albums") } } Tab("Search", systemImage: "magnifyingglass", role: .search) { NavigationStack { PhotosGridView() .navigationTitle("Search") .searchable(text: $searchText) } } } .tabBarMinimizeBehavior(.onScrollUp) .tabViewBottomAccessory { TimelineAccessoryView() .environment(modelData) } } } struct TimelineAccessoryView: View { @Environment(ModelData.self) private var modelData @Environment(\.tabViewBottomAccessoryPlacement) var placement var body: some View { Group { if let placement = placement { switch placement { case .inline: inlineView case .expanded: expandedView } } } } @ViewBuilder private var inlineView: some View { @Bindable var modelData = modelData Picker("View", selection: $modelData.timelineFilter) { Text("Years").tag(TimelineFilter.year) Text("Months").tag(TimelineFilter.month) Text("All").tag(TimelineFilter.all) } .pickerStyle(.segmented) .frame(maxWidth: 200) } @ViewBuilder private var expandedView: some View { Text("Expanded state") } } Issues Encountered 1. Console logs show placement changes correctly: placement: nil → expanded → inline 2. However, the segmented control doesn't appear visually in inline mode - The accessory view seems to render, but nothing is visible on screen - Only a small empty space appears where the control should be 3. AttributeGraph cycle warnings appear: === AttributeGraph: cycle detected through attribute 27160 === === AttributeGraph: cycle detected through attribute 26304 === What I've Tried 1. ✅ Separating inline/expanded views into @ViewBuilder properties to avoid cycles 2. ✅ Using .onAppear and .onChange for debugging instead of direct prints in body 3. ✅ Confirming placement environment value changes correctly 4. ❌ The segmented control still doesn't display in inline mode Questions 1. Is tabViewBottomAccessory the correct API to achieve this Photos app effect? 2. How should content be structured in .inline placement to display properly between tab button and search? 3. Are there additional modifiers or constraints needed for inline accessories? 4. Is there documentation or sample code showing this pattern? Environment - Xcode 17.0 - iOS 26.0 - iPhone 16 Simulator - SwiftUI Any guidance on the correct approach to implement this would be greatly appreciated. Thank you!
1
0
198
Oct ’25
I don't want black background in presented sheet
I want a different color, one from my asset catalog, as the background of my first ever swift UI view (and, well, swift, the rest of the app is still obj.c) I've tried putting the color everywhere, but it does't take. I tried with just .red, too to make sure it wasn't me. Does anyone know where I can put a color call that will actually run? Black looks very out of place in my happy app. I spent a lot of time making a custom dark palette. TIA KT @State private var viewModel = ViewModel() @State private var showAddSheet = false var body: some View { ZStack { Color.myCuteBg .ignoresSafeArea(.all) NavigationStack { content .navigationBarTitleDisplayMode(.inline) .toolbar { ToolbarItem(placement: .principal) { Image("cute.image") .font(.system(size: 30)) .foregroundColor(.beigeTitle) } } } .background(Color.myCuteBg) .presentationBackground(.myCuteBg) .sheet(isPresented: $showAddSheet) { AddView() } .environment(viewModel) .onAppear { viewModel.fetchStuff() } } .tint(.cuteColor) } @ViewBuilder var content: some View { if viewModel.list.isEmpty && viewModel.anotherlist.isEmpty { ContentUnavailableView( "No Content", image: "stop", description: Text("Add something here by tapping the + button.") ) } else { contentList } } var contentList: some View { blah blah blah } } First I tried the background, then the presentation background, and finally the Zstack. I hope this is fixed because it's actually fun to build scrollable content and text with swiftUI and I'd been avoiding it for years.
7
0
356
Oct ’25
Xcode 26 Build Failure: _sys_select and netinet_in Type Mismatches
I'm facing a build failure after migrating my project to Xcode 26. The issue appears to be related to the redefinition of some core system types. The compiler errors point to a failure to locate the original type definitions, suggesting they've been moved or renamed. Specifically, the build log contains these errors: ../arm64-apple-ios.private.swiftinterface:653:11: Cannot find type '_sys_select' in scope ../arm64-apple-ios.private.swiftinterface:130:33: Cannot find type 'netinet_in' in scope I've observed that the types are being mapped as follows: netinet_in.in_addr_t -> _DarwinFoundation2.in_addr_t _sys_select.fd_set -> _DarwinFoundation2.fd_set I'm looking for guidance on the recommended way to resolve these API changes. How should I handle these type redefinitions in Xcode 26 to ensure my project builds correctly? Any insights would be greatly appreciated. Thank you.
0
0
40
Oct ’25
iO26 freezes my phone and the hangs each time
The new iO26 that was released recently is indeed a game changer as it overhauled all the features and outlooks, it is a great one, however it came with serious drawback on my phone. My phone started hanging after installing the new iOS26 update. It freezes each time I’m using it or when I want to pick a call. It only get resolved once i hit the power button and unlock again. battery drains faster I thought i0S26 .1 wil resolve it but no it didn’t my phone is iPhone 13 Pro Max The smoothness of the screen transition has reduce as it drags instead of smooth sliding. My battery drains faster, my battery went from 83% to 79 in less than two weeks of upgrading to the New iOS I can’t use the “set as ringtone” option from downloaded or created music, it just freezes. I thought i0S26 .1 wil resolve it but no it didn’t my phone is iPhone 13 Pro Max i need help please, let something be done to help me. I’m already frustrated and considering getting another operating system
0
0
128
Oct ’25
Does UIDevice.current.identifierForVendor change after iCloud backup and restore on another iOS device?
I'm trying to understand how UIDevice.current.identifierForVendor behaves when an iOS app is restored via iCloud onto a different physical device. Context I'm building an app that needs to detect whether it’s running on a newly restored device (for example, after the user transfers their iPhone via iCloud setup). To do this, I save the value of UIDevice.current.identifierForVendor?.uuidString in persistent storage (e.g., UserDefaults). The question If I install my app on Device A, store the identifierForVendor value, back up the device to iCloud, and then restore that backup onto Device B, will the restored app see the same identifierForVendor value, or a new one? More specifically: Does iCloud backup/restore preserve the underlying “vendor” ID across devices? Is the identifierForVendor tied only to the bundle identifier and vendor prefix, or also to the physical device hardware? If the user deletes all apps from the same vendor, then restores them from iCloud, is the ID reset? What I’ve found so far Apple’s docs say: “The value of this property is the same for apps that come from the same vendor running on the same device. If the user deletes all of that vendor’s apps from the device and then reinstalls one or more of them, the value may change.” However, it doesn’t explicitly mention what happens after iCloud restore onto a new device. Goal I want to know if it’s safe to use identifierForVendor to detect a new device context (e.g., trigger a refresh of a Firebase token when the user’s device changes). Environment iOS 17+ (latest) Swift / Capacitor app bridge Testing between iPhone 14 Pro → iPhone 15 Pro (iCloud restore)
0
1
451
Oct ’25
Xcode26 build app with iOS26, UISplitViewController UI issue
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.
4
1
675
Oct ’25
iOS 26 Safari & WebView: VisualViewport.offsetTop not reset after keyboard dismissal, causing fixed elements misplacement
1. System/device combinations where the issue does not occur: Physical device: iOS 26.0 (23A5318c) + iPhone 16 Pro Max 2. System/device combinations where the issue does occur: System versions: Physical device: iOS 26.0 (23A5330a), iOS 26.0 (23A340) Simulator: iOS 26.0 (23A339) Device models: Physical device: iPhone 12 Reproducible in Safari, WKWebView, and UIWebView: Yes Actual behavior In WebView (and identically in Safari): Before the keyboard is shown, header/footer elements with position: fixed are correctly aligned with the screen viewport. Scrolling up/down works as expected. After the keyboard appears, the visualViewport position changes. Bug: When the keyboard is dismissed, visualViewport.offsetTop does not reset to 0. As a result, fixed header/footer elements remain misaligned: When scrolling down, the position looks correct. When scrolling up, the header/footer are visibly offset. Steps to reproduce Focus an input field → the keyboard appears Dismiss the keyboard Observe that visualViewport.offsetTop remains >0 (does not reset to zero) position: fixed header/footer elements are misplaced relative to the screen Expected behavior After the keyboard is dismissed, visualViewport.height should return to match the layout viewport, and visualViewport.offsetTop should reset to 0. When scrolling upward, fixed elements should remain correctly positioned within the layout viewport. Minimal reproducible demo A simple HTML file containing: A header and footer with position: fixed An input element to trigger the keyboard <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /> <title>H5 吸顶吸底页面 Demo</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: Arial, sans-serif; height: 2000px; /* 设置内容高度 */ background-color: #f0f8ff; /* body 背景浅蓝色 */ padding-top: 120px; /* 预留 header 高度 */ padding-bottom: 60px; /* 预留 footer 高度 */ overflow-x: hidden; } /* 吸顶 Header */ header { position: fixed; top: 0; left: 0; width: 100%; height: 120px; background-color: #ff6b6b; /* 红色 */ display: flex; align-items: center; justify-content: center; color: white; font-size: 24px; font-weight: bold; z-index: 1000; } /* 吸底 Footer */ footer { position: fixed; bottom: 0; left: 0; width: 100%; height: 60px; background-color: #4ecdc4; /* 青绿色 */ display: flex; align-items: center; justify-content: center; color: white; font-size: 18px; font-weight: bold; z-index: 1000; } /* 输入框样式 */ .input-container { margin: 100px auto; width: 80%; max-width: 600px; text-align: center; } input[type='text'] { padding: 12px; font-size: 16px; border: 2px solid #ddd; border-radius: 8px; width: 100%; box-sizing: border-box; } input[type='text']:focus { outline: none; border-color: #4ecdc4; } </style> </head> <body> <!-- 吸顶 Header --> <header>吸顶 Header (120px)</header> <!-- 主体内容 --> <div class="input-container"> <input type="text" placeholder="请输入内容..." /> </div> <!-- 吸底 Footer --> <footer>吸底 Footer (60px)</footer> </body> </html>
27
27
20k
Oct ’25
Flutter 3.35 iOS build fails on Apple Silicon (M3/M4): 'Flutter/Flutter.h' file not found
I'm on a MacBook Air 2025 M4 (Apple Silicon) using Flutter 3.35.5 on channel stable, Xcode 26.0.1, and CocoaPods 1.16.2. Actual Setup: Component Version macOS 15.0 Sequoia CPU Apple M4 (ARM64) Flutter 3.35.5 on channel stable Dart 3.9.2 DevTools 2.48.0 CocoaPods 1.16.2 Xcode 26.0.1 Build 17A400 Since updating Flutter from 3.24 → 3.35, iOS builds consistently fail with the following errors (not matter if simulation or real device, also ios version no matter): fatal error: 'Flutter/Flutter.h' file not found Error logs: /Users/myuser/.pub-cache/hosted/pub.dev/app_links-6.4.1/ios/app_links/Sources/app_links/AppLinksIosPlugin.swift /Users/myuser/.pub-cache/hosted/pub.dev/app_links-6.4.1/ios/app_links/Sources/app_links/AppLinksIosPlugin.swift:1:8 Unable to find module dependency: 'Flutter' import Flutter ^ flutter_native_splash /Users/myuser/.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.6/ios/flutter_native_splash/Sources/flutter_native_splash/include/flutter_native_splash/FlutterNativeSplashPlugin.h /Users/myuser/.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.6/ios/flutter_native_splash/Sources/flutter_native_splash/include/flutter_native_splash/FlutterNativeSplashPlugin.h:1:9 'Flutter/Flutter.h' file not found flutter_secure_storage Clang dependency scanner failure: While building module 'flutter_secure_storage' imported from flutter_secure_storage-7125a5c1.input:1: In file included from <module-includes>:1: In file included from /Users/myuser/Documents/mycompany/auftrag/AppName/name-app/ios/Pods/Headers/Public/flutter_secure_storage/flutter_secure_storage-umbrella.h:13: /Users/myuser/Documents/mycompany/auftrag/AppName/name-app/ios/Pods/Headers/Public/flutter_secure_storage/FlutterSecureStoragePlugin.h:11:9: fatal error: 'Flutter/Flutter.h' file not found flutter_secure_storage-7125a5c1.input:1:1: fatal error: could not build module 'flutter_secure_storage' Unable to find module dependency: 'flutter_secure_storage' /Users/myuser/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/ios/Classes/SwiftFlutterSecureStoragePlugin.swift /Users/myuser/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/ios/Classes/SwiftFlutterSecureStoragePlugin.swift:8:8 Unable to find module dependency: 'Flutter' import Flutter ^ path_provider_foundation /Users/myuser/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/darwin/path_provider_foundation/Sources/path_provider_foundation/messages.g.swift /Users/myuser/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/darwin/path_provider_foundation/Sources/path_provider_foundation/messages.g.swift:10:10 Unable to find module dependency: 'Flutter' import Flutter ^ sign_in_with_apple Clang dependency scanner failure: While building module 'sign_in_with_apple' imported from sign_in_with_apple-b77ac708.input:1: In file included from <module-includes>:1: In file included from /Users/myuser/Documents/mycompany/auftrag/AppName/name-app/ios/Pods/Headers/Public/sign_in_with_apple/sign_in_with_apple-umbrella.h:13: /Users/myuser/Documents/mycompany/auftrag/AppName/name-app/ios/Pods/Headers/Public/sign_in_with_apple/SignInWithApplePlugin.h:1:9: fatal error: 'Flutter/Flutter.h' file not found sign_in_with_apple-b77ac708.input:1:1: fatal error: could not build module 'sign_in_with_apple' Unable to find module dependency: 'sign_in_with_apple' /Users/myuser/.pub-cache/hosted/pub.dev/sign_in_with_apple-7.0.1/ios/Classes/SignInWithAppleAvailablePlugin.swift /Users/myuser/.pub-cache/hosted/pub.dev/sign_in_with_apple-7.0.1/ios/Classes/SignInWithAppleAvailablePlugin.swift:6:8 Unable to find module dependency: 'Flutter' import Flutter ^ What I’ve verified flutter clean + flutter pub get pod install --repo-update Deleted DerivedData Verified Generated.xcconfig exists Verified FLUTTER_ROOT path is correct Tried both in Podfile use_frameworks! :linkage => :static and modular headers Tried flutter build ios --no-codesign Still, the same errors appear. Observations I couldn't find a solution with ChatGPT or searching in the Internet like on Stackoverflow Since Flutter 3.35, Flutter.framework is no longer under .../engine/ios/Flutter.framework, but instead part of .../engine/ios/Flutter.xcframework/ios-arm64/Flutter.framework After pod install, there is no Pods/Flutter/Flutter.xcframework folder at all. Running flutter build ios does not generate the framework either — Flutter seems to depend on dynamic build-time injection, but the plugins expect static headers at build time. On my Windows machine, the exact same project and plugin versions build perfectly (obviously without actual iOS compilation). Podfile ENV['COCOAPODS_DISABLE_STATS'] = 'true' project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, } def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. Run flutter pub get first." end File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}" end require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) flutter_ios_podfile_setup target 'Runner' do use_frameworks! :linkage => :static use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0' config.build_settings['HEADER_SEARCH_PATHS'] ||= ['$(inherited)', '${PODS_ROOT}/../Flutter/Flutter.framework/Headers'] config.build_settings['FRAMEWORK_SEARCH_PATHS'] ||= ['$(inherited)', '${PODS_ROOT}/../Flutter'] config.build_settings['DEFINES_MODULE'] = 'YES' end end end
1
0
138
Oct ’25