ShawnMoore / XMLParsing

XMLEncoder & XMLDecoder using the codable protocol in Swift 4.2
MIT License
332 stars 100 forks source link

Using in iOS project does not work #30

Open yariviii opened 6 years ago

yariviii commented 6 years ago

I am having problems using this framework in an iOS project. It first claimed that this module was created for macos 10.10 target. I cloned the project and made the changes relevant changes: Added deployment target for iphoneos but that didnt work.

I tried to use cocoapods to integrate it in my project but I get:

[!] CocoaPods could not find compatible versions for pod "XMLParsing": In Podfile: XMLParsing (from https://github.com/ShawnMoore/XMLParsing.git)

Specs satisfying the XMLParsing (fromhttps://github.com/ShawnMoore/XMLParsing.git) dependency were found, but they required a higher minimum deployment target.

Did anyone else had this problem?

k3zi commented 6 years ago

Make sure your Podfile has:

platform :ios, '10.0'

It needs to be 10.0 >=.

yariviii commented 6 years ago

My pdofile has

platform :ios, '9.0'

since this is what my current project requires. I was wondering if you can make the framework targeted to iOS 9.0 so i can easily insert it into my project with cocapods.

Otherwise i need to clone the framework modify it and manually add it to my project. I understand that it uses capabilities found in iOS 10.0 and up but I saw if #available(iOS 10 ... in the code wrapping around relevant code blocks anyway so I guess you can target the framework to 9.0

Any idea of a different way to do it ? Thanks

k3zi commented 6 years ago

You could fork the repo, changing the XMLParsing.podspec file so that s.ios.deployment_target = "9.0", then point the git URL to your fork pod 'XMLParsing', :git => 'https://github.com/yariviii/XMLParsing.git'. That would allow you to pull any changes from upstream through Github.

I'm not sure if there is anyway to force CocoaPods to install an incompatible pod. Maybe you could provide just the custom podspec via https://guides.cocoapods.org/syntax/podfile.html#pod :

pod 'XMLParsing', :podspec => '~/Documents/XMLParsing.podspec', :git => 'https://github.com/ShawnMoore/XMLParsing.git'

this way you don't have to clone or fork the project. Although I'm not sure if podspec will take a local file, it would be worth a shot.

If there is indeed already support for iOS 9.0 without having to modify the code maybe the podspec should reflect that then, @ShawnMoore ?