Skip to content
This repository was archived by the owner on Jan 17, 2019. It is now read-only.

Commit 2fad2b2

Browse files
authored
Merge pull request #223 from JohnSundell/view-uri-public
View controller: Make view URI a public property
2 parents b19b6aa + 557ef58 commit 2fad2b2

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

include/HubFramework/HUBViewController.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ NS_ASSUME_NONNULL_BEGIN
164164
/// The identifier of the feature that this view controller belongs to
165165
@property (nonatomic, copy, readonly) NSString *featureIdentifier;
166166

167+
/// The URI that this view controller was resolved from
168+
@property (nonatomic, copy, readonly) NSURL *viewURI;
169+
167170
/**
168171
* The current view model that the view controller is using
169172
*

sources/HUBViewController.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ @interface HUBViewController () <
6262
HUBCollectionViewDelegate
6363
>
6464

65-
@property (nonatomic, copy, readonly) NSURL *viewURI;
6665
@property (nonatomic, strong, readonly) HUBViewModelLoaderImplementation *viewModelLoader;
6766
@property (nonatomic, strong, readonly) HUBCollectionViewFactory *collectionViewFactory;
6867
@property (nonatomic, strong, readonly) id<HUBComponentRegistry> componentRegistry;

tests/HUBViewControllerFactoryTests.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ - (void)testCreatingViewControllerForValidViewURI
9494
viewControllerScrollHandler:nil];
9595

9696
XCTAssertTrue([self.manager.viewControllerFactory canCreateViewControllerForViewURI:viewURI]);
97-
XCTAssertNotNil([self.manager.viewControllerFactory createViewControllerForViewURI:viewURI]);
97+
98+
HUBViewController * const viewController = [self.manager.viewControllerFactory createViewControllerForViewURI:viewURI];
99+
XCTAssertEqualObjects(viewController.viewURI, viewURI);
98100
}
99101

100102
- (void)testCreatingViewControllerForInvalidViewURIReturnsNil

0 commit comments

Comments
 (0)