GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — RETableViewManager/RETableViewManager/RETableViewSection.h at master · zhmios/RETableViewManager Expand file tree/ Copy pathRETableViewSection.hMore file actions 366 lines (287 loc) · 11.6 KB / Copy pathRETableViewSection.hFile metadata and controls366 lines (287 loc) · 11.6 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 // // RETableViewSection.h // RETableViewManager // // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #import <Foundation/Foundation.h> @class RETableViewManager; @class RETableViewCellStyle; extern CGFloat const RETableViewSectionHeaderHeightAutomatic; extern CGFloat const RETableViewSectionFooterHeightAutomatic; /** Table view section. */ @interface RETableViewSection : NSObject /** An array of section items (rows). */ @property (strong, readonly, nonatomic) NSArray *items; /** The title of the header of the specified section of the table view. */ @property (copy, readwrite, nonatomic) NSString *headerTitle; /** The title of the footer of the specified section of the table view. */ @property (copy, readwrite, nonatomic) NSString *footerTitle; /** The height of the header of the specified section of the table view. */ @property (assign, readwrite, nonatomic) CGFloat headerHeight; /** The height of the footer of the specified section of the table view. */ @property (assign, readwrite, nonatomic) CGFloat footerHeight; /** A view object to display in the header of the specified section of the table view. */ @property (strong, readwrite, nonatomic) UIView *headerView; /** A view object to display in the footer of the specified section of the table view. */ @property (strong, readwrite, nonatomic) UIView *footerView; /** The table view manager of this section. */ @property (weak, readwrite, nonatomic) RETableViewManager *tableViewManager; /** Section index in UITableView. */ @property (assign, readonly, nonatomic) NSUInteger index; /** Section index title. */ @property (copy, readwrite, nonatomic) NSString *indexTitle; /** Returns the width of the longest title in the section. @param font A base font to use in calculations. @return width. */ - (CGFloat)maximumTitleWidthWithFont:(UIFont *)font; ///----------------------------- /// @name Creating and Initializing a RETableViewSection ///----------------------------- /** Creates and returns a new section. @return A new section. */ + (instancetype)section; /** Creates and returns a new section with predefined header title. @param headerTitle A header title. @return A new section with defined header title. */ + (instancetype)sectionWithHeaderTitle:(NSString *)headerTitle; /** Creates and returns a new section with predefined header and footer titles. @param headerTitle A header title. @param footerTitle A footer title. @return A new section with header and footer titles. */ + (instancetype)sectionWithHeaderTitle:(NSString *)headerTitle footerTitle:(NSString *)footerTitle; /** Creates and returns a new section containing a header view. @param headerView A header view. @return A new section containing a header view. */ + (instancetype)sectionWithHeaderView:(UIView *)headerView; /** Creates and returns a new section containing header and footer views. @param headerView A header view. @param footerView A footer view. @return A new section containing header and footer views. */ + (instancetype)sectionWithHeaderView:(UIView *)headerView footerView:(UIView *)footerView; /** Initializes a newly allocated section and sets header title. @param headerTitle A header title. @return A new section initialized with a header title. */ - (id)initWithHeaderTitle:(NSString *)headerTitle; /** Initializes a newly allocated section with header and footer titles. @param headerTitle A header title. @param footerTitle A footer title. @return A new section initialized with header and footer titles. */ - (id)initWithHeaderTitle:(NSString *)headerTitle footerTitle:(NSString *)footerTitle; /** Initializes a newly allocated section containing a header view. @param headerView A header view. @return A new section initialized containing a header view. */ - (id)initWithHeaderView:(UIView *)headerView; /** Initializes a newly allocated section containing header and footer views. @param headerView A header view. @param footerView A footer view. @return A new section initialized with header and footer views. */ - (id)initWithHeaderView:(UIView *)headerView footerView:(UIView *)footerView; ///----------------------------- /// @name Styling ///----------------------------- /** The object that provides styling for the section. See RETableViewCellStyle reference for details. */ @property (strong, readwrite, nonatomic) RETableViewCellStyle *style; ///----------------------------- /// @name Adding Items ///----------------------------- /** Inserts a given item at the end of the section. @param item The item to add to the end of the section. This value must not be `nil`. @return The item. */ - (void)addItem:(id)item; /** Adds the items contained in another given array to the end of the section. @param array An array of items to add to the end of the section. */ - (void)addItemsFromArray:(NSArray *)array; /** Inserts a given item into the section at a given index. @param item The item to add to the section. This value must not be nil. @param index The index in the section at which to insert item. This value must not be greater than the count of items in the section. */ - (void)insertItem:(id)item atIndex:(NSUInteger)index; /** Inserts the items in the provided items array into the section at the specified indexes. @param items An array of items to insert into the section. @param indexes The indexes at which the items should be inserted. */ - (void)insertItems:(NSArray *)items atIndexes:(NSIndexSet *)indexes; ///----------------------------- /// @name Removing Items ///----------------------------- /** Removes all occurrences in the section of a given item. @param item The item to remove from the section. */ - (void)removeItem:(id)item; /** Empties the section of all its items. */ - (void)removeAllItems; /** Removes all occurrences of item within the specified range in the section. @param item The item to remove from the section within range. @param range The range in the section from which to remove section. */ - (void)removeItemIdenticalTo:(id)item inRange:(NSRange)range; /** Removes all occurrences of a given item in the section. @param item The section to remove from the section. */ - (void)removeItemIdenticalTo:(id)item; /** Removes from the section the items in another given array. @param otherArray An array containing the items to be removed from the section. */ - (void)removeItemsInArray:(NSArray *)otherArray; /** Removes from the section each of the items within a given range. @param range The range of the items to remove from the section. */ - (void)removeItemsInRange:(NSRange)range; /** Removes all occurrences within a specified range in the section of a given item. @param item The item to remove from the section. @param range The range from which to remove item. */ - (void)removeItem:(id)item inRange:(NSRange)range; /** Removes the item with the highest-valued index in the section. */ - (void)removeLastItem; /** Removes the item at index. @param index The index from which to remove the item in the section. The value must not exceed the bounds of the section. */ - (void)removeItemAtIndex:(NSUInteger)index; /** Removes the items at the specified indexes from the section. @param indexes The indexes of the items to remove from the section. The locations specified by indexes must lie within the bounds of the section. */ - (void)removeItemsAtIndexes:(NSIndexSet *)indexes; ///----------------------------- /// @name Replacing Items ///----------------------------- /** Replaces the item at index with another item. @param index The index of the item to be replaced. This value must not exceed the bounds of the section. @param item The item with which to replace the item at index index in the section. This value must not be `nil`. */ - (void)replaceItemAtIndex:(NSUInteger)index withItem:(id)item; /** Replaces the items in the section with all of the items from a given array. @param otherArray The array of items from which to select replacements for the items. */ - (void)replaceItemsWithItemsFromArray:(NSArray *)otherArray; /** Replaces the items in the section at specified locations specified with the items from a given array. @param indexes The indexes of the items to be replaced. @param items The items with which to replace the items in the section at the indexes specified by `indexes`. The count of locations in indexes must equal the count of items. */ - (void)replaceItemsAtIndexes:(NSIndexSet *)indexes withItems:(NSArray *)items; /** Replaces the items in the section by one given range with the items in another array specified by another range. @param range The range of items to replace in (or remove from) the section. @param otherArray The array of items from which to select replacements for the items in range. @param otherRange The range of items to select from otherArray as replacements for the items in range. */ - (void)replaceItemsInRange:(NSRange)range withItemsFromArray:(NSArray *)otherArray range:(NSRange)otherRange; /** Replaces the items in the section specified by a given range with all of the items from a given array. @param range The range of items to replace in (or remove from) the section. @param otherArray The array of items from which to select replacements for the items in range. */ - (void)replaceItemsInRange:(NSRange)range withItemsFromArray:(NSArray *)otherArray; ///----------------------------- /// @name Rearranging Items ///----------------------------- /** Exchanges the items in the section at given indices. @param idx1 The index of the item with which to replace the item at index idx2. @param idx2 The index of the items with which to replace the item at index idx1. */ - (void)exchangeItemAtIndex:(NSUInteger)idx1 withItemAtIndex:(NSUInteger)idx2; /** Sorts the items in ascending order as defined by the comparison function compare. @param compare The comparison function to use to compare two items at a time. @param context The context argument to pass to the compare function. */ - (void)sortItemsUsingFunction:(NSInteger (*)(id, id, void *))compare context:(void *)context; - (void)sortItemsUsingSelector:(SEL)comparator; ///----------------------------- /// @name Manipulating table view section ///----------------------------- /** Reloads the `section` using a given animation effect. @param animation A constant that indicates how the reloading is to be animated */ - (void)reloadSectionWithAnimation:(UITableViewRowAnimation)animation; ///----------------------------- /// @name Checking for Validation Errors ///----------------------------- @property (strong, readonly, nonatomic) NSArray *errors; @end |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |