@@ -566,6 +566,34 @@ bool objectGetPathCanReadRuntimeProperty(id object,
566566constexpr const char * kNativeApiAppearanceClassNameExpando =
567567 " __nativeApiAppearanceClassName" ;
568568
569+ Class appearanceProxyCustomizableClassFromDescription (id object) {
570+ #if TARGET_OS_IPHONE
571+ if (object == nil ) {
572+ return Nil ;
573+ }
574+
575+ const char * runtimeClassName = object_getClassName (object);
576+ if (runtimeClassName == nullptr ||
577+ std::strstr (runtimeClassName, " Appearance" ) == nullptr ) {
578+ return Nil ;
579+ }
580+
581+ NSString * description = [object description ];
582+ NSString * prefix = @" <Customizable class: " ;
583+ if (description.length <= prefix.length + 1 ||
584+ ![description hasPrefix: prefix] || ![description hasSuffix: @" >" ]) {
585+ return Nil ;
586+ }
587+
588+ NSRange classNameRange =
589+ NSMakeRange (prefix.length, description.length - prefix.length - 1 );
590+ NSString * className = [description substringWithRange: classNameRange];
591+ return NSClassFromString (className);
592+ #else
593+ return Nil ;
594+ #endif
595+ }
596+
569597Class taggedAppearanceProxyClass (
570598 Runtime& runtime, const std::shared_ptr<NativeApiBridge>& bridge,
571599 id object) {
@@ -576,7 +604,7 @@ Class taggedAppearanceProxyClass(
576604 Value classNameValue = bridge->findObjectExpando (
577605 runtime, object, kNativeApiAppearanceClassNameExpando );
578606 if (!classNameValue.isString ()) {
579- return Nil ;
607+ return appearanceProxyCustomizableClassFromDescription (object) ;
580608 }
581609
582610 std::string className =
0 commit comments