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

Commit

Permalink
- iOS hot fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
prscms committed Jun 12, 2018
1 parent 02e470b commit 7ba0b8b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 deletions.
1 change: 1 addition & 0 deletions RNIconic.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class RNIconic extends Component {
disable={this.props.disabled}
shape={this.props.shape}
color={this.props.color}
selection={this.props.selection}
onChange={this._onChange}
/>
);
Expand Down
35 changes: 23 additions & 12 deletions ios/RNIconic.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,30 @@

@implementation RNIconic

- (dispatch_queue_t)methodQueue
{
- (dispatch_queue_t)methodQueue {
return dispatch_get_main_queue();
}


- (id)init {
self = [super init];
if (self) {
self.selection = 0;
self.shapes = [[NSArray alloc] init];
}

return self;
}


RCT_EXPORT_MODULE()

- (VBFPopFlatButton *)view {
VBFPopFlatButton *iconicButton = [[VBFPopFlatButton alloc] init];
[iconicButton addTarget:self
action:@selector(handleSelection:)
forControlEvents:UIControlEventTouchUpInside];

forControlEvents:UIControlEventTouchUpInside];
return iconicButton;
}

Expand Down Expand Up @@ -56,7 +67,7 @@ - (VBFPopFlatButton *)view {


-(void)handleSelection:(VBFPopFlatButton*)iconicButton {

NSNumber *selection = [self selection];
NSArray *shapes = [self shapes];

Expand All @@ -66,17 +77,17 @@ -(void)handleSelection:(VBFPopFlatButton*)iconicButton {
shape = [self getShape: [shapes objectAtIndex: ([selection intValue] + 1)]];
self.selection = [NSNumber numberWithInt: [selection intValue] + 1];
} else {
shape = [self getShape: 0];
shape = [self getShape: [shapes objectAtIndex: 0]];
self.selection = [NSNumber numberWithInt: 0];
}

[iconicButton animateToType: shape];

NSDictionary *event = @{
@"target": iconicButton.reactTag,
@"value": self.selection,
@"name": @"tap",
};
@"target": iconicButton.reactTag,
@"value": self.selection,
@"name": @"tap",
};
[self.bridge.eventDispatcher sendInputEventWithName:@"topChange" body:event];
}

Expand Down Expand Up @@ -152,4 +163,4 @@ + (UIColor *) colorFromHexCode:(NSString *)hexString {
}

@end

16 changes: 0 additions & 16 deletions ios/RNIconic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
58B511D71A9E6C8500147676 /* Sources */,
58B511D81A9E6C8500147676 /* Frameworks */,
58B511D91A9E6C8500147676 /* CopyFiles */,
6B5B4B263DABDFCE817958AA /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -204,21 +203,6 @@
/* End PBXReferenceProxy section */

/* Begin PBXShellScriptBuildPhase section */
6B5B4B263DABDFCE817958AA /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RNIconic/Pods-RNIconic-resources.sh\"\n";
showEnvVarsInLog = 0;
};
A70399F1E189608FAD3B9070 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down

0 comments on commit 7ba0b8b

Please sign in to comment.