@@ -180,11 +180,7 @@ open class UITableView: UIScrollView {
180
180
/// Returns a reusable header or footer view located by its identifier.
181
181
public func dequeueReusableHeaderFooterView( withIdentifier identifier: String ) -> UITableViewHeaderFooterView ? {
182
182
183
- if let existingView = dequeue ( with: identifier, cache: & cache. headerFooters) {
184
-
185
- return existingView
186
-
187
- } else if let registeredView = self . reuseIdentifiers. headerFooters [ identifier] {
183
+ if let registeredView = self . reuseIdentifiers. headerFooters [ identifier] {
188
184
189
185
// create new cell
190
186
switch registeredView {
@@ -986,7 +982,6 @@ private extension UITableView {
986
982
987
983
var sections = [ Section] ( )
988
984
var cells = ( reusable: Set < UITableViewCell > ( ) , cached: [ IndexPath: UITableViewCell] ( ) )
989
- var headerFooters = [ UITableViewHeaderFooterView] ( )
990
985
}
991
986
992
987
struct ReuseIdentifiers {
@@ -1073,68 +1068,24 @@ private extension UITableView {
1073
1068
1074
1069
func tableView( _ tableView: UITableView , cellForRowAt indexPath: IndexPath ) -> UITableViewCell {
1075
1070
1076
- assert ( tableView. dataSource == nil , " Requesting cell for table view with no data source set " )
1077
-
1078
1071
fatalError ( " Should never request cell for table view with default data source " )
1079
1072
}
1080
1073
}
1081
1074
1082
1075
final class DefaultDelegate : UITableViewDelegate {
1083
1076
1084
1077
fileprivate init ( ) { }
1085
-
1086
- func scrollViewDidEndScrollingAnimation( _ scrollView: UIScrollView ) {
1087
-
1088
- }
1089
-
1090
- func scrollViewDidScroll( _ scrollView: UIScrollView ) {
1091
-
1092
- }
1093
-
1094
- func scrollViewWillBeginDragging( _ scrollView: UIScrollView ) {
1095
-
1096
- }
1097
-
1098
- func scrollViewDidEndDragging( _ scrollView: UIScrollView , willDecelerate decelerate: Bool ) {
1099
-
1100
- }
1101
-
1102
- func scrollViewWillBeginDecelerating( _ scrollView: UIScrollView ) {
1103
-
1104
- }
1105
-
1106
- func scrollViewDidEndDecelerating( _ scrollView: UIScrollView ) {
1107
-
1108
- }
1109
-
1110
- func viewForZooming( in scrollView: UIScrollView ) -> UIView {
1111
-
1112
- }
1113
-
1114
- func scrollViewWillBeginZooming( _ scrollView: UIScrollView , withView view: UIView ) {
1115
-
1116
- }
1117
-
1118
- func scrollViewDidEndZooming( _ scrollView: UIScrollView , with view: UIView , atScale scale: Float ) {
1119
-
1120
- }
1121
-
1122
- func scrollViewDidZoom( _ scrollView: UIScrollView ) {
1123
-
1124
- }
1125
-
1126
- func scrollViewShouldScrollToTop( _ scrollView: UIScrollView ) -> Bool {
1127
-
1128
- }
1129
1078
}
1130
1079
}
1131
1080
1081
+ /// The style of the table view.
1132
1082
public enum UITableViewStyle : Int {
1133
1083
1134
1084
case plain
1135
1085
case grouped
1136
1086
}
1137
1087
1088
+ /// The position in the table view (top, middle, bottom) to which a given row is scrolled.
1138
1089
public enum UITableViewScrollPosition : Int {
1139
1090
1140
1091
case none
@@ -1143,6 +1094,7 @@ public enum UITableViewScrollPosition: Int {
1143
1094
case bottom
1144
1095
}
1145
1096
1097
+ /// The type of animation when rows are inserted or deleted.
1146
1098
public enum UITableViewRowAnimation : Int {
1147
1099
1148
1100
case fade
@@ -1156,9 +1108,19 @@ public enum UITableViewRowAnimation: Int {
1156
1108
case automatic = 100
1157
1109
}
1158
1110
1111
+ /// Requests icon to be shown in the section index of a table view.
1112
+ ///
1113
+ /// If the data source includes this constant string in the array of strings it returns
1114
+ /// in `sectionIndexTitles(for:)`, the section index displays a magnifying glass icon at
1115
+ /// the corresponding index location. This location should generally be the first title in the index.
1159
1116
// http://stackoverflow.com/questions/235120/whats-the-uitableview-index-magnifying-glass-character
1160
1117
public let UITableViewIndexSearch : String = " {search} "
1161
1118
1119
+ /// The default value for a given dimension.
1120
+ ///
1121
+ /// Requests that UITableView use the default value for a given dimension.
1122
+ public let UITableViewAutomaticDimension : CGFloat = - 1.0
1123
+
1162
1124
open class UITableViewRowAction {
1163
1125
1164
1126
0 commit comments