Repository: ReactiveX/RxSwift
File: RxCocoa/iOS/Proxies/RxCollectionViewDataSourcePrefetchingProxy.swift (Swift)

Code before:
//
//  RxCollectionViewDataSourcePrefetchingProxy.swift
//  RxCocoa
//
//  Created by Rowan Livingstone on 2/15/18.
//  Copyright © 2018 Krunoslav Zaher. All rights reserved.
//

#if os(iOS) || os(tvOS)

import UIKit
import RxSwift

@available(iOS 10.0, tvOS 10.0, *)
extension UICollectionView: HasPrefetchDataSource {
    public typealias PrefetchDataSource = UICollectionViewDataSourcePrefetching
}

@available(iOS 10.0, tvOS 10.0, *)
let collectionViewPrefetchDataSourceNotSet = CollectionViewPrefetchDataSourceNotSet()

@available(iOS 10.0, tvOS 10.0, *)
final class CollectionViewPrefetchDataSourceNotSet : NSObject, UICollectionViewDataSourcePrefetching {

    func collectionView(_ collectionView: UICollectionView, prefetchItemsAt indexPaths: [IndexPath]) {}

}

@available(iOS 10.0, tvOS 10.0, *)
open class RxCollectionViewDataSourcePrefetchingProxy: DelegateProxy<UICollectionView, UICollectionViewDataSourcePrefetching>, DelegateProxyType, UICollectionViewDataSourcePrefetching {

    /// Typed parent object.
    public weak private(set) var collectionView: UICollectionView?

    /// - parameter collectionView: Parent object for delegate proxy.
    public init(collectionView: ParentObject) {
        self.collectionView = collectionView
        super.init(parentObject: collectionView, delegateProxy: RxCollectionViewDataSourcePrefetchingProxy.self)
    }

    // Register known implementations
    public static func registerKnownImplementations() {
        self.register { RxCollectionViewDataSourcePrefetchingProxy(collectionView: $0) }
    }


Review comment (suggestion):
I think that we can make this `fileprivate`. (and also make the other corresponding fields like `collectionViewDataSourceNotSet` `fileprivate`).

Code after:
//
//  RxCollectionViewDataSourcePrefetchingProxy.swift
//  RxCocoa
//
//  Created by Rowan Livingstone on 2/15/18.
//  Copyright © 2018 Krunoslav Zaher. All rights reserved.
//

#if os(iOS) || os(tvOS)

import UIKit
import RxSwift

@available(iOS 10.0, tvOS 10.0, *)
extension UICollectionView: HasPrefetchDataSource {
    public typealias PrefetchDataSource = UICollectionViewDataSourcePrefetching
}

@available(iOS 10.0, tvOS 10.0, *)
fileprivate let collectionViewPrefetchDataSourceNotSet = CollectionViewPrefetchDataSourceNotSet()

@available(iOS 10.0, tvOS 10.0, *)
fileprivate final class CollectionViewPrefetchDataSourceNotSet
    : NSObject
    , UICollectionViewDataSourcePrefetching {

    func collectionView(_ collectionView: UICollectionView, prefetchItemsAt indexPaths: [IndexPath]) {}

}

@available(iOS 10.0, tvOS 10.0, *)
open class RxCollectionViewDataSourcePrefetchingProxy
    : DelegateProxy<UICollectionView, UICollectionViewDataSourcePrefetching>
    , DelegateProxyType
    , UICollectionViewDataSourcePrefetching {

    /// Typed parent object.
    public weak private(set) var collectionView: UICollectionView?

    /// - parameter collectionView: Parent object for delegate proxy.
    public init(collectionView: ParentObject) {
        self.collectionView = collectionView
        super.init(parentObject: collectionView, delegateProxy: RxCollectionViewDataSourcePrefetchingProxy.self)
    }