From 335dc55ff02af279ccd605b159b31d47b6b13108 Mon Sep 17 00:00:00 2001 From: Alexander Melanchenko Date: Wed, 19 Jul 2017 17:55:15 +0300 Subject: [PATCH] clean --- ios/RNTBgImage/RNTBgImage.m | 25 +++---------------------- ios/RNTBgImage/RNTBgImageManager.m | 16 ---------------- package.json | 5 ++--- 3 files changed, 5 insertions(+), 41 deletions(-) diff --git a/ios/RNTBgImage/RNTBgImage.m b/ios/RNTBgImage/RNTBgImage.m index 0732bd8..a4e2e3e 100644 --- a/ios/RNTBgImage/RNTBgImage.m +++ b/ios/RNTBgImage/RNTBgImage.m @@ -9,19 +9,8 @@ #import #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 @@ -29,31 +18,23 @@ @implementation RNTBgImage - (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 diff --git a/ios/RNTBgImage/RNTBgImageManager.m b/ios/RNTBgImage/RNTBgImageManager.m index a5e545b..0bbdc8b 100644 --- a/ios/RNTBgImage/RNTBgImageManager.m +++ b/ios/RNTBgImage/RNTBgImageManager.m @@ -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; diff --git a/package.json b/package.json index 3fe2481..d1ba8fd 100644 --- a/package.json +++ b/package.json @@ -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",