mirror of
https://github.com/TextureGroup/Texture.git
synced 2026-04-07 19:17:39 +00:00
Add empty ASViewController initializer to facilitate subclassing (#1754)
This commit is contained in:
committed by
Jon Parise
parent
361aa5b5ad
commit
80ffcdfa09
@@ -38,6 +38,15 @@ typedef ASTraitCollection * _Nonnull (^ASDisplayTraitsForTraitWindowSizeBlock)(C
|
||||
*/
|
||||
- (instancetype)initWithNode:(DisplayNodeType)node NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
/**
|
||||
* ASViewController initializer. Useful for interoperability with normal UIViewControllers.
|
||||
*
|
||||
* @return An ASViewController instance with a nil node whose root view will be backed by a standard UIView as with a normal UIViewController.
|
||||
*
|
||||
* @see ASVisibilityDepth
|
||||
*/
|
||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
/**
|
||||
|
||||
@@ -64,6 +64,17 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
if (!(self = [super initWithNibName:nil bundle:nil])) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
[self _initializeInstance];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)_initializeInstance
|
||||
{
|
||||
if (_node == nil) {
|
||||
|
||||
@@ -17,7 +17,7 @@ class ViewController: ASViewController<ASCollectionNode>, MosaicCollectionViewLa
|
||||
let _layoutInspector = MosaicCollectionViewLayoutInspector()
|
||||
let kNumberOfImages: UInt = 14
|
||||
|
||||
init() {
|
||||
override init() {
|
||||
let layout = MosaicCollectionViewLayout()
|
||||
layout.numberOfColumns = 3;
|
||||
layout.headerHeight = 44;
|
||||
|
||||
@@ -13,7 +13,7 @@ class OverviewViewController: ASViewController<ASTableNode> {
|
||||
let tableNode = ASTableNode()
|
||||
let layoutExamples: [LayoutExampleNode.Type]
|
||||
|
||||
init() {
|
||||
override init() {
|
||||
layoutExamples = [
|
||||
HeaderWithRightAndLeftItems.self,
|
||||
PhotoWithInsetTextOverlay.self,
|
||||
|
||||
@@ -29,7 +29,7 @@ final class ViewController: ASViewController<ASDisplayNode>, ASTableDataSource,
|
||||
|
||||
fileprivate(set) var state: State = .empty
|
||||
|
||||
init() {
|
||||
override init() {
|
||||
super.init(node: ASTableNode())
|
||||
tableNode.delegate = self
|
||||
tableNode.dataSource = self
|
||||
|
||||
Reference in New Issue
Block a user