Skip to content

Commit 2cda4ef

Browse files
committed
cocoapods: added podspec for PageControl and Slider
Summary: added PageControl and Slider to podspec touching more components in the cocoapod demo apps Reviewers: ajsecord, #material_components_ios_owners, featherless Reviewed By: #material_components_ios_owners, featherless Projects: #material_components_ios_owners Differential Revision: http://codereview.cc/D51
1 parent 70b577d commit 2cda4ef

File tree

5 files changed

+100
-21
lines changed

5 files changed

+100
-21
lines changed

demos/CocoapodsObjCApp/CocoapodsObjCApp/ViewController.m

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,53 @@
1616

1717
#import "ViewController.h"
1818

19+
#import <MaterialPageControl.h>
20+
#import <MaterialSlider.h>
21+
#import <MaterialScrollViewDelegateMultiplexer.h>
22+
#import <MaterialShadowLayer.h>
23+
#import <MaterialSpritedAnimationView.h>
1924
#import <MaterialTypography.h>
25+
#import <MaterialInk.h>
2026

2127
@implementation ViewController
2228

2329
- (void)viewDidLoad {
2430
[super viewDidLoad];
31+
self.view.backgroundColor = [UIColor whiteColor];
2532

26-
UILabel *label = [UILabel new];
27-
label.font = [MDCTypography body1Font];
28-
label.alpha = [MDCTypography body1FontOpacity];
29-
label.text = @"This is a label";
30-
[label sizeToFit];
31-
label.center = CGPointMake(200, 200);
32-
[self.view addSubview:label];
33+
// Testing build and linking so all we need to do is touch the component objects.
34+
#pragma mark Slider
35+
36+
MDCSlider *slider = [[MDCSlider alloc] initWithFrame:CGRectMake(0, 0, 100, 27)];
37+
[self.view addSubview:slider];
38+
slider.center = CGPointMake(100, 45);
39+
40+
#pragma mark Typography
41+
42+
NSAssert([MDCTypography subheadFont], @"expecting valid object");
43+
44+
#pragma mark Ink
45+
46+
NSAssert([[MDCInkTouchController alloc] initWithView:self.view], @"expecting valid object");
47+
48+
#pragma mark ScrollViewDelegateMultiplexer
49+
50+
NSAssert([[MDCScrollViewDelegateMultiplexer alloc] init], @"expecting valid object");
51+
52+
#pragma mark ShadowLayer
53+
54+
NSAssert([[MDCShadowLayer alloc] init], @"expecting valid object");
55+
56+
#pragma mark SpritedAnimation
57+
58+
NSAssert([[MDCSpritedAnimationView alloc] init], @"expecting valid object");
59+
60+
#pragma mark PageControl
61+
62+
MDCPageControl *pageControl = [[MDCPageControl alloc] initWithFrame:CGRectMake(0, 0, 100, 27)];
63+
pageControl.numberOfPages = 3;
64+
[self.view addSubview:pageControl];
65+
pageControl.center = CGPointMake(100, 145);
3366
}
3467

3568
@end

demos/CocoapodsObjCApp/Podfile.lock

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
PODS:
22
- material-components-ios (0.1.0):
33
- material-components-ios/Ink (= 0.1.0)
4+
- material-components-ios/PageControl (= 0.1.0)
45
- material-components-ios/private (= 0.1.0)
56
- material-components-ios/ScrollViewDelegateMultiplexer (= 0.1.0)
67
- material-components-ios/ShadowElevations (= 0.1.0)
78
- material-components-ios/ShadowLayer (= 0.1.0)
9+
- material-components-ios/Slider (= 0.1.0)
810
- material-components-ios/SpritedAnimationView (= 0.1.0)
911
- material-components-ios/Typography (= 0.1.0)
1012
- material-components-ios/Ink (0.1.0)
13+
- material-components-ios/PageControl (0.1.0)
1114
- material-components-ios/private (0.1.0):
1215
- material-components-ios/private/Color (= 0.1.0)
1316
- material-components-ios/private/ThumbTrack (= 0.1.0)
@@ -19,6 +22,7 @@ PODS:
1922
- material-components-ios/ScrollViewDelegateMultiplexer (0.1.0)
2023
- material-components-ios/ShadowElevations (0.1.0)
2124
- material-components-ios/ShadowLayer (0.1.0)
25+
- material-components-ios/Slider (0.1.0)
2226
- material-components-ios/SpritedAnimationView (0.1.0)
2327
- material-components-ios/Typography (0.1.0)
2428

@@ -27,9 +31,9 @@ DEPENDENCIES:
2731

2832
EXTERNAL SOURCES:
2933
material-components-ios:
30-
:path: "../../"
34+
:path: ../../
3135

3236
SPEC CHECKSUMS:
33-
material-components-ios: 20d2937472f43c41504a49efa169cc89f8db8201
37+
material-components-ios: 90b3d23cebcb2913875bbab015605ebe103b5ab1
3438

3539
COCOAPODS: 0.39.0

demos/CocoapodsSwiftApp/CocoapodsSwiftApp/ViewController.swift

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,38 @@ class ViewController: UIViewController {
2323
override func viewDidLoad() {
2424
super.viewDidLoad()
2525

26-
let label = UILabel()
27-
label.font = MDCTypography.body1Font()
28-
label.alpha = MDCTypography.body1FontOpacity()
29-
label.text = "This is a label"
30-
label.sizeToFit()
31-
label.center = CGPoint(x: 200, y: 200)
32-
self.view.addSubview(label)
26+
// Testing build and linking so all we need to do is touch the component objects.
27+
28+
// MARK: Slider
29+
let slider = MDCSlider.init(frame: CGRectMake(0, 0, 100, 27));
30+
self.view.addSubview(slider);
31+
slider.center = CGPointMake(100, 45);
32+
33+
// MARK: Typography
34+
assert(MDCTypography.subheadFont().isKindOfClass(UIFont), "expecting valid object");
35+
36+
// MARK: Ink
37+
MDCInkTouchController.init(view: self.view)!;
38+
39+
// MARK: ScrollViewDelegateMultiplexer
40+
41+
assert(MDCScrollViewDelegateMultiplexer.init().isKindOfClass(MDCScrollViewDelegateMultiplexer),
42+
"expecting valid object");
43+
44+
// MARK: ShadowLayer
45+
46+
assert(MDCShadowLayer.init().isKindOfClass(MDCShadowLayer), "expecting valid object");
47+
48+
// MARK: SpritedAnimation
49+
50+
assert(MDCSpritedAnimationView.init().isKindOfClass(MDCSpritedAnimationView), "expecting valid object");
51+
52+
// MARK: PageControl
53+
54+
let pageControl = MDCPageControl.init(frame:CGRectMake(0, 0, 100, 27));
55+
pageControl.numberOfPages = 3;
56+
self.view.addSubview(pageControl);
57+
pageControl.center = CGPointMake(100, 145);
58+
3359
}
3460
}

demos/CocoapodsSwiftApp/Podfile.lock

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
PODS:
22
- material-components-ios (0.1.0):
33
- material-components-ios/Ink (= 0.1.0)
4+
- material-components-ios/PageControl (= 0.1.0)
45
- material-components-ios/private (= 0.1.0)
56
- material-components-ios/ScrollViewDelegateMultiplexer (= 0.1.0)
67
- material-components-ios/ShadowElevations (= 0.1.0)
78
- material-components-ios/ShadowLayer (= 0.1.0)
9+
- material-components-ios/Slider (= 0.1.0)
810
- material-components-ios/SpritedAnimationView (= 0.1.0)
911
- material-components-ios/Typography (= 0.1.0)
1012
- material-components-ios/Ink (0.1.0)
13+
- material-components-ios/PageControl (0.1.0)
1114
- material-components-ios/private (0.1.0):
1215
- material-components-ios/private/Color (= 0.1.0)
1316
- material-components-ios/private/ThumbTrack (= 0.1.0)
@@ -19,6 +22,7 @@ PODS:
1922
- material-components-ios/ScrollViewDelegateMultiplexer (0.1.0)
2023
- material-components-ios/ShadowElevations (0.1.0)
2124
- material-components-ios/ShadowLayer (0.1.0)
25+
- material-components-ios/Slider (0.1.0)
2226
- material-components-ios/SpritedAnimationView (0.1.0)
2327
- material-components-ios/Typography (0.1.0)
2428

@@ -27,9 +31,9 @@ DEPENDENCIES:
2731

2832
EXTERNAL SOURCES:
2933
material-components-ios:
30-
:path: "../../"
34+
:path: ../../
3135

3236
SPEC CHECKSUMS:
33-
material-components-ios: 20d2937472f43c41504a49efa169cc89f8db8201
37+
material-components-ios: 90b3d23cebcb2913875bbab015605ebe103b5ab1
3438

3539
COCOAPODS: 0.39.0

material-components-ios.podspec

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Pod::Spec.new do |s|
1919
#
2020
# ## Optional properties
2121
#
22-
# private_header_files => This should point to your component's Private/ directory if you have any
22+
# private_header_files => This should point to your component's private/ directory if you have any
2323
# private headers.
2424
# resource_bundles => If your component has a bundle, add a dictionary mapping from the bundle
2525
# name to the bundle path.
@@ -30,11 +30,11 @@ Pod::Spec.new do |s|
3030
#
3131
# s.subspec 'ComponentName' do |ss|
3232
# ss.public_header_files = 'components/ComponentName/src/*.h'
33-
# ss.source_files = 'components/ComponentName/src/*.{h,m}', 'components/ComponentName/src/Private/*.{h,m}'
33+
# ss.source_files = 'components/ComponentName/src/*.{h,m}', 'components/ComponentName/src/private/*.{h,m}'
3434
# ss.header_mappings_dir = 'components/ComponentName/src/*'
3535
#
3636
# # Only if you have private headers
37-
# ss.private_header_files = 'components/ComponentName/src/Private/*.h'
37+
# ss.private_header_files = 'components/ComponentName/src/private/*.h'
3838
#
3939
# # Only if you have a resource bundle
4040
# ss.resource_bundles = {
@@ -50,6 +50,12 @@ Pod::Spec.new do |s|
5050
ss.private_header_files = 'components/Ink/src/private/*.h'
5151
end
5252

53+
s.subspec 'PageControl' do |ss|
54+
ss.public_header_files = 'components/PageControl/src/*.h'
55+
ss.source_files = 'components/PageControl/src/*.{h,m}', 'components/PageControl/src/private/*.{h,m}'
56+
ss.header_mappings_dir = 'components/PageControl/src/*'
57+
end
58+
5359
s.subspec 'ScrollViewDelegateMultiplexer' do |ss|
5460
ss.public_header_files = 'components/ScrollViewDelegateMultiplexer/src/*.h'
5561
ss.source_files = 'components/ScrollViewDelegateMultiplexer/src/*.{h,m}'
@@ -68,6 +74,12 @@ Pod::Spec.new do |s|
6874
ss.header_mappings_dir = 'components/ShadowLayer/src/*'
6975
end
7076

77+
s.subspec 'Slider' do |ss|
78+
ss.public_header_files = 'components/Slider/src/*.h'
79+
ss.source_files = 'components/Slider/src/*.{h,m}', 'components/Slider/src/private/*.{h,m}'
80+
ss.header_mappings_dir = 'components/Slider/src/*'
81+
end
82+
7183
s.subspec 'SpritedAnimationView' do |ss|
7284
ss.public_header_files = 'components/SpritedAnimationView/src/*.h'
7385
ss.source_files = 'components/SpritedAnimationView/src/*.{h,m}'

0 commit comments

Comments
 (0)