├── .gitignore ├── LICENSE ├── README.md ├── ZKInspector.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── ZKInspector ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ └── MainMenu.xib ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── ZKInspector.h ├── ZKInspector.m └── main.m ├── ZKInspectorTests ├── Info.plist └── ZKInspectorTests.m └── preview.png /.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 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | # Pods/ 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Alex Zielenski 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ZKInspector 2 | =========== 3 | 4 | An NSOutlineView subclass for 10.9+ that gets you a collapsable stack of views like Xcode's inspector. 5 | 6 | ![Preview](https://github.com/alexzielenski/ZKInspector/raw/master/preview.png "Preview") 7 | 8 | Usage 9 | ===== 10 | 11 | Create an `NSOutlineView` as you normally would in interface builder then simply change its class to `ZKInspector` 12 | 13 | ```objc 14 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 15 | self.inspector.inspectorDelegate = self; 16 | // Insert code here to initialize your application 17 | [self.inspector addView:[[NSView alloc] initWithFrame:NSMakeRect(0, 0, 0, 1)] withTitle:@"View 1" expanded:NO]; 18 | [self.inspector addView:self.view2 withTitle:@"View 2" expanded:NO]; 19 | 20 | 21 | [self.inspector setTitle:@"New Title" forIndex:0]; 22 | } 23 | 24 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 25 | // Insert code here to tear down your application 26 | } 27 | 28 | - (BOOL)inspector:(ZKInspector *)inspector shouldExpandView:(NSView *)view withTitle:(NSString *)title atIndex:(NSUInteger)index { 29 | return index != 0; 30 | } 31 | 32 | - (void)inspector:(ZKInspector *)inspector didExpandView:(NSView *)view withTitle:(NSString *)title atIndex:(NSUInteger)index { 33 | if (index == 1 && inspector.numberOfViews == 2) { 34 | static BOOL dispatched = NO; 35 | if (!dispatched) { 36 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 37 | [self.inspector addView:self.view3 withTitle:@"View 3" expanded:YES]; 38 | [self.inspector setView:self.view1 forIndex:1]; 39 | }); 40 | dispatched = YES; 41 | } 42 | } else if (index == 2) { 43 | [self.inspector setTitle:[[NSUUID UUID] UUIDString] forIndex:1]; 44 | [self.inspector moveViewAtIndex:0 toIndex:1]; 45 | } 46 | } 47 | 48 | - (CGFloat)inspector:(ZKInspector *)inspector heightForView:(NSView *)view withTitle:(NSString *)title atIndex:(NSUInteger)index { 49 | return 132.0; 50 | } 51 | 52 | 53 | ``` 54 | 55 | License 56 | ======= 57 | 58 | ZKInspector is licensed under BSD 59 | 60 | Copyright (c) 2014, Alex Zielenski 61 | All rights reserved. 62 | 63 | Redistribution and use in source and binary forms, with or without 64 | modification, are permitted provided that the following conditions are met: 65 | 66 | * Redistributions of source code must retain the above copyright notice, this 67 | list of conditions and the following disclaimer. 68 | 69 | * Redistributions in binary form must reproduce the above copyright notice, 70 | this list of conditions and the following disclaimer in the documentation 71 | and/or other materials provided with the distribution. 72 | 73 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 74 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 75 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 76 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 77 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 78 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 79 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 80 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 81 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 82 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 83 | -------------------------------------------------------------------------------- /ZKInspector.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | FAC2622319980FD800EED86A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = FAC2622219980FD800EED86A /* main.m */; }; 11 | FAC2622619980FD800EED86A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FAC2622519980FD800EED86A /* AppDelegate.m */; }; 12 | FAC2622819980FD800EED86A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FAC2622719980FD800EED86A /* Images.xcassets */; }; 13 | FAC2622B19980FD800EED86A /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = FAC2622919980FD800EED86A /* MainMenu.xib */; }; 14 | FAC2623719980FD800EED86A /* ZKInspectorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = FAC2623619980FD800EED86A /* ZKInspectorTests.m */; }; 15 | FAC262421998100B00EED86A /* ZKInspector.m in Sources */ = {isa = PBXBuildFile; fileRef = FAC262411998100B00EED86A /* ZKInspector.m */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXContainerItemProxy section */ 19 | FAC2623119980FD800EED86A /* PBXContainerItemProxy */ = { 20 | isa = PBXContainerItemProxy; 21 | containerPortal = FAC2621519980FD800EED86A /* Project object */; 22 | proxyType = 1; 23 | remoteGlobalIDString = FAC2621C19980FD800EED86A; 24 | remoteInfo = ZKInspector; 25 | }; 26 | /* End PBXContainerItemProxy section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | FAC2621D19980FD800EED86A /* ZKInspector.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ZKInspector.app; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | FAC2622119980FD800EED86A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | FAC2622219980FD800EED86A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32 | FAC2622419980FD800EED86A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 33 | FAC2622519980FD800EED86A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 34 | FAC2622719980FD800EED86A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 35 | FAC2622A19980FD800EED86A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 36 | FAC2623019980FD800EED86A /* ZKInspectorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZKInspectorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | FAC2623519980FD800EED86A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | FAC2623619980FD800EED86A /* ZKInspectorTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZKInspectorTests.m; sourceTree = ""; }; 39 | FAC262401998100B00EED86A /* ZKInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZKInspector.h; sourceTree = ""; }; 40 | FAC262411998100B00EED86A /* ZKInspector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZKInspector.m; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | FAC2621A19980FD800EED86A /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | FAC2622D19980FD800EED86A /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | /* End PBXFrameworksBuildPhase section */ 59 | 60 | /* Begin PBXGroup section */ 61 | FAC2621419980FD800EED86A = { 62 | isa = PBXGroup; 63 | children = ( 64 | FAC2621F19980FD800EED86A /* ZKInspector */, 65 | FAC2623319980FD800EED86A /* ZKInspectorTests */, 66 | FAC2621E19980FD800EED86A /* Products */, 67 | ); 68 | sourceTree = ""; 69 | }; 70 | FAC2621E19980FD800EED86A /* Products */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | FAC2621D19980FD800EED86A /* ZKInspector.app */, 74 | FAC2623019980FD800EED86A /* ZKInspectorTests.xctest */, 75 | ); 76 | name = Products; 77 | sourceTree = ""; 78 | }; 79 | FAC2621F19980FD800EED86A /* ZKInspector */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | FAC2622419980FD800EED86A /* AppDelegate.h */, 83 | FAC2622519980FD800EED86A /* AppDelegate.m */, 84 | FAC262401998100B00EED86A /* ZKInspector.h */, 85 | FAC262411998100B00EED86A /* ZKInspector.m */, 86 | FAC2622719980FD800EED86A /* Images.xcassets */, 87 | FAC2622919980FD800EED86A /* MainMenu.xib */, 88 | FAC2622019980FD800EED86A /* Supporting Files */, 89 | ); 90 | path = ZKInspector; 91 | sourceTree = ""; 92 | }; 93 | FAC2622019980FD800EED86A /* Supporting Files */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | FAC2622119980FD800EED86A /* Info.plist */, 97 | FAC2622219980FD800EED86A /* main.m */, 98 | ); 99 | name = "Supporting Files"; 100 | sourceTree = ""; 101 | }; 102 | FAC2623319980FD800EED86A /* ZKInspectorTests */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | FAC2623619980FD800EED86A /* ZKInspectorTests.m */, 106 | FAC2623419980FD800EED86A /* Supporting Files */, 107 | ); 108 | path = ZKInspectorTests; 109 | sourceTree = ""; 110 | }; 111 | FAC2623419980FD800EED86A /* Supporting Files */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | FAC2623519980FD800EED86A /* Info.plist */, 115 | ); 116 | name = "Supporting Files"; 117 | sourceTree = ""; 118 | }; 119 | /* End PBXGroup section */ 120 | 121 | /* Begin PBXNativeTarget section */ 122 | FAC2621C19980FD800EED86A /* ZKInspector */ = { 123 | isa = PBXNativeTarget; 124 | buildConfigurationList = FAC2623A19980FD800EED86A /* Build configuration list for PBXNativeTarget "ZKInspector" */; 125 | buildPhases = ( 126 | FAC2621919980FD800EED86A /* Sources */, 127 | FAC2621A19980FD800EED86A /* Frameworks */, 128 | FAC2621B19980FD800EED86A /* Resources */, 129 | ); 130 | buildRules = ( 131 | ); 132 | dependencies = ( 133 | ); 134 | name = ZKInspector; 135 | productName = ZKInspector; 136 | productReference = FAC2621D19980FD800EED86A /* ZKInspector.app */; 137 | productType = "com.apple.product-type.application"; 138 | }; 139 | FAC2622F19980FD800EED86A /* ZKInspectorTests */ = { 140 | isa = PBXNativeTarget; 141 | buildConfigurationList = FAC2623D19980FD800EED86A /* Build configuration list for PBXNativeTarget "ZKInspectorTests" */; 142 | buildPhases = ( 143 | FAC2622C19980FD800EED86A /* Sources */, 144 | FAC2622D19980FD800EED86A /* Frameworks */, 145 | FAC2622E19980FD800EED86A /* Resources */, 146 | ); 147 | buildRules = ( 148 | ); 149 | dependencies = ( 150 | FAC2623219980FD800EED86A /* PBXTargetDependency */, 151 | ); 152 | name = ZKInspectorTests; 153 | productName = ZKInspectorTests; 154 | productReference = FAC2623019980FD800EED86A /* ZKInspectorTests.xctest */; 155 | productType = "com.apple.product-type.bundle.unit-test"; 156 | }; 157 | /* End PBXNativeTarget section */ 158 | 159 | /* Begin PBXProject section */ 160 | FAC2621519980FD800EED86A /* Project object */ = { 161 | isa = PBXProject; 162 | attributes = { 163 | LastUpgradeCheck = 0600; 164 | ORGANIZATIONNAME = "Alexander Zielenski"; 165 | TargetAttributes = { 166 | FAC2621C19980FD800EED86A = { 167 | CreatedOnToolsVersion = 6.0; 168 | }; 169 | FAC2622F19980FD800EED86A = { 170 | CreatedOnToolsVersion = 6.0; 171 | TestTargetID = FAC2621C19980FD800EED86A; 172 | }; 173 | }; 174 | }; 175 | buildConfigurationList = FAC2621819980FD800EED86A /* Build configuration list for PBXProject "ZKInspector" */; 176 | compatibilityVersion = "Xcode 3.2"; 177 | developmentRegion = English; 178 | hasScannedForEncodings = 0; 179 | knownRegions = ( 180 | en, 181 | Base, 182 | ); 183 | mainGroup = FAC2621419980FD800EED86A; 184 | productRefGroup = FAC2621E19980FD800EED86A /* Products */; 185 | projectDirPath = ""; 186 | projectRoot = ""; 187 | targets = ( 188 | FAC2621C19980FD800EED86A /* ZKInspector */, 189 | FAC2622F19980FD800EED86A /* ZKInspectorTests */, 190 | ); 191 | }; 192 | /* End PBXProject section */ 193 | 194 | /* Begin PBXResourcesBuildPhase section */ 195 | FAC2621B19980FD800EED86A /* Resources */ = { 196 | isa = PBXResourcesBuildPhase; 197 | buildActionMask = 2147483647; 198 | files = ( 199 | FAC2622819980FD800EED86A /* Images.xcassets in Resources */, 200 | FAC2622B19980FD800EED86A /* MainMenu.xib in Resources */, 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | }; 204 | FAC2622E19980FD800EED86A /* Resources */ = { 205 | isa = PBXResourcesBuildPhase; 206 | buildActionMask = 2147483647; 207 | files = ( 208 | ); 209 | runOnlyForDeploymentPostprocessing = 0; 210 | }; 211 | /* End PBXResourcesBuildPhase section */ 212 | 213 | /* Begin PBXSourcesBuildPhase section */ 214 | FAC2621919980FD800EED86A /* Sources */ = { 215 | isa = PBXSourcesBuildPhase; 216 | buildActionMask = 2147483647; 217 | files = ( 218 | FAC2622619980FD800EED86A /* AppDelegate.m in Sources */, 219 | FAC262421998100B00EED86A /* ZKInspector.m in Sources */, 220 | FAC2622319980FD800EED86A /* main.m in Sources */, 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | FAC2622C19980FD800EED86A /* Sources */ = { 225 | isa = PBXSourcesBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | FAC2623719980FD800EED86A /* ZKInspectorTests.m in Sources */, 229 | ); 230 | runOnlyForDeploymentPostprocessing = 0; 231 | }; 232 | /* End PBXSourcesBuildPhase section */ 233 | 234 | /* Begin PBXTargetDependency section */ 235 | FAC2623219980FD800EED86A /* PBXTargetDependency */ = { 236 | isa = PBXTargetDependency; 237 | target = FAC2621C19980FD800EED86A /* ZKInspector */; 238 | targetProxy = FAC2623119980FD800EED86A /* PBXContainerItemProxy */; 239 | }; 240 | /* End PBXTargetDependency section */ 241 | 242 | /* Begin PBXVariantGroup section */ 243 | FAC2622919980FD800EED86A /* MainMenu.xib */ = { 244 | isa = PBXVariantGroup; 245 | children = ( 246 | FAC2622A19980FD800EED86A /* Base */, 247 | ); 248 | name = MainMenu.xib; 249 | sourceTree = ""; 250 | }; 251 | /* End PBXVariantGroup section */ 252 | 253 | /* Begin XCBuildConfiguration section */ 254 | FAC2623819980FD800EED86A /* Debug */ = { 255 | isa = XCBuildConfiguration; 256 | buildSettings = { 257 | ALWAYS_SEARCH_USER_PATHS = NO; 258 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 259 | CLANG_CXX_LIBRARY = "libc++"; 260 | CLANG_ENABLE_MODULES = YES; 261 | CLANG_ENABLE_OBJC_ARC = YES; 262 | CLANG_WARN_BOOL_CONVERSION = YES; 263 | CLANG_WARN_CONSTANT_CONVERSION = YES; 264 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 265 | CLANG_WARN_EMPTY_BODY = YES; 266 | CLANG_WARN_ENUM_CONVERSION = YES; 267 | CLANG_WARN_INT_CONVERSION = YES; 268 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 269 | CLANG_WARN_UNREACHABLE_CODE = YES; 270 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 271 | CODE_SIGN_IDENTITY = "-"; 272 | COPY_PHASE_STRIP = NO; 273 | ENABLE_STRICT_OBJC_MSGSEND = YES; 274 | GCC_C_LANGUAGE_STANDARD = gnu99; 275 | GCC_DYNAMIC_NO_PIC = NO; 276 | GCC_OPTIMIZATION_LEVEL = 0; 277 | GCC_PREPROCESSOR_DEFINITIONS = ( 278 | "DEBUG=1", 279 | "$(inherited)", 280 | ); 281 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 282 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 283 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 284 | GCC_WARN_UNDECLARED_SELECTOR = YES; 285 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 286 | GCC_WARN_UNUSED_FUNCTION = YES; 287 | GCC_WARN_UNUSED_VARIABLE = YES; 288 | MACOSX_DEPLOYMENT_TARGET = 10.9; 289 | MTL_ENABLE_DEBUG_INFO = YES; 290 | ONLY_ACTIVE_ARCH = YES; 291 | SDKROOT = macosx10.9; 292 | }; 293 | name = Debug; 294 | }; 295 | FAC2623919980FD800EED86A /* Release */ = { 296 | isa = XCBuildConfiguration; 297 | buildSettings = { 298 | ALWAYS_SEARCH_USER_PATHS = NO; 299 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 300 | CLANG_CXX_LIBRARY = "libc++"; 301 | CLANG_ENABLE_MODULES = YES; 302 | CLANG_ENABLE_OBJC_ARC = YES; 303 | CLANG_WARN_BOOL_CONVERSION = YES; 304 | CLANG_WARN_CONSTANT_CONVERSION = YES; 305 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 306 | CLANG_WARN_EMPTY_BODY = YES; 307 | CLANG_WARN_ENUM_CONVERSION = YES; 308 | CLANG_WARN_INT_CONVERSION = YES; 309 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 310 | CLANG_WARN_UNREACHABLE_CODE = YES; 311 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 312 | CODE_SIGN_IDENTITY = "-"; 313 | COPY_PHASE_STRIP = YES; 314 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 315 | ENABLE_NS_ASSERTIONS = NO; 316 | ENABLE_STRICT_OBJC_MSGSEND = YES; 317 | GCC_C_LANGUAGE_STANDARD = gnu99; 318 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 319 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 320 | GCC_WARN_UNDECLARED_SELECTOR = YES; 321 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 322 | GCC_WARN_UNUSED_FUNCTION = YES; 323 | GCC_WARN_UNUSED_VARIABLE = YES; 324 | MACOSX_DEPLOYMENT_TARGET = 10.9; 325 | MTL_ENABLE_DEBUG_INFO = NO; 326 | SDKROOT = macosx10.9; 327 | }; 328 | name = Release; 329 | }; 330 | FAC2623B19980FD800EED86A /* Debug */ = { 331 | isa = XCBuildConfiguration; 332 | buildSettings = { 333 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 334 | COMBINE_HIDPI_IMAGES = YES; 335 | INFOPLIST_FILE = ZKInspector/Info.plist; 336 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 337 | PRODUCT_NAME = "$(TARGET_NAME)"; 338 | }; 339 | name = Debug; 340 | }; 341 | FAC2623C19980FD800EED86A /* Release */ = { 342 | isa = XCBuildConfiguration; 343 | buildSettings = { 344 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 345 | COMBINE_HIDPI_IMAGES = YES; 346 | INFOPLIST_FILE = ZKInspector/Info.plist; 347 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 348 | PRODUCT_NAME = "$(TARGET_NAME)"; 349 | }; 350 | name = Release; 351 | }; 352 | FAC2623E19980FD800EED86A /* Debug */ = { 353 | isa = XCBuildConfiguration; 354 | buildSettings = { 355 | BUNDLE_LOADER = "$(TEST_HOST)"; 356 | COMBINE_HIDPI_IMAGES = YES; 357 | FRAMEWORK_SEARCH_PATHS = ( 358 | "$(DEVELOPER_FRAMEWORKS_DIR)", 359 | "$(inherited)", 360 | ); 361 | GCC_PREPROCESSOR_DEFINITIONS = ( 362 | "DEBUG=1", 363 | "$(inherited)", 364 | ); 365 | INFOPLIST_FILE = ZKInspectorTests/Info.plist; 366 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 367 | PRODUCT_NAME = "$(TARGET_NAME)"; 368 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ZKInspector.app/Contents/MacOS/ZKInspector"; 369 | }; 370 | name = Debug; 371 | }; 372 | FAC2623F19980FD800EED86A /* Release */ = { 373 | isa = XCBuildConfiguration; 374 | buildSettings = { 375 | BUNDLE_LOADER = "$(TEST_HOST)"; 376 | COMBINE_HIDPI_IMAGES = YES; 377 | FRAMEWORK_SEARCH_PATHS = ( 378 | "$(DEVELOPER_FRAMEWORKS_DIR)", 379 | "$(inherited)", 380 | ); 381 | INFOPLIST_FILE = ZKInspectorTests/Info.plist; 382 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 383 | PRODUCT_NAME = "$(TARGET_NAME)"; 384 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ZKInspector.app/Contents/MacOS/ZKInspector"; 385 | }; 386 | name = Release; 387 | }; 388 | /* End XCBuildConfiguration section */ 389 | 390 | /* Begin XCConfigurationList section */ 391 | FAC2621819980FD800EED86A /* Build configuration list for PBXProject "ZKInspector" */ = { 392 | isa = XCConfigurationList; 393 | buildConfigurations = ( 394 | FAC2623819980FD800EED86A /* Debug */, 395 | FAC2623919980FD800EED86A /* Release */, 396 | ); 397 | defaultConfigurationIsVisible = 0; 398 | defaultConfigurationName = Release; 399 | }; 400 | FAC2623A19980FD800EED86A /* Build configuration list for PBXNativeTarget "ZKInspector" */ = { 401 | isa = XCConfigurationList; 402 | buildConfigurations = ( 403 | FAC2623B19980FD800EED86A /* Debug */, 404 | FAC2623C19980FD800EED86A /* Release */, 405 | ); 406 | defaultConfigurationIsVisible = 0; 407 | defaultConfigurationName = Release; 408 | }; 409 | FAC2623D19980FD800EED86A /* Build configuration list for PBXNativeTarget "ZKInspectorTests" */ = { 410 | isa = XCConfigurationList; 411 | buildConfigurations = ( 412 | FAC2623E19980FD800EED86A /* Debug */, 413 | FAC2623F19980FD800EED86A /* Release */, 414 | ); 415 | defaultConfigurationIsVisible = 0; 416 | defaultConfigurationName = Release; 417 | }; 418 | /* End XCConfigurationList section */ 419 | }; 420 | rootObject = FAC2621519980FD800EED86A /* Project object */; 421 | } 422 | -------------------------------------------------------------------------------- /ZKInspector.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ZKInspector/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ZKInspector 4 | // 5 | // Created by Alexander Zielenski on 8/10/14. 6 | // Copyright (c) 2014 Alexander Zielenski. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ZKInspector.h" 11 | @interface AppDelegate : NSObject 12 | @property (weak) IBOutlet NSView *view1; 13 | @property (weak) IBOutlet NSView *view2; 14 | @property (weak) IBOutlet NSView *view3; 15 | @property (weak) IBOutlet ZKInspector *inspector; 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /ZKInspector/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ZKInspector 4 | // 5 | // Created by Alexander Zielenski on 8/10/14. 6 | // Copyright (c) 2014 Alexander Zielenski. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @property (weak) IBOutlet NSWindow *window; 14 | 15 | @end 16 | 17 | @implementation AppDelegate 18 | 19 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 20 | self.inspector.inspectorDelegate = self; 21 | // Insert code here to initialize your application 22 | [self.inspector addView:[[NSView alloc] initWithFrame:NSMakeRect(0, 0, 0, 1)] withTitle:@"View 1" expanded:NO]; 23 | [self.inspector addView:self.view2 withTitle:@"View 2" expanded:NO]; 24 | 25 | 26 | [self.inspector setTitle:@"New Title" forIndex:0]; 27 | [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(timerAction:) userInfo:nil repeats:YES]; 28 | } 29 | 30 | - (void)timerAction:(id)sender { 31 | dispatch_async(dispatch_get_main_queue(), ^{ 32 | NSRect f = self.view1.frame; 33 | f.size.height += 10; 34 | self.view1.frame = f; 35 | }); 36 | 37 | } 38 | 39 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 40 | // Insert code here to tear down your application 41 | } 42 | 43 | - (BOOL)inspector:(ZKInspector *)inspector shouldExpandView:(NSView *)view withTitle:(NSString *)title atIndex:(NSUInteger)index { 44 | return index != 0; 45 | } 46 | 47 | - (void)inspector:(ZKInspector *)inspector didExpandView:(NSView *)view withTitle:(NSString *)title atIndex:(NSUInteger)index { 48 | if (index == 1 && inspector.numberOfViews == 2) { 49 | static BOOL dispatched = NO; 50 | if (!dispatched) { 51 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 52 | [self.inspector addView:self.view3 withTitle:@"View 3" expanded:YES]; 53 | [self.inspector setView:self.view1 forIndex:1]; 54 | }); 55 | dispatched = YES; 56 | } 57 | } else if (index == 2) { 58 | [self.inspector setTitle:[[NSUUID UUID] UUIDString] forIndex:1]; 59 | [self.inspector moveViewAtIndex:0 toIndex:1]; 60 | } 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /ZKInspector/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | Default 543 | 544 | 545 | 546 | 547 | 548 | 549 | Left to Right 550 | 551 | 552 | 553 | 554 | 555 | 556 | Right to Left 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | Default 568 | 569 | 570 | 571 | 572 | 573 | 574 | Left to Right 575 | 576 | 577 | 578 | 579 | 580 | 581 | Right to Left 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 717 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | -------------------------------------------------------------------------------- /ZKInspector/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /ZKInspector/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.alexzielenski.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2014 Alexander Zielenski. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /ZKInspector/ZKInspector.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZKInspector.h 3 | // ZKInspector 4 | // 5 | // Copyright (c) 2014, Alex Zielenski 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are met: 10 | // 11 | // * Redistributions of source code must retain the above copyright notice, this 12 | // list of conditions and the following disclaimer. 13 | // 14 | // * Redistributions in binary form must reproduce the above copyright notice, 15 | // this list of conditions and the following disclaimer in the documentation 16 | // and/or other materials provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | #import 30 | 31 | @class ZKInspector; 32 | @protocol ZKInspectorDelegate 33 | @optional 34 | - (BOOL)inspector:(ZKInspector *)inspector shouldExpandView:(NSView *)view withTitle:(NSString *)title atIndex:(NSUInteger)index; 35 | - (void)inspector:(ZKInspector *)inspector didExpandView:(NSView *)view withTitle:(NSString *)title atIndex:(NSUInteger)index; 36 | - (BOOL)inspector:(ZKInspector *)inspector shouldCollapseView:(NSView *)view withTitle:(NSString *)title atIndex:(NSUInteger)index; 37 | - (void)inspector:(ZKInspector *)inspector didCollapseView:(NSView *)view withTitle:(NSString *)title atIndex:(NSUInteger)index; 38 | 39 | @end 40 | 41 | @interface ZKInspector : NSOutlineView 42 | @property (weak) id inspectorDelegate; 43 | @property (assign) CGFloat headerHeight; // defaults to 24 44 | - (void)addView:(NSView *)view withTitle:(NSString *)title expanded:(BOOL)expanded; 45 | - (void)insertView:(NSView *)view withTitle:(NSString *)title atIndex:(NSUInteger)index expanded:(BOOL)expanded; 46 | 47 | - (NSString *)titleForView:(NSView *)view; 48 | - (NSView *)viewForTitle:(NSString *)title; 49 | 50 | - (NSString *)titleAtIndex:(NSUInteger)index; 51 | - (NSView *)viewAtIndex:(NSUInteger)index; 52 | 53 | - (NSUInteger)numberOfViews; 54 | 55 | - (void)setView:(NSView *)view forTitle:(NSString *)title; 56 | - (void)setTitle:(NSString *)title forView:(NSView *)view; 57 | 58 | - (void)setView:(NSView *)view forIndex:(NSUInteger)index; 59 | - (void)setTitle:(NSString *)title forIndex:(NSUInteger)index; 60 | 61 | - (void)removeView:(NSView *)view; 62 | - (void)removeViewWithTitle:(NSString *)title; 63 | - (void)removeViewAtIndex:(NSUInteger)index; 64 | 65 | - (void)moveViewAtIndex:(NSUInteger)index toIndex:(NSUInteger)destinationIndex; 66 | 67 | - (void)expandViewForTitle:(NSString *)title; 68 | - (void)expandViewAtIndex:(NSUInteger)index; 69 | - (void)expandView:(NSView *)view; 70 | 71 | - (void)collapseViewForTitle:(NSString *)title; 72 | - (void)collapseViewAtIndex:(NSUInteger)index; 73 | - (void)collapseView:(NSView *)view; 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /ZKInspector/ZKInspector.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZKInspector.m 3 | // ZKInspector 4 | // 5 | // Copyright (c) 2014, Alex Zielenski 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are met: 10 | // 11 | // * Redistributions of source code must retain the above copyright notice, this 12 | // list of conditions and the following disclaimer. 13 | // 14 | // * Redistributions in binary form must reproduce the above copyright notice, 15 | // this list of conditions and the following disclaimer in the documentation 16 | // and/or other materials provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | #import "ZKInspector.h" 30 | @import QuartzCore.CATransaction; 31 | 32 | #define kDefaultHeaderHeight 24.0 33 | const void *kRowViewContext; 34 | 35 | @class ZKInspectorItem; 36 | @interface ZKTitleRowView : NSTableRowView 37 | @property (weak) NSButton *toggleButton; 38 | @property (weak) NSTableCellView *cell; 39 | @property (weak) ZKInspectorItem *item; 40 | @property (weak) NSOutlineView *outlineView; 41 | @end 42 | 43 | 44 | @interface ZKInspectorItem : NSObject 45 | @property (copy) NSString *title; 46 | @property (strong) NSView *view; 47 | @property (strong) NSTableCellView *cellView; 48 | @property (strong) ZKTitleRowView *titleRowView; 49 | @property (assign, getter=isExpanded) BOOL expanded; 50 | @end 51 | 52 | @implementation ZKTitleRowView 53 | 54 | - (void)viewDidMoveToWindow { 55 | [self addObserver:self forKeyPath:@"item" options:0 context:&kRowViewContext]; 56 | [self addObserver:self forKeyPath:@"item.expanded" options:0 context:&kRowViewContext]; 57 | } 58 | 59 | - (void)dealloc { 60 | [self removeObserver:self forKeyPath:@"item"]; 61 | [self removeObserver:self forKeyPath:@"item.expanded"]; 62 | } 63 | 64 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { 65 | if (context == &kRowViewContext) { 66 | [self setNeedsDisplay:YES]; 67 | } else { 68 | [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; 69 | } 70 | } 71 | 72 | - (void)drawRect:(NSRect)dirtyRect { 73 | NSUInteger row = [self.outlineView rowForItem:self.item]; 74 | if (!self.item.isExpanded) { 75 | [[NSColor lightGrayColor] set]; 76 | NSRectFill(NSMakeRect(0, NSMaxY(self.bounds) - 2, self.bounds.size.width, 1)); 77 | 78 | [[[NSColor whiteColor] colorWithAlphaComponent:0.3] set]; 79 | NSRectFill(NSMakeRect(0, NSMaxY(self.bounds) - 1, self.bounds.size.width, 1)); 80 | } 81 | 82 | if (row != 0) { 83 | [[NSColor lightGrayColor] set]; 84 | NSRectFill(NSMakeRect(0, 0, self.bounds.size.width, 1)); 85 | 86 | [[[NSColor whiteColor] colorWithAlphaComponent:0.3] set]; 87 | NSRectFill(NSMakeRect(0, 1, self.bounds.size.width, 1)); 88 | } 89 | } 90 | 91 | @end 92 | 93 | @implementation ZKInspectorItem 94 | 95 | - (id)init { 96 | if ((self = [super init])) { 97 | self.cellView = [[NSTableCellView alloc] initWithFrame:NSMakeRect(0, 0, 250, kDefaultHeaderHeight)]; 98 | 99 | NSTextField *textField = [[NSTextField alloc] initWithFrame:self.cellView.frame]; 100 | textField.selectable = NO; 101 | textField.editable = NO; 102 | textField.bezeled = NO; 103 | textField.drawsBackground = NO; 104 | 105 | textField.translatesAutoresizingMaskIntoConstraints = NO; 106 | self.cellView.translatesAutoresizingMaskIntoConstraints = NO; 107 | self.cellView.rowSizeStyle = NSTableViewRowSizeStyleLarge; 108 | 109 | NSView *wrap = [[NSView alloc] initWithFrame:self.cellView.bounds]; 110 | wrap.translatesAutoresizingMaskIntoConstraints = NO; 111 | [wrap addSubview:textField]; 112 | [self.cellView addSubview:wrap]; 113 | self.cellView.textField = textField; 114 | 115 | NSDictionary *views = NSDictionaryOfVariableBindings(wrap, textField); 116 | [self.cellView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(8)-[wrap]|" 117 | options:0 118 | metrics:nil 119 | views:views]]; 120 | [self.cellView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[wrap]|" 121 | options:0 122 | metrics:nil 123 | views:views]]; 124 | [wrap addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[textField]|" 125 | options:0 126 | metrics:nil 127 | views:views]]; 128 | [wrap addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[textField]|" 129 | options:0 130 | metrics:nil 131 | views:views]]; 132 | [textField bind:NSValueBinding toObject:self withKeyPath:@"title" options:nil]; 133 | self.titleRowView = [[ZKTitleRowView alloc] initWithFrame:NSZeroRect]; 134 | } 135 | 136 | return self; 137 | } 138 | 139 | - (void)dealloc { 140 | [self.cellView.textField unbind:NSValueBinding]; 141 | } 142 | 143 | @end 144 | 145 | 146 | @interface ZKInspector () 147 | @property (strong) NSMutableArray *items; 148 | - (void)_initialize; 149 | - (ZKInspectorItem *)_itemForView:(NSView *)view; 150 | - (ZKInspectorItem *)_itemForTitle:(NSString *)title; 151 | - (void)_expandItem:(ZKInspectorItem *)item; 152 | - (void)_collapseItem:(ZKInspectorItem *)item; 153 | - (void)_setView:(NSView *)view forItem:(ZKInspectorItem *)item; 154 | - (void)_setTitle:(NSString *)title forItem:(ZKInspectorItem *)item; 155 | - (void)_removeItem:(ZKInspectorItem *)item; 156 | - (void)_startObservingItem:(ZKInspectorItem *)item; 157 | - (void)_stopObservingItem:(ZKInspectorItem *)item; 158 | @end 159 | 160 | @implementation ZKInspector 161 | 162 | - (id)initWithFrame:(NSRect)frameRect { 163 | if ((self = [super initWithFrame:frameRect])) { 164 | [self _initialize]; 165 | } 166 | 167 | return self; 168 | } 169 | 170 | - (id)initWithCoder:(NSCoder *)coder { 171 | if ((self = [super initWithCoder:coder])) { 172 | [self _initialize]; 173 | } 174 | 175 | return self; 176 | } 177 | 178 | - (id)init { 179 | if ((self = [super init])) { 180 | [self _initialize]; 181 | } 182 | 183 | return self; 184 | } 185 | 186 | - (void)_initialize { 187 | self.headerHeight = kDefaultHeaderHeight; 188 | 189 | self.items = [NSMutableArray array]; 190 | 191 | if (!self.outlineTableColumn) { 192 | NSTableColumn *column = [[NSTableColumn alloc] initWithIdentifier:@"ZKInspectorColumn"]; 193 | column.editable = NO; 194 | [self addTableColumn:column]; 195 | } 196 | 197 | self.outlineTableColumn = self.tableColumns[0]; 198 | self.outlineTableColumn.minWidth = 100; 199 | self.outlineTableColumn.maxWidth = FLT_MAX; 200 | self.outlineTableColumn.resizingMask = NSTableColumnAutoresizingMask; 201 | [self setAutoresizesOutlineColumn:YES]; 202 | 203 | 204 | self.rowSizeStyle = NSTableViewRowSizeStyleMedium; 205 | self.selectionHighlightStyle = NSTableViewSelectionHighlightStyleSourceList; 206 | self.intercellSpacing = NSZeroSize; 207 | self.floatsGroupRows = NO; 208 | self.indentationPerLevel = 0.0; 209 | self.headerView = nil; 210 | self.allowsColumnReordering = NO; 211 | self.gridStyleMask = NSTableViewGridNone; 212 | self.allowsColumnResizing = NO; 213 | self.focusRingType = NSFocusRingTypeNone; 214 | } 215 | 216 | - (void)viewDidMoveToWindow { 217 | [super viewDidMoveToWindow]; 218 | 219 | self.delegate = self; 220 | self.dataSource = self; 221 | [self reloadData]; 222 | } 223 | 224 | - (BOOL)acceptsFirstResponder { 225 | return NO; 226 | } 227 | 228 | #pragma mark - Actions 229 | 230 | - (void)addView:(NSView *)view withTitle:(NSString *)title expanded:(BOOL)expanded { 231 | [self insertView:view withTitle:title atIndex:self.items.count expanded:expanded]; 232 | } 233 | 234 | - (void)insertView:(NSView *)view withTitle:(NSString *)title atIndex:(NSUInteger)index expanded:(BOOL)expanded { 235 | NSAssert([self _itemForTitle:title] == nil && [self _itemForView:view] == nil, @"Every view in ZKInspector must have a unique title and view (%@, %@)", title, view); 236 | 237 | ZKInspectorItem *item = [[ZKInspectorItem alloc] init]; 238 | item.title = title; 239 | item.view = view; 240 | [self _startObservingItem:item]; 241 | [self.items insertObject:item atIndex:index]; 242 | 243 | [self beginUpdates]; 244 | [self insertItemsAtIndexes:[NSIndexSet indexSetWithIndex:index] inParent:nil withAnimation:NSTableViewAnimationSlideDown]; 245 | if (expanded) { 246 | __weak ZKInspectorItem *weakItem = item; 247 | __weak ZKInspector *weakSelf = self; 248 | [CATransaction setCompletionBlock:^{ 249 | [weakSelf _expandItem:weakItem]; 250 | }]; 251 | } 252 | [self endUpdates]; 253 | } 254 | 255 | - (NSString *)titleForView:(NSView *)view { 256 | return [self _itemForView:view].title; 257 | } 258 | 259 | - (NSView *)viewForTitle:(NSString *)title { 260 | return [self _itemForTitle:title].view; 261 | } 262 | 263 | - (NSString *)titleAtIndex:(NSUInteger)index { 264 | return [self.items[index] title]; 265 | } 266 | 267 | - (NSView *)viewAtIndex:(NSUInteger)index { 268 | return [self.items[index] view]; 269 | } 270 | 271 | - (NSUInteger)numberOfViews { 272 | return self.items.count; 273 | } 274 | 275 | - (void)setView:(NSView *)view forTitle:(NSString *)title { 276 | [self _setView:view forItem:[self _itemForTitle:title]]; 277 | } 278 | 279 | - (void)setTitle:(NSString *)title forView:(NSView *)view { 280 | [self _setTitle:title forItem:[self _itemForView:view]]; 281 | } 282 | 283 | - (void)setView:(NSView *)view forIndex:(NSUInteger)index { 284 | [self _setView:view forItem:self.items[index]]; 285 | } 286 | 287 | - (void)setTitle:(NSString *)title forIndex:(NSUInteger)index { 288 | [self _setTitle:title forItem:self.items[index]]; 289 | } 290 | 291 | - (void)removeView:(NSView *)view { 292 | [self _removeItem:[self _itemForView:view]]; 293 | } 294 | 295 | - (void)removeViewWithTitle:(NSString *)title { 296 | [self _removeItem:[self _itemForTitle:title]]; 297 | } 298 | 299 | - (void)removeViewAtIndex:(NSUInteger)index { 300 | [self _stopObservingItem:self.items[index]]; 301 | [self.items removeObjectAtIndex:index]; 302 | [self removeItemsAtIndexes:[NSIndexSet indexSetWithIndex:index] inParent:nil withAnimation:NSTableViewAnimationEffectGap]; 303 | } 304 | 305 | - (void)moveViewAtIndex:(NSUInteger)index toIndex:(NSUInteger)destinationIndex { 306 | __strong ZKInspectorItem *item = self.items[index]; 307 | 308 | [self.items removeObjectAtIndex:index]; 309 | [self.items insertObject:item atIndex:destinationIndex]; 310 | 311 | [self moveItemAtIndex:index inParent:nil toIndex:destinationIndex inParent:nil]; 312 | } 313 | 314 | - (void)expandViewForTitle:(NSString *)title { 315 | [self _expandItem:[self _itemForTitle:title]]; 316 | } 317 | 318 | - (void)expandViewAtIndex:(NSUInteger)index { 319 | [self _expandItem:self.items[index]]; 320 | } 321 | 322 | - (void)expandView:(NSView *)view { 323 | [self _expandItem:[self _itemForView:view]]; 324 | } 325 | 326 | - (void)collapseViewForTitle:(NSString *)title { 327 | [self _collapseItem:[self _itemForTitle:title]]; 328 | } 329 | 330 | - (void)collapseViewAtIndex:(NSUInteger)index { 331 | [self _collapseItem:self.items[index]]; 332 | } 333 | 334 | - (void)collapseView:(NSView *)view { 335 | [self _collapseItem:[self _itemForView:view]]; 336 | } 337 | 338 | #pragma mark - Private 339 | 340 | static void *ZKDirtyViewContext; 341 | 342 | - (void)_startObservingItem:(ZKInspectorItem *)item { 343 | [item addObserver:self forKeyPath:@"view.frame" 344 | options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew 345 | context:&ZKDirtyViewContext]; 346 | } 347 | 348 | - (void)_stopObservingItem:(ZKInspectorItem *)item { 349 | [item removeObserver:self forKeyPath:@"view.frame" context:&ZKDirtyViewContext]; 350 | } 351 | 352 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { 353 | if (context == &ZKDirtyViewContext) { 354 | NSValue *oldFrame = change[NSKeyValueChangeOldKey]; 355 | NSValue *newFrame = change[NSKeyValueChangeNewKey]; 356 | 357 | if ([oldFrame isKindOfClass:[NSNull class]]) 358 | oldFrame = nil; 359 | if ([newFrame isKindOfClass:[NSNull class]]) 360 | newFrame = nil; 361 | 362 | NSRect oldRect = oldFrame.rectValue; 363 | NSRect newRect = newFrame.rectValue; 364 | 365 | if (oldRect.size.height != newRect.size.height) { 366 | // It would've been nice to get the animation that this provides, but the outline view seems to get the delta 367 | // for the previous and current heights and keeps setting the frame of the view which causes an infinite loop 368 | // [self noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndex:[self rowForView:((ZKInspectorItem *)object).view]]]; 369 | [self reloadItem:object reloadChildren:YES]; 370 | } 371 | 372 | } else { 373 | [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; 374 | } 375 | } 376 | 377 | - (ZKInspectorItem *)_itemForView:(NSView *)view { 378 | return [[self.items filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"view == %@", view]] firstObject]; 379 | } 380 | 381 | - (ZKInspectorItem *)_itemForTitle:(NSString *)title { 382 | return [[self.items filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"title == %@", title]] firstObject]; 383 | } 384 | 385 | - (void)_expandItem:(ZKInspectorItem *)item { 386 | [self expandItem:item expandChildren:YES]; 387 | } 388 | 389 | - (void)_collapseItem:(ZKInspectorItem *)item { 390 | [self collapseItem:item]; 391 | } 392 | 393 | - (void)_setView:(NSView *)view forItem:(ZKInspectorItem *)item { 394 | NSAssert([self _itemForView:view] == nil, @"Every view in ZKInspector must have a unique title and view (%@)", view); 395 | item.view = view; 396 | [self reloadItem:item reloadChildren:YES]; 397 | } 398 | 399 | - (void)_setTitle:(NSString *)title forItem:(ZKInspectorItem *)item { 400 | NSAssert([self _itemForTitle:title] == nil, @"Every view in ZKInspector must have a unique title and view (%@)", title); 401 | item.title = title; 402 | } 403 | 404 | - (void)_removeItem:(ZKInspectorItem *)item { 405 | [self removeViewAtIndex:[self.items indexOfObject:item]]; 406 | } 407 | 408 | #pragma mark - Override 409 | 410 | - (BOOL)validateProposedFirstResponder:(NSResponder *)responder forEvent:(NSEvent *)event { 411 | return YES; 412 | } 413 | 414 | - (NSRect)frameOfCellAtColumn:(NSInteger)column row:(NSInteger)row { 415 | NSRect frame = [super frameOfCellAtColumn:column row:row]; 416 | frame.size.width = self.bounds.size.width; 417 | return frame; 418 | } 419 | 420 | #pragma mark - NSOutlineViewDataSource 421 | 422 | - (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item { 423 | if (item == nil) 424 | return self.items[index]; 425 | 426 | return ((ZKInspectorItem *)item).view; 427 | } 428 | 429 | - (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item { 430 | if (item == nil) 431 | return self.items.count; 432 | return [self outlineView:outlineView isGroupItem:item] ? 1: 0; 433 | } 434 | 435 | - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(ZKInspectorItem *)item { 436 | return [self outlineView:outlineView isGroupItem:item]; 437 | } 438 | 439 | #pragma mark - NSOutlineViewDelegate 440 | 441 | - (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item { 442 | return [item isKindOfClass:[ZKInspectorItem class]]; 443 | } 444 | 445 | 446 | - (NSTableRowView *)outlineView:(NSOutlineView *)outlineView rowViewForItem:(id)item { 447 | if ([self outlineView:outlineView isGroupItem:item]) { 448 | ZKTitleRowView *rowView = ((ZKInspectorItem *)item).titleRowView; 449 | rowView.outlineView = outlineView; 450 | rowView.item = item; 451 | return rowView; 452 | } 453 | return nil; 454 | } 455 | 456 | - (void)outlineView:(NSOutlineView *)outlineView didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row { 457 | // required 458 | } 459 | 460 | - (void)outlineView:(NSOutlineView *)outlineView didRemoveRowView:(NSTableRowView *)rowView forRow:(NSInteger)row { 461 | // required 462 | } 463 | 464 | - (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(NSView *)item { 465 | if ([self outlineView:outlineView isGroupItem:item]) { 466 | return [item valueForKey:@"cellView"]; 467 | } 468 | 469 | return item; 470 | } 471 | 472 | - (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item { 473 | return NO; 474 | } 475 | 476 | - (CGFloat)outlineView:(NSOutlineView *)outlineView heightOfRowByItem:(id)item { 477 | if ([self outlineView:outlineView isGroupItem:item]) { 478 | return self.headerHeight; 479 | } 480 | 481 | return ((NSView *)item).frame.size.height; 482 | } 483 | 484 | 485 | - (BOOL)outlineView:(NSOutlineView *)outlineView shouldExpandItem:(ZKInspectorItem *)item { 486 | if ([self.inspectorDelegate respondsToSelector:@selector(inspector:shouldExpandView:withTitle:atIndex:)]) { 487 | return [self.inspectorDelegate inspector:self shouldExpandView:item.view withTitle:item.title atIndex:[self.items indexOfObject:item]]; 488 | } 489 | 490 | return YES; 491 | } 492 | 493 | - (void)outlineViewItemDidExpand:(NSNotification *)notification { 494 | ZKInspectorItem *item = notification.userInfo[@"NSObject"]; 495 | item.expanded = YES; 496 | 497 | if ([self.inspectorDelegate respondsToSelector:@selector(inspector:didExpandView:withTitle:atIndex:)]) { 498 | [self.inspectorDelegate inspector:self didExpandView:item.view withTitle:item.title atIndex:[self.items indexOfObject:item]]; 499 | } 500 | 501 | } 502 | 503 | - (BOOL)outlineView:(NSOutlineView *)outlineView shouldCollapseItem:(ZKInspectorItem *)item { 504 | if ([self.inspectorDelegate respondsToSelector:@selector(inspector:shouldCollapseView:withTitle:atIndex:)]) { 505 | return [self.inspectorDelegate inspector:self shouldCollapseView:item.view withTitle:item.title atIndex:[self.items indexOfObject:item]]; 506 | } 507 | 508 | return YES; 509 | } 510 | 511 | - (void)outlineViewItemDidCollapse:(NSNotification *)notification { 512 | ZKInspectorItem *item = notification.userInfo[@"NSObject"]; 513 | item.expanded = NO; 514 | 515 | if ([self.inspectorDelegate respondsToSelector:@selector(inspector:didCollapseView:withTitle:atIndex:)]) { 516 | [self.inspectorDelegate inspector:self didCollapseView:item.view withTitle:item.title atIndex:[self.items indexOfObject:item]]; 517 | } 518 | 519 | } 520 | 521 | @end 522 | 523 | -------------------------------------------------------------------------------- /ZKInspector/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ZKInspector 4 | // 5 | // Created by Alexander Zielenski on 8/10/14. 6 | // Copyright (c) 2014 Alexander Zielenski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) { 12 | return NSApplicationMain(argc, argv); 13 | } 14 | -------------------------------------------------------------------------------- /ZKInspectorTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.alexzielenski.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ZKInspectorTests/ZKInspectorTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZKInspectorTests.m 3 | // ZKInspectorTests 4 | // 5 | // Created by Alexander Zielenski on 8/10/14. 6 | // Copyright (c) 2014 Alexander Zielenski. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ZKInspectorTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation ZKInspectorTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexzielenski/ZKInspector/04d748dc798a0e2b2835c9c41f508e3131f1f02c/preview.png --------------------------------------------------------------------------------