iOS 给 cocoapods 的 spec 类如何扩展方法

lxs091021119 · October 20, 2018 · Last by jasl replied at October 20, 2018 · 5730 hits

cocoapods 的 spec 类扩展方法,我写在 cocoapods 源码里面可以,但是写在 podfile 里面不行,提示扩展的方法找不到,代码如下,请教各位大神,错误出在哪里?

class Spec 
      def spec_test
         puts "测试"
      end  
 end

试试 class ::Spec 注意用 :: 指定下顶层

You need to Sign in before reply, if you don't have an account, please Sign up first.