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

Add generics to foundation collection classes

Chaoshuai Lu лет назад: 8
Родитель
Сommit
a535f10d0c
54 измененных файлов с 303 добавлено и 300 удалено
  1. 1 1
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputColorView.m
  2. 4 4
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputFontsPickerView.m
  3. 1 1
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputNumberView.m
  4. 5 5
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputStructView.m
  5. 1 1
      Classes/Editing/FLEXFieldEditorView.h
  6. 1 1
      Classes/Editing/FLEXFieldEditorView.m
  7. 2 2
      Classes/Editing/FLEXMethodCallingViewController.m
  8. 25 25
      Classes/ExplorerInterface/FLEXExplorerViewController.m
  9. 3 3
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXDatabaseManager.h
  10. 2 2
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXMultiColumnTableView.m
  11. 9 9
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXRealmDatabaseManager.m
  12. 3 3
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXRealmDefines.h
  13. 11 10
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXSQLiteDatabaseManager.m
  14. 2 2
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableContentCell.h
  15. 1 1
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableContentCell.m
  16. 2 2
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableContentViewController.h
  17. 6 7
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableContentViewController.m
  18. 14 13
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableListViewController.m
  19. 4 4
      Classes/GlobalStateExplorers/FLEXClassesTableViewController.m
  20. 2 2
      Classes/GlobalStateExplorers/FLEXCookiesTableViewController.m
  21. 1 1
      Classes/GlobalStateExplorers/FLEXFileBrowserSearchOperation.h
  22. 6 6
      Classes/GlobalStateExplorers/FLEXFileBrowserSearchOperation.m
  23. 8 8
      Classes/GlobalStateExplorers/FLEXFileBrowserTableViewController.m
  24. 3 5
      Classes/GlobalStateExplorers/FLEXGlobalsTableViewController.m
  25. 2 2
      Classes/GlobalStateExplorers/FLEXInstancesTableViewController.m
  26. 6 6
      Classes/GlobalStateExplorers/FLEXLibrariesTableViewController.m
  27. 7 7
      Classes/GlobalStateExplorers/FLEXLiveObjectsTableViewController.m
  28. 6 6
      Classes/GlobalStateExplorers/FLEXWebViewController.m
  29. 2 2
      Classes/GlobalStateExplorers/SystemLog/FLEXSystemLogTableViewCell.m
  30. 6 6
      Classes/GlobalStateExplorers/SystemLog/FLEXSystemLogTableViewController.m
  31. 3 1
      Classes/Manager/FLEXManager+Private.h
  32. 7 5
      Classes/Manager/FLEXManager.m
  33. 1 1
      Classes/Network/FLEXNetworkCurlLogger.m
  34. 6 6
      Classes/Network/FLEXNetworkHistoryTableViewController.m
  35. 1 1
      Classes/Network/FLEXNetworkRecorder.h
  36. 7 7
      Classes/Network/FLEXNetworkRecorder.m
  37. 2 2
      Classes/Network/FLEXNetworkSettingsTableViewController.m
  38. 22 22
      Classes/Network/FLEXNetworkTransactionDetailTableViewController.m
  39. 2 2
      Classes/Network/FLEXNetworkTransactionTableViewCell.m
  40. 2 2
      Classes/Network/PonyDebugger/FLEXNetworkObserver.m
  41. 2 2
      Classes/ObjectExplorers/FLEXClassExplorerViewController.m
  42. 1 1
      Classes/ObjectExplorers/FLEXObjectExplorerFactory.m
  43. 44 44
      Classes/ObjectExplorers/FLEXObjectExplorerViewController.m
  44. 8 8
      Classes/ObjectExplorers/FLEXViewExplorerViewController.m
  45. 1 1
      Classes/Toolbar/FLEXExplorerToolbar.h
  46. 1 1
      Classes/Toolbar/FLEXExplorerToolbar.m
  47. 1 1
      Classes/Toolbar/FLEXToolbarItem.m
  48. 8 8
      Classes/Utility/FLEXKeyboardShortcutManager.m
  49. 1 1
      Classes/Utility/FLEXRuntimeUtility.h
  50. 14 14
      Classes/Utility/FLEXRuntimeUtility.m
  51. 2 2
      Classes/Utility/FLEXUtility.h
  52. 13 13
      Classes/Utility/FLEXUtility.m
  53. 1 1
      Classes/ViewHierarchy/FLEXHierarchyTableViewController.h
  54. 7 7
      Classes/ViewHierarchy/FLEXHierarchyTableViewController.m

+ 1 - 1
Classes/Editing/ArgumentInputViews/FLEXArgumentInputColorView.m

@@ -228,7 +228,7 @@
     CGFloat hexLabelOriginY = CGRectGetMaxY(self.colorPreviewBox.frame) - self.colorPreviewBox.layer.borderWidth - self.hexLabel.frame.size.height;
     self.hexLabel.frame = CGRectMake(hexLabelOriginX, hexLabelOriginY, self.hexLabel.frame.size.width, self.hexLabel.frame.size.height);
     
-    NSArray *colorComponentInputViews = @[self.alphaInput, self.redInput, self.greenInput, self.blueInput];
+    NSArray<FLEXColorComponentInputView *> *colorComponentInputViews = @[self.alphaInput, self.redInput, self.greenInput, self.blueInput];
     for (FLEXColorComponentInputView *inputView in colorComponentInputViews) {
         CGSize fitSize = [inputView sizeThatFits:constrainSize];
         inputView.frame = CGRectMake(0, runningOriginY, fitSize.width, fitSize.height);

+ 4 - 4
Classes/Editing/ArgumentInputViews/FLEXArgumentInputFontsPickerView.m

@@ -11,7 +11,7 @@
 
 @interface FLEXArgumentInputFontsPickerView ()
 
-@property (nonatomic, strong) NSMutableArray *availableFonts;
+@property (nonatomic, strong) NSMutableArray<NSString *> *availableFonts;
 
 @end
 
@@ -35,7 +35,7 @@
     if ([self.availableFonts indexOfObject:inputValue] == NSNotFound) {
         [self.availableFonts insertObject:inputValue atIndex:0];
     }
-    [(UIPickerView*)self.inputTextView.inputView selectRow:[self.availableFonts indexOfObject:inputValue] inComponent:0 animated:NO];
+    [(UIPickerView *)self.inputTextView.inputView selectRow:[self.availableFonts indexOfObject:inputValue] inComponent:0 animated:NO];
 }
 
 - (id)inputValue
@@ -56,7 +56,7 @@
 
 - (void)createAvailableFonts
 {
-    NSMutableArray *unsortedFontsArray = [NSMutableArray array];
+    NSMutableArray<NSString *> *unsortedFontsArray = [NSMutableArray array];
     for (NSString *eachFontFamily in [UIFont familyNames]) {
         for (NSString *eachFontName in [UIFont fontNamesForFamilyName:eachFontFamily]) {
             [unsortedFontsArray addObject:eachFontName];
@@ -90,7 +90,7 @@
         fontLabel = (UILabel*)view;
     }
     UIFont *font = [UIFont fontWithName:self.availableFonts[row] size:15.0];
-    NSDictionary *attributesDictionary = [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName];
+    NSDictionary<NSString *, id> *attributesDictionary = [NSDictionary<NSString *, id> dictionaryWithObject:font forKey:NSFontAttributeName];
     NSAttributedString *attributesString = [[NSAttributedString alloc] initWithString:self.availableFonts[row] attributes:attributesDictionary];
     fontLabel.attributedText = attributesString;
     [fontLabel sizeToFit];

+ 1 - 1
Classes/Editing/ArgumentInputViews/FLEXArgumentInputNumberView.m

@@ -35,7 +35,7 @@
 
 + (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value
 {
-    static NSArray *primitiveTypes = nil;
+    static NSArray<NSString *> *primitiveTypes = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
         primitiveTypes = @[@(@encode(char)),

+ 5 - 5
Classes/Editing/ArgumentInputViews/FLEXArgumentInputStructView.m

@@ -12,7 +12,7 @@
 
 @interface FLEXArgumentInputStructView ()
 
-@property (nonatomic, strong) NSArray *argumentInputViews;
+@property (nonatomic, strong) NSArray<UIView *> *argumentInputViews;
 
 @end
 
@@ -22,8 +22,8 @@
 {
     self = [super initWithArgumentTypeEncoding:typeEncoding];
     if (self) {
-        NSMutableArray *inputViews = [NSMutableArray array];
-        NSArray *customTitles = [[self class] customFieldTitlesForTypeEncoding:typeEncoding];
+        NSMutableArray<UIView *> *inputViews = [NSMutableArray array];
+        NSArray<NSString *> *customTitles = [[self class] customFieldTitlesForTypeEncoding:typeEncoding];
         [FLEXRuntimeUtility enumerateTypesInStructEncoding:typeEncoding usingBlock:^(NSString *structName, const char *fieldTypeEncoding, NSString *prettyTypeEncoding, NSUInteger fieldIndex, NSUInteger fieldOffset) {
             
             FLEXArgumentInputView *inputView = [FLEXArgumentInputViewFactory argumentInputViewForTypeEncoding:fieldTypeEncoding];
@@ -179,9 +179,9 @@
     return type && type[0] == '{';
 }
 
-+ (NSArray *)customFieldTitlesForTypeEncoding:(const char *)typeEncoding
++ (NSArray<NSString *> *)customFieldTitlesForTypeEncoding:(const char *)typeEncoding
 {
-    NSArray *customTitles = nil;
+    NSArray<NSString *> *customTitles = nil;
     if (strcmp(typeEncoding, @encode(CGRect)) == 0) {
         customTitles = @[@"CGPoint origin", @"CGSize size"];
     } else if (strcmp(typeEncoding, @encode(CGPoint)) == 0) {

+ 1 - 1
Classes/Editing/FLEXFieldEditorView.h

@@ -13,6 +13,6 @@
 @property (nonatomic, copy) NSString *targetDescription;
 @property (nonatomic, copy) NSString *fieldDescription;
 
-@property (nonatomic, strong) NSArray *argumentInputViews;
+@property (nonatomic, strong) NSArray<UIView *> *argumentInputViews;
 
 @end

+ 1 - 1
Classes/Editing/FLEXFieldEditorView.m

@@ -103,7 +103,7 @@
     }
 }
 
-- (void)setArgumentInputViews:(NSArray *)argumentInputViews
+- (void)setArgumentInputViews:(NSArray<UIView *> *)argumentInputViews
 {
     if (![_argumentInputViews isEqual:argumentInputViews]) {
         

+ 2 - 2
Classes/Editing/FLEXMethodCallingViewController.m

@@ -38,8 +38,8 @@
     
     self.fieldEditorView.fieldDescription = [FLEXRuntimeUtility prettyNameForMethod:self.method isClassMethod:[self isClassMethod]];
     
-    NSArray *methodComponents = [FLEXRuntimeUtility prettyArgumentComponentsForMethod:self.method];
-    NSMutableArray *argumentInputViews = [NSMutableArray array];
+    NSArray<NSString *> *methodComponents = [FLEXRuntimeUtility prettyArgumentComponentsForMethod:self.method];
+    NSMutableArray<UIView *> *argumentInputViews = [NSMutableArray array];
     unsigned int argumentIndex = kFLEXNumberOfImplicitArgs;
     for (NSString *methodComponent in methodComponents) {
         char *argumentTypeEncoding = method_copyArgumentType(self.method, argumentIndex);

+ 25 - 25
Classes/ExplorerInterface/FLEXExplorerViewController.m

@@ -45,10 +45,10 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 
 /// Borders of all the visible views in the hierarchy at the selection point.
 /// The keys are NSValues with the correponding view (nonretained).
-@property (nonatomic, strong) NSDictionary *outlineViewsForVisibleViews;
+@property (nonatomic, strong) NSDictionary<NSValue *, UIView *> *outlineViewsForVisibleViews;
 
 /// The actual views at the selection point with the deepest view last.
-@property (nonatomic, strong) NSArray *viewsAtTapPoint;
+@property (nonatomic, strong) NSArray<UIView *> *viewsAtTapPoint;
 
 /// The view that we're currently highlighting with an overlay and displaying details for.
 @property (nonatomic, strong) UIView *selectedView;
@@ -68,7 +68,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 @property (nonatomic, assign) UIStatusBarStyle previousStatusBarStyle;
 
 /// All views that we're KVOing. Used to help us clean up properly.
-@property (nonatomic, strong) NSMutableSet *observedViews;
+@property (nonatomic, strong) NSMutableSet<UIView *> *observedViews;
 
 @end
 
@@ -238,7 +238,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     }
 }
 
-- (void)setViewsAtTapPoint:(NSArray *)viewsAtTapPoint
+- (void)setViewsAtTapPoint:(NSArray<UIView *> *)viewsAtTapPoint
 {
     if (![_viewsAtTapPoint isEqual:viewsAtTapPoint]) {
         for (UIView *view in _viewsAtTapPoint) {
@@ -268,7 +268,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
                 
             case FLEXExplorerModeSelect:
                 // Make sure the outline views are unhidden in case we came from the move mode.
-                for (id key in self.outlineViewsForVisibleViews) {
+                for (NSValue *key in self.outlineViewsForVisibleViews) {
                     UIView *outlineView = self.outlineViewsForVisibleViews[key];
                     outlineView.hidden = NO;
                 }
@@ -276,7 +276,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
                 
             case FLEXExplorerModeMove:
                 // Hide all the outline views to focus on the selected view, which is the only one that will move.
-                for (id key in self.outlineViewsForVisibleViews) {
+                for (NSValue *key in self.outlineViewsForVisibleViews) {
                     UIView *outlineView = self.outlineViewsForVisibleViews[key];
                     outlineView.hidden = YES;
                 }
@@ -317,9 +317,9 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     [self.observedViews removeObject:view];
 }
 
-+ (NSArray *)viewKeyPathsToTrack
++ (NSArray<NSString *> *)viewKeyPathsToTrack
 {
-    static NSArray *trackedViewKeyPaths = nil;
+    static NSArray<NSString *> *trackedViewKeyPaths = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
         NSString *frameKeyPath = NSStringFromSelector(@selector(frame));
@@ -328,7 +328,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return trackedViewKeyPaths;
 }
 
-- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *, id> *)change context:(void *)context
 {
     [self updateOverlayAndDescriptionForObjectIfNeeded:object];
 }
@@ -382,10 +382,10 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     [self toggleViewsTool];
 }
 
-- (NSArray *)allViewsInHierarchy
+- (NSArray<UIView *> *)allViewsInHierarchy
 {
-    NSMutableArray *allViews = [NSMutableArray array];
-    NSArray *windows = [FLEXUtility allWindows];
+    NSMutableArray<UIView *> *allViews = [NSMutableArray array];
+    NSArray<UIWindow *> *windows = [FLEXUtility allWindows];
     for (UIWindow *window in windows) {
         if (window != self.view.window) {
             [allViews addObject:window];
@@ -542,8 +542,8 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     
     // For outlined views and the selected view, only use visible views.
     // Outlining hidden views adds clutter and makes the selection behavior confusing.
-    NSArray *visibleViewsAtTapPoint = [self viewsAtPoint:selectionPointInWindow skipHiddenViews:YES];
-    NSMutableDictionary *newOutlineViewsForVisibleViews = [NSMutableDictionary dictionary];
+    NSArray<UIView *> *visibleViewsAtTapPoint = [self viewsAtPoint:selectionPointInWindow skipHiddenViews:YES];
+    NSMutableDictionary<NSValue *, UIView *> *newOutlineViewsForVisibleViews = [NSMutableDictionary dictionary];
     for (UIView *view in visibleViewsAtTapPoint) {
         UIView *outlineView = [self outlineViewForView:view];
         [self.view addSubview:outlineView];
@@ -571,16 +571,16 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 
 - (void)removeAndClearOutlineViews
 {
-    for (id key in self.outlineViewsForVisibleViews) {
+    for (NSValue *key in self.outlineViewsForVisibleViews) {
         UIView *outlineView = self.outlineViewsForVisibleViews[key];
         [outlineView removeFromSuperview];
     }
     self.outlineViewsForVisibleViews = nil;
 }
 
-- (NSArray *)viewsAtPoint:(CGPoint)tapPointInWindow skipHiddenViews:(BOOL)skipHidden
+- (NSArray<UIView *> *)viewsAtPoint:(CGPoint)tapPointInWindow skipHiddenViews:(BOOL)skipHidden
 {
-    NSMutableArray *views = [NSMutableArray array];
+    NSMutableArray<UIView *> *views = [NSMutableArray array];
     for (UIWindow *window in [FLEXUtility allWindows]) {
         // Don't include the explorer's own window or subviews.
         if (window != self.view.window && [window pointInside:tapPointInWindow withEvent:nil]) {
@@ -610,9 +610,9 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return [[self recursiveSubviewsAtPoint:tapPointInWindow inView:windowForSelection skipHiddenViews:YES] lastObject];
 }
 
-- (NSArray *)recursiveSubviewsAtPoint:(CGPoint)pointInView inView:(UIView *)view skipHiddenViews:(BOOL)skipHidden
+- (NSArray<UIView *> *)recursiveSubviewsAtPoint:(CGPoint)pointInView inView:(UIView *)view skipHiddenViews:(BOOL)skipHidden
 {
-    NSMutableArray *subviewsAtPoint = [NSMutableArray array];
+    NSMutableArray<UIView *> *subviewsAtPoint = [NSMutableArray array];
     for (UIView *subview in view.subviews) {
         BOOL isHidden = subview.hidden || subview.alpha < 0.01;
         if (skipHidden && isHidden) {
@@ -634,9 +634,9 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return subviewsAtPoint;
 }
 
-- (NSArray *)allRecursiveSubviewsInView:(UIView *)view
+- (NSArray<UIView *> *)allRecursiveSubviewsInView:(UIView *)view
 {
-    NSMutableArray *subviews = [NSMutableArray array];
+    NSMutableArray<UIView *> *subviews = [NSMutableArray array];
     for (UIView *subview in view.subviews) {
         [subviews addObject:subview];
         [subviews addObjectsFromArray:[self allRecursiveSubviewsInView:subview]];
@@ -644,9 +644,9 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return subviews;
 }
 
-- (NSDictionary *)hierarchyDepthsForViews:(NSArray *)views
+- (NSDictionary<NSValue *, NSNumber *> *)hierarchyDepthsForViews:(NSArray<UIView *> *)views
 {
-    NSMutableDictionary *hierarchyDepths = [NSMutableDictionary dictionary];
+    NSMutableDictionary<NSValue *, NSNumber *> *hierarchyDepths = [NSMutableDictionary dictionary];
     for (UIView *view in views) {
         NSInteger depth = 0;
         UIView *tryView = view;
@@ -863,8 +863,8 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
         [self resignKeyAndDismissViewControllerAnimated:YES completion:nil];
     } else {
         void (^presentBlock)(void) = ^{
-            NSArray *allViews = [self allViewsInHierarchy];
-            NSDictionary *depthsForViews = [self hierarchyDepthsForViews:allViews];
+            NSArray<UIView *> *allViews = [self allViewsInHierarchy];
+            NSDictionary<NSValue *, NSNumber *> *depthsForViews = [self hierarchyDepthsForViews:allViews];
             FLEXHierarchyTableViewController *hierarchyTVC = [[FLEXHierarchyTableViewController alloc] initWithViews:allViews viewsAtTap:self.viewsAtTapPoint selectedView:self.selectedView depths:depthsForViews];
             hierarchyTVC.delegate = self;
             UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:hierarchyTVC];

+ 3 - 3
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXDatabaseManager.h

@@ -19,8 +19,8 @@
 - (instancetype)initWithPath:(NSString*)path;
 
 - (BOOL)open;
-- (NSArray *)queryAllTables;
-- (NSArray *)queryAllColumnsWithTableName:(NSString *)tableName;
-- (NSArray *)queryAllDataWithTableName:(NSString *)tableName;
+- (NSArray<NSDictionary<NSString *, id> *> *)queryAllTables;
+- (NSArray<NSString *> *)queryAllColumnsWithTableName:(NSString *)tableName;
+- (NSArray<NSDictionary<NSString *, id> *> *)queryAllDataWithTableName:(NSString *)tableName;
 
 @end

+ 2 - 2
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXMultiColumnTableView.m

@@ -19,7 +19,7 @@
 @property (nonatomic, strong) UITableView  *contentTableView;
 @property (nonatomic, strong) UIView       *leftHeader;
 
-@property (nonatomic, strong) NSDictionary *sortStatusDict;
+@property (nonatomic, strong) NSDictionary<NSString *, NSNumber *> *sortStatusDict;
 @property (nonatomic, strong) NSArray *rowData;
 @end
 
@@ -135,7 +135,7 @@ static const CGFloat kColumnMargin = 1;
 
 - (void)loadHeaderData
 {
-    NSArray *subviews = self.headerScrollView.subviews;
+    NSArray<UIView *> *subviews = self.headerScrollView.subviews;
     
     for (UIView *subview in subviews) {
         [subview removeFromSuperview];

+ 9 - 9
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXRealmDatabaseManager.m

@@ -18,7 +18,7 @@
 @interface FLEXRealmDatabaseManager ()
 
 @property (nonatomic, copy) NSString *path;
-@property (nonatomic, strong) id realm;
+@property (nonatomic, strong) RLMRealm * realm;
 
 @end
 
@@ -57,9 +57,9 @@
     return (error == nil);
 }
 
-- (NSArray *)queryAllTables
+- (NSArray<NSDictionary<NSString *, id> *> *)queryAllTables
 {
-    NSMutableArray *allTables = [NSMutableArray array];
+    NSMutableArray<NSDictionary<NSString *, id> *> *allTables = [NSMutableArray array];
     RLMSchema *schema = [self.realm schema];
     
     for (RLMObjectSchema *objectSchema in schema.objectSchema) {
@@ -67,21 +67,21 @@
             continue;
         }
         
-        NSDictionary *dictionary = @{@"name":objectSchema.className};
+        NSDictionary<NSString *, id> *dictionary = @{@"name":objectSchema.className};
         [allTables addObject:dictionary];
     }
     
     return allTables;
 }
 
-- (NSArray *)queryAllColumnsWithTableName:(NSString *)tableName
+- (NSArray<NSString *> *)queryAllColumnsWithTableName:(NSString *)tableName
 {
     RLMObjectSchema *objectSchema = [[self.realm schema] schemaForClassName:tableName];
     if (objectSchema == nil) {
         return nil;
     }
     
-    NSMutableArray *columnNames = [NSMutableArray array];
+    NSMutableArray<NSString *> *columnNames = [NSMutableArray array];
     for (RLMProperty *property in objectSchema.properties) {
         [columnNames addObject:property.name];
     }
@@ -89,7 +89,7 @@
     return columnNames;
 }
 
-- (NSArray *)queryAllDataWithTableName:(NSString *)tableName
+- (NSArray<NSDictionary<NSString *, id> *> *)queryAllDataWithTableName:(NSString *)tableName
 {
     RLMObjectSchema *objectSchema = [[self.realm schema] schemaForClassName:tableName];
     RLMResults *results = [self.realm allObjects:tableName];
@@ -97,9 +97,9 @@
         return nil;
     }
     
-    NSMutableArray *allDataEntries = [NSMutableArray array];
+    NSMutableArray<NSDictionary<NSString *, id> *> *allDataEntries = [NSMutableArray array];
     for (RLMObject *result in results) {
-        NSMutableDictionary *entry = [NSMutableDictionary dictionary];
+        NSMutableDictionary<NSString *, id> *entry = [NSMutableDictionary dictionary];
         for (RLMProperty *property in objectSchema.properties) {
             id value = [result valueForKey:property.name];
             entry[property.name] = (value) ? (value) : [NSNull null];

+ 3 - 3
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXRealmDefines.h

@@ -22,13 +22,13 @@
 @end
 
 @interface RLMSchema : NSObject
-@property (nonatomic, readonly) NSArray *objectSchema;
+@property (nonatomic, readonly) NSArray<RLMObjectSchema *> *objectSchema;
 - (RLMObjectSchema *)schemaForClassName:(NSString *)className;
 @end
 
 @interface RLMObjectSchema : NSObject
 @property (nonatomic, readonly) NSString *className;
-@property (nonatomic, readonly) NSArray *properties;
+@property (nonatomic, readonly) NSArray<RLMProperty *> *properties;
 @end
 
 @interface RLMProperty : NSString
@@ -43,4 +43,4 @@
 
 @end
 
-#endif
+#endif

+ 11 - 10
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXSQLiteDatabaseManager.m

@@ -86,23 +86,24 @@ static NSString *const QUERY_TABLENAMES_SQL = @"SELECT name FROM sqlite_master W
 }
 
 
-- (NSArray *)queryAllTables
+- (NSArray<NSDictionary<NSString *, id> *> *)queryAllTables
 {
     return [self executeQuery:QUERY_TABLENAMES_SQL];
 }
 
-- (NSArray *)queryAllColumnsWithTableName:(NSString *)tableName
+- (NSArray<NSString *> *)queryAllColumnsWithTableName:(NSString *)tableName
 {
     NSString *sql = [NSString stringWithFormat:@"PRAGMA table_info('%@')",tableName];
-    NSArray *resultArray =  [self executeQuery:sql];
-    NSMutableArray *array = [NSMutableArray array];
-    for (NSDictionary *dict in resultArray) {
-        [array addObject:dict[@"name"]];
+    NSArray<NSDictionary<NSString *, id> *> *resultArray =  [self executeQuery:sql];
+    NSMutableArray<NSString *> *array = [NSMutableArray array];
+    for (NSDictionary<NSString *, id> *dict in resultArray) {
+        NSString *columnName = (NSString *)dict[@"name"] ?: @"";
+        [array addObject:columnName];
     }
     return array;
 }
 
-- (NSArray *)queryAllDataWithTableName:(NSString *)tableName
+- (NSArray<NSDictionary<NSString *, id> *> *)queryAllDataWithTableName:(NSString *)tableName
 {
     NSString *sql = [NSString stringWithFormat:@"SELECT * FROM %@",tableName];
     return [self executeQuery:sql];
@@ -111,16 +112,16 @@ static NSString *const QUERY_TABLENAMES_SQL = @"SELECT name FROM sqlite_master W
 #pragma mark -
 #pragma mark - Private
 
-- (NSArray *)executeQuery:(NSString *)sql
+- (NSArray<NSDictionary<NSString *, id> *> *)executeQuery:(NSString *)sql
 {
     [self open];
-    NSMutableArray *resultArray = [NSMutableArray array];
+    NSMutableArray<NSDictionary<NSString *, id> *> *resultArray = [NSMutableArray array];
     sqlite3_stmt *pstmt;
     if (sqlite3_prepare_v2(_db, [sql UTF8String], -1, &pstmt, 0) == SQLITE_OK) {
         while (sqlite3_step(pstmt) == SQLITE_ROW) {
             NSUInteger num_cols = (NSUInteger)sqlite3_data_count(pstmt);
             if (num_cols > 0) {
-                NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:num_cols];
+                NSMutableDictionary<NSString *, id> *dict = [NSMutableDictionary dictionaryWithCapacity:num_cols];
                 
                 int columnCount = sqlite3_column_count(pstmt);
                 

+ 2 - 2
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableContentCell.h

@@ -18,9 +18,9 @@
 
 @interface FLEXTableContentCell : UITableViewCell
 
-@property (nonatomic, strong)NSArray *labels;
+@property (nonatomic, strong) NSArray<UILabel *> *labels;
 
-@property (nonatomic, weak) id<FLEXTableContentCellDelegate>delegate;
+@property (nonatomic, weak) id<FLEXTableContentCellDelegate> delegate;
 
 + (instancetype)cellWithTableView:(UITableView *)tableView columnNumber:(NSInteger)number;
 

+ 1 - 1
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableContentCell.m

@@ -21,7 +21,7 @@
     FLEXTableContentCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
     if (!cell) {
         cell = [[FLEXTableContentCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
-        NSMutableArray *labels = [NSMutableArray array];
+        NSMutableArray<UILabel *> *labels = [NSMutableArray array];
         for (int i = 0; i < number ; i++) {
             UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
             label.backgroundColor = [UIColor whiteColor];

+ 2 - 2
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableContentViewController.h

@@ -10,7 +10,7 @@
 
 @interface FLEXTableContentViewController : UIViewController
 
-@property (nonatomic, strong) NSArray *columnsArray;
-@property (nonatomic, strong) NSArray *contentsArray;
+@property (nonatomic, strong) NSArray<NSString *> *columnsArray;
+@property (nonatomic, strong) NSArray<NSDictionary<NSString *, id> *> *contentsArray;
 
 @end

+ 6 - 7
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableContentViewController.m

@@ -13,7 +13,7 @@
 
 @interface FLEXTableContentViewController ()<FLEXMultiColumnTableViewDataSource, FLEXMultiColumnTableViewDelegate>
 
-@property (nonatomic, strong)FLEXMultiColumnTableView *multiColumView;
+@property (nonatomic, strong) FLEXMultiColumnTableView *multiColumView;
 
 @end
 
@@ -48,7 +48,6 @@
 {
     [super viewWillAppear:animated];
     [self.multiColumView reloadData];
-    
 }
 
 #pragma mark -
@@ -78,7 +77,7 @@
 - (NSString *)contentAtColumn:(NSInteger)column row:(NSInteger)row
 {
     if (self.contentsArray.count > row) {
-        NSDictionary *dic = self.contentsArray[row];
+        NSDictionary<NSString *, id> *dic = self.contentsArray[row];
         if (self.contentsArray.count > column) {
             return [NSString stringWithFormat:@"%@",[dic objectForKey:self.columnsArray[column]]];
         }
@@ -90,11 +89,11 @@
 {
     NSMutableArray *result = [NSMutableArray array];
     if (self.contentsArray.count > row) {
-        NSDictionary *dic = self.contentsArray[row];
+        NSDictionary<NSString *, id> *dic = self.contentsArray[row];
         for (int i = 0; i < self.columnsArray.count; i ++) {
             [result addObject:dic[self.columnsArray[i]]];
         }
-        return  result;
+        return result;
     }
     return nil;
 }
@@ -119,7 +118,7 @@
 - (CGFloat)widthForLeftHeaderInTableView:(FLEXMultiColumnTableView *)tableView
 {
     NSString *str = [NSString stringWithFormat:@"%lu",(unsigned long)self.contentsArray.count];
-    NSDictionary *attrs = @{@"NSFontAttributeName":[UIFont systemFontOfSize:17.0]};
+    NSDictionary<NSString *, id> *attrs = @{@"NSFontAttributeName":[UIFont systemFontOfSize:17.0]};
     CGSize size =   [str boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, 14)
                                       options:NSStringDrawingUsesLineFragmentOrigin
                                    attributes:attrs context:nil].size;
@@ -139,7 +138,7 @@
 - (void)multiColumnTableView:(FLEXMultiColumnTableView *)tableView didTapHeaderWithText:(NSString *)text sortType:(FLEXTableColumnHeaderSortType)sortType
 {
     
-    NSArray *sortContentData = [self.contentsArray sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
+    NSArray<NSDictionary<NSString *, id> *> *sortContentData = [self.contentsArray sortedArrayUsingComparator:^NSComparisonResult(NSDictionary<NSString *, id> * obj1, NSDictionary<NSString *, id> * obj2) {
         
         if ([obj1 objectForKey:text] == [NSNull null]) {
             return NSOrderedAscending;

+ 14 - 13
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableListViewController.m

@@ -20,10 +20,10 @@
     NSString *_databasePath;
 }
 
-@property (nonatomic, strong) NSArray *tables;
+@property (nonatomic, strong) NSArray<NSString *> *tables;
 
-+ (NSArray *)supportedSQLiteExtensions;
-+ (NSArray *)supportedRealmExtensions;
++ (NSArray<NSString *> *)supportedSQLiteExtensions;
++ (NSArray<NSString *> *)supportedRealmExtensions;
 
 @end
 
@@ -45,12 +45,12 @@
 {
     NSString *pathExtension = path.pathExtension.lowercaseString;
     
-    NSArray *sqliteExtensions = [FLEXTableListViewController supportedSQLiteExtensions];
+    NSArray<NSString *> *sqliteExtensions = [FLEXTableListViewController supportedSQLiteExtensions];
     if ([sqliteExtensions indexOfObject:pathExtension] != NSNotFound) {
         return [[FLEXSQLiteDatabaseManager alloc] initWithPath:path];
     }
     
-    NSArray *realmExtensions = [FLEXTableListViewController supportedRealmExtensions];
+    NSArray<NSString *> *realmExtensions = [FLEXTableListViewController supportedRealmExtensions];
     if (realmExtensions != nil && [realmExtensions indexOfObject:pathExtension] != NSNotFound) {
         return [[FLEXRealmDatabaseManager alloc] initWithPath:path];
     }
@@ -60,10 +60,11 @@
 
 - (void)getAllTables
 {
-    NSArray *resultArray = [_dbm queryAllTables];
-    NSMutableArray *array = [NSMutableArray array];
-    for (NSDictionary *dict in resultArray) {
-        [array addObject:dict[@"name"]];
+    NSArray<NSDictionary<NSString *, id> *> *resultArray = [_dbm queryAllTables];
+    NSMutableArray<NSString *> *array = [NSMutableArray array];
+    for (NSDictionary<NSString *, id> *dict in resultArray) {
+        NSString *columnName = (NSString *)dict[@"name"] ?: @"";
+        [array addObject:columnName];
     }
     self.tables = array;
 }
@@ -106,12 +107,12 @@
 {
     extension = extension.lowercaseString;
     
-    NSArray *sqliteExtensions = [FLEXTableListViewController supportedSQLiteExtensions];
+    NSArray<NSString *> *sqliteExtensions = [FLEXTableListViewController supportedSQLiteExtensions];
     if (sqliteExtensions.count > 0 && [sqliteExtensions indexOfObject:extension] != NSNotFound) {
         return YES;
     }
     
-    NSArray *realmExtensions = [FLEXTableListViewController supportedRealmExtensions];
+    NSArray<NSString *> *realmExtensions = [FLEXTableListViewController supportedRealmExtensions];
     if (realmExtensions.count > 0 && [realmExtensions indexOfObject:extension] != NSNotFound) {
         return YES;
     }
@@ -119,12 +120,12 @@
     return NO;
 }
 
-+ (NSArray *)supportedSQLiteExtensions
++ (NSArray<NSString *> *)supportedSQLiteExtensions
 {
     return @[@"db", @"sqlite", @"sqlite3"];
 }
 
-+ (NSArray *)supportedRealmExtensions
++ (NSArray<NSString *> *)supportedRealmExtensions
 {
     if (NSClassFromString(@"RLMRealm") == nil) {
         return nil;

+ 4 - 4
Classes/GlobalStateExplorers/FLEXClassesTableViewController.m

@@ -14,8 +14,8 @@
 
 @interface FLEXClassesTableViewController () <UISearchBarDelegate>
 
-@property (nonatomic, strong) NSArray *classNames;
-@property (nonatomic, strong) NSArray *filteredClassNames;
+@property (nonatomic, strong) NSArray<NSString *> *classNames;
+@property (nonatomic, strong) NSArray<NSString *> *filteredClassNames;
 @property (nonatomic, strong) UISearchBar *searchBar;
 
 @end
@@ -42,7 +42,7 @@
     }
 }
 
-- (void)setClassNames:(NSArray *)classNames
+- (void)setClassNames:(NSArray<NSString *> *)classNames
 {
     _classNames = classNames;
     self.filteredClassNames = classNames;
@@ -53,7 +53,7 @@
     unsigned int classNamesCount = 0;
     const char **classNames = objc_copyClassNamesForImage([self.binaryImageName UTF8String], &classNamesCount);
     if (classNames) {
-        NSMutableArray *classNameStrings = [NSMutableArray array];
+        NSMutableArray<NSString *> *classNameStrings = [NSMutableArray array];
         for (unsigned int i = 0; i < classNamesCount; i++) {
             const char *className = classNames[i];
             NSString *classNameString = [NSString stringWithUTF8String:className];

+ 2 - 2
Classes/GlobalStateExplorers/FLEXCookiesTableViewController.m

@@ -12,7 +12,7 @@
 
 @interface FLEXCookiesTableViewController ()
 
-@property (nonatomic, strong) NSArray *cookies;
+@property (nonatomic, strong) NSArray<NSHTTPCookie *> *cookies;
 
 @end
 
@@ -25,7 +25,7 @@
         self.title = @"Cookies";
 
         NSSortDescriptor *nameSortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES selector:@selector(caseInsensitiveCompare:)];
-        _cookies =[[NSHTTPCookieStorage sharedHTTPCookieStorage].cookies sortedArrayUsingDescriptors:@[nameSortDescriptor]];
+        _cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage].cookies sortedArrayUsingDescriptors:@[nameSortDescriptor]];
     }
     
     return self;

+ 1 - 1
Classes/GlobalStateExplorers/FLEXFileBrowserSearchOperation.h

@@ -20,6 +20,6 @@
 
 @protocol FLEXFileBrowserSearchOperationDelegate <NSObject>
 
-- (void)fileBrowserSearchOperationResult:(NSArray *)searchResult size:(uint64_t)size;
+- (void)fileBrowserSearchOperationResult:(NSArray<NSString *> *)searchResult size:(uint64_t)size;
 
 @end

+ 6 - 6
Classes/GlobalStateExplorers/FLEXFileBrowserSearchOperation.m

@@ -38,7 +38,7 @@
 - (uint64_t)totalSizeAtPath:(NSString *)path
 {
     NSFileManager *fileManager = [NSFileManager defaultManager];
-    NSDictionary *attributes = [fileManager attributesOfItemAtPath:path error:NULL];
+    NSDictionary<NSString *, id> *attributes = [fileManager attributesOfItemAtPath:path error:NULL];
     uint64_t totalSize = [attributes fileSize];
     
     for (NSString *fileName in [fileManager enumeratorAtPath:path]) {
@@ -65,16 +65,16 @@
 - (void)main
 {
     NSFileManager *fileManager = [NSFileManager defaultManager];
-    NSMutableArray *searchPaths = [NSMutableArray array];
-    NSMutableDictionary *sizeMapping = [NSMutableDictionary dictionary];
+    NSMutableArray<NSString *> *searchPaths = [NSMutableArray array];
+    NSMutableDictionary<NSString *, NSNumber *> *sizeMapping = [NSMutableDictionary dictionary];
     uint64_t totalSize = 0;
-    NSMutableArray *stack = [NSMutableArray array];
+    NSMutableArray<NSString *> *stack = [NSMutableArray array];
     [stack flex_push:self.path];
     
     //recursive found all match searchString paths, and precomputing there size
     while ([stack count]) {
         NSString *currentPath = [stack flex_pop];
-        NSArray *directoryPath = [fileManager contentsOfDirectoryAtPath:currentPath error:nil];
+        NSArray<NSString *> *directoryPath = [fileManager contentsOfDirectoryAtPath:currentPath error:nil];
         
         for (NSString *subPath in directoryPath) {
             NSString *fullPath = [currentPath stringByAppendingPathComponent:subPath];
@@ -99,7 +99,7 @@
     }
     
     //sort
-    NSArray *sortedArray = [searchPaths sortedArrayUsingComparator:^NSComparisonResult(NSString *path1, NSString *path2) {
+    NSArray<NSString *> *sortedArray = [searchPaths sortedArrayUsingComparator:^NSComparisonResult(NSString *path1, NSString *path2) {
         uint64_t pathSize1 = [sizeMapping[path1] unsignedLongLongValue];
         uint64_t pathSize2 = [sizeMapping[path2] unsignedLongLongValue];
         if (pathSize1 < pathSize2) {

+ 8 - 8
Classes/GlobalStateExplorers/FLEXFileBrowserTableViewController.m

@@ -19,8 +19,8 @@
 @interface FLEXFileBrowserTableViewController () <FLEXFileBrowserFileOperationControllerDelegate, FLEXFileBrowserSearchOperationDelegate, UISearchResultsUpdating, UISearchControllerDelegate>
 
 @property (nonatomic, copy) NSString *path;
-@property (nonatomic, copy) NSArray *childPaths;
-@property (nonatomic, strong) NSArray *searchPaths;
+@property (nonatomic, copy) NSArray<NSString *> *childPaths;
+@property (nonatomic, strong) NSArray<NSString *> *searchPaths;
 @property (nonatomic, strong) NSNumber *recursiveSize;
 @property (nonatomic, strong) NSNumber *searchPathsSize;
 @property (nonatomic, strong) UISearchController *searchController;
@@ -55,7 +55,7 @@
         FLEXFileBrowserTableViewController *__weak weakSelf = self;
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             NSFileManager *fileManager = [NSFileManager defaultManager];
-            NSDictionary *attributes = [fileManager attributesOfItemAtPath:path error:NULL];
+            NSDictionary<NSString *, id> *attributes = [fileManager attributesOfItemAtPath:path error:NULL];
             uint64_t totalSize = [attributes fileSize];
             
             for (NSString *fileName in [fileManager enumeratorAtPath:path]) {
@@ -93,7 +93,7 @@
 
 #pragma mark - FLEXFileBrowserSearchOperationDelegate
 
-- (void)fileBrowserSearchOperationResult:(NSArray *)searchResult size:(uint64_t)size
+- (void)fileBrowserSearchOperationResult:(NSArray<NSString *> *)searchResult size:(uint64_t)size
 {
     self.searchPaths = searchResult;
     self.searchPathsSize = @(size);
@@ -133,7 +133,7 @@
 {
     BOOL isSearchActive = self.searchController.isActive;
     NSNumber *currentSize = isSearchActive ? self.searchPathsSize : self.recursiveSize;
-    NSArray *currentPaths = isSearchActive ? self.searchPaths : self.childPaths;
+    NSArray<NSString *> *currentPaths = isSearchActive ? self.searchPaths : self.childPaths;
     
     NSString *sizeString = nil;
     if (!currentSize) {
@@ -148,7 +148,7 @@
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
 {
     NSString *fullPath = [self filePathAtIndexPath:indexPath];
-    NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:fullPath error:NULL];
+    NSDictionary<NSString *, id> *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:fullPath error:NULL];
     BOOL isDirectory = [[attributes fileType] isEqual:NSFileTypeDirectory];
     NSString *subtitle = nil;
     if (isDirectory) {
@@ -306,8 +306,8 @@
 
 - (void)reloadChildPaths
 {
-    NSMutableArray *childPaths = [NSMutableArray array];
-    NSArray *subpaths = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:self.path error:NULL];
+    NSMutableArray<NSString *> *childPaths = [NSMutableArray array];
+    NSArray<NSString *> *subpaths = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:self.path error:NULL];
     for (NSString *subpath in subpaths) {
         [childPaths addObject:[self.path stringByAppendingPathComponent:subpath]];
     }

+ 3 - 5
Classes/GlobalStateExplorers/FLEXGlobalsTableViewController.m

@@ -42,17 +42,15 @@ typedef NS_ENUM(NSUInteger, FLEXGlobalsRow) {
 
 @interface FLEXGlobalsTableViewController ()
 
-/// [FLEXGlobalsTableViewControllerEntry *]
-@property (nonatomic, readonly, copy) NSArray *entries;
+@property (nonatomic, readonly, copy) NSArray<FLEXGlobalsTableViewControllerEntry *> *entries;
 
 @end
 
 @implementation FLEXGlobalsTableViewController
 
-/// [FLEXGlobalsTableViewControllerEntry *]
-+ (NSArray *)defaultGlobalEntries
++ (NSArray<FLEXGlobalsTableViewControllerEntry *> *)defaultGlobalEntries
 {
-    NSMutableArray *defaultGlobalEntries = [NSMutableArray array];
+    NSMutableArray<FLEXGlobalsTableViewControllerEntry *> *defaultGlobalEntries = [NSMutableArray array];
 
     for (FLEXGlobalsRow defaultRowIndex = 0; defaultRowIndex < FLEXGlobalsRowCount; defaultRowIndex++) {
         FLEXGlobalsTableViewControllerEntryNameFuture titleFuture = nil;

+ 2 - 2
Classes/GlobalStateExplorers/FLEXInstancesTableViewController.m

@@ -18,7 +18,7 @@
 @interface FLEXInstancesTableViewController ()
 
 @property (nonatomic, strong) NSArray *instances;
-@property (nonatomic, strong) NSArray *fieldNames;
+@property (nonatomic, strong) NSArray<NSString *> *fieldNames;
 
 @end
 
@@ -47,7 +47,7 @@
 + (instancetype)instancesTableViewControllerForInstancesReferencingObject:(id)object
 {
     NSMutableArray *instances = [NSMutableArray array];
-    NSMutableArray *fieldNames = [NSMutableArray array];
+    NSMutableArray<NSString *> *fieldNames = [NSMutableArray array];
     [FLEXHeapEnumerator enumerateLiveObjectsUsingBlock:^(__unsafe_unretained id tryObject, __unsafe_unretained Class actualClass) {
         // Get all the ivars on the object. Start with the class and and travel up the inheritance chain.
         // Once we find a match, record it and move on to the next object. There's no reason to find multiple matches within the same object.

+ 6 - 6
Classes/GlobalStateExplorers/FLEXLibrariesTableViewController.m

@@ -14,8 +14,8 @@
 
 @interface FLEXLibrariesTableViewController () <UISearchBarDelegate>
 
-@property (nonatomic, strong) NSArray *imageNames;
-@property (nonatomic, strong) NSArray *filteredImageNames;
+@property (nonatomic, strong) NSArray<NSString *> *imageNames;
+@property (nonatomic, strong) NSArray<NSString *> *filteredImageNames;
 
 @property (nonatomic, strong) UISearchBar *searchBar;
 @property (nonatomic, strong) Class foundClass;
@@ -52,7 +52,7 @@
     unsigned int imageNamesCount = 0;
     const char **imageNames = objc_copyImageNames(&imageNamesCount);
     if (imageNames) {
-        NSMutableArray *imageNameStrings = [NSMutableArray array];
+        NSMutableArray<NSString *> *imageNameStrings = [NSMutableArray array];
         NSString *appImageName = [FLEXUtility applicationImageName];
         for (unsigned int i = 0; i < imageNamesCount; i++) {
             const char *imageName = imageNames[i];
@@ -76,14 +76,14 @@
 
 - (NSString *)shortNameForImageName:(NSString *)imageName
 {
-    NSArray *components = [imageName componentsSeparatedByString:@"/"];
+    NSArray<NSString *> *components = [imageName componentsSeparatedByString:@"/"];
     if (components.count >= 2) {
         return [NSString stringWithFormat:@"%@/%@", components[components.count - 2], components[components.count - 1]];
     }
     return imageName.lastPathComponent;
 }
 
-- (void)setImageNames:(NSArray *)imageNames
+- (void)setImageNames:(NSArray<NSString *> *)imageNames
 {
     if (![_imageNames isEqual:imageNames]) {
         _imageNames = imageNames;
@@ -97,7 +97,7 @@
 - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
 {
     if ([searchText length] > 0) {
-        NSPredicate *searchPreidcate = [NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
+        NSPredicate *searchPreidcate = [NSPredicate predicateWithBlock:^BOOL(NSString *evaluatedObject, NSDictionary<NSString *, id> *bindings) {
             BOOL matches = NO;
             NSString *shortName = [self shortNameForImageName:evaluatedObject];
             if ([shortName rangeOfString:searchText options:NSCaseInsensitiveSearch].length > 0) {

+ 7 - 7
Classes/GlobalStateExplorers/FLEXLiveObjectsTableViewController.m

@@ -18,10 +18,10 @@ static const NSInteger kFLEXLiveObjectsSortBySizeIndex = 2;
 
 @interface FLEXLiveObjectsTableViewController () <UISearchBarDelegate>
 
-@property (nonatomic, strong) NSDictionary *instanceCountsForClassNames;
-@property (nonatomic, strong) NSDictionary *instanceSizesForClassNames;
-@property (nonatomic, readonly) NSArray *allClassNames;
-@property (nonatomic, strong) NSArray *filteredClassNames;
+@property (nonatomic, strong) NSDictionary<NSString *, NSNumber *> *instanceCountsForClassNames;
+@property (nonatomic, strong) NSDictionary<NSString *, NSNumber *> *instanceSizesForClassNames;
+@property (nonatomic, readonly) NSArray<NSString *> *allClassNames;
+@property (nonatomic, strong) NSArray<NSString *> *filteredClassNames;
 @property (nonatomic, strong) UISearchBar *searchBar;
 
 @end
@@ -46,7 +46,7 @@ static const NSInteger kFLEXLiveObjectsSortBySizeIndex = 2;
     [self reloadTableData];
 }
 
-- (NSArray *)allClassNames
+- (NSArray<NSString *> *)allClassNames
 {
     return [self.instanceCountsForClassNames allKeys];
 }
@@ -74,8 +74,8 @@ static const NSInteger kFLEXLiveObjectsSortBySizeIndex = 2;
     }];
     
     // Convert our CF primitive dictionary into a nicer mapping of class name strings to counts that we will use as the table's model.
-    NSMutableDictionary *mutableCountsForClassNames = [NSMutableDictionary dictionary];
-    NSMutableDictionary *mutableSizesForClassNames = [NSMutableDictionary dictionary];
+    NSMutableDictionary<NSString *, NSNumber *> *mutableCountsForClassNames = [NSMutableDictionary dictionary];
+    NSMutableDictionary<NSString *, NSNumber *> *mutableSizesForClassNames = [NSMutableDictionary dictionary];
     for (unsigned int i = 0; i < classCount; i++) {
         Class class = classes[i];
         NSUInteger instanceCount = (NSUInteger)CFDictionaryGetValue(mutableCountsForClasses, (__bridge const void *)(class));

+ 6 - 6
Classes/GlobalStateExplorers/FLEXWebViewController.m

@@ -102,23 +102,23 @@
 + (BOOL)supportsPathExtension:(NSString *)extension
 {
     BOOL supported = NO;
-    NSSet *supportedExtensions = [self webViewSupportedPathExtensions];
+    NSSet<NSString *> *supportedExtensions = [self webViewSupportedPathExtensions];
     if ([supportedExtensions containsObject:[extension lowercaseString]]) {
         supported = YES;
     }
     return supported;
 }
 
-+ (NSSet *)webViewSupportedPathExtensions
++ (NSSet<NSString *> *)webViewSupportedPathExtensions
 {
-    static NSSet *pathExtenstions = nil;
+    static NSSet<NSString *> *pathExtenstions = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
         // Note that this is not exhaustive, but all these extensions should work well in the web view.
         // See https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html#//apple_ref/doc/uid/TP40006482-SW7
-        pathExtenstions = [NSSet setWithArray:@[@"jpg", @"jpeg", @"png", @"gif", @"pdf", @"svg", @"tiff", @"3gp", @"3gpp", @"3g2",
-                                                @"3gp2", @"aiff", @"aif", @"aifc", @"cdda", @"amr", @"mp3", @"swa", @"mp4", @"mpeg",
-                                                @"mpg", @"mp3", @"wav", @"bwf", @"m4a", @"m4b", @"m4p", @"mov", @"qt", @"mqv", @"m4v"]];
+        pathExtenstions = [NSSet<NSString *> setWithArray:@[@"jpg", @"jpeg", @"png", @"gif", @"pdf", @"svg", @"tiff", @"3gp", @"3gpp", @"3g2",
+                                                            @"3gp2", @"aiff", @"aif", @"aifc", @"cdda", @"amr", @"mp3", @"swa", @"mp4", @"mpeg",
+                                                            @"mpg", @"mp3", @"wav", @"bwf", @"m4a", @"m4b", @"m4p", @"mov", @"qt", @"mqv", @"m4v"]];
         
     });
     return pathExtenstions;

+ 2 - 2
Classes/GlobalStateExplorers/SystemLog/FLEXSystemLogTableViewCell.m

@@ -74,12 +74,12 @@ static const UIEdgeInsets kFLEXLogMessageCellInsets = {10.0, 10.0, 10.0, 10.0};
 + (NSAttributedString *)attributedTextForLogMessage:(FLEXSystemLogMessage *)logMessage highlightedText:(NSString *)highlightedText
 {
     NSString *text = [self displayedTextForLogMessage:logMessage];
-    NSDictionary *attributes = @{ NSFontAttributeName : [UIFont fontWithName:@"CourierNewPSMT" size:12.0] };
+    NSDictionary<NSString *, id> *attributes = @{ NSFontAttributeName : [UIFont fontWithName:@"CourierNewPSMT" size:12.0] };
     NSAttributedString *attributedText = [[NSAttributedString alloc] initWithString:text attributes:attributes];
 
     if ([highlightedText length] > 0) {
         NSMutableAttributedString *mutableAttributedText = [attributedText mutableCopy];
-        NSMutableDictionary *highlightAttributes = [@{ NSBackgroundColorAttributeName : [UIColor yellowColor] } mutableCopy];
+        NSMutableDictionary<NSString *, id> *highlightAttributes = [@{ NSBackgroundColorAttributeName : [UIColor yellowColor] } mutableCopy];
         [highlightAttributes addEntriesFromDictionary:attributes];
         
         NSRange remainingSearchRange = NSMakeRange(0, text.length);

+ 6 - 6
Classes/GlobalStateExplorers/SystemLog/FLEXSystemLogTableViewController.m

@@ -15,8 +15,8 @@
 @interface FLEXSystemLogTableViewController () <UISearchResultsUpdating, UISearchControllerDelegate>
 
 @property (nonatomic, strong) UISearchController *searchController;
-@property (nonatomic, copy) NSArray *logMessages;
-@property (nonatomic, copy) NSArray *filteredLogMessages;
+@property (nonatomic, copy) NSArray<FLEXSystemLogMessage *> *logMessages;
+@property (nonatomic, copy) NSArray<FLEXSystemLogMessage *> *filteredLogMessages;
 @property (nonatomic, strong) NSTimer *logUpdateTimer;
 
 @end
@@ -65,7 +65,7 @@
 - (void)updateLogMessages
 {
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        NSArray *logMessages = [[self class] allLogMessagesForCurrentProcess];
+        NSArray<FLEXSystemLogMessage *> *logMessages = [[self class] allLogMessagesForCurrentProcess];
         dispatch_async(dispatch_get_main_queue(), ^{
             self.title = @"System Log";
             self.logMessages = logMessages;
@@ -154,7 +154,7 @@
 {
     NSString *searchString = searchController.searchBar.text;
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        NSArray *filteredLogMessages = [self.logMessages filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(FLEXSystemLogMessage *logMessage, NSDictionary *bindings) {
+        NSArray<FLEXSystemLogMessage *> *filteredLogMessages = [self.logMessages filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(FLEXSystemLogMessage *logMessage, NSDictionary<NSString *, id> *bindings) {
             NSString *displayedText = [FLEXSystemLogTableViewCell displayedTextForLogMessage:logMessage];
             return [displayedText rangeOfString:searchString options:NSCaseInsensitiveSearch].length > 0;
         }]];
@@ -169,7 +169,7 @@
 
 #pragma mark - Log Message Fetching
 
-+ (NSArray *)allLogMessagesForCurrentProcess
++ (NSArray<FLEXSystemLogMessage *> *)allLogMessagesForCurrentProcess
 {
     asl_object_t query = asl_new(ASL_TYPE_QUERY);
 
@@ -180,7 +180,7 @@
     aslresponse response = asl_search(NULL, query);
     aslmsg aslMessage = NULL;
 
-    NSMutableArray *logMessages = [NSMutableArray array];
+    NSMutableArray<FLEXSystemLogMessage *> *logMessages = [NSMutableArray array];
     while ((aslMessage = asl_next(response))) {
         [logMessages addObject:[FLEXSystemLogMessage logMessageFromASLMessage:aslMessage]];
     }

+ 3 - 1
Classes/Manager/FLEXManager+Private.h

@@ -8,9 +8,11 @@
 
 #import "FLEXManager.h"
 
+@class FLEXGlobalsTableViewControllerEntry;
+
 @interface FLEXManager ()
 
 /// An array of FLEXGlobalsTableViewControllerEntry objects that have been registered by the user.
-@property (nonatomic, readonly, strong) NSArray *userGlobalEntries;
+@property (nonatomic, readonly, strong) NSArray<FLEXGlobalsTableViewControllerEntry *> *userGlobalEntries;
 
 @end

+ 7 - 5
Classes/Manager/FLEXManager.m

@@ -24,7 +24,7 @@
 @property (nonatomic, strong) FLEXWindow *explorerWindow;
 @property (nonatomic, strong) FLEXExplorerViewController *explorerViewController;
 
-@property (nonatomic, readonly, strong) NSMutableArray *userGlobalEntries;
+@property (nonatomic, readonly, strong) NSMutableArray<FLEXGlobalsTableViewControllerEntry *> *userGlobalEntries;
 
 @end
 
@@ -44,7 +44,7 @@
 {
     self = [super init];
     if (self) {
-        _userGlobalEntries = [[NSMutableArray alloc] init];
+        _userGlobalEntries = [NSMutableArray array];
     }
     return self;
 }
@@ -115,11 +115,13 @@
     [[FLEXNetworkRecorder defaultRecorder] setResponseCacheByteLimit:networkResponseCacheByteLimit];
 }
 
-- (void)setNetworkRequestHostBlacklist:(NSArray<NSString *> *)networkRequestHostBlacklist {
+- (void)setNetworkRequestHostBlacklist:(NSArray<NSString *> *)networkRequestHostBlacklist
+{
     [FLEXNetworkRecorder defaultRecorder].hostBlacklist = networkRequestHostBlacklist;
 }
 
-- (NSArray<NSString *> *)hostBlacklist {
+- (NSArray<NSString *> *)hostBlacklist
+{
     return [FLEXNetworkRecorder defaultRecorder].hostBlacklist;
 }
 
@@ -310,7 +312,7 @@
 
 - (UIScrollView *)firstScrollView
 {
-    NSMutableArray *views = [[[[UIApplication sharedApplication] keyWindow] subviews] mutableCopy];
+    NSMutableArray<UIView *> *views = [[[[UIApplication sharedApplication] keyWindow] subviews] mutableCopy];
     UIScrollView *scrollView = nil;
     while ([views count] > 0) {
         UIView *view = [views firstObject];

+ 1 - 1
Classes/Network/FLEXNetworkCurlLogger.m

@@ -18,7 +18,7 @@
         [curlCommandString appendFormat:@"-H \'%@: %@\' ", key, val];
     }];
 
-    NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:request.URL];
+    NSArray<NSHTTPCookie *> *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:request.URL];
     if (cookies) {
         [curlCommandString appendFormat:@"-H \'Cookie:"];
         for (NSHTTPCookie *cookie in cookies) {

+ 6 - 6
Classes/Network/FLEXNetworkHistoryTableViewController.m

@@ -17,9 +17,9 @@
 @interface FLEXNetworkHistoryTableViewController () <UISearchResultsUpdating, UISearchControllerDelegate>
 
 /// Backing model
-@property (nonatomic, copy) NSArray *networkTransactions;
+@property (nonatomic, copy) NSArray<FLEXNetworkTransaction *> *networkTransactions;
 @property (nonatomic, assign) long long bytesReceived;
-@property (nonatomic, copy) NSArray *filteredNetworkTransactions;
+@property (nonatomic, copy) NSArray<FLEXNetworkTransaction *> *filteredNetworkTransactions;
 @property (nonatomic, assign) long long filteredBytesReceived;
 
 @property (nonatomic, assign) BOOL rowInsertInProgress;
@@ -90,7 +90,7 @@
     self.networkTransactions = [[FLEXNetworkRecorder defaultRecorder] networkTransactions];
 }
 
-- (void)setNetworkTransactions:(NSArray *)networkTransactions
+- (void)setNetworkTransactions:(NSArray<FLEXNetworkTransaction *> *)networkTransactions
 {
     if (![_networkTransactions isEqual:networkTransactions]) {
         _networkTransactions = networkTransactions;
@@ -109,7 +109,7 @@
     [self updateFirstSectionHeader];
 }
 
-- (void)setFilteredNetworkTransactions:(NSArray *)filteredNetworkTransactions
+- (void)setFilteredNetworkTransactions:(NSArray<FLEXNetworkTransaction *> *)filteredNetworkTransactions
 {
     if (![_filteredNetworkTransactions isEqual:filteredNetworkTransactions]) {
         _filteredNetworkTransactions = filteredNetworkTransactions;
@@ -196,7 +196,7 @@
                 [self tryUpdateTransactions];
             }];
 
-            NSMutableArray *indexPathsToReload = [NSMutableArray array];
+            NSMutableArray<NSIndexPath *> *indexPathsToReload = [NSMutableArray array];
             for (NSInteger row = 0; row < addedRowCount; row++) {
                 [indexPathsToReload addObject:[NSIndexPath indexPathForRow:row inSection:0]];
             }
@@ -332,7 +332,7 @@
 {
     NSString *searchString = self.searchController.searchBar.text;
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        NSArray *filteredNetworkTransactions = [self.networkTransactions filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(FLEXNetworkTransaction *transaction, NSDictionary *bindings) {
+        NSArray<FLEXNetworkTransaction *> *filteredNetworkTransactions = [self.networkTransactions filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(FLEXNetworkTransaction *transaction, NSDictionary<NSString *, id> *bindings) {
             return [[transaction.request.URL absoluteString] rangeOfString:searchString options:NSCaseInsensitiveSearch].length > 0;
         }]];
         dispatch_async(dispatch_get_main_queue(), ^{

+ 1 - 1
Classes/Network/FLEXNetworkRecorder.h

@@ -33,7 +33,7 @@ extern NSString *const kFLEXNetworkRecorderTransactionsClearedNotification;
 // Accessing recorded network activity
 
 /// Array of FLEXNetworkTransaction objects ordered by start time with the newest first.
-- (NSArray *)networkTransactions;
+- (NSArray<FLEXNetworkTransaction *> *)networkTransactions;
 
 /// The full response data IFF it hasn't been purged due to memory pressure.
 - (NSData *)cachedResponseBodyForTransaction:(FLEXNetworkTransaction *)transaction;

+ 7 - 7
Classes/Network/FLEXNetworkRecorder.m

@@ -22,8 +22,8 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
 @interface FLEXNetworkRecorder ()
 
 @property (nonatomic, strong) NSCache *responseCache;
-@property (nonatomic, strong) NSMutableArray *orderedTransactions;
-@property (nonatomic, strong) NSMutableDictionary *networkTransactionsForRequestIdentifiers;
+@property (nonatomic, strong) NSMutableArray<FLEXNetworkTransaction *> *orderedTransactions;
+@property (nonatomic, strong) NSMutableDictionary<NSString *, FLEXNetworkTransaction *> *networkTransactionsForRequestIdentifiers;
 @property (nonatomic, strong) dispatch_queue_t queue;
 
 @end
@@ -74,9 +74,9 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
     [[NSUserDefaults standardUserDefaults] setObject:@(responseCacheByteLimit) forKey:kFLEXNetworkRecorderResponseCacheLimitDefaultsKey];
 }
 
-- (NSArray *)networkTransactions
+- (NSArray<FLEXNetworkTransaction *> *)networkTransactions
 {
-    __block NSArray *transactions = nil;
+    __block NSArray<FLEXNetworkTransaction *> *transactions = nil;
     dispatch_sync(self.queue, ^{
         transactions = [self.orderedTransactions copy];
     });
@@ -175,7 +175,7 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
 
         BOOL shouldCache = [responseBody length] > 0;
         if (!self.shouldCacheMediaResponses) {
-            NSArray *ignoredMIMETypePrefixes = @[ @"audio", @"image", @"video" ];
+            NSArray<NSString *> *ignoredMIMETypePrefixes = @[ @"audio", @"image", @"video" ];
             for (NSString *ignoredPrefix in ignoredMIMETypePrefixes) {
                 shouldCache = shouldCache && ![transaction.response.MIMEType hasPrefix:ignoredPrefix];
             }
@@ -252,7 +252,7 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
 - (void)postNewTransactionNotificationWithTransaction:(FLEXNetworkTransaction *)transaction
 {
     dispatch_async(dispatch_get_main_queue(), ^{
-        NSDictionary *userInfo = @{ kFLEXNetworkRecorderUserInfoTransactionKey : transaction };
+        NSDictionary<NSString *, id> *userInfo = @{ kFLEXNetworkRecorderUserInfoTransactionKey : transaction };
         [[NSNotificationCenter defaultCenter] postNotificationName:kFLEXNetworkRecorderNewTransactionNotification object:self userInfo:userInfo];
     });
 }
@@ -260,7 +260,7 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
 - (void)postUpdateNotificationForTransaction:(FLEXNetworkTransaction *)transaction
 {
     dispatch_async(dispatch_get_main_queue(), ^{
-        NSDictionary *userInfo = @{ kFLEXNetworkRecorderUserInfoTransactionKey : transaction };
+        NSDictionary<NSString *, id> *userInfo = @{ kFLEXNetworkRecorderUserInfoTransactionKey : transaction };
         [[NSNotificationCenter defaultCenter] postNotificationName:kFLEXNetworkRecorderTransactionUpdatedNotification object:self userInfo:userInfo];
     });
 }

+ 2 - 2
Classes/Network/FLEXNetworkSettingsTableViewController.m

@@ -13,7 +13,7 @@
 
 @interface FLEXNetworkSettingsTableViewController () <UIActionSheetDelegate>
 
-@property (nonatomic, copy) NSArray *cells;
+@property (nonatomic, copy) NSArray<UITableViewCell *> *cells;
 
 @property (nonatomic, strong) UITableViewCell *cacheLimitCell;
 
@@ -34,7 +34,7 @@
 {
     [super viewDidLoad];
 
-    NSMutableArray *mutableCells = [NSMutableArray array];
+    NSMutableArray<UITableViewCell *> *mutableCells = [NSMutableArray array];
 
     UITableViewCell *networkDebuggingCell = [self switchCellWithTitle:@"Network Debugging" toggleAction:@selector(networkDebuggingToggled:) isOn:[FLEXNetworkObserver isEnabled]];
     [mutableCells addObject:networkDebuggingCell];

+ 22 - 22
Classes/Network/FLEXNetworkTransactionDetailTableViewController.m

@@ -15,34 +15,34 @@
 #import "FLEXMultilineTableViewCell.h"
 #import "FLEXUtility.h"
 
-@interface FLEXNetworkDetailSection : NSObject
+typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
+
+@interface FLEXNetworkDetailRow : NSObject
 
 @property (nonatomic, copy) NSString *title;
-@property (nonatomic, copy) NSArray *rows;
+@property (nonatomic, copy) NSString *detailText;
+@property (nonatomic, copy) FLEXNetworkDetailRowSelectionFuture selectionFuture;
 
 @end
 
-@implementation FLEXNetworkDetailSection
+@implementation FLEXNetworkDetailRow
 
 @end
 
-typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
-
-@interface FLEXNetworkDetailRow : NSObject
+@interface FLEXNetworkDetailSection : NSObject
 
 @property (nonatomic, copy) NSString *title;
-@property (nonatomic, copy) NSString *detailText;
-@property (nonatomic, copy) FLEXNetworkDetailRowSelectionFuture selectionFuture;
+@property (nonatomic, copy) NSArray<FLEXNetworkDetailRow *> *rows;
 
 @end
 
-@implementation FLEXNetworkDetailRow
+@implementation FLEXNetworkDetailSection
 
 @end
 
 @interface FLEXNetworkTransactionDetailTableViewController ()
 
-@property (nonatomic, copy) NSArray *sections;
+@property (nonatomic, copy) NSArray<FLEXNetworkDetailSection *> *sections;
 
 @end
 
@@ -75,7 +75,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     }
 }
 
-- (void)setSections:(NSArray *)sections
+- (void)setSections:(NSArray<FLEXNetworkDetailSection *> *)sections
 {
     if (![_sections isEqual:sections]) {
         _sections = [sections copy];
@@ -85,7 +85,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
 
 - (void)rebuildTableSections
 {
-    NSMutableArray *sections = [NSMutableArray array];
+    NSMutableArray<FLEXNetworkDetailSection *> *sections = [NSMutableArray array];
 
     FLEXNetworkDetailSection *generalSection = [[self class] generalSectionForTransaction:self.transaction];
     if ([generalSection.rows count] > 0) {
@@ -210,10 +210,10 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
 
 + (NSAttributedString *)attributedTextForRow:(FLEXNetworkDetailRow *)row
 {
-    NSDictionary *titleAttributes = @{ NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Medium" size:12.0],
-                                       NSForegroundColorAttributeName : [UIColor colorWithWhite:0.5 alpha:1.0] };
-    NSDictionary *detailAttributes = @{ NSFontAttributeName : [FLEXUtility defaultTableViewCellLabelFont],
-                                        NSForegroundColorAttributeName : [UIColor blackColor] };
+    NSDictionary<NSString *, id> *titleAttributes = @{ NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Medium" size:12.0],
+                                                       NSForegroundColorAttributeName : [UIColor colorWithWhite:0.5 alpha:1.0] };
+    NSDictionary<NSString *, id> *detailAttributes = @{ NSFontAttributeName : [FLEXUtility defaultTableViewCellLabelFont],
+                                                        NSForegroundColorAttributeName : [UIColor blackColor] };
 
     NSString *title = [NSString stringWithFormat:@"%@: ", row.title];
     NSString *detailText = row.detailText ?: @"";
@@ -228,7 +228,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
 
 + (FLEXNetworkDetailSection *)generalSectionForTransaction:(FLEXNetworkTransaction *)transaction
 {
-    NSMutableArray *rows = [NSMutableArray array];
+    NSMutableArray<FLEXNetworkDetailRow *> *rows = [NSMutableArray array];
 
     FLEXNetworkDetailRow *requestURLRow = [[FLEXNetworkDetailRow alloc] init];
     requestURLRow.title = @"Request URL";
@@ -390,7 +390,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
 
 + (FLEXNetworkDetailSection *)queryParametersSectionForTransaction:(FLEXNetworkTransaction *)transaction
 {
-    NSDictionary *queryDictionary = [FLEXUtility dictionaryFromQuery:transaction.request.URL.query];
+    NSDictionary<NSString *, id> *queryDictionary = [FLEXUtility dictionaryFromQuery:transaction.request.URL.query];
     FLEXNetworkDetailSection *querySection = [[FLEXNetworkDetailSection alloc] init];
     querySection.title = @"Query Parameters";
     querySection.rows = [self networkDetailRowsFromDictionary:queryDictionary];
@@ -409,12 +409,12 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     return responseHeadersSection;
 }
 
-+ (NSArray *)networkDetailRowsFromDictionary:(NSDictionary *)dictionary
++ (NSArray<FLEXNetworkDetailRow *> *)networkDetailRowsFromDictionary:(NSDictionary<NSString *, id> *)dictionary
 {
-    NSMutableArray *rows = [NSMutableArray arrayWithCapacity:[dictionary count]];
-    NSArray *sortedKeys = [[dictionary allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
+    NSMutableArray<FLEXNetworkDetailRow *> *rows = [NSMutableArray arrayWithCapacity:[dictionary count]];
+    NSArray<NSString *> *sortedKeys = [[dictionary allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
     for (NSString *key in sortedKeys) {
-        NSString *value = dictionary[key];
+        id value = dictionary[key];
         FLEXNetworkDetailRow *row = [[FLEXNetworkDetailRow alloc] init];
         row.title = key;
         row.detailText = [value description];

+ 2 - 2
Classes/Network/FLEXNetworkTransactionTableViewCell.m

@@ -111,7 +111,7 @@ NSString *const kFLEXNetworkTransactionCellIdentifier = @"kFLEXNetworkTransactio
 - (NSString *)pathLabelText
 {
     NSURL *url = self.transaction.request.URL;
-    NSMutableArray *mutablePathComponents = [[url pathComponents] mutableCopy];
+    NSMutableArray<NSString *> *mutablePathComponents = [[url pathComponents] mutableCopy];
     if ([mutablePathComponents count] > 0) {
         [mutablePathComponents removeLastObject];
     }
@@ -124,7 +124,7 @@ NSString *const kFLEXNetworkTransactionCellIdentifier = @"kFLEXNetworkTransactio
 
 - (NSString *)transactionDetailsLabelText
 {
-    NSMutableArray *detailComponents = [NSMutableArray array];
+    NSMutableArray<NSString *> *detailComponents = [NSMutableArray array];
 
     NSString *timestamp = [[self class] timestampStringFromRequestDate:self.transaction.startTime];
     if ([timestamp length] > 0) {

+ 2 - 2
Classes/Network/PonyDebugger/FLEXNetworkObserver.m

@@ -68,7 +68,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
 
 @interface FLEXNetworkObserver ()
 
-@property (nonatomic, strong) NSMutableDictionary *requestStatesForRequestIDs;
+@property (nonatomic, strong) NSMutableDictionary<NSString *, FLEXInternalRequestState *> *requestStatesForRequestIDs;
 @property (nonatomic, strong) dispatch_queue_t queue;
 
 @end
@@ -995,7 +995,7 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
 {
     [self performBlock:^{
         // Mimic the behavior of NSURLSession which is to create an error on cancellation.
-        NSDictionary *userInfo = @{ NSLocalizedDescriptionKey : @"cancelled" };
+        NSDictionary<NSString *, id> *userInfo = @{ NSLocalizedDescriptionKey : @"cancelled" };
         NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:userInfo];
         [self connection:connection didFailWithError:error delegate:nil];
     }];

+ 2 - 2
Classes/ObjectExplorers/FLEXClassExplorerViewController.m

@@ -35,11 +35,11 @@ typedef NS_ENUM(NSUInteger, FLEXClassExplorerRow) {
 
 #pragma mark - Superclass Overrides
 
-- (NSArray *)possibleExplorerSections
+- (NSArray<NSNumber *> *)possibleExplorerSections
 {
     // Move class methods to between our custom section and the properties section since
     // we are more interested in the class sections than in the instance level sections.
-    NSMutableArray *mutableSections = [[super possibleExplorerSections] mutableCopy];
+    NSMutableArray<NSNumber *> *mutableSections = [[super possibleExplorerSections] mutableCopy];
     [mutableSections removeObject:@(FLEXObjectExplorerSectionClassMethods)];
     [mutableSections insertObject:@(FLEXObjectExplorerSectionClassMethods) atIndex:[mutableSections indexOfObject:@(FLEXObjectExplorerSectionProperties)]];
     return mutableSections;

+ 1 - 1
Classes/ObjectExplorers/FLEXObjectExplorerFactory.m

@@ -28,7 +28,7 @@
         return nil;
     }
     
-    static NSDictionary *explorerSubclassesForObjectTypeStrings = nil;
+    static NSDictionary<NSString *, Class> *explorerSubclassesForObjectTypeStrings = nil;
     static dispatch_once_t once;
     dispatch_once(&once, ^{
         explorerSubclassesForObjectTypeStrings = @{NSStringFromClass([NSArray class])          : [FLEXArrayExplorerViewController class],

+ 44 - 44
Classes/ObjectExplorers/FLEXObjectExplorerViewController.m

@@ -41,24 +41,24 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
 
 @interface FLEXObjectExplorerViewController () <UISearchBarDelegate>
 
-@property (nonatomic, strong) NSArray *properties;
-@property (nonatomic, strong) NSArray *inheritedProperties;
-@property (nonatomic, strong) NSArray *filteredProperties;
+@property (nonatomic, strong) NSArray<FLEXPropertyBox *> *properties;
+@property (nonatomic, strong) NSArray<FLEXPropertyBox *> *inheritedProperties;
+@property (nonatomic, strong) NSArray<FLEXPropertyBox *> *filteredProperties;
 
-@property (nonatomic, strong) NSArray *ivars;
-@property (nonatomic, strong) NSArray *inheritedIvars;
-@property (nonatomic, strong) NSArray *filteredIvars;
+@property (nonatomic, strong) NSArray<FLEXIvarBox *> *ivars;
+@property (nonatomic, strong) NSArray<FLEXIvarBox *> *inheritedIvars;
+@property (nonatomic, strong) NSArray<FLEXIvarBox *> *filteredIvars;
 
-@property (nonatomic, strong) NSArray *methods;
-@property (nonatomic, strong) NSArray *inheritedMethods;
-@property (nonatomic, strong) NSArray *filteredMethods;
+@property (nonatomic, strong) NSArray<FLEXMethodBox *> *methods;
+@property (nonatomic, strong) NSArray<FLEXMethodBox *> *inheritedMethods;
+@property (nonatomic, strong) NSArray<FLEXMethodBox *> *filteredMethods;
 
-@property (nonatomic, strong) NSArray *classMethods;
-@property (nonatomic, strong) NSArray *inheritedClassMethods;
-@property (nonatomic, strong) NSArray *filteredClassMethods;
+@property (nonatomic, strong) NSArray<FLEXMethodBox *> *classMethods;
+@property (nonatomic, strong) NSArray<FLEXMethodBox *> *inheritedClassMethods;
+@property (nonatomic, strong) NSArray<FLEXMethodBox *> *filteredClassMethods;
 
-@property (nonatomic, strong) NSArray *superclasses;
-@property (nonatomic, strong) NSArray *filteredSuperclasses;
+@property (nonatomic, strong) NSArray<Class> *superclasses;
+@property (nonatomic, strong) NSArray<Class> *filteredSuperclasses;
 
 @property (nonatomic, strong) NSArray *cachedCustomSectionRowCookies;
 @property (nonatomic, strong) NSIndexSet *customSectionVisibleIndexes;
@@ -218,9 +218,9 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
     self.inheritedProperties = [[self class] inheritedPropertiesForClass:class];
 }
 
-+ (NSArray *)propertiesForClass:(Class)class
++ (NSArray<FLEXPropertyBox *> *)propertiesForClass:(Class)class
 {
-    NSMutableArray *boxedProperties = [NSMutableArray array];
+    NSMutableArray<FLEXPropertyBox *> *boxedProperties = [NSMutableArray array];
     unsigned int propertyCount = 0;
     objc_property_t *propertyList = class_copyPropertyList(class, &propertyCount);
     if (propertyList) {
@@ -234,9 +234,9 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
     return boxedProperties;
 }
 
-+ (NSArray *)inheritedPropertiesForClass:(Class)class
++ (NSArray<FLEXPropertyBox *> *)inheritedPropertiesForClass:(Class)class
 {
-    NSMutableArray *inheritedProperties = [NSMutableArray array];
+    NSMutableArray<FLEXPropertyBox *> *inheritedProperties = [NSMutableArray array];
     while ((class = [class superclass])) {
         [inheritedProperties addObjectsFromArray:[self propertiesForClass:class]];
     }
@@ -245,14 +245,14 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
 
 - (void)updateFilteredProperties
 {
-    NSArray *candidateProperties = self.properties;
+    NSArray<FLEXPropertyBox *> *candidateProperties = self.properties;
     if (self.includeInheritance) {
         candidateProperties = [candidateProperties arrayByAddingObjectsFromArray:self.inheritedProperties];
     }
     
-    NSArray *unsortedFilteredProperties = nil;
+    NSArray<FLEXPropertyBox *> *unsortedFilteredProperties = nil;
     if ([self.filterText length] > 0) {
-        NSMutableArray *mutableUnsortedFilteredProperties = [NSMutableArray array];
+        NSMutableArray<FLEXPropertyBox *> *mutableUnsortedFilteredProperties = [NSMutableArray array];
         for (FLEXPropertyBox *propertyBox in candidateProperties) {
             NSString *prettyName = [FLEXRuntimeUtility prettyNameForProperty:propertyBox.property];
             if ([prettyName rangeOfString:self.filterText options:NSCaseInsensitiveSearch].location != NSNotFound) {
@@ -297,9 +297,9 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
     self.inheritedIvars = [[self class] inheritedIvarsForClass:class];
 }
 
-+ (NSArray *)ivarsForClass:(Class)class
++ (NSArray<FLEXIvarBox *> *)ivarsForClass:(Class)class
 {
-    NSMutableArray *boxedIvars = [NSMutableArray array];
+    NSMutableArray<FLEXIvarBox *> *boxedIvars = [NSMutableArray array];
     unsigned int ivarCount = 0;
     Ivar *ivarList = class_copyIvarList(class, &ivarCount);
     if (ivarList) {
@@ -313,9 +313,9 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
     return boxedIvars;
 }
 
-+ (NSArray *)inheritedIvarsForClass:(Class)class
++ (NSArray<FLEXIvarBox *> *)inheritedIvarsForClass:(Class)class
 {
-    NSMutableArray *inheritedIvars = [NSMutableArray array];
+    NSMutableArray<FLEXIvarBox *> *inheritedIvars = [NSMutableArray array];
     while ((class = [class superclass])) {
         [inheritedIvars addObjectsFromArray:[self ivarsForClass:class]];
     }
@@ -324,14 +324,14 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
 
 - (void)updateFilteredIvars
 {
-    NSArray *candidateIvars = self.ivars;
+    NSArray<FLEXIvarBox *> *candidateIvars = self.ivars;
     if (self.includeInheritance) {
         candidateIvars = [candidateIvars arrayByAddingObjectsFromArray:self.inheritedIvars];
     }
     
-    NSArray *unsortedFilteredIvars = nil;
+    NSArray<FLEXIvarBox *> *unsortedFilteredIvars = nil;
     if ([self.filterText length] > 0) {
-        NSMutableArray *mutableUnsortedFilteredIvars = [NSMutableArray array];
+        NSMutableArray<FLEXIvarBox *> *mutableUnsortedFilteredIvars = [NSMutableArray array];
         for (FLEXIvarBox *ivarBox in candidateIvars) {
             NSString *prettyName = [FLEXRuntimeUtility prettyNameForIvar:ivarBox.ivar];
             if ([prettyName rangeOfString:self.filterText options:NSCaseInsensitiveSearch].location != NSNotFound) {
@@ -394,9 +394,9 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
     self.filteredClassMethods = [self filteredMethodsFromMethods:self.classMethods inheritedMethods:self.inheritedClassMethods areClassMethods:YES];
 }
 
-+ (NSArray *)methodsForClass:(Class)class
++ (NSArray<FLEXMethodBox *> *)methodsForClass:(Class)class
 {
-    NSMutableArray *boxedMethods = [NSMutableArray array];
+    NSMutableArray<FLEXMethodBox *> *boxedMethods = [NSMutableArray array];
     unsigned int methodCount = 0;
     Method *methodList = class_copyMethodList(class, &methodCount);
     if (methodList) {
@@ -410,25 +410,25 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
     return boxedMethods;
 }
 
-+ (NSArray *)inheritedMethodsForClass:(Class)class
++ (NSArray<FLEXMethodBox *> *)inheritedMethodsForClass:(Class)class
 {
-    NSMutableArray *inheritedMethods = [NSMutableArray array];
+    NSMutableArray<FLEXMethodBox *> *inheritedMethods = [NSMutableArray array];
     while ((class = [class superclass])) {
         [inheritedMethods addObjectsFromArray:[self methodsForClass:class]];
     }
     return inheritedMethods;
 }
 
-- (NSArray *)filteredMethodsFromMethods:(NSArray *)methods inheritedMethods:(NSArray *)inheritedMethods areClassMethods:(BOOL)areClassMethods
+- (NSArray<FLEXMethodBox *> *)filteredMethodsFromMethods:(NSArray<FLEXMethodBox *> *)methods inheritedMethods:(NSArray<FLEXMethodBox *> *)inheritedMethods areClassMethods:(BOOL)areClassMethods
 {
-    NSArray *candidateMethods = methods;
+    NSArray<FLEXMethodBox *> *candidateMethods = methods;
     if (self.includeInheritance) {
         candidateMethods = [candidateMethods arrayByAddingObjectsFromArray:inheritedMethods];
     }
     
-    NSArray *unsortedFilteredMethods = nil;
+    NSArray<FLEXMethodBox *> *unsortedFilteredMethods = nil;
     if ([self.filterText length] > 0) {
-        NSMutableArray *mutableUnsortedFilteredMethods = [NSMutableArray array];
+        NSMutableArray<FLEXMethodBox *> *mutableUnsortedFilteredMethods = [NSMutableArray array];
         for (FLEXMethodBox *methodBox in candidateMethods) {
             NSString *prettyName = [FLEXRuntimeUtility prettyNameForMethod:methodBox.method isClassMethod:areClassMethods];
             if ([prettyName rangeOfString:self.filterText options:NSCaseInsensitiveSearch].location != NSNotFound) {
@@ -440,7 +440,7 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
         unsortedFilteredMethods = candidateMethods;
     }
     
-    NSArray *sortedFilteredMethods = [unsortedFilteredMethods sortedArrayUsingComparator:^NSComparisonResult(FLEXMethodBox *methodBox1, FLEXMethodBox *methodBox2) {
+    NSArray<FLEXMethodBox *> *sortedFilteredMethods = [unsortedFilteredMethods sortedArrayUsingComparator:^NSComparisonResult(FLEXMethodBox *methodBox1, FLEXMethodBox *methodBox2) {
         NSString *name1 = NSStringFromSelector(method_getName(methodBox1.method));
         NSString *name2 = NSStringFromSelector(method_getName(methodBox2.method));
         return [name1 caseInsensitiveCompare:name2];
@@ -464,9 +464,9 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
 
 #pragma mark - Superclasses
 
-+ (NSArray *)superclassesForClass:(Class)class
++ (NSArray<Class> *)superclassesForClass:(Class)class
 {
-    NSMutableArray *superClasses = [NSMutableArray array];
+    NSMutableArray<Class> *superClasses = [NSMutableArray array];
     while ((class = [class superclass])) {
         [superClasses addObject:class];
     }
@@ -481,7 +481,7 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
 - (void)updateFilteredSuperclasses
 {
     if ([self.filterText length] > 0) {
-        NSMutableArray *filteredSuperclasses = [NSMutableArray array];
+        NSMutableArray<Class> *filteredSuperclasses = [NSMutableArray array];
         for (Class superclass in self.superclasses) {
             if ([NSStringFromClass(superclass) rangeOfString:self.filterText options:NSCaseInsensitiveSearch].length > 0) {
                 [filteredSuperclasses addObject:superclass];
@@ -496,9 +496,9 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
 
 #pragma mark - Table View Data Helpers
 
-- (NSArray *)possibleExplorerSections
+- (NSArray<NSNumber *> *)possibleExplorerSections
 {
-    static NSArray *possibleSections = nil;
+    static NSArray<NSNumber *> *possibleSections = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
         possibleSections = @[@(FLEXObjectExplorerSectionDescription),
@@ -513,9 +513,9 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
     return possibleSections;
 }
 
-- (NSArray *)visibleExplorerSections
+- (NSArray<NSNumber *> *)visibleExplorerSections
 {
-    NSMutableArray *visibleSections = [NSMutableArray array];
+    NSMutableArray<NSNumber *> *visibleSections = [NSMutableArray array];
     
     for (NSNumber *possibleSection in [self possibleExplorerSections]) {
         FLEXObjectExplorerSection explorerSection = [possibleSection unsignedIntegerValue];

+ 8 - 8
Classes/ObjectExplorers/FLEXViewExplorerViewController.m

@@ -57,9 +57,9 @@ typedef NS_ENUM(NSUInteger, FLEXViewExplorerRow) {
     return rowCookies;
 }
 
-- (NSArray *)shortcutPropertyNames
+- (NSArray<NSString *> *)shortcutPropertyNames
 {
-    NSArray *propertyNames = @[@"frame", @"bounds", @"center", @"transform", @"backgroundColor", @"alpha", @"opaque", @"hidden", @"clipsToBounds", @"userInteractionEnabled", @"layer"];
+    NSArray<NSString *> *propertyNames = @[@"frame", @"bounds", @"center", @"transform", @"backgroundColor", @"alpha", @"opaque", @"hidden", @"clipsToBounds", @"userInteractionEnabled", @"layer"];
     
     if ([self.viewToExplore isKindOfClass:[UILabel class]]) {
         propertyNames = [@[@"text", @"font", @"textColor"] arrayByAddingObjectsFromArray:propertyNames];
@@ -195,22 +195,22 @@ typedef NS_ENUM(NSUInteger, FLEXViewExplorerRow) {
     // We add these properties to the class at runtime if they haven't been added yet.
     // This way, we can use our property editor to access and change them.
     // The property attributes match the declared attributes in UIView.h
-    NSDictionary *frameAttributes = @{kFLEXUtilityAttributeTypeEncoding : @(@encode(CGRect)), kFLEXUtilityAttributeNonAtomic : @""};
+    NSDictionary<NSString *, NSString *> *frameAttributes = @{kFLEXUtilityAttributeTypeEncoding : @(@encode(CGRect)), kFLEXUtilityAttributeNonAtomic : @""};
     [FLEXRuntimeUtility tryAddPropertyWithName:"frame" attributes:frameAttributes toClass:[UIView class]];
     
-    NSDictionary *alphaAttributes = @{kFLEXUtilityAttributeTypeEncoding : @(@encode(CGFloat)), kFLEXUtilityAttributeNonAtomic : @""};
+    NSDictionary<NSString *, NSString *> *alphaAttributes = @{kFLEXUtilityAttributeTypeEncoding : @(@encode(CGFloat)), kFLEXUtilityAttributeNonAtomic : @""};
     [FLEXRuntimeUtility tryAddPropertyWithName:"alpha" attributes:alphaAttributes toClass:[UIView class]];
     
-    NSDictionary *clipsAttributes = @{kFLEXUtilityAttributeTypeEncoding : @(@encode(BOOL)), kFLEXUtilityAttributeNonAtomic : @""};
+    NSDictionary<NSString *, NSString *> *clipsAttributes = @{kFLEXUtilityAttributeTypeEncoding : @(@encode(BOOL)), kFLEXUtilityAttributeNonAtomic : @""};
     [FLEXRuntimeUtility tryAddPropertyWithName:"clipsToBounds" attributes:clipsAttributes toClass:[UIView class]];
     
-    NSDictionary *opaqueAttributes = @{kFLEXUtilityAttributeTypeEncoding : @(@encode(BOOL)), kFLEXUtilityAttributeNonAtomic : @"", kFLEXUtilityAttributeCustomGetter : @"isOpaque"};
+    NSDictionary<NSString *, NSString *> *opaqueAttributes = @{kFLEXUtilityAttributeTypeEncoding : @(@encode(BOOL)), kFLEXUtilityAttributeNonAtomic : @"", kFLEXUtilityAttributeCustomGetter : @"isOpaque"};
     [FLEXRuntimeUtility tryAddPropertyWithName:"opaque" attributes:opaqueAttributes toClass:[UIView class]];
     
-    NSDictionary *hiddenAttributes = @{kFLEXUtilityAttributeTypeEncoding : @(@encode(BOOL)), kFLEXUtilityAttributeNonAtomic : @"", kFLEXUtilityAttributeCustomGetter : @"isHidden"};
+    NSDictionary<NSString *, NSString *> *hiddenAttributes = @{kFLEXUtilityAttributeTypeEncoding : @(@encode(BOOL)), kFLEXUtilityAttributeNonAtomic : @"", kFLEXUtilityAttributeCustomGetter : @"isHidden"};
     [FLEXRuntimeUtility tryAddPropertyWithName:"hidden" attributes:hiddenAttributes toClass:[UIView class]];
     
-    NSDictionary *backgroundColorAttributes = @{kFLEXUtilityAttributeTypeEncoding : @(FLEXEncodeClass(UIColor)), kFLEXUtilityAttributeNonAtomic : @"", kFLEXUtilityAttributeCopy : @""};
+    NSDictionary<NSString *, NSString *> *backgroundColorAttributes = @{kFLEXUtilityAttributeTypeEncoding : @(FLEXEncodeClass(UIColor)), kFLEXUtilityAttributeNonAtomic : @"", kFLEXUtilityAttributeCopy : @""};
     [FLEXRuntimeUtility tryAddPropertyWithName:"backgroundColor" attributes:backgroundColorAttributes toClass:[UIView class]];
 }
 

+ 1 - 1
Classes/Toolbar/FLEXExplorerToolbar.h

@@ -14,7 +14,7 @@
 
 /// The items to be displayed in the toolbar. Defaults to:
 /// globalsItem, hierarchyItem, selectItem, moveItem, closeItem
-@property (nonatomic, copy) NSArray<UIView *> *toolbarItems;
+@property (nonatomic, copy) NSArray<FLEXToolbarItem *> *toolbarItems;
 
 /// Toolbar item for selecting views.
 /// Users of the toolbar can configure the enabled/selected state and event targets/actions.

+ 1 - 1
Classes/Toolbar/FLEXExplorerToolbar.m

@@ -163,7 +163,7 @@
     
 #pragma mark - Setter Overrides
 
-- (void)setToolbarItems:(NSArray *)toolbarItems {
+- (void)setToolbarItems:(NSArray<FLEXToolbarItem *> *)toolbarItems {
     if (_toolbarItems == toolbarItems) {
         return;
     }

+ 1 - 1
Classes/Toolbar/FLEXToolbarItem.m

@@ -43,7 +43,7 @@
 
 #pragma mark - Display Defaults
 
-+ (NSDictionary *)titleAttributes
++ (NSDictionary<NSString *, id> *)titleAttributes
 {
     return @{NSFontAttributeName : [FLEXUtility defaultFontOfSize:12.0]};
 }

+ 8 - 8
Classes/Utility/FLEXKeyboardShortcutManager.m

@@ -57,12 +57,12 @@
 
 - (NSString *)description
 {
-    NSDictionary *keyMappings = @{ UIKeyInputUpArrow : @"↑",
-                                   UIKeyInputDownArrow : @"↓",
-                                   UIKeyInputLeftArrow : @"←",
-                                   UIKeyInputRightArrow : @"→",
-                                   UIKeyInputEscape : @"␛",
-                                   @" " : @"␠"};
+    NSDictionary<NSString *, NSString *> *keyMappings = @{ UIKeyInputUpArrow : @"↑",
+                                                           UIKeyInputDownArrow : @"↓",
+                                                           UIKeyInputLeftArrow : @"←",
+                                                           UIKeyInputRightArrow : @"→",
+                                                           UIKeyInputEscape : @"␛",
+                                                           @" " : @"␠"};
     
     NSString *prettyKey = nil;
     if (self.key && keyMappings[self.key]) {
@@ -113,7 +113,7 @@
 
 @interface FLEXKeyboardShortcutManager ()
 
-@property (nonatomic, strong) NSMutableDictionary *actionsForKeyInputs;
+@property (nonatomic, strong) NSMutableDictionary<FLEXKeyInput *, dispatch_block_t> *actionsForKeyInputs;
 
 @property (nonatomic, assign, getter=isPressingShift) BOOL pressingShift;
 @property (nonatomic, assign, getter=isPressingCommand) BOOL pressingCommand;
@@ -292,7 +292,7 @@ static const long kFLEXCommandKeyCode = 0xe3;
 - (NSString *)keyboardShortcutsDescription
 {
     NSMutableString *description = [NSMutableString string];
-    NSArray *keyInputs = [[self.actionsForKeyInputs allKeys] sortedArrayUsingComparator:^NSComparisonResult(FLEXKeyInput *_Nonnull input1, FLEXKeyInput *_Nonnull input2) {
+    NSArray<FLEXKeyInput *> *keyInputs = [[self.actionsForKeyInputs allKeys] sortedArrayUsingComparator:^NSComparisonResult(FLEXKeyInput *_Nonnull input1, FLEXKeyInput *_Nonnull input2) {
         return [input1.key caseInsensitiveCompare:input2.key];
     }];
     for (FLEXKeyInput *keyInput in keyInputs) {

+ 1 - 1
Classes/Utility/FLEXRuntimeUtility.h

@@ -37,7 +37,7 @@ extern NSString *const kFLEXUtilityAttributeOldStyleTypeEncoding;
 + (NSString *)fullDescriptionForProperty:(objc_property_t)property;
 + (id)valueForProperty:(objc_property_t)property onObject:(id)object;
 + (NSString *)descriptionForIvarOrPropertyValue:(id)value;
-+ (void)tryAddPropertyWithName:(const char *)name attributes:(NSDictionary *)attributePairs toClass:(__unsafe_unretained Class)theClass;
++ (void)tryAddPropertyWithName:(const char *)name attributes:(NSDictionary<NSString *, NSString *> *)attributePairs toClass:(__unsafe_unretained Class)theClass;
 
 // Ivar Helpers
 + (NSString *)prettyNameForIvar:(Ivar)ivar;

+ 14 - 14
Classes/Utility/FLEXRuntimeUtility.m

@@ -48,7 +48,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
 
 + (NSString *)typeEncodingForProperty:(objc_property_t)property
 {
-    NSDictionary *attributesDictionary = [self attributesDictionaryForProperty:property];
+    NSDictionary<NSString *, NSString *> *attributesDictionary = [self attributesDictionaryForProperty:property];
     return attributesDictionary[kFLEXUtilityAttributeTypeEncoding];
 }
 
@@ -73,8 +73,8 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
 
 + (NSString *)fullDescriptionForProperty:(objc_property_t)property
 {
-    NSDictionary *attributesDictionary = [self attributesDictionaryForProperty:property];
-    NSMutableArray *attributesStrings = [NSMutableArray array];
+    NSDictionary<NSString *, NSString *> *attributesDictionary = [self attributesDictionaryForProperty:property];
+    NSMutableArray<NSString *> *attributesStrings = [NSMutableArray array];
     
     // Atomicity
     if (attributesDictionary[kFLEXUtilityAttributeNonAtomic]) {
@@ -168,7 +168,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     return description;
 }
 
-+ (void)tryAddPropertyWithName:(const char *)name attributes:(NSDictionary *)attributePairs toClass:(__unsafe_unretained Class)theClass
++ (void)tryAddPropertyWithName:(const char *)name attributes:(NSDictionary<NSString *, NSString *> *)attributePairs toClass:(__unsafe_unretained Class)theClass
 {
     objc_property_t property = class_getProperty(theClass, name);
     if (!property) {
@@ -262,7 +262,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     NSString *readableReturnType = [self readableTypeForEncoding:@(returnType)];
     free(returnType);
     NSString *prettyName = [NSString stringWithFormat:@"%@ (%@)", methodTypeString, readableReturnType];
-    NSArray *components = [self prettyArgumentComponentsForMethod:method];
+    NSArray<NSString *> *components = [self prettyArgumentComponentsForMethod:method];
     if ([components count] > 0) {
         prettyName = [prettyName stringByAppendingString:[components componentsJoinedByString:@" "]];
     } else {
@@ -272,12 +272,12 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     return prettyName;
 }
 
-+ (NSArray *)prettyArgumentComponentsForMethod:(Method)method
++ (NSArray<NSString *> *)prettyArgumentComponentsForMethod:(Method)method
 {
-    NSMutableArray *components = [NSMutableArray array];
+    NSMutableArray<NSString *> *components = [NSMutableArray array];
     
     NSString *selectorName = NSStringFromSelector(method_getName(method));
-    NSMutableArray *selectorComponents = [[selectorName componentsSeparatedByString:@":"] mutableCopy];
+    NSMutableArray<NSString *> *selectorComponents = [[selectorName componentsSeparatedByString:@":"] mutableCopy];
     
     // this is a workaround cause method_getNumberOfArguments() returns wrong number for some methods
     if (selectorComponents.count == 1) {
@@ -307,7 +307,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     // Bail if the object won't respond to this selector.
     if (![object respondsToSelector:selector]) {
         if (error) {
-            NSDictionary *userInfo = @{ NSLocalizedDescriptionKey : [NSString stringWithFormat:@"%@ does not respond to the selector %@", object, NSStringFromSelector(selector)]};
+            NSDictionary<NSString *, id> *userInfo = @{ NSLocalizedDescriptionKey : [NSString stringWithFormat:@"%@ does not respond to the selector %@", object, NSStringFromSelector(selector)]};
             *error = [NSError errorWithDomain:FLEXRuntimeUtilityErrorDomain code:FLEXRuntimeUtilityErrorCodeDoesNotRecognizeSelector userInfo:userInfo];
         }
         return nil;
@@ -343,7 +343,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
                 // Ensure that the type encoding on the NSValue matches the type encoding of the argument in the method signature
                 if (strcmp([argumentValue objCType], typeEncodingCString) != 0) {
                     if (error) {
-                        NSDictionary *userInfo = @{ NSLocalizedDescriptionKey : [NSString stringWithFormat:@"Type encoding mismatch for agrument at index %lu. Value type: %s; Method argument type: %s.", (unsigned long)argumentsArrayIndex, [argumentValue objCType], typeEncodingCString]};
+                        NSDictionary<NSString *, id> *userInfo = @{ NSLocalizedDescriptionKey : [NSString stringWithFormat:@"Type encoding mismatch for agrument at index %lu. Value type: %s; Method argument type: %s.", (unsigned long)argumentsArrayIndex, [argumentValue objCType], typeEncodingCString]};
                         *error = [NSError errorWithDomain:FLEXRuntimeUtilityErrorDomain code:FLEXRuntimeUtilityErrorCodeArgumentTypeMismatch userInfo:userInfo];
                     }
                     return nil;
@@ -375,7 +375,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     } @catch (NSException *exception) {
         // Bummer...
         if (error) {
-            NSDictionary *userInfo = @{ NSLocalizedDescriptionKey : [NSString stringWithFormat:@"Exception thrown while performing selector %@ on object %@", NSStringFromSelector(selector), object]};
+            NSDictionary<NSString *, id> *userInfo = @{ NSLocalizedDescriptionKey : [NSString stringWithFormat:@"Exception thrown while performing selector %@ on object %@", NSStringFromSelector(selector), object]};
             *error = [NSError errorWithDomain:FLEXRuntimeUtilityErrorDomain code:FLEXRuntimeUtilityErrorCodeInvocationFailed userInfo:userInfo];
         }
     }
@@ -558,12 +558,12 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
 
 #pragma mark - Internal Helpers
 
-+ (NSDictionary *)attributesDictionaryForProperty:(objc_property_t)property
++ (NSDictionary<NSString *, NSString *> *)attributesDictionaryForProperty:(objc_property_t)property
 {
     NSString *attributes = @(property_getAttributes(property));
     // Thanks to MAObjcRuntime for inspiration here.
-    NSArray *attributePairs = [attributes componentsSeparatedByString:@","];
-    NSMutableDictionary *attributesDictionary = [NSMutableDictionary dictionaryWithCapacity:[attributePairs count]];
+    NSArray<NSString *> *attributePairs = [attributes componentsSeparatedByString:@","];
+    NSMutableDictionary<NSString *, NSString *> *attributesDictionary = [NSMutableDictionary dictionaryWithCapacity:[attributePairs count]];
     for (NSString *attributePair in attributePairs) {
         [attributesDictionary setObject:[attributePair substringFromIndex:1] forKey:[attributePair substringToIndex:1]];
     }

+ 2 - 2
Classes/Utility/FLEXUtility.h

@@ -40,12 +40,12 @@
 + (NSString *)stringFromRequestDuration:(NSTimeInterval)duration;
 + (NSString *)statusCodeStringFromURLResponse:(NSURLResponse *)response;
 + (BOOL)isErrorStatusCodeFromURLResponse:(NSURLResponse *)response;
-+ (NSDictionary *)dictionaryFromQuery:(NSString *)query;
++ (NSDictionary<NSString *, id> *)dictionaryFromQuery:(NSString *)query;
 + (NSString *)prettyJSONStringFromData:(NSData *)data;
 + (BOOL)isValidJSONData:(NSData *)data;
 + (NSData *)inflatedDataFromCompressedData:(NSData *)compressedData;
 
-+ (NSArray *)allWindows;
++ (NSArray<UIWindow *> *)allWindows;
 
 // Swizzling utilities
 

+ 13 - 13
Classes/Utility/FLEXUtility.m

@@ -138,7 +138,7 @@
 
 + (NSString *)stringByEscapingHTMLEntitiesInString:(NSString *)originalString
 {
-    static NSDictionary *escapingDictionary = nil;
+    static NSDictionary<NSString *, NSString *> *escapingDictionary = nil;
     static NSRegularExpression *regex = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
@@ -156,7 +156,7 @@
     
     NSMutableString *mutableString = [originalString mutableCopy];
     
-    NSArray *matches = [regex matchesInString:mutableString options:0 range:NSMakeRange(0, [mutableString length])];
+    NSArray<NSTextCheckingResult *> *matches = [regex matchesInString:mutableString options:0 range:NSMakeRange(0, [mutableString length])];
     for (NSTextCheckingResult *result in [matches reverseObjectEnumerator]) {
         NSString *foundString = [mutableString substringWithRange:result.range];
         NSString *replacementString = escapingDictionary[foundString];
@@ -170,7 +170,7 @@
 
 + (UIInterfaceOrientationMask)infoPlistSupportedInterfaceOrientationsMask
 {
-    NSArray *supportedOrientations = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UISupportedInterfaceOrientations"];
+    NSArray<NSString *> *supportedOrientations = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UISupportedInterfaceOrientations"];
     UIInterfaceOrientationMask supportedOrientationsMask = 0;
     if ([supportedOrientations containsObject:@"UIInterfaceOrientationPortrait"]) {
         supportedOrientationsMask |= UIInterfaceOrientationMaskPortrait;
@@ -203,9 +203,9 @@
     UIImage *thumbnail = nil;
     CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)data, 0);
     if (imageSource) {
-        NSDictionary *options = @{ (__bridge id)kCGImageSourceCreateThumbnailWithTransform : @YES,
-                                   (__bridge id)kCGImageSourceCreateThumbnailFromImageAlways : @YES,
-                                   (__bridge id)kCGImageSourceThumbnailMaxPixelSize : @(dimension) };
+        NSDictionary<NSString *, id> *options = @{ (__bridge id)kCGImageSourceCreateThumbnailWithTransform : @YES,
+                                                   (__bridge id)kCGImageSourceCreateThumbnailFromImageAlways : @YES,
+                                                   (__bridge id)kCGImageSourceThumbnailMaxPixelSize : @(dimension) };
 
         CGImageRef scaledImageRef = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, (__bridge CFDictionaryRef)options);
         if (scaledImageRef) {
@@ -261,15 +261,15 @@
 }
 
 
-+ (NSDictionary *)dictionaryFromQuery:(NSString *)query
++ (NSDictionary<NSString *, id> *)dictionaryFromQuery:(NSString *)query
 {
-    NSMutableDictionary *queryDictionary = [NSMutableDictionary dictionary];
+    NSMutableDictionary<NSString *, id> *queryDictionary = [NSMutableDictionary dictionary];
 
     // [a=1, b=2, c=3]
-    NSArray *queryComponents = [query componentsSeparatedByString:@"&"];
+    NSArray<NSString *> *queryComponents = [query componentsSeparatedByString:@"&"];
     for (NSString *keyValueString in queryComponents) {
         // [a, 1]
-        NSArray *components = [keyValueString componentsSeparatedByString:@"="];
+        NSArray<NSString *> *components = [keyValueString componentsSeparatedByString:@"="];
         if ([components count] == 2) {
             NSString *key = [[components firstObject] stringByRemovingPercentEncoding];
             id value = [[components lastObject] stringByRemovingPercentEncoding];
@@ -350,12 +350,12 @@
     return inflatedData;
 }
 
-+ (NSArray *)allWindows
++ (NSArray<UIWindow *> *)allWindows
 {
     BOOL includeInternalWindows = YES;
     BOOL onlyVisibleWindows = NO;
 
-    NSArray *allWindowsComponents = @[@"al", @"lWindo", @"wsIncl", @"udingInt", @"ernalWin", @"dows:o", @"nlyVisi", @"bleWin", @"dows:"];
+    NSArray<NSString *> *allWindowsComponents = @[@"al", @"lWindo", @"wsIncl", @"udingInt", @"ernalWin", @"dows:o", @"nlyVisi", @"bleWin", @"dows:"];
     SEL allWindowsSelector = NSSelectorFromString([allWindowsComponents componentsJoinedByString:@""]);
 
     NSMethodSignature *methodSignature = [[UIWindow class] methodSignatureForSelector:allWindowsSelector];
@@ -367,7 +367,7 @@
     [invocation setArgument:&onlyVisibleWindows atIndex:3];
     [invocation invoke];
 
-    __unsafe_unretained NSArray *windows = nil;
+    __unsafe_unretained NSArray<UIWindow *> *windows = nil;
     [invocation getReturnValue:&windows];
     return windows;
 }

+ 1 - 1
Classes/ViewHierarchy/FLEXHierarchyTableViewController.h

@@ -12,7 +12,7 @@
 
 @interface FLEXHierarchyTableViewController : UITableViewController
 
-- (id)initWithViews:(NSArray *)allViews viewsAtTap:(NSArray *)viewsAtTap selectedView:(UIView *)selectedView depths:(NSDictionary *)depthsForViews;
+- (instancetype)initWithViews:(NSArray<UIView *> *)allViews viewsAtTap:(NSArray<UIView *> *)viewsAtTap selectedView:(UIView *)selectedView depths:(NSDictionary<NSValue *, NSNumber *> *)depthsForViews;
 
 @property (nonatomic, weak) id <FLEXHierarchyTableViewControllerDelegate> delegate;
 

+ 7 - 7
Classes/ViewHierarchy/FLEXHierarchyTableViewController.m

@@ -17,11 +17,11 @@ static const NSInteger kFLEXHierarchyScopeFullHierarchyIndex = 1;
 
 @interface FLEXHierarchyTableViewController () <UISearchBarDelegate>
 
-@property (nonatomic, strong) NSArray *allViews;
-@property (nonatomic, strong) NSDictionary *depthsForViews;
-@property (nonatomic, strong) NSArray *viewsAtTap;
+@property (nonatomic, strong) NSArray<UIView *> *allViews;
+@property (nonatomic, strong) NSDictionary<NSValue *, NSNumber *> *depthsForViews;
+@property (nonatomic, strong) NSArray<UIView *> *viewsAtTap;
 @property (nonatomic, strong) UIView *selectedView;
-@property (nonatomic, strong) NSArray *displayedViews;
+@property (nonatomic, strong) NSArray<UIView *> *displayedViews;
 
 @property (nonatomic, strong) UISearchBar *searchBar;
 
@@ -29,7 +29,7 @@ static const NSInteger kFLEXHierarchyScopeFullHierarchyIndex = 1;
 
 @implementation FLEXHierarchyTableViewController
 
-- (id)initWithViews:(NSArray *)allViews viewsAtTap:(NSArray *)viewsAtTap selectedView:(UIView *)selectedView depths:(NSDictionary *)depthsForViews
+- (instancetype)initWithViews:(NSArray<UIView *> *)allViews viewsAtTap:(NSArray<UIView *> *)viewsAtTap selectedView:(UIView *)selectedView depths:(NSDictionary<NSValue *, NSNumber *> *)depthsForViews
 {
     self = [super initWithStyle:UITableViewStylePlain];
     if (self) {
@@ -92,7 +92,7 @@ static const NSInteger kFLEXHierarchyScopeFullHierarchyIndex = 1;
 
 - (void)updateDisplayedViews
 {
-    NSArray *candidateViews = nil;
+    NSArray<UIView *> *candidateViews = nil;
     if ([self showScopeBar]) {
         if (self.searchBar.selectedScopeButtonIndex == kFLEXHierarchyScopeViewsAtTapIndex) {
             candidateViews = self.viewsAtTap;
@@ -104,7 +104,7 @@ static const NSInteger kFLEXHierarchyScopeFullHierarchyIndex = 1;
     }
     
     if ([self.searchBar.text length] > 0) {
-        self.displayedViews = [candidateViews filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(UIView *candidateView, NSDictionary *bindings) {
+        self.displayedViews = [candidateViews filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(UIView *candidateView, NSDictionary<NSString *, id> *bindings) {
             NSString *title = [FLEXUtility descriptionForView:candidateView includingFrame:NO];
             NSString *candidateViewPointerAddress = [NSString stringWithFormat:@"%p", candidateView];
             BOOL matchedViewPointerAddress = [candidateViewPointerAddress rangeOfString:self.searchBar.text options:NSCaseInsensitiveSearch].location != NSNotFound;