Posts

Post not yet marked as solved
0 Replies
2.6k Views
I wonder if its possible to get target based dependency using Swift Package Manager without Xcode resolving all dependency in package. I have a package like this: // swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "ReCaptcha", platforms: [ .iOS(.v9) ], products: [ .library( name: "ReCaptcha", targets: ["ReCaptcha"]), .library( name: "ReCaptchaRx", targets: ["ReCaptchaRx"]) ], dependencies: [ .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "6.0.0"), .package(url: "https://github.com/JakubMazur/AppSwizzle.git", from: "1.3.2"), ], targets: [ .target( name: "ReCaptcha", dependencies: [], path: "ReCaptcha/Classes", exclude: ["Rx"], linkerSettings: [ .linkedFramework("UIKit") ] ), .target( name: "ReCaptchaRx", dependencies: [ "ReCaptcha", .product(name: "RxSwift", package: "RxSwift") ], path: "ReCaptcha/Classes/Rx", linkerSettings: [ .linkedFramework("UIKit") ]), .testTarget( name: "ReCaptcha_Tests", dependencies: ["ReCaptcha", "AppSwizzle"], path: "Example/ReCaptcha_Tests", exclude: ["Info.plist"], resources: [ .copy("mock.html") ]) ] ) So it contains RxSwift as a dependency to 1 of 2 targets. So what I wanted to happen is that if I import only one target: This will NOT resolve RxSwift in project Instead it's getting resolved but it's anyway unavailable to import: Original autor of this library using AppSwizzle library for testTarget and then it's not getting resolved as expected, but why then importing only target without dependency resolve dependency to other target? This is open source, so code is available: https://github.com/JakubMazur/ReCaptcha/pull/1
Posted
by jkmazur.
Last updated
.
Post not yet marked as solved
0 Replies
383 Views
I want to update my timeline on some given date and time. I saw in documentation in WWDC videos that the network requests are handled on a background fetch from AppDelegate that communicates with Widget. But I know exactly when I need to perform request to update timeline and it's rare, but want to have as much precision as possible. So you can make a URLSession request directly in getTimeline(for:in:completion:) method when the last date was met? I've tried that and experience some weird blinking and I'm not sure if thats some other issue or it's just a reaction for doing something that is not allowed in widgets
Posted
by jkmazur.
Last updated
.
Post marked as solved
5 Replies
982 Views
Completion closure for authorization status is not getting called on macOS 11. The same code works without any issues on iOS: static func requestAccess(_ completion: @escaping(Bool) -> Void) { SKCloudServiceController.requestAuthorization { (status) in switch status { case .authorized: completion(true) case .denied, .notDetermined, .restricted: completion(false) @unknown default: completion(false) } } } So for iOS I see the permission prompt to access AppleMusic/Music like "[App] would like to access Apple Music, your music and video activity, and your media library" But for macOS closure never got executed. I wonder if thats the issue with documentation and it not will be supported for macOS apps or with implementation? But there is a separate section for apple music permission on macOS 11. What am I missing? Xcode 12 beta 3 macOS 11 (20A5323l) Link to docs: https://developer.apple.com/documentation/storekit/skcloudservicecontroller/1620609-requestauthorization?changes=latest_minor
Posted
by jkmazur.
Last updated
.