├── .gitignore ├── OutlineView ├── OutlineView.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── OutlineView │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── MainMenu.xib │ ├── Book.h │ ├── Book.m │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── OutlineView-Info.plist │ ├── OutlineView-Prefix.pch │ ├── book.icns │ ├── en.lproj │ │ ├── Credits.rtf │ │ └── InfoPlist.strings │ └── main.m ├── OutlineViewTests │ ├── OutlineViewTests-Info.plist │ ├── OutlineViewTests.m │ └── en.lproj │ │ └── InfoPlist.strings ├── Readme.md └── screenshot.png └── Readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 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 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | *.hmap 18 | *.xccheckout 19 | 20 | #CocoaPods 21 | Pods -------------------------------------------------------------------------------- /OutlineView/OutlineView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CD7B89C51807F3DD00D2EA80 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD7B89C41807F3DD00D2EA80 /* Cocoa.framework */; }; 11 | CD7B89CF1807F3DD00D2EA80 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CD7B89CD1807F3DD00D2EA80 /* InfoPlist.strings */; }; 12 | CD7B89D11807F3DD00D2EA80 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CD7B89D01807F3DD00D2EA80 /* main.m */; }; 13 | CD7B89D51807F3DD00D2EA80 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = CD7B89D31807F3DD00D2EA80 /* Credits.rtf */; }; 14 | CD7B89D81807F3DD00D2EA80 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CD7B89D71807F3DD00D2EA80 /* AppDelegate.m */; }; 15 | CD7B89DB1807F3DD00D2EA80 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD7B89D91807F3DD00D2EA80 /* MainMenu.xib */; }; 16 | CD7B89DD1807F3DD00D2EA80 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CD7B89DC1807F3DD00D2EA80 /* Images.xcassets */; }; 17 | CD7B89E41807F3DE00D2EA80 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD7B89E31807F3DE00D2EA80 /* XCTest.framework */; }; 18 | CD7B89E51807F3DE00D2EA80 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD7B89C41807F3DD00D2EA80 /* Cocoa.framework */; }; 19 | CD7B89ED1807F3DE00D2EA80 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CD7B89EB1807F3DE00D2EA80 /* InfoPlist.strings */; }; 20 | CD7B89EF1807F3DE00D2EA80 /* OutlineViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CD7B89EE1807F3DE00D2EA80 /* OutlineViewTests.m */; }; 21 | CD7B89FA1807F5C500D2EA80 /* Book.m in Sources */ = {isa = PBXBuildFile; fileRef = CD7B89F91807F5C500D2EA80 /* Book.m */; }; 22 | CD7B89FC1807F7B500D2EA80 /* Readme.md in Resources */ = {isa = PBXBuildFile; fileRef = CD7B89FB1807F7B500D2EA80 /* Readme.md */; }; 23 | CD7B89FE1808245300D2EA80 /* book.icns in Resources */ = {isa = PBXBuildFile; fileRef = CD7B89FD1808245300D2EA80 /* book.icns */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | CD7B89E61807F3DE00D2EA80 /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = CD7B89B91807F3DD00D2EA80 /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = CD7B89C01807F3DD00D2EA80; 32 | remoteInfo = OutlineView; 33 | }; 34 | /* End PBXContainerItemProxy section */ 35 | 36 | /* Begin PBXFileReference section */ 37 | CD7B89C11807F3DD00D2EA80 /* OutlineView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OutlineView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | CD7B89C41807F3DD00D2EA80 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 39 | CD7B89C71807F3DD00D2EA80 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 40 | CD7B89C81807F3DD00D2EA80 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 41 | CD7B89C91807F3DD00D2EA80 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 42 | CD7B89CC1807F3DD00D2EA80 /* OutlineView-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "OutlineView-Info.plist"; sourceTree = ""; }; 43 | CD7B89CE1807F3DD00D2EA80 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 44 | CD7B89D01807F3DD00D2EA80 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 45 | CD7B89D21807F3DD00D2EA80 /* OutlineView-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "OutlineView-Prefix.pch"; sourceTree = ""; }; 46 | CD7B89D41807F3DD00D2EA80 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 47 | CD7B89D61807F3DD00D2EA80 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 48 | CD7B89D71807F3DD00D2EA80 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 49 | CD7B89DA1807F3DD00D2EA80 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 50 | CD7B89DC1807F3DD00D2EA80 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 51 | CD7B89E21807F3DE00D2EA80 /* OutlineViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OutlineViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | CD7B89E31807F3DE00D2EA80 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 53 | CD7B89EA1807F3DE00D2EA80 /* OutlineViewTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "OutlineViewTests-Info.plist"; sourceTree = ""; }; 54 | CD7B89EC1807F3DE00D2EA80 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 55 | CD7B89EE1807F3DE00D2EA80 /* OutlineViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OutlineViewTests.m; sourceTree = ""; }; 56 | CD7B89F81807F5C500D2EA80 /* Book.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Book.h; sourceTree = ""; }; 57 | CD7B89F91807F5C500D2EA80 /* Book.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Book.m; sourceTree = ""; }; 58 | CD7B89FB1807F7B500D2EA80 /* Readme.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Readme.md; sourceTree = ""; }; 59 | CD7B89FD1808245300D2EA80 /* book.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = book.icns; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | CD7B89BE1807F3DD00D2EA80 /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | CD7B89C51807F3DD00D2EA80 /* Cocoa.framework in Frameworks */, 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | CD7B89DF1807F3DE00D2EA80 /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | CD7B89E51807F3DE00D2EA80 /* Cocoa.framework in Frameworks */, 76 | CD7B89E41807F3DE00D2EA80 /* XCTest.framework in Frameworks */, 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | /* End PBXFrameworksBuildPhase section */ 81 | 82 | /* Begin PBXGroup section */ 83 | CD7B89B81807F3DD00D2EA80 = { 84 | isa = PBXGroup; 85 | children = ( 86 | CD7B89FB1807F7B500D2EA80 /* Readme.md */, 87 | CD7B89CA1807F3DD00D2EA80 /* OutlineView */, 88 | CD7B89E81807F3DE00D2EA80 /* OutlineViewTests */, 89 | CD7B89C31807F3DD00D2EA80 /* Frameworks */, 90 | CD7B89C21807F3DD00D2EA80 /* Products */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | CD7B89C21807F3DD00D2EA80 /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | CD7B89C11807F3DD00D2EA80 /* OutlineView.app */, 98 | CD7B89E21807F3DE00D2EA80 /* OutlineViewTests.xctest */, 99 | ); 100 | name = Products; 101 | sourceTree = ""; 102 | }; 103 | CD7B89C31807F3DD00D2EA80 /* Frameworks */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | CD7B89C41807F3DD00D2EA80 /* Cocoa.framework */, 107 | CD7B89E31807F3DE00D2EA80 /* XCTest.framework */, 108 | CD7B89C61807F3DD00D2EA80 /* Other Frameworks */, 109 | ); 110 | name = Frameworks; 111 | sourceTree = ""; 112 | }; 113 | CD7B89C61807F3DD00D2EA80 /* Other Frameworks */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | CD7B89C71807F3DD00D2EA80 /* AppKit.framework */, 117 | CD7B89C81807F3DD00D2EA80 /* CoreData.framework */, 118 | CD7B89C91807F3DD00D2EA80 /* Foundation.framework */, 119 | ); 120 | name = "Other Frameworks"; 121 | sourceTree = ""; 122 | }; 123 | CD7B89CA1807F3DD00D2EA80 /* OutlineView */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | CD7B89D61807F3DD00D2EA80 /* AppDelegate.h */, 127 | CD7B89D71807F3DD00D2EA80 /* AppDelegate.m */, 128 | CD7B89D91807F3DD00D2EA80 /* MainMenu.xib */, 129 | CD7B89FD1808245300D2EA80 /* book.icns */, 130 | CD7B89DC1807F3DD00D2EA80 /* Images.xcassets */, 131 | CD7B89CB1807F3DD00D2EA80 /* Supporting Files */, 132 | CD7B89F81807F5C500D2EA80 /* Book.h */, 133 | CD7B89F91807F5C500D2EA80 /* Book.m */, 134 | ); 135 | path = OutlineView; 136 | sourceTree = ""; 137 | }; 138 | CD7B89CB1807F3DD00D2EA80 /* Supporting Files */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | CD7B89CC1807F3DD00D2EA80 /* OutlineView-Info.plist */, 142 | CD7B89CD1807F3DD00D2EA80 /* InfoPlist.strings */, 143 | CD7B89D01807F3DD00D2EA80 /* main.m */, 144 | CD7B89D21807F3DD00D2EA80 /* OutlineView-Prefix.pch */, 145 | CD7B89D31807F3DD00D2EA80 /* Credits.rtf */, 146 | ); 147 | name = "Supporting Files"; 148 | sourceTree = ""; 149 | }; 150 | CD7B89E81807F3DE00D2EA80 /* OutlineViewTests */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | CD7B89EE1807F3DE00D2EA80 /* OutlineViewTests.m */, 154 | CD7B89E91807F3DE00D2EA80 /* Supporting Files */, 155 | ); 156 | path = OutlineViewTests; 157 | sourceTree = ""; 158 | }; 159 | CD7B89E91807F3DE00D2EA80 /* Supporting Files */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | CD7B89EA1807F3DE00D2EA80 /* OutlineViewTests-Info.plist */, 163 | CD7B89EB1807F3DE00D2EA80 /* InfoPlist.strings */, 164 | ); 165 | name = "Supporting Files"; 166 | sourceTree = ""; 167 | }; 168 | /* End PBXGroup section */ 169 | 170 | /* Begin PBXNativeTarget section */ 171 | CD7B89C01807F3DD00D2EA80 /* OutlineView */ = { 172 | isa = PBXNativeTarget; 173 | buildConfigurationList = CD7B89F21807F3DE00D2EA80 /* Build configuration list for PBXNativeTarget "OutlineView" */; 174 | buildPhases = ( 175 | CD7B89BD1807F3DD00D2EA80 /* Sources */, 176 | CD7B89BE1807F3DD00D2EA80 /* Frameworks */, 177 | CD7B89BF1807F3DD00D2EA80 /* Resources */, 178 | ); 179 | buildRules = ( 180 | ); 181 | dependencies = ( 182 | ); 183 | name = OutlineView; 184 | productName = OutlineView; 185 | productReference = CD7B89C11807F3DD00D2EA80 /* OutlineView.app */; 186 | productType = "com.apple.product-type.application"; 187 | }; 188 | CD7B89E11807F3DE00D2EA80 /* OutlineViewTests */ = { 189 | isa = PBXNativeTarget; 190 | buildConfigurationList = CD7B89F51807F3DE00D2EA80 /* Build configuration list for PBXNativeTarget "OutlineViewTests" */; 191 | buildPhases = ( 192 | CD7B89DE1807F3DE00D2EA80 /* Sources */, 193 | CD7B89DF1807F3DE00D2EA80 /* Frameworks */, 194 | CD7B89E01807F3DE00D2EA80 /* Resources */, 195 | ); 196 | buildRules = ( 197 | ); 198 | dependencies = ( 199 | CD7B89E71807F3DE00D2EA80 /* PBXTargetDependency */, 200 | ); 201 | name = OutlineViewTests; 202 | productName = OutlineViewTests; 203 | productReference = CD7B89E21807F3DE00D2EA80 /* OutlineViewTests.xctest */; 204 | productType = "com.apple.product-type.bundle.unit-test"; 205 | }; 206 | /* End PBXNativeTarget section */ 207 | 208 | /* Begin PBXProject section */ 209 | CD7B89B91807F3DD00D2EA80 /* Project object */ = { 210 | isa = PBXProject; 211 | attributes = { 212 | LastUpgradeCheck = 0500; 213 | ORGANIZATIONNAME = company; 214 | TargetAttributes = { 215 | CD7B89E11807F3DE00D2EA80 = { 216 | TestTargetID = CD7B89C01807F3DD00D2EA80; 217 | }; 218 | }; 219 | }; 220 | buildConfigurationList = CD7B89BC1807F3DD00D2EA80 /* Build configuration list for PBXProject "OutlineView" */; 221 | compatibilityVersion = "Xcode 3.2"; 222 | developmentRegion = English; 223 | hasScannedForEncodings = 0; 224 | knownRegions = ( 225 | en, 226 | Base, 227 | ); 228 | mainGroup = CD7B89B81807F3DD00D2EA80; 229 | productRefGroup = CD7B89C21807F3DD00D2EA80 /* Products */; 230 | projectDirPath = ""; 231 | projectRoot = ""; 232 | targets = ( 233 | CD7B89C01807F3DD00D2EA80 /* OutlineView */, 234 | CD7B89E11807F3DE00D2EA80 /* OutlineViewTests */, 235 | ); 236 | }; 237 | /* End PBXProject section */ 238 | 239 | /* Begin PBXResourcesBuildPhase section */ 240 | CD7B89BF1807F3DD00D2EA80 /* Resources */ = { 241 | isa = PBXResourcesBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | CD7B89FC1807F7B500D2EA80 /* Readme.md in Resources */, 245 | CD7B89CF1807F3DD00D2EA80 /* InfoPlist.strings in Resources */, 246 | CD7B89DD1807F3DD00D2EA80 /* Images.xcassets in Resources */, 247 | CD7B89D51807F3DD00D2EA80 /* Credits.rtf in Resources */, 248 | CD7B89DB1807F3DD00D2EA80 /* MainMenu.xib in Resources */, 249 | CD7B89FE1808245300D2EA80 /* book.icns in Resources */, 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | CD7B89E01807F3DE00D2EA80 /* Resources */ = { 254 | isa = PBXResourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | CD7B89ED1807F3DE00D2EA80 /* InfoPlist.strings in Resources */, 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | }; 261 | /* End PBXResourcesBuildPhase section */ 262 | 263 | /* Begin PBXSourcesBuildPhase section */ 264 | CD7B89BD1807F3DD00D2EA80 /* Sources */ = { 265 | isa = PBXSourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | CD7B89FA1807F5C500D2EA80 /* Book.m in Sources */, 269 | CD7B89D81807F3DD00D2EA80 /* AppDelegate.m in Sources */, 270 | CD7B89D11807F3DD00D2EA80 /* main.m in Sources */, 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | }; 274 | CD7B89DE1807F3DE00D2EA80 /* Sources */ = { 275 | isa = PBXSourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | CD7B89EF1807F3DE00D2EA80 /* OutlineViewTests.m in Sources */, 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | /* End PBXSourcesBuildPhase section */ 283 | 284 | /* Begin PBXTargetDependency section */ 285 | CD7B89E71807F3DE00D2EA80 /* PBXTargetDependency */ = { 286 | isa = PBXTargetDependency; 287 | target = CD7B89C01807F3DD00D2EA80 /* OutlineView */; 288 | targetProxy = CD7B89E61807F3DE00D2EA80 /* PBXContainerItemProxy */; 289 | }; 290 | /* End PBXTargetDependency section */ 291 | 292 | /* Begin PBXVariantGroup section */ 293 | CD7B89CD1807F3DD00D2EA80 /* InfoPlist.strings */ = { 294 | isa = PBXVariantGroup; 295 | children = ( 296 | CD7B89CE1807F3DD00D2EA80 /* en */, 297 | ); 298 | name = InfoPlist.strings; 299 | sourceTree = ""; 300 | }; 301 | CD7B89D31807F3DD00D2EA80 /* Credits.rtf */ = { 302 | isa = PBXVariantGroup; 303 | children = ( 304 | CD7B89D41807F3DD00D2EA80 /* en */, 305 | ); 306 | name = Credits.rtf; 307 | sourceTree = ""; 308 | }; 309 | CD7B89D91807F3DD00D2EA80 /* MainMenu.xib */ = { 310 | isa = PBXVariantGroup; 311 | children = ( 312 | CD7B89DA1807F3DD00D2EA80 /* Base */, 313 | ); 314 | name = MainMenu.xib; 315 | sourceTree = ""; 316 | }; 317 | CD7B89EB1807F3DE00D2EA80 /* InfoPlist.strings */ = { 318 | isa = PBXVariantGroup; 319 | children = ( 320 | CD7B89EC1807F3DE00D2EA80 /* en */, 321 | ); 322 | name = InfoPlist.strings; 323 | sourceTree = ""; 324 | }; 325 | /* End PBXVariantGroup section */ 326 | 327 | /* Begin XCBuildConfiguration section */ 328 | CD7B89F01807F3DE00D2EA80 /* Debug */ = { 329 | isa = XCBuildConfiguration; 330 | buildSettings = { 331 | ALWAYS_SEARCH_USER_PATHS = NO; 332 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 333 | CLANG_CXX_LIBRARY = "libc++"; 334 | CLANG_ENABLE_OBJC_ARC = YES; 335 | CLANG_WARN_BOOL_CONVERSION = YES; 336 | CLANG_WARN_CONSTANT_CONVERSION = YES; 337 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 338 | CLANG_WARN_EMPTY_BODY = YES; 339 | CLANG_WARN_ENUM_CONVERSION = YES; 340 | CLANG_WARN_INT_CONVERSION = YES; 341 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 342 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 343 | COPY_PHASE_STRIP = NO; 344 | GCC_C_LANGUAGE_STANDARD = gnu99; 345 | GCC_DYNAMIC_NO_PIC = NO; 346 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 347 | GCC_OPTIMIZATION_LEVEL = 0; 348 | GCC_PREPROCESSOR_DEFINITIONS = ( 349 | "DEBUG=1", 350 | "$(inherited)", 351 | ); 352 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 353 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 354 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 355 | GCC_WARN_UNDECLARED_SELECTOR = YES; 356 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 357 | GCC_WARN_UNUSED_FUNCTION = YES; 358 | GCC_WARN_UNUSED_VARIABLE = YES; 359 | MACOSX_DEPLOYMENT_TARGET = 10.8; 360 | ONLY_ACTIVE_ARCH = YES; 361 | SDKROOT = macosx; 362 | }; 363 | name = Debug; 364 | }; 365 | CD7B89F11807F3DE00D2EA80 /* Release */ = { 366 | isa = XCBuildConfiguration; 367 | buildSettings = { 368 | ALWAYS_SEARCH_USER_PATHS = NO; 369 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 370 | CLANG_CXX_LIBRARY = "libc++"; 371 | CLANG_ENABLE_OBJC_ARC = YES; 372 | CLANG_WARN_BOOL_CONVERSION = YES; 373 | CLANG_WARN_CONSTANT_CONVERSION = YES; 374 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 375 | CLANG_WARN_EMPTY_BODY = YES; 376 | CLANG_WARN_ENUM_CONVERSION = YES; 377 | CLANG_WARN_INT_CONVERSION = YES; 378 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 379 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 380 | COPY_PHASE_STRIP = YES; 381 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 382 | ENABLE_NS_ASSERTIONS = NO; 383 | GCC_C_LANGUAGE_STANDARD = gnu99; 384 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 385 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 386 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 387 | GCC_WARN_UNDECLARED_SELECTOR = YES; 388 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 389 | GCC_WARN_UNUSED_FUNCTION = YES; 390 | GCC_WARN_UNUSED_VARIABLE = YES; 391 | MACOSX_DEPLOYMENT_TARGET = 10.8; 392 | SDKROOT = macosx; 393 | }; 394 | name = Release; 395 | }; 396 | CD7B89F31807F3DE00D2EA80 /* Debug */ = { 397 | isa = XCBuildConfiguration; 398 | buildSettings = { 399 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 400 | COMBINE_HIDPI_IMAGES = YES; 401 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 402 | GCC_PREFIX_HEADER = "OutlineView/OutlineView-Prefix.pch"; 403 | INFOPLIST_FILE = "OutlineView/OutlineView-Info.plist"; 404 | PRODUCT_NAME = "$(TARGET_NAME)"; 405 | WRAPPER_EXTENSION = app; 406 | }; 407 | name = Debug; 408 | }; 409 | CD7B89F41807F3DE00D2EA80 /* Release */ = { 410 | isa = XCBuildConfiguration; 411 | buildSettings = { 412 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 413 | COMBINE_HIDPI_IMAGES = YES; 414 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 415 | GCC_PREFIX_HEADER = "OutlineView/OutlineView-Prefix.pch"; 416 | INFOPLIST_FILE = "OutlineView/OutlineView-Info.plist"; 417 | PRODUCT_NAME = "$(TARGET_NAME)"; 418 | WRAPPER_EXTENSION = app; 419 | }; 420 | name = Release; 421 | }; 422 | CD7B89F61807F3DE00D2EA80 /* Debug */ = { 423 | isa = XCBuildConfiguration; 424 | buildSettings = { 425 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/OutlineView.app/Contents/MacOS/OutlineView"; 426 | COMBINE_HIDPI_IMAGES = YES; 427 | FRAMEWORK_SEARCH_PATHS = ( 428 | "$(DEVELOPER_FRAMEWORKS_DIR)", 429 | "$(inherited)", 430 | ); 431 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 432 | GCC_PREFIX_HEADER = "OutlineView/OutlineView-Prefix.pch"; 433 | GCC_PREPROCESSOR_DEFINITIONS = ( 434 | "DEBUG=1", 435 | "$(inherited)", 436 | ); 437 | INFOPLIST_FILE = "OutlineViewTests/OutlineViewTests-Info.plist"; 438 | PRODUCT_NAME = "$(TARGET_NAME)"; 439 | TEST_HOST = "$(BUNDLE_LOADER)"; 440 | WRAPPER_EXTENSION = xctest; 441 | }; 442 | name = Debug; 443 | }; 444 | CD7B89F71807F3DE00D2EA80 /* Release */ = { 445 | isa = XCBuildConfiguration; 446 | buildSettings = { 447 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/OutlineView.app/Contents/MacOS/OutlineView"; 448 | COMBINE_HIDPI_IMAGES = YES; 449 | FRAMEWORK_SEARCH_PATHS = ( 450 | "$(DEVELOPER_FRAMEWORKS_DIR)", 451 | "$(inherited)", 452 | ); 453 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 454 | GCC_PREFIX_HEADER = "OutlineView/OutlineView-Prefix.pch"; 455 | INFOPLIST_FILE = "OutlineViewTests/OutlineViewTests-Info.plist"; 456 | PRODUCT_NAME = "$(TARGET_NAME)"; 457 | TEST_HOST = "$(BUNDLE_LOADER)"; 458 | WRAPPER_EXTENSION = xctest; 459 | }; 460 | name = Release; 461 | }; 462 | /* End XCBuildConfiguration section */ 463 | 464 | /* Begin XCConfigurationList section */ 465 | CD7B89BC1807F3DD00D2EA80 /* Build configuration list for PBXProject "OutlineView" */ = { 466 | isa = XCConfigurationList; 467 | buildConfigurations = ( 468 | CD7B89F01807F3DE00D2EA80 /* Debug */, 469 | CD7B89F11807F3DE00D2EA80 /* Release */, 470 | ); 471 | defaultConfigurationIsVisible = 0; 472 | defaultConfigurationName = Release; 473 | }; 474 | CD7B89F21807F3DE00D2EA80 /* Build configuration list for PBXNativeTarget "OutlineView" */ = { 475 | isa = XCConfigurationList; 476 | buildConfigurations = ( 477 | CD7B89F31807F3DE00D2EA80 /* Debug */, 478 | CD7B89F41807F3DE00D2EA80 /* Release */, 479 | ); 480 | defaultConfigurationIsVisible = 0; 481 | }; 482 | CD7B89F51807F3DE00D2EA80 /* Build configuration list for PBXNativeTarget "OutlineViewTests" */ = { 483 | isa = XCConfigurationList; 484 | buildConfigurations = ( 485 | CD7B89F61807F3DE00D2EA80 /* Debug */, 486 | CD7B89F71807F3DE00D2EA80 /* Release */, 487 | ); 488 | defaultConfigurationIsVisible = 0; 489 | }; 490 | /* End XCConfigurationList section */ 491 | }; 492 | rootObject = CD7B89B91807F3DD00D2EA80 /* Project object */; 493 | } 494 | -------------------------------------------------------------------------------- /OutlineView/OutlineView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OutlineView/OutlineView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // OutlineView 4 | // 5 | // Copyright (c) 2013 company. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface AppDelegate : NSObject 11 | 12 | @property (assign) IBOutlet NSWindow *window; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /OutlineView/OutlineView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // OutlineView 4 | // 5 | // Copyright (c) 2013 company. All rights reserved. 6 | // 7 | 8 | #import "AppDelegate.h" 9 | #import "Book.h" 10 | 11 | @interface AppDelegate() 12 | 13 | @property (weak) IBOutlet NSOutlineView *outlineView; 14 | @property (weak) IBOutlet NSTreeController *booksController; 15 | 16 | @end 17 | 18 | 19 | @implementation AppDelegate 20 | 21 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 22 | { 23 | self.outlineView.delegate = self; 24 | self.outlineView.dataSource = self; 25 | self.outlineView.floatsGroupRows = NO; // Prevent a sticky header 26 | [self addData]; 27 | 28 | // Expand the first group and select the first item in the list 29 | [self.outlineView expandItem:[self.outlineView itemAtRow:0]]; 30 | [self.outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:1] byExtendingSelection:NO]; 31 | 32 | // Enable Drag and Drop 33 | [self.outlineView registerForDraggedTypes: [NSArray arrayWithObject: @"public.text"]]; 34 | } 35 | 36 | 37 | #pragma mark - Add data 38 | 39 | - (void) addData{ 40 | 41 | // `children` and `isLeaf` have to be configured for the Tree Controller in IB 42 | NSMutableDictionary *root = @{@"title": @"BOOKS", 43 | @"isLeaf": @(NO), 44 | @"children":@[ 45 | [Book bookWithTitle:@"To Kill a Mockingbird" andAuthor:@"Harper Lee"], 46 | [Book bookWithTitle:@"Pride and Prejudice" andAuthor:@"Jane Austen"], 47 | [Book bookWithTitle:@"The Catcher in the Rye" andAuthor:@"J.D. Salinger"] 48 | ].mutableCopy 49 | }.mutableCopy; 50 | 51 | [self.booksController addObject:root]; 52 | } 53 | 54 | 55 | - (IBAction)addClicked:(id)sender { 56 | NSUInteger indexArr[] = {0,0}; 57 | 58 | [self.booksController insertObject:[Book new] atArrangedObjectIndexPath:[NSIndexPath indexPathWithIndexes:indexArr length:2]]; 59 | } 60 | 61 | 62 | 63 | #pragma mark - Helpers 64 | 65 | - (BOOL) isHeader:(id)item{ 66 | 67 | if([item isKindOfClass:[NSTreeNode class]]){ 68 | return ![((NSTreeNode *)item).representedObject isKindOfClass:[Book class]]; 69 | } else { 70 | return ![item isKindOfClass:[Book class]]; 71 | } 72 | } 73 | 74 | 75 | #pragma mark - NSOutlineViewDelegate 76 | 77 | - (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item{ 78 | return ![self isHeader:item]; 79 | } 80 | 81 | - (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item { 82 | 83 | if ([self isHeader:item]) { 84 | return [outlineView makeViewWithIdentifier:@"HeaderCell" owner:self]; 85 | } else { 86 | return [outlineView makeViewWithIdentifier:@"DataCell" owner:self]; 87 | } 88 | } 89 | 90 | - (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item{ 91 | // This converts a group to a header which influences its style 92 | return [self isHeader:item]; 93 | } 94 | 95 | 96 | #pragma mark - Drag & Drop 97 | 98 | - (id )outlineView:(NSOutlineView *)outlineView pasteboardWriterForItem:(id)item{ 99 | // No dragging if 100 | BOOL dragAllowed = YES; 101 | if (!dragAllowed) { 102 | return nil; 103 | } 104 | 105 | Book *book = (Book *)(((NSTreeNode *)item).representedObject); 106 | NSString *identifier = book.title; 107 | 108 | NSPasteboardItem *pboardItem = [[NSPasteboardItem alloc] init]; 109 | [pboardItem setString:identifier forType: @"public.text"]; 110 | 111 | return pboardItem; 112 | } 113 | 114 | 115 | - (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id < NSDraggingInfo >)info proposedItem:(id)targetItem proposedChildIndex:(NSInteger)index{ 116 | 117 | BOOL canDrag = index >= 0 && targetItem; 118 | 119 | if (canDrag) { 120 | return NSDragOperationMove; 121 | }else { 122 | return NSDragOperationNone; 123 | } 124 | } 125 | 126 | 127 | - (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id < NSDraggingInfo >)info item:(id)targetItem childIndex:(NSInteger)index{ 128 | 129 | NSPasteboard *p = [info draggingPasteboard]; 130 | NSString *title = [p stringForType:@"public.text"]; 131 | NSTreeNode *sourceNode; 132 | 133 | for(NSTreeNode *b in [targetItem childNodes]){ 134 | if ([[[b representedObject] title] isEqualToString:title]){ 135 | sourceNode = b; 136 | } 137 | } 138 | 139 | if(!sourceNode){ 140 | // Not found 141 | return NO; 142 | } 143 | 144 | NSUInteger indexArr[] = {0,index}; 145 | NSIndexPath *toIndexPATH =[NSIndexPath indexPathWithIndexes:indexArr length:2]; 146 | 147 | [self.booksController moveNode:sourceNode toIndexPath:toIndexPATH]; 148 | 149 | return YES; 150 | } 151 | 152 | @end 153 | -------------------------------------------------------------------------------- /OutlineView/OutlineView/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 | Default 529 | 530 | 531 | 532 | 533 | 534 | 535 | Left to Right 536 | 537 | 538 | 539 | 540 | 541 | 542 | Right to Left 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | Default 554 | 555 | 556 | 557 | 558 | 559 | 560 | Left to Right 561 | 562 | 563 | 564 | 565 | 566 | 567 | Right to Left 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 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 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 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 | 754 | 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 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 812 | 823 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | -------------------------------------------------------------------------------- /OutlineView/OutlineView/Book.h: -------------------------------------------------------------------------------- 1 | // 2 | // Book.h 3 | // OutlineView 4 | // 5 | // Copyright (c) 2013 company. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface Book : NSObject 11 | 12 | @property (copy) NSString *title; 13 | @property (copy) NSString *author; 14 | 15 | + (Book*) bookWithTitle:(NSString *)title andAuthor:(NSString *) author; 16 | 17 | 18 | @property (readonly) BOOL isLeaf; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /OutlineView/OutlineView/Book.m: -------------------------------------------------------------------------------- 1 | // 2 | // Book.m 3 | // OutlineView 4 | // 5 | // Copyright (c) 2013 company. All rights reserved. 6 | // 7 | 8 | #import "Book.h" 9 | 10 | @implementation Book 11 | 12 | +(Book *)bookWithTitle:(NSString *)title andAuthor:(NSString *)author{ 13 | Book *result = [Book new]; 14 | result.author = author; 15 | result.title = title; 16 | 17 | return result; 18 | } 19 | 20 | -(BOOL)isLeaf{ 21 | return YES; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /OutlineView/OutlineView/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 | } -------------------------------------------------------------------------------- /OutlineView/OutlineView/OutlineView-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.company.${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 © 2013 company. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /OutlineView/OutlineView/OutlineView-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /OutlineView/OutlineView/book.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/besi/mac-quickies/e8d2c2506349fa00a342c291a0031c40a1f598e3/OutlineView/OutlineView/book.icns -------------------------------------------------------------------------------- /OutlineView/OutlineView/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /OutlineView/OutlineView/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /OutlineView/OutlineView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OutlineView 4 | // 5 | // Copyright (c) 2013 company. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | int main(int argc, const char * argv[]) 11 | { 12 | return NSApplicationMain(argc, argv); 13 | } 14 | -------------------------------------------------------------------------------- /OutlineView/OutlineViewTests/OutlineViewTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.company.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /OutlineView/OutlineViewTests/OutlineViewTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // OutlineViewTests.m 3 | // OutlineViewTests 4 | // 5 | // Copyright (c) 2013 company. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface OutlineViewTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation OutlineViewTests 15 | 16 | - (void)setUp 17 | { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown 23 | { 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 | { 30 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /OutlineView/OutlineViewTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /OutlineView/Readme.md: -------------------------------------------------------------------------------- 1 | Outline View 2 | ============ 3 | 4 | This example features a view-based source list which shows a list of books. When the books are selected, the detail is shown to the right. 5 | 6 | Bindings are used to display the data in the UI. 7 | 8 | Also check the [DragNDropOutlineView](https://developer.apple.com/library/mac/samplecode/DragNDropOutlineView) for reference. 9 | 10 | 11 | Screenshot 12 | ---------- 13 | 14 | ![screenshot](https://raw.github.com/besi/mac-quickies/master/OutlineView/screenshot.png) 15 | 16 | 17 | Setup in Interface Builder 18 | -------------------------- 19 | 20 | The binding is setup in Interface builder 21 | 22 | - For the movies add an Object and set its class to `NSMutableArray`. 23 | - Add a Tree Controller and set the newly created `movies` object as its content connection. 24 | - Setup the Tree Controller so set the Children KeyPath to `children` and the leaf KeyPath to `isLeaf`. The `Book` class always returns `YES` for `isLeaf`. 25 | - Bind the **Table Column** of the `NSOutlineView` to the **Tree Controller** with the **Controller Key** of `arrangedObjects`. 26 | - Bind the text field of the given cell (`DataCell`) to **Table Cell View** with the **Model Key Path** of `objectValue.title` which has to correspond with the data, that the **Tree Controller** is provided with. 27 | 28 | - Despite the binding some things need to be set in code to achieve the following: 29 | 30 | - Tell the `NSOutlineView` which cell to use 31 | - Prevent the user from selecting the header cell 32 | - Tell the `NSOutlineView` whether a given note should be displayed as a header cell so that **Show/Hide** is shown rather than the disclosure indicator. 33 | 34 | - Finally bind the text field's values to the **Tree Controller** with the **Controller Key** of `selection` and the **Model Key Path** of `title / author`. -------------------------------------------------------------------------------- /OutlineView/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/besi/mac-quickies/e8d2c2506349fa00a342c291a0031c40a1f598e3/OutlineView/screenshot.png -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | Mac Quickies 2 | ============ 3 | 4 | 5 | [OutlineView] 6 | ------------- 7 | 8 | Demonstrates a simple `NSOutlineView` 9 | 10 | ![screenshot](https://raw.github.com/besi/mac-quickies/master/OutlineView/screenshot.png) 11 | 12 | [OutlineView]: https://github.com/besi/mac-quickies/tree/master/OutlineView --------------------------------------------------------------------------------