Post

Replies

Boosts

Views

Activity

Draggable Views with Child Drop Destination Elements not Draggable in iOS 18
I'm creating an app that has a number of draggable views, and each of these views themselves contain child dropDestination views. In iOS 17.x they are draggable as expected. However, in iOS 18 betas 1 & 2 a long press on these views does NOT pick them up (start the drag operation). I have not tested with macOS 15 betas but the issue may well exist there also. Is this a bug in iOS 18 betas 1 & 2 or does the implementation need to be updated somehow for iOS 18? Please see example code below: Views: import SwiftUI extension View { func dropTarget<T>(for payloadType: T.Type, withTitle title: String) -> some View where T: Transferable { modifier(DropTargetViewModifer<T>(title: title)) } } struct DropTargetViewModifer<T>: ViewModifier where T: Transferable { let title: String func body(content: Content) -> some View { content .dropDestination(for: T.self) { items, location in print("Item(s) dropped in \(title)") return true } isTargeted: { targted in if targted { print("\(title) targeted") } } } } struct InnerTestView: View { let title: String let borderColor: Color var body: some View { ZStack { Text(title) .padding() Rectangle() .stroke(borderColor) } .contentShape(Rectangle()) } } struct TestView: View { var body: some View { VStack(spacing: 0.0) { HStack(alignment: .top, spacing: 0.0) { InnerTestView(title: "Drop Zone 1", borderColor: .pink) .dropTarget(for: ItemType1.self, withTitle: "Drop Zone 1") InnerTestView(title: "Drop Zone 2", borderColor: .indigo) .dropTarget(for: ItemType2.self, withTitle: "Drop Zone 2") } InnerTestView(title: "Drop Zone 3", borderColor: .orange) .dropTarget(for: ItemType3.self, withTitle: "Drop Zone 3") } .contentShape(Rectangle()) .draggable(ItemType1(id: "Object 1")) } } struct ContentView: View { var body: some View { ScrollView { LazyVStack { TestView() TestView() InnerTestView(title: "Draggable 2", borderColor: .orange) .draggable(ItemType2(id: "Object 2")) InnerTestView(title: "Draggable 3", borderColor: .indigo) .draggable(ItemType3(id: "Object 3")) } .padding() } } } Transfer Representations: import UniformTypeIdentifiers import CoreTransferable extension UTType { static let itemType1 = UTType(exportedAs: "com.droptest.typeone") static let itemType2 = UTType(exportedAs: "com.droptest.typetwo") static let itemType3 = UTType(exportedAs: "com.droptest.typethree") } struct ItemType1: Codable, Transferable { var id: String public static var transferRepresentation: some TransferRepresentation { CodableRepresentation(contentType: .itemType1) } } struct ItemType2: Codable, Transferable { var id: String public static var transferRepresentation: some TransferRepresentation { CodableRepresentation(contentType: .itemType2) } } struct ItemType3: Codable, Transferable { var id: String public static var transferRepresentation: some TransferRepresentation { CodableRepresentation(contentType: .itemType3) } }
3
3
374
Jun ’24
Unable to successfully sign Mac Catalyst app with Xcode
I've been trying to solve this problem off and on for multiple weeks now to no avail. I even have a DTS open with Apple but so far they haven't been able to help me. Essentially, I am creating a Mac Catalyst version of an existing iOS app, and I want to use the same bundle ID to have the in-app purchases be cross-platform (now that that's a thing). I can build and run locally without issue, and it archives just fine. However, there's some sort of signing issue that prevents it from uploading successfully. I have tried both automatic and manual signing. I get the following error when trying to upload: App Store Connect Operation Error: ERROR ITMS-90283: "Invalid Provisioning Profile. The provisioning profile included in the bundle org.cocoapods.gRPCCertificates-Cpp [&lt;Bundle Id&gt;.pkg/Payload/&lt;App Name&gt;.app/Contents/Resources/gRPCCertificates-Cpp.bundle] is invalid. [Invalid 'com.apple.application-identifier' entitlement value.] For more information, visit the macOS Developer Portal. The initial advice was to not sign the gRPCCertificates-Cpp bundle, which does not help. It's also strange that I have another catalyst app that uses the same bundle and it works just fine, so I think it's less an issue with that bundle and more how Xcode handles entitlements and signing. Though I'm open to all suggestions. One possible difference between the app that works fine and the problematic one is that the problematic one uses an explicit App ID Prefix and the other has a Team ID prefix. Another potential clue, I need to enabled Associated Domains, Autofill Credential Provider, Sign In with Apple and iCloud Key Value Storage entitlements for my app to function correctly. However, if I remove all of those and retain only In-App Purchase, Hardened Runtime, and App Sandbox entitlements the app does sign and upload successfully to the App Store. So I'm thinking the issue must have something to do with these entitlements or how Xcode handles them compared to the others. Does anyone have any ideas on what else I could try?
3
0
1.6k
Jun ’20