mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 19:30:29 +00:00
Replace initialiser return types of id with new instancetype
This commit is contained in:
parent
3cf56aa9d6
commit
42738397a6
@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
#pragma mark - NSObject
|
#pragma mark - NSObject
|
||||||
|
|
||||||
- (id)initWithFrame:(CGRect)frame {
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
if ((self = [super initWithFrame:frame])) {
|
if ((self = [super initWithFrame:frame])) {
|
||||||
self.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
self.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||||
self.backgroundColor = kWhiteBackgroundColorDefault;
|
self.backgroundColor = kWhiteBackgroundColorDefault;
|
||||||
|
|||||||
@ -139,7 +139,7 @@
|
|||||||
[encoder encodeObject:self.uuids forKey:@"uuids"];
|
[encoder encodeObject:self.uuids forKey:@"uuids"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)initWithCoder:(NSCoder *)decoder {
|
- (instancetype)initWithCoder:(NSCoder *)decoder {
|
||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
self.name = [decoder decodeObjectForKey:@"name"];
|
self.name = [decoder decodeObjectForKey:@"name"];
|
||||||
self.version = [decoder decodeObjectForKey:@"version"];
|
self.version = [decoder decodeObjectForKey:@"version"];
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
@implementation BITArrowImageAnnotation
|
@implementation BITArrowImageAnnotation
|
||||||
|
|
||||||
- (id)initWithFrame:(CGRect)frame
|
- (instancetype)initWithFrame:(CGRect)frame
|
||||||
{
|
{
|
||||||
self = [super initWithFrame:frame];
|
self = [super initWithFrame:frame];
|
||||||
if (self) {
|
if (self) {
|
||||||
|
|||||||
@ -240,7 +240,7 @@ static inline NSAttributedString * NSAttributedStringBySettingColorFromContext(N
|
|||||||
@synthesize verticalAlignment = _verticalAlignment;
|
@synthesize verticalAlignment = _verticalAlignment;
|
||||||
@synthesize activeLink = _activeLink;
|
@synthesize activeLink = _activeLink;
|
||||||
|
|
||||||
- (id)initWithFrame:(CGRect)frame {
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
self = [super initWithFrame:frame];
|
self = [super initWithFrame:frame];
|
||||||
if (!self) {
|
if (!self) {
|
||||||
return nil;
|
return nil;
|
||||||
@ -251,7 +251,7 @@ static inline NSAttributedString * NSAttributedStringBySettingColorFromContext(N
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)initWithCoder:(NSCoder *)coder {
|
- (instancetype)initWithCoder:(NSCoder *)coder {
|
||||||
self = [super initWithCoder:coder];
|
self = [super initWithCoder:coder];
|
||||||
if (!self) {
|
if (!self) {
|
||||||
return nil;
|
return nil;
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
@implementation BITBlurImageAnnotation
|
@implementation BITBlurImageAnnotation
|
||||||
|
|
||||||
- (id)initWithFrame:(CGRect)frame
|
- (instancetype)initWithFrame:(CGRect)frame
|
||||||
{
|
{
|
||||||
self = [super initWithFrame:frame];
|
self = [super initWithFrame:frame];
|
||||||
if (self) {
|
if (self) {
|
||||||
|
|||||||
@ -52,7 +52,7 @@
|
|||||||
[encoder encodeObject:self.contentType forKey:@"contentType"];
|
[encoder encodeObject:self.contentType forKey:@"contentType"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)initWithCoder:(NSCoder *)decoder {
|
- (instancetype)initWithCoder:(NSCoder *)decoder {
|
||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
_filename = [decoder decodeObjectForKey:@"filename"];
|
_filename = [decoder decodeObjectForKey:@"filename"];
|
||||||
_crashAttachmentData = [decoder decodeObjectForKey:@"data"];
|
_crashAttachmentData = [decoder decodeObjectForKey:@"data"];
|
||||||
|
|||||||
@ -123,7 +123,7 @@ static PLCrashReporterCallbacks plCrashCallbacks = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (id)init {
|
- (instancetype)init {
|
||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
_delegate = nil;
|
_delegate = nil;
|
||||||
_showAlwaysButton = YES;
|
_showAlwaysButton = YES;
|
||||||
|
|||||||
@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
#pragma mark - NSObject
|
#pragma mark - NSObject
|
||||||
|
|
||||||
- (id)init {
|
- (instancetype)init {
|
||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
_customActivityImage = nil;
|
_customActivityImage = nil;
|
||||||
_customActivityTitle = nil;
|
_customActivityTitle = nil;
|
||||||
|
|||||||
@ -76,7 +76,7 @@
|
|||||||
|
|
||||||
#pragma mark - NSObject
|
#pragma mark - NSObject
|
||||||
|
|
||||||
- (id)init {
|
- (instancetype)init {
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self) {
|
if (self) {
|
||||||
self.title = BITHockeyLocalizedString(@"HockeyFeedbackComposeTitle");
|
self.title = BITHockeyLocalizedString(@"HockeyFeedbackComposeTitle");
|
||||||
|
|||||||
@ -76,7 +76,7 @@
|
|||||||
@implementation BITFeedbackListViewCell
|
@implementation BITFeedbackListViewCell
|
||||||
|
|
||||||
|
|
||||||
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
||||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||||
if (self) {
|
if (self) {
|
||||||
// Initialization code
|
// Initialization code
|
||||||
|
|||||||
@ -77,7 +77,7 @@
|
|||||||
|
|
||||||
#pragma mark - Initialization
|
#pragma mark - Initialization
|
||||||
|
|
||||||
- (id)init {
|
- (instancetype)init {
|
||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
_currentFeedbackListViewController = nil;
|
_currentFeedbackListViewController = nil;
|
||||||
_currentFeedbackComposeViewController = nil;
|
_currentFeedbackComposeViewController = nil;
|
||||||
|
|||||||
@ -51,7 +51,7 @@
|
|||||||
@implementation BITFeedbackUserDataViewController
|
@implementation BITFeedbackUserDataViewController
|
||||||
|
|
||||||
|
|
||||||
- (id)initWithStyle:(UITableViewStyle)style {
|
- (instancetype)initWithStyle:(UITableViewStyle)style {
|
||||||
self = [super initWithStyle:style];
|
self = [super initWithStyle:style];
|
||||||
if (self) {
|
if (self) {
|
||||||
self.title = BITHockeyLocalizedString(@"HockeyFeedbackUserDataTitle");
|
self.title = BITHockeyLocalizedString(@"HockeyFeedbackUserDataTitle");
|
||||||
|
|||||||
@ -54,7 +54,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (id)init {
|
- (instancetype)init {
|
||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
_serverURL = BITHOCKEYSDK_URL;
|
_serverURL = BITHOCKEYSDK_URL;
|
||||||
|
|
||||||
@ -75,7 +75,7 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)initWithAppIdentifier:(NSString *)appIdentifier isAppStoreEnvironment:(BOOL)isAppStoreEnvironment {
|
- (instancetype)initWithAppIdentifier:(NSString *)appIdentifier isAppStoreEnvironment:(BOOL)isAppStoreEnvironment {
|
||||||
if ((self = [self init])) {
|
if ((self = [self init])) {
|
||||||
_appIdentifier = appIdentifier;
|
_appIdentifier = appIdentifier;
|
||||||
_isAppStoreEnvironment = isAppStoreEnvironment;
|
_isAppStoreEnvironment = isAppStoreEnvironment;
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
@property (nonatomic, strong) NSString *appIdentifier;
|
@property (nonatomic, strong) NSString *appIdentifier;
|
||||||
|
|
||||||
- (id)initWithAppIdentifier:(NSString *)appIdentifier isAppStoreEnvironment:(BOOL)isAppStoreEnvironment;
|
- (instancetype)initWithAppIdentifier:(NSString *)appIdentifier isAppStoreEnvironment:(BOOL)isAppStoreEnvironment;
|
||||||
|
|
||||||
- (void)startManager;
|
- (void)startManager;
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
@implementation BITImageAnnotation
|
@implementation BITImageAnnotation
|
||||||
|
|
||||||
- (id)initWithFrame:(CGRect)frame
|
- (instancetype)initWithFrame:(CGRect)frame
|
||||||
{
|
{
|
||||||
self = [super initWithFrame:frame];
|
self = [super initWithFrame:frame];
|
||||||
if (self) {
|
if (self) {
|
||||||
|
|||||||
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
@implementation BITRectangleImageAnnotation
|
@implementation BITRectangleImageAnnotation
|
||||||
|
|
||||||
- (id)initWithFrame:(CGRect)frame
|
- (instancetype)initWithFrame:(CGRect)frame
|
||||||
{
|
{
|
||||||
self = [super initWithFrame:frame];
|
self = [super initWithFrame:frame];
|
||||||
if (self) {
|
if (self) {
|
||||||
|
|||||||
@ -71,8 +71,8 @@ typedef NS_ENUM(NSUInteger, BITStoreButtonStyle) {
|
|||||||
// The interface is flexible, so there is now fixed order
|
// The interface is flexible, so there is now fixed order
|
||||||
@interface BITStoreButton : UIButton
|
@interface BITStoreButton : UIButton
|
||||||
|
|
||||||
- (id)initWithFrame:(CGRect)frame;
|
- (instancetype)initWithFrame:(CGRect)frame;
|
||||||
- (id)initWithPadding:(CGPoint)padding style:(BITStoreButtonStyle)style;
|
- (instancetype)initWithPadding:(CGPoint)padding style:(BITStoreButtonStyle)style;
|
||||||
|
|
||||||
// action delegate
|
// action delegate
|
||||||
@property (nonatomic, weak) id<BITStoreButtonDelegate> buttonDelegate;
|
@property (nonatomic, weak) id<BITStoreButtonDelegate> buttonDelegate;
|
||||||
|
|||||||
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
#pragma mark - NSObject
|
#pragma mark - NSObject
|
||||||
|
|
||||||
- (id)initWithLabel:(NSString*)aLabel enabled:(BOOL)flag {
|
- (instancetype)initWithLabel:(NSString*)aLabel enabled:(BOOL)flag {
|
||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
self.label = aLabel;
|
self.label = aLabel;
|
||||||
self.enabled = flag;
|
self.enabled = flag;
|
||||||
@ -152,7 +152,7 @@
|
|||||||
|
|
||||||
#pragma mark - NSObject
|
#pragma mark - NSObject
|
||||||
|
|
||||||
- (id)initWithFrame:(CGRect)frame {
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
if ((self = [super initWithFrame:frame])) {
|
if ((self = [super initWithFrame:frame])) {
|
||||||
self.layer.needsDisplayOnBoundsChange = YES;
|
self.layer.needsDisplayOnBoundsChange = YES;
|
||||||
|
|
||||||
@ -167,7 +167,7 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)initWithPadding:(CGPoint)padding style:(BITStoreButtonStyle)style {
|
- (instancetype)initWithPadding:(CGPoint)padding style:(BITStoreButtonStyle)style {
|
||||||
CGRect frame = CGRectMake(0, 0, 40, BIT_MIN_HEIGHT);
|
CGRect frame = CGRectMake(0, 0, 40, BIT_MIN_HEIGHT);
|
||||||
if ((self = [self initWithFrame:frame])) {
|
if ((self = [self initWithFrame:frame])) {
|
||||||
_customPadding = padding;
|
_customPadding = padding;
|
||||||
|
|||||||
@ -106,7 +106,7 @@
|
|||||||
|
|
||||||
#pragma mark - Init
|
#pragma mark - Init
|
||||||
|
|
||||||
- (id)init {
|
- (instancetype)init {
|
||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
_checkInProgress = NO;
|
_checkInProgress = NO;
|
||||||
_updateAvailable = NO;
|
_updateAvailable = NO;
|
||||||
|
|||||||
@ -386,7 +386,7 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
|||||||
|
|
||||||
#pragma mark - Init
|
#pragma mark - Init
|
||||||
|
|
||||||
- (id)init {
|
- (instancetype)init {
|
||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
_delegate = nil;
|
_delegate = nil;
|
||||||
_expiryDate = nil;
|
_expiryDate = nil;
|
||||||
|
|||||||
@ -230,7 +230,7 @@
|
|||||||
|
|
||||||
#pragma mark - Init
|
#pragma mark - Init
|
||||||
|
|
||||||
- (id)initWithStyle:(UITableViewStyle)style {
|
- (instancetype)initWithStyle:(UITableViewStyle)style {
|
||||||
if ((self = [super initWithStyle:UITableViewStylePlain])) {
|
if ((self = [super initWithStyle:UITableViewStylePlain])) {
|
||||||
_updateManager = [BITHockeyManager sharedHockeyManager].updateManager ;
|
_updateManager = [BITHockeyManager sharedHockeyManager].updateManager ;
|
||||||
_isAppStoreEnvironment = [BITHockeyManager sharedHockeyManager].isAppStoreEnvironment;
|
_isAppStoreEnvironment = [BITHockeyManager sharedHockeyManager].isAppStoreEnvironment;
|
||||||
|
|||||||
@ -118,7 +118,7 @@ body { font: 13px 'Helvetica Neue', Helvetica; color:#626262; word-wrap:break-wo
|
|||||||
|
|
||||||
#pragma mark - NSObject
|
#pragma mark - NSObject
|
||||||
|
|
||||||
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
||||||
if((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) {
|
if((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) {
|
||||||
self.cellBackgroundColor = [UIColor clearColor];
|
self.cellBackgroundColor = [UIColor clearColor];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
@end
|
@end
|
||||||
@implementation MyDeviceWithIdentifierForVendor
|
@implementation MyDeviceWithIdentifierForVendor
|
||||||
|
|
||||||
- (id)init {
|
- (instancetype)init {
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if( self ) {
|
if( self ) {
|
||||||
_identifierForVendor = [NSUUID UUID];
|
_identifierForVendor = [NSUUID UUID];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user