Skip to content

Commit

Permalink
fix bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
sshiqiao committed Dec 21, 2018
1 parent 394f5cc commit 5c620e5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Douyin.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "-test.douyin";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -960,6 +961,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "-test.douyin";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
Binary file not shown.
9 changes: 8 additions & 1 deletion Douyin/Controller/AwemeList/AwemeListController.m
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,15 @@ - (void)loadData:(NSInteger)pageIndex pageSize:(NSInteger)pageSize {
NSArray<Aweme *> *array = response.data;
if(array.count > 0) {
wself.pageIndex++;
[wself.tableView beginUpdates];
[wself.data addObjectsFromArray:array];
[wself.tableView reloadData];
NSMutableArray<NSIndexPath *> *indexPaths = [NSMutableArray array];
for(NSInteger row = wself.data.count - array.count; row<wself.data.count; row++) {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:0];
[indexPaths addObject:indexPath];
}
[wself.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:NO];
[wself.tableView endUpdates];
[wself.loadMore endLoading];
}else {
[wself.loadMore loadingAll];
Expand Down
13 changes: 6 additions & 7 deletions Douyin/Controller/UserHomePage/UserHomePageController.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ - (instancetype)init {
}


- (void)viewDidLoad {
[super viewDidLoad];
[self initCollectionView];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onNetworkStatusChange:) name:NetworkStatesChangeNotification object:nil];
}

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self setNavigationBarTitleColor:ColorClear];
Expand All @@ -78,13 +84,6 @@ - (void)viewWillAppear:(BOOL)animated {
[self setStatusBarHidden:NO];
}

- (void)viewDidLoad {
[super viewDidLoad];
[self initCollectionView];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onNetworkStatusChange:) name:NetworkStatesChangeNotification object:nil];
}


- (void)initCollectionView {
_itemWidth = (ScreenWidth - (CGFloat)(((NSInteger)(ScreenWidth)) % 3) ) / 3.0f - 1.0f;
_itemHeight = _itemWidth * 1.35f;
Expand Down

0 comments on commit 5c620e5

Please sign in to comment.