├── 1.png ├── Demo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── mac.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── Demo.xcscheme │ └── xcschememanagement.plist ├── Demo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ └── Main.storyboard ├── ContentView.h ├── ContentView.m ├── ContentView.xib ├── Info.plist ├── ViewController.h ├── ViewController.m ├── WindowController.h ├── WindowController.m └── main.m ├── DemoTests ├── DemoTests.m └── Info.plist ├── DemoUITests ├── DemoUITests.m └── Info.plist └── README.md /1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shibiao/MACOS_QQ-NSWindow/c08eabf2fa6348611f6957070406305a9e212e41/1.png -------------------------------------------------------------------------------- /Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 04536F521E0FE9D700ED5FC9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 04536F511E0FE9D700ED5FC9 /* AppDelegate.m */; }; 11 | 04536F551E0FE9D700ED5FC9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 04536F541E0FE9D700ED5FC9 /* main.m */; }; 12 | 04536F581E0FE9D700ED5FC9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04536F571E0FE9D700ED5FC9 /* ViewController.m */; }; 13 | 04536F5A1E0FE9D800ED5FC9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 04536F591E0FE9D800ED5FC9 /* Assets.xcassets */; }; 14 | 04536F5D1E0FE9D800ED5FC9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 04536F5B1E0FE9D800ED5FC9 /* Main.storyboard */; }; 15 | 04536F681E0FE9D800ED5FC9 /* DemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 04536F671E0FE9D800ED5FC9 /* DemoTests.m */; }; 16 | 04536F731E0FE9D800ED5FC9 /* DemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 04536F721E0FE9D800ED5FC9 /* DemoUITests.m */; }; 17 | 04536F821E0FF3E200ED5FC9 /* WindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04536F811E0FF3E200ED5FC9 /* WindowController.m */; }; 18 | 04536F871E0FF5ED00ED5FC9 /* ContentView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 04536F861E0FF5ED00ED5FC9 /* ContentView.xib */; }; 19 | 04536F8A1E0FFAA400ED5FC9 /* ContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04536F891E0FFAA400ED5FC9 /* ContentView.m */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | 04536F641E0FE9D800ED5FC9 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = 04536F451E0FE9D700ED5FC9 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = 04536F4C1E0FE9D700ED5FC9; 28 | remoteInfo = Demo; 29 | }; 30 | 04536F6F1E0FE9D800ED5FC9 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 04536F451E0FE9D700ED5FC9 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 04536F4C1E0FE9D700ED5FC9; 35 | remoteInfo = Demo; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 04536F4D1E0FE9D700ED5FC9 /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 04536F501E0FE9D700ED5FC9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 42 | 04536F511E0FE9D700ED5FC9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 43 | 04536F541E0FE9D700ED5FC9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 44 | 04536F561E0FE9D700ED5FC9 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 45 | 04536F571E0FE9D700ED5FC9 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 46 | 04536F591E0FE9D800ED5FC9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | 04536F5C1E0FE9D800ED5FC9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 48 | 04536F5E1E0FE9D800ED5FC9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 04536F631E0FE9D800ED5FC9 /* DemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 04536F671E0FE9D800ED5FC9 /* DemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoTests.m; sourceTree = ""; }; 51 | 04536F691E0FE9D800ED5FC9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | 04536F6E1E0FE9D800ED5FC9 /* DemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 04536F721E0FE9D800ED5FC9 /* DemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoUITests.m; sourceTree = ""; }; 54 | 04536F741E0FE9D800ED5FC9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 04536F801E0FF3E200ED5FC9 /* WindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowController.h; sourceTree = ""; }; 56 | 04536F811E0FF3E200ED5FC9 /* WindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WindowController.m; sourceTree = ""; }; 57 | 04536F861E0FF5ED00ED5FC9 /* ContentView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ContentView.xib; sourceTree = ""; }; 58 | 04536F881E0FFAA400ED5FC9 /* ContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentView.h; sourceTree = ""; }; 59 | 04536F891E0FFAA400ED5FC9 /* ContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContentView.m; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | 04536F4A1E0FE9D700ED5FC9 /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | 04536F601E0FE9D800ED5FC9 /* Frameworks */ = { 71 | isa = PBXFrameworksBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | 04536F6B1E0FE9D800ED5FC9 /* Frameworks */ = { 78 | isa = PBXFrameworksBuildPhase; 79 | buildActionMask = 2147483647; 80 | files = ( 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | /* End PBXFrameworksBuildPhase section */ 85 | 86 | /* Begin PBXGroup section */ 87 | 04536F441E0FE9D700ED5FC9 = { 88 | isa = PBXGroup; 89 | children = ( 90 | 04536F4F1E0FE9D700ED5FC9 /* Demo */, 91 | 04536F661E0FE9D800ED5FC9 /* DemoTests */, 92 | 04536F711E0FE9D800ED5FC9 /* DemoUITests */, 93 | 04536F4E1E0FE9D700ED5FC9 /* Products */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | 04536F4E1E0FE9D700ED5FC9 /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 04536F4D1E0FE9D700ED5FC9 /* Demo.app */, 101 | 04536F631E0FE9D800ED5FC9 /* DemoTests.xctest */, 102 | 04536F6E1E0FE9D800ED5FC9 /* DemoUITests.xctest */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | 04536F4F1E0FE9D700ED5FC9 /* Demo */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 04536F501E0FE9D700ED5FC9 /* AppDelegate.h */, 111 | 04536F511E0FE9D700ED5FC9 /* AppDelegate.m */, 112 | 04536F561E0FE9D700ED5FC9 /* ViewController.h */, 113 | 04536F571E0FE9D700ED5FC9 /* ViewController.m */, 114 | 04536F801E0FF3E200ED5FC9 /* WindowController.h */, 115 | 04536F811E0FF3E200ED5FC9 /* WindowController.m */, 116 | 04536F881E0FFAA400ED5FC9 /* ContentView.h */, 117 | 04536F891E0FFAA400ED5FC9 /* ContentView.m */, 118 | 04536F861E0FF5ED00ED5FC9 /* ContentView.xib */, 119 | 04536F591E0FE9D800ED5FC9 /* Assets.xcassets */, 120 | 04536F5B1E0FE9D800ED5FC9 /* Main.storyboard */, 121 | 04536F5E1E0FE9D800ED5FC9 /* Info.plist */, 122 | 04536F531E0FE9D700ED5FC9 /* Supporting Files */, 123 | ); 124 | path = Demo; 125 | sourceTree = ""; 126 | }; 127 | 04536F531E0FE9D700ED5FC9 /* Supporting Files */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 04536F541E0FE9D700ED5FC9 /* main.m */, 131 | ); 132 | name = "Supporting Files"; 133 | sourceTree = ""; 134 | }; 135 | 04536F661E0FE9D800ED5FC9 /* DemoTests */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 04536F671E0FE9D800ED5FC9 /* DemoTests.m */, 139 | 04536F691E0FE9D800ED5FC9 /* Info.plist */, 140 | ); 141 | path = DemoTests; 142 | sourceTree = ""; 143 | }; 144 | 04536F711E0FE9D800ED5FC9 /* DemoUITests */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | 04536F721E0FE9D800ED5FC9 /* DemoUITests.m */, 148 | 04536F741E0FE9D800ED5FC9 /* Info.plist */, 149 | ); 150 | path = DemoUITests; 151 | sourceTree = ""; 152 | }; 153 | /* End PBXGroup section */ 154 | 155 | /* Begin PBXNativeTarget section */ 156 | 04536F4C1E0FE9D700ED5FC9 /* Demo */ = { 157 | isa = PBXNativeTarget; 158 | buildConfigurationList = 04536F771E0FE9D800ED5FC9 /* Build configuration list for PBXNativeTarget "Demo" */; 159 | buildPhases = ( 160 | 04536F491E0FE9D700ED5FC9 /* Sources */, 161 | 04536F4A1E0FE9D700ED5FC9 /* Frameworks */, 162 | 04536F4B1E0FE9D700ED5FC9 /* Resources */, 163 | ); 164 | buildRules = ( 165 | ); 166 | dependencies = ( 167 | ); 168 | name = Demo; 169 | productName = Demo; 170 | productReference = 04536F4D1E0FE9D700ED5FC9 /* Demo.app */; 171 | productType = "com.apple.product-type.application"; 172 | }; 173 | 04536F621E0FE9D800ED5FC9 /* DemoTests */ = { 174 | isa = PBXNativeTarget; 175 | buildConfigurationList = 04536F7A1E0FE9D800ED5FC9 /* Build configuration list for PBXNativeTarget "DemoTests" */; 176 | buildPhases = ( 177 | 04536F5F1E0FE9D800ED5FC9 /* Sources */, 178 | 04536F601E0FE9D800ED5FC9 /* Frameworks */, 179 | 04536F611E0FE9D800ED5FC9 /* Resources */, 180 | ); 181 | buildRules = ( 182 | ); 183 | dependencies = ( 184 | 04536F651E0FE9D800ED5FC9 /* PBXTargetDependency */, 185 | ); 186 | name = DemoTests; 187 | productName = DemoTests; 188 | productReference = 04536F631E0FE9D800ED5FC9 /* DemoTests.xctest */; 189 | productType = "com.apple.product-type.bundle.unit-test"; 190 | }; 191 | 04536F6D1E0FE9D800ED5FC9 /* DemoUITests */ = { 192 | isa = PBXNativeTarget; 193 | buildConfigurationList = 04536F7D1E0FE9D800ED5FC9 /* Build configuration list for PBXNativeTarget "DemoUITests" */; 194 | buildPhases = ( 195 | 04536F6A1E0FE9D800ED5FC9 /* Sources */, 196 | 04536F6B1E0FE9D800ED5FC9 /* Frameworks */, 197 | 04536F6C1E0FE9D800ED5FC9 /* Resources */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | 04536F701E0FE9D800ED5FC9 /* PBXTargetDependency */, 203 | ); 204 | name = DemoUITests; 205 | productName = DemoUITests; 206 | productReference = 04536F6E1E0FE9D800ED5FC9 /* DemoUITests.xctest */; 207 | productType = "com.apple.product-type.bundle.ui-testing"; 208 | }; 209 | /* End PBXNativeTarget section */ 210 | 211 | /* Begin PBXProject section */ 212 | 04536F451E0FE9D700ED5FC9 /* Project object */ = { 213 | isa = PBXProject; 214 | attributes = { 215 | LastUpgradeCheck = 0820; 216 | ORGANIZATIONNAME = shibiao; 217 | TargetAttributes = { 218 | 04536F4C1E0FE9D700ED5FC9 = { 219 | CreatedOnToolsVersion = 8.2.1; 220 | DevelopmentTeam = M54Y5FDG74; 221 | ProvisioningStyle = Automatic; 222 | }; 223 | 04536F621E0FE9D800ED5FC9 = { 224 | CreatedOnToolsVersion = 8.2.1; 225 | DevelopmentTeam = M54Y5FDG74; 226 | ProvisioningStyle = Automatic; 227 | TestTargetID = 04536F4C1E0FE9D700ED5FC9; 228 | }; 229 | 04536F6D1E0FE9D800ED5FC9 = { 230 | CreatedOnToolsVersion = 8.2.1; 231 | DevelopmentTeam = M54Y5FDG74; 232 | ProvisioningStyle = Automatic; 233 | TestTargetID = 04536F4C1E0FE9D700ED5FC9; 234 | }; 235 | }; 236 | }; 237 | buildConfigurationList = 04536F481E0FE9D700ED5FC9 /* Build configuration list for PBXProject "Demo" */; 238 | compatibilityVersion = "Xcode 3.2"; 239 | developmentRegion = English; 240 | hasScannedForEncodings = 0; 241 | knownRegions = ( 242 | en, 243 | Base, 244 | ); 245 | mainGroup = 04536F441E0FE9D700ED5FC9; 246 | productRefGroup = 04536F4E1E0FE9D700ED5FC9 /* Products */; 247 | projectDirPath = ""; 248 | projectRoot = ""; 249 | targets = ( 250 | 04536F4C1E0FE9D700ED5FC9 /* Demo */, 251 | 04536F621E0FE9D800ED5FC9 /* DemoTests */, 252 | 04536F6D1E0FE9D800ED5FC9 /* DemoUITests */, 253 | ); 254 | }; 255 | /* End PBXProject section */ 256 | 257 | /* Begin PBXResourcesBuildPhase section */ 258 | 04536F4B1E0FE9D700ED5FC9 /* Resources */ = { 259 | isa = PBXResourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | 04536F5A1E0FE9D800ED5FC9 /* Assets.xcassets in Resources */, 263 | 04536F871E0FF5ED00ED5FC9 /* ContentView.xib in Resources */, 264 | 04536F5D1E0FE9D800ED5FC9 /* Main.storyboard in Resources */, 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | 04536F611E0FE9D800ED5FC9 /* Resources */ = { 269 | isa = PBXResourcesBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | }; 275 | 04536F6C1E0FE9D800ED5FC9 /* Resources */ = { 276 | isa = PBXResourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | /* End PBXResourcesBuildPhase section */ 283 | 284 | /* Begin PBXSourcesBuildPhase section */ 285 | 04536F491E0FE9D700ED5FC9 /* Sources */ = { 286 | isa = PBXSourcesBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | 04536F581E0FE9D700ED5FC9 /* ViewController.m in Sources */, 290 | 04536F821E0FF3E200ED5FC9 /* WindowController.m in Sources */, 291 | 04536F8A1E0FFAA400ED5FC9 /* ContentView.m in Sources */, 292 | 04536F551E0FE9D700ED5FC9 /* main.m in Sources */, 293 | 04536F521E0FE9D700ED5FC9 /* AppDelegate.m in Sources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | 04536F5F1E0FE9D800ED5FC9 /* Sources */ = { 298 | isa = PBXSourcesBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | 04536F681E0FE9D800ED5FC9 /* DemoTests.m in Sources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | 04536F6A1E0FE9D800ED5FC9 /* Sources */ = { 306 | isa = PBXSourcesBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | 04536F731E0FE9D800ED5FC9 /* DemoUITests.m in Sources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | /* End PBXSourcesBuildPhase section */ 314 | 315 | /* Begin PBXTargetDependency section */ 316 | 04536F651E0FE9D800ED5FC9 /* PBXTargetDependency */ = { 317 | isa = PBXTargetDependency; 318 | target = 04536F4C1E0FE9D700ED5FC9 /* Demo */; 319 | targetProxy = 04536F641E0FE9D800ED5FC9 /* PBXContainerItemProxy */; 320 | }; 321 | 04536F701E0FE9D800ED5FC9 /* PBXTargetDependency */ = { 322 | isa = PBXTargetDependency; 323 | target = 04536F4C1E0FE9D700ED5FC9 /* Demo */; 324 | targetProxy = 04536F6F1E0FE9D800ED5FC9 /* PBXContainerItemProxy */; 325 | }; 326 | /* End PBXTargetDependency section */ 327 | 328 | /* Begin PBXVariantGroup section */ 329 | 04536F5B1E0FE9D800ED5FC9 /* Main.storyboard */ = { 330 | isa = PBXVariantGroup; 331 | children = ( 332 | 04536F5C1E0FE9D800ED5FC9 /* Base */, 333 | ); 334 | name = Main.storyboard; 335 | sourceTree = ""; 336 | }; 337 | /* End PBXVariantGroup section */ 338 | 339 | /* Begin XCBuildConfiguration section */ 340 | 04536F751E0FE9D800ED5FC9 /* Debug */ = { 341 | isa = XCBuildConfiguration; 342 | buildSettings = { 343 | ALWAYS_SEARCH_USER_PATHS = NO; 344 | CLANG_ANALYZER_NONNULL = YES; 345 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 346 | CLANG_CXX_LIBRARY = "libc++"; 347 | CLANG_ENABLE_MODULES = YES; 348 | CLANG_ENABLE_OBJC_ARC = YES; 349 | CLANG_WARN_BOOL_CONVERSION = YES; 350 | CLANG_WARN_CONSTANT_CONVERSION = YES; 351 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 352 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 353 | CLANG_WARN_EMPTY_BODY = YES; 354 | CLANG_WARN_ENUM_CONVERSION = YES; 355 | CLANG_WARN_INFINITE_RECURSION = YES; 356 | CLANG_WARN_INT_CONVERSION = YES; 357 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 358 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 359 | CLANG_WARN_UNREACHABLE_CODE = YES; 360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 361 | CODE_SIGN_IDENTITY = "-"; 362 | COPY_PHASE_STRIP = NO; 363 | DEBUG_INFORMATION_FORMAT = dwarf; 364 | ENABLE_STRICT_OBJC_MSGSEND = YES; 365 | ENABLE_TESTABILITY = YES; 366 | GCC_C_LANGUAGE_STANDARD = gnu99; 367 | GCC_DYNAMIC_NO_PIC = NO; 368 | GCC_NO_COMMON_BLOCKS = YES; 369 | GCC_OPTIMIZATION_LEVEL = 0; 370 | GCC_PREPROCESSOR_DEFINITIONS = ( 371 | "DEBUG=1", 372 | "$(inherited)", 373 | ); 374 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 375 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 376 | GCC_WARN_UNDECLARED_SELECTOR = YES; 377 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 378 | GCC_WARN_UNUSED_FUNCTION = YES; 379 | GCC_WARN_UNUSED_VARIABLE = YES; 380 | MACOSX_DEPLOYMENT_TARGET = 10.12; 381 | MTL_ENABLE_DEBUG_INFO = YES; 382 | ONLY_ACTIVE_ARCH = YES; 383 | SDKROOT = macosx; 384 | }; 385 | name = Debug; 386 | }; 387 | 04536F761E0FE9D800ED5FC9 /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | buildSettings = { 390 | ALWAYS_SEARCH_USER_PATHS = NO; 391 | CLANG_ANALYZER_NONNULL = YES; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 393 | CLANG_CXX_LIBRARY = "libc++"; 394 | CLANG_ENABLE_MODULES = YES; 395 | CLANG_ENABLE_OBJC_ARC = YES; 396 | CLANG_WARN_BOOL_CONVERSION = YES; 397 | CLANG_WARN_CONSTANT_CONVERSION = YES; 398 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 399 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 400 | CLANG_WARN_EMPTY_BODY = YES; 401 | CLANG_WARN_ENUM_CONVERSION = YES; 402 | CLANG_WARN_INFINITE_RECURSION = YES; 403 | CLANG_WARN_INT_CONVERSION = YES; 404 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 405 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 406 | CLANG_WARN_UNREACHABLE_CODE = YES; 407 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 408 | CODE_SIGN_IDENTITY = "-"; 409 | COPY_PHASE_STRIP = NO; 410 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 411 | ENABLE_NS_ASSERTIONS = NO; 412 | ENABLE_STRICT_OBJC_MSGSEND = YES; 413 | GCC_C_LANGUAGE_STANDARD = gnu99; 414 | GCC_NO_COMMON_BLOCKS = YES; 415 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 416 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 417 | GCC_WARN_UNDECLARED_SELECTOR = YES; 418 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 419 | GCC_WARN_UNUSED_FUNCTION = YES; 420 | GCC_WARN_UNUSED_VARIABLE = YES; 421 | MACOSX_DEPLOYMENT_TARGET = 10.12; 422 | MTL_ENABLE_DEBUG_INFO = NO; 423 | SDKROOT = macosx; 424 | }; 425 | name = Release; 426 | }; 427 | 04536F781E0FE9D800ED5FC9 /* Debug */ = { 428 | isa = XCBuildConfiguration; 429 | buildSettings = { 430 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 431 | COMBINE_HIDPI_IMAGES = YES; 432 | DEVELOPMENT_TEAM = M54Y5FDG74; 433 | INFOPLIST_FILE = Demo/Info.plist; 434 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 435 | PRODUCT_BUNDLE_IDENTIFIER = com.shibiao.Demo; 436 | PRODUCT_NAME = "$(TARGET_NAME)"; 437 | }; 438 | name = Debug; 439 | }; 440 | 04536F791E0FE9D800ED5FC9 /* Release */ = { 441 | isa = XCBuildConfiguration; 442 | buildSettings = { 443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 444 | COMBINE_HIDPI_IMAGES = YES; 445 | DEVELOPMENT_TEAM = M54Y5FDG74; 446 | INFOPLIST_FILE = Demo/Info.plist; 447 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 448 | PRODUCT_BUNDLE_IDENTIFIER = com.shibiao.Demo; 449 | PRODUCT_NAME = "$(TARGET_NAME)"; 450 | }; 451 | name = Release; 452 | }; 453 | 04536F7B1E0FE9D800ED5FC9 /* Debug */ = { 454 | isa = XCBuildConfiguration; 455 | buildSettings = { 456 | BUNDLE_LOADER = "$(TEST_HOST)"; 457 | COMBINE_HIDPI_IMAGES = YES; 458 | DEVELOPMENT_TEAM = M54Y5FDG74; 459 | INFOPLIST_FILE = DemoTests/Info.plist; 460 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 461 | PRODUCT_BUNDLE_IDENTIFIER = com.shibiao.DemoTests; 462 | PRODUCT_NAME = "$(TARGET_NAME)"; 463 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo.app/Contents/MacOS/Demo"; 464 | }; 465 | name = Debug; 466 | }; 467 | 04536F7C1E0FE9D800ED5FC9 /* Release */ = { 468 | isa = XCBuildConfiguration; 469 | buildSettings = { 470 | BUNDLE_LOADER = "$(TEST_HOST)"; 471 | COMBINE_HIDPI_IMAGES = YES; 472 | DEVELOPMENT_TEAM = M54Y5FDG74; 473 | INFOPLIST_FILE = DemoTests/Info.plist; 474 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 475 | PRODUCT_BUNDLE_IDENTIFIER = com.shibiao.DemoTests; 476 | PRODUCT_NAME = "$(TARGET_NAME)"; 477 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo.app/Contents/MacOS/Demo"; 478 | }; 479 | name = Release; 480 | }; 481 | 04536F7E1E0FE9D800ED5FC9 /* Debug */ = { 482 | isa = XCBuildConfiguration; 483 | buildSettings = { 484 | COMBINE_HIDPI_IMAGES = YES; 485 | DEVELOPMENT_TEAM = M54Y5FDG74; 486 | INFOPLIST_FILE = DemoUITests/Info.plist; 487 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 488 | PRODUCT_BUNDLE_IDENTIFIER = com.shibiao.DemoUITests; 489 | PRODUCT_NAME = "$(TARGET_NAME)"; 490 | TEST_TARGET_NAME = Demo; 491 | }; 492 | name = Debug; 493 | }; 494 | 04536F7F1E0FE9D800ED5FC9 /* Release */ = { 495 | isa = XCBuildConfiguration; 496 | buildSettings = { 497 | COMBINE_HIDPI_IMAGES = YES; 498 | DEVELOPMENT_TEAM = M54Y5FDG74; 499 | INFOPLIST_FILE = DemoUITests/Info.plist; 500 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 501 | PRODUCT_BUNDLE_IDENTIFIER = com.shibiao.DemoUITests; 502 | PRODUCT_NAME = "$(TARGET_NAME)"; 503 | TEST_TARGET_NAME = Demo; 504 | }; 505 | name = Release; 506 | }; 507 | /* End XCBuildConfiguration section */ 508 | 509 | /* Begin XCConfigurationList section */ 510 | 04536F481E0FE9D700ED5FC9 /* Build configuration list for PBXProject "Demo" */ = { 511 | isa = XCConfigurationList; 512 | buildConfigurations = ( 513 | 04536F751E0FE9D800ED5FC9 /* Debug */, 514 | 04536F761E0FE9D800ED5FC9 /* Release */, 515 | ); 516 | defaultConfigurationIsVisible = 0; 517 | defaultConfigurationName = Release; 518 | }; 519 | 04536F771E0FE9D800ED5FC9 /* Build configuration list for PBXNativeTarget "Demo" */ = { 520 | isa = XCConfigurationList; 521 | buildConfigurations = ( 522 | 04536F781E0FE9D800ED5FC9 /* Debug */, 523 | 04536F791E0FE9D800ED5FC9 /* Release */, 524 | ); 525 | defaultConfigurationIsVisible = 0; 526 | }; 527 | 04536F7A1E0FE9D800ED5FC9 /* Build configuration list for PBXNativeTarget "DemoTests" */ = { 528 | isa = XCConfigurationList; 529 | buildConfigurations = ( 530 | 04536F7B1E0FE9D800ED5FC9 /* Debug */, 531 | 04536F7C1E0FE9D800ED5FC9 /* Release */, 532 | ); 533 | defaultConfigurationIsVisible = 0; 534 | }; 535 | 04536F7D1E0FE9D800ED5FC9 /* Build configuration list for PBXNativeTarget "DemoUITests" */ = { 536 | isa = XCConfigurationList; 537 | buildConfigurations = ( 538 | 04536F7E1E0FE9D800ED5FC9 /* Debug */, 539 | 04536F7F1E0FE9D800ED5FC9 /* Release */, 540 | ); 541 | defaultConfigurationIsVisible = 0; 542 | }; 543 | /* End XCConfigurationList section */ 544 | }; 545 | rootObject = 04536F451E0FE9D700ED5FC9 /* Project object */; 546 | } 547 | -------------------------------------------------------------------------------- /Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo.xcodeproj/xcuserdata/mac.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Demo.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/Demo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /Demo.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Demo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 04536F4C1E0FE9D700ED5FC9 16 | 17 | primary 18 | 19 | 20 | 04536F621E0FE9D800ED5FC9 21 | 22 | primary 23 | 24 | 25 | 04536F6D1E0FE9D800ED5FC9 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Demo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Demo 4 | // 5 | // Created by Mac on 2016/12/25. 6 | // Copyright © 2016年 shibiao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Demo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Demo 4 | // 5 | // Created by Mac on 2016/12/25. 6 | // Copyright © 2016年 shibiao. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 18 | // Insert code here to initialize your application 19 | } 20 | 21 | 22 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 23 | // Insert code here to tear down your application 24 | } 25 | 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Demo/Assets.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 | } -------------------------------------------------------------------------------- /Demo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 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 | Default 511 | 512 | 513 | 514 | 515 | 516 | 517 | Left to Right 518 | 519 | 520 | 521 | 522 | 523 | 524 | Right to Left 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | Default 536 | 537 | 538 | 539 | 540 | 541 | 542 | Left to Right 543 | 544 | 545 | 546 | 547 | 548 | 549 | Right to Left 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 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 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | -------------------------------------------------------------------------------- /Demo/ContentView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.h 3 | // Demo 4 | // 5 | // Created by Mac on 2016/12/25. 6 | // Copyright © 2016年 shibiao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ContentView : NSView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/ContentView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.m 3 | // Demo 4 | // 5 | // Created by Mac on 2016/12/25. 6 | // Copyright © 2016年 shibiao. All rights reserved. 7 | // 8 | 9 | #import "ContentView.h" 10 | 11 | @implementation ContentView 12 | - (void)drawRect:(NSRect)dirtyRect { 13 | [super drawRect:dirtyRect]; 14 | 15 | // Drawing code here. 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Demo/ContentView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 24 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | Copyright © 2016年 shibiao. All rights reserved. 27 | NSMainStoryboardFile 28 | Main 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /Demo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Demo 4 | // 5 | // Created by Mac on 2016/12/25. 6 | // Copyright © 2016年 shibiao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ContentView.h" 11 | @interface ViewController : NSViewController 12 | 13 | 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /Demo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Demo 4 | // 5 | // Created by Mac on 2016/12/25. 6 | // Copyright © 2016年 shibiao. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @implementation ViewController{ 12 | NSWindow *_sbWindow; 13 | ContentView *_customView; 14 | } 15 | 16 | - (void)viewDidLoad { 17 | [super viewDidLoad]; 18 | NSArray *nilArray; 19 | [[NSBundle mainBundle]loadNibNamed:@"ContentView" owner:self topLevelObjects:&nilArray]; 20 | _customView = (ContentView *)nilArray[1]; 21 | [_customView setWantsLayer:YES]; 22 | _customView.layer.cornerRadius = 5; 23 | [_customView.layer masksToBounds]; 24 | 25 | } 26 | -(void)viewDidAppear{ 27 | [super viewDidAppear]; 28 | NSLog(@"%@",NSStringFromRect(self.view.window.frame)); 29 | 30 | 31 | } 32 | - (IBAction)click:(id)sender { 33 | 34 | if (!_sbWindow) { 35 | [self createSubWindow]; 36 | }else{ 37 | [self.view.window removeChildWindow:_sbWindow]; 38 | _sbWindow = nil; 39 | } 40 | } 41 | -(void)createSubWindow{ 42 | //一种初始化方法 43 | // _sbWindow = [[NSWindow alloc]initWithContentRect:NSMakeRect(self.view.window.frame.origin.x, self.view.window.frame.origin.y-180, self.view.window.frame.size.width, 200) styleMask:NSWindowStyleMaskTitled|NSWindowStyleMaskMiniaturizable backing:NSBackingStoreNonretained defer:YES]; 44 | //第二种初始化方法 45 | _sbWindow = [[NSWindow alloc]init]; 46 | _sbWindow.styleMask = NSWindowStyleMaskBorderless; 47 | _sbWindow.backingType = NSBackingStoreNonretained; 48 | [_sbWindow setFrame:NSMakeRect(self.view.window.frame.origin.x, self.view.window.frame.origin.y-100, self.view.window.frame.size.width, 100) display:YES animate:YES]; 49 | //设置ContentView 50 | _sbWindow.contentView = _customView; 51 | //添加childWindow 52 | [self.view.window addChildWindow:_sbWindow ordered:NSWindowBelow]; 53 | } 54 | 55 | - (void)setRepresentedObject:(id)representedObject { 56 | [super setRepresentedObject:representedObject]; 57 | 58 | // Update the view, if already loaded. 59 | } 60 | 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Demo/WindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // WindowController.h 3 | // Demo 4 | // 5 | // Created by Mac on 2016/12/25. 6 | // Copyright © 2016年 shibiao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WindowController : NSWindowController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/WindowController.m: -------------------------------------------------------------------------------- 1 | // 2 | // WindowController.m 3 | // Demo 4 | // 5 | // Created by Mac on 2016/12/25. 6 | // Copyright © 2016年 shibiao. All rights reserved. 7 | // 8 | 9 | #import "WindowController.h" 10 | 11 | @interface WindowController () 12 | 13 | @end 14 | 15 | @implementation WindowController 16 | 17 | - (void)windowDidLoad { 18 | [super windowDidLoad]; 19 | self.window.titlebarAppearsTransparent = YES; 20 | self.window.titleVisibility = NSWindowTitleHidden; 21 | self.window.backgroundColor = [NSColor whiteColor]; 22 | [[self.window standardWindowButton:NSWindowMiniaturizeButton] setHidden:YES]; 23 | [[self.window standardWindowButton:NSWindowZoomButton] setHidden:YES]; 24 | self.window.movableByWindowBackground = YES; 25 | // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Demo 4 | // 5 | // Created by Mac on 2016/12/25. 6 | // Copyright © 2016年 shibiao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) { 12 | return NSApplicationMain(argc, argv); 13 | } 14 | -------------------------------------------------------------------------------- /DemoTests/DemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoTests.m 3 | // DemoTests 4 | // 5 | // Created by Mac on 2016/12/25. 6 | // Copyright © 2016年 shibiao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DemoTests 16 | 17 | - (void)setUp { 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 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /DemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /DemoUITests/DemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoUITests.m 3 | // DemoUITests 4 | // 5 | // Created by Mac on 2016/12/25. 6 | // Copyright © 2016年 shibiao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /DemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MACOS_QQ-NSWindow 2 | >MACOS 类似于QQ抽屉功能,NSWindow 3 | 4 | ![1](https://github.com/shibiao/MACOS_QQ-NSWindow/blob/master/1.png) 5 | *** 6 | 博客地址:[blog](http://www.jianshu.com/p/c2466c67be32) 7 | --------------------------------------------------------------------------------