File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ //
2+ // ORStackViewController.h
3+ // Pods
4+ //
5+ // Created by Dzianis Lebedzeu on 5/5/15.
6+ //
7+ //
8+
9+ #import " ORStackScrollView.h"
10+
11+ @interface ORStackViewController : UIViewController
12+
13+ @property (nonatomic , readonly ) ORStackScrollView *scrollView;
14+ @property (nonatomic , readonly ) ORStackView *stackView;
15+
16+ @end
Original file line number Diff line number Diff line change 1+ //
2+ // ORStackViewController.m
3+ // Pods
4+ //
5+ // Created by Dzianis Lebedzeu on 5/5/15.
6+ //
7+ //
8+
9+ #import " ORStackViewController.h"
10+
11+ @implementation ORStackViewController
12+
13+ - (void )loadView {
14+ self.view = [[ORStackScrollView alloc ] init ];
15+ }
16+
17+ - (ORStackScrollView *)scrollView {
18+ return (ORStackScrollView *)self.view ;
19+ }
20+
21+ - (ORStackView *)stackView {
22+ return self.scrollView .stackView ;
23+ }
24+
25+ @end
Original file line number Diff line number Diff line change 66// Copyright (c) 2013 Orta. All rights reserved.
77//
88
9- @interface ORSecondViewController : UIViewController
9+ #import < ORStackView/ORStackViewController.h>
10+
11+ @interface ORSecondViewController : ORStackViewController
1012
1113@end
Original file line number Diff line number Diff line change 1212
1313// More complex use case: Inserting
1414
15- @interface ORSecondViewController ()
16- @property (nonatomic , strong ) ORStackView *stackView;
17- @end
18-
1915@implementation ORSecondViewController
2016
2117- (UIStatusBarStyle)preferredStatusBarStyle {
2218 return UIStatusBarStyleLightContent;
2319}
2420
25- - (void )loadView
26- {
27- self.view = [[UIView alloc ] init ];
28- }
29-
3021- (void )viewDidLoad
3122{
32- self.stackView = [[ORStackView alloc ] init ];
33- [self .view addSubview: self .stackView];
34- if ([self respondsToSelector: @selector (topLayoutGuide )]) {
35- [self .view addConstraint: [NSLayoutConstraint constraintWithItem: self .stackView attribute: NSLayoutAttributeTop relatedBy: NSLayoutRelationEqual toItem: self .topLayoutGuide attribute: NSLayoutAttributeBottom multiplier: 1.0 constant: 0 ]];
36- }
37- [self .view addConstraint: [NSLayoutConstraint constraintWithItem: self .stackView attribute: NSLayoutAttributeWidth relatedBy: NSLayoutRelationEqual toItem: self .view attribute: NSLayoutAttributeWidth multiplier: 1.0 constant: 0 ]];
38- [self .view addConstraint: [NSLayoutConstraint constraintWithItem: self .stackView attribute: NSLayoutAttributeCenterX relatedBy: NSLayoutRelationEqual toItem: self .view attribute: NSLayoutAttributeCenterX multiplier: 1.0 constant: 0 ]];
39-
23+ self.edgesForExtendedLayout = UIRectEdgeNone;
24+
4025 ORColourView *view1 = [[ORColourView alloc ] init ];
4126 view1.text = @" 1 - ORStackView - Tap Me" ;
4227 view1.fakeContentSize = (CGSize){ UIViewNoIntrinsicMetric , 40 };
@@ -76,4 +61,5 @@ - (void)removeTappedView:(UITapGestureRecognizer *)gesture
7661{
7762 [self .stackView removeSubview: gesture.view];
7863}
64+
7965@end
You can’t perform that action at this time.
0 commit comments