How to create cocoapod with .swift?

I know how to work with cocoapods in a new fast-paced project?
But how can I create my own cocoapod using swift?

pod lib lint creates this error:

- NOTE | [xcodebuild] warning: no rule to process file '/Pod/Classes/SomeClass.swift' of type text for architecture armv7 

Edit: Just found this quick branch: https://github.com/CocoaPods/CocoaPods/tree/swift

+6
source share
3 answers

Cocoapods now supports fast: Pod-Authors-Guide-to-CocoaPods-Frameworks

+3
source

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 
+1
source

Using the latest version of Cocoapods ( 0.37.1 ), you can now use pod lib create to create Swift libraries. The first question you asked is should the library be Objective-C or Swift.

Also described here: http://guides.cocoapods.org/making/using-pod-lib-create.html

0
source

Source: https://habr.com/ru/post/972924/


All Articles