├── .gitignore
├── .npmignore
├── BEMCheckBox.ios.js
├── BEMCheckBox
├── BEMAnimationManager.h
├── BEMAnimationManager.m
├── BEMCheckBox.h
├── BEMCheckBox.m
├── BEMPathManager.h
└── BEMPathManager.m
├── Example
├── .flowconfig
├── .gitignore
├── .watchmanconfig
├── index.ios.js
├── ios
│ ├── CheckBox.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── CheckBox.xcscheme
│ └── CheckBox
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Base.lproj
│ │ └── LaunchScreen.xib
│ │ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── app-icon-iphone@2x.png
│ │ │ ├── app-icon-iphone@3x.png
│ │ │ ├── app-icon-setting@2x.png
│ │ │ ├── app-icon-setting@3x.png
│ │ │ ├── app-icon-spotlight@2x.png
│ │ │ └── app-icon-spotlight@3x.png
│ │ ├── Info.plist
│ │ └── main.m
└── package.json
├── README.md
├── RNBEMCheckBox.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── rifat.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── xcuserdata
│ └── rifat.xcuserdatad
│ └── xcschemes
│ ├── RNBEMCheckBox.xcscheme
│ └── xcschememanagement.plist
├── RNBEMCheckBox
├── RNBEMCheckBoxManager.h
└── RNBEMCheckBoxManager.m
├── package.json
├── preview.gif
└── react-native-bem-check-box.podspec
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules/
2 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | **/build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | **/xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | **/DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 | project.xcworkspace
24 |
--------------------------------------------------------------------------------
/BEMCheckBox.ios.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @providesModule BEMCheckBox
3 | * @flow
4 | */
5 | 'use strict';
6 | import React, { Component } from 'react';
7 | import { StyleSheet, requireNativeComponent } from 'react-native';
8 | import PropTypes from 'prop-types';
9 |
10 | const RNBEMCheckBox = requireNativeComponent('RNBEMCheckBox', null);
11 |
12 | const BOX_TYPES = ['circle', 'square'];
13 | const ANIMATION_TYPES = ['stroke', 'fill', 'bounce', 'flat', 'one-stroke', 'fade'];
14 |
15 | export default class BEMCheckBox extends Component {
16 |
17 | static propTypes = {
18 | value: PropTypes.bool,
19 | lineWidth: PropTypes.number,
20 | hideBox: PropTypes.bool,
21 | boxType: PropTypes.oneOf(BOX_TYPES),
22 | tintColor: PropTypes.string,
23 | onCheckColor: PropTypes.string,
24 | onFillColor: PropTypes.string,
25 | onTintColor: PropTypes.string,
26 | animationDuration: PropTypes.number,
27 | onAnimationType: PropTypes.oneOf(ANIMATION_TYPES),
28 | offAnimationType: PropTypes.oneOf(ANIMATION_TYPES),
29 | onValueChange: PropTypes.func,
30 | onAnimationEnd: PropTypes.func,
31 | };
32 |
33 | static defaultProps = {
34 | };
35 |
36 | render () {
37 | const { style, ...rest} = this.props;
38 | return (
39 |
44 | );
45 | }
46 |
47 | _onChange = (event: Object): void => {
48 | const { name, value } = event.nativeEvent;
49 | const { onValueChange, onAnimationEnd } = this.props;
50 | switch (name) {
51 | case 'tap':
52 | onValueChange && onValueChange(value);
53 | break;
54 | case 'animation':
55 | onAnimationEnd && onAnimationEnd(value);
56 | break;
57 | }
58 | };
59 |
60 | }
61 |
62 | const styles = StyleSheet.create({
63 | checkbox: {
64 | height: 50,
65 | width: 50,
66 | backgroundColor: 'transparent',
67 | },
68 | });
69 |
--------------------------------------------------------------------------------
/BEMCheckBox/BEMAnimationManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // BEMAnimationManager.h
3 | // CheckBox
4 | //
5 | // Created by Bobo on 9/19/15.
6 | // Copyright (c) 2015 Boris Emorine. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 |
11 | /** Animation object used by BEMCheckBox to generate animations.
12 | */
13 | @interface BEMAnimationManager : NSObject
14 |
15 | /** The duration of the animation created by the BEMAnimationManager object.
16 | */
17 | @property (nonatomic) CGFloat animationDuration;
18 |
19 | /** Designated initializer.
20 | * @param animationDuration The duration of the animations created with the BEMAnimationManager object.
21 | * @return Returns the a fully initialized BEMAnimationManager object.
22 | */
23 | - (instancetype)initWithAnimationDuration:(CGFloat)animationDuration;
24 |
25 | /** Returns a CABasicAnimation which the stroke.
26 | * @param reverse The direction of the animation. Set to YES if the animation should go from opacity 0 to 1, or NO for the opposite.
27 | * @return Returns the CABasicAnimation object.
28 | */
29 | - (CABasicAnimation *)strokeAnimationReverse:(BOOL)reverse;
30 |
31 | /** Returns a CABasicAnimation which animates the opacity.
32 | * @param reverse The direction of the animation. Set to YES if the animation should go from opacity 0 to 1, or NO for the opposite.
33 | * @return Returns the CABasicAnimation object.
34 | */
35 | - (CABasicAnimation *)opacityAnimationReverse:(BOOL)reverse;
36 |
37 | /** Returns a CABasicAnimation which animates between two paths.
38 | * @param fromPath The path to transform (morph) from.
39 | * @param toPath The path to transform (morph) to.
40 | * @return Returns the CABasicAnimation object.
41 | */
42 | - (CABasicAnimation *)morphAnimationFromPath:(UIBezierPath *)fromPath toPath:(UIBezierPath *)toPath ;
43 |
44 | /** Animation engine to create a fill animation.
45 | * @param bounces The number of bounces for the animation.
46 | * @param amplitue How far does the animation bounce.
47 | * @param reserve Flag to track if the animation should fill or empty the layer.
48 | * @return Returns the CAKeyframeAnimation object.
49 | */
50 | - (CAKeyframeAnimation *)fillAnimationWithBounces:(NSUInteger)bounces amplitude:(CGFloat)amplitude reverse:(BOOL)reverse;
51 |
52 | @end
53 |
--------------------------------------------------------------------------------
/BEMCheckBox/BEMAnimationManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // BEMAnimationManager.m
3 | // CheckBox
4 | //
5 | // Created by Bobo on 9/19/15.
6 | // Copyright (c) 2015 Boris Emorine. All rights reserved.
7 | //
8 |
9 | #import "BEMAnimationManager.h"
10 |
11 | @implementation BEMAnimationManager
12 |
13 | - (instancetype)initWithAnimationDuration:(CGFloat)animationDuration {
14 | self = [super init];
15 | if (self) {
16 | _animationDuration = animationDuration;
17 | }
18 |
19 | return self;
20 | }
21 |
22 | - (CABasicAnimation *)strokeAnimationReverse:(BOOL)reverse {
23 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];
24 | if (reverse) {
25 | animation.fromValue = [NSNumber numberWithFloat:1.0];
26 | animation.toValue = [NSNumber numberWithFloat:0.0];
27 | } else {
28 | animation.fromValue = [NSNumber numberWithFloat:0.0];
29 | animation.toValue = [NSNumber numberWithFloat:1.0];
30 | }
31 | animation.duration = self.animationDuration;
32 | animation.removedOnCompletion = NO;
33 | animation.fillMode = kCAFillModeForwards;
34 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
35 |
36 | return animation;
37 | }
38 |
39 | - (CABasicAnimation *)opacityAnimationReverse:(BOOL)reverse {
40 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"opacity"];
41 | if (reverse) {
42 | animation.fromValue = [NSNumber numberWithFloat:1.0];
43 | animation.toValue = [NSNumber numberWithFloat:0.0];
44 | } else {
45 | animation.fromValue = [NSNumber numberWithFloat:0.0];
46 | animation.toValue = [NSNumber numberWithFloat:1.0];
47 | }
48 | animation.duration = self.animationDuration;
49 | animation.removedOnCompletion = NO;
50 | animation.fillMode = kCAFillModeForwards;
51 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
52 |
53 | return animation;
54 | }
55 |
56 | - (CABasicAnimation *)morphAnimationFromPath:(UIBezierPath *)fromPath toPath:(UIBezierPath *)toPath {
57 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"path"];
58 | animation.duration = self.animationDuration;
59 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
60 |
61 | animation.fromValue = (id)fromPath.CGPath;
62 | animation.toValue = (id)toPath.CGPath;
63 |
64 | return animation;
65 | }
66 |
67 | - (CAKeyframeAnimation *)fillAnimationWithBounces:(NSUInteger)bounces amplitude:(CGFloat)amplitude reverse:(BOOL)reverse {
68 | NSMutableArray *values = [NSMutableArray new];
69 | NSMutableArray *keyTimes = [NSMutableArray new];
70 |
71 | if (reverse) {
72 | [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1, 1, 1)]];
73 | } else {
74 | [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0, 0, 0)]];
75 | }
76 |
77 | [keyTimes addObject:@0.0];
78 |
79 | for (NSUInteger i = 1; i <= bounces; i++) {
80 | CGFloat scale = (i % 2) ? (1 + amplitude/i) : (1 - amplitude/i);
81 | CGFloat time = i * 1.0/(bounces + 1);
82 |
83 | [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(scale, scale, scale)]];
84 | [keyTimes addObject:[NSNumber numberWithFloat:time]];
85 | }
86 |
87 | if (reverse) {
88 | [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.0001, 0.0001, 0.0001)]];
89 | } else {
90 | [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1, 1, 1)]];
91 | }
92 |
93 | [keyTimes addObject:@1.0];
94 |
95 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
96 | animation.values = values;
97 | animation.keyTimes = keyTimes;
98 | animation.removedOnCompletion = NO;
99 | animation.fillMode = kCAFillModeForwards;
100 | animation.duration = self.animationDuration;
101 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
102 |
103 | return animation;
104 | }
105 |
106 | - (void)dealloc {
107 | }
108 |
109 | @end
110 |
--------------------------------------------------------------------------------
/BEMCheckBox/BEMCheckBox.h:
--------------------------------------------------------------------------------
1 | //
2 | // BEMCheckBox.h
3 | // CheckBox
4 | //
5 | // Created by Bobo on 8/29/15.
6 | // Copyright (c) 2015 Boris Emorine. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 |
11 | @protocol BEMCheckBoxDelegate;
12 |
13 | // Tell the compiler to assume that no method should have a NULL value
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /** Tasteful Checkbox for iOS.
17 | */
18 | IB_DESIGNABLE @interface BEMCheckBox : UIView
19 |
20 | /** The different type of boxes available.
21 | * @see boxType
22 | */
23 | typedef NS_ENUM(NSInteger, BEMBoxType) {
24 | /** Circled box.
25 | */
26 | BEMBoxTypeCircle,
27 |
28 | /** Squared box.
29 | */
30 | BEMBoxTypeSquare
31 | };
32 |
33 | /** The different type of animations available.
34 | * @see onAnimationType and offAnimationType.
35 | */
36 | typedef NS_ENUM(NSInteger, BEMAnimationType) {
37 | /** Animates the box and the check as if they were drawn.
38 | * Should be used with a clear colored onFillColor property.
39 | */
40 | BEMAnimationTypeStroke,
41 |
42 | /** When tapped, the checkbox is filled from its center.
43 | * Should be used with a colored onFillColor property.
44 | */
45 | BEMAnimationTypeFill,
46 |
47 | /** Animates the check mark with a bouncy effect.
48 | */
49 | BEMAnimationTypeBounce,
50 |
51 | /** Morphs the checkmark from a line.
52 | * Should be used with a colored onFillColor property.
53 | */
54 | BEMAnimationTypeFlat,
55 |
56 | /** Animates the box and check as if they were drawn in one continuous line.
57 | * Should be used with a clear colored onFillColor property.
58 | */
59 | BEMAnimationTypeOneStroke,
60 |
61 | /** When tapped, the checkbox is fading in or out (opacity).
62 | */
63 | BEMAnimationTypeFade
64 | };
65 |
66 | /** The object that acts as the delegate of the receiving check box.
67 | * @discussion The delegate must adopt the \p BEMCheckBoxDelegate protocol. The delegate is not retained.
68 | */
69 | @property (nonatomic, weak) IBOutlet id delegate;
70 |
71 | /** This property allows you to retrieve and set (without animation) a value determining whether the BEMCheckBox object is On or Off.
72 | * Default to NO.
73 | */
74 | @property (nonatomic) IBInspectable BOOL on;
75 |
76 | /** The width of the lines of the check mark and the box. Default to 2.0.
77 | */
78 | @property (nonatomic) IBInspectable CGFloat lineWidth;
79 |
80 | /** The duration in seconds of the animation when the check box switches from on and off. Default to 0.5.
81 | */
82 | @property (nonatomic) IBInspectable CGFloat animationDuration;
83 |
84 | /** BOOL to control if the box should be hidden or not. Defaults to NO.
85 | */
86 | @property (nonatomic) IBInspectable BOOL hideBox;
87 |
88 | /** The color of the line around the box when it is On.
89 | */
90 | @property (strong, nonatomic) IBInspectable UIColor *onTintColor;
91 |
92 | /** The color of the inside of the box when it is On.
93 | */
94 | @property (strong, nonatomic) IBInspectable UIColor *onFillColor;
95 |
96 | /** The color of the check mark when it is On.
97 | */
98 | @property (strong, nonatomic) IBInspectable UIColor *onCheckColor;
99 |
100 | /** The color of the box when the checkbox is Off.
101 | */
102 | @property (strong, nonatomic) IBInspectable UIColor *tintColor;
103 |
104 | /** The type of box.
105 | * @see BEMBoxType.
106 | */
107 | @property (nonatomic) BEMBoxType boxType;
108 |
109 | /** The animation type when the check mark gets set to On.
110 | * @warning Some animations might not look as intended if the different colors of the control are not appropriatly configured.
111 | * @see BEMAnimationType.
112 | */
113 | @property (nonatomic) BEMAnimationType onAnimationType;
114 |
115 | /** The animation type when the check mark gets set to Off.
116 | * @warning Some animations might not look as intended if the different colors of the control are not appropriatly configured.
117 | * @see BEMAnimationType.
118 | */
119 | @property (nonatomic) BEMAnimationType offAnimationType;
120 |
121 | /** Set the state of the check box to On or Off, optionally animating the transition.
122 | */
123 | - (void)setOn:(BOOL)on animated:(BOOL)animated;
124 |
125 | /** Forces a redraw of the entire check box.
126 | * The current value of On is kept.
127 | */
128 | - (void)reload;
129 |
130 | @end
131 |
132 |
133 | /** The BEMCheckBoxDelegate protocol. Used to receive life cycle events.
134 | */
135 | @protocol BEMCheckBoxDelegate
136 |
137 | @optional
138 |
139 | /** Sent to the delegate every time the check box gets tapped.
140 | * @discussion This method gets triggered after the properties are updated (on), but before the animations, if any, are completed.
141 | * @seealso animationDidStopForCheckBox:
142 | * @param checkBox: The BEMCheckBox instance that has been tapped.
143 | */
144 | - (void)didTapCheckBox:(BEMCheckBox*)checkBox;
145 |
146 |
147 | /** Sent to the delegate every time the check box finishes being animated.
148 | * @discussion This method gets triggered after the properties are updated (on), and after the animations are completed. It won't be triggered if no animations are started.
149 | * @seealso didTapCheckBox:
150 | * @param checkBox: The BEMCheckBox instance that was animated.
151 | */
152 | - (void)animationDidStopForCheckBox:(BEMCheckBox *)checkBox;
153 |
154 | @end
155 |
156 | NS_ASSUME_NONNULL_END
157 |
--------------------------------------------------------------------------------
/BEMCheckBox/BEMCheckBox.m:
--------------------------------------------------------------------------------
1 | //
2 | // BEMCheckBox.m
3 | // CheckBox
4 | //
5 | // Created by Bobo on 8/29/15.
6 | // Copyright (c) 2015 Boris Emorine. All rights reserved.
7 | //
8 |
9 | #import "BEMCheckBox.h"
10 | #import "BEMAnimationManager.h"
11 | #import "BEMPathManager.h"
12 |
13 | @interface BEMCheckBox ()
14 |
15 | /** The layer where the box is drawn when the check box is set to On.
16 | */
17 | @property (strong, nonatomic) CAShapeLayer *onBoxLayer;
18 |
19 | /** The layer where the box is drawn when the check box is set to Off.
20 | */
21 | @property (strong, nonatomic) CAShapeLayer *offBoxLayer;
22 |
23 | /** The layer where the check mark is drawn when the check box is set to On.
24 | */
25 | @property (strong, nonatomic) CAShapeLayer *checkMarkLayer;
26 |
27 | /** The BEMAnimationManager object used to generate animations.
28 | */
29 | @property (strong, nonatomic) BEMAnimationManager *animationManager;
30 |
31 | /** The BEMPathManager object used to generate paths.
32 | */
33 | @property (strong, nonatomic) BEMPathManager *pathManager;
34 |
35 | @end
36 |
37 | @implementation BEMCheckBox
38 |
39 | #pragma mark Initialization
40 | - (instancetype)initWithFrame:(CGRect)frame {
41 | self = [super initWithFrame:frame];
42 | if (self) [self commonInit];
43 | return self;
44 | }
45 |
46 | - (instancetype)initWithCoder:(NSCoder *)coder {
47 | self = [super initWithCoder:coder];
48 | if (self) [self commonInit];
49 | return self;
50 | }
51 |
52 | - (void)commonInit {
53 | // Default values
54 | _on = NO;
55 | _hideBox = NO;
56 | _onTintColor = [UIColor colorWithRed:0 green:122.0/255.0 blue:255/255 alpha:1];
57 | _onFillColor = [UIColor clearColor];
58 | _onCheckColor = [UIColor colorWithRed:0 green:122.0/255.0 blue:255/255 alpha:1];
59 | _tintColor = [UIColor lightGrayColor];
60 | _lineWidth = 2.0;
61 | _animationDuration = 0.5;
62 | _onAnimationType = BEMAnimationTypeStroke;
63 | _offAnimationType = BEMAnimationTypeStroke;
64 | self.backgroundColor = [UIColor clearColor];
65 |
66 | [self initPathManager];
67 | [self initAnimationManager];
68 |
69 | [self addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapCheckBox:)]];
70 | }
71 |
72 | - (void)initPathManager {
73 | _pathManager = [BEMPathManager new];
74 | _pathManager.lineWidth = _lineWidth;
75 | _pathManager.boxType = _boxType;
76 | }
77 |
78 | - (void)initAnimationManager {
79 | _animationManager = [[BEMAnimationManager alloc] initWithAnimationDuration:_animationDuration];
80 | }
81 |
82 | - (void)layoutSubviews {
83 | self.pathManager.size = self.frame.size.height;
84 |
85 | [super layoutSubviews];
86 | }
87 |
88 | - (void)reload {
89 | [self.offBoxLayer removeFromSuperlayer];
90 | self.offBoxLayer = nil;
91 |
92 | [self.onBoxLayer removeFromSuperlayer];
93 | self.onBoxLayer = nil;
94 |
95 | [self.checkMarkLayer removeFromSuperlayer];
96 | self.checkMarkLayer = nil;
97 |
98 | [self setNeedsDisplay];
99 | [self layoutIfNeeded];
100 | }
101 |
102 | #pragma mark Setters
103 | - (void)setOn:(BOOL)on animated:(BOOL)animated {
104 | _on = on;
105 |
106 | [self drawEntireCheckBox];
107 |
108 | if (on) {
109 | if (animated) {
110 | [self addOnAnimation];
111 | }
112 | } else {
113 | if (animated) {
114 | [self addOffAnimation];
115 | } else {
116 | [self.onBoxLayer removeFromSuperlayer];
117 | [self.checkMarkLayer removeFromSuperlayer];
118 | }
119 | }
120 | }
121 |
122 | - (void)setOn:(BOOL)on {
123 | [self setOn:on animated:NO];
124 | }
125 |
126 | - (void)setAnimationDuration:(CGFloat)animationDuration {
127 | _animationDuration = animationDuration;
128 | _animationManager.animationDuration = animationDuration;
129 | }
130 |
131 | - (void)setBoxType:(BEMBoxType)boxType {
132 | _boxType = boxType;
133 | _pathManager.boxType = boxType;
134 | [self reload];
135 | }
136 |
137 | - (void)setLineWidth:(CGFloat)lineWidth {
138 | _lineWidth = lineWidth;
139 | _pathManager.lineWidth = lineWidth;
140 | [self reload];
141 | }
142 |
143 | - (void)setOffAnimationType:(BEMAnimationType)offAnimationType {
144 | _offAnimationType = offAnimationType;
145 | }
146 |
147 | - (void)setTintColor:(UIColor *)tintColor {
148 | _tintColor = tintColor;
149 | [self drawOffBox];
150 | }
151 |
152 | - (void)setOnTintColor:(UIColor *)onTintColor {
153 | _onTintColor = onTintColor;
154 | [self reload];
155 | }
156 |
157 | - (void)setOnFillColor:(UIColor *)onFillColor {
158 | _onFillColor = onFillColor;
159 | [self reload];
160 | }
161 |
162 | - (void)setOnCheckColor:(UIColor *)onCheckColor {
163 | _onCheckColor = onCheckColor;
164 | [self reload];
165 | }
166 |
167 | #pragma mark Gesture Recognizer
168 | - (void)handleTapCheckBox:(UITapGestureRecognizer *)recognizer {
169 | [self setOn:!self.on animated:YES];
170 | if ([self.delegate respondsToSelector:@selector(didTapCheckBox:)]) {
171 | [self.delegate didTapCheckBox:self];
172 | }
173 | }
174 |
175 | #pragma mark - Helper methods -
176 | #pragma mark Drawings
177 | - (void)drawRect:(CGRect)rect {
178 | [self setOn:self.on animated:NO];
179 | }
180 |
181 | /** Draws the entire checkbox, depending on the current state of the on property.
182 | */
183 | - (void)drawEntireCheckBox {
184 | if (!self.hideBox) {
185 | if (!self.offBoxLayer || CGPathGetBoundingBox(self.offBoxLayer.path).size.height == 0.0) {
186 | [self drawOffBox];
187 | }
188 | if (self.on) {
189 | [self drawOnBox];
190 | }
191 | }
192 | if (self.on) {
193 | [self drawCheckMark];
194 | }
195 | }
196 |
197 | /** Draws the box used when the checkbox is set to Off.
198 | */
199 | - (void)drawOffBox {
200 | [self.offBoxLayer removeFromSuperlayer];
201 | self.offBoxLayer = [CAShapeLayer layer];
202 | self.offBoxLayer.frame = self.bounds;
203 | self.offBoxLayer.path = [self.pathManager pathForBox].CGPath;
204 | self.offBoxLayer.fillColor = [UIColor clearColor].CGColor;
205 | self.offBoxLayer.strokeColor = self.tintColor.CGColor;
206 | self.offBoxLayer.lineWidth = self.lineWidth;
207 |
208 | self.offBoxLayer.rasterizationScale = 2.0 * [UIScreen mainScreen].scale;
209 | self.offBoxLayer.shouldRasterize = YES;
210 |
211 | [self.layer addSublayer:self.offBoxLayer];
212 | }
213 |
214 | /** Draws the box when the checkbox is set to On.
215 | */
216 | - (void)drawOnBox {
217 | [self.onBoxLayer removeFromSuperlayer];
218 | self.onBoxLayer = [CAShapeLayer layer];
219 | self.onBoxLayer.frame = self.bounds;
220 | self.onBoxLayer.path = [self.pathManager pathForBox].CGPath;
221 | self.onBoxLayer.lineWidth = self.lineWidth;
222 | self.onBoxLayer.fillColor = self.onFillColor.CGColor;
223 | self.onBoxLayer.strokeColor = self.onTintColor.CGColor;
224 | self.onBoxLayer.rasterizationScale = 2.0 * [UIScreen mainScreen].scale;
225 | self.onBoxLayer.shouldRasterize = YES;
226 | [self.layer addSublayer:self.onBoxLayer];
227 | }
228 |
229 | /** Draws the check mark when the checkbox is set to On.
230 | */
231 | - (void)drawCheckMark {
232 | [self.checkMarkLayer removeFromSuperlayer];
233 | self.checkMarkLayer = [CAShapeLayer layer];
234 | self.checkMarkLayer.frame = self.bounds;
235 | self.checkMarkLayer.path = [self.pathManager pathForCheckMark].CGPath;
236 | self.checkMarkLayer.strokeColor = self.onCheckColor.CGColor;
237 | self.checkMarkLayer.lineWidth = self.lineWidth;
238 | self.checkMarkLayer.fillColor = [UIColor clearColor].CGColor;
239 | self.checkMarkLayer.lineCap = kCALineCapRound;
240 | self.checkMarkLayer.lineJoin = kCALineJoinRound;
241 |
242 | self.checkMarkLayer.rasterizationScale = 2.0 * [UIScreen mainScreen].scale;
243 | self.checkMarkLayer.shouldRasterize = YES;
244 | [self.layer addSublayer:self.checkMarkLayer];
245 | }
246 |
247 | #pragma mark Animations
248 | - (void)addOnAnimation {
249 | if (self.animationDuration == 0.0) {
250 | return;
251 | }
252 |
253 | switch (self.onAnimationType) {
254 | case BEMAnimationTypeStroke: {
255 | CABasicAnimation *animation = [self.animationManager strokeAnimationReverse:NO];
256 |
257 | [self.onBoxLayer addAnimation:animation forKey:@"strokeEnd"];
258 | animation.delegate = self;
259 | [self.checkMarkLayer addAnimation:animation forKey:@"strokeEnd"];
260 | }
261 | return;
262 |
263 | case BEMAnimationTypeFill: {
264 | CAKeyframeAnimation *wiggle = [self.animationManager fillAnimationWithBounces:1 amplitude:0.18 reverse:NO];
265 | CABasicAnimation *opacityAnimation = [self.animationManager opacityAnimationReverse:NO];
266 | opacityAnimation.delegate = self;
267 |
268 | [self.onBoxLayer addAnimation:wiggle forKey:@"transform"];
269 | [self.checkMarkLayer addAnimation:opacityAnimation forKey:@"opacity"];
270 | }
271 | return;
272 |
273 | case BEMAnimationTypeBounce: {
274 | CGFloat amplitude = (self.boxType == BEMBoxTypeSquare) ? 0.20 : 0.35;
275 | CAKeyframeAnimation *wiggle = [self.animationManager fillAnimationWithBounces:1 amplitude:amplitude reverse:NO];
276 | wiggle.delegate = self;
277 |
278 | CABasicAnimation *opacity = [self.animationManager opacityAnimationReverse:NO];
279 | opacity.duration = self.animationDuration / 1.4;
280 |
281 | [self.onBoxLayer addAnimation:opacity forKey:@"opacity"];
282 | [self.checkMarkLayer addAnimation:wiggle forKey:@"transform"];
283 | }
284 | return;
285 |
286 | case BEMAnimationTypeFlat: {
287 | CABasicAnimation *morphAnimation = [self.animationManager morphAnimationFromPath:[self.pathManager pathForFlatCheckMark] toPath:[self.pathManager pathForCheckMark]];
288 | morphAnimation.delegate = self;
289 |
290 | CABasicAnimation *opacity = [self.animationManager opacityAnimationReverse:NO];
291 | opacity.duration = self.animationDuration / 5;
292 |
293 | [self.onBoxLayer addAnimation:opacity forKey:@"opacity"];
294 | [self.checkMarkLayer addAnimation:morphAnimation forKey:@"path"];
295 | [self.checkMarkLayer addAnimation:opacity forKey:@"opacity"];
296 | }
297 | return;
298 |
299 | case BEMAnimationTypeOneStroke: {
300 | // Temporary set the path of the checkmarl to the long checkmarl
301 | self.checkMarkLayer.path = [[self.pathManager pathForLongCheckMark] bezierPathByReversingPath].CGPath;
302 |
303 | CABasicAnimation *boxStrokeAnimation = [self.animationManager strokeAnimationReverse:NO];
304 | boxStrokeAnimation.duration = boxStrokeAnimation.duration / 2;
305 | [self.onBoxLayer addAnimation:boxStrokeAnimation forKey:@"strokeEnd"];
306 |
307 | CABasicAnimation *checkStrokeAnimation = [self.animationManager strokeAnimationReverse:NO];
308 | checkStrokeAnimation.duration = checkStrokeAnimation.duration / 3;
309 | checkStrokeAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
310 | checkStrokeAnimation.fillMode = kCAFillModeBackwards;
311 | checkStrokeAnimation.beginTime = CACurrentMediaTime() + boxStrokeAnimation.duration;
312 | [self.checkMarkLayer addAnimation:checkStrokeAnimation forKey:@"strokeEnd"];
313 |
314 | CABasicAnimation *checkMorphAnimation = [self.animationManager morphAnimationFromPath:[self.pathManager pathForLongCheckMark] toPath:[self.pathManager pathForCheckMark]];
315 | checkMorphAnimation.duration = checkMorphAnimation.duration / 6;
316 | checkMorphAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
317 | checkMorphAnimation.beginTime = CACurrentMediaTime() + boxStrokeAnimation.duration + checkStrokeAnimation.duration;
318 | checkMorphAnimation.removedOnCompletion = NO;
319 | checkMorphAnimation.fillMode = kCAFillModeForwards;
320 | checkMorphAnimation.delegate = self;
321 | [self.checkMarkLayer addAnimation:checkMorphAnimation forKey:@"path"];
322 | }
323 | return;
324 |
325 | default: {
326 | CABasicAnimation *animation = [self.animationManager opacityAnimationReverse:NO];
327 | [self.onBoxLayer addAnimation:animation forKey:@"opacity"];
328 | animation.delegate = self;
329 | [self.checkMarkLayer addAnimation:animation forKey:@"opacity"];
330 | }
331 | return;
332 | }
333 | }
334 |
335 | - (void)addOffAnimation {
336 | if (self.animationDuration == 0.0) {
337 | [self.onBoxLayer removeFromSuperlayer];
338 | [self.checkMarkLayer removeFromSuperlayer];
339 | return;
340 | }
341 |
342 | switch (self.offAnimationType) {
343 | case BEMAnimationTypeStroke: {
344 | CABasicAnimation *animation = [self.animationManager strokeAnimationReverse:YES];
345 | [self.onBoxLayer addAnimation:animation forKey:@"strokeEnd"];
346 | animation.delegate = self;
347 | [self.checkMarkLayer addAnimation:animation forKey:@"strokeEnd"];
348 | }
349 | return;
350 |
351 | case BEMAnimationTypeFill: {
352 | CAKeyframeAnimation *wiggle = [self.animationManager fillAnimationWithBounces:1 amplitude:0.18 reverse:YES];
353 | wiggle.duration = self.animationDuration;
354 | wiggle.delegate = self;
355 |
356 | [self.onBoxLayer addAnimation:wiggle forKey:@"transform"];
357 | [self.checkMarkLayer addAnimation:[self.animationManager opacityAnimationReverse:YES] forKey:@"opacity"];
358 | }
359 | return;
360 |
361 | case BEMAnimationTypeBounce: {
362 | CGFloat amplitude = (self.boxType == BEMBoxTypeSquare) ? 0.20 : 0.35;
363 | CAKeyframeAnimation *wiggle = [self.animationManager fillAnimationWithBounces:1 amplitude:amplitude reverse:YES];
364 | wiggle.duration = self.animationDuration / 1.1;
365 | CABasicAnimation *opacity = [self.animationManager opacityAnimationReverse:YES];
366 | opacity.delegate = self;
367 |
368 | [self.onBoxLayer addAnimation:opacity forKey:@"opacity"];
369 | [self.checkMarkLayer addAnimation:wiggle forKey:@"transform"];
370 | }
371 | return;
372 |
373 | case BEMAnimationTypeFlat: {
374 | CABasicAnimation *animation = [self.animationManager morphAnimationFromPath:[self.pathManager pathForCheckMark] toPath:[self.pathManager pathForFlatCheckMark]];
375 | animation.delegate = self;
376 |
377 | CABasicAnimation *opacity = [self.animationManager opacityAnimationReverse:YES];
378 | opacity.duration = self.animationDuration;
379 |
380 | [self.onBoxLayer addAnimation:opacity forKey:@"opacity"];
381 | [self.checkMarkLayer addAnimation:animation forKey:@"path"];
382 | [self.checkMarkLayer addAnimation:opacity forKey:@"opacity"];
383 | }
384 | return;
385 |
386 | case BEMAnimationTypeOneStroke: {
387 | self.checkMarkLayer.path = [[self.pathManager pathForLongCheckMark] bezierPathByReversingPath].CGPath;
388 |
389 | CABasicAnimation *checkMorphAnimation = [self.animationManager morphAnimationFromPath:[self.pathManager pathForCheckMark] toPath:[self.pathManager pathForLongCheckMark]];
390 | checkMorphAnimation.delegate = nil;
391 | checkMorphAnimation.duration = checkMorphAnimation.duration / 6;
392 | [self.checkMarkLayer addAnimation:checkMorphAnimation forKey:@"path"];
393 |
394 | CABasicAnimation *checkStrokeAnimation = [self.animationManager strokeAnimationReverse:YES];
395 | checkStrokeAnimation.delegate = nil;
396 | checkStrokeAnimation.beginTime = CACurrentMediaTime() + checkMorphAnimation.duration;
397 | checkStrokeAnimation.duration = checkStrokeAnimation.duration / 3;
398 | [self.checkMarkLayer addAnimation:checkStrokeAnimation forKey:@"strokeEnd"];
399 |
400 | __weak __typeof__(self) weakSelf = self;
401 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(CACurrentMediaTime() + checkMorphAnimation.duration + checkStrokeAnimation.duration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
402 | weakSelf.checkMarkLayer.lineCap = kCALineCapButt;
403 | });
404 |
405 | CABasicAnimation *boxStrokeAnimation = [self.animationManager strokeAnimationReverse:YES];
406 | boxStrokeAnimation.beginTime = CACurrentMediaTime() + checkMorphAnimation.duration + checkStrokeAnimation.duration;
407 | boxStrokeAnimation.duration = boxStrokeAnimation.duration / 2;
408 | boxStrokeAnimation.delegate = self;
409 | [self.onBoxLayer addAnimation:boxStrokeAnimation forKey:@"strokeEnd"];
410 | }
411 | return;
412 |
413 | default: {
414 | CABasicAnimation *animation = [self.animationManager opacityAnimationReverse:YES];
415 |
416 | [self.onBoxLayer addAnimation:animation forKey:@"opacity"];
417 | animation.delegate = self;
418 | [self.checkMarkLayer addAnimation:animation forKey:@"opacity"];
419 | }
420 | return;
421 | }
422 | }
423 |
424 | #pragma mark Animation Delegate
425 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag {
426 | if (flag == YES) {
427 | if (self.on == NO) {
428 | [self.onBoxLayer removeFromSuperlayer];
429 | [self.checkMarkLayer removeFromSuperlayer];
430 | }
431 |
432 | if ([self.delegate respondsToSelector:@selector(animationDidStopForCheckBox:)]) {
433 | [self.delegate animationDidStopForCheckBox:self];
434 | }
435 | }
436 | }
437 |
438 | - (void)dealloc {
439 | self.delegate = nil;
440 | }
441 |
442 | @end
443 |
--------------------------------------------------------------------------------
/BEMCheckBox/BEMPathManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // BEMPathManager.h
3 | // CheckBox
4 | //
5 | // Created by Bobo on 9/19/15.
6 | // Copyright (c) 2015 Boris Emorine. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 | #import "BEMCheckBox.h"
11 |
12 | /** Path object used by BEMCheckBox to generate paths.
13 | */
14 | @interface BEMPathManager : NSObject
15 |
16 | /** The paths are assumed to be created in squares.
17 | * This is the size of width, or height, of the paths that will be created.
18 | */
19 | @property (nonatomic) CGFloat size;
20 |
21 | /** The width of the lines on the created paths.
22 | */
23 | @property (nonatomic) CGFloat lineWidth;
24 |
25 | /** The type of box.
26 | * Depending on the box type, paths may be created differently
27 | * @see BEMBoxType
28 | */
29 | @property (nonatomic) BEMBoxType boxType;
30 |
31 | /** Returns a UIBezierPath object for the box of the checkbox
32 | * @returns The path of the box.
33 | */
34 | - (UIBezierPath *)pathForBox;
35 |
36 | /** Returns a UIBezierPath object for the checkmark of the checkbox
37 | * @returns The path of the checkmark.
38 | */
39 | - (UIBezierPath *)pathForCheckMark;
40 |
41 | /** Returns a UIBezierPath object for an extra long checkmark which is in contact with the box.
42 | * @returns The path of the checkmark.
43 | */
44 | - (UIBezierPath *)pathForLongCheckMark;
45 |
46 | /** Returns a UIBezierPath object for the flat checkmark of the checkbox
47 | * @see BEMAnimationTypeFlat
48 | * @returns The path of the flat checkmark.
49 | */
50 | - (UIBezierPath *)pathForFlatCheckMark;
51 |
52 | @end
53 |
--------------------------------------------------------------------------------
/BEMCheckBox/BEMPathManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // BEMPathManager.m
3 | // CheckBox
4 | //
5 | // Created by Bobo on 9/19/15.
6 | // Copyright (c) 2015 Boris Emorine. All rights reserved.
7 | //
8 |
9 | #import "BEMPathManager.h"
10 |
11 | @implementation BEMPathManager
12 |
13 | #pragma mark Paths
14 |
15 | - (UIBezierPath *)pathForBox {
16 | UIBezierPath* path;
17 | switch (self.boxType) {
18 | case BEMBoxTypeSquare:
19 | path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, self.size, self.size) cornerRadius:3.0];
20 | [path applyTransform:CGAffineTransformRotate(CGAffineTransformIdentity, M_PI * 2.5)];
21 | [path applyTransform:CGAffineTransformMakeTranslation(self.size, 0)];
22 | break;
23 |
24 | default: {
25 | CGFloat radius = self.size / 2;
26 | path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(self.size / 2, self.size / 2)
27 | radius: radius
28 | startAngle: - M_PI / 4
29 | endAngle: 2 * M_PI - M_PI / 4
30 | clockwise:YES];
31 | }
32 | break;
33 | }
34 | return path;
35 | }
36 |
37 | - (UIBezierPath *)pathForCheckMark {
38 | UIBezierPath* checkMarkPath = [UIBezierPath bezierPath];
39 |
40 | [checkMarkPath moveToPoint: CGPointMake(self.size/3.1578, self.size/2)];
41 | [checkMarkPath addLineToPoint: CGPointMake(self.size/2.0618, self.size/1.57894)];
42 | [checkMarkPath addLineToPoint: CGPointMake(self.size/1.3953, self.size/2.7272)];
43 |
44 | if (self.boxType == BEMBoxTypeSquare) {
45 | // If we use a square box, the check mark should be a little bit bigger
46 | [checkMarkPath applyTransform:CGAffineTransformMakeScale(1.5, 1.5)];
47 | [checkMarkPath applyTransform:CGAffineTransformMakeTranslation(-self.size/4, -self.size/4)];
48 | }
49 |
50 | return checkMarkPath;
51 | }
52 |
53 | - (UIBezierPath *)pathForLongCheckMark {
54 | UIBezierPath* checkMarkPath = [UIBezierPath bezierPath];
55 |
56 | [checkMarkPath moveToPoint: CGPointMake(self.size/3.1578, self.size/2)];
57 | [checkMarkPath addLineToPoint: CGPointMake(self.size/2.0618, self.size/1.57894)];
58 |
59 | if (self.boxType == BEMBoxTypeSquare) {
60 | // If we use a square box, the check mark should be a little bit bigger
61 | [checkMarkPath addLineToPoint: CGPointMake(self.size/1.2053, self.size/4.5272)];
62 | [checkMarkPath applyTransform:CGAffineTransformMakeScale(1.5, 1.5)];
63 | [checkMarkPath applyTransform:CGAffineTransformMakeTranslation(-self.size/4, -self.size/4)];
64 | } else {
65 | [checkMarkPath addLineToPoint: CGPointMake(self.size/1.1553, self.size/5.9272)];
66 | }
67 |
68 | return checkMarkPath;
69 | }
70 |
71 | - (UIBezierPath *)pathForFlatCheckMark {
72 | UIBezierPath* flatCheckMarkPath = [UIBezierPath bezierPath];
73 | [flatCheckMarkPath moveToPoint: CGPointMake(self.size/4, self.size/2)];
74 | [flatCheckMarkPath addLineToPoint: CGPointMake(self.size/2, self.size/2)];
75 | [flatCheckMarkPath addLineToPoint: CGPointMake(self.size/1.2, self.size/2)];
76 |
77 | return flatCheckMarkPath;
78 | }
79 |
80 | @end
81 |
--------------------------------------------------------------------------------
/Example/.flowconfig:
--------------------------------------------------------------------------------
1 | [ignore]
2 |
3 | # We fork some components by platform.
4 | .*/*.web.js
5 | .*/*.android.js
6 |
7 | # Some modules have their own node_modules with overlap
8 | .*/node_modules/node-haste/.*
9 |
10 | # Ugh
11 | .*/node_modules/babel.*
12 | .*/node_modules/babylon.*
13 | .*/node_modules/invariant.*
14 |
15 | # Ignore react and fbjs where there are overlaps, but don't ignore
16 | # anything that react-native relies on
17 | .*/node_modules/fbjs/lib/Map.js
18 | .*/node_modules/fbjs/lib/fetch.js
19 | .*/node_modules/fbjs/lib/ExecutionEnvironment.js
20 | .*/node_modules/fbjs/lib/ErrorUtils.js
21 |
22 | # Flow has a built-in definition for the 'react' module which we prefer to use
23 | # over the currently-untyped source
24 | .*/node_modules/react/react.js
25 | .*/node_modules/react/lib/React.js
26 | .*/node_modules/react/lib/ReactDOM.js
27 |
28 | .*/__mocks__/.*
29 | .*/__tests__/.*
30 |
31 | .*/commoner/test/source/widget/share.js
32 |
33 | # Ignore commoner tests
34 | .*/node_modules/commoner/test/.*
35 |
36 | # See https://github.com/facebook/flow/issues/442
37 | .*/react-tools/node_modules/commoner/lib/reader.js
38 |
39 | # Ignore jest
40 | .*/node_modules/jest-cli/.*
41 |
42 | # Ignore Website
43 | .*/website/.*
44 |
45 | .*/node_modules/is-my-json-valid/test/.*\.json
46 | .*/node_modules/iconv-lite/encodings/tables/.*\.json
47 | .*/node_modules/y18n/test/.*\.json
48 | .*/node_modules/spdx-license-ids/spdx-license-ids.json
49 | .*/node_modules/spdx-exceptions/index.json
50 | .*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json
51 | .*/node_modules/resolve/lib/core.json
52 | .*/node_modules/jsonparse/samplejson/.*\.json
53 | .*/node_modules/json5/test/.*\.json
54 | .*/node_modules/ua-parser-js/test/.*\.json
55 | .*/node_modules/builtin-modules/builtin-modules.json
56 | .*/node_modules/binary-extensions/binary-extensions.json
57 | .*/node_modules/url-regex/tlds.json
58 | .*/node_modules/joi/.*\.json
59 | .*/node_modules/isemail/.*\.json
60 | .*/node_modules/tr46/.*\.json
61 |
62 | [include]
63 |
64 | [libs]
65 | node_modules/react-native/Libraries/react-native/react-native-interface.js
66 | node_modules/react-native/flow
67 | flow/
68 |
69 | [options]
70 | module.system=haste
71 |
72 | esproposal.class_static_fields=enable
73 | esproposal.class_instance_fields=enable
74 |
75 | munge_underscores=true
76 |
77 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
78 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\)$' -> 'RelativeImageStub'
79 |
80 | suppress_type=$FlowIssue
81 | suppress_type=$FlowFixMe
82 | suppress_type=$FixMe
83 |
84 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-2]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
85 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-2]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
86 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
87 |
88 | [version]
89 | 0.22.1
90 |
--------------------------------------------------------------------------------
/Example/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 | project.xcworkspace
24 |
25 | # Android/IJ
26 | #
27 | .idea
28 | .gradle
29 | local.properties
30 |
31 | # node.js
32 | #
33 | node_modules/
34 | npm-debug.log
35 |
--------------------------------------------------------------------------------
/Example/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/Example/index.ios.js:
--------------------------------------------------------------------------------
1 | /* @flow */
2 | import React, {
3 | AppRegistry,
4 | Component,
5 | StyleSheet,
6 | Text,
7 | View,
8 | SliderIOS,
9 | ActionSheetIOS,
10 | TouchableOpacity,
11 | SegmentedControlIOS,
12 | } from 'react-native';
13 |
14 | import BEMCheckBox from 'react-native-bem-check-box';
15 |
16 | const COLORS = {
17 | AZURE: '#007aff',
18 | LIGHT_GRAY: '#aaa', // 0.667 white
19 | WHITE: '#fff',
20 | CLEAR: 'transparent',
21 | };
22 | const ANIMATION_TYPES = {
23 | 'stroke': 'Stroke',
24 | 'fill': 'Fill',
25 | 'bounce': 'Bounce',
26 | 'flat': 'Flat',
27 | 'one-stroke': 'One stroke',
28 | 'fade': 'Fade',
29 | };
30 |
31 | class CheckBox extends Component {
32 |
33 | state: Object = {
34 | drawTypeIndex: 1,
35 | boxTypeIndex: 0,
36 | drawTypeSegmentEnabled: true,
37 | animationDuration: 0.5,
38 | lineWidth: 5,
39 | animationIndex: 2,
40 | };
41 |
42 | render () {
43 | const {
44 | drawTypeIndex, boxTypeIndex,
45 | animationDuration, lineWidth, animationIndex,
46 | drawTypeSegmentEnabled,
47 | } = this.state;
48 |
49 | let tintColor, onTintColor, onFillColor, onCheckColor;
50 | if (drawTypeIndex === 0) {
51 | tintColor = COLORS.LIGHT_GRAY;
52 | onTintColor = COLORS.AZURE;
53 | onFillColor = COLORS.CLEAR;
54 | onCheckColor = COLORS.AZURE;
55 | }
56 | else {
57 | tintColor = COLORS.LIGHT_GRAY;
58 | onTintColor = COLORS.AZURE;
59 | onFillColor = COLORS.AZURE;
60 | onCheckColor = COLORS.WHITE;
61 | }
62 |
63 | return (
64 |
65 |
66 |
78 |
79 |
80 |
81 |
89 | {
95 | this.setState({
96 | boxTypeIndex: event.nativeEvent.selectedSegmentIndex
97 | });
98 | }}
99 | />
100 |
101 |
102 | Animation duration
103 | this.setState({animationDuration: value})}
111 | />
112 |
113 |
114 | Line width
115 | this.setState({lineWidth: value})}
123 | />
124 |
125 |
126 |
130 | Animations
131 |
132 |
133 |
134 |
135 | );
136 | }
137 |
138 | _onDrawTypeChange: (event: Object) => void = (event) => {
139 | const drawTypeIndex = event.nativeEvent.selectedSegmentIndex;
140 | this.setState({ drawTypeIndex });
141 | };
142 |
143 | _onPressAnimation: (event: Object) => void = (event) => {
144 | const { animationIndex } = this.state;
145 | ActionSheetIOS.showActionSheetWithOptions({
146 | options: Object.values(ANIMATION_TYPES),
147 | title: 'Animations',
148 | cancelButtonIndex: animationIndex,
149 | },
150 | (animationIndex) => {
151 | const animationType = Object.keys(ANIMATION_TYPES)[animationIndex];
152 | if (animationType === 'stroke' || animationType === 'one-stroke') {
153 | this.setState({
154 | drawTypeIndex: 0,
155 | drawTypeSegmentEnabled: false,
156 | animationIndex,
157 | });
158 | }
159 | else if (animationType === 'fill') {
160 | this.setState({
161 | drawTypeIndex: 1,
162 | drawTypeSegmentEnabled: false,
163 | animationIndex,
164 | });
165 | }
166 | else {
167 | this.setState({
168 | drawTypeSegmentEnabled: true,
169 | animationIndex,
170 | });
171 | }
172 | });
173 | };
174 |
175 | }
176 |
177 | const styles = StyleSheet.create({
178 | container: {
179 | flex: 1,
180 | },
181 | previewContainer: {
182 | flex: 1,
183 | justifyContent: 'center',
184 | alignItems: 'center',
185 | },
186 | controlsContainer: {
187 | flex: 1,
188 | backgroundColor: COLORS.AZURE,
189 | },
190 | segmentContainer: {
191 | flexDirection: 'row',
192 | justifyContent: 'center',
193 | margin: 20,
194 | },
195 | sliderContainer: {
196 | flexDirection: 'row',
197 | justifyContent: 'space-between',
198 | alignItems: 'center',
199 | margin: 20,
200 | },
201 | buttonContainer: {
202 | alignItems: 'center',
203 | justifyContent: 'center',
204 | flex: 1,
205 | flexDirection: 'row',
206 | },
207 | sliderLabel: {
208 | color: COLORS.WHITE,
209 | },
210 | buttonLabel: {
211 | color: COLORS.WHITE,
212 | },
213 | checkbox: {
214 | width: 100,
215 | height: 100,
216 | },
217 | segment: {
218 | width: 123,
219 | height: 28,
220 | margin: 20,
221 | },
222 | slider: {
223 | width: 100,
224 | height: 30,
225 | },
226 | button: {
227 | width: 100,
228 | height: 44,
229 | borderWidth: 1,
230 | borderColor: COLORS.WHITE,
231 | borderRadius: 5,
232 | justifyContent: 'center',
233 | alignItems: 'center',
234 | },
235 | });
236 |
237 | AppRegistry.registerComponent('CheckBox', () => CheckBox);
238 |
--------------------------------------------------------------------------------
/Example/ios/CheckBox.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };
13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };
14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };
15 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };
16 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };
17 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };
18 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
19 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
20 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
21 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
22 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
23 | 3579C82B1CB73FCC0065A834 /* libRNBEMCheckBox.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3579C8121CB73B5B0065A834 /* libRNBEMCheckBox.a */; };
24 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
25 | /* End PBXBuildFile section */
26 |
27 | /* Begin PBXContainerItemProxy section */
28 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = {
29 | isa = PBXContainerItemProxy;
30 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
31 | proxyType = 2;
32 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
33 | remoteInfo = RCTActionSheet;
34 | };
35 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = {
36 | isa = PBXContainerItemProxy;
37 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
38 | proxyType = 2;
39 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
40 | remoteInfo = RCTGeolocation;
41 | };
42 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = {
43 | isa = PBXContainerItemProxy;
44 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
45 | proxyType = 2;
46 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676;
47 | remoteInfo = RCTImage;
48 | };
49 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = {
50 | isa = PBXContainerItemProxy;
51 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
52 | proxyType = 2;
53 | remoteGlobalIDString = 58B511DB1A9E6C8500147676;
54 | remoteInfo = RCTNetwork;
55 | };
56 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = {
57 | isa = PBXContainerItemProxy;
58 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
59 | proxyType = 2;
60 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7;
61 | remoteInfo = RCTVibration;
62 | };
63 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {
64 | isa = PBXContainerItemProxy;
65 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
66 | proxyType = 2;
67 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
68 | remoteInfo = RCTSettings;
69 | };
70 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = {
71 | isa = PBXContainerItemProxy;
72 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
73 | proxyType = 2;
74 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A;
75 | remoteInfo = RCTWebSocket;
76 | };
77 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = {
78 | isa = PBXContainerItemProxy;
79 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
80 | proxyType = 2;
81 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
82 | remoteInfo = React;
83 | };
84 | 3579C8111CB73B5B0065A834 /* PBXContainerItemProxy */ = {
85 | isa = PBXContainerItemProxy;
86 | containerPortal = 3579C80D1CB73B5B0065A834 /* RNBEMCheckBox.xcodeproj */;
87 | proxyType = 2;
88 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
89 | remoteInfo = RNBEMCheckBox;
90 | };
91 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {
92 | isa = PBXContainerItemProxy;
93 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
94 | proxyType = 2;
95 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
96 | remoteInfo = RCTLinking;
97 | };
98 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = {
99 | isa = PBXContainerItemProxy;
100 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
101 | proxyType = 2;
102 | remoteGlobalIDString = 58B5119B1A9E6C1200147676;
103 | remoteInfo = RCTText;
104 | };
105 | B07681831F5585DE00D094B5 /* PBXContainerItemProxy */ = {
106 | isa = PBXContainerItemProxy;
107 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
108 | proxyType = 2;
109 | remoteGlobalIDString = 2D2A283A1D9B042B00D4039D;
110 | remoteInfo = "RCTImage-tvOS";
111 | };
112 | B07681871F5585DE00D094B5 /* PBXContainerItemProxy */ = {
113 | isa = PBXContainerItemProxy;
114 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
115 | proxyType = 2;
116 | remoteGlobalIDString = 2D2A28471D9B043800D4039D;
117 | remoteInfo = "RCTLinking-tvOS";
118 | };
119 | B076818B1F5585DE00D094B5 /* PBXContainerItemProxy */ = {
120 | isa = PBXContainerItemProxy;
121 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
122 | proxyType = 2;
123 | remoteGlobalIDString = 2D2A28541D9B044C00D4039D;
124 | remoteInfo = "RCTNetwork-tvOS";
125 | };
126 | B076818F1F5585DE00D094B5 /* PBXContainerItemProxy */ = {
127 | isa = PBXContainerItemProxy;
128 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
129 | proxyType = 2;
130 | remoteGlobalIDString = 2D2A28611D9B046600D4039D;
131 | remoteInfo = "RCTSettings-tvOS";
132 | };
133 | B07681931F5585DE00D094B5 /* PBXContainerItemProxy */ = {
134 | isa = PBXContainerItemProxy;
135 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
136 | proxyType = 2;
137 | remoteGlobalIDString = 2D2A287B1D9B048500D4039D;
138 | remoteInfo = "RCTText-tvOS";
139 | };
140 | B07681981F5585DE00D094B5 /* PBXContainerItemProxy */ = {
141 | isa = PBXContainerItemProxy;
142 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
143 | proxyType = 2;
144 | remoteGlobalIDString = 2D2A28881D9B049200D4039D;
145 | remoteInfo = "RCTWebSocket-tvOS";
146 | };
147 | B07681A21F5585DE00D094B5 /* PBXContainerItemProxy */ = {
148 | isa = PBXContainerItemProxy;
149 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
150 | proxyType = 2;
151 | remoteGlobalIDString = 2D2A28131D9B038B00D4039D;
152 | remoteInfo = "React-tvOS";
153 | };
154 | B07681A41F5585DE00D094B5 /* PBXContainerItemProxy */ = {
155 | isa = PBXContainerItemProxy;
156 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
157 | proxyType = 2;
158 | remoteGlobalIDString = 3D3C059A1DE3340900C268FA;
159 | remoteInfo = yoga;
160 | };
161 | B07681A61F5585DE00D094B5 /* PBXContainerItemProxy */ = {
162 | isa = PBXContainerItemProxy;
163 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
164 | proxyType = 2;
165 | remoteGlobalIDString = 3D3C06751DE3340C00C268FA;
166 | remoteInfo = "yoga-tvOS";
167 | };
168 | B07681A81F5585DE00D094B5 /* PBXContainerItemProxy */ = {
169 | isa = PBXContainerItemProxy;
170 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
171 | proxyType = 2;
172 | remoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4;
173 | remoteInfo = cxxreact;
174 | };
175 | B07681AA1F5585DE00D094B5 /* PBXContainerItemProxy */ = {
176 | isa = PBXContainerItemProxy;
177 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
178 | proxyType = 2;
179 | remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4;
180 | remoteInfo = "cxxreact-tvOS";
181 | };
182 | B07681AC1F5585DE00D094B5 /* PBXContainerItemProxy */ = {
183 | isa = PBXContainerItemProxy;
184 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
185 | proxyType = 2;
186 | remoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4;
187 | remoteInfo = jschelpers;
188 | };
189 | B07681AE1F5585DE00D094B5 /* PBXContainerItemProxy */ = {
190 | isa = PBXContainerItemProxy;
191 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
192 | proxyType = 2;
193 | remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4;
194 | remoteInfo = "jschelpers-tvOS";
195 | };
196 | /* End PBXContainerItemProxy section */
197 |
198 | /* Begin PBXFileReference section */
199 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; };
200 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; };
201 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; };
202 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; };
203 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; };
204 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; };
205 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; };
206 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; };
207 | 13B07F961A680F5B00A75B9A /* CheckBox.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CheckBox.app; sourceTree = BUILT_PRODUCTS_DIR; };
208 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = CheckBox/AppDelegate.h; sourceTree = ""; };
209 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = CheckBox/AppDelegate.m; sourceTree = ""; };
210 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
211 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = CheckBox/Images.xcassets; sourceTree = ""; };
212 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = CheckBox/Info.plist; sourceTree = ""; };
213 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = CheckBox/main.m; sourceTree = ""; };
214 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; };
215 | 3579C80D1CB73B5B0065A834 /* RNBEMCheckBox.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNBEMCheckBox.xcodeproj; path = "../node_modules/react-native-bem-check-box/RNBEMCheckBox.xcodeproj"; sourceTree = ""; };
216 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; };
217 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; };
218 | /* End PBXFileReference section */
219 |
220 | /* Begin PBXFrameworksBuildPhase section */
221 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
222 | isa = PBXFrameworksBuildPhase;
223 | buildActionMask = 2147483647;
224 | files = (
225 | 146834051AC3E58100842450 /* libReact.a in Frameworks */,
226 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
227 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,
228 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,
229 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */,
230 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,
231 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */,
232 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
233 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
234 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
235 | 3579C82B1CB73FCC0065A834 /* libRNBEMCheckBox.a in Frameworks */,
236 | );
237 | runOnlyForDeploymentPostprocessing = 0;
238 | };
239 | /* End PBXFrameworksBuildPhase section */
240 |
241 | /* Begin PBXGroup section */
242 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = {
243 | isa = PBXGroup;
244 | children = (
245 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */,
246 | );
247 | name = Products;
248 | sourceTree = "";
249 | };
250 | 00C302B61ABCB90400DB3ED1 /* Products */ = {
251 | isa = PBXGroup;
252 | children = (
253 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */,
254 | );
255 | name = Products;
256 | sourceTree = "";
257 | };
258 | 00C302BC1ABCB91800DB3ED1 /* Products */ = {
259 | isa = PBXGroup;
260 | children = (
261 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */,
262 | B07681841F5585DE00D094B5 /* libRCTImage-tvOS.a */,
263 | );
264 | name = Products;
265 | sourceTree = "";
266 | };
267 | 00C302D41ABCB9D200DB3ED1 /* Products */ = {
268 | isa = PBXGroup;
269 | children = (
270 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */,
271 | B076818C1F5585DE00D094B5 /* libRCTNetwork-tvOS.a */,
272 | );
273 | name = Products;
274 | sourceTree = "";
275 | };
276 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = {
277 | isa = PBXGroup;
278 | children = (
279 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */,
280 | );
281 | name = Products;
282 | sourceTree = "";
283 | };
284 | 139105B71AF99BAD00B5F7CC /* Products */ = {
285 | isa = PBXGroup;
286 | children = (
287 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */,
288 | B07681901F5585DE00D094B5 /* libRCTSettings-tvOS.a */,
289 | );
290 | name = Products;
291 | sourceTree = "";
292 | };
293 | 139FDEE71B06529A00C62182 /* Products */ = {
294 | isa = PBXGroup;
295 | children = (
296 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
297 | B07681991F5585DE00D094B5 /* libRCTWebSocket-tvOS.a */,
298 | );
299 | name = Products;
300 | sourceTree = "";
301 | };
302 | 13B07FAE1A68108700A75B9A /* CheckBox */ = {
303 | isa = PBXGroup;
304 | children = (
305 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */,
306 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
307 | 13B07FB01A68108700A75B9A /* AppDelegate.m */,
308 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
309 | 13B07FB61A68108700A75B9A /* Info.plist */,
310 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
311 | 13B07FB71A68108700A75B9A /* main.m */,
312 | );
313 | name = CheckBox;
314 | sourceTree = "";
315 | };
316 | 146834001AC3E56700842450 /* Products */ = {
317 | isa = PBXGroup;
318 | children = (
319 | 146834041AC3E56700842450 /* libReact.a */,
320 | B07681A31F5585DE00D094B5 /* libReact.a */,
321 | B07681A51F5585DE00D094B5 /* libyoga.a */,
322 | B07681A71F5585DE00D094B5 /* libyoga.a */,
323 | B07681A91F5585DE00D094B5 /* libcxxreact.a */,
324 | B07681AB1F5585DE00D094B5 /* libcxxreact.a */,
325 | B07681AD1F5585DE00D094B5 /* libjschelpers.a */,
326 | B07681AF1F5585DE00D094B5 /* libjschelpers.a */,
327 | );
328 | name = Products;
329 | sourceTree = "";
330 | };
331 | 3579C80E1CB73B5B0065A834 /* Products */ = {
332 | isa = PBXGroup;
333 | children = (
334 | 3579C8121CB73B5B0065A834 /* libRNBEMCheckBox.a */,
335 | );
336 | name = Products;
337 | sourceTree = "";
338 | };
339 | 78C398B11ACF4ADC00677621 /* Products */ = {
340 | isa = PBXGroup;
341 | children = (
342 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */,
343 | B07681881F5585DE00D094B5 /* libRCTLinking-tvOS.a */,
344 | );
345 | name = Products;
346 | sourceTree = "";
347 | };
348 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
349 | isa = PBXGroup;
350 | children = (
351 | 146833FF1AC3E56700842450 /* React.xcodeproj */,
352 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
353 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,
354 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,
355 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,
356 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,
357 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */,
358 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
359 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
360 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
361 | 3579C80D1CB73B5B0065A834 /* RNBEMCheckBox.xcodeproj */,
362 | );
363 | name = Libraries;
364 | sourceTree = "";
365 | };
366 | 832341B11AAA6A8300B99B32 /* Products */ = {
367 | isa = PBXGroup;
368 | children = (
369 | 832341B51AAA6A8300B99B32 /* libRCTText.a */,
370 | B07681941F5585DE00D094B5 /* libRCTText-tvOS.a */,
371 | );
372 | name = Products;
373 | sourceTree = "";
374 | };
375 | 83CBB9F61A601CBA00E9B192 = {
376 | isa = PBXGroup;
377 | children = (
378 | 13B07FAE1A68108700A75B9A /* CheckBox */,
379 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
380 | 83CBBA001A601CBA00E9B192 /* Products */,
381 | );
382 | indentWidth = 2;
383 | sourceTree = "";
384 | tabWidth = 2;
385 | };
386 | 83CBBA001A601CBA00E9B192 /* Products */ = {
387 | isa = PBXGroup;
388 | children = (
389 | 13B07F961A680F5B00A75B9A /* CheckBox.app */,
390 | );
391 | name = Products;
392 | sourceTree = "";
393 | };
394 | /* End PBXGroup section */
395 |
396 | /* Begin PBXNativeTarget section */
397 | 13B07F861A680F5B00A75B9A /* CheckBox */ = {
398 | isa = PBXNativeTarget;
399 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "CheckBox" */;
400 | buildPhases = (
401 | 13B07F871A680F5B00A75B9A /* Sources */,
402 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
403 | 13B07F8E1A680F5B00A75B9A /* Resources */,
404 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
405 | );
406 | buildRules = (
407 | );
408 | dependencies = (
409 | );
410 | name = CheckBox;
411 | productName = "Hello World";
412 | productReference = 13B07F961A680F5B00A75B9A /* CheckBox.app */;
413 | productType = "com.apple.product-type.application";
414 | };
415 | /* End PBXNativeTarget section */
416 |
417 | /* Begin PBXProject section */
418 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
419 | isa = PBXProject;
420 | attributes = {
421 | LastUpgradeCheck = 0830;
422 | ORGANIZATIONNAME = Facebook;
423 | };
424 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "CheckBox" */;
425 | compatibilityVersion = "Xcode 3.2";
426 | developmentRegion = English;
427 | hasScannedForEncodings = 0;
428 | knownRegions = (
429 | en,
430 | Base,
431 | );
432 | mainGroup = 83CBB9F61A601CBA00E9B192;
433 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
434 | projectDirPath = "";
435 | projectReferences = (
436 | {
437 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */;
438 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
439 | },
440 | {
441 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */;
442 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
443 | },
444 | {
445 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */;
446 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
447 | },
448 | {
449 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */;
450 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
451 | },
452 | {
453 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */;
454 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
455 | },
456 | {
457 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */;
458 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
459 | },
460 | {
461 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */;
462 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
463 | },
464 | {
465 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */;
466 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
467 | },
468 | {
469 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */;
470 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
471 | },
472 | {
473 | ProductGroup = 146834001AC3E56700842450 /* Products */;
474 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
475 | },
476 | {
477 | ProductGroup = 3579C80E1CB73B5B0065A834 /* Products */;
478 | ProjectRef = 3579C80D1CB73B5B0065A834 /* RNBEMCheckBox.xcodeproj */;
479 | },
480 | );
481 | projectRoot = "";
482 | targets = (
483 | 13B07F861A680F5B00A75B9A /* CheckBox */,
484 | );
485 | };
486 | /* End PBXProject section */
487 |
488 | /* Begin PBXReferenceProxy section */
489 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = {
490 | isa = PBXReferenceProxy;
491 | fileType = archive.ar;
492 | path = libRCTActionSheet.a;
493 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */;
494 | sourceTree = BUILT_PRODUCTS_DIR;
495 | };
496 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = {
497 | isa = PBXReferenceProxy;
498 | fileType = archive.ar;
499 | path = libRCTGeolocation.a;
500 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */;
501 | sourceTree = BUILT_PRODUCTS_DIR;
502 | };
503 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = {
504 | isa = PBXReferenceProxy;
505 | fileType = archive.ar;
506 | path = libRCTImage.a;
507 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */;
508 | sourceTree = BUILT_PRODUCTS_DIR;
509 | };
510 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = {
511 | isa = PBXReferenceProxy;
512 | fileType = archive.ar;
513 | path = libRCTNetwork.a;
514 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */;
515 | sourceTree = BUILT_PRODUCTS_DIR;
516 | };
517 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = {
518 | isa = PBXReferenceProxy;
519 | fileType = archive.ar;
520 | path = libRCTVibration.a;
521 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */;
522 | sourceTree = BUILT_PRODUCTS_DIR;
523 | };
524 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = {
525 | isa = PBXReferenceProxy;
526 | fileType = archive.ar;
527 | path = libRCTSettings.a;
528 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */;
529 | sourceTree = BUILT_PRODUCTS_DIR;
530 | };
531 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = {
532 | isa = PBXReferenceProxy;
533 | fileType = archive.ar;
534 | path = libRCTWebSocket.a;
535 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */;
536 | sourceTree = BUILT_PRODUCTS_DIR;
537 | };
538 | 146834041AC3E56700842450 /* libReact.a */ = {
539 | isa = PBXReferenceProxy;
540 | fileType = archive.ar;
541 | path = libReact.a;
542 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
543 | sourceTree = BUILT_PRODUCTS_DIR;
544 | };
545 | 3579C8121CB73B5B0065A834 /* libRNBEMCheckBox.a */ = {
546 | isa = PBXReferenceProxy;
547 | fileType = archive.ar;
548 | path = libRNBEMCheckBox.a;
549 | remoteRef = 3579C8111CB73B5B0065A834 /* PBXContainerItemProxy */;
550 | sourceTree = BUILT_PRODUCTS_DIR;
551 | };
552 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {
553 | isa = PBXReferenceProxy;
554 | fileType = archive.ar;
555 | path = libRCTLinking.a;
556 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */;
557 | sourceTree = BUILT_PRODUCTS_DIR;
558 | };
559 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = {
560 | isa = PBXReferenceProxy;
561 | fileType = archive.ar;
562 | path = libRCTText.a;
563 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;
564 | sourceTree = BUILT_PRODUCTS_DIR;
565 | };
566 | B07681841F5585DE00D094B5 /* libRCTImage-tvOS.a */ = {
567 | isa = PBXReferenceProxy;
568 | fileType = archive.ar;
569 | path = "libRCTImage-tvOS.a";
570 | remoteRef = B07681831F5585DE00D094B5 /* PBXContainerItemProxy */;
571 | sourceTree = BUILT_PRODUCTS_DIR;
572 | };
573 | B07681881F5585DE00D094B5 /* libRCTLinking-tvOS.a */ = {
574 | isa = PBXReferenceProxy;
575 | fileType = archive.ar;
576 | path = "libRCTLinking-tvOS.a";
577 | remoteRef = B07681871F5585DE00D094B5 /* PBXContainerItemProxy */;
578 | sourceTree = BUILT_PRODUCTS_DIR;
579 | };
580 | B076818C1F5585DE00D094B5 /* libRCTNetwork-tvOS.a */ = {
581 | isa = PBXReferenceProxy;
582 | fileType = archive.ar;
583 | path = "libRCTNetwork-tvOS.a";
584 | remoteRef = B076818B1F5585DE00D094B5 /* PBXContainerItemProxy */;
585 | sourceTree = BUILT_PRODUCTS_DIR;
586 | };
587 | B07681901F5585DE00D094B5 /* libRCTSettings-tvOS.a */ = {
588 | isa = PBXReferenceProxy;
589 | fileType = archive.ar;
590 | path = "libRCTSettings-tvOS.a";
591 | remoteRef = B076818F1F5585DE00D094B5 /* PBXContainerItemProxy */;
592 | sourceTree = BUILT_PRODUCTS_DIR;
593 | };
594 | B07681941F5585DE00D094B5 /* libRCTText-tvOS.a */ = {
595 | isa = PBXReferenceProxy;
596 | fileType = archive.ar;
597 | path = "libRCTText-tvOS.a";
598 | remoteRef = B07681931F5585DE00D094B5 /* PBXContainerItemProxy */;
599 | sourceTree = BUILT_PRODUCTS_DIR;
600 | };
601 | B07681991F5585DE00D094B5 /* libRCTWebSocket-tvOS.a */ = {
602 | isa = PBXReferenceProxy;
603 | fileType = archive.ar;
604 | path = "libRCTWebSocket-tvOS.a";
605 | remoteRef = B07681981F5585DE00D094B5 /* PBXContainerItemProxy */;
606 | sourceTree = BUILT_PRODUCTS_DIR;
607 | };
608 | B07681A31F5585DE00D094B5 /* libReact.a */ = {
609 | isa = PBXReferenceProxy;
610 | fileType = archive.ar;
611 | path = libReact.a;
612 | remoteRef = B07681A21F5585DE00D094B5 /* PBXContainerItemProxy */;
613 | sourceTree = BUILT_PRODUCTS_DIR;
614 | };
615 | B07681A51F5585DE00D094B5 /* libyoga.a */ = {
616 | isa = PBXReferenceProxy;
617 | fileType = archive.ar;
618 | path = libyoga.a;
619 | remoteRef = B07681A41F5585DE00D094B5 /* PBXContainerItemProxy */;
620 | sourceTree = BUILT_PRODUCTS_DIR;
621 | };
622 | B07681A71F5585DE00D094B5 /* libyoga.a */ = {
623 | isa = PBXReferenceProxy;
624 | fileType = archive.ar;
625 | path = libyoga.a;
626 | remoteRef = B07681A61F5585DE00D094B5 /* PBXContainerItemProxy */;
627 | sourceTree = BUILT_PRODUCTS_DIR;
628 | };
629 | B07681A91F5585DE00D094B5 /* libcxxreact.a */ = {
630 | isa = PBXReferenceProxy;
631 | fileType = archive.ar;
632 | path = libcxxreact.a;
633 | remoteRef = B07681A81F5585DE00D094B5 /* PBXContainerItemProxy */;
634 | sourceTree = BUILT_PRODUCTS_DIR;
635 | };
636 | B07681AB1F5585DE00D094B5 /* libcxxreact.a */ = {
637 | isa = PBXReferenceProxy;
638 | fileType = archive.ar;
639 | path = libcxxreact.a;
640 | remoteRef = B07681AA1F5585DE00D094B5 /* PBXContainerItemProxy */;
641 | sourceTree = BUILT_PRODUCTS_DIR;
642 | };
643 | B07681AD1F5585DE00D094B5 /* libjschelpers.a */ = {
644 | isa = PBXReferenceProxy;
645 | fileType = archive.ar;
646 | path = libjschelpers.a;
647 | remoteRef = B07681AC1F5585DE00D094B5 /* PBXContainerItemProxy */;
648 | sourceTree = BUILT_PRODUCTS_DIR;
649 | };
650 | B07681AF1F5585DE00D094B5 /* libjschelpers.a */ = {
651 | isa = PBXReferenceProxy;
652 | fileType = archive.ar;
653 | path = libjschelpers.a;
654 | remoteRef = B07681AE1F5585DE00D094B5 /* PBXContainerItemProxy */;
655 | sourceTree = BUILT_PRODUCTS_DIR;
656 | };
657 | /* End PBXReferenceProxy section */
658 |
659 | /* Begin PBXResourcesBuildPhase section */
660 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
661 | isa = PBXResourcesBuildPhase;
662 | buildActionMask = 2147483647;
663 | files = (
664 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
665 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
666 | );
667 | runOnlyForDeploymentPostprocessing = 0;
668 | };
669 | /* End PBXResourcesBuildPhase section */
670 |
671 | /* Begin PBXShellScriptBuildPhase section */
672 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
673 | isa = PBXShellScriptBuildPhase;
674 | buildActionMask = 2147483647;
675 | files = (
676 | );
677 | inputPaths = (
678 | );
679 | name = "Bundle React Native code and images";
680 | outputPaths = (
681 | );
682 | runOnlyForDeploymentPostprocessing = 0;
683 | shellPath = /bin/sh;
684 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
685 | };
686 | /* End PBXShellScriptBuildPhase section */
687 |
688 | /* Begin PBXSourcesBuildPhase section */
689 | 13B07F871A680F5B00A75B9A /* Sources */ = {
690 | isa = PBXSourcesBuildPhase;
691 | buildActionMask = 2147483647;
692 | files = (
693 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
694 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
695 | );
696 | runOnlyForDeploymentPostprocessing = 0;
697 | };
698 | /* End PBXSourcesBuildPhase section */
699 |
700 | /* Begin PBXVariantGroup section */
701 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
702 | isa = PBXVariantGroup;
703 | children = (
704 | 13B07FB21A68108700A75B9A /* Base */,
705 | );
706 | name = LaunchScreen.xib;
707 | path = CheckBox;
708 | sourceTree = "";
709 | };
710 | /* End PBXVariantGroup section */
711 |
712 | /* Begin XCBuildConfiguration section */
713 | 13B07F941A680F5B00A75B9A /* Debug */ = {
714 | isa = XCBuildConfiguration;
715 | buildSettings = {
716 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
717 | DEAD_CODE_STRIPPING = NO;
718 | HEADER_SEARCH_PATHS = (
719 | "$(inherited)",
720 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
721 | "$(SRCROOT)/../node_modules/react-native/React/**",
722 | );
723 | INFOPLIST_FILE = CheckBox/Info.plist;
724 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
725 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
726 | OTHER_LDFLAGS = "-ObjC";
727 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
728 | PRODUCT_NAME = CheckBox;
729 | };
730 | name = Debug;
731 | };
732 | 13B07F951A680F5B00A75B9A /* Release */ = {
733 | isa = XCBuildConfiguration;
734 | buildSettings = {
735 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
736 | HEADER_SEARCH_PATHS = (
737 | "$(inherited)",
738 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
739 | "$(SRCROOT)/../node_modules/react-native/React/**",
740 | );
741 | INFOPLIST_FILE = CheckBox/Info.plist;
742 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
743 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
744 | OTHER_LDFLAGS = "-ObjC";
745 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
746 | PRODUCT_NAME = CheckBox;
747 | };
748 | name = Release;
749 | };
750 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
751 | isa = XCBuildConfiguration;
752 | buildSettings = {
753 | ALWAYS_SEARCH_USER_PATHS = NO;
754 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
755 | CLANG_CXX_LIBRARY = "libc++";
756 | CLANG_ENABLE_MODULES = YES;
757 | CLANG_ENABLE_OBJC_ARC = YES;
758 | CLANG_WARN_BOOL_CONVERSION = YES;
759 | CLANG_WARN_CONSTANT_CONVERSION = YES;
760 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
761 | CLANG_WARN_EMPTY_BODY = YES;
762 | CLANG_WARN_ENUM_CONVERSION = YES;
763 | CLANG_WARN_INFINITE_RECURSION = YES;
764 | CLANG_WARN_INT_CONVERSION = YES;
765 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
766 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
767 | CLANG_WARN_UNREACHABLE_CODE = YES;
768 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
769 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
770 | COPY_PHASE_STRIP = NO;
771 | ENABLE_STRICT_OBJC_MSGSEND = YES;
772 | ENABLE_TESTABILITY = YES;
773 | GCC_C_LANGUAGE_STANDARD = gnu99;
774 | GCC_DYNAMIC_NO_PIC = NO;
775 | GCC_NO_COMMON_BLOCKS = YES;
776 | GCC_OPTIMIZATION_LEVEL = 0;
777 | GCC_PREPROCESSOR_DEFINITIONS = (
778 | "DEBUG=1",
779 | "$(inherited)",
780 | );
781 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
782 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
783 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
784 | GCC_WARN_UNDECLARED_SELECTOR = YES;
785 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
786 | GCC_WARN_UNUSED_FUNCTION = YES;
787 | GCC_WARN_UNUSED_VARIABLE = YES;
788 | HEADER_SEARCH_PATHS = (
789 | "$(inherited)",
790 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
791 | "$(SRCROOT)/../node_modules/react-native/React/**",
792 | );
793 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
794 | MTL_ENABLE_DEBUG_INFO = YES;
795 | ONLY_ACTIVE_ARCH = YES;
796 | SDKROOT = iphoneos;
797 | };
798 | name = Debug;
799 | };
800 | 83CBBA211A601CBA00E9B192 /* Release */ = {
801 | isa = XCBuildConfiguration;
802 | buildSettings = {
803 | ALWAYS_SEARCH_USER_PATHS = NO;
804 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
805 | CLANG_CXX_LIBRARY = "libc++";
806 | CLANG_ENABLE_MODULES = YES;
807 | CLANG_ENABLE_OBJC_ARC = YES;
808 | CLANG_WARN_BOOL_CONVERSION = YES;
809 | CLANG_WARN_CONSTANT_CONVERSION = YES;
810 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
811 | CLANG_WARN_EMPTY_BODY = YES;
812 | CLANG_WARN_ENUM_CONVERSION = YES;
813 | CLANG_WARN_INFINITE_RECURSION = YES;
814 | CLANG_WARN_INT_CONVERSION = YES;
815 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
816 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
817 | CLANG_WARN_UNREACHABLE_CODE = YES;
818 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
819 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
820 | COPY_PHASE_STRIP = YES;
821 | ENABLE_NS_ASSERTIONS = NO;
822 | ENABLE_STRICT_OBJC_MSGSEND = YES;
823 | GCC_C_LANGUAGE_STANDARD = gnu99;
824 | GCC_NO_COMMON_BLOCKS = YES;
825 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
826 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
827 | GCC_WARN_UNDECLARED_SELECTOR = YES;
828 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
829 | GCC_WARN_UNUSED_FUNCTION = YES;
830 | GCC_WARN_UNUSED_VARIABLE = YES;
831 | HEADER_SEARCH_PATHS = (
832 | "$(inherited)",
833 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
834 | "$(SRCROOT)/../node_modules/react-native/React/**",
835 | );
836 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
837 | MTL_ENABLE_DEBUG_INFO = NO;
838 | SDKROOT = iphoneos;
839 | VALIDATE_PRODUCT = YES;
840 | };
841 | name = Release;
842 | };
843 | /* End XCBuildConfiguration section */
844 |
845 | /* Begin XCConfigurationList section */
846 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "CheckBox" */ = {
847 | isa = XCConfigurationList;
848 | buildConfigurations = (
849 | 13B07F941A680F5B00A75B9A /* Debug */,
850 | 13B07F951A680F5B00A75B9A /* Release */,
851 | );
852 | defaultConfigurationIsVisible = 0;
853 | defaultConfigurationName = Release;
854 | };
855 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "CheckBox" */ = {
856 | isa = XCConfigurationList;
857 | buildConfigurations = (
858 | 83CBBA201A601CBA00E9B192 /* Debug */,
859 | 83CBBA211A601CBA00E9B192 /* Release */,
860 | );
861 | defaultConfigurationIsVisible = 0;
862 | defaultConfigurationName = Release;
863 | };
864 | /* End XCConfigurationList section */
865 | };
866 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
867 | }
868 |
--------------------------------------------------------------------------------
/Example/ios/CheckBox.xcodeproj/xcshareddata/xcschemes/CheckBox.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
60 |
61 |
67 |
68 |
69 |
70 |
71 |
72 |
82 |
84 |
90 |
91 |
92 |
93 |
94 |
95 |
101 |
103 |
109 |
110 |
111 |
112 |
114 |
115 |
118 |
119 |
120 |
--------------------------------------------------------------------------------
/Example/ios/CheckBox/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (nonatomic, strong) UIWindow *window;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Example/ios/CheckBox/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "AppDelegate.h"
11 |
12 | #import "RCTRootView.h"
13 |
14 | @implementation AppDelegate
15 |
16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
17 | {
18 | NSURL *jsCodeLocation;
19 |
20 | /**
21 | * Loading JavaScript code - uncomment the one you want.
22 | *
23 | * OPTION 1
24 | * Load from development server. Start the server from the repository root:
25 | *
26 | * $ npm start
27 | *
28 | * To run on device, change `localhost` to the IP address of your computer
29 | * (you can get this by typing `ifconfig` into the terminal and selecting the
30 | * `inet` value under `en0:`) and make sure your computer and iOS device are
31 | * on the same Wi-Fi network.
32 | */
33 |
34 | jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
35 |
36 | /**
37 | * OPTION 2
38 | * Load from pre-bundled file on disk. The static bundle is automatically
39 | * generated by the "Bundle React Native code and images" build step when
40 | * running the project on an actual device or running the project on the
41 | * simulator in the "Release" build configuration.
42 | */
43 |
44 | // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
45 |
46 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
47 | moduleName:@"CheckBox"
48 | initialProperties:nil
49 | launchOptions:launchOptions];
50 |
51 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
52 | UIViewController *rootViewController = [UIViewController new];
53 | rootViewController.view = rootView;
54 | self.window.rootViewController = rootViewController;
55 | [self.window makeKeyAndVisible];
56 | return YES;
57 | }
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/Example/ios/CheckBox/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Example/ios/CheckBox/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "29x29",
5 | "idiom" : "iphone",
6 | "filename" : "app-icon-setting@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "29x29",
11 | "idiom" : "iphone",
12 | "filename" : "app-icon-setting@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "40x40",
17 | "idiom" : "iphone",
18 | "filename" : "app-icon-spotlight@2x.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "40x40",
23 | "idiom" : "iphone",
24 | "filename" : "app-icon-spotlight@3x.png",
25 | "scale" : "3x"
26 | },
27 | {
28 | "size" : "60x60",
29 | "idiom" : "iphone",
30 | "filename" : "app-icon-iphone@2x.png",
31 | "scale" : "2x"
32 | },
33 | {
34 | "size" : "60x60",
35 | "idiom" : "iphone",
36 | "filename" : "app-icon-iphone@3x.png",
37 | "scale" : "3x"
38 | }
39 | ],
40 | "info" : {
41 | "version" : 1,
42 | "author" : "xcode"
43 | }
44 | }
--------------------------------------------------------------------------------
/Example/ios/CheckBox/Images.xcassets/AppIcon.appiconset/app-icon-iphone@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/torifat/react-native-bem-check-box/7e013908f5f68d38c504bf34dd2d6776566b3031/Example/ios/CheckBox/Images.xcassets/AppIcon.appiconset/app-icon-iphone@2x.png
--------------------------------------------------------------------------------
/Example/ios/CheckBox/Images.xcassets/AppIcon.appiconset/app-icon-iphone@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/torifat/react-native-bem-check-box/7e013908f5f68d38c504bf34dd2d6776566b3031/Example/ios/CheckBox/Images.xcassets/AppIcon.appiconset/app-icon-iphone@3x.png
--------------------------------------------------------------------------------
/Example/ios/CheckBox/Images.xcassets/AppIcon.appiconset/app-icon-setting@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/torifat/react-native-bem-check-box/7e013908f5f68d38c504bf34dd2d6776566b3031/Example/ios/CheckBox/Images.xcassets/AppIcon.appiconset/app-icon-setting@2x.png
--------------------------------------------------------------------------------
/Example/ios/CheckBox/Images.xcassets/AppIcon.appiconset/app-icon-setting@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/torifat/react-native-bem-check-box/7e013908f5f68d38c504bf34dd2d6776566b3031/Example/ios/CheckBox/Images.xcassets/AppIcon.appiconset/app-icon-setting@3x.png
--------------------------------------------------------------------------------
/Example/ios/CheckBox/Images.xcassets/AppIcon.appiconset/app-icon-spotlight@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/torifat/react-native-bem-check-box/7e013908f5f68d38c504bf34dd2d6776566b3031/Example/ios/CheckBox/Images.xcassets/AppIcon.appiconset/app-icon-spotlight@2x.png
--------------------------------------------------------------------------------
/Example/ios/CheckBox/Images.xcassets/AppIcon.appiconset/app-icon-spotlight@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/torifat/react-native-bem-check-box/7e013908f5f68d38c504bf34dd2d6776566b3031/Example/ios/CheckBox/Images.xcassets/AppIcon.appiconset/app-icon-spotlight@3x.png
--------------------------------------------------------------------------------
/Example/ios/CheckBox/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | NSAppTransportSecurity
26 |
27 | NSAllowsArbitraryLoads
28 |
29 |
30 | NSLocationWhenInUseUsageDescription
31 |
32 | UILaunchStoryboardName
33 | LaunchScreen
34 | UIRequiredDeviceCapabilities
35 |
36 | armv7
37 |
38 | UISupportedInterfaceOrientations
39 |
40 | UIInterfaceOrientationPortrait
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UIViewControllerBasedStatusBarAppearance
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Example/ios/CheckBox/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import "AppDelegate.h"
13 |
14 | int main(int argc, char * argv[]) {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "CheckBox",
3 | "version": "1.0.0",
4 | "private": true,
5 | "scripts": {
6 | "start": "node node_modules/react-native/local-cli/cli.js start"
7 | },
8 | "dependencies": {
9 | "react": "^15.4.0",
10 | "react-native": "~0.40.0",
11 | "react-native-bem-check-box": "file:../"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # React Native BEMCheckbox
2 | React Native bridge for awesome [BEMCheckBox](https://github.com/Boris-Em/BEMCheckBox)
3 |
4 | **iOS Only**
5 |
6 | 
7 |
8 | ### Content
9 | - [Installation](#installation)
10 | - [Usage example](#usage-example)
11 | - [Basic usage](#basic-usage)
12 | - [Component properties](#component-properties)
13 | - [Changelog](#changelog)
14 | - [License](#license)
15 |
16 | ### Installation
17 | 1. Install package via `npm`:
18 |
19 | ```sh
20 | npm install --save react-native-bem-check-box
21 | ```
22 |
23 | 2. Link your library by one of those ways: either by using `rnpm link` (see more about rnpm [here](https://github.com/rnpm/rnpm)) or like it's [described here](http://facebook.github.io/react-native/docs/linking-libraries-ios.html).
24 | 3. Inside your code include JS part by adding
25 |
26 | ```javascript
27 | import BEMCheckBox from 'react-native-bem-check-box';
28 | ```
29 |
30 | 5. Compile and have fun!
31 |
32 | ### Usage example
33 | You can run built-in example via few simple steps:
34 |
35 | 1. Clone repository
36 | 2. Go to `Example`
37 | 3. Run `npm install && open CheckBox.xcodeproj`
38 | 4. Hit "Run"(`cmd+R`) button on XCode panel
39 |
40 | #### Basic usage
41 |
42 | ```javascript
43 | import BEMCheckBox from 'react-native-bem-check-box';
44 |
45 | this.setState(value)}
47 | />
48 | ```
49 |
50 | ### Component properties
51 |
52 | Check [this section](https://github.com/Boris-Em/BEMCheckBox#customization) in `BEMCheckBox` document
53 |
54 | - `value` (boolean) - The current state. **Defaults to `false`**
55 |
56 | - `lineWidth` (number) - The width of the lines of the check mark and box. **Defaults to `2.0`**
57 |
58 | - `hideBox` (boolean) - boolean to control if the box should be hidden or not. Setting this property to `true` will basically turn the checkbox into a check mark. **Defaults to false**
59 |
60 | - `boxType` (string) - The type of box to use. **Defaults to `circle`**
61 | - `circle`
62 | - `square`
63 |
64 | - `tintColor` (string) - The color of the line around the box when it is Off. **Defaults to `#aaaaaa`**
65 |
66 | - `onCheckColor` (string) - The color of the check mark when it is On. **Defaults to `#007aff`**
67 |
68 | - `onFillColor` (string) - The color of the inside of the box when it is On. **Defaults to `transparent`**
69 |
70 | - `onTintColor` (string) - The color of the line around the box when it is On. **Defaults to `#007aff`**
71 |
72 | - `animationDuration` (number) - The duration in seconds of the animations. **Defaults to `0.5`**
73 |
74 | - `onAnimationType`/`offAnimationType` (string) - The type of animation to use when the checkbox gets checked/unchecked. **Defaults to `stroke`**
75 | - `stroke`
76 | - `fill`
77 | - `bounce`
78 | - `flat`
79 | - `one-stroke`
80 | - `fade`
81 |
82 | - `onValueChange` (function) - every time the check box gets tapped, after its properties are updated, but before the animations are completed.
83 |
84 | - `onAnimationEnd` (function) - every time the check box finishes being animated.
85 |
86 | ## Changelog
87 |
88 | - 0.3.2 Animate on `value` property set
89 | - 0.3.1 Updated podspec
90 | - 0.2.0 Added Example
91 | - 0.1.0 Initial release
92 |
93 | ## License
94 |
95 | Copyright 2016 Rifat Nabi
96 | Licensed under the MIT License.
97 |
--------------------------------------------------------------------------------
/RNBEMCheckBox.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 3579C7EF1CB73AA00065A834 /* BEMAnimationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3579C7EA1CB73AA00065A834 /* BEMAnimationManager.m */; };
11 | 3579C7F01CB73AA00065A834 /* BEMCheckBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 3579C7EC1CB73AA00065A834 /* BEMCheckBox.m */; };
12 | 3579C7F11CB73AA00065A834 /* BEMPathManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3579C7EE1CB73AA00065A834 /* BEMPathManager.m */; };
13 | 3579C7F71CB73ABA0065A834 /* RNBEMCheckBoxManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3579C7F51CB73ABA0065A834 /* RNBEMCheckBoxManager.m */; };
14 | /* End PBXBuildFile section */
15 |
16 | /* Begin PBXCopyFilesBuildPhase section */
17 | 58B511D91A9E6C8500147676 /* Copy Files */ = {
18 | isa = PBXCopyFilesBuildPhase;
19 | buildActionMask = 2147483647;
20 | dstPath = "include/$(PRODUCT_NAME)";
21 | dstSubfolderSpec = 16;
22 | files = (
23 | );
24 | name = "Copy Files";
25 | runOnlyForDeploymentPostprocessing = 0;
26 | };
27 | /* End PBXCopyFilesBuildPhase section */
28 |
29 | /* Begin PBXFileReference section */
30 | 134814201AA4EA6300B7C361 /* libRNBEMCheckBox.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNBEMCheckBox.a; sourceTree = BUILT_PRODUCTS_DIR; };
31 | 3579C7E91CB73AA00065A834 /* BEMAnimationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BEMAnimationManager.h; path = BEMCheckBox/BEMAnimationManager.h; sourceTree = ""; };
32 | 3579C7EA1CB73AA00065A834 /* BEMAnimationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BEMAnimationManager.m; path = BEMCheckBox/BEMAnimationManager.m; sourceTree = ""; };
33 | 3579C7EB1CB73AA00065A834 /* BEMCheckBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BEMCheckBox.h; path = BEMCheckBox/BEMCheckBox.h; sourceTree = ""; };
34 | 3579C7EC1CB73AA00065A834 /* BEMCheckBox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BEMCheckBox.m; path = BEMCheckBox/BEMCheckBox.m; sourceTree = ""; };
35 | 3579C7ED1CB73AA00065A834 /* BEMPathManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BEMPathManager.h; path = BEMCheckBox/BEMPathManager.h; sourceTree = ""; };
36 | 3579C7EE1CB73AA00065A834 /* BEMPathManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BEMPathManager.m; path = BEMCheckBox/BEMPathManager.m; sourceTree = ""; };
37 | 3579C7F41CB73ABA0065A834 /* RNBEMCheckBoxManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNBEMCheckBoxManager.h; path = RNBEMCheckBox/RNBEMCheckBoxManager.h; sourceTree = ""; };
38 | 3579C7F51CB73ABA0065A834 /* RNBEMCheckBoxManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RNBEMCheckBoxManager.m; path = RNBEMCheckBox/RNBEMCheckBoxManager.m; sourceTree = ""; };
39 | /* End PBXFileReference section */
40 |
41 | /* Begin PBXFrameworksBuildPhase section */
42 | 58B511D81A9E6C8500147676 /* Frameworks */ = {
43 | isa = PBXFrameworksBuildPhase;
44 | buildActionMask = 2147483647;
45 | files = (
46 | );
47 | runOnlyForDeploymentPostprocessing = 0;
48 | };
49 | /* End PBXFrameworksBuildPhase section */
50 |
51 | /* Begin PBXGroup section */
52 | 134814211AA4EA7D00B7C361 /* Products */ = {
53 | isa = PBXGroup;
54 | children = (
55 | 134814201AA4EA6300B7C361 /* libRNBEMCheckBox.a */,
56 | );
57 | name = Products;
58 | sourceTree = "";
59 | };
60 | 3579C7D41CB739C90065A834 /* BEMCheckBox */ = {
61 | isa = PBXGroup;
62 | children = (
63 | 3579C7E91CB73AA00065A834 /* BEMAnimationManager.h */,
64 | 3579C7EA1CB73AA00065A834 /* BEMAnimationManager.m */,
65 | 3579C7EB1CB73AA00065A834 /* BEMCheckBox.h */,
66 | 3579C7EC1CB73AA00065A834 /* BEMCheckBox.m */,
67 | 3579C7ED1CB73AA00065A834 /* BEMPathManager.h */,
68 | 3579C7EE1CB73AA00065A834 /* BEMPathManager.m */,
69 | );
70 | name = BEMCheckBox;
71 | sourceTree = "";
72 | };
73 | 58B511D21A9E6C8500147676 = {
74 | isa = PBXGroup;
75 | children = (
76 | 3579C7D41CB739C90065A834 /* BEMCheckBox */,
77 | 3579C7F41CB73ABA0065A834 /* RNBEMCheckBoxManager.h */,
78 | 3579C7F51CB73ABA0065A834 /* RNBEMCheckBoxManager.m */,
79 | 134814211AA4EA7D00B7C361 /* Products */,
80 | );
81 | sourceTree = "";
82 | };
83 | /* End PBXGroup section */
84 |
85 | /* Begin PBXNativeTarget section */
86 | 58B511DA1A9E6C8500147676 /* RNBEMCheckBox */ = {
87 | isa = PBXNativeTarget;
88 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNBEMCheckBox" */;
89 | buildPhases = (
90 | 58B511D81A9E6C8500147676 /* Frameworks */,
91 | 58B511D71A9E6C8500147676 /* Sources */,
92 | 58B511D91A9E6C8500147676 /* Copy Files */,
93 | );
94 | buildRules = (
95 | );
96 | dependencies = (
97 | );
98 | name = RNBEMCheckBox;
99 | productName = RCTDataManager;
100 | productReference = 134814201AA4EA6300B7C361 /* libRNBEMCheckBox.a */;
101 | productType = "com.apple.product-type.library.static";
102 | };
103 | /* End PBXNativeTarget section */
104 |
105 | /* Begin PBXProject section */
106 | 58B511D31A9E6C8500147676 /* Project object */ = {
107 | isa = PBXProject;
108 | attributes = {
109 | LastUpgradeCheck = 0730;
110 | ORGANIZATIONNAME = Facebook;
111 | TargetAttributes = {
112 | 58B511DA1A9E6C8500147676 = {
113 | CreatedOnToolsVersion = 6.1.1;
114 | };
115 | };
116 | };
117 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNBEMCheckBox" */;
118 | compatibilityVersion = "Xcode 3.2";
119 | developmentRegion = English;
120 | hasScannedForEncodings = 0;
121 | knownRegions = (
122 | en,
123 | );
124 | mainGroup = 58B511D21A9E6C8500147676;
125 | productRefGroup = 58B511D21A9E6C8500147676;
126 | projectDirPath = "";
127 | projectRoot = "";
128 | targets = (
129 | 58B511DA1A9E6C8500147676 /* RNBEMCheckBox */,
130 | );
131 | };
132 | /* End PBXProject section */
133 |
134 | /* Begin PBXSourcesBuildPhase section */
135 | 58B511D71A9E6C8500147676 /* Sources */ = {
136 | isa = PBXSourcesBuildPhase;
137 | buildActionMask = 2147483647;
138 | files = (
139 | 3579C7EF1CB73AA00065A834 /* BEMAnimationManager.m in Sources */,
140 | 3579C7F71CB73ABA0065A834 /* RNBEMCheckBoxManager.m in Sources */,
141 | 3579C7F11CB73AA00065A834 /* BEMPathManager.m in Sources */,
142 | 3579C7F01CB73AA00065A834 /* BEMCheckBox.m in Sources */,
143 | );
144 | runOnlyForDeploymentPostprocessing = 0;
145 | };
146 | /* End PBXSourcesBuildPhase section */
147 |
148 | /* Begin XCBuildConfiguration section */
149 | 58B511ED1A9E6C8500147676 /* Debug */ = {
150 | isa = XCBuildConfiguration;
151 | buildSettings = {
152 | ALWAYS_SEARCH_USER_PATHS = NO;
153 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
154 | CLANG_CXX_LIBRARY = "libc++";
155 | CLANG_ENABLE_MODULES = YES;
156 | CLANG_ENABLE_OBJC_ARC = YES;
157 | CLANG_WARN_BOOL_CONVERSION = YES;
158 | CLANG_WARN_CONSTANT_CONVERSION = YES;
159 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
160 | CLANG_WARN_EMPTY_BODY = YES;
161 | CLANG_WARN_ENUM_CONVERSION = YES;
162 | CLANG_WARN_INT_CONVERSION = YES;
163 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
164 | CLANG_WARN_UNREACHABLE_CODE = YES;
165 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
166 | COPY_PHASE_STRIP = NO;
167 | ENABLE_STRICT_OBJC_MSGSEND = YES;
168 | ENABLE_TESTABILITY = YES;
169 | GCC_C_LANGUAGE_STANDARD = gnu99;
170 | GCC_DYNAMIC_NO_PIC = NO;
171 | GCC_OPTIMIZATION_LEVEL = 0;
172 | GCC_PREPROCESSOR_DEFINITIONS = (
173 | "DEBUG=1",
174 | "$(inherited)",
175 | );
176 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
177 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
178 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
179 | GCC_WARN_UNDECLARED_SELECTOR = YES;
180 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
181 | GCC_WARN_UNUSED_FUNCTION = YES;
182 | GCC_WARN_UNUSED_VARIABLE = YES;
183 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
184 | MTL_ENABLE_DEBUG_INFO = YES;
185 | ONLY_ACTIVE_ARCH = YES;
186 | SDKROOT = iphoneos;
187 | };
188 | name = Debug;
189 | };
190 | 58B511EE1A9E6C8500147676 /* Release */ = {
191 | isa = XCBuildConfiguration;
192 | buildSettings = {
193 | ALWAYS_SEARCH_USER_PATHS = NO;
194 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
195 | CLANG_CXX_LIBRARY = "libc++";
196 | CLANG_ENABLE_MODULES = YES;
197 | CLANG_ENABLE_OBJC_ARC = YES;
198 | CLANG_WARN_BOOL_CONVERSION = YES;
199 | CLANG_WARN_CONSTANT_CONVERSION = YES;
200 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
201 | CLANG_WARN_EMPTY_BODY = YES;
202 | CLANG_WARN_ENUM_CONVERSION = YES;
203 | CLANG_WARN_INT_CONVERSION = YES;
204 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
205 | CLANG_WARN_UNREACHABLE_CODE = YES;
206 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
207 | COPY_PHASE_STRIP = YES;
208 | ENABLE_NS_ASSERTIONS = NO;
209 | ENABLE_STRICT_OBJC_MSGSEND = YES;
210 | GCC_C_LANGUAGE_STANDARD = gnu99;
211 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
212 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
213 | GCC_WARN_UNDECLARED_SELECTOR = YES;
214 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
215 | GCC_WARN_UNUSED_FUNCTION = YES;
216 | GCC_WARN_UNUSED_VARIABLE = YES;
217 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
218 | MTL_ENABLE_DEBUG_INFO = NO;
219 | SDKROOT = iphoneos;
220 | VALIDATE_PRODUCT = YES;
221 | };
222 | name = Release;
223 | };
224 | 58B511F01A9E6C8500147676 /* Debug */ = {
225 | isa = XCBuildConfiguration;
226 | buildSettings = {
227 | HEADER_SEARCH_PATHS = (
228 | "$(inherited)",
229 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
230 | "$(SRCROOT)/../../React/**",
231 | "$(SRCROOT)/../../node_modules/react-native/React/**",
232 | );
233 | LIBRARY_SEARCH_PATHS = "$(inherited)";
234 | OTHER_LDFLAGS = "-ObjC";
235 | PRODUCT_NAME = RNBEMCheckBox;
236 | SKIP_INSTALL = YES;
237 | USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../react-native/React/**";
238 | };
239 | name = Debug;
240 | };
241 | 58B511F11A9E6C8500147676 /* Release */ = {
242 | isa = XCBuildConfiguration;
243 | buildSettings = {
244 | HEADER_SEARCH_PATHS = (
245 | "$(inherited)",
246 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
247 | "$(SRCROOT)/../../React/**",
248 | "$(SRCROOT)/../../node_modules/react-native/React/**",
249 | );
250 | LIBRARY_SEARCH_PATHS = "$(inherited)";
251 | OTHER_LDFLAGS = "-ObjC";
252 | PRODUCT_NAME = RNBEMCheckBox;
253 | SKIP_INSTALL = YES;
254 | USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../react-native/React/**";
255 | };
256 | name = Release;
257 | };
258 | /* End XCBuildConfiguration section */
259 |
260 | /* Begin XCConfigurationList section */
261 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNBEMCheckBox" */ = {
262 | isa = XCConfigurationList;
263 | buildConfigurations = (
264 | 58B511ED1A9E6C8500147676 /* Debug */,
265 | 58B511EE1A9E6C8500147676 /* Release */,
266 | );
267 | defaultConfigurationIsVisible = 0;
268 | defaultConfigurationName = Release;
269 | };
270 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNBEMCheckBox" */ = {
271 | isa = XCConfigurationList;
272 | buildConfigurations = (
273 | 58B511F01A9E6C8500147676 /* Debug */,
274 | 58B511F11A9E6C8500147676 /* Release */,
275 | );
276 | defaultConfigurationIsVisible = 0;
277 | defaultConfigurationName = Release;
278 | };
279 | /* End XCConfigurationList section */
280 | };
281 | rootObject = 58B511D31A9E6C8500147676 /* Project object */;
282 | }
283 |
--------------------------------------------------------------------------------
/RNBEMCheckBox.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/RNBEMCheckBox.xcodeproj/project.xcworkspace/xcuserdata/rifat.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/torifat/react-native-bem-check-box/7e013908f5f68d38c504bf34dd2d6776566b3031/RNBEMCheckBox.xcodeproj/project.xcworkspace/xcuserdata/rifat.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/RNBEMCheckBox.xcodeproj/xcuserdata/rifat.xcuserdatad/xcschemes/RNBEMCheckBox.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/RNBEMCheckBox.xcodeproj/xcuserdata/rifat.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | RNBEMCheckBox.xcscheme
8 |
9 | isShown
10 |
11 | orderHint
12 | 11
13 |
14 |
15 | SuppressBuildableAutocreation
16 |
17 | 58B511DA1A9E6C8500147676
18 |
19 | primary
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/RNBEMCheckBox/RNBEMCheckBoxManager.h:
--------------------------------------------------------------------------------
1 | #import "RCTViewManager.h"
2 |
3 | @interface RNBEMCheckBoxManager : RCTViewManager
4 |
5 | @end
6 |
--------------------------------------------------------------------------------
/RNBEMCheckBox/RNBEMCheckBoxManager.m:
--------------------------------------------------------------------------------
1 | #import "BEMCheckBox.h"
2 | #import "RNBEMCheckBoxManager.h"
3 |
4 | #import
5 | #import
6 | #import
7 | #import
8 |
9 | @implementation RCTConvert (BEMCheckBox)
10 |
11 | RCT_ENUM_CONVERTER(BEMBoxType, (@{
12 | @"circle": @(BEMBoxTypeCircle),
13 | @"square": @(BEMBoxTypeSquare),
14 | }), BEMBoxTypeCircle, integerValue);
15 |
16 |
17 | RCT_ENUM_CONVERTER(BEMAnimationType, (@{
18 | @"stroke": @(BEMAnimationTypeStroke),
19 | @"fill": @(BEMAnimationTypeFill),
20 | @"bounce": @(BEMAnimationTypeBounce),
21 | @"flat": @(BEMAnimationTypeFlat),
22 | @"one-stroke": @(BEMAnimationTypeOneStroke),
23 | @"fade": @(BEMAnimationTypeFade),
24 | }), BEMAnimationTypeStroke, integerValue);
25 |
26 | @end
27 |
28 | @interface RNBEMCheckBoxManager()
29 | @end
30 |
31 | @implementation RNBEMCheckBoxManager
32 |
33 | RCT_EXPORT_MODULE();
34 |
35 | - (UIView *)view
36 | {
37 | BEMCheckBox *_checkBox = _checkBox = [BEMCheckBox new];
38 | _checkBox.delegate = self;
39 | return _checkBox;
40 | }
41 |
42 | #pragma mark BEMCheckBoxDelegate
43 | - (void)didTapCheckBox:(BEMCheckBox*)sender {
44 | NSDictionary *event = @{
45 | @"target": sender.reactTag,
46 | @"value": @(sender.on),
47 | @"name": @"tap",
48 | };
49 | [self.bridge.eventDispatcher sendInputEventWithName:@"topChange" body:event];
50 | }
51 |
52 | - (void)animationDidStopForCheckBox:(BEMCheckBox *)sender {
53 | NSDictionary *event = @{
54 | @"target": sender.reactTag,
55 | @"value": @(sender.on),
56 | @"name": @"animation",
57 | };
58 | [self.bridge.eventDispatcher sendInputEventWithName:@"topChange" body:event];
59 | }
60 |
61 | RCT_CUSTOM_VIEW_PROPERTY(value, BOOL, BEMCheckBox) {
62 | [view setOn:[RCTConvert BOOL:json] animated:YES];
63 | }
64 |
65 | RCT_EXPORT_VIEW_PROPERTY(lineWidth, CGFloat);
66 | RCT_EXPORT_VIEW_PROPERTY(hideBox, BOOL);
67 | RCT_REMAP_VIEW_PROPERTY(boxType, boxType, BEMBoxType);
68 | RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor);
69 | RCT_EXPORT_VIEW_PROPERTY(onCheckColor, UIColor);
70 | RCT_EXPORT_VIEW_PROPERTY(onFillColor, UIColor);
71 | RCT_EXPORT_VIEW_PROPERTY(onTintColor, UIColor);
72 |
73 | RCT_EXPORT_VIEW_PROPERTY(animationDuration, CGFloat);
74 | RCT_REMAP_VIEW_PROPERTY(onAnimationType, onAnimationType, BEMAnimationType);
75 | RCT_REMAP_VIEW_PROPERTY(offAnimationType, offAnimationType, BEMAnimationType);
76 |
77 | @end
78 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-bem-check-box",
3 | "version": "1.0.0",
4 | "description": "React Native bridge for BEMCheckBox",
5 | "main": "BEMCheckBox.ios.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git@github.com:torifat/react-native-bem-check-box.git"
12 | },
13 | "keywords": [
14 | "react-native",
15 | "ios",
16 | "react-component"
17 | ],
18 | "author": "Rifat Nabi (https://github.com/torifat)",
19 | "license": "MIT",
20 | "bugs": {
21 | "url": "https://github.com/torifat/react-native-bem-check-box/issues"
22 | },
23 | "homepage": "https://github.com/torifat/react-native-bem-check-box",
24 | "peerDependencies": {
25 | "react-native": "~0.40.0"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/torifat/react-native-bem-check-box/7e013908f5f68d38c504bf34dd2d6776566b3031/preview.gif
--------------------------------------------------------------------------------
/react-native-bem-check-box.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "react-native-bem-check-box"
3 | s.version = "1.0.0"
4 | s.summary = "React Native bridge for BEMCheckBox"
5 | s.homepage = "https://github.com/torifat/react-native-bem-check-box"
6 | s.license = "MIT"
7 | s.author = { "Rifat Nabi" => "to.rifat@gmail.com" }
8 | s.source = { :git => "https://github.com/torifat/react-native-bem-check-box.git", :tag => s.version }
9 |
10 | s.platform = :ios, "7.0"
11 | s.requires_arc = true
12 |
13 | s.source_files = "RNBEMCheckBox/*.{h,m}", "BEMCheckBox/*.{h,m}"
14 |
15 | s.dependency "React"
16 | end
17 |
--------------------------------------------------------------------------------