File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 423
423
CLANG_WARN_EMPTY_BODY = YES;
424
424
CLANG_WARN_ENUM_CONVERSION = YES;
425
425
CLANG_WARN_INT_CONVERSION = YES;
426
+ CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES;
426
427
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
427
428
CLANG_WARN_UNREACHABLE_CODE = YES;
428
429
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
467
468
CLANG_WARN_EMPTY_BODY = YES;
468
469
CLANG_WARN_ENUM_CONVERSION = YES;
469
470
CLANG_WARN_INT_CONVERSION = YES;
471
+ CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES;
470
472
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
471
473
CLANG_WARN_UNREACHABLE_CODE = YES;
472
474
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
499
501
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
500
502
PRODUCT_BUNDLE_IDENTIFIER = com.google.Switch;
501
503
PRODUCT_NAME = "$(TARGET_NAME)";
504
+ WARNING_CFLAGS = "";
502
505
};
503
506
name = Debug;
504
507
};
510
513
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
511
514
PRODUCT_BUNDLE_IDENTIFIER = com.google.Switch;
512
515
PRODUCT_NAME = "$(TARGET_NAME)";
516
+ WARNING_CFLAGS = "";
513
517
};
514
518
name = Release;
515
519
};
Original file line number Diff line number Diff line change @@ -611,19 +611,21 @@ - (void)setValueFromThumbPosition:(CGPoint)position isTap:(BOOL)isTap {
611
611
} else {
612
612
value = [self valueForThumbPosition: position];
613
613
}
614
- __weak MDCThumbTrack *weakSelf = self ;
615
- if ([_delegate respondsToSelector: @selector (thumbTrack:willAnimateToValue: )]) {
616
- [_delegate thumbTrack: self willAnimateToValue: value];
614
+ __strong typeof (_delegate) strongDelegate = _delegate ;
615
+ if ([strongDelegate respondsToSelector: @selector (thumbTrack:willAnimateToValue: )]) {
616
+ [strongDelegate thumbTrack: self willAnimateToValue: value];
617
617
}
618
+ __weak typeof (self) weakSelf = self;
618
619
[self setValue: value
619
620
animated: YES
620
621
userGenerated: YES
621
622
completion: ^{
622
- MDCThumbTrack *strongSelf = weakSelf;
623
+ __strong typeof (weakSelf) strongSelf = weakSelf;
624
+ __strong typeof (strongSelf->_delegate ) strongDelegate = strongSelf->_delegate ;
623
625
[strongSelf sendDiscreteChangeAction ];
624
- if (strongSelf && [strongSelf->_delegate
626
+ if (strongSelf && [strongDelegate
625
627
respondsToSelector: @selector (thumbTrack:didAnimateToValue: )]) {
626
- [strongSelf->_delegate thumbTrack: weakSelf didAnimateToValue: value];
628
+ [strongDelegate thumbTrack: strongSelf didAnimateToValue: value];
627
629
}
628
630
}];
629
631
}
You can’t perform that action at this time.
0 commit comments