Skip to content

Commit da60fc6

Browse files
committed
Merge branch 'release-candidate' into stable
2 parents 938ddf9 + 44037e0 commit da60fc6

File tree

7 files changed

+35
-3
lines changed

7 files changed

+35
-3
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# 2.4.0
2+
3+
- Now you can add the method `catalogRelatedInfo` that returns an NSURL to your example, if you wish to link to related information and resources.
4+
- A performance improvement when fetching all viable classes to build the navigation tree.
5+
6+
## Source changes
7+
8+
* [Add "related info" URLs to examples (#24)](https://github.com/material-foundation/cocoapods-catalog-by-convention/commit/ee57bf7bb544b105c5d91aaa2ef348d0f663a690) (Adrian Secord)
9+
* [[Runtime] Only select UIViewController subclasses (#22)](https://github.com/material-foundation/cocoapods-catalog-by-convention/commit/ce864aabf505978a3933a93bfcf048f5d41bc071) (Robert Moore)
10+
111
# 2.3.1
212

313
minor bug fix introduced in 2.3.0 that returns wrong boolean values.

CatalogByConvention.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "CatalogByConvention"
3-
s.version = "2.3.1"
3+
s.version = "2.4.0"
44
s.authors = "Google Inc."
55
s.summary = "Tools for building a Catalog by Convention."
66
s.homepage = "https://github.com/material-foundation/cocoapods-catalog-by-convention"

example/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- CatalogByConvention (2.2.0)
2+
- CatalogByConvention (2.3.1)
33
- CatalogExamples (1.0.0)
44
- CatalogUnitTests (1.0.0):
55
- Resistor
@@ -22,7 +22,7 @@ EXTERNAL SOURCES:
2222
:path: components/Resistor
2323

2424
SPEC CHECKSUMS:
25-
CatalogByConvention: 5df5831e48b8083b18570dcb804f20fd1c90694f
25+
CatalogByConvention: 1df2d770271921f668a99245c7c4c129e78941ee
2626
CatalogExamples: cafe3e4eae3abc948d96beb626657455c1dfb327
2727
CatalogUnitTests: b7a746f12abb31a905654521ee926ea007ab7275
2828
Resistor: 36a9ae98666be3b4f34d8133fad442fa87fdbce2

src/CBCCatalogExample.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,7 @@
5353
/** Return a description of the example. */
5454
- (nonnull NSString *)catalogDescription;
5555

56+
/** Return a link to related information or resources. */
57+
- (nonnull NSURL *)catalogRelatedInfo;
58+
5659
@end

src/CBCNodeListViewController.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ - (NSString *)exampleDescription {
8585
return CBCDescriptionFromClass(_exampleClass);
8686
}
8787

88+
- (NSURL *)exampleRelatedInfo {
89+
NSAssert(_exampleClass != nil, @"This node has no associated example.");
90+
return CBCRelatedInfoFromClass(_exampleClass);
91+
}
92+
8893
- (BOOL)isPrimaryDemo {
8994
return CBCCatalogIsPrimaryDemoFromClass(_exampleClass);
9095
}

src/private/CBCRuntime.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ FOUNDATION_EXTERN UIViewController *CBCViewControllerFromClass(Class aClass);
6060
/** Create a description from the provided class. **/
6161
FOUNDATION_EXTERN NSString *CBCDescriptionFromClass(Class aClass);
6262

63+
/** Create a link to related information from the provided class. **/
64+
FOUNDATION_EXTERN NSURL *CBCRelatedInfoFromClass(Class aClass);
65+
6366
#pragma mark Fix View Debugging
6467

6568
/**

src/private/CBCRuntime.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ BOOL CBCCatalogIsDebugLeaf(Class aClass) {
9494
if (hasIgnoredPrefix) {
9595
continue;
9696
}
97+
if (![aClass isSubclassOfClass:[UIViewController class]]) {
98+
continue;
99+
}
97100
[classes addObject:aClass];
98101
}
99102

@@ -135,6 +138,14 @@ BOOL CBCCatalogIsDebugLeaf(Class aClass) {
135138
return nil;
136139
}
137140

141+
NSURL *CBCRelatedInfoFromClass(Class aClass) {
142+
if ([aClass respondsToSelector:@selector(catalogRelatedInfo)]) {
143+
NSURL *catalogRelatedInfo = [aClass catalogRelatedInfo];
144+
return catalogRelatedInfo;
145+
}
146+
return nil;
147+
}
148+
138149
#pragma mark Fix View Debugging
139150

140151
void CBCFixViewDebuggingIfNeeded(void) {

0 commit comments

Comments
 (0)