Skip to content

Commit

Permalink
Merge branch 'release-candidate'
Browse files Browse the repository at this point in the history
  • Loading branch information
Junius Gunaratne committed Apr 13, 2016
2 parents 1195948 + bd8f0a3 commit 1542251
Show file tree
Hide file tree
Showing 233 changed files with 7,973 additions and 2,329 deletions.
6 changes: 4 additions & 2 deletions .arcconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"load": [
"scripts/external/clang-format-linter",
"scripts/external/arc-xcode-test-engine",
"scripts/external/arc-proselint"
"scripts/external/arc-jazzy-linter",
"scripts/external/arc-proselint",
"scripts/external/arc-regex-line-length-linter",
"scripts/external/arc-xcode-test-engine"
],
"phabricator.uri" : "http://codereview.cc/",
"repository.callsign" : "MDC",
Expand Down
43 changes: 38 additions & 5 deletions .arclint
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,35 @@
"text": {
"type": "text",
"include": "(\\.(m|h|mm|md|swift)$)",
"exclude": "(/Pods/)",
"exclude": [
"(/Pods/)"
],
"severity": {
"3": "disabled",
"5": "disabled"
},
"text.max-line-length": 100
}
},
"line-length": {
"type": "regex-line-length",
"include": "(\\.(m|h|mm|md|swift)$)",
"exclude": [
"(/Pods/)",
"(CHANGELOG.md)",
"(\\.playground/.+\\.swift)"
],
"max-line-length": 100,
"ignore-line-regexes": [
"(https?://)",
"(<a href)",
"(\\[.+\\]\\(.+\\))",
"( *func )",
"(^[-+@].+)",
"(NS_UNAVAILABLE;$)",
"(^ )",
"(^#define)",
"(^excerpt:)",
"(GENERATED)"
]
},
"chmod": {
"type": "chmod",
Expand All @@ -21,17 +45,26 @@
"prose": {
"type": "prose",
"include": "(\\.(md)$)",
"exclude": "(/Pods/)",
"exclude": [
"(/Pods/)",
"(^CHANGELOG.md)",
"(writing_readmes.md$)"
],
"severity": {
"typography.symbols.curly_quotes": "disabled",
"typography.symbols.ellipsis": "disabled",
"leonard.exclamation.30ppm": "disabled"
"leonard.exclamation.30ppm": "disabled",
"misc.annotations": "warning"
}
},
"spelling": {
"type": "spelling",
"include": "(\\.(m|h|mm|md)$)",
"exclude": "(/Pods/)"
},
"jazzy": {
"type": "jazzy",
"include": "(components/.*?/src/[^\/]+?\\.(h|swift)$)"
}
}
}
2 changes: 1 addition & 1 deletion .arcunit
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"engines": {
"xcode": {
"type": "xcode-test-engine",
"include": "(\\.(m|h|mm|swift)$)",
"include": "(components/.+/(src|unit)/.*\\.(m|h|mm|swift)$)",
"exclude": "(/Pods/)"
}
}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
build_tests/CocoapodsObjCApp/CocoapodsObjCApp.xcworkspace
build_tests/CocoapodsSwiftApp/CocoapodsSwiftApp.xcworkspace
scripts/external/material-design-icons/
scripts/external/objc-diff/

# Xcode
#
Expand Down
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@
[submodule "scripts/external/arc-proselint"]
path = scripts/external/arc-proselint
url = [email protected]:google/arc-proselint.git
[submodule "scripts/external/arc-jazzy-linter"]
path = scripts/external/arc-jazzy-linter
url = [email protected]:google/arc-jazzy-linter.git
[submodule "scripts/external/arc-regex-line-length-linter"]
path = scripts/external/arc-regex-line-length-linter
url = [email protected]:google/arc-regex-line-length-linter.git
247 changes: 247 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

52 changes: 35 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,41 @@ This repository follows a file layout convention that ensures consistency and
predictability across all of our components. The convention for a given
component is as follows:

components/ComponentName/
README.md
docs/ <- In-depth technical documentation.
TechnicalDoc1.md <- Docs are written in Markdown.
assets/ <- All documentation assets live here.
image.png <- Pngs, movs, gifs, etc...
examples/ <- Examples added here show up in the [Catalog](catalog/README.md).
Example.swift <- Examples can be Swift,
Example.m <- or Objective-C
src/ <- All component source lives here
MaterialComponent.h <- Every component must have an umbrella header
MDCObject.h <- Component source must be written in Objective-C.
MDCObject.m
tests/ <- All tests here will show up in the [Catalog](catalog/README.md).
unit/ <- All unit tests must go here.
SomeAPITest.swift <- Unit tests can be Swift,
AnotherTest.m <- or Objective-C.
ComponentName/
CHANGELOG.md <- Release notes and history.
README.md <- Essential installation and usage guide.
ComponentName.podspec <- The podspec for the library.

docs/ <- In-depth technical documentation.
TechnicalDoc1.md <- Docs are written in Markdown.
assets/ <- All documentation assets live here.
image.png <- Pngs, movs, gifs, etc...

examples/
Example.swift <- Examples can be Swift,
Example.m <- or Objective-C.
apps/ <- Example applications live in this sub-directory.
ExampleApp/ <- Example application.
AnotherApp/ <- Another example application.
resources/ <- Resources required by the examples.
supplemental/ <- Supplemental example source code.

src/ <- All component source lives here.
ComponentName.h <- Umbrella header.
GOSObject.h <- Component source must be written in Objective-C.
GOSObject.m
private/ <- Private APIs live in a sub-directory
GOSPrivateAPI.h
GOSPrivateAPI.m
ComponentName.bundle/ <- All assets required by the source.

tests/
ui/ <- All user interface tests.
SomeAPITest.swift <- Tests can be Swift,
AnotherTest.m <- or Objective-C.
unit/ <- All unit tests.
SomeAPITest.swift <- Tests can be Swift,
AnotherTest.m <- or Objective-C.

Note that all directories are **lower-cased** except the component's root
directory.
Expand Down
8 changes: 2 additions & 6 deletions MaterialComponents.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ load 'scripts/generated/icons.rb'

Pod::Spec.new do |s|
s.name = "MaterialComponents"
s.version = "3.1.0"
s.version = "4.0.0"
s.authors = { 'Apple platform engineering at Google' => '[email protected]' }
s.summary = "A collection of stand-alone production-ready UI libraries focused on design details."
s.homepage = "https://github.com/google/material-components-ios"
Expand Down Expand Up @@ -130,9 +130,7 @@ Pod::Spec.new do |s|
}

ss.dependency "MaterialComponents/FontDiskLoader"
# TODO: https://github.com/google/material-components-ios/issues/74 This was intended to be a
# strong dependancy but is weak during the deprecation period.
# ss.dependency "MaterialComponents/Typography"
ss.dependency "MaterialComponents/Typography"
end

s.subspec "ScrollViewDelegateMultiplexer" do |ss|
Expand Down Expand Up @@ -182,8 +180,6 @@ Pod::Spec.new do |s|
ss.public_header_files = "components/#{ss.base_name}/src/*.h"
ss.source_files = "components/#{ss.base_name}/src/*.{h,m}", "components/#{ss.base_name}/src/private/*.{h,m}"
ss.header_mappings_dir = "components/#{ss.base_name}/src/*"

ss.dependency "MaterialComponents/RobotoFontLoader" # This dependancy is part of a deprecation.
end

s.subspec "private" do |pss|
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponentsCatalog.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MaterialComponentsCatalog"
s.version = "3.1.0"
s.version = "4.0.0"
s.authors = { 'Apple platform engineering at Google' => '[email protected]' }
s.summary = "A collection of stand-alone production-ready UI libraries focused on design details."
s.homepage = "https://github.com/google/material-components-ios"
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponentsUnitTests.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MaterialComponentsUnitTests"
s.version = "3.1.0"
s.version = "4.0.0"
s.authors = { 'Apple platform engineering at Google' => '[email protected]' }
s.summary = "A collection of stand-alone production-ready UI libraries focused on design details."
s.homepage = "https://github.com/google/material-components-ios"
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,16 @@ Material Components is a collection of standalone production-quality components.
Material Components’ visual style is based on the
[material design](http://www.google.com/design/spec/material-design/introduction.html)
specification, developed by a team of iOS engineers and UX designers at Google.

## Attributions

Material Components iOS uses
[Material Design icons](https://github.com/google/material-design-icons),
copyright Google Inc. and licensed under
[CC BY 4.0](http://creativecommons.org/licenses/by/4.0/).

Roboto Font Loader uses the
[Roboto font](https://github.com/google/fonts/tree/master/apache/roboto),
copyright 2011 Google Inc. and licensed under
[Apache 2.0](https://github.com/google/fonts/blob/master/apache/roboto/LICENSE.txt)
without a NOTICE file.
3 changes: 2 additions & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
For the coming months, the Material Components iOS team is focused on developing the following components:
For the coming months, the Material Components iOS team is focused on developing the following
components:

- HUD
- Textfields
Expand Down
11 changes: 7 additions & 4 deletions catalog/CatalogByConvention/src/CBCCatalogExample.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,25 @@
*/

/**
The CBCCatalogExample protocol defines the static methods that classes can implement in order to
The CBCCatalogExample protocol defines methods that examples are expected to implement in order to
customize their location and behavior in the Catalog by Convention.
Examples should not formally conform to this protocol. Examples should simply implement these
methods.
methods by convention.
*/
@protocol CBCCatalogExample <NSObject>

/** Return a list of breadcrumbs defining the navigation path taken to reach this example. */
+ (NSArray<NSString *> *)catalogBreadcrumbs;
+ (nonnull NSArray<NSString *> *)catalogBreadcrumbs;

@optional

/**
Return the name of a UIStoryboard from which the example's view controller should be instantiated.
*/
- (NSString *)catalogStoryboardName;
- (nonnull NSString *)catalogStoryboardName;

/** Return a description of the example. */
- (nonnull NSString *)catalogDescription;

@end
10 changes: 9 additions & 1 deletion catalog/CatalogByConvention/src/CBCNodeViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
/** Initializes a CBCNodeViewController instance with a non-example node. */
- (nonnull instancetype)initWithNode:(nonnull CBCNode *)node;

- (nonnull instancetype)initWithStyle:(UITableViewStyle)style NS_UNAVAILABLE;

/** The node that this view controller must represent. */
@property(nonatomic, strong, nonnull, readonly) CBCNode *node;

Expand Down Expand Up @@ -57,13 +59,19 @@ FOUNDATION_EXTERN CBCNode *__nonnull CBCCreateNavigationTree(void);
/** The title for this node. */
@property(nonatomic, copy, nonnull, readonly) NSString *title;

/** The description for this node. */
@property(nonatomic, copy, nonnull, readonly) NSString *nodeDescription;

/** The children of this node. */
@property(nonatomic, strong, nonnull, readonly) NSArray<CBCNode *> *children;
@property(nonatomic, strong, nonnull) NSArray<CBCNode *> *children;

/** Returns YES if this is an example node. */
- (BOOL)isExample;

/** Returns an instance of a UIViewController for presentation purposes. */
- (nonnull UIViewController *)createExampleViewController;

/** Returns a description of the example. */
- (nonnull NSString *)createExampleDescription;

@end
14 changes: 12 additions & 2 deletions catalog/CatalogByConvention/src/CBCNodeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,15 @@ - (BOOL)isExample {
}

- (UIViewController *)createExampleViewController {
NSAssert(_exampleClass != nil, @"This is node has no associated example.");
NSAssert(_exampleClass != nil, @"This node has no associated example.");
return CBCViewControllerFromClass(_exampleClass);
}

- (NSString *)createExampleDescription {
NSAssert(_exampleClass != nil, @"This node has no associated example.");
return CBCDescriptionFromClass(_exampleClass);
}

@end

@implementation CBCNodeListViewController
Expand All @@ -80,7 +85,7 @@ - (instancetype)initWithNode:(CBCNode *)node {
NSAssert(!_node.isExample,
@"%@ cannot represent example nodes.", NSStringFromClass([self class]));

self = [super initWithStyle:UITableViewStylePlain];
self = [super initWithStyle:UITableViewStyleGrouped];
if (self) {
_node = node;

Expand All @@ -89,6 +94,11 @@ - (instancetype)initWithNode:(CBCNode *)node {
return self;
}

- (instancetype)initWithStyle:(UITableViewStyle)style {
[self doesNotRecognizeSelector:_cmd];
return nil;
}

#pragma mark - UITableViewDataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ FOUNDATION_EXTERN NSArray<Class> *CBCClassesRespondingToSelector(NSArray<Class>
-instantiateInitialViewController on the UIStoryboard instance.
*/
FOUNDATION_EXTERN UIViewController *CBCViewControllerFromClass(Class aClass);

/** Create a description from the provided class. **/
FOUNDATION_EXTERN NSString *CBCDescriptionFromClass(Class aClass);
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,18 @@
NSString *storyboardName = [aClass catalogStoryboardName];
NSBundle *bundle = [NSBundle bundleForClass:aClass];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle:bundle];
return [storyboard instantiateInitialViewController];
NSCAssert(storyboard, @"expecting a storyboard to exist at %@", storyboardName);
UIViewController *vc = [storyboard instantiateInitialViewController];
NSCAssert(vc, @"expecting a initialViewController in the storyboard %@", storyboardName);
return vc;
}
return [[aClass alloc] initWithNibName:nil bundle:nil];
}

NSString *CBCDescriptionFromClass(Class aClass) {
if ([aClass respondsToSelector:@selector(catalogDescription)]) {
NSString *catalogDescription = [aClass catalogDescription];
return catalogDescription;
}
return nil;
}
Loading

0 comments on commit 1542251

Please sign in to comment.