Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnd committed Jul 19, 2017
1 parent 79d0b20 commit 335dc55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 41 deletions.
25 changes: 3 additions & 22 deletions ios/RNTBgImage/RNTBgImage.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,32 @@
#import <React/RCTLog.h>
#import "RNTBgImage.h"

/*
//source: https://kylewbanks.com/blog/Android-iOS-Repeating-Background-Image
UIView *myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
//Repeating background image
UIImage *repeatingImage = [UIImage imageNamed:@"my_background_image"];
UIColor *repeatingBackground = [UIColor colorWithPatternImage:repeatingImage];
[myView setBackgroundColor:repeatingBackground];
*/

@implementation RNTBgImage
{
//UIImage *_repeatingImage;
//UIColor *_repeatingBackground;
}

#pragma mark - UIViewHierarchy methods

- (instancetype)init
{
if ((self = [super init])) {
//make initializations here...
}
return self;
}

- (void)layoutSubviews
{
//RCTLogInfo(@"~~~####### layoutSubviews %@", self.drawable);
[super layoutSubviews];
//RCTLogInfo(@"*** layoutSubviews");
[self drawBitmap];
[super layoutSubviews];
}

- (void)drawBitmap
{
//RCTLogInfo(@"~~~####### drawBitmap %@", self.drawable);
//_repeatingImage = [UIImage imageNamed:@"wavy_line"];
//RCTLogInfo(@"*** drawBitmap %@", self.drawable);
UIImage *_repeatingImage = [UIImage imageNamed:self.drawable];
UIColor *_repeatingBackground = [UIColor colorWithPatternImage:_repeatingImage];
[self setBackgroundColor:_repeatingBackground];
}

//- (void)setImageName:(NSString *)imageName
//{
// self.drawable = imageName;
// [self setNeedsDisplay];
//}

@end
16 changes: 0 additions & 16 deletions ios/RNTBgImage/RNTBgImageManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,6 @@ @implementation RNTBgImageManager

#pragma mark - Lifecycle

//- (instancetype)init
//{
// if ((self = [super init])) {
// self.bgImage = nil;
// }
// return self;
//}
//
//- (UIView *)view
//{
// if (!self.bgImage) {
// self.bgImage = [[RNTBgImage alloc] init];
// }
// return self.bgImage;
//}

- (UIView *)view
{
RNTBgImage * theView;
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"name": "react-native-bgimage",
"version": "1.2.0",
"version": "1.3.0",
"description": "Background image view for react native",
"keywords": [ "react", "react native", "react-native", "react-component", "image", "background" ],
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "npm pack && mv react-native-bgimage-1.2.0.tgz ..",
"dev-build": "npm pack && mv react-native-bgimage-1.2.0.tgz .. && cd ../.. && npm i react-native-bgimage"
"build": "npm pack && mv react-native-bgimage-1.2.0.tgz .. && cd ../.. && npm i react-native-bgimage"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 335dc55

Please sign in to comment.