Преглед изворни кода

Clean up formatting in various files

- Braces on same line
- Comments and method calls curbed to be near or under 100 characters per line
Tanner Bennett пре 6 година
родитељ
комит
795cff68fd
68 измењених фајлова са 892 додато и 1478 уклоњено
  1. 2 0
      Classes/Core/Controllers/FLEXNavigationController.h
  2. 4 0
      Classes/Core/Controllers/FLEXNavigationController.m
  3. 1 2
      Classes/Core/Controllers/FLEXTableViewController.m
  4. 4 8
      Classes/Core/Views/Cells/FLEXTableViewCell.m
  5. 22 44
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputColorView.m
  6. 6 12
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputDateView.m
  7. 9 18
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputFontView.m
  8. 9 18
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputFontsPickerView.m
  9. 1 2
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputNotSupportedView.m
  10. 4 8
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputNumberView.m
  11. 11 22
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputObjectView.m
  12. 4 8
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputStringView.m
  13. 10 20
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputStructView.m
  14. 7 14
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputSwitchView.m
  15. 11 22
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputTextView.m
  16. 12 24
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputView.m
  17. 4 8
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputViewFactory.m
  18. 6 12
      Classes/Editing/FLEXDefaultEditorViewController.m
  19. 13 26
      Classes/Editing/FLEXFieldEditorView.m
  20. 4 8
      Classes/Editing/FLEXMethodCallingViewController.m
  21. 10 20
      Classes/Editing/FLEXVariableEditorViewController.m
  22. 153 155
      Classes/ExplorerInterface/FLEXExplorerViewController.m
  23. 5 10
      Classes/ExplorerInterface/FLEXWindow.m
  24. 28 56
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXMultiColumnTableView.m
  25. 5 10
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXRealmDatabaseManager.m
  26. 6 12
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXSQLiteDatabaseManager.m
  27. 3 6
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableColumnHeader.m
  28. 3 6
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableContentCell.m
  29. 14 28
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableContentViewController.m
  30. 2 4
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableLeftCell.m
  31. 13 26
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableListViewController.m
  32. 9 18
      Classes/GlobalStateExplorers/FLEXInstancesTableViewController.m
  33. 12 24
      Classes/GlobalStateExplorers/FLEXLiveObjectsTableViewController.m
  34. 9 18
      Classes/GlobalStateExplorers/FLEXWebViewController.m
  35. 5 10
      Classes/GlobalStateExplorers/FileBrowser/FLEXFileBrowserSearchOperation.m
  36. 30 60
      Classes/GlobalStateExplorers/FileBrowser/FLEXFileBrowserTableViewController.m
  37. 3 6
      Classes/GlobalStateExplorers/Globals/FLEXGlobalsEntry.m
  38. 10 20
      Classes/GlobalStateExplorers/Globals/FLEXGlobalsViewController.m
  39. 13 26
      Classes/GlobalStateExplorers/Keychain/FLEXKeychainTableViewController.m
  40. 1 2
      Classes/GlobalStateExplorers/RuntimeBrowser/TBToken.h
  41. 7 14
      Classes/GlobalStateExplorers/SystemLog/FLEXASLLogController.m
  42. 3 6
      Classes/GlobalStateExplorers/SystemLog/FLEXOSLogController.m
  43. 6 12
      Classes/GlobalStateExplorers/SystemLog/FLEXSystemLogMessage.m
  44. 12 21
      Classes/GlobalStateExplorers/SystemLog/FLEXSystemLogTableViewCell.m
  45. 14 28
      Classes/GlobalStateExplorers/SystemLog/FLEXSystemLogTableViewController.m
  46. 4 4
      Classes/Manager/FLEXManager+Extensibility.m
  47. 31 62
      Classes/Network/FLEXNetworkHistoryTableViewController.m
  48. 15 30
      Classes/Network/FLEXNetworkRecorder.m
  49. 14 28
      Classes/Network/FLEXNetworkSettingsTableViewController.m
  50. 2 4
      Classes/Network/FLEXNetworkTransaction.m
  51. 28 56
      Classes/Network/FLEXNetworkTransactionDetailTableViewController.m
  52. 9 17
      Classes/Network/FLEXNetworkTransactionTableViewCell.m
  53. 49 98
      Classes/Network/PonyDebugger/FLEXNetworkObserver.m
  54. 2 4
      Classes/ObjectExplorers/FLEXObjectExplorer.m
  55. 6 12
      Classes/ObjectExplorers/FLEXObjectExplorerFactory.m
  56. 26 52
      Classes/ObjectExplorers/FLEXObjectExplorerViewController.m
  57. 14 28
      Classes/Toolbar/FLEXExplorerToolbar.m
  58. 11 22
      Classes/Toolbar/FLEXToolbarItem.m
  59. 1 2
      Classes/Utility/Categories/FLEXRuntime+UIKitHelpers.h
  60. 1 2
      Classes/Utility/Categories/UIFont+FLEX.m
  61. 4 8
      Classes/Utility/FLEXHeapEnumerator.m
  62. 2 4
      Classes/Utility/FLEXKeyboardHelpViewController.m
  63. 52 39
      Classes/Utility/FLEXKeyboardShortcutManager.m
  64. 0 2
      Classes/Utility/FLEXUtility.h
  65. 73 75
      Classes/Utility/FLEXUtility.m
  66. 4 8
      Classes/Utility/Runtime/FLEXObjcInternal.mm
  67. 2 4
      Classes/Utility/Runtime/FLEXRuntimeUtility.h
  68. 22 43
      Classes/Utility/Runtime/FLEXRuntimeUtility.m

+ 2 - 0
Classes/Core/Controllers/FLEXNavigationController.h

@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface FLEXNavigationController : UINavigationController
 
++ (instancetype)withRootViewController:(UIViewController *)rootVC;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 4 - 0
Classes/Core/Controllers/FLEXNavigationController.m

@@ -22,6 +22,10 @@
 
 @implementation FLEXNavigationController
 
++ (instancetype)withRootViewController:(UIViewController *)rootVC {
+    return [[self alloc] initWithRootViewController:rootVC];
+}
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     

+ 1 - 2
Classes/Core/Controllers/FLEXTableViewController.m

@@ -370,8 +370,7 @@ CGFloat const kFLEXDebounceForExpensiveIO = 0.5;
 
 #pragma mark UISearchResultsUpdating
 
-- (void)updateSearchResultsForSearchController:(UISearchController *)searchController
-{
+- (void)updateSearchResultsForSearchController:(UISearchController *)searchController {
     [self.debounceTimer invalidate];
     NSString *text = searchController.searchBar.text;
     

+ 4 - 8
Classes/Core/Views/Cells/FLEXTableViewCell.m

@@ -24,8 +24,7 @@
 
 @implementation FLEXTableViewCell
 
-- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
-{
+- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
     self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
     if (self) {
         [self postInit];
@@ -55,8 +54,7 @@
     return self.detailTextLabel;
 }
 
-- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
-{
+- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
     return [self._tableView _canPerformAction:action forCell:self sender:sender];
 }
 
@@ -69,8 +67,7 @@
 /// sake. I see this as "fixing" a poorly designed API.
 /// That approach would require lots of boilerplate to
 /// make the menu appear above this cell.
-- (void)forwardInvocation:(NSInvocation *)invocation
-{
+- (void)forwardInvocation:(NSInvocation *)invocation {
     // Must be unretained to avoid over-releasing
     __unsafe_unretained id sender;
     [invocation getArgument:&sender atIndex:2];
@@ -84,8 +81,7 @@
     [invocation invokeWithTarget:self._tableView];
 }
 
-- (NSMethodSignature *)methodSignatureForSelector:(SEL)selector
-{
+- (NSMethodSignature *)methodSignatureForSelector:(SEL)selector {
     if ([self canPerformAction:selector withSender:nil]) {
         return [self._tableView methodSignatureForSelector:@selector(_performAction:forCell:sender:)];
     }

+ 22 - 44
Classes/Editing/ArgumentInputViews/FLEXArgumentInputColorView.m

@@ -30,8 +30,7 @@
 
 @implementation FLEXColorComponentInputView
 
-- (id)initWithFrame:(CGRect)frame
-{
+- (id)initWithFrame:(CGRect)frame {
     self = [super initWithFrame:frame];
     if (self) {
         self.slider = [UISlider new];
@@ -49,15 +48,13 @@
     return self;
 }
 
-- (void)setBackgroundColor:(UIColor *)backgroundColor
-{
+- (void)setBackgroundColor:(UIColor *)backgroundColor {
     [super setBackgroundColor:backgroundColor];
     self.slider.backgroundColor = backgroundColor;
     self.valueLabel.backgroundColor = backgroundColor;
 }
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     [super layoutSubviews];
     
     const CGFloat kValueLabelWidth = 50.0;
@@ -72,19 +69,16 @@
     self.valueLabel.frame = CGRectMake(valueLabelOriginX, valueLabelOriginY, kValueLabelWidth, self.valueLabel.frame.size.height);
 }
 
-- (void)sliderChanged:(id)sender
-{
+- (void)sliderChanged:(id)sender {
     [self.delegate colorComponentInputViewValueDidChange:self];
     [self updateValueLabel];
 }
 
-- (void)updateValueLabel
-{
+- (void)updateValueLabel {
     self.valueLabel.text = [NSString stringWithFormat:@"%.3f", self.slider.value];
 }
 
-- (CGSize)sizeThatFits:(CGSize)size
-{
+- (CGSize)sizeThatFits:(CGSize)size {
     CGFloat height = [self.slider sizeThatFits:size].height;
     return CGSizeMake(size.width, height);
 }
@@ -101,8 +95,7 @@
 
 @implementation FLEXColorPreviewBox
 
-- (id)initWithFrame:(CGRect)frame
-{
+- (id)initWithFrame:(CGRect)frame {
     self = [super initWithFrame:frame];
     if (self) {
         self.layer.borderWidth = 1.0;
@@ -117,18 +110,15 @@
     return self;
 }
 
-- (void)setColor:(UIColor *)color
-{
+- (void)setColor:(UIColor *)color {
     self.colorOverlayView.backgroundColor = color;
 }
 
-- (UIColor *)color
-{
+- (UIColor *)color {
     return self.colorOverlayView.backgroundColor;
 }
 
-+ (UIImage *)backgroundPatternImage
-{
++ (UIImage *)backgroundPatternImage {
     const CGFloat kSquareDimension = 5.0;
     CGSize squareSize = CGSizeMake(kSquareDimension, kSquareDimension);
     CGSize imageSize = CGSizeMake(2.0 * kSquareDimension, 2.0 * kSquareDimension);
@@ -163,8 +153,7 @@
 
 @implementation FLEXArgumentInputColorView
 
-- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding
-{
+- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding {
     self = [super initWithArgumentTypeEncoding:typeEncoding];
     if (self) {
         self.colorPreviewBox = [FLEXColorPreviewBox new];
@@ -199,8 +188,7 @@
     return self;
 }
 
-- (void)setBackgroundColor:(UIColor *)backgroundColor
-{
+- (void)setBackgroundColor:(UIColor *)backgroundColor {
     [super setBackgroundColor:backgroundColor];
     self.alphaInput.backgroundColor = backgroundColor;
     self.redInput.backgroundColor = backgroundColor;
@@ -208,8 +196,7 @@
     self.blueInput.backgroundColor = backgroundColor;
 }
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     [super layoutSubviews];
     
     CGFloat runningOriginY = 0;
@@ -235,8 +222,7 @@
     }
 }
 
-- (void)setInputValue:(id)inputValue
-{
+- (void)setInputValue:(id)inputValue {
     if ([inputValue isKindOfClass:[UIColor class]]) {
         [self updateWithColor:inputValue];
     } else if ([inputValue isKindOfClass:[NSValue class]]) {
@@ -252,18 +238,15 @@
     }
 }
 
-- (id)inputValue
-{
+- (id)inputValue {
     return [UIColor colorWithRed:self.redInput.slider.value green:self.greenInput.slider.value blue:self.blueInput.slider.value alpha:self.alphaInput.slider.value];
 }
 
-- (void)colorComponentInputViewValueDidChange:(FLEXColorComponentInputView *)colorComponentInputView
-{
+- (void)colorComponentInputViewValueDidChange:(FLEXColorComponentInputView *)colorComponentInputView {
     [self updateColorPreview];
 }
 
-- (void)updateWithColor:(UIColor *)color
-{
+- (void)updateWithColor:(UIColor *)color {
     CGFloat red, green, blue, white, alpha;
     if ([color getRed:&red green:&green blue:&blue alpha:&alpha]) {
         self.alphaInput.slider.value = alpha;
@@ -287,8 +270,7 @@
     [self updateColorPreview];
 }
 
-- (void)updateColorPreview
-{
+- (void)updateColorPreview {
     self.colorPreviewBox.color = self.inputValue;
     unsigned char redByte = self.redInput.slider.value * 255;
     unsigned char greenByte = self.greenInput.slider.value * 255;
@@ -297,8 +279,7 @@
     [self setNeedsLayout];
 }
 
-- (CGSize)sizeThatFits:(CGSize)size
-{
+- (CGSize)sizeThatFits:(CGSize)size {
     CGFloat height = 0;
     height += [[self class] colorPreviewBoxHeight];
     height += [[self class] inputViewVerticalPadding];
@@ -312,18 +293,15 @@
     return CGSizeMake(size.width, height);
 }
 
-+ (CGFloat)inputViewVerticalPadding
-{
++ (CGFloat)inputViewVerticalPadding {
     return 10.0;
 }
 
-+ (CGFloat)colorPreviewBoxHeight
-{
++ (CGFloat)colorPreviewBoxHeight {
     return 40.0;
 }
 
-+ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value
-{
++ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value {
     NSParameterAssert(type);
 
     // We don't care if currentValue is a color or not; we will default to +clearColor

+ 6 - 12
Classes/Editing/ArgumentInputViews/FLEXArgumentInputDateView.m

@@ -17,8 +17,7 @@
 
 @implementation FLEXArgumentInputDateView
 
-- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding
-{
+- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding {
     self = [super initWithArgumentTypeEncoding:typeEncoding];
     if (self) {
         self.datePicker = [UIDatePicker new];
@@ -31,32 +30,27 @@
     return self;
 }
 
-- (void)setInputValue:(id)inputValue
-{
+- (void)setInputValue:(id)inputValue {
     if ([inputValue isKindOfClass:[NSDate class]]) {
         self.datePicker.date = inputValue;
     }
 }
 
-- (id)inputValue
-{
+- (id)inputValue {
     return self.datePicker.date;
 }
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     [super layoutSubviews];
     self.datePicker.frame = self.bounds;
 }
 
-- (CGSize)sizeThatFits:(CGSize)size
-{
+- (CGSize)sizeThatFits:(CGSize)size {
     CGFloat height = [self.datePicker sizeThatFits:size].height;
     return CGSizeMake(size.width, height);
 }
 
-+ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value
-{
++ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value {
     NSParameterAssert(type);
     return strcmp(type, FLEXEncodeClass(NSDate)) == 0;
 }

+ 9 - 18
Classes/Editing/ArgumentInputViews/FLEXArgumentInputFontView.m

@@ -20,8 +20,7 @@
 
 @implementation FLEXArgumentInputFontView
 
-- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding
-{
+- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding {
     self = [super initWithArgumentTypeEncoding:typeEncoding];
     if (self) {
         self.fontNameInput = [[FLEXArgumentInputFontsPickerView alloc] initWithArgumentTypeEncoding:FLEXEncodeClass(NSString)];
@@ -37,15 +36,13 @@
     return self;
 }
 
-- (void)setBackgroundColor:(UIColor *)backgroundColor
-{
+- (void)setBackgroundColor:(UIColor *)backgroundColor {
     [super setBackgroundColor:backgroundColor];
     self.fontNameInput.backgroundColor = backgroundColor;
     self.pointSizeInput.backgroundColor = backgroundColor;
 }
 
-- (void)setInputValue:(id)inputValue
-{
+- (void)setInputValue:(id)inputValue {
     if ([inputValue isKindOfClass:[UIFont class]]) {
         UIFont *font = (UIFont *)inputValue;
         self.fontNameInput.inputValue = font.fontName;
@@ -53,8 +50,7 @@
     }
 }
 
-- (id)inputValue
-{
+- (id)inputValue {
     CGFloat pointSize = 0;
     if ([self.pointSizeInput.inputValue isKindOfClass:[NSValue class]]) {
         NSValue *pointSizeValue = (NSValue *)self.pointSizeInput.inputValue;
@@ -65,16 +61,14 @@
     return [UIFont fontWithName:self.fontNameInput.inputValue size:pointSize];
 }
 
-- (BOOL)inputViewIsFirstResponder
-{
+- (BOOL)inputViewIsFirstResponder {
     return [self.fontNameInput inputViewIsFirstResponder] || [self.pointSizeInput inputViewIsFirstResponder];
 }
 
 
 #pragma mark - Layout and Sizing
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     [super layoutSubviews];
     
     CGFloat runningOriginY = self.topInputFieldVerticalLayoutGuide;
@@ -87,13 +81,11 @@
     self.pointSizeInput.frame = CGRectMake(0, runningOriginY, pointSizeFitSize.width, pointSizeFitSize.height);
 }
 
-+ (CGFloat)verticalPaddingBetweenFields
-{
++ (CGFloat)verticalPaddingBetweenFields {
     return 10.0;
 }
 
-- (CGSize)sizeThatFits:(CGSize)size
-{
+- (CGSize)sizeThatFits:(CGSize)size {
     CGSize fitSize = [super sizeThatFits:size];
     
     CGSize constrainSize = CGSizeMake(size.width, CGFLOAT_MAX);
@@ -109,8 +101,7 @@
 
 #pragma mark -
 
-+ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value
-{
++ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value {
     NSParameterAssert(type);
     return strcmp(type, FLEXEncodeClass(UIFont)) == 0;
 }

+ 9 - 18
Classes/Editing/ArgumentInputViews/FLEXArgumentInputFontsPickerView.m

@@ -18,8 +18,7 @@
 
 @implementation FLEXArgumentInputFontsPickerView
 
-- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding
-{
+- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding {
     self = [super initWithArgumentTypeEncoding:typeEncoding];
     if (self) {
         self.targetSize = FLEXArgumentInputViewSizeSmall;
@@ -29,8 +28,7 @@
     return self;
 }
 
-- (void)setInputValue:(id)inputValue
-{
+- (void)setInputValue:(id)inputValue {
     self.inputTextView.text = inputValue;
     if ([self.availableFonts indexOfObject:inputValue] == NSNotFound) {
         [self.availableFonts insertObject:inputValue atIndex:0];
@@ -38,15 +36,13 @@
     [(UIPickerView *)self.inputTextView.inputView selectRow:[self.availableFonts indexOfObject:inputValue] inComponent:0 animated:NO];
 }
 
-- (id)inputValue
-{
+- (id)inputValue {
     return self.inputTextView.text.length > 0 ? [self.inputTextView.text copy] : nil;
 }
 
 #pragma mark - private
 
-- (UIPickerView*)createFontsPicker
-{
+- (UIPickerView*)createFontsPicker {
     UIPickerView *fontsPicker = [UIPickerView new];
     fontsPicker.dataSource = self;
     fontsPicker.delegate = self;
@@ -54,8 +50,7 @@
     return fontsPicker;
 }
 
-- (void)createAvailableFonts
-{
+- (void)createAvailableFonts {
     NSMutableArray<NSString *> *unsortedFontsArray = [NSMutableArray array];
     for (NSString *eachFontFamily in [UIFont familyNames]) {
         for (NSString *eachFontName in [UIFont fontNamesForFamilyName:eachFontFamily]) {
@@ -67,20 +62,17 @@
 
 #pragma mark - UIPickerViewDataSource
 
-- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
-{
+- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
     return 1;
 }
 
-- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
-{
+- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
     return self.availableFonts.count;
 }
 
 #pragma mark - UIPickerViewDelegate
 
-- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
-{
+- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view {
     UILabel *fontLabel;
     if (!view) {
         fontLabel = [UILabel new];
@@ -97,8 +89,7 @@
     return fontLabel;
 }
 
-- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
-{
+- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
     self.inputTextView.text = self.availableFonts[row];
 }
 

+ 1 - 2
Classes/Editing/ArgumentInputViews/FLEXArgumentInputNotSupportedView.m

@@ -11,8 +11,7 @@
 
 @implementation FLEXArgumentInputNotSupportedView
 
-- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding
-{
+- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding {
     self = [super initWithArgumentTypeEncoding:typeEncoding];
     if (self) {
         self.inputTextView.userInteractionEnabled = NO;

+ 4 - 8
Classes/Editing/ArgumentInputViews/FLEXArgumentInputNumberView.m

@@ -11,8 +11,7 @@
 
 @implementation FLEXArgumentInputNumberView
 
-- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding
-{
+- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding {
     self = [super initWithArgumentTypeEncoding:typeEncoding];
     if (self) {
         self.inputTextView.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
@@ -21,20 +20,17 @@
     return self;
 }
 
-- (void)setInputValue:(id)inputValue
-{
+- (void)setInputValue:(id)inputValue {
     if ([inputValue respondsToSelector:@selector(stringValue)]) {
         self.inputTextView.text = [inputValue stringValue];
     }
 }
 
-- (id)inputValue
-{
+- (id)inputValue {
     return [FLEXRuntimeUtility valueForNumberWithObjCType:self.typeEncoding.UTF8String fromInputString:self.inputTextView.text];
 }
 
-+ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value
-{
++ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value {
     NSParameterAssert(type);
     
     static NSArray<NSString *> *primitiveTypes = nil;

+ 11 - 22
Classes/Editing/ArgumentInputViews/FLEXArgumentInputObjectView.m

@@ -25,8 +25,7 @@ typedef NS_ENUM(NSUInteger, FLEXArgInputObjectType) {
 
 @implementation FLEXArgumentInputObjectView
 
-- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding
-{
+- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding {
     self = [super initWithArgumentTypeEncoding:typeEncoding];
     if (self) {
         // Start with the numbers and punctuation keyboard since quotes, curly braces, or
@@ -46,8 +45,7 @@ typedef NS_ENUM(NSUInteger, FLEXArgInputObjectType) {
     return self;
 }
 
-- (void)didChangeType
-{
+- (void)didChangeType {
     self.inputType = self.objectTypeSegmentControl.selectedSegmentIndex;
 
     if (super.inputValue) {
@@ -61,8 +59,7 @@ typedef NS_ENUM(NSUInteger, FLEXArgInputObjectType) {
     }
 }
 
-- (void)setInputType:(FLEXArgInputObjectType)inputType
-{
+- (void)setInputType:(FLEXArgInputObjectType)inputType {
     if (_inputType == inputType) return;
 
     _inputType = inputType;
@@ -98,14 +95,12 @@ typedef NS_ENUM(NSUInteger, FLEXArgInputObjectType) {
     [self.superview setNeedsLayout];
 }
 
-- (void)setInputValue:(id)inputValue
-{
+- (void)setInputValue:(id)inputValue {
     super.inputValue = inputValue;
     [self populateTextAreaFromValue:inputValue];
 }
 
-- (id)inputValue
-{
+- (id)inputValue {
     switch (self.inputType) {
         case FLEXArgInputObjectTypeJSON:
             return [FLEXRuntimeUtility objectValueFromEditableJSONString:self.inputTextView.text];
@@ -122,8 +117,7 @@ typedef NS_ENUM(NSUInteger, FLEXArgInputObjectType) {
     }
 }
 
-- (void)populateTextAreaFromValue:(id)value
-{
+- (void)populateTextAreaFromValue:(id)value {
     if (!value) {
         self.inputTextView.text = nil;
     } else {
@@ -138,16 +132,14 @@ typedef NS_ENUM(NSUInteger, FLEXArgInputObjectType) {
     [self textViewDidChange:self.inputTextView];
 }
 
-- (CGSize)sizeThatFits:(CGSize)size
-{
+- (CGSize)sizeThatFits:(CGSize)size {
     CGSize fitSize = [super sizeThatFits:size];
     fitSize.height += [self.objectTypeSegmentControl sizeThatFits:size].height + kSegmentInputMargin;
 
     return fitSize;
 }
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     CGFloat segmentHeight = [self.objectTypeSegmentControl sizeThatFits:self.frame.size].height;
     self.objectTypeSegmentControl.frame = CGRectMake(
         0.0,
@@ -162,22 +154,19 @@ typedef NS_ENUM(NSUInteger, FLEXArgInputObjectType) {
     [super layoutSubviews];
 }
 
-- (CGFloat)topInputFieldVerticalLayoutGuide
-{
+- (CGFloat)topInputFieldVerticalLayoutGuide {
     // Our text view is offset from the segmented control
     CGFloat segmentHeight = [self.objectTypeSegmentControl sizeThatFits:self.frame.size].height;
     return segmentHeight + super.topInputFieldVerticalLayoutGuide + kSegmentInputMargin;
 }
 
-+ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value
-{
++ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value {
     NSParameterAssert(type);
     // Must be object type
     return type[0] == FLEXTypeEncodingObjcObject || type[0] == FLEXTypeEncodingObjcClass;
 }
 
-+ (FLEXArgInputObjectType)preferredDefaultTypeForObjCType:(const char *)type withCurrentValue:(id)value
-{
++ (FLEXArgInputObjectType)preferredDefaultTypeForObjCType:(const char *)type withCurrentValue:(id)value {
     NSParameterAssert(type[0] == FLEXTypeEncodingObjcObject || type[0] == FLEXTypeEncodingObjcClass);
 
     if (value) {

+ 4 - 8
Classes/Editing/ArgumentInputViews/FLEXArgumentInputStringView.m

@@ -11,8 +11,7 @@
 
 @implementation FLEXArgumentInputStringView
 
-- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding
-{
+- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding {
     self = [super initWithArgumentTypeEncoding:typeEncoding];
     if (self) {
         FLEXTypeEncoding type = typeEncoding[0];
@@ -31,8 +30,7 @@
     return self;
 }
 
-- (void)setInputValue:(id)inputValue
-{
+- (void)setInputValue:(id)inputValue {
     if ([inputValue isKindOfClass:[NSString class]]) {
         self.inputTextView.text = inputValue;
     } else if ([inputValue isKindOfClass:[NSValue class]]) {
@@ -54,8 +52,7 @@
     }
 }
 
-- (id)inputValue
-{
+- (id)inputValue {
     NSString *text = self.inputTextView.text;
     // Interpret empty string as nil. We loose the ability to set empty string as a string value,
     // but we accept that tradeoff in exchange for not having to type quotes for every string.
@@ -84,8 +81,7 @@
 
 // TODO: Support using object address for strings, as in the object arg view.
 
-+ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value
-{
++ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value {
     NSParameterAssert(type);
     unsigned long len = strlen(type);
 

+ 10 - 20
Classes/Editing/ArgumentInputViews/FLEXArgumentInputStructView.m

@@ -18,8 +18,7 @@
 
 @implementation FLEXArgumentInputStructView
 
-- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding
-{
+- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding {
     self = [super initWithArgumentTypeEncoding:typeEncoding];
     if (self) {
         NSMutableArray<FLEXArgumentInputView *> *inputViews = [NSMutableArray array];
@@ -52,16 +51,14 @@
 
 #pragma mark - Superclass Overrides
 
-- (void)setBackgroundColor:(UIColor *)backgroundColor
-{
+- (void)setBackgroundColor:(UIColor *)backgroundColor {
     [super setBackgroundColor:backgroundColor];
     for (FLEXArgumentInputView *inputView in self.argumentInputViews) {
         inputView.backgroundColor = backgroundColor;
     }
 }
 
-- (void)setInputValue:(id)inputValue
-{
+- (void)setInputValue:(id)inputValue {
     if ([inputValue isKindOfClass:[NSValue class]]) {
         const char *structTypeEncoding = [inputValue objCType];
         if (strcmp(self.typeEncoding.UTF8String, structTypeEncoding) == 0) {
@@ -96,8 +93,7 @@
     }
 }
 
-- (id)inputValue
-{
+- (id)inputValue {
     NSValue *boxedStruct = nil;
     const char *structTypeEncoding = self.typeEncoding.UTF8String;
     NSUInteger structSize = 0;
@@ -136,8 +132,7 @@
     return boxedStruct;
 }
 
-- (BOOL)inputViewIsFirstResponder
-{
+- (BOOL)inputViewIsFirstResponder {
     BOOL isFirstResponder = NO;
     for (FLEXArgumentInputView *inputView in self.argumentInputViews) {
         if ([inputView inputViewIsFirstResponder]) {
@@ -151,8 +146,7 @@
 
 #pragma mark - Layout and Sizing
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     [super layoutSubviews];
     
     CGFloat runningOriginY = self.topInputFieldVerticalLayoutGuide;
@@ -164,13 +158,11 @@
     }
 }
 
-+ (CGFloat)verticalPaddingBetweenFields
-{
++ (CGFloat)verticalPaddingBetweenFields {
     return 10.0;
 }
 
-- (CGSize)sizeThatFits:(CGSize)size
-{
+- (CGSize)sizeThatFits:(CGSize)size {
     CGSize fitSize = [super sizeThatFits:size];
     
     CGSize constrainSize = CGSizeMake(size.width, CGFLOAT_MAX);
@@ -187,8 +179,7 @@
 
 #pragma mark - Class Helpers
 
-+ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value
-{
++ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value {
     NSParameterAssert(type);
     if (type[0] == FLEXTypeEncodingStructBegin) {
         // We cannot support anything with bitfields or structs,
@@ -205,8 +196,7 @@
     return NO;
 }
 
-+ (NSArray<NSString *> *)customFieldTitlesForTypeEncoding:(const char *)typeEncoding
-{
++ (NSArray<NSString *> *)customFieldTitlesForTypeEncoding:(const char *)typeEncoding {
     NSArray<NSString *> *customTitles = nil;
     if (strcmp(typeEncoding, @encode(CGRect)) == 0) {
         customTitles = @[@"CGPoint origin", @"CGSize size"];

+ 7 - 14
Classes/Editing/ArgumentInputViews/FLEXArgumentInputSwitchView.m

@@ -16,8 +16,7 @@
 
 @implementation FLEXArgumentInputSwitchView
 
-- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding
-{
+- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding {
     self = [super initWithArgumentTypeEncoding:typeEncoding];
     if (self) {
         self.inputSwitch = [UISwitch new];
@@ -31,8 +30,7 @@
 
 #pragma mark Input/Output
 
-- (void)setInputValue:(id)inputValue
-{
+- (void)setInputValue:(id)inputValue {
     BOOL on = NO;
     if ([inputValue isKindOfClass:[NSNumber class]]) {
         NSNumber *number = (NSNumber *)inputValue;
@@ -46,30 +44,26 @@
     self.inputSwitch.on = on;
 }
 
-- (id)inputValue
-{
+- (id)inputValue {
     BOOL isOn = [self.inputSwitch isOn];
     NSValue *boxedBool = [NSValue value:&isOn withObjCType:@encode(BOOL)];
     return boxedBool;
 }
 
-- (void)switchValueDidChange:(id)sender
-{
+- (void)switchValueDidChange:(id)sender {
     [self.delegate argumentInputViewValueDidChange:self];
 }
 
 
 #pragma mark - Layout and Sizing
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     [super layoutSubviews];
     
     self.inputSwitch.frame = CGRectMake(0, self.topInputFieldVerticalLayoutGuide, self.inputSwitch.frame.size.width, self.inputSwitch.frame.size.height);
 }
 
-- (CGSize)sizeThatFits:(CGSize)size
-{
+- (CGSize)sizeThatFits:(CGSize)size {
     CGSize fitSize = [super sizeThatFits:size];
     fitSize.height += self.inputSwitch.frame.size.height;
     return fitSize;
@@ -78,8 +72,7 @@
 
 #pragma mark - Class Helpers
 
-+ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value
-{
++ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value {
     NSParameterAssert(type);
     // Only BOOLs. Current value is irrelevant.
     return strcmp(type, @encode(BOOL)) == 0;

+ 11 - 22
Classes/Editing/ArgumentInputViews/FLEXArgumentInputTextView.m

@@ -20,8 +20,7 @@
 
 @implementation FLEXArgumentInputTextView
 
-- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding
-{
+- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding {
     self = [super initWithArgumentTypeEncoding:typeEncoding];
     if (self) {
         self.inputTextView = [UITextView new];
@@ -54,8 +53,7 @@
 
 #pragma mark - Private
 
-- (UIToolbar *)createToolBar
-{
+- (UIToolbar *)createToolBar {
     UIToolbar *toolBar = [UIToolbar new];
     [toolBar sizeToFit];
     UIBarButtonItem *spaceItem = [[UIBarButtonItem alloc]
@@ -74,8 +72,7 @@
     return toolBar;
 }
 
-- (void)setInputPlaceholderText:(NSString *)placeholder
-{
+- (void)setInputPlaceholderText:(NSString *)placeholder {
     self.placeholderLabel.text = placeholder;
     if (placeholder.length) {
         if (!self.inputTextView.text.length) {
@@ -90,24 +87,21 @@
     [self setNeedsLayout];
 }
 
-- (NSString *)inputPlaceholderText
-{
+- (NSString *)inputPlaceholderText {
     return self.placeholderLabel.text;
 }
 
 
 #pragma mark - Superclass Overrides
 
-- (BOOL)inputViewIsFirstResponder
-{
+- (BOOL)inputViewIsFirstResponder {
     return self.inputTextView.isFirstResponder;
 }
 
 
 #pragma mark - Layout and Sizing
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     [super layoutSubviews];
     
     self.inputTextView.frame = CGRectMake(0, self.topInputFieldVerticalLayoutGuide, self.bounds.size.width, [self inputTextViewHeight]);
@@ -121,8 +115,7 @@
     );
 }
 
-- (NSUInteger)numberOfInputLines
-{
+- (NSUInteger)numberOfInputLines {
     switch (self.targetSize) {
         case FLEXArgumentInputViewSizeDefault:
             return 2;
@@ -133,13 +126,11 @@
     }
 }
 
-- (CGFloat)inputTextViewHeight
-{
+- (CGFloat)inputTextViewHeight {
     return ceil([[self class] inputFont].lineHeight * self.numberOfInputLines) + 16.0;
 }
 
-- (CGSize)sizeThatFits:(CGSize)size
-{
+- (CGSize)sizeThatFits:(CGSize)size {
     CGSize fitSize = [super sizeThatFits:size];
     fitSize.height += [self inputTextViewHeight];
     return fitSize;
@@ -148,16 +139,14 @@
 
 #pragma mark - Class Helpers
 
-+ (UIFont *)inputFont
-{
++ (UIFont *)inputFont {
     return [UIFont systemFontOfSize:14.0];
 }
 
 
 #pragma mark - UITextViewDelegate
 
-- (void)textViewDidChange:(UITextView *)textView
-{
+- (void)textViewDidChange:(UITextView *)textView {
     [self.delegate argumentInputViewValueDidChange:self];
     self.placeholderLabel.hidden = !(self.inputPlaceholderText.length && !textView.text.length);
 }

+ 12 - 24
Classes/Editing/ArgumentInputViews/FLEXArgumentInputView.m

@@ -19,8 +19,7 @@
 
 @implementation FLEXArgumentInputView
 
-- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding
-{
+- (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding {
     self = [super initWithFrame:CGRectZero];
     if (self) {
         self.typeEncoding = typeEncoding != NULL ? @(typeEncoding) : nil;
@@ -28,8 +27,7 @@
     return self;
 }
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     [super layoutSubviews];
     
     if (self.showsTitle) {
@@ -39,14 +37,12 @@
     }
 }
 
-- (void)setBackgroundColor:(UIColor *)backgroundColor
-{
+- (void)setBackgroundColor:(UIColor *)backgroundColor {
     [super setBackgroundColor:backgroundColor];
     self.titleLabel.backgroundColor = backgroundColor;
 }
 
-- (void)setTitle:(NSString *)title
-{
+- (void)setTitle:(NSString *)title {
     if (![_title isEqual:title]) {
         _title = title;
         self.titleLabel.text = title;
@@ -54,8 +50,7 @@
     }
 }
 
-- (UILabel *)titleLabel
-{
+- (UILabel *)titleLabel {
     if (!_titleLabel) {
         _titleLabel = [UILabel new];
         _titleLabel.font = [[self class] titleFont];
@@ -66,13 +61,11 @@
     return _titleLabel;
 }
 
-- (BOOL)showsTitle
-{
+- (BOOL)showsTitle {
     return self.title.length > 0;
 }
 
-- (CGFloat)topInputFieldVerticalLayoutGuide
-{
+- (CGFloat)topInputFieldVerticalLayoutGuide {
     CGFloat verticalLayoutGuide = 0;
     if (self.showsTitle) {
         CGFloat titleHeight = [self.titleLabel sizeThatFits:self.bounds.size].height;
@@ -84,34 +77,29 @@
 
 #pragma mark - Subclasses Can Override
 
-- (BOOL)inputViewIsFirstResponder
-{
+- (BOOL)inputViewIsFirstResponder {
     return NO;
 }
 
-+ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value
-{
++ (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value {
     return NO;
 }
 
 
 #pragma mark - Class Helpers
 
-+ (UIFont *)titleFont
-{
++ (UIFont *)titleFont {
     return [UIFont systemFontOfSize:12.0];
 }
 
-+ (CGFloat)titleBottomPadding
-{
++ (CGFloat)titleBottomPadding {
     return 4.0;
 }
 
 
 #pragma mark - Sizing
 
-- (CGSize)sizeThatFits:(CGSize)size
-{
+- (CGSize)sizeThatFits:(CGSize)size {
     CGFloat height = 0;
     
     if (self.title.length > 0) {

+ 4 - 8
Classes/Editing/ArgumentInputViews/FLEXArgumentInputViewFactory.m

@@ -21,13 +21,11 @@
 
 @implementation FLEXArgumentInputViewFactory
 
-+ (FLEXArgumentInputView *)argumentInputViewForTypeEncoding:(const char *)typeEncoding
-{
++ (FLEXArgumentInputView *)argumentInputViewForTypeEncoding:(const char *)typeEncoding {
     return [self argumentInputViewForTypeEncoding:typeEncoding currentValue:nil];
 }
 
-+ (FLEXArgumentInputView *)argumentInputViewForTypeEncoding:(const char *)typeEncoding currentValue:(id)currentValue
-{
++ (FLEXArgumentInputView *)argumentInputViewForTypeEncoding:(const char *)typeEncoding currentValue:(id)currentValue {
     Class subclass = [self argumentInputViewSubclassForTypeEncoding:typeEncoding currentValue:currentValue];
     if (!subclass) {
         // Fall back to a FLEXArgumentInputNotSupportedView if we can't find a subclass that fits the type encoding.
@@ -39,8 +37,7 @@
     return [[subclass alloc] initWithArgumentTypeEncoding:typeEncoding + fieldNameOffset];
 }
 
-+ (Class)argumentInputViewSubclassForTypeEncoding:(const char *)typeEncoding currentValue:(id)currentValue
-{
++ (Class)argumentInputViewSubclassForTypeEncoding:(const char *)typeEncoding currentValue:(id)currentValue {
     // Remove the field name if there is any (e.g. \"width\"d -> d)
     const NSUInteger fieldNameOffset = [FLEXRuntimeUtility fieldNameOffsetForTypeEncoding:typeEncoding];
     Class argumentInputViewSubclass = nil;
@@ -66,8 +63,7 @@
     return argumentInputViewSubclass;
 }
 
-+ (BOOL)canEditFieldWithTypeEncoding:(const char *)typeEncoding currentValue:(id)currentValue
-{
++ (BOOL)canEditFieldWithTypeEncoding:(const char *)typeEncoding currentValue:(id)currentValue {
     return [self argumentInputViewSubclassForTypeEncoding:typeEncoding currentValue:currentValue] != nil;
 }
 

+ 6 - 12
Classes/Editing/FLEXDefaultEditorViewController.m

@@ -21,8 +21,7 @@
 
 @implementation FLEXDefaultEditorViewController
 
-- (id)initWithDefaults:(NSUserDefaults *)defaults key:(NSString *)key
-{
+- (id)initWithDefaults:(NSUserDefaults *)defaults key:(NSString *)key {
     self = [super initWithTarget:defaults];
     if (self) {
         self.key = key;
@@ -31,13 +30,11 @@
     return self;
 }
 
-- (NSUserDefaults *)defaults
-{
+- (NSUserDefaults *)defaults {
     return [self.target isKindOfClass:[NSUserDefaults class]] ? self.target : nil;
 }
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
     
     self.fieldEditorView.fieldDescription = self.key;
@@ -52,8 +49,7 @@
     self.fieldEditorView.argumentInputViews = @[inputView];
 }
 
-- (void)actionButtonPressed:(id)sender
-{
+- (void)actionButtonPressed:(id)sender {
     [super actionButtonPressed:sender];
     
     id value = self.firstInputView.inputValue;
@@ -67,15 +63,13 @@
     self.firstInputView.inputValue = [self.defaults objectForKey:self.key];
 }
 
-- (void)getterButtonPressed:(id)sender
-{
+- (void)getterButtonPressed:(id)sender {
     [super getterButtonPressed:sender];
     id returnedObject = [self.defaults objectForKey:self.key];
     [self exploreObjectOrPopViewController:returnedObject];
 }
 
-+ (BOOL)canEditDefaultWithValue:(id)currentValue
-{
++ (BOOL)canEditDefaultWithValue:(id)currentValue {
     return [FLEXArgumentInputViewFactory
         canEditFieldWithTypeEncoding:FLEXEncodeObject(currentValue)
         currentValue:currentValue

+ 13 - 26
Classes/Editing/FLEXFieldEditorView.m

@@ -21,8 +21,7 @@
 
 @implementation FLEXFieldEditorView
 
-- (id)initWithFrame:(CGRect)frame
-{
+- (id)initWithFrame:(CGRect)frame {
     self = [super initWithFrame:frame];
     if (self) {
         self.targetDescriptionLabel = [UILabel new];
@@ -44,8 +43,7 @@
     return self;
 }
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     [super layoutSubviews];
     
     CGFloat horizontalPadding = [[self class] horizontalPadding];
@@ -78,15 +76,13 @@
     }
 }
 
-- (void)setBackgroundColor:(UIColor *)backgroundColor
-{
+- (void)setBackgroundColor:(UIColor *)backgroundColor {
     [super setBackgroundColor:backgroundColor];
     self.targetDescriptionLabel.backgroundColor = backgroundColor;
     self.fieldDescriptionLabel.backgroundColor = backgroundColor;
 }
 
-- (void)setTargetDescription:(NSString *)targetDescription
-{
+- (void)setTargetDescription:(NSString *)targetDescription {
     if (![_targetDescription isEqual:targetDescription]) {
         _targetDescription = targetDescription;
         self.targetDescriptionLabel.text = targetDescription;
@@ -94,8 +90,7 @@
     }
 }
 
-- (void)setFieldDescription:(NSString *)fieldDescription
-{
+- (void)setFieldDescription:(NSString *)fieldDescription {
     if (![_fieldDescription isEqual:fieldDescription]) {
         _fieldDescription = fieldDescription;
         self.fieldDescriptionLabel.text = fieldDescription;
@@ -103,8 +98,7 @@
     }
 }
 
-- (void)setArgumentInputViews:(NSArray<FLEXArgumentInputView *> *)argumentInputViews
-{
+- (void)setArgumentInputViews:(NSArray<FLEXArgumentInputView *> *)argumentInputViews {
     if (![_argumentInputViews isEqual:argumentInputViews]) {
         
         for (FLEXArgumentInputView *inputView in _argumentInputViews) {
@@ -121,40 +115,33 @@
     }
 }
 
-+ (UIView *)dividerView
-{
++ (UIView *)dividerView {
     UIView *dividerView = [UIView new];
     dividerView.backgroundColor = [self dividerColor];
     return dividerView;
 }
 
-+ (UIColor *)dividerColor
-{
++ (UIColor *)dividerColor {
     return UIColor.lightGrayColor;
 }
 
-+ (CGFloat)horizontalPadding
-{
++ (CGFloat)horizontalPadding {
     return 10.0;
 }
 
-+ (CGFloat)verticalPadding
-{
++ (CGFloat)verticalPadding {
     return 20.0;
 }
 
-+ (UIFont *)labelFont
-{
++ (UIFont *)labelFont {
     return [UIFont systemFontOfSize:14.0];
 }
 
-+ (CGFloat)dividerLineHeight
-{
++ (CGFloat)dividerLineHeight {
     return 1.0;
 }
 
-- (CGSize)sizeThatFits:(CGSize)size
-{
+- (CGSize)sizeThatFits:(CGSize)size {
     CGFloat horizontalPadding = [[self class] horizontalPadding];
     CGFloat verticalPadding = [[self class] verticalPadding];
     CGFloat dividerLineHeight = [[self class] dividerLineHeight];

+ 4 - 8
Classes/Editing/FLEXMethodCallingViewController.m

@@ -21,13 +21,11 @@
 
 @implementation FLEXMethodCallingViewController
 
-+ (instancetype)target:(id)target method:(FLEXMethod *)method
-{
++ (instancetype)target:(id)target method:(FLEXMethod *)method {
     return [[self alloc] initWithTarget:target method:method];
 }
 
-- (id)initWithTarget:(id)target method:(FLEXMethod *)method
-{
+- (id)initWithTarget:(id)target method:(FLEXMethod *)method {
     NSParameterAssert(method.isInstanceMethod == !object_isClass(target));
 
     self = [super initWithTarget:target];
@@ -39,8 +37,7 @@
     return self;
 }
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
 
     self.setterButton.title = @"Call";
@@ -73,8 +70,7 @@
     return argumentInputViews;
 }
 
-- (void)actionButtonPressed:(id)sender
-{
+- (void)actionButtonPressed:(id)sender {
     [super actionButtonPressed:sender];
 
     // Gather arguments

+ 10 - 20
Classes/Editing/FLEXVariableEditorViewController.m

@@ -25,13 +25,11 @@
 
 #pragma mark - Initialization
 
-+ (instancetype)target:(id)target
-{
++ (instancetype)target:(id)target {
     return [[self alloc] initWithTarget:target];
 }
 
-- (id)initWithTarget:(id)target
-{
+- (id)initWithTarget:(id)target {
     self = [super init];
     if (self) {
         self.target = target;
@@ -48,15 +46,13 @@
     return self;
 }
 
-- (void)dealloc
-{
+- (void)dealloc {
     [NSNotificationCenter.defaultCenter removeObserver:self];
 }
 
 #pragma mark - UIViewController methods
 
-- (void)keyboardDidShow:(NSNotification *)notification
-{
+- (void)keyboardDidShow:(NSNotification *)notification {
     CGRect keyboardRectInWindow = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
     CGSize keyboardSize = [self.view convertRect:keyboardRectInWindow fromView:nil].size;
     UIEdgeInsets scrollInsets = self.scrollView.contentInset;
@@ -74,16 +70,14 @@
     }
 }
 
-- (void)keyboardWillHide:(NSNotification *)notification
-{
+- (void)keyboardWillHide:(NSNotification *)notification {
     UIEdgeInsets scrollInsets = self.scrollView.contentInset;
     scrollInsets.bottom = 0.0;
     self.scrollView.contentInset = scrollInsets;
     self.scrollView.scrollIndicatorInsets = scrollInsets;
 }
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
     
     self.view.backgroundColor = FLEXColor.scrollViewBackgroundColor;
@@ -107,8 +101,7 @@
     self.navigationItem.rightBarButtonItem = self.setterButton;
 }
 
-- (void)viewWillLayoutSubviews
-{
+- (void)viewWillLayoutSubviews {
     CGSize constrainSize = CGSizeMake(self.scrollView.bounds.size.width, CGFLOAT_MAX);
     CGSize fieldEditorSize = [self.fieldEditorView sizeThatFits:constrainSize];
     self.fieldEditorView.frame = CGRectMake(0, 0, fieldEditorSize.width, fieldEditorSize.height);
@@ -117,19 +110,16 @@
 
 #pragma mark - Public
 
-- (FLEXArgumentInputView *)firstInputView
-{
+- (FLEXArgumentInputView *)firstInputView {
     return [self.fieldEditorView argumentInputViews].firstObject;
 }
 
-- (void)actionButtonPressed:(id)sender
-{
+- (void)actionButtonPressed:(id)sender {
     // Subclasses can override
     [self.fieldEditorView endEditing:YES];
 }
 
-- (void)exploreObjectOrPopViewController:(id)objectOrNil
-{
+- (void)exploreObjectOrPopViewController:(id)objectOrNil {
     if (objectOrNil) {
         // For non-nil (or void) return types, push an explorer view controller to display the object
         FLEXObjectExplorerViewController *explorerViewController = [FLEXObjectExplorerFactory explorerViewControllerForObject:objectOrNil];

+ 153 - 155
Classes/ExplorerInterface/FLEXExplorerViewController.m

@@ -71,8 +71,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 
 @implementation FLEXExplorerViewController
 
-- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
-{
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
     self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
     if (self) {
         self.observedViews = [NSMutableSet set];
@@ -80,15 +79,13 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return self;
 }
 
-- (void)dealloc
-{
+- (void)dealloc {
     for (UIView *view in _observedViews) {
         [self stopObservingView:view];
     }
 }
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
 
     // Toolbar
@@ -99,15 +96,23 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     CGFloat toolbarOriginY = toolbarOriginYDefault ? [toolbarOriginYDefault doubleValue] : 100;
 
     CGRect safeArea = [self viewSafeArea];
-    CGSize toolbarSize = [self.explorerToolbar sizeThatFits:CGSizeMake(CGRectGetWidth(self.view.bounds), CGRectGetHeight(safeArea))];
-    [self updateToolbarPositionWithUnconstrainedFrame:CGRectMake(CGRectGetMinX(safeArea), toolbarOriginY, toolbarSize.width, toolbarSize.height)];
-    self.explorerToolbar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin;
+    CGSize toolbarSize = [self.explorerToolbar sizeThatFits:CGSizeMake(
+        CGRectGetWidth(self.view.bounds), CGRectGetHeight(safeArea)
+    )];
+    [self updateToolbarPositionWithUnconstrainedFrame:CGRectMake(
+        CGRectGetMinX(safeArea), toolbarOriginY, toolbarSize.width, toolbarSize.height
+    )];
+    self.explorerToolbar.autoresizingMask = UIViewAutoresizingFlexibleWidth |
+                                            UIViewAutoresizingFlexibleBottomMargin |
+                                            UIViewAutoresizingFlexibleTopMargin;
     [self.view addSubview:self.explorerToolbar];
     [self setupToolbarActions];
     [self setupToolbarGestures];
     
     // View selection
-    UITapGestureRecognizer *selectionTapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSelectionTap:)];
+    UITapGestureRecognizer *selectionTapGR = [[UITapGestureRecognizer alloc]
+        initWithTarget:self action:@selector(handleSelectionTap:)
+    ];
     [self.view addGestureRecognizer:selectionTapGR];
     
     // View moving
@@ -116,8 +121,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     [self.view addGestureRecognizer:self.movePanGR];
 }
 
-- (void)viewWillAppear:(BOOL)animated
-{
+- (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
     
     [self updateButtonStates];
@@ -126,11 +130,12 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 
 #pragma mark - Rotation
 
-- (UIViewController *)viewControllerForRotationAndOrientation
-{
+- (UIViewController *)viewControllerForRotationAndOrientation {
     UIViewController *viewController = FLEXUtility.appKeyWindow.rootViewController;
     // Obfuscating selector _viewControllerForSupportedInterfaceOrientations
-    NSString *viewControllerSelectorString = [@[@"_vie", @"wContro", @"llerFor", @"Supported", @"Interface", @"Orientations"] componentsJoinedByString:@""];
+    NSString *viewControllerSelectorString = [@[
+        @"_vie", @"wContro", @"llerFor", @"Supported", @"Interface", @"Orientations"
+    ] componentsJoinedByString:@""];
     SEL viewControllerSelector = NSSelectorFromString(viewControllerSelectorString);
     if ([viewController respondsToSelector:viewControllerSelector]) {
         viewController = [viewController valueForKey:viewControllerSelectorString];
@@ -139,8 +144,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return viewController;
 }
 
-- (UIInterfaceOrientationMask)supportedInterfaceOrientations
-{
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
     UIViewController *viewControllerToAsk = [self viewControllerForRotationAndOrientation];
     UIInterfaceOrientationMask supportedOrientations = [FLEXUtility infoPlistSupportedInterfaceOrientationsMask];
     if (viewControllerToAsk && ![viewControllerToAsk isKindOfClass:[self class]]) {
@@ -157,8 +161,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return supportedOrientations;
 }
 
-- (BOOL)shouldAutorotate
-{
+- (BOOL)shouldAutorotate {
     UIViewController *viewControllerToAsk = [self viewControllerForRotationAndOrientation];
     BOOL shouldAutorotate = YES;
     if (viewControllerToAsk && viewControllerToAsk != self) {
@@ -167,8 +170,8 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return shouldAutorotate;
 }
 
-- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
-{
+- (void)viewWillTransitionToSize:(CGSize)size
+       withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
     [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
     [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
         for (UIView *outlineView in self.outlineViewsForVisibleViews.allValues) {
@@ -195,8 +198,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 
 #pragma mark - Setter Overrides
 
-- (void)setSelectedView:(UIView *)selectedView
-{
+- (void)setSelectedView:(UIView *)selectedView {
     if (![_selectedView isEqual:selectedView]) {
         if (![self.viewsAtTapPoint containsObject:_selectedView]) {
             [self stopObservingView:_selectedView];
@@ -207,8 +209,12 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
         [self beginObservingView:selectedView];
 
         // Update the toolbar and selected overlay
-        self.explorerToolbar.selectedViewDescription = [FLEXUtility descriptionForView:selectedView includingFrame:YES];
-        self.explorerToolbar.selectedViewOverlayColor = [FLEXUtility consistentRandomColorForObject:selectedView];
+        self.explorerToolbar.selectedViewDescription = [FLEXUtility
+            descriptionForView:selectedView includingFrame:YES
+        ];
+        self.explorerToolbar.selectedViewOverlayColor = [FLEXUtility
+            consistentRandomColorForObject:selectedView
+        ];
 
         if (selectedView) {
             if (!self.selectedViewOverlay) {
@@ -221,7 +227,8 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
             self.selectedViewOverlay.layer.borderColor = outlineColor.CGColor;
             self.selectedViewOverlay.frame = [self.view convertRect:selectedView.bounds fromView:selectedView];
             
-            // Make sure the selected overlay is in front of all the other subviews except the toolbar, which should always stay on top.
+            // Make sure the selected overlay is in front of all the other subviews
+            // except the toolbar, which should always stay on top.
             [self.view bringSubviewToFront:self.selectedViewOverlay];
             [self.view bringSubviewToFront:self.explorerToolbar];
         } else {
@@ -234,8 +241,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     }
 }
 
-- (void)setViewsAtTapPoint:(NSArray<UIView *> *)viewsAtTapPoint
-{
+- (void)setViewsAtTapPoint:(NSArray<UIView *> *)viewsAtTapPoint {
     if (![_viewsAtTapPoint isEqual:viewsAtTapPoint]) {
         for (UIView *view in _viewsAtTapPoint) {
             if (view != self.selectedView) {
@@ -251,8 +257,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     }
 }
 
-- (void)setCurrentMode:(FLEXExplorerMode)currentMode
-{
+- (void)setCurrentMode:(FLEXExplorerMode)currentMode {
     if (_currentMode != currentMode) {
         _currentMode = currentMode;
         switch (currentMode) {
@@ -271,7 +276,8 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
                 break;
                 
             case FLEXExplorerModeMove:
-                // Hide all the outline views to focus on the selected view, which is the only one that will move.
+                // Hide all the outline views to focus on the selected view,
+                // which is the only one that will move.
                 for (NSValue *key in self.outlineViewsForVisibleViews) {
                     UIView *outlineView = self.outlineViewsForVisibleViews[key];
                     outlineView.hidden = YES;
@@ -286,8 +292,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 
 #pragma mark - View Tracking
 
-- (void)beginObservingView:(UIView *)view
-{
+- (void)beginObservingView:(UIView *)view {
     // Bail if we're already observing this view or if there's nothing to observe.
     if (!view || [self.observedViews containsObject:view]) {
         return;
@@ -300,8 +305,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     [self.observedViews addObject:view];
 }
 
-- (void)stopObservingView:(UIView *)view
-{
+- (void)stopObservingView:(UIView *)view {
     if (!view) {
         return;
     }
@@ -313,8 +317,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     [self.observedViews removeObject:view];
 }
 
-- (NSArray<NSString *> *)viewKeyPathsToTrack
-{
+- (NSArray<NSString *> *)viewKeyPathsToTrack {
     static NSArray<NSString *> *trackedViewKeyPaths = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
@@ -324,13 +327,13 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return trackedViewKeyPaths;
 }
 
-- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *, id> *)change context:(void *)context
-{
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
+                        change:(NSDictionary<NSString *, id> *)change
+                       context:(void *)context {
     [self updateOverlayAndDescriptionForObjectIfNeeded:object];
 }
 
-- (void)updateOverlayAndDescriptionForObjectIfNeeded:(id)object
-{
+- (void)updateOverlayAndDescriptionForObjectIfNeeded:(id)object {
     NSUInteger indexOfView = [self.viewsAtTapPoint indexOfObject:object];
     if (indexOfView != NSNotFound) {
         UIView *view = self.viewsAtTapPoint[indexOfView];
@@ -342,66 +345,66 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     }
     if (object == self.selectedView) {
         // Update the selected view description since we show the frame value there.
-        self.explorerToolbar.selectedViewDescription = [FLEXUtility descriptionForView:self.selectedView includingFrame:YES];
+        self.explorerToolbar.selectedViewDescription = [FLEXUtility
+            descriptionForView:self.selectedView includingFrame:YES
+        ];
         CGRect selectedViewOutlineFrame = [self frameInLocalCoordinatesForView:self.selectedView];
         self.selectedViewOverlay.frame = selectedViewOutlineFrame;
     }
 }
 
-- (CGRect)frameInLocalCoordinatesForView:(UIView *)view
-{
-    // First convert to window coordinates since the view may be in a different window than our view.
+- (CGRect)frameInLocalCoordinatesForView:(UIView *)view {
+    // Convert to window coordinates since the view may be in a different window than our view
     CGRect frameInWindow = [view convertRect:view.bounds toView:nil];
-    // Then convert from the window to our view's coordinate space.
+    // Convert from the window to our view's coordinate space
     return [self.view convertRect:frameInWindow fromView:nil];
 }
 
 
 #pragma mark - Toolbar Buttons
 
-- (void)setupToolbarActions
-{
-    [self.explorerToolbar.selectItem addTarget:self action:@selector(selectButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-    [self.explorerToolbar.hierarchyItem addTarget:self action:@selector(hierarchyButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-    [self.explorerToolbar.moveItem addTarget:self action:@selector(moveButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-    [self.explorerToolbar.globalsItem addTarget:self action:@selector(globalsButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-    [self.explorerToolbar.closeItem addTarget:self action:@selector(closeButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
+- (void)setupToolbarActions {
+    FLEXExplorerToolbar *toolbar = self.explorerToolbar;
+    NSDictionary<NSString *, FLEXToolbarItem *> *actionsToItems = @{
+        NSStringFromSelector(@selector(selectButtonTapped:)):        toolbar.selectItem,
+        NSStringFromSelector(@selector(hierarchyButtonTapped:)):     toolbar.hierarchyItem,
+        NSStringFromSelector(@selector(moveButtonTapped:)):          toolbar.moveItem,
+        NSStringFromSelector(@selector(globalsButtonTapped:)):       toolbar.globalsItem,
+        NSStringFromSelector(@selector(closeButtonTapped:)):         toolbar.closeItem,
+    };
+    
+    [actionsToItems enumerateKeysAndObjectsUsingBlock:^(NSString *sel, FLEXToolbarItem *item, BOOL *stop) {
+        [item addTarget:self action:NSSelectorFromString(sel) forControlEvents:UIControlEventTouchUpInside];
+    }];
 }
 
-- (void)selectButtonTapped:(FLEXToolbarItem *)sender
-{
+- (void)selectButtonTapped:(FLEXToolbarItem *)sender {
     [self toggleSelectTool];
 }
 
-- (void)hierarchyButtonTapped:(FLEXToolbarItem *)sender
-{
+- (void)hierarchyButtonTapped:(FLEXToolbarItem *)sender {
     [self toggleViewsTool];
 }
 
-- (UIWindow *)statusWindow
-{
+- (UIWindow *)statusWindow {
     NSString *statusBarString = [NSString stringWithFormat:@"%@arWindow", @"_statusB"];
     return [UIApplication.sharedApplication valueForKey:statusBarString];
 }
 
-- (void)moveButtonTapped:(FLEXToolbarItem *)sender
-{
+- (void)moveButtonTapped:(FLEXToolbarItem *)sender {
     [self toggleMoveTool];
 }
 
-- (void)globalsButtonTapped:(FLEXToolbarItem *)sender
-{
+- (void)globalsButtonTapped:(FLEXToolbarItem *)sender {
     [self toggleMenuTool];
 }
 
-- (void)closeButtonTapped:(FLEXToolbarItem *)sender
-{
+- (void)closeButtonTapped:(FLEXToolbarItem *)sender {
     self.currentMode = FLEXExplorerModeDefault;
     [self.delegate explorerViewControllerDidFinish:self];
 }
 
-- (void)updateButtonStates
-{
+- (void)updateButtonStates {
     // Move and details only active when an object is selected.
     BOOL hasSelectedObject = self.selectedView != nil;
     self.explorerToolbar.moveItem.enabled = hasSelectedObject;
@@ -412,23 +415,27 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 
 #pragma mark - Toolbar Dragging
 
-- (void)setupToolbarGestures
-{
+- (void)setupToolbarGestures {
     // Pan gesture for dragging.
-    UIPanGestureRecognizer *panGR = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleToolbarPanGesture:)];
+    UIPanGestureRecognizer *panGR = [[UIPanGestureRecognizer alloc]
+        initWithTarget:self action:@selector(handleToolbarPanGesture:)
+    ];
     [self.explorerToolbar.dragHandle addGestureRecognizer:panGR];
     
     // Tap gesture for hinting.
-    UITapGestureRecognizer *hintTapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleToolbarHintTapGesture:)];
+    UITapGestureRecognizer *hintTapGR = [[UITapGestureRecognizer alloc]
+        initWithTarget:self action:@selector(handleToolbarHintTapGesture:)
+    ];
     [self.explorerToolbar.dragHandle addGestureRecognizer:hintTapGR];
     
     // Tap gesture for showing additional details
-    self.detailsTapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleToolbarDetailsTapGesture:)];
+    self.detailsTapGR = [[UITapGestureRecognizer alloc]
+        initWithTarget:self action:@selector(handleToolbarDetailsTapGesture:)
+    ];
     [self.explorerToolbar.selectedViewDescriptionContainer addGestureRecognizer:self.detailsTapGR];
 }
 
-- (void)handleToolbarPanGesture:(UIPanGestureRecognizer *)panGR
-{
+- (void)handleToolbarPanGesture:(UIPanGestureRecognizer *)panGR {
     switch (panGR.state) {
         case UIGestureRecognizerStateBegan:
             self.toolbarFrameBeforeDragging = self.explorerToolbar.frame;
@@ -445,8 +452,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     }
 }
 
-- (void)updateToolbarPositionWithDragGesture:(UIPanGestureRecognizer *)panGR
-{
+- (void)updateToolbarPositionWithDragGesture:(UIPanGestureRecognizer *)panGR {
     CGPoint translation = [panGR translationInView:self.view];
     CGRect newToolbarFrame = self.toolbarFrameBeforeDragging;
     newToolbarFrame.origin.y += translation.y;
@@ -454,10 +460,10 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     [self updateToolbarPositionWithUnconstrainedFrame:newToolbarFrame];
 }
 
-- (void)updateToolbarPositionWithUnconstrainedFrame:(CGRect)unconstrainedFrame
-{
+- (void)updateToolbarPositionWithUnconstrainedFrame:(CGRect)unconstrainedFrame {
     CGRect safeArea = [self viewSafeArea];
-    // We only constrain the Y-axis because We want the toolbar to handle the X-axis safeArea layout by itself
+    // We only constrain the Y-axis because we want the toolbar
+    // to handle the X-axis safeArea layout by itself
     CGFloat minY = CGRectGetMinY(safeArea);
     CGFloat maxY = CGRectGetMaxY(safeArea) - unconstrainedFrame.size.height;
     if (unconstrainedFrame.origin.y < minY) {
@@ -468,11 +474,12 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 
     self.explorerToolbar.frame = unconstrainedFrame;
 
-    [[NSUserDefaults standardUserDefaults] setDouble:unconstrainedFrame.origin.y forKey:kFLEXToolbarTopMarginDefaultsKey];
+    [NSUserDefaults.standardUserDefaults
+        setDouble:unconstrainedFrame.origin.y forKey:kFLEXToolbarTopMarginDefaultsKey
+    ];
 }
 
-- (void)handleToolbarHintTapGesture:(UITapGestureRecognizer *)tapGR
-{
+- (void)handleToolbarHintTapGesture:(UITapGestureRecognizer *)tapGR {
     // Bounce the toolbar to indicate that it is draggable.
     // TODO: make it bouncier.
     if (tapGR.state == UIGestureRecognizerStateRecognized) {
@@ -491,23 +498,23 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     }
 }
 
-- (void)handleToolbarDetailsTapGesture:(UITapGestureRecognizer *)tapGR
-{
+- (void)handleToolbarDetailsTapGesture:(UITapGestureRecognizer *)tapGR {
     if (tapGR.state == UIGestureRecognizerStateRecognized && self.selectedView) {
         UIViewController *topStackVC = [FLEXObjectExplorerFactory explorerViewControllerForObject:self.selectedView];
-        UINavigationController *navigationController = [[FLEXNavigationController alloc] initWithRootViewController:topStackVC];
-        [self makeKeyAndPresentViewController:navigationController animated:YES completion:nil];
+        [self makeKeyAndPresentViewController:
+            [FLEXNavigationController withRootViewController:topStackVC]
+        animated:YES completion:nil];
     }
 }
 
 
 #pragma mark - View Selection
 
-- (void)handleSelectionTap:(UITapGestureRecognizer *)tapGR
-{
+- (void)handleSelectionTap:(UITapGestureRecognizer *)tapGR {
     // Only if we're in selection mode
     if (self.currentMode == FLEXExplorerModeSelect && tapGR.state == UIGestureRecognizerStateRecognized) {
-        // Note that [tapGR locationInView:nil] is broken in iOS 8, so we have to do a two step conversion to window coordinates.
+        // Note that [tapGR locationInView:nil] is broken in iOS 8,
+        // so we have to do a two step conversion to window coordinates.
         // Thanks to @lascorbe for finding this: https://github.com/Flipboard/FLEX/pull/31
         CGPoint tapPointInView = [tapGR locationInView:self.view];
         CGPoint tapPointInWindow = [self.view convertPoint:tapPointInView toView:nil];
@@ -515,8 +522,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     }
 }
 
-- (void)updateOutlineViewsForSelectionPoint:(CGPoint)selectionPointInWindow
-{
+- (void)updateOutlineViewsForSelectionPoint:(CGPoint)selectionPointInWindow {
     [self removeAndClearOutlineViews];
     
     // Include hidden views in the "viewsAtTapPoint" array so we can show them in the hierarchy list.
@@ -525,7 +531,7 @@ 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<UIView *> *visibleViewsAtTapPoint = [self viewsAtPoint:selectionPointInWindow skipHiddenViews:YES];
-    NSMutableDictionary<NSValue *, UIView *> *newOutlineViewsForVisibleViews = [NSMutableDictionary dictionary];
+    NSMutableDictionary<NSValue *, UIView *> *newOutlineViewsForVisibleViews = [NSMutableDictionary new];
     for (UIView *view in visibleViewsAtTapPoint) {
         UIView *outlineView = [self outlineViewForView:view];
         [self.view addSubview:outlineView];
@@ -541,8 +547,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     [self updateButtonStates];
 }
 
-- (UIView *)outlineViewForView:(UIView *)view
-{
+- (UIView *)outlineViewForView:(UIView *)view {
     CGRect outlineFrame = [self frameInLocalCoordinatesForView:view];
     UIView *outlineView = [[UIView alloc] initWithFrame:outlineFrame];
     outlineView.backgroundColor = UIColor.clearColor;
@@ -551,8 +556,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return outlineView;
 }
 
-- (void)removeAndClearOutlineViews
-{
+- (void)removeAndClearOutlineViews {
     for (NSValue *key in self.outlineViewsForVisibleViews) {
         UIView *outlineView = self.outlineViewsForVisibleViews[key];
         [outlineView removeFromSuperview];
@@ -560,22 +564,23 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     self.outlineViewsForVisibleViews = nil;
 }
 
-- (NSArray<UIView *> *)viewsAtPoint:(CGPoint)tapPointInWindow skipHiddenViews:(BOOL)skipHidden
-{
+- (NSArray<UIView *> *)viewsAtPoint:(CGPoint)tapPointInWindow skipHiddenViews:(BOOL)skipHidden {
     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]) {
             [views addObject:window];
-            [views addObjectsFromArray:[self recursiveSubviewsAtPoint:tapPointInWindow inView:window skipHiddenViews:skipHidden]];
+            [views addObjectsFromArray:[self
+                recursiveSubviewsAtPoint:tapPointInWindow inView:window skipHiddenViews:skipHidden
+            ]];
         }
     }
     return views;
 }
 
-- (UIView *)viewForSelectionAtPoint:(CGPoint)tapPointInWindow
-{
-    // Select in the window that would handle the touch, but don't just use the result of hitTest:withEvent: so we can still select views with interaction disabled.
+- (UIView *)viewForSelectionAtPoint:(CGPoint)tapPointInWindow {
+    // Select in the window that would handle the touch, but don't just use the result of
+    // hitTest:withEvent: so we can still select views with interaction disabled.
     // Default to the the application's key window if none of the windows want the touch.
     UIWindow *windowForSelection = [UIApplication.sharedApplication keyWindow];
     for (UIWindow *window in [FLEXUtility allWindows].reverseObjectEnumerator) {
@@ -592,8 +597,9 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return [self recursiveSubviewsAtPoint:tapPointInWindow inView:windowForSelection skipHiddenViews:YES].lastObject;
 }
 
-- (NSArray<UIView *> *)recursiveSubviewsAtPoint:(CGPoint)pointInView inView:(UIView *)view skipHiddenViews:(BOOL)skipHidden
-{
+- (NSArray<UIView *> *)recursiveSubviewsAtPoint:(CGPoint)pointInView
+                                         inView:(UIView *)view
+                                skipHiddenViews:(BOOL)skipHidden {
     NSMutableArray<UIView *> *subviewsAtPoint = [NSMutableArray array];
     for (UIView *subview in view.subviews) {
         BOOL isHidden = subview.hidden || subview.alpha < 0.01;
@@ -606,11 +612,13 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
             [subviewsAtPoint addObject:subview];
         }
         
-        // If this view doesn't clip to its bounds, we need to check its subviews even if it doesn't contain the selection point.
-        // They may be visible and contain the selection point.
+        // If this view doesn't clip to its bounds, we need to check its subviews even if it
+        // doesn't contain the selection point. They may be visible and contain the selection point.
         if (subviewContainsPoint || !subview.clipsToBounds) {
             CGPoint pointInSubview = [view convertPoint:pointInView toView:subview];
-            [subviewsAtPoint addObjectsFromArray:[self recursiveSubviewsAtPoint:pointInSubview inView:subview skipHiddenViews:skipHidden]];
+            [subviewsAtPoint addObjectsFromArray:[self
+                recursiveSubviewsAtPoint:pointInSubview inView:subview skipHiddenViews:skipHidden
+            ]];
         }
     }
     return subviewsAtPoint;
@@ -619,8 +627,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 
 #pragma mark - Selected View Moving
 
-- (void)handleMovePan:(UIPanGestureRecognizer *)movePanGR
-{
+- (void)handleMovePan:(UIPanGestureRecognizer *)movePanGR {
     switch (movePanGR.state) {
         case UIGestureRecognizerStateBegan:
             self.selectedViewFrameBeforeDragging = self.selectedView.frame;
@@ -637,8 +644,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     }
 }
 
-- (void)updateSelectedViewPositionWithDragGesture:(UIPanGestureRecognizer *)movePanGR
-{
+- (void)updateSelectedViewPositionWithDragGesture:(UIPanGestureRecognizer *)movePanGR {
     CGPoint translation = [movePanGR translationInView:self.selectedView.superview];
     CGRect newSelectedViewFrame = self.selectedViewFrameBeforeDragging;
     newSelectedViewFrame.origin.x = FLEXFloor(newSelectedViewFrame.origin.x + translation.x);
@@ -649,8 +655,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 
 #pragma mark - Safe Area Handling
 
-- (CGRect)viewSafeArea
-{
+- (CGRect)viewSafeArea {
     CGRect safeArea = self.view.bounds;
     if (@available(iOS 11.0, *)) {
         safeArea = UIEdgeInsetsInsetRect(self.view.bounds, self.view.safeAreaInsets);
@@ -659,22 +664,27 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return safeArea;
 }
 
-- (void)viewSafeAreaInsetsDidChange
-{
+- (void)viewSafeAreaInsetsDidChange {
     if (@available(iOS 11.0, *)) {
         [super viewSafeAreaInsetsDidChange];
 
         CGRect safeArea = [self viewSafeArea];
-        CGSize toolbarSize = [self.explorerToolbar sizeThatFits:CGSizeMake(CGRectGetWidth(self.view.bounds), CGRectGetHeight(safeArea))];
-        [self updateToolbarPositionWithUnconstrainedFrame:CGRectMake(CGRectGetMinX(self.explorerToolbar.frame), CGRectGetMinY(self.explorerToolbar.frame), toolbarSize.width, toolbarSize.height)];
+        CGSize toolbarSize = [self.explorerToolbar sizeThatFits:CGSizeMake(
+            CGRectGetWidth(self.view.bounds), CGRectGetHeight(safeArea)
+        )];
+        [self updateToolbarPositionWithUnconstrainedFrame:CGRectMake(
+            CGRectGetMinX(self.explorerToolbar.frame),
+            CGRectGetMinY(self.explorerToolbar.frame),
+            toolbarSize.width,
+            toolbarSize.height)
+        ];
     }
 }
 
 
 #pragma mark - Touch Handling
 
-- (BOOL)shouldReceiveTouchAtWindowPoint:(CGPoint)pointInWindowCoordinates
-{
+- (BOOL)shouldReceiveTouchAtWindowPoint:(CGPoint)pointInWindowCoordinates {
     BOOL shouldReceiveTouch = NO;
     
     CGPoint pointInLocalCoordinates = [self.view convertPoint:pointInWindowCoordinates fromView:nil];
@@ -705,10 +715,9 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 
 #pragma mark - FLEXHierarchyDelegate
 
-- (void)viewHierarchyDidDismiss:(UIView *)selectedView
-{
-    // Note that we need to wait until the view controller is dismissed to calculated the frame of the outline view.
-    // Otherwise the coordinate conversion doesn't give the correct result.
+- (void)viewHierarchyDidDismiss:(UIView *)selectedView {
+    // Note that we need to wait until the view controller is dismissed to calculate the frame
+    // of the outline view, otherwise the coordinate conversion doesn't give the correct result.
     [self toggleViewsToolWithCompletion:^{
         // If the selected view is outside of the tap point array (selected from "Full Hierarchy"),
         // then clear out the tap point array and remove all the outline views.
@@ -730,24 +739,20 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 
 #pragma mark - Modal Dismissal
 
-- (void)presentationControllerDidDismiss:(UIPresentationController *)presentationController
-{
+- (void)presentationControllerDidDismiss:(UIPresentationController *)presentationController {
     [self presentedViewControllerDidDismiss];
 }
 
-- (void)presentedViewControllerDidDismiss
-{
+- (void)presentedViewControllerDidDismiss {
     [self resignKeyAndDismissViewControllerAnimated:YES completion:nil];
 }
 
 
 #pragma mark - Modal Presentation and Window Management
 
-- (void)makeKeyAndPresentViewController:(UINavigationController *)toPresent animated:(BOOL)animated completion:(void (^)(void))completion
-{
-    // Save the current key window so we can restore it following dismissal.
-    self.previousKeyWindow = UIApplication.sharedApplication.keyWindow;
-
+- (void)makeKeyAndPresentViewController:(UINavigationController *)toPresent
+                               animated:(BOOL)animated
+                             completion:(void (^)(void))completion {
     // Make our window key to correctly handle input.
     [self.view.window makeKeyWindow];
 
@@ -786,7 +791,8 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     [self presentViewController:toPresent animated:animated completion:completion];
 }
 
-- (void)resignKeyAndDismissViewControllerAnimated:(BOOL)animated completion:(void (^)(void))completion
+- (void)resignKeyAndDismissViewControllerAnimated:(BOOL)animated
+                                       completion:(void (^)(void))completion
 {
     UIWindow *appWindow = self.window.previousKeyWindow;
     [appWindow makeKeyWindow];
@@ -799,7 +805,8 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     self.appMenuItems = nil;
     
     // Restore the status bar window's normal window level.
-    // We want it above FLEX while a modal is presented for scroll to top, but below FLEX otherwise for exploration.
+    // We want it above FLEX while a modal is presented for
+    // scroll to top, but below FLEX otherwise for exploration.
     [self statusWindow].windowLevel = UIWindowLevelStatusBar;
     
     [self dismissViewControllerAnimated:animated completion:completion];
@@ -810,8 +817,8 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return self.window.previousKeyWindow != nil;
 }
 
-- (void)toggleToolWithViewControllerProvider:(UINavigationController *(^)(void))future completion:(void(^)(void))completion
-{
+- (void)toggleToolWithViewControllerProvider:(UINavigationController *(^)(void))future
+                                  completion:(void(^)(void))completion {
     if (self.presentedViewController) {
         [self resignKeyAndDismissViewControllerAnimated:YES completion:completion];
     } else if (future) {
@@ -826,8 +833,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 
 #pragma mark - Keyboard Shortcut Helpers
 
-- (void)toggleSelectTool
-{
+- (void)toggleSelectTool {
     if (self.currentMode == FLEXExplorerModeSelect) {
         self.currentMode = FLEXExplorerModeDefault;
     } else {
@@ -835,8 +841,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     }
 }
 
-- (void)toggleMoveTool
-{
+- (void)toggleMoveTool {
     if (self.currentMode == FLEXExplorerModeMove) {
         self.currentMode = FLEXExplorerModeDefault;
     } else {
@@ -844,13 +849,11 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     }
 }
 
-- (void)toggleViewsTool
-{
+- (void)toggleViewsTool {
     [self toggleViewsToolWithCompletion:nil];
 }
 
-- (void)toggleViewsToolWithCompletion:(void(^)(void))completion
-{
+- (void)toggleViewsToolWithCompletion:(void(^)(void))completion {
     [self toggleToolWithViewControllerProvider:^UINavigationController *{
         if (self.selectedView) {
             return [FLEXHierarchyViewController
@@ -868,15 +871,13 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     }];
 }
 
-- (void)toggleMenuTool
-{
+- (void)toggleMenuTool {
     [self toggleToolWithViewControllerProvider:^UINavigationController *{
-        return [[FLEXNavigationController alloc] initWithRootViewController:[FLEXGlobalsViewController new]];
+        return [FLEXNavigationController withRootViewController:[FLEXGlobalsViewController new]];
     } completion:nil];
 }
 
-- (BOOL)handleDownArrowKeyPressed
-{
+- (BOOL)handleDownArrowKeyPressed {
     if (self.currentMode == FLEXExplorerModeMove) {
         CGRect frame = self.selectedView.frame;
         frame.origin.y += 1.0 / UIScreen.mainScreen.scale;
@@ -893,8 +894,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return YES;
 }
 
-- (BOOL)handleUpArrowKeyPressed
-{
+- (BOOL)handleUpArrowKeyPressed {
     if (self.currentMode == FLEXExplorerModeMove) {
         CGRect frame = self.selectedView.frame;
         frame.origin.y -= 1.0 / UIScreen.mainScreen.scale;
@@ -911,8 +911,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return YES;
 }
 
-- (BOOL)handleRightArrowKeyPressed
-{
+- (BOOL)handleRightArrowKeyPressed {
     if (self.currentMode == FLEXExplorerModeMove) {
         CGRect frame = self.selectedView.frame;
         frame.origin.x += 1.0 / UIScreen.mainScreen.scale;
@@ -923,8 +922,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return NO;
 }
 
-- (BOOL)handleLeftArrowKeyPressed
-{
+- (BOOL)handleLeftArrowKeyPressed {
     if (self.currentMode == FLEXExplorerModeMove) {
         CGRect frame = self.selectedView.frame;
         frame.origin.x -= 1.0 / UIScreen.mainScreen.scale;

+ 5 - 10
Classes/ExplorerInterface/FLEXWindow.m

@@ -12,8 +12,7 @@
 
 @implementation FLEXWindow
 
-- (id)initWithFrame:(CGRect)frame
-{
+- (id)initWithFrame:(CGRect)frame {
     self = [super initWithFrame:frame];
     if (self) {
         // Some apps have windows at UIWindowLevelStatusBar + n.
@@ -25,8 +24,7 @@
     return self;
 }
 
-- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
-{
+- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
     BOOL pointInside = NO;
     if ([self.eventDelegate shouldHandleTouchAtPoint:point]) {
         pointInside = [super pointInside:point withEvent:event];
@@ -34,13 +32,11 @@
     return pointInside;
 }
 
-- (BOOL)shouldAffectStatusBarAppearance
-{
+- (BOOL)shouldAffectStatusBarAppearance {
     return [self isKeyWindow];
 }
 
-- (BOOL)canBecomeKeyWindow
-{
+- (BOOL)canBecomeKeyWindow {
     return [self.eventDelegate canBecomeKeyWindow];
 }
 
@@ -54,8 +50,7 @@
     _previousKeyWindow = nil;
 }
 
-+ (void)initialize
-{
++ (void)initialize {
     // This adds a method (superclass override) at runtime which gives us the status bar behavior we want.
     // The FLEX window is intended to be an overlay that generally doesn't affect the app underneath.
     // Most of the time, we want the app's main window(s) to be in control of status bar behavior.

+ 28 - 56
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXMultiColumnTableView.m

@@ -28,8 +28,7 @@ static const CGFloat kColumnMargin = 1;
 @implementation FLEXMultiColumnTableView
 
 
-- (instancetype)initWithFrame:(CGRect)frame
-{
+- (instancetype)initWithFrame:(CGRect)frame {
     self = [super initWithFrame:frame];
     if (self) {
         [self loadUI];
@@ -37,14 +36,12 @@ static const CGFloat kColumnMargin = 1;
     return self;
 }
 
-- (void)didMoveToSuperview
-{
+- (void)didMoveToSuperview {
     [super didMoveToSuperview];
     [self reloadData];
 }
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     [super layoutSubviews];
     
     CGFloat width  = self.frame.size.width;
@@ -73,15 +70,13 @@ static const CGFloat kColumnMargin = 1;
 }
 
 
-- (void)loadUI
-{
+- (void)loadUI {
     [self loadHeaderScrollView];
     [self loadContentScrollView];
     [self loadLeftView];
 }
 
-- (void)reloadData
-{
+- (void)reloadData {
     [self loadLeftViewData];
     [self loadContentData];
     [self loadHeaderData];
@@ -89,8 +84,7 @@ static const CGFloat kColumnMargin = 1;
 
 #pragma mark - UI
 
-- (void)loadHeaderScrollView
-{
+- (void)loadHeaderScrollView {
     UIScrollView *headerScrollView = [UIScrollView new];
     headerScrollView.delegate      = self;
     self.headerScrollView          = headerScrollView;
@@ -99,8 +93,7 @@ static const CGFloat kColumnMargin = 1;
     [self addSubview:headerScrollView];
 }
 
-- (void)loadContentScrollView
-{
+- (void)loadContentScrollView {
     
     UIScrollView *scrollView = [UIScrollView new];
     scrollView.bounces       = NO;
@@ -119,8 +112,7 @@ static const CGFloat kColumnMargin = 1;
     
 }
 
-- (void)loadLeftView
-{
+- (void)loadLeftView {
     UITableView *leftTableView = [UITableView new];
     leftTableView.delegate       = self;
     leftTableView.dataSource     = self;
@@ -138,8 +130,7 @@ static const CGFloat kColumnMargin = 1;
 
 #pragma mark - Data
 
-- (void)loadHeaderData
-{
+- (void)loadHeaderData {
     NSArray<UIView *> *subviews = self.headerScrollView.subviews;
     
     for (UIView *subview in subviews) {
@@ -166,8 +157,7 @@ static const CGFloat kColumnMargin = 1;
     }
 }
 
-- (void)contentHeaderTap:(UIGestureRecognizer *)gesture
-{
+- (void)contentHeaderTap:(UIGestureRecognizer *)gesture {
     FLEXTableColumnHeader *header = (FLEXTableColumnHeader *)gesture.view;
     NSString *string = header.label.text;
     FLEXTableColumnHeaderSortType currentType = [self.sortStatusDict[string] integerValue];
@@ -191,19 +181,16 @@ static const CGFloat kColumnMargin = 1;
     
 }
 
-- (void)loadContentData
-{
+- (void)loadContentData {
     [self.contentTableView reloadData];
 }
 
-- (void)loadLeftViewData
-{
+- (void)loadLeftViewData {
     [self.leftTableView reloadData];
 }
 
 - (UITableViewCell *)tableView:(UITableView *)tableView
-         cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+         cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     UIColor *backgroundColor = UIColor.whiteColor;
     if (indexPath.row % 2 != 0) {
         backgroundColor = [UIColor colorWithWhite:0.950 alpha:0.750];
@@ -239,20 +226,17 @@ static const CGFloat kColumnMargin = 1;
     }
 }
 
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     return [self.dataSource numberOfRowsInTableView:self];
 }
 
 
-- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
     return [self.dataSource multiColumnTableView:self heightForContentCellInRow:indexPath.row];
 }
 
 
-- (void)scrollViewDidScroll:(UIScrollView *)scrollView
-{
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
     if (scrollView == self.contentScrollView) {
         self.headerScrollView.contentOffset = scrollView.contentOffset;
     }
@@ -270,8 +254,7 @@ static const CGFloat kColumnMargin = 1;
 #pragma mark -
 #pragma mark UITableView Delegate
 
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     if (tableView == self.leftTableView) {
         [self.contentTableView selectRowAtIndexPath:indexPath
                                            animated:NO
@@ -287,59 +270,48 @@ static const CGFloat kColumnMargin = 1;
 #pragma mark -
 #pragma mark DataSource Accessor
 
-- (NSInteger)numberOfRows
-{
+- (NSInteger)numberOfRows {
     return [self.dataSource numberOfRowsInTableView:self];
 }
 
-- (NSInteger)numberOfColumns
-{
+- (NSInteger)numberOfColumns {
     return [self.dataSource numberOfColumnsInTableView:self];
 }
 
-- (NSString *)columnTitleForColumn:(NSInteger)column
-{
+- (NSString *)columnTitleForColumn:(NSInteger)column {
     return [self.dataSource columnNameInColumn:column];
 }
 
-- (NSString *)rowTitleForRow:(NSInteger)row
-{
+- (NSString *)rowTitleForRow:(NSInteger)row {
     return [self.dataSource rowNameInRow:row];
 }
 
-- (NSString *)contentAtColumn:(NSInteger)column row:(NSInteger)row;
-{
+- (NSString *)contentAtColumn:(NSInteger)column row:(NSInteger)row; {
     return [self.dataSource contentAtColumn:column row:row];
 }
 
-- (CGFloat)contentWidthForColumn:(NSInteger)column
-{
+- (CGFloat)contentWidthForColumn:(NSInteger)column {
     return [self.dataSource multiColumnTableView:self widthForContentCellInColumn:column];
 }
 
-- (CGFloat)contentHeightForRow:(NSInteger)row
-{
+- (CGFloat)contentHeightForRow:(NSInteger)row {
     return [self.dataSource multiColumnTableView:self heightForContentCellInRow:row];
 }
 
-- (CGFloat)topHeaderHeight
-{
+- (CGFloat)topHeaderHeight {
     return [self.dataSource heightForTopHeaderInTableView:self];
 }
 
-- (CGFloat)leftHeaderWidth
-{
+- (CGFloat)leftHeaderWidth {
     return [self.dataSource widthForLeftHeaderInTableView:self];
 }
 
-- (CGFloat)columnMargin
-{
+- (CGFloat)columnMargin {
     return kColumnMargin;
 }
 
 
-- (void)tableContentCell:(FLEXTableContentCell *)tableView labelDidTapWithText:(NSString *)text
-{
+- (void)tableContentCell:(FLEXTableContentCell *)tableView labelDidTapWithText:(NSString *)text {
     [self.delegate multiColumnTableView:self didTapLabelWithText:text];
 }
 

+ 5 - 10
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXRealmDatabaseManager.m

@@ -26,8 +26,7 @@
 
 @implementation FLEXRealmDatabaseManager
 
-- (instancetype)initWithPath:(NSString*)aPath
-{
+- (instancetype)initWithPath:(NSString*)aPath {
     Class realmClass = NSClassFromString(@"RLMRealm");
     if (realmClass == nil) {
         return nil;
@@ -41,8 +40,7 @@
     return self;
 }
 
-- (BOOL)open
-{
+- (BOOL)open {
     Class realmClass = NSClassFromString(@"RLMRealm");
     Class configurationClass = NSClassFromString(@"RLMRealmConfiguration");
     
@@ -57,8 +55,7 @@
     return (error == nil);
 }
 
-- (NSArray<NSDictionary<NSString *, id> *> *)queryAllTables
-{
+- (NSArray<NSDictionary<NSString *, id> *> *)queryAllTables {
     NSMutableArray<NSDictionary<NSString *, id> *> *allTables = [NSMutableArray array];
     RLMSchema *schema = [self.realm schema];
     
@@ -74,8 +71,7 @@
     return allTables;
 }
 
-- (NSArray<NSString *> *)queryAllColumnsWithTableName:(NSString *)tableName
-{
+- (NSArray<NSString *> *)queryAllColumnsWithTableName:(NSString *)tableName {
     RLMObjectSchema *objectSchema = [[self.realm schema] schemaForClassName:tableName];
     if (objectSchema == nil) {
         return nil;
@@ -89,8 +85,7 @@
     return columnNames;
 }
 
-- (NSArray<NSDictionary<NSString *, id> *> *)queryAllDataWithTableName:(NSString *)tableName
-{
+- (NSArray<NSDictionary<NSString *, id> *> *)queryAllDataWithTableName:(NSString *)tableName {
     RLMObjectSchema *objectSchema = [[self.realm schema] schemaForClassName:tableName];
     RLMResults *results = [self.realm allObjects:tableName];
     if (results.count == 0 || objectSchema == nil) {

+ 6 - 12
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXSQLiteDatabaseManager.m

@@ -13,14 +13,12 @@
 
 static NSString *const QUERY_TABLENAMES_SQL = @"SELECT name FROM sqlite_master WHERE type='table' ORDER BY name";
 
-@implementation FLEXSQLiteDatabaseManager
-{
+@implementation FLEXSQLiteDatabaseManager {
     sqlite3* _db;
     NSString* _databasePath;
 }
 
-- (instancetype)initWithPath:(NSString*)aPath
-{
+- (instancetype)initWithPath:(NSString*)aPath {
     self = [super init];
     
     if (self) {
@@ -86,13 +84,11 @@ static NSString *const QUERY_TABLENAMES_SQL = @"SELECT name FROM sqlite_master W
 }
 
 
-- (NSArray<NSDictionary<NSString *, id> *> *)queryAllTables
-{
+- (NSArray<NSDictionary<NSString *, id> *> *)queryAllTables {
     return [self executeQuery:QUERY_TABLENAMES_SQL];
 }
 
-- (NSArray<NSString *> *)queryAllColumnsWithTableName:(NSString *)tableName
-{
+- (NSArray<NSString *> *)queryAllColumnsWithTableName:(NSString *)tableName {
     NSString *sql = [NSString stringWithFormat:@"PRAGMA table_info('%@')",tableName];
     NSArray<NSDictionary<NSString *, id> *> *resultArray =  [self executeQuery:sql];
     NSMutableArray<NSString *> *array = [NSMutableArray array];
@@ -103,8 +99,7 @@ static NSString *const QUERY_TABLENAMES_SQL = @"SELECT name FROM sqlite_master W
     return array;
 }
 
-- (NSArray<NSDictionary<NSString *, id> *> *)queryAllDataWithTableName:(NSString *)tableName
-{
+- (NSArray<NSDictionary<NSString *, id> *> *)queryAllDataWithTableName:(NSString *)tableName {
     NSString *sql = [NSString stringWithFormat:@"SELECT * FROM %@",tableName];
     return [self executeQuery:sql];
 }
@@ -112,8 +107,7 @@ static NSString *const QUERY_TABLENAMES_SQL = @"SELECT name FROM sqlite_master W
 #pragma mark -
 #pragma mark - Private
 
-- (NSArray<NSDictionary<NSString *, id> *> *)executeQuery:(NSString *)sql
-{
+- (NSArray<NSDictionary<NSString *, id> *> *)executeQuery:(NSString *)sql {
     [self open];
     NSMutableArray<NSDictionary<NSString *, id> *> *resultArray = [NSMutableArray array];
     sqlite3_stmt *pstmt;

+ 3 - 6
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableColumnHeader.m

@@ -8,14 +8,12 @@
 
 #import "FLEXTableColumnHeader.h"
 
-@implementation FLEXTableColumnHeader
-{
+@implementation FLEXTableColumnHeader {
     UILabel *_arrowLabel;
 }
 
 
-- (instancetype)initWithFrame:(CGRect)frame
-{
+- (instancetype)initWithFrame:(CGRect)frame {
     self = [super initWithFrame:frame];
     if (self) {
         self.backgroundColor = UIColor.whiteColor;
@@ -38,8 +36,7 @@
     return self;
 }
 
-- (void)changeSortStatusWithType:(FLEXTableColumnHeaderSortType)type
-{
+- (void)changeSortStatusWithType:(FLEXTableColumnHeaderSortType)type {
     switch (type) {
         case FLEXTableColumnHeaderSortTypeNone:
             _arrowLabel.text = @"";

+ 3 - 6
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableContentCell.m

@@ -15,8 +15,7 @@
 
 @implementation FLEXTableContentCell
 
-+ (instancetype)cellWithTableView:(UITableView *)tableView columnNumber:(NSInteger)number;
-{
++ (instancetype)cellWithTableView:(UITableView *)tableView columnNumber:(NSInteger)number; {
     static NSString *identifier = @"FLEXTableContentCell";
     FLEXTableContentCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
     if (!cell) {
@@ -43,8 +42,7 @@
     return cell;
 }
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     [super layoutSubviews];
     CGFloat labelWidth  = self.contentView.frame.size.width / self.labels.count;
     CGFloat labelHeight = self.contentView.frame.size.height;
@@ -55,8 +53,7 @@
 }
 
 
-- (void)labelDidTap:(UIGestureRecognizer *)gesture
-{
+- (void)labelDidTap:(UIGestureRecognizer *)gesture {
     UILabel *label = (UILabel *)gesture.view;
     if ([self.delegate respondsToSelector:@selector(tableContentCell:labelDidTapWithText:)]) {
         [self.delegate tableContentCell:self labelDidTapWithText:label.text];

+ 14 - 28
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableContentViewController.m

@@ -25,8 +25,7 @@
     [self.view addSubview:self.multiColumnView];
 }
 
-- (void)viewWillAppear:(BOOL)animated
-{
+- (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
     [self.multiColumnView reloadData];
 }
@@ -48,29 +47,24 @@
 }
 #pragma mark MultiColumnTableView DataSource
 
-- (NSInteger)numberOfColumnsInTableView:(FLEXMultiColumnTableView *)tableView
-{
+- (NSInteger)numberOfColumnsInTableView:(FLEXMultiColumnTableView *)tableView {
     return self.columnsArray.count;
 }
-- (NSInteger)numberOfRowsInTableView:(FLEXMultiColumnTableView *)tableView
-{
+- (NSInteger)numberOfRowsInTableView:(FLEXMultiColumnTableView *)tableView {
     return self.contentsArray.count;
 }
 
 
-- (NSString *)columnNameInColumn:(NSInteger)column
-{
+- (NSString *)columnNameInColumn:(NSInteger)column {
     return self.columnsArray[column];
 }
 
 
-- (NSString *)rowNameInRow:(NSInteger)row
-{
+- (NSString *)rowNameInRow:(NSInteger)row {
     return [NSString stringWithFormat:@"%ld",(long)row];
 }
 
-- (NSString *)contentAtColumn:(NSInteger)column row:(NSInteger)row
-{
+- (NSString *)contentAtColumn:(NSInteger)column row:(NSInteger)row {
     if (self.contentsArray.count > row) {
         NSDictionary<NSString *, id> *dic = self.contentsArray[row];
         if (self.contentsArray.count > column) {
@@ -80,8 +74,7 @@
     return @"";
 }
 
-- (NSArray *)contentAtRow:(NSInteger)row
-{
+- (NSArray *)contentAtRow:(NSInteger)row {
     NSMutableArray *result = [NSMutableArray array];
     if (self.contentsArray.count > row) {
         NSDictionary<NSString *, id> *dic = self.contentsArray[row];
@@ -94,24 +87,20 @@
 }
 
 - (CGFloat)multiColumnTableView:(FLEXMultiColumnTableView *)tableView
-      heightForContentCellInRow:(NSInteger)row
-{
+      heightForContentCellInRow:(NSInteger)row {
     return 40;
 }
 
 - (CGFloat)multiColumnTableView:(FLEXMultiColumnTableView *)tableView
-    widthForContentCellInColumn:(NSInteger)column
-{
+    widthForContentCellInColumn:(NSInteger)column {
     return 120;
 }
 
-- (CGFloat)heightForTopHeaderInTableView:(FLEXMultiColumnTableView *)tableView
-{
+- (CGFloat)heightForTopHeaderInTableView:(FLEXMultiColumnTableView *)tableView {
     return 40;
 }
 
-- (CGFloat)widthForLeftHeaderInTableView:(FLEXMultiColumnTableView *)tableView
-{
+- (CGFloat)widthForLeftHeaderInTableView:(FLEXMultiColumnTableView *)tableView {
     NSString *str = [NSString stringWithFormat:@"%lu",(unsigned long)self.contentsArray.count];
     NSDictionary<NSString *, id> *attrs = @{@"NSFontAttributeName":[UIFont systemFontOfSize:17.0]};
     CGSize size =   [str boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, 14)
@@ -124,14 +113,12 @@
 #pragma mark MultiColumnTableView Delegate
 
 
-- (void)multiColumnTableView:(FLEXMultiColumnTableView *)tableView didTapLabelWithText:(NSString *)text
-{
+- (void)multiColumnTableView:(FLEXMultiColumnTableView *)tableView didTapLabelWithText:(NSString *)text {
     FLEXWebViewController * detailViewController = [[FLEXWebViewController alloc] initWithText:text];
     [self.navigationController pushViewController:detailViewController animated:YES];
 }
 
-- (void)multiColumnTableView:(FLEXMultiColumnTableView *)tableView didTapHeaderWithText:(NSString *)text sortType:(FLEXTableColumnHeaderSortType)sortType
-{
+- (void)multiColumnTableView:(FLEXMultiColumnTableView *)tableView didTapHeaderWithText:(NSString *)text sortType:(FLEXTableColumnHeaderSortType)sortType {
     
     NSArray<NSDictionary<NSString *, id> *> *sortContentData = [self.contentsArray sortedArrayUsingComparator:^NSComparisonResult(NSDictionary<NSString *, id> * obj1, NSDictionary<NSString *, id> * obj2) {
         
@@ -163,8 +150,7 @@
 #pragma mark About Transition
 
 - (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection
-              withTransitionCoordinator:(id <UIViewControllerTransitionCoordinator>)coordinator
-{
+              withTransitionCoordinator:(id <UIViewControllerTransitionCoordinator>)coordinator {
     [super willTransitionToTraitCollection:newCollection
                  withTransitionCoordinator:coordinator];
     [coordinator animateAlongsideTransition:^(id <UIViewControllerTransitionCoordinatorContext> context) {

+ 2 - 4
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableLeftCell.m

@@ -10,8 +10,7 @@
 
 @implementation FLEXTableLeftCell
 
-+ (instancetype)cellWithTableView:(UITableView *)tableView
-{
++ (instancetype)cellWithTableView:(UITableView *)tableView {
     static NSString *identifier = @"FLEXTableLeftCell";
     FLEXTableLeftCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
     
@@ -27,8 +26,7 @@
     return cell;
 }
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     [super layoutSubviews];
     self.titlelabel.frame = self.contentView.frame;
 }

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

@@ -14,8 +14,7 @@
 
 #import "FLEXTableContentViewController.h"
 
-@interface FLEXTableListViewController ()
-{
+@interface FLEXTableListViewController () {
     id<FLEXDatabaseManager> _dbm;
     NSString *_databasePath;
 }
@@ -30,8 +29,7 @@
 
 @implementation FLEXTableListViewController
 
-- (instancetype)initWithPath:(NSString *)path
-{
+- (instancetype)initWithPath:(NSString *)path {
     self = [super initWithStyle:UITableViewStyleGrouped];
     if (self) {
         _databasePath = [path copy];
@@ -42,8 +40,7 @@
     return self;
 }
 
-- (id<FLEXDatabaseManager>)databaseManagerForFileAtPath:(NSString *)path
-{
+- (id<FLEXDatabaseManager>)databaseManagerForFileAtPath:(NSString *)path {
     NSString *pathExtension = path.pathExtension.lowercaseString;
     
     NSArray<NSString *> *sqliteExtensions = [FLEXTableListViewController supportedSQLiteExtensions];
@@ -59,8 +56,7 @@
     return nil;
 }
 
-- (void)getAllTables
-{
+- (void)getAllTables {
     NSArray<NSDictionary<NSString *, id> *> *resultArray = [_dbm queryAllTables];
     NSMutableArray<NSString *> *array = [NSMutableArray array];
     for (NSDictionary<NSString *, id> *dict in resultArray) {
@@ -71,8 +67,7 @@
     self.filteredTables = array;
 }
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
     
     self.showsSearchBar = YES;
@@ -80,8 +75,7 @@
 
 #pragma mark - Search bar
 
-- (void)updateSearchResults:(NSString *)searchText
-{
+- (void)updateSearchResults:(NSString *)searchText {
     if (searchText.length > 0) {
         NSPredicate *searchPredicate = [NSPredicate predicateWithFormat:@"SELF CONTAINS[cd] %@", searchText];
         self.filteredTables = [self.tables filteredArrayUsingPredicate:searchPredicate];
@@ -94,13 +88,11 @@
 
 #pragma mark - Table View Data Source
 
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     return self.filteredTables.count;
 }
 
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FLEXTableListViewControllerCell"];
     if (!cell) {
         cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
@@ -111,8 +103,7 @@
 }
 
 
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     FLEXTableContentViewController *contentViewController = [FLEXTableContentViewController new];
     
     contentViewController.contentsArray = [_dbm queryAllDataWithTableName:self.filteredTables[indexPath.row]];
@@ -122,15 +113,13 @@
     [self.navigationController pushViewController:contentViewController animated:YES];
 }
 
-- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
-{
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
     return [NSString stringWithFormat:@"Tables (%lu)", (unsigned long)self.filteredTables.count];
 }
 
 #pragma mark - FLEXTableListViewController
 
-+ (BOOL)supportsExtension:(NSString *)extension
-{
++ (BOOL)supportsExtension:(NSString *)extension {
     extension = extension.lowercaseString;
     
     NSArray<NSString *> *sqliteExtensions = [FLEXTableListViewController supportedSQLiteExtensions];
@@ -146,13 +135,11 @@
     return NO;
 }
 
-+ (NSArray<NSString *> *)supportedSQLiteExtensions
-{
++ (NSArray<NSString *> *)supportedSQLiteExtensions {
     return @[@"db", @"sqlite", @"sqlite3"];
 }
 
-+ (NSArray<NSString *> *)supportedRealmExtensions
-{
++ (NSArray<NSString *> *)supportedRealmExtensions {
     if (NSClassFromString(@"RLMRealm") == nil) {
         return nil;
     }

+ 9 - 18
Classes/GlobalStateExplorers/FLEXInstancesTableViewController.m

@@ -55,8 +55,7 @@
     return self;
 }
 
-+ (instancetype)instancesTableViewControllerForClassName:(NSString *)className
-{
++ (instancetype)instancesTableViewControllerForClassName:(NSString *)className {
     const char *classNameCString = className.UTF8String;
     NSMutableArray *instances = [NSMutableArray array];
     [FLEXHeapEnumerator enumerateLiveObjectsUsingBlock:^(__unsafe_unretained id object, __unsafe_unretained Class actualClass) {
@@ -76,8 +75,7 @@
     return viewController;
 }
 
-+ (instancetype)instancesTableViewControllerForInstancesReferencingObject:(id)object
-{
++ (instancetype)instancesTableViewControllerForInstancesReferencingObject:(id)object {
     NSMutableArray<FLEXObjectRef *> *instances = [NSMutableArray array];
     [FLEXHeapEnumerator enumerateLiveObjectsUsingBlock:^(__unsafe_unretained id tryObject, __unsafe_unretained Class actualClass) {
         // Skip Swift objects
@@ -116,8 +114,7 @@
     return viewController;
 }
 
-+ (NSPredicate *)defaultPredicateForSection:(NSInteger)section
-{
++ (NSPredicate *)defaultPredicateForSection:(NSInteger)section {
     // These are the types of references that we typically don't care about.
     // We want this list of "object-ivar pairs" split into two sections.
     BOOL(^isObserver)(FLEXObjectRef *, NSDictionary *) = ^BOOL(FLEXObjectRef *ref, NSDictionary *bindings) {
@@ -171,8 +168,7 @@
     return @[@"", @"AutoLayout", @"Trivial"];
 }
 
-- (void)buildSections
-{
+- (void)buildSections {
     NSInteger maxSections = self.maxSections;
     NSMutableArray *sections = [NSMutableArray array];
     for (NSInteger i = 0; i < maxSections; i++) {
@@ -190,18 +186,15 @@
 
 #pragma mark - Table View Data Source
 
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
     return self.maxSections;
 }
 
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     return self.sections[section].count;
 }
 
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     static NSString *CellIdentifier = @"Cell";
     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
     if (!cell) {
@@ -220,8 +213,7 @@
     return cell;
 }
 
-- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
-{
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
     if (self.sectionTitles.count) {
         // Return nil instead of empty strings
         NSString *title = self.sectionTitles[section];
@@ -236,8 +228,7 @@
 
 #pragma mark - Table View Delegate
 
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     id instance = self.instances[indexPath.row].object;
     FLEXObjectExplorerViewController *drillInViewController = [FLEXObjectExplorerFactory explorerViewControllerForObject:instance];
     [self.navigationController pushViewController:drillInViewController animated:YES];

+ 12 - 24
Classes/GlobalStateExplorers/FLEXLiveObjectsTableViewController.m

@@ -30,13 +30,11 @@ static const NSInteger kFLEXLiveObjectsSortBySizeIndex = 2;
 
 @implementation FLEXLiveObjectsTableViewController
 
-- (void)loadView
-{
+- (void)loadView {
     self.tableView = [FLEXTableView flexDefaultTableView];
 }
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
 
 //    self.title = @"Live Objects";
@@ -51,13 +49,11 @@ static const NSInteger kFLEXLiveObjectsSortBySizeIndex = 2;
     [self reloadTableData];
 }
 
-- (NSArray<NSString *> *)allClassNames
-{
+- (NSArray<NSString *> *)allClassNames {
     return self.instanceCountsForClassNames.allKeys;
 }
 
-- (void)reloadTableData
-{
+- (void)reloadTableData {
     // Set up a CFMutableDictionary with class pointer keys and NSUInteger values.
     // We abuse CFMutableDictionary a little to have primitive keys through judicious casting, but it gets the job done.
     // The dictionary is intialized with a 0 count for each class so that it doesn't have to expand during enumeration.
@@ -98,14 +94,12 @@ static const NSInteger kFLEXLiveObjectsSortBySizeIndex = 2;
     [self updateSearchResults:nil];
 }
 
-- (void)refreshControlDidRefresh:(id)sender
-{
+- (void)refreshControlDidRefresh:(id)sender {
     [self reloadTableData];
     [self.refreshControl endRefreshing];
 }
 
-- (void)updateHeaderTitle
-{
+- (void)updateHeaderTitle {
     NSUInteger totalCount = 0;
     NSUInteger totalSize = 0;
     for (NSString *className in self.allClassNames) {
@@ -159,8 +153,7 @@ static const NSInteger kFLEXLiveObjectsSortBySizeIndex = 2;
 
 #pragma mark - Search bar
 
-- (void)updateSearchResults:(NSString *)filter
-{
+- (void)updateSearchResults:(NSString *)filter {
     NSInteger selectedScope = self.selectedScope;
     
     if (filter.length) {
@@ -197,18 +190,15 @@ static const NSInteger kFLEXLiveObjectsSortBySizeIndex = 2;
 
 #pragma mark - Table view data source
 
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
     return 1;
 }
 
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     return self.filteredClassNames.count;
 }
 
-- (UITableViewCell *)tableView:(__kindof UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (UITableViewCell *)tableView:(__kindof UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     UITableViewCell *cell = [tableView
         dequeueReusableCellWithIdentifier:kFLEXDefaultCell
         forIndexPath:indexPath
@@ -230,16 +220,14 @@ static const NSInteger kFLEXLiveObjectsSortBySizeIndex = 2;
     return cell;
 }
 
-- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
-{
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
     return self.headerTitle;
 }
 
 
 #pragma mark - Table view delegate
 
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     NSString *className = self.filteredClassNames[indexPath.row];
     FLEXInstancesTableViewController *instancesViewController = [FLEXInstancesTableViewController instancesTableViewControllerForClassName:className];
     [self.navigationController pushViewController:instancesViewController animated:YES];

+ 9 - 18
Classes/GlobalStateExplorers/FLEXWebViewController.m

@@ -19,8 +19,7 @@
 
 @implementation FLEXWebViewController
 
-- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
-{
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
     self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
     if (self) {
         WKWebViewConfiguration *configuration = [WKWebViewConfiguration new];
@@ -35,8 +34,7 @@
     return self;
 }
 
-- (id)initWithText:(NSString *)text
-{
+- (id)initWithText:(NSString *)text {
     self = [self initWithNibName:nil bundle:nil];
     if (self) {
         self.originalText = text;
@@ -46,8 +44,7 @@
     return self;
 }
 
-- (id)initWithURL:(NSURL *)url
-{
+- (id)initWithURL:(NSURL *)url {
     self = [self initWithNibName:nil bundle:nil];
     if (self) {
         NSURLRequest *request = [NSURLRequest requestWithURL:url];
@@ -56,16 +53,14 @@
     return self;
 }
 
-- (void)dealloc
-{
+- (void)dealloc {
     // WKWebView's delegate is assigned so we need to clear it manually.
     if (_webView.navigationDelegate == self) {
         _webView.navigationDelegate = nil;
     }
 }
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
     
     [self.view addSubview:self.webView];
@@ -77,16 +72,14 @@
     }
 }
 
-- (void)copyButtonTapped:(id)sender
-{
+- (void)copyButtonTapped:(id)sender {
     [UIPasteboard.generalPasteboard setString:self.originalText];
 }
 
 
 #pragma mark - WKWebView Delegate
 
-- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
-{
+- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
     WKNavigationActionPolicy policy = WKNavigationActionPolicyCancel;
     if (navigationAction.navigationType == WKNavigationTypeOther) {
         // Allow the initial load
@@ -105,8 +98,7 @@
 
 #pragma mark - Class Helpers
 
-+ (BOOL)supportsPathExtension:(NSString *)extension
-{
++ (BOOL)supportsPathExtension:(NSString *)extension {
     BOOL supported = NO;
     NSSet<NSString *> *supportedExtensions = [self webViewSupportedPathExtensions];
     if ([supportedExtensions containsObject:[extension lowercaseString]]) {
@@ -115,8 +107,7 @@
     return supported;
 }
 
-+ (NSSet<NSString *> *)webViewSupportedPathExtensions
-{
++ (NSSet<NSString *> *)webViewSupportedPathExtensions {
     static NSSet<NSString *> *pathExtensions = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{

+ 5 - 10
Classes/GlobalStateExplorers/FileBrowser/FLEXFileBrowserSearchOperation.m

@@ -10,13 +10,11 @@
 
 @implementation NSMutableArray (FLEXStack)
 
-- (void)flex_push:(id)anObject
-{
+- (void)flex_push:(id)anObject {
     [self addObject:anObject];
 }
 
-- (id)flex_pop
-{
+- (id)flex_pop {
     id anObject = self.lastObject;
     [self removeLastObject];
     return anObject;
@@ -35,8 +33,7 @@
 
 #pragma mark - private
 
-- (uint64_t)totalSizeAtPath:(NSString *)path
-{
+- (uint64_t)totalSizeAtPath:(NSString *)path {
     NSFileManager *fileManager = NSFileManager.defaultManager;
     NSDictionary<NSString *, id> *attributes = [fileManager attributesOfItemAtPath:path error:NULL];
     uint64_t totalSize = [attributes fileSize];
@@ -50,8 +47,7 @@
 
 #pragma mark - instance method
 
-- (id)initWithPath:(NSString *)currentPath searchString:(NSString *)searchString
-{
+- (id)initWithPath:(NSString *)currentPath searchString:(NSString *)searchString {
     self = [super init];
     if (self) {
         self.path = currentPath;
@@ -62,8 +58,7 @@
 
 #pragma mark - methods to override
 
-- (void)main
-{
+- (void)main {
     NSFileManager *fileManager = NSFileManager.defaultManager;
     NSMutableArray<NSString *> *searchPaths = [NSMutableArray array];
     NSMutableDictionary<NSString *, NSNumber *> *sizeMapping = [NSMutableDictionary dictionary];

+ 30 - 60
Classes/GlobalStateExplorers/FileBrowser/FLEXFileBrowserTableViewController.m

@@ -31,18 +31,15 @@
 
 @implementation FLEXFileBrowserTableViewController
 
-+ (instancetype)path:(NSString *)path
-{
++ (instancetype)path:(NSString *)path {
     return [[self alloc] initWithPath:path];
 }
 
-- (id)init
-{
+- (id)init {
     return [self initWithPath:NSHomeDirectory()];
 }
 
-- (id)initWithPath:(NSString *)path
-{
+- (id)initWithPath:(NSString *)path {
     self = [super init];
     if (self) {
         self.path = path;
@@ -81,8 +78,7 @@
 
 #pragma mark - UIViewController
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
     
     self.showsSearchBar = YES;
@@ -109,8 +105,7 @@
 
 #pragma mark - FLEXFileBrowserSearchOperationDelegate
 
-- (void)fileBrowserSearchOperationResult:(NSArray<NSString *> *)searchResult size:(uint64_t)size
-{
+- (void)fileBrowserSearchOperationResult:(NSArray<NSString *> *)searchResult size:(uint64_t)size {
     self.searchPaths = searchResult;
     self.searchPathsSize = @(size);
     [self.tableView reloadData];
@@ -118,15 +113,13 @@
 
 #pragma mark - Search bar
 
-- (void)updateSearchResults:(NSString *)newText
-{
+- (void)updateSearchResults:(NSString *)newText {
     [self reloadDisplayedPaths];
 }
 
 #pragma mark UISearchControllerDelegate
 
-- (void)willDismissSearchController:(UISearchController *)searchController
-{
+- (void)willDismissSearchController:(UISearchController *)searchController {
     [self.operationQueue cancelAllOperations];
     [self reloadCurrentPath];
     [self.tableView reloadData];
@@ -134,18 +127,15 @@
 
 #pragma mark - Table view data source
 
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
     return 1;
 }
 
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     return self.searchController.isActive ? self.searchPaths.count : self.childPaths.count;
 }
 
-- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
-{
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
     BOOL isSearchActive = self.searchController.isActive;
     NSNumber *currentSize = isSearchActive ? self.searchPathsSize : self.recursiveSize;
     NSArray<NSString *> *currentPaths = isSearchActive ? self.searchPaths : self.childPaths;
@@ -160,8 +150,7 @@
     return [NSString stringWithFormat:@"%lu files (%@)", (unsigned long)currentPaths.count, sizeString];
 }
 
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     NSString *fullPath = [self filePathAtIndexPath:indexPath];
     NSDictionary<NSString *, id> *attributes = [NSFileManager.defaultManager attributesOfItemAtPath:fullPath error:NULL];
     BOOL isDirectory = [attributes.fileType isEqual:NSFileTypeDirectory];
@@ -201,8 +190,7 @@
     return cell;
 }
 
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
 
     NSString *fullPath = [self filePathAtIndexPath:indexPath];
@@ -283,8 +271,7 @@
     }
 }
 
-- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath {
     UIMenuItem *rename = [[UIMenuItem alloc] initWithTitle:@"Rename" action:@selector(fileBrowserRename:)];
     UIMenuItem *delete = [[UIMenuItem alloc] initWithTitle:@"Delete" action:@selector(fileBrowserDelete:)];
     UIMenuItem *copyPath = [[UIMenuItem alloc] initWithTitle:@"Copy Path" action:@selector(fileBrowserCopyPath:)];
@@ -295,16 +282,14 @@
     return YES;
 }
 
-- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
-{
+- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender {
     return action == @selector(fileBrowserDelete:)
         || action == @selector(fileBrowserRename:)
         || action == @selector(fileBrowserCopyPath:)
         || action == @selector(fileBrowserShare:);
 }
 
-- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
-{
+- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender {
     // Empty, but has to exist for the menu to show
     // The table view only calls this method for actions in the UIResponderStandardEditActions informal protocol.
     // Since our actions are outside of that protocol, we need to manually handle the action forwarding from the cells.
@@ -312,8 +297,7 @@
 
 #if FLEX_AT_LEAST_IOS13_SDK
 
-- (UIContextMenuConfiguration *)tableView:(UITableView *)tableView contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath point:(CGPoint)point __IOS_AVAILABLE(13.0)
-{
+- (UIContextMenuConfiguration *)tableView:(UITableView *)tableView contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath point:(CGPoint)point __IOS_AVAILABLE(13.0) {
     __weak typeof(self) weakSelf = self;
     return [UIContextMenuConfiguration configurationWithIdentifier:nil
                                                    previewProvider:nil
@@ -349,8 +333,7 @@
 
 #endif
 
-- (void)openFileController:(NSString *)fullPath
-{
+- (void)openFileController:(NSString *)fullPath {
     UIDocumentInteractionController *controller = [UIDocumentInteractionController new];
     controller.URL = [NSURL fileURLWithPath:fullPath];
 
@@ -358,8 +341,7 @@
     self.documentController = controller;
 }
 
-- (void)fileBrowserRename:(UITableViewCell *)sender
-{
+- (void)fileBrowserRename:(UITableViewCell *)sender {
     NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
     NSString *fullPath = [self filePathAtIndexPath:indexPath];
 
@@ -384,8 +366,7 @@
     }
 }
 
-- (void)fileBrowserDelete:(UITableViewCell *)sender
-{
+- (void)fileBrowserDelete:(UITableViewCell *)sender {
     NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
     NSString *fullPath = [self filePathAtIndexPath:indexPath];
 
@@ -409,15 +390,13 @@
     }
 }
 
-- (void)fileBrowserCopyPath:(UITableViewCell *)sender
-{
+- (void)fileBrowserCopyPath:(UITableViewCell *)sender {
     NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
     NSString *fullPath = [self filePathAtIndexPath:indexPath];
     UIPasteboard.generalPasteboard.string = fullPath;
 }
 
-- (void)fileBrowserShare:(UITableViewCell *)sender
-{
+- (void)fileBrowserShare:(UITableViewCell *)sender {
     NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
     NSString *pathString = [self filePathAtIndexPath:indexPath];
     NSURL *filePath = [NSURL fileURLWithPath:pathString];
@@ -435,8 +414,7 @@
     }
 }
 
-- (void)reloadDisplayedPaths
-{
+- (void)reloadDisplayedPaths {
     if (self.searchController.isActive) {
         [self updateSearchPaths];
     } else {
@@ -445,8 +423,7 @@
     }
 }
 
-- (void)reloadCurrentPath
-{
+- (void)reloadCurrentPath {
     NSMutableArray<NSString *> *childPaths = [NSMutableArray array];
     NSArray<NSString *> *subpaths = [NSFileManager.defaultManager contentsOfDirectoryAtPath:self.path error:NULL];
     for (NSString *subpath in subpaths) {
@@ -455,8 +432,7 @@
     self.childPaths = childPaths;
 }
 
-- (void)updateSearchPaths
-{
+- (void)updateSearchPaths {
     self.searchPaths = nil;
     self.searchPathsSize = nil;
 
@@ -467,8 +443,7 @@
     [self.operationQueue addOperation:newOperation];
 }
 
-- (NSString *)filePathAtIndexPath:(NSIndexPath *)indexPath
-{
+- (NSString *)filePathAtIndexPath:(NSIndexPath *)indexPath {
     return self.searchController.isActive ? self.searchPaths[indexPath.row] : self.childPaths[indexPath.row];
 }
 
@@ -477,29 +452,24 @@
 
 @implementation FLEXFileBrowserTableViewCell
 
-- (void)forwardAction:(SEL)action withSender:(id)sender
-{
+- (void)forwardAction:(SEL)action withSender:(id)sender {
     id target = [self.nextResponder targetForAction:action withSender:sender];
     [UIApplication.sharedApplication sendAction:action to:target from:self forEvent:nil];
 }
 
-- (void)fileBrowserRename:(UIMenuController *)sender
-{
+- (void)fileBrowserRename:(UIMenuController *)sender {
     [self forwardAction:_cmd withSender:sender];
 }
 
-- (void)fileBrowserDelete:(UIMenuController *)sender
-{
+- (void)fileBrowserDelete:(UIMenuController *)sender {
     [self forwardAction:_cmd withSender:sender];
 }
 
-- (void)fileBrowserCopyPath:(UIMenuController *)sender
-{
+- (void)fileBrowserCopyPath:(UIMenuController *)sender {
     [self forwardAction:_cmd withSender:sender];
 }
 
-- (void)fileBrowserShare:(UIMenuController *)sender
-{
+- (void)fileBrowserShare:(UIMenuController *)sender {
     [self forwardAction:_cmd withSender:sender];
 }
 

+ 3 - 6
Classes/GlobalStateExplorers/Globals/FLEXGlobalsEntry.m

@@ -10,8 +10,7 @@
 
 @implementation FLEXGlobalsEntry
 
-+ (instancetype)entryWithEntry:(Class<FLEXGlobalsEntry>)cls row:(FLEXGlobalsRow)row
-{
++ (instancetype)entryWithEntry:(Class<FLEXGlobalsEntry>)cls row:(FLEXGlobalsRow)row {
     BOOL providesVCs = [cls respondsToSelector:@selector(globalsEntryViewController:)];
     BOOL providesActions = [cls respondsToSelector:@selector(globalsEntryRowAction:)];
     NSParameterAssert(cls);
@@ -35,8 +34,7 @@
 }
 
 + (instancetype)entryWithNameFuture:(FLEXGlobalsEntryNameFuture)nameFuture
-               viewControllerFuture:(FLEXGlobalsTableViewControllerViewControllerFuture)viewControllerFuture
-{
+               viewControllerFuture:(FLEXGlobalsTableViewControllerViewControllerFuture)viewControllerFuture {
     NSParameterAssert(nameFuture);
     NSParameterAssert(viewControllerFuture);
 
@@ -48,8 +46,7 @@
 }
 
 + (instancetype)entryWithNameFuture:(FLEXGlobalsEntryNameFuture)nameFuture
-                             action:(FLEXGlobalsTableViewControllerRowAction)rowSelectedAction
-{
+                             action:(FLEXGlobalsTableViewControllerRowAction)rowSelectedAction {
     NSParameterAssert(nameFuture);
     NSParameterAssert(rowSelectedAction);
 

+ 10 - 20
Classes/GlobalStateExplorers/Globals/FLEXGlobalsViewController.m

@@ -32,8 +32,7 @@
 
 @implementation FLEXGlobalsViewController
 
-+ (NSString *)globalsTitleForSection:(FLEXGlobalsSectionKind)section
-{
++ (NSString *)globalsTitleForSection:(FLEXGlobalsSectionKind)section {
     switch (section) {
         case FLEXGlobalsSectionProcessAndEvents:
             return @"Process and Events";
@@ -49,8 +48,7 @@
     }
 }
 
-+ (FLEXGlobalsEntry *)globalsEntryForRow:(FLEXGlobalsRow)row
-{
++ (FLEXGlobalsEntry *)globalsEntryForRow:(FLEXGlobalsRow)row {
     switch (row) {
         case FLEXGlobalsRowAppKeychainItems:
             return [FLEXKeychainTableViewController flex_concreteGlobalsEntry:row];
@@ -89,8 +87,7 @@
     }
 }
 
-+ (NSArray<FLEXGlobalsSection *> *)defaultGlobalSections
-{
++ (NSArray<FLEXGlobalsSection *> *)defaultGlobalSections {
     static NSArray<FLEXGlobalsSection *> *sections = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
@@ -133,8 +130,7 @@
 
 #pragma mark - UIViewController
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
 
     self.title = @"💪  FLEX";
@@ -174,8 +170,7 @@
 
 #pragma mark - Private
 
-- (NSArray<FLEXGlobalsSection *> *)nonemptySections
-{
+- (NSArray<FLEXGlobalsSection *> *)nonemptySections {
     return [self.allSections flex_filtered:^BOOL(FLEXTableViewSection *section, NSUInteger idx) {
         return section.numberOfRows > 0;
     }];
@@ -183,18 +178,15 @@
 
 #pragma mark - Table View Data Source
 
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
     return self.sections.count;
 }
 
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     return self.sections[section].numberOfRows;
 }
 
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     static NSString *CellIdentifier = @"Cell";
     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
     if (!cell) {
@@ -208,15 +200,13 @@
     return cell;
 }
 
-- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
-{
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
     return self.sections[section].title;
 }
 
 #pragma mark - Table View Delegate
 
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     FLEXTableViewSection *section = self.sections[indexPath.section];
 
     void (^action)(UIViewController *) = [section didSelectRowAction:indexPath.row];

+ 13 - 26
Classes/GlobalStateExplorers/Keychain/FLEXKeychainTableViewController.m

@@ -21,8 +21,7 @@
 
 @implementation FLEXKeychainTableViewController
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
     
     self.navigationItem.rightBarButtonItems = @[
@@ -38,18 +37,15 @@
     [self updateHeaderTitle];
 }
 
-- (void)refreshkeychainItems
-{
+- (void)refreshkeychainItems {
     self.keychainItems = [FLEXKeychain allAccounts].mutableCopy;
 }
 
-- (void)updateHeaderTitle
-{
+- (void)updateHeaderTitle {
     self.headerTitle = [NSString stringWithFormat:@"%@ items", @(self.keychainItems.count)];
 }
 
-- (FLEXKeychainQuery *)queryForItemAtIndex:(NSInteger)idx
-{
+- (FLEXKeychainQuery *)queryForItemAtIndex:(NSInteger)idx {
     NSDictionary *item = self.keychainItems[idx];
 
     FLEXKeychainQuery *query = [FLEXKeychainQuery new];
@@ -60,8 +56,7 @@
     return query;
 }
 
-- (void)deleteItem:(NSDictionary *)item
-{
+- (void)deleteItem:(NSDictionary *)item {
     NSError *error = nil;
     BOOL success = [FLEXKeychain
         deletePasswordForService:item[kFLEXKeychainWhereKey]
@@ -80,8 +75,7 @@
 
 #pragma mark Buttons
 
-- (void)trashPressed
-{
+- (void)trashPressed {
     [FLEXAlert makeSheet:^(FLEXAlert *make) {
         make.title(@"Clear Keychain");
         make.message(@"This will remove all keychain items for this app.\n");
@@ -98,8 +92,7 @@
     } showFrom:self];
 }
 
-- (void)addPressed
-{
+- (void)addPressed {
     [FLEXAlert makeAlert:^(FLEXAlert *make) {
         make.title(@"Add Keychain Item");
         make.textField(@"Service name, i.e. Instagram");
@@ -122,8 +115,7 @@
 
 #pragma mark - FLEXGlobalsEntry
 
-+ (NSString *)globalsEntryTitle:(FLEXGlobalsRow)row
-{
++ (NSString *)globalsEntryTitle:(FLEXGlobalsRow)row {
     return @"🔑  Keychain";
 }
 
@@ -137,13 +129,11 @@
 
 #pragma mark - Table View Data Source
 
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     return self.keychainItems.count;
 }
 
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     static NSString *CellIdentifier = @"Cell";
     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
     if (!cell) {
@@ -167,13 +157,11 @@
     return cell;
 }
 
-- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
-{
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
     return self.headerTitle;
 }
 
-- (void)tableView:(UITableView *)tv commitEditingStyle:(UITableViewCellEditingStyle)style forRowAtIndexPath:(NSIndexPath *)ip
-{
+- (void)tableView:(UITableView *)tv commitEditingStyle:(UITableViewCellEditingStyle)style forRowAtIndexPath:(NSIndexPath *)ip {
     if (style == UITableViewCellEditingStyleDelete) {
         [self deleteItem:self.keychainItems[ip.row]];
         [self.keychainItems removeObjectAtIndex:ip.row];
@@ -184,8 +172,7 @@
 
 #pragma mark - Table View Delegate
 
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     FLEXKeychainQuery *query = [self queryForItemAtIndex:indexPath.row];
     
     [FLEXAlert makeAlert:^(FLEXAlert *make) {

+ 1 - 2
Classes/GlobalStateExplorers/RuntimeBrowser/TBToken.h

@@ -9,8 +9,7 @@
 #import <Foundation/Foundation.h>
 
 
-typedef NS_OPTIONS(NSUInteger, TBWildcardOptions)
-{
+typedef NS_OPTIONS(NSUInteger, TBWildcardOptions) {
     TBWildcardOptionsNone   = 0,
     TBWildcardOptionsAny    = 1,
     TBWildcardOptionsPrefix = 1 << 1,

+ 7 - 14
Classes/GlobalStateExplorers/SystemLog/FLEXASLLogController.m

@@ -36,13 +36,11 @@
 
 @implementation FLEXASLLogController
 
-+ (instancetype)withUpdateHandler:(void(^)(NSArray<FLEXSystemLogMessage *> *newMessages))newMessagesHandler
-{
++ (instancetype)withUpdateHandler:(void(^)(NSArray<FLEXSystemLogMessage *> *newMessages))newMessagesHandler {
     return [[self alloc] initWithUpdateHandler:newMessagesHandler];
 }
 
-- (id)initWithUpdateHandler:(void(^)(NSArray<FLEXSystemLogMessage *> *newMessages))newMessagesHandler
-{
+- (id)initWithUpdateHandler:(void(^)(NSArray<FLEXSystemLogMessage *> *newMessages))newMessagesHandler {
     NSParameterAssert(newMessagesHandler);
 
     self = [super init];
@@ -59,8 +57,7 @@
     return self;
 }
 
-- (void)dealloc
-{
+- (void)dealloc {
     [self.logUpdateTimer invalidate];
 }
 
@@ -69,8 +66,7 @@
     return YES;
 }
 
-- (void)updateLogMessages
-{
+- (void)updateLogMessages {
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         NSArray<FLEXSystemLogMessage *> *newMessages;
         @synchronized (self) {
@@ -94,8 +90,7 @@
 
 #pragma mark - Log Message Fetching
 
-- (NSArray<FLEXSystemLogMessage *> *)newLogMessagesForCurrentProcess
-{
+- (NSArray<FLEXSystemLogMessage *> *)newLogMessagesForCurrentProcess {
     if (!self.logMessageIdentifiers.count) {
         return [self allLogMessagesForCurrentProcess];
     }
@@ -116,8 +111,7 @@
     return newMessages;
 }
 
-- (aslresponse)ASLMessageListForCurrentProcess
-{
+- (aslresponse)ASLMessageListForCurrentProcess {
     static NSString *pidString = nil;
     if (!pidString) {
         pidString = @([NSProcessInfo.processInfo processIdentifier]).stringValue;
@@ -137,8 +131,7 @@
     return asl_search(NULL, query);
 }
 
-- (NSArray<FLEXSystemLogMessage *> *)allLogMessagesForCurrentProcess
-{
+- (NSArray<FLEXSystemLogMessage *> *)allLogMessagesForCurrentProcess {
     aslresponse response = [self ASLMessageListForCurrentProcess];
     aslmsg aslMessage = NULL;
 

+ 3 - 6
Classes/GlobalStateExplorers/SystemLog/FLEXOSLogController.m

@@ -38,8 +38,7 @@ static uint8_t (*OSLogGetType)(void *);
 
 @implementation FLEXOSLogController
 
-+ (void)load
-{
++ (void)load {
     // Persist logs when the app launches on iOS 10 if we have persistent logs turned on
     if (FLEXOSLogAvailable()) {
         BOOL persistent = [[NSUserDefaults standardUserDefaults] boolForKey:kFLEXiOSPersistentOSLogKey];
@@ -60,15 +59,13 @@ static uint8_t (*OSLogGetType)(void *);
     return shared;
 }
 
-+ (instancetype)withUpdateHandler:(void(^)(NSArray<FLEXSystemLogMessage *> *newMessages))newMessagesHandler
-{
++ (instancetype)withUpdateHandler:(void(^)(NSArray<FLEXSystemLogMessage *> *newMessages))newMessagesHandler {
     FLEXOSLogController *shared = [self sharedLogController];
     shared.updateHandler = newMessagesHandler;
     return shared;
 }
 
-- (id)init
-{
+- (id)init {
     NSAssert(FLEXOSLogAvailable(), @"os_log is only available on iOS 10 and up");
 
     self = [super init];

+ 6 - 12
Classes/GlobalStateExplorers/SystemLog/FLEXSystemLogMessage.m

@@ -10,8 +10,7 @@
 
 @implementation FLEXSystemLogMessage
 
-+ (instancetype)logMessageFromASLMessage:(aslmsg)aslMessage
-{
++ (instancetype)logMessageFromASLMessage:(aslmsg)aslMessage {
     NSDate *date = nil;
     NSString *sender = nil, *text = nil;
     long long identifier = 0;
@@ -46,13 +45,11 @@
     return message;
 }
 
-+ (instancetype)logMessageFromDate:(NSDate *)date text:(NSString *)text
-{
++ (instancetype)logMessageFromDate:(NSDate *)date text:(NSString *)text {
     return [[self alloc] initWithDate:date sender:nil text:text messageID:0];
 }
 
-- (id)initWithDate:(NSDate *)date sender:(NSString *)sender text:(NSString *)text messageID:(long long)identifier
-{
+- (id)initWithDate:(NSDate *)date sender:(NSString *)sender text:(NSString *)text messageID:(long long)identifier {
     self = [super init];
     if (self) {
         _date = date;
@@ -64,8 +61,7 @@
     return self;
 }
 
-- (BOOL)isEqual:(id)object
-{
+- (BOOL)isEqual:(id)object {
     if ([object isKindOfClass:[self class]]) {
         if (self.messageID) {
             // Only ASL uses messageID, otherwise it is 0
@@ -80,13 +76,11 @@
     return NO;
 }
 
-- (NSUInteger)hash
-{
+- (NSUInteger)hash {
     return (NSUInteger)self.messageID;
 }
 
-- (NSString *)description
-{
+- (NSString *)description {
     NSString *escaped = [self.messageText stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"];
     return [NSString stringWithFormat:@"(%@) %@", @(self.messageText.length), escaped];
 }

+ 12 - 21
Classes/GlobalStateExplorers/SystemLog/FLEXSystemLogTableViewCell.m

@@ -20,8 +20,7 @@ NSString *const kFLEXSystemLogTableViewCellIdentifier = @"FLEXSystemLogTableView
 
 @implementation FLEXSystemLogTableViewCell
 
-- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
-{
+- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
     self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
     if (self) {
         self.logMessageLabel = [UILabel new];
@@ -33,8 +32,7 @@ NSString *const kFLEXSystemLogTableViewCellIdentifier = @"FLEXSystemLogTableView
     return self;
 }
 
-- (void)setLogMessage:(FLEXSystemLogMessage *)logMessage
-{
+- (void)setLogMessage:(FLEXSystemLogMessage *)logMessage {
     if (![_logMessage isEqual:logMessage]) {
         _logMessage = logMessage;
         self.logMessageAttributedText = nil;
@@ -42,8 +40,7 @@ NSString *const kFLEXSystemLogTableViewCellIdentifier = @"FLEXSystemLogTableView
     }
 }
 
-- (void)setHighlightedText:(NSString *)highlightedText
-{
+- (void)setHighlightedText:(NSString *)highlightedText {
     if (![_highlightedText isEqual:highlightedText]) {
         _highlightedText = highlightedText;
         self.logMessageAttributedText = nil;
@@ -51,8 +48,7 @@ NSString *const kFLEXSystemLogTableViewCellIdentifier = @"FLEXSystemLogTableView
     }
 }
 
-- (NSAttributedString *)logMessageAttributedText
-{
+- (NSAttributedString *)logMessageAttributedText {
     if (!_logMessageAttributedText) {
         _logMessageAttributedText = [[self class] attributedTextForLogMessage:self.logMessage highlightedText:self.highlightedText];
     }
@@ -61,8 +57,7 @@ NSString *const kFLEXSystemLogTableViewCellIdentifier = @"FLEXSystemLogTableView
 
 static const UIEdgeInsets kFLEXLogMessageCellInsets = {10.0, 10.0, 10.0, 10.0};
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     [super layoutSubviews];
 
     self.logMessageLabel.attributedText = self.logMessageAttributedText;
@@ -71,16 +66,15 @@ static const UIEdgeInsets kFLEXLogMessageCellInsets = {10.0, 10.0, 10.0, 10.0};
 
 #pragma mark - Stateless helpers
 
-+ (NSAttributedString *)attributedTextForLogMessage:(FLEXSystemLogMessage *)logMessage highlightedText:(NSString *)highlightedText
-{
++ (NSAttributedString *)attributedTextForLogMessage:(FLEXSystemLogMessage *)logMessage highlightedText:(NSString *)highlightedText {
     NSString *text = [self displayedTextForLogMessage:logMessage];
     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<NSString *, id> *highlightAttributes = [@{ NSBackgroundColorAttributeName : UIColor.yellowColor } mutableCopy];
-        [highlightAttributes addEntriesFromDictionary:attributes];
+        NSMutableAttributedString *mutableAttributedText = attributedText.mutableCopy;
+        NSMutableDictionary<NSString *, id> *highlightAttributes = attributes.mutableCopy;
+        highlightAttributes[NSBackgroundColorAttributeName] = UIColor.yellowColor;
         
         NSRange remainingSearchRange = NSMakeRange(0, text.length);
         while (remainingSearchRange.location < text.length) {
@@ -99,13 +93,11 @@ static const UIEdgeInsets kFLEXLogMessageCellInsets = {10.0, 10.0, 10.0, 10.0};
     return attributedText;
 }
 
-+ (NSString *)displayedTextForLogMessage:(FLEXSystemLogMessage *)logMessage
-{
++ (NSString *)displayedTextForLogMessage:(FLEXSystemLogMessage *)logMessage {
     return [NSString stringWithFormat:@"%@: %@", [self logTimeStringFromDate:logMessage.date], logMessage.messageText];
 }
 
-+ (CGFloat)preferredHeightForLogMessage:(FLEXSystemLogMessage *)logMessage inWidth:(CGFloat)width
-{
++ (CGFloat)preferredHeightForLogMessage:(FLEXSystemLogMessage *)logMessage inWidth:(CGFloat)width {
     UIEdgeInsets insets = kFLEXLogMessageCellInsets;
     CGFloat availableWidth = width - insets.left - insets.right;
     NSAttributedString *attributedLogText = [self attributedTextForLogMessage:logMessage highlightedText:nil];
@@ -113,8 +105,7 @@ static const UIEdgeInsets kFLEXLogMessageCellInsets = {10.0, 10.0, 10.0, 10.0};
     return labelSize.height + insets.top + insets.bottom;
 }
 
-+ (NSString *)logTimeStringFromDate:(NSDate *)date
-{
++ (NSString *)logTimeStringFromDate:(NSDate *)date {
     static NSDateFormatter *formatter = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{

+ 14 - 28
Classes/GlobalStateExplorers/SystemLog/FLEXSystemLogTableViewController.m

@@ -27,8 +27,7 @@
     return [super initWithStyle:UITableViewStylePlain];
 }
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
     
     self.showsSearchBar = YES;
@@ -65,8 +64,7 @@
     }
 }
 
-- (void)handleUpdateWithNewMessages:(NSArray<FLEXSystemLogMessage *> *)newMessages
-{
+- (void)handleUpdateWithNewMessages:(NSArray<FLEXSystemLogMessage *> *)newMessages {
     self.title = @"System Log";
 
     [self.logMessages addObjectsFromArray:newMessages];
@@ -79,15 +77,13 @@
     }
 }
 
-- (void)viewWillAppear:(BOOL)animated
-{
+- (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
 
     [self.logController startMonitoring];
 }
 
-- (void)scrollToLastRow
-{
+- (void)scrollToLastRow {
     NSInteger numberOfRows = [self.tableView numberOfRowsInSection:0];
     if (numberOfRows > 0) {
         NSIndexPath *lastIndexPath = [NSIndexPath indexPathForRow:numberOfRows - 1 inSection:0];
@@ -95,8 +91,7 @@
     }
 }
 
-- (void)showLogSettings
-{
+- (void)showLogSettings {
     FLEXOSLogController *logController = (FLEXOSLogController *)self.logController;
     BOOL persistent = [[NSUserDefaults standardUserDefaults] boolForKey:kFLEXiOSPersistentOSLogKey];
     NSString *toggle = persistent ? @"Disable" : @"Enable";
@@ -127,18 +122,15 @@
 
 #pragma mark - Table view data source
 
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
     return 1;
 }
 
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     return self.searchController.isActive ? self.filteredLogMessages.count : self.logMessages.count;
 }
 
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
-{
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath  {
     FLEXSystemLogTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kFLEXSystemLogTableViewCellIdentifier forIndexPath:indexPath];
     cell.logMessage = [self logMessageAtIndexPath:indexPath];
     cell.highlightedText = self.searchText;
@@ -152,41 +144,35 @@
     return cell;
 }
 
-- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
     FLEXSystemLogMessage *logMessage = [self logMessageAtIndexPath:indexPath];
     return [FLEXSystemLogTableViewCell preferredHeightForLogMessage:logMessage inWidth:self.tableView.bounds.size.width];
 }
 
 #pragma mark - Copy on long press
 
-- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath {
     return YES;
 }
 
-- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
-{
+- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender {
     return action == @selector(copy:);
 }
 
-- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
-{
+- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender {
     if (action == @selector(copy:)) {
         // We usually only want to copy the log message itself, not any metadata associated with it.
         UIPasteboard.generalPasteboard.string = [self logMessageAtIndexPath:indexPath].messageText;
     }
 }
 
-- (FLEXSystemLogMessage *)logMessageAtIndexPath:(NSIndexPath *)indexPath
-{
+- (FLEXSystemLogMessage *)logMessageAtIndexPath:(NSIndexPath *)indexPath {
     return self.searchController.isActive ? self.filteredLogMessages[indexPath.row] : self.logMessages[indexPath.row];
 }
 
 #pragma mark - Search bar
 
-- (void)updateSearchResults:(NSString *)searchString
-{
+- (void)updateSearchResults:(NSString *)searchString {
     [self onBackgroundQueue:^NSArray *{
         return [self.logMessages filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(FLEXSystemLogMessage *logMessage, NSDictionary<NSString *, id> *bindings) {
             NSString *displayedText = [FLEXSystemLogTableViewCell displayedTextForLogMessage:logMessage];

+ 4 - 4
Classes/Manager/FLEXManager+Extensibility.m

@@ -183,7 +183,7 @@
 }
 
 - (UIScrollView *)firstScrollView {
-    NSMutableArray<UIView *> *views = FLEXUtility.appKeyWindow.subviews.copy;
+    NSMutableArray<UIView *> *views = FLEXUtility.appKeyWindow.subviews.mutableCopy;
     UIScrollView *scrollView = nil;
     while (views.count > 0) {
         UIView *view = views.firstObject;
@@ -223,9 +223,9 @@
         [topViewController.topViewController isKindOfClass:[class class]]) {
         [topViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];
     } else {
-        id viewController = [class new];
-        UINavigationController *navigationController = [[FLEXNavigationController alloc] initWithRootViewController:viewController];
-        [topViewController presentViewController:navigationController animated:YES completion:nil];
+        [topViewController presentViewController:
+            [FLEXNavigationController withRootViewController:[class new]]
+        animated:YES completion:nil];
     }
 }
 

+ 31 - 62
Classes/Network/FLEXNetworkHistoryTableViewController.m

@@ -31,8 +31,7 @@
 
 @implementation FLEXNetworkHistoryTableViewController
 
-- (id)init
-{
+- (id)init {
     self = [super initWithStyle:UITableViewStylePlain];
     if (self) {
         [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(handleNewTransactionRecordedNotification:) name:kFLEXNetworkRecorderNewTransactionNotification object:nil];
@@ -49,13 +48,11 @@
     return self;
 }
 
-- (void)dealloc
-{
+- (void)dealloc {
     [NSNotificationCenter.defaultCenter removeObserver:self];
 }
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
 
     self.showsSearchBar = YES;
@@ -70,8 +67,7 @@
     [self updateTransactions];
 }
 
-- (void)settingsButtonTapped:(id)sender
-{
+- (void)settingsButtonTapped:(id)sender {
     FLEXNetworkSettingsTableViewController *settingsViewController = [FLEXNetworkSettingsTableViewController new];
     settingsViewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(settingsViewControllerDoneTapped:)];
     settingsViewController.title = @"Network Debugging Settings";
@@ -80,18 +76,15 @@
     [self presentViewController:wrapperNavigationController animated:YES completion:nil];
 }
 
-- (void)settingsViewControllerDoneTapped:(id)sender
-{
+- (void)settingsViewControllerDoneTapped:(id)sender {
     [self dismissViewControllerAnimated:YES completion:nil];
 }
 
-- (void)updateTransactions
-{
+- (void)updateTransactions {
     self.networkTransactions = [[FLEXNetworkRecorder defaultRecorder] networkTransactions];
 }
 
-- (void)setNetworkTransactions:(NSArray<FLEXNetworkTransaction *> *)networkTransactions
-{
+- (void)setNetworkTransactions:(NSArray<FLEXNetworkTransaction *> *)networkTransactions {
     if (![_networkTransactions isEqual:networkTransactions]) {
         _networkTransactions = networkTransactions;
         [self updateBytesReceived];
@@ -99,8 +92,7 @@
     }
 }
 
-- (void)updateBytesReceived
-{
+- (void)updateBytesReceived {
     long long bytesReceived = 0;
     for (FLEXNetworkTransaction *transaction in self.networkTransactions) {
         bytesReceived += transaction.receivedDataLength;
@@ -109,16 +101,14 @@
     [self updateFirstSectionHeader];
 }
 
-- (void)setFilteredNetworkTransactions:(NSArray<FLEXNetworkTransaction *> *)filteredNetworkTransactions
-{
+- (void)setFilteredNetworkTransactions:(NSArray<FLEXNetworkTransaction *> *)filteredNetworkTransactions {
     if (![_filteredNetworkTransactions isEqual:filteredNetworkTransactions]) {
         _filteredNetworkTransactions = filteredNetworkTransactions;
         [self updateFilteredBytesReceived];
     }
 }
 
-- (void)updateFilteredBytesReceived
-{
+- (void)updateFilteredBytesReceived {
     long long filteredBytesReceived = 0;
     for (FLEXNetworkTransaction *transaction in self.filteredNetworkTransactions) {
         filteredBytesReceived += transaction.receivedDataLength;
@@ -127,8 +117,7 @@
     [self updateFirstSectionHeader];
 }
 
-- (void)updateFirstSectionHeader
-{
+- (void)updateFirstSectionHeader {
     UIView *view = [self.tableView headerViewForSection:0];
     if ([view isKindOfClass:[UITableViewHeaderFooterView class]]) {
         UITableViewHeaderFooterView *headerView = (UITableViewHeaderFooterView *)view;
@@ -137,8 +126,7 @@
     }
 }
 
-- (NSString *)headerText
-{
+- (NSString *)headerText {
     NSString *headerText = nil;
     if (FLEXNetworkObserver.isEnabled) {
         long long bytesReceived = 0;
@@ -171,15 +159,13 @@
 
 #pragma mark - Notification Handlers
 
-- (void)handleNewTransactionRecordedNotification:(NSNotification *)notification
-{
+- (void)handleNewTransactionRecordedNotification:(NSNotification *)notification {
     if (self.viewIfLoaded.window) {
         [self tryUpdateTransactions];
     }
 }
 
-- (void)tryUpdateTransactions
-{
+- (void)tryUpdateTransactions {
     // Let the previous row insert animation finish before starting a new one to avoid stomping.
     // We'll try calling the method again when the insertion completes, and we properly no-op if there haven't been changes.
     if (self.rowInsertInProgress) {
@@ -225,8 +211,7 @@
     }
 }
 
-- (void)handleTransactionUpdatedNotification:(NSNotification *)notification
-{
+- (void)handleTransactionUpdatedNotification:(NSNotification *)notification {
     [self updateBytesReceived];
     [self updateFilteredBytesReceived];
 
@@ -245,40 +230,34 @@
     [self updateFirstSectionHeader];
 }
 
-- (void)handleTransactionsClearedNotification:(NSNotification *)notification
-{
+- (void)handleTransactionsClearedNotification:(NSNotification *)notification {
     [self updateTransactions];
     [self.tableView reloadData];
 }
 
-- (void)handleNetworkObserverEnabledStateChangedNotification:(NSNotification *)notification
-{
+- (void)handleNetworkObserverEnabledStateChangedNotification:(NSNotification *)notification {
     // Update the header, which displays a warning when network debugging is disabled
     [self updateFirstSectionHeader];
 }
 
 #pragma mark - Table view data source
 
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     return self.searchController.isActive ? self.filteredNetworkTransactions.count : self.networkTransactions.count;
 }
 
-- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
-{
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
     return [self headerText];
 }
 
-- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
-{
+- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section {
     if ([view isKindOfClass:[UITableViewHeaderFooterView class]]) {
         UITableViewHeaderFooterView *headerView = (UITableViewHeaderFooterView *)view;
         headerView.textLabel.font = [UIFont systemFontOfSize:14.0 weight:UIFontWeightSemibold];
     }
 }
 
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     FLEXNetworkTransactionTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kFLEXNetworkTransactionCellIdentifier forIndexPath:indexPath];
     cell.transaction = [self transactionAtIndexPath:indexPath];
 
@@ -293,8 +272,7 @@
     return cell;
 }
 
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     FLEXNetworkTransactionDetailTableViewController *detailViewController = [FLEXNetworkTransactionDetailTableViewController new];
     detailViewController.transaction = [self transactionAtIndexPath:indexPath];
     [self.navigationController pushViewController:detailViewController animated:YES];
@@ -302,18 +280,15 @@
 
 #pragma mark - Menu Actions
 
-- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath {
     return YES;
 }
 
-- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
-{
+- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender {
     return action == @selector(copy:);
 }
 
-- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
-{
+- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender {
     if (action == @selector(copy:)) {
         NSURLRequest *request = [self transactionAtIndexPath:indexPath].request;
         UIPasteboard.generalPasteboard.string = request.URL.absoluteString ?: @"";
@@ -322,8 +297,7 @@
 
 #if FLEX_AT_LEAST_IOS13_SDK
 
-- (UIContextMenuConfiguration *)tableView:(UITableView *)tableView contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath point:(CGPoint)point __IOS_AVAILABLE(13.0)
-{
+- (UIContextMenuConfiguration *)tableView:(UITableView *)tableView contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath point:(CGPoint)point __IOS_AVAILABLE(13.0) {
     return [UIContextMenuConfiguration
         configurationWithIdentifier:nil
         previewProvider:nil
@@ -348,15 +322,13 @@
 
 #endif
 
-- (FLEXNetworkTransaction *)transactionAtIndexPath:(NSIndexPath *)indexPath
-{
+- (FLEXNetworkTransaction *)transactionAtIndexPath:(NSIndexPath *)indexPath {
     return self.searchController.isActive ? self.filteredNetworkTransactions[indexPath.row] : self.networkTransactions[indexPath.row];
 }
 
 #pragma mark - Search Bar
 
-- (void)updateSearchResults:(NSString *)searchString
-{
+- (void)updateSearchResults:(NSString *)searchString {
     [self onBackgroundQueue:^NSArray *{
         return [self.networkTransactions filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(FLEXNetworkTransaction *transaction, NSDictionary<NSString *, id> *bindings) {
             return [[transaction.request.URL absoluteString] rangeOfString:searchString options:NSCaseInsensitiveSearch].length > 0;
@@ -371,18 +343,15 @@
 
 #pragma mark UISearchControllerDelegate
 
-- (void)willPresentSearchController:(UISearchController *)searchController
-{
+- (void)willPresentSearchController:(UISearchController *)searchController {
     self.isPresentingSearch = YES;
 }
 
-- (void)didPresentSearchController:(UISearchController *)searchController
-{
+- (void)didPresentSearchController:(UISearchController *)searchController {
     self.isPresentingSearch = NO;
 }
 
-- (void)willDismissSearchController:(UISearchController *)searchController
-{
+- (void)willDismissSearchController:(UISearchController *)searchController {
     [self.tableView reloadData];
 }
 

+ 15 - 30
Classes/Network/FLEXNetworkRecorder.m

@@ -30,8 +30,7 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
 
 @implementation FLEXNetworkRecorder
 
-- (instancetype)init
-{
+- (instancetype)init {
     self = [super init];
     if (self) {
         self.responseCache = [NSCache new];
@@ -51,8 +50,7 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
     return self;
 }
 
-+ (instancetype)defaultRecorder
-{
++ (instancetype)defaultRecorder {
     static FLEXNetworkRecorder *defaultRecorder = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
@@ -63,19 +61,16 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
 
 #pragma mark - Public Data Access
 
-- (NSUInteger)responseCacheByteLimit
-{
+- (NSUInteger)responseCacheByteLimit {
     return [self.responseCache totalCostLimit];
 }
 
-- (void)setResponseCacheByteLimit:(NSUInteger)responseCacheByteLimit
-{
+- (void)setResponseCacheByteLimit:(NSUInteger)responseCacheByteLimit {
     [self.responseCache setTotalCostLimit:responseCacheByteLimit];
     [[NSUserDefaults standardUserDefaults] setObject:@(responseCacheByteLimit) forKey:kFLEXNetworkRecorderResponseCacheLimitDefaultsKey];
 }
 
-- (NSArray<FLEXNetworkTransaction *> *)networkTransactions
-{
+- (NSArray<FLEXNetworkTransaction *> *)networkTransactions {
     __block NSArray<FLEXNetworkTransaction *> *transactions = nil;
     dispatch_sync(self.queue, ^{
         transactions = [self.orderedTransactions copy];
@@ -83,13 +78,11 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
     return transactions;
 }
 
-- (NSData *)cachedResponseBodyForTransaction:(FLEXNetworkTransaction *)transaction
-{
+- (NSData *)cachedResponseBodyForTransaction:(FLEXNetworkTransaction *)transaction {
     return [self.responseCache objectForKey:transaction.requestID];
 }
 
-- (void)clearRecordedActivity
-{
+- (void)clearRecordedActivity {
     dispatch_async(self.queue, ^{
         [self.responseCache removeAllObjects];
         [self.orderedTransactions removeAllObjects];
@@ -102,8 +95,7 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
 
 #pragma mark - Network Events
 
-- (void)recordRequestWillBeSentWithRequestID:(NSString *)requestID request:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse
-{
+- (void)recordRequestWillBeSentWithRequestID:(NSString *)requestID request:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse {
     for (NSString *host in self.hostBlacklist) {
         if ([request.URL.host hasSuffix:host]) {
             return;
@@ -131,8 +123,7 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
     });
 }
 
-- (void)recordResponseReceivedWithRequestID:(NSString *)requestID response:(NSURLResponse *)response
-{
+- (void)recordResponseReceivedWithRequestID:(NSString *)requestID response:(NSURLResponse *)response {
     NSDate *responseDate = [NSDate date];
 
     dispatch_async(self.queue, ^{
@@ -148,8 +139,7 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
     });
 }
 
-- (void)recordDataReceivedWithRequestID:(NSString *)requestID dataLength:(int64_t)dataLength
-{
+- (void)recordDataReceivedWithRequestID:(NSString *)requestID dataLength:(int64_t)dataLength {
     dispatch_async(self.queue, ^{
         FLEXNetworkTransaction *transaction = self.networkTransactionsForRequestIdentifiers[requestID];
         if (!transaction) {
@@ -161,8 +151,7 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
     });
 }
 
-- (void)recordLoadingFinishedWithRequestID:(NSString *)requestID responseBody:(NSData *)responseBody
-{
+- (void)recordLoadingFinishedWithRequestID:(NSString *)requestID responseBody:(NSData *)responseBody {
     NSDate *finishedDate = [NSDate date];
 
     dispatch_async(self.queue, ^{
@@ -219,8 +208,7 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
     });
 }
 
-- (void)recordLoadingFailedWithRequestID:(NSString *)requestID error:(NSError *)error
-{
+- (void)recordLoadingFailedWithRequestID:(NSString *)requestID error:(NSError *)error {
     dispatch_async(self.queue, ^{
         FLEXNetworkTransaction *transaction = self.networkTransactionsForRequestIdentifiers[requestID];
         if (!transaction) {
@@ -234,8 +222,7 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
     });
 }
 
-- (void)recordMechanism:(NSString *)mechanism forRequestID:(NSString *)requestID
-{
+- (void)recordMechanism:(NSString *)mechanism forRequestID:(NSString *)requestID {
     dispatch_async(self.queue, ^{
         FLEXNetworkTransaction *transaction = self.networkTransactionsForRequestIdentifiers[requestID];
         if (!transaction) {
@@ -249,16 +236,14 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
 
 #pragma mark Notification Posting
 
-- (void)postNewTransactionNotificationWithTransaction:(FLEXNetworkTransaction *)transaction
-{
+- (void)postNewTransactionNotificationWithTransaction:(FLEXNetworkTransaction *)transaction {
     dispatch_async(dispatch_get_main_queue(), ^{
         NSDictionary<NSString *, id> *userInfo = @{ kFLEXNetworkRecorderUserInfoTransactionKey : transaction };
         [NSNotificationCenter.defaultCenter postNotificationName:kFLEXNetworkRecorderNewTransactionNotification object:self userInfo:userInfo];
     });
 }
 
-- (void)postUpdateNotificationForTransaction:(FLEXNetworkTransaction *)transaction
-{
+- (void)postUpdateNotificationForTransaction:(FLEXNetworkTransaction *)transaction {
     dispatch_async(dispatch_get_main_queue(), ^{
         NSDictionary<NSString *, id> *userInfo = @{ kFLEXNetworkRecorderUserInfoTransactionKey : transaction };
         [NSNotificationCenter.defaultCenter postNotificationName:kFLEXNetworkRecorderTransactionUpdatedNotification object:self userInfo:userInfo];

+ 14 - 28
Classes/Network/FLEXNetworkSettingsTableViewController.m

@@ -21,8 +21,7 @@
 
 @implementation FLEXNetworkSettingsTableViewController
 
-- (instancetype)initWithStyle:(UITableViewStyle)style
-{
+- (instancetype)initWithStyle:(UITableViewStyle)style {
     self = [super initWithStyle:UITableViewStyleGrouped];
     if (self) {
 
@@ -30,8 +29,7 @@
     return self;
 }
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
 
     NSMutableArray<UITableViewCell *> *mutableCells = [NSMutableArray array];
@@ -56,24 +54,20 @@
 
 #pragma mark - Settings Actions
 
-- (void)networkDebuggingToggled:(UISwitch *)sender
-{
+- (void)networkDebuggingToggled:(UISwitch *)sender {
     [FLEXNetworkObserver setEnabled:sender.isOn];
 }
 
-- (void)cacheMediaResponsesToggled:(UISwitch *)sender
-{
+- (void)cacheMediaResponsesToggled:(UISwitch *)sender {
     [[FLEXNetworkRecorder defaultRecorder] setShouldCacheMediaResponses:sender.isOn];
 }
 
-- (void)cacheLimitAdjusted:(UISlider *)sender
-{
+- (void)cacheLimitAdjusted:(UISlider *)sender {
     [[FLEXNetworkRecorder defaultRecorder] setResponseCacheByteLimit:sender.value];
     self.cacheLimitCell.textLabel.text = [self titleForCacheLimitCellWithValue:sender.value];
 }
 
-- (void)clearRequestsTapped:(UIButton *)sender
-{
+- (void)clearRequestsTapped:(UIButton *)sender {
     [FLEXAlert makeSheet:^(FLEXAlert *make) {
         make.button(@"Cancel").cancelStyle();
         make.button(@"Clear Recorded Requests").destructiveStyle().handler(^(NSArray *strings) {
@@ -87,25 +81,21 @@
 
 #pragma mark - Table view data source
 
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
     return 1;
 }
 
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     return self.cells.count;
 }
 
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
-{
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath  {
     return self.cells[indexPath.row];
 }
 
 #pragma mark - Helpers
 
-- (UITableViewCell *)switchCellWithTitle:(NSString *)title toggleAction:(SEL)toggleAction isOn:(BOOL)isOn
-{
+- (UITableViewCell *)switchCellWithTitle:(NSString *)title toggleAction:(SEL)toggleAction isOn:(BOOL)isOn {
     UITableViewCell *cell = [UITableViewCell new];
     cell.selectionStyle = UITableViewCellSelectionStyleNone;
     cell.textLabel.text = title;
@@ -124,8 +114,7 @@
     return cell;
 }
 
-- (UITableViewCell *)buttonCellWithTitle:(NSString *)title touchUpAction:(SEL)action isDestructive:(BOOL)isDestructive
-{
+- (UITableViewCell *)buttonCellWithTitle:(NSString *)title touchUpAction:(SEL)action isDestructive:(BOOL)isDestructive {
     UITableViewCell *buttonCell = [UITableViewCell new];
     buttonCell.selectionStyle = UITableViewCellSelectionStyleNone;
 
@@ -146,14 +135,12 @@
     return buttonCell;
 }
 
-- (NSString *)titleForCacheLimitCellWithValue:(long long)cacheLimit
-{
+- (NSString *)titleForCacheLimitCellWithValue:(long long)cacheLimit {
     NSInteger limitInMB = round(cacheLimit / (1024 * 1024));
     return [NSString stringWithFormat:@"Cache Limit (%ld MB)", (long)limitInMB];
 }
 
-- (UITableViewCell *)sliderCellWithTitle:(NSString *)title changedAction:(SEL)changedAction minimum:(CGFloat)minimum maximum:(CGFloat)maximum initialValue:(CGFloat)initialValue
-{
+- (UITableViewCell *)sliderCellWithTitle:(NSString *)title changedAction:(SEL)changedAction minimum:(CGFloat)minimum maximum:(CGFloat)maximum initialValue:(CGFloat)initialValue {
     UITableViewCell *sliderCell = [UITableViewCell new];
     sliderCell.selectionStyle = UITableViewCellSelectionStyleNone;
     sliderCell.textLabel.text = title;
@@ -176,8 +163,7 @@
     return sliderCell;
 }
 
-+ (UIFont *)cellTitleFont
-{
++ (UIFont *)cellTitleFont {
     return [UIFont systemFontOfSize:14.0];
 }
 

+ 2 - 4
Classes/Network/FLEXNetworkTransaction.m

@@ -16,8 +16,7 @@
 
 @implementation FLEXNetworkTransaction
 
-- (NSString *)description
-{
+- (NSString *)description {
     NSString *description = [super description];
 
     description = [description stringByAppendingFormat:@" id = %@;", self.requestID];
@@ -50,8 +49,7 @@
     return _cachedRequestBody;
 }
 
-+ (NSString *)readableStringFromTransactionState:(FLEXNetworkTransactionState)state
-{
++ (NSString *)readableStringFromTransactionState:(FLEXNetworkTransactionState)state {
     NSString *readableString = nil;
     switch (state) {
         case FLEXNetworkTransactionStateUnstarted:

+ 28 - 56
Classes/Network/FLEXNetworkTransactionDetailTableViewController.m

@@ -51,8 +51,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
 
 @implementation FLEXNetworkTransactionDetailTableViewController
 
-- (instancetype)initWithStyle:(UITableViewStyle)style
-{
+- (instancetype)initWithStyle:(UITableViewStyle)style {
     // Force grouped style
     self = [super initWithStyle:UITableViewStyleGrouped];
     if (self) {
@@ -62,15 +61,13 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     return self;
 }
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
 
     [self.tableView registerClass:[FLEXMultilineTableViewCell class] forCellReuseIdentifier:kFLEXMultilineCell];
 }
 
-- (void)setTransaction:(FLEXNetworkTransaction *)transaction
-{
+- (void)setTransaction:(FLEXNetworkTransaction *)transaction {
     if (![_transaction isEqual:transaction]) {
         _transaction = transaction;
         self.title = [transaction.request.URL lastPathComponent];
@@ -78,16 +75,14 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     }
 }
 
-- (void)setSections:(NSArray<FLEXNetworkDetailSection *> *)sections
-{
+- (void)setSections:(NSArray<FLEXNetworkDetailSection *> *)sections {
     if (![_sections isEqual:sections]) {
         _sections = [sections copy];
         [self.tableView reloadData];
     }
 }
 
-- (void)rebuildTableSections
-{
+- (void)rebuildTableSections {
     NSMutableArray<FLEXNetworkDetailSection *> *sections = [NSMutableArray array];
 
     FLEXNetworkDetailSection *generalSection = [[self class] generalSectionForTransaction:self.transaction];
@@ -114,40 +109,34 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     self.sections = sections;
 }
 
-- (void)handleTransactionUpdatedNotification:(NSNotification *)notification
-{
+- (void)handleTransactionUpdatedNotification:(NSNotification *)notification {
     FLEXNetworkTransaction *transaction = [[notification userInfo] objectForKey:kFLEXNetworkRecorderUserInfoTransactionKey];
     if (transaction == self.transaction) {
         [self rebuildTableSections];
     }
 }
 
-- (void)copyButtonPressed:(id)sender
-{
+- (void)copyButtonPressed:(id)sender {
     [UIPasteboard.generalPasteboard setString:[FLEXNetworkCurlLogger curlCommandString:_transaction.request]];
 }
 
 #pragma mark - Table view data source
 
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
     return self.sections.count;
 }
 
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     FLEXNetworkDetailSection *sectionModel = self.sections[section];
     return sectionModel.rows.count;
 }
 
-- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
-{
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
     FLEXNetworkDetailSection *sectionModel = self.sections[section];
     return sectionModel.title;
 }
 
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     FLEXMultilineTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kFLEXMultilineCell forIndexPath:indexPath];
 
     FLEXNetworkDetailRow *rowModel = [self rowModelAtIndexPath:indexPath];
@@ -159,8 +148,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     return cell;
 }
 
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     FLEXNetworkDetailRow *rowModel = [self rowModelAtIndexPath:indexPath];
 
     UIViewController *viewController = nil;
@@ -177,8 +165,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     [tableView deselectRowAtIndexPath:indexPath animated:YES];
 }
 
-- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
     FLEXNetworkDetailRow *row = [self rowModelAtIndexPath:indexPath];
     NSAttributedString *attributedText = [[self class] attributedTextForRow:row];
     BOOL showsAccessory = row.selectionFuture != nil;
@@ -190,26 +177,22 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     ];
 }
 
-- (FLEXNetworkDetailRow *)rowModelAtIndexPath:(NSIndexPath *)indexPath
-{
+- (FLEXNetworkDetailRow *)rowModelAtIndexPath:(NSIndexPath *)indexPath {
     FLEXNetworkDetailSection *sectionModel = self.sections[indexPath.section];
     return sectionModel.rows[indexPath.row];
 }
 
 #pragma mark - Cell Copying
 
-- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath {
     return YES;
 }
 
-- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
-{
+- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender {
     return action == @selector(copy:);
 }
 
-- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
-{
+- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender {
     if (action == @selector(copy:)) {
         FLEXNetworkDetailRow *row = [self rowModelAtIndexPath:indexPath];
         UIPasteboard.generalPasteboard.string = row.detailText;
@@ -218,8 +201,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
 
 #if FLEX_AT_LEAST_IOS13_SDK
 
-- (UIContextMenuConfiguration *)tableView:(UITableView *)tableView contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath point:(CGPoint)point __IOS_AVAILABLE(13.0)
-{
+- (UIContextMenuConfiguration *)tableView:(UITableView *)tableView contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath point:(CGPoint)point __IOS_AVAILABLE(13.0) {
     return [UIContextMenuConfiguration
         configurationWithIdentifier:nil
         previewProvider:nil
@@ -246,8 +228,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
 
 #pragma mark - View Configuration
 
-+ (NSAttributedString *)attributedTextForRow:(FLEXNetworkDetailRow *)row
-{
++ (NSAttributedString *)attributedTextForRow:(FLEXNetworkDetailRow *)row {
     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 : UIFont.flex_defaultTableCellFont,
@@ -264,8 +245,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
 
 #pragma mark - Table Data Generation
 
-+ (FLEXNetworkDetailSection *)generalSectionForTransaction:(FLEXNetworkTransaction *)transaction
-{
++ (FLEXNetworkDetailSection *)generalSectionForTransaction:(FLEXNetworkTransaction *)transaction {
     NSMutableArray<FLEXNetworkDetailRow *> *rows = [NSMutableArray array];
 
     FLEXNetworkDetailRow *requestURLRow = [FLEXNetworkDetailRow new];
@@ -420,8 +400,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     return generalSection;
 }
 
-+ (FLEXNetworkDetailSection *)requestHeadersSectionForTransaction:(FLEXNetworkTransaction *)transaction
-{
++ (FLEXNetworkDetailSection *)requestHeadersSectionForTransaction:(FLEXNetworkTransaction *)transaction {
     FLEXNetworkDetailSection *requestHeadersSection = [FLEXNetworkDetailSection new];
     requestHeadersSection.title = @"Request Headers";
     requestHeadersSection.rows = [self networkDetailRowsFromDictionary:transaction.request.allHTTPHeaderFields];
@@ -429,8 +408,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     return requestHeadersSection;
 }
 
-+ (FLEXNetworkDetailSection *)postBodySectionForTransaction:(FLEXNetworkTransaction *)transaction
-{
++ (FLEXNetworkDetailSection *)postBodySectionForTransaction:(FLEXNetworkTransaction *)transaction {
     FLEXNetworkDetailSection *postBodySection = [FLEXNetworkDetailSection new];
     postBodySection.title = @"Request Body Parameters";
     if (transaction.cachedRequestBody.length > 0) {
@@ -443,8 +421,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     return postBodySection;
 }
 
-+ (FLEXNetworkDetailSection *)queryParametersSectionForTransaction:(FLEXNetworkTransaction *)transaction
-{
++ (FLEXNetworkDetailSection *)queryParametersSectionForTransaction:(FLEXNetworkTransaction *)transaction {
     NSArray<NSURLQueryItem *> *queries = [FLEXUtility itemsFromQueryString:transaction.request.URL.query];
     FLEXNetworkDetailSection *querySection = [FLEXNetworkDetailSection new];
     querySection.title = @"Query Parameters";
@@ -453,8 +430,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     return querySection;
 }
 
-+ (FLEXNetworkDetailSection *)responseHeadersSectionForTransaction:(FLEXNetworkTransaction *)transaction
-{
++ (FLEXNetworkDetailSection *)responseHeadersSectionForTransaction:(FLEXNetworkTransaction *)transaction {
     FLEXNetworkDetailSection *responseHeadersSection = [FLEXNetworkDetailSection new];
     responseHeadersSection.title = @"Response Headers";
     if ([transaction.response isKindOfClass:[NSHTTPURLResponse class]]) {
@@ -464,8 +440,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     return responseHeadersSection;
 }
 
-+ (NSArray<FLEXNetworkDetailRow *> *)networkDetailRowsFromDictionary:(NSDictionary<NSString *, id> *)dictionary
-{
++ (NSArray<FLEXNetworkDetailRow *> *)networkDetailRowsFromDictionary:(NSDictionary<NSString *, id> *)dictionary {
     NSMutableArray<FLEXNetworkDetailRow *> *rows = [NSMutableArray new];
     NSArray<NSString *> *sortedKeys = [dictionary.allKeys sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
     
@@ -480,8 +455,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     return rows.copy;
 }
 
-+ (NSArray<FLEXNetworkDetailRow *> *)networkDetailRowsFromQueryItems:(NSArray<NSURLQueryItem *> *)items
-{
++ (NSArray<FLEXNetworkDetailRow *> *)networkDetailRowsFromQueryItems:(NSArray<NSURLQueryItem *> *)items {
     // Sort the items by name
     items = [items sortedArrayUsingComparator:^NSComparisonResult(NSURLQueryItem *item1, NSURLQueryItem *item2) {
         return [item1.name caseInsensitiveCompare:item2.name];
@@ -498,8 +472,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     return [rows copy];
 }
 
-+ (UIViewController *)detailViewControllerForMIMEType:(NSString *)mimeType data:(NSData *)data
-{
++ (UIViewController *)detailViewControllerForMIMEType:(NSString *)mimeType data:(NSData *)data {
     FLEXCustomContentViewerFuture makeCustomViewer = [FLEXManager sharedManager].customContentTypeViewers[mimeType.lowercaseString];
 
     if (makeCustomViewer) {
@@ -535,8 +508,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
     return detailViewController;
 }
 
-+ (NSData *)postBodyDataForTransaction:(FLEXNetworkTransaction *)transaction
-{
++ (NSData *)postBodyDataForTransaction:(FLEXNetworkTransaction *)transaction {
     NSData *bodyData = transaction.cachedRequestBody;
     if (bodyData.length > 0) {
         NSString *contentEncoding = [transaction.request valueForHTTPHeaderField:@"Content-Encoding"];

+ 9 - 17
Classes/Network/FLEXNetworkTransactionTableViewCell.m

@@ -25,8 +25,7 @@ NSString *const kFLEXNetworkTransactionCellIdentifier = @"kFLEXNetworkTransactio
 
 @implementation FLEXNetworkTransactionTableViewCell
 
-- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
-{
+- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
     self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
     if (self) {
         self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
@@ -54,16 +53,14 @@ NSString *const kFLEXNetworkTransactionCellIdentifier = @"kFLEXNetworkTransactio
     return self;
 }
 
-- (void)setTransaction:(FLEXNetworkTransaction *)transaction
-{
+- (void)setTransaction:(FLEXNetworkTransaction *)transaction {
     if (_transaction != transaction) {
         _transaction = transaction;
         [self setNeedsLayout];
     }
 }
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     [super layoutSubviews];
 
     const CGFloat kVerticalPadding = 8.0;
@@ -95,8 +92,7 @@ NSString *const kFLEXNetworkTransactionCellIdentifier = @"kFLEXNetworkTransactio
     self.transactionDetailsLabel.frame = CGRectMake(transactionDetailsOriginX, transactionDetailsLabelOriginY, transactionDetailsLabelWidth, transactionLabelPreferredSize.height);
 }
 
-- (NSString *)nameLabelText
-{
+- (NSString *)nameLabelText {
     NSURL *url = self.transaction.request.URL;
     NSString *name = [url lastPathComponent];
     if (name.length == 0) {
@@ -109,10 +105,9 @@ NSString *const kFLEXNetworkTransactionCellIdentifier = @"kFLEXNetworkTransactio
     return name;
 }
 
-- (NSString *)pathLabelText
-{
+- (NSString *)pathLabelText {
     NSURL *url = self.transaction.request.URL;
-    NSMutableArray<NSString *> *mutablePathComponents = [[url pathComponents] mutableCopy];
+    NSMutableArray<NSString *> *mutablePathComponents = url.pathComponents.mutableCopy;
     if (mutablePathComponents.count > 0) {
         [mutablePathComponents removeLastObject];
     }
@@ -123,8 +118,7 @@ NSString *const kFLEXNetworkTransactionCellIdentifier = @"kFLEXNetworkTransactio
     return path;
 }
 
-- (NSString *)transactionDetailsLabelText
-{
+- (NSString *)transactionDetailsLabelText {
     NSMutableArray<NSString *> *detailComponents = [NSMutableArray array];
 
     NSString *timestamp = [[self class] timestampStringFromRequestDate:self.transaction.startTime];
@@ -162,8 +156,7 @@ NSString *const kFLEXNetworkTransactionCellIdentifier = @"kFLEXNetworkTransactio
     return [detailComponents componentsJoinedByString:@" ・ "];
 }
 
-+ (NSString *)timestampStringFromRequestDate:(NSDate *)date
-{
++ (NSString *)timestampStringFromRequestDate:(NSDate *)date {
     static NSDateFormatter *dateFormatter = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
@@ -173,8 +166,7 @@ NSString *const kFLEXNetworkTransactionCellIdentifier = @"kFLEXNetworkTransactio
     return [dateFormatter stringFromDate:date];
 }
 
-+ (CGFloat)preferredCellHeight
-{
++ (CGFloat)preferredCellHeight {
     return 65.0;
 }
 

+ 49 - 98
Classes/Network/PonyDebugger/FLEXNetworkObserver.m

@@ -77,8 +77,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
 
 #pragma mark - Public Methods
 
-+ (void)setEnabled:(BOOL)enabled
-{
++ (void)setEnabled:(BOOL)enabled {
     BOOL previouslyEnabled = [self isEnabled];
     
     [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:kFLEXNetworkObserverEnabledDefaultsKey];
@@ -94,13 +93,11 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     }
 }
 
-+ (BOOL)isEnabled
-{
++ (BOOL)isEnabled {
     return [[[NSUserDefaults standardUserDefaults] objectForKey:kFLEXNetworkObserverEnabledDefaultsKey] boolValue];
 }
 
-+ (void)load
-{
++ (void)load {
     // We don't want to do the swizzling from +load because not all the classes may be loaded at this point.
     dispatch_async(dispatch_get_main_queue(), ^{
         if ([self isEnabled]) {
@@ -111,8 +108,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
 
 #pragma mark - Statics
 
-+ (instancetype)sharedObserver
-{
++ (instancetype)sharedObserver {
     static FLEXNetworkObserver *sharedObserver = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
@@ -121,8 +117,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     return sharedObserver;
 }
 
-+ (NSString *)nextRequestID
-{
++ (NSString *)nextRequestID {
     return [[NSUUID UUID] UUIDString];
 }
 
@@ -131,8 +126,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
 /// All swizzled delegate methods should make use of this guard.
 /// This will prevent duplicated sniffing when the original implementation calls up to a superclass implementation which we've also swizzled.
 /// The superclass implementation (and implementations in classes above that) will be executed without interference if called from the original implementation.
-+ (void)sniffWithoutDuplicationForObject:(NSObject *)object selector:(SEL)selector sniffingBlock:(void (^)(void))sniffingBlock originalImplementationBlock:(void (^)(void))originalImplementationBlock
-{
++ (void)sniffWithoutDuplicationForObject:(NSObject *)object selector:(SEL)selector sniffingBlock:(void (^)(void))sniffingBlock originalImplementationBlock:(void (^)(void))originalImplementationBlock {
     // If we don't have an object to detect nested calls on, just run the original implementation and bail.
     // This case can happen if someone besides the URL loading system calls the delegate methods directly.
     // See https://github.com/Flipboard/FLEX/issues/61 for an example.
@@ -156,8 +150,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
 
 #pragma mark - Delegate Injection
 
-+ (void)injectIntoAllNSURLConnectionDelegateClasses
-{
++ (void)injectIntoAllNSURLConnectionDelegateClasses {
     // Only allow swizzling once.
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
@@ -227,8 +220,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     });
 }
 
-+ (void)injectIntoDelegateClass:(Class)cls
-{
++ (void)injectIntoDelegateClass:(Class)cls {
     // Connections
     [self injectWillSendRequestIntoDelegateClass:cls];
     [self injectDidReceiveDataIntoDelegateClass:cls];
@@ -251,8 +243,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     [self injectDownloadTaskDidFinishDownloadingIntoDelegateClass:cls];
 }
 
-+ (void)injectIntoNSURLConnectionCancel
-{
++ (void)injectIntoNSURLConnectionCancel {
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
         Class class = [NSURLConnection class];
@@ -272,8 +263,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     });
 }
 
-+ (void)injectIntoNSURLSessionTaskResume
-{
++ (void)injectIntoNSURLSessionTaskResume {
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
         // In iOS 7 resume lives in __NSCFLocalSessionTask
@@ -312,8 +302,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     });
 }
 
-+ (void)injectIntoNSURLConnectionAsynchronousClassMethod
-{
++ (void)injectIntoNSURLConnectionAsynchronousClassMethod {
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
         Class class = objc_getMetaClass(class_getName([NSURLConnection class]));
@@ -352,8 +341,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     });
 }
 
-+ (void)injectIntoNSURLConnectionSynchronousClassMethod
-{
++ (void)injectIntoNSURLConnectionSynchronousClassMethod {
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
         Class class = objc_getMetaClass(class_getName([NSURLConnection class]));
@@ -394,8 +382,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     });
 }
 
-+ (void)injectIntoNSURLSessionAsyncDataAndDownloadTaskMethods
-{
++ (void)injectIntoNSURLSessionAsyncDataAndDownloadTaskMethods {
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
         Class class = [NSURLSession class];
@@ -443,8 +430,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     });
 }
 
-+ (void)injectIntoNSURLSessionAsyncUploadTaskMethods
-{
++ (void)injectIntoNSURLSessionAsyncUploadTaskMethods {
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
         Class class = [NSURLSession class];
@@ -487,13 +473,11 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     });
 }
 
-+ (NSString *)mechanismFromClassMethod:(SEL)selector onClass:(Class)class
-{
++ (NSString *)mechanismFromClassMethod:(SEL)selector onClass:(Class)class {
     return [NSString stringWithFormat:@"+[%@ %@]", NSStringFromClass(class), NSStringFromSelector(selector)];
 }
 
-+ (NSURLSessionAsyncCompletion)asyncCompletionWrapperForRequestID:(NSString *)requestID mechanism:(NSString *)mechanism completion:(NSURLSessionAsyncCompletion)completion
-{
++ (NSURLSessionAsyncCompletion)asyncCompletionWrapperForRequestID:(NSString *)requestID mechanism:(NSString *)mechanism completion:(NSURLSessionAsyncCompletion)completion {
     NSURLSessionAsyncCompletion completionWrapper = ^(id fileURLOrData, NSURLResponse *response, NSError *error) {
         [[FLEXNetworkRecorder defaultRecorder] recordMechanism:mechanism forRequestID:requestID];
         [[FLEXNetworkRecorder defaultRecorder] recordResponseReceivedWithRequestID:requestID response:response];
@@ -518,8 +502,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     return completionWrapper;
 }
 
-+ (void)injectWillSendRequestIntoDelegateClass:(Class)cls
-{
++ (void)injectWillSendRequestIntoDelegateClass:(Class)cls {
     SEL selector = @selector(connection:willSendRequest:redirectResponse:);
     SEL swizzledSelector = [FLEXUtility swizzledSelectorForSelector:selector];
     
@@ -550,8 +533,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     [FLEXUtility replaceImplementationOfSelector:selector withSelector:swizzledSelector forClass:cls withMethodDescription:methodDescription implementationBlock:implementationBlock undefinedBlock:undefinedBlock];
 }
 
-+ (void)injectDidReceiveResponseIntoDelegateClass:(Class)cls
-{
++ (void)injectDidReceiveResponseIntoDelegateClass:(Class)cls {
     SEL selector = @selector(connection:didReceiveResponse:);
     SEL swizzledSelector = [FLEXUtility swizzledSelectorForSelector:selector];
     
@@ -579,8 +561,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     [FLEXUtility replaceImplementationOfSelector:selector withSelector:swizzledSelector forClass:cls withMethodDescription:methodDescription implementationBlock:implementationBlock undefinedBlock:undefinedBlock];
 }
 
-+ (void)injectDidReceiveDataIntoDelegateClass:(Class)cls
-{
++ (void)injectDidReceiveDataIntoDelegateClass:(Class)cls {
     SEL selector = @selector(connection:didReceiveData:);
     SEL swizzledSelector = [FLEXUtility swizzledSelectorForSelector:selector];
     
@@ -608,8 +589,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     [FLEXUtility replaceImplementationOfSelector:selector withSelector:swizzledSelector forClass:cls withMethodDescription:methodDescription implementationBlock:implementationBlock undefinedBlock:undefinedBlock];
 }
 
-+ (void)injectDidFinishLoadingIntoDelegateClass:(Class)cls
-{
++ (void)injectDidFinishLoadingIntoDelegateClass:(Class)cls {
     SEL selector = @selector(connectionDidFinishLoading:);
     SEL swizzledSelector = [FLEXUtility swizzledSelectorForSelector:selector];
     
@@ -637,8 +617,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     [FLEXUtility replaceImplementationOfSelector:selector withSelector:swizzledSelector forClass:cls withMethodDescription:methodDescription implementationBlock:implementationBlock undefinedBlock:undefinedBlock];
 }
 
-+ (void)injectDidFailWithErrorIntoDelegateClass:(Class)cls
-{
++ (void)injectDidFailWithErrorIntoDelegateClass:(Class)cls {
     SEL selector = @selector(connection:didFailWithError:);
     SEL swizzledSelector = [FLEXUtility swizzledSelectorForSelector:selector];
     
@@ -662,8 +641,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     [FLEXUtility replaceImplementationOfSelector:selector withSelector:swizzledSelector forClass:cls withMethodDescription:methodDescription implementationBlock:implementationBlock undefinedBlock:undefinedBlock];
 }
 
-+ (void)injectTaskWillPerformHTTPRedirectionIntoDelegateClass:(Class)cls
-{
++ (void)injectTaskWillPerformHTTPRedirectionIntoDelegateClass:(Class)cls {
     SEL selector = @selector(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:);
     SEL swizzledSelector = [FLEXUtility swizzledSelectorForSelector:selector];
 
@@ -690,8 +668,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
 
 }
 
-+ (void)injectTaskDidReceiveDataIntoDelegateClass:(Class)cls
-{
++ (void)injectTaskDidReceiveDataIntoDelegateClass:(Class)cls {
     SEL selector = @selector(URLSession:dataTask:didReceiveData:);
     SEL swizzledSelector = [FLEXUtility swizzledSelectorForSelector:selector];
     
@@ -717,8 +694,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
 
 }
 
-+ (void)injectDataTaskDidBecomeDownloadTaskIntoDelegateClass:(Class)cls
-{
++ (void)injectDataTaskDidBecomeDownloadTaskIntoDelegateClass:(Class)cls {
     SEL selector = @selector(URLSession:dataTask:didBecomeDownloadTask:);
     SEL swizzledSelector = [FLEXUtility swizzledSelectorForSelector:selector];
 
@@ -743,8 +719,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     [FLEXUtility replaceImplementationOfSelector:selector withSelector:swizzledSelector forClass:cls withMethodDescription:methodDescription implementationBlock:implementationBlock undefinedBlock:undefinedBlock];
 }
 
-+ (void)injectTaskDidReceiveResponseIntoDelegateClass:(Class)cls
-{
++ (void)injectTaskDidReceiveResponseIntoDelegateClass:(Class)cls {
     SEL selector = @selector(URLSession:dataTask:didReceiveResponse:completionHandler:);
     SEL swizzledSelector = [FLEXUtility swizzledSelectorForSelector:selector];
     
@@ -771,8 +746,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
 
 }
 
-+ (void)injectTaskDidCompleteWithErrorIntoDelegateClass:(Class)cls
-{
++ (void)injectTaskDidCompleteWithErrorIntoDelegateClass:(Class)cls {
     SEL selector = @selector(URLSession:task:didCompleteWithError:);
     SEL swizzledSelector = [FLEXUtility swizzledSelectorForSelector:selector];
     
@@ -797,8 +771,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
 }
 
 // Used for overriding AFNetworking behavior
-+ (void)injectRespondsToSelectorIntoDelegateClass:(Class)cls
-{
++ (void)injectRespondsToSelectorIntoDelegateClass:(Class)cls {
     SEL selector = @selector(respondsToSelector:);
     SEL swizzledSelector = [FLEXUtility swizzledSelectorForSelector:selector];
 
@@ -821,8 +794,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
 }
 
 
-+ (void)injectDownloadTaskDidFinishDownloadingIntoDelegateClass:(Class)cls
-{
++ (void)injectDownloadTaskDidFinishDownloadingIntoDelegateClass:(Class)cls {
     SEL selector = @selector(URLSession:downloadTask:didFinishDownloadingToURL:);
     SEL swizzledSelector = [FLEXUtility swizzledSelectorForSelector:selector];
 
@@ -847,8 +819,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
     [FLEXUtility replaceImplementationOfSelector:selector withSelector:swizzledSelector forClass:cls withMethodDescription:methodDescription implementationBlock:implementationBlock undefinedBlock:undefinedBlock];
 }
 
-+ (void)injectDownloadTaskDidWriteDataIntoDelegateClass:(Class)cls
-{
++ (void)injectDownloadTaskDidWriteDataIntoDelegateClass:(Class)cls {
     SEL selector = @selector(URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:);
     SEL swizzledSelector = [FLEXUtility swizzledSelectorForSelector:selector];
 
@@ -875,8 +846,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id <NSU
 
 static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
 
-+ (NSString *)requestIDForConnectionOrTask:(id)connectionOrTask
-{
++ (NSString *)requestIDForConnectionOrTask:(id)connectionOrTask {
     NSString *requestID = objc_getAssociatedObject(connectionOrTask, kFLEXRequestIDKey);
     if (!requestID) {
         requestID = [self nextRequestID];
@@ -885,15 +855,13 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
     return requestID;
 }
 
-+ (void)setRequestID:(NSString *)requestID forConnectionOrTask:(id)connectionOrTask
-{
++ (void)setRequestID:(NSString *)requestID forConnectionOrTask:(id)connectionOrTask {
     objc_setAssociatedObject(connectionOrTask, kFLEXRequestIDKey, requestID, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
 }
 
 #pragma mark - Initialization
 
-- (id)init
-{
+- (id)init {
     self = [super init];
     if (self) {
         self.requestStatesForRequestIDs = [NSMutableDictionary new];
@@ -904,15 +872,13 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
 
 #pragma mark - Private Methods
 
-- (void)performBlock:(dispatch_block_t)block
-{
+- (void)performBlock:(dispatch_block_t)block {
     if ([[self class] isEnabled]) {
         dispatch_async(_queue, block);
     }
 }
 
-- (FLEXInternalRequestState *)requestStateForRequestID:(NSString *)requestID
-{
+- (FLEXInternalRequestState *)requestStateForRequestID:(NSString *)requestID {
     FLEXInternalRequestState *requestState = self.requestStatesForRequestIDs[requestID];
     if (!requestState) {
         requestState = [FLEXInternalRequestState new];
@@ -921,8 +887,7 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
     return requestState;
 }
 
-- (void)removeRequestStateForRequestID:(NSString *)requestID
-{
+- (void)removeRequestStateForRequestID:(NSString *)requestID {
     [self.requestStatesForRequestIDs removeObjectForKey:requestID];
 }
 
@@ -931,8 +896,7 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
 
 @implementation FLEXNetworkObserver (NSURLConnectionHelpers)
 
-- (void)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response delegate:(id<NSURLConnectionDelegate>)delegate
-{
+- (void)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response delegate:(id<NSURLConnectionDelegate>)delegate {
     [self performBlock:^{
         NSString *requestID = [[self class] requestIDForConnectionOrTask:connection];
         FLEXInternalRequestState *requestState = [self requestStateForRequestID:requestID];
@@ -943,8 +907,7 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
     }];
 }
 
-- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response delegate:(id<NSURLConnectionDelegate>)delegate
-{
+- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response delegate:(id<NSURLConnectionDelegate>)delegate {
     [self performBlock:^{
         NSString *requestID = [[self class] requestIDForConnectionOrTask:connection];
         FLEXInternalRequestState *requestState = [self requestStateForRequestID:requestID];
@@ -961,8 +924,7 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
     }];
 }
 
-- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data delegate:(id<NSURLConnectionDelegate>)delegate
-{
+- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data delegate:(id<NSURLConnectionDelegate>)delegate {
     // Just to be safe since we're doing this async
     data = [data copy];
     [self performBlock:^{
@@ -973,8 +935,7 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
     }];
 }
 
-- (void)connectionDidFinishLoading:(NSURLConnection *)connection delegate:(id<NSURLConnectionDelegate>)delegate
-{
+- (void)connectionDidFinishLoading:(NSURLConnection *)connection delegate:(id<NSURLConnectionDelegate>)delegate {
     [self performBlock:^{
         NSString *requestID = [[self class] requestIDForConnectionOrTask:connection];
         FLEXInternalRequestState *requestState = [self requestStateForRequestID:requestID];
@@ -983,8 +944,7 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
     }];
 }
 
-- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error delegate:(id<NSURLConnectionDelegate>)delegate
-{
+- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error delegate:(id<NSURLConnectionDelegate>)delegate {
     [self performBlock:^{
         NSString *requestID = [[self class] requestIDForConnectionOrTask:connection];
         FLEXInternalRequestState *requestState = [self requestStateForRequestID:requestID];
@@ -999,8 +959,7 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
     }];
 }
 
-- (void)connectionWillCancel:(NSURLConnection *)connection
-{
+- (void)connectionWillCancel:(NSURLConnection *)connection {
     [self performBlock:^{
         // Mimic the behavior of NSURLSession which is to create an error on cancellation.
         NSDictionary<NSString *, id> *userInfo = @{ NSLocalizedDescriptionKey : @"cancelled" };
@@ -1014,16 +973,14 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
 
 @implementation FLEXNetworkObserver (NSURLSessionTaskHelpers)
 
-- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request completionHandler:(void (^)(NSURLRequest *))completionHandler delegate:(id<NSURLSessionDelegate>)delegate
-{
+- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request completionHandler:(void (^)(NSURLRequest *))completionHandler delegate:(id<NSURLSessionDelegate>)delegate {
     [self performBlock:^{
         NSString *requestID = [[self class] requestIDForConnectionOrTask:task];
         [[FLEXNetworkRecorder defaultRecorder] recordRequestWillBeSentWithRequestID:requestID request:request redirectResponse:response];
     }];
 }
 
-- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveResponse:(NSURLResponse *)response completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler delegate:(id<NSURLSessionDelegate>)delegate
-{
+- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveResponse:(NSURLResponse *)response completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler delegate:(id<NSURLSessionDelegate>)delegate {
     [self performBlock:^{
         NSString *requestID = [[self class] requestIDForConnectionOrTask:dataTask];
         FLEXInternalRequestState *requestState = [self requestStateForRequestID:requestID];
@@ -1043,8 +1000,7 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
     }];
 }
 
-- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id<NSURLSessionDelegate>)delegate
-{
+- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask delegate:(id<NSURLSessionDelegate>)delegate {
     [self performBlock:^{
         // By setting the request ID of the download task to match the data task,
         // it can pick up where the data task left off.
@@ -1053,8 +1009,7 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
     }];
 }
 
-- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data delegate:(id<NSURLSessionDelegate>)delegate
-{
+- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data delegate:(id<NSURLSessionDelegate>)delegate {
     // Just to be safe since we're doing this async
     data = [data copy];
     [self performBlock:^{
@@ -1067,8 +1022,7 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
     }];
 }
 
-- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error delegate:(id<NSURLSessionDelegate>)delegate
-{
+- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error delegate:(id<NSURLSessionDelegate>)delegate {
     [self performBlock:^{
         NSString *requestID = [[self class] requestIDForConnectionOrTask:task];
         FLEXInternalRequestState *requestState = [self requestStateForRequestID:requestID];
@@ -1083,8 +1037,7 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
     }];
 }
 
-- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite delegate:(id<NSURLSessionDelegate>)delegate
-{
+- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite delegate:(id<NSURLSessionDelegate>)delegate {
     [self performBlock:^{
         NSString *requestID = [[self class] requestIDForConnectionOrTask:downloadTask];
         FLEXInternalRequestState *requestState = [self requestStateForRequestID:requestID];
@@ -1102,8 +1055,7 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
     }];
 }
 
-- (void)URLSession:(NSURLSession *)session task:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location data:(NSData *)data delegate:(id<NSURLSessionDelegate>)delegate
-{
+- (void)URLSession:(NSURLSession *)session task:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location data:(NSData *)data delegate:(id<NSURLSessionDelegate>)delegate {
     data = [data copy];
     [self performBlock:^{
         NSString *requestID = [[self class] requestIDForConnectionOrTask:downloadTask];
@@ -1112,8 +1064,7 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
     }];
 }
 
-- (void)URLSessionTaskWillResume:(NSURLSessionTask *)task
-{
+- (void)URLSessionTaskWillResume:(NSURLSessionTask *)task {
     // Since resume can be called multiple times on the same task, only treat the first resume as
     // the equivalent to connection:willSendRequest:...
     [self performBlock:^{

+ 2 - 4
Classes/ObjectExplorers/FLEXObjectExplorer.m

@@ -32,13 +32,11 @@
 
 #pragma mark - Initialization
 
-+ (id)forObject:(id)objectOrClass
-{
++ (id)forObject:(id)objectOrClass {
     return [[self alloc] initWithObject:objectOrClass];
 }
 
-- (id)initWithObject:(id)objectOrClass
-{
+- (id)initWithObject:(id)objectOrClass {
     NSParameterAssert(objectOrClass);
     
     self = [super init];

+ 6 - 12
Classes/ObjectExplorers/FLEXObjectExplorerFactory.m

@@ -23,8 +23,7 @@
 @implementation FLEXObjectExplorerFactory
 static NSMutableDictionary<Class, Class> *classesToRegisteredSections = nil;
 
-+ (void)initialize
-{
++ (void)initialize {
     if (self == [FLEXObjectExplorerFactory class]) {
         #define ClassKey(name) (Class<NSCopying>)[name class]
         #define ClassKeyByName(str) (Class<NSCopying>)NSClassFromString(@ #str)
@@ -46,8 +45,7 @@ static NSMutableDictionary<Class, Class> *classesToRegisteredSections = nil;
     }
 }
 
-+ (FLEXObjectExplorerViewController *)explorerViewControllerForObject:(id)object
-{
++ (FLEXObjectExplorerViewController *)explorerViewControllerForObject:(id)object {
     // Can't explore nil
     if (!object) {
         return nil;
@@ -77,15 +75,13 @@ static NSMutableDictionary<Class, Class> *classesToRegisteredSections = nil;
     ];
 }
 
-+ (void)registerExplorerSection:(Class)explorerClass forClass:(Class)objectClass
-{
++ (void)registerExplorerSection:(Class)explorerClass forClass:(Class)objectClass {
     classesToRegisteredSections[(Class<NSCopying>)objectClass] = explorerClass;
 }
 
 #pragma mark - FLEXGlobalsEntry
 
-+ (NSString *)globalsEntryTitle:(FLEXGlobalsRow)row 
-{
++ (NSString *)globalsEntryTitle:(FLEXGlobalsRow)row  {
     switch (row) {
         case FLEXGlobalsRowAppDelegate:
             return @"🎟  App Delegate";
@@ -111,8 +107,7 @@ static NSMutableDictionary<Class, Class> *classesToRegisteredSections = nil;
     }
 }
 
-+ (UIViewController *)globalsEntryViewController:(FLEXGlobalsRow)row 
-{
++ (UIViewController *)globalsEntryViewController:(FLEXGlobalsRow)row  {
     switch (row) {
         case FLEXGlobalsRowAppDelegate: {
             id<UIApplicationDelegate> appDelegate = UIApplication.sharedApplication.delegate;
@@ -148,8 +143,7 @@ static NSMutableDictionary<Class, Class> *classesToRegisteredSections = nil;
     }
 }
 
-+ (FLEXGlobalsTableViewControllerRowAction)globalsEntryRowAction:(FLEXGlobalsRow)row
-{
++ (FLEXGlobalsTableViewControllerRowAction)globalsEntryRowAction:(FLEXGlobalsRow)row {
     switch (row) {
         case FLEXGlobalsRowRootViewController: {
             // Check if the app delegate responds to -window. If not, present an alert

+ 26 - 52
Classes/ObjectExplorers/FLEXObjectExplorerViewController.m

@@ -40,13 +40,11 @@
 
 #pragma mark - Initialization
 
-+ (instancetype)exploringObject:(id)target
-{
++ (instancetype)exploringObject:(id)target {
     return [self exploringObject:target customSection:[FLEXShortcutsSection forObject:target]];
 }
 
-+ (instancetype)exploringObject:(id)target customSection:(FLEXTableViewSection *)section
-{
++ (instancetype)exploringObject:(id)target customSection:(FLEXTableViewSection *)section {
     return [[self alloc]
         initWithObject:target
         explorer:[FLEXObjectExplorer forObject:target]
@@ -56,8 +54,7 @@
 
 - (id)initWithObject:(id)target
             explorer:(__kindof FLEXObjectExplorer *)explorer
-       customSection:(FLEXTableViewSection *)customSection
-{
+       customSection:(FLEXTableViewSection *)customSection {
     NSParameterAssert(target);
     
     self = [super init];
@@ -73,8 +70,7 @@
 
 #pragma mark - View controller lifecycle
 
-- (void)loadView
-{
+- (void)loadView {
     // TODO: grouped with rounded corners or not?
     FLEXTableView *tableView = [[FLEXTableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
     self.tableView = tableView;
@@ -87,8 +83,7 @@
     }
 }
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
 
     // Use [object class] here rather than object_getClass
@@ -129,8 +124,7 @@
     [self.tableView addGestureRecognizer:rightSwipe];
 }
 
-- (void)viewWillAppear:(BOOL)animated
-{
+- (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
     
     // Reload the entire table view rather than just the visible cells, because the filtered rows
@@ -141,14 +135,12 @@
 
 #pragma mark - Private
 
-- (void)refreshControlDidRefresh:(id)sender
-{
+- (void)refreshControlDidRefresh:(id)sender {
     [self reloadData];
     [self.refreshControl endRefreshing];
 }
 
-- (NSArray<FLEXTableViewSection *> *)makeSections
-{
+- (NSArray<FLEXTableViewSection *> *)makeSections {
     FLEXObjectExplorer *explorer = self.explorer;
     
     // Description section is only for instances
@@ -200,15 +192,13 @@
     return sections.copy;
 }
 
-- (NSArray<FLEXTableViewSection *> *)nonemptySections
-{
+- (NSArray<FLEXTableViewSection *> *)nonemptySections {
     return [self.allSections flex_filtered:^BOOL(FLEXTableViewSection *section, NSUInteger idx) {
         return section.numberOfRows > 0;
     }];
 }
 
-- (BOOL)sectionHasActions:(NSInteger)section
-{
+- (BOOL)sectionHasActions:(NSInteger)section {
     return self.sections[section] == self.descriptionSection;
 }
 
@@ -238,8 +228,7 @@
 
 #pragma mark - Description
 
-- (BOOL)shouldShowDescription
-{
+- (BOOL)shouldShowDescription {
     // Hide if we have filter text; it is rarely
     // useful to see the description when searching
     // since it's already at the top of the screen
@@ -252,8 +241,7 @@
 
 #pragma mark - Search
 
-- (void)updateSearchResults:(NSString *)newText;
-{
+- (void)updateSearchResults:(NSString *)newText; {
     self.filterText = newText;
 
     // Sections will adjust data based on this property
@@ -280,8 +268,7 @@
 
 #pragma mark - Reloading
 
-- (void)reloadData
-{
+- (void)reloadData {
     // Reload explorer
     [self.explorer reloadMetadata];
 
@@ -302,31 +289,26 @@
 
 #pragma mark - UITableViewDataSource
 
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
     return self.sections.count;
 }
 
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     return self.sections[section].numberOfRows;
 }
 
-- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
-{
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
     return self.sections[section].title;
 }
 
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     NSString *reuse = [self.sections[indexPath.section] reuseIdentifierForRow:indexPath.row];
     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuse forIndexPath:indexPath];
     [self.sections[indexPath.section] configureCell:cell forRow:indexPath.row];
     return cell;
 }
 
-- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
     // For the description section, we want that nice slim/snug looking row.
     // Other rows use the automatic size.
     FLEXTableViewSection *section = self.sections[indexPath.section];
@@ -357,13 +339,11 @@
 
 #pragma mark - UITableViewDelegate
 
-- (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath {
     return [self.sections[indexPath.section] canSelectRow:indexPath.row];
 }
 
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     FLEXTableViewSection *section = self.sections[indexPath.section];
 
     void (^action)(UIViewController *) = [section didSelectRowAction:indexPath.row];
@@ -380,13 +360,11 @@
     }
 }
 
-- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath
-{
+- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath {
     return [self sectionHasActions:indexPath.section];
 }
 
-- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
-{
+- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender {
     // Only the description section has "actions"
     if (self.sections[indexPath.section] == self.descriptionSection) {
         return action == @selector(copy:) || action == @selector(copyObjectAddress:);
@@ -395,8 +373,7 @@
     return NO;
 }
 
-- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
-{
+- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender {
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
     [self performSelector:action withObject:indexPath];
@@ -435,13 +412,11 @@
 ///
 /// Our table cells will use the UITableViewDelegate methods
 /// to make sure we can perform the actions we want to
-- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
-{
+- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
     return NO;
 }
 
-- (void)copy:(NSIndexPath *)indexPath
-{
+- (void)copy:(NSIndexPath *)indexPath {
     FLEXTableViewSection *section = self.sections[indexPath.section];
     UIPasteboard.generalPasteboard.string = ({
         NSString *copy = [section titleForRow:indexPath.row];
@@ -456,8 +431,7 @@
     });
 }
 
-- (void)copyObjectAddress:(NSIndexPath *)indexPath
-{
+- (void)copyObjectAddress:(NSIndexPath *)indexPath {
     UIPasteboard.generalPasteboard.string = [FLEXUtility addressOfObject:self.object];
 }
 

+ 14 - 28
Classes/Toolbar/FLEXExplorerToolbar.m

@@ -34,8 +34,7 @@
 
 @implementation FLEXExplorerToolbar
 
-- (id)initWithFrame:(CGRect)frame
-{
+- (id)initWithFrame:(CGRect)frame {
     self = [super initWithFrame:frame];
     if (self) {
         self.backgroundView = [UIView new];
@@ -90,8 +89,7 @@
     return self;
 }
 
-- (void)layoutSubviews
-{
+- (void)layoutSubviews {
     [super layoutSubviews];
 
 
@@ -191,16 +189,14 @@
     [self layoutIfNeeded];
 }
 
-- (void)setSelectedViewOverlayColor:(UIColor *)selectedViewOverlayColor
-{
+- (void)setSelectedViewOverlayColor:(UIColor *)selectedViewOverlayColor {
     if (![_selectedViewOverlayColor isEqual:selectedViewOverlayColor]) {
         _selectedViewOverlayColor = selectedViewOverlayColor;
         self.selectedViewColorIndicator.backgroundColor = selectedViewOverlayColor;
     }
 }
 
-- (void)setSelectedViewDescription:(NSString *)selectedViewDescription
-{
+- (void)setSelectedViewDescription:(NSString *)selectedViewDescription {
     if (![_selectedViewDescription isEqual:selectedViewDescription]) {
         _selectedViewDescription = selectedViewDescription;
         self.selectedViewDescriptionLabel.text = selectedViewDescription;
@@ -212,56 +208,46 @@
 
 #pragma mark - Sizing Convenience Methods
 
-+ (UIFont *)descriptionLabelFont
-{
++ (UIFont *)descriptionLabelFont {
     return [UIFont systemFontOfSize:12.0];
 }
 
-+ (CGFloat)toolbarItemHeight
-{
++ (CGFloat)toolbarItemHeight {
     return 44.0;
 }
 
-+ (CGFloat)dragHandleWidth
-{
++ (CGFloat)dragHandleWidth {
     return [FLEXResources dragHandle].size.width;
 }
 
-+ (CGFloat)descriptionLabelHeight
-{
++ (CGFloat)descriptionLabelHeight {
     return ceil([[self descriptionLabelFont] lineHeight]);
 }
 
-+ (CGFloat)descriptionVerticalPadding
-{
++ (CGFloat)descriptionVerticalPadding {
     return 2.0;
 }
 
-+ (CGFloat)descriptionContainerHeight
-{
++ (CGFloat)descriptionContainerHeight {
     return [self descriptionVerticalPadding] * 2.0 + [self descriptionLabelHeight];
 }
 
-+ (CGFloat)selectedViewColorIndicatorDiameter
-{
++ (CGFloat)selectedViewColorIndicatorDiameter {
     return ceil([self descriptionLabelHeight] / 2.0);
 }
 
-+ (CGFloat)horizontalPadding
-{
++ (CGFloat)horizontalPadding {
     return 11.0;
 }
 
-- (CGSize)sizeThatFits:(CGSize)size
-{
+- (CGSize)sizeThatFits:(CGSize)size {
     CGFloat height = 0.0;
     height += [[self class] toolbarItemHeight];
     height += [[self class] descriptionContainerHeight];
     return CGSizeMake(size.width, height);
 }
 
-- (CGRect)safeArea
-{
+- (CGRect)safeArea {
     CGRect safeArea = self.bounds;
     if (@available(iOS 11.0, *)) {
         safeArea = UIEdgeInsetsInsetRect(self.bounds, self.safeAreaInsets);

+ 11 - 22
Classes/Toolbar/FLEXToolbarItem.m

@@ -19,8 +19,7 @@
 
 @implementation FLEXToolbarItem
 
-+ (instancetype)toolbarItemWithTitle:(NSString *)title image:(UIImage *)image
-{
++ (instancetype)toolbarItemWithTitle:(NSString *)title image:(UIImage *)image {
     FLEXToolbarItem *toolbarItem = [self buttonWithType:UIButtonTypeSystem];
     toolbarItem.title = title;
     toolbarItem.backgroundColor = [self defaultBackgroundColor];
@@ -37,50 +36,42 @@
 
 #pragma mark - Display Defaults
 
-+ (NSDictionary<NSString *, id> *)titleAttributes
-{
++ (NSDictionary<NSString *, id> *)titleAttributes {
     return @{NSFontAttributeName : [UIFont systemFontOfSize:12.0]};
 }
 
-+ (UIColor *)highlightedBackgroundColor
-{
++ (UIColor *)highlightedBackgroundColor {
     return [FLEXColor toolbarItemHighlightedColor];
 }
 
-+ (UIColor *)selectedBackgroundColor
-{
++ (UIColor *)selectedBackgroundColor {
     return [FLEXColor toolbarItemSelectedColor];
 }
 
-+ (UIColor *)defaultBackgroundColor
-{
++ (UIColor *)defaultBackgroundColor {
     return UIColor.clearColor;
 }
 
-+ (CGFloat)topMargin
-{
++ (CGFloat)topMargin {
     return 2.0;
 }
 
 
 #pragma mark - State Changes
 
-- (void)setHighlighted:(BOOL)highlighted
-{
+- (void)setHighlighted:(BOOL)highlighted {
     [super setHighlighted:highlighted];
     [self updateColors];
 }
 
-- (void)setSelected:(BOOL)selected
-{
+- (void)setSelected:(BOOL)selected {
     [super setSelected:selected];
     [self updateColors];
 }
 
 + (id)_selectedIndicatorImage { return nil; }
 
-- (void)updateColors
-{
+- (void)updateColors {
     // Background color
     if (self.highlighted) {
         self.backgroundColor = [[self class] highlightedBackgroundColor];
@@ -94,8 +85,7 @@
 
 #pragma mark - UIButton Layout Overrides
 
-- (CGRect)titleRectForContentRect:(CGRect)contentRect
-{
+- (CGRect)titleRectForContentRect:(CGRect)contentRect {
     NSDictionary *attrs = [[self class] titleAttributes];
     // Bottom aligned and centered.
     CGRect titleRect = CGRectZero;
@@ -110,8 +100,7 @@
     return titleRect;
 }
 
-- (CGRect)imageRectForContentRect:(CGRect)contentRect
-{
+- (CGRect)imageRectForContentRect:(CGRect)contentRect {
     CGSize imageSize = self.image.size;
     CGRect titleRect = [self titleRectForContentRect:contentRect];
     CGFloat availableHeight = contentRect.size.height - titleRect.size.height - [[self class] topMargin];

+ 1 - 2
Classes/Utility/Categories/FLEXRuntime+UIKitHelpers.h

@@ -62,8 +62,7 @@
 @interface FLEXMethod (UIKitHelpers) <FLEXRuntimeMetadata> @end
 @interface FLEXProtocol (UIKitHelpers) <FLEXRuntimeMetadata> @end
 
-typedef NS_ENUM(NSUInteger, FLEXStaticMetadataRowStyle)
-{
+typedef NS_ENUM(NSUInteger, FLEXStaticMetadataRowStyle) {
     FLEXStaticMetadataRowStyleSubtitle,
     FLEXStaticMetadataRowStyleKeyValue,
     FLEXStaticMetadataRowStyleDefault = FLEXStaticMetadataRowStyleSubtitle,

+ 1 - 2
Classes/Utility/Categories/UIFont+FLEX.m

@@ -12,8 +12,7 @@
 
 @implementation UIFont (FLEX)
 
-+ (UIFont *)flex_defaultTableCellFont
-{
++ (UIFont *)flex_defaultTableCellFont {
     static UIFont *defaultTableCellFont = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{

+ 4 - 8
Classes/Utility/FLEXHeapEnumerator.m

@@ -20,8 +20,7 @@ typedef struct {
 
 @implementation FLEXHeapEnumerator
 
-static void range_callback(task_t task, void *context, unsigned type, vm_range_t *ranges, unsigned rangeCount)
-{
+static void range_callback(task_t task, void *context, unsigned type, vm_range_t *ranges, unsigned rangeCount) {
     if (!context) {
         return;
     }
@@ -44,14 +43,12 @@ static void range_callback(task_t task, void *context, unsigned type, vm_range_t
     }
 }
 
-static kern_return_t reader(__unused task_t remote_task, vm_address_t remote_address, __unused vm_size_t size, void **local_memory)
-{
+static kern_return_t reader(__unused task_t remote_task, vm_address_t remote_address, __unused vm_size_t size, void **local_memory) {
     *local_memory = (void *)remote_address;
     return KERN_SUCCESS;
 }
 
-+ (void)enumerateLiveObjectsUsingBlock:(flex_object_enumeration_block_t)block
-{
++ (void)enumerateLiveObjectsUsingBlock:(flex_object_enumeration_block_t)block {
     if (!block) {
         return;
     }
@@ -116,8 +113,7 @@ static kern_return_t reader(__unused task_t remote_task, vm_address_t remote_add
     }
 }
 
-+ (void)updateRegisteredClasses
-{
++ (void)updateRegisteredClasses {
     if (!registeredClasses) {
         registeredClasses = CFSetCreateMutable(NULL, 0, NULL);
     } else {

+ 2 - 4
Classes/Utility/FLEXKeyboardHelpViewController.m

@@ -17,8 +17,7 @@
 
 @implementation FLEXKeyboardHelpViewController
 
-- (void)viewDidLoad
-{
+- (void)viewDidLoad {
     [super viewDidLoad];
 
     self.textView = [[UITextView alloc] initWithFrame:self.view.bounds];
@@ -36,8 +35,7 @@
     self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(donePressed:)];
 }
 
-- (void)donePressed:(id)sender
-{
+- (void)donePressed:(id)sender {
     [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
 }
 

+ 52 - 39
Classes/Utility/FLEXKeyboardShortcutManager.m

@@ -33,8 +33,7 @@
 
 @implementation FLEXKeyInput
 
-- (BOOL)isEqual:(id)object
-{
+- (BOOL)isEqual:(id)object {
     BOOL isEqual = NO;
     if ([object isKindOfClass:[FLEXKeyInput class]]) {
         FLEXKeyInput *keyCommand = (FLEXKeyInput *)object;
@@ -45,24 +44,23 @@
     return isEqual;
 }
 
-- (NSUInteger)hash
-{
-    return [self.key hash] ^ self.flags;
+- (NSUInteger)hash {
+    return self.key.hash ^ self.flags;
 }
 
-- (id)copyWithZone:(NSZone *)zone
-{
+- (id)copyWithZone:(NSZone *)zone {
     return [[self class] keyInputForKey:self.key flags:self.flags helpDescription:self.helpDescription];
 }
 
-- (NSString *)description
-{
-    NSDictionary<NSString *, NSString *> *keyMappings = @{ UIKeyInputUpArrow : @"↑",
-                                                           UIKeyInputDownArrow : @"↓",
-                                                           UIKeyInputLeftArrow : @"←",
-                                                           UIKeyInputRightArrow : @"→",
-                                                           UIKeyInputEscape : @"␛",
-                                                           @" " : @"␠"};
+- (NSString *)description {
+    NSDictionary<NSString *, NSString *> *keyMappings = @{
+        UIKeyInputUpArrow : @"↑",
+        UIKeyInputDownArrow : @"↓",
+        UIKeyInputLeftArrow : @"←",
+        UIKeyInputRightArrow : @"→",
+        UIKeyInputEscape : @"␛",
+        @" " : @"␠"
+    };
     
     NSString *prettyKey = nil;
     if (self.key && keyMappings[self.key]) {
@@ -93,13 +91,13 @@
     return [NSString stringWithFormat:@"%@%@\t%@", prettyFlags, prettyKey, self.helpDescription];
 }
 
-+ (instancetype)keyInputForKey:(NSString *)key flags:(UIKeyModifierFlags)flags
-{
++ (instancetype)keyInputForKey:(NSString *)key flags:(UIKeyModifierFlags)flags {
     return [self keyInputForKey:key flags:flags helpDescription:nil];
 }
 
-+ (instancetype)keyInputForKey:(NSString *)key flags:(UIKeyModifierFlags)flags helpDescription:(NSString *)helpDescription
-{
++ (instancetype)keyInputForKey:(NSString *)key
+                         flags:(UIKeyModifierFlags)flags
+               helpDescription:(NSString *)helpDescription {
     FLEXKeyInput *keyInput = [self new];
     if (keyInput) {
         keyInput->_key = key;
@@ -123,8 +121,7 @@
 
 @implementation FLEXKeyboardShortcutManager
 
-+ (instancetype)sharedManager
-{
++ (instancetype)sharedManager {
     static FLEXKeyboardShortcutManager *sharedManager = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
@@ -133,8 +130,7 @@
     return sharedManager;
 }
 
-+ (void)load
-{
++ (void)load {
     SEL originalKeyEventSelector = NSSelectorFromString(@"handleKeyUIEvent:");
     SEL swizzledKeyEventSelector = [FLEXUtility swizzledSelectorForSelector:originalKeyEventSelector];
     
@@ -145,7 +141,11 @@
         ((void(*)(id, SEL, id))objc_msgSend)(slf, swizzledKeyEventSelector, event);
     };
     
-    [FLEXUtility replaceImplementationOfKnownSelector:originalKeyEventSelector onClass:[UIApplication class] withBlock:handleKeyUIEventSwizzleBlock swizzledSelector:swizzledKeyEventSelector];
+    [FLEXUtility replaceImplementationOfKnownSelector:originalKeyEventSelector
+        onClass:[UIApplication class]
+        withBlock:handleKeyUIEventSwizzleBlock
+        swizzledSelector:swizzledKeyEventSelector
+    ];
     
     if ([[UITouch class] instancesRespondToSelector:@selector(maximumPossibleForce)]) {
         SEL originalSendEventSelector = NSSelectorFromString(@"sendEvent:");
@@ -177,7 +177,11 @@
             ((void(*)(id, SEL, id))objc_msgSend)(slf, swizzledSendEventSelector, event);
         };
         
-        [FLEXUtility replaceImplementationOfKnownSelector:originalSendEventSelector onClass:[UIApplication class] withBlock:sendEventSwizzleBlock swizzledSelector:swizzledSendEventSelector];
+        [FLEXUtility replaceImplementationOfKnownSelector:originalSendEventSelector
+            onClass:[UIApplication class]
+            withBlock:sendEventSwizzleBlock
+            swizzledSelector:swizzledSendEventSelector
+        ];
         
         SEL originalSupportsTouchPressureSelector = NSSelectorFromString(@"_supportsForceTouch");
         SEL swizzledSupportsTouchPressureSelector = [FLEXUtility swizzledSelectorForSelector:originalSupportsTouchPressureSelector];
@@ -186,12 +190,15 @@
             return YES;
         };
         
-        [FLEXUtility replaceImplementationOfKnownSelector:originalSupportsTouchPressureSelector onClass:[UIDevice class] withBlock:supportsTouchPressureSwizzleBlock swizzledSelector:swizzledSupportsTouchPressureSelector];
+        [FLEXUtility replaceImplementationOfKnownSelector:originalSupportsTouchPressureSelector
+            onClass:[UIDevice class]
+            withBlock:supportsTouchPressureSwizzleBlock
+            swizzledSelector:swizzledSupportsTouchPressureSelector
+        ];
     }
 }
 
-- (instancetype)init
-{
+- (instancetype)init {
     self = [super init];
     
     if (self) {
@@ -202,8 +209,10 @@
     return self;
 }
 
-- (void)registerSimulatorShortcutWithKey:(NSString *)key modifiers:(UIKeyModifierFlags)modifiers action:(dispatch_block_t)action description:(NSString *)description
-{
+- (void)registerSimulatorShortcutWithKey:(NSString *)key
+                               modifiers:(UIKeyModifierFlags)modifiers
+                                  action:(dispatch_block_t)action
+                             description:(NSString *)description {
     FLEXKeyInput *keyInput = [FLEXKeyInput keyInputForKey:key flags:modifiers helpDescription:description];
     [self.actionsForKeyInputs setObject:action forKey:keyInput];
 }
@@ -212,8 +221,7 @@ static const long kFLEXControlKeyCode = 0xe0;
 static const long kFLEXShiftKeyCode = 0xe1;
 static const long kFLEXCommandKeyCode = 0xe3;
 
-- (void)handleKeyboardEvent:(UIEvent *)event
-{
+- (void)handleKeyboardEvent:(UIEvent *)event {
     if (!self.enabled) {
         return;
     }
@@ -262,12 +270,16 @@ static const long kFLEXCommandKeyCode = 0xe3;
             dispatch_block_t actionBlock = self.actionsForKeyInputs[exactMatch];
             
             if (!actionBlock) {
-                FLEXKeyInput *shiftMatch = [FLEXKeyInput keyInputForKey:modifiedInput flags:flags&(~UIKeyModifierShift)];
+                FLEXKeyInput *shiftMatch = [FLEXKeyInput
+                    keyInputForKey:modifiedInput flags:flags&(~UIKeyModifierShift)
+                ];
                 actionBlock = self.actionsForKeyInputs[shiftMatch];
             }
             
             if (!actionBlock) {
-                FLEXKeyInput *capitalMatch = [FLEXKeyInput keyInputForKey:[unmodifiedInput uppercaseString] flags:flags];
+                FLEXKeyInput *capitalMatch = [FLEXKeyInput
+                    keyInputForKey:[unmodifiedInput uppercaseString] flags:flags
+                ];
                 actionBlock = self.actionsForKeyInputs[capitalMatch];
             }
             
@@ -291,12 +303,13 @@ static const long kFLEXCommandKeyCode = 0xe3;
     }
 }
 
-- (NSString *)keyboardShortcutsDescription
-{
+- (NSString *)keyboardShortcutsDescription {
     NSMutableString *description = [NSMutableString string];
-    NSArray<FLEXKeyInput *> *keyInputs = [self.actionsForKeyInputs.allKeys sortedArrayUsingComparator:^NSComparisonResult(FLEXKeyInput *_Nonnull input1, FLEXKeyInput *_Nonnull input2) {
-        return [input1.key caseInsensitiveCompare:input2.key];
-    }];
+    NSArray<FLEXKeyInput *> *keyInputs = [self.actionsForKeyInputs.allKeys
+        sortedArrayUsingComparator:^NSComparisonResult(FLEXKeyInput *input1, FLEXKeyInput *input2) {
+            return [input1.key caseInsensitiveCompare:input2.key];
+        }
+    ];
     for (FLEXKeyInput *keyInput in keyInputs) {
         [description appendFormat:@"%@\n", keyInput];
     }

+ 0 - 2
Classes/Utility/FLEXUtility.h

@@ -88,8 +88,6 @@ NS_INLINE CGRect FLEXRectSetHeight(CGRect r, CGFloat height) {
 + (NSString *)detailDescriptionForView:(UIView *)view;
 + (UIImage *)circularImageWithColor:(UIColor *)color radius:(CGFloat)radius;
 + (UIColor *)hierarchyIndentPatternColor;
-+ (NSString *)applicationImageName;
-+ (NSString *)applicationName;
 + (NSString *)pointerToString:(void *)ptr;
 + (NSString *)addressOfObject:(id)object;
 + (NSString *)stringByEscapingHTMLEntitiesInString:(NSString *)originalString;

+ 73 - 75
Classes/Utility/FLEXUtility.m

@@ -59,14 +59,12 @@
 }
 #endif
 
-+ (UIColor *)consistentRandomColorForObject:(id)object
-{
++ (UIColor *)consistentRandomColorForObject:(id)object {
     CGFloat hue = (((NSUInteger)object >> 4) % 256) / 255.0;
     return [UIColor colorWithHue:hue saturation:1.0 brightness:1.0 alpha:1.0];
 }
 
-+ (NSString *)descriptionForView:(UIView *)view includingFrame:(BOOL)includeFrame
-{
++ (NSString *)descriptionForView:(UIView *)view includingFrame:(BOOL)includeFrame {
     NSString *description = [[view class] description];
     
     NSString *viewControllerDescription = [[[self viewControllerForView:view] class] description];
@@ -85,13 +83,13 @@
     return description;
 }
 
-+ (NSString *)stringForCGRect:(CGRect)rect
-{
-    return [NSString stringWithFormat:@"{(%g, %g), (%g, %g)}", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height];
++ (NSString *)stringForCGRect:(CGRect)rect {
+    return [NSString stringWithFormat:@"{(%g, %g), (%g, %g)}",
+        rect.origin.x, rect.origin.y, rect.size.width, rect.size.height
+    ];
 }
 
-+ (UIViewController *)viewControllerForView:(UIView *)view
-{
++ (UIViewController *)viewControllerForView:(UIView *)view {
     NSString *viewDelegate = @"_viewDelegate";
     if ([view respondsToSelector:NSSelectorFromString(viewDelegate)]) {
         return [view valueForKey:viewDelegate];
@@ -100,8 +98,7 @@
     return nil;
 }
 
-+ (UIViewController *)viewControllerForAncestralView:(UIView *)view
-{
++ (UIViewController *)viewControllerForAncestralView:(UIView *)view {
     NSString *_viewControllerForAncestor = @"_viewControllerForAncestor";
     if ([view respondsToSelector:NSSelectorFromString(_viewControllerForAncestor)]) {
         return [view valueForKey:_viewControllerForAncestor];
@@ -110,8 +107,7 @@
     return nil;
 }
 
-+ (UIImage *)previewImageForView:(UIView *)view
-{
++ (UIImage *)previewImageForView:(UIView *)view {
     if (CGRectIsEmpty(view.bounds)) {
         return nil;
     }
@@ -124,8 +120,7 @@
     return previewImage;
 }
 
-+ (UIImage *)previewImageForLayer:(CALayer *)layer
-{
++ (UIImage *)previewImageForLayer:(CALayer *)layer {
     if (CGRectIsEmpty(layer.bounds)) {
         return nil;
     }
@@ -138,13 +133,11 @@
     return previewImage;
 }
 
-+ (NSString *)detailDescriptionForView:(UIView *)view
-{
++ (NSString *)detailDescriptionForView:(UIView *)view {
     return [NSString stringWithFormat:@"frame %@", [self stringForCGRect:view.frame]];
 }
 
-+ (UIImage *)circularImageWithColor:(UIColor *)color radius:(CGFloat)radius
-{
++ (UIImage *)circularImageWithColor:(UIColor *)color radius:(CGFloat)radius {
     CGFloat diameter = radius * 2.0;
     UIGraphicsBeginImageContextWithOptions(CGSizeMake(diameter, diameter), NO, 0.0);
     CGContextRef imageContext = UIGraphicsGetCurrentContext();
@@ -155,8 +148,7 @@
     return circularImage;
 }
 
-+ (UIColor *)hierarchyIndentPatternColor
-{
++ (UIColor *)hierarchyIndentPatternColor {
     static UIColor *patternColor = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
@@ -166,9 +158,13 @@
 #if FLEX_AT_LEAST_IOS13_SDK
         if (@available(iOS 13.0, *)) {
             // Create a dark mode version
-            UIGraphicsBeginImageContextWithOptions(indentationPatternImage.size, NO, indentationPatternImage.scale);
+            UIGraphicsBeginImageContextWithOptions(
+                indentationPatternImage.size, NO, indentationPatternImage.scale
+            );
             [[FLEXColor iconColor] set];
-            [indentationPatternImage drawInRect:CGRectMake(0, 0, indentationPatternImage.size.width, indentationPatternImage.size.height)];
+            [indentationPatternImage drawInRect:CGRectMake(
+                0, 0, indentationPatternImage.size.width, indentationPatternImage.size.height
+            )];
             UIImage *darkModePatternImage = UIGraphicsGetImageFromCurrentImageContext();
             UIGraphicsEndImageContext();
 
@@ -185,28 +181,23 @@
     return patternColor;
 }
 
-+ (NSString *)applicationImageName
-{
++ (NSString *)applicationImageName {
     return NSBundle.mainBundle.executablePath;
 }
 
-+ (NSString *)applicationName
-{
++ (NSString *)applicationName {
     return [FLEXUtility applicationImageName].lastPathComponent;
 }
 
-+ (NSString *)pointerToString:(void *)ptr
-{
++ (NSString *)pointerToString:(void *)ptr {
     return [NSString stringWithFormat:@"%p", ptr];
 }
 
-+ (NSString *)addressOfObject:(id)object
-{
++ (NSString *)addressOfObject:(id)object {
     return [NSString stringWithFormat:@"%p", object];
 }
 
-+ (NSString *)stringByEscapingHTMLEntitiesInString:(NSString *)originalString
-{
++ (NSString *)stringByEscapingHTMLEntitiesInString:(NSString *)originalString {
     static NSDictionary<NSString *, NSString *> *escapingDictionary = nil;
     static NSRegularExpression *regex = nil;
     static dispatch_once_t onceToken;
@@ -223,9 +214,11 @@
         regex = [NSRegularExpression regularExpressionWithPattern:@"(&|>|<|'|\"|«|»)" options:0 error:NULL];
     });
     
-    NSMutableString *mutableString = [originalString mutableCopy];
+    NSMutableString *mutableString = originalString.mutableCopy;
     
-    NSArray<NSTextCheckingResult *> *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];
@@ -237,8 +230,7 @@
     return [mutableString copy];
 }
 
-+ (UIInterfaceOrientationMask)infoPlistSupportedInterfaceOrientationsMask
-{
++ (UIInterfaceOrientationMask)infoPlistSupportedInterfaceOrientationsMask {
     NSArray<NSString *> *supportedOrientations = NSBundle.mainBundle.infoDictionary[@"UISupportedInterfaceOrientations"];
     UIInterfaceOrientationMask supportedOrientationsMask = 0;
     if ([supportedOrientations containsObject:@"UIInterfaceOrientationPortrait"]) {
@@ -256,16 +248,19 @@
     return supportedOrientationsMask;
 }
 
-+ (UIImage *)thumbnailedImageWithMaxPixelDimension:(NSInteger)dimension fromImageData:(NSData *)data
-{
++ (UIImage *)thumbnailedImageWithMaxPixelDimension:(NSInteger)dimension fromImageData:(NSData *)data {
     UIImage *thumbnail = nil;
     CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)data, 0);
     if (imageSource) {
-        NSDictionary<NSString *, id> *options = @{ (__bridge id)kCGImageSourceCreateThumbnailWithTransform : @YES,
-                                                   (__bridge id)kCGImageSourceCreateThumbnailFromImageAlways : @YES,
-                                                   (__bridge id)kCGImageSourceThumbnailMaxPixelSize : @(dimension) };
-
-        CGImageRef scaledImageRef = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, (__bridge CFDictionaryRef)options);
+        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) {
             thumbnail = [UIImage imageWithCGImage:scaledImageRef];
             CFRelease(scaledImageRef);
@@ -275,8 +270,7 @@
     return thumbnail;
 }
 
-+ (NSString *)stringFromRequestDuration:(NSTimeInterval)duration
-{
++ (NSString *)stringFromRequestDuration:(NSTimeInterval)duration {
     NSString *string = @"0s";
     if (duration > 0.0) {
         if (duration < 1.0) {
@@ -290,8 +284,7 @@
     return string;
 }
 
-+ (NSString *)statusCodeStringFromURLResponse:(NSURLResponse *)response
-{
++ (NSString *)statusCodeStringFromURLResponse:(NSURLResponse *)response {
     NSString *httpResponseString = nil;
     if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
         NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
@@ -307,8 +300,7 @@
     return httpResponseString;
 }
 
-+ (BOOL)isErrorStatusCodeFromURLResponse:(NSURLResponse *)response
-{
++ (BOOL)isErrorStatusCodeFromURLResponse:(NSURLResponse *)response {
     if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
         NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
         return httpResponse.statusCode >= 400;
@@ -317,8 +309,7 @@
     return NO;
 }
 
-+ (NSArray<NSURLQueryItem *> *)itemsFromQueryString:(NSString *)query
-{
++ (NSArray<NSURLQueryItem *> *)itemsFromQueryString:(NSString *)query {
     NSMutableArray<NSURLQueryItem *> *items = [NSMutableArray new];
 
     // [a=1, b=2, c=3]
@@ -337,14 +328,16 @@
     return items.copy;
 }
 
-+ (NSString *)prettyJSONStringFromData:(NSData *)data
-{
++ (NSString *)prettyJSONStringFromData:(NSData *)data {
     NSString *prettyString = nil;
     
     id jsonObject = [NSJSONSerialization JSONObjectWithData:data options:0 error:NULL];
     if ([NSJSONSerialization isValidJSONObject:jsonObject]) {
-        prettyString = [NSString stringWithCString:[NSJSONSerialization dataWithJSONObject:jsonObject options:NSJSONWritingPrettyPrinted error:NULL].bytes encoding:NSUTF8StringEncoding];
-        // NSJSONSerialization escapes forward slashes. We want pretty json, so run through and unescape the slashes.
+        prettyString = [NSString stringWithCString:[NSJSONSerialization
+            dataWithJSONObject:jsonObject options:NSJSONWritingPrettyPrinted error:NULL
+        ].bytes encoding:NSUTF8StringEncoding];
+        // NSJSONSerialization escapes forward slashes.
+        // We want pretty json, so run through and unescape the slashes.
         prettyString = [prettyString stringByReplacingOccurrencesOfString:@"\\/" withString:@"/"];
     } else {
         prettyString = [NSString stringWithCString:data.bytes encoding:NSUTF8StringEncoding];
@@ -353,16 +346,14 @@
     return prettyString;
 }
 
-+ (BOOL)isValidJSONData:(NSData *)data
-{
++ (BOOL)isValidJSONData:(NSData *)data {
     return [NSJSONSerialization JSONObjectWithData:data options:0 error:NULL] ? YES : NO;
 }
 
 // Thanks to the following links for help with this method
 // https://www.cocoanetics.com/2012/02/decompressing-files-into-memory/
 // https://github.com/nicklockwood/GZIP
-+ (NSData *)inflatedDataFromCompressedData:(NSData *)compressedData
-{
++ (NSData *)inflatedDataFromCompressedData:(NSData *)compressedData {
     NSData *inflatedData = nil;
     NSUInteger compressedDataLength = compressedData.length;
     if (compressedDataLength > 0) {
@@ -396,13 +387,14 @@
     return inflatedData;
 }
 
-+ (NSArray<UIWindow *> *)allWindows
-{
++ (NSArray<UIWindow *> *)allWindows {
     BOOL includeInternalWindows = YES;
     BOOL onlyVisibleWindows = NO;
 
     // Obfuscating selector allWindowsIncludingInternalWindows:onlyVisibleWindows:
-    NSArray<NSString *> *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];
@@ -419,8 +411,7 @@
     return windows;
 }
 
-+ (UIAlertController *)alert:(NSString *)title message:(NSString *)message
-{
++ (UIAlertController *)alert:(NSString *)title message:(NSString *)message {
     return [UIAlertController
         alertControllerWithTitle:title
         message:message
@@ -428,13 +419,13 @@
     ];
 }
 
-+ (SEL)swizzledSelectorForSelector:(SEL)selector
-{
-    return NSSelectorFromString([NSString stringWithFormat:@"_flex_swizzle_%x_%@", arc4random(), NSStringFromSelector(selector)]);
++ (SEL)swizzledSelectorForSelector:(SEL)selector {
+    return NSSelectorFromString([NSString stringWithFormat:
+        @"_flex_swizzle_%x_%@", arc4random(), NSStringFromSelector(selector)
+    ]);
 }
 
-+ (BOOL)instanceRespondsButDoesNotImplementSelector:(SEL)selector class:(Class)cls
-{
++ (BOOL)instanceRespondsButDoesNotImplementSelector:(SEL)selector class:(Class)cls {
     if ([cls instancesRespondToSelector:selector]) {
         unsigned int numMethods = 0;
         Method *methods = class_copyMethodList(cls, &numMethods);
@@ -458,8 +449,10 @@
     return NO;
 }
 
-+ (void)replaceImplementationOfKnownSelector:(SEL)originalSelector onClass:(Class)class withBlock:(id)block swizzledSelector:(SEL)swizzledSelector
-{
++ (void)replaceImplementationOfKnownSelector:(SEL)originalSelector
+                                     onClass:(Class)class
+                                   withBlock:(id)block
+                            swizzledSelector:(SEL)swizzledSelector {
     // This method is only intended for swizzling methods that are know to exist on the class.
     // Bail if that isn't the case.
     Method originalMethod = class_getInstanceMethod(class, originalSelector);
@@ -473,13 +466,18 @@
     method_exchangeImplementations(originalMethod, newMethod);
 }
 
-+ (void)replaceImplementationOfSelector:(SEL)selector withSelector:(SEL)swizzledSelector forClass:(Class)cls withMethodDescription:(struct objc_method_description)methodDescription implementationBlock:(id)implementationBlock undefinedBlock:(id)undefinedBlock
-{
++ (void)replaceImplementationOfSelector:(SEL)selector
+                           withSelector:(SEL)swizzledSelector
+                               forClass:(Class)cls
+                  withMethodDescription:(struct objc_method_description)methodDescription
+                    implementationBlock:(id)implementationBlock undefinedBlock:(id)undefinedBlock {
     if ([self instanceRespondsButDoesNotImplementSelector:selector class:cls]) {
         return;
     }
     
-    IMP implementation = imp_implementationWithBlock((id)([cls instancesRespondToSelector:selector] ? implementationBlock : undefinedBlock));
+    IMP implementation = imp_implementationWithBlock((id)(
+        [cls instancesRespondToSelector:selector] ? implementationBlock : undefinedBlock)
+    );
     
     Method oldMethod = class_getInstanceMethod(cls, selector);
     const char *types = methodDescription.types;

+ 4 - 8
Classes/Utility/Runtime/FLEXObjcInternal.mm

@@ -74,8 +74,7 @@
 //////////////////////////////////////
 // originally _objc_isTaggedPointer //
 //////////////////////////////////////
-static BOOL flex_isTaggedPointer(const void *ptr) 
-{
+static BOOL flex_isTaggedPointer(const void *ptr)  {
     return ((uintptr_t)ptr & _OBJC_TAG_MASK) == _OBJC_TAG_MASK;
 }
 
@@ -86,8 +85,7 @@ static BOOL flex_isTaggedPointer(const void *ptr)
 ////////////////////////////////////////////////
 // originally objc_object::isExtTaggedPointer //
 ////////////////////////////////////////////////
-static BOOL flex_isExtTaggedPointer(const void *ptr) 
-{
+static BOOL flex_isExtTaggedPointer(const void *ptr)  {
     return ((uintptr_t)ptr & _OBJC_TAG_EXT_MASK) == _OBJC_TAG_EXT_MASK;
 }
 
@@ -100,8 +98,7 @@ static BOOL flex_isExtTaggedPointer(const void *ptr)
 
 extern "C" {
 
-static BOOL FLEXPointerIsReadable(const void *inPtr)
-{
+static BOOL FLEXPointerIsReadable(const void *inPtr) {
     kern_return_t error = KERN_SUCCESS;
 
     vm_size_t vmsize;
@@ -142,8 +139,7 @@ static BOOL FLEXPointerIsReadable(const void *inPtr)
 
 /// Accepts addresses that may or may not be readable.
 /// https://blog.timac.org/2016/1124-testing-if-an-arbitrary-pointer-is-a-valid-objective-c-object/
-BOOL FLEXPointerIsValidObjcObject(const void *ptr)
-{
+BOOL FLEXPointerIsValidObjcObject(const void *ptr) {
     uintptr_t pointer = (uintptr_t)ptr;
 
     if (!ptr) {

+ 2 - 4
Classes/Utility/Runtime/FLEXRuntimeUtility.h

@@ -25,8 +25,7 @@ extern NSString *const kFLEXPropertyAttributeKeyWeak;
 extern NSString *const kFLEXPropertyAttributeKeyGarbageCollectable;
 extern NSString *const kFLEXPropertyAttributeKeyOldStyleTypeEncoding;
 
-typedef NS_ENUM(NSUInteger, FLEXPropertyAttribute)
-{
+typedef NS_ENUM(NSUInteger, FLEXPropertyAttribute) {
     FLEXPropertyAttributeTypeEncoding       = 'T',
     FLEXPropertyAttributeBackingIvarName    = 'V',
     FLEXPropertyAttributeCopy               = 'C',
@@ -41,8 +40,7 @@ typedef NS_ENUM(NSUInteger, FLEXPropertyAttribute)
     FLEXPropertyAttributeWeak               = 'W'
 };
 
-typedef NS_ENUM(char, FLEXTypeEncoding)
-{
+typedef NS_ENUM(char, FLEXTypeEncoding) {
     FLEXTypeEncodingUnknown          = '?',
     FLEXTypeEncodingChar             = 'c',
     FLEXTypeEncodingInt              = 'i',

+ 22 - 43
Classes/Utility/Runtime/FLEXRuntimeUtility.m

@@ -39,13 +39,11 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
 
 #pragma mark - General Helpers (Public)
 
-+ (BOOL)pointerIsValidObjcObject:(const void *)pointer
-{
++ (BOOL)pointerIsValidObjcObject:(const void *)pointer {
     return FLEXPointerIsValidObjcObject(pointer);
 }
 
-+ (id)potentiallyUnwrapBoxedPointer:(id)returnedObjectOrNil type:(const FLEXTypeEncoding *)returnType
-{
++ (id)potentiallyUnwrapBoxedPointer:(id)returnedObjectOrNil type:(const FLEXTypeEncoding *)returnType {
     if (!returnedObjectOrNil) {
         return nil;
     }
@@ -93,8 +91,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     return returnedObjectOrNil;
 }
 
-+ (NSUInteger)fieldNameOffsetForTypeEncoding:(const FLEXTypeEncoding *)typeEncoding
-{
++ (NSUInteger)fieldNameOffsetForTypeEncoding:(const FLEXTypeEncoding *)typeEncoding {
     NSUInteger beginIndex = 0;
     while (typeEncoding[beginIndex] == FLEXTypeEncodingQuote) {
         NSUInteger endIndex = beginIndex + 1;
@@ -106,8 +103,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     return beginIndex;
 }
 
-+ (NSArray<Class> *)classHierarchyOfObject:(id)objectOrClass
-{
++ (NSArray<Class> *)classHierarchyOfObject:(id)objectOrClass {
     NSMutableArray<Class> *superClasses = [NSMutableArray new];
     id cls = [objectOrClass class];
     do {
@@ -118,8 +114,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
 }
 
 /// Could be nil
-+ (NSString *)safeDescriptionForObject:(id)object
-{
++ (NSString *)safeDescriptionForObject:(id)object {
     // Don't assume that we have an NSObject subclass.
     // Check to make sure the object responds to the description method
     if ([object respondsToSelector:@selector(description)]) {
@@ -130,8 +125,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
 }
 
 /// Never nil
-+ (NSString *)safeDebugDescriptionForObject:(id)object
-{
++ (NSString *)safeDebugDescriptionForObject:(id)object {
     NSString *description = nil;
 
     // Don't assume that we have an NSObject subclass.
@@ -154,8 +148,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     return description;
 }
 
-+ (NSString *)summaryForObject:(id)value
-{
++ (NSString *)summaryForObject:(id)value {
     NSString *description = nil;
 
     // Special case BOOL for better readability.
@@ -192,8 +185,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
 
 + (void)tryAddPropertyWithName:(const char *)name
                     attributes:(NSDictionary<NSString *, NSString *> *)attributePairs
-                       toClass:(__unsafe_unretained Class)theClass
-{
+                       toClass:(__unsafe_unretained Class)theClass {
     objc_property_t property = class_getProperty(theClass, name);
     if (!property) {
         unsigned int totalAttributesCount = (unsigned int)attributePairs.count;
@@ -213,8 +205,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     }
 }
 
-+ (NSArray<NSString *> *)allPropertyAttributeKeys
-{
++ (NSArray<NSString *> *)allPropertyAttributeKeys {
     static NSArray<NSString *> *allPropertyAttributeKeys = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
@@ -240,12 +231,11 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
 
 #pragma mark - Method Helpers (Public)
 
-+ (NSArray<NSString *> *)prettyArgumentComponentsForMethod:(Method)method
-{
++ (NSArray<NSString *> *)prettyArgumentComponentsForMethod:(Method)method {
     NSMutableArray<NSString *> *components = [NSMutableArray array];
 
     NSString *selectorName = NSStringFromSelector(method_getName(method));
-    NSMutableArray<NSString *> *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) {
@@ -274,16 +264,14 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
 
 #pragma mark - Method Calling/Field Editing (Public)
 
-+ (id)performSelector:(SEL)selector onObject:(id)object
-{
++ (id)performSelector:(SEL)selector onObject:(id)object {
     return [self performSelector:selector onObject:object withArguments:@[] error:nil];
 }
 
 + (id)performSelector:(SEL)selector
              onObject:(id)object
         withArguments:(NSArray *)arguments
-                error:(NSError * __autoreleasing *)error
-{
+                error:(NSError * __autoreleasing *)error {
     static dispatch_once_t onceToken;
     static SEL stdStringExclusion = nil;
     dispatch_once(&onceToken, ^{
@@ -447,8 +435,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     return returnObject;
 }
 
-+ (BOOL)isTollFreeBridgedValue:(id)value forCFType:(const char *)typeEncoding
-{
++ (BOOL)isTollFreeBridgedValue:(id)value forCFType:(const char *)typeEncoding {
     // See https://developer.apple.com/library/archive/documentation/General/Conceptual/CocoaEncyclopedia/Toll-FreeBridgin/Toll-FreeBridgin.html
 #define CASE(cftype, foundationClass) \
     if (strcmp(typeEncoding, @encode(cftype)) == 0) { \
@@ -485,8 +472,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     return NO;
 }
 
-+ (NSString *)editableJSONStringForObject:(id)object
-{
++ (NSString *)editableJSONStringForObject:(id)object {
     NSString *editableDescription = nil;
 
     if (object) {
@@ -504,8 +490,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     return editableDescription;
 }
 
-+ (id)objectValueFromEditableJSONString:(NSString *)string
-{
++ (id)objectValueFromEditableJSONString:(NSString *)string {
     id value = nil;
     // nil for empty string/whitespace
     if ([string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]].length) {
@@ -518,8 +503,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     return value;
 }
 
-+ (NSValue *)valueForNumberWithObjCType:(const char *)typeEncoding fromInputString:(NSString *)inputString
-{
++ (NSValue *)valueForNumberWithObjCType:(const char *)typeEncoding fromInputString:(NSString *)inputString {
     NSNumberFormatter *formatter = [NSNumberFormatter new];
     [formatter setNumberStyle:NSNumberFormatterDecimalStyle];
     NSNumber *number = [formatter numberFromString:inputString];
@@ -575,8 +559,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
                                                  const char *fieldTypeEncoding,
                                                  NSString *prettyTypeEncoding,
                                                  NSUInteger fieldIndex,
-                                                 NSUInteger fieldOffset))typeBlock
-{
+                                                 NSUInteger fieldOffset))typeBlock {
     if (structEncoding && structEncoding[0] == FLEXTypeEncodingStructBegin) {
         const char *equals = strchr(structEncoding, '=');
         if (equals) {
@@ -628,8 +611,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
 
 #pragma mark - Metadata Helpers
 
-+ (NSDictionary<NSString *, NSString *> *)attributesForProperty:(objc_property_t)property
-{
++ (NSDictionary<NSString *, NSString *> *)attributesForProperty:(objc_property_t)property {
     NSString *attributes = @(property_getAttributes(property));
     // Thanks to MAObjcRuntime for inspiration here.
     NSArray<NSString *> *attributePairs = [attributes componentsSeparatedByString:@","];
@@ -640,8 +622,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     return attributesDictionary;
 }
 
-+ (NSString *)appendName:(NSString *)name toType:(NSString *)type
-{
++ (NSString *)appendName:(NSString *)name toType:(NSString *)type {
     if (!type.length) {
         type = @"(?)";
     }
@@ -655,8 +636,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     return combined;
 }
 
-+ (NSString *)readableTypeForEncoding:(NSString *)encodingString
-{
++ (NSString *)readableTypeForEncoding:(NSString *)encodingString {
     if (!encodingString.length) {
         return @"???";
     }
@@ -805,8 +785,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
 
 #pragma mark - Internal Helpers
 
-+ (NSValue *)valueForPrimitivePointer:(void *)pointer objCType:(const char *)type
-{
++ (NSValue *)valueForPrimitivePointer:(void *)pointer objCType:(const char *)type {
     // Remove the field name if there is any (e.g. \"width\"d -> d)
     const NSUInteger fieldNameOffset = [FLEXRuntimeUtility fieldNameOffsetForTypeEncoding:type];
     if (fieldNameOffset > 0) {