在Swift上找不到Objective-C pod

时间:2022-09-07 09:20:28

I have this pod on my project:

我的项目中有这个pod:

Podfile:

Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'AFNetworking'
pod 'Parse'
pod 'Fabric'
pod 'Crashlytics'
pod 'MagicalRecord'
pod 'Socket.IO-Client-Swift'
pod 'SDWebImage'
pod 'MBProgressHUD'
pod 'HexColors'
pod 'SWTableViewCell'
pod 'AKPickerView'
pod 'CRToast'
pod 'MTDates'
pod 'JazzHands'

Project-Bridging-Header

Project-Bridging-Header

#import <JazzHands/IFTTTJazzHands.h>
#import <MTDates/NSDate+MTDates.h>
#import <MTDates/NSDateComponents+MTDates.h>

I can use any MTDates function at any Objective-C or Swift file. And I can use any JazzHands function/class at any Objective-C file, but when I try to use it on Swift like this:

我可以在任何Objective-C或Swift文件中使用任何MTDates函数。我可以在任何Objective-C文件中使用任何JazzHands函数/类,但是当我在Swift上使用它时

import UIKit
class GICalendarViewController: UIViewController{
    var separatorFrameAnimation: IFTTTFrameAnimation!

I've got this error:

我有这个错误:

Use of undeclared type 'IFTTTFrameAnimation'

使用未声明类型“IFTTTFrameAnimation”

I've tried to add @objc tag on this class, and this doesn't work.

我已经尝试在这个类上添加@objc标记,但是这不起作用。

Any ideas why this is happening?

有什么想法吗?

1 个解决方案

#1


2  

You use these libraries as frameworks (use_frameworks!). So you have to add

您将这些库用作框架(use_frameworks!)。所以你必须加上

import JazzHands

in your source files. The same you do with Cocoa's frameworks like UIKit.

在你的源文件。同样,你也可以使用像UIKit这样的Cocoa框架。

#1


2  

You use these libraries as frameworks (use_frameworks!). So you have to add

您将这些库用作框架(use_frameworks!)。所以你必须加上

import JazzHands

in your source files. The same you do with Cocoa's frameworks like UIKit.

在你的源文件。同样,你也可以使用像UIKit这样的Cocoa框架。