Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2502a58

Browse files
author
dzenbot
committed
Exposes -initWithCoder: and updates documentation
1 parent a333e06 commit 2502a58

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

Examples/Messenger/Messenger-Shared/MessageViewController.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ - (id)init
3434
{
3535
self = [super initWithTableViewStyle:UITableViewStylePlain];
3636
if (self) {
37-
// Register a subclass of SLKTextView, if you need any special appearance and/or behavior customisation.
38-
[self registerClassForTextView:[MessageTextView class]];
37+
// Do something
3938
}
4039
return self;
4140
}

Source/Classes/SLKTextViewController.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ NS_CLASS_AVAILABLE_IOS(7_0) @interface SLKTextViewController : UIViewController
112112
@param style A constant that specifies the style of main table view that the controller object is to manage (UITableViewStylePlain or UITableViewStyleGrouped).
113113
@return An initialized SLKTextViewController object or nil if the object could not be created.
114114
*/
115-
- (instancetype)initWithTableViewStyle:(UITableViewStyle)style;
115+
- (instancetype)initWithTableViewStyle:(UITableViewStyle)style NS_DESIGNATED_INITIALIZER;
116116

117117
/**
118118
Initializes a collection view controller and configures the collection view with the provided layout.
@@ -121,12 +121,20 @@ NS_CLASS_AVAILABLE_IOS(7_0) @interface SLKTextViewController : UIViewController
121121
@param layout The layout object to associate with the collection view. The layout controls how the collection view presents its cells and supplementary views.
122122
@return An initialized SLKTextViewController object or nil if the object could not be created.
123123
*/
124-
- (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)layout;
124+
- (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)layout NS_DESIGNATED_INITIALIZER;
125+
126+
/**
127+
Initializes either a table or collection view controller.
128+
You must override either +tableViewStyleForCoder: or +collectionViewLayoutForCoder: to define witch view to be layed out.
129+
130+
@param decoder An unarchiver object.
131+
@return An initialized SLKTextViewController object or nil if the object could not be created.
132+
*/
133+
- (instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER;
125134

126135
/**
127136
Returns the tableView style to be configured when using Interface Builder. Default is UITableViewStylePlain.
128137
You must override this method if you want to configure a tableView.
129-
You should not override -initWithCoder:
130138
131139
@param decoder An unarchiver object.
132140
@return The tableView style to be used in the new instantiated tableView.
@@ -136,7 +144,6 @@ NS_CLASS_AVAILABLE_IOS(7_0) @interface SLKTextViewController : UIViewController
136144
/**
137145
Returns the tableView style to be configured when using Interface Builder. Default is nil.
138146
You must override this method if you want to configure a collectionView.
139-
You should not override -initWithCoder:
140147
141148
@param decoder An unarchiver object.
142149
@return The collectionView style to be used in the new instantiated collectionView.

0 commit comments

Comments
 (0)