如何将 ParseUI 添加到 swift 项目 [英] How to add ParseUI to a swift project

查看:50
本文介绍了如何将 ParseUI 添加到 swift 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Parse.com 构建应用程序.我添加了以下框架:

I'm building an app with Parse.com. I added the following frameworks:

我复制了

Parse.framework
Bolts.framework

并在构建阶段添加了以下框架:

and added the following frameworks in Build phases:

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 安装:

The app is working but now I want to use ParseUI so I added the following to my podfile and did a pod install:

pod 'ParseUI'

然后我将以下内容添加到我的视图控制器

I then added the following to my view controller

var logInController = PFLogInViewController()
logInController.delegate = self
self.presentViewController(logInController, animated:true, completion: nil)

但我收到以下错误:

Use of unresolved identifier "PFLoginViewController"

我哪里出错了?我必须在桥接头中添加任何内容吗?我在 Xcode 中以及通过 pod 文件添加了框架.

Where am I going wrong? Must I add anything to the bridging header? I have the frameworks added in Xcode as well as through the pod file.

当我将 #import <ParseUI/ParseUI.h> 添加到桥接头时,我收到错误类型'MEssageCollectionViewController'不符合协议'PFLoginViewControllerDelegate' logInController.delegate = self

When I add #import <ParseUI/ParseUI.h> to the bridging header I get the error Type 'MEssageCollectionViewController' does not conform to protocol 'PFLoginViewControllerDelegate' on the line logInController.delegate = self

推荐答案

你需要在Bridging-Header.h

#import <ParseUI/ParseUI.h>

添加后,您需要将以下委托函数添加到您的类中.可以在此处找到它们.

After you add that, you'll need to add the following delegate functions to your class. They can be found here.

– logInViewController:shouldBeginLogInWithUsername:password:
– logInViewController:didLogInUser:
– logInViewController:didFailToLogInWithError:
– logInViewControllerDidCancelLogIn:

这篇关于如何将 ParseUI 添加到 swift 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆