Skip to content

Commit

Permalink
Patch v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
xerdnu committed Aug 16, 2024
1 parent 07c9f1e commit 914aafc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [1.0.2] (2024-08-16)

#### Bug Fixes

- Fixed a bug where images was not sent into view on iOS.

## [1.0.1] (2024-08-16)

#### Improvements
Expand Down
12 changes: 8 additions & 4 deletions ios/BlastedViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#import "BlastedImageModule.h"
#import <React/RCTViewManager.h>
#import <React/RCTConvert.h>
#import <React/RCTBridge.h>
#import <React/RCTBridgeModule.h>
#import <SDWebImage/SDWebImage.h>

@implementation BlastedViewManager
Expand All @@ -17,9 +19,12 @@ - (BOOL)isEmptyString:(NSString *)str {
return (!str || ![str isKindOfClass:[NSString class]] || [str isEqualToString:@""]);
}

RCT_CUSTOM_VIEW_PROPERTY(source, NSString, UIImageView) {
RCT_CUSTOM_VIEW_PROPERTY(source, NSDictionary, UIImageView) {

if ([self isEmptyString:json]) {
BlastedImageModule *blastedImageModule = [self.bridge moduleForClass:[BlastedImageModule class]];

if ([self isEmptyString:json[@"uri"]]) {
[blastedImageModule sendEventWithName:@"BlastedEventLog" message:@"Source is empty"];
[view setHidden:YES];
return;
}
Expand All @@ -28,9 +33,8 @@ - (BOOL)isEmptyString:(NSString *)str {
BOOL hybridAssets = [RCTConvert BOOL:json[@"hybridAssets"]];
NSString *cloudUrl = [RCTConvert NSString:json[@"cloudUrl"]];

BlastedImageModule *blastedImageModule = [[BlastedImageModule alloc] init];
NSURL *url = [blastedImageModule prepareUrl:uri hybridAssets:hybridAssets cloudUrl:cloudUrl showLog:NO];

if (url != nil && ![url.absoluteString isEqualToString:@""]) {
[view sd_setImageWithURL:url];
[view setHidden:NO];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-blasted-image",
"version": "1.0.1",
"version": "1.0.2",
"description": "A simple yet powerful image component for React Native, powered by Glide and SDWebImage",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 914aafc

Please sign in to comment.