Skip to content

Commit 4336c18

Browse files
committed
Merge branch 'develop' into button
2 parents 4c3587f + cdcd458 commit 4336c18

File tree

21 files changed

+1109
-4
lines changed

21 files changed

+1109
-4
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Master
2+
3+
##### Breaking
4+
5+
##### Enhancements
6+
7+
##### Bug Fixes
8+
9+
## x.x.x
10+
11+
This is a template. When cutting a new release, rename "master" to the release number and create a
12+
new, empty "Master" section.
13+
14+
##### Breaking
15+
16+
##### Enhancements
17+
18+
##### Bug Fixes
19+
20+
* This is a template description
21+
[person responsible](https://github.com/...)
22+
[#xxx](github.com/google/material-components-ios/issues/xxx)

catalog/MDCCatalog.xcodeproj/project.pbxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@
289289
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
290290
GCC_WARN_UNUSED_FUNCTION = YES;
291291
GCC_WARN_UNUSED_VARIABLE = YES;
292-
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
292+
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
293293
MTL_ENABLE_DEBUG_INFO = YES;
294294
ONLY_ACTIVE_ARCH = YES;
295295
SDKROOT = iphoneos;
@@ -328,7 +328,7 @@
328328
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
329329
GCC_WARN_UNUSED_FUNCTION = YES;
330330
GCC_WARN_UNUSED_VARIABLE = YES;
331-
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
331+
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
332332
MTL_ENABLE_DEBUG_INFO = NO;
333333
SDKROOT = iphoneos;
334334
TARGETED_DEVICE_FAMILY = "1,2";
@@ -343,6 +343,7 @@
343343
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
344344
CLANG_ENABLE_MODULES = YES;
345345
INFOPLIST_FILE = MDCCatalog/Info.plist;
346+
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
346347
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
347348
PRODUCT_BUNDLE_IDENTIFIER = com.google.MDCCatalog;
348349
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -358,6 +359,7 @@
358359
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
359360
CLANG_ENABLE_MODULES = YES;
360361
INFOPLIST_FILE = MDCCatalog/Info.plist;
362+
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
361363
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
362364
PRODUCT_BUNDLE_IDENTIFIER = com.google.MDCCatalog;
363365
PRODUCT_NAME = "$(TARGET_NAME)";

catalog/MDCCatalog.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

catalog/MDCCatalog/Runtime.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ func getAllClasses() -> [AnyClass] {
4242
func classesRespondingToSelector(selector: Selector) -> [AnyClass] {
4343
return getAllClasses().filter {
4444
let className = NSStringFromClass($0)
45-
if className == "SwiftObject" || className == "Object" || className.hasPrefix("Swift.") || className.hasPrefix("_") || className.hasPrefix("JS") {
45+
if className == "SwiftObject" || className == "Object" || className.hasPrefix("Swift.") ||
46+
className.hasPrefix("_") || className.hasPrefix("JS") || className == "NSLeafProxy" ||
47+
className == "FigIrisAutoTrimmerMotionSampleExport" {
4648
return false
4749
}
4850
return $0.respondsToSelector(selector)

catalog/README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Catalog by convention
2+
3+
This app is dynamically generated by taking advantage of CocoaPods wildcards. The Podfile for the
4+
catalog adds all Material components. It also adds any example source that matches a wildcard like
5+
`components/*/examples/*.{h,m,swift}`. Check out `material-components-ios-catalog.podspec` for the
6+
most up-to-date paths.
7+
8+
At runtime, the app enumerates all instances of UIViewController that respond to the
9+
`+catalogHierarchy` class method. This method is expected to return an array of strings that define
10+
the "breadcrumbs" for the view controller in the app.
11+
12+
The app uses the aggregate of these breadcrumbs to build a navigation tree, with each node either
13+
representing a specific UIViewController (an example) or a list of other nodes.
14+
15+
## Building the app
16+
17+
We use CocoaPods to manage the dependencies of this app. To generate the dependent projects, run
18+
the following within the `catalog/` directory of this repo:
19+
20+
pod install
21+
22+
This will update the MDCCatalog.xcworkspace.
23+
24+
Open the workspace and ensure that the "MDCCatalog" target is selected.
25+
26+
Build and run the app.
27+
28+
## Adding examples
29+
30+
Let's build a hypothetical example for the "Ink" component.
31+
32+
The first step is to create a source file. This can be either a .m or a .swift; whichever you
33+
prefer. Place this source file in the component's `examples/` directory, like so:
34+
35+
> View controller names must be globally-unique across every component's example set. An easy way to
36+
> ensure this is to prefix the controller with the name of the component.
37+
38+
components/Ink/examples/InkDemoViewController.m
39+
40+
Note that, like unit tests, you likely won't need to create a .h file for your example.
41+
42+
You can now create the view controller class.
43+
44+
#import <UIKit/UIKit.h>
45+
46+
@interface InkDemoViewController : UIViewController
47+
@end
48+
49+
@implementation InkDemoViewController
50+
51+
// TODO: Support other categorizational methods.
52+
+ (NSArray *)catalogHierarchy {
53+
return @[ @"Ink", @"README demo" ];
54+
}
55+
56+
@end
57+
58+
The `catalogHierarchy` method is the mechanism by which you define *where* the example lives in the
59+
catalog app. It is easiest to think of the values as a list of breadcrumbs.
60+
61+
To add the example to the Catalog app, simply run pod install in the catalog/ directory again:
62+
63+
catalog/ $ pod install
64+
65+
Build and run and you'll see your example listed in the app's hierarchy.

0 commit comments

Comments
 (0)