From f35d117fc5cb308ec30558aa537b52bf3fb4a60e Mon Sep 17 00:00:00 2001 From: Adrian Godoroja Date: Mon, 25 Mar 2019 10:49:08 +0100 Subject: [PATCH] Adds Swift 5 support to UIKitExtension. --- Sources/Extensions/UIKitExtension.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Sources/Extensions/UIKitExtension.swift b/Sources/Extensions/UIKitExtension.swift index e40f75d..a63c5e9 100644 --- a/Sources/Extensions/UIKitExtension.swift +++ b/Sources/Extensions/UIKitExtension.swift @@ -21,6 +21,19 @@ public extension UITableView { interrupt: ((Changeset) -> Bool)? = nil, setData: (C) -> Void ) { + #if swift(>=5.0) + reload( + using: stagedChangeset, + deleteSectionsAnimation: animation(), + insertSectionsAnimation: animation(), + reloadSectionsAnimation: animation(), + deleteRowsAnimation: animation(), + insertRowsAnimation: animation(), + reloadRowsAnimation: animation(), + interrupt: interrupt, + setData: setData + ) + #else reload( using: stagedChangeset, deleteSectionsAnimation: animation, @@ -32,6 +45,7 @@ public extension UITableView { interrupt: interrupt, setData: setData ) + #endif } /// Applies multiple animated updates in stages using `StagedChangeset`. -- 2.21.0