From 83b9d5c682b21d88133f24da0f94dd56bd79e687 Mon Sep 17 00:00:00 2001 From: 单军华 Date: Thu, 19 Jul 2018 13:38:55 +0800 Subject: [PATCH] change --- screendisplay/Pods/YYCategories/YYCategories/UIKit/UITableView+YYAdd.m | 80 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 80 insertions(+), 0 deletions(-) diff --git a/screendisplay/Pods/YYCategories/YYCategories/UIKit/UITableView+YYAdd.m b/screendisplay/Pods/YYCategories/YYCategories/UIKit/UITableView+YYAdd.m new file mode 100755 index 0000000..9bd400e --- /dev/null +++ b/screendisplay/Pods/YYCategories/YYCategories/UIKit/UITableView+YYAdd.m @@ -0,0 +1,80 @@ +// +// UITableView+YYAdd.m +// YYCategories <https://github.com/ibireme/YYCategories> +// +// Created by ibireme on 14/5/12. +// Copyright (c) 2015 ibireme. +// +// This source code is licensed under the MIT-style license found in the +// LICENSE file in the root directory of this source tree. +// + +#import "UITableView+YYAdd.h" +#import "YYCategoriesMacro.h" + +YYSYNTH_DUMMY_CLASS(UITableView_YYAdd) + + +@implementation UITableView (YYAdd) + +- (void)updateWithBlock:(void (^)(UITableView *tableView))block { + [self beginUpdates]; + block(self); + [self endUpdates]; +} + +- (void)scrollToRow:(NSUInteger)row inSection:(NSUInteger)section atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated { + NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:section]; + [self scrollToRowAtIndexPath:indexPath atScrollPosition:scrollPosition animated:animated]; +} + +- (void)insertRowAtIndexPath:(NSIndexPath *)indexPath withRowAnimation:(UITableViewRowAnimation)animation { + [self insertRowsAtIndexPaths:@[indexPath] withRowAnimation:animation]; +} + +- (void)insertRow:(NSUInteger)row inSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation { + NSIndexPath *toInsert = [NSIndexPath indexPathForRow:row inSection:section]; + [self insertRowAtIndexPath:toInsert withRowAnimation:animation]; +} + +- (void)reloadRowAtIndexPath:(NSIndexPath *)indexPath withRowAnimation:(UITableViewRowAnimation)animation { + [self reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:animation]; +} + +- (void)reloadRow:(NSUInteger)row inSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation { + NSIndexPath *toReload = [NSIndexPath indexPathForRow:row inSection:section]; + [self reloadRowAtIndexPath:toReload withRowAnimation:animation]; +} + +- (void)deleteRowAtIndexPath:(NSIndexPath *)indexPath withRowAnimation:(UITableViewRowAnimation)animation { + [self deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:animation]; +} + +- (void)deleteRow:(NSUInteger)row inSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation { + NSIndexPath *toDelete = [NSIndexPath indexPathForRow:row inSection:section]; + [self deleteRowAtIndexPath:toDelete withRowAnimation:animation]; +} + +- (void)insertSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation { + NSIndexSet *sections = [NSIndexSet indexSetWithIndex:section]; + [self insertSections:sections withRowAnimation:animation]; +} + +- (void)deleteSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation { + NSIndexSet *sections = [NSIndexSet indexSetWithIndex:section]; + [self deleteSections:sections withRowAnimation:animation]; +} + +- (void)reloadSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation { + NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex:section]; + [self reloadSections:indexSet withRowAnimation:animation]; +} + +- (void)clearSelectedRowsAnimated:(BOOL)animated { + NSArray *indexs = [self indexPathsForSelectedRows]; + [indexs enumerateObjectsUsingBlock:^(NSIndexPath* path, NSUInteger idx, BOOL *stop) { + [self deselectRowAtIndexPath:path animated:animated]; + }]; +} + +@end -- Gitblit v1.8.0