Post

Replies

Boosts

Views

Activity

Strange behavior of opening a new file on Xcode
I have noticed that every time I open a new file (by clicking, double-clicking, or using "open quickly"), instead of opening in a new tab, there is a chance that it will replace my current tab with the new file. For example, if I have 3 files open, my tabs look like this: [a.swift, b.swift, c.swift] and b.swift is my current working file. When I open d.swift, my tabs then become: [a.swift, d.swift, c.swift] How can I change this behavior?
0
0
9
1d
Release app to production with Xcode 16 beta and MacOS 15 beta
I've updated my mac to Sequoia (MacOS 15) beta, my iPhone to iOS 18 beta, and Xcode to Xcode 16 beta. Only then, I realized I couldn't publish app updates with Xcode beta (error in AppStore Connect). I tried using the non-beta Xcode version but got "Invalid Binary" during app review: ITMS-90111: Unsupported SDK or Xcode version - App submissions must use the latest Xcode and SDK Release Candidates (RC). For details on currently supported versions, visit: https://developer.apple.com/news/releases. I really need to publish updates and I can't wait for September. I can't downgrade my devices because that would require me to erase both my Mac and my iPhone (for testing), which is not something I can do. Is there any option I didn't think about? How can I publish app updates in the current situation? It really should be more explicit before updating that you can't release updates with the beta versions...
4
1
138
2d
Linker command failed due to Undefined Symbol errors.
Xcode will build and analyze fine using the Debug build configuration but trying to use Analyze or Archive with Release configuration generates 3 errors: Undefined symbol: protocol conformance descriptor, Undefined symbol: type metadata accessor, and Undefined symbol: nominal type descriptor causing the linker to command to fail. The library is included and already linked and a previous version did not have the error so I think it's a code issue but not quite sure what it is or how to fix! The project/package can be found here: https://github.com/kudit/Device/tree/v2.1.17 (to reproduce, checkout this version and rename appending ".swiftpm" to the folder, then right-click to show package contents, open the Development folder and open the Xcode project there. It's done this way so the package can be imported and edited on iPad Swift Playgrounds)
0
0
71
2d
Test Swift Package that vends XCFramework and has dependencies in example app before distribution
I've created a closed source iOS SDK from a local Swift package, which has dependencies on other Swift packages, and successfully created a binary XCFramework following the solution from my previous post. I would now like to create a Package.swift to vend this XCFramework and test it in an example app to verify it works as expected before I upload it to a public repo for distribution. I understand that binaryTarget does not support dependencies so we need to use a wrapper. I created a directory containing the following: Package.swift MyFramework.xcframework/ MyFrameworkWrapper/ ├─ dummy.swift Package.swift contains: // swift-tools-version: 5.10 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "MyFramework", platforms: [ .iOS(.v14) ], products: [ .library( name: "MyFramework", targets: ["MyFramework", "MyFrameworkWrapper"] ) ], dependencies: [ .package(url: "https://github.com/gordontucker/FittedSheets.git", from: "2.6.1") ], targets: [ .target( name: "MyFrameworkWrapper", dependencies: [ "FittedSheets" ], path: "MyFrameworkWrapper" ), .binaryTarget( name: "MyFramework", path: "MyFramework.xcframework" ) ] ) I created a new iOS app, selected the project, Package Dependencies > + > Add Local, and added the directory containing this Package.swift. Xcode resolves the dependencies and lists them in the sidebar. I added code to import and use the framework. It builds successfully but the app crashes when run: dyld[63959]: Library not loaded: @rpath/FittedSheets.framework/FittedSheets Referenced from: <7DE247FC-DAFF-3946-AD21-E80F5AF841C9> /Users/Jordan/Library/Developer/Xcode/DerivedData/MyFramework-Example-gaeeymnqzenzrbbmhuebpodqctsz/Build/Products/Debug-iphonesimulator/MyFramework.framework/MyFramework How do I get this working? I'm wondering is my package set up properly to vend the framework specifying its dependencies, and is my XCFramework created correctly? The Package.swift for the framework's source code contains: // swift-tools-version: 5.10 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "MyFramework", platforms: [ .iOS(.v14) ], products: [ .library( name: "MyFramework", type: .dynamic, targets: ["MyFramework"] ) ], dependencies: [ .package(url: "https://github.com/gordontucker/FittedSheets.git", from: "2.6.1") ], targets: [ .target( name: "MyFramework", dependencies: [ "FittedSheets" ], path: "Sources" ) ] ) And I created the XCFramework following the steps in that previous thread: Create archive from package via xcodebuild archive -workspace "$PACKAGE_PATH" -scheme "$FRAMEWORK_NAME" -destination 'generic/platform=iOS' -archivePath "$ARCHIVE_PATH/iOS" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES ENABLE_USER_SCRIPT_SANDBOXING=NO ENABLE_MODULE_VERIFIER=NO OTHER_SWIFT_FLAGS=-no-verify-emitted-module-interface Create the Modules directory in the framework via mkdir -p "$ARCHIVE_PATH/iOS.xcarchive/Products/usr/local/lib/$FRAMEWORK_NAME.framework/Modules" Copy the Swift interface files into the framework from the build in DerivedData via cp -a "$BUILD_PRODUCTS_PATH/Build/Intermediates.noindex/ArchiveIntermediates/$FRAMEWORK_NAME/BuildProductsPath/Release-iphoneos/$FRAMEWORK_NAME.swiftmodule" "$ARCHIVE_PATH/iOS.xcarchive/Products/usr/local/lib/$FRAMEWORK_NAME.framework/Modules" Repeat 1-3 for iOS Simulator Create an XCFramework via xcodebuild -create-xcframework -framework "$ARCHIVE_PATH/iOS.xcarchive/Products/usr/local/lib/$FRAMEWORK_NAME.framework" -framework "$ARCHIVE_PATH/iOS_Simulator.xcarchive/Products/usr/local/lib/$FRAMEWORK_NAME.framework" -output "$ARCHIVE_PATH/$FRAMEWORK_NAME.xcframework"
0
0
70
2d
AVSpeechUtterance not working on apple watch
import AVFoundation Button { let utterance = AVSpeechUtterance(string: "Hello world") utterance.voice = AVSpeechSynthesisVoice(language: "en-GB") utterance.rate = 1 let synthesizer = AVSpeechSynthesizer() synthesizer.speak(utterance) } label: { Text("hello") } i omitted some code but this is the core part. When i run this on apple watch se 2 simulator (watch os 10.5) nothing happens and gives the error Query for com.apple.MobileAsset.VoiceServicesVocalizerVoice failed: 2 Unable to list voice folder Query for com.apple.MobileAsset.VoiceServices.GryphonVoice failed: 2 Unable to list voice folder Query for com.apple.MobileAsset.VoiceServices.CustomVoice failed: 2 Unable to list voice folder Query for com.apple.MobileAsset.VoiceServices.GryphonVoice failed: 2 Unable to list voice folder
1
0
40
2d
Migration of users after an app has been transferred to a new organization
Our company was re-formed under a new name. Rather than rename the organization on the App Store, we were advised by support to create a new organization and then transfer the app to that organization, which we have done. Our app implements Apple Authentication. We did not not migrate the users of the app (as instructed here: https://developer.apple.com/documentation/sign_in_with_apple/transferring_your_apps_and_users_to_another_team) Is it possible to now migrate the users, after the app has been transferred? Our attempt to get an authorization token with scope "user.migration" results in HTTP error 400 with body: "invalid_client".
0
0
51
2d
FinanceKit Query for current AccountBalance
The 2024 WWDC video 'Meet FinanceKit' has a code example to get the latest 7 AccountBalance entries for a given account: // Get latest 7 available balances for account func getBalances(account: Account) async throws -> [AccountBalance] { let sortDescriptor = SortDescriptor(\AccountBalance.asOfDate, order: .reverse) let predicate = #Predicate<AccountBalance> { balance in balance.available != nil && balance.accountId == account.id } let query = AccountBalanceQuery( sortDescriptors: [sortDescriptor], predicate: predicate, limit: 7 ) return try await store.accountBalances(query: query).reversed() } This code does not compile, because the AccountBalance struct has no field named asOfDate - you need to inspect the currentBalance enum, switch over the enum type value, and then extract asOfDate from the associated value. All of this can't be done in a KeyPath (as far as I know 🤷‍♂️), which I think means it's impossible to get recent balances, without specifying a date, or getting all balances, and then sorting them in memory. Am I missing something? I'd love to be proven wrong :) FB14076698
0
0
33
2d
Unable to access related file in QuickLook Thumbnail Extension and QuickLook Preview Extension
Hi, I am developing QuickLook Thumbnail Extension and QuickLook Preview Extension which work with embroidery files. To prepare the view, I need to access stitches from the "stitch" file (supplied to my extension by system) and also to read the "colors" from related file (i.e. the file with different extension, but the same filename as "stitch" file). The embrodery is located stored in 2 files: squirrel.dst (stitchs) and squirrel.edr (colors). Is it even possible to extend sandbox in extensions for this task? I have tried to ask user to select folder in main.app (NSOpenPanel), create security-scoped Bookmark in main.app and access it from extension. However, this is not working - in the extension it is not possible to resolve the bookmark created in main.app. I have also tried to use mechanism for accessing related files as shown at https://developer.apple.com/documentation/security/app_sandbox/protecting_user_data_with_app_sandbox, using NSFilePresenter/NSFileCoordinator. It works in main.app, but doesn't work in QuickLook Thumbnail Extension and QuickLook Preview Extension. Is there any mechanism on Mac which would allow me to access more than the "supplied" file URL in QuickLook Thumbnail Extension and QuickLook Preview Extension? Ladislav
0
0
42
2d
XCode 16 beta2 (beta1 also) hangs when trying to open complex Localizable.xcstrings
XCode 16 beta1 and beta2 hangs whenever I try to open Localizable.xcstrings. The localization screen appears but afterwards XCode becomes unresponsive until I kill it. To make matters worse, upon restart the last window, Localizaton is reloaded, instantly causing a hang again (I need to be super quick as I have about half a second to try to click elsewhere like crazy). The same localization strings file works fine on XCode 15.4. I tried to export all localizations in 15.4, empty the file, re-generate localization strings, re-import languages one by one in 16, starting with different languages (thinking maybe a weird exotic character causes the issue with one of the languages, this happened previously crashing XCode 15 until I found the offending character and replaced it with something else). But generally even after just adding a single language there is a serious slowdown - after adding the second one, XCode hangs again. Note: the app in question has a lot of localizable strings - I had no issue creating a simple project with only a few strings. Just hoping a fix - I really wished the issue was fixed in beta2 but now I am a bit concerned that maybe it's a rare problem and might not get fixed as I saw no similar reports so far.
7
1
86
2d
Xcode Crashes on Distribute/Validate Archive
Hi, my Xcode is crashing immediately after clicking on 'Distribute' (after selecting 'Distribution Method', and regardless of the method I choose). I've tried: Updated Xcode Cleared Derived Data Updated macOS Created new signing certificates After all changes I created new archives but had the same result on distribute. I recently cleaned up my mac, so I suspect I might've deleted something important. My touch bar also recently broke. Other than that, I can't think of any other variables since my last successful distribution attempt. Please help, I've never experienced any issues like this. I've attached snippets from the report as a text file, but the full report was too large: xcode_crash_report.txt
0
0
42
2d