├── Demo ├── BVCMainViewController.h ├── BVCMainViewController.m ├── BVCMainViewController.xib ├── BVCNextViewController.h ├── BVCNextViewController.m ├── BVCNextViewController.xib ├── BetterViewController-Info.plist ├── BetterViewController.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── BetterViewControllerAppDelegate.h ├── BetterViewControllerAppDelegate.m ├── BetterViewController_Prefix.pch ├── English.lproj │ ├── InfoPlist.strings │ └── MainMenu.xib └── main.m ├── JAViewController.h ├── JAViewController.m ├── NSObject+JAExtensions.h ├── NSObject+JAExtensions.m ├── NSView+JAExtensions.h ├── NSView+JAExtensions.m └── README /Demo/BVCMainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BVCMainViewController.h 3 | // BetterViewController 4 | // 5 | // Created by Josh Abernathy on 8/22/10. 6 | // Copyright 2010 Maybe Apps. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JAViewController.h" 11 | 12 | 13 | @interface BVCMainViewController : JAViewController { 14 | 15 | } 16 | 17 | - (IBAction)showNextView:(id)sender; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Demo/BVCMainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BVCMainViewController.m 3 | // BetterViewController 4 | // 5 | // Created by Josh Abernathy on 8/22/10. 6 | // Copyright 2010 Maybe Apps. All rights reserved. 7 | // 8 | 9 | #import "BVCMainViewController.h" 10 | #import "BVCNextViewController.h" 11 | 12 | 13 | @implementation BVCMainViewController 14 | 15 | - (void)viewWillAppear { 16 | [super viewWillAppear]; 17 | LOG(); 18 | } 19 | 20 | - (void)viewDidAppear { 21 | [super viewDidAppear]; 22 | LOG(); 23 | } 24 | 25 | - (void)viewWillDisappear { 26 | [super viewWillDisappear]; 27 | LOG(); 28 | } 29 | 30 | - (void)viewDidDisappear { 31 | [super viewDidDisappear]; 32 | LOG(); 33 | } 34 | 35 | - (IBAction)showNextView:(id)sender { 36 | BVCNextViewController *viewController = [BVCNextViewController viewController]; 37 | [self.view.window.contentView replaceSubview:self.view with:viewController.view]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Demo/BVCMainViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1060 5 | 10F569 6 | 788 7 | 1038.29 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.CocoaPlugin 11 | 788 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.CocoaPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | BVCMainViewController 34 | 35 | 36 | FirstResponder 37 | 38 | 39 | NSApplication 40 | 41 | 42 | 43 | 268 44 | 45 | YES 46 | 47 | 48 | 268 49 | {{198, 125}, {84, 22}} 50 | 51 | YES 52 | 53 | 68288064 54 | 272630784 55 | Main View 56 | 57 | HelveticaNeue-Light 58 | 18 59 | 16 60 | 61 | 62 | 63 | 6 64 | System 65 | controlColor 66 | 67 | 3 68 | MC42NjY2NjY2NjY3AA 69 | 70 | 71 | 72 | 6 73 | System 74 | controlTextColor 75 | 76 | 3 77 | MAA 78 | 79 | 80 | 81 | 82 | 83 | 84 | 268 85 | {{342, 18}, {118, 25}} 86 | 87 | YES 88 | 89 | -2080244224 90 | 134217728 91 | Next View 92 | 93 | LucidaGrande 94 | 13 95 | 1044 96 | 97 | 98 | -2038152961 99 | 163 100 | 101 | 102 | 400 103 | 75 104 | 105 | 106 | 107 | {480, 272} 108 | 109 | NSView 110 | 111 | 112 | 113 | 114 | YES 115 | 116 | 117 | view 118 | 119 | 120 | 121 | 2 122 | 123 | 124 | 125 | showNextView: 126 | 127 | 128 | 129 | 7 130 | 131 | 132 | 133 | 134 | YES 135 | 136 | 0 137 | 138 | 139 | 140 | 141 | 142 | -2 143 | 144 | 145 | File's Owner 146 | 147 | 148 | -1 149 | 150 | 151 | First Responder 152 | 153 | 154 | -3 155 | 156 | 157 | Application 158 | 159 | 160 | 1 161 | 162 | 163 | YES 164 | 165 | 166 | 167 | 168 | 169 | 170 | 3 171 | 172 | 173 | YES 174 | 175 | 176 | 177 | 178 | 179 | 4 180 | 181 | 182 | 183 | 184 | 5 185 | 186 | 187 | YES 188 | 189 | 190 | 191 | 192 | 193 | 6 194 | 195 | 196 | 197 | 198 | 199 | 200 | YES 201 | 202 | YES 203 | 1.IBEditorWindowLastContentRect 204 | 1.IBPluginDependency 205 | 1.WindowOrigin 206 | 1.editorWindowContentRectSynchronizationRect 207 | 3.IBPluginDependency 208 | 4.IBPluginDependency 209 | 5.IBPluginDependency 210 | 6.IBPluginDependency 211 | 212 | 213 | YES 214 | {{214, 48}, {480, 272}} 215 | com.apple.InterfaceBuilder.CocoaPlugin 216 | {628, 654} 217 | {{217, 442}, {480, 272}} 218 | com.apple.InterfaceBuilder.CocoaPlugin 219 | com.apple.InterfaceBuilder.CocoaPlugin 220 | com.apple.InterfaceBuilder.CocoaPlugin 221 | com.apple.InterfaceBuilder.CocoaPlugin 222 | 223 | 224 | 225 | YES 226 | 227 | 228 | YES 229 | 230 | 231 | 232 | 233 | YES 234 | 235 | 236 | YES 237 | 238 | 239 | 240 | 7 241 | 242 | 243 | 244 | YES 245 | 246 | BVCMainViewController 247 | JAViewController 248 | 249 | showNextView: 250 | id 251 | 252 | 253 | showNextView: 254 | 255 | showNextView: 256 | id 257 | 258 | 259 | 260 | IBProjectSource 261 | BVCMainViewController.h 262 | 263 | 264 | 265 | JAViewController 266 | NSViewController 267 | 268 | IBProjectSource 269 | JAKit/JAViewController.h 270 | 271 | 272 | 273 | NSControl 274 | 275 | IBProjectSource 276 | JAKit/Extensions/NSControl+JAExtensions.h 277 | 278 | 279 | 280 | NSObject 281 | 282 | IBProjectSource 283 | JAKit/Extensions/NSObject+JAExtensions.h 284 | 285 | 286 | 287 | NSView 288 | 289 | viewController 290 | NSViewController 291 | 292 | 293 | viewController 294 | 295 | viewController 296 | NSViewController 297 | 298 | 299 | 300 | IBProjectSource 301 | JAKit/Extensions/NSView+JAExtensions.h 302 | 303 | 304 | 305 | 306 | YES 307 | 308 | NSActionCell 309 | NSCell 310 | 311 | IBFrameworkSource 312 | AppKit.framework/Headers/NSActionCell.h 313 | 314 | 315 | 316 | NSApplication 317 | NSResponder 318 | 319 | IBFrameworkSource 320 | AppKit.framework/Headers/NSApplication.h 321 | 322 | 323 | 324 | NSApplication 325 | 326 | IBFrameworkSource 327 | AppKit.framework/Headers/NSApplicationScripting.h 328 | 329 | 330 | 331 | NSApplication 332 | 333 | IBFrameworkSource 334 | AppKit.framework/Headers/NSColorPanel.h 335 | 336 | 337 | 338 | NSApplication 339 | 340 | IBFrameworkSource 341 | AppKit.framework/Headers/NSHelpManager.h 342 | 343 | 344 | 345 | NSApplication 346 | 347 | IBFrameworkSource 348 | AppKit.framework/Headers/NSPageLayout.h 349 | 350 | 351 | 352 | NSApplication 353 | 354 | IBFrameworkSource 355 | AppKit.framework/Headers/NSUserInterfaceItemSearching.h 356 | 357 | 358 | 359 | NSButton 360 | NSControl 361 | 362 | IBFrameworkSource 363 | AppKit.framework/Headers/NSButton.h 364 | 365 | 366 | 367 | NSButtonCell 368 | NSActionCell 369 | 370 | IBFrameworkSource 371 | AppKit.framework/Headers/NSButtonCell.h 372 | 373 | 374 | 375 | NSCell 376 | NSObject 377 | 378 | IBFrameworkSource 379 | AppKit.framework/Headers/NSCell.h 380 | 381 | 382 | 383 | NSControl 384 | NSView 385 | 386 | IBFrameworkSource 387 | AppKit.framework/Headers/NSControl.h 388 | 389 | 390 | 391 | NSFormatter 392 | NSObject 393 | 394 | IBFrameworkSource 395 | Foundation.framework/Headers/NSFormatter.h 396 | 397 | 398 | 399 | NSMenu 400 | NSObject 401 | 402 | IBFrameworkSource 403 | AppKit.framework/Headers/NSMenu.h 404 | 405 | 406 | 407 | NSObject 408 | 409 | IBFrameworkSource 410 | AppKit.framework/Headers/NSAccessibility.h 411 | 412 | 413 | 414 | NSObject 415 | 416 | 417 | 418 | NSObject 419 | 420 | 421 | 422 | NSObject 423 | 424 | 425 | 426 | NSObject 427 | 428 | 429 | 430 | NSObject 431 | 432 | IBFrameworkSource 433 | AppKit.framework/Headers/NSDictionaryController.h 434 | 435 | 436 | 437 | NSObject 438 | 439 | IBFrameworkSource 440 | AppKit.framework/Headers/NSDragging.h 441 | 442 | 443 | 444 | NSObject 445 | 446 | IBFrameworkSource 447 | AppKit.framework/Headers/NSFontManager.h 448 | 449 | 450 | 451 | NSObject 452 | 453 | IBFrameworkSource 454 | AppKit.framework/Headers/NSFontPanel.h 455 | 456 | 457 | 458 | NSObject 459 | 460 | IBFrameworkSource 461 | AppKit.framework/Headers/NSKeyValueBinding.h 462 | 463 | 464 | 465 | NSObject 466 | 467 | 468 | 469 | NSObject 470 | 471 | IBFrameworkSource 472 | AppKit.framework/Headers/NSNibLoading.h 473 | 474 | 475 | 476 | NSObject 477 | 478 | IBFrameworkSource 479 | AppKit.framework/Headers/NSOutlineView.h 480 | 481 | 482 | 483 | NSObject 484 | 485 | IBFrameworkSource 486 | AppKit.framework/Headers/NSPasteboard.h 487 | 488 | 489 | 490 | NSObject 491 | 492 | IBFrameworkSource 493 | AppKit.framework/Headers/NSSavePanel.h 494 | 495 | 496 | 497 | NSObject 498 | 499 | IBFrameworkSource 500 | AppKit.framework/Headers/NSTableView.h 501 | 502 | 503 | 504 | NSObject 505 | 506 | IBFrameworkSource 507 | AppKit.framework/Headers/NSToolbarItem.h 508 | 509 | 510 | 511 | NSObject 512 | 513 | IBFrameworkSource 514 | AppKit.framework/Headers/NSView.h 515 | 516 | 517 | 518 | NSObject 519 | 520 | IBFrameworkSource 521 | Foundation.framework/Headers/NSArchiver.h 522 | 523 | 524 | 525 | NSObject 526 | 527 | IBFrameworkSource 528 | Foundation.framework/Headers/NSClassDescription.h 529 | 530 | 531 | 532 | NSObject 533 | 534 | IBFrameworkSource 535 | Foundation.framework/Headers/NSError.h 536 | 537 | 538 | 539 | NSObject 540 | 541 | IBFrameworkSource 542 | Foundation.framework/Headers/NSFileManager.h 543 | 544 | 545 | 546 | NSObject 547 | 548 | IBFrameworkSource 549 | Foundation.framework/Headers/NSKeyValueCoding.h 550 | 551 | 552 | 553 | NSObject 554 | 555 | IBFrameworkSource 556 | Foundation.framework/Headers/NSKeyValueObserving.h 557 | 558 | 559 | 560 | NSObject 561 | 562 | IBFrameworkSource 563 | Foundation.framework/Headers/NSKeyedArchiver.h 564 | 565 | 566 | 567 | NSObject 568 | 569 | IBFrameworkSource 570 | Foundation.framework/Headers/NSObject.h 571 | 572 | 573 | 574 | NSObject 575 | 576 | IBFrameworkSource 577 | Foundation.framework/Headers/NSObjectScripting.h 578 | 579 | 580 | 581 | NSObject 582 | 583 | IBFrameworkSource 584 | Foundation.framework/Headers/NSPortCoder.h 585 | 586 | 587 | 588 | NSObject 589 | 590 | IBFrameworkSource 591 | Foundation.framework/Headers/NSRunLoop.h 592 | 593 | 594 | 595 | NSObject 596 | 597 | IBFrameworkSource 598 | Foundation.framework/Headers/NSScriptClassDescription.h 599 | 600 | 601 | 602 | NSObject 603 | 604 | IBFrameworkSource 605 | Foundation.framework/Headers/NSScriptKeyValueCoding.h 606 | 607 | 608 | 609 | NSObject 610 | 611 | IBFrameworkSource 612 | Foundation.framework/Headers/NSScriptObjectSpecifiers.h 613 | 614 | 615 | 616 | NSObject 617 | 618 | IBFrameworkSource 619 | Foundation.framework/Headers/NSScriptWhoseTests.h 620 | 621 | 622 | 623 | NSObject 624 | 625 | IBFrameworkSource 626 | Foundation.framework/Headers/NSThread.h 627 | 628 | 629 | 630 | NSObject 631 | 632 | IBFrameworkSource 633 | Foundation.framework/Headers/NSURL.h 634 | 635 | 636 | 637 | NSObject 638 | 639 | IBFrameworkSource 640 | Foundation.framework/Headers/NSURLConnection.h 641 | 642 | 643 | 644 | NSObject 645 | 646 | IBFrameworkSource 647 | Foundation.framework/Headers/NSURLDownload.h 648 | 649 | 650 | 651 | NSResponder 652 | 653 | IBFrameworkSource 654 | AppKit.framework/Headers/NSInterfaceStyle.h 655 | 656 | 657 | 658 | NSResponder 659 | NSObject 660 | 661 | IBFrameworkSource 662 | AppKit.framework/Headers/NSResponder.h 663 | 664 | 665 | 666 | NSTextField 667 | NSControl 668 | 669 | IBFrameworkSource 670 | AppKit.framework/Headers/NSTextField.h 671 | 672 | 673 | 674 | NSTextFieldCell 675 | NSActionCell 676 | 677 | IBFrameworkSource 678 | AppKit.framework/Headers/NSTextFieldCell.h 679 | 680 | 681 | 682 | NSView 683 | 684 | IBFrameworkSource 685 | AppKit.framework/Headers/NSClipView.h 686 | 687 | 688 | 689 | NSView 690 | 691 | IBFrameworkSource 692 | AppKit.framework/Headers/NSMenuItem.h 693 | 694 | 695 | 696 | NSView 697 | 698 | IBFrameworkSource 699 | AppKit.framework/Headers/NSRulerView.h 700 | 701 | 702 | 703 | NSView 704 | NSResponder 705 | 706 | 707 | 708 | NSViewController 709 | NSResponder 710 | 711 | view 712 | NSView 713 | 714 | 715 | view 716 | 717 | view 718 | NSView 719 | 720 | 721 | 722 | IBFrameworkSource 723 | AppKit.framework/Headers/NSViewController.h 724 | 725 | 726 | 727 | 728 | 0 729 | IBCocoaFramework 730 | 731 | com.apple.InterfaceBuilder.CocoaPlugin.macosx 732 | 733 | 734 | 735 | com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 736 | 737 | 738 | YES 739 | BetterViewController.xcodeproj 740 | 3 741 | 742 | 743 | -------------------------------------------------------------------------------- /Demo/BVCNextViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BVCNextViewController.h 3 | // BetterViewController 4 | // 5 | // Created by Josh Abernathy on 8/23/10. 6 | // Copyright 2010 Maybe Apps. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JAViewController.h" 11 | 12 | 13 | @interface BVCNextViewController : JAViewController { 14 | 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Demo/BVCNextViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BVCNextViewController.m 3 | // BetterViewController 4 | // 5 | // Created by Josh Abernathy on 8/23/10. 6 | // Copyright 2010 Maybe Apps. All rights reserved. 7 | // 8 | 9 | #import "BVCNextViewController.h" 10 | 11 | 12 | @implementation BVCNextViewController 13 | 14 | - (void)viewWillAppear { 15 | [super viewWillAppear]; 16 | LOG(); 17 | } 18 | 19 | - (void)viewDidAppear { 20 | [super viewDidAppear]; 21 | LOG(); 22 | } 23 | 24 | - (void)viewWillDisappear { 25 | [super viewWillDisappear]; 26 | LOG(); 27 | } 28 | 29 | - (void)viewDidDisappear { 30 | [super viewDidDisappear]; 31 | LOG(); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Demo/BVCNextViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1060 5 | 10F569 6 | 788 7 | 1038.29 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.CocoaPlugin 11 | 788 12 | 13 | 14 | YES 15 | 16 | 17 | YES 18 | com.apple.InterfaceBuilder.CocoaPlugin 19 | 20 | 21 | YES 22 | 23 | YES 24 | 25 | 26 | YES 27 | 28 | 29 | 30 | YES 31 | 32 | BVCNextViewController 33 | 34 | 35 | FirstResponder 36 | 37 | 38 | NSApplication 39 | 40 | 41 | 42 | 268 43 | 44 | YES 45 | 46 | 47 | 268 48 | {{181, 120}, {119, 32}} 49 | 50 | 51 | YES 52 | 53 | 68288064 54 | 272630784 55 | Next View 56 | 57 | Futura-Medium 58 | 24 59 | 16 60 | 61 | 62 | 63 | 6 64 | System 65 | controlColor 66 | 67 | 3 68 | MC42NjY2NjY2NjY3AA 69 | 70 | 71 | 72 | 6 73 | System 74 | controlTextColor 75 | 76 | 3 77 | MAA 78 | 79 | 80 | 81 | 82 | 83 | {480, 272} 84 | 85 | 86 | NSView 87 | 88 | 89 | 90 | 91 | YES 92 | 93 | 94 | view 95 | 96 | 97 | 98 | 4 99 | 100 | 101 | 102 | 103 | YES 104 | 105 | 0 106 | 107 | 108 | 109 | 110 | 111 | -2 112 | 113 | 114 | File's Owner 115 | 116 | 117 | -1 118 | 119 | 120 | First Responder 121 | 122 | 123 | -3 124 | 125 | 126 | Application 127 | 128 | 129 | 1 130 | 131 | 132 | YES 133 | 134 | 135 | 136 | 137 | 138 | 2 139 | 140 | 141 | YES 142 | 143 | 144 | 145 | 146 | 147 | 3 148 | 149 | 150 | 151 | 152 | 153 | 154 | YES 155 | 156 | YES 157 | 1.IBEditorWindowLastContentRect 158 | 1.IBPluginDependency 159 | 1.WindowOrigin 160 | 1.editorWindowContentRectSynchronizationRect 161 | 2.IBPluginDependency 162 | 3.IBPluginDependency 163 | 164 | 165 | YES 166 | {{322, 484}, {480, 272}} 167 | com.apple.InterfaceBuilder.CocoaPlugin 168 | {628, 654} 169 | {{217, 442}, {480, 272}} 170 | com.apple.InterfaceBuilder.CocoaPlugin 171 | com.apple.InterfaceBuilder.CocoaPlugin 172 | 173 | 174 | 175 | YES 176 | 177 | 178 | YES 179 | 180 | 181 | 182 | 183 | YES 184 | 185 | 186 | YES 187 | 188 | 189 | 190 | 4 191 | 192 | 193 | 194 | YES 195 | 196 | BVCNextViewController 197 | JAViewController 198 | 199 | IBProjectSource 200 | BVCNextViewController.h 201 | 202 | 203 | 204 | JAViewController 205 | NSViewController 206 | 207 | IBProjectSource 208 | JAKit/JAViewController.h 209 | 210 | 211 | 212 | NSControl 213 | 214 | IBProjectSource 215 | JAKit/Extensions/NSControl+JAExtensions.h 216 | 217 | 218 | 219 | NSObject 220 | 221 | IBProjectSource 222 | JAKit/Extensions/NSObject+JAExtensions.h 223 | 224 | 225 | 226 | NSView 227 | 228 | viewController 229 | NSViewController 230 | 231 | 232 | viewController 233 | 234 | viewController 235 | NSViewController 236 | 237 | 238 | 239 | IBProjectSource 240 | JAKit/Extensions/NSView+JAExtensions.h 241 | 242 | 243 | 244 | 245 | YES 246 | 247 | NSActionCell 248 | NSCell 249 | 250 | IBFrameworkSource 251 | AppKit.framework/Headers/NSActionCell.h 252 | 253 | 254 | 255 | NSApplication 256 | NSResponder 257 | 258 | IBFrameworkSource 259 | AppKit.framework/Headers/NSApplication.h 260 | 261 | 262 | 263 | NSApplication 264 | 265 | IBFrameworkSource 266 | AppKit.framework/Headers/NSApplicationScripting.h 267 | 268 | 269 | 270 | NSApplication 271 | 272 | IBFrameworkSource 273 | AppKit.framework/Headers/NSColorPanel.h 274 | 275 | 276 | 277 | NSApplication 278 | 279 | IBFrameworkSource 280 | AppKit.framework/Headers/NSHelpManager.h 281 | 282 | 283 | 284 | NSApplication 285 | 286 | IBFrameworkSource 287 | AppKit.framework/Headers/NSPageLayout.h 288 | 289 | 290 | 291 | NSApplication 292 | 293 | IBFrameworkSource 294 | AppKit.framework/Headers/NSUserInterfaceItemSearching.h 295 | 296 | 297 | 298 | NSCell 299 | NSObject 300 | 301 | IBFrameworkSource 302 | AppKit.framework/Headers/NSCell.h 303 | 304 | 305 | 306 | NSControl 307 | NSView 308 | 309 | IBFrameworkSource 310 | AppKit.framework/Headers/NSControl.h 311 | 312 | 313 | 314 | NSFormatter 315 | NSObject 316 | 317 | IBFrameworkSource 318 | Foundation.framework/Headers/NSFormatter.h 319 | 320 | 321 | 322 | NSMenu 323 | NSObject 324 | 325 | IBFrameworkSource 326 | AppKit.framework/Headers/NSMenu.h 327 | 328 | 329 | 330 | NSObject 331 | 332 | IBFrameworkSource 333 | AppKit.framework/Headers/NSAccessibility.h 334 | 335 | 336 | 337 | NSObject 338 | 339 | 340 | 341 | NSObject 342 | 343 | 344 | 345 | NSObject 346 | 347 | 348 | 349 | NSObject 350 | 351 | 352 | 353 | NSObject 354 | 355 | IBFrameworkSource 356 | AppKit.framework/Headers/NSDictionaryController.h 357 | 358 | 359 | 360 | NSObject 361 | 362 | IBFrameworkSource 363 | AppKit.framework/Headers/NSDragging.h 364 | 365 | 366 | 367 | NSObject 368 | 369 | IBFrameworkSource 370 | AppKit.framework/Headers/NSFontManager.h 371 | 372 | 373 | 374 | NSObject 375 | 376 | IBFrameworkSource 377 | AppKit.framework/Headers/NSFontPanel.h 378 | 379 | 380 | 381 | NSObject 382 | 383 | IBFrameworkSource 384 | AppKit.framework/Headers/NSKeyValueBinding.h 385 | 386 | 387 | 388 | NSObject 389 | 390 | 391 | 392 | NSObject 393 | 394 | IBFrameworkSource 395 | AppKit.framework/Headers/NSNibLoading.h 396 | 397 | 398 | 399 | NSObject 400 | 401 | IBFrameworkSource 402 | AppKit.framework/Headers/NSOutlineView.h 403 | 404 | 405 | 406 | NSObject 407 | 408 | IBFrameworkSource 409 | AppKit.framework/Headers/NSPasteboard.h 410 | 411 | 412 | 413 | NSObject 414 | 415 | IBFrameworkSource 416 | AppKit.framework/Headers/NSSavePanel.h 417 | 418 | 419 | 420 | NSObject 421 | 422 | IBFrameworkSource 423 | AppKit.framework/Headers/NSTableView.h 424 | 425 | 426 | 427 | NSObject 428 | 429 | IBFrameworkSource 430 | AppKit.framework/Headers/NSToolbarItem.h 431 | 432 | 433 | 434 | NSObject 435 | 436 | IBFrameworkSource 437 | AppKit.framework/Headers/NSView.h 438 | 439 | 440 | 441 | NSObject 442 | 443 | IBFrameworkSource 444 | Foundation.framework/Headers/NSArchiver.h 445 | 446 | 447 | 448 | NSObject 449 | 450 | IBFrameworkSource 451 | Foundation.framework/Headers/NSClassDescription.h 452 | 453 | 454 | 455 | NSObject 456 | 457 | IBFrameworkSource 458 | Foundation.framework/Headers/NSError.h 459 | 460 | 461 | 462 | NSObject 463 | 464 | IBFrameworkSource 465 | Foundation.framework/Headers/NSFileManager.h 466 | 467 | 468 | 469 | NSObject 470 | 471 | IBFrameworkSource 472 | Foundation.framework/Headers/NSKeyValueCoding.h 473 | 474 | 475 | 476 | NSObject 477 | 478 | IBFrameworkSource 479 | Foundation.framework/Headers/NSKeyValueObserving.h 480 | 481 | 482 | 483 | NSObject 484 | 485 | IBFrameworkSource 486 | Foundation.framework/Headers/NSKeyedArchiver.h 487 | 488 | 489 | 490 | NSObject 491 | 492 | IBFrameworkSource 493 | Foundation.framework/Headers/NSObject.h 494 | 495 | 496 | 497 | NSObject 498 | 499 | IBFrameworkSource 500 | Foundation.framework/Headers/NSObjectScripting.h 501 | 502 | 503 | 504 | NSObject 505 | 506 | IBFrameworkSource 507 | Foundation.framework/Headers/NSPortCoder.h 508 | 509 | 510 | 511 | NSObject 512 | 513 | IBFrameworkSource 514 | Foundation.framework/Headers/NSRunLoop.h 515 | 516 | 517 | 518 | NSObject 519 | 520 | IBFrameworkSource 521 | Foundation.framework/Headers/NSScriptClassDescription.h 522 | 523 | 524 | 525 | NSObject 526 | 527 | IBFrameworkSource 528 | Foundation.framework/Headers/NSScriptKeyValueCoding.h 529 | 530 | 531 | 532 | NSObject 533 | 534 | IBFrameworkSource 535 | Foundation.framework/Headers/NSScriptObjectSpecifiers.h 536 | 537 | 538 | 539 | NSObject 540 | 541 | IBFrameworkSource 542 | Foundation.framework/Headers/NSScriptWhoseTests.h 543 | 544 | 545 | 546 | NSObject 547 | 548 | IBFrameworkSource 549 | Foundation.framework/Headers/NSThread.h 550 | 551 | 552 | 553 | NSObject 554 | 555 | IBFrameworkSource 556 | Foundation.framework/Headers/NSURL.h 557 | 558 | 559 | 560 | NSObject 561 | 562 | IBFrameworkSource 563 | Foundation.framework/Headers/NSURLConnection.h 564 | 565 | 566 | 567 | NSObject 568 | 569 | IBFrameworkSource 570 | Foundation.framework/Headers/NSURLDownload.h 571 | 572 | 573 | 574 | NSResponder 575 | 576 | IBFrameworkSource 577 | AppKit.framework/Headers/NSInterfaceStyle.h 578 | 579 | 580 | 581 | NSResponder 582 | NSObject 583 | 584 | IBFrameworkSource 585 | AppKit.framework/Headers/NSResponder.h 586 | 587 | 588 | 589 | NSTextField 590 | NSControl 591 | 592 | IBFrameworkSource 593 | AppKit.framework/Headers/NSTextField.h 594 | 595 | 596 | 597 | NSTextFieldCell 598 | NSActionCell 599 | 600 | IBFrameworkSource 601 | AppKit.framework/Headers/NSTextFieldCell.h 602 | 603 | 604 | 605 | NSView 606 | 607 | IBFrameworkSource 608 | AppKit.framework/Headers/NSClipView.h 609 | 610 | 611 | 612 | NSView 613 | 614 | IBFrameworkSource 615 | AppKit.framework/Headers/NSMenuItem.h 616 | 617 | 618 | 619 | NSView 620 | 621 | IBFrameworkSource 622 | AppKit.framework/Headers/NSRulerView.h 623 | 624 | 625 | 626 | NSView 627 | NSResponder 628 | 629 | 630 | 631 | NSViewController 632 | NSResponder 633 | 634 | view 635 | NSView 636 | 637 | 638 | view 639 | 640 | view 641 | NSView 642 | 643 | 644 | 645 | IBFrameworkSource 646 | AppKit.framework/Headers/NSViewController.h 647 | 648 | 649 | 650 | 651 | 0 652 | IBCocoaFramework 653 | 654 | com.apple.InterfaceBuilder.CocoaPlugin.macosx 655 | 656 | 657 | 658 | com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 659 | 660 | 661 | YES 662 | BetterViewController.xcodeproj 663 | 3 664 | 665 | 666 | -------------------------------------------------------------------------------- /Demo/BetterViewController-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${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 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /Demo/BetterViewController.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; 11 | 256AC3DA0F4B6AC300CF3369 /* BetterViewControllerAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* BetterViewControllerAppDelegate.m */; }; 12 | 8833044F122251C000D32C43 /* BVCMainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8833044E122251C000D32C43 /* BVCMainViewController.m */; }; 13 | 88330453122251EF00D32C43 /* BVCMainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 88330452122251EF00D32C43 /* BVCMainViewController.xib */; }; 14 | 883304CC1222554400D32C43 /* BVCNextViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 883304CB1222554400D32C43 /* BVCNextViewController.m */; }; 15 | 883304CE1222555200D32C43 /* BVCNextViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 883304CD1222555200D32C43 /* BVCNextViewController.xib */; }; 16 | 883B43871224DC28008DBAD7 /* JAViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 883B43821224DC28008DBAD7 /* JAViewController.m */; }; 17 | 883B43881224DC28008DBAD7 /* NSObject+JAExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 883B43841224DC28008DBAD7 /* NSObject+JAExtensions.m */; }; 18 | 883B43891224DC28008DBAD7 /* NSView+JAExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 883B43861224DC28008DBAD7 /* NSView+JAExtensions.m */; }; 19 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 20 | 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 21 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXFileReference section */ 25 | 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 26 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 27 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 28 | 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; 29 | 256AC3D80F4B6AC300CF3369 /* BetterViewControllerAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BetterViewControllerAppDelegate.h; sourceTree = ""; }; 30 | 256AC3D90F4B6AC300CF3369 /* BetterViewControllerAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BetterViewControllerAppDelegate.m; sourceTree = ""; }; 31 | 256AC3F00F4B6AF500CF3369 /* BetterViewController_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BetterViewController_Prefix.pch; sourceTree = ""; }; 32 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 33 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 34 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 35 | 8833044D122251C000D32C43 /* BVCMainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BVCMainViewController.h; sourceTree = ""; }; 36 | 8833044E122251C000D32C43 /* BVCMainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BVCMainViewController.m; sourceTree = ""; }; 37 | 88330452122251EF00D32C43 /* BVCMainViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BVCMainViewController.xib; sourceTree = ""; }; 38 | 883304CA1222554400D32C43 /* BVCNextViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BVCNextViewController.h; sourceTree = ""; }; 39 | 883304CB1222554400D32C43 /* BVCNextViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BVCNextViewController.m; sourceTree = ""; }; 40 | 883304CD1222555200D32C43 /* BVCNextViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BVCNextViewController.xib; sourceTree = ""; }; 41 | 883B43811224DC28008DBAD7 /* JAViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JAViewController.h; path = ../JAViewController.h; sourceTree = SOURCE_ROOT; }; 42 | 883B43821224DC28008DBAD7 /* JAViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JAViewController.m; path = ../JAViewController.m; sourceTree = SOURCE_ROOT; }; 43 | 883B43831224DC28008DBAD7 /* NSObject+JAExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSObject+JAExtensions.h"; path = "../NSObject+JAExtensions.h"; sourceTree = SOURCE_ROOT; }; 44 | 883B43841224DC28008DBAD7 /* NSObject+JAExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSObject+JAExtensions.m"; path = "../NSObject+JAExtensions.m"; sourceTree = SOURCE_ROOT; }; 45 | 883B43851224DC28008DBAD7 /* NSView+JAExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSView+JAExtensions.h"; path = "../NSView+JAExtensions.h"; sourceTree = SOURCE_ROOT; }; 46 | 883B43861224DC28008DBAD7 /* NSView+JAExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSView+JAExtensions.m"; path = "../NSView+JAExtensions.m"; sourceTree = SOURCE_ROOT; }; 47 | 8D1107310486CEB800E47090 /* BetterViewController-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "BetterViewController-Info.plist"; sourceTree = ""; }; 48 | 8D1107320486CEB800E47090 /* BetterViewController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BetterViewController.app; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | /* End PBXFileReference section */ 50 | 51 | /* Begin PBXFrameworksBuildPhase section */ 52 | 8D11072E0486CEB800E47090 /* Frameworks */ = { 53 | isa = PBXFrameworksBuildPhase; 54 | buildActionMask = 2147483647; 55 | files = ( 56 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | /* End PBXFrameworksBuildPhase section */ 61 | 62 | /* Begin PBXGroup section */ 63 | 080E96DDFE201D6D7F000001 /* Classes */ = { 64 | isa = PBXGroup; 65 | children = ( 66 | 883304CA1222554400D32C43 /* BVCNextViewController.h */, 67 | 883304CB1222554400D32C43 /* BVCNextViewController.m */, 68 | 883304CD1222555200D32C43 /* BVCNextViewController.xib */, 69 | 8833044D122251C000D32C43 /* BVCMainViewController.h */, 70 | 8833044E122251C000D32C43 /* BVCMainViewController.m */, 71 | 88330452122251EF00D32C43 /* BVCMainViewController.xib */, 72 | 256AC3D80F4B6AC300CF3369 /* BetterViewControllerAppDelegate.h */, 73 | 256AC3D90F4B6AC300CF3369 /* BetterViewControllerAppDelegate.m */, 74 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, 75 | ); 76 | name = Classes; 77 | sourceTree = ""; 78 | }; 79 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, 83 | ); 84 | name = "Linked Frameworks"; 85 | sourceTree = ""; 86 | }; 87 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */, 91 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, 92 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 93 | ); 94 | name = "Other Frameworks"; 95 | sourceTree = ""; 96 | }; 97 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 8D1107320486CEB800E47090 /* BetterViewController.app */, 101 | ); 102 | name = Products; 103 | sourceTree = ""; 104 | }; 105 | 29B97314FDCFA39411CA2CEA /* BetterViewController */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 883B437D1224DC20008DBAD7 /* JAViewController */, 109 | 080E96DDFE201D6D7F000001 /* Classes */, 110 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 111 | 29B97317FDCFA39411CA2CEA /* Resources */, 112 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 113 | 19C28FACFE9D520D11CA2CBB /* Products */, 114 | ); 115 | name = BetterViewController; 116 | sourceTree = ""; 117 | }; 118 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 256AC3F00F4B6AF500CF3369 /* BetterViewController_Prefix.pch */, 122 | 29B97316FDCFA39411CA2CEA /* main.m */, 123 | ); 124 | name = "Other Sources"; 125 | sourceTree = ""; 126 | }; 127 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 8D1107310486CEB800E47090 /* BetterViewController-Info.plist */, 131 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 132 | ); 133 | name = Resources; 134 | sourceTree = ""; 135 | }; 136 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 140 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, 141 | ); 142 | name = Frameworks; 143 | sourceTree = ""; 144 | }; 145 | 883B437D1224DC20008DBAD7 /* JAViewController */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | 883B43811224DC28008DBAD7 /* JAViewController.h */, 149 | 883B43821224DC28008DBAD7 /* JAViewController.m */, 150 | 883B43831224DC28008DBAD7 /* NSObject+JAExtensions.h */, 151 | 883B43841224DC28008DBAD7 /* NSObject+JAExtensions.m */, 152 | 883B43851224DC28008DBAD7 /* NSView+JAExtensions.h */, 153 | 883B43861224DC28008DBAD7 /* NSView+JAExtensions.m */, 154 | ); 155 | name = JAViewController; 156 | sourceTree = ""; 157 | }; 158 | /* End PBXGroup section */ 159 | 160 | /* Begin PBXNativeTarget section */ 161 | 8D1107260486CEB800E47090 /* BetterViewController */ = { 162 | isa = PBXNativeTarget; 163 | buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "BetterViewController" */; 164 | buildPhases = ( 165 | 8D1107290486CEB800E47090 /* Resources */, 166 | 8D11072C0486CEB800E47090 /* Sources */, 167 | 8D11072E0486CEB800E47090 /* Frameworks */, 168 | ); 169 | buildRules = ( 170 | ); 171 | dependencies = ( 172 | ); 173 | name = BetterViewController; 174 | productInstallPath = "$(HOME)/Applications"; 175 | productName = BetterViewController; 176 | productReference = 8D1107320486CEB800E47090 /* BetterViewController.app */; 177 | productType = "com.apple.product-type.application"; 178 | }; 179 | /* End PBXNativeTarget section */ 180 | 181 | /* Begin PBXProject section */ 182 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 183 | isa = PBXProject; 184 | attributes = { 185 | LastUpgradeCheck = 0430; 186 | ORGANIZATIONNAME = "Maybe Apps"; 187 | }; 188 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "BetterViewController" */; 189 | compatibilityVersion = "Xcode 3.2"; 190 | developmentRegion = English; 191 | hasScannedForEncodings = 1; 192 | knownRegions = ( 193 | en, 194 | ); 195 | mainGroup = 29B97314FDCFA39411CA2CEA /* BetterViewController */; 196 | projectDirPath = ""; 197 | projectRoot = ""; 198 | targets = ( 199 | 8D1107260486CEB800E47090 /* BetterViewController */, 200 | ); 201 | }; 202 | /* End PBXProject section */ 203 | 204 | /* Begin PBXResourcesBuildPhase section */ 205 | 8D1107290486CEB800E47090 /* Resources */ = { 206 | isa = PBXResourcesBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, 210 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, 211 | 88330453122251EF00D32C43 /* BVCMainViewController.xib in Resources */, 212 | 883304CE1222555200D32C43 /* BVCNextViewController.xib in Resources */, 213 | ); 214 | runOnlyForDeploymentPostprocessing = 0; 215 | }; 216 | /* End PBXResourcesBuildPhase section */ 217 | 218 | /* Begin PBXSourcesBuildPhase section */ 219 | 8D11072C0486CEB800E47090 /* Sources */ = { 220 | isa = PBXSourcesBuildPhase; 221 | buildActionMask = 2147483647; 222 | files = ( 223 | 8D11072D0486CEB800E47090 /* main.m in Sources */, 224 | 256AC3DA0F4B6AC300CF3369 /* BetterViewControllerAppDelegate.m in Sources */, 225 | 8833044F122251C000D32C43 /* BVCMainViewController.m in Sources */, 226 | 883304CC1222554400D32C43 /* BVCNextViewController.m in Sources */, 227 | 883B43871224DC28008DBAD7 /* JAViewController.m in Sources */, 228 | 883B43881224DC28008DBAD7 /* NSObject+JAExtensions.m in Sources */, 229 | 883B43891224DC28008DBAD7 /* NSView+JAExtensions.m in Sources */, 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | }; 233 | /* End PBXSourcesBuildPhase section */ 234 | 235 | /* Begin PBXVariantGroup section */ 236 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { 237 | isa = PBXVariantGroup; 238 | children = ( 239 | 089C165DFE840E0CC02AAC07 /* English */, 240 | ); 241 | name = InfoPlist.strings; 242 | sourceTree = ""; 243 | }; 244 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = { 245 | isa = PBXVariantGroup; 246 | children = ( 247 | 1DDD58150DA1D0A300B32029 /* English */, 248 | ); 249 | name = MainMenu.xib; 250 | sourceTree = ""; 251 | }; 252 | /* End PBXVariantGroup section */ 253 | 254 | /* Begin XCBuildConfiguration section */ 255 | C01FCF4B08A954540054247B /* Debug */ = { 256 | isa = XCBuildConfiguration; 257 | buildSettings = { 258 | ALWAYS_SEARCH_USER_PATHS = NO; 259 | COPY_PHASE_STRIP = NO; 260 | GCC_DYNAMIC_NO_PIC = NO; 261 | GCC_MODEL_TUNING = G5; 262 | GCC_OPTIMIZATION_LEVEL = 0; 263 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 264 | GCC_PREFIX_HEADER = BetterViewController_Prefix.pch; 265 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 266 | INFOPLIST_FILE = "BetterViewController-Info.plist"; 267 | INSTALL_PATH = "$(HOME)/Applications"; 268 | PRODUCT_NAME = BetterViewController; 269 | }; 270 | name = Debug; 271 | }; 272 | C01FCF4C08A954540054247B /* Release */ = { 273 | isa = XCBuildConfiguration; 274 | buildSettings = { 275 | ALWAYS_SEARCH_USER_PATHS = NO; 276 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 277 | GCC_MODEL_TUNING = G5; 278 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 279 | GCC_PREFIX_HEADER = BetterViewController_Prefix.pch; 280 | INFOPLIST_FILE = "BetterViewController-Info.plist"; 281 | INSTALL_PATH = "$(HOME)/Applications"; 282 | PRODUCT_NAME = BetterViewController; 283 | }; 284 | name = Release; 285 | }; 286 | C01FCF4F08A954540054247B /* Debug */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 290 | GCC_C_LANGUAGE_STANDARD = gnu99; 291 | GCC_ENABLE_OBJC_GC = required; 292 | GCC_OPTIMIZATION_LEVEL = 0; 293 | GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; 294 | GCC_TREAT_WARNINGS_AS_ERRORS = YES; 295 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 296 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 297 | GCC_WARN_ABOUT_MISSING_NEWLINE = YES; 298 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 299 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 300 | GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; 301 | GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; 302 | GCC_WARN_MISSING_PARENTHESES = YES; 303 | GCC_WARN_PROTOTYPE_CONVERSION = YES; 304 | GCC_WARN_SHADOW = YES; 305 | GCC_WARN_SIGN_COMPARE = YES; 306 | GCC_WARN_STRICT_SELECTOR_MATCH = YES; 307 | GCC_WARN_UNDECLARED_SELECTOR = YES; 308 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 309 | GCC_WARN_UNUSED_PARAMETER = NO; 310 | GCC_WARN_UNUSED_VALUE = YES; 311 | GCC_WARN_UNUSED_VARIABLE = YES; 312 | ONLY_ACTIVE_ARCH = YES; 313 | SDKROOT = macosx; 314 | WARNING_CFLAGS = ( 315 | "-Wall", 316 | "-Werror", 317 | ); 318 | }; 319 | name = Debug; 320 | }; 321 | C01FCF5008A954540054247B /* Release */ = { 322 | isa = XCBuildConfiguration; 323 | buildSettings = { 324 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 325 | GCC_C_LANGUAGE_STANDARD = gnu99; 326 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 327 | GCC_WARN_UNUSED_VARIABLE = YES; 328 | SDKROOT = macosx; 329 | }; 330 | name = Release; 331 | }; 332 | /* End XCBuildConfiguration section */ 333 | 334 | /* Begin XCConfigurationList section */ 335 | C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "BetterViewController" */ = { 336 | isa = XCConfigurationList; 337 | buildConfigurations = ( 338 | C01FCF4B08A954540054247B /* Debug */, 339 | C01FCF4C08A954540054247B /* Release */, 340 | ); 341 | defaultConfigurationIsVisible = 0; 342 | defaultConfigurationName = Release; 343 | }; 344 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "BetterViewController" */ = { 345 | isa = XCConfigurationList; 346 | buildConfigurations = ( 347 | C01FCF4F08A954540054247B /* Debug */, 348 | C01FCF5008A954540054247B /* Release */, 349 | ); 350 | defaultConfigurationIsVisible = 0; 351 | defaultConfigurationName = Release; 352 | }; 353 | /* End XCConfigurationList section */ 354 | }; 355 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 356 | } 357 | -------------------------------------------------------------------------------- /Demo/BetterViewController.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo/BetterViewControllerAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BetterViewControllerAppDelegate.h 3 | // BetterViewController 4 | // 5 | // Created by Josh Abernathy on 8/22/10. 6 | // Copyright 2010 Maybe Apps. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BVCMainViewController; 12 | 13 | 14 | @interface BetterViewControllerAppDelegate : NSObject { 15 | NSWindow *window; 16 | BVCMainViewController *mainViewController; 17 | } 18 | 19 | @property (nonatomic, retain) IBOutlet NSWindow *window; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Demo/BetterViewControllerAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // BetterViewControllerAppDelegate.m 3 | // BetterViewController 4 | // 5 | // Created by Josh Abernathy on 8/22/10. 6 | // Copyright 2010 Maybe Apps. All rights reserved. 7 | // 8 | 9 | #import "BetterViewControllerAppDelegate.h" 10 | #import "BVCMainViewController.h" 11 | 12 | @interface BetterViewControllerAppDelegate () 13 | @property (nonatomic, retain) BVCMainViewController *mainViewController; 14 | @end 15 | 16 | 17 | @implementation BetterViewControllerAppDelegate 18 | 19 | - (void)applicationWillFinishLaunching:(NSNotification *)notification { 20 | LOG(); 21 | self.mainViewController = [BVCMainViewController viewController]; 22 | [self.window.contentView addSubview:self.mainViewController.view]; 23 | self.mainViewController.view.frame = [self.window.contentView bounds]; 24 | LOG(); 25 | } 26 | 27 | - (void)applicationDidFinishLaunching:(NSNotification *)notification { 28 | LOG(); 29 | [self.window makeKeyAndOrderFront:nil]; 30 | LOG(); 31 | } 32 | 33 | @synthesize window; 34 | @synthesize mainViewController; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Demo/BetterViewController_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'BetterViewController' target in the 'BetterViewController' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | 9 | #define LOG() NSLog(@"<%p> %@ // %d", self, NSStringFromSelector(_cmd), __LINE__); 10 | -------------------------------------------------------------------------------- /Demo/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // BetterViewController 4 | // 5 | // Created by Josh Abernathy on 8/22/10. 6 | // Copyright 2010 Maybe Apps. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /JAViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JAViewController.h 3 | // 4 | // Created by Josh Abernathy on 8/17/10. 5 | // Copyright (c) 2010 Maybe Apps. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | 11 | @interface JAViewController : NSViewController { 12 | 13 | } 14 | 15 | + (id)viewController; 16 | 17 | - (void)viewDidLoad; 18 | 19 | // Called when the view has a superview and window. This does not necessarily mean the view is visible. 20 | - (void)viewWillAppear; 21 | - (void)viewDidAppear; 22 | 23 | // Called when the view no longer has a superview or no longer has a window. 24 | - (void)viewWillDisappear; 25 | - (void)viewDidDisappear; 26 | 27 | - (void)viewWillMoveToSuperview:(NSView *)newSuperview; 28 | - (void)viewDidMoveToSuperview; 29 | - (void)viewWillBeRemovedFromSuperview; 30 | - (void)viewWasRemovedFromSuperview; 31 | 32 | - (void)viewWillMoveToWindow:(NSWindow *)newWindow; 33 | - (void)viewDidMoveToWindow; 34 | - (void)viewWillBeRemovedFromWindow; 35 | - (void)viewWasRemovedFromWindow; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /JAViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // JAViewController.m 3 | // 4 | // Created by Josh Abernathy on 8/17/10. 5 | // Copyright (c) 2010 Maybe Apps. All rights reserved. 6 | // 7 | 8 | #import "JAViewController.h" 9 | #import "NSView+JAExtensions.h" 10 | 11 | 12 | @implementation JAViewController 13 | 14 | + (id)viewController { 15 | return [[[self alloc] initWithNibName:NSStringFromClass([self class]) bundle:nil] autorelease]; 16 | } 17 | 18 | - (void)loadView { 19 | [super loadView]; 20 | 21 | [self viewDidLoad]; 22 | } 23 | 24 | - (void)setView:(NSView *)view { 25 | [super setView:view]; 26 | 27 | self.view.viewController = self; 28 | } 29 | 30 | - (void)viewDidLoad { 31 | 32 | } 33 | 34 | - (void)viewWillAppear { 35 | [self.view setNeedsLayout]; 36 | } 37 | 38 | - (void)viewDidAppear { 39 | 40 | } 41 | 42 | - (void)viewWillDisappear { 43 | 44 | } 45 | 46 | - (void)viewDidDisappear { 47 | 48 | } 49 | 50 | - (void)viewWillMoveToSuperview:(NSView *)newSuperview { 51 | 52 | } 53 | 54 | - (void)viewDidMoveToSuperview { 55 | 56 | } 57 | 58 | - (void)viewWillBeRemovedFromSuperview { 59 | 60 | } 61 | 62 | - (void)viewWasRemovedFromSuperview { 63 | 64 | } 65 | 66 | - (void)viewWillMoveToWindow:(NSWindow *)newWindow { 67 | 68 | } 69 | 70 | - (void)viewDidMoveToWindow { 71 | 72 | } 73 | 74 | - (void)viewWillBeRemovedFromWindow { 75 | 76 | } 77 | 78 | - (void)viewWasRemovedFromWindow { 79 | 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /NSObject+JAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+JAExtensions.h 3 | // 4 | // Created by Josh Abernathy on 8/18/10. 5 | // Copyright (c) 2010 Maybe Apps. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | 11 | @interface NSObject (JAExtensions) 12 | + (void)swapMethod:(SEL)originalSelector with:(SEL)newSelector; 13 | @end 14 | -------------------------------------------------------------------------------- /NSObject+JAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+JAExtensions.m 3 | // 4 | // Created by Josh Abernathy on 8/18/10. 5 | // Copyright (c) 2010 Maybe Apps. All rights reserved. 6 | // 7 | 8 | #import "NSObject+JAExtensions.h" 9 | #import 10 | 11 | 12 | @implementation NSObject (JAExtensions) 13 | 14 | + (void)swapMethod:(SEL)originalSelector with:(SEL)newSelector { 15 | Method originalMethod = class_getInstanceMethod(self, originalSelector); 16 | Method newMethod = class_getInstanceMethod(self, newSelector); 17 | const char *originalTypeEncoding = method_getTypeEncoding(originalMethod); 18 | const char *newTypeEncoding = method_getTypeEncoding(newMethod); 19 | NSAssert2(!strcmp(originalTypeEncoding, newTypeEncoding), @"Method type encodings must be the same: %s vs. %s", originalTypeEncoding, newTypeEncoding); 20 | 21 | if(class_addMethod(self, originalSelector, method_getImplementation(newMethod), newTypeEncoding)) { 22 | class_replaceMethod(self, newSelector, method_getImplementation(originalMethod), originalTypeEncoding); 23 | } else { 24 | method_exchangeImplementations(originalMethod, newMethod); 25 | } 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /NSView+JAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSView+JAExtensions.h 3 | // 4 | // Created by Josh Abernathy on 8/18/10. 5 | // Copyright (c) 2010 Maybe Apps. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | 11 | @interface NSView (JAExtensions) 12 | - (void)layoutSubviews; 13 | - (void)layoutIfNeeded; 14 | - (void)setNeedsLayout; 15 | 16 | @property (nonatomic, assign) IBOutlet NSViewController *viewController; 17 | @end 18 | -------------------------------------------------------------------------------- /NSView+JAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSView+JAExtensions.m 3 | // 4 | // Created by Josh Abernathy on 8/18/10. 5 | // Copyright (c) 2010 Maybe Apps. All rights reserved. 6 | // 7 | 8 | #import "NSView+JAExtensions.h" 9 | #import "NSObject+JAExtensions.h" 10 | #import "JAViewController.h" 11 | #import 12 | 13 | static NSString * const JAViewExtensionsViewControllerKey = @"JAViewExtensionsViewControllerKey"; 14 | static NSString * const JAViewExtensionsNeedsLayoutKey = @"JAViewExtensionsNeedsLayoutKey"; 15 | 16 | static BOOL hasSwizzledViewControllerMethods = NO; 17 | 18 | 19 | @implementation NSView (JAExtensions) 20 | 21 | + (void)initialize { 22 | if(self == [NSView class]) { 23 | [self loadSupportForLayoutSubviews]; 24 | } 25 | } 26 | 27 | 28 | #pragma mark UIView -layoutSubviews support 29 | 30 | + (void)loadSupportForLayoutSubviews { 31 | [self swapMethod:@selector(setBounds:) with:@selector(custom_setBounds:)]; 32 | [self swapMethod:@selector(setFrame:) with:@selector(custom_setFrame:)]; 33 | [self swapMethod:@selector(viewWillDraw) with:@selector(custom_viewWillDraw)]; 34 | } 35 | 36 | - (void)custom_setBounds:(NSRect)newBounds { 37 | [self custom_setBounds:newBounds]; 38 | 39 | [self setNeedsLayout]; 40 | } 41 | 42 | - (void)custom_setFrame:(NSRect)newFrame { 43 | [self custom_setFrame:newFrame]; 44 | 45 | [self setNeedsLayout]; 46 | } 47 | 48 | - (void)custom_viewWillDraw { 49 | [self layoutIfNeeded]; 50 | 51 | [self custom_viewWillDraw]; 52 | } 53 | 54 | - (void)layoutIfNeeded { 55 | if([self needsLayout]) { 56 | [self layoutSubviews]; 57 | } 58 | } 59 | 60 | - (void)layoutSubviews { 61 | objc_setAssociatedObject(self, JAViewExtensionsNeedsLayoutKey, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 62 | } 63 | 64 | - (void)setNeedsLayout { 65 | objc_setAssociatedObject(self, JAViewExtensionsNeedsLayoutKey, [NSNull null], OBJC_ASSOCIATION_RETAIN_NONATOMIC); 66 | 67 | [self setNeedsDisplay:YES]; 68 | } 69 | 70 | - (BOOL)needsLayout { 71 | return objc_getAssociatedObject(self, JAViewExtensionsNeedsLayoutKey) != nil; 72 | } 73 | 74 | 75 | #pragma mark NSViewController support 76 | 77 | + (void)loadSupportForViewControllers { 78 | @synchronized(self) { 79 | if(hasSwizzledViewControllerMethods) return; 80 | 81 | [self swapMethod:@selector(viewWillMoveToSuperview:) with:@selector(custom_viewWillMoveToSuperview:)]; 82 | [self swapMethod:@selector(viewDidMoveToSuperview) with:@selector(custom_viewDidMoveToSuperview)]; 83 | 84 | [self swapMethod:@selector(viewWillMoveToWindow:) with:@selector(custom_viewWillMoveToWindow:)]; 85 | [self swapMethod:@selector(viewDidMoveToWindow) with:@selector(custom_viewDidMoveToWindow)]; 86 | 87 | [self swapMethod:@selector(setNextResponder:) with:@selector(custom_setNextResponder:)]; 88 | 89 | hasSwizzledViewControllerMethods = YES; 90 | } 91 | } 92 | 93 | - (void)setViewController:(NSViewController *)newViewController { 94 | // swizzle methods only after we make use of the viewController property 95 | [[self class] loadSupportForViewControllers]; 96 | 97 | if(self.viewController != nil) { 98 | NSResponder *controllerNextResponder = [self.viewController nextResponder]; 99 | [self custom_setNextResponder:controllerNextResponder]; 100 | [self.viewController setNextResponder:nil]; 101 | } 102 | 103 | objc_setAssociatedObject(self, JAViewExtensionsViewControllerKey, newViewController, OBJC_ASSOCIATION_ASSIGN); 104 | 105 | if(newViewController != nil) { 106 | NSResponder *ownNextResponder = [self nextResponder]; 107 | [self custom_setNextResponder:self.viewController]; 108 | [self.viewController setNextResponder:ownNextResponder]; 109 | } 110 | } 111 | 112 | - (NSViewController *)viewController { 113 | return objc_getAssociatedObject(self, JAViewExtensionsViewControllerKey); 114 | } 115 | 116 | - (void)custom_viewWillMoveToSuperview:(NSView *)newSuperview { 117 | [self custom_viewWillMoveToSuperview:newSuperview]; 118 | 119 | if([self.viewController isKindOfClass:[JAViewController class]]) { 120 | if(newSuperview == nil) { 121 | [(JAViewController *) self.viewController viewWillBeRemovedFromSuperview]; 122 | 123 | if(self.superview != nil && self.window != nil) { 124 | [(JAViewController *) self.viewController viewWillDisappear]; 125 | } 126 | } else { 127 | [(JAViewController *) self.viewController viewWillMoveToSuperview:newSuperview]; 128 | 129 | if(self.window != nil) { 130 | [(JAViewController *) self.viewController viewWillAppear]; 131 | } 132 | } 133 | } 134 | } 135 | 136 | - (void)custom_viewDidMoveToSuperview { 137 | [self custom_viewDidMoveToSuperview]; 138 | 139 | if([self.viewController isKindOfClass:[JAViewController class]]) { 140 | if(self.superview == nil) { 141 | [(JAViewController *) self.viewController viewWasRemovedFromSuperview]; 142 | 143 | if(self.window == nil) { 144 | [(JAViewController *) self.viewController viewDidDisappear]; 145 | } 146 | } else { 147 | [(JAViewController *) self.viewController viewDidMoveToSuperview]; 148 | 149 | if(self.window != nil) { 150 | [(JAViewController *) self.viewController viewDidAppear]; 151 | } 152 | } 153 | } 154 | } 155 | 156 | - (void)custom_viewWillMoveToWindow:(NSWindow *)newWindow { 157 | [self custom_viewWillMoveToWindow:newWindow]; 158 | 159 | if([self.viewController isKindOfClass:[JAViewController class]]) { 160 | if(newWindow == nil) { 161 | [(JAViewController *) self.viewController viewWillBeRemovedFromWindow]; 162 | 163 | if(self.superview != nil && self.window != nil) { 164 | [(JAViewController *) self.viewController viewWillDisappear]; 165 | } 166 | } else { 167 | [(JAViewController *) self.viewController viewWillMoveToWindow:newWindow]; 168 | 169 | if(self.superview != nil) { 170 | [(JAViewController *) self.viewController viewWillAppear]; 171 | } 172 | } 173 | } 174 | } 175 | 176 | - (void)custom_viewDidMoveToWindow { 177 | [self custom_viewDidMoveToWindow]; 178 | 179 | if([self.viewController isKindOfClass:[JAViewController class]]) { 180 | if(self.window == nil) { 181 | [(JAViewController *) self.viewController viewWasRemovedFromWindow]; 182 | 183 | if(self.superview == nil) { 184 | [(JAViewController *) self.viewController viewDidDisappear]; 185 | } 186 | } else { 187 | [(JAViewController *) self.viewController viewDidMoveToWindow]; 188 | 189 | if(self.superview != nil) { 190 | [(JAViewController *) self.viewController viewDidAppear]; 191 | } 192 | } 193 | } 194 | } 195 | 196 | - (void)custom_setNextResponder:(NSResponder *)newNextResponder { 197 | if(self.viewController != nil) { 198 | [self.viewController setNextResponder:newNextResponder]; 199 | return; 200 | } 201 | 202 | [self custom_setNextResponder:newNextResponder]; 203 | } 204 | 205 | @end 206 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------------------------------------------------