Skip to content

Commit

Permalink
Merge branch 'release-candidate' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
yarneo committed Dec 22, 2017
2 parents 938ddf9 + 44037e0 commit da60fc6
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 3 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 2.4.0

- Now you can add the method `catalogRelatedInfo` that returns an NSURL to your example, if you wish to link to related information and resources.
- A performance improvement when fetching all viable classes to build the navigation tree.

## Source changes

* [Add "related info" URLs to examples (#24)](https://github.com/material-foundation/cocoapods-catalog-by-convention/commit/ee57bf7bb544b105c5d91aaa2ef348d0f663a690) (Adrian Secord)
* [[Runtime] Only select UIViewController subclasses (#22)](https://github.com/material-foundation/cocoapods-catalog-by-convention/commit/ce864aabf505978a3933a93bfcf048f5d41bc071) (Robert Moore)

# 2.3.1

minor bug fix introduced in 2.3.0 that returns wrong boolean values.
Expand Down
2 changes: 1 addition & 1 deletion CatalogByConvention.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "CatalogByConvention"
s.version = "2.3.1"
s.version = "2.4.0"
s.authors = "Google Inc."
s.summary = "Tools for building a Catalog by Convention."
s.homepage = "https://github.com/material-foundation/cocoapods-catalog-by-convention"
Expand Down
4 changes: 2 additions & 2 deletions example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- CatalogByConvention (2.2.0)
- CatalogByConvention (2.3.1)
- CatalogExamples (1.0.0)
- CatalogUnitTests (1.0.0):
- Resistor
Expand All @@ -22,7 +22,7 @@ EXTERNAL SOURCES:
:path: components/Resistor

SPEC CHECKSUMS:
CatalogByConvention: 5df5831e48b8083b18570dcb804f20fd1c90694f
CatalogByConvention: 1df2d770271921f668a99245c7c4c129e78941ee
CatalogExamples: cafe3e4eae3abc948d96beb626657455c1dfb327
CatalogUnitTests: b7a746f12abb31a905654521ee926ea007ab7275
Resistor: 36a9ae98666be3b4f34d8133fad442fa87fdbce2
Expand Down
3 changes: 3 additions & 0 deletions src/CBCCatalogExample.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,7 @@
/** Return a description of the example. */
- (nonnull NSString *)catalogDescription;

/** Return a link to related information or resources. */
- (nonnull NSURL *)catalogRelatedInfo;

@end
5 changes: 5 additions & 0 deletions src/CBCNodeListViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ - (NSString *)exampleDescription {
return CBCDescriptionFromClass(_exampleClass);
}

- (NSURL *)exampleRelatedInfo {
NSAssert(_exampleClass != nil, @"This node has no associated example.");
return CBCRelatedInfoFromClass(_exampleClass);
}

- (BOOL)isPrimaryDemo {
return CBCCatalogIsPrimaryDemoFromClass(_exampleClass);
}
Expand Down
3 changes: 3 additions & 0 deletions src/private/CBCRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ FOUNDATION_EXTERN UIViewController *CBCViewControllerFromClass(Class aClass);
/** Create a description from the provided class. **/
FOUNDATION_EXTERN NSString *CBCDescriptionFromClass(Class aClass);

/** Create a link to related information from the provided class. **/
FOUNDATION_EXTERN NSURL *CBCRelatedInfoFromClass(Class aClass);

#pragma mark Fix View Debugging

/**
Expand Down
11 changes: 11 additions & 0 deletions src/private/CBCRuntime.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ BOOL CBCCatalogIsDebugLeaf(Class aClass) {
if (hasIgnoredPrefix) {
continue;
}
if (![aClass isSubclassOfClass:[UIViewController class]]) {
continue;
}
[classes addObject:aClass];
}

Expand Down Expand Up @@ -135,6 +138,14 @@ BOOL CBCCatalogIsDebugLeaf(Class aClass) {
return nil;
}

NSURL *CBCRelatedInfoFromClass(Class aClass) {
if ([aClass respondsToSelector:@selector(catalogRelatedInfo)]) {
NSURL *catalogRelatedInfo = [aClass catalogRelatedInfo];
return catalogRelatedInfo;
}
return nil;
}

#pragma mark Fix View Debugging

void CBCFixViewDebuggingIfNeeded(void) {
Expand Down

0 comments on commit da60fc6

Please sign in to comment.