Visitar URL original
Modify public API methods to unify vetical/horizontal behavior · orta/ORStackView@9735301 · GitHub
Skip to content

Commit 9735301

Browse files
committed
Modify public API methods to unify vetical/horizontal behavior
1 parent 85247bf commit 9735301

10 files changed

Lines changed: 79 additions & 79 deletions

‎Classes/ios/ORStackView.h‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,33 @@ typedef NS_ENUM(NSUInteger, ORStackViewDirection) {
1818

1919
/// Adds a view to the heirarchy, if it's the first it is
2020
/// attached to the top, otherwise to the view above.
21-
- (void)addSubview:(UIView *)view withTopMargin:(CGFloat)margin;
21+
- (void)addSubview:(UIView *)view withStartMargin:(CGFloat)margin;
2222

2323
/// Adds a view to the heirarchy like addSubview:withTopMargin:
2424
/// will also center and apply side margins as insets from edge
25-
- (void)addSubview:(UIView *)view withTopMargin:(CGFloat)topMargin sideMargin:(CGFloat)sideMargin;
25+
- (void)addSubview:(UIView *)view withStartMargin:(CGFloat)topMargin sideMargin:(CGFloat)sideMargin;
2626

2727
/// Adds a view controller's view to the stack heirarchy
28-
- (void)addViewController:(UIViewController *)viewController toParent:(UIViewController *)parentViewController withTopMargin:(CGFloat)margin;
28+
- (void)addViewController:(UIViewController *)viewController toParent:(UIViewController *)parentViewController withStartMargin:(CGFloat)margin;
2929

3030
/// Adds a view controller's view to the stack heirarchy, and applys edge insets
31-
- (void)addViewController:(UIViewController *)viewController toParent:(UIViewController *)parentViewController withTopMargin:(CGFloat)margin sideMargin:(CGFloat)sideMargin;
31+
- (void)addViewController:(UIViewController *)viewController toParent:(UIViewController *)parentViewController withStartMargin:(CGFloat)margin sideMargin:(CGFloat)sideMargin;
3232

3333

3434
// Note: These indexes are not z-order, but stack order.
3535
// z-index ordering can be done with the UIView methods bringSubviewToFront:
3636

3737
/// Insert a subview at an arbitrary index in the stack's order
38-
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index withTopMargin:(CGFloat)margin;
38+
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index withStartMargin:(CGFloat)margin;
3939

4040
/// Inserts a subview and centeres it
41-
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index withTopMargin:(CGFloat)topMargin sideMargin:(CGFloat)sideMargin;
41+
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index withStartMargin:(CGFloat)topMargin sideMargin:(CGFloat)sideMargin;
4242

4343
/// Insert a subview below another view, or at the end if it cannot be found
44-
- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview withTopMargin:(CGFloat)margin;
44+
- (void)insertSubview:(UIView *)view afterSubview:(UIView *)siblingSubview withStartMargin:(CGFloat)margin;
4545

4646
/// Insert a subview above another view, will assert if view is not found
47-
- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview withTopMargin:(CGFloat)margin;
47+
- (void)insertSubview:(UIView *)view beforeSubview:(UIView *)siblingSubview withStartMargin:(CGFloat)margin;
4848

4949
/// Remove a subview from the Stack View
5050
- (void)removeSubview:(UIView *)subview;

‎Classes/ios/ORStackView.m‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,51 +103,51 @@ - (void)updateConstraints
103103

104104
#pragma mark - Adding Subviews
105105

106-
- (void)addSubview:(UIView *)view withTopMargin:(CGFloat)margin
106+
- (void)addSubview:(UIView *)view withStartMargin:(CGFloat)margin
107107
{
108-
[self _addSubview:view withBeforetMargin:margin centered:NO sideMargin:0];
108+
[self _addSubview:view withStartMargin:margin centered:NO sideMargin:0];
109109
}
110110

111-
- (void)addSubview:(UIView *)view withTopMargin:(CGFloat)topMargin sideMargin:(CGFloat)sideMargin
111+
- (void)addSubview:(UIView *)view withStartMargin:(CGFloat)startMargin sideMargin:(CGFloat)sideMargin
112112
{
113-
[self _addSubview:view withBeforetMargin:topMargin centered:YES sideMargin:sideMargin];
113+
[self _addSubview:view withStartMargin:startMargin centered:YES sideMargin:sideMargin];
114114
}
115115

116-
- (void)_addSubview:(UIView *)view withBeforetMargin:(CGFloat)beforeMargin centered:(BOOL)centered sideMargin:(CGFloat)sideMargin
116+
- (void)_addSubview:(UIView *)view withStartMargin:(CGFloat)startMargin centered:(BOOL)centered sideMargin:(CGFloat)sideMargin
117117
{
118118
NSInteger index = self.viewStack.count;
119-
[self _insertSubview:view atIndex:index withBeforeMargin:beforeMargin centered:centered sideMargin:sideMargin];
119+
[self _insertSubview:view atIndex:index withStartMargin:startMargin centered:centered sideMargin:sideMargin];
120120
}
121121

122122
#pragma mark - Inserting Subviews
123123

124-
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index withTopMargin:(CGFloat)margin;
124+
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index withStartMargin:(CGFloat)margin;
125125
{
126-
[self _insertSubview:view atIndex:index withBeforeMargin:margin centered:NO sideMargin:0];
126+
[self _insertSubview:view atIndex:index withStartMargin:margin centered:NO sideMargin:0];
127127
}
128128

129-
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index withTopMargin:(CGFloat)topMargin sideMargin:(CGFloat)sideMargin
129+
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index withStartMargin:(CGFloat)startMargin sideMargin:(CGFloat)sideMargin
130130
{
131-
[self _insertSubview:view atIndex:index withBeforeMargin:topMargin centered:YES sideMargin:sideMargin];
131+
[self _insertSubview:view atIndex:index withStartMargin:startMargin centered:YES sideMargin:sideMargin];
132132
}
133133

134134

135-
- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview withTopMargin:(CGFloat)margin
135+
- (void)insertSubview:(UIView *)view afterSubview:(UIView *)siblingSubview withStartMargin:(CGFloat)margin
136136
{
137137
BOOL hasSibling = [self.subviews containsObject:siblingSubview];
138138
NSInteger index = hasSibling ? [self indexOfView:siblingSubview] : self.viewStack.count;
139-
[self _insertSubview:view atIndex:index withBeforeMargin:margin centered:NO sideMargin:0];
139+
[self _insertSubview:view atIndex:index withStartMargin:margin centered:NO sideMargin:0];
140140
}
141141

142-
- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview withTopMargin:(CGFloat)margin
142+
- (void)insertSubview:(UIView *)view beforeSubview:(UIView *)siblingSubview withStartMargin:(CGFloat)margin
143143
{
144144
NSAssert([self.subviews containsObject:siblingSubview], @"SiblingSubview not found in ORStackView");
145145

146146
NSInteger index = [self indexOfView:siblingSubview] - 1;
147-
[self _insertSubview:view atIndex:index withBeforeMargin:margin centered:NO sideMargin:0];
147+
[self _insertSubview:view atIndex:index withStartMargin:margin centered:NO sideMargin:0];
148148
}
149149

150-
- (void)_insertSubview:(UIView *)view atIndex:(NSInteger)index withBeforeMargin:(CGFloat)beforeMargin centered:(BOOL)centered sideMargin:(CGFloat)sideMargin
150+
- (void)_insertSubview:(UIView *)view atIndex:(NSInteger)index withStartMargin:(CGFloat)startMargin centered:(BOOL)centered sideMargin:(CGFloat)sideMargin
151151
{
152152
NSParameterAssert(view);
153153
if ([self.subviews containsObject:view]) return;
@@ -156,7 +156,7 @@ - (void)_insertSubview:(UIView *)view atIndex:(NSInteger)index withBeforeMargin:
156156

157157
StackView *stackView = [[StackView alloc] init];
158158
stackView.view = view;
159-
stackView.constant = beforeMargin;
159+
stackView.constant = startMargin;
160160
[self.viewStack insertObject:stackView atIndex:index];
161161

162162
if (centered) {
@@ -212,19 +212,19 @@ - (void)performBatchUpdates:(void (^)(void))updates;
212212
[self setNeedsUpdateConstraints];
213213
}
214214

215-
- (void)addViewController:(UIViewController *)viewController toParent:(UIViewController *)parentViewController withTopMargin:(CGFloat)margin
215+
- (void)addViewController:(UIViewController *)viewController toParent:(UIViewController *)parentViewController withStartMargin:(CGFloat)margin
216216
{
217217
[viewController willMoveToParentViewController:parentViewController];
218218
[parentViewController addChildViewController:viewController];
219-
[self addSubview:viewController.view withTopMargin:margin];
219+
[self addSubview:viewController.view withStartMargin:margin];
220220
[viewController didMoveToParentViewController:parentViewController];
221221
}
222222

223-
- (void)addViewController:(UIViewController *)viewController toParent:(UIViewController *)parentViewController withTopMargin:(CGFloat)margin sideMargin:(CGFloat)sideMargin;
223+
- (void)addViewController:(UIViewController *)viewController toParent:(UIViewController *)parentViewController withStartMargin:(CGFloat)margin sideMargin:(CGFloat)sideMargin;
224224
{
225225
[viewController willMoveToParentViewController:parentViewController];
226226
[parentViewController addChildViewController:viewController];
227-
[self addSubview:viewController.view withTopMargin:margin sideMargin:sideMargin];
227+
[self addSubview:viewController.view withStartMargin:margin sideMargin:sideMargin];
228228
[viewController didMoveToParentViewController:parentViewController];
229229
}
230230

‎Classes/ios/ORTagBasedAutoStackView.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616

1717

1818
// Please don't use the insert methods on this class
19-
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index withTopMargin:(CGFloat)margin __attribute__((unavailable("Inserting subviews is not supported on ORTagBasedAutoStackView.")));
19+
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index withStartMargin:(CGFloat)margin __attribute__((unavailable("Inserting subviews is not supported on ORTagBasedAutoStackView.")));
2020

2121
// Please don't use the insert methods on this class
22-
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index withTopMargin:(CGFloat)topMargin sideMargin:(CGFloat)sideMargin __attribute__((unavailable("Inserting subviews is not supported on ORTagBasedAutoStackView.")));
22+
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index withStartMargin:(CGFloat)topMargin sideMargin:(CGFloat)sideMargin __attribute__((unavailable("Inserting subviews is not supported on ORTagBasedAutoStackView.")));
2323

2424
// Please don't use the insert methods on this class
25-
- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview withTopMargin:(CGFloat)margin __attribute__((unavailable("Inserting subviews is not supported on ORTagBasedAutoStackView.")));
25+
- (void)insertSubview:(UIView *)view afterSubview:(UIView *)siblingSubview withStartMargin:(CGFloat)margin __attribute__((unavailable("Inserting subviews is not supported on ORTagBasedAutoStackView.")));
2626

2727
// Please don't use the insert methods on this class
28-
- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview withTopMargin:(CGFloat)margin __attribute__((unavailable("Inserting subviews is not supported on ORTagBasedAutoStackView.")));
28+
- (void)insertSubview:(UIView *)view beforeSubview:(UIView *)siblingSubview withStartMargin:(CGFloat)margin __attribute__((unavailable("Inserting subviews is not supported on ORTagBasedAutoStackView.")));
2929

3030
@end

‎Classes/ios/ORTagBasedAutoStackView.m‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
@implementation ORTagBasedAutoStackView
1313

14-
- (void)_addSubview:(UIView *)view withBeforetMargin:(CGFloat)topMargin centered:(BOOL)centered sideMargin:(CGFloat)sideMargin
14+
- (void)_addSubview:(UIView *)view withStartMargin:(CGFloat)topMargin centered:(BOOL)centered sideMargin:(CGFloat)sideMargin
1515
{
1616
NSInteger index = self.viewStack.count;
1717
for (StackView *stackView in self.viewStack) {
@@ -21,7 +21,7 @@ - (void)_addSubview:(UIView *)view withBeforetMargin:(CGFloat)topMargin centered
2121
}
2222
}
2323

24-
[self _insertSubview:view atIndex:MAX(0, index) withBeforeMargin:topMargin centered:centered sideMargin:sideMargin];
24+
[self _insertSubview:view atIndex:MAX(0, index) withStartMargin:topMargin centered:centered sideMargin:sideMargin];
2525
}
2626

2727
@end

‎Classes/ios/private/ORStackView+Private.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
@property (nonatomic, strong) NSMutableArray *viewStack;
2323

2424
// Methods that allow subclasses to make changes around how views are inserted.
25-
- (void)_addSubview:(UIView *)view withBeforetMargin:(CGFloat)beforeMargin centered:(BOOL)centered sideMargin:(CGFloat)sideMargin;
25+
- (void)_addSubview:(UIView *)view withStartMargin:(CGFloat)startMargin centered:(BOOL)centered sideMargin:(CGFloat)sideMargin;
2626

2727
// Methods that allow subclasses to make changes around how views are inserted.
28-
- (void)_insertSubview:(UIView *)view atIndex:(NSInteger)index withBeforeMargin:(CGFloat)beforeMargin centered:(BOOL)centered sideMargin:(CGFloat)sideMargin;
28+
- (void)_insertSubview:(UIView *)view atIndex:(NSInteger)index withStartMargin:(CGFloat)startMargin centered:(BOOL)centered sideMargin:(CGFloat)sideMargin;
2929
@end

‎ORStackViewExample/ORFifthViewController.m‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,21 +85,21 @@ - (void)viewDidLoad
8585
ORColourView *right3 = [[ORColourView alloc] init];
8686
right3.text = @"a view";
8787
right3.fakeContentSize = (CGSize){ UIViewNoIntrinsicMetric , 50};
88-
89-
[view4.leftStack addSubview:left1 withTopMargin:0.0 sideMargin:10.0];
90-
[view4.leftStack addSubview:left2 withTopMargin:10.0 sideMargin:5.0];
91-
[view4.leftStack addSubview:left3 withTopMargin:10.0 sideMargin:15.0];
92-
[view4.rightStack addSubview:right1 withTopMargin:0.0 sideMargin:15.0];
93-
[view4.rightStack addSubview:right2 withTopMargin:10.0 sideMargin:10.0];
94-
[view4.rightStack addSubview:right3 withTopMargin:10.0 sideMargin:5.0];
95-
96-
[self.view.stackView addSubview:view1 withTopMargin:20.0 sideMargin:40.0];
97-
[self.view.stackView addSubview:view2 withTopMargin:10.0 sideMargin:30.0];
98-
[self.view.stackView addSubview:view3 withTopMargin:10.0 sideMargin:35.0];
99-
[self.view.stackView addSubview:view4 withTopMargin:15.0 sideMargin:30.0];
100-
[self.view.stackView addSubview:view5 withTopMargin:20.0 sideMargin:15.0];
101-
[self.view.stackView addSubview:view6 withTopMargin:10.0 sideMargin:20.0];
102-
[self.view.stackView addSubview:view7 withTopMargin:15.0 sideMargin:30.0];
88+
89+
[view4.leftStack addSubview:left1 withStartMargin:0.0 sideMargin:10.0];
90+
[view4.leftStack addSubview:left2 withStartMargin:10.0 sideMargin:5.0];
91+
[view4.leftStack addSubview:left3 withStartMargin:10.0 sideMargin:15.0];
92+
[view4.rightStack addSubview:right1 withStartMargin:0.0 sideMargin:15.0];
93+
[view4.rightStack addSubview:right2 withStartMargin:10.0 sideMargin:10.0];
94+
[view4.rightStack addSubview:right3 withStartMargin:10.0 sideMargin:5.0];
95+
96+
[self.view.stackView addSubview:view1 withStartMargin:20.0 sideMargin:40.0];
97+
[self.view.stackView addSubview:view2 withStartMargin:10.0 sideMargin:30.0];
98+
[self.view.stackView addSubview:view3 withStartMargin:10.0 sideMargin:35.0];
99+
[self.view.stackView addSubview:view4 withStartMargin:15.0 sideMargin:30.0];
100+
[self.view.stackView addSubview:view5 withStartMargin:20.0 sideMargin:15.0];
101+
[self.view.stackView addSubview:view6 withStartMargin:10.0 sideMargin:20.0];
102+
[self.view.stackView addSubview:view7 withStartMargin:15.0 sideMargin:30.0];
103103

104104
}
105105

@@ -108,7 +108,7 @@ - (void)addView:(UITapGestureRecognizer *)gesture
108108
ORColourView *view = [[ORColourView alloc] init];
109109
view.text = @"Tap to remove";
110110
view.fakeContentSize = (CGSize){ UIViewNoIntrinsicMetric , 40 };
111-
[(ORStackView *)gesture.view.superview addSubview:view withTopMargin:5.0 sideMargin:10.0];
111+
[(ORStackView *)gesture.view.superview addSubview:view withStartMargin:5.0 sideMargin:10.0];
112112

113113
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(removeTappedView:)];
114114
[view addGestureRecognizer:tapGesture];

‎ORStackViewExample/ORFirstViewController.m‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,18 @@ - (void)viewDidLoad
6363
ORColourView *view3 = [[ORColourView alloc] init];
6464
view3.text = @"By default, new subviews are added to the right of ORHorizontalStackView.";
6565
view3.fakeContentSize = (CGSize){ 100, UIViewNoIntrinsicMetric };
66-
67-
[self.stackView addSubview:view1 withTopMargin:20.0 sideMargin:30.0];
68-
[self.stackView addSubview:view2 withTopMargin:10.0 sideMargin:170.0];
69-
[self.stackView addSubview:view3 withTopMargin:30.0 sideMargin:20.0];
66+
67+
[self.stackView addSubview:view1 withStartMargin:20.0 sideMargin:30.0];
68+
[self.stackView addSubview:view2 withStartMargin:10.0 sideMargin:170.0];
69+
[self.stackView addSubview:view3 withStartMargin:30.0 sideMargin:20.0];
7070
}
7171

7272
- (void)addView
7373
{
7474
ORColourView *view = [[ORColourView alloc] init];
7575
view.text = @"Tap to remove";
7676
view.fakeContentSize = (CGSize){ 24, UIViewNoIntrinsicMetric};
77-
[self.stackView addSubview:view withTopMargin:5.0 sideMargin:40.0];
77+
[self.stackView addSubview:view withStartMargin:5.0 sideMargin:40.0];
7878

7979
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(removeTappedView:)];
8080
[view addGestureRecognizer:tapGesture];

‎ORStackViewExample/ORFourthViewController.m‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,21 @@ - (void)viewDidLoad
5959
ORColourView *right3 = [[ORColourView alloc] init];
6060
right3.text = @"a view";
6161
right3.fakeContentSize = (CGSize){ UIViewNoIntrinsicMetric , 40};
62-
63-
[splitView.leftStack addSubview:left1 withTopMargin:0.0 sideMargin:10.0];
64-
[splitView.leftStack addSubview:left2 withTopMargin:10.0 sideMargin:5.0];
65-
[splitView.leftStack addSubview:left3 withTopMargin:10.0 sideMargin:15.0];
66-
[splitView.rightStack addSubview:right1 withTopMargin:0.0 sideMargin:15.0];
67-
[splitView.rightStack addSubview:right2 withTopMargin:10.0 sideMargin:10.0];
68-
[splitView.rightStack addSubview:right3 withTopMargin:10.0 sideMargin:5.0];
62+
63+
[splitView.leftStack addSubview:left1 withStartMargin:0.0 sideMargin:10.0];
64+
[splitView.leftStack addSubview:left2 withStartMargin:10.0 sideMargin:5.0];
65+
[splitView.leftStack addSubview:left3 withStartMargin:10.0 sideMargin:15.0];
66+
[splitView.rightStack addSubview:right1 withStartMargin:0.0 sideMargin:15.0];
67+
[splitView.rightStack addSubview:right2 withStartMargin:10.0 sideMargin:10.0];
68+
[splitView.rightStack addSubview:right3 withStartMargin:10.0 sideMargin:5.0];
6969
}
7070

7171
- (void)addView:(UITapGestureRecognizer *)gesture
7272
{
7373
ORColourView *view = [[ORColourView alloc] init];
7474
view.text = @"Tap to remove";
7575
view.fakeContentSize = (CGSize){ UIViewNoIntrinsicMetric , 24 };
76-
[(ORStackView *)gesture.view.superview addSubview:view withTopMargin:5.0 sideMargin:10.0];
76+
[(ORStackView *)gesture.view.superview addSubview:view withStartMargin:5.0 sideMargin:10.0];
7777

7878
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(removeTappedView:)];
7979
[view addGestureRecognizer:tapGesture];

‎ORStackViewExample/ORSecondViewController.m‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,20 @@ - (void)viewDidLoad
5454
ORColourView *view4 = [[ORColourView alloc] init];
5555
view4.text = @"4 - Lorem ipsum, etc. etc.";
5656
view4.fakeContentSize = (CGSize){ UIViewNoIntrinsicMetric , 20 };
57-
58-
[self.stackView insertSubview:view2 atIndex:0 withTopMargin:20.0 sideMargin:20.0];
59-
[self.stackView insertSubview:view4 atIndex:1 withTopMargin:15.0 sideMargin:20.0];
60-
[self.stackView insertSubview:view1 atIndex:0 withTopMargin:10.0 sideMargin:20.0];
61-
[self.stackView insertSubview:view3 atIndex:2 withTopMargin:10.0 sideMargin:20.0];
57+
58+
[self.stackView insertSubview:view2 atIndex:0 withStartMargin:20.0 sideMargin:20.0];
59+
[self.stackView insertSubview:view4 atIndex:1 withStartMargin:15.0 sideMargin:20.0];
60+
[self.stackView insertSubview:view1 atIndex:0 withStartMargin:10.0 sideMargin:20.0];
61+
[self.stackView insertSubview:view3 atIndex:2 withStartMargin:10.0 sideMargin:20.0];
6262
}
6363

6464
- (void)addView
6565
{
6666
ORColourView *view = [[ORColourView alloc] init];
6767
view.text = @"new view added at index 2\nTap to remove";
6868
view.fakeContentSize = (CGSize){ UIViewNoIntrinsicMetric , 50 };
69-
70-
[self.stackView insertSubview:view atIndex:2 withTopMargin:10.0 sideMargin:10.0];
69+
70+
[self.stackView insertSubview:view atIndex:2 withStartMargin:10.0 sideMargin:10.0];
7171
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(removeTappedView:)];
7272
[view addGestureRecognizer:tapGesture];
7373
}

0 commit comments

Comments
 (0)