,你看不到已安裝的容器中有新的.swift
文件,對嗎?
在新創建的文件.podspec
,你可以看到Cocoapod的有關源代碼註釋:
# ――― 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.
#
幾乎所有(除Bolts
)在Cocoapod框架我用沒有文件夾。所以當你瀏覽Pods> AFramework時,你可以看到它的類。
這裏是最簡單的.podspec
代碼的源代碼和資源。嘗試一下。如您所見,我將源代碼部分的路徑從我的pod的根文件夾中提取出來。 GPKit/**/*.{swift}
以及我的資源。我過去遇到同樣的問題,但是資源(例如.xib
),而不是.swift
文件。
# ――― 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 = "GPKit", "GPKit/**/*.{swift}"
# ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# A list of resources included with the Pod. These are copied into the
# target bundle with a build phase script. Anything else will be cleaned.
# You can preserve files from being cleaned, please don't preserve
# non-essential files like tests, examples and documentation.
#
# s.resource = "icon.png"
# s.resources = "Resources/*.png"
s.resources = "GPKit/**/*.{xib}"
# s.preserve_paths = "FilesToSave", "MoreFilesToSave"
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3' }
在這裏發表您podspec – Bannings
@Bannings這裏添加的podspec – Jobs
@JonasSchafft你是什麼意思。在這裏我創建一個pod,不使用pod – Jobs