CocoaPod development for iOS and OSX

I have CocoaPod published for iOS and want to make it available for OS X as well. I fixed my PodSpec so that it was ready for both iOS and Mac OS X:

Pod::Spec.new do |s| s.name = "EveryoneAPI" s.version = "0.9.5" s.summary = "An objective-c wrapper for EveryoneAPI.com API" s.description = <<-DESC To retrieve all information for EveryoneAPI use the following: EveryoneAPI *everyoneAPI = [[EveryoneAPI alloc] initWithAccountSID:@"ACb8444c3013dc40518e46b48c91f82ba0" withAuthToken:@"AUe90abecac85645ca8a314d41e9b55079"]; [everyoneAPI getInformation:EveryoneAPIReturnAllInfo forPhoneNumber:@"5551234567" withSuccessHandler:^(EveryoneAPIResponseObject *responseObject){ } withErrorHandler:^(NSError *error, NSNumber *statusCode, NSString *readableError){ }]; DESC s.homepage = "https://github.com/msencenb/EveryoneAPI" s.license = 'MIT' s.author = { "Matt Sencenbaugh" => " my_email@gmail.com " } s.source = { :git => "https://github.com/msencenb/EveryoneAPI.git", :tag => s.version.to_s } s.ios.deployment_target = "8.0" s.osx.deployment_target = "10.9" s.requires_arc = true s.source_files = 'Pod/Classes' s.resource_bundles = { 'EveryoneAPI' => ['Pod/Assets/*.png'] } end 

This is a simple module that uses only Foundation classes, so it does not need separate resources. All is well and good, but during pod lib lint I get the following error:

  - NOTE | [OSX] error: /var/folders/yd/kfjb5s4d1vv57fv5lhtm9lbh0000gn/T/CocoaPods/Lint/build/Release/EveryoneAPI.bundle: No such file or directory 

Be that as it may, my goal of EveryoneAPI.bundle in the Xcode development section is to set up an iOS package. I can’t understand for my whole life how to make the pod focus on OSX. Are there any good guides? Add a new goal? If so, how can I tell podspec to look for that particular package, not iOS?

+6
source share
1 answer

You can add

 s.platform = :osx, '10.7' s.platform = :ios, '6.0' 

to your Podspec , and as I suggested I'L'I, you must specify the source file, as well as the pod lint error in that it does not find sources.

 s.osx.source_files = "Classes/osx/**/*.{h,m}" 

If your allAPI is a module, you can also add it as follows:

 s.osx.frameworks = 'everyoneAPI' 

And if it is a library, you can add it like this:

 s.vendored_libraries = 'Vendor/everyoneAPI/everyoneAPI' 
+3
source

All Articles