[英]Parse with Swift - If Contains Channel
我正在使用Parse與Swift進行推送通知。 我正在嘗試編寫一個if語句,該語句搜索當前訂閱的頻道,並查看它們是否已訂閱該特定頻道。
這是我的代碼:
let currentInstallation = PFInstallation.currentInstallation()
if(contains(currentInstallation.channels as String, "game1")) {
// do something
}
我收到以下錯誤:
找不到包含所提供參數的“包含”的重載
關於我在做什么錯的任何想法?
您正在嘗試將[AnyObject]
為String
。 試試看(如果您使用的是Swift 1.2):
let currentInstallation = PFInstallation.currentInstallation()
if (contains(currentInstallation.channels as! [String], "game1")) {
// do something
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.