Skip to content

Commit 716e2a7

Browse files
committed
refactor(DTXUISyncResource): Reenable IMPLICIT_RETAIN_SELF and fix issues
1 parent b5677c7 commit 716e2a7

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

DetoxSync/DetoxSync.xcodeproj/project.pbxproj

-2
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,6 @@
12241224
isa = XCBuildConfiguration;
12251225
buildSettings = {
12261226
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = NO;
1227-
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO;
12281227
CODE_SIGN_STYLE = Automatic;
12291228
DEFINES_MODULE = YES;
12301229
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -1255,7 +1254,6 @@
12551254
isa = XCBuildConfiguration;
12561255
buildSettings = {
12571256
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = NO;
1258-
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO;
12591257
CODE_SIGN_STYLE = Automatic;
12601258
DEFINES_MODULE = YES;
12611259
DYLIB_COMPATIBILITY_VERSION = 1;

DetoxSync/DetoxSync/SyncResources/DTXUISyncResource.m

+14-14
Original file line numberDiff line numberDiff line change
@@ -113,45 +113,45 @@ - (void)_untrackForParam:(NSUInteger*)param eventIdentifier:(NSString*(NS_NOESCA
113113
- (void)trackViewNeedsLayout:(UIView *)view
114114
{
115115
NSString* identifier = [self _trackForParam:&_viewNeedsLayoutCount eventDescription:_DTXStringReturningBlock(@"View Layout") objectDescription:_DTXStringReturningBlock(view.__detox_sync_safeDescription)];
116-
116+
117117
__detox_sync_orig_dispatch_async(dispatch_get_main_queue(), ^ {
118-
[self _untrackForParam:&_viewNeedsLayoutCount eventIdentifier:_DTXStringReturningBlock(identifier)];
118+
[self _untrackForParam:&self->_viewNeedsLayoutCount eventIdentifier:_DTXStringReturningBlock(identifier)];
119119
});
120120
}
121121

122122
- (void)trackViewNeedsDisplay:(UIView *)view
123123
{
124124
NSString* identifier = [self _trackForParam:&_viewNeedsDisplayCount eventDescription:_DTXStringReturningBlock(@"View Display") objectDescription:_DTXStringReturningBlock(view.__detox_sync_safeDescription)];
125-
125+
126126
__detox_sync_orig_dispatch_async(dispatch_get_main_queue(), ^ {
127-
[self _untrackForParam:&_viewNeedsDisplayCount eventIdentifier:_DTXStringReturningBlock(identifier)];
127+
[self _untrackForParam:&self->_viewNeedsDisplayCount eventIdentifier:_DTXStringReturningBlock(identifier)];
128128
});
129129
}
130130

131131
- (void)trackLayerNeedsLayout:(CALayer *)layer
132132
{
133133
NSString* identifier = [self _trackForParam:&_layerNeedsLayoutCount eventDescription:_DTXStringReturningBlock(@"Layer Layout") objectDescription:_DTXStringReturningBlock(layer.description)];
134-
134+
135135
__detox_sync_orig_dispatch_async(dispatch_get_main_queue(), ^ {
136-
[self _untrackForParam:&_layerNeedsLayoutCount eventIdentifier:_DTXStringReturningBlock(identifier)];
136+
[self _untrackForParam:&self->_layerNeedsLayoutCount eventIdentifier:_DTXStringReturningBlock(identifier)];
137137
});
138138
}
139139

140140
- (void)trackLayerNeedsDisplay:(CALayer *)layer
141141
{
142142
NSString* identifier = [self _trackForParam:&_layerNeedsDisplayCount eventDescription:_DTXStringReturningBlock(@"Layer Display") objectDescription:_DTXStringReturningBlock(layer.description)];
143-
143+
144144
__detox_sync_orig_dispatch_async(dispatch_get_main_queue(), ^ {
145-
[self _untrackForParam:&_layerNeedsDisplayCount eventIdentifier:_DTXStringReturningBlock(identifier)];
145+
[self _untrackForParam:&self->_layerNeedsDisplayCount eventIdentifier:_DTXStringReturningBlock(identifier)];
146146
});
147147
}
148148

149149
- (void)trackLayerPendingAnimation:(CALayer*)layer
150150
{
151151
NSString* identifier = [self _trackForParam:&_layerPendingAnimationCount eventDescription:_DTXStringReturningBlock(@"Layer Pending Animation") objectDescription:_DTXStringReturningBlock(layer.description)];
152-
152+
153153
__detox_sync_orig_dispatch_async(dispatch_get_main_queue(), ^ {
154-
[self _untrackForParam:&_layerPendingAnimationCount eventIdentifier:_DTXStringReturningBlock(identifier)];
154+
[self _untrackForParam:&self->_layerPendingAnimationCount eventIdentifier:_DTXStringReturningBlock(identifier)];
155155
});
156156
}
157157

@@ -160,9 +160,9 @@ - (void)trackViewControllerWillAppear:(UIViewController *)vc
160160
if(vc.transitionCoordinator)
161161
{
162162
NSString* identifier = [self _trackForParam:&_viewControllerWillAppearCount eventDescription:_DTXStringReturningBlock(@"View Layout") objectDescription:_DTXStringReturningBlock(vc.description)];
163-
163+
164164
[vc.transitionCoordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
165-
[self _untrackForParam:&_viewControllerWillAppearCount eventIdentifier:_DTXStringReturningBlock(identifier)];
165+
[self _untrackForParam:&self->_viewControllerWillAppearCount eventIdentifier:_DTXStringReturningBlock(identifier)];
166166
}];
167167
}
168168
}
@@ -172,9 +172,9 @@ - (void)trackViewControllerWillDisappear:(UIViewController *)vc
172172
if(vc.transitionCoordinator)
173173
{
174174
NSString* identifier = [self _trackForParam:&_viewControllerWillDisappearCount eventDescription:_DTXStringReturningBlock(@"View Layout") objectDescription:_DTXStringReturningBlock(vc.description)];
175-
175+
176176
[vc.transitionCoordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
177-
[self _untrackForParam:&_viewControllerWillDisappearCount eventIdentifier:_DTXStringReturningBlock(identifier)];
177+
[self _untrackForParam:&self->_viewControllerWillDisappearCount eventIdentifier:_DTXStringReturningBlock(identifier)];
178178
}];
179179
}
180180
}

0 commit comments

Comments
 (0)