Search results for

Swift 6

49,211 results found

Post

Replies

Boosts

Views

Activity

Reply to @State variable returns empty despite being set in .onAppear function
Another point. In DataView, index should not be a State variable. Add a button in ContentView VStack { if showView && (index >= 0) && (index < data.count) { DataView(datum: data[index]) } Spacer() HStack { Text(Index: (index) -> ) Button(Next) { index += 1 if index >= data.count { index = 0 } } } } You will see that text in DataView does not change Text(DataView (datum.str)) always says DataView String 1 Now change DataView as follows to get it updated on index change by button press: struct DataView: View { /*@State*/ var datum: Data2 var body: some View { Text(DataView (datum.str)) } } Note: I renamed data to datum for an array item, to differentiate from the array. Now, I have to update my initial answer. In fact, no need for showView and Dispatch (even though that made it work). Just test index: if (index < data.count) { DataView(datum: data[index]) Without the index test, it crashes… Swift/ContiguousArrayBuffer.swift:691: Fatal error: Index out of range Reason is t
Topic: Design SubTopic: General Tags:
4w
Unable to download sales report
Hello, I’m encountering a consistent HTTP 400 – Bad Request error when attempting to retrieve daily sales reports via the App Store Connect API. The request format follows the official documentation: https://developer.apple.com/documentation/appstoreconnectapi/get-v1-salesreports. Here is an example of the request I’m making: curl --location --globoff ' https://api.appstoreconnect.apple.com/v1/salesReports?filter[frequency]=DAILY&filter[vendorNumber]=&filter[reportDate]=2025-08-11&filter[reportType]=SALES&filter[reportSubType]=SUMMARY' --header 'Authorization: Bearer ' This request worked without issues until August 6, 2025 (Obviously using the previous day date), but from August 7 onward it returns a 400 error. Could you please confirm: Whether there have been any changes to the required query parameters (e.g., filter[version]). If there are any known issues with the SALES / SUMMARY / DAILY endpoint. Aside from the images attached, our buffer error also shows: new Uint8Array([60, 3
2
0
151
Aug ’25
Reply to Dynamic Library cannot call exposed C function
@DTS Engineer you are right, the KERN_PROTECTION_ERROR really through me off. I updated today to Xcode 26 beta 5 and with my dylib compiled with debug symbols all of the sudden I can see where the null invocation is happening However, I don't have any idea why the compiler is stripping this symbols when packaging for TestFlight/Debugging. I've already added a lot of preprocessor directives to try to keep the symbols intact. Any idea what could I try? #define EXPORT __attribute__((visibility(default), used, retain)) extern C { EXPORT void ios_prepare_request(const char *url) { NSString *urlString = [NSString stringWithUTF8String:url]; request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]]; } void force_symbol_registration() { // Force these symbols to be included in the binary by referencing them volatile void *ptrs[] = {(void *)ios_prepare_request, (void *)ios_set_request_header, (void *)ios_present_webview, (void *)ios_close_webview, (void *)ios_get_browser_cookies_for_current_url, (v
Topic: Code Signing SubTopic: General Tags:
4w
GateKeeper rejects application bundles with a file name with an NFC/NFD problem by copying with Finder
I made a macOS application using Swift Package and distributed it in dmg format through Apple Notary service. However, we received a report from a user that it can be launched from a disk image mounted from dmg, but when copied to /Applications, the app is broken and does not start. I looked into why this happened, I noticed that the codesign command returned different results when copying the application bundle and /Applications on the volume mounted dmg with Finder. Mounted dmg: OK ❯ codesign --verify --deep --verbose /Volumes/azoo-key-skkserv/azoo-key-skkserv.app /Volumes/azoo-key-skkserv/azoo-key-skkserv.app: valid on disk /Volumes/azoo-key-skkserv/azoo-key-skkserv.app: satisfies its Designated Requirement Copied by Finder: Bad codesign reports that there are 148 added/missing files. ❯ codesign --verify --deep --verbose /Applications/azoo-key-skkserv.app /Applications/azoo-key-skkserv.app: a sealed resource is missing or invalid file added: /Applications/azoo-key-skkserv.app/Contents/Resources/Az
Topic: Code Signing SubTopic: General
5
0
248
4w
Reply to Dynamic Library cannot call exposed C function
Thanks for the crash report. The standard DTS mantra is “Always ask for a crash report first.” I failed to do that in this case, to my own detriment )-: The crash report snippet in your original post, and the discussion of Rust and so on, confused me into thinking that this problem is more complex than it is. However, your crash report makes it clear as to exactly what’s going on: Thread 3 name: Thread 3 Crashed: 0 ??? 0x0000000000000000 0x0 + 0 1 sdk 0x0000000105931ec0 0x105820000 + 1121984 This isn’t a weird code signing issue. Rather, your code has simply jumped to nil. [quote='853477022, ospfranco, /thread/795348?answerId=853477022#853477022, /profile/ospfranco'] I guess cocoapods masqueraded the issue. [/quote] Possibly. I often see cross-platform code deploy the -undefined linker option, which has a tendency to turn build-time errors into run-time errors. Needless to say, I’m not a fan [1]. If you’re curious about how Mach-O symbols work, I talk about that extensively in Understanding Mach-O Symbols. Th
Topic: Code Signing SubTopic: General Tags:
4w
Reply to Dynamic Library cannot call exposed C function
@DTS Engineer I just tried the SPM version of the package and found out that on release config, it crashes with a undefined symbol. I guess cocoapods masqueraded the issue. When ran with the debug scheme then it runs fine. The Package.swift is defined as follows // swift-tools-version: 5.8 import PackageDescription let package = Package( name: OpacityCore, platforms: [ .iOS(.v13) ], products: [ .library( name: OpacityCore, targets: [OpacityCoreObjc, OpacityCoreSwift]) ], dependencies: [], targets: [ .binaryTarget( name: sdk, path: sdk.xcframework ), .target( name: OpacityCoreObjc, dependencies: [sdk], path: src/objc, publicHeadersPath: ., cSettings: [ .headerSearchPath(../../include) ], linkerSettings: [ .linkedFramework(CoreTelephony), .linkedFramework(CoreLocation), .linkedFramework(WebKit), ] ), .target( name: OpacityCoreSwift, dependencies: [OpacityCoreObjc], path: src/swift ), ] )
Topic: Code Signing SubTopic: General Tags:
4w
xcodebuild keeps defaulting to Mac Catalyst
Ok, I'm going crazy here. I have a static library for iOS that I want to build for the simulator. I use xcodebuild -destination=iOS Simulator and then check the library using otool which tells me the platform is 6, which is Mac Catalyst. When I look at the output of xcodebuild, it says --- xcodebuild: WARNING: Using the first of multiple matching destinations: { platform:macOS, arch:arm64, variant:Mac Catalyst, id:00006041-0008492E3AA1801C, name:My Mac } ... It has the simulator listed too, way down the list: { platform:iOS Simulator, arch:x86_64, id:AB7A99B3-8D24-4F73-A42D-9BB45321928D, OS:18.6, name:iPad (A16) } When I put all of that into xcodebuild for the platform, it still says there are multiple matching destinations and chooses Mac Catalyst. Why? How? What? Does platform=iOS Simulator mean nothing? How in the world does Mac Catalyst match iOS Simulator????? I don't want Mac Catalyst, I don't need Mac Catalyst, and I can't get rid of Mac Catalyst. Nothing I specify in xcodebuild results in any
5
0
74
Aug ’25
Reply to Swift 6 Minimum Requirement for App Store
I can't speak to urgency, because that could be interpreted as a future looking timeframe. As a process, I would enable the Swift 5 stricter concurrency checking in code that you control to gauge what the important issues in your code base are, and decide what it would mean to fix them in terms of complexity. After that, try out the Swift 6 language mode, and see what other issues the complier identifies, once again with an eye for complexity. You can then take that information about the technical complexity and use that as information in your overall scheduling and mangement of your software project, and when the best time to do the work is. Since you can do that on a module-by-module basis, there's no need to jump to Swift 6 all at once. You can turn it on just for one module where perhaps there are no issues, or they are easy to address, after updating the language mode, and expand outward from there. And looking at this from the other direction, if there's a module where the iss
Aug ’25