While I found a solution to check if debugger is attached to a process following this Q&A. My query is mostly with regards to distribution aspect to it. My use-case is to have this check as an SDK that is shipped as XCFramework. I have verified no submission error being generated if app including this code is submitted to TestFlight.
However, I am unsure what will happen if app having this check is submitted to appstore. Will this submission be rejected? Or having this check in an appstore submitted app doesn't impact anything?
Post
Replies
Boosts
Views
Activity
I have a Swift Package that includes XCFrameworks which are exported as binary targets. If I include any of the product in Frameworks and Libraries section of a notification service extension target, build succeeds while the extension crashes with dynamic linker error:
Library not loaded: @rpath/MoEngageRichNotification.framework/MoEngageRichNotification
My workaround is to include the same product in app target's Frameworks and Libraries section and add @executable_path/../../Frameworks to LD_RUNPATH_SEARCH_PATHS settings for extension target.
Is this a known limitation of XCode when using SPM?
I am exploring on managing state in SwiftUI app with purpose built Views due to the advantages for managing dependency with Environment.
This is the minimal example I came up with:
@MainActor
struct AsyncStateModifier<T: Equatable>: View {
let input: T
let action: (T) async -> Void
@Environment var queue: AsyncActionQueue
var body: some View {
return EmptyView()
.onChange(of: input, initial: true) { old, new in
queue.process(action: action, with: input)
}
}
}
The drawback of this approach is initial: true allows the onChange callback to fire when view appears and since EmptyView doesn't appear the action is never executed initially.
When replacing EmptyView with Rectangle().hidden() this can be achieved, but I wanted to avoid having any impact on view hierarchy and EmptyView is suitable for that. Is there any alternative approach to make something like this possible?