Update outdated pods.

This commit is contained in:
Qiu Yuzhou
2017-03-20 21:26:25 +08:00
parent 5f97493f1d
commit 975b544078
209 changed files with 4395 additions and 2293 deletions

View File

@ -6,32 +6,31 @@
// Copyright © 2016 Krunoslav Zaher. All rights reserved.
//
import Foundation
// MARK: forEach
extension Bag where T: ObserverType {
/// Dispatches `event` to app observers contained inside bag.
///
/// - parameter action: Enumeration closure.
func on(_ event: Event<T.E>) {
if _onlyFastPath {
_value0?.on(event)
return
}
@inline(__always)
func dispatch<E>(_ bag: Bag<(Event<E>) -> ()>, _ event: Event<E>) {
if bag._onlyFastPath {
bag._value0?(event)
return
}
let value0 = _value0
let dictionary = _dictionary
let value0 = bag._value0
let dictionary = bag._dictionary
if let value0 = value0 {
value0.on(event)
}
if let value0 = value0 {
value0(event)
}
if let dictionary = dictionary {
for element in dictionary.values {
element.on(event)
}
let pairs = bag._pairs
for i in 0 ..< pairs.count {
pairs[i].value(event)
}
if let dictionary = dictionary {
for element in dictionary.values {
element(event)
}
}
}
@ -50,6 +49,11 @@ func disposeAll(in bag: Bag<Disposable>) {
value0.dispose()
}
let pairs = bag._pairs
for i in 0 ..< pairs.count {
pairs[i].value.dispose()
}
if let dictionary = dictionary {
for element in dictionary.values {
element.dispose()

View File

@ -6,8 +6,6 @@
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
extension String {
/// This is needed because on Linux Swift doesn't have `rangeOfString(..., options: .BackwardsSearch)`
func lastIndexOf(_ character: Character) -> Index? {