Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
* [iOS] bugfix that waterfall component cannot scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
acton393 authored and Phil committed Apr 19, 2018
1 parent a8de438 commit 44cf4f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ - (void)save:(WXKeepAliveCallback)resultCallback

// iOS 11 needs a NSPhotoLibraryUsageDescription key for permission
if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0")) {
if (!info[@"NSPhotoLibraryUsageDescription"]) {
if (!info[@"NSPhotoLibraryAddUsageDescription"]) {
if (resultCallback) {
resultCallback(@{
@"success" : @(false),
@"errorDesc": @"This maybe crash above iOS 10 because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data."
@"errorDesc": @"This maybe crash above iOS 11 because it attempted to save image without a usage description. The app's Info.plist must contain an NSPhotoLibraryAddUsageDescription key with a string value explaining to the user how the app uses this data."
}, NO);
}
return;
Expand Down
6 changes: 5 additions & 1 deletion ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ - (void)viewDidLoad
scrollView.showsHorizontalScrollIndicator = _showScrollBar;
scrollView.scrollEnabled = _scrollable;
scrollView.pagingEnabled = _pagingEnabled;
scrollView.bounces = _bounces;

if (scrollView.bounces != _bounces) {
scrollView.bounces = _bounces;
}

if (_alwaysScrollableHorizontal) {
scrollView.alwaysBounceHorizontal = [WXConvert BOOL:_alwaysScrollableHorizontal];
}
Expand Down

0 comments on commit 44cf4f5

Please sign in to comment.