How do you convert an xcode project into a cocoapod? -
i have piece of code find reusing in multiple different projects i'd make cocoapod , use private cocoapod repo.
my question how setup xcode project cocoapod? should static library or empty 'project' appdelegate ok? seems not want appdelegate or main.m in pod, sure makes easier run , debug.
thanks
a cocoapod can simple couple of files. it's in how define in podspec. include relevant source code files in podspec (no main.m
or unless have reason so). recommendation have source
directory in top-level of repo containing relevant source files.
if want have demo project show how use it, can on same level, , use files source
directory (don't copy them somewhere under demo project directory). having actual xcode project not required have pod.
you have close demo of basic podspec:
pod::spec.new |s| s.name = 'reachability' s.version = '3.1.0' s.license = :type => 'bsd' s.homepage = 'https://github.com/tonymillion/reachability' s.authors = 'tony million' => 'tonymillion@gmail.com' s.summary = 'arc , gcd compatible reachability class ios , os x. drop in replacement apple reachability.' s.source = :git => 'https://github.com/tonymillion/reachability.git', :tag => 'v3.1.0' s.source_files = 'reachability.h,m' s.framework = 'systemconfiguration' s.requires_arc = true end
source: http://docs.cocoapods.org/specification.html
and here repo reachability in example: https://github.com/tonymillion/reachability
Comments
Post a Comment