├── .clang-format
├── .github
├── FUNDING.yml
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── .gitignore
├── .travis.yml
├── CONTRIBUTING.md
├── Classes
├── Core
│ ├── Controllers
│ │ ├── FLEXFilteringTableViewController.h
│ │ ├── FLEXFilteringTableViewController.m
│ │ ├── FLEXNavigationController.h
│ │ ├── FLEXNavigationController.m
│ │ ├── FLEXTableViewController.h
│ │ └── FLEXTableViewController.m
│ ├── FLEXSingleRowSection.h
│ ├── FLEXSingleRowSection.m
│ ├── FLEXTableViewSection.h
│ ├── FLEXTableViewSection.m
│ └── Views
│ │ ├── Carousel
│ │ ├── FLEXCarouselCell.h
│ │ ├── FLEXCarouselCell.m
│ │ ├── FLEXScopeCarousel.h
│ │ └── FLEXScopeCarousel.m
│ │ ├── Cells
│ │ ├── FLEXCodeFontCell.h
│ │ ├── FLEXCodeFontCell.m
│ │ ├── FLEXKeyValueTableViewCell.h
│ │ ├── FLEXKeyValueTableViewCell.m
│ │ ├── FLEXMultilineTableViewCell.h
│ │ ├── FLEXMultilineTableViewCell.m
│ │ ├── FLEXSubtitleTableViewCell.h
│ │ ├── FLEXSubtitleTableViewCell.m
│ │ ├── FLEXTableViewCell.h
│ │ └── FLEXTableViewCell.m
│ │ ├── FLEXTableView.h
│ │ └── FLEXTableView.m
├── Editing
│ ├── ArgumentInputViews
│ │ ├── FLEXArgumentInputColorView.h
│ │ ├── FLEXArgumentInputColorView.m
│ │ ├── FLEXArgumentInputDateView.h
│ │ ├── FLEXArgumentInputDateView.m
│ │ ├── FLEXArgumentInputFontView.h
│ │ ├── FLEXArgumentInputFontView.m
│ │ ├── FLEXArgumentInputFontsPickerView.h
│ │ ├── FLEXArgumentInputFontsPickerView.m
│ │ ├── FLEXArgumentInputNotSupportedView.h
│ │ ├── FLEXArgumentInputNotSupportedView.m
│ │ ├── FLEXArgumentInputNumberView.h
│ │ ├── FLEXArgumentInputNumberView.m
│ │ ├── FLEXArgumentInputObjectView.h
│ │ ├── FLEXArgumentInputObjectView.m
│ │ ├── FLEXArgumentInputStringView.h
│ │ ├── FLEXArgumentInputStringView.m
│ │ ├── FLEXArgumentInputStructView.h
│ │ ├── FLEXArgumentInputStructView.m
│ │ ├── FLEXArgumentInputSwitchView.h
│ │ ├── FLEXArgumentInputSwitchView.m
│ │ ├── FLEXArgumentInputTextView.h
│ │ ├── FLEXArgumentInputTextView.m
│ │ ├── FLEXArgumentInputView.h
│ │ └── FLEXArgumentInputView.m
│ ├── FLEXArgumentInputViewFactory.h
│ ├── FLEXArgumentInputViewFactory.m
│ ├── FLEXDefaultEditorViewController.h
│ ├── FLEXDefaultEditorViewController.m
│ ├── FLEXFieldEditorView.h
│ ├── FLEXFieldEditorView.m
│ ├── FLEXFieldEditorViewController.h
│ ├── FLEXFieldEditorViewController.m
│ ├── FLEXMethodCallingViewController.h
│ ├── FLEXMethodCallingViewController.m
│ ├── FLEXVariableEditorViewController.h
│ └── FLEXVariableEditorViewController.m
├── ExplorerInterface
│ ├── Bookmarks
│ │ ├── FLEXBookmarkManager.h
│ │ ├── FLEXBookmarkManager.m
│ │ ├── FLEXBookmarksViewController.h
│ │ └── FLEXBookmarksViewController.m
│ ├── FLEXExplorerViewController.h
│ ├── FLEXExplorerViewController.m
│ ├── FLEXViewControllersViewController.h
│ ├── FLEXViewControllersViewController.m
│ ├── FLEXWindow.h
│ ├── FLEXWindow.m
│ ├── FLEXWindowManagerController.h
│ ├── FLEXWindowManagerController.m
│ └── Tabs
│ │ ├── FLEXTabList.h
│ │ ├── FLEXTabList.m
│ │ ├── FLEXTabsViewController.h
│ │ └── FLEXTabsViewController.m
├── FLEX-Categories.h
├── FLEX-Core.h
├── FLEX-ObjectExploring.h
├── FLEX-Runtime.h
├── FLEX.h
├── GlobalStateExplorers
│ ├── DatabaseBrowser
│ │ ├── FLEXDBQueryRowCell.h
│ │ ├── FLEXDBQueryRowCell.m
│ │ ├── FLEXDatabaseManager.h
│ │ ├── FLEXMultiColumnTableView.h
│ │ ├── FLEXMultiColumnTableView.m
│ │ ├── FLEXRealmDatabaseManager.h
│ │ ├── FLEXRealmDatabaseManager.m
│ │ ├── FLEXRealmDefines.h
│ │ ├── FLEXSQLResult.h
│ │ ├── FLEXSQLResult.m
│ │ ├── FLEXSQLiteDatabaseManager.h
│ │ ├── FLEXSQLiteDatabaseManager.m
│ │ ├── FLEXTableColumnHeader.h
│ │ ├── FLEXTableColumnHeader.m
│ │ ├── FLEXTableContentViewController.h
│ │ ├── FLEXTableContentViewController.m
│ │ ├── FLEXTableLeftCell.h
│ │ ├── FLEXTableLeftCell.m
│ │ ├── FLEXTableListViewController.h
│ │ ├── FLEXTableListViewController.m
│ │ └── LICENSE
│ ├── FLEXAddressExplorerCoordinator.h
│ ├── FLEXAddressExplorerCoordinator.m
│ ├── FLEXCookiesViewController.h
│ ├── FLEXCookiesViewController.m
│ ├── FLEXLiveObjectsController.h
│ ├── FLEXLiveObjectsController.m
│ ├── FLEXObjectListViewController.h
│ ├── FLEXObjectListViewController.m
│ ├── FLEXObjectRef.h
│ ├── FLEXObjectRef.m
│ ├── FLEXWebViewController.h
│ ├── FLEXWebViewController.m
│ ├── FileBrowser
│ │ ├── FLEXFileBrowserController.h
│ │ ├── FLEXFileBrowserController.m
│ │ ├── FLEXFileBrowserSearchOperation.h
│ │ └── FLEXFileBrowserSearchOperation.m
│ ├── Globals
│ │ ├── FLEXGlobalsEntry.h
│ │ ├── FLEXGlobalsEntry.m
│ │ ├── FLEXGlobalsSection.h
│ │ ├── FLEXGlobalsSection.m
│ │ ├── FLEXGlobalsViewController.h
│ │ └── FLEXGlobalsViewController.m
│ ├── Keychain
│ │ ├── FLEXKeychain.h
│ │ ├── FLEXKeychain.m
│ │ ├── FLEXKeychainQuery.h
│ │ ├── FLEXKeychainQuery.m
│ │ ├── FLEXKeychainViewController.h
│ │ ├── FLEXKeychainViewController.m
│ │ └── SSKeychain_LICENSE
│ ├── RuntimeBrowser
│ │ ├── DataSources
│ │ │ ├── FLEXRuntimeClient.h
│ │ │ ├── FLEXRuntimeClient.m
│ │ │ ├── FLEXRuntimeController.h
│ │ │ ├── FLEXRuntimeController.m
│ │ │ ├── FLEXRuntimeExporter.h
│ │ │ └── FLEXRuntimeExporter.m
│ │ ├── FLEXKBToolbarButton.h
│ │ ├── FLEXKBToolbarButton.m
│ │ ├── FLEXKeyPathSearchController.h
│ │ ├── FLEXKeyPathSearchController.m
│ │ ├── FLEXKeyboardToolbar.h
│ │ ├── FLEXKeyboardToolbar.m
│ │ ├── FLEXObjcRuntimeViewController.h
│ │ ├── FLEXObjcRuntimeViewController.m
│ │ ├── FLEXRuntimeBrowserToolbar.h
│ │ ├── FLEXRuntimeBrowserToolbar.m
│ │ ├── FLEXRuntimeKeyPath.h
│ │ ├── FLEXRuntimeKeyPath.m
│ │ ├── FLEXRuntimeKeyPathTokenizer.h
│ │ ├── FLEXRuntimeKeyPathTokenizer.m
│ │ ├── FLEXSearchToken.h
│ │ └── FLEXSearchToken.m
│ └── SystemLog
│ │ ├── ActivityStreamAPI.h
│ │ ├── FLEXASLLogController.h
│ │ ├── FLEXASLLogController.m
│ │ ├── FLEXLogController.h
│ │ ├── FLEXOSLogController.h
│ │ ├── FLEXOSLogController.m
│ │ ├── FLEXSystemLogCell.h
│ │ ├── FLEXSystemLogCell.m
│ │ ├── FLEXSystemLogMessage.h
│ │ ├── FLEXSystemLogMessage.m
│ │ ├── FLEXSystemLogViewController.h
│ │ ├── FLEXSystemLogViewController.m
│ │ └── LLVM_LICENSE.TXT
├── Info.plist
├── Manager
│ ├── FLEXManager+Extensibility.h
│ ├── FLEXManager+Extensibility.m
│ ├── FLEXManager+Networking.h
│ ├── FLEXManager+Networking.m
│ ├── FLEXManager.h
│ ├── FLEXManager.m
│ └── Private
│ │ └── FLEXManager+Private.h
├── Network
│ ├── FLEXNetworkCurlLogger.h
│ ├── FLEXNetworkCurlLogger.m
│ ├── FLEXNetworkMITMViewController.h
│ ├── FLEXNetworkMITMViewController.m
│ ├── FLEXNetworkRecorder.h
│ ├── FLEXNetworkRecorder.m
│ ├── FLEXNetworkSettingsController.h
│ ├── FLEXNetworkSettingsController.m
│ ├── FLEXNetworkTransaction.h
│ ├── FLEXNetworkTransaction.m
│ ├── FLEXNetworkTransactionCell.h
│ ├── FLEXNetworkTransactionCell.m
│ ├── FLEXNetworkTransactionDetailController.h
│ ├── FLEXNetworkTransactionDetailController.m
│ └── PonyDebugger
│ │ ├── FLEXNetworkObserver.h
│ │ ├── FLEXNetworkObserver.m
│ │ └── LICENSE
├── ObjectExplorers
│ ├── FLEXObjectExplorer.h
│ ├── FLEXObjectExplorer.m
│ ├── FLEXObjectExplorerFactory.h
│ ├── FLEXObjectExplorerFactory.m
│ ├── FLEXObjectExplorerViewController.h
│ ├── FLEXObjectExplorerViewController.m
│ └── Sections
│ │ ├── FLEXCollectionContentSection.h
│ │ ├── FLEXCollectionContentSection.m
│ │ ├── FLEXColorPreviewSection.h
│ │ ├── FLEXColorPreviewSection.m
│ │ ├── FLEXDefaultsContentSection.h
│ │ ├── FLEXDefaultsContentSection.m
│ │ ├── FLEXMetadataSection.h
│ │ ├── FLEXMetadataSection.m
│ │ ├── FLEXMutableListSection.h
│ │ ├── FLEXMutableListSection.m
│ │ ├── FLEXObjectInfoSection.h
│ │ └── Shortcuts
│ │ ├── FLEXBlockShortcuts.h
│ │ ├── FLEXBlockShortcuts.m
│ │ ├── FLEXBundleShortcuts.h
│ │ ├── FLEXBundleShortcuts.m
│ │ ├── FLEXClassShortcuts.h
│ │ ├── FLEXClassShortcuts.m
│ │ ├── FLEXImageShortcuts.h
│ │ ├── FLEXImageShortcuts.m
│ │ ├── FLEXLayerShortcuts.h
│ │ ├── FLEXLayerShortcuts.m
│ │ ├── FLEXNSDataShortcuts.h
│ │ ├── FLEXNSDataShortcuts.m
│ │ ├── FLEXNSStringShortcuts.h
│ │ ├── FLEXNSStringShortcuts.m
│ │ ├── FLEXShortcut.h
│ │ ├── FLEXShortcut.m
│ │ ├── FLEXShortcutsFactory+Defaults.h
│ │ ├── FLEXShortcutsFactory+Defaults.m
│ │ ├── FLEXShortcutsSection.h
│ │ ├── FLEXShortcutsSection.m
│ │ ├── FLEXUIAppShortcuts.h
│ │ ├── FLEXUIAppShortcuts.m
│ │ ├── FLEXViewControllerShortcuts.h
│ │ ├── FLEXViewControllerShortcuts.m
│ │ ├── FLEXViewShortcuts.h
│ │ └── FLEXViewShortcuts.m
├── Toolbar
│ ├── FLEXExplorerToolbar.h
│ ├── FLEXExplorerToolbar.m
│ ├── FLEXExplorerToolbarItem.h
│ └── FLEXExplorerToolbarItem.m
├── Utility
│ ├── APPLE_LICENSE
│ ├── Categories
│ │ ├── CALayer+FLEX.h
│ │ ├── CALayer+FLEX.m
│ │ ├── FLEXRuntime+Compare.h
│ │ ├── FLEXRuntime+Compare.m
│ │ ├── FLEXRuntime+UIKitHelpers.h
│ │ ├── FLEXRuntime+UIKitHelpers.m
│ │ ├── NSArray+FLEX.h
│ │ ├── NSArray+FLEX.m
│ │ ├── NSObject+FLEX_Reflection.h
│ │ ├── NSObject+FLEX_Reflection.m
│ │ ├── NSTimer+FLEX.h
│ │ ├── NSTimer+FLEX.m
│ │ ├── NSUserDefaults+FLEX.h
│ │ ├── NSUserDefaults+FLEX.m
│ │ ├── Private
│ │ │ ├── Cocoa+FLEXShortcuts.h
│ │ │ ├── Cocoa+FLEXShortcuts.m
│ │ │ ├── NSDictionary+ObjcRuntime.h
│ │ │ ├── NSDictionary+ObjcRuntime.m
│ │ │ ├── NSMapTable+FLEX_Subscripting.h
│ │ │ ├── NSMapTable+FLEX_Subscripting.m
│ │ │ ├── NSString+FLEX.h
│ │ │ ├── NSString+FLEX.m
│ │ │ ├── NSString+ObjcRuntime.h
│ │ │ ├── NSString+ObjcRuntime.m
│ │ │ ├── UIView+FLEX_Layout.h
│ │ │ └── UIView+FLEX_Layout.m
│ │ ├── UIBarButtonItem+FLEX.h
│ │ ├── UIBarButtonItem+FLEX.m
│ │ ├── UIFont+FLEX.h
│ │ ├── UIFont+FLEX.m
│ │ ├── UIGestureRecognizer+Blocks.h
│ │ ├── UIGestureRecognizer+Blocks.m
│ │ ├── UIMenu+FLEX.h
│ │ ├── UIMenu+FLEX.m
│ │ ├── UIPasteboard+FLEX.h
│ │ ├── UIPasteboard+FLEX.m
│ │ ├── UITextField+Range.h
│ │ ├── UITextField+Range.m
│ │ ├── UIView+FLEX_Layout.h
│ │ ├── UIViewController+FLEX.h
│ │ ├── UIViewController+FLEX.m
│ │ ├── UIWindow+FLEX.h
│ │ └── UIWindow+FLEX.m
│ ├── FLEXAlert.h
│ ├── FLEXAlert.m
│ ├── FLEXColor.h
│ ├── FLEXColor.m
│ ├── FLEXHeapEnumerator.h
│ ├── FLEXHeapEnumerator.m
│ ├── FLEXMacros.h
│ ├── FLEXResources.h
│ ├── FLEXResources.m
│ ├── FLEXUtility.h
│ ├── FLEXUtility.m
│ ├── Keyboard
│ │ ├── FLEXKeyboardHelpViewController.h
│ │ ├── FLEXKeyboardHelpViewController.m
│ │ ├── FLEXKeyboardShortcutManager.h
│ │ └── FLEXKeyboardShortcutManager.m
│ └── Runtime
│ │ ├── FLEXRuntimeUtility.h
│ │ ├── FLEXRuntimeUtility.m
│ │ ├── Objc
│ │ ├── FLEXObjcInternal.h
│ │ ├── FLEXObjcInternal.mm
│ │ ├── FLEXRuntimeConstants.h
│ │ ├── FLEXRuntimeConstants.m
│ │ ├── FLEXRuntimeSafety.h
│ │ ├── FLEXRuntimeSafety.m
│ │ ├── FLEXTypeEncodingParser.h
│ │ ├── FLEXTypeEncodingParser.m
│ │ └── Reflection
│ │ │ ├── FLEXBlockDescription.h
│ │ │ ├── FLEXBlockDescription.m
│ │ │ ├── FLEXClassBuilder.h
│ │ │ ├── FLEXClassBuilder.m
│ │ │ ├── FLEXIvar.h
│ │ │ ├── FLEXIvar.m
│ │ │ ├── FLEXMethod.h
│ │ │ ├── FLEXMethod.m
│ │ │ ├── FLEXMethodBase.h
│ │ │ ├── FLEXMethodBase.m
│ │ │ ├── FLEXMirror.h
│ │ │ ├── FLEXMirror.m
│ │ │ ├── FLEXProperty.h
│ │ │ ├── FLEXProperty.m
│ │ │ ├── FLEXPropertyAttributes.h
│ │ │ ├── FLEXPropertyAttributes.m
│ │ │ ├── FLEXProtocol.h
│ │ │ ├── FLEXProtocol.m
│ │ │ ├── FLEXProtocolBuilder.h
│ │ │ └── FLEXProtocolBuilder.m
│ │ ├── flex_fishhook.c
│ │ └── flex_fishhook.h
├── ViewHierarchy
│ ├── FLEXHierarchyViewController.h
│ ├── FLEXHierarchyViewController.m
│ ├── FLEXImagePreviewViewController.h
│ ├── FLEXImagePreviewViewController.m
│ ├── SnapshotExplorer
│ │ ├── FHSRangeSlider.h
│ │ ├── FHSRangeSlider.m
│ │ ├── FHSSnapshotView.h
│ │ ├── FHSSnapshotView.m
│ │ ├── FHSView.h
│ │ ├── FHSView.m
│ │ ├── FHSViewController.h
│ │ ├── FHSViewController.m
│ │ ├── FHSViewSnapshot.h
│ │ ├── FHSViewSnapshot.m
│ │ └── Scene
│ │ │ ├── FHSSnapshotNodes.h
│ │ │ ├── FHSSnapshotNodes.m
│ │ │ ├── SceneKit+Snapshot.h
│ │ │ └── SceneKit+Snapshot.m
│ └── TreeExplorer
│ │ ├── FLEXHierarchyTableViewCell.h
│ │ ├── FLEXHierarchyTableViewCell.m
│ │ ├── FLEXHierarchyTableViewController.h
│ │ └── FLEXHierarchyTableViewController.m
├── iOSPrefix.pch
└── tvOS
│ ├── FLEXFontListTableViewController.h
│ ├── FLEXFontListTableViewController.m
│ ├── FLEXTV.h
│ ├── FLEXTV.m
│ ├── KBDatePickerView.h
│ ├── KBDatePickerView.m
│ ├── KBSelectableTextView.h
│ ├── KBSelectableTextView.m
│ ├── KBSlider.h
│ ├── KBSlider.m
│ ├── Macros.h
│ └── tvOSPrefix.pch
├── Example
├── FLEXample.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── FLEXample.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── FLEXample
│ ├── App
│ │ ├── Commit.swift
│ │ ├── CommitListViewController.h
│ │ ├── CommitListViewController.m
│ │ ├── Person.h
│ │ └── Person.m
│ ├── AppDelegate.swift
│ ├── MiscNetworkRequests.h
│ ├── MiscNetworkRequests.m
│ ├── SceneDelegate.swift
│ └── Supporting Files
│ │ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── Contents.json
│ │ ├── Base.lproj
│ │ └── LaunchScreen.storyboard
│ │ ├── Bundle
│ │ ├── dogs.realm
│ │ ├── image
│ │ ├── image.jpeg
│ │ ├── image.jpg
│ │ ├── image.png
│ │ ├── music_library.db
│ │ └── music_library_schema.jpg
│ │ ├── FLEXample-Bridging-Header.h
│ │ ├── Info.plist
│ │ └── Preview Content
│ │ └── Preview Assets.xcassets
│ │ └── Contents.json
├── Podfile
└── Realm
│ ├── Dog.h
│ ├── Dog.m
│ ├── Owner.h
│ └── Owner.m
├── FLEX-tvOS-Info.plist
├── FLEX.podspec
├── FLEX.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── xcshareddata
│ └── xcschemes
│ ├── FLEX-tvOS.xcscheme
│ ├── FLEX.xcscheme
│ └── FLEXTests.xcscheme
├── FLEXTests
├── FLEXTests.m
├── FLEXTestsMethodsList.m
├── FLEXTypeEncodingParserTests.m
├── Info.plist
└── Supporting Files
│ ├── FLEXNewRootClass.h
│ └── FLEXNewRootClass.m
├── Graphics
├── FLEX-Icons.sketch
├── filetypes
│ ├── audio.png
│ ├── audio@2x.png
│ ├── audio@3x.png
│ ├── binary.png
│ ├── binary@2x.png
│ ├── binary@3x.png
│ ├── html.png
│ ├── html@2x.png
│ ├── html@3x.png
│ ├── js.png
│ ├── js@2x.png
│ ├── js@3x.png
│ ├── json.png
│ ├── json@2x.png
│ ├── json@3x.png
│ ├── old
│ │ ├── audio.pxm
│ │ ├── binary.pxm
│ │ ├── html.pxm
│ │ ├── js.pxm
│ │ ├── json.pxm
│ │ ├── plist.pxm
│ │ ├── text.pxm
│ │ ├── textplain.pxm
│ │ └── video.pxm
│ ├── plist.png
│ ├── plist@2x.png
│ ├── plist@3x.png
│ ├── text.png
│ ├── text@2x.png
│ ├── text@3x.png
│ ├── textplain.png
│ ├── textplain@2x.png
│ ├── textplain@3x.png
│ ├── video.png
│ ├── video@2x.png
│ ├── video@3x.png
│ ├── xml.png
│ ├── xml@2x.png
│ └── xml@3x.png
├── image_to_code.py
├── images_to_hex.sh
├── iterate_hex_to_pasteboard.sh
├── misc
│ ├── bookmarks.png
│ ├── bookmarks@2x.png
│ ├── bookmarks@3x.png
│ ├── checker.png
│ ├── checker@2x.png
│ ├── checker@3x.png
│ ├── gear.png
│ ├── gear@2x.png
│ ├── gear@3x.png
│ ├── more.png
│ ├── more@2x.png
│ ├── more@3x.png
│ ├── scrolldown.png
│ ├── scrolldown@2x.png
│ ├── scrolldown@3x.png
│ ├── tabs.png
│ ├── tabs@2x.png
│ ├── tabs@3x.png
│ ├── toggle2D.png
│ ├── toggle2D@2x.png
│ ├── toggle2D@3x.png
│ ├── toggle3D.png
│ ├── toggle3D@2x.png
│ └── toggle3D@3x.png
├── range-slider
│ ├── fill.png
│ ├── fill@2x.png
│ ├── fill@3x.png
│ ├── left_handle.png
│ ├── left_handle@2x.png
│ ├── left_handle@3x.png
│ ├── right_handle.png
│ ├── right_handle@2x.png
│ ├── right_handle@3x.png
│ ├── track.png
│ ├── track@2x.png
│ └── track@3x.png
└── toolbar
│ ├── close.png
│ ├── close@2x.png
│ ├── close@3x.png
│ ├── dragHandle.png
│ ├── dragHandle@2x.png
│ ├── dragHandle@3x.png
│ ├── move.png
│ ├── move@2x.png
│ ├── move@3x.png
│ ├── recent.png
│ ├── recent@2x.png
│ ├── recent@3x.png
│ ├── select.png
│ ├── select@2x.png
│ ├── select@3x.png
│ ├── views.png
│ ├── views@2x.png
│ ├── views@3x.png
│ ├── wrench.png
│ ├── wrench@2x.png
│ └── wrench@3x.png
├── LICENSE
├── README.md
├── flexinjected
├── FLEXInjected.plist
├── Makefile
├── Tweak.x
└── layout
│ ├── DEBIAN
│ └── control
│ └── Library
│ └── PreferenceLoader
│ └── Preferences
│ └── FLEXInjected.plist
├── layout
└── DEBIAN
│ └── control
├── postScript.sh
├── tvOSAccessoryImages
├── TVTableViewCellAccessoryChevron.jpg
├── TVTableViewCellAccessoryChevronDisclosureButton.jpg
├── TVTableViewCellAccessoryChevronOpen.jpg
├── TVTableViewCellAccessoryChevronOpenDisclosureButton.jpg
├── TVTableViewCellAccessoryDetailButton.jpg
└── TVTableViewCellAccessoryDetailDisclosureButton.jpg
├── tvOSBuild.sh
└── tvos_flexing.gif
/.clang-format:
--------------------------------------------------------------------------------
1 | ---
2 | BasedOnStyle: WebKit
3 | AccessModifierOffset: -2
4 | AlignEscapedNewlinesLeft: false
5 | AlignTrailingComments: true
6 | AllowAllParametersOfDeclarationOnNextLine: false
7 | AllowShortIfStatementsOnASingleLine: false
8 | AllowShortLoopsOnASingleLine: false
9 | AlwaysBreakBeforeMultilineStrings: false
10 | AlwaysBreakTemplateDeclarations: false
11 | BinPackParameters: true
12 | BreakBeforeBinaryOperators: false
13 | BreakBeforeBraces: Linux
14 | BreakBeforeTernaryOperators: true
15 | BreakConstructorInitializersBeforeComma: false
16 | ColumnLimit: 0
17 | ConstructorInitializerAllOnOneLineOrOnePerLine: true
18 | ConstructorInitializerIndentWidth: 4
19 | ContinuationIndentWidth: 4
20 | Cpp11BracedListStyle: true
21 | DerivePointerBinding: false
22 | ExperimentalAutoDetectBinPacking: false
23 | IndentCaseLabels: true
24 | IndentFunctionDeclarationAfterType: false
25 | IndentWidth: 4
26 | MaxEmptyLinesToKeep: 3
27 | NamespaceIndentation: None
28 | ObjCSpaceBeforeProtocolList: true
29 | PenaltyBreakBeforeFirstCallParameter: 19
30 | PenaltyBreakComment: 60
31 | PenaltyBreakFirstLessLess: 120
32 | PenaltyBreakString: 1000
33 | PenaltyExcessCharacter: 1000000
34 | PenaltyReturnTypeOnItsOwnLine: 60
35 | PointerBindsToType: false
36 | SpaceAfterControlStatementKeyword: true
37 | SpaceBeforeAssignmentOperators: true
38 | SpaceInEmptyParentheses: false
39 | SpacesBeforeTrailingComments: 1
40 | SpacesInAngles: false
41 | SpacesInCStyleCastParentheses: false
42 | SpacesInParentheses: false
43 | Standard: Auto
44 | TabWidth: 4
45 | UseTab: Never
46 |
47 | ...
48 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: [NSExceptional]
4 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Report a bug in FLEX
4 | title: ''
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | ### Environment
11 | - Platform+version: **iOS 14**
12 | - FLEX version: **9.9.9**
13 |
14 |
15 | ### Bug Report
16 |
17 | Here, you can provide a description of the bug. Some tips:
18 |
19 | - Please do not paste an entire crash log. Upload the crash log to something like [ghostbin.co](https://ghostbin.co/) or another paste service. Alternatively, you can cut out the relevant stack trace and paste that inside a ` ```code block``` `
20 | - If the bug is more complex than "this button is broken" or a crash, consider including a sample project. For example, if your app's requests aren't showing up in the network history page.
21 | - Providing steps to reproduce is always helpful!
22 | - If you want to include a screenshot or GIF, consider modifying the default markdown for uploaded images to use this code to make the image smaller on desktop:
23 | ```
24 |
25 | ```
26 |
27 | This template is a suggestion. You may format your issue however you want, but generally you should at least include your iOS version and FLEX version.
28 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest a new feature for FLEX
4 | title: ''
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | xcuserdata
13 | *.xccheckout
14 | *.moved-aside
15 | DerivedData
16 | *.hmap
17 | *.ipa
18 | *.xcuserstate
19 | .DS_Store
20 | /Example/Pods
21 | Podfile.lock
22 | IDEWorkspaceChecks.plist
23 |
24 | #tvOS specific
25 | libflex_*
26 | flexinjected/packages/*
27 | layout/Library/Frameworks/*.framework
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: objective-c
2 | xcode_workspace: FLEX.xcworkspace
3 | xcode_sdk: iphonesimulator
4 | before_install:
5 | - gem install xcpretty
6 | matrix:
7 | include:
8 | - xcode_scheme: UICatalog
9 | - xcode_scheme: FLEX
10 | script:
11 | - set -o pipefail
12 | - xcodebuild -workspace $TRAVIS_XCODE_WORKSPACE -scheme $TRAVIS_XCODE_SCHEME -sdk $TRAVIS_XCODE_SDK build | xcpretty
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to FLEX #
2 |
3 | We welcome contributions! Please open a pull request with your changes.
4 |
--------------------------------------------------------------------------------
/Classes/Core/Controllers/FLEXNavigationController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXNavigationController.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 1/30/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FLEXNavigationController : UINavigationController
14 |
15 | + (instancetype)withRootViewController:(UIViewController *)rootVC;
16 |
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/Classes/Core/FLEXSingleRowSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXSingleRowSection.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 9/25/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableViewSection.h"
10 |
11 | /// A section providing a specific single row.
12 | ///
13 | /// You may optionally provide a view controller to push when the row
14 | /// is selected, or an action to perform when it is selected.
15 | /// Which one is used first is up to the table view data source.
16 | @interface FLEXSingleRowSection : FLEXTableViewSection
17 |
18 | /// @param reuseIdentifier if nil, kFLEXDefaultCell is used.
19 | + (instancetype)title:(NSString *)sectionTitle
20 | reuse:(NSString *)reuseIdentifier
21 | cell:(void(^)(__kindof UITableViewCell *cell))cellConfiguration;
22 |
23 | @property (nonatomic) UIViewController *pushOnSelection;
24 | @property (nonatomic) void (^selectionAction)(UIViewController *host);
25 | /// Called to determine whether the single row should display itself or not.
26 | @property (nonatomic) BOOL (^filterMatcher)(NSString *filterText);
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/Classes/Core/Views/Carousel/FLEXCarouselCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXCarouselCell.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 7/17/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface FLEXCarouselCell : UICollectionViewCell
12 |
13 | @property (nonatomic, copy) NSString *title;
14 | @property (nonatomic, readonly) UILabel *titleLabel;
15 | - (void)updateAppearance;
16 | @end
17 |
--------------------------------------------------------------------------------
/Classes/Core/Views/Carousel/FLEXScopeCarousel.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXScopeCarousel.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 7/17/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /// Only use on iOS 10 and up. Requires iOS 10 APIs for calculating row sizes.
12 | @interface FLEXScopeCarousel : UIControl
13 |
14 | @property (nonatomic, copy) NSArray *items;
15 | @property (nonatomic) NSInteger selectedIndex;
16 | @property (nonatomic) void(^selectedIndexChangedAction)(NSInteger idx);
17 |
18 | - (void)registerBlockForDynamicTypeChanges:(void(^)(FLEXScopeCarousel *))handler;
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/Classes/Core/Views/Cells/FLEXCodeFontCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXCodeFontCell.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 12/27/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXMultilineTableViewCell.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FLEXCodeFontCell : FLEXMultilineDetailTableViewCell
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Classes/Core/Views/Cells/FLEXCodeFontCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXCodeFontCell.m
3 | // FLEX
4 | //
5 | // Created by Tanner on 12/27/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXCodeFontCell.h"
10 | #import "UIFont+FLEX.h"
11 |
12 | @implementation FLEXCodeFontCell
13 |
14 | - (void)postInit {
15 | [super postInit];
16 |
17 | self.titleLabel.font = UIFont.flex_codeFont;
18 | self.subtitleLabel.font = UIFont.flex_codeFont;
19 |
20 | self.titleLabel.adjustsFontSizeToFitWidth = YES;
21 | self.titleLabel.minimumScaleFactor = 0.9;
22 | self.subtitleLabel.adjustsFontSizeToFitWidth = YES;
23 | self.subtitleLabel.minimumScaleFactor = 0.75;
24 |
25 | // Disable mutli-line pre iOS 11
26 | if (@available(iOS 11, *)) {
27 | self.subtitleLabel.numberOfLines = 5;
28 | } else {
29 | self.titleLabel.numberOfLines = 1;
30 | self.subtitleLabel.numberOfLines = 1;
31 | }
32 | }
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/Classes/Core/Views/Cells/FLEXKeyValueTableViewCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXKeyValueTableViewCell.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 1/23/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableViewCell.h"
10 |
11 | @interface FLEXKeyValueTableViewCell : FLEXTableViewCell
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/Core/Views/Cells/FLEXKeyValueTableViewCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXKeyValueTableViewCell.m
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 1/23/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXKeyValueTableViewCell.h"
10 |
11 | @implementation FLEXKeyValueTableViewCell
12 |
13 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
14 | return [super initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier];
15 | }
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Classes/Core/Views/Cells/FLEXMultilineTableViewCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXMultilineTableViewCell.h
3 | // FLEX
4 | //
5 | // Created by Ryan Olson on 2/13/15.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableViewCell.h"
10 |
11 | /// A cell with both labels set to be multi-line capable.
12 | @interface FLEXMultilineTableViewCell : FLEXTableViewCell
13 |
14 | + (CGFloat)preferredHeightWithAttributedText:(NSAttributedString *)attributedText
15 | maxWidth:(CGFloat)contentViewWidth
16 | style:(UITableViewStyle)style
17 | showsAccessory:(BOOL)showsAccessory;
18 |
19 | @end
20 |
21 | /// A \c FLEXMultilineTableViewCell initialized with \c UITableViewCellStyleSubtitle
22 | @interface FLEXMultilineDetailTableViewCell : FLEXMultilineTableViewCell
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/Classes/Core/Views/Cells/FLEXSubtitleTableViewCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXSubtitleTableViewCell.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 4/17/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableViewCell.h"
10 |
11 | /// A cell initialized with \c UITableViewCellStyleSubtitle
12 | @interface FLEXSubtitleTableViewCell : FLEXTableViewCell
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Classes/Core/Views/Cells/FLEXSubtitleTableViewCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXSubtitleTableViewCell.m
3 | // FLEX
4 | //
5 | // Created by Tanner on 4/17/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXSubtitleTableViewCell.h"
10 |
11 | @implementation FLEXSubtitleTableViewCell
12 |
13 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
14 | return [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier];
15 | }
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Classes/Core/Views/Cells/FLEXTableViewCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXTableViewCell.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 4/17/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface FLEXTableViewCell : UITableViewCell
12 |
13 | /// Use this instead of .textLabel
14 | @property (nonatomic, readonly) UILabel *titleLabel;
15 | /// Use this instead of .detailTextLabel
16 | @property (nonatomic, readonly) UILabel *subtitleLabel;
17 |
18 | /// Subclasses can override this instead of initializers to
19 | /// perform additional initialization without lots of boilerplate.
20 | /// Remember to call super!
21 | - (void)postInit;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/Classes/Core/Views/Cells/FLEXTableViewCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXTableViewCell.m
3 | // FLEX
4 | //
5 | // Created by Tanner on 4/17/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableViewCell.h"
10 | #import "FLEXUtility.h"
11 | #import "FLEXColor.h"
12 | #import "FLEXTableView.h"
13 |
14 | @interface UITableView (Internal)
15 | // Exists at least since iOS 5
16 | - (BOOL)_canPerformAction:(SEL)action forCell:(UITableViewCell *)cell sender:(id)sender;
17 | - (void)_performAction:(SEL)action forCell:(UITableViewCell *)cell sender:(id)sender;
18 | @end
19 |
20 | @interface UITableViewCell (Internal)
21 | // Exists at least since iOS 5
22 | @property (nonatomic, readonly) FLEXTableView *_tableView;
23 | @end
24 |
25 | @implementation FLEXTableViewCell
26 |
27 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
28 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
29 | if (self) {
30 | [self postInit];
31 | }
32 |
33 | return self;
34 | }
35 |
36 | - (void)postInit {
37 | UIFont *cellFont = UIFont.flex_defaultTableCellFont;
38 | self.titleLabel.font = cellFont;
39 | self.subtitleLabel.font = cellFont;
40 | #if !TARGET_OS_TV
41 | self.subtitleLabel.textColor = FLEXColor.deemphasizedTextColor;
42 | #endif
43 | self.titleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
44 | self.subtitleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
45 |
46 | self.titleLabel.numberOfLines = 1;
47 | self.subtitleLabel.numberOfLines = 1;
48 | }
49 |
50 | - (UILabel *)titleLabel {
51 | return self.textLabel;
52 | }
53 |
54 | - (UILabel *)subtitleLabel {
55 | return self.detailTextLabel;
56 | }
57 |
58 | @end
59 |
--------------------------------------------------------------------------------
/Classes/Editing/ArgumentInputViews/FLEXArgumentInputColorView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXArgumentInputColorView.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 6/30/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXArgumentInputView.h"
10 |
11 | @interface FLEXArgumentInputColorView : FLEXArgumentInputView
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/Editing/ArgumentInputViews/FLEXArgumentInputDateView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXArgumentInputDataView.h
3 | // Flipboard
4 | //
5 | // Created by Daniel Rodriguez Troitino on 2/14/15.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXArgumentInputView.h"
10 |
11 | @interface FLEXArgumentInputDateView : FLEXArgumentInputView
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/Editing/ArgumentInputViews/FLEXArgumentInputFontView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXArgumentInputFontView.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 6/28/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXArgumentInputView.h"
10 |
11 | @interface FLEXArgumentInputFontView : FLEXArgumentInputView
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/Editing/ArgumentInputViews/FLEXArgumentInputFontsPickerView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXArgumentInputFontsPickerView.h
3 | // FLEX
4 | //
5 | // Created by 啟倫 陳 on 2014/7/27.
6 | // Copyright (c) 2014年 f. All rights reserved.
7 | //
8 |
9 | #import "FLEXArgumentInputTextView.h"
10 |
11 | #if TARGET_OS_TV
12 | @interface FLEXArgumentInputFontsPickerView : FLEXArgumentInputTextView
13 | #else
14 | @interface FLEXArgumentInputFontsPickerView : FLEXArgumentInputTextView
15 | #endif
16 | @end
17 |
--------------------------------------------------------------------------------
/Classes/Editing/ArgumentInputViews/FLEXArgumentInputNotSupportedView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXArgumentInputNotSupportedView.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 6/18/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXArgumentInputTextView.h"
10 |
11 | @interface FLEXArgumentInputNotSupportedView : FLEXArgumentInputTextView
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/Editing/ArgumentInputViews/FLEXArgumentInputNotSupportedView.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXArgumentInputNotSupportedView.m
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 6/18/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXArgumentInputNotSupportedView.h"
10 | #import "FLEXColor.h"
11 |
12 | @implementation FLEXArgumentInputNotSupportedView
13 |
14 | - (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding {
15 | self = [super initWithArgumentTypeEncoding:typeEncoding];
16 | if (self) {
17 | self.inputTextView.userInteractionEnabled = NO;
18 | self.inputTextView.backgroundColor = [FLEXColor secondaryGroupedBackgroundColorWithAlpha:0.5];
19 | self.inputPlaceholderText = @"nil (type not supported)";
20 | self.targetSize = FLEXArgumentInputViewSizeSmall;
21 | }
22 | return self;
23 | }
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/Classes/Editing/ArgumentInputViews/FLEXArgumentInputNumberView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXArgumentInputNumberView.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 6/15/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXArgumentInputTextView.h"
10 |
11 | @interface FLEXArgumentInputNumberView : FLEXArgumentInputTextView
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/Editing/ArgumentInputViews/FLEXArgumentInputObjectView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXArgumentInputObjectView.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 6/15/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXArgumentInputTextView.h"
10 |
11 | @interface FLEXArgumentInputObjectView : FLEXArgumentInputTextView
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/Editing/ArgumentInputViews/FLEXArgumentInputStringView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXArgumentInputStringView.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 6/28/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXArgumentInputTextView.h"
10 |
11 | @interface FLEXArgumentInputStringView : FLEXArgumentInputTextView
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/Editing/ArgumentInputViews/FLEXArgumentInputStructView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXArgumentInputStructView.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 6/16/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXArgumentInputView.h"
10 |
11 | @interface FLEXArgumentInputStructView : FLEXArgumentInputView
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/Editing/ArgumentInputViews/FLEXArgumentInputSwitchView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXArgumentInputSwitchView.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 6/16/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXArgumentInputView.h"
10 |
11 | @interface FLEXArgumentInputSwitchView : FLEXArgumentInputView
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/Editing/ArgumentInputViews/FLEXArgumentInputTextView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXArgumentInputTextView.h
3 | // FLEXInjected
4 | //
5 | // Created by Ryan Olson on 6/15/14.
6 | //
7 | //
8 |
9 | #import "FLEXArgumentInputView.h"
10 | #if TARGET_OS_TV
11 | #import "KBSelectableTextView.h"
12 | #endif
13 |
14 | @interface FLEXArgumentInputTextView : FLEXArgumentInputView
15 |
16 | // For subclass eyes only
17 | #if TARGET_OS_TV
18 | @property (nonatomic, readonly) KBSelectableTextView *inputTextView;
19 | #else
20 | @property (nonatomic, readonly) UITextView *inputTextView;
21 | #endif
22 | @property (nonatomic) NSString *inputPlaceholderText;
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/Classes/Editing/FLEXArgumentInputViewFactory.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXArgumentInputViewFactory.h
3 | // FLEXInjected
4 | //
5 | // Created by Ryan Olson on 6/15/14.
6 | //
7 | //
8 |
9 | #import
10 | #import "FLEXArgumentInputSwitchView.h"
11 |
12 | @interface FLEXArgumentInputViewFactory : NSObject
13 |
14 | /// Forwards to argumentInputViewForTypeEncoding:currentValue: with a nil currentValue.
15 | + (FLEXArgumentInputView *)argumentInputViewForTypeEncoding:(const char *)typeEncoding;
16 |
17 | /// The main factory method for making argument input view subclasses that are the best fit for the type.
18 | + (FLEXArgumentInputView *)argumentInputViewForTypeEncoding:(const char *)typeEncoding currentValue:(id)currentValue;
19 |
20 | /// A way to check if we should try editing a filed given its type encoding and value.
21 | /// Useful when deciding whether to edit or explore a property, ivar, or NSUserDefaults value.
22 | + (BOOL)canEditFieldWithTypeEncoding:(const char *)typeEncoding currentValue:(id)currentValue;
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/Classes/Editing/FLEXDefaultEditorViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXDefaultEditorViewController.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 5/23/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXFieldEditorViewController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FLEXDefaultEditorViewController : FLEXVariableEditorViewController
14 |
15 | + (instancetype)target:(NSUserDefaults *)defaults key:(NSString *)key commitHandler:(void(^_Nullable)())onCommit;
16 |
17 | + (BOOL)canEditDefaultWithValue:(nullable id)currentValue;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/Classes/Editing/FLEXFieldEditorView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXFieldEditorView.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 5/16/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class FLEXArgumentInputView;
12 |
13 | @interface FLEXFieldEditorView : UIView
14 |
15 | @property (nonatomic, copy) NSString *targetDescription;
16 | @property (nonatomic, copy) NSString *fieldDescription;
17 |
18 | @property (nonatomic, copy) NSArray *argumentInputViews;
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/Classes/Editing/FLEXFieldEditorViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXFieldEditorViewController.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 11/22/18.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXVariableEditorViewController.h"
10 | #import "FLEXProperty.h"
11 | #import "FLEXIvar.h"
12 |
13 | NS_ASSUME_NONNULL_BEGIN
14 |
15 | @interface FLEXFieldEditorViewController : FLEXVariableEditorViewController
16 |
17 | /// @return nil if the property is readonly or if the type is unsupported
18 | + (nullable instancetype)target:(id)target property:(FLEXProperty *)property commitHandler:(void(^_Nullable)())onCommit;
19 | /// @return nil if the ivar type is unsupported
20 | + (nullable instancetype)target:(id)target ivar:(FLEXIvar *)ivar commitHandler:(void(^_Nullable)())onCommit;
21 | #if TARGET_OS_TV
22 | /// Subclasses can change the button title via the \c title property
23 | @property (nonatomic, readonly) UIButton *getterButton;
24 | #else
25 | /// Subclasses can change the button title via the \c title property
26 | @property (nonatomic, readonly) UIBarButtonItem *getterButton;
27 | #endif
28 | - (void)getterButtonPressed:(id)sender;
29 |
30 | @end
31 |
32 | NS_ASSUME_NONNULL_END
33 |
--------------------------------------------------------------------------------
/Classes/Editing/FLEXMethodCallingViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXMethodCallingViewController.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 5/23/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXVariableEditorViewController.h"
10 | #import "FLEXMethod.h"
11 |
12 | @interface FLEXMethodCallingViewController : FLEXVariableEditorViewController
13 |
14 | + (instancetype)target:(id)target method:(FLEXMethod *)method;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Classes/ExplorerInterface/Bookmarks/FLEXBookmarkManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXBookmarkManager.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 2/6/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FLEXBookmarkManager : NSObject
14 |
15 | @property (nonatomic, readonly, class) NSMutableArray *bookmarks;
16 |
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/Classes/ExplorerInterface/Bookmarks/FLEXBookmarkManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXBookmarkManager.m
3 | // FLEX
4 | //
5 | // Created by Tanner on 2/6/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXBookmarkManager.h"
10 |
11 | static NSMutableArray *kFLEXBookmarkManagerBookmarks = nil;
12 |
13 | @implementation FLEXBookmarkManager
14 |
15 | + (void)initialize {
16 | if (self == [FLEXBookmarkManager class]) {
17 | kFLEXBookmarkManagerBookmarks = [NSMutableArray new];
18 | }
19 | }
20 |
21 | + (NSMutableArray *)bookmarks {
22 | return kFLEXBookmarkManagerBookmarks;
23 | }
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/Classes/ExplorerInterface/Bookmarks/FLEXBookmarksViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXBookmarksViewController.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 2/6/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableViewController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FLEXBookmarksViewController : FLEXTableViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Classes/ExplorerInterface/FLEXViewControllersViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXViewControllersViewController.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 2/13/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXFilteringTableViewController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FLEXViewControllersViewController : FLEXFilteringTableViewController
14 |
15 | + (instancetype)controllersForViews:(NSArray *)views;
16 |
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/Classes/ExplorerInterface/FLEXWindow.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXWindow.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 4/13/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @protocol FLEXWindowEventDelegate
12 |
13 | - (BOOL)shouldHandleTouchAtPoint:(CGPoint)pointInWindow;
14 | - (BOOL)canBecomeKeyWindow;
15 |
16 | @end
17 |
18 | #pragma mark -
19 | @interface FLEXWindow : UIWindow
20 |
21 | @property (nonatomic, weak) id eventDelegate;
22 |
23 | /// Tracked so we can restore the key window after dismissing a modal.
24 | /// We need to become key after modal presentation so we can correctly capture input.
25 | /// If we're just showing the toolbar, we want the main app's window to remain key
26 | /// so that we don't interfere with input, status bar, etc.
27 | @property (nonatomic, readonly) UIWindow *previousKeyWindow;
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/Classes/ExplorerInterface/FLEXWindowManagerController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXWindowManagerController.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 2/6/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableViewController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FLEXWindowManagerController : FLEXTableViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Classes/ExplorerInterface/Tabs/FLEXTabList.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXTabList.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 2/1/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FLEXTabList : NSObject
14 |
15 | @property (nonatomic, readonly, class) FLEXTabList *sharedList;
16 |
17 | @property (nonatomic, readonly, nullable) UINavigationController *activeTab;
18 | @property (nonatomic, readonly) NSArray *openTabs;
19 | /// Snapshots of each tab when they were last active.
20 | @property (nonatomic, readonly) NSArray *openTabSnapshots;
21 | /// \c NSNotFound if no tabs are present.
22 | /// Setting this property changes the active tab to one of the already open tabs.
23 | @property (nonatomic) NSInteger activeTabIndex;
24 |
25 | /// Adds a new tab and sets the new tab as the active tab.
26 | - (void)addTab:(UINavigationController *)newTab;
27 | /// Closes the given tab. If this tab was the active tab,
28 | /// the most recent tab before that becomes the active tab.
29 | - (void)closeTab:(UINavigationController *)tab;
30 | /// Closes a tab at the given index. If this tab was the active tab,
31 | /// the most recent tab before that becomes the active tab.
32 | - (void)closeTabAtIndex:(NSInteger)idx;
33 | /// Closes all of the tabs at the given indexes. If the active tab
34 | /// is included, the most recent still-open tab becomes the active tab.
35 | - (void)closeTabsAtIndexes:(NSIndexSet *)indexes;
36 | /// A shortcut to close the active tab.
37 | - (void)closeActiveTab;
38 | /// A shortcut to close \e every tab.
39 | - (void)closeAllTabs;
40 |
41 | - (void)updateSnapshotForActiveTab;
42 |
43 | @end
44 |
45 | NS_ASSUME_NONNULL_END
46 |
--------------------------------------------------------------------------------
/Classes/ExplorerInterface/Tabs/FLEXTabsViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXTabsViewController.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 2/4/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableViewController.h"
10 |
11 | @interface FLEXTabsViewController : FLEXTableViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/FLEX-Categories.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEX-Categories.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/12/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 |
10 |
11 | #import
12 | #import
13 | #import
14 | #import
15 | #import
16 | #import
17 | #import
18 |
19 | #import
20 | #import
21 | #import
22 | #import
23 |
--------------------------------------------------------------------------------
/Classes/FLEX-Core.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEX-Core.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/11/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import
12 | #import
13 |
14 | #import
15 | #import
16 |
17 | #import
18 | #import
19 | #import
20 | #import
21 | #import
22 |
23 | #import
24 |
--------------------------------------------------------------------------------
/Classes/FLEX-ObjectExploring.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEX-ObjectExploring.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/11/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | #import
13 |
14 | #import
15 | #import
16 | #import
17 | #import
18 | #import
19 | #import
20 | #import
21 | #import
22 | #import
23 | #import
24 |
25 | #import
26 | #import
27 | #import
28 | #import
29 | #import
30 | #import
31 |
--------------------------------------------------------------------------------
/Classes/FLEX-Runtime.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEX-Runtime.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/11/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import
12 | #import
13 |
14 | #import
15 | #import
16 | #import
17 | #import
18 | #import
19 | #import
20 | #import
21 | #import
22 | #import
23 |
24 | #import
25 | #import
26 |
--------------------------------------------------------------------------------
/Classes/FLEX.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEX.h
3 | // FLEX
4 | //
5 | // Created by Eric Horacek on 7/18/15.
6 | // Modified by Tanner Bennett on 3/12/20.
7 | // Copyright (c) 2020 FLEX Team. All rights reserved.
8 | //
9 |
10 | #import
11 | #import
12 | #import
13 |
14 | #import
15 | #import
16 | #import
17 |
18 | #import
19 | #import
20 | #import
21 | #import
22 |
23 | #import
24 | #import
25 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/DatabaseBrowser/FLEXDBQueryRowCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXDBQueryRowCell.h
3 | // FLEX
4 | //
5 | // Created by Peng Tao on 15/11/24.
6 | // Copyright © 2015年 f. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class FLEXDBQueryRowCell;
12 |
13 | extern NSString * const kFLEXDBQueryRowCellReuse;
14 |
15 | @protocol FLEXDBQueryRowCellLayoutSource
16 |
17 | - (CGFloat)dbQueryRowCell:(FLEXDBQueryRowCell *)dbQueryRowCell minXForColumn:(NSUInteger)column;
18 | - (CGFloat)dbQueryRowCell:(FLEXDBQueryRowCell *)dbQueryRowCell widthForColumn:(NSUInteger)column;
19 |
20 | @end
21 |
22 | @interface FLEXDBQueryRowCell : UITableViewCell
23 |
24 | /// An array of NSString, NSNumber, or NSData objects
25 | @property (nonatomic) NSArray *data;
26 | @property (nonatomic, weak) id layoutSource;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/DatabaseBrowser/FLEXDatabaseManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // PTDatabaseManager.h
3 | // Derived from:
4 | //
5 | // FMDatabase.h
6 | // FMDB( https://github.com/ccgus/fmdb )
7 | //
8 | // Created by Peng Tao on 15/11/23.
9 | //
10 | // Licensed to Flying Meat Inc. under one or more contributor license agreements.
11 | // See the LICENSE file distributed with this work for the terms under
12 | // which Flying Meat Inc. licenses this file to you.
13 |
14 | #import
15 | #import "FLEXSQLResult.h"
16 |
17 | /// Conformers should automatically open and close the database
18 | @protocol FLEXDatabaseManager
19 |
20 | @required
21 |
22 | /// @return \c nil if the database couldn't be opened
23 | + (instancetype)managerForDatabase:(NSString *)path;
24 |
25 | /// @return a list of all table names
26 | - (NSArray *)queryAllTables;
27 | - (NSArray *)queryAllColumnsOfTable:(NSString *)tableName;
28 | - (NSArray *)queryAllDataInTable:(NSString *)tableName;
29 |
30 | @optional
31 |
32 | - (NSArray *)queryRowIDsInTable:(NSString *)tableName;
33 | - (FLEXSQLResult *)executeStatement:(NSString *)SQLStatement;
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/DatabaseBrowser/FLEXMultiColumnTableView.h:
--------------------------------------------------------------------------------
1 | //
2 | // PTMultiColumnTableView.h
3 | // PTMultiColumnTableViewDemo
4 | //
5 | // Created by Peng Tao on 15/11/16.
6 | // Copyright © 2015年 Peng Tao. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FLEXTableColumnHeader.h"
11 |
12 | @class FLEXMultiColumnTableView;
13 |
14 | @protocol FLEXMultiColumnTableViewDelegate
15 |
16 | @required
17 | - (void)multiColumnTableView:(FLEXMultiColumnTableView *)tableView didSelectRow:(NSInteger)row;
18 | - (void)multiColumnTableView:(FLEXMultiColumnTableView *)tableView didSelectHeaderForColumn:(NSInteger)column sortType:(FLEXTableColumnHeaderSortType)sortType;
19 |
20 | @end
21 |
22 | @protocol FLEXMultiColumnTableViewDataSource
23 |
24 | @required
25 |
26 | - (NSInteger)numberOfColumnsInTableView:(FLEXMultiColumnTableView *)tableView;
27 | - (NSInteger)numberOfRowsInTableView:(FLEXMultiColumnTableView *)tableView;
28 | - (NSString *)columnTitle:(NSInteger)column;
29 | - (NSString *)rowTitle:(NSInteger)row;
30 | - (NSArray *)contentForRow:(NSInteger)row;
31 |
32 | - (CGFloat)multiColumnTableView:(FLEXMultiColumnTableView *)tableView minWidthForContentCellInColumn:(NSInteger)column;
33 | - (CGFloat)multiColumnTableView:(FLEXMultiColumnTableView *)tableView heightForContentCellInRow:(NSInteger)row;
34 | - (CGFloat)heightForTopHeaderInTableView:(FLEXMultiColumnTableView *)tableView;
35 | - (CGFloat)widthForLeftHeaderInTableView:(FLEXMultiColumnTableView *)tableView;
36 |
37 | @end
38 |
39 |
40 | @interface FLEXMultiColumnTableView : UIView
41 |
42 | @property (nonatomic, weak) id dataSource;
43 | @property (nonatomic, weak) id delegate;
44 |
45 | - (void)reloadData;
46 |
47 | @end
48 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/DatabaseBrowser/FLEXRealmDatabaseManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXRealmDatabaseManager.h
3 | // FLEX
4 | //
5 | // Created by Tim Oliver on 28/01/2016.
6 | // Copyright © 2016 Realm. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FLEXDatabaseManager.h"
11 |
12 | @interface FLEXRealmDatabaseManager : NSObject
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/DatabaseBrowser/FLEXRealmDefines.h:
--------------------------------------------------------------------------------
1 | //
2 | // Realm.h
3 | // FLEX
4 | //
5 | // Created by Tim Oliver on 16/02/2016.
6 | // Copyright © 2016 Realm. All rights reserved.
7 | //
8 |
9 | #if __has_include()
10 | #else
11 |
12 | @class RLMObject, RLMResults, RLMRealm, RLMRealmConfiguration, RLMSchema, RLMObjectSchema, RLMProperty;
13 |
14 | @interface RLMRealmConfiguration : NSObject
15 | @property (nonatomic, copy) NSURL *fileURL;
16 | @end
17 |
18 | @interface RLMRealm : NSObject
19 | @property (nonatomic, readonly) RLMSchema *schema;
20 | + (RLMRealm *)realmWithConfiguration:(RLMRealmConfiguration *)configuration error:(NSError **)error;
21 | - (RLMResults *)allObjects:(NSString *)className;
22 | @end
23 |
24 | @interface RLMSchema : NSObject
25 | @property (nonatomic, readonly) NSArray *objectSchema;
26 | - (RLMObjectSchema *)schemaForClassName:(NSString *)className;
27 | @end
28 |
29 | @interface RLMObjectSchema : NSObject
30 | @property (nonatomic, readonly) NSString *className;
31 | @property (nonatomic, readonly) NSArray *properties;
32 | @end
33 |
34 | @interface RLMProperty : NSString
35 | @property (nonatomic, readonly) NSString *name;
36 | @end
37 |
38 | @interface RLMResults : NSObject
39 | @property (nonatomic, readonly) NSInteger count;
40 | @end
41 |
42 | @interface RLMObject : NSObject
43 |
44 | @end
45 |
46 | #endif
47 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/DatabaseBrowser/FLEXSQLResult.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXSQLResult.m
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/3/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXSQLResult.h"
10 | #import "NSArray+FLEX.h"
11 |
12 | @implementation FLEXSQLResult
13 | @synthesize keyedRows = _keyedRows;
14 |
15 | + (instancetype)message:(NSString *)message {
16 | return [[self alloc] initWithmessage:message columns:nil rows:nil];
17 | }
18 |
19 | + (instancetype)error:(NSString *)message {
20 | FLEXSQLResult *result = [self message:message];
21 | result->_isError = YES;
22 | return result;
23 | }
24 |
25 | + (instancetype)columns:(NSArray *)columnNames rows:(NSArray *> *)rowData {
26 | return [[self alloc] initWithmessage:nil columns:columnNames rows:rowData];
27 | }
28 |
29 | - (id)initWithmessage:(NSString *)message columns:(NSArray *)columns rows:(NSArray *)rows {
30 | NSParameterAssert(message || (columns && rows));
31 | NSParameterAssert(columns.count == rows.firstObject.count);
32 |
33 | self = [super init];
34 | if (self) {
35 | _message = message;
36 | _columns = columns;
37 | _rows = rows;
38 | }
39 |
40 | return self;
41 | }
42 |
43 | - (NSArray *> *)keyedRows {
44 | if (!_keyedRows) {
45 | _keyedRows = [self.rows flex_mapped:^id(NSArray *row, NSUInteger idx) {
46 | return [NSDictionary dictionaryWithObjects:row forKeys:self.columns];
47 | }];
48 | }
49 |
50 | return _keyedRows;
51 | }
52 |
53 | @end
54 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/DatabaseBrowser/FLEXSQLiteDatabaseManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // PTDatabaseManager.h
3 | // Derived from:
4 | //
5 | // FMDatabase.h
6 | // FMDB( https://github.com/ccgus/fmdb )
7 | //
8 | // Created by Peng Tao on 15/11/23.
9 | //
10 | // Licensed to Flying Meat Inc. under one or more contributor license agreements.
11 | // See the LICENSE file distributed with this work for the terms under
12 | // which Flying Meat Inc. licenses this file to you.
13 |
14 | #import
15 | #import "FLEXDatabaseManager.h"
16 | #import "FLEXSQLResult.h"
17 |
18 | @interface FLEXSQLiteDatabaseManager : NSObject
19 |
20 | /// Contains the result of the last operation, which may be an error
21 | @property (nonatomic, readonly) FLEXSQLResult *lastResult;
22 | /// Calls into \c sqlite3_last_insert_rowid()
23 | @property (nonatomic, readonly) NSInteger lastRowID;
24 |
25 | /// Given a statement like 'SELECT * from @table where @col = @val' and arguments
26 | /// like { @"table": @"Album", @"col": @"year", @"val" @1 } this method will
27 | /// invoke the statement and properly bind the given arguments to the statement.
28 | ///
29 | /// You may pass NSStrings, NSData, NSNumbers, or NSNulls as values.
30 | - (FLEXSQLResult *)executeStatement:(NSString *)statement arguments:(NSDictionary *)args;
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableColumnHeader.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXTableContentHeaderCell.h
3 | // FLEX
4 | //
5 | // Created by Peng Tao on 15/11/26.
6 | // Copyright © 2015年 f. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef NS_ENUM(NSUInteger, FLEXTableColumnHeaderSortType) {
12 | FLEXTableColumnHeaderSortTypeNone = 0,
13 | FLEXTableColumnHeaderSortTypeAsc,
14 | FLEXTableColumnHeaderSortTypeDesc,
15 | };
16 |
17 | NS_INLINE FLEXTableColumnHeaderSortType FLEXNextTableColumnHeaderSortType(
18 | FLEXTableColumnHeaderSortType current) {
19 | switch (current) {
20 | case FLEXTableColumnHeaderSortTypeAsc:
21 | return FLEXTableColumnHeaderSortTypeDesc;
22 | case FLEXTableColumnHeaderSortTypeNone:
23 | case FLEXTableColumnHeaderSortTypeDesc:
24 | return FLEXTableColumnHeaderSortTypeAsc;
25 | }
26 |
27 | return FLEXTableColumnHeaderSortTypeNone;
28 | }
29 |
30 | @interface FLEXTableColumnHeader : UIView
31 |
32 | @property (nonatomic) NSInteger index;
33 | @property (nonatomic, readonly) UILabel *titleLabel;
34 |
35 | @property (nonatomic) FLEXTableColumnHeaderSortType sortType;
36 |
37 | @end
38 |
39 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableContentViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // PTTableContentViewController.h
3 | // PTDatabaseReader
4 | //
5 | // Created by Peng Tao on 15/11/23.
6 | // Copyright © 2015年 Peng Tao. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FLEXDatabaseManager.h"
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface FLEXTableContentViewController : UIViewController
15 |
16 | /// Display a table with the given columns, rows, and name.
17 | /// @param databaseManager an optional manager to allow modifying the table.
18 | + (instancetype)columns:(NSArray *)columnNames
19 | rows:(NSArray *> *)rowData
20 | rowIDs:(nullable NSArray *)rowIds
21 | tableName:(NSString *)tableName
22 | database:(nullable id)databaseManager;
23 |
24 | @end
25 |
26 | NS_ASSUME_NONNULL_END
27 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableLeftCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXTableLeftCell.h
3 | // FLEX
4 | //
5 | // Created by Peng Tao on 15/11/24.
6 | // Copyright © 2015年 f. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface FLEXTableLeftCell : UITableViewCell
12 |
13 | @property (nonatomic) UILabel *titlelabel;
14 |
15 | + (instancetype)cellWithTableView:(UITableView *)tableView;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableLeftCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXTableLeftCell.m
3 | // FLEX
4 | //
5 | // Created by Peng Tao on 15/11/24.
6 | // Copyright © 2015年 f. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableLeftCell.h"
10 |
11 | @implementation FLEXTableLeftCell
12 |
13 | + (instancetype)cellWithTableView:(UITableView *)tableView {
14 | static NSString *identifier = @"FLEXTableLeftCell";
15 | FLEXTableLeftCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
16 |
17 | if (!cell) {
18 | cell = [[FLEXTableLeftCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
19 | UILabel *textLabel = [UILabel new];
20 | textLabel.textAlignment = NSTextAlignmentCenter;
21 | textLabel.font = [UIFont systemFontOfSize:13.0];
22 | [cell.contentView addSubview:textLabel];
23 | cell.titlelabel = textLabel;
24 | }
25 |
26 | return cell;
27 | }
28 |
29 | - (void)layoutSubviews {
30 | [super layoutSubviews];
31 | self.titlelabel.frame = self.contentView.frame;
32 | }
33 | @end
34 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/DatabaseBrowser/FLEXTableListViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // PTTableListViewController.h
3 | // PTDatabaseReader
4 | //
5 | // Created by Peng Tao on 15/11/23.
6 | // Copyright © 2015年 Peng Tao. All rights reserved.
7 | //
8 |
9 | #import "FLEXFilteringTableViewController.h"
10 |
11 | @interface FLEXTableListViewController : FLEXFilteringTableViewController
12 |
13 | + (BOOL)supportsExtension:(NSString *)extension;
14 | - (instancetype)initWithPath:(NSString *)path;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/DatabaseBrowser/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | FMDB
3 | Copyright (c) 2008-2014 Flying Meat Inc.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/FLEXAddressExplorerCoordinator.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXAddressExplorerCoordinator.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 7/10/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXGlobalsEntry.h"
10 |
11 | @interface FLEXAddressExplorerCoordinator : NSObject
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/FLEXCookiesViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXCookiesViewController.h
3 | // FLEX
4 | //
5 | // Created by Rich Robinson on 19/10/2015.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXGlobalsEntry.h"
10 | #import "FLEXFilteringTableViewController.h"
11 |
12 | @interface FLEXCookiesViewController : FLEXFilteringTableViewController
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/FLEXLiveObjectsController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXLiveObjectsController.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 5/28/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableViewController.h"
10 | #import "FLEXGlobalsEntry.h"
11 |
12 | @interface FLEXLiveObjectsController : FLEXTableViewController
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/FLEXObjectListViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXObjectListViewController.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 5/28/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXFilteringTableViewController.h"
10 |
11 | @interface FLEXObjectListViewController : FLEXFilteringTableViewController
12 |
13 | /// This will either return a list of the instances, or take you straight
14 | /// to the explorer itself if there is only one instance.
15 | + (UIViewController *)instancesOfClassWithName:(NSString *)className;
16 | + (instancetype)subclassesOfClassWithName:(NSString *)className;
17 | + (instancetype)objectsWithReferencesToObject:(id)object;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/FLEXObjectRef.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXObjectRef.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 7/24/18.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface FLEXObjectRef : NSObject
12 |
13 | + (instancetype)referencing:(id)object;
14 | + (instancetype)referencing:(id)object ivar:(NSString *)ivarName;
15 |
16 | + (NSArray *)referencingAll:(NSArray *)objects;
17 | /// Classes do not have a summary, and the reference is just the class name.
18 | + (NSArray *)referencingClasses:(NSArray *)classes;
19 |
20 | /// For example, "NSString 0x1d4085d0" or "NSLayoutConstraint _object"
21 | @property (nonatomic, readonly) NSString *reference;
22 | /// For instances, this is the result of -[FLEXRuntimeUtility summaryForObject:]
23 | /// For classes, there is no summary.
24 | @property (nonatomic, readonly) NSString *summary;
25 | @property (nonatomic, readonly) id object;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/FLEXWebViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXWebViewController.m
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 6/10/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #if TARGET_OS_TV
12 |
13 | @class KBWebView;
14 |
15 | @protocol KBWebViewDelegate
16 |
17 | @optional
18 | - (BOOL)webView:(KBWebView *_Nonnull)webView shouldStartLoadWithRequest:(NSURLRequest *_Nonnull)request navigationType:(NSInteger)navigationType;
19 | - (void)webViewDidStartLoad:(KBWebView *_Nonnull)webView;
20 | - (void)webViewDidFinishLoad:(KBWebView *_Nonnull)webView;
21 | - (void)webView:(KBWebView *_Nonnull)webView didFailLoadWithError:(NSError *_Nullable)error;
22 |
23 | @end
24 |
25 | @protocol KBWebViewDelegate;
26 |
27 | @interface KBWebView: UIView
28 | @property (nullable, nonatomic, assign) id delegate;
29 |
30 | - (void)loadRequest:(NSURLRequest *_Nonnull)request;
31 | - (void)loadHTMLString:(NSString *_Nonnull)string baseURL:(nullable NSURL *)baseURL;
32 | - (void)loadData:(NSData *_Nonnull)data MIMEType:(NSString *_Nullable)MIMEType textEncodingName:(NSString *_Nonnull)textEncodingName baseURL:(NSURL *_Nonnull)baseURL;
33 |
34 | @property (nullable, nonatomic, readonly, strong) NSURLRequest *request;
35 |
36 | - (void)reload;
37 | - (void)stopLoading;
38 |
39 | - (void)goBack;
40 | - (void)goForward;
41 | @end
42 |
43 | @interface FLEXWebViewController : UIViewController
44 |
45 | #else
46 |
47 | @interface FLEXWebViewController : UIViewController
48 |
49 | #endif
50 |
51 |
52 | - (id)initWithURL:(NSURL *)url;
53 | - (id)initWithText:(NSString *)text;
54 |
55 | + (BOOL)supportsPathExtension:(NSString *)extension;
56 |
57 | @end
58 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/FileBrowser/FLEXFileBrowserController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXFileBrowserController.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 6/9/14.
6 | // Based on previous work by Evan Doll
7 | //
8 |
9 | #import "FLEXTableViewController.h"
10 | #import "FLEXGlobalsEntry.h"
11 | #import "FLEXFileBrowserSearchOperation.h"
12 |
13 | @interface FLEXFileBrowserController : FLEXTableViewController
14 |
15 | + (instancetype)path:(NSString *)path;
16 | - (id)initWithPath:(NSString *)path;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/FileBrowser/FLEXFileBrowserSearchOperation.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXFileBrowserSearchOperation.h
3 | // FLEX
4 | //
5 | // Created by 啟倫 陳 on 2014/8/4.
6 | // Copyright (c) 2014年 f. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @protocol FLEXFileBrowserSearchOperationDelegate;
12 |
13 | @interface FLEXFileBrowserSearchOperation : NSOperation
14 |
15 | @property (nonatomic, weak) id delegate;
16 |
17 | - (id)initWithPath:(NSString *)currentPath searchString:(NSString *)searchString;
18 |
19 | @end
20 |
21 | @protocol FLEXFileBrowserSearchOperationDelegate
22 |
23 | - (void)fileBrowserSearchOperationResult:(NSArray *)searchResult size:(uint64_t)size;
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/Globals/FLEXGlobalsSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXGlobalsSection.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 7/11/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableViewSection.h"
10 | #import "FLEXGlobalsEntry.h"
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface FLEXGlobalsSection : FLEXTableViewSection
15 |
16 | + (instancetype)title:(NSString *)title rows:(NSArray *)rows;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/Globals/FLEXGlobalsViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXGlobalsViewController.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 2014-05-03.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXFilteringTableViewController.h"
10 | @protocol FLEXGlobalsTableViewControllerDelegate;
11 |
12 | typedef NS_ENUM(NSUInteger, FLEXGlobalsSectionKind) {
13 | FLEXGlobalsSectionCustom,
14 | /// NSProcessInfo, Network history, system log,
15 | /// heap, address explorer, libraries, app classes
16 | FLEXGlobalsSectionProcessAndEvents,
17 | /// Browse container, browse bundle, NSBundle.main,
18 | /// NSUserDefaults.standard, UIApplication,
19 | /// app delegate, key window, root VC, cookies
20 | FLEXGlobalsSectionAppShortcuts,
21 | /// UIPasteBoard.general, UIScreen, UIDevice
22 | FLEXGlobalsSectionMisc,
23 | FLEXGlobalsSectionCount
24 | };
25 |
26 | @interface FLEXGlobalsViewController : FLEXFilteringTableViewController
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/Keychain/FLEXKeychainViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXKeychainViewController.h
3 | // FLEX
4 | //
5 | // Created by ray on 2019/8/17.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXGlobalsEntry.h"
10 | #import "FLEXFilteringTableViewController.h"
11 |
12 | @interface FLEXKeychainViewController : FLEXFilteringTableViewController
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/Keychain/SSKeychain_LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010-2012 Sam Soffes.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/RuntimeBrowser/DataSources/FLEXRuntimeController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXRuntimeController.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/23/17.
6 | // Copyright © 2017 Tanner Bennett. All rights reserved.
7 | //
8 |
9 | #import "FLEXRuntimeKeyPath.h"
10 |
11 | /// Wraps FLEXRuntimeClient and provides extra caching mechanisms
12 | @interface FLEXRuntimeController : NSObject
13 |
14 | /// @return An array of strings if the key path only evaluates
15 | /// to a class or bundle; otherwise, a list of lists of FLEXMethods.
16 | + (NSArray *)dataForKeyPath:(FLEXRuntimeKeyPath *)keyPath;
17 |
18 | /// Useful when you need to specify which classes to search in.
19 | /// \c dataForKeyPath: will only search classes matching the class key.
20 | /// We use this elsewhere when we need to search a class hierarchy.
21 | + (NSArray *> *)methodsForToken:(FLEXSearchToken *)token
22 | instance:(NSNumber *)onlyInstanceMethods
23 | inClasses:(NSArray *)classes;
24 |
25 | /// Useful when you need the classes that are associated with the
26 | /// double list of methods returned from \c dataForKeyPath
27 | + (NSMutableArray *)classesForKeyPath:(FLEXRuntimeKeyPath *)keyPath;
28 |
29 | + (NSString *)shortBundleNameForClass:(NSString *)name;
30 |
31 | + (NSString *)imagePathWithShortName:(NSString *)suffix;
32 |
33 | /// Gives back short names. For example, "Foundation.framework"
34 | + (NSArray *)allBundleNames;
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/RuntimeBrowser/DataSources/FLEXRuntimeExporter.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXRuntimeExporter.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 3/26/20.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | /// A class for exporting all runtime metadata to an SQLite database.
14 | //API_AVAILABLE(ios(10.0))
15 | @interface FLEXRuntimeExporter : NSObject
16 |
17 | + (void)createRuntimeDatabaseAtPath:(NSString *)path
18 | progressHandler:(void(^)(NSString *status))progress
19 | completion:(void(^)(NSString *_Nullable error))completion;
20 |
21 | + (void)createRuntimeDatabaseAtPath:(NSString *)path
22 | forImages:(nullable NSArray *)images
23 | progressHandler:(void(^)(NSString *status))progress
24 | completion:(void(^)(NSString *_Nullable error))completion;
25 |
26 |
27 | @end
28 |
29 | NS_ASSUME_NONNULL_END
30 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/RuntimeBrowser/FLEXKBToolbarButton.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXKBToolbarButton.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 6/11/17.
6 | // Copyright © 2017 Tanner Bennett. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef void (^FLEXKBToolbarAction)(NSString *buttonTitle, BOOL isSuggestion);
12 |
13 |
14 | @interface FLEXKBToolbarButton : UIButton
15 |
16 | /// Set to `default` to use the system appearance on iOS 13+
17 | @property (nonatomic) UIKeyboardAppearance appearance;
18 |
19 | + (instancetype)buttonWithTitle:(NSString *)title;
20 | + (instancetype)buttonWithTitle:(NSString *)title action:(FLEXKBToolbarAction)eventHandler;
21 | + (instancetype)buttonWithTitle:(NSString *)title action:(FLEXKBToolbarAction)action forControlEvents:(UIControlEvents)controlEvents;
22 |
23 | /// Adds the event handler for the button.
24 | ///
25 | /// @param eventHandler The event handler block.
26 | /// @param controlEvents The type of event.
27 | - (void)addEventHandler:(FLEXKBToolbarAction)eventHandler forControlEvents:(UIControlEvents)controlEvents;
28 |
29 | @end
30 |
31 | @interface FLEXKBToolbarSuggestedButton : FLEXKBToolbarButton @end
32 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/RuntimeBrowser/FLEXKeyPathSearchController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXKeyPathSearchController.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/23/17.
6 | // Copyright © 2017 Tanner Bennett. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FLEXRuntimeBrowserToolbar.h"
11 | #import "FLEXMethod.h"
12 | #import
13 | @protocol FLEXKeyPathSearchControllerDelegate
14 |
15 | @property (nonatomic, readonly) UITableView *tableView;
16 | @property (nonatomic, readonly) UISearchController *searchController;
17 |
18 | /// For loaded images which don't have an NSBundle
19 | - (void)didSelectImagePath:(NSString *)message shortName:(NSString *)shortName;
20 | - (void)didSelectBundle:(NSBundle *)bundle;
21 | - (void)didSelectClass:(Class)cls;
22 |
23 | @end
24 |
25 |
26 | @interface FLEXKeyPathSearchController : NSObject
27 |
28 | + (instancetype)delegate:(id)delegate;
29 |
30 | @property (nonatomic) FLEXRuntimeBrowserToolbar *toolbar;
31 |
32 | /// Suggestions for the toolbar
33 | @property (nonatomic, readonly) NSArray *suggestions;
34 |
35 | - (void)didSelectKeyPathOption:(NSString *)text;
36 | - (void)didPressButton:(NSString *)text insertInto:(UISearchBar *)searchBar;
37 | #if TARGET_OS_TV
38 | - (void)basicSearchWithText:(NSString *)text;
39 | #endif
40 | @end
41 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/RuntimeBrowser/FLEXKeyboardToolbar.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXKeyboardToolbar.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 6/11/17.
6 | // Copyright © 2017 Tanner Bennett. All rights reserved.
7 | //
8 |
9 | #import "FLEXKBToolbarButton.h"
10 |
11 | @interface FLEXKeyboardToolbar : UIView
12 |
13 | + (instancetype)toolbarWithButtons:(NSArray *)buttons;
14 |
15 | @property (nonatomic) NSArray *buttons;
16 | @property (nonatomic) UIKeyboardAppearance appearance;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/RuntimeBrowser/FLEXObjcRuntimeViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXObjcRuntimeViewController.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/23/17.
6 | // Copyright © 2017 Tanner Bennett. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableViewController.h"
10 | #import "FLEXGlobalsEntry.h"
11 |
12 | @interface FLEXObjcRuntimeViewController : FLEXTableViewController
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/RuntimeBrowser/FLEXRuntimeBrowserToolbar.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXRuntimeBrowserToolbar.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 6/11/17.
6 | // Copyright © 2017 Tanner Bennett. All rights reserved.
7 | //
8 |
9 | #import "FLEXKeyboardToolbar.h"
10 | #import "FLEXRuntimeKeyPath.h"
11 |
12 | @interface FLEXRuntimeBrowserToolbar : FLEXKeyboardToolbar
13 |
14 | + (instancetype)toolbarWithHandler:(FLEXKBToolbarAction)tapHandler suggestions:(NSArray *)suggestions;
15 |
16 | - (void)setKeyPath:(FLEXRuntimeKeyPath *)keyPath suggestions:(NSArray *)suggestions;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/RuntimeBrowser/FLEXRuntimeKeyPath.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXRuntimeKeyPath.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/22/17.
6 | // Copyright © 2017 Tanner Bennett. All rights reserved.
7 | //
8 |
9 | #import "FLEXSearchToken.h"
10 | @class FLEXMethod;
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | /// A key path represents a query into a set of bundles or classes
15 | /// for a set of one or more methods. It is composed of three tokens:
16 | /// bundle, class, and method. A key path may be incomplete if it
17 | /// is missing any of the tokens. A key path is considered "absolute"
18 | /// if all tokens have no options and if methodKey.string begins
19 | /// with a + or a -.
20 | ///
21 | /// The @code TBKeyPathTokenizer @endcode class is used to create
22 | /// a key path from a string.
23 | @interface FLEXRuntimeKeyPath : NSObject
24 |
25 | + (instancetype)empty;
26 |
27 | /// @param method must start with either a wildcard or a + or -.
28 | + (instancetype)bundle:(FLEXSearchToken *)bundle
29 | class:(FLEXSearchToken *)cls
30 | method:(FLEXSearchToken *)method
31 | isInstance:(NSNumber *)instance
32 | string:(NSString *)keyPathString;
33 |
34 | @property (nonatomic, nullable, readonly) FLEXSearchToken *bundleKey;
35 | @property (nonatomic, nullable, readonly) FLEXSearchToken *classKey;
36 | @property (nonatomic, nullable, readonly) FLEXSearchToken *methodKey;
37 |
38 | /// Indicates whether the method token specifies instance methods.
39 | /// Nil if not specified.
40 | @property (nonatomic, nullable, readonly) NSNumber *instanceMethods;
41 |
42 | @end
43 | NS_ASSUME_NONNULL_END
44 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/RuntimeBrowser/FLEXRuntimeKeyPathTokenizer.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXRuntimeKeyPathTokenizer.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/22/17.
6 | // Copyright © 2017 Tanner Bennett. All rights reserved.
7 | //
8 |
9 | #import "FLEXRuntimeKeyPath.h"
10 |
11 | @interface FLEXRuntimeKeyPathTokenizer : NSObject
12 |
13 | + (NSUInteger)tokenCountOfString:(NSString *)userInput;
14 | + (FLEXRuntimeKeyPath *)tokenizeString:(NSString *)userInput;
15 |
16 | + (BOOL)allowedInKeyPath:(NSString *)text;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/RuntimeBrowser/FLEXSearchToken.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXSearchToken.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/22/17.
6 | // Copyright © 2017 Tanner Bennett. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef NS_OPTIONS(NSUInteger, TBWildcardOptions) {
12 | TBWildcardOptionsNone = 0,
13 | TBWildcardOptionsAny = 1,
14 | TBWildcardOptionsPrefix = 1 << 1,
15 | TBWildcardOptionsSuffix = 1 << 2,
16 | };
17 |
18 | /// A token may contain wildcards at one or either end,
19 | /// but not in the middle of the token (as of now).
20 | @interface FLEXSearchToken : NSObject
21 |
22 | + (instancetype)any;
23 | + (instancetype)string:(NSString *)string options:(TBWildcardOptions)options;
24 |
25 | /// Will not contain the wildcard (*) symbol
26 | @property (nonatomic, readonly) NSString *string;
27 | @property (nonatomic, readonly) TBWildcardOptions options;
28 |
29 | /// Opposite of "is ambiguous"
30 | @property (nonatomic, readonly) BOOL isAbsolute;
31 | @property (nonatomic, readonly) BOOL isAny;
32 | /// Still \c isAny, but checks that the string is empty
33 | @property (nonatomic, readonly) BOOL isEmpty;
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/SystemLog/FLEXASLLogController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXASLLogController.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/14/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXLogController.h"
10 |
11 | @interface FLEXASLLogController : NSObject
12 |
13 | /// Guaranteed to call back on the main thread.
14 | + (instancetype)withUpdateHandler:(void(^)(NSArray *newMessages))newMessagesHandler;
15 |
16 | - (BOOL)startMonitoring;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/SystemLog/FLEXLogController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXLogController.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/17/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FLEXSystemLogMessage.h"
11 |
12 | @protocol FLEXLogController
13 |
14 | /// Guaranteed to call back on the main thread.
15 | + (instancetype)withUpdateHandler:(void(^)(NSArray *newMessages))newMessagesHandler;
16 |
17 | - (BOOL)startMonitoring;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/SystemLog/FLEXOSLogController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXOSLogController.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 12/19/18.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXLogController.h"
10 |
11 | #define FLEXOSLogAvailable() (NSProcessInfo.processInfo.operatingSystemVersion.majorVersion >= 10)
12 |
13 | /// The log controller used for iOS 10 and up.
14 | @interface FLEXOSLogController : NSObject
15 |
16 | + (instancetype)withUpdateHandler:(void(^)(NSArray *newMessages))newMessagesHandler;
17 |
18 | - (BOOL)startMonitoring;
19 |
20 | /// Whether log messages are to be recorded and kept in-memory in the background.
21 | /// You do not need to initialize this value, only change it.
22 | @property (nonatomic) BOOL persistent;
23 | /// Used mostly internally, but also used by the log VC to persist messages
24 | /// that were created prior to enabling persistence.
25 | @property (nonatomic) NSMutableArray *messages;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/SystemLog/FLEXSystemLogCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXSystemLogCell.h
3 | // FLEX
4 | //
5 | // Created by Ryan Olson on 1/25/15.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableViewCell.h"
10 |
11 | @class FLEXSystemLogMessage;
12 |
13 | extern NSString *const kFLEXSystemLogCellIdentifier;
14 |
15 | @interface FLEXSystemLogCell : FLEXTableViewCell
16 |
17 | @property (nonatomic) FLEXSystemLogMessage *logMessage;
18 | @property (nonatomic, copy) NSString *highlightedText;
19 |
20 | + (NSString *)displayedTextForLogMessage:(FLEXSystemLogMessage *)logMessage;
21 | + (CGFloat)preferredHeightForLogMessage:(FLEXSystemLogMessage *)logMessage inWidth:(CGFloat)width;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/SystemLog/FLEXSystemLogMessage.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXSystemLogMessage.h
3 | // FLEX
4 | //
5 | // Created by Ryan Olson on 1/25/15.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import "ActivityStreamAPI.h"
12 |
13 | NS_ASSUME_NONNULL_BEGIN
14 |
15 | @interface FLEXSystemLogMessage : NSObject
16 |
17 | + (instancetype)logMessageFromASLMessage:(aslmsg)aslMessage;
18 | + (instancetype)logMessageFromDate:(NSDate *)date text:(NSString *)text;
19 |
20 | // ASL specific properties
21 | @property (nonatomic, readonly, nullable) NSString *sender;
22 | @property (nonatomic, readonly, nullable) aslmsg aslMessage;
23 |
24 | @property (nonatomic, readonly) NSDate *date;
25 | @property (nonatomic, readonly) NSString *messageText;
26 | @property (nonatomic, readonly) long long messageID;
27 |
28 | @end
29 |
30 | NS_ASSUME_NONNULL_END
31 |
--------------------------------------------------------------------------------
/Classes/GlobalStateExplorers/SystemLog/FLEXSystemLogViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXSystemLogViewController.h
3 | // FLEX
4 | //
5 | // Created by Ryan Olson on 1/19/15.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXFilteringTableViewController.h"
10 | #import "FLEXGlobalsEntry.h"
11 |
12 | @interface FLEXSystemLogViewController : FLEXFilteringTableViewController
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Classes/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(CURRENT_PROJECT_VERSION)
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Classes/Manager/FLEXManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXManager.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 4/4/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXExplorerToolbar.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FLEXManager : NSObject
14 |
15 | @property (nonatomic, readonly, class) FLEXManager *sharedManager;
16 |
17 | @property (nonatomic, readonly) BOOL isHidden;
18 | @property (nonatomic, readonly) FLEXExplorerToolbar *toolbar;
19 |
20 | - (void)showExplorer;
21 | - (void)hideExplorer;
22 | - (void)toggleExplorer;
23 |
24 | /// Programmatically dismiss anything presented by FLEX, leaving only the toolbar visible.
25 | - (void)dismissAnyPresentedTools:(void (^_Nullable)(void))completion;
26 | /// Programmatically present something on top of the FLEX toolbar.
27 | /// This method will automatically dismiss any currently presented tool,
28 | /// so you do not need to call \c dismissAnyPresentedTools: yourself.
29 | - (void)presentTool:(UINavigationController *(^)(void))viewControllerFuture
30 | completion:(void (^_Nullable)(void))completion;
31 |
32 | ///tvOS specific
33 |
34 | - (void)showHintsAlert;
35 |
36 | /// Use this to present the explorer in a specific scene when the one
37 | /// it chooses by default is not the one you wish to display it in.
38 | - (void)showExplorerFromScene:(UIWindowScene *)scene API_AVAILABLE(ios(13.0));
39 |
40 | #pragma mark - Misc
41 |
42 | /// Default database password is @c nil by default.
43 | /// Set this to the password you want the databases to open with.
44 | @property (copy, nonatomic) NSString *defaultSqliteDatabasePassword;
45 |
46 | @end
47 |
48 |
49 | typedef UIViewController * _Nullable(^FLEXCustomContentViewerFuture)(NSData *data);
50 |
51 | NS_ASSUME_NONNULL_END
52 |
--------------------------------------------------------------------------------
/Classes/Manager/Private/FLEXManager+Private.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXManager+Private.h
3 | // PebbleApp
4 | //
5 | // Created by Javier Soto on 7/26/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXManager.h"
10 | #import "FLEXWindow.h"
11 |
12 | @class FLEXGlobalsEntry, FLEXExplorerViewController;
13 |
14 | @interface FLEXManager (Private)
15 |
16 | @property (nonatomic, readonly) FLEXWindow *explorerWindow;
17 | @property (nonatomic, readonly) FLEXExplorerViewController *explorerViewController;
18 |
19 | /// An array of FLEXGlobalsEntry objects that have been registered by the user.
20 | @property (nonatomic, readonly) NSMutableArray *userGlobalEntries;
21 | @property (nonatomic, readonly) NSMutableDictionary *customContentTypeViewers;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/Classes/Network/FLEXNetworkCurlLogger.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXCurlLogger.h
3 | //
4 | //
5 | // Created by Ji Pei on 07/27/16
6 | //
7 |
8 | #import
9 |
10 | @interface FLEXNetworkCurlLogger : NSObject
11 |
12 | /**
13 | * Generates a cURL command equivalent to the given request.
14 | *
15 | * @param request The request to be translated
16 | */
17 | + (NSString *)curlCommandString:(NSURLRequest *)request;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Classes/Network/FLEXNetworkCurlLogger.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXCurlLogger.m
3 | //
4 | //
5 | // Created by Ji Pei on 07/27/16
6 | //
7 |
8 | #import "FLEXNetworkCurlLogger.h"
9 |
10 | @implementation FLEXNetworkCurlLogger
11 |
12 | + (NSString *)curlCommandString:(NSURLRequest *)request {
13 | __block NSMutableString *curlCommandString = [NSMutableString stringWithFormat:@"curl -v -X %@ ", request.HTTPMethod];
14 |
15 | [curlCommandString appendFormat:@"\'%@\' ", request.URL.absoluteString];
16 |
17 | [request.allHTTPHeaderFields enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *val, BOOL *stop) {
18 | [curlCommandString appendFormat:@"-H \'%@: %@\' ", key, val];
19 | }];
20 |
21 | NSArray *cookies = [NSHTTPCookieStorage.sharedHTTPCookieStorage cookiesForURL:request.URL];
22 | if (cookies) {
23 | [curlCommandString appendFormat:@"-H \'Cookie:"];
24 | for (NSHTTPCookie *cookie in cookies) {
25 | [curlCommandString appendFormat:@" %@=%@;", cookie.name, cookie.value];
26 | }
27 | [curlCommandString appendFormat:@"\' "];
28 | }
29 |
30 | if (request.HTTPBody) {
31 | NSString *body = [[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding];
32 | [curlCommandString appendFormat:@"-d \'%@\'", body];
33 | }
34 |
35 | return curlCommandString;
36 | }
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/Classes/Network/FLEXNetworkMITMViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXNetworkMITMViewController.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 2/8/15.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableViewController.h"
10 | #import "FLEXGlobalsEntry.h"
11 |
12 | @interface FLEXNetworkMITMViewController : FLEXTableViewController
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Classes/Network/FLEXNetworkSettingsController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXNetworkSettingsController.h
3 | // FLEXInjected
4 | //
5 | // Created by Ryan Olson on 2/20/15.
6 | //
7 |
8 | #import "FLEXTableViewController.h"
9 |
10 | @interface FLEXNetworkSettingsController : FLEXTableViewController
11 |
12 | @end
13 |
--------------------------------------------------------------------------------
/Classes/Network/FLEXNetworkTransaction.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXNetworkTransaction.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 2/8/15.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "UIKit/UIKit.h"
11 |
12 | typedef NS_ENUM(NSInteger, FLEXNetworkTransactionState) {
13 | FLEXNetworkTransactionStateUnstarted,
14 | FLEXNetworkTransactionStateAwaitingResponse,
15 | FLEXNetworkTransactionStateReceivingData,
16 | FLEXNetworkTransactionStateFinished,
17 | FLEXNetworkTransactionStateFailed
18 | };
19 |
20 | @interface FLEXNetworkTransaction : NSObject
21 |
22 | @property (nonatomic, copy) NSString *requestID;
23 |
24 | @property (nonatomic) NSURLRequest *request;
25 | @property (nonatomic) NSURLResponse *response;
26 | @property (nonatomic, copy) NSString *requestMechanism;
27 | @property (nonatomic) FLEXNetworkTransactionState transactionState;
28 | @property (nonatomic) NSError *error;
29 |
30 | @property (nonatomic) NSDate *startTime;
31 | @property (nonatomic) NSTimeInterval latency;
32 | @property (nonatomic) NSTimeInterval duration;
33 |
34 | @property (nonatomic) int64_t receivedDataLength;
35 |
36 | /// Only applicable for image downloads. A small thumbnail to preview the full response.
37 | @property (nonatomic) UIImage *responseThumbnail;
38 |
39 | /// Populated lazily. Handles both normal HTTPBody data and HTTPBodyStreams.
40 | @property (nonatomic, readonly) NSData *cachedRequestBody;
41 |
42 | + (NSString *)readableStringFromTransactionState:(FLEXNetworkTransactionState)state;
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/Classes/Network/FLEXNetworkTransactionCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXNetworkTransactionCell.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 2/8/15.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | extern NSString * const kFLEXNetworkTransactionCellIdentifier;
12 |
13 | @class FLEXNetworkTransaction;
14 |
15 | @interface FLEXNetworkTransactionCell : UITableViewCell
16 |
17 | @property (nonatomic) FLEXNetworkTransaction *transaction;
18 |
19 | + (CGFloat)preferredCellHeight;
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/Classes/Network/FLEXNetworkTransactionDetailController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXNetworkTransactionDetailController.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 2/10/15.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class FLEXNetworkTransaction;
12 |
13 | @interface FLEXNetworkTransactionDetailController : UITableViewController
14 |
15 | @property (nonatomic) FLEXNetworkTransaction *transaction;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Classes/Network/PonyDebugger/FLEXNetworkObserver.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXNetworkObserver.h
3 | // Derived from:
4 | //
5 | // PDAFNetworkDomainController.h
6 | // PonyDebugger
7 | //
8 | // Created by Mike Lewis on 2/27/12.
9 | //
10 | // Licensed to Square, Inc. under one or more contributor license agreements.
11 | // See the LICENSE file distributed with this work for the terms under
12 | // which Square, Inc. licenses this file to you.
13 | //
14 |
15 | #import
16 |
17 | FOUNDATION_EXTERN NSString *const kFLEXNetworkObserverEnabledStateChangedNotification;
18 |
19 | /// This class swizzles NSURLConnection and NSURLSession delegate methods to observe events in the URL loading system.
20 | /// High level network events are sent to the default FLEXNetworkRecorder instance which maintains the request history and caches response bodies.
21 | @interface FLEXNetworkObserver : NSObject
22 |
23 | /// Swizzling occurs when the observer is enabled for the first time.
24 | /// This reduces the impact of FLEX if network debugging is not desired.
25 | /// NOTE: this setting persists between launches of the app.
26 | @property (nonatomic, class, getter=isEnabled) BOOL enabled;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/Classes/Network/PonyDebugger/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | PonyDebugger
3 | Copyright 2012 Square Inc.
4 |
5 | Licensed under the Apache License, Version 2.0 (the "License");
6 | you may not use this file except in compliance with the License.
7 | You may obtain a copy of the License at
8 |
9 | http://www.apache.org/licenses/LICENSE-2.0
10 |
11 | Unless required by applicable law or agreed to in writing, software
12 | distributed under the License is distributed on an "AS IS" BASIS,
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | See the License for the specific language governing permissions and
15 | limitations under the License.
16 |
17 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/FLEXObjectExplorerFactory.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXObjectExplorerFactory.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 5/15/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXGlobalsEntry.h"
10 |
11 | #ifndef _FLEXObjectExplorerViewController_h
12 | #import "FLEXObjectExplorerViewController.h"
13 | #else
14 | @class FLEXObjectExplorerViewController;
15 | #endif
16 |
17 | NS_ASSUME_NONNULL_BEGIN
18 |
19 | @interface FLEXObjectExplorerFactory : NSObject
20 |
21 | + (nullable FLEXObjectExplorerViewController *)explorerViewControllerForObject:(nullable id)object;
22 |
23 | /// Register a specific explorer view controller class to be used when exploring
24 | /// an object of a specific class. Calls will overwrite existing registrations.
25 | /// Sections must be initialized using \c forObject: like
26 | + (void)registerExplorerSection:(Class)sectionClass forClass:(Class)objectClass;
27 |
28 | @end
29 |
30 | NS_ASSUME_NONNULL_END
31 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/FLEXColorPreviewSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXColorPreviewSection.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 12/12/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXSingleRowSection.h"
10 | #import "FLEXObjectInfoSection.h"
11 |
12 | @interface FLEXColorPreviewSection : FLEXSingleRowSection
13 |
14 | + (instancetype)forObject:(UIColor *)color;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/FLEXColorPreviewSection.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXColorPreviewSection.m
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 12/12/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXColorPreviewSection.h"
10 |
11 | @implementation FLEXColorPreviewSection
12 |
13 | + (instancetype)forObject:(UIColor *)color {
14 | return [self title:@"Color" reuse:nil cell:^(__kindof UITableViewCell *cell) {
15 | cell.backgroundColor = color;
16 | }];
17 | }
18 |
19 | - (BOOL)canSelectRow:(NSInteger)row {
20 | return NO;
21 | }
22 |
23 | - (BOOL (^)(NSString *))filterMatcher {
24 | return ^BOOL(NSString *filterText) {
25 | // Hide when searching
26 | return !filterText.length;
27 | };
28 | }
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/FLEXDefaultsContentSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXDefaultsContentSection.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 8/28/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXCollectionContentSection.h"
10 | #import "FLEXObjectInfoSection.h"
11 |
12 | @interface FLEXDefaultsContentSection : FLEXCollectionContentSection
13 |
14 | /// Uses \c NSUserDefaults.standardUserDefaults
15 | + (instancetype)standard;
16 | + (instancetype)forDefaults:(NSUserDefaults *)userDefaults;
17 |
18 | /// Whether or not to filter out keys not present in the app's user defaults file.
19 | ///
20 | /// This is useful for filtering out some useless keys that seem to appear
21 | /// in every app's defaults but are never actually used or touched by the app.
22 | /// Only applies to instances using \c NSUserDefaults.standardUserDefaults.
23 | /// This is the default for any instance using \c standardUserDefaults, so
24 | /// you must opt-out in those instances if you don't want this behavior.
25 | @property (nonatomic) BOOL onlyShowKeysForAppPrefs;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/FLEXMetadataSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXMetadataSection.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 9/19/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableViewSection.h"
10 | #import "FLEXObjectExplorer.h"
11 |
12 | typedef NS_ENUM(NSUInteger, FLEXMetadataKind) {
13 | FLEXMetadataKindProperties = 1,
14 | FLEXMetadataKindClassProperties,
15 | FLEXMetadataKindIvars,
16 | FLEXMetadataKindMethods,
17 | FLEXMetadataKindClassMethods,
18 | FLEXMetadataKindClassHierarchy,
19 | FLEXMetadataKindProtocols,
20 | FLEXMetadataKindOther
21 | };
22 |
23 | /// This section is used for displaying ObjC runtime metadata
24 | /// about a class or object, such as listing methods, properties, etc.
25 | @interface FLEXMetadataSection : FLEXTableViewSection
26 |
27 | + (instancetype)explorer:(FLEXObjectExplorer *)explorer kind:(FLEXMetadataKind)metadataKind;
28 |
29 | @property (nonatomic, readonly) FLEXMetadataKind metadataKind;
30 |
31 | /// The names of metadata to exclude. Useful if you wish to group specific
32 | /// properties or methods together in their own section outside of this one.
33 | ///
34 | /// Setting this property calls \c reloadData on this section.
35 | @property (nonatomic) NSSet *excludedMetadata;
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/FLEXObjectInfoSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXObjectInfoSection.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 8/28/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /// \c FLEXTableViewSection itself doesn't know about the object being explored.
12 | /// Subclasses might need this info to provide useful information about the object. Instead
13 | /// of adding an abstract class to the class hierarchy, subclasses can conform to this protocol
14 | /// to indicate that the only info they need to be initialized is the object being explored.
15 | @protocol FLEXObjectInfoSection
16 |
17 | + (instancetype)forObject:(id)object;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/Shortcuts/FLEXBlockShortcuts.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXBlockShortcuts.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 1/30/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXShortcutsSection.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | /// Provides a description of the block's signature
14 | /// and access to an NSMethodSignature of the block
15 | @interface FLEXBlockShortcuts : FLEXShortcutsSection
16 |
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/Shortcuts/FLEXBundleShortcuts.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXBundleShortcuts.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 12/12/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXShortcutsSection.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | /// Provides a "Browse Bundle Directory" action
14 | @interface FLEXBundleShortcuts : FLEXShortcutsSection
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/Shortcuts/FLEXClassShortcuts.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXClassShortcuts.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 11/22/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXShortcutsSection.h"
10 |
11 | /// Provides handy shortcuts for class objects.
12 | /// This is the default section used for all class objects.
13 | @interface FLEXClassShortcuts : FLEXShortcutsSection
14 |
15 | + (instancetype)forObject:(Class)cls;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/Shortcuts/FLEXImageShortcuts.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXImageShortcuts.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 8/29/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXShortcutsSection.h"
10 |
11 | /// Provides "view image" and "save image" shortcuts for UIImage objects
12 | @interface FLEXImageShortcuts : FLEXShortcutsSection
13 |
14 | + (instancetype)forObject:(UIImage *)image;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/Shortcuts/FLEXLayerShortcuts.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXLayerShortcuts.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 12/12/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXShortcutsSection.h"
10 |
11 | @interface FLEXLayerShortcuts : FLEXShortcutsSection
12 |
13 | + (instancetype)forObject:(CALayer *)layer;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/Shortcuts/FLEXLayerShortcuts.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXLayerShortcuts.m
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 12/12/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXLayerShortcuts.h"
10 | #import "FLEXShortcut.h"
11 | #import "FLEXImagePreviewViewController.h"
12 |
13 | @implementation FLEXLayerShortcuts
14 |
15 | + (instancetype)forObject:(CALayer *)layer {
16 | return [self forObject:layer additionalRows:@[
17 | [FLEXActionShortcut title:@"Preview Image" subtitle:nil
18 | viewer:^UIViewController *(CALayer *layer) {
19 | return [FLEXImagePreviewViewController previewForLayer:layer];
20 | }
21 | accessoryType:^UITableViewCellAccessoryType(CALayer *layer) {
22 | return CGRectIsEmpty(layer.bounds) ? UITableViewCellAccessoryNone : UITableViewCellAccessoryDisclosureIndicator;
23 | }
24 | ]
25 | ]];
26 | }
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/Shortcuts/FLEXNSDataShortcuts.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXNSDataShortcuts.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/29/21.
6 | //
7 |
8 | #import "FLEXShortcutsSection.h"
9 |
10 | /// Adds a "UTF-8 String" shortcut
11 | @interface FLEXNSDataShortcuts : FLEXShortcutsSection
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/Shortcuts/FLEXNSDataShortcuts.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXNSDataShortcuts.m
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/29/21.
6 | //
7 |
8 | #import "FLEXNSDataShortcuts.h"
9 | #import "FLEXObjectExplorerFactory.h"
10 | #import "FLEXShortcut.h"
11 |
12 | @implementation FLEXNSDataShortcuts
13 |
14 | + (instancetype)forObject:(NSData *)data {
15 | NSString *string = [self stringForData:data];
16 |
17 | return [self forObject:data additionalRows:@[
18 | [FLEXActionShortcut title:@"UTF-8 String" subtitle:^(NSData *object) {
19 | return string.length ? string : (string ?
20 | @"Data is not a UTF8 String" : @"Empty string"
21 | );
22 | } viewer:^UIViewController *(id object) {
23 | return [FLEXObjectExplorerFactory explorerViewControllerForObject:string];
24 | } accessoryType:^UITableViewCellAccessoryType(NSData *object) {
25 | if (string.length) {
26 | return UITableViewCellAccessoryDisclosureIndicator;
27 | }
28 |
29 | return UITableViewCellAccessoryNone;
30 | }]
31 | ]];
32 | }
33 |
34 | + (NSString *)stringForData:(NSData *)data {
35 | return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
36 | }
37 |
38 | @end
39 |
40 | @interface NSData (Overrides) @end
41 | @implementation NSData (Overrides)
42 |
43 | // This normally crashes
44 | - (NSUInteger)length {
45 | return 0;
46 | }
47 |
48 | @end
49 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/Shortcuts/FLEXNSStringShortcuts.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXNSStringShortcuts.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/29/21.
6 | //
7 |
8 | #import "FLEXShortcutsSection.h"
9 |
10 | /// Adds a "UTF-8 Data" shortcut
11 | @interface FLEXNSStringShortcuts : FLEXShortcutsSection
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/Shortcuts/FLEXNSStringShortcuts.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXNSStringShortcuts.m
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/29/21.
6 | //
7 |
8 | #import "FLEXNSStringShortcuts.h"
9 | #import "FLEXObjectExplorerFactory.h"
10 | #import "FLEXShortcut.h"
11 |
12 | @implementation FLEXNSStringShortcuts
13 |
14 | + (instancetype)forObject:(NSString *)string {
15 | NSUInteger length = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
16 | NSData *data = [NSData dataWithBytesNoCopy:(void *)string.UTF8String length:length freeWhenDone:NO];
17 |
18 | return [self forObject:string additionalRows:@[
19 | [FLEXActionShortcut title:@"UTF-8 Data" subtitle:^NSString *(id _) {
20 | return data.description;
21 | } viewer:^UIViewController *(id _) {
22 | return [FLEXObjectExplorerFactory explorerViewControllerForObject:data];
23 | } accessoryType:^UITableViewCellAccessoryType(id _) {
24 | return UITableViewCellAccessoryDisclosureIndicator;
25 | }]
26 | ]];
27 | }
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/Shortcuts/FLEXShortcutsFactory+Defaults.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXShortcutsFactory+Defaults.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 8/29/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXShortcutsSection.h"
10 |
11 | @interface FLEXShortcutsFactory (UIApplication) @end
12 |
13 | @interface FLEXShortcutsFactory (Views) @end
14 |
15 | @interface FLEXShortcutsFactory (ViewControllers) @end
16 |
17 | @interface FLEXShortcutsFactory (UIImage) @end
18 |
19 | @interface FLEXShortcutsFactory (NSBundle) @end
20 |
21 | @interface FLEXShortcutsFactory (Classes) @end
22 |
23 | @interface FLEXShortcutsFactory (Activities) @end
24 |
25 | @interface FLEXShortcutsFactory (Blocks) @end
26 |
27 | @interface FLEXShortcutsFactory (Foundation) @end
28 |
29 | @interface FLEXShortcutsFactory (WebKit_Safari) @end
30 |
31 | @interface FLEXShortcutsFactory (Pasteboard) @end
32 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/Shortcuts/FLEXUIAppShortcuts.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXUIAppShortcuts.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 5/25/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXShortcutsSection.h"
10 |
11 | @interface FLEXUIAppShortcuts : FLEXShortcutsSection
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/Shortcuts/FLEXViewControllerShortcuts.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXViewControllerShortcuts.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 12/12/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXShortcutsSection.h"
10 |
11 | @interface FLEXViewControllerShortcuts : FLEXShortcutsSection
12 |
13 | + (instancetype)forObject:(UIViewController *)viewController;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Classes/ObjectExplorers/Sections/Shortcuts/FLEXViewShortcuts.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXViewShortcuts.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 12/11/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXShortcutsSection.h"
10 |
11 | /// Adds "Nearest View Controller" and "Preview Image" shortcuts to all views
12 | @interface FLEXViewShortcuts : FLEXShortcutsSection
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/CALayer+FLEX.h:
--------------------------------------------------------------------------------
1 | //
2 | // CALayer+FLEX.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 2/28/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CALayer (FLEX)
12 |
13 | @property (nonatomic) BOOL flex_continuousCorners;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/CALayer+FLEX.m:
--------------------------------------------------------------------------------
1 | //
2 | // CALayer+FLEX.m
3 | // FLEX
4 | //
5 | // Created by Tanner on 2/28/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "CALayer+FLEX.h"
10 |
11 | @interface CALayer (Private)
12 | @property (nonatomic) BOOL continuousCorners;
13 | @end
14 |
15 | @implementation CALayer (FLEX)
16 |
17 | static BOOL respondsToContinuousCorners = NO;
18 |
19 | + (void)load {
20 | respondsToContinuousCorners = [CALayer
21 | instancesRespondToSelector:@selector(setContinuousCorners:)
22 | ];
23 | }
24 |
25 | - (BOOL)flex_continuousCorners {
26 | if (respondsToContinuousCorners) {
27 | return self.continuousCorners;
28 | }
29 |
30 | return NO;
31 | }
32 |
33 | - (void)setFlex_continuousCorners:(BOOL)enabled {
34 | if (respondsToContinuousCorners) {
35 | if (@available(iOS 13, tvOS 13, *)) {
36 | self.cornerCurve = kCACornerCurveContinuous;
37 | } else {
38 | self.continuousCorners = enabled;
39 | // self.masksToBounds = NO;
40 | // self.allowsEdgeAntialiasing = YES;
41 | // self.edgeAntialiasingMask = kCALayerLeftEdge | kCALayerRightEdge | kCALayerTopEdge | kCALayerBottomEdge;
42 | }
43 | }
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/FLEXRuntime+Compare.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXRuntime+Compare.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 8/28/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FLEXProperty.h"
11 | #import "FLEXIvar.h"
12 | #import "FLEXMethodBase.h"
13 | #import "FLEXProtocol.h"
14 |
15 | @interface FLEXProperty (Compare)
16 | - (NSComparisonResult)compare:(FLEXProperty *)other;
17 | @end
18 |
19 | @interface FLEXIvar (Compare)
20 | - (NSComparisonResult)compare:(FLEXIvar *)other;
21 | @end
22 |
23 | @interface FLEXMethodBase (Compare)
24 | - (NSComparisonResult)compare:(FLEXMethodBase *)other;
25 | @end
26 |
27 | @interface FLEXProtocol (Compare)
28 | - (NSComparisonResult)compare:(FLEXProtocol *)other;
29 | @end
30 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/FLEXRuntime+Compare.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXRuntime+Compare.m
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 8/28/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXRuntime+Compare.h"
10 |
11 | @implementation FLEXProperty (Compare)
12 |
13 | - (NSComparisonResult)compare:(FLEXProperty *)other {
14 | NSComparisonResult r = [self.name caseInsensitiveCompare:other.name];
15 | if (r == NSOrderedSame) {
16 | // TODO make sure empty image name sorts above an image name
17 | return [self.imageName ?: @"" compare:other.imageName];
18 | }
19 |
20 | return r;
21 | }
22 |
23 | @end
24 |
25 | @implementation FLEXIvar (Compare)
26 |
27 | - (NSComparisonResult)compare:(FLEXIvar *)other {
28 | return [self.name caseInsensitiveCompare:other.name];
29 | }
30 |
31 | @end
32 |
33 | @implementation FLEXMethodBase (Compare)
34 |
35 | - (NSComparisonResult)compare:(FLEXMethodBase *)other {
36 | return [self.name caseInsensitiveCompare:other.name];
37 | }
38 |
39 | @end
40 |
41 | @implementation FLEXProtocol (Compare)
42 |
43 | - (NSComparisonResult)compare:(FLEXProtocol *)other {
44 | return [self.name caseInsensitiveCompare:other.name];
45 | }
46 |
47 | @end
48 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/NSArray+FLEX.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+FLEX.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 9/25/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface NSArray (Functional)
12 |
13 | /// Actually more like flatmap, but it seems like the objc way to allow returning nil to omit objects.
14 | /// So, return nil from the block to omit objects, and return an object to include it in the new array.
15 | /// Unlike flatmap, however, this will not flatten arrays of arrays into a single array.
16 | - (__kindof NSArray *)flex_mapped:(id(^)(T obj, NSUInteger idx))mapFunc;
17 | /// Like flex_mapped, but expects arrays to be returned, and flattens them into one array.
18 | - (__kindof NSArray *)flex_flatmapped:(NSArray *(^)(id, NSUInteger idx))block;
19 | - (instancetype)flex_filtered:(BOOL(^)(T obj, NSUInteger idx))filterFunc;
20 | - (void)flex_forEach:(void(^)(T obj, NSUInteger idx))block;
21 |
22 | /// Unlike \c subArrayWithRange: this will not throw an exception if \c maxLength
23 | /// is greater than the size of the array. If the array has one element and
24 | /// \c maxLength is greater than 1, you get an array with 1 element back.
25 | - (instancetype)flex_subArrayUpto:(NSUInteger)maxLength;
26 |
27 | + (instancetype)flex_forEachUpTo:(NSUInteger)bound map:(T(^)(NSUInteger i))block;
28 | + (instancetype)flex_mapped:(id)collection block:(id(^)(T obj, NSUInteger idx))mapFunc;
29 |
30 | - (instancetype)flex_sortedUsingSelector:(SEL)selector;
31 |
32 | @end
33 |
34 | @interface NSMutableArray (Functional)
35 |
36 | - (void)flex_filter:(BOOL(^)(T obj, NSUInteger idx))filterFunc;
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/NSTimer+FLEX.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSTimer+Blocks.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/23/17.
6 | //
7 |
8 | #import
9 |
10 | typedef void (^VoidBlock)(void);
11 |
12 | @interface NSTimer (Blocks)
13 |
14 | + (instancetype)flex_fireSecondsFromNow:(NSTimeInterval)delay block:(VoidBlock)block;
15 |
16 | // Forward declaration
17 | //+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval repeats:(BOOL)repeats block:(void (^)(NSTimer *timer))block;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/NSTimer+FLEX.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSTimer+Blocks.m
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/23/17.
6 | //
7 |
8 | #import "NSTimer+FLEX.h"
9 |
10 | @interface Block : NSObject
11 | - (void)invoke;
12 | @end
13 |
14 | #pragma clang diagnostic ignored "-Wincomplete-implementation"
15 | @implementation NSTimer (Blocks)
16 |
17 | + (instancetype)flex_fireSecondsFromNow:(NSTimeInterval)delay block:(VoidBlock)block {
18 | if (@available(iOS 10, *)) {
19 | return [self scheduledTimerWithTimeInterval:delay repeats:NO block:(id)block];
20 | } else {
21 | return [self scheduledTimerWithTimeInterval:delay target:block selector:@selector(invoke) userInfo:nil repeats:NO];
22 | }
23 | }
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/Private/Cocoa+FLEXShortcuts.h:
--------------------------------------------------------------------------------
1 | //
2 | // Cocoa+FLEXShortcuts.h
3 | // Pods
4 | //
5 | // Created by Tanner on 2/24/21.
6 | //
7 | //
8 |
9 | #import
10 |
11 | @interface UIAlertAction (FLEXShortcuts)
12 | @property (nonatomic, readonly) NSString *flex_styleName;
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/Private/Cocoa+FLEXShortcuts.m:
--------------------------------------------------------------------------------
1 | //
2 | // Cocoa+FLEXShortcuts.m
3 | // Pods
4 | //
5 | // Created by Tanner on 2/24/21.
6 | //
7 | //
8 |
9 | #import "Cocoa+FLEXShortcuts.h"
10 |
11 | @implementation UIAlertAction (FLEXShortcuts)
12 | - (NSString *)flex_styleName {
13 | switch (self.style) {
14 | case UIAlertActionStyleDefault:
15 | return @"Default style";
16 | case UIAlertActionStyleCancel:
17 | return @"Cancel style";
18 | case UIAlertActionStyleDestructive:
19 | return @"Destructive style";
20 |
21 | default:
22 | return [NSString stringWithFormat:@"Unknown (%@)", @(self.style)];
23 | }
24 | }
25 | @end
26 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/Private/NSDictionary+ObjcRuntime.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSDictionary+ObjcRuntime.h
3 | // FLEX
4 | //
5 | // Derived from MirrorKit.
6 | // Created by Tanner on 7/5/15.
7 | // Copyright (c) 2020 FLEX Team. All rights reserved.
8 | //
9 |
10 | #import
11 | #import
12 |
13 | @interface NSDictionary (ObjcRuntime)
14 |
15 | /// \c kFLEXPropertyAttributeKeyTypeEncoding is the only required key.
16 | /// Keys representing a boolean value should have a value of \c YES instead of an empty string.
17 | - (NSString *)propertyAttributesString;
18 |
19 | + (instancetype)attributesDictionaryForProperty:(objc_property_t)property;
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/Private/NSMapTable+FLEX_Subscripting.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSMapTable+FLEX_Subscripting.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 1/9/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface NSMapTable (FLEX_Subscripting)
14 |
15 | - (nullable ObjectType)objectForKeyedSubscript:(KeyType)key;
16 | - (void)setObject:(nullable ObjectType)obj forKeyedSubscript:(KeyType )key;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/Private/NSMapTable+FLEX_Subscripting.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSMapTable+FLEX_Subscripting.m
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 1/9/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "NSMapTable+FLEX_Subscripting.h"
10 |
11 | @implementation NSMapTable (FLEX_Subscripting)
12 |
13 | - (id)objectForKeyedSubscript:(id)key {
14 | return [self objectForKey:key];
15 | }
16 |
17 | - (void)setObject:(id)obj forKeyedSubscript:(id)key {
18 | [self setObject:obj forKey:key];
19 | }
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/Private/NSString+FLEX.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSString+FLEX.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/26/17.
6 | // Copyright © 2017 Tanner Bennett. All rights reserved.
7 | //
8 |
9 | #import "FLEXRuntimeConstants.h"
10 |
11 | @interface NSString (FLEXTypeEncoding)
12 |
13 | ///@return whether this type starts with the const specifier
14 | @property (nonatomic, readonly) BOOL flex_typeIsConst;
15 | /// @return the first char in the type encoding that is not the const specifier
16 | @property (nonatomic, readonly) FLEXTypeEncoding flex_firstNonConstType;
17 | /// @return the first char in the type encoding after the pointer specifier, if it is a pointer
18 | @property (nonatomic, readonly) FLEXTypeEncoding flex_pointeeType;
19 | /// @return whether this type is an objc object of any kind, even if it's const
20 | @property (nonatomic, readonly) BOOL flex_typeIsObjectOrClass;
21 | /// @return the class named in this type encoding if it is of the form \c @"MYClass"
22 | @property (nonatomic, readonly) Class flex_typeClass;
23 | /// Includes C strings and selectors as well as regular pointers
24 | @property (nonatomic, readonly) BOOL flex_typeIsNonObjcPointer;
25 |
26 | @end
27 |
28 | @interface NSString (KeyPaths)
29 |
30 | - (NSString *)flex_stringByRemovingLastKeyPathComponent;
31 | - (NSString *)flex_stringByReplacingLastKeyPathComponent:(NSString *)replacement;
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/Private/NSString+ObjcRuntime.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSString+ObjcRuntime.h
3 | // FLEX
4 | //
5 | // Derived from MirrorKit.
6 | // Created by Tanner on 7/1/15.
7 | // Copyright (c) 2020 FLEX Team. All rights reserved.
8 | //
9 |
10 | #import
11 |
12 | @interface NSString (Utilities)
13 |
14 | /// A dictionary of property attributes if the receiver is a valid property attributes string.
15 | /// Values are either a string or \c YES. Boolean attributes which are false will not be
16 | /// present in the dictionary. See this link on how to construct a proper attributes string:
17 | /// https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtPropertyIntrospection.html
18 | ///
19 | /// Note: this method doesn't work properly for certain type encodings, and neither does
20 | /// the property_copyAttributeValue function in the runtime itself. Radar: FB7499230
21 | - (NSDictionary *)propertyAttributes;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/Private/UIView+FLEX_Layout.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+FLEX_Layout.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 7/18/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #define Padding(p) UIEdgeInsetsMake(p, p, p, p)
12 |
13 | @interface UIView (FLEX_Layout)
14 |
15 | - (void)flex_centerInView:(UIView *)view;
16 | - (void)flex_pinEdgesTo:(UIView *)view;
17 | - (void)flex_pinEdgesTo:(UIView *)view withInsets:(UIEdgeInsets)insets;
18 | - (void)flex_pinEdgesToSuperview;
19 | - (void)flex_pinEdgesToSuperviewWithInsets:(UIEdgeInsets)insets;
20 | - (void)flex_pinEdgesToSuperviewWithInsets:(UIEdgeInsets)insets aboveView:(UIView *)sibling;
21 | - (void)flex_pinEdgesToSuperviewWithInsets:(UIEdgeInsets)insets belowView:(UIView *)sibling;
22 | - (UIView *)flex_findFirstSubviewWithClass:(Class)theClass;
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UIBarButtonItem+FLEX.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIBarButtonItem+FLEX.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 2/4/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #define FLEXBarButtonItemSystem(item, tgt, sel) \
12 | [UIBarButtonItem flex_systemItem:UIBarButtonSystemItem##item target:tgt action:sel]
13 |
14 | @interface UIBarButtonItem (FLEX)
15 |
16 | @property (nonatomic, readonly, class) UIBarButtonItem *flex_flexibleSpace;
17 | @property (nonatomic, readonly, class) UIBarButtonItem *flex_fixedSpace;
18 |
19 | + (instancetype)flex_itemWithCustomView:(UIView *)customView;
20 | + (instancetype)flex_backItemWithTitle:(NSString *)title;
21 |
22 | + (instancetype)flex_systemItem:(UIBarButtonSystemItem)item target:(id)target action:(SEL)action;
23 |
24 | + (instancetype)flex_itemWithTitle:(NSString *)title target:(id)target action:(SEL)action;
25 | + (instancetype)flex_doneStyleitemWithTitle:(NSString *)title target:(id)target action:(SEL)action;
26 |
27 | + (instancetype)flex_itemWithImage:(UIImage *)image target:(id)target action:(SEL)action;
28 |
29 | + (instancetype)flex_disabledSystemItem:(UIBarButtonSystemItem)item;
30 | + (instancetype)flex_disabledItemWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style;
31 | + (instancetype)flex_disabledItemWithImage:(UIImage *)image;
32 |
33 | /// @return the receiver
34 | - (UIBarButtonItem *)flex_withTintColor:(UIColor *)tint;
35 |
36 | - (void)_setWidth:(CGFloat)width;
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UIFont+FLEX.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIFont+FLEX.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 12/20/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIFont (FLEX)
12 |
13 | @property (nonatomic, readonly, class) UIFont *flex_defaultTableCellFont;
14 | @property (nonatomic, readonly, class) UIFont *flex_codeFont;
15 | @property (nonatomic, readonly, class) UIFont *flex_smallCodeFont;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UIFont+FLEX.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIFont+FLEX.m
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 12/20/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "UIFont+FLEX.h"
10 | #if TARGET_OS_TV
11 | #define kFLEXDefaultCellFontSize 24.0
12 | #else
13 | #define kFLEXDefaultCellFontSize 12.0
14 | #endif
15 | @implementation UIFont (FLEX)
16 |
17 | + (UIFont *)flex_defaultTableCellFont {
18 | static UIFont *defaultTableCellFont = nil;
19 | static dispatch_once_t onceToken;
20 | dispatch_once(&onceToken, ^{
21 | defaultTableCellFont = [UIFont systemFontOfSize:kFLEXDefaultCellFontSize];
22 | });
23 |
24 | return defaultTableCellFont;
25 | }
26 |
27 | + (UIFont *)flex_codeFont {
28 | // Actually only available in iOS 13, the SDK headers are wrong
29 | if (@available(iOS 13, tvOS 13, *)) {
30 | return [self monospacedSystemFontOfSize:kFLEXDefaultCellFontSize weight:UIFontWeightRegular];
31 | } else {
32 | return [self fontWithName:@"Menlo-Regular" size:kFLEXDefaultCellFontSize];
33 | }
34 | }
35 |
36 | + (UIFont *)flex_smallCodeFont {
37 | // Actually only available in iOS 13, the SDK headers are wrong
38 | if (@available(iOS 13, tvOS 13, *)) {
39 | return [self monospacedSystemFontOfSize:self.smallSystemFontSize weight:UIFontWeightRegular];
40 | } else {
41 | return [self fontWithName:@"Menlo-Regular" size:self.smallSystemFontSize];
42 | }
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UIGestureRecognizer+Blocks.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIGestureRecognizer+Blocks.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 12/20/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef void (^GestureBlock)(UIGestureRecognizer *gesture);
12 |
13 |
14 | @interface UIGestureRecognizer (Blocks)
15 |
16 | + (instancetype)flex_action:(GestureBlock)action;
17 |
18 | @property (nonatomic, setter=flex_setAction:) GestureBlock flex_action;
19 |
20 | @end
21 |
22 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UIGestureRecognizer+Blocks.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIGestureRecognizer+Blocks.m
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 12/20/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "UIGestureRecognizer+Blocks.h"
10 | #import
11 |
12 |
13 | @implementation UIGestureRecognizer (Blocks)
14 |
15 | static void * actionKey;
16 |
17 | + (instancetype)flex_action:(GestureBlock)action {
18 | UIGestureRecognizer *gesture = [[self alloc] initWithTarget:nil action:nil];
19 | [gesture addTarget:gesture action:@selector(flex_invoke)];
20 | gesture.flex_action = action;
21 | return gesture;
22 | }
23 |
24 | - (void)flex_invoke {
25 | self.flex_action(self);
26 | }
27 |
28 | - (GestureBlock)flex_action {
29 | return objc_getAssociatedObject(self, &actionKey);
30 | }
31 |
32 | - (void)flex_setAction:(GestureBlock)action {
33 | objc_setAssociatedObject(self, &actionKey, action, OBJC_ASSOCIATION_COPY);
34 | }
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UIMenu+FLEX.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIMenu+FLEX.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 1/28/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIMenu (FLEX)
12 |
13 | + (instancetype)flex_inlineMenuWithTitle:(NSString *)title
14 | image:(UIImage *)image
15 | children:(NSArray *)children;
16 |
17 | - (instancetype)flex_collapsed;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UIMenu+FLEX.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIMenu+FLEX.m
3 | // FLEX
4 | //
5 | // Created by Tanner on 1/28/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "UIMenu+FLEX.h"
10 |
11 | @implementation UIMenu (FLEX)
12 |
13 | + (instancetype)flex_inlineMenuWithTitle:(NSString *)title image:(UIImage *)image children:(NSArray *)children {
14 | return [UIMenu
15 | menuWithTitle:title
16 | image:image
17 | identifier:nil
18 | options:UIMenuOptionsDisplayInline
19 | children:children
20 | ];
21 | }
22 |
23 | - (instancetype)flex_collapsed {
24 | return [UIMenu
25 | menuWithTitle:@""
26 | image:nil
27 | identifier:nil
28 | options:UIMenuOptionsDisplayInline
29 | children:@[[UIMenu
30 | menuWithTitle:self.title
31 | image:self.image
32 | identifier:self.identifier
33 | options:0
34 | children:self.children
35 | ]]
36 | ];
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UIPasteboard+FLEX.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIPasteboard+FLEX.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 12/9/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIPasteboard (FLEX)
12 |
13 | /// For copying an object which could be a string, data, or number
14 | - (void)flex_copy:(id)unknownType;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UIPasteboard+FLEX.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIPasteboard+FLEX.m
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 12/9/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "UIPasteboard+FLEX.h"
10 |
11 | @implementation UIPasteboard (FLEX)
12 |
13 | - (void)flex_copy:(id)object {
14 | if (!object) {
15 | return;
16 | }
17 |
18 | if ([object isKindOfClass:[NSString class]]) {
19 | UIPasteboard.generalPasteboard.string = object;
20 | } else if([object isKindOfClass:[NSData class]]) {
21 | [UIPasteboard.generalPasteboard setData:object forPasteboardType:@"public.data"];
22 | } else if ([object isKindOfClass:[NSNumber class]]) {
23 | UIPasteboard.generalPasteboard.string = [object stringValue];
24 | } else {
25 | // TODO: make this an alert instead of an exception
26 | [NSException raise:NSInternalInconsistencyException
27 | format:@"Tried to copy unsupported type: %@", [object class]];
28 | }
29 | }
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UITextField+Range.h:
--------------------------------------------------------------------------------
1 | //
2 | // UITextField+Range.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 6/13/17.
6 | //
7 |
8 | #import
9 |
10 | @interface UITextField (Range)
11 |
12 | @property (nonatomic, readonly) NSRange flex_selectedRange;
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UITextField+Range.m:
--------------------------------------------------------------------------------
1 | //
2 | // UITextField+Range.m
3 | // FLEX
4 | //
5 | // Created by Tanner on 6/13/17.
6 | //
7 |
8 | #import "UITextField+Range.h"
9 |
10 | @implementation UITextField (Range)
11 |
12 | - (NSRange)flex_selectedRange {
13 | UITextRange *r = self.selectedTextRange;
14 | if (r) {
15 | NSInteger loc = [self offsetFromPosition:self.beginningOfDocument toPosition:r.start];
16 | NSInteger len = [self offsetFromPosition:r.start toPosition:r.end];
17 | return NSMakeRange(loc, len);
18 | }
19 |
20 | return NSMakeRange(NSNotFound, 0);
21 | }
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UIView+FLEX_Layout.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+FLEX_Layout.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 7/18/19.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #define Padding(p) UIEdgeInsetsMake(p, p, p, p)
12 |
13 | @interface UIView (darkMode)
14 | - (BOOL)darkMode;
15 | @end
16 |
17 | @interface UIView (FLEX_Layout)
18 |
19 | - (void)centerInView:(UIView *)view;
20 | - (void)pinEdgesTo:(UIView *)view;
21 | - (void)pinEdgesTo:(UIView *)view withInsets:(UIEdgeInsets)insets;
22 | - (void)pinEdgesToSuperview;
23 | - (void)pinEdgesToSuperviewWithInsets:(UIEdgeInsets)insets;
24 | - (void)pinEdgesToSuperviewWithInsets:(UIEdgeInsets)insets aboveView:(UIView *)sibling;
25 | - (void)pinEdgesToSuperviewWithInsets:(UIEdgeInsets)insets belowView:(UIView *)sibling;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UIViewController+FLEX.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+FLEX.h
3 | // FLEX
4 | //
5 | // Created by kevinbradley on 9/22/21.
6 | // Copyright © 2021 Flipboard. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface UIViewController (FLEX)
14 | - (UINavigationController *_Nullable)safeNavigationController;
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UIViewController+FLEX.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+FLEX.m
3 | // FLEX
4 | //
5 | // Created by kevinbradley on 9/22/21.
6 | // Copyright © 2021 Flipboard. All rights reserved.
7 | //
8 |
9 | #import "UIViewController+FLEX.h"
10 |
11 | @implementation UIViewController (FLEX)
12 |
13 | -(UINavigationController *)safeNavigationController {
14 | #if TARGET_OS_TV
15 | if (self.navigationController != nil) {
16 | return self.navigationController;
17 | }
18 | return self.presentingViewController.navigationController;
19 | #else
20 | return self.navigationController;
21 | #endif
22 | }
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UIWindow+FLEX.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIWindow+FLEX.h
3 | // FLEX
4 | //
5 | // Created by Kevin Bradley on 12/23/20.
6 | // Copyright © 2020 Flipboard. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface UIWindow (FLEX)
14 | - (UIViewController *)visibleViewController;
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Classes/Utility/Categories/UIWindow+FLEX.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIWindow+FLEX.m
3 | // FLEX
4 | //
5 | // Created by Kevin Bradley on 12/23/20.
6 | // Copyright © 2020 Flipboard. All rights reserved.
7 | //
8 |
9 | #import "UIWindow+FLEX.h"
10 |
11 | @implementation UIWindow (FLEX)
12 |
13 | - (UIViewController *)visibleViewController {
14 | UIViewController *rootViewController = self.rootViewController;
15 | return [UIWindow getVisibleViewControllerFrom:rootViewController];
16 | }
17 |
18 | + (UIViewController *) getVisibleViewControllerFrom:(UIViewController *) vc {
19 | if ([vc isKindOfClass:[UINavigationController class]]) {
20 | return [UIWindow getVisibleViewControllerFrom:[((UINavigationController *) vc) visibleViewController]];
21 | } else if ([vc isKindOfClass:[UITabBarController class]]) {
22 | return [UIWindow getVisibleViewControllerFrom:[((UITabBarController *) vc) selectedViewController]];
23 | } else {
24 | if (vc.presentedViewController) {
25 | return [UIWindow getVisibleViewControllerFrom:vc.presentedViewController];
26 | } else {
27 | return vc;
28 | }
29 | }
30 | }
31 |
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/Classes/Utility/FLEXHeapEnumerator.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXHeapEnumerator.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 5/28/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef void (^flex_object_enumeration_block_t)(__unsafe_unretained id object, __unsafe_unretained Class actualClass);
12 |
13 | @interface FLEXHeapEnumerator : NSObject
14 |
15 | + (void)enumerateLiveObjectsUsingBlock:(flex_object_enumeration_block_t)block;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Classes/Utility/Keyboard/FLEXKeyboardHelpViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXKeyboardHelpViewController.h
3 | // FLEX
4 | //
5 | // Created by Ryan Olson on 9/19/15.
6 | // Copyright © 2015 f. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface FLEXKeyboardHelpViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/Utility/Keyboard/FLEXKeyboardHelpViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXKeyboardHelpViewController.m
3 | // FLEX
4 | //
5 | // Created by Ryan Olson on 9/19/15.
6 | // Copyright © 2015 f. All rights reserved.
7 | //
8 |
9 | #import "FLEXKeyboardHelpViewController.h"
10 | #import "FLEXKeyboardShortcutManager.h"
11 | #import "KBSelectableTextView.h"
12 | @interface FLEXKeyboardHelpViewController ()
13 |
14 | #if TARGET_OS_TV
15 | @property (nonatomic) KBSelectableTextView *textView;
16 | #else
17 | @property (nonatomic) UITextView *textView;
18 | #endif
19 |
20 | @end
21 |
22 | @implementation FLEXKeyboardHelpViewController
23 |
24 | - (void)viewDidLoad {
25 | [super viewDidLoad];
26 | #if TARGET_OS_TV
27 | self.textView = [[KBSelectableTextView alloc] initWithFrame:self.view.bounds];
28 | #else
29 | self.textView = [[UITextView alloc] initWithFrame:self.view.bounds];
30 | #endif
31 | self.textView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
32 | [self.view addSubview:self.textView];
33 | #if TARGET_OS_SIMULATOR
34 | self.textView.text = FLEXKeyboardShortcutManager.sharedManager.keyboardShortcutsDescription;
35 | #endif
36 | self.textView.backgroundColor = UIColor.blackColor;
37 | self.textView.textColor = UIColor.whiteColor;
38 | self.textView.font = [UIFont boldSystemFontOfSize:14.0];
39 | #if !TARGET_OS_TV
40 | self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
41 | #endif
42 | self.title = @"Simulator Shortcuts";
43 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(donePressed:)];
44 | }
45 |
46 | - (void)donePressed:(id)sender {
47 | [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
48 | }
49 |
50 | @end
51 |
--------------------------------------------------------------------------------
/Classes/Utility/Keyboard/FLEXKeyboardShortcutManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXKeyboardShortcutManager.h
3 | // FLEX
4 | //
5 | // Created by Ryan Olson on 9/19/15.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface FLEXKeyboardShortcutManager : NSObject
12 |
13 | @property (nonatomic, readonly, class) FLEXKeyboardShortcutManager *sharedManager;
14 |
15 | /// @param key A single character string matching a key on the keyboard
16 | /// @param modifiers Modifier keys such as shift, command, or alt/option
17 | /// @param action The block to run on the main thread when the key & modifier combination is recognized.
18 | /// @param description Shown the the keyboard shortcut help menu, which is accessed via the '?' key.
19 | /// @param allowOverride Allow registering even if there's an existing action associated with that key/modifier.
20 | - (void)registerSimulatorShortcutWithKey:(NSString *)key
21 | modifiers:(UIKeyModifierFlags)modifiers
22 | action:(dispatch_block_t)action
23 | description:(NSString *)description
24 | allowOverride:(BOOL)allowOverride;
25 |
26 | @property (nonatomic, getter=isEnabled) BOOL enabled;
27 | @property (nonatomic, readonly) NSString *keyboardShortcutsDescription;
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/Classes/Utility/Runtime/Objc/FLEXRuntimeConstants.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXRuntimeConstants.m
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/11/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXRuntimeConstants.h"
10 |
11 | const unsigned int kFLEXNumberOfImplicitArgs = 2;
12 |
13 | NSString *const kFLEXPropertyAttributeKeyTypeEncoding = @"T";
14 | NSString *const kFLEXPropertyAttributeKeyBackingIvarName = @"V";
15 | NSString *const kFLEXPropertyAttributeKeyReadOnly = @"R";
16 | NSString *const kFLEXPropertyAttributeKeyCopy = @"C";
17 | NSString *const kFLEXPropertyAttributeKeyRetain = @"&";
18 | NSString *const kFLEXPropertyAttributeKeyNonAtomic = @"N";
19 | NSString *const kFLEXPropertyAttributeKeyCustomGetter = @"G";
20 | NSString *const kFLEXPropertyAttributeKeyCustomSetter = @"S";
21 | NSString *const kFLEXPropertyAttributeKeyDynamic = @"D";
22 | NSString *const kFLEXPropertyAttributeKeyWeak = @"W";
23 | NSString *const kFLEXPropertyAttributeKeyGarbageCollectable = @"P";
24 | NSString *const kFLEXPropertyAttributeKeyOldStyleTypeEncoding = @"t";
25 |
--------------------------------------------------------------------------------
/Classes/Utility/Runtime/Objc/FLEXRuntimeSafety.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXRuntimeSafety.h
3 | // FLEX
4 | //
5 | // Created by Tanner on 3/25/17.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | #pragma mark - Classes
12 |
13 | extern NSUInteger const kFLEXKnownUnsafeClassCount;
14 | extern const Class * FLEXKnownUnsafeClassList(void);
15 | extern NSSet * FLEXKnownUnsafeClassNames(void);
16 | extern CFSetRef FLEXKnownUnsafeClasses;
17 |
18 | static Class cNSObject = nil, cNSProxy = nil;
19 |
20 | __attribute__((constructor))
21 | static void FLEXInitKnownRootClasses() {
22 | cNSObject = [NSObject class];
23 | cNSProxy = [NSProxy class];
24 | }
25 |
26 | static inline BOOL FLEXClassIsSafe(Class cls) {
27 | // Is it nil or known to be unsafe?
28 | if (!cls || CFSetContainsValue(FLEXKnownUnsafeClasses, (__bridge void *)cls)) {
29 | return NO;
30 | }
31 |
32 | // Is it a known root class?
33 | if (!class_getSuperclass(cls)) {
34 | return cls == cNSObject || cls == cNSProxy;
35 | }
36 |
37 | // Probably safe
38 | return YES;
39 | }
40 |
41 | static inline BOOL FLEXClassNameIsSafe(NSString *cls) {
42 | if (!cls) return NO;
43 |
44 | NSSet *ignored = FLEXKnownUnsafeClassNames();
45 | return ![ignored containsObject:cls];
46 | }
47 |
48 | #pragma mark - Ivars
49 |
50 | extern CFSetRef FLEXKnownUnsafeIvars;
51 |
52 | static inline BOOL FLEXIvarIsSafe(Ivar ivar) {
53 | if (!ivar) return NO;
54 |
55 | return !CFSetContainsValue(FLEXKnownUnsafeIvars, ivar);
56 | }
57 |
--------------------------------------------------------------------------------
/Classes/Utility/Runtime/Objc/Reflection/FLEXIvar.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXIvar.h
3 | // FLEX
4 | //
5 | // Derived from MirrorKit.
6 | // Created by Tanner on 6/30/15.
7 | // Copyright (c) 2020 FLEX Team. All rights reserved.
8 | //
9 |
10 | #import "FLEXRuntimeConstants.h"
11 |
12 | @interface FLEXIvar : NSObject
13 |
14 | + (instancetype)ivar:(Ivar)ivar;
15 | + (instancetype)named:(NSString *)name onClass:(Class)cls;
16 |
17 | /// The underlying \c Ivar data structure.
18 | @property (nonatomic, readonly) Ivar objc_ivar;
19 |
20 | /// The name of the instance variable.
21 | @property (nonatomic, readonly) NSString *name;
22 | /// The type of the instance variable.
23 | @property (nonatomic, readonly) FLEXTypeEncoding type;
24 | /// The type encoding string of the instance variable.
25 | @property (nonatomic, readonly) NSString *typeEncoding;
26 | /// The offset of the instance variable.
27 | @property (nonatomic, readonly) NSInteger offset;
28 | /// The size of the instance variable. 0 if unknown.
29 | @property (nonatomic, readonly) NSUInteger size;
30 | /// Describes the type encoding, size, offset, and objc_ivar
31 | @property (nonatomic, readonly) NSString *details;
32 | /// The full path of the image that contains this ivar definition,
33 | /// or \c nil if this ivar was probably defined at runtime.
34 | @property (nonatomic, readonly) NSString *imagePath;
35 |
36 | /// For internal use
37 | @property (nonatomic) id tag;
38 |
39 | - (id)getValue:(id)target;
40 | - (void)setValue:(id)value onObject:(id)target;
41 |
42 | /// Calls into -getValue: and passes that value into
43 | /// -[FLEXRuntimeUtility potentiallyUnwrapBoxedPointer:type:]
44 | /// and returns the result
45 | - (id)getPotentiallyUnboxedValue:(id)target;
46 |
47 | @end
48 |
--------------------------------------------------------------------------------
/Classes/Utility/Runtime/Objc/Reflection/FLEXMethodBase.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXMethodBase.h
3 | // FLEX
4 | //
5 | // Derived from MirrorKit.
6 | // Created by Tanner on 7/5/15.
7 | // Copyright (c) 2020 FLEX Team. All rights reserved.
8 | //
9 |
10 | #import
11 |
12 |
13 | /// A base class for methods which encompasses those that may not
14 | /// have been added to a class yet. Useful on it's own for adding
15 | /// methods to a class, or building a new class from the ground up.
16 | @interface FLEXMethodBase : NSObject {
17 | @protected
18 | SEL _selector;
19 | NSString *_name;
20 | NSString *_typeEncoding;
21 | IMP _implementation;
22 |
23 | NSString *_flex_description;
24 | }
25 |
26 | /// Constructs and returns an \c FLEXSimpleMethod instance with the given name, type encoding, and implementation.
27 | + (instancetype)buildMethodNamed:(NSString *)name withTypes:(NSString *)typeEncoding implementation:(IMP)implementation;
28 |
29 | /// The selector of the method.
30 | @property (nonatomic, readonly) SEL selector;
31 | /// The selector string of the method.
32 | @property (nonatomic, readonly) NSString *selectorString;
33 | /// Same as selectorString.
34 | @property (nonatomic, readonly) NSString *name;
35 | /// The type encoding of the method.
36 | @property (nonatomic, readonly) NSString *typeEncoding;
37 | /// The implementation of the method.
38 | @property (nonatomic, readonly) IMP implementation;
39 |
40 | /// For internal use
41 | @property (nonatomic) id tag;
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/Classes/Utility/Runtime/Objc/Reflection/FLEXMethodBase.m:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXMethodBase.m
3 | // FLEX
4 | //
5 | // Derived from MirrorKit.
6 | // Created by Tanner on 7/5/15.
7 | // Copyright (c) 2020 FLEX Team. All rights reserved.
8 | //
9 |
10 | #import "FLEXMethodBase.h"
11 |
12 |
13 | @implementation FLEXMethodBase
14 |
15 | #pragma mark Initializers
16 |
17 | + (instancetype)buildMethodNamed:(NSString *)name withTypes:(NSString *)typeEncoding implementation:(IMP)implementation {
18 | return [[self alloc] initWithSelector:sel_registerName(name.UTF8String) types:typeEncoding imp:implementation];
19 | }
20 |
21 | - (id)initWithSelector:(SEL)selector types:(NSString *)types imp:(IMP)imp {
22 | NSParameterAssert(selector); NSParameterAssert(types); NSParameterAssert(imp);
23 |
24 | self = [super init];
25 | if (self) {
26 | _selector = selector;
27 | _typeEncoding = types;
28 | _implementation = imp;
29 | _name = NSStringFromSelector(self.selector);
30 | }
31 |
32 | return self;
33 | }
34 |
35 | - (NSString *)selectorString {
36 | return _name;
37 | }
38 |
39 | #pragma mark Overrides
40 |
41 | - (NSString *)description {
42 | if (!_flex_description) {
43 | _flex_description = [NSString stringWithFormat:@"%@ '%@'", _name, _typeEncoding];
44 | }
45 |
46 | return _flex_description;
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/Classes/Utility/Runtime/Objc/Reflection/FLEXProtocolBuilder.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXProtocolBuilder.h
3 | // FLEX
4 | //
5 | // Derived from MirrorKit.
6 | // Created by Tanner on 7/4/15.
7 | // Copyright (c) 2020 FLEX Team. All rights reserved.
8 | //
9 |
10 | #import
11 | @class FLEXProperty, FLEXProtocol, Protocol;
12 |
13 | @interface FLEXProtocolBuilder : NSObject
14 |
15 | /// Begins to construct a new protocol with the given name.
16 | /// @discussion You must register the protocol with the
17 | /// \c registerProtocol method before you can use it.
18 | + (instancetype)allocateProtocol:(NSString *)name;
19 |
20 | /// Adds a property to a protocol.
21 | /// @param property The property to add.
22 | /// @param isRequired Whether the property is required to implement the protocol.
23 | - (void)addProperty:(FLEXProperty *)property isRequired:(BOOL)isRequired;
24 | /// Adds a property to a protocol.
25 | /// @param selector The selector of the method to add.
26 | /// @param typeEncoding The type encoding of the method to add.
27 | /// @param isRequired Whether the method is required to implement the protocol.
28 | /// @param isInstanceMethod \c YES if the method is an instance method, \c NO if it is a class method.
29 | - (void)addMethod:(SEL)selector
30 | typeEncoding:(NSString *)typeEncoding
31 | isRequired:(BOOL)isRequired
32 | isInstanceMethod:(BOOL)isInstanceMethod;
33 | /// Makes the recieving protocol conform to the given protocol.
34 | - (void)addProtocol:(Protocol *)protocol;
35 |
36 | /// Registers and returns the recieving protocol, which was previously under construction.
37 | - (FLEXProtocol *)registerProtocol;
38 | /// Whether the protocol is still under construction or already registered.
39 | @property (nonatomic, readonly) BOOL isRegistered;
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/Classes/ViewHierarchy/FLEXHierarchyViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXHierarchyViewController.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 1/9/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXNavigationController.h"
10 | #import
11 |
12 | @protocol FLEXHierarchyDelegate
13 | - (void)viewHierarchyDidDismiss:(UIView *)selectedView;
14 | @end
15 |
16 | /// A navigation controller which manages two child view controllers:
17 | /// a 3D Reveal-like hierarchy explorer, and a 2D tree-list hierarchy explorer.
18 | @interface FLEXHierarchyViewController : FLEXNavigationController
19 |
20 | + (instancetype)delegate:(id)delegate;
21 | + (instancetype)delegate:(id)delegate
22 | viewsAtTap:(NSArray *)viewsAtTap
23 | selectedView:(UIView *)selectedView;
24 |
25 | - (void)toggleHierarchyMode;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Classes/ViewHierarchy/FLEXImagePreviewViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXImagePreviewViewController.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 6/12/14.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface FLEXImagePreviewViewController : UIViewController
12 |
13 | + (instancetype)previewForView:(UIView *)view;
14 | + (instancetype)previewForLayer:(CALayer *)layer;
15 | + (instancetype)forImage:(UIImage *)image;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Classes/ViewHierarchy/SnapshotExplorer/FHSRangeSlider.h:
--------------------------------------------------------------------------------
1 | //
2 | // FHSRangeSlider.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 1/7/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FHSRangeSlider : UIControl
14 |
15 | @property (nonatomic) CGFloat allowedMinValue;
16 | @property (nonatomic) CGFloat allowedMaxValue;
17 | @property (nonatomic) CGFloat minValue;
18 | @property (nonatomic) CGFloat maxValue;
19 |
20 | @end
21 |
22 | NS_ASSUME_NONNULL_END
23 |
--------------------------------------------------------------------------------
/Classes/ViewHierarchy/SnapshotExplorer/FHSSnapshotView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FHSSnapshotView.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 1/7/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FHSViewSnapshot.h"
10 | #import "FHSRangeSlider.h"
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @protocol FHSSnapshotViewDelegate
15 |
16 | - (void)didSelectView:(FHSViewSnapshot *)snapshot;
17 | - (void)didDeselectView:(FHSViewSnapshot *)snapshot;
18 | - (void)didLongPressView:(FHSViewSnapshot *)snapshot;
19 |
20 | @end
21 |
22 | @interface FHSSnapshotView : UIView
23 |
24 | + (instancetype)delegate:(id)delegate;
25 |
26 | @property (nonatomic, weak) id delegate;
27 |
28 | @property (nonatomic) NSArray *snapshots;
29 | @property (nonatomic, nullable) FHSViewSnapshot *selectedView;
30 |
31 | /// Views of these classes will have their headers hidden
32 | @property (nonatomic) NSArray *headerExclusions;
33 | @property (nonatomic, readonly) FHSRangeSlider *depthSlider; //this is a UIControl, it wont work OOB on tvOS but the snapshot viewer isnt working on tvOS anyway, moot for now.
34 | #if !TARGET_OS_TV
35 | @property (nonatomic, readonly) UISlider *spacingSlider;
36 | #else
37 | @property (nonatomic, readonly) KBSlider *spacingSlider;
38 | #endif
39 |
40 | - (void)emphasizeViews:(NSArray *)emphasizedViews;
41 |
42 | - (void)toggleShowHeaders;
43 | - (void)toggleShowBorders;
44 |
45 | - (void)hideView:(FHSViewSnapshot *)view;
46 |
47 | @end
48 |
49 | NS_ASSUME_NONNULL_END
50 |
--------------------------------------------------------------------------------
/Classes/ViewHierarchy/SnapshotExplorer/FHSView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FHSView.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 1/6/20.
6 | //
7 |
8 | #import
9 |
10 | @interface FHSView : NSObject {
11 | @private
12 | BOOL _inScrollView;
13 | }
14 |
15 | + (instancetype)forView:(UIView *)view isInScrollView:(BOOL)inScrollView;
16 |
17 | /// Intentionally not weak
18 | @property (nonatomic, readonly) UIView *view;
19 | @property (nonatomic, readonly) NSString *identifier;
20 |
21 | @property (nonatomic, readonly) NSString *title;
22 | /// Whether or not this view item should be visually distinguished
23 | @property (nonatomic, readwrite) BOOL important;
24 |
25 | @property (nonatomic, readonly) CGRect frame;
26 | @property (nonatomic, readonly) BOOL hidden;
27 | @property (nonatomic, readonly) UIImage *snapshotImage;
28 |
29 | @property (nonatomic, readonly) NSArray *children;
30 | @property (nonatomic, readonly) NSString *summary;
31 |
32 | /// @return importantAttr if .important, otherwise normalAttr
33 | //- (id)ifImportant:(id)importantAttr ifNormal:(id)normalAttr;
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/Classes/ViewHierarchy/SnapshotExplorer/FHSViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FHSViewController.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 1/6/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | /// The view controller
14 | /// "FHS" stands for "FLEX (view) hierarchy snapshot"
15 | @interface FHSViewController : UIViewController
16 |
17 | /// Use this when you want to snapshot a set of windows.
18 | + (instancetype)snapshotWindows:(NSArray *)windows;
19 | /// Use this when you want to snapshot a specific slice of the view hierarchy.
20 | + (instancetype)snapshotView:(UIView *)view;
21 | /// Use this when you want to emphasize specific views on the screen.
22 | /// These views must all be in the same window as the selected view.
23 | + (instancetype)snapshotViewsAtTap:(NSArray *)viewsAtTap selectedView:(UIView *)view;
24 |
25 | @property (nonatomic, nullable) UIView *selectedView;
26 |
27 | @end
28 |
29 | NS_ASSUME_NONNULL_END
30 |
--------------------------------------------------------------------------------
/Classes/ViewHierarchy/SnapshotExplorer/FHSViewSnapshot.h:
--------------------------------------------------------------------------------
1 | //
2 | // FHSViewSnapshot.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 1/9/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FHSView.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FHSViewSnapshot : NSObject
14 |
15 | + (instancetype)snapshotWithView:(FHSView *)view;
16 |
17 | @property (nonatomic, readonly) FHSView *view;
18 |
19 | @property (nonatomic, readonly) NSString *title;
20 | /// Whether or not this view item should be visually distinguished
21 | @property (nonatomic, readwrite) BOOL important;
22 |
23 | @property (nonatomic, readonly) CGRect frame;
24 | @property (nonatomic, readonly) BOOL hidden;
25 | @property (nonatomic, readonly) UIImage *snapshotImage;
26 |
27 | @property (nonatomic, readonly) NSArray *children;
28 | @property (nonatomic, readonly) NSString *summary;
29 |
30 | /// Returns a different color based on whether or not the view is important
31 | @property (nonatomic, readonly) UIColor *headerColor;
32 |
33 | - (FHSViewSnapshot *)snapshotForView:(UIView *)view;
34 |
35 | @end
36 |
37 | NS_ASSUME_NONNULL_END
38 |
--------------------------------------------------------------------------------
/Classes/ViewHierarchy/SnapshotExplorer/FHSViewSnapshot.m:
--------------------------------------------------------------------------------
1 | //
2 | // FHSViewSnapshot.m
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 1/9/20.
6 | // Copyright © 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FHSViewSnapshot.h"
10 | #import "NSArray+FLEX.h"
11 |
12 | @implementation FHSViewSnapshot
13 |
14 | + (instancetype)snapshotWithView:(FHSView *)view {
15 | NSArray *children = [view.children flex_mapped:^id(FHSView *v, NSUInteger idx) {
16 | return [self snapshotWithView:v];
17 | }];
18 | return [[self alloc] initWithView:view children:children];
19 | }
20 |
21 | - (id)initWithView:(FHSView *)view children:(NSArray *)children {
22 | NSParameterAssert(view); NSParameterAssert(children);
23 |
24 | self = [super init];
25 | if (self) {
26 | _view = view;
27 | _title = view.title;
28 | _important = view.important;
29 | _frame = view.frame;
30 | _hidden = view.hidden;
31 | _snapshotImage = view.snapshotImage;
32 | _children = children;
33 | _summary = view.summary;
34 | }
35 |
36 | return self;
37 | }
38 |
39 | - (UIColor *)headerColor {
40 | if (self.important) {
41 | return [UIColor colorWithRed: 0.000 green: 0.533 blue: 1.000 alpha: 0.900];
42 | } else {
43 | return [UIColor colorWithRed:0.961 green: 0.651 blue: 0.137 alpha: 0.900];
44 | }
45 | }
46 |
47 | - (FHSViewSnapshot *)snapshotForView:(UIView *)view {
48 | if (view == self.view.view) {
49 | return self;
50 | }
51 |
52 | for (FHSViewSnapshot *child in self.children) {
53 | FHSViewSnapshot *snapshot = [child snapshotForView:view];
54 | if (snapshot) {
55 | return snapshot;
56 | }
57 | }
58 |
59 | return nil;
60 | }
61 |
62 | @end
63 |
--------------------------------------------------------------------------------
/Classes/ViewHierarchy/SnapshotExplorer/Scene/FHSSnapshotNodes.h:
--------------------------------------------------------------------------------
1 | //
2 | // FHSSnapshotNodes.h
3 | // FLEX
4 | //
5 | // Created by Tanner Bennett on 1/7/20.
6 | //
7 |
8 | #import "FHSViewSnapshot.h"
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | /// Container that holds references to the SceneKit nodes associated with a snapshot.
14 | @interface FHSSnapshotNodes : NSObject
15 |
16 | + (instancetype)snapshot:(FHSViewSnapshot *)snapshot depth:(NSInteger)depth;
17 |
18 | @property (nonatomic, readonly) FHSViewSnapshot *snapshotItem;
19 | @property (nonatomic, readonly) NSInteger depth;
20 |
21 | /// The view image itself
22 | @property (nonatomic, nullable) SCNNode *snapshot;
23 | /// Goes on top of the snapshot, has rounded top corners
24 | @property (nonatomic, nullable) SCNNode *header;
25 | /// The bounding box drawn around the snapshot
26 | @property (nonatomic, nullable) SCNNode *border;
27 |
28 | /// Used to indicate when a view is selected
29 | @property (nonatomic, getter=isHighlighted) BOOL highlighted;
30 | /// Used to indicate when a view is de-emphasized
31 | @property (nonatomic, getter=isDimmed) BOOL dimmed;
32 |
33 | @property (nonatomic) BOOL forceHideHeader;
34 |
35 | @end
36 |
37 | NS_ASSUME_NONNULL_END
38 |
--------------------------------------------------------------------------------
/Classes/ViewHierarchy/TreeExplorer/FLEXHierarchyTableViewCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXHierarchyTableViewCell.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 2014-05-02.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface FLEXHierarchyTableViewCell : UITableViewCell
12 |
13 | - (id)initWithReuseIdentifier:(NSString *)reuseIdentifier;
14 |
15 | @property (nonatomic) NSInteger viewDepth;
16 | @property (nonatomic) UIColor *randomColorTag;
17 | @property (nonatomic) UIColor *indicatedViewColor;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Classes/ViewHierarchy/TreeExplorer/FLEXHierarchyTableViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FLEXHierarchyTableViewController.h
3 | // Flipboard
4 | //
5 | // Created by Ryan Olson on 2014-05-01.
6 | // Copyright (c) 2020 FLEX Team. All rights reserved.
7 | //
8 |
9 | #import "FLEXTableViewController.h"
10 |
11 | @interface FLEXHierarchyTableViewController : FLEXTableViewController
12 |
13 | + (instancetype)windows:(NSArray *)allWindows
14 | viewsAtTap:(NSArray *)viewsAtTap
15 | selectedView:(UIView *)selectedView;
16 |
17 | @property (nonatomic) UIView *selectedView;
18 | @property (nonatomic) void(^didSelectRowAction)(UIView *selectedView);
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/Classes/iOSPrefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // tvOSPrefix.pch
3 | // FLEX-tvOS
4 | //
5 | // Created by kevinbradley on 9/22/21.
6 | // Copyright © 2021 Flipboard. All rights reserved.
7 | //
8 |
9 | #ifdef __OBJC__
10 | #import
11 | #import
12 | #import "UIViewController+FLEX.h"
13 | #endif
14 |
--------------------------------------------------------------------------------
/Classes/tvOS/FLEXFontListTableViewController.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface FLEXFontListTableViewController : UITableViewController
4 | @property (nonatomic, copy, nullable) void (^itemSelectedBlock)(NSString * _Nullable fontName);
5 | @end
6 |
--------------------------------------------------------------------------------
/Classes/tvOS/KBSelectableTextView.h:
--------------------------------------------------------------------------------
1 | #import
2 | /**
3 | UITextView doesn't work the same on tvOS as it does on iOS, we largely need to recreate the experience in a pretty unconventional way.
4 | Handle focus & showing the keyboard using a zero rect UITextField
5 |
6 | */
7 |
8 | @interface KBSelectableTextView : UITextView
9 | - (id)initForAutoLayout;
10 | @property (nonatomic, weak) UIViewController *parentView;
11 | @property (readwrite, assign) BOOL focusColorChange;
12 | @property (nonatomic, strong) UIViewController *inputViewController;
13 | @end
14 |
--------------------------------------------------------------------------------
/Classes/tvOS/KBSlider.h:
--------------------------------------------------------------------------------
1 | //
2 | // KBSlider.h
3 | // KBSlider
4 | //
5 | // Created by Kevin Bradley on 12/25/20.
6 | // Copyright © 2020 nito. All rights reserved.
7 | //
8 |
9 | /**
10 |
11 | UISlider doesn't exist on tvOS, this is a port: https://github.com/lechium/KBSlider of one written in swift https://github.com/zattoo/TvOSSlider
12 |
13 | */
14 |
15 | #import
16 |
17 | NS_ASSUME_NONNULL_BEGIN
18 |
19 | typedef NS_ENUM(NSInteger, DPadState) {
20 | DPadStateSelect,
21 | DPadStateRight,
22 | DPadStateLeft,
23 | DPadStateUp,
24 | DPadStateDown,
25 | };
26 |
27 |
28 | @interface KBSlider : UIControl
29 |
30 | @property CGFloat value;
31 | @property CGFloat minimumValue;
32 | @property CGFloat maximumValue;
33 | @property(nonatomic,getter=isContinuous) BOOL continuous;
34 | @property UIColor *maximumTrackTintColor;
35 | @property UIColor *minimumTrackTintColor;
36 | @property UIColor *thumbTintColor;
37 | @property CGFloat focusScaleFactor;
38 | @property CGFloat stepValue;
39 |
40 | @property UIImage *currentMinimumTrackImage;
41 | @property UIImage *currentMaximumTrackImage;
42 |
43 | @property CGFloat storedValue;
44 |
45 | - (UIImage *)currentThumbImage;
46 | - (void)setValue:(CGFloat)value animated:(BOOL)animated;
47 | - (void)setMinimumTrackImage:(UIImage *)minTrackImage forState:(UIControlState)state;
48 | - (void)setMaximumTrackImage:(UIImage *)maxTrackImage forState:(UIControlState)state;
49 | - (void)setThumbImage:(UIImage *)thumbImage forState:(UIControlState)state;
50 | - (UIImage *)minimumTrackImageForState:(UIControlState)state;
51 | - (UIImage *)maximumTrackImageForState:(UIControlState)state;
52 | - (UIImage *)thumbImageForState:(UIControlState)state;
53 | @end
54 |
55 | NS_ASSUME_NONNULL_END
56 |
--------------------------------------------------------------------------------
/Classes/tvOS/Macros.h:
--------------------------------------------------------------------------------
1 | //
2 | // Based on http://stackoverflow.com/a/202511
3 | //
4 |
5 | #pragma mark - Enum Factory Macros
6 | // expansion macro for enum value definition
7 | #define ENUM_VALUE(name,assign) name assign,
8 |
9 | // expansion macro for enum to string conversion
10 | #define ENUM_CASE(name,assign) case name: return @#name;
11 |
12 | // expansion macro for string to enum conversion
13 | #define ENUM_STRCMP(name,assign) if ([string isEqualToString:@#name]) return name;
14 |
15 | /// declare the access function and define enum values
16 | #define DECLARE_ENUM(EnumType,ENUM_DEF) \
17 | typedef enum EnumType { \
18 | ENUM_DEF(ENUM_VALUE) \
19 | }EnumType; \
20 | NSString *_Nonnull NSStringFrom##EnumType(EnumType value); \
21 | EnumType EnumType##FromNSString(NSString *_Nonnull string); \
22 |
23 | // Define Functions
24 | #define DEFINE_ENUM(EnumType, ENUM_DEF) \
25 | NSString *_Nonnull NSStringFrom##EnumType(EnumType value) \
26 | { \
27 | switch(value) \
28 | { \
29 | ENUM_DEF(ENUM_CASE) \
30 | default: return @""; \
31 | } \
32 | } \
33 | EnumType EnumType##FromNSString(NSString *string) \
34 | { \
35 | ENUM_DEF(ENUM_STRCMP) \
36 | return (EnumType)0; \
37 | }
38 |
--------------------------------------------------------------------------------
/Classes/tvOS/tvOSPrefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // tvOSPrefix.pch
3 | // FLEX-tvOS
4 | //
5 | // Created by kevinbradley on 9/22/21.
6 | // Copyright © 2021 Flipboard. All rights reserved.
7 | //
8 |
9 | #ifdef __OBJC__
10 | #import
11 | #import
12 | #import "UIViewController+FLEX.h"
13 | #import "FLEXTV.h"
14 | #endif
15 |
--------------------------------------------------------------------------------
/Example/FLEXample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/FLEXample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/FLEXample.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Example/FLEXample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/FLEXample/App/CommitListViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CommitListViewController.h
3 | // FLEXample
4 | //
5 | // Created by Tanner on 3/11/20.
6 | // Copyright © 2020 Flipboard. All rights reserved.
7 | //
8 |
9 | #import "FLEXFilteringTableViewController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface CommitListViewController : FLEXFilteringTableViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Example/FLEXample/App/Person.h:
--------------------------------------------------------------------------------
1 | //
2 | // Person.h
3 | // UICatalog
4 | //
5 | // Created by Tanner on 4/17/19.
6 | // Copyright © 2019 . All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface Person : NSObject
14 |
15 | + (instancetype)bob;
16 |
17 | @property (nonatomic, readonly) NSString *name;
18 | @property (nonatomic, readonly) NSInteger age;
19 | @property (nonatomic, readonly) CGFloat height;
20 | @property (nonatomic, readonly) NSNumber *numberOfKids;
21 |
22 | @property (nonatomic) NSDecimalNumber *netWorth;
23 |
24 | @end
25 |
26 | NS_ASSUME_NONNULL_END
27 |
--------------------------------------------------------------------------------
/Example/FLEXample/App/Person.m:
--------------------------------------------------------------------------------
1 | //
2 | // Person.m
3 | // UICatalog
4 | //
5 | // Created by Tanner on 4/17/19.
6 | // Copyright © 2019 f. All rights reserved.
7 | //
8 |
9 | #import "Person.h"
10 |
11 | @implementation Person
12 |
13 | + (id)bob {
14 | Person *bob = [Person new];
15 | bob->_name = @"Bob";
16 | bob->_age = 50;
17 | bob->_height = 5.8;
18 | bob->_numberOfKids = @3;
19 | bob->_netWorth = [NSDecimalNumber decimalNumberWithString:@"12345.67"];
20 | return bob;
21 | }
22 |
23 | - (void)encodeWithCoder:(nonnull NSCoder *)coder {
24 | [coder encodeObject:self.name forKey:@"name"];
25 | [coder encodeInteger:self.age forKey:@"age"];
26 | [coder encodeDouble:self.height forKey:@"height"];
27 | [coder encodeObject:self.numberOfKids forKey:@"numberOfKids"];
28 | [coder encodeObject:self.netWorth forKey:@"netWorth"];
29 | }
30 |
31 | - (nullable instancetype)initWithCoder:(nonnull NSCoder *)coder {
32 | self->_name = [coder decodeObjectForKey:@"name"];
33 | self->_age = [coder decodeIntegerForKey:@"age"];
34 | self->_height = [coder decodeDoubleForKey:@"height"];
35 | self->_numberOfKids = [coder decodeObjectForKey:@"numberOfKids"];
36 | self->_netWorth = [coder decodeObjectForKey:@"netWorth"];
37 | return self;
38 | }
39 |
40 | - (void)setNetWorth:(NSDecimalNumber *)netWorth {
41 | _netWorth = netWorth;
42 | }
43 |
44 | - (NSUInteger)hash {
45 | return self.name.hash ^ @(self.age).hash ^ self.numberOfKids.hash ^ self.netWorth.hash;
46 | }
47 |
48 | - (BOOL)isEqual:(id)object {
49 | if ([object isKindOfClass:[Person class]])
50 | return [self isEqualToPerson:object];
51 |
52 | return [super isEqual:object];
53 | }
54 |
55 | - (BOOL)isEqualToPerson:(Person *)person {
56 | return [self.name isEqualToString:person.name];
57 | }
58 |
59 | + (NSInteger)version {
60 | return 2;
61 | }
62 |
63 | @end
64 |
--------------------------------------------------------------------------------
/Example/FLEXample/MiscNetworkRequests.h:
--------------------------------------------------------------------------------
1 | //
2 | // MiscNetworkRequests.h
3 | // FLEXample
4 | //
5 | // Created by Tanner on 3/12/20.
6 | // Copyright © 2020 Flipboard. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface MiscNetworkRequests : NSObject