Search results for

xcode github

91,977 results found

Post

Replies

Boosts

Views

Activity

Inconsistent subviews redrawing in LazyVStack
Hello Apple forum ! I spotted a weird behaviour with LazyVStack in a ScrollView. I understand that it loads its views only once upon appearance unlinke VStack that loads everything in one shot. What I noticed also, it seems to reload its views sometimes when scrolling back up to earlier loaded views. The thing is, it isn't always the case. struct LazyVStackTest: View { var body: some View { ScrollView { LazyVStack { ForEach(0..<1000, id: .self) { _ in // if true { MyText() // } } } } } struct MyText: View { var body: some View { let _ = Self._printChanges() HStack { Text(hello) } } } } If we consider the code above on XCode 26 beta 7 on an iOS 26 or iOS 18.2 simulator. Scroll to the bottom : you'll see one LazyVStackTest.MyText: @self changed for each row. Then scroll back up to the top, we'll see again the same message printed multiple times. --> So I gather from this that LazyVStack not only loads lazily but also removes old rows from memory & recreates them upon reappearance. What I don'
0
0
141
1w
TextEditor Problem Or Me?
When using SwiftUI's TextEditor, the application crashes immediately on launch. This occurs even in a brand new project with the simplest usage. If I remove the TextEditor, the application runs normally. Environment: OS: macOS 15.6.1 Xcode: 16.4 SDK: macOS 14 (and also tried with macOS 15 SDK) Steps to Reproduce: Create a new SwiftUI macOS App project. Replace ContentView with the following code: import SwiftUI struct ContentView: View { @State private var text = 114514 var body: some View { TextEditor(text: $text) } } Run the app. Expected Result: The app should display a working TextEditor. Actual Result: The app immediately crashes, and the debugger shows a Metal assertion error. If I remove the TextEditor, the app works fine. Screenshot: Additional Notes: This issue did not occur on macOS 14 / Xcode 15.4. It reproduces even in an empty project. Possibly related to SwiftUI/Metal integration on macOS 15.6.1. 這樣寫更專業、清楚,Apple 工程師能快速重現和定位問題。 如果你要用中文回報也可以,我能幫你翻譯。
Topic: UI Frameworks SubTopic: SwiftUI
2
0
94
1w
Core Data + CKSyncEngine with Swift 6 — concurrency, Sendable, and best practices validation
Hi everyone, I’ve been working on migrating my app (SwimTimes, which helps swimmers track their times) to use Core Data + CKSyncEngine with Swift 6. After many iterations, forum searches, and experimentation, I’ve created a focused sample project that demonstrates the architecture I’m using. The good news: 👉 I believe the crashes I was experiencing are now solved, and the sync behavior is working correctly. 👉 The demo project compiles and runs cleanly with Swift 6. However, before adopting this as the final architecture, I’d like to ask the community (and hopefully Apple engineers) to validate a few critical points, especially regarding Swift 6 concurrency and Core Data contexts. Architecture Overview Persistence layer: Persistence.swift sets up the Core Data stack with a main viewContext and a background context for CKSyncEngine. Repositories: All Core Data access is abstracted into repository classes (UsersRepository, SwimTimesRepository), with async/await methods. SyncEngine: Wraps CKSyncEngine, handles
1
0
334
1w
SwiftUI TextField with optional value working for @State but not @Binding properties
I've encountered a potential bug where a TextField connected to an optional value (not a string) works as expected when bound to a @State property, but won't update a @Binding property. Here is some example code import SwiftUI struct ContentView: View { @Binding var boundValue: Double? @State private var stateValue: Double? = 55 var body: some View { TextField(Bound value, value: $boundValue, format: .number) Text((boundValue ?? .nan)) TextField(State value, value: $stateValue, format: .number) Text((stateValue ?? .nan)) } } #Preview { ContentView(boundValue: .constant(42.00)) } It's as though the optional value stored externally is preventing the value updating. Can anyone confirm whether this is intentional, or a bug? This is in Xcode 26b6, on macOS Tahoe 26b8, but from this query it looks like the problem has existed for years.
Topic: UI Frameworks SubTopic: SwiftUI
8
0
319
1w
Reply to Avoid IPv6 communication when debugging with real device
The device communication infrastructure requires IPv6 and relies on IPv6 link-local traffic, starting from Xcode 15. There are no IPv4 options that you can enable as alternatives. TN3158 tackles a particular slice of this that is specific for some VPN and security configurations, so your IT organization may get some value from reading through that document, though there are many other types of IT configurations that fall beyond the scope of that document. If your company would like to get IT department level support from Apple on how to work with an IPv6 world with Apple features that rely on IPv6, they can take a look at the options available through AppleCare Professional Support. — Ed Ford,  DTS Engineer
1w
Reply to UIMenuBuilder - some menus refuse customization
I had no trouble replacing the View menu with code similar to the following: override func buildMenu(with builder: any UIMenuBuilder) { super.buildMenu(with: builder) if builder.system == .main { let cmd = UIKeyCommand(title: Hello, image:nil, action:#selector(doStuff), input: 1, modifierFlags: .command) let menu = UIMenu(image: nil, options: .displayInline, children: [cmd]) if let view = builder.menu(for: .view) { let newView = view.replacingChildren([menu]) builder.replace(menu: .view, with: newView) } } } With that code the View menu only shows the one menu item I created. Tested with Xcode 26 beta 7 running on a simulated iPad running iPadOS 26 beta 6.
Topic: UI Frameworks SubTopic: UIKit
1w
Reply to XCode reverts CoreData's .xccurrentversion
I had been too swamped to be able to continue this conversation because of the highly prioritized work related to WWDC25, and after that I lost the track of this thread. Sorry for that. Thanks to another developer reaching out via DTS with the same issue, I am now picking up this thread, which hopefully is not too late. I'd like to confirm that I can now reproduce the issue. As folks have mentioned, the issue happens only in an Xcode project using folders, not groups. I've always used groups which helps me better organize files logically, and so had not seen the issue before. Xcode 26 Beta 6 doesn't fix the issue. Before the issue is fixed from the system side, the workarounds folks mentioned, like using groups instead or giving the new model version a name alphabetically ordered to the last, sound good to me. Best, —— Ziqiao Chen  Worldwide Developer Relations.
1w
Reply to ITMS-90207: Invalid Bundle. The bundle at 'Runner.app' does not contain a bundle executable.
I would look in the built app to make sure that the CFBundleExecutable key in the Info.plist file is present, and that its value is the name of your main app binary that is located at the root of your .app. And of course, that binary file must be present in the package as well. If that much is good, then I'd also check that the binary file is an actual executable, and not some other type of Mach-O binary. An easy way to do that is to run otool -hv /Path/To/Your.app/YourMainExecutable in Terminal, and make sure that the file type is listed as EXECUTE. Checking in the built app as the starting point here means that I would unpack the .ipa file you are submitting to the App Store by unzipping it — you can change the extension to .zip to make that easy to do so with the built-in macOS Archive Utility. The Info.plist file inside the built app sources its contents in several ways, including values set in a source Info.plist file that you check in as part of your source code, there are build settings with values tha
1w
UIMenuBuilder - some menus refuse customization
I'm trying to customize the menu in my iPad app for iOS 26, since most of the default menu options aren't relevant to my app. Fortunately, I already have the code for this from my Mac Catalyst implementation. However, the functionality to replace menus with new sets of options has no effect on some menus on iOS. For example, updating the Format menu works fine on Mac Catalyst and iOS 26: override func buildMenu(with builder: UIMenuBuilder) { super.buildMenu(with: builder) let transposeUpItem = UIKeyCommand(title: NSLocalizedString(TRANSPOSE_UP), image: nil, action: #selector(TransposeToolbar.transposeUp(_:)), input: =, modifierFlags: UIKeyModifierFlags.command, propertyList: nil, alternates: []) let transposeDownItem = UIKeyCommand(title: NSLocalizedString(TRANSPOSE_DOWN), image: nil, action: #selector(TransposeToolbar.transposeDown(_:)), input: -, modifierFlags: UIKeyModifierFlags.command, propertyList: nil, alternates: []) let transposeGroup = UIMenu(title: , image: nil, identifier: UIMenu.Identifi
Topic: UI Frameworks SubTopic: UIKit
3
0
305
1w
Reply to Apple Music API: Adding To Collaborative playlist gives 500 error
Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. Please file a bug report, include a small Xcode project and some directions that can be used to reproduce the problem, and post the Feedback number here once you do. If you post the Feedback number here I'll check the status next time I do a sweep of forums posts where I've suggested bug reports. Bug Reporting: How and Why? has tips on creating your bug report.
Topic: Media Technologies SubTopic: General Tags:
1w
Reply to Replace Apple Clang with Vanilla Clang, what can go wrong?
It would be helpful to understand what parts of C++20 support that you feel motivate needing to switch in the first place so that we're aware. We have a published list of C++20 features and their support status, if you haven't seen it. Further, the Xcode Release Notes are extensive, and so smaller developments in C++20 support that you value may appear there, and I recommend doing a survey through the different versions there to also gauge the amount of changes in C++20 support. If there's more that you need, then please let us know through Feedback Assistant, and feel free to post the FB numbers of any of your requests here for my reference. however our concern is that we might have overlooked possible issues that could arise. The clang version included with Xcode or the Command Line Tools packages is the supported option for development and distribution with Apple frameworks. By going off that path, especially since you name a few Apple-specific frameworks such as AVFoundation and CoreML,
1w
Dynamic Library and Unit Testing - Module not found
Hi! I must be missing something. I am creating a MacOS dynamic library using Xcode. I have created the library as follows: File->New Project then choose macOS 'Library' in Frameworks and Libraries. I give the Product Name TestLib. Framework: STL (C++ Library) Type: Dynamic This creates a default library project, with one exported class 'TestLib'. There's a method HelloWorld. And this suffices for my issue. To be able to test my dynamic library, I want to use an XCtest target. So in the project settings, I select '+', and add a 'Unit Testing Bundle': Product name: TestLibTests Language: Swift Testing System: XCTest Project: TestLib Target to be tested: TestLib I press finish, and my test target is created. Now, I think I need to have a module map. So I Add New File From Template', and choose 'Module Map'. A 'module.modulemap' is created. In the module map file, I name the module 'TestLib', and header 'TestLib.h'. So far, everything makes sense, and no errors. But here it comes... When I want to mak
0
0
326
1w