Repository: ReactiveX/RxSwift
File: RxSwift/Schedulers/SerialDispatchQueueScheduler.swift (Swift)

Code before:
import struct Foundation.TimeInterval
import struct Foundation.Date
import Dispatch

/**
Abstracts the work that needs to be performed on a specific `dispatch_queue_t`. It will make sure 
that even if concurrent dispatch queue is passed, it's transformed into a serial one.

It is extremely important that this scheduler is serial, because
certain operator perform optimizations that rely on that property.

Because there is no way of detecting is passed dispatch queue serial or
concurrent, for every queue that is being passed, worst case (concurrent)
will be assumed, and internal serial proxy dispatch queue will be created.

This scheduler can also be used with internal serial queue alone.

In case some customization need to be made on it before usage,
internal serial queue can be customized using `serialQueueConfiguration`
callback.
*/
public class SerialDispatchQueueScheduler: SchedulerType {
    public typealias TimeInterval = Foundation.TimeInterval
    public typealias Time = Date

    /// Return current time.
    public var now: Date {
        return Date()
    }

    let configuration: DispatchQueueConfiguration

    /// Constructs new `SerialDispatchQueueScheduler` that wraps `queue`.
    ///
    /// - Parameters:
    ///   - serialQueue: Target dispatch queue.
    ///   - leeway:
    init(serialQueue: DispatchQueue, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) {
        configuration = DispatchQueueConfiguration(queue: serialQueue, leeway: leeway)
    }

    /// Constructs new `SerialDispatchQueueScheduler` with internal serial queue named `internalSerialQueueName`.
    ///
    /// Additional dispatch queue properties can be set after dispatch queue is created using `serialQueueConfiguration`.
    ///
    /// - Parameters:
    ///   - internalSerialQueueName: Name of internal serial dispatch queue.
    ///   - serialQueueConfiguration: Additional configuration of internal serial dispatch queue.
    ///   - leeway: The amount of time, in nanoseconds, that the system can defer the timer.
    public convenience init(internalSerialQueueName: String, serialQueueConfiguration: ((DispatchQueue) -> Void)? = nil, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) {
        let queue = DispatchQueue(label: internalSerialQueueName, attributes: [])

Review comment (suggestion):
Please revert this change. `returns: Something` is the correct syntax Xcode detects. 

Code after:
import struct Foundation.TimeInterval
import struct Foundation.Date
import Dispatch

/**
Abstracts the work that needs to be performed on a specific `dispatch_queue_t`. It will make sure 
that even if concurrent dispatch queue is passed, it's transformed into a serial one.

It is extremely important that this scheduler is serial, because
certain operator perform optimizations that rely on that property.

Because there is no way of detecting is passed dispatch queue serial or
concurrent, for every queue that is being passed, worst case (concurrent)
will be assumed, and internal serial proxy dispatch queue will be created.

This scheduler can also be used with internal serial queue alone.

In case some customization need to be made on it before usage,
internal serial queue can be customized using `serialQueueConfiguration`
callback.
*/
public class SerialDispatchQueueScheduler : SchedulerType {
    public typealias TimeInterval = Foundation.TimeInterval
    public typealias Time = Date
    
    /// - returns: Current time.
    public var now : Date {
        return Date()
    }

    let configuration: DispatchQueueConfiguration
    
    /**
    Constructs new `SerialDispatchQueueScheduler` that wraps `serialQueue`.

    - parameter serialQueue: Target dispatch queue.
    - parameter leeway: The amount of time, in nanoseconds, that the system will defer the timer.
    */
    init(serialQueue: DispatchQueue, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) {
        configuration = DispatchQueueConfiguration(queue: serialQueue, leeway: leeway)
    }

    /**
    Constructs new `SerialDispatchQueueScheduler` with internal serial queue named `internalSerialQueueName`.
    
    Additional dispatch queue properties can be set after dispatch queue is created using `serialQueueConfiguration`.
    
    - parameter internalSerialQueueName: Name of internal serial dispatch queue.
    - parameter serialQueueConfiguration: Additional configuration of internal serial dispatch queue.
    - parameter leeway: The amount of time, in nanoseconds, that the system will defer the timer.
    */