Skip to content
This repository was archived by the owner on Jan 17, 2023. It is now read-only.

Added support to add UIKit+AFNetworking using Swift Package Manager#4623

Open
tc-sgupta wants to merge 4 commits intoAFNetworking:masterfrom
tc-sgupta:master
Open

Added support to add UIKit+AFNetworking using Swift Package Manager#4623
tc-sgupta wants to merge 4 commits intoAFNetworking:masterfrom
tc-sgupta:master

Conversation

@tc-sgupta
Copy link
Copy Markdown

Issue Link 🔗

https://github.com/AFNetworking/AFNetworking/issues/4616

Goals ⚽

  • Added support to add UIKit+AFNetworking using Swift Package Manager

Implementation Details 🚧

  • Added target UIKit_AFNetworking depends on target AFNetworking

Testing Details 🔍

  • Create a project and try to add AFNetworking or UIKit_AFNetworking target.

Screen Shot 2020-10-04 at 12 05 17 AM

@JuhaO81
Copy link
Copy Markdown

JuhaO81 commented Oct 7, 2020

Any estimates when is this going in and to be released?

@jshier
Copy link
Copy Markdown
Member

jshier commented Dec 20, 2020

Thanks for the PR! Unfortunately this makes the UIKit extensions available to all package consumers, not just those on iOS, so anyone who includes both packages and isn't on iOS will see a build failure. There doesn't seem to be a way to conditionalize the target so it's only available on iOS, which is why I didn't include it when creating the package in the first place. For that reason I'm inclined not to merge this PR and just say that anyone who wants the extensions should use other package managers, unless there's an alternate solution.

@KyNorthstar
Copy link
Copy Markdown

As someone who consumes platform-dependent packages from multiple platforms, I know there are many mechanisms to remove the difficulties presented here. You could have a specific target just for macOS/AppKit or watchOS/WatchKit, or you could surround imports with compiler conditionals. Merging this will not break existing code, and those requiring it will be able to easily overcome any challenges they face including it.

* Added UIKIT sources

* Fix sources

* Add more sources

* Add different target UIKit_AFNetworking

* Fix syntax

* Avoid duplicate target

* Include afnetworking sources

* Add afnetworking dependency to UIKit_AFNetworking
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants