【发布时间】:2018-04-24 12:59:10
【问题描述】:
我该如何解决这个问题?在map 函数中,它说表达式太复杂,无法在合理的时间内解决;考虑将表达式分解为不同的子表达式。
let manuallyShowFerryInBoundPopup = Observable.merge([
NotificationCenter.default.rx
.notification(NSNotification.Name.UIApplicationDidBecomeActive)
.map { _ in () },
viewDidAppear
])
.flatMap { VADApi.FerryDestination.list(skip: 0, take: 1, token: VADDataManager.getUserToken()!) }
.map { $0.first }
.filter {
$0 != nil
&& "\(String(($0?.ferry?.id)!)),\(String(($0?.id)!))" != VADDataManager.shownFerryInBoundTrace
}
.map { ( ($0?.ferry?.id)!, ($0?.id)! ) } // Expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions
【问题讨论】: