Skip to content

Commit

Permalink
Supported sf symbols for back image on old arch
Browse files Browse the repository at this point in the history
  • Loading branch information
grahammendick committed Nov 17, 2024
1 parent 2b1074a commit b4b9bbf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ - (void)loadImage
return;
}
}
_backImageLoading = !![uri length];
_backImageLoading = YES;
[_imageLoader loadImageWithURLRequest:NSURLRequestFromImageSource(_imageSource) size:CGSizeMake(_imageSource.size.width, _imageSource.size.height) scale:_imageSource.scale clipped:NO resizeMode:RCTResizeModeCover progressBlock:^(int64_t progress, int64_t total){} partialLoadBlock:^(UIImage *image){} completionBlock:^(NSError *error, UIImage *image) {
dispatch_async(dispatch_get_main_queue(), ^{
if (self.backImageDidLoadBlock) {
Expand Down
10 changes: 9 additions & 1 deletion NavigationReactNative/src/ios/NVNavigationBarView.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,16 @@ - (id)initWithBridge:(RCTBridge *)bridge

- (void)setBackImage:(RCTImageSource *)source
{
_backImageLoading = !!source;
if (!!source) {
if (@available(iOS 13.0, *)) {
UIImage *sfSymbol = [UIImage systemImageNamed:[source.request.URL lastPathComponent]];
if (sfSymbol) {
_backImage = sfSymbol;
[self updateStyle];
return;
}
}
_backImageLoading = YES;
[[_bridge moduleForName:@"ImageLoader"] loadImageWithURLRequest:source.request size:source.size scale:source.scale clipped:NO resizeMode:RCTResizeModeCover progressBlock:^(int64_t progress, int64_t total){} partialLoadBlock:^(UIImage *image){} completionBlock:^(NSError *error, UIImage *image) {
dispatch_async(dispatch_get_main_queue(), ^{
if (self.backImageDidLoadBlock) {
Expand Down

0 comments on commit b4b9bbf

Please sign in to comment.