├── .gitignore ├── .gitmodules ├── IttyBittyBits.xcworkspace └── contents.xcworkspacedata ├── LICENSE.txt ├── Makefile ├── README.markdown ├── config ├── Project-IttyBittyBits-Debug.xcconfig ├── Project-IttyBittyBits-Release.xcconfig ├── Project-IttyBittyBits-Shared.xcconfig ├── Samples │ ├── Target-Samples-Debug.xcconfig │ ├── Target-Samples-Release.xcconfig │ └── Target-Samples-Shared.xcconfig ├── Target-IttyBittyBits-Debug.xcconfig ├── Target-IttyBittyBits-Release.xcconfig └── Target-IttyBittyBits-Shared.xcconfig ├── lib └── gh-unit │ ├── 0.4.32 │ └── GHUnitIOS.framework │ ├── GHUnitIOS │ ├── Headers │ ├── Resources │ └── Versions │ ├── A │ ├── GHUnitIOS │ ├── Headers │ │ ├── GHAsyncTestCase.h │ │ ├── GHTest+JUnitXML.h │ │ ├── GHTest.h │ │ ├── GHTestCase.h │ │ ├── GHTestGroup+JUnitXML.h │ │ ├── GHTestGroup.h │ │ ├── GHTestMacros.h │ │ ├── GHTestOperation.h │ │ ├── GHTestRunner.h │ │ ├── GHTestSuite.h │ │ ├── GHTestViewModel.h │ │ ├── GHTesting.h │ │ ├── GHUnit.h │ │ ├── GHUnitIOSAppDelegate.h │ │ ├── GHUnitIOSTableViewDataSource.h │ │ ├── GHUnitIOSTestViewController.h │ │ ├── GHUnitIOSView.h │ │ ├── GHUnitIOSViewController.h │ │ ├── GHUnitIPhoneAppDelegate.h │ │ ├── NSException+GHTestFailureExceptions.h │ │ └── NSValue+GHValueFormatter.h │ └── Resources │ │ └── Info.plist │ └── Current ├── samples ├── DebugConsole │ ├── DebugConsole.xcodeproj │ │ └── project.pbxproj │ └── DebugConsole │ │ ├── DebugConsole-Info.plist │ │ ├── DebugConsole-Prefix.pch │ │ ├── DebugConsoleAppDelegate.h │ │ ├── DebugConsoleAppDelegate.m │ │ ├── DebugConsoleViewController.h │ │ ├── DebugConsoleViewController.m │ │ ├── en.lproj │ │ ├── DebugConsoleViewController.xib │ │ ├── InfoPlist.strings │ │ └── MainWindow.xib │ │ └── main.m ├── IBACarouselViewSample │ ├── IBACarouselViewSample-Info.plist │ ├── IBACarouselViewSample-Prefix.pch │ ├── IBACarouselViewSampleAppDelegate.h │ ├── IBACarouselViewSampleAppDelegate.m │ ├── IBACarouselViewSampleViewController.h │ ├── IBACarouselViewSampleViewController.m │ ├── README.markdown │ ├── Resources │ │ └── iPhoneImages │ │ │ └── .gitignore │ ├── download_images.sh │ ├── en.lproj │ │ ├── IBACarouselViewSampleViewController.xib │ │ ├── InfoPlist.strings │ │ └── MainWindow.xib │ └── main.m ├── IBAFlipButtonSample │ ├── IBAFlipButtonSample-Info.plist │ ├── IBAFlipButtonSample-Prefix.pch │ ├── IBAFlipButtonSampleAppDelegate.h │ ├── IBAFlipButtonSampleAppDelegate.m │ ├── IBAFlipButtonSampleViewController.h │ ├── IBAFlipButtonSampleViewController.m │ ├── Resources │ │ ├── back.png │ │ ├── back@2x.png │ │ ├── front.png │ │ └── front@2x.png │ ├── en.lproj │ │ ├── IBAFlipButtonSampleViewController.xib │ │ ├── InfoPlist.strings │ │ └── MainWindow.xib │ └── main.m └── IBAResourceManagerSample │ ├── IBAResourceManagerSample-Info.plist │ ├── IBAResourceManagerSample-Prefix.pch │ ├── IBAResourceManagerSampleAppDelegate.h │ ├── IBAResourceManagerSampleAppDelegate.m │ ├── README.markdown │ ├── Resources0.bundle │ ├── Resources.plist │ ├── image.png │ └── image@2x.png │ ├── Resources1.bundle │ └── Resources.plist │ ├── RootViewController.h │ ├── RootViewController.m │ ├── en.lproj │ ├── InfoPlist.strings │ ├── MainWindow.xib │ └── RootViewController.xib │ └── main.m ├── src ├── CoreAnimation │ ├── CADisplayLink+IBAExtensions.h │ ├── CADisplayLink+IBAExtensions.m │ └── IBACoreAnimation.h ├── CoreData │ ├── IBAAbstractCoreDataService.h │ ├── IBAAbstractCoreDataService.m │ ├── IBACoreData.h │ ├── IBACoreDataContextProvider.h │ ├── IBACoreDataContextProvider.m │ ├── NSEntityDescription+IBAExtensions.h │ ├── NSEntityDescription+IBAExtensions.m │ ├── NSError+IBACoreDataErrors.h │ ├── NSError+IBACoreDataErrors.mm │ ├── NSExpressionDescription+IBAExtensions.h │ ├── NSExpressionDescription+IBAExtensions.m │ ├── NSFetchRequest+IBAExtensions.h │ ├── NSFetchRequest+IBAExtensions.m │ ├── NSManagedObjectContext+IBAExtensions.h │ └── NSManagedObjectContext+IBAExtensions.m ├── CoreGraphics │ ├── IBACoreGraphics.h │ ├── IBAResourceBundle+CoreGraphics.h │ ├── IBAResourceBundle+CoreGraphics.m │ ├── IBAResourceManager+CoreGraphics.h │ ├── IBAResourceManager+CoreGraphics.m │ ├── IBARoundedRectPath.h │ └── IBARoundedRectPath.m ├── CoreLocation │ ├── IBACoreLocation.h │ └── IBACoreLocation.m ├── Foundation │ ├── IBABinding.h │ ├── IBABinding.m │ ├── IBABindingManager.h │ ├── IBABindingManager.m │ ├── IBACancelToken.h │ ├── IBACancelToken.m │ ├── IBACommon.h │ ├── IBADebug.h │ ├── IBADebug.m │ ├── IBADelimitedTextFileReader.h │ ├── IBADelimitedTextFileReader.m │ ├── IBADelimitedTextFileReaderDelegate.h │ ├── IBADelimitedTextFileReaderDelegate.m │ ├── IBADispatch.h │ ├── IBAEasing.h │ ├── IBAEasing.m │ ├── IBAErrors.h │ ├── IBAFoundation.h │ ├── IBAInputStreamLineReader.h │ ├── IBAInputStreamLineReader.m │ ├── IBALogger.h │ ├── IBALogger.m │ ├── IBAMath.h │ ├── IBAMath.m │ ├── IBANetworkReachability.h │ ├── IBANetworkReachability.m │ ├── IBAPathUtilities.h │ ├── IBAPathUtilities.m │ ├── IBAPreProcessorMagic.h │ ├── IBAResourceBundle+Internal.h │ ├── IBAResourceBundle.h │ ├── IBAResourceBundle.m │ ├── IBAResourceManager+Internal.h │ ├── IBAResourceManager.h │ ├── IBAResourceManager.m │ ├── IBAStack.h │ ├── IBAStack.m │ ├── IBAStateMachine.h │ ├── IBAStateMachine.m │ ├── IBASynthesizeSingleton.h │ ├── IBATemporaryFile.h │ ├── IBATemporaryFile.m │ ├── NSArray+IBAExtensions.h │ ├── NSArray+IBAExtensions.m │ ├── NSArray+IBASorting.h │ ├── NSArray+IBASorting.m │ ├── NSArray+IBAWhitespace.h │ ├── NSArray+IBAWhitespace.m │ ├── NSData+IBAExtensions.h │ ├── NSData+IBAExtensions.m │ ├── NSDate+IBAExtensions.h │ ├── NSDate+IBAExtensions.m │ ├── NSDictionary+IBAExtensions.h │ ├── NSDictionary+IBAExtensions.m │ ├── NSError+IBAExtensions.h │ ├── NSError+IBAExtensions.m │ ├── NSFileManager+IBAExtensions.h │ ├── NSFileManager+IBAExtensions.m │ ├── NSHTTPURLResponse+IBAExtensions.h │ ├── NSHTTPURLResponse+IBAExtensions.m │ ├── NSMutableArray+IBAExtensions.h │ ├── NSMutableArray+IBAExtensions.m │ ├── NSMutableArray+IBASorting.h │ ├── NSMutableArray+IBASorting.m │ ├── NSMutableDictionary+IBAExtensions.h │ ├── NSMutableDictionary+IBAExtensions.m │ ├── NSMutableSet+IBAExtensions.h │ ├── NSMutableSet+IBAExtensions.m │ ├── NSNumber+IBAExtensions.h │ ├── NSNumber+IBAExtensions.m │ ├── NSObject+IBAExtensions.h │ ├── NSObject+IBAExtensions.m │ ├── NSOperationQueue+IBAExtensions.h │ ├── NSOperationQueue+IBAExtensions.m │ ├── NSPropertyListSerialization+IBAExtensions.h │ ├── NSPropertyListSerialization+IBAExtensions.m │ ├── NSString+IBAExtensions.h │ ├── NSString+IBAExtensions.m │ ├── NSTimer+IBABlocks.h │ ├── NSTimer+IBABlocks.m │ ├── NSURLRequest+IBAExtensions.h │ └── NSURLRequest+IBAExtensions.m ├── IttyBittyBits-Prefix.pch ├── IttyBittyBits.h ├── IttyBittyBits.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── MapKit │ ├── IBABreadcrumbPath.hh │ ├── IBABreadcrumbPath.mm │ ├── IBABreadcrumbPathView.h │ ├── IBABreadcrumbPathView.mm │ ├── IBAExtendedPlacemark.h │ ├── IBAExtendedPlacemark.m │ ├── IBAGeocoder.h │ ├── IBAGeocoder.m │ ├── IBAMapKit.h │ ├── IBAMapKitUtils.h │ ├── IBAMapKitUtils.m │ ├── IBAPointAnnotation.h │ ├── IBAPointAnnotation.m │ ├── MKMapView+IBAAnnotations.h │ ├── MKMapView+IBAAnnotations.m │ ├── MKPlacemark+IBAFormattedAddress.h │ ├── MKPlacemark+IBAFormattedAddress.m │ ├── MKReverseGeocoder+IBABlocks.h │ └── MKReverseGeocoder+IBABlocks.m ├── Security │ ├── IBAKeychainUtils.h │ ├── IBAKeychainUtils.m │ └── IBASecurity.h └── UIKit │ ├── IBAActionSheet.h │ ├── IBAActionSheet.m │ ├── IBAAlertView.h │ ├── IBAAlertView.m │ ├── IBAAnchoredStackView.h │ ├── IBAAnchoredStackView.m │ ├── IBACSSColors.x │ ├── IBACarouselView.h │ ├── IBACarouselView.m │ ├── IBAFlipButton.h │ ├── IBAFlipButton.m │ ├── IBAFlipViewController.h │ ├── IBAFlipViewController.m │ ├── IBAGradientButton.h │ ├── IBAGradientButton.m │ ├── IBANavigationBar.h │ ├── IBANavigationBar.m │ ├── IBANavigationController.h │ ├── IBANavigationController.m │ ├── IBAResourceBundle+UIKit.h │ ├── IBAResourceBundle+UIKit.m │ ├── IBAResourceManager+UIKit.h │ ├── IBAResourceManager+UIKit.m │ ├── IBATableViewAccessory.h │ ├── IBATableViewAccessory.m │ ├── IBATableViewController.h │ ├── IBATableViewController.m │ ├── IBATableViewModel.h │ ├── IBATableViewModel.m │ ├── IBATableViewSectionModel.h │ ├── IBATableViewSectionModel.m │ ├── IBATiledImageView.h │ ├── IBATiledImageView.m │ ├── IBAUIKit.h │ ├── IBAUIKit.m │ ├── IBAViewController.h │ ├── IBAViewController.m │ ├── NSIndexPath+UITableView+IBAExtensions.h │ ├── NSIndexPath+UITableView+IBAExtensions.m │ ├── UIAlertView+IBAExtensions.h │ ├── UIAlertView+IBAExtensions.m │ ├── UIApplication+IBAExtensions.h │ ├── UIApplication+IBAExtensions.m │ ├── UIBarButtonItem+IBAFactories.h │ ├── UIBarButtonItem+IBAFactories.m │ ├── UIColor+IBAExtensions.h │ ├── UIColor+IBAExtensions.m │ ├── UIGestureRecognizer+IBAExtensions.h │ ├── UIGestureRecognizer+IBAExtensions.m │ ├── UIImage+IBAExtensions.h │ ├── UIImage+IBAExtensions.m │ ├── UINavigationController+IBAExtensions.h │ ├── UINavigationController+IBAExtensions.m │ ├── UINib+IBAExtensions.h │ ├── UINib+IBAExtensions.m │ ├── UIScrollView+IBAExtensions.h │ ├── UIScrollView+IBAExtensions.m │ ├── UISearchBar+IBAExtensions.h │ ├── UISearchBar+IBAExtensions.m │ ├── UITableView+IBAExtensions.h │ ├── UITableView+IBAExtensions.m │ ├── UIView+IBAExtensions.h │ └── UIView+IBAExtensions.m └── tests ├── CoreGraphics ├── IBAResourceBundle+CoreGraphicsTests.h └── IBAResourceBundle+CoreGraphicsTests.m ├── DefaultResources.bundle ├── Resources.plist ├── data.txt └── images │ ├── Test.png │ └── Test@2x.png ├── Foundation ├── IBACommonTests.h ├── IBACommonTests.m ├── IBADebugTests.h ├── IBADebugTests.m ├── IBADelimitedTextFileReaderTests.h ├── IBADelimitedTextFileReaderTests.m ├── IBAInputStreamLineReaderTests.h ├── IBAInputStreamLineReaderTests.m ├── IBALoggerTests.h ├── IBALoggerTests.m ├── IBAResourceBundleTests.h ├── IBAResourceBundleTests.m ├── IBAStackTests.h ├── IBAStackTests.m ├── NSData+IBAExtensionsTests.h ├── NSData+IBAExtensionsTests.m ├── NSString+IBAExtensionsTests.h └── NSString+IBAExtensionsTests.m ├── GHUnitIOSTestMain.mm ├── IttyBittyBitsTests-Info.plist ├── IttyBittyBitsTests-Prefix.pch ├── UIKit ├── IBAResourceBundle+UIKitTests.h ├── IBAResourceBundle+UIKitTests.m ├── IBATableViewModelTests.h ├── IBATableViewModelTests.m ├── IBATableViewSectionModelTests.h ├── IBATableViewSectionModelTests.m ├── UIColor+IBAExtensionsTests.h └── UIColor+IBAExtensionsTests.m └── en.lproj └── InfoPlist.strings /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | build/ 3 | .idea/ 4 | *.pbxuser 5 | *.perspective 6 | *.perspectivev3 7 | *.mode1v3 8 | *.mode2v3 9 | *.xcuserdatad 10 | *.trace 11 | *project.xcworkspace/ 12 | 13 | # OSX 14 | .DS_Store 15 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/JSONKit"] 2 | path = lib/JSONKit 3 | url = https://github.com/johnezang/JSONKit.git 4 | [submodule "lib/jenkins-xcode-support"] 5 | path = lib/jenkins-xcode-support 6 | url = https://github.com/ittybittyapps/jenkins-xcode-support.git 7 | -------------------------------------------------------------------------------- /IttyBittyBits.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 9 | 10 | 12 | 13 | 14 | 16 | 17 | 20 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | XCODE_WORKSPACE ?= IttyBittyBits.xcworkspace 2 | XCODE_SCHEME ?= IttyBittyBitsTests 3 | CONFIG ?= Debug 4 | SDK ?= iphonesimulator4.3 5 | KEYCHAIN_NAME := IttyBittyApps 6 | 7 | BUILD_DIR ?= ../build 8 | 9 | include lib/jenkins-xcode-support/project/make/Makefile.include 10 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | # IttyBittyApps Objective-C Utility Library 2 | 3 | ### Getting Start 4 | 5 | - Refer to IttyBittyBits target Link Binary with Libraries, add them into your Link Binary Phase. 6 | - Config Other Linker Flags to be "all_load -ObjC -lstdc++" 7 | 8 | 9 | 10 | Copyright (c) 2011 IttyBittyApps Pty. Ltd. 11 | 12 | Where not indicated in the individual files code in this repository are licensed under the following terms: 13 | 14 | Licensed under the Apache License, Version 2.0 (the "License"); 15 | you may not use this file except in compliance with the License. 16 | You may obtain a copy of the License at 17 | 18 | http://www.apache.org/licenses/LICENSE-2.0 19 | 20 | Unless required by applicable law or agreed to in writing, software 21 | distributed under the License is distributed on an "AS IS" BASIS, 22 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | See the License for the specific language governing permissions and 24 | limitations under the License. 25 | 26 | This library also contains modified versions of code copyright the following authors and is used with permission or in accordance with their open source licenses (individual files specify copyright & license terms). 27 | 28 | Oliver Jones 29 | Matt Gallagher 30 | Buzz Andersen (SciFi HiFi) 31 | Jonathan Wight 32 | Jon Crosby 33 | Mike Malone 34 | Remy Demarest 35 | Sam Vermette 36 | Erica Sadun 37 | Kevin O'Neill 38 | Robert Penner 39 | Michael Waterfall 40 | -------------------------------------------------------------------------------- /config/Project-IttyBittyBits-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Project-IttyBittyBits-Debug.xcconfig 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 17/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | #include "Project-IttyBittyBits-Shared.xcconfig" 9 | 10 | // No optimization 11 | GCC_OPTIMIZATION_LEVEL = 0 12 | 13 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 14 | -------------------------------------------------------------------------------- /config/Project-IttyBittyBits-Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Project-IttyBittyBits-Release.xcconfig 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 17/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | #include "Project-IttyBittyBits-Shared.xcconfig" 9 | 10 | // Fast and small 11 | GCC_OPTIMIZATION_LEVEL = s 12 | 13 | // Don't raise assertions in Release code. 14 | GCC_PREPROCESSOR_DEFINITIONS = NS_BLOCK_ASSERTIONS=1 IBA_LOG_DEBUG_DISABLED=1 IBA_LOG_INFO_DISABLED=1 IBA_LOG_NOTICE_DISABLED=1 15 | 16 | -------------------------------------------------------------------------------- /config/Samples/Target-Samples-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Target-Samples-Debug.xcconfig 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 30/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | #include "Target-Samples-Shared.xcconfig" 9 | -------------------------------------------------------------------------------- /config/Samples/Target-Samples-Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Target-Samples-Release.xcconfig 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 30/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | #include "Target-Samples-Shared.xcconfig" -------------------------------------------------------------------------------- /config/Samples/Target-Samples-Shared.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Target-Samples-Shared.xcconfig 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 30/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | WRAPPER_EXTENSION = app 9 | GCC_DYNAMIC_NO_PIC = NO 10 | GCC_PRECOMPILE_PREFIX_HEADER = YES 11 | COPY_PHASE_STRIP = NO 12 | VALIDATE_PRODUCT = NO 13 | 14 | OTHER_LDFLAGS = -ObjC -all_load -lstdc++ 15 | 16 | SAMPLES_SRCROOT = $(SRCROOT)/../samples 17 | 18 | CODE_SIGN_IDENTITY = iPhone Developer 19 | 20 | PRODUCT_NAME = $(TARGET_NAME) 21 | INFOPLIST_FILE = $(SAMPLES_SRCROOT)/$(TARGET_NAME)/$(TARGET_NAME)-Info.plist 22 | GCC_PREFIX_HEADER = $(SAMPLES_SRCROOT)/$(TARGET_NAME)/$(TARGET_NAME)-Prefix.pch 23 | -------------------------------------------------------------------------------- /config/Target-IttyBittyBits-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Target-IttyBittyBits-Debug.xcconfig 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 17/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | #include "Target-IttyBittyBits-Shared.xcconfig" -------------------------------------------------------------------------------- /config/Target-IttyBittyBits-Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Target-IttyBittyBits-Release.xcconfig 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 17/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | #include "Target-IttyBittyBits-Shared.xcconfig" -------------------------------------------------------------------------------- /config/Target-IttyBittyBits-Shared.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Target-IttyBittyBits-Shared.xcconfig 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 17/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | OTHER_LDFLAGS = -ObjC -all_load 9 | PRODUCT_NAME = $(TARGET_NAME) 10 | ALWAYS_SEARCH_USER_PATHS = NO 11 | GCC_PRECOMPILE_PREFIX_HEADER = YES 12 | GCC_PREFIX_HEADER = IttyBittyBits-Prefix.pch 13 | -------------------------------------------------------------------------------- /lib/gh-unit/0.4.32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ittybittyapps/ittybittybits/46c5193968f58afb600fe55e9fa93a697398cdba/lib/gh-unit/0.4.32 -------------------------------------------------------------------------------- /lib/gh-unit/GHUnitIOS.framework/GHUnitIOS: -------------------------------------------------------------------------------- 1 | Versions/Current/GHUnitIOS -------------------------------------------------------------------------------- /lib/gh-unit/GHUnitIOS.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /lib/gh-unit/GHUnitIOS.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /lib/gh-unit/GHUnitIOS.framework/Versions/A/GHUnitIOS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ittybittyapps/ittybittybits/46c5193968f58afb600fe55e9fa93a697398cdba/lib/gh-unit/GHUnitIOS.framework/Versions/A/GHUnitIOS -------------------------------------------------------------------------------- /lib/gh-unit/GHUnitIOS.framework/Versions/A/Headers/GHTest+JUnitXML.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHTest+JUnitXML.h 3 | // GHUnit 4 | // 5 | // Created by Gabriel Handford on 6/4/10. 6 | // Copyright 2010. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | //! @cond DEV 31 | 32 | #import "GHTest.h" 33 | 34 | @interface GHTest(JUnitXML) 35 | 36 | /*! 37 | Return test results in JUnit XML format for external parsing use 38 | (such as a Continuous Integration system like Hudson) 39 | */ 40 | - (NSString *)JUnitXML; 41 | 42 | @end 43 | 44 | //! @endcond 45 | -------------------------------------------------------------------------------- /lib/gh-unit/GHUnitIOS.framework/Versions/A/Headers/GHTestGroup+JUnitXML.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHTestGroup+JUnitXML.h 3 | // GHUnit 4 | // 5 | // Created by Gabriel Handford on 6/4/10. 6 | // Copyright 2010. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | //! @cond DEV 31 | 32 | #import "GHTestGroup.h" 33 | 34 | @interface GHTestGroup(JUnitXML) 35 | 36 | - (NSString *)JUnitXML; 37 | 38 | - (BOOL)writeJUnitXMLAtPath:(NSString *)documentsPath error:(NSError **)error; 39 | 40 | @end 41 | 42 | //! @endcond 43 | -------------------------------------------------------------------------------- /lib/gh-unit/GHUnitIOS.framework/Versions/A/Headers/GHTestOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHTestOperation.h 3 | // GHUnit 4 | // 5 | // Created by Gabriel Handford on 6/4/10. 6 | // Copyright 2010. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | //! @cond DEV 31 | 32 | #import "GHTest.h" 33 | 34 | /*! 35 | Test for running in the context of an NSOperationQueue. 36 | */ 37 | @interface GHTestOperation : NSOperation { 38 | id test_; 39 | GHTestOptions options_; 40 | } 41 | 42 | - (id)initWithTest:(id)test options:(GHTestOptions)options; 43 | 44 | @end 45 | 46 | //! @endcond 47 | -------------------------------------------------------------------------------- /lib/gh-unit/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIOSAppDelegate.h 3 | // GHUnitIOS 4 | // 5 | // Created by Gabriel Handford on 1/25/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | 32 | @interface GHUnitIOSAppDelegate : NSObject { 33 | UIWindow *window_; 34 | 35 | UINavigationController *navigationController_; 36 | } 37 | 38 | @end 39 | 40 | -------------------------------------------------------------------------------- /lib/gh-unit/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSTableViewDataSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIOSTableViewDataSource.h 3 | // GHUnitIOS 4 | // 5 | // Created by Gabriel Handford on 5/5/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | #import "GHTestViewModel.h" 32 | 33 | @interface GHUnitIOSTableViewDataSource : GHTestViewModel { 34 | 35 | } 36 | 37 | - (GHTestNode *)nodeForIndexPath:(NSIndexPath *)indexPath; 38 | 39 | - (void)setSelectedForAllNodes:(BOOL)selected; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /lib/gh-unit/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSTestViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIOSTestViewController.h 3 | // GHUnitIOS 4 | // 5 | // Created by Gabriel Handford on 2/20/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | #import "GHTestViewModel.h" 32 | 33 | @interface GHUnitIOSTestViewController : UIViewController { 34 | UITextView *textView_; 35 | 36 | GHTestNode *testNode_; 37 | 38 | GHTestRunner *runner_; 39 | } 40 | 41 | - (void)setTest:(id)test; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /lib/gh-unit/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIOSView.h 3 | // GHUnitIOS 4 | // 5 | // Created by Gabriel Handford on 4/12/10. 6 | // Copyright 2010. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | #import 32 | 33 | 34 | @interface GHUnitIOSView : UIView { 35 | UISearchBar *searchBar_; 36 | 37 | UITableView *tableView_; 38 | 39 | //! Status label at bottom of the view 40 | UILabel *statusLabel_; 41 | 42 | UISegmentedControl *filterControl_; 43 | 44 | UIToolbar *runToolbar_; 45 | 46 | UIView *footerView_; 47 | } 48 | 49 | @property (readonly, nonatomic) UILabel *statusLabel; 50 | @property (readonly, nonatomic) UISegmentedControl *filterControl; 51 | @property (readonly, nonatomic) UISearchBar *searchBar; 52 | @property (readonly, nonatomic) UITableView *tableView; 53 | 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /lib/gh-unit/GHUnitIOS.framework/Versions/A/Headers/GHUnitIPhoneAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIPhoneAppDelegate.h 3 | // GHUnitIOS 4 | // 5 | // Created by Gabriel Handford on 6/28/11. 6 | // 7 | // Permission is hereby granted, free of charge, to any person 8 | // obtaining a copy of this software and associated documentation 9 | // files (the "Software"), to deal in the Software without 10 | // restriction, including without limitation the rights to use, 11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the 13 | // Software is furnished to do so, subject to the following 14 | // conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be 17 | // included in all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | // OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | #import "GHUnitIOSAppDelegate.h" 30 | 31 | // For backwards compatibility (see GHUnitIOSAppDelegate) 32 | @interface GHUnitIPhoneAppDelegate : GHUnitIOSAppDelegate { 33 | 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /lib/gh-unit/GHUnitIOS.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | me.rel.ghunit 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | FMWK 13 | CFBundleSignature 14 | ???? 15 | CFBundleVersion 16 | $(GHUNIT_VERSION) 17 | 18 | 19 | -------------------------------------------------------------------------------- /lib/gh-unit/GHUnitIOS.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /samples/DebugConsole/DebugConsole/DebugConsole-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.deeperdesign.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /samples/DebugConsole/DebugConsole/DebugConsole-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'DebugConsole' target in the 'DebugConsole' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /samples/DebugConsole/DebugConsole/DebugConsoleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // DebugConsoleAppDelegate.h 3 | // DebugConsole 4 | // 5 | // Created by Oliver Jones on 3/05/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DebugConsoleViewController; 12 | 13 | @interface DebugConsoleAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet DebugConsoleViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /samples/DebugConsole/DebugConsole/DebugConsoleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DebugConsoleViewController.h 3 | // DebugConsole 4 | // 5 | // Created by Oliver Jones on 3/05/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DebugConsoleViewController : UIViewController 12 | { 13 | 14 | } 15 | 16 | - (IBAction)openDebugConsole:(id)sender; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /samples/DebugConsole/DebugConsole/DebugConsoleViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DebugConsoleViewController.m 3 | // DebugConsole 4 | // 5 | // Created by Oliver Jones on 3/05/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "DebugConsoleViewController.h" 10 | 11 | @implementation DebugConsoleViewController 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | - (void)didReceiveMemoryWarning 19 | { 20 | // Releases the view if it doesn't have a superview. 21 | [super didReceiveMemoryWarning]; 22 | 23 | // Release any cached data, images, etc that aren't in use. 24 | } 25 | 26 | #pragma mark - View lifecycle 27 | 28 | /* 29 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 30 | - (void)viewDidLoad 31 | { 32 | [super viewDidLoad]; 33 | } 34 | */ 35 | 36 | - (void)viewDidUnload 37 | { 38 | [super viewDidUnload]; 39 | // Release any retained subviews of the main view. 40 | // e.g. self.myOutlet = nil; 41 | } 42 | 43 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 44 | { 45 | // Return YES for supported orientations 46 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 47 | } 48 | 49 | - (IBAction)openDebugConsole:(id)sender 50 | { 51 | [self presentModalViewController:<#(UIViewController *)#> animated:<#(BOOL)#> 52 | } 53 | @end 54 | -------------------------------------------------------------------------------- /samples/DebugConsole/DebugConsole/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /samples/DebugConsole/DebugConsole/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DebugConsole 4 | // 5 | // Created by Oliver Jones on 3/05/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /samples/IBACarouselViewSample/IBACarouselViewSample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.ittybittybits.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /samples/IBACarouselViewSample/IBACarouselViewSample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'IBACarouselViewSample' target in the 'IBACarouselViewSample' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_2 8 | #warning "This project uses features only available in iPhone SDK 4.2 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | # import 13 | # import 14 | # import "IttyBittyBits.h" 15 | #endif 16 | -------------------------------------------------------------------------------- /samples/IBACarouselViewSample/IBACarouselViewSampleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBACarouselViewSampleAppDelegate.h 3 | // IBACarouselViewSample 4 | // 5 | // Created by Oliver Jones on 1/09/11. 6 | // Copyright 2011 Deeper Design. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface IBACarouselViewSampleAppDelegate : NSObject 12 | 13 | @property (nonatomic, retain) IBOutlet UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /samples/IBACarouselViewSample/IBACarouselViewSampleAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // IBACarouselViewSampleAppDelegate.m 3 | // IBACarouselViewSample 4 | // 5 | // Created by Oliver Jones on 1/09/11. 6 | // Copyright 2011 Deeper Design. All rights reserved. 7 | // 8 | 9 | #import "IBACarouselViewSampleAppDelegate.h" 10 | 11 | @implementation IBACarouselViewSampleAppDelegate 12 | 13 | @synthesize window = _window; 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | #pragma unused(application, launchOptions) 18 | [self.window makeKeyAndVisible]; 19 | return YES; 20 | } 21 | 22 | - (void)dealloc 23 | { 24 | [_window release]; 25 | [super dealloc]; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /samples/IBACarouselViewSample/IBACarouselViewSampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBACarouselViewSampleViewController.h 3 | // IBACarouselViewSample 4 | // 5 | // Created by Oliver Jones on 1/09/11. 6 | // Copyright 2011 Deeper Design. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class IBACarouselView; 12 | 13 | @interface IBACarouselViewSampleViewController : UIViewController 14 | 15 | @property (nonatomic, retain) IBOutlet IBACarouselView* carousel1; 16 | @property (nonatomic, retain) IBOutlet IBACarouselView* carousel2; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /samples/IBACarouselViewSample/README.markdown: -------------------------------------------------------------------------------- 1 | # IBACarouselView Sample 2 | This sample shows how to use the IBACarouselView control. 3 | 4 | Unfortunately we can't ship example 360 carousel images with this sample as we were using Apple's material and that is probably covered by copyright. But in this folder there is a script (download_images.sh) that downloads the images we used in the sample into the Resources folder. 5 | -------------------------------------------------------------------------------- /samples/IBACarouselViewSample/Resources/iPhoneImages/.gitignore: -------------------------------------------------------------------------------- 1 | Seq*.jpg 2 | -------------------------------------------------------------------------------- /samples/IBACarouselViewSample/download_images.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | for i in `seq -w 1 72`; do 3 | url="http://www.apple.com/html5/showcase/threesixty/images/optimized/Seq_v04_640x378_$i.jpg" 4 | echo Downloading $url... 5 | curl $url -o Resources/iPhoneImages/Seq_v04_640x378_$i.jpg 6 | done -------------------------------------------------------------------------------- /samples/IBACarouselViewSample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /samples/IBACarouselViewSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // IBACarouselViewSample 4 | // 5 | // Created by Oliver Jones on 1/09/11. 6 | // Copyright 2011 Deeper Design. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /samples/IBAFlipButtonSample/IBAFlipButtonSample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.ittybittybits.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /samples/IBAFlipButtonSample/IBAFlipButtonSample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'IBAFlipButtonSample' target in the 'IBAFlipButtonSample' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_2 8 | # warning "This project uses features only available in iPhone SDK 4.2 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | # import 13 | # import 14 | # import "IttyBittyBits.h" 15 | #endif 16 | -------------------------------------------------------------------------------- /samples/IBAFlipButtonSample/IBAFlipButtonSampleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAFlipButtonSampleAppDelegate.h 3 | // IBAFlipButtonSample 4 | // 5 | // Created by Oliver Jones on 30/08/11. 6 | // Copyright 2011 Deeper Design. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class IBAFlipButtonSampleViewController; 12 | 13 | @interface IBAFlipButtonSampleAppDelegate : NSObject 14 | 15 | @property (nonatomic, retain) IBOutlet UIWindow *window; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /samples/IBAFlipButtonSample/IBAFlipButtonSampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAFlipButtonSampleViewController.h 3 | // IBAFlipButtonSample 4 | // 5 | // Created by Oliver Jones on 30/08/11. 6 | // Copyright 2011 Deeper Design. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class IBAFlipButton; 12 | 13 | @interface IBAFlipButtonSampleViewController : UIViewController 14 | 15 | @property (nonatomic, retain) IBOutlet IBAFlipButton *flipButton; 16 | @property (nonatomic, retain) IBOutlet IBAFlipButton *flipButton2; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /samples/IBAFlipButtonSample/Resources/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ittybittyapps/ittybittybits/46c5193968f58afb600fe55e9fa93a697398cdba/samples/IBAFlipButtonSample/Resources/back.png -------------------------------------------------------------------------------- /samples/IBAFlipButtonSample/Resources/back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ittybittyapps/ittybittybits/46c5193968f58afb600fe55e9fa93a697398cdba/samples/IBAFlipButtonSample/Resources/back@2x.png -------------------------------------------------------------------------------- /samples/IBAFlipButtonSample/Resources/front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ittybittyapps/ittybittybits/46c5193968f58afb600fe55e9fa93a697398cdba/samples/IBAFlipButtonSample/Resources/front.png -------------------------------------------------------------------------------- /samples/IBAFlipButtonSample/Resources/front@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ittybittyapps/ittybittybits/46c5193968f58afb600fe55e9fa93a697398cdba/samples/IBAFlipButtonSample/Resources/front@2x.png -------------------------------------------------------------------------------- /samples/IBAFlipButtonSample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /samples/IBAFlipButtonSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // IBAFlipButtonSample 4 | // 5 | // Created by Oliver Jones on 30/08/11. 6 | // Copyright 2011 Deeper Design. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /samples/IBAResourceManagerSample/IBAResourceManagerSample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.ittybittybits.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /samples/IBAResourceManagerSample/IBAResourceManagerSample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'IBAResourceManagerSample' target 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_2 8 | #warning "This project uses features only available in iPhone SDK 4.2 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | # import 13 | # import 14 | # import "IttyBittyBits.h" 15 | #endif 16 | -------------------------------------------------------------------------------- /samples/IBAResourceManagerSample/IBAResourceManagerSampleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceManagerSampleAppDelegate.h 3 | // IBAResourceManagerSample 4 | // 5 | // Created by Oliver Jones on 7/11/11. 6 | // Copyright 2011 Deeper Design. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface IBAResourceManagerSampleAppDelegate : NSObject 12 | 13 | @property (nonatomic, retain) IBOutlet UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /samples/IBAResourceManagerSample/IBAResourceManagerSampleAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceManagerSampleAppDelegate.m 3 | // IBAResourceManagerSample 4 | // 5 | // Created by Oliver Jones on 7/11/11. 6 | // Copyright 2011 Deeper Design. All rights reserved. 7 | // 8 | 9 | #import "IBAResourceManagerSampleAppDelegate.h" 10 | 11 | @implementation IBAResourceManagerSampleAppDelegate 12 | 13 | @synthesize window = _window; 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | #pragma unused(application, launchOptions) 18 | [[IBAResourceManager sharedInstance] pushResourceBundleNamed:@"Resources0"]; 19 | 20 | // Override point for customization after application launch. 21 | [self.window makeKeyAndVisible]; 22 | return YES; 23 | } 24 | 25 | - (void)dealloc 26 | { 27 | [_window release]; 28 | [super dealloc]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /samples/IBAResourceManagerSample/README.markdown: -------------------------------------------------------------------------------- 1 | # IBAThemeManager Sample 2 | This sample shows how to use the IBAThemeManager classes. 3 | 4 | -------------------------------------------------------------------------------- /samples/IBAResourceManagerSample/Resources0.bundle/Resources.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | labelTextColor 6 | red 7 | labelBackgroundColor 8 | rgb(50%, 50%, 50%) 9 | image 10 | image 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/IBAResourceManagerSample/Resources0.bundle/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ittybittyapps/ittybittybits/46c5193968f58afb600fe55e9fa93a697398cdba/samples/IBAResourceManagerSample/Resources0.bundle/image.png -------------------------------------------------------------------------------- /samples/IBAResourceManagerSample/Resources0.bundle/image@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ittybittyapps/ittybittybits/46c5193968f58afb600fe55e9fa93a697398cdba/samples/IBAResourceManagerSample/Resources0.bundle/image@2x.png -------------------------------------------------------------------------------- /samples/IBAResourceManagerSample/Resources1.bundle/Resources.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | labelTextColor 6 | blue 7 | labelBackgroundColor 8 | rgb(50%, 100%, 50%) 9 | 10 | 11 | -------------------------------------------------------------------------------- /samples/IBAResourceManagerSample/RootViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 7/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RootViewController : IBAViewController 12 | 13 | @property (nonatomic, retain) IBOutlet UILabel *label; 14 | @property (nonatomic, retain) IBOutlet UIImageView *imageView; 15 | 16 | + (id)controller; 17 | 18 | - (IBAction)buttonPressed:(id)sender forEvent:(UIEvent*)event; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /samples/IBAResourceManagerSample/RootViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 7/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | 9 | #import "RootViewController.h" 10 | #import "IttyBittyBits.h" 11 | 12 | @implementation RootViewController 13 | 14 | @synthesize label, imageView; 15 | 16 | + (id)controller 17 | { 18 | return [[[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil] autorelease]; 19 | } 20 | 21 | #pragma mark - View lifecycle 22 | 23 | - (void)viewDidLoad 24 | { 25 | IBAResourceManager *resources = [IBAResourceManager sharedInstance]; 26 | 27 | self.label.textColor = [resources colorNamed:@"labelTextColor"]; 28 | self.label.backgroundColor = [resources colorNamed:@"labelBackgroundColor"]; 29 | self.imageView.contentMode = UIViewContentModeCenter; 30 | self.imageView.image = [resources imageNamed:@"image"]; 31 | 32 | [super viewDidLoad]; 33 | } 34 | 35 | -(void)viewDidDisappear:(BOOL)animated 36 | { 37 | #pragma unused(animated) 38 | if (self.navigationController == nil) 39 | { 40 | [[IBAResourceManager sharedInstance] popResourceBundle]; 41 | } 42 | } 43 | 44 | - (IBAction)buttonPressed:(id)sender forEvent:(UIEvent*)event 45 | { 46 | #pragma unused(sender, event) 47 | NSString *bundleName = [NSString stringWithFormat:@"Resources%d", [self.navigationController.viewControllers count] % 2]; 48 | 49 | [[IBAResourceManager sharedInstance] pushResourceBundleNamed:bundleName]; 50 | 51 | [self.navigationController pushViewController:[RootViewController controller] animated:YES]; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /samples/IBAResourceManagerSample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /samples/IBAResourceManagerSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // IBAThemeManagerSample 4 | // 5 | // Created by Oliver Jones on 1/09/11. 6 | // Copyright 2011 Deeper Design. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /src/CoreAnimation/CADisplayLink+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // CADisplayLink+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 7/09/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | typedef void (^IBADisplayLinkBlock)(CADisplayLink *); 23 | 24 | @interface CADisplayLink (IBAExtensions) 25 | 26 | + (CADisplayLink *)ibaDisplayLinkWithBlock:(IBADisplayLinkBlock)block; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /src/CoreAnimation/IBACoreAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBACoreAnimation.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 7/09/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "CADisplayLink+IBAExtensions.h" -------------------------------------------------------------------------------- /src/CoreData/IBACoreData.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBACoreGraphics.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 6/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 9 | // use this file except in compliance with the License. You may obtain a copy 10 | // of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | // License for the specific language governing permissions and limitations under 18 | // the License. 19 | // 20 | 21 | #import "../Foundation/IBAFoundation.h" 22 | 23 | #import "IBACoreDataContextProvider.h" 24 | #import "IBAAbstractCoreDataService.h" 25 | #import "NSEntityDescription+IBAExtensions.h" 26 | #import "NSError+IBACoreDataErrors.h" 27 | #import "NSFetchRequest+IBAExtensions.h" 28 | #import "NSExpressionDescription+IBAExtensions.h" 29 | #import "NSManagedObjectContext+IBAExtensions.h" -------------------------------------------------------------------------------- /src/CoreData/IBACoreDataContextProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBACoreDataContextProvider.h 3 | // IttyBittyBits 4 | // 5 | // Created by Sean Woodhouse on 22/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | #import 22 | 23 | @interface IBACoreDataContextProvider : NSObject { 24 | NSManagedObjectModel *managedObjectModel_; 25 | NSManagedObjectContext *managedObjectContext_; 26 | NSPersistentStoreCoordinator *persistentStoreCoordinator_; 27 | NSArray *resourceBundles_; 28 | } 29 | 30 | @property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel; 31 | @property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext; 32 | @property (nonatomic, retain, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator; 33 | 34 | // Setting this property to YES will set the NSFileProtectionKey attribute to 35 | // NSFileProtectionComplete on the db file, enabling db encryption. 36 | @property (nonatomic, assign) BOOL fileProtectionEnabled; 37 | 38 | + (IBACoreDataContextProvider *)sharedIBACoreDataContextProvider; 39 | 40 | - (id)initWithResourceBundles:(NSArray *)theResourceBundles; 41 | - (NSManagedObjectContext *)newManagedObjectContext; 42 | - (void)handleCoreDataError:(NSError *)error; 43 | - (void)deletePersistentStore; 44 | 45 | 46 | @end -------------------------------------------------------------------------------- /src/CoreData/NSEntityDescription+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSEntityDescription+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 28/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | #import 22 | 23 | @interface NSEntityDescription (IBAExtensions) 24 | 25 | - (NSAttributeDescription*) ibaAttributeByName:(NSString *)name; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /src/CoreData/NSEntityDescription+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSEntityDescription+IBAExtensions.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 28/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "NSEntityDescription+IBAExtensions.h" 21 | 22 | 23 | @implementation NSEntityDescription (IBAExtensions) 24 | 25 | - (NSAttributeDescription*) ibaAttributeByName:(NSString *)name 26 | { 27 | NSDictionary *attributes = [self attributesByName]; 28 | return [attributes objectForKey:name]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /src/CoreData/NSError+IBACoreDataErrors.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSError+IBACoreDataErrors.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 28/07/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface NSError (IBACoreDataErrors) 23 | 24 | - (BOOL)ibaIsCoreDataValidationError; 25 | - (NSArray *)ibaCoreDataValidationErrors; 26 | - (NSArray *)ibaCoreDataValidationErrorsPassingTest:(BOOL (^)(id obj, NSUInteger idx, BOOL *stop))predicate; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /src/CoreData/NSExpressionDescription+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSExpressionDescription+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 28/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | #import 22 | 23 | @interface NSExpressionDescription (IBAExtensions) 24 | 25 | + (NSExpressionDescription *)ibaExpressionForFunction:(NSString *)function 26 | onAttribute:(NSString *)attribute 27 | ofEntity:(NSEntityDescription*)entity 28 | asName:(NSString*)name; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /src/CoreData/NSExpressionDescription+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSExpressionDescription+IBAExtensions.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 28/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "NSExpressionDescription+IBAExtensions.h" 21 | #import 22 | 23 | #import "NSEntityDescription+IBAExtensions.h" 24 | #import "../Foundation/IBAFoundation.h" 25 | 26 | @implementation NSExpressionDescription (IBAExtensions) 27 | 28 | 29 | + (NSExpressionDescription *)ibaExpressionForFunction:(NSString *)function 30 | onAttribute:(NSString *)attribute 31 | ofEntity:(NSEntityDescription*)entity 32 | asName:(NSString*)name 33 | { 34 | NSExpression* keyPathExpression = [NSExpression expressionForKeyPath:attribute]; 35 | NSExpression* expression = [NSExpression expressionForFunction:function 36 | arguments:IBA_NSARRAY(keyPathExpression)]; 37 | 38 | NSExpressionDescription* expressionDescription = [[NSExpressionDescription alloc] init]; 39 | [expressionDescription setName:name]; 40 | [expressionDescription setExpression:expression]; 41 | [expressionDescription setExpressionResultType:[[entity ibaAttributeByName:attribute] attributeType]]; 42 | 43 | return [expressionDescription autorelease]; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /src/CoreData/NSFetchRequest+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSFetchRequest+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 28/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | #import 22 | 23 | @interface NSFetchRequest (IBAExtensions) 24 | 25 | + (id)ibaDictionaryFetchRequestForEntity:(NSString *)entityName inContext:(NSManagedObjectContext*)context; 26 | + (id)ibaFetchRequestForEntity:(NSString *)entityName inContext:(NSManagedObjectContext*)context; 27 | 28 | + (id)ibaFetchRequestForEntity:(NSString *)entityName 29 | inContext:(NSManagedObjectContext *)context 30 | withPredicate:(id)stringOrPredicate, ...; 31 | 32 | + (id)ibaFetchRequestForEntity:(NSString *)entityName 33 | inContext:(NSManagedObjectContext *)context 34 | withPredicate:(NSString*)stringPredicate 35 | args:(va_list)variadicArguments; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /src/CoreData/NSManagedObjectContext+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSManagedObjectContext.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 28/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | #import 22 | 23 | #import "../Foundation/IBAErrors.h" 24 | 25 | @interface NSManagedObjectContext (IBAExtensions) 26 | 27 | - (NSUInteger)ibaCountForFetchRequest:(NSFetchRequest*)request 28 | errorHandler:(IBAErrorHandler)errorHandler; 29 | 30 | - (NSArray *)ibaExecuteFetchRequest:(NSFetchRequest*)request 31 | errorHandler:(IBAErrorHandler)errorHandler; 32 | 33 | - (NSArray *)ibaExecuteFetchRequestForEntity:(NSString *)entityName 34 | withErrorHandler:(IBAErrorHandler)errorHandler 35 | forPredicate:(id)stringOrPredicate, ...; 36 | 37 | - (BOOL)ibaSaveWithErrorHandler:(IBAErrorHandler)errorHandler; 38 | 39 | - (void)ibaDeleteEntitiesNamed:(NSString *)entityName 40 | withErrorHandler:(IBAErrorHandler)errorHandler 41 | matchingPredicate:(id)stringOrPredicate, ...; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /src/CoreGraphics/IBACoreGraphics.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBACoreGraphics.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 6/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 9 | // use this file except in compliance with the License. You may obtain a copy 10 | // of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | // License for the specific language governing permissions and limitations under 18 | // the License. 19 | // 20 | 21 | #import "../Foundation/IBAFoundation.h" 22 | 23 | #import "IBAResourceBundle+CoreGraphics.h" 24 | #import "IBAResourceManager+CoreGraphics.h" 25 | #import "IBARoundedRectPath.h" 26 | -------------------------------------------------------------------------------- /src/CoreGraphics/IBAResourceBundle+CoreGraphics.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceBundle+CoreGraphics.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 14/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "../Foundation/IBAResourceBundle.h" 21 | 22 | @interface IBAResourceBundle (CoreGraphics) 23 | 24 | - (CGSize)sizeNamed:(NSString *)name; 25 | - (CGRect)rectNamed:(NSString *)name; 26 | - (CGPoint)pointNamed:(NSString *)name; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /src/CoreGraphics/IBAResourceManager+CoreGraphics.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceManager+CoreGraphics.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 14/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "../Foundation/IBAResourceManager.h" 21 | 22 | @interface IBAResourceManager (CoreGraphics) 23 | 24 | - (CGSize)sizeNamed:(NSString *)name; 25 | - (CGRect)rectNamed:(NSString *)name; 26 | - (CGPoint)pointNamed:(NSString *)name; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /src/CoreGraphics/IBAResourceManager+CoreGraphics.m: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceManager+CoreGraphics.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 14/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "IBAResourceManager+CoreGraphics.h" 21 | #import "IBAResourceBundle+CoreGraphics.h" 22 | 23 | #import "../Foundation/IBAResourceManager+Internal.h" 24 | 25 | @implementation IBAResourceManager (CoreGraphics) 26 | 27 | ImplResourceNamed(size, CGSize, CGSizeZero) 28 | ImplResourceNamed(rect, CGRect, CGRectZero) 29 | ImplResourceNamed(point, CGPoint, CGPointZero) 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /src/CoreGraphics/IBARoundedRectPath.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBARoundedRectPath.h 3 | // IttyBittyBits 4 | // 5 | // Copyright 2010 Google Inc. 6 | // Modified by Oliver Jones on 6/05/11. 7 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 10 | // use this file except in compliance with the License. You may obtain a copy 11 | // of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 18 | // License for the specific language governing permissions and limitations under 19 | // the License. 20 | // 21 | 22 | #import 23 | 24 | #import "../Foundation/IBACommon.h" 25 | 26 | IBA_EXTERN_C_BEGIN 27 | 28 | /*! 29 | \brief Inscribe a round rectangle inside of rectangle \a rect with a corner radius \a radius. 30 | \param rect 31 | Iuter rectangle to inscribe into. 32 | \param radius 33 | Radius of the corners. \a radius is clamped internally to be no larger than the smaller of half \a rect's width or height 34 | */ 35 | void IBACGContextAddRoundRect(CGContextRef context, CGRect rect, CGFloat radius); 36 | 37 | /*! 38 | \brief Adds a path which is a round rectangle inscribed inside of rectangle \a rect with a corner radius of \a radius. 39 | \param path 40 | Path to add the rounded rectangle to. 41 | \param m 42 | Matrix modifying the round rect. 43 | \param rect 44 | Outer rectangle to inscribe into. 45 | \param radius 46 | Radius of the corners. \a radius is clamped internally to be no larger than the smaller of half \a rect's width or height. 47 | */ 48 | void IBACGPathAddRoundRect(CGMutablePathRef path, 49 | const CGAffineTransform *m, 50 | CGRect rect, 51 | CGFloat radius); 52 | 53 | IBA_EXTERN_C_END 54 | -------------------------------------------------------------------------------- /src/CoreLocation/IBACoreLocation.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBACoreLocation.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 20/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 9 | // use this file except in compliance with the License. You may obtain a copy 10 | // of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | // License for the specific language governing permissions and limitations under 18 | // the License. 19 | // 20 | 21 | #import 22 | 23 | /*! 24 | \brief Compares to CLLocationCoordinate2D structs for equality. 25 | */ 26 | #define IBACLLocationCoordinate2DAreEqual(x, y) (((x).latitude - (y).latitude) == 0.0 && ((x).longitude - (y).longitude) == 0.0) -------------------------------------------------------------------------------- /src/CoreLocation/IBACoreLocation.m: -------------------------------------------------------------------------------- 1 | // 2 | // IBACoreLocation.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 29/09/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 9 | // use this file except in compliance with the License. You may obtain a copy 10 | // of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | // License for the specific language governing permissions and limitations under 18 | // the License. 19 | // 20 | 21 | #import "IBACoreLocation.h" 22 | 23 | -------------------------------------------------------------------------------- /src/Foundation/IBABinding.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBABinding.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 25/07/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @class IBABinding; 23 | 24 | typedef void (^IBABindingActionBlock)(IBABinding *binding, id oldValue, id newValue); 25 | 26 | @interface IBABinding : NSObject 27 | 28 | @property (nonatomic, retain, readonly) NSObject *source; 29 | @property (nonatomic, retain, readonly) NSObject *target; 30 | @property (nonatomic, retain, readonly) NSString *sourceKeyPath; 31 | @property (nonatomic, retain, readonly) NSString *targetKeyPath; 32 | @property (nonatomic, copy, readonly) IBABindingActionBlock action; 33 | 34 | + (id)bindingWithSourceObject:(NSObject *)source 35 | sourceKeyPath:(NSString *)sourceKeyPath 36 | targetObject:(NSObject *)target 37 | targetPath:(NSString *)targetKeyPath 38 | initializeTarget:(BOOL)initializeTarget 39 | action:(IBABindingActionBlock)blockOrNil; 40 | 41 | - (id)initWithSourceObject:(NSObject *)source 42 | sourceKeyPath:(NSString *)sourceKeyPath 43 | targetObject:(NSObject *)target 44 | targetPath:(NSString *)targetKeyPath 45 | initializeTarget:(BOOL)initializeTarget 46 | action:(IBABindingActionBlock)blockOrNil; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /src/Foundation/IBABindingManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBABindingManager.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 25/07/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | #import "IBABinding.h" 22 | 23 | typedef enum 24 | { 25 | IBABindingManagerOptionsNone = 0, 26 | IBABindingManagerOptionsIntializeTarget, 27 | IBABingingManagerOptionsBidirectional 28 | } IBABindingManagerOptions; 29 | 30 | @interface IBABindingManager : NSObject 31 | 32 | - (void)bindSource:(NSObject *)source 33 | withKeyPath:(NSString *)sourceKeyPath 34 | toTarget:(NSObject *)target; 35 | 36 | - (void)bindSource:(NSObject *)source 37 | withKeyPath:(NSString *)sourceKeyPath 38 | toTarget:(NSObject *)target 39 | withTargetKeyPath:(NSString *)targetKeyPath; 40 | 41 | - (void)bindSource:(NSObject *)source 42 | withKeyPath:(NSString *)sourceKeyPath 43 | toTarget:(NSObject *)target 44 | withTargetKeyPath:(NSString *)targetKeyPath 45 | options:(IBABindingManagerOptions)options; 46 | 47 | - (void)bindSource:(NSObject *)source 48 | withKeyPath:(NSString *)sourceKeyPath 49 | toTarget:(NSObject *)target 50 | withTargetKeyPath:(NSString *)targetKeyPath 51 | options:(IBABindingManagerOptions)options 52 | action:(IBABindingActionBlock)blockOrNil; 53 | 54 | - (void)unbindSource:(NSObject *)source; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /src/Foundation/IBACancelToken.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBACancelToken.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 21/10/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface IBACancelToken : NSObject 23 | 24 | + (id)token; 25 | 26 | - (void)cancel; 27 | - (BOOL)cancelled; 28 | - (BOOL)notCancelled; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /src/Foundation/IBACancelToken.m: -------------------------------------------------------------------------------- 1 | // 2 | // IBACancelToken.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 21/10/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "IBACancelToken.h" 21 | #import "IBACommon.h" 22 | 23 | #import 24 | 25 | @implementation IBACancelToken 26 | { 27 | NSObject *lock; 28 | __volatile BOOL cancelled; 29 | } 30 | 31 | + (id)token 32 | { 33 | return [[IBACancelToken new] autorelease]; 34 | } 35 | 36 | - (id)init 37 | { 38 | if ((self = [super init])) 39 | { 40 | lock = [NSObject new]; 41 | } 42 | 43 | return self; 44 | } 45 | 46 | - (void)dealloc 47 | { 48 | IBA_RELEASE(lock); 49 | [super dealloc]; 50 | } 51 | 52 | - (void)cancel 53 | { 54 | @synchronized(lock) 55 | { 56 | cancelled = YES; 57 | } 58 | } 59 | 60 | - (BOOL)notCancelled 61 | { 62 | return [self cancelled] == NO; 63 | } 64 | 65 | - (BOOL)cancelled 66 | { 67 | @synchronized(lock) 68 | { 69 | return cancelled; 70 | } 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /src/Foundation/IBADelimitedTextFileReaderDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // IBADelimitedTextFileReaderDelegate.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 10/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #include "IBADelimitedTextFileReaderDelegate.h" 21 | 22 | @implementation IBADelimitedTextFileReaderDelegateBlockAdapter 23 | 24 | - (id) initWithDidReadRecordBlock:(IBADelimitedTextFileReaderDidReadRecordBlock)block 25 | { 26 | if ((self = [super init])) 27 | { 28 | didReadRecordBlock = [block copy]; 29 | } 30 | 31 | return self; 32 | } 33 | 34 | - (void)dealloc 35 | { 36 | [didReadRecordBlock release]; 37 | 38 | [super dealloc]; 39 | } 40 | 41 | - (void) didReadColumnHeaders:(NSArray*)columnHeaders 42 | { 43 | if (didReadColumnHeaders) 44 | { 45 | didReadColumnHeaders(columnHeaders); 46 | } 47 | } 48 | 49 | - (void) didReadRecord:(NSDictionary*)record 50 | { 51 | didReadRecordBlock(record); 52 | } 53 | 54 | @end -------------------------------------------------------------------------------- /src/Foundation/IBADispatch.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBADispatch.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 26/09/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #ifndef IttyBittyBits_IBADispatch_h 21 | #define IttyBittyBits_IBADispatch_h 22 | 23 | /*! 24 | \brief Helper macro to dispatch blocks asynchronously to the application's main event loop queue. 25 | \param block The block to dispatch. 26 | */ 27 | #define iba_dispatch_to_main_queue(block) dispatch_async(dispatch_get_main_queue(), (block)) 28 | 29 | /*! 30 | \brief Helper macro to dispatch blocks asynchronously to the application's global queue with default priority. 31 | \param block The block to dispatch. 32 | */ 33 | #define iba_dispatch_to_default_queue(block) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), (block)) 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/Foundation/IBAErrors.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAErrors.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 12/07/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 9 | // use this file except in compliance with the License. You may obtain a copy 10 | // of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | // License for the specific language governing permissions and limitations under 18 | // the License. 19 | // 20 | 21 | typedef void (^IBAErrorHandler)(NSError *error); 22 | 23 | 24 | /*! 25 | \def IBASetError 26 | \brief Helper macro to set an pointer to a NSError. 27 | \details Ensures that the pointer references a valid NSError pointer before assigning to it. 28 | */ 29 | #define IBASetOutError(error, value) do { if (error) { (*(error)) = (value); } } while(0) -------------------------------------------------------------------------------- /src/Foundation/IBAPathUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAPathUtilities.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 14/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | #import "IBACommon.h" 22 | 23 | IBA_EXTERN_C_BEGIN 24 | 25 | NSString *IBAApplicationCachesDirectory(void); 26 | 27 | IBA_EXTERN_C_END -------------------------------------------------------------------------------- /src/Foundation/IBAPathUtilities.m: -------------------------------------------------------------------------------- 1 | // 2 | // IBAPathUtilities.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 14/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "IBAPathUtilities.h" 21 | 22 | /*! 23 | \brief Returns the current application's Caches directory. 24 | */ 25 | NSString *IBAApplicationCachesDirectory(void) 26 | { 27 | NSString *path = nil; 28 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); 29 | 30 | if ([paths count]) 31 | { 32 | NSString *bundleName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"]; 33 | path = [[paths objectAtIndex:0] stringByAppendingPathComponent:bundleName]; 34 | } 35 | 36 | return path; 37 | } 38 | -------------------------------------------------------------------------------- /src/Foundation/IBAResourceBundle+Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceBundle+IBAInternal.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 14/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "IBAResourceBundle.h" 21 | 22 | @interface IBAResourceBundle () 23 | - (NSString *)resolveResourceName:(NSString *)name; 24 | @property (nonatomic, retain, readonly) NSDictionary *resources; 25 | @property (nonatomic, retain, readonly) NSCache *cache; 26 | @property (nonatomic, retain, readonly) NSBundle *bundle; 27 | @end 28 | -------------------------------------------------------------------------------- /src/Foundation/IBAResourceBundle.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceBundle.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 25/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface IBAResourceBundle : NSObject 23 | 24 | + (id)bundleNamed:(NSString *)name; 25 | 26 | - (id)initWithBundleName:(NSString *)name; 27 | - (BOOL)hasResourceNamed:(NSString *)name; 28 | 29 | - (NSString *)stringNamed:(NSString *)name; 30 | - (NSData *)dataNamed:(NSString *)name; 31 | - (NSNumber *)numberNamed:(NSString *)name; 32 | 33 | @end 34 | 35 | -------------------------------------------------------------------------------- /src/Foundation/IBAResourceManager+Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceManager+Internal.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 14/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "IBAResourceManager.h" 21 | #import "IBAResourceBundle+Internal.h" 22 | #import "IBAStack.h" 23 | #import "IBALogger.h" 24 | 25 | #define ImplResourceNamed(name, type, default) \ 26 | - (type)name##Named:(NSString *)name \ 27 | { \ 28 | for (IBAResourceBundle *bundle in self.bundleStack) \ 29 | { \ 30 | if ([bundle hasResourceNamed:name]) { \ 31 | type resource = (type)[bundle name##Named:name]; \ 32 | return resource; \ 33 | } \ 34 | } \ 35 | \ 36 | IBALogError(@"Failed to find resource with name '%@', returning default.", name); \ 37 | return (default); \ 38 | } 39 | 40 | @interface IBAResourceManager () 41 | @property (nonatomic, retain, readonly) IBAStack *bundleStack; 42 | @end -------------------------------------------------------------------------------- /src/Foundation/IBAResourceManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceManager.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 25/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @class IBAResourceBundle; 23 | 24 | @interface IBAResourceManager : NSObject 25 | 26 | /*! 27 | \brief Returns a shared singleton instance of the theme manager. 28 | */ 29 | + (IBAResourceManager *)sharedInstance; 30 | 31 | - (void)pushResourceBundleNamed:(NSString *)bundleName; 32 | - (void)pushResourceBundle:(IBAResourceBundle *)bundle; 33 | - (void)popResourceBundle; 34 | 35 | - (NSString *)stringNamed:(NSString *)name; 36 | - (NSData *)dataNamed:(NSString *)name; 37 | - (NSNumber *)numberNamed:(NSString *)name; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /src/Foundation/IBAResourceManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceManager.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 25/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "IBAResourceManager.h" 21 | #import "IBAResourceBundle.h" 22 | 23 | #import "IBAResourceManager+Internal.h" 24 | 25 | #import "../Foundation/IBAFoundation.h" 26 | 27 | @implementation IBAResourceManager 28 | 29 | IBA_SYNTHESIZE_SINGLETON_FOR_CLASS(IBAResourceManager, sharedInstance); 30 | IBA_SYNTHESIZE(bundleStack); 31 | 32 | - (id)init 33 | { 34 | if ((self = [super init])) 35 | { 36 | IBA_RETAIN_PROPERTY(bundleStack, [IBAStack stack]); 37 | } 38 | 39 | return self; 40 | } 41 | 42 | - (void)dealloc 43 | { 44 | IBA_RELEASE_PROPERTY(bundleStack); 45 | 46 | [super dealloc]; 47 | } 48 | 49 | - (void)pushResourceBundleNamed:(NSString *)bundleName 50 | { 51 | IBAAssertNotNilOrEmptyString(bundleName); 52 | [self pushResourceBundle:[IBAResourceBundle bundleNamed:bundleName]]; 53 | } 54 | 55 | - (void)pushResourceBundle:(IBAResourceBundle *)bundle 56 | { 57 | IBAAssertNotNil(bundle); 58 | [self.bundleStack pushObject:bundle]; 59 | } 60 | 61 | - (void)popResourceBundle 62 | { 63 | [self.bundleStack popObject]; 64 | } 65 | 66 | ImplResourceNamed(string, NSString *, nil) 67 | ImplResourceNamed(data, NSData *, nil) 68 | ImplResourceNamed(number, NSNumber *, nil) 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /src/Foundation/IBAStack.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAStack.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 25/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface IBAStack : NSObject 23 | 24 | + (IBAStack *)stack; 25 | + (IBAStack *)stackWithCapacity:(NSUInteger)numItems; 26 | 27 | - (id)initWithCapacity:(NSUInteger)numItems; 28 | - (void)pushObject:(id)object; 29 | - (id)popObject; 30 | - (NSArray *)popAllObjects; 31 | - (id)peekObject; 32 | - (BOOL)isEmpty; 33 | - (NSUInteger)count; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /src/Foundation/IBAStateMachine.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAStateMachine.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 28/07/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | typedef NSInteger IBAState; 23 | typedef void (^IBAStateTransitionBlock)(IBAState from, IBAState to); 24 | typedef void (^IBAStateActionBlock)(IBAState state); 25 | 26 | @interface IBAStateMachine : NSObject 27 | 28 | - (id)initWithInitialState:(IBAState)state; 29 | 30 | - (void)addTransitionFromState:(IBAState)fromState 31 | toState:(IBAState)toState; 32 | - (void)addTransitionFromState:(IBAState)fromState 33 | toState:(IBAState)toState 34 | withTransition:(IBAStateTransitionBlock)transition; 35 | 36 | - (void)transitionToState:(IBAState)state; 37 | 38 | - (void)whenExitingState:(IBAState)state invokeAction:(IBAStateActionBlock)action; 39 | - (void)whenEnteringState:(IBAState)state invokeAction:(IBAStateActionBlock)action; 40 | 41 | @property (nonatomic, readonly) IBAState currentState; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /src/Foundation/IBASynthesizeSingleton.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBASynthesizeSingleton.h 3 | // Copyright 2009 Matt Gallagher. All rights reserved. 4 | // 5 | // Modified by Oliver Jones. 6 | // 7 | // Permission is given to use this source code file without charge in any 8 | // project, commercial or otherwise, entirely at your risk, with the condition 9 | // that any redistribution (in part or whole) of source code must retain 10 | // this copyright and permission notice. Attribution in compiled projects is 11 | // appreciated but not required. 12 | // 13 | 14 | #define IBA_SYNTHESIZE_SINGLETON_FOR_CLASS(classname, accessorname) \ 15 | static classname *shared##classname = nil; \ 16 | + (classname *)accessorname \ 17 | { \ 18 | static dispatch_once_t p; \ 19 | dispatch_once(&p, \ 20 | ^{ \ 21 | if (shared##classname == nil) \ 22 | { \ 23 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; \ 24 | shared##classname = [[self alloc] init]; \ 25 | [pool drain]; \ 26 | } \ 27 | }); \ 28 | return shared##classname; \ 29 | } \ 30 | + (id)allocWithZone:(NSZone *)zone \ 31 | { \ 32 | static dispatch_once_t p; \ 33 | __block classname* temp = nil; \ 34 | dispatch_once(&p, \ 35 | ^{ \ 36 | if (shared##classname == nil) \ 37 | { \ 38 | temp = shared##classname = [super allocWithZone:zone]; \ 39 | } \ 40 | }); \ 41 | return temp; \ 42 | } \ 43 | - (id)copyWithZone:(NSZone *)IBA_UNUSED zone { return self; } \ 44 | - (id)retain { return self; } \ 45 | - (NSUInteger)retainCount { return NSUIntegerMax; } \ 46 | - (oneway void)release { } \ 47 | - (id)autorelease { return self; } 48 | -------------------------------------------------------------------------------- /src/Foundation/IBATemporaryFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAFileUtils.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 4/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | /*! 23 | \brief Encapsulates a the creation of removal of a temporary file. The temporary file is created in the user's temporary directory. 24 | \sa NSTemporaryDirectory() 25 | */ 26 | @interface IBATemporaryFile : NSObject 27 | { 28 | } 29 | 30 | + (IBATemporaryFile *)temporaryFileWithTemplate:(NSString *)filenameTemplate; 31 | - (id)initWithFilenameTemplate:(NSString *)filenameTemplate; 32 | 33 | /*! 34 | \brief The open filehandle ready for reading/writing. 35 | \details The file will be closed and deleted when this IBATemporaryFile instance is released. 36 | */ 37 | @property (nonatomic, readonly) NSFileHandle *handle; 38 | 39 | /*! 40 | \brief The fully qualified path to the temporary file. 41 | */ 42 | @property (nonatomic, readonly) NSString *filepath; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /src/Foundation/NSArray+IBASorting.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+IBASorting.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 18/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | 21 | #import 22 | 23 | @interface NSArray (IBASorting) 24 | 25 | - (NSArray *)ibaSortedArrayOfNumbers; 26 | - (NSArray *)ibaSortedArrayOfLocalizedStrings; 27 | 28 | - (NSArray *)ibaReversedArray; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /src/Foundation/NSArray+IBAWhitespace.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+IBAWhitespace.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 10/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | 23 | @interface NSArray (IBAWhitespace) 24 | 25 | - (NSString *)ibaNonEmptyComponentsJoinedByString:(NSString *)string; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /src/Foundation/NSArray+IBAWhitespace.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+IBAWhitespace.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 10/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | 21 | #import "NSArray+IBAWhitespace.h" 22 | #import "IBACommon.h" 23 | 24 | @implementation NSArray (IBAWhitespace) 25 | 26 | /*! 27 | \brief Constructs and returns an NSString object that is the result of interposing a given separator between the non-empty elements of the array. 28 | \param separator 29 | The string to interpose between the elements of the array. 30 | \return An NSString object that is the result of interposing separator between the elements of the array. If the array has no elements, returns an NSString object representing an empty string. 31 | 32 | \note Each element in the array must handle description. 33 | */ 34 | - (NSString *)ibaNonEmptyComponentsJoinedByString:(NSString *)string 35 | { 36 | NSMutableArray *nonEmpty = [[NSMutableArray alloc] initWithCapacity:[self count]]; 37 | 38 | for (id item in self) 39 | { 40 | if ([@"" isEqualToString:[item description]] == NO) 41 | { 42 | [nonEmpty addObject:item]; 43 | } 44 | } 45 | 46 | NSString *joined = [nonEmpty componentsJoinedByString:string]; 47 | 48 | IBA_RELEASE(nonEmpty); 49 | 50 | return joined; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /src/Foundation/NSDictionary+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+IBHelper.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 18/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface NSDictionary (IBAExtensions) 23 | 24 | - (id)ibaObjectForKey:(id)key withDefault:(id)defaultValue; 25 | - (NSString *)ibaStringForKey:(id)key; 26 | - (id)ibaObjectForUIntegerKey:(NSUInteger)key; 27 | - (id)ibaObjectForIntegerKey:(NSInteger)key; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /src/Foundation/NSDictionary+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+IBHelper.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 18/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "NSDictionary+IBAExtensions.h" 21 | 22 | 23 | @implementation NSDictionary (IBAExtensions) 24 | 25 | 26 | /*! 27 | \brief Returns the value associated with a given \a key; or \a defaultValue if no value is associated with the given \a key. 28 | */ 29 | - (id)ibaObjectForKey:(id)key withDefault:(id)defaultValue 30 | { 31 | id o = [self objectForKey:key]; 32 | return o != nil ? o : defaultValue; 33 | } 34 | 35 | /*! 36 | \brief Get a string for the specified dictionary \a key. 37 | */ 38 | - (NSString *)ibaStringForKey:(id)key 39 | { 40 | id o = [self objectForKey:key]; 41 | return (NSString *)o; 42 | } 43 | 44 | /*! 45 | \brief Returns the object associated with a given NSUInteger \a key. 46 | */ 47 | - (id)ibaObjectForUIntegerKey:(NSUInteger)key 48 | { 49 | NSNumber* number = [NSNumber numberWithUnsignedInteger:key]; 50 | return [self objectForKey:number]; 51 | } 52 | 53 | /*! 54 | \brief Returns the object associated with a given NSInteger \a key. 55 | */ 56 | - (id)ibaObjectForIntegerKey:(NSInteger)key 57 | { 58 | NSNumber* number = [NSNumber numberWithInteger:key]; 59 | return [self objectForKey:number]; 60 | } 61 | 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /src/Foundation/NSError+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSError+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 20/07/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface NSError (IBAExtensions) 23 | 24 | + (NSError *)ibaErrorWithDomain:(NSString *)domain 25 | code:(NSInteger)errorCode 26 | localizedDescription:(NSString *)description; 27 | 28 | + (NSError *)ibaErrorWithDomain:(NSString *)domain 29 | code:(NSInteger)errorCode 30 | localizedDescription:(NSString *)description 31 | cause:(NSError *)cause; 32 | 33 | + (NSError *)ibaErrorWithPOSIXErrorCode:(int)code; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /src/Foundation/NSError+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSError+IBAExtensions.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 20/07/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "NSError+IBAExtensions.h" 21 | 22 | @implementation NSError (IBAExtensions) 23 | 24 | + (NSError *)ibaErrorWithDomain:(NSString *)domain 25 | code:(NSInteger)errorCode 26 | localizedDescription:(NSString *)description 27 | { 28 | NSDictionary *userInfo = [NSDictionary dictionaryWithObject:description forKey:NSLocalizedDescriptionKey]; 29 | return [[[NSError alloc] initWithDomain:domain code:errorCode userInfo:userInfo] autorelease]; 30 | } 31 | 32 | + (NSError *)ibaErrorWithDomain:(NSString *)domain 33 | code:(NSInteger)errorCode 34 | localizedDescription:(NSString *)description 35 | cause:(NSError *)cause 36 | { 37 | NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithObject:description forKey:NSLocalizedDescriptionKey]; 38 | 39 | if (cause != nil) 40 | { 41 | [userInfo setObject:cause forKey:NSUnderlyingErrorKey]; 42 | } 43 | 44 | return [[[NSError alloc] initWithDomain:domain code:errorCode userInfo:[NSDictionary dictionaryWithDictionary:userInfo]] autorelease]; 45 | } 46 | 47 | + (NSError *)ibaErrorWithPOSIXErrorCode:(int)code 48 | { 49 | return [self ibaErrorWithDomain:NSPOSIXErrorDomain code:code localizedDescription:[NSString stringWithUTF8String:strerror(code)]]; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /src/Foundation/NSFileManager+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSFileManager+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 14/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface NSFileManager (IBAExtensions) 23 | 24 | - (BOOL)ibaDirectoryExistsAtPath:(NSString *)directory; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /src/Foundation/NSFileManager+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSFileManager+IBAExtensions.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 14/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "NSFileManager+IBAExtensions.h" 21 | 22 | @implementation NSFileManager (IBAExtensions) 23 | 24 | 25 | /*! 26 | \brief Returns a Boolean value that indicates whether a file exists at the specified path and it is a directory. 27 | */ 28 | - (BOOL)ibaDirectoryExistsAtPath:(NSString *)directory 29 | { 30 | BOOL isDirectory = NO; 31 | BOOL fileExists = [self fileExistsAtPath:directory isDirectory:&isDirectory]; 32 | 33 | return fileExists && isDirectory; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /src/Foundation/NSHTTPURLResponse+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSHTTPURLResponse+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 3/10/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface NSHTTPURLResponse (IBAExtensions) 23 | 24 | - (NSString *)ibaDebugDescription; 25 | - (NSDate *)ibaDateHeader; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /src/Foundation/NSHTTPURLResponse+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSHTTPURLResponse+IBAExtensions.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 3/10/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "NSHTTPURLResponse+IBAExtensions.h" 21 | #import "NSDate+IBAExtensions.h" 22 | 23 | @implementation NSHTTPURLResponse (IBAExtensions) 24 | 25 | - (NSString *)ibaDebugDescription 26 | { 27 | return [NSString stringWithFormat:@"%d: %@, Expected Content Length: %lld, Headers: %@", self.statusCode, [[self class] localizedStringForStatusCode:self.statusCode], self.expectedContentLength, self.allHeaderFields]; 28 | } 29 | 30 | /*! 31 | \brief Returns the date header from the HTTP response (if the header exists & is parseable). 32 | \return The response header date/time if available; otherwise nil. 33 | */ 34 | - (NSDate *)ibaDateHeader 35 | { 36 | NSString *dateString = [[self allHeaderFields] objectForKey:@"Date"]; 37 | if (dateString) 38 | { 39 | return [NSDate ibaDateFromRFC822String:dateString]; 40 | } 41 | 42 | return nil; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /src/Foundation/NSMutableArray+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableArray+IBASorting.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 23/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | 21 | #import 22 | #import "NSMutableArray+IBASorting.h" 23 | 24 | @interface NSMutableArray (IBAExtensions) 25 | 26 | - (void)ibaReverse; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /src/Foundation/NSMutableArray+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableArray+IBASorting.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 23/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | 21 | #import "NSMutableArray+IBAExtensions.h" 22 | 23 | 24 | @implementation NSMutableArray (IBAExtensions) 25 | 26 | /*! 27 | \brief Reverses the order of elements in the receiving array. 28 | */ 29 | - (void)ibaReverse 30 | { 31 | NSUInteger i = 0, j = [self count] - 1; 32 | 33 | while (i < j) 34 | { 35 | [self exchangeObjectAtIndex:i withObjectAtIndex:j]; 36 | ++i; --j; 37 | } 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /src/Foundation/NSMutableArray+IBASorting.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableArray+IBASorting.h 3 | // IttyBittyBits 4 | // 5 | // Created by Sam Page on 25/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface NSMutableArray (IBASorting) 23 | 24 | - (void)ibaSortByPropertyKey:(NSString *)key ascending:(BOOL)ascending; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /src/Foundation/NSMutableArray+IBASorting.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableArray+IBASorting.m 3 | // IttyBittyBits 4 | // 5 | // Created by Sam Page on 25/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "NSMutableArray+IBASorting.h" 21 | 22 | @implementation NSMutableArray (IBASorting) 23 | 24 | - (void)ibaSortByPropertyKey:(NSString *)key ascending:(BOOL)ascending 25 | { 26 | 27 | NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:key ascending:ascending] autorelease]; 28 | NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor]; 29 | 30 | [self sortUsingDescriptors:sortDescriptors]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /src/Foundation/NSMutableDictionary+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableDictionary+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 11/07/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | #import "NSDictionary+IBAExtensions.h" 22 | #import "IBACommon.h" 23 | 24 | @interface NSMutableDictionary (IBAExtensions) 25 | 26 | - (void)ibaSetObject:(id)object forUIntegerKey:(NSUInteger)key; 27 | - (void)ibaSetObject:(id)object forIntegerKey:(NSInteger)key; 28 | - (id)ibaObjectForKey:(id)key setDefaultUsingBlock:(IBAObjectFactory)factory; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /src/Foundation/NSMutableDictionary+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableDictionary+IBAExtensions.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 11/07/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "NSMutableDictionary+IBAExtensions.h" 21 | #import "NSNumber+IBAExtensions.h" 22 | 23 | @implementation NSMutableDictionary (IBAExtensions) 24 | 25 | - (void)ibaSetObject:(id)object forUIntegerKey:(NSUInteger)key 26 | { 27 | [self setObject:object forKey:IBAUIntegerToNumber(key)]; 28 | } 29 | 30 | - (void)ibaSetObject:(id)object forIntegerKey:(NSInteger)key 31 | { 32 | [self setObject:object forKey:IBAIntegerToNumber(key)]; 33 | } 34 | 35 | /*! 36 | \brief Returns the value associated with a given key. If no value exists in the dictionary for the specified \a key the \a factory block is invoked and the retured result is added to the dictionary for \a key. 37 | \return The value associated with \a key, or the result of invoking the \a factory if no value is associated with \a key. 38 | */ 39 | - (id)ibaObjectForKey:(id)key setDefaultUsingBlock:(IBAObjectFactory)factory 40 | { 41 | id o = [self objectForKey:key]; 42 | if (o == nil) 43 | { 44 | o = factory(); 45 | [self setObject:o forKey:key]; 46 | } 47 | 48 | return o; 49 | } 50 | 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /src/Foundation/NSMutableSet+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableSet+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 25/07/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface NSMutableSet (IBAExtensions) 23 | 24 | - (void)ibaRemoveObjectsInArray:(NSArray *)objects; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /src/Foundation/NSMutableSet+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableSet+IBAExtensions.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 25/07/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "NSMutableSet+IBAExtensions.h" 21 | 22 | @implementation NSMutableSet (IBAExtensions) 23 | 24 | /*! 25 | \brief Removes all occurrences in the array of a given array if objects. 26 | \param objects An array of objects to remove. 27 | */ 28 | - (void)ibaRemoveObjectsInArray:(NSArray *)objects 29 | { 30 | for (id o in objects) 31 | { 32 | [self removeObject:o]; 33 | } 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /src/Foundation/NSObject+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 7/07/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | #import "IBACommon.h" 23 | 24 | @interface NSObject (IBAExtensions) 25 | 26 | + (id)ibaInstanceFromDictionary:(NSDictionary *)dictionary; 27 | 28 | - (void)ibaAddObserver:(NSObject *)anObserver forKeyPaths:(NSArray *)keyPaths options:(NSKeyValueObservingOptions)options context:(void *)context; 29 | 30 | - (void)ibaRemoveObserver:(NSObject *)anObserver forKeyPaths:(NSArray *)keyPaths; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /src/Foundation/NSOperationQueue+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSOperationQueue+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 26/09/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface NSOperationQueue (IBAExtensions) 23 | 24 | + (NSOperationQueue *)ibaOperationQueueWithName:(NSString *)name; 25 | + (NSOperationQueue *)ibaSerialOperationQueueWithName:(NSString *)name; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /src/Foundation/NSOperationQueue+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSOperationQueue+IBAExtensions.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 26/09/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "NSOperationQueue+IBAExtensions.h" 21 | 22 | @implementation NSOperationQueue (IBAExtensions) 23 | 24 | /*! 25 | \brief Returns an auto-released NSOperationQueue instance with the specified \a name. 26 | \param name The name of the queue. 27 | */ 28 | + (NSOperationQueue *)ibaOperationQueueWithName:(NSString *)name 29 | { 30 | NSOperationQueue *q = [[self alloc] init]; 31 | [q setName:name]; 32 | 33 | return [q autorelease]; 34 | } 35 | 36 | /*! 37 | \brief Returns an auto-released NSOperationQueue instance with the specified \a name and maxConcurrentOperationCount set to 1. 38 | \param name The name of the queue. 39 | */ 40 | + (NSOperationQueue *)ibaSerialOperationQueueWithName:(NSString *)name 41 | { 42 | NSOperationQueue *q = [self ibaOperationQueueWithName:name]; 43 | q.maxConcurrentOperationCount = 1; 44 | return q; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /src/Foundation/NSPropertyListSerialization+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSPropertyListSerialization+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 23/09/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | #import "IBACommon.h" 22 | 23 | typedef enum { 24 | IBAPropertyListSerializationErrorLoadFailed 25 | } IBAPropertyListSerializationErrorCodes; 26 | 27 | IBA_EXTERN NSString * const IBAPropertyListSerializationErrorDomain; 28 | 29 | @interface NSPropertyListSerialization (IBAExtensions) 30 | + (NSDictionary *)ibaDictionaryFromPropertyList:(NSString *)plistPath error:(NSError **)error; 31 | + (NSDictionary *)ibaDictionaryFromPropertyListData:(NSData *)data error:(NSError **)error; 32 | @end 33 | -------------------------------------------------------------------------------- /src/Foundation/NSString+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+IBAWhitespace.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 10/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // Copyright 2006-2008 Google Inc. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | 21 | #import 22 | 23 | /*! 24 | \def IBAIsNilOrEmptyString 25 | \brief Returns a value indicating whether the specified \a string is nil or empty. 26 | \return YES if the \a string is nil or empty; otherwise NO. 27 | */ 28 | #define IBAIsNilOrEmptyString(string) ((string) == nil || [@"" isEqualToString:(string)]) 29 | 30 | @interface NSString (IBAExtensions) 31 | 32 | - (NSString *)ibaStringByTrimmingWhitespaceAndNewline; 33 | - (NSString *)ibaStringByCompressingWhitespaceAndNewlineTo:(NSString *)seperator; 34 | - (BOOL)ibaNotBlank; 35 | 36 | - (NSString *)ibaURLEncoded; 37 | - (NSString *)ibaURLDecoded; 38 | 39 | - (NSString *)ibaStringByEscapingForHTML; 40 | - (NSString *)ibaStringByEscapingForAsciiHTML; 41 | - (NSString *)ibaStringByUnescapingFromHTML; 42 | 43 | - (NSData *)ibaObfuscateWithKey:(NSString *)key; 44 | 45 | + (NSString *)ibaStringByDeobfuscatingData:(NSData *)data withKey:(NSString *)key; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /src/Foundation/NSTimer+IBABlocks.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Remy Demarest 3 | Modifications Copyright (c) 2011 Oliver Jones 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without 8 | restriction, including without limitation the rights to use, 9 | copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following 12 | conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | #import 28 | 29 | typedef void (^IBATimerBlock)(NSTimer *); 30 | 31 | /*! 32 | \brief A category that adds the ability to schedule the execution of blocks with NSTimer. 33 | */ 34 | @interface NSTimer (IBABlocks) 35 | 36 | 37 | + (NSTimer *)ibaScheduledTimerWithTimeInterval:(NSTimeInterval)seconds 38 | repeats:(BOOL)repeats 39 | usingBlock:(IBATimerBlock)block; 40 | 41 | 42 | + (NSTimer *)ibaTimerWithTimeInterval:(NSTimeInterval)seconds 43 | repeats:(BOOL)repeats 44 | usingBlock:(IBATimerBlock)block; 45 | @end 46 | -------------------------------------------------------------------------------- /src/Foundation/NSURLRequest+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLRequest+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 3/10/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | @interface NSURLRequest (IBAExtensions) 21 | 22 | - (NSString *)ibaDebugDescription; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /src/Foundation/NSURLRequest+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLRequest+IBAExtensions.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 3/10/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "NSURLRequest+IBAExtensions.h" 21 | #import "NSString+IBAExtensions.h" 22 | 23 | @implementation NSURLRequest (IBAExtensions) 24 | 25 | - (NSString *)ibaDebugDescription 26 | { 27 | return [NSString stringWithFormat:@"%@, Headers: %@", [[self.URL description] ibaURLDecoded], self.allHTTPHeaderFields]; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /src/IttyBittyBits-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'IttyBittyBits' target in the 'IttyBittyBits' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | # import 7 | # import 8 | # import 9 | # import 10 | # import 11 | # import 12 | # import 13 | #endif 14 | -------------------------------------------------------------------------------- /src/IttyBittyBits.h: -------------------------------------------------------------------------------- 1 | // 2 | // IttyBittyBits.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 6/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "Foundation/IBAFoundation.h" 21 | #import "CoreAnimation/IBACoreAnimation.h" 22 | #import "CoreData/IBACoreData.h" 23 | #import "CoreLocation/IBACoreLocation.h" 24 | #import "CoreGraphics/IBACoreGraphics.h" 25 | #import "Security/IBASecurity.h" 26 | #import "UIKit/IBAUIKit.h" 27 | #import "MapKit/IBAMapKit.h" 28 | -------------------------------------------------------------------------------- /src/IttyBittyBits.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/MapKit/IBABreadcrumbPath.hh: -------------------------------------------------------------------------------- 1 | // 2 | // BreadCrumbPath.hh 3 | // CustomFleet 4 | // 5 | // Created by Oliver Jones on 27/06/11. 6 | // Copyright 2011 GE Capital Australia & New Zealand. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | #import 22 | 23 | @class IBABreadcrumbPathInternal; 24 | 25 | @interface IBABreadcrumbPath : NSObject { 26 | @private 27 | IBABreadcrumbPathInternal *internal; 28 | MKMapRect boundingMapRect; 29 | } 30 | 31 | @property (nonatomic, readonly) CLLocationCoordinate2D coordinate; 32 | @property (nonatomic, readonly) MKMapRect boundingMapRect; 33 | @property (nonatomic, readonly) std::vector mapPoints; 34 | 35 | - (id)initWithCenterCoordinate:(CLLocationCoordinate2D)coord; 36 | - (MKMapRect)addCoordinate:(CLLocationCoordinate2D)coord; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /src/MapKit/IBABreadcrumbPathView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BreadcrumbPathView.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 27/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface IBABreadcrumbPathView : MKOverlayView { 23 | 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /src/MapKit/IBAMapKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAMapKit.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 16/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "MKMapView+IBAAnnotations.h" 21 | #import "MKPlacemark+IBAFormattedAddress.h" 22 | #import "MKReverseGeocoder+IBABlocks.h" 23 | #import "IBAGeocoder.h" 24 | #import "IBAExtendedPlacemark.h" 25 | #import "IBABreadcrumbPathView.h" 26 | #import "IBAMapKitUtils.h" 27 | #import "IBAPointAnnotation.h" 28 | 29 | #ifdef __cplusplus 30 | # import "IBABreadcrumbPath.hh" 31 | #endif -------------------------------------------------------------------------------- /src/MapKit/IBAMapKitUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAMapKitUtils.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 30/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "../Foundation/IBAFoundation.h" 21 | #import 22 | 23 | IBA_EXTERN MKCoordinateRegion IBAMKCoordinateRegionNull; 24 | 25 | IBA_EXTERN_C_BEGIN 26 | 27 | MKCoordinateRegion IBAMKCoordinateRegionWithCoordinates(CLLocationCoordinate2D * coordinates, NSUInteger count); 28 | BOOL IBAMKCoordinateRegionIsNull(MKCoordinateRegion region); 29 | BOOL IBAMKCoordinateRegionIsEmpty(MKCoordinateRegion region); 30 | 31 | NSString *IBAMKCoordinateRegionDebugDescription(MKCoordinateRegion region); 32 | 33 | IBA_EXTERN_C_END 34 | -------------------------------------------------------------------------------- /src/MapKit/IBAPointAnnotation.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAPointAnnotation.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 25/10/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | /*! 23 | \brief MKPointAnnotation (or perhaps its base class) leaks so here we implement our own basic point annotation object. 24 | */ 25 | @interface IBAPointAnnotation : NSObject 26 | 27 | @property (nonatomic, assign, readwrite) CLLocationCoordinate2D coordinate; 28 | @property (nonatomic, copy, readwrite) NSString *title; 29 | @property (nonatomic, copy, readwrite) NSString *subtitle; 30 | 31 | + (id)annotationWithCoordinate:(CLLocationCoordinate2D)coordinate; 32 | - (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /src/MapKit/IBAPointAnnotation.m: -------------------------------------------------------------------------------- 1 | // 2 | // IBAPointAnnotation.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 25/10/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "IBAPointAnnotation.h" 21 | #import "../Foundation/IBAFoundation.h" 22 | 23 | @interface IBAPointAnnotation () 24 | @end 25 | 26 | @implementation IBAPointAnnotation 27 | 28 | + (id)annotationWithCoordinate:(CLLocationCoordinate2D)coordinate 29 | { 30 | return [[[self alloc] initWithCoordinate:coordinate] autorelease]; 31 | } 32 | 33 | IBA_SYNTHESIZE(coordinate, 34 | title, 35 | subtitle); 36 | 37 | - (id)init 38 | { 39 | return [self initWithCoordinate:kCLLocationCoordinate2DInvalid]; 40 | } 41 | 42 | - (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate 43 | { 44 | if ((self = [super init])) 45 | { 46 | IBA_PROPERTY_IVAR(coordinate) = coordinate; 47 | } 48 | 49 | return self; 50 | } 51 | 52 | - (void)dealloc 53 | { 54 | IBA_RELEASE_PROPERTY(title, 55 | subtitle); 56 | 57 | [super dealloc]; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /src/MapKit/MKMapView+IBAAnnotations.h: -------------------------------------------------------------------------------- 1 | // 2 | // MKMapView+IBAAnnotations.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 16/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | 21 | #import 22 | #import 23 | 24 | @interface MKMapView (IBAAnnotations) 25 | 26 | - (void)ibaSetRegionForAnnotations:(NSArray *)annotations 27 | animated:(BOOL)animated; 28 | 29 | - (void)ibaSetRegionForAnnotations:(NSArray *)annotations 30 | location:(CLLocationCoordinate2D)coordinate 31 | animated:(BOOL)animated; 32 | 33 | - (void)ibaSetRegionForCoordinates:(CLLocationCoordinate2D *)coordinates 34 | count:(NSUInteger)number 35 | animated:(BOOL)animated; 36 | 37 | - (void)ibaRemoveAllAnnotations; 38 | - (void)ibaRemoveAllOverlays; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /src/MapKit/MKPlacemark+IBAFormattedAddress.h: -------------------------------------------------------------------------------- 1 | // 2 | // MKPLacemark+IBAFormattedAddress.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 31/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | 23 | @interface MKPlacemark (IBAFormattedAddress) 24 | 25 | - (NSString *)ibaStreetName; 26 | - (NSString *)ibaStreetAddress; 27 | - (NSString *)ibaFormattedAddress; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /src/MapKit/MKReverseGeocoder+IBABlocks.h: -------------------------------------------------------------------------------- 1 | // 2 | // MKReverseGeocoder+IBABlocks.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 20/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | 21 | #import 22 | #import 23 | 24 | typedef void (^IBAReverseGeocoderBlock)(MKPlacemark *, NSError *); 25 | 26 | @interface MKReverseGeocoder (IBABlocks) 27 | 28 | - (void) ibaStartUsingBlock:(IBAReverseGeocoderBlock)block; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /src/Security/IBASecurity.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBASecurity.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 6/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "../Foundation/IBAFoundation.h" 21 | 22 | #import "IBAKeychainUtils.h" -------------------------------------------------------------------------------- /src/UIKit/IBAActionSheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAActionSheet.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 17/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | 21 | #import 22 | 23 | @class IBAActionSheet; 24 | 25 | typedef void (^IBAActionSheetActionBlock)(IBAActionSheet*); 26 | 27 | @interface IBAActionSheet : UIActionSheet 28 | { 29 | } 30 | 31 | + (id)actionSheetWithTitle:(NSString *)title 32 | delegate:(id)delegate; 33 | 34 | + (id)actionSheet; 35 | 36 | - (id)initWithTitle:(NSString *)title delegate:(id)delegate; 37 | 38 | - (NSInteger)addButtonWithTitle:(NSString *)title block:(IBAActionSheetActionBlock)blk; 39 | - (NSInteger)setDestructiveButtonTitle:(NSString *)title block:(IBAActionSheetActionBlock)blk; 40 | - (NSInteger)setCancelButtonTitle:(NSString *)title; 41 | - (NSInteger)setCancelButtonTitle:(NSString *)title block:(IBAActionSheetActionBlock)blk; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /src/UIKit/IBAAnchoredStackView.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAAnchoredStackView.h 3 | // IttyBittyBits 4 | // 5 | // Created by Sam Page on 23/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum 12 | { 13 | IBAAnchoredStackViewLeft, 14 | IBAAnchoredStackViewRight, 15 | IBAAnchoredStackViewBottom, 16 | IBAAnchoredStackViewTop, 17 | } IBAAnchoredStackViewAnchor; 18 | 19 | @interface IBAAnchoredStackView : UIView 20 | 21 | @property (nonatomic, assign) CGSize minimumSize; 22 | 23 | - (void)addSubview:(UIView *)view anchorTo:(IBAAnchoredStackViewAnchor)anchor; 24 | - (void)addSubview:(UIView *)view anchorTo:(IBAAnchoredStackViewAnchor)anchor padding:(CGFloat)padding; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /src/UIKit/IBAFlipViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAFlipViewController.h 3 | // IttyBittyBits 4 | // 5 | // Created by Jason Morrissey on 20/10/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "IBAViewController.h" 21 | #import "../Foundation/IBAFoundation.h" 22 | 23 | @protocol IBAFlipViewSideProtocol 24 | - (UIView *)view; 25 | @optional 26 | - (void)flipSideWillAppear; 27 | - (void)flipSideWillDisappear; 28 | - (void)flipSideDidAppear; 29 | @end 30 | 31 | @interface IBAFlipViewController : IBAViewController 32 | 33 | IBA_PROPERTY(assign, BOOL flipped); 34 | IBA_PROPERTY_STRONG(id frontViewCoordinator, 35 | id backViewCoordinator); 36 | IBA_PROPERTY(copy, IBAAction animateBlockDuringFlip); 37 | 38 | 39 | - (void)switchViews; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /src/UIKit/IBAGradientButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAGradientButton.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 23/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | 23 | @interface IBAGradientButton : UIButton 24 | { 25 | } 26 | 27 | @property (copy) NSArray *colors; 28 | @property (copy) NSArray *locations; 29 | @property (assign) CGPoint startPoint; 30 | @property (copy) NSString *type; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /src/UIKit/IBANavigationBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // IBANavigationBar.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 21/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "IBANavigationBar.h" 21 | #import "../Foundation/IBAFoundation.h" 22 | 23 | @implementation IBANavigationBar 24 | 25 | IBA_SYNTHESIZE(landscapeBackgroundImage, portraitBackgroundImage); 26 | 27 | /*! 28 | \brief Draws the receiver’s image within the passed-in rectangle. 29 | \param rect The portion of the view’s bounds that needs to be updated. 30 | */ 31 | -(void)drawRect:(CGRect)rect 32 | { 33 | UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; 34 | if (UIInterfaceOrientationIsPortrait(orientation) && self.portraitBackgroundImage) 35 | { 36 | [self.portraitBackgroundImage drawInRect:rect]; 37 | } 38 | else if (UIInterfaceOrientationIsLandscape(orientation) && self.landscapeBackgroundImage) 39 | { 40 | [self.landscapeBackgroundImage drawInRect:rect]; 41 | } 42 | else 43 | { 44 | [super drawRect:rect]; 45 | } 46 | } 47 | 48 | /*! 49 | \brief Deallocates the memory occupied by the receiver. 50 | */ 51 | - (void)dealloc 52 | { 53 | IBA_RELEASE_PROPERTY(portraitBackgroundImage); 54 | IBA_RELEASE_PROPERTY(landscapeBackgroundImage); 55 | 56 | [super dealloc]; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /src/UIKit/IBANavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBANavigationController.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 18/10/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | #import "IBAViewController.h" 22 | 23 | @class IBANavigationController; 24 | 25 | @protocol IBANavigationControllerDelegate 26 | @optional 27 | - (void)navigationController:(IBANavigationController *)navigationController didPopViewController:(UIViewController *)viewController animated:(BOOL)animated; 28 | - (void)navigationController:(IBANavigationController *)navigationController willPushViewController:(UIViewController *)viewController animated:(BOOL)animated; 29 | @end 30 | 31 | @interface IBANavigationController : UINavigationController 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /src/UIKit/IBAResourceBundle+UIKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceBundle+UIKit.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 14/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "../Foundation/IBAResourceBundle.h" 21 | 22 | @interface IBAResourceBundle (UIKit) 23 | 24 | - (void)setImageCacheMaxCost:(NSUInteger)maxCost; 25 | - (UIColor *)colorNamed:(NSString *)name; 26 | - (UIColor *)colorWithPatternNamed:(NSString *)name; 27 | - (UIImage *)imageNamed:(NSString *)name; 28 | - (UIFont *)fontNamed:(NSString *)name; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /src/UIKit/IBAResourceManager+UIKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceManager+UIKit.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 14/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "../Foundation/IBAResourceManager.h" 21 | 22 | @interface IBAResourceManager (UIKit) 23 | 24 | - (UIImage *)imageNamed:(NSString *)name; 25 | - (UIColor *)colorNamed:(NSString *)name; 26 | - (UIColor *)colorWithPatternNamed:(NSString *)name; 27 | - (UIFont *)fontNamed:(NSString *)name; 28 | - (BOOL)hasResource:(NSString *)name; 29 | 30 | // gradients? 31 | 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /src/UIKit/IBAResourceManager+UIKit.m: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceManager+UIKit.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 14/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "IBAResourceManager+UIKit.h" 21 | #import "IBAResourceBundle+UIKit.h" 22 | 23 | #import "../Foundation/IBAResourceManager.h" 24 | #import "../Foundation/IBAResourceManager+Internal.h" 25 | 26 | @implementation IBAResourceManager (UIKit) 27 | 28 | ImplResourceNamed(color, UIColor *, nil) 29 | ImplResourceNamed(image, UIImage *, nil) 30 | ImplResourceNamed(colorWithPattern, UIColor *, nil) 31 | ImplResourceNamed(font, UIFont *, nil) 32 | 33 | // For additional resource-name validation without throwing missing resource debug errors. 34 | - (BOOL)hasResource:(NSString *)name 35 | { 36 | for (IBAResourceBundle *bundle in self.bundleStack) 37 | { 38 | if ([bundle hasResourceNamed:name]) 39 | return YES; 40 | } 41 | return NO; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /src/UIKit/IBATableViewAccessory.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBATableViewAccessory.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 4/07/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | 23 | @interface IBATableViewAccessory : UIControl { 24 | } 25 | 26 | @property (nonatomic, retain) UIColor *accessoryColor; 27 | @property (nonatomic, retain) UIColor *highlightedColor; 28 | 29 | + (id)accessoryWithColor:(UIColor *)color; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /src/UIKit/IBATableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBATableViewController.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 2/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "IBAViewController.h" 21 | 22 | @class IBATableViewModel; 23 | 24 | @interface IBATableViewController : IBAViewController 25 | 26 | @property (nonatomic, retain) IBOutlet UITableView *tableView; 27 | @property (nonatomic, retain) IBATableViewModel *tableViewModel; 28 | 29 | @property (nonatomic, assign) BOOL clearsSelectionOnViewWillAppear; 30 | 31 | - (id)initWithStyle:(UITableViewStyle)style; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /src/UIKit/IBATableViewSectionModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBATableViewSectionModel.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 14/09/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | #import "NSIndexPath+UITableView+IBAExtensions.h" 22 | 23 | @interface IBATableViewSectionModel : NSObject 24 | 25 | @property (nonatomic, retain) NSString *title; 26 | 27 | + (id)tableViewSectionModel; 28 | + (id)tableViewSectionModelWithRows:(NSArray *)rows title:(NSString*)title; 29 | + (id)tableViewSectionModelWithRows:(NSArray *)rows; 30 | + (id)tableViewSectionModelWithTitle:(NSString *)title; 31 | 32 | - (id)initWithRows:(NSArray *)rows title:(NSString *)title; 33 | - (id)initWithRows:(NSArray *)rows; 34 | - (id)initWithTitle:(NSString *)title; 35 | 36 | - (NSInteger)rowCount; 37 | - (id)rowAtIndex:(NSInteger)indexRow; 38 | - (void)addRow:(id)row; 39 | - (void)addRowsFromArray:(NSArray *)rows; 40 | - (NSArray *)allRows; 41 | 42 | - (void)removeRow:(id)row; 43 | - (void)removeRowAtIndex:(NSInteger)index; 44 | 45 | - (void)sortRowsUsingComparator:(NSComparator)cmptr; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /src/UIKit/IBATiledImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBATiledScrollView.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 31/07/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | #import 22 | 23 | @class IBATiledImageView; 24 | 25 | @protocol IBATiledImageViewDataSource 26 | 27 | - (UIImage *)tileForView:(IBATiledImageView*)view 28 | scale:(CGFloat)scale 29 | row:(NSInteger)row 30 | column:(NSInteger)column; 31 | 32 | @end 33 | 34 | @interface IBATiledImageView : UIView 35 | 36 | @property (nonatomic, readonly) CATiledLayer *tiledLayer; 37 | @property (nonatomic, assign) id dataSource; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /src/UIKit/IBAUIKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAUIKit.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 12/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "IBAActionSheet.h" 21 | #import "IBACarouselView.h" 22 | #import "IBAFlipButton.h" 23 | #import "IBAFlipViewController.h" 24 | #import "IBAGradientButton.h" 25 | #import "IBANavigationBar.h" 26 | #import "IBANavigationController.h" 27 | #import "IBAResourceBundle+UIKit.h" 28 | #import "IBAResourceManager+UIKit.h" 29 | #import "IBATableViewAccessory.h" 30 | #import "IBATableViewController.h" 31 | #import "IBATableViewSectionModel.h" 32 | #import "IBATableViewModel.h" 33 | #import "IBATiledImageView.h" 34 | #import "IBAViewController.h" 35 | #import "IBAAlertView.h" 36 | #import "IBAAnchoredStackView.h" 37 | 38 | // Extension categories. 39 | #import "NSIndexPath+UITableView+IBAExtensions.h" 40 | #import "UIAlertView+IBAExtensions.h" 41 | #import "UIApplication+IBAExtensions.h" 42 | #import "UIBarButtonItem+IBAFactories.h" 43 | #import "UIColor+IBAExtensions.h" 44 | #import "UIImage+IBAExtensions.h" 45 | #import "UINavigationController+IBAExtensions.h" 46 | #import "UINib+IBAExtensions.h" 47 | #import "UISearchBar+IBAExtensions.h" 48 | #import "UIScrollView+IBAExtensions.h" 49 | #import "UITableView+IBAExtensions.h" 50 | #import "UIView+IBAExtensions.h" 51 | 52 | 53 | IBA_EXTERN_C_BEGIN 54 | 55 | CGRect IBACGRectForApplicationOrientation(CGRect rect); 56 | 57 | IBA_EXTERN_C_END 58 | -------------------------------------------------------------------------------- /src/UIKit/IBAUIKit.m: -------------------------------------------------------------------------------- 1 | // 2 | // IBAUIKit.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 23/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #include "IBAUIKit.h" 21 | 22 | /*! 23 | \brief Converts the specified \a rect to match the application's current orientation. 24 | \param rect The CGRect to convert. 25 | \return The converted CGRect. 26 | */ 27 | CGRect IBACGRectForApplicationOrientation(CGRect rect) 28 | { 29 | if (UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])) 30 | { 31 | return rect; 32 | } 33 | 34 | return CGRectMake(rect.origin.y, rect.origin.x, rect.size.height, rect.size.width); 35 | } -------------------------------------------------------------------------------- /src/UIKit/NSIndexPath+UITableView+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSIndexPath+UITableView+IBAExtensions.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 14/09/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "NSIndexPath+UITableView+IBAExtensions.h" 21 | #import "IBACommon.h" 22 | 23 | @implementation NSIndexPath (UITableView_IBAExtension) 24 | 25 | /*! 26 | \brief Returns a value indicating whether the NSIndexPath's row property value is within the index bounds of the specified \a array. 27 | \return YES if the NSIndexPath's row property value is within the index bounds of the specified \a array; otherwise NO. 28 | */ 29 | - (BOOL)ibaRowIsWithinBoundsOfArray:(NSArray *)array 30 | { 31 | #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_4_3 32 | return (self.row >= 0 && IBANSIntegerLessThanNSUInteger(self.row, [array count])); 33 | #else 34 | return (self.row < [array count]); 35 | #endif 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /src/UIKit/UIAlertView+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIAlertView+IBAHelpers.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 12/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | 21 | #import 22 | 23 | 24 | @interface UIAlertView (IBAExtensions) 25 | 26 | + (void)ibaShowSimpleAlertWithTitle:(NSString *)title message:(NSString *)message; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /src/UIKit/UIAlertView+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIAlertView+IBAHelpers.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 12/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | 21 | #import "UIAlertView+IBAExtensions.h" 22 | #import "../Foundation/IBACommon.h" 23 | 24 | @implementation UIAlertView (IBAExtensions) 25 | 26 | /*! 27 | \brief Show a simple modal alert with a \a title, \a message, and OK button. 28 | \param title The alert title. 29 | \param message The alert message. 30 | */ 31 | + (void)ibaShowSimpleAlertWithTitle:(NSString *)title message:(NSString *)message 32 | { 33 | UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title 34 | message:message 35 | delegate:nil 36 | cancelButtonTitle:IBALocalizedString(@"OK") 37 | otherButtonTitles:nil]; 38 | 39 | [alert show]; 40 | 41 | IBA_RELEASE(alert); 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /src/UIKit/UIApplication+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIApplication+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 19/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface UIApplication (IBAExtensions) 23 | 24 | - (void)ibaBeginNetworkActivity; 25 | - (void)ibaEndNetworkActivity; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /src/UIKit/UIBarButtonItem+IBAFactories.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIBarButtonItem+IBAFactories.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 12/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | 21 | #import 22 | 23 | 24 | @interface UIBarButtonItem (IBAFactories) 25 | 26 | + (UIBarButtonItem *)ibaFlexibleSpace; 27 | + (UIBarButtonItem *)ibaFixedSpaceWithWidth:(CGFloat)width; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /src/UIKit/UIBarButtonItem+IBAFactories.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIBarButtonItem+IBAFactories.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 12/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | 21 | #import "UIBarButtonItem+IBAFactories.h" 22 | 23 | 24 | @implementation UIBarButtonItem (IBAFactories) 25 | 26 | /*! 27 | \brief Factory method that creates an autoreleased flexible space bar item. 28 | */ 29 | + (UIBarButtonItem *)ibaFlexibleSpace 30 | { 31 | return [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease]; 32 | } 33 | 34 | /*! 35 | \brief Factory method that creates an autoreleased fixed space bar item. 36 | */ 37 | + (UIBarButtonItem *)ibaFixedSpaceWithWidth:(CGFloat)width 38 | { 39 | UIBarButtonItem *item = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil] autorelease]; 40 | item.width = width; 41 | return item; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /src/UIKit/UIImage+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 19/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface UIImage (IBAExtensions) 23 | 24 | + (UIImage *)ibaImageWithContentsOfFile:(NSString *)imageBaseName scale:(CGFloat)scale; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /src/UIKit/UIImage+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+IBAExtensions.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 19/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "UIImage+IBAExtensions.h" 21 | 22 | @implementation UIImage (IBAExtensions) 23 | 24 | + (UIImage *)ibaImageWithContentsOfFile:(NSString *)imageBaseName scale:(CGFloat)scale 25 | { 26 | NSString *filename = imageBaseName; 27 | if (scale > 1.0) 28 | { 29 | NSString *filenameWithoutExtension = [imageBaseName stringByDeletingPathExtension]; 30 | 31 | NSString *filenameForScale = [NSString stringWithFormat:@"%@@%.0fx%@", 32 | filenameWithoutExtension, 33 | floorf(scale), 34 | [imageBaseName substringFromIndex:[filenameWithoutExtension length]]]; 35 | 36 | if ([[NSFileManager defaultManager] fileExistsAtPath:filenameForScale]) 37 | { 38 | filename = filenameForScale; 39 | } 40 | } 41 | 42 | return [UIImage imageWithContentsOfFile:filename]; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /src/UIKit/UINavigationController+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 21/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @class IBANavigationBar; 23 | 24 | @interface UINavigationController (IBAExtensions) 25 | 26 | @property (nonatomic, readonly) IBANavigationBar *ibaNavigationBar; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /src/UIKit/UINavigationController+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+IBAExtensions.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 21/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "UINavigationController+IBAExtensions.h" 21 | #import "IBANavigationBar.h" 22 | #import "../Foundation/IBAFoundation.h" 23 | 24 | @implementation UINavigationController (IBAExtensions) 25 | 26 | 27 | /*! 28 | \brief Returns the IBANavigationBar associated with the UINavigationController (if any). 29 | */ 30 | - (IBANavigationBar *)ibaNavigationBar 31 | { 32 | if ([self.navigationBar isKindOfClass:[IBANavigationBar class]]) 33 | { 34 | return (IBANavigationBar *)self.navigationBar; 35 | } 36 | 37 | IBALogDebug(@"Expected navigationBar to be an instance of IBANavigationBar for %@, returning nil.", self); 38 | 39 | return nil; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /src/UIKit/UINib+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINib+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 30/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface UINib (IBAExtensions) 23 | 24 | - (NSArray *)ibaInstantiate; 25 | - (NSArray *)ibaInstantiateWithOwner:(id)ownerOrNil; 26 | - (NSArray *)ibaInstantiateWithOwner:(id)ownerOrNil proxyObjects:(NSDictionary *)dictionaryOrNil; 27 | 28 | - (UITableViewCell *)ibaInstantiateWithOwner:(id)ownerOrNil forTableViewCellWithReuseIdentifier:(NSString*)reuseIdentifier; 29 | 30 | - (UINavigationController *)ibaInstantiateNavigationControllerWithRootViewController:(UIViewController *)rootViewController; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /src/UIKit/UIScrollView+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 23/06/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | 23 | @interface UIScrollView (IBAExtensions) 24 | 25 | - (void)ibaAdjustInsetsForCoveringFrame:(CGRect)coveringFrame; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /src/UIKit/UISearchBar+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UISearchBar+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 20/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | 23 | @interface UISearchBar (IBAExtensions) 24 | 25 | - (UIButton *) ibaCancelButton; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /src/UIKit/UISearchBar+IBAExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UISearchBar+IBAExtensions.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 20/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "UISearchBar+IBAExtensions.h" 21 | 22 | 23 | @implementation UISearchBar (IBAExtensions) 24 | 25 | /*! 26 | \brief Gets the Cancel button from the UISearchBar's view hierarchy. 27 | */ 28 | - (UIButton *) ibaCancelButton 29 | { 30 | for (UIView *v in self.subviews) 31 | { 32 | if ([v isKindOfClass:[UIButton class]]) 33 | { 34 | UIButton *b = (UIButton *)v; 35 | return b; 36 | } 37 | } 38 | 39 | return nil; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /src/UIKit/UITableView+IBAExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+IBAExtensions.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 3/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UITableView (IBAExtensions) 12 | 13 | #pragma mark - iOS 5 Backwards Compatibility 14 | 15 | #if !defined(__IPHONE_5_0) || __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_5_0 16 | 17 | @property(nonatomic) BOOL allowsMultipleSelection; 18 | - (NSArray *)indexPathsForSelectedRows; 19 | 20 | #endif 21 | 22 | - (NSIndexPath *)ibaIndexPathOfRowBeforeIndexPath:(NSIndexPath*)indexPath; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /tests/CoreGraphics/IBAResourceBundle+CoreGraphicsTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceBundle+CoreGraphicsTests.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 16/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | 21 | #import 22 | 23 | @interface IBAResourceBundle_CoreGraphicsTests : GHTestCase 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /tests/DefaultResources.bundle/data.txt: -------------------------------------------------------------------------------- 1 | This is a test data file. 2 | -------------------------------------------------------------------------------- /tests/DefaultResources.bundle/images/Test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ittybittyapps/ittybittybits/46c5193968f58afb600fe55e9fa93a697398cdba/tests/DefaultResources.bundle/images/Test.png -------------------------------------------------------------------------------- /tests/DefaultResources.bundle/images/Test@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ittybittyapps/ittybittybits/46c5193968f58afb600fe55e9fa93a697398cdba/tests/DefaultResources.bundle/images/Test@2x.png -------------------------------------------------------------------------------- /tests/Foundation/IBACommonTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBACommonTests.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 29/09/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface IBACommonTests : GHTestCase 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /tests/Foundation/IBACommonTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // IBACommonTests.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 29/09/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "IBACommonTests.h" 21 | #import "IBACommon.h" 22 | 23 | @implementation IBACommonTests 24 | 25 | - (void)testIBANSIntegerToNSUInteger 26 | { 27 | GHAssertEquals((NSUInteger)NSIntegerMax, IBANSIntegerToNSUInteger(NSIntegerMax), @""); 28 | GHAssertEquals((NSUInteger)0, IBANSIntegerToNSUInteger(NSIntegerMin), @""); 29 | GHAssertEquals((NSUInteger)0, IBANSIntegerToNSUInteger(0), @""); 30 | GHAssertEquals((NSUInteger)NSIntegerMax-1, IBANSIntegerToNSUInteger(NSIntegerMax-1), @""); 31 | } 32 | 33 | - (void)testIBANSUIntegerToNSInteger 34 | { 35 | GHAssertEquals((NSInteger)NSIntegerMax, IBANSUIntegerToNSInteger(NSUIntegerMax), @""); 36 | GHAssertEquals((NSInteger)NSIntegerMax, IBANSUIntegerToNSInteger(NSUIntegerMax-1), @""); 37 | GHAssertEquals((NSInteger)NSIntegerMax, IBANSUIntegerToNSInteger((NSUInteger)NSIntegerMax), @""); 38 | GHAssertEquals((NSInteger)NSIntegerMax-1, IBANSUIntegerToNSInteger((NSUInteger)NSIntegerMax-1), @""); 39 | GHAssertEquals((NSInteger)0, IBANSUIntegerToNSInteger(0), @""); 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /tests/Foundation/IBADebugTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBADebugTests.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 4/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | 23 | @interface IBADebugTests : GHTestCase { 24 | 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /tests/Foundation/IBADebugTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // IBADebugTests.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 4/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "IBADebugTests.h" 21 | #import "IBADebug.h" 22 | 23 | @implementation IBADebugTests 24 | 25 | // Run before each test method 26 | - (void)setUp {} 27 | 28 | // Run after each test method 29 | - (void)tearDown {} 30 | 31 | // Run before the tests are run for this class 32 | - (void)setUpClass {} 33 | 34 | // Run before the tests are run for this class 35 | - (void)tearDownClass {} 36 | 37 | - (void)testDLog 38 | { 39 | DLog(@"Something"); 40 | 41 | #ifndef NDEBUG 42 | GHAssertThrows(ALog(@"Something else"), @""); 43 | #endif 44 | 45 | } 46 | @end 47 | -------------------------------------------------------------------------------- /tests/Foundation/IBADelimitedTextFileReaderTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBADelimitedTextFileReaderTests.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 9/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface IBADelimitedTextFileReaderTests : GHTestCase { 23 | 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /tests/Foundation/IBAInputStreamLineReaderTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAInputStreamLineReaderTests.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 9/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | 21 | #import 22 | 23 | 24 | @interface IBAInputStreamLineReaderTests : GHTestCase { 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /tests/Foundation/IBALoggerTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBALogger.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 4/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @class IBATemporaryFile; 23 | 24 | @interface IBALoggerTests : GHTestCase { 25 | @private 26 | IBATemporaryFile* tempLogFile; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /tests/Foundation/IBALoggerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // IBALogger.m 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 4/05/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "IBALoggerTests.h" 21 | #import "IBALogger.h" 22 | #import "IBATemporaryFile.h" 23 | 24 | @implementation IBALoggerTests 25 | 26 | // Run before each test method 27 | - (void)setUp {} 28 | 29 | // Run after each test method 30 | - (void)tearDown {} 31 | 32 | // Run before the tests are run for this class 33 | - (void)setUpClass { 34 | tempLogFile = [[IBATemporaryFile temporaryFileWithTemplate:@"test.XXXXXXXX"] retain]; 35 | [[IBALogger sharedLogger] addLogFile:tempLogFile.filepath]; 36 | } 37 | 38 | // Run before the tests are run for this class 39 | - (void)tearDownClass { 40 | [[IBALogger sharedLogger] removeLogFile:tempLogFile.filepath]; 41 | 42 | [tempLogFile release]; 43 | tempLogFile = nil; 44 | } 45 | 46 | - (void)testLogger 47 | { 48 | IBALogDebug(@"A debug log message => %d: %@", 1, @"one"); 49 | IBALogInfo(@"A info log message => %d: %@", 2, @"two"); 50 | IBALogNotice(@"A info log message => %d: %@", 3, @"three"); 51 | IBALogWarning(@"A info log message => %d: %@", 4, @"four"); 52 | IBALogError(@"A info log message => %d: %@", 5, @"five"); 53 | IBALogCritical(@"A info log message => %d: %@", 6, @"six"); 54 | IBALogAlert(@"A info log message => %d: %@", 7, @"seven"); 55 | //IBALogEmergency(@"A info log message => %d: %@", 8, @"eight"); 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /tests/Foundation/IBAResourceBundleTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceBundleTests.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 16/11/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface IBAResourceBundleTests : GHTestCase 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /tests/Foundation/IBAStackTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAStackTests.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 25/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface IBAStackTests : GHTestCase 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /tests/Foundation/NSData+IBAExtensionsTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+IBAExtensionsTests.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 6/10/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface NSData_IBAExtensionsTests : GHTestCase 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /tests/Foundation/NSString+IBAExtensionsTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+IBAExtensionsTests.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 24/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface NSString_IBAExtensionsTests : GHTestCase 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /tests/IttyBittyBitsTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.deeperdesign.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /tests/IttyBittyBitsTests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'IttyBittyBitsTests' target in the 'IttyBittyBitsTests' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #import 15 | #import 16 | #import 17 | #endif 18 | -------------------------------------------------------------------------------- /tests/UIKit/IBAResourceBundle+UIKitTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBAResourceBundle+UIKitTests.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 30/08/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | 21 | #import 22 | 23 | @interface IBAResourceBundle_UIKitTests : GHTestCase 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /tests/UIKit/IBATableViewModelTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBATableViewModelTests.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 19/09/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface IBATableViewModelTests : GHTestCase 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /tests/UIKit/IBATableViewSectionModelTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // IBATableViewSectionModelTests.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 19/09/11. 6 | // Copyright (c) 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface IBATableViewSectionModelTests : GHTestCase 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /tests/UIKit/UIColor+IBAExtensionsTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+IBAExtensionsTests.h 3 | // IttyBittyBits 4 | // 5 | // Created by Oliver Jones on 17/07/11. 6 | // Copyright 2011 Itty Bitty Apps Pty. Ltd. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | @interface UIColor_IBAExtensionsTests : GHTestCase 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | --------------------------------------------------------------------------------