Although Swift is officially supported, there are official templates for Swift , and the documentation is still thin. Here's a step-by-step tutorial for creating CocoaPods in Swift, which can help.
Essentially the steps are:
- Create a git repository
- Create an Xcode Workspace
- Add sample iOS / OSX project
- Add a Swift environment and make it dependent on your project project
Create your specified pod file, here is an example for Swift pod:
Pod::Spec.new do |s| s.name = "MySwiftPod" s.version = "0.1" s.summary = "This is my amazing Swift CocoaPod!" s.description = <<-DESC This is my long description here... yada, yada. DESC s.homepage = "http://basememara.com/how-to-create-a-cocoapod-with-swift/" s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" s.license = { :type => "MIT", :file => "LICENSE" } s.author = { "Basem Emara" => " some@example.com " } s.social_media_url = "https://twitter.com/basememara" s.platform = :ios, "8.0" s.source = { :git => "https://github.com/basememara/cocoapods-swift-sample.git", :tag => s.version } s.source_files = "MySwiftPod/MySwiftPod/*.swift" end
Basem source share