Skip to content

Commit d9461a9

Browse files
committed
使用 nil coalescing 减少行数
如题
1 parent cca04cb commit d9461a9

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

MJRefresh/Custom/Header/MJRefreshNormalHeader.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ @implementation MJRefreshNormalHeader
2020
- (UIImageView *)arrowView
2121
{
2222
if (!_arrowView) {
23-
UIImage *image = [UIImage imageNamed:MJRefreshSrcName(@"arrow.png")];
24-
if (!image) {
25-
image = [UIImage imageNamed:MJRefreshFrameworkSrcName(@"arrow.png")];
26-
}
23+
UIImage *image = [UIImage imageNamed:MJRefreshSrcName(@"arrow.png")] ?: [UIImage imageNamed:MJRefreshFrameworkSrcName(@"arrow.png")];
2724
UIImageView *arrowView = [[UIImageView alloc] initWithImage:image];
2825
[self addSubview:_arrowView = arrowView];
2926
}

0 commit comments

Comments
 (0)