Skip to content
This repository was archived by the owner on Nov 29, 2022. It is now read-only.

Commit b5b9216

Browse files
subdigitalIgnacio Romero Zurbuchen
authored andcommitted
Set fade property before adding view (#328)
The fade setting is checked on `- didMoveToSuperview`, but we don't set this value until _after_ the view is already added to the hierarchy. Moving this setting up allows the fade to work.
1 parent 0043d58 commit b5b9216

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Source/UIScrollView+EmptyDataSet.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,9 @@ - (void)dzn_reloadEmptyDataSet
448448

449449
DZNEmptyDataSetView *view = self.emptyDataSetView;
450450

451+
// Configure empty dataset fade in display
452+
view.fadeInOnDisplay = [self dzn_shouldFadeIn];
453+
451454
if (!view.superview) {
452455
// Send the view all the way to the back, in case a header and/or footer is present, as well as for sectionHeaders or any other content
453456
if (([self isKindOfClass:[UITableView class]] || [self isKindOfClass:[UICollectionView class]]) && self.subviews.count > 1) {
@@ -527,9 +530,6 @@ - (void)dzn_reloadEmptyDataSet
527530
// Configure empty dataset userInteraction permission
528531
view.userInteractionEnabled = [self dzn_isTouchAllowed];
529532

530-
// Configure empty dataset fade in display
531-
view.fadeInOnDisplay = [self dzn_shouldFadeIn];
532-
533533
[view setupConstraints];
534534

535535
[UIView performWithoutAnimation:^{

0 commit comments

Comments
 (0)