mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-19 04:39:36 +00:00
Remove UIKit call from -init!1
This commit is contained in:
parent
1d93dbc0b3
commit
2317e17c53
@ -38,6 +38,8 @@
|
||||
|
||||
#pragma mark - Lifecycle
|
||||
|
||||
// -init is often called off the main thread in ASDK. Therefore it is imperative that no UIKit objects are accessed.
|
||||
// Examples of common errors include accessing the node’s view or creating a gesture recognizer.
|
||||
- (instancetype)init
|
||||
{
|
||||
_tableNode = [[ASTableNode alloc] init];
|
||||
@ -50,17 +52,19 @@
|
||||
_tableNode.dataSource = self;
|
||||
_tableNode.delegate = self;
|
||||
|
||||
_activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
// do any ASDK view stuff in loadView
|
||||
// -loadView is guaranteed to be called on the main thread and is the appropriate place to
|
||||
// set up an UIKit objects you may be using.
|
||||
- (void)loadView
|
||||
{
|
||||
[super loadView];
|
||||
|
||||
_activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
|
||||
|
||||
_photoFeed = [[PhotoFeedModel alloc] initWithPhotoFeedModelType:PhotoFeedModelTypePopular imageSize:[self imageSizeForScreenWidth]];
|
||||
[self refreshFeed];
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user