Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Sources/Controllers/Base/OABaseNavbarViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ typedef NS_ENUM(NSInteger, EOABaseNavbarStyle)
- (void)updateAppearance;
- (void)updateNavbar;
- (void)updateUI:(BOOL)animated;
- (void)updateUIWithoutData;
- (void)updateUI:(BOOL)animated completion:(void (^)(void))completion;
- (void)updateUIWithoutData:(void (^)(void))completion;
- (void)refreshUI;

- (UIBarButtonItem *)createRightNavbarButton:(NSString *)title
Expand Down
24 changes: 19 additions & 5 deletions Sources/Controllers/Base/OABaseNavbarViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,22 @@ - (void)updateNavbar

- (void)updateUI:(BOOL)animated
{
[self reloadData:animated];
[self updateUI:animated completion:nil];
}

- (void)updateUI:(BOOL)animated completion:(void (^)(void))completion
{
[self reloadData:animated completion:completion];
[self refreshUI];
}

- (void)updateUIWithoutData
- (void)updateUIWithoutData:(void (^)(void))completion
{
[self.tableView reconfigureRowsAtIndexPaths:self.tableView.indexPathsForVisibleRows];
[self.tableView performBatchUpdates:^{
[self.tableView reconfigureRowsAtIndexPaths:self.tableView.indexPathsForVisibleRows];
if (completion)
completion();
} completion:nil];
[self refreshUI];
}

Expand All @@ -271,7 +280,7 @@ - (void)refreshUI
[self updateNavbar];
}

- (void) reloadData:(BOOL)animated
- (void) reloadData:(BOOL)animated completion:(void (^ __nullable)(void))completion
{
[self generateData];
if (animated)
Expand All @@ -283,7 +292,12 @@ - (void) reloadData:(BOOL)animated
{
[self.tableView reloadData];
}
completion:nil];
completion:^(BOOL finished)
{
if (completion)
completion();
}
];
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class DestinationsListViewController: OABaseButtonsViewController {
if tableData.hasChanged || tableData.sectionCount() == 0 {
updateUI(true)
} else {
updateUIWithoutData()
updateUIWithoutData(nil)
}
}
}
Expand Down
Loading