0
我已經安裝了firebase和導入框架的pods,並盡了一切可能......但我仍然得到這種使用undeclare'firebase'的錯誤。
進口的UIKit 進口JSQMessagesViewController 進口火力地堡在ios中使用未聲明的類型'firebase'
class ChatViewController: JSQMessagesViewController {
var ref: Firebase
@IBOutlet weak var blackBtn: UIButton!
@IBOutlet weak var menuView: UIView!
@IBOutlet weak var TypeTxt: UITextField!
var messages = [JSQMessage]()
var outgoingBubbleImageView: JSQMessagesBubbleImage!
var incomingBubbleImageView: JSQMessagesBubbleImage!
override func viewDidLoad() {
super.viewDidLoad()
ref = Firebase(url: "https://candleheart-6bee6.firebaseio.com/")
// var ref = Firebase(url:"https://fir-example-fea13.firebaseio.com/names")
// ref.setValue(["name":"mamta"])
// title = "ChatChat"
setupBubbles()
collectionView!.collectionViewLayout.incomingAvatarViewSize = CGSizeZero
collectionView!.collectionViewLayout.outgoingAvatarViewSize = CGSizeZero
// messageRef = rootRef.childByAppendingPath("messages")
TypeTxt.layer.cornerRadius = 22.0
TypeTxt.layer.borderWidth = 2.0
TypeTxt.layer.borderColor = UIColor.whiteColor().CGColor
TypeTxt.layer.backgroundColor = UIColor.whiteColor().CGColor
}
是的,我已經做了所有這些事情。 – aarti
@aarti您是否將框架文件拖到您的項目中?只是好奇 –
你不應該拖動任何文件到項目。只需在podfile中提及pod並在終端中使用pod install即可。沒有別的。也清理並在之後建立。 –