You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// iOS/tvOS 13 sometimes need a nudge on the next run loop.
127
-
if #available(iOS 14, tvOS 14,*){}else{
128
-
DispatchQueue.main.async{[weak controller]in
129
-
controller?.handler?()
130
-
}
131
-
}
132
-
133
124
return controller
134
125
}
135
126
@@ -159,7 +150,12 @@ final class IntrospectionPlatformViewController: PlatformViewController {
159
150
guardlet self else{
160
151
return
161
152
}
162
-
handler?(self)
153
+
154
+
// NB: .introspect makes no guarantees about the number of times it's callback is invoked, so the below is fair play to maximize compatibility and predictability
155
+
handler?(self) // we call this eagerly as most customization can successfully happen without a thread hop
156
+
DispatchQueue.main.async{
157
+
handler?(self) // we also thread hop to cover the rest of the cases where the underlying UI component isn't quite ready for customization
0 commit comments