项目中使用 'MLeaksFinder',提示UITextField leak,
临时打了个补丁解决iOS11 下UITextField 私有变量的retaincycle
- (void)willMoveToSuperview:(UIWindow *)superview
{
[super willMoveToSuperview:superview];
if (@available(iOS 11.0, *)) {//a temp solution to fix { UITextField private-var retaincycle.}
if (!superview) {
NSString *keyPath = @"textContentView.provider";
[self.passwordTextField setValue:nil forKeyPath:keyPath];
}
}
}