我正在使用 Parse.com 构建一个应用程序。我添加了以下框架:
我复制过来了
Parse.framework
Bolts.framework
并在构建阶段添加了以下框架:
audiotoolbox.framework
cfnetwork.framework
coregraphics.framework
corelocation.framework
libz.dylib
mobilecoreservices.framework
quartzcore.framework
security.framework
storekit.framework
systemconfiguration.framework
libsqlite3.dylib
在我的桥接头中有
#import <Parse/Parse.h>
该应用程序正在运行,但现在我想使用 ParseUI,所以我将以下内容添加到我的 podfile 并进行了 pod 安装:
pod 'ParseUI'
然后我将以下内容添加到我的 View Controller
var logInController = PFLogInViewController()
logInController.delegate = self
self.presentViewController(logInController, animated:true, completion: nil)
但我收到以下错误:
Use of unresolved identifier "PFLoginViewController"
我哪里错了?我必须在桥接头中添加任何东西吗?我在 Xcode 中以及通过 pod 文件添加了框架。
当我添加#import <ParseUI/ParseUI.h>
时到桥接头我得到错误
Type 'MEssageCollectionViewController' does not conform to protocol 'PFLoginViewControllerDelegate'
在线logInController.delegate = self
最佳答案
您需要将以下行添加到Bridging-Header.h
#import <ParseUI/ParseUI.h>
添加之后,您需要将以下委托(delegate)函数添加到您的类中。他们可以找到 here .
– logInViewController:shouldBeginLogInWithUsername:password:
– logInViewController:didLogInUser:
– logInViewController:didFailToLogInWithError:
– logInViewControllerDidCancelLogIn:
关于swift - 如何将 ParseUI 添加到 swift 项目中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27708057/