I know how to work with cocoapods in a new swift project?
But how can i create my own cocoapod using swift?
pod lib lint produces this error:
- NOTE | [xcodebuild] warning: no rule to process file '/Pod/Classes/SomeClass.swift' of type text for architecture armv7
Edit: Just found this swift branch: https://github.com/CocoaPods/CocoaPods/tree/swift
Open the project folder using Finder and you’ll see CocoaPods created a new IceCreamShop.xcworkspace file and a Pods folder to store all the project’s dependencies. Note: From now on, as the command line warning mentioned, you must always open the project with the .xcworkspace file and not the .xcodeproj.
You first need to add your Podspec to a private specs repo; this lets CocoaPods find the pod when you try to install it. Fortunately, you’ve already created a Git repo for this, so this final step is relatively straightforward.
Somewhere along your iOS development journey you will come across the term cocoapods or pods. What is it and what does it do? Cocoapods is an application level dependency manager that runs on objective-c, swift, and any other programming languages that run on Objective-C.
Cocoapods is an application level dependency manager that runs on objective-c, swift, and any other programming languages that run on Objective-C. It focuses on source-based distribution of third party code and allows automatic integration to your Xcode projects.
Cocoapods now supports swift : Pod-Authors-Guide-to-CocoaPods-Frameworks
Although Swift is officially supported, there are no official templates available for Swift and documentation is still slim. Here's a step-by-step tutorial for creating CocoaPods in Swift that may help though.
Essentially the steps are:
Create your pod spec file, here's an example for a 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" => "[email protected]" }
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With