Просмотр исходного кода

Add comment explaining why we add the frame property to UIView at runtime.

Ryan Olson лет назад: 12
Родитель
Сommit
6a7d8cea5c
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      Classes/Object Explorers/FLEXViewExplorerViewController.m

+ 2 - 0
Classes/Object Explorers/FLEXViewExplorerViewController.m

@@ -88,6 +88,8 @@ typedef NS_ENUM(NSUInteger, FLEXViewExplorerRow) {
     if ([rowCookie isEqual:@(FLEXViewExplorerRowViewController)]) {
         drillInViewController = [FLEXObjectExplorerFactory explorerViewControllerForObject:[FLEXUtility viewControllerForView:self.viewToExplore]];
     } else if ([rowCookie isEqual:@(FLEXViewExplorerRowFrame)]) {
+        // A quirk of UIView: frame is not actually a property from the perspective of the runtime.
+        // We add the property to the class at runtime if it hasn't been added yet.
         [FLEXRuntimeUtility addFramePropertyToUIViewIfNeeded];
         objc_property_t frameProperty = class_getProperty([UIView class], "frame");
         drillInViewController = [[FLEXPropertyEditorViewController alloc] initWithTarget:self.viewToExplore property:frameProperty];