Skip to content

amirk27/cocoapods-workshop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CocoaPods Workshop

Helpful links to get started:

Ask me on Twitter

Example project

  1. Install Xcode or command line tools (xcode-select --install)
  2. sudo gem install cocoapods (if needed: sudo gem update --system)
  3. Create new Xcode project
  4. touch Podfile && open -e Podfile
  5. pod install

Sample Podfile

platform :ios, '7.0'

pod 'AFNetworking'

Resulting directory layout:

- Project/
	- Project/
		- *.{h,m}
	- Project.xcodeproj
	- Project.xcworkspace
	- Podfile
	- Pods/
		- Pods.xcodeproj 

Discussion:

  • Xcode workspace, projects, Build Phases, Info settings
  • Podfile.lock, Pods directory
  • Check in Pods directory
  • pod outdated, pod update

Tips & tricks

Create your own pod

  1. pod spec create AlertViewController or copy from existing podspec
  2. open -e AlertViewController.podspec
  3. Add pod 'AlertViewController', :path => '..' to your project for testing
  4. When done testing, tag source code with version
  5. pod spec lint
  6. Fork Specs repo
  7. Add your podspec and create pull request

Sample podspec

Pod::Spec.new do |s|
  s.name     = 'AlertViewController'
  s.version  = '0.0.1'
  s.license  = 'MIT'
  s.summary  = 'Cocoapods workshop excercise.'
  s.homepage = 'https://github.com/choefele/cocapods-workshop'
  s.authors  = { 'Claus Höfele' => '[email protected]' }
  s.social_media_url = 'https://twitter.com/claushoefele'
  s.source   = { :git => 'https://github.com/choefele/cocapods-workshop.git', :tag => s.version.to_s }
  s.requires_arc = true

  s.ios.deployment_target = '6.0'

  s.source_files = 'Pod/*.{h,m}'
end

About

CocoaPods workshop

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 98.6%
  • Other 1.4%