2
我正在做的是創建一個不顯示我的源代碼實現的可可豆莢。我被告知你可以使用「s.ios.vendored_frameworks」並嵌入你的框架,就像iOS爲其框架所做的一樣。我想要做的是嵌入我的框架,但不能使我的源文件可見並且能夠編輯。我究竟做錯了什麼?我想在Cocoapods中做一個vendored_frameworks
我有我通過這裏的Xcode創建一個框架:https://bitbucket.org/nerdgang/ngkitsdk/src
這是我podspec:
Pod::Spec.new do |s|
s.name = "NGKitSDK"
s.version = "0.0.1"
s.summary = "NGKit a SDK for my projects, my version of iOS."
s.homepage = "https://bitbucket.org/nerdgang/ngkitsdk"
# ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# Licensing your code is important. See http://choosealicense.com for more info.
# CocoaPods will detect a license file if there is a named LICENSE*
# Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'.
#
s.license = "MIT"
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
# ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# Specify the authors of the library, with email addresses. Email addresses
# of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also
# accepts just a name if you'd rather not provide an email address.
#
# Specify a social_media_url where others can refer to, for example a twitter
# profile URL.
#
s.author = { "Havic" => "[email protected]" }
# Or just: s.author = "Havic"
# s.authors = { "Havic" => "[email protected]" }
# s.social_media_url = "http://twitter.com/Havic"
# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# If this Pod runs only on iOS or OS X, then specify the platform and
# the deployment target. You can optionally include the target after the platform.
#
# s.platform = :ios
s.platform = :ios, "5.0"
# When using multiple platforms
# s.ios.deployment_target = "5.0"
# s.osx.deployment_target = "10.7"
# s.watchos.deployment_target = "2.0"
# s.tvos.deployment_target = "9.0"
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# Specify the location from where the source should be retrieved.
# Supports git, hg, bzr, svn and HTTP.
#
s.source = { :git => "https://bitbucket.org/nerdgang/ngkitsdk/src" }
s.ios.vendored_frameworks = 'NGKitSDK.framework'
# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# CocoaPods is smart about how it includes source code. For source files
# giving a folder will include any swift, h, m, mm, c & cpp files.
# For header files it will include any header in the folder.
# Not including the public_header_files will make all headers public.
#
s.source_files = "NGKitSDK", "Classes/**/*.{h,m}"
s.exclude_files = "Classes/Exclude"
# s.public_header_files = "Classes/**/*.h"
我寫了一篇關於如何向CocoaPods發佈一個通用的閉源框架的廣泛指南:https://eladnava.com/publish-a-universal-binary-ios-framework-in-swift-using-cocoapods/ –