当在iOS中本地或远程安装Pod时,无法看到额外添加的.swift文件
问题描述:
我使用pod lib create 'mypodname'
创建了一个Pod。以下是由Xcode给出的默认结构 。当在iOS中本地或远程安装Pod时,无法看到额外添加的.swift文件
- 大部分的教程,我可以看到文件夹叫
Classes
MyFirtTestPod
文件夹内。但在这里我们没有它。 - 在另一方面,我可以添加新的
.swift
文件,但使用本地路径到另一个项目,或者truncated
后远程安装后只能看到ReplaceMe.swift
为.swift
文件安装在吊舱后。 我试着删除RepalceMe.swift
文件并添加新的.swift
文件。但没有工作。我唯一能做的就是重命名ReplaceMe.swift
。我可以看到这些文件github
但不是在装舱
这个我.podspec
文件,并根据您的文章标题的文件结构
答
,你看不到已安装的容器中有新的.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