Skip to content
Permalink
Browse files

Update RxExample project

  • Loading branch information...
freak4pc authored and kzaher committed Apr 6, 2019
1 parent 5eb798a commit 9a39952e787f923922ea51fe57a7be5c3fadca63
Showing with 63 additions and 284 deletions.
  1. +0 −6 Platform/DataStructures/Bag.swift
  2. +2 −2 Preprocessor/Preprocessor.xcodeproj/project.pbxproj
  3. +0 −2 RxCocoa/Common/ControlTarget.swift
  4. +4 −3 RxExample/RxDataSources/Differentiator/Diff.swift
  5. +3 −4 RxExample/RxDataSources/Differentiator/ItemPath.swift
  6. +6 −6 RxExample/RxDataSources/RxDataSources/AnimationConfiguration.swift
  7. +1 −1 RxExample/RxDataSources/RxDataSources/TableViewSectionedDataSource.swift
  8. +18 −18 RxExample/RxDataSources/RxDataSources/UI+SectionedViewType.swift
  9. +12 −225 RxExample/RxExample.xcodeproj/project.pbxproj
  10. +1 −1 RxExample/RxExample.xcodeproj/xcshareddata/xcschemes/RxExample-iOS.xcscheme
  11. +1 −1 RxExample/RxExample.xcodeproj/xcshareddata/xcschemes/RxExample-iOSTests.xcscheme
  12. +1 −1 RxExample/RxExample.xcodeproj/xcshareddata/xcschemes/RxExample-iOSUITests.xcscheme
  13. +1 −1 RxExample/RxExample.xcodeproj/xcshareddata/xcschemes/RxExample-macOS.xcscheme
  14. +1 −1 RxExample/RxExample.xcodeproj/xcshareddata/xcschemes/RxExample-macOSUITests.xcscheme
  15. +1 −1 RxExample/RxExample/Examples/GeolocationExample/GeolocationViewController.swift
  16. +3 −3 RxExample/RxExample/Examples/ImagePicker/ImagePickerController.swift
  17. +1 −1 ...mple/Examples/SimpleTableViewExampleSectioned/SimpleTableViewExampleSectionedViewController.swift
  18. +2 −2 RxExample/RxExample/Examples/UIPickerViewExample/SimplePickerViewExampleViewController.swift
  19. +1 −1 RxExample/RxExample/Examples/WikipediaImageSearch/Views/CollectionViewImageCell.swift
  20. +1 −1 RxExample/RxExample/Services/UIImageView+DownloadableImage.swift
  21. +2 −2 RxExample/RxExample/Version.swift
  22. +1 −1 RxExample/RxExample/iOS/AppDelegate.swift
@@ -171,15 +171,9 @@ extension Bag {
}

extension BagKey: Hashable {
#if swift(>=4.2)
func hash(into hasher: inout Hasher) {
hasher.combine(rawValue)
}
#else
var hashValue: Int {
return rawValue.hashValue
}
#endif
}

func ==(lhs: BagKey, rhs: BagKey) -> Bool {
@@ -180,7 +180,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@@ -228,7 +228,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
@@ -14,8 +14,6 @@ import RxSwift
import UIKit

typealias Control = UIKit.UIControl
public typealias ControlEvents = UIKit.UIControl.Event

#elseif os(macOS)
import Cocoa

@@ -126,14 +126,15 @@ public enum Diff {
//================================================================================
// swift dictionary optimizations {
private struct OptimizedIdentity<E: Hashable> : Hashable {
private struct OptimizedIdentity<E: Hashable>: Hashable {
func hash(into hasher: inout Hasher) {
hasher.combine(identity.pointee)
}

let hashValue: Int
let identity: UnsafePointer<E>

init(_ identity: UnsafePointer<E>) {
self.identity = identity
self.hashValue = identity.pointee.hashValue
}

static func == (lhs: OptimizedIdentity<E>, rhs: OptimizedIdentity<E>) -> Bool {
@@ -27,9 +27,8 @@ public func == (lhs: ItemPath, rhs: ItemPath) -> Bool {
}

extension ItemPath: Hashable {

public var hashValue: Int {
return sectionIndex.byteSwapped.hashValue ^ itemIndex.hashValue
public func hash(into hasher: inout Hasher) {
hasher.combine(sectionIndex.byteSwapped)
hasher.combine(itemIndex)
}

}
@@ -14,13 +14,13 @@
Exposes custom animation styles for insertion, deletion and reloading behavior.
*/
public struct AnimationConfiguration {
public let insertAnimation: UITableViewRowAnimation
public let reloadAnimation: UITableViewRowAnimation
public let deleteAnimation: UITableViewRowAnimation
public let insertAnimation: UITableView.RowAnimation
public let reloadAnimation: UITableView.RowAnimation
public let deleteAnimation: UITableView.RowAnimation

public init(insertAnimation: UITableViewRowAnimation = .automatic,
reloadAnimation: UITableViewRowAnimation = .automatic,
deleteAnimation: UITableViewRowAnimation = .automatic) {
public init(insertAnimation: UITableView.RowAnimation = .automatic,
reloadAnimation: UITableView.RowAnimation = .automatic,
deleteAnimation: UITableView.RowAnimation = .automatic) {
self.insertAnimation = insertAnimation
self.reloadAnimation = reloadAnimation
self.deleteAnimation = deleteAnimation
@@ -153,7 +153,7 @@ open class TableViewSectionedDataSource<S: SectionModelType>
}
}

open var rowAnimation: UITableViewRowAnimation = .automatic
open var rowAnimation: UITableView.RowAnimation = .automatic

#if os(iOS)
open var sectionIndexTitles: SectionIndexTitles {
@@ -20,35 +20,35 @@ func indexSet(_ values: [Int]) -> IndexSet {

extension UITableView : SectionedViewType {

public func insertItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation) {
public func insertItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation) {
self.insertRows(at: paths, with: animationStyle)
}

public func deleteItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation) {
public func deleteItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation) {
self.deleteRows(at: paths, with: animationStyle)
}

public func moveItemAtIndexPath(_ from: IndexPath, to: IndexPath) {
self.moveRow(at: from, to: to)
}

public func reloadItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation) {
public func reloadItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation) {
self.reloadRows(at: paths, with: animationStyle)
}

public func insertSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) {
public func insertSections(_ sections: [Int], animationStyle: UITableView.RowAnimation) {
self.insertSections(indexSet(sections), with: animationStyle)
}

public func deleteSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) {
public func deleteSections(_ sections: [Int], animationStyle: UITableView.RowAnimation) {
self.deleteSections(indexSet(sections), with: animationStyle)
}

public func moveSection(_ from: Int, to: Int) {
self.moveSection(from, toSection: to)
}

public func reloadSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) {
public func reloadSections(_ sections: [Int], animationStyle: UITableView.RowAnimation) {
self.reloadSections(indexSet(sections), with: animationStyle)
}

@@ -60,35 +60,35 @@ extension UITableView : SectionedViewType {
}

extension UICollectionView : SectionedViewType {
public func insertItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation) {
public func insertItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation) {
self.insertItems(at: paths)
}

public func deleteItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation) {
public func deleteItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation) {
self.deleteItems(at: paths)
}

public func moveItemAtIndexPath(_ from: IndexPath, to: IndexPath) {
self.moveItem(at: from, to: to)
}

public func reloadItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation) {
public func reloadItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation) {
self.reloadItems(at: paths)
}

public func insertSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) {
public func insertSections(_ sections: [Int], animationStyle: UITableView.RowAnimation) {
self.insertSections(indexSet(sections))
}

public func deleteSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) {
public func deleteSections(_ sections: [Int], animationStyle: UITableView.RowAnimation) {
self.deleteSections(indexSet(sections))
}

public func moveSection(_ from: Int, to: Int) {
self.moveSection(from, toSection: to)
}

public func reloadSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) {
public func reloadSections(_ sections: [Int], animationStyle: UITableView.RowAnimation) {
self.reloadSections(indexSet(sections))
}

@@ -101,15 +101,15 @@ extension UICollectionView : SectionedViewType {
}

public protocol SectionedViewType {
func insertItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation)
func deleteItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation)
func insertItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation)
func deleteItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation)
func moveItemAtIndexPath(_ from: IndexPath, to: IndexPath)
func reloadItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation)
func reloadItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation)

func insertSections(_ sections: [Int], animationStyle: UITableViewRowAnimation)
func deleteSections(_ sections: [Int], animationStyle: UITableViewRowAnimation)
func insertSections(_ sections: [Int], animationStyle: UITableView.RowAnimation)
func deleteSections(_ sections: [Int], animationStyle: UITableView.RowAnimation)
func moveSection(_ from: Int, to: Int)
func reloadSections(_ sections: [Int], animationStyle: UITableViewRowAnimation)
func reloadSections(_ sections: [Int], animationStyle: UITableView.RowAnimation)

func performBatchUpdates<S>(_ changes: Changeset<S>, animationConfiguration: AnimationConfiguration)
}
Oops, something went wrong.

0 comments on commit 9a39952

Please sign in to comment.
You can’t perform that action at this time.