在iOS、swift中本地或远程安装pod时,无法查看额外添加的.swift文件

在iOS、swift中本地或远程安装pod时,无法查看额外添加的.swift文件,ios,swift,cocoapods,Ios,Swift,Cocoapods,我使用pod库create'mypodname'创建了一个pod。下面是 默认结构由Xcode提供 在大多数教程中,我可以在MyFirtTestPod文件夹中看到名为Classes的文件夹。但在这里我们没有 另一方面,我可以添加新的.swift文件,但在使用另一个项目的本地路径安装pod后,或者在截断后远程安装后,只能将ReplaceMe.swift作为文件查看我尝试删除RepalceMe.swift文件并添加新的.swift文件。但是没有起作用。我唯一能做的就是重命名ReplaceMe.s

我使用
pod库create'mypodname'
创建了一个pod。下面是 默认结构由Xcode提供

  • 在大多数教程中,我可以在
    MyFirtTestPod
    文件夹中看到名为
    Classes
    的文件夹。但在这里我们没有
  • 另一方面,我可以添加新的
    .swift
    文件,但在使用另一个项目的本地路径安装pod后,或者在
    截断后远程安装后,只能将
    ReplaceMe.swift
    作为
    文件查看我尝试删除
    RepalceMe.swift
    文件并添加新的
    .swift
    文件。但是没有起作用。我唯一能做的就是重命名
    ReplaceMe.swift
    。我可以在
    github
    中看到这些文件,但在已安装的pod中看不到这些文件
这是我的
.podspec
文件和文件结构


根据您文章的标题,您在已安装的pod中看不到新的
.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.
  #
我使用的Cocoapod中几乎所有(除了
螺栓
)框架都没有文件夹。因此,当您浏览Pods>aframew时,您已经可以看到它的类了

下面是源代码和资源的最简单的
.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' }

根据文章的标题,您在已安装的pod中看不到新的
.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.
  #
我使用的Cocoapod中几乎所有(除了
螺栓
)框架都没有文件夹。因此,当您浏览Pods>aframew时,您已经可以看到它的类了

下面是源代码和资源的最简单的
.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' }

发布你的podspechere@Bannings添加了podspechere@JonasSchafft你什么意思?在这里,我正在创建一个pod,而不是使用pod404:删除podspec中
s.source\u文件中的
Classes
部分路径here@Bannings添加了podspechere@JonasSchafft你什么意思?在这里,我正在创建一个pod,而不是使用pod404:Delete
Classes
podspec中的
s.source\u文件中的部分路径。