├── .gitignore ├── Chapter-1 └── Quiz │ ├── Quiz.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── Quiz │ ├── BNRAppDelegate.h │ ├── BNRAppDelegate.m │ ├── BNRQuizViewController.h │ ├── BNRQuizViewController.m │ ├── BNRQuizViewController.xib │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ └── Icon@2x.png │ │ └── LaunchImage.launchimage │ │ │ ├── Contents.json │ │ │ ├── Default-568h@2x.png │ │ │ └── Default@2x.png │ ├── Quiz-Info.plist │ ├── Quiz-Prefix.pch │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m │ └── QuizTests │ ├── QuizTests-Info.plist │ ├── QuizTests.m │ └── en.lproj │ └── InfoPlist.strings ├── Chapter-10 ├── Homepwner-Bronze │ ├── Homepwner.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── Homepwner │ │ ├── BNRAppDelegate.h │ │ ├── BNRAppDelegate.m │ │ ├── BNRDetailViewController.h │ │ ├── BNRDetailViewController.m │ │ ├── BNRDetailViewController.xib │ │ ├── BNRItem.h │ │ ├── BNRItem.m │ │ ├── BNRItemStore.h │ │ ├── BNRItemStore.m │ │ ├── BNRItemsViewController.h │ │ ├── BNRItemsViewController.m │ │ ├── Homepwner-Info.plist │ │ ├── Homepwner-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ └── HomepwnerTests │ │ ├── HomepwnerTests-Info.plist │ │ ├── HomepwnerTests.m │ │ └── en.lproj │ │ └── InfoPlist.strings ├── Homepwner-Gold │ ├── Homepwner.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── Homepwner │ │ ├── BNRAppDelegate.h │ │ ├── BNRAppDelegate.m │ │ ├── BNRDateViewController.h │ │ ├── BNRDateViewController.m │ │ ├── BNRDateViewController.xib │ │ ├── BNRDetailViewController.h │ │ ├── BNRDetailViewController.m │ │ ├── BNRDetailViewController.xib │ │ ├── BNRItem.h │ │ ├── BNRItem.m │ │ ├── BNRItemStore.h │ │ ├── BNRItemStore.m │ │ ├── BNRItemsViewController.h │ │ ├── BNRItemsViewController.m │ │ ├── Homepwner-Info.plist │ │ ├── Homepwner-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ └── HomepwnerTests │ │ ├── HomepwnerTests-Info.plist │ │ ├── HomepwnerTests.m │ │ └── en.lproj │ │ └── InfoPlist.strings ├── Homepwner-Silver │ ├── Homepwner.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── Homepwner │ │ ├── BNRAppDelegate.h │ │ ├── BNRAppDelegate.m │ │ ├── BNRDetailViewController.h │ │ ├── BNRDetailViewController.m │ │ ├── BNRDetailViewController.xib │ │ ├── BNRItem.h │ │ ├── BNRItem.m │ │ ├── BNRItemStore.h │ │ ├── BNRItemStore.m │ │ ├── BNRItemsViewController.h │ │ ├── BNRItemsViewController.m │ │ ├── Homepwner-Info.plist │ │ ├── Homepwner-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ └── HomepwnerTests │ │ ├── HomepwnerTests-Info.plist │ │ ├── HomepwnerTests.m │ │ └── en.lproj │ │ └── InfoPlist.strings └── Homepwner │ ├── Homepwner.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── Homepwner │ ├── BNRAppDelegate.h │ ├── BNRAppDelegate.m │ ├── BNRDetailViewController.h │ ├── BNRDetailViewController.m │ ├── BNRDetailViewController.xib │ ├── BNRItem.h │ ├── BNRItem.m │ ├── BNRItemStore.h │ ├── BNRItemStore.m │ ├── BNRItemsViewController.h │ ├── BNRItemsViewController.m │ ├── Homepwner-Info.plist │ ├── Homepwner-Prefix.pch │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m │ └── HomepwnerTests │ ├── HomepwnerTests-Info.plist │ ├── HomepwnerTests.m │ └── en.lproj │ └── InfoPlist.strings ├── Chapter-2 ├── RandomItems-Bronze │ ├── RandomItems.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── RandomItems │ │ ├── BNRItem.h │ │ ├── BNRItem.m │ │ ├── RandomItems-Prefix.pch │ │ ├── RandomItems.1 │ │ └── main.m ├── RandomItems-Gold │ ├── RandomItems.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── RandomItems │ │ ├── BNRContainer.h │ │ ├── BNRContainer.m │ │ ├── BNRItem.h │ │ ├── BNRItem.m │ │ ├── RandomItems-Prefix.pch │ │ ├── RandomItems.1 │ │ └── main.m ├── RandomItems-Silver │ ├── RandomItems.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── RandomItems │ │ ├── BNRItem.h │ │ ├── BNRItem.m │ │ ├── RandomItems-Prefix.pch │ │ ├── RandomItems.1 │ │ └── main.m └── RandomItems │ ├── RandomItems.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── RandomItems │ ├── BNRItem.h │ ├── BNRItem.m │ ├── RandomItems-Prefix.pch │ ├── RandomItems.1 │ └── main.m ├── Chapter-3 └── RandomItems │ ├── RandomItems.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── RandomItems │ ├── BNRItem.h │ ├── BNRItem.m │ ├── RandomItems-Prefix.pch │ ├── RandomItems.1 │ └── main.m ├── Chapter-4 ├── Hypnosister-Bronze │ ├── Hypnosister.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── Hypnosister │ │ ├── BNRAppDelegate.h │ │ ├── BNRAppDelegate.m │ │ ├── BNRHypnosisView.h │ │ ├── BNRHypnosisView.m │ │ ├── Hypnosister-Info.plist │ │ ├── Hypnosister-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ ├── HypnosisterTests │ │ ├── HypnosisterTests-Info.plist │ │ ├── HypnosisterTests.m │ │ └── en.lproj │ │ │ └── InfoPlist.strings │ └── logo.png ├── Hypnosister-Gold │ ├── Hypnosister.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── Hypnosister │ │ ├── BNRAppDelegate.h │ │ ├── BNRAppDelegate.m │ │ ├── BNRHypnosisView.h │ │ ├── BNRHypnosisView.m │ │ ├── Hypnosister-Info.plist │ │ ├── Hypnosister-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ ├── HypnosisterTests │ │ ├── HypnosisterTests-Info.plist │ │ ├── HypnosisterTests.m │ │ └── en.lproj │ │ │ └── InfoPlist.strings │ └── logo.png └── Hypnosister │ ├── Hypnosister.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── Hypnosister │ ├── BNRAppDelegate.h │ ├── BNRAppDelegate.m │ ├── BNRHypnosisView.h │ ├── BNRHypnosisView.m │ ├── Hypnosister-Info.plist │ ├── Hypnosister-Prefix.pch │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m │ └── HypnosisterTests │ ├── HypnosisterTests-Info.plist │ ├── HypnosisterTests.m │ └── en.lproj │ └── InfoPlist.strings ├── Chapter-5 └── Hypnosister │ ├── Hypnosister.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── Hypnosister │ ├── BNRAppDelegate.h │ ├── BNRAppDelegate.m │ ├── BNRHypnosisView.h │ ├── BNRHypnosisView.m │ ├── Hypnosister-Info.plist │ ├── Hypnosister-Prefix.pch │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m │ └── HypnosisterTests │ ├── HypnosisterTests-Info.plist │ ├── HypnosisterTests.m │ └── en.lproj │ └── InfoPlist.strings ├── Chapter-6 ├── HypnoNerd-Bronze │ ├── HypnoNerd.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── HypnoNerd │ │ ├── BNRAppDelegate.h │ │ ├── BNRAppDelegate.m │ │ ├── BNRHypnosisView.h │ │ ├── BNRHypnosisView.m │ │ ├── BNRHypnosisViewController.h │ │ ├── BNRHypnosisViewController.m │ │ ├── BNRQuizViewController.h │ │ ├── BNRQuizViewController.m │ │ ├── BNRQuizViewController.xib │ │ ├── BNRReminderViewController.h │ │ ├── BNRReminderViewController.m │ │ ├── BNRReminderViewController.xib │ │ ├── HypnoNerd-Info.plist │ │ ├── HypnoNerd-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ ├── Hypno.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── Hypno.png │ │ │ │ └── Hypno@2x.png │ │ │ ├── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ │ └── Time.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── Time.png │ │ │ │ └── Time@2x.png │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ └── HypnoNerdTests │ │ ├── HypnoNerdTests-Info.plist │ │ ├── HypnoNerdTests.m │ │ └── en.lproj │ │ └── InfoPlist.strings ├── HypnoNerd-Silver │ ├── HypnoNerd.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── HypnoNerd │ │ ├── BNRAppDelegate.h │ │ ├── BNRAppDelegate.m │ │ ├── BNRHypnosisView.h │ │ ├── BNRHypnosisView.m │ │ ├── BNRHypnosisViewController.h │ │ ├── BNRHypnosisViewController.m │ │ ├── BNRHypnosisViewController.xib │ │ ├── BNRReminderViewController.h │ │ ├── BNRReminderViewController.m │ │ ├── BNRReminderViewController.xib │ │ ├── HypnoNerd-Info.plist │ │ ├── HypnoNerd-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ ├── Hypno.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── Hypno.png │ │ │ │ └── Hypno@2x.png │ │ │ ├── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ │ └── Time.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── Time.png │ │ │ │ └── Time@2x.png │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ └── HypnoNerdTests │ │ ├── HypnoNerdTests-Info.plist │ │ ├── HypnoNerdTests.m │ │ └── en.lproj │ │ └── InfoPlist.strings └── HypnoNerd │ ├── HypnoNerd.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── HypnoNerd │ ├── BNRAppDelegate.h │ ├── BNRAppDelegate.m │ ├── BNRHypnosisView.h │ ├── BNRHypnosisView.m │ ├── BNRHypnosisViewController.h │ ├── BNRHypnosisViewController.m │ ├── BNRReminderViewController.h │ ├── BNRReminderViewController.m │ ├── BNRReminderViewController.xib │ ├── HypnoNerd-Info.plist │ ├── HypnoNerd-Prefix.pch │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Hypno.imageset │ │ │ ├── Contents.json │ │ │ ├── Hypno.png │ │ │ └── Hypno@2x.png │ │ ├── LaunchImage.launchimage │ │ │ └── Contents.json │ │ └── Time.imageset │ │ │ ├── Contents.json │ │ │ ├── Time.png │ │ │ └── Time@2x.png │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m │ └── HypnoNerdTests │ ├── HypnoNerdTests-Info.plist │ ├── HypnoNerdTests.m │ └── en.lproj │ └── InfoPlist.strings ├── Chapter-7 ├── HypnoNerd │ ├── HypnoNerd.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── HypnoNerd │ │ ├── BNRAppDelegate.h │ │ ├── BNRAppDelegate.m │ │ ├── BNRHypnosisView.h │ │ ├── BNRHypnosisView.m │ │ ├── BNRHypnosisViewController.h │ │ ├── BNRHypnosisViewController.m │ │ ├── BNRReminderViewController.h │ │ ├── BNRReminderViewController.m │ │ ├── BNRReminderViewController.xib │ │ ├── HypnoNerd-Info.plist │ │ ├── HypnoNerd-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ ├── Hypno.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── Hypno.png │ │ │ │ └── Hypno@2x.png │ │ │ ├── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ │ └── Time.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── Time.png │ │ │ │ └── Time@2x.png │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ └── HypnoNerdTests │ │ ├── HypnoNerdTests-Info.plist │ │ ├── HypnoNerdTests.m │ │ └── en.lproj │ │ └── InfoPlist.strings └── Hypnosister-Silver │ ├── Hypnosister.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── Hypnosister │ ├── BNRAppDelegate.h │ ├── BNRAppDelegate.m │ ├── BNRHypnosisView.h │ ├── BNRHypnosisView.m │ ├── Hypnosister-Info.plist │ ├── Hypnosister-Prefix.pch │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m │ └── HypnosisterTests │ ├── HypnosisterTests-Info.plist │ ├── HypnosisterTests.m │ └── en.lproj │ └── InfoPlist.strings ├── Chapter-8 ├── Homepwner-Bronze │ ├── Homepwner.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── Homepwner │ │ ├── BNRAppDelegate.h │ │ ├── BNRAppDelegate.m │ │ ├── BNRItem.h │ │ ├── BNRItem.m │ │ ├── BNRItemStore.h │ │ ├── BNRItemStore.m │ │ ├── BNRItemsViewController.h │ │ ├── BNRItemsViewController.m │ │ ├── Homepwner-Info.plist │ │ ├── Homepwner-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ └── HomepwnerTests │ │ ├── HomepwnerTests-Info.plist │ │ ├── HomepwnerTests.m │ │ └── en.lproj │ │ └── InfoPlist.strings ├── Homepwner-Gold │ ├── Homepwner.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── Homepwner │ │ ├── BNRAppDelegate.h │ │ ├── BNRAppDelegate.m │ │ ├── BNRItem.h │ │ ├── BNRItem.m │ │ ├── BNRItemStore.h │ │ ├── BNRItemStore.m │ │ ├── BNRItemsViewController.h │ │ ├── BNRItemsViewController.m │ │ ├── Homepwner-Info.plist │ │ ├── Homepwner-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ ├── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ │ └── background.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── background.png │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ └── HomepwnerTests │ │ ├── HomepwnerTests-Info.plist │ │ ├── HomepwnerTests.m │ │ └── en.lproj │ │ └── InfoPlist.strings ├── Homepwner-Silver │ ├── Homepwner.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── Homepwner │ │ ├── BNRAppDelegate.h │ │ ├── BNRAppDelegate.m │ │ ├── BNRItem.h │ │ ├── BNRItem.m │ │ ├── BNRItemStore.h │ │ ├── BNRItemStore.m │ │ ├── BNRItemsViewController.h │ │ ├── BNRItemsViewController.m │ │ ├── Homepwner-Info.plist │ │ ├── Homepwner-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ └── HomepwnerTests │ │ ├── HomepwnerTests-Info.plist │ │ ├── HomepwnerTests.m │ │ └── en.lproj │ │ └── InfoPlist.strings └── Homepwner │ ├── Homepwner.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── Homepwner │ ├── BNRAppDelegate.h │ ├── BNRAppDelegate.m │ ├── BNRItem.h │ ├── BNRItem.m │ ├── BNRItemStore.h │ ├── BNRItemStore.m │ ├── BNRItemsViewController.h │ ├── BNRItemsViewController.m │ ├── Homepwner-Info.plist │ ├── Homepwner-Prefix.pch │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m │ └── HomepwnerTests │ ├── HomepwnerTests-Info.plist │ ├── HomepwnerTests.m │ └── en.lproj │ └── InfoPlist.strings ├── Chapter-9 ├── Homepwner-Bronze │ ├── Homepwner.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── Homepwner │ │ ├── BNRAppDelegate.h │ │ ├── BNRAppDelegate.m │ │ ├── BNRItem.h │ │ ├── BNRItem.m │ │ ├── BNRItemStore.h │ │ ├── BNRItemStore.m │ │ ├── BNRItemsViewController.h │ │ ├── BNRItemsViewController.m │ │ ├── HeaderView.xib │ │ ├── Homepwner-Info.plist │ │ ├── Homepwner-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ └── HomepwnerTests │ │ ├── HomepwnerTests-Info.plist │ │ ├── HomepwnerTests.m │ │ └── en.lproj │ │ └── InfoPlist.strings ├── Homepwner-Gold │ ├── Homepwner.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── Homepwner │ │ ├── BNRAppDelegate.h │ │ ├── BNRAppDelegate.m │ │ ├── BNRItem.h │ │ ├── BNRItem.m │ │ ├── BNRItemStore.h │ │ ├── BNRItemStore.m │ │ ├── BNRItemsViewController.h │ │ ├── BNRItemsViewController.m │ │ ├── HeaderView.xib │ │ ├── Homepwner-Info.plist │ │ ├── Homepwner-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ └── HomepwnerTests │ │ ├── HomepwnerTests-Info.plist │ │ ├── HomepwnerTests.m │ │ └── en.lproj │ │ └── InfoPlist.strings ├── Homepwner-Silver │ ├── Homepwner.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── Homepwner │ │ ├── BNRAppDelegate.h │ │ ├── BNRAppDelegate.m │ │ ├── BNRItem.h │ │ ├── BNRItem.m │ │ ├── BNRItemStore.h │ │ ├── BNRItemStore.m │ │ ├── BNRItemsViewController.h │ │ ├── BNRItemsViewController.m │ │ ├── HeaderView.xib │ │ ├── Homepwner-Info.plist │ │ ├── Homepwner-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ └── HomepwnerTests │ │ ├── HomepwnerTests-Info.plist │ │ ├── HomepwnerTests.m │ │ └── en.lproj │ │ └── InfoPlist.strings └── Homepwner │ ├── Homepwner.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── Homepwner │ ├── BNRAppDelegate.h │ ├── BNRAppDelegate.m │ ├── BNRItem.h │ ├── BNRItem.m │ ├── BNRItemStore.h │ ├── BNRItemStore.m │ ├── BNRItemsViewController.h │ ├── BNRItemsViewController.m │ ├── HeaderView.xib │ ├── Homepwner-Info.plist │ ├── Homepwner-Prefix.pch │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m │ └── HomepwnerTests │ ├── HomepwnerTests-Info.plist │ ├── HomepwnerTests.m │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | # Xcode ignores from `https://github.com/github/gitignore` 4 | build/ 5 | *.pbxuser 6 | !default.pbxuser 7 | *.mode1v3 8 | !default.mode1v3 9 | *.mode2v3 10 | !default.mode2v3 11 | *.perspectivev3 12 | !default.perspectivev3 13 | xcuserdata 14 | *.xccheckout 15 | *.moved-aside 16 | DerivedData 17 | *.hmap 18 | *.ipa 19 | *.xcuserstate 20 | -------------------------------------------------------------------------------- /Chapter-1/Quiz/Quiz.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-1/Quiz/Quiz/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Quiz 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-1/Quiz/Quiz/BNRQuizViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRQuizViewController.h 3 | // Quiz 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRQuizViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-1/Quiz/Quiz/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "size" : "60x60", 15 | "idiom" : "iphone", 16 | "filename" : "Icon@2x.png", 17 | "scale" : "2x" 18 | } 19 | ], 20 | "info" : { 21 | "version" : 1, 22 | "author" : "xcode" 23 | } 24 | } -------------------------------------------------------------------------------- /Chapter-1/Quiz/Quiz/Images.xcassets/AppIcon.appiconset/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-1/Quiz/Quiz/Images.xcassets/AppIcon.appiconset/Icon@2x.png -------------------------------------------------------------------------------- /Chapter-1/Quiz/Quiz/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "extent" : "full-screen", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "filename" : "Default-568h@2x.png", 15 | "minimum-system-version" : "7.0", 16 | "orientation" : "portrait", 17 | "scale" : "2x" 18 | }, 19 | { 20 | "orientation" : "portrait", 21 | "idiom" : "iphone", 22 | "extent" : "full-screen", 23 | "filename" : "Default@2x.png", 24 | "scale" : "2x" 25 | } 26 | ], 27 | "info" : { 28 | "version" : 1, 29 | "author" : "xcode" 30 | } 31 | } -------------------------------------------------------------------------------- /Chapter-1/Quiz/Quiz/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-1/Quiz/Quiz/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /Chapter-1/Quiz/Quiz/Images.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-1/Quiz/Quiz/Images.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /Chapter-1/Quiz/Quiz/Quiz-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.hirahim.${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.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Chapter-1/Quiz/Quiz/Quiz-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-1/Quiz/Quiz/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-1/Quiz/Quiz/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Quiz 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-1/Quiz/QuizTests/QuizTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-1/Quiz/QuizTests/QuizTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // QuizTests.m 3 | // QuizTests 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QuizTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation QuizTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-1/Quiz/QuizTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Bronze/Homepwner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Bronze/Homepwner/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Bronze/Homepwner/BNRDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRDetailViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/26/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRDetailViewController : UIViewController 14 | 15 | @property (nonatomic, strong) BNRItem *item; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Bronze/Homepwner/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | { 13 | NSString *_itemName; 14 | NSString *_serialNumber; 15 | int _valueInDollars; 16 | NSDate *_dateCreated; 17 | } 18 | 19 | + (instancetype)randomItem; 20 | 21 | // Designated initializer for BNRItem 22 | - (instancetype)initWithItemName:(NSString *)name 23 | valueInDollars:(int)value 24 | serialNumber:(NSString *)sNumber; 25 | 26 | - (instancetype)initWithItemName:(NSString *)name; 27 | 28 | - (void)setItemName:(NSString *)str; 29 | - (NSString *)itemName; 30 | 31 | - (void)setSerialNumber:(NSString *)str; 32 | - (NSString *)serialNumber; 33 | 34 | - (void)setValueInDollars:(int)v; 35 | - (int)valueInDollars; 36 | 37 | - (NSDate *)dateCreated; 38 | @end 39 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Bronze/Homepwner/BNRItemStore.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemStore.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRItemStore : NSObject 14 | 15 | @property (nonatomic, readonly) NSArray *allItems; 16 | 17 | + (instancetype)sharedStore; 18 | - (BNRItem *)createItem; 19 | - (void)removeItem:(BNRItem *)item; 20 | - (void)moveItemAtIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Bronze/Homepwner/BNRItemsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemsViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItemsViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Bronze/Homepwner/Homepwner-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.hirahim.${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.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Bronze/Homepwner/Homepwner-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Bronze/Homepwner/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Bronze/Homepwner/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Bronze/Homepwner/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Bronze/Homepwner/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Bronze/HomepwnerTests/HomepwnerTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Bronze/HomepwnerTests/HomepwnerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomepwnerTests.m 3 | // HomepwnerTests 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomepwnerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HomepwnerTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Bronze/HomepwnerTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/Homepwner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/Homepwner/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/Homepwner/BNRDateViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRDateViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/27/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRDateViewController : UIViewController 14 | 15 | @property (nonatomic, strong) BNRItem *item; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/Homepwner/BNRDateViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BNRDateViewController.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/27/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import "BNRDateViewController.h" 10 | #import "BNRItem.h" 11 | 12 | @interface BNRDateViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet UIDatePicker *datePicker; 15 | 16 | @end 17 | 18 | @implementation BNRDateViewController 19 | 20 | - (void)viewWillAppear:(BOOL)animated 21 | { 22 | [super viewWillAppear:animated]; 23 | 24 | BNRItem *item = self.item; 25 | 26 | [self.datePicker setDate:item.dateCreated animated:YES]; 27 | } 28 | 29 | - (void)viewWillDisappear:(BOOL)animated 30 | { 31 | [super viewWillDisappear:animated]; 32 | 33 | BNRItem *item = self.item; 34 | item.dateCreated = self.datePicker.date; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/Homepwner/BNRDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRDetailViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/26/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRDetailViewController : UIViewController 14 | 15 | @property (nonatomic, strong) BNRItem *item; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/Homepwner/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | 13 | + (instancetype)randomItem; 14 | 15 | // Designated initializer for BNRItem 16 | - (instancetype)initWithItemName:(NSString *)name 17 | valueInDollars:(int)value 18 | serialNumber:(NSString *)sNumber; 19 | 20 | - (instancetype)initWithItemName:(NSString *)name; 21 | 22 | @property (nonatomic, copy) NSString *itemName; 23 | @property (nonatomic, copy) NSString *serialNumber; 24 | @property (nonatomic, unsafe_unretained) int valueInDollars; 25 | @property (nonatomic, strong) NSDate *dateCreated; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/Homepwner/BNRItemStore.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemStore.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRItemStore : NSObject 14 | 15 | @property (nonatomic, readonly) NSArray *allItems; 16 | 17 | + (instancetype)sharedStore; 18 | - (BNRItem *)createItem; 19 | - (void)removeItem:(BNRItem *)item; 20 | - (void)moveItemAtIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/Homepwner/BNRItemsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemsViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItemsViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/Homepwner/Homepwner-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.hirahim.${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.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/Homepwner/Homepwner-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/Homepwner/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/Homepwner/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/Homepwner/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/Homepwner/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/HomepwnerTests/HomepwnerTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/HomepwnerTests/HomepwnerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomepwnerTests.m 3 | // HomepwnerTests 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomepwnerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HomepwnerTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Gold/HomepwnerTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Silver/Homepwner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Silver/Homepwner/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Silver/Homepwner/BNRDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRDetailViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/26/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRDetailViewController : UIViewController 14 | 15 | @property (nonatomic, strong) BNRItem *item; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Silver/Homepwner/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | { 13 | NSString *_itemName; 14 | NSString *_serialNumber; 15 | int _valueInDollars; 16 | NSDate *_dateCreated; 17 | } 18 | 19 | + (instancetype)randomItem; 20 | 21 | // Designated initializer for BNRItem 22 | - (instancetype)initWithItemName:(NSString *)name 23 | valueInDollars:(int)value 24 | serialNumber:(NSString *)sNumber; 25 | 26 | - (instancetype)initWithItemName:(NSString *)name; 27 | 28 | - (void)setItemName:(NSString *)str; 29 | - (NSString *)itemName; 30 | 31 | - (void)setSerialNumber:(NSString *)str; 32 | - (NSString *)serialNumber; 33 | 34 | - (void)setValueInDollars:(int)v; 35 | - (int)valueInDollars; 36 | 37 | - (NSDate *)dateCreated; 38 | @end 39 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Silver/Homepwner/BNRItemStore.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemStore.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRItemStore : NSObject 14 | 15 | @property (nonatomic, readonly) NSArray *allItems; 16 | 17 | + (instancetype)sharedStore; 18 | - (BNRItem *)createItem; 19 | - (void)removeItem:(BNRItem *)item; 20 | - (void)moveItemAtIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Silver/Homepwner/BNRItemsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemsViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItemsViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Silver/Homepwner/Homepwner-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.hirahim.${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.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Silver/Homepwner/Homepwner-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Silver/Homepwner/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Silver/Homepwner/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Silver/Homepwner/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Silver/Homepwner/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Silver/HomepwnerTests/HomepwnerTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Silver/HomepwnerTests/HomepwnerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomepwnerTests.m 3 | // HomepwnerTests 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomepwnerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HomepwnerTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner-Silver/HomepwnerTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner/Homepwner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner/Homepwner/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner/Homepwner/BNRDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRDetailViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/26/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRDetailViewController : UIViewController 14 | 15 | @property (nonatomic, strong) BNRItem *item; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner/Homepwner/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | { 13 | NSString *_itemName; 14 | NSString *_serialNumber; 15 | int _valueInDollars; 16 | NSDate *_dateCreated; 17 | } 18 | 19 | + (instancetype)randomItem; 20 | 21 | // Designated initializer for BNRItem 22 | - (instancetype)initWithItemName:(NSString *)name 23 | valueInDollars:(int)value 24 | serialNumber:(NSString *)sNumber; 25 | 26 | - (instancetype)initWithItemName:(NSString *)name; 27 | 28 | - (void)setItemName:(NSString *)str; 29 | - (NSString *)itemName; 30 | 31 | - (void)setSerialNumber:(NSString *)str; 32 | - (NSString *)serialNumber; 33 | 34 | - (void)setValueInDollars:(int)v; 35 | - (int)valueInDollars; 36 | 37 | - (NSDate *)dateCreated; 38 | @end 39 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner/Homepwner/BNRItemStore.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemStore.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRItemStore : NSObject 14 | 15 | @property (nonatomic, readonly) NSArray *allItems; 16 | 17 | + (instancetype)sharedStore; 18 | - (BNRItem *)createItem; 19 | - (void)removeItem:(BNRItem *)item; 20 | - (void)moveItemAtIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner/Homepwner/BNRItemsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemsViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItemsViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner/Homepwner/Homepwner-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.hirahim.${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.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner/Homepwner/Homepwner-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner/Homepwner/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-10/Homepwner/Homepwner/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-10/Homepwner/Homepwner/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner/Homepwner/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner/HomepwnerTests/HomepwnerTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner/HomepwnerTests/HomepwnerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomepwnerTests.m 3 | // HomepwnerTests 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomepwnerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HomepwnerTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-10/Homepwner/HomepwnerTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems-Bronze/RandomItems.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems-Bronze/RandomItems/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | { 13 | NSString *_itemName; 14 | NSString *_serialNumber; 15 | int _valueInDollars; 16 | NSDate *_dateCreated; 17 | } 18 | 19 | + (instancetype)randomItem; 20 | 21 | // Designated initializer for BNRItem 22 | - (instancetype)initWithItemName:(NSString *)name 23 | valueInDollars:(int)value 24 | serialNumber:(NSString *)sNumber; 25 | 26 | - (instancetype)initWithItemName:(NSString *)name; 27 | 28 | - (void)setItemName:(NSString *)str; 29 | - (NSString *)itemName; 30 | 31 | - (void)setSerialNumber:(NSString *)str; 32 | - (NSString *)serialNumber; 33 | 34 | - (void)setValueInDollars:(int)v; 35 | - (int)valueInDollars; 36 | 37 | - (NSDate *)dateCreated; 38 | @end 39 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems-Bronze/RandomItems/RandomItems-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems-Bronze/RandomItems/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BNRItem.h" 11 | 12 | int main(int argc, const char * argv[]) 13 | { 14 | @autoreleasepool { 15 | // Create a mutable array object, store its address in items variable 16 | NSMutableArray *items = [[NSMutableArray alloc] init]; 17 | 18 | for (int i = 0; i < 10; i++) { 19 | BNRItem *item = [BNRItem randomItem]; 20 | [items addObject:item]; 21 | } 22 | 23 | for (BNRItem *item in items) { 24 | NSLog(@"%@", item); 25 | } 26 | 27 | NSLog(@"%@", items[10]); 28 | 29 | items = nil; 30 | } 31 | 32 | return 0; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems-Gold/RandomItems.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems-Gold/RandomItems/BNRContainer.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRContainer.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 4/15/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import "BNRItem.h" 10 | 11 | @interface BNRContainer : BNRItem 12 | { 13 | NSMutableArray *_subitems; 14 | NSString *_containerName; 15 | } 16 | 17 | - (void)setContainerName:(NSString *)str; 18 | - (NSString *)containerName; 19 | 20 | - (NSArray *)items; 21 | 22 | - (void)addItem:(BNRItem *)item; 23 | - (BNRItem *)itemAtIndex:(int)index; 24 | 25 | - (int)valueInDollars; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems-Gold/RandomItems/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | { 13 | NSString *_itemName; 14 | NSString *_serialNumber; 15 | int _valueInDollars; 16 | NSDate *_dateCreated; 17 | } 18 | 19 | + (instancetype)randomItem; 20 | 21 | // Designated initializer for BNRItem 22 | - (instancetype)initWithItemName:(NSString *)name 23 | valueInDollars:(int)value 24 | serialNumber:(NSString *)sNumber; 25 | 26 | - (instancetype)initWithItemName:(NSString *)name; 27 | 28 | - (void)setItemName:(NSString *)str; 29 | - (NSString *)itemName; 30 | 31 | - (void)setSerialNumber:(NSString *)str; 32 | - (NSString *)serialNumber; 33 | 34 | - (void)setValueInDollars:(int)v; 35 | - (int)valueInDollars; 36 | 37 | - (NSDate *)dateCreated; 38 | @end 39 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems-Gold/RandomItems/RandomItems-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems-Silver/RandomItems.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems-Silver/RandomItems/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | { 13 | NSString *_itemName; 14 | NSString *_serialNumber; 15 | int _valueInDollars; 16 | NSDate *_dateCreated; 17 | } 18 | 19 | + (instancetype)randomItem; 20 | 21 | // Designated initializer for BNRItem 22 | - (instancetype)initWithItemName:(NSString *)name 23 | valueInDollars:(int)value 24 | serialNumber:(NSString *)sNumber; 25 | 26 | - (instancetype)initWithName:(NSString *)name 27 | serialNumber:(NSString *)sNumber; 28 | 29 | - (instancetype)initWithItemName:(NSString *)name; 30 | 31 | - (void)setItemName:(NSString *)str; 32 | - (NSString *)itemName; 33 | 34 | - (void)setSerialNumber:(NSString *)str; 35 | - (NSString *)serialNumber; 36 | 37 | - (void)setValueInDollars:(int)v; 38 | - (int)valueInDollars; 39 | 40 | - (NSDate *)dateCreated; 41 | @end 42 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems-Silver/RandomItems/RandomItems-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems-Silver/RandomItems/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BNRItem.h" 11 | 12 | int main(int argc, const char * argv[]) 13 | { 14 | @autoreleasepool { 15 | // Create a mutable array object, store its address in items variable 16 | NSMutableArray *items = [[NSMutableArray alloc] init]; 17 | 18 | for (int i = 0; i < 10; i++) { 19 | BNRItem *item = [BNRItem randomItem]; 20 | [items addObject:item]; 21 | } 22 | 23 | // Test new initializer 24 | BNRItem *itemWithNameAndSerial = [[BNRItem alloc] initWithName:@"Green Sofa" serialNumber:@"123"]; 25 | [items addObject:itemWithNameAndSerial]; 26 | 27 | for (BNRItem *item in items) { 28 | NSLog(@"%@", item); 29 | } 30 | 31 | items = nil; 32 | } 33 | 34 | return 0; 35 | } 36 | 37 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems/RandomItems.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems/RandomItems/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | { 13 | NSString *_itemName; 14 | NSString *_serialNumber; 15 | int _valueInDollars; 16 | NSDate *_dateCreated; 17 | } 18 | 19 | + (instancetype)randomItem; 20 | 21 | // Designated initializer for BNRItem 22 | - (instancetype)initWithItemName:(NSString *)name 23 | valueInDollars:(int)value 24 | serialNumber:(NSString *)sNumber; 25 | 26 | - (instancetype)initWithItemName:(NSString *)name; 27 | 28 | - (void)setItemName:(NSString *)str; 29 | - (NSString *)itemName; 30 | 31 | - (void)setSerialNumber:(NSString *)str; 32 | - (NSString *)serialNumber; 33 | 34 | - (void)setValueInDollars:(int)v; 35 | - (int)valueInDollars; 36 | 37 | - (NSDate *)dateCreated; 38 | @end 39 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems/RandomItems/RandomItems-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /Chapter-2/RandomItems/RandomItems/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BNRItem.h" 11 | 12 | int main(int argc, const char * argv[]) 13 | { 14 | @autoreleasepool { 15 | // Create a mutable array object, store its address in items variable 16 | NSMutableArray *items = [[NSMutableArray alloc] init]; 17 | 18 | for (int i = 0; i < 10; i++) { 19 | BNRItem *item = [BNRItem randomItem]; 20 | [items addObject:item]; 21 | } 22 | 23 | for (BNRItem *item in items) { 24 | NSLog(@"%@", item); 25 | } 26 | 27 | items = nil; 28 | } 29 | 30 | return 0; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /Chapter-3/RandomItems/RandomItems.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-3/RandomItems/RandomItems/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | 13 | + (instancetype)randomItem; 14 | 15 | // Designated initializer for BNRItem 16 | - (instancetype)initWithItemName:(NSString *)name 17 | valueInDollars:(int)value 18 | serialNumber:(NSString *)sNumber; 19 | 20 | - (instancetype)initWithItemName:(NSString *)name; 21 | 22 | @property (nonatomic, strong) BNRItem *containedItem; 23 | @property (nonatomic, weak) BNRItem *container; 24 | @property (nonatomic, copy) NSString *itemName; 25 | @property (nonatomic, copy) NSString *serialNumber; 26 | @property (nonatomic) int valueInDollars; 27 | @property (nonatomic, readonly, strong) NSDate *dateCreated; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Chapter-3/RandomItems/RandomItems/RandomItems-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /Chapter-3/RandomItems/RandomItems/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BNRItem.h" 11 | 12 | int main(int argc, const char * argv[]) 13 | { 14 | @autoreleasepool { 15 | NSMutableArray *items = [[NSMutableArray alloc] init]; 16 | 17 | BNRItem *backpack = [[BNRItem alloc] initWithItemName:@"Backpack"]; 18 | [items addObject:backpack]; 19 | 20 | BNRItem *calculator = [[BNRItem alloc] initWithItemName:@"Calculator"]; 21 | [items addObject:calculator]; 22 | 23 | backpack.containedItem = calculator; 24 | 25 | backpack = nil; 26 | calculator = nil; 27 | 28 | for (BNRItem *item in items) { 29 | NSLog(@"%@", item); 30 | } 31 | 32 | NSLog(@"Setting items to nil..."); 33 | items = nil; 34 | } 35 | 36 | return 0; 37 | } 38 | 39 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Bronze/Hypnosister.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Bronze/Hypnosister/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Bronze/Hypnosister/BNRHypnosisView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRHypnosisView.h 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRHypnosisView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Bronze/Hypnosister/Hypnosister-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Bronze/Hypnosister/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Bronze/Hypnosister/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Bronze/Hypnosister/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Bronze/Hypnosister/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Bronze/HypnosisterTests/HypnosisterTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Bronze/HypnosisterTests/HypnosisterTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HypnosisterTests.m 3 | // HypnosisterTests 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HypnosisterTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HypnosisterTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Bronze/HypnosisterTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Bronze/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-4/Hypnosister-Bronze/logo.png -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Gold/Hypnosister.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Gold/Hypnosister/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Gold/Hypnosister/BNRHypnosisView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRHypnosisView.h 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRHypnosisView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Gold/Hypnosister/Hypnosister-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Gold/Hypnosister/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Gold/Hypnosister/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Gold/Hypnosister/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Gold/Hypnosister/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Gold/HypnosisterTests/HypnosisterTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Gold/HypnosisterTests/HypnosisterTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HypnosisterTests.m 3 | // HypnosisterTests 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HypnosisterTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HypnosisterTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Gold/HypnosisterTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister-Gold/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-4/Hypnosister-Gold/logo.png -------------------------------------------------------------------------------- /Chapter-4/Hypnosister/Hypnosister.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister/Hypnosister/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister/Hypnosister/BNRHypnosisView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRHypnosisView.h 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRHypnosisView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister/Hypnosister/Hypnosister-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.hirahim.${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.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister/Hypnosister/Hypnosister-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister/Hypnosister/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-4/Hypnosister/Hypnosister/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-4/Hypnosister/Hypnosister/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister/Hypnosister/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister/HypnosisterTests/HypnosisterTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister/HypnosisterTests/HypnosisterTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HypnosisterTests.m 3 | // HypnosisterTests 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HypnosisterTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HypnosisterTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-4/Hypnosister/HypnosisterTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-5/Hypnosister/Hypnosister.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-5/Hypnosister/Hypnosister/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-5/Hypnosister/Hypnosister/BNRHypnosisView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRHypnosisView.h 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRHypnosisView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-5/Hypnosister/Hypnosister/Hypnosister-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.hirahim.${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.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Chapter-5/Hypnosister/Hypnosister/Hypnosister-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-5/Hypnosister/Hypnosister/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-5/Hypnosister/Hypnosister/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-5/Hypnosister/Hypnosister/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-5/Hypnosister/Hypnosister/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-5/Hypnosister/HypnosisterTests/HypnosisterTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-5/Hypnosister/HypnosisterTests/HypnosisterTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HypnosisterTests.m 3 | // HypnosisterTests 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HypnosisterTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HypnosisterTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-5/Hypnosister/HypnosisterTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/BNRHypnosisView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRHypnosisView.h 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRHypnosisView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/BNRHypnosisViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRHypnosisViewController.h 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRHypnosisViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/BNRHypnosisViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BNRHypnosisViewController.m 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import "BNRHypnosisViewController.h" 10 | #import "BNRHypnosisView.h" 11 | 12 | @implementation BNRHypnosisViewController 13 | 14 | - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 15 | { 16 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 17 | 18 | if (self) { 19 | self.tabBarItem.title = @"Hypnotize"; 20 | 21 | UIImage *i = [UIImage imageNamed:@"Hypno"]; 22 | 23 | self.tabBarItem.image = i; 24 | } 25 | 26 | return self; 27 | } 28 | 29 | - (void)viewDidLoad 30 | { 31 | [super viewDidLoad]; 32 | 33 | NSLog(@"BNRHypnosisViewController loaded its view."); 34 | } 35 | 36 | - (void)loadView 37 | { 38 | BNRHypnosisView *backgroundView = [[BNRHypnosisView alloc] init]; 39 | self.view = backgroundView; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/BNRQuizViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRQuizViewController.h 3 | // Quiz 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRQuizViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/BNRReminderViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRReminderViewController.h 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRReminderViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/HypnoNerd-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.hirahim.${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.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/HypnoNerd-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/Images.xcassets/Hypno.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Hypno.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Hypno@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-6/HypnoNerd-Bronze/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno.png -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-6/HypnoNerd-Bronze/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno@2x.png -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/Images.xcassets/Time.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Time.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Time@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/Images.xcassets/Time.imageset/Time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-6/HypnoNerd-Bronze/HypnoNerd/Images.xcassets/Time.imageset/Time.png -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/Images.xcassets/Time.imageset/Time@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-6/HypnoNerd-Bronze/HypnoNerd/Images.xcassets/Time.imageset/Time@2x.png -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerd/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerdTests/HypnoNerdTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerdTests/HypnoNerdTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HypnoNerdTests.m 3 | // HypnoNerdTests 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HypnoNerdTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HypnoNerdTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Bronze/HypnoNerdTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/BNRHypnosisView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRHypnosisView.h 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRHypnosisView : UIView 12 | 13 | @property (strong, nonatomic) UIColor *circleColor; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/BNRHypnosisViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRHypnosisViewController.h 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRHypnosisViewController : UIViewController 12 | 13 | @property (nonatomic, weak) IBOutlet UISegmentedControl *segmentControl; 14 | 15 | - (IBAction)changeColor:(id)sender; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/BNRReminderViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRReminderViewController.h 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRReminderViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/HypnoNerd-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.hirahim.${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.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/HypnoNerd-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/Images.xcassets/Hypno.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Hypno.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Hypno@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-6/HypnoNerd-Silver/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno.png -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-6/HypnoNerd-Silver/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno@2x.png -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/Images.xcassets/Time.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Time.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Time@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/Images.xcassets/Time.imageset/Time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-6/HypnoNerd-Silver/HypnoNerd/Images.xcassets/Time.imageset/Time.png -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/Images.xcassets/Time.imageset/Time@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-6/HypnoNerd-Silver/HypnoNerd/Images.xcassets/Time.imageset/Time@2x.png -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerd/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerdTests/HypnoNerdTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerdTests/HypnoNerdTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HypnoNerdTests.m 3 | // HypnoNerdTests 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HypnoNerdTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HypnoNerdTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd-Silver/HypnoNerdTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/BNRHypnosisView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRHypnosisView.h 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRHypnosisView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/BNRHypnosisViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRHypnosisViewController.h 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRHypnosisViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/BNRHypnosisViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BNRHypnosisViewController.m 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import "BNRHypnosisViewController.h" 10 | #import "BNRHypnosisView.h" 11 | 12 | @implementation BNRHypnosisViewController 13 | 14 | - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 15 | { 16 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 17 | 18 | if (self) { 19 | self.tabBarItem.title = @"Hypnotize"; 20 | 21 | UIImage *i = [UIImage imageNamed:@"Hypno"]; 22 | 23 | self.tabBarItem.image = i; 24 | } 25 | 26 | return self; 27 | } 28 | 29 | - (void)viewDidLoad 30 | { 31 | [super viewDidLoad]; 32 | 33 | NSLog(@"BNRHypnosisViewController loaded its view."); 34 | } 35 | 36 | - (void)loadView 37 | { 38 | BNRHypnosisView *backgroundView = [[BNRHypnosisView alloc] init]; 39 | self.view = backgroundView; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/BNRReminderViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRReminderViewController.h 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRReminderViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/HypnoNerd-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.hirahim.${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.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/HypnoNerd-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/Images.xcassets/Hypno.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Hypno.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Hypno@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-6/HypnoNerd/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno.png -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-6/HypnoNerd/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno@2x.png -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/Images.xcassets/Time.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Time.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Time@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/Images.xcassets/Time.imageset/Time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-6/HypnoNerd/HypnoNerd/Images.xcassets/Time.imageset/Time.png -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/Images.xcassets/Time.imageset/Time@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-6/HypnoNerd/HypnoNerd/Images.xcassets/Time.imageset/Time@2x.png -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerd/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerdTests/HypnoNerdTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerdTests/HypnoNerdTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HypnoNerdTests.m 3 | // HypnoNerdTests 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HypnoNerdTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HypnoNerdTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-6/HypnoNerd/HypnoNerdTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/BNRHypnosisView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRHypnosisView.h 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRHypnosisView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/BNRHypnosisViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRHypnosisViewController.h 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRHypnosisViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/BNRReminderViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRReminderViewController.h 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRReminderViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/HypnoNerd-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.hirahim.${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.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/HypnoNerd-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/Images.xcassets/Hypno.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Hypno.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Hypno@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-7/HypnoNerd/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno.png -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-7/HypnoNerd/HypnoNerd/Images.xcassets/Hypno.imageset/Hypno@2x.png -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/Images.xcassets/Time.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Time.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Time@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/Images.xcassets/Time.imageset/Time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-7/HypnoNerd/HypnoNerd/Images.xcassets/Time.imageset/Time.png -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/Images.xcassets/Time.imageset/Time@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-7/HypnoNerd/HypnoNerd/Images.xcassets/Time.imageset/Time@2x.png -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerd/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HypnoNerd 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerdTests/HypnoNerdTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerdTests/HypnoNerdTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HypnoNerdTests.m 3 | // HypnoNerdTests 4 | // 5 | // Created by Rahim Sonawalla on 4/19/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HypnoNerdTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HypnoNerdTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-7/HypnoNerd/HypnoNerdTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-7/Hypnosister-Silver/Hypnosister.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-7/Hypnosister-Silver/Hypnosister/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-7/Hypnosister-Silver/Hypnosister/BNRHypnosisView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRHypnosisView.h 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRHypnosisView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-7/Hypnosister-Silver/Hypnosister/Hypnosister-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-7/Hypnosister-Silver/Hypnosister/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-7/Hypnosister-Silver/Hypnosister/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-7/Hypnosister-Silver/Hypnosister/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-7/Hypnosister-Silver/Hypnosister/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Hypnosister 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-7/Hypnosister-Silver/HypnosisterTests/HypnosisterTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-7/Hypnosister-Silver/HypnosisterTests/HypnosisterTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HypnosisterTests.m 3 | // HypnosisterTests 4 | // 5 | // Created by Rahim Sonawalla on 4/18/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HypnosisterTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HypnosisterTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-7/Hypnosister-Silver/HypnosisterTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Bronze/Homepwner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Bronze/Homepwner/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Bronze/Homepwner/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | { 13 | NSString *_itemName; 14 | NSString *_serialNumber; 15 | int _valueInDollars; 16 | NSDate *_dateCreated; 17 | } 18 | 19 | + (instancetype)randomItem; 20 | 21 | // Designated initializer for BNRItem 22 | - (instancetype)initWithItemName:(NSString *)name 23 | valueInDollars:(int)value 24 | serialNumber:(NSString *)sNumber; 25 | 26 | - (instancetype)initWithItemName:(NSString *)name; 27 | 28 | - (void)setItemName:(NSString *)str; 29 | - (NSString *)itemName; 30 | 31 | - (void)setSerialNumber:(NSString *)str; 32 | - (NSString *)serialNumber; 33 | 34 | - (void)setValueInDollars:(int)v; 35 | - (int)valueInDollars; 36 | 37 | - (NSDate *)dateCreated; 38 | @end 39 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Bronze/Homepwner/BNRItemStore.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemStore.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRItemStore : NSObject 14 | 15 | @property (nonatomic, readonly) NSArray *allItemsUnder50; 16 | @property (nonatomic, readonly) NSArray *allItemsOver50; 17 | 18 | + (instancetype)sharedStore; 19 | - (BNRItem *)createItem; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Bronze/Homepwner/BNRItemsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemsViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItemsViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Bronze/Homepwner/Homepwner-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Bronze/Homepwner/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Bronze/Homepwner/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Bronze/Homepwner/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Bronze/Homepwner/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Bronze/HomepwnerTests/HomepwnerTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Bronze/HomepwnerTests/HomepwnerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomepwnerTests.m 3 | // HomepwnerTests 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomepwnerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HomepwnerTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Bronze/HomepwnerTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/Homepwner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/Homepwner/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/Homepwner/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | { 13 | NSString *_itemName; 14 | NSString *_serialNumber; 15 | int _valueInDollars; 16 | NSDate *_dateCreated; 17 | } 18 | 19 | + (instancetype)randomItem; 20 | 21 | // Designated initializer for BNRItem 22 | - (instancetype)initWithItemName:(NSString *)name 23 | valueInDollars:(int)value 24 | serialNumber:(NSString *)sNumber; 25 | 26 | - (instancetype)initWithItemName:(NSString *)name; 27 | 28 | - (void)setItemName:(NSString *)str; 29 | - (NSString *)itemName; 30 | 31 | - (void)setSerialNumber:(NSString *)str; 32 | - (NSString *)serialNumber; 33 | 34 | - (void)setValueInDollars:(int)v; 35 | - (int)valueInDollars; 36 | 37 | - (NSDate *)dateCreated; 38 | @end 39 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/Homepwner/BNRItemStore.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemStore.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRItemStore : NSObject 14 | 15 | @property (nonatomic, readonly) NSArray *allItems; 16 | 17 | + (instancetype)sharedStore; 18 | - (BNRItem *)createItem; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/Homepwner/BNRItemStore.m: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemStore.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import "BNRItemStore.h" 10 | #import "BNRItem.h" 11 | 12 | @interface BNRItemStore () 13 | 14 | @property (nonatomic) NSMutableArray *privateItems; 15 | 16 | @end 17 | 18 | @implementation BNRItemStore 19 | 20 | + (instancetype)sharedStore 21 | { 22 | static BNRItemStore *sharedStore = nil; 23 | 24 | if (!sharedStore) { 25 | sharedStore = [[self alloc] initPrivate]; 26 | } 27 | 28 | return sharedStore; 29 | } 30 | 31 | - (instancetype)init 32 | { 33 | @throw [NSException exceptionWithName:@"Singleton" reason:@"Use +[BNRItemStore sharedStore]" userInfo:nil]; 34 | return nil; 35 | } 36 | 37 | - (instancetype)initPrivate 38 | { 39 | self = [super init]; 40 | 41 | if (self) { 42 | _privateItems = [[NSMutableArray alloc] init]; 43 | } 44 | 45 | return self; 46 | } 47 | 48 | - (NSArray *)allItems 49 | { 50 | return self.privateItems; 51 | } 52 | 53 | - (BNRItem *)createItem 54 | { 55 | BNRItem *randomItem = [BNRItem randomItem]; 56 | 57 | [self.privateItems addObject:randomItem]; 58 | 59 | return randomItem; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/Homepwner/BNRItemsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemsViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItemsViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/Homepwner/Homepwner-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/Homepwner/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/Homepwner/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/Homepwner/Images.xcassets/background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "background.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/Homepwner/Images.xcassets/background.imageset/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahims/iOS-Programming-The-Big-Nerd-Ranch-Guide/3ec521fca570194356da20097afd4805d4d8d232/Chapter-8/Homepwner-Gold/Homepwner/Images.xcassets/background.imageset/background.png -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/Homepwner/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/Homepwner/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/HomepwnerTests/HomepwnerTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/HomepwnerTests/HomepwnerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomepwnerTests.m 3 | // HomepwnerTests 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomepwnerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HomepwnerTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Gold/HomepwnerTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Silver/Homepwner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Silver/Homepwner/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Silver/Homepwner/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | { 13 | NSString *_itemName; 14 | NSString *_serialNumber; 15 | int _valueInDollars; 16 | NSDate *_dateCreated; 17 | } 18 | 19 | + (instancetype)randomItem; 20 | 21 | // Designated initializer for BNRItem 22 | - (instancetype)initWithItemName:(NSString *)name 23 | valueInDollars:(int)value 24 | serialNumber:(NSString *)sNumber; 25 | 26 | - (instancetype)initWithItemName:(NSString *)name; 27 | 28 | - (void)setItemName:(NSString *)str; 29 | - (NSString *)itemName; 30 | 31 | - (void)setSerialNumber:(NSString *)str; 32 | - (NSString *)serialNumber; 33 | 34 | - (void)setValueInDollars:(int)v; 35 | - (int)valueInDollars; 36 | 37 | - (NSDate *)dateCreated; 38 | @end 39 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Silver/Homepwner/BNRItemStore.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemStore.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRItemStore : NSObject 14 | 15 | @property (nonatomic, readonly) NSArray *allItems; 16 | 17 | + (instancetype)sharedStore; 18 | - (BNRItem *)createItem; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Silver/Homepwner/BNRItemStore.m: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemStore.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import "BNRItemStore.h" 10 | #import "BNRItem.h" 11 | 12 | @interface BNRItemStore () 13 | 14 | @property (nonatomic) NSMutableArray *privateItems; 15 | 16 | @end 17 | 18 | @implementation BNRItemStore 19 | 20 | + (instancetype)sharedStore 21 | { 22 | static BNRItemStore *sharedStore = nil; 23 | 24 | if (!sharedStore) { 25 | sharedStore = [[self alloc] initPrivate]; 26 | } 27 | 28 | return sharedStore; 29 | } 30 | 31 | - (instancetype)init 32 | { 33 | @throw [NSException exceptionWithName:@"Singleton" reason:@"Use +[BNRItemStore sharedStore]" userInfo:nil]; 34 | return nil; 35 | } 36 | 37 | - (instancetype)initPrivate 38 | { 39 | self = [super init]; 40 | 41 | if (self) { 42 | _privateItems = [[NSMutableArray alloc] init]; 43 | } 44 | 45 | return self; 46 | } 47 | 48 | - (NSArray *)allItems 49 | { 50 | return self.privateItems; 51 | } 52 | 53 | - (BNRItem *)createItem 54 | { 55 | BNRItem *randomItem = [BNRItem randomItem]; 56 | 57 | [self.privateItems addObject:randomItem]; 58 | 59 | return randomItem; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Silver/Homepwner/BNRItemsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemsViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItemsViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Silver/Homepwner/Homepwner-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Silver/Homepwner/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Silver/Homepwner/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Silver/Homepwner/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Silver/Homepwner/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Silver/HomepwnerTests/HomepwnerTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Silver/HomepwnerTests/HomepwnerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomepwnerTests.m 3 | // HomepwnerTests 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomepwnerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HomepwnerTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner-Silver/HomepwnerTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner/Homepwner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner/Homepwner/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner/Homepwner/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | { 13 | NSString *_itemName; 14 | NSString *_serialNumber; 15 | int _valueInDollars; 16 | NSDate *_dateCreated; 17 | } 18 | 19 | + (instancetype)randomItem; 20 | 21 | // Designated initializer for BNRItem 22 | - (instancetype)initWithItemName:(NSString *)name 23 | valueInDollars:(int)value 24 | serialNumber:(NSString *)sNumber; 25 | 26 | - (instancetype)initWithItemName:(NSString *)name; 27 | 28 | - (void)setItemName:(NSString *)str; 29 | - (NSString *)itemName; 30 | 31 | - (void)setSerialNumber:(NSString *)str; 32 | - (NSString *)serialNumber; 33 | 34 | - (void)setValueInDollars:(int)v; 35 | - (int)valueInDollars; 36 | 37 | - (NSDate *)dateCreated; 38 | @end 39 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner/Homepwner/BNRItemStore.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemStore.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRItemStore : NSObject 14 | 15 | @property (nonatomic, readonly) NSArray *allItems; 16 | 17 | + (instancetype)sharedStore; 18 | - (BNRItem *)createItem; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner/Homepwner/BNRItemStore.m: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemStore.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import "BNRItemStore.h" 10 | #import "BNRItem.h" 11 | 12 | @interface BNRItemStore () 13 | 14 | @property (nonatomic) NSMutableArray *privateItems; 15 | 16 | @end 17 | 18 | @implementation BNRItemStore 19 | 20 | + (instancetype)sharedStore 21 | { 22 | static BNRItemStore *sharedStore = nil; 23 | 24 | if (!sharedStore) { 25 | sharedStore = [[self alloc] initPrivate]; 26 | } 27 | 28 | return sharedStore; 29 | } 30 | 31 | - (instancetype)init 32 | { 33 | @throw [NSException exceptionWithName:@"Singleton" reason:@"Use +[BNRItemStore sharedStore]" userInfo:nil]; 34 | return nil; 35 | } 36 | 37 | - (instancetype)initPrivate 38 | { 39 | self = [super init]; 40 | 41 | if (self) { 42 | _privateItems = [[NSMutableArray alloc] init]; 43 | } 44 | 45 | return self; 46 | } 47 | 48 | - (NSArray *)allItems 49 | { 50 | return self.privateItems; 51 | } 52 | 53 | - (BNRItem *)createItem 54 | { 55 | BNRItem *randomItem = [BNRItem randomItem]; 56 | 57 | [self.privateItems addObject:randomItem]; 58 | 59 | return randomItem; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner/Homepwner/BNRItemsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemsViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItemsViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner/Homepwner/Homepwner-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.hirahim.${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.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner/Homepwner/Homepwner-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner/Homepwner/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-8/Homepwner/Homepwner/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-8/Homepwner/Homepwner/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner/Homepwner/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner/HomepwnerTests/HomepwnerTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner/HomepwnerTests/HomepwnerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomepwnerTests.m 3 | // HomepwnerTests 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomepwnerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HomepwnerTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-8/Homepwner/HomepwnerTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Bronze/Homepwner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Bronze/Homepwner/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Bronze/Homepwner/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | { 13 | NSString *_itemName; 14 | NSString *_serialNumber; 15 | int _valueInDollars; 16 | NSDate *_dateCreated; 17 | } 18 | 19 | + (instancetype)randomItem; 20 | 21 | // Designated initializer for BNRItem 22 | - (instancetype)initWithItemName:(NSString *)name 23 | valueInDollars:(int)value 24 | serialNumber:(NSString *)sNumber; 25 | 26 | - (instancetype)initWithItemName:(NSString *)name; 27 | 28 | - (void)setItemName:(NSString *)str; 29 | - (NSString *)itemName; 30 | 31 | - (void)setSerialNumber:(NSString *)str; 32 | - (NSString *)serialNumber; 33 | 34 | - (void)setValueInDollars:(int)v; 35 | - (int)valueInDollars; 36 | 37 | - (NSDate *)dateCreated; 38 | @end 39 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Bronze/Homepwner/BNRItemStore.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemStore.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRItemStore : NSObject 14 | 15 | @property (nonatomic, readonly) NSArray *allItems; 16 | 17 | + (instancetype)sharedStore; 18 | - (BNRItem *)createItem; 19 | - (void)removeItem:(BNRItem *)item; 20 | - (void)moveItemAtIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Bronze/Homepwner/BNRItemsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemsViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItemsViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Bronze/Homepwner/Homepwner-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Bronze/Homepwner/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Bronze/Homepwner/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Bronze/Homepwner/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Bronze/Homepwner/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Bronze/HomepwnerTests/HomepwnerTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Bronze/HomepwnerTests/HomepwnerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomepwnerTests.m 3 | // HomepwnerTests 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomepwnerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HomepwnerTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Bronze/HomepwnerTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Gold/Homepwner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Gold/Homepwner/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Gold/Homepwner/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | { 13 | NSString *_itemName; 14 | NSString *_serialNumber; 15 | int _valueInDollars; 16 | NSDate *_dateCreated; 17 | } 18 | 19 | + (instancetype)randomItem; 20 | 21 | // Designated initializer for BNRItem 22 | - (instancetype)initWithItemName:(NSString *)name 23 | valueInDollars:(int)value 24 | serialNumber:(NSString *)sNumber; 25 | 26 | - (instancetype)initWithItemName:(NSString *)name; 27 | 28 | - (void)setItemName:(NSString *)str; 29 | - (NSString *)itemName; 30 | 31 | - (void)setSerialNumber:(NSString *)str; 32 | - (NSString *)serialNumber; 33 | 34 | - (void)setValueInDollars:(int)v; 35 | - (int)valueInDollars; 36 | 37 | - (NSDate *)dateCreated; 38 | @end 39 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Gold/Homepwner/BNRItemStore.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemStore.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRItemStore : NSObject 14 | 15 | @property (nonatomic, readonly) NSArray *allItems; 16 | 17 | + (instancetype)sharedStore; 18 | - (BNRItem *)createItem; 19 | - (void)removeItem:(BNRItem *)item; 20 | - (void)moveItemAtIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Gold/Homepwner/BNRItemsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemsViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItemsViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Gold/Homepwner/Homepwner-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Gold/Homepwner/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Gold/Homepwner/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Gold/Homepwner/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Gold/Homepwner/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Gold/HomepwnerTests/HomepwnerTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Gold/HomepwnerTests/HomepwnerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomepwnerTests.m 3 | // HomepwnerTests 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomepwnerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HomepwnerTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Gold/HomepwnerTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Silver/Homepwner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Silver/Homepwner/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Silver/Homepwner/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | { 13 | NSString *_itemName; 14 | NSString *_serialNumber; 15 | int _valueInDollars; 16 | NSDate *_dateCreated; 17 | } 18 | 19 | + (instancetype)randomItem; 20 | 21 | // Designated initializer for BNRItem 22 | - (instancetype)initWithItemName:(NSString *)name 23 | valueInDollars:(int)value 24 | serialNumber:(NSString *)sNumber; 25 | 26 | - (instancetype)initWithItemName:(NSString *)name; 27 | 28 | - (void)setItemName:(NSString *)str; 29 | - (NSString *)itemName; 30 | 31 | - (void)setSerialNumber:(NSString *)str; 32 | - (NSString *)serialNumber; 33 | 34 | - (void)setValueInDollars:(int)v; 35 | - (int)valueInDollars; 36 | 37 | - (NSDate *)dateCreated; 38 | @end 39 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Silver/Homepwner/BNRItemStore.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemStore.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRItemStore : NSObject 14 | 15 | @property (nonatomic, readonly) NSArray *allItems; 16 | 17 | + (instancetype)sharedStore; 18 | - (BNRItem *)createItem; 19 | - (void)removeItem:(BNRItem *)item; 20 | - (void)moveItemAtIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Silver/Homepwner/BNRItemsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemsViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItemsViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Silver/Homepwner/Homepwner-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Silver/Homepwner/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Silver/Homepwner/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Silver/Homepwner/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Silver/Homepwner/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Silver/HomepwnerTests/HomepwnerTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Silver/HomepwnerTests/HomepwnerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomepwnerTests.m 3 | // HomepwnerTests 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomepwnerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HomepwnerTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner-Silver/HomepwnerTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner/Homepwner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner/Homepwner/BNRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRAppDelegate.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner/Homepwner/BNRItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItem.h 3 | // RandomItems 4 | // 5 | // Created by Rahim Sonawalla on 3/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItem : NSObject 12 | { 13 | NSString *_itemName; 14 | NSString *_serialNumber; 15 | int _valueInDollars; 16 | NSDate *_dateCreated; 17 | } 18 | 19 | + (instancetype)randomItem; 20 | 21 | // Designated initializer for BNRItem 22 | - (instancetype)initWithItemName:(NSString *)name 23 | valueInDollars:(int)value 24 | serialNumber:(NSString *)sNumber; 25 | 26 | - (instancetype)initWithItemName:(NSString *)name; 27 | 28 | - (void)setItemName:(NSString *)str; 29 | - (NSString *)itemName; 30 | 31 | - (void)setSerialNumber:(NSString *)str; 32 | - (NSString *)serialNumber; 33 | 34 | - (void)setValueInDollars:(int)v; 35 | - (int)valueInDollars; 36 | 37 | - (NSDate *)dateCreated; 38 | @end 39 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner/Homepwner/BNRItemStore.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemStore.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BNRItem; 12 | 13 | @interface BNRItemStore : NSObject 14 | 15 | @property (nonatomic, readonly) NSArray *allItems; 16 | 17 | + (instancetype)sharedStore; 18 | - (BNRItem *)createItem; 19 | - (void)removeItem:(BNRItem *)item; 20 | - (void)moveItemAtIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner/Homepwner/BNRItemsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BNRItemsViewController.h 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BNRItemsViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner/Homepwner/Homepwner-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.hirahim.${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.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner/Homepwner/Homepwner-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner/Homepwner/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-9/Homepwner/Homepwner/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter-9/Homepwner/Homepwner/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner/Homepwner/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Homepwner 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BNRAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BNRAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner/HomepwnerTests/HomepwnerTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.hirahim.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner/HomepwnerTests/HomepwnerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomepwnerTests.m 3 | // HomepwnerTests 4 | // 5 | // Created by Rahim Sonawalla on 4/20/14. 6 | // Copyright (c) 2014 Hi Rahim. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomepwnerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation HomepwnerTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chapter-9/Homepwner/HomepwnerTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Rahim Sonawalla 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Slowly making my way through [iOS Programming: The Big Nerd Ranch Guide](https://www.bignerdranch.com/book/ios_programming_the_big_nerd_ranch_guide) (4th Edition) in my spare time. This repo holds my solutions to the various challenges presented at the end of most chapters in the book. I'm learning iOS development as I go through the book, so none of this should be considered examples of "good" code/style, but it might be helpful for others that get stuck along the way. --------------------------------------------------------------------------------