【发布时间】:2019-12-18 09:06:05
【问题描述】:
var readIndicatorNeedsDisplay: Driver<Bool> = .empty()
public func bindcellEvents(readNotificationID: String) {
if let unreadNotificationIDs = UserDefaults.main?.unreadNotificationIDs, unreadNotificationIDs.contains(readNotificationID) {
readIndicatorNeedsDisplay = true
} else {
UserDefaults.main?.unreadNotificationIDs.append(readNotificationID)
readIndicatorNeedsDisplay = false
// Cannot assign value of type 'Bool' to type 'Driver<Bool>' (aka 'SharedSequence<DriverSharingStrategy, Bool>')
}
}
当我将 bool 分配给驱动程序时出现错误:无法将类型“Bool”的值分配给类型“驱动程序”(又名“SharedSequence”)
【问题讨论】:
-
请按照说明在 StackOverflow 上提问。