├── DCTUIKit.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── DCTUIKit ├── DCTTableViewController.h ├── DCTTableViewController.m ├── DCTUIKit.h ├── DCTViewController.h ├── DCTViewController.m ├── UIAlertView+DCTErrorHandling.h ├── UIAlertView+DCTErrorHandling.m ├── UIColor+DCTComponents.h ├── UIColor+DCTComponents.m ├── UIColor+DCTHex.h ├── UIColor+DCTHex.m ├── UIColor+DCTMixing.h ├── UIColor+DCTMixing.m ├── UIDevice+DCTFeatureCheck.h ├── UIDevice+DCTFeatureCheck.m ├── UIDevice+DCTSystemVersion.h ├── UIDevice+DCTSystemVersion.m ├── UIImageView+DCTImageSizing.h ├── UIImageView+DCTImageSizing.m ├── UINib+DCTExtensions.h ├── UINib+DCTExtensions.m ├── UIResponder+DCTNextResponderExtensions.h ├── UIResponder+DCTNextResponderExtensions.m ├── UITableView+DCTExtras.h ├── UITableView+DCTExtras.m ├── UITableViewCell+DCTExtensions.h ├── UITableViewCell+DCTExtensions.m ├── UIView+DCTAnimation.h ├── UIView+DCTAnimation.m ├── UIView+DCTFirstResponder.h ├── UIView+DCTFirstResponder.m ├── UIView+DCTLogging.h ├── UIView+DCTLogging.m ├── UIView+DCTSubviewExtensions.h ├── UIView+DCTSubviewExtensions.m ├── UIViewController+DCTExtras.h ├── UIViewController+DCTExtras.m ├── UIViewController+DCTViewController.h ├── UIViewController+DCTViewController.m ├── UIWindow+DCTFirstResponder.h └── UIWindow+DCTFirstResponder.m └── DCTUIKitTests ├── DCTUIKitTests-Info.plist ├── DCTUIKitTests.h ├── DCTUIKitTests.m └── en.lproj └── InfoPlist.strings /DCTUIKit.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2437B6F315B97DD500750117 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24F6EE49158A3F1E00CEDD41 /* Foundation.framework */; }; 11 | 2437B70015B97E0B00750117 /* DCTTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE73158A3F6500CEDD41 /* DCTTableViewController.m */; }; 12 | 2437B70215B97E0B00750117 /* DCTViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE75158A3F6500CEDD41 /* DCTViewController.m */; }; 13 | 2437B70415B97E0B00750117 /* UIAlertView+DCTErrorHandling.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE77158A3F6500CEDD41 /* UIAlertView+DCTErrorHandling.m */; }; 14 | 2437B70615B97E0B00750117 /* UIColor+DCTComponents.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE79158A3F6500CEDD41 /* UIColor+DCTComponents.m */; }; 15 | 2437B70815B97E0B00750117 /* UIColor+DCTHex.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE7B158A3F6500CEDD41 /* UIColor+DCTHex.m */; }; 16 | 2437B70A15B97E0B00750117 /* UIDevice+DCTFeatureCheck.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE7D158A3F6500CEDD41 /* UIDevice+DCTFeatureCheck.m */; }; 17 | 2437B70C15B97E0B00750117 /* UIDevice+DCTSystemVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE7F158A3F6500CEDD41 /* UIDevice+DCTSystemVersion.m */; }; 18 | 2437B70E15B97E0B00750117 /* UINib+DCTExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE81158A3F6500CEDD41 /* UINib+DCTExtensions.m */; }; 19 | 2437B71015B97E0B00750117 /* UIResponder+DCTNextResponderExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE83158A3F6500CEDD41 /* UIResponder+DCTNextResponderExtensions.m */; }; 20 | 2437B71215B97E0B00750117 /* UITableViewCell+DCTExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE85158A3F6500CEDD41 /* UITableViewCell+DCTExtensions.m */; }; 21 | 2437B71415B97E0B00750117 /* UIView+DCTAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE87158A3F6500CEDD41 /* UIView+DCTAnimation.m */; }; 22 | 2437B71615B97E0B00750117 /* UIView+DCTFirstResponder.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE89158A3F6500CEDD41 /* UIView+DCTFirstResponder.m */; }; 23 | 2437B71815B97E0B00750117 /* UIView+DCTLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE8B158A3F6500CEDD41 /* UIView+DCTLogging.m */; }; 24 | 2437B71A15B97E0B00750117 /* UIView+DCTSubviewExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE8D158A3F6500CEDD41 /* UIView+DCTSubviewExtensions.m */; }; 25 | 2437B71C15B97E0B00750117 /* UIViewController+DCTExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE8F158A3F6500CEDD41 /* UIViewController+DCTExtras.m */; }; 26 | 2437B71E15B97E0B00750117 /* UIViewController+DCTViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE91158A3F6500CEDD41 /* UIViewController+DCTViewController.m */; }; 27 | 2437B72015B97E0B00750117 /* UIWindow+DCTFirstResponder.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE93158A3F6600CEDD41 /* UIWindow+DCTFirstResponder.m */; }; 28 | 2437B72215B97E0B00750117 /* UIImageView+DCTImageSizing.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE95158A3F6600CEDD41 /* UIImageView+DCTImageSizing.m */; }; 29 | 2437B72415B97E0B00750117 /* UIColor+DCTMixing.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EEBB158A40A400CEDD41 /* UIColor+DCTMixing.m */; }; 30 | 2437B72615B97E0B00750117 /* UITableView+DCTExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EEBD158A40A400CEDD41 /* UITableView+DCTExtras.m */; }; 31 | 2437B72715B97E0C00750117 /* DCTUIKit.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE4E158A3F1E00CEDD41 /* DCTUIKit.h */; }; 32 | 2437B72815B97E0D00750117 /* DCTTableViewController.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE72158A3F6500CEDD41 /* DCTTableViewController.h */; }; 33 | 2437B72A15B97E0D00750117 /* DCTViewController.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE74158A3F6500CEDD41 /* DCTViewController.h */; }; 34 | 2437B72C15B97E0D00750117 /* UIAlertView+DCTErrorHandling.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE76158A3F6500CEDD41 /* UIAlertView+DCTErrorHandling.h */; }; 35 | 2437B72E15B97E0D00750117 /* UIColor+DCTComponents.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE78158A3F6500CEDD41 /* UIColor+DCTComponents.h */; }; 36 | 2437B73015B97E0D00750117 /* UIColor+DCTHex.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE7A158A3F6500CEDD41 /* UIColor+DCTHex.h */; }; 37 | 2437B73215B97E0D00750117 /* UIDevice+DCTFeatureCheck.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE7C158A3F6500CEDD41 /* UIDevice+DCTFeatureCheck.h */; }; 38 | 2437B73415B97E0D00750117 /* UIDevice+DCTSystemVersion.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE7E158A3F6500CEDD41 /* UIDevice+DCTSystemVersion.h */; }; 39 | 2437B73615B97E0D00750117 /* UINib+DCTExtensions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE80158A3F6500CEDD41 /* UINib+DCTExtensions.h */; }; 40 | 2437B73815B97E0D00750117 /* UIResponder+DCTNextResponderExtensions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE82158A3F6500CEDD41 /* UIResponder+DCTNextResponderExtensions.h */; }; 41 | 2437B73A15B97E0D00750117 /* UITableViewCell+DCTExtensions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE84158A3F6500CEDD41 /* UITableViewCell+DCTExtensions.h */; }; 42 | 2437B73C15B97E0D00750117 /* UIView+DCTAnimation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE86158A3F6500CEDD41 /* UIView+DCTAnimation.h */; }; 43 | 2437B73E15B97E0D00750117 /* UIView+DCTFirstResponder.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE88158A3F6500CEDD41 /* UIView+DCTFirstResponder.h */; }; 44 | 2437B74015B97E0D00750117 /* UIView+DCTLogging.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE8A158A3F6500CEDD41 /* UIView+DCTLogging.h */; }; 45 | 2437B74215B97E0D00750117 /* UIView+DCTSubviewExtensions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE8C158A3F6500CEDD41 /* UIView+DCTSubviewExtensions.h */; }; 46 | 2437B74415B97E0D00750117 /* UIViewController+DCTExtras.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE8E158A3F6500CEDD41 /* UIViewController+DCTExtras.h */; }; 47 | 2437B74815B97E0D00750117 /* UIWindow+DCTFirstResponder.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE92158A3F6600CEDD41 /* UIWindow+DCTFirstResponder.h */; }; 48 | 2437B74A15B97E0D00750117 /* UIImageView+DCTImageSizing.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EE94158A3F6600CEDD41 /* UIImageView+DCTImageSizing.h */; }; 49 | 2437B74C15B97E0D00750117 /* UIColor+DCTMixing.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EEBA158A40A400CEDD41 /* UIColor+DCTMixing.h */; }; 50 | 2437B74E15B97E0D00750117 /* UITableView+DCTExtras.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 24F6EEBC158A40A400CEDD41 /* UITableView+DCTExtras.h */; }; 51 | 24F6EE58158A3F1E00CEDD41 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24F6EE57158A3F1E00CEDD41 /* SenTestingKit.framework */; }; 52 | 24F6EE5B158A3F1E00CEDD41 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24F6EE49158A3F1E00CEDD41 /* Foundation.framework */; }; 53 | 24F6EE64158A3F1E00CEDD41 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 24F6EE62158A3F1E00CEDD41 /* InfoPlist.strings */; }; 54 | 24F6EE67158A3F1E00CEDD41 /* DCTUIKitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EE66158A3F1E00CEDD41 /* DCTUIKitTests.m */; }; 55 | /* End PBXBuildFile section */ 56 | 57 | /* Begin PBXCopyFilesBuildPhase section */ 58 | 2437B6F015B97DD500750117 /* CopyFiles */ = { 59 | isa = PBXCopyFilesBuildPhase; 60 | buildActionMask = 2147483647; 61 | dstPath = "include/${PRODUCT_NAME}"; 62 | dstSubfolderSpec = 16; 63 | files = ( 64 | 2437B72715B97E0C00750117 /* DCTUIKit.h in CopyFiles */, 65 | 2437B72815B97E0D00750117 /* DCTTableViewController.h in CopyFiles */, 66 | 2437B72A15B97E0D00750117 /* DCTViewController.h in CopyFiles */, 67 | 2437B72C15B97E0D00750117 /* UIAlertView+DCTErrorHandling.h in CopyFiles */, 68 | 2437B72E15B97E0D00750117 /* UIColor+DCTComponents.h in CopyFiles */, 69 | 2437B73015B97E0D00750117 /* UIColor+DCTHex.h in CopyFiles */, 70 | 2437B73215B97E0D00750117 /* UIDevice+DCTFeatureCheck.h in CopyFiles */, 71 | 2437B73415B97E0D00750117 /* UIDevice+DCTSystemVersion.h in CopyFiles */, 72 | 2437B73615B97E0D00750117 /* UINib+DCTExtensions.h in CopyFiles */, 73 | 2437B73815B97E0D00750117 /* UIResponder+DCTNextResponderExtensions.h in CopyFiles */, 74 | 2437B73A15B97E0D00750117 /* UITableViewCell+DCTExtensions.h in CopyFiles */, 75 | 2437B73C15B97E0D00750117 /* UIView+DCTAnimation.h in CopyFiles */, 76 | 2437B73E15B97E0D00750117 /* UIView+DCTFirstResponder.h in CopyFiles */, 77 | 2437B74015B97E0D00750117 /* UIView+DCTLogging.h in CopyFiles */, 78 | 2437B74215B97E0D00750117 /* UIView+DCTSubviewExtensions.h in CopyFiles */, 79 | 2437B74415B97E0D00750117 /* UIViewController+DCTExtras.h in CopyFiles */, 80 | 2437B74815B97E0D00750117 /* UIWindow+DCTFirstResponder.h in CopyFiles */, 81 | 2437B74A15B97E0D00750117 /* UIImageView+DCTImageSizing.h in CopyFiles */, 82 | 2437B74C15B97E0D00750117 /* UIColor+DCTMixing.h in CopyFiles */, 83 | 2437B74E15B97E0D00750117 /* UITableView+DCTExtras.h in CopyFiles */, 84 | ); 85 | runOnlyForDeploymentPostprocessing = 0; 86 | }; 87 | /* End PBXCopyFilesBuildPhase section */ 88 | 89 | /* Begin PBXFileReference section */ 90 | 2437B6F215B97DD500750117 /* libDCTUIKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDCTUIKit.a; sourceTree = BUILT_PRODUCTS_DIR; }; 91 | 24F6EE49158A3F1E00CEDD41 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 92 | 24F6EE4E158A3F1E00CEDD41 /* DCTUIKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DCTUIKit.h; sourceTree = ""; }; 93 | 24F6EE56158A3F1E00CEDD41 /* DCTUIKitTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DCTUIKitTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 94 | 24F6EE57158A3F1E00CEDD41 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; 95 | 24F6EE61158A3F1E00CEDD41 /* DCTUIKitTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DCTUIKitTests-Info.plist"; sourceTree = ""; }; 96 | 24F6EE63158A3F1E00CEDD41 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97 | 24F6EE65158A3F1E00CEDD41 /* DCTUIKitTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DCTUIKitTests.h; sourceTree = ""; }; 98 | 24F6EE66158A3F1E00CEDD41 /* DCTUIKitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DCTUIKitTests.m; sourceTree = ""; }; 99 | 24F6EE70158A3F5300CEDD41 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 100 | 24F6EE72158A3F6500CEDD41 /* DCTTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCTTableViewController.h; sourceTree = ""; }; 101 | 24F6EE73158A3F6500CEDD41 /* DCTTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCTTableViewController.m; sourceTree = ""; }; 102 | 24F6EE74158A3F6500CEDD41 /* DCTViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCTViewController.h; sourceTree = ""; }; 103 | 24F6EE75158A3F6500CEDD41 /* DCTViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCTViewController.m; sourceTree = ""; }; 104 | 24F6EE76158A3F6500CEDD41 /* UIAlertView+DCTErrorHandling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIAlertView+DCTErrorHandling.h"; sourceTree = ""; }; 105 | 24F6EE77158A3F6500CEDD41 /* UIAlertView+DCTErrorHandling.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIAlertView+DCTErrorHandling.m"; sourceTree = ""; }; 106 | 24F6EE78158A3F6500CEDD41 /* UIColor+DCTComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+DCTComponents.h"; sourceTree = ""; }; 107 | 24F6EE79158A3F6500CEDD41 /* UIColor+DCTComponents.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+DCTComponents.m"; sourceTree = ""; }; 108 | 24F6EE7A158A3F6500CEDD41 /* UIColor+DCTHex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+DCTHex.h"; sourceTree = ""; }; 109 | 24F6EE7B158A3F6500CEDD41 /* UIColor+DCTHex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+DCTHex.m"; sourceTree = ""; }; 110 | 24F6EE7C158A3F6500CEDD41 /* UIDevice+DCTFeatureCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIDevice+DCTFeatureCheck.h"; sourceTree = ""; }; 111 | 24F6EE7D158A3F6500CEDD41 /* UIDevice+DCTFeatureCheck.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIDevice+DCTFeatureCheck.m"; sourceTree = ""; }; 112 | 24F6EE7E158A3F6500CEDD41 /* UIDevice+DCTSystemVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIDevice+DCTSystemVersion.h"; sourceTree = ""; }; 113 | 24F6EE7F158A3F6500CEDD41 /* UIDevice+DCTSystemVersion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIDevice+DCTSystemVersion.m"; sourceTree = ""; }; 114 | 24F6EE80158A3F6500CEDD41 /* UINib+DCTExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UINib+DCTExtensions.h"; sourceTree = ""; }; 115 | 24F6EE81158A3F6500CEDD41 /* UINib+DCTExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UINib+DCTExtensions.m"; sourceTree = ""; }; 116 | 24F6EE82158A3F6500CEDD41 /* UIResponder+DCTNextResponderExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIResponder+DCTNextResponderExtensions.h"; sourceTree = ""; }; 117 | 24F6EE83158A3F6500CEDD41 /* UIResponder+DCTNextResponderExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIResponder+DCTNextResponderExtensions.m"; sourceTree = ""; }; 118 | 24F6EE84158A3F6500CEDD41 /* UITableViewCell+DCTExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableViewCell+DCTExtensions.h"; sourceTree = ""; }; 119 | 24F6EE85158A3F6500CEDD41 /* UITableViewCell+DCTExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableViewCell+DCTExtensions.m"; sourceTree = ""; }; 120 | 24F6EE86158A3F6500CEDD41 /* UIView+DCTAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+DCTAnimation.h"; sourceTree = ""; }; 121 | 24F6EE87158A3F6500CEDD41 /* UIView+DCTAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+DCTAnimation.m"; sourceTree = ""; }; 122 | 24F6EE88158A3F6500CEDD41 /* UIView+DCTFirstResponder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+DCTFirstResponder.h"; sourceTree = ""; }; 123 | 24F6EE89158A3F6500CEDD41 /* UIView+DCTFirstResponder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+DCTFirstResponder.m"; sourceTree = ""; }; 124 | 24F6EE8A158A3F6500CEDD41 /* UIView+DCTLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+DCTLogging.h"; sourceTree = ""; }; 125 | 24F6EE8B158A3F6500CEDD41 /* UIView+DCTLogging.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+DCTLogging.m"; sourceTree = ""; }; 126 | 24F6EE8C158A3F6500CEDD41 /* UIView+DCTSubviewExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+DCTSubviewExtensions.h"; sourceTree = ""; }; 127 | 24F6EE8D158A3F6500CEDD41 /* UIView+DCTSubviewExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+DCTSubviewExtensions.m"; sourceTree = ""; }; 128 | 24F6EE8E158A3F6500CEDD41 /* UIViewController+DCTExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+DCTExtras.h"; sourceTree = ""; }; 129 | 24F6EE8F158A3F6500CEDD41 /* UIViewController+DCTExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+DCTExtras.m"; sourceTree = ""; }; 130 | 24F6EE90158A3F6500CEDD41 /* UIViewController+DCTViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+DCTViewController.h"; sourceTree = ""; }; 131 | 24F6EE91158A3F6500CEDD41 /* UIViewController+DCTViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+DCTViewController.m"; sourceTree = ""; }; 132 | 24F6EE92158A3F6600CEDD41 /* UIWindow+DCTFirstResponder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIWindow+DCTFirstResponder.h"; sourceTree = ""; }; 133 | 24F6EE93158A3F6600CEDD41 /* UIWindow+DCTFirstResponder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWindow+DCTFirstResponder.m"; sourceTree = ""; }; 134 | 24F6EE94158A3F6600CEDD41 /* UIImageView+DCTImageSizing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+DCTImageSizing.h"; sourceTree = ""; }; 135 | 24F6EE95158A3F6600CEDD41 /* UIImageView+DCTImageSizing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+DCTImageSizing.m"; sourceTree = ""; }; 136 | 24F6EEBA158A40A400CEDD41 /* UIColor+DCTMixing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+DCTMixing.h"; sourceTree = ""; }; 137 | 24F6EEBB158A40A400CEDD41 /* UIColor+DCTMixing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+DCTMixing.m"; sourceTree = ""; }; 138 | 24F6EEBC158A40A400CEDD41 /* UITableView+DCTExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableView+DCTExtras.h"; sourceTree = ""; }; 139 | 24F6EEBD158A40A400CEDD41 /* UITableView+DCTExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableView+DCTExtras.m"; sourceTree = ""; }; 140 | /* End PBXFileReference section */ 141 | 142 | /* Begin PBXFrameworksBuildPhase section */ 143 | 2437B6EF15B97DD500750117 /* Frameworks */ = { 144 | isa = PBXFrameworksBuildPhase; 145 | buildActionMask = 2147483647; 146 | files = ( 147 | 2437B6F315B97DD500750117 /* Foundation.framework in Frameworks */, 148 | ); 149 | runOnlyForDeploymentPostprocessing = 0; 150 | }; 151 | 24F6EE52158A3F1E00CEDD41 /* Frameworks */ = { 152 | isa = PBXFrameworksBuildPhase; 153 | buildActionMask = 2147483647; 154 | files = ( 155 | 24F6EE58158A3F1E00CEDD41 /* SenTestingKit.framework in Frameworks */, 156 | 24F6EE5B158A3F1E00CEDD41 /* Foundation.framework in Frameworks */, 157 | ); 158 | runOnlyForDeploymentPostprocessing = 0; 159 | }; 160 | /* End PBXFrameworksBuildPhase section */ 161 | 162 | /* Begin PBXGroup section */ 163 | 24F6EE3B158A3F1E00CEDD41 = { 164 | isa = PBXGroup; 165 | children = ( 166 | 24F6EE4B158A3F1E00CEDD41 /* DCTUIKit */, 167 | 24F6EE5F158A3F1E00CEDD41 /* DCTUIKitTests */, 168 | 24F6EE48158A3F1E00CEDD41 /* Frameworks */, 169 | 24F6EE47158A3F1E00CEDD41 /* Products */, 170 | ); 171 | sourceTree = ""; 172 | }; 173 | 24F6EE47158A3F1E00CEDD41 /* Products */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | 24F6EE56158A3F1E00CEDD41 /* DCTUIKitTests.octest */, 177 | 2437B6F215B97DD500750117 /* libDCTUIKit.a */, 178 | ); 179 | name = Products; 180 | sourceTree = ""; 181 | }; 182 | 24F6EE48158A3F1E00CEDD41 /* Frameworks */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | 24F6EE70158A3F5300CEDD41 /* UIKit.framework */, 186 | 24F6EE49158A3F1E00CEDD41 /* Foundation.framework */, 187 | 24F6EE57158A3F1E00CEDD41 /* SenTestingKit.framework */, 188 | ); 189 | name = Frameworks; 190 | sourceTree = ""; 191 | }; 192 | 24F6EE4B158A3F1E00CEDD41 /* DCTUIKit */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | 24F6EE4E158A3F1E00CEDD41 /* DCTUIKit.h */, 196 | 24F6EE72158A3F6500CEDD41 /* DCTTableViewController.h */, 197 | 24F6EE73158A3F6500CEDD41 /* DCTTableViewController.m */, 198 | 24F6EE74158A3F6500CEDD41 /* DCTViewController.h */, 199 | 24F6EE75158A3F6500CEDD41 /* DCTViewController.m */, 200 | 24F6EE76158A3F6500CEDD41 /* UIAlertView+DCTErrorHandling.h */, 201 | 24F6EE77158A3F6500CEDD41 /* UIAlertView+DCTErrorHandling.m */, 202 | 24F6EE78158A3F6500CEDD41 /* UIColor+DCTComponents.h */, 203 | 24F6EE79158A3F6500CEDD41 /* UIColor+DCTComponents.m */, 204 | 24F6EE7A158A3F6500CEDD41 /* UIColor+DCTHex.h */, 205 | 24F6EE7B158A3F6500CEDD41 /* UIColor+DCTHex.m */, 206 | 24F6EE7C158A3F6500CEDD41 /* UIDevice+DCTFeatureCheck.h */, 207 | 24F6EE7D158A3F6500CEDD41 /* UIDevice+DCTFeatureCheck.m */, 208 | 24F6EE7E158A3F6500CEDD41 /* UIDevice+DCTSystemVersion.h */, 209 | 24F6EE7F158A3F6500CEDD41 /* UIDevice+DCTSystemVersion.m */, 210 | 24F6EE80158A3F6500CEDD41 /* UINib+DCTExtensions.h */, 211 | 24F6EE81158A3F6500CEDD41 /* UINib+DCTExtensions.m */, 212 | 24F6EE82158A3F6500CEDD41 /* UIResponder+DCTNextResponderExtensions.h */, 213 | 24F6EE83158A3F6500CEDD41 /* UIResponder+DCTNextResponderExtensions.m */, 214 | 24F6EE84158A3F6500CEDD41 /* UITableViewCell+DCTExtensions.h */, 215 | 24F6EE85158A3F6500CEDD41 /* UITableViewCell+DCTExtensions.m */, 216 | 24F6EE86158A3F6500CEDD41 /* UIView+DCTAnimation.h */, 217 | 24F6EE87158A3F6500CEDD41 /* UIView+DCTAnimation.m */, 218 | 24F6EE88158A3F6500CEDD41 /* UIView+DCTFirstResponder.h */, 219 | 24F6EE89158A3F6500CEDD41 /* UIView+DCTFirstResponder.m */, 220 | 24F6EE8A158A3F6500CEDD41 /* UIView+DCTLogging.h */, 221 | 24F6EE8B158A3F6500CEDD41 /* UIView+DCTLogging.m */, 222 | 24F6EE8C158A3F6500CEDD41 /* UIView+DCTSubviewExtensions.h */, 223 | 24F6EE8D158A3F6500CEDD41 /* UIView+DCTSubviewExtensions.m */, 224 | 24F6EE8E158A3F6500CEDD41 /* UIViewController+DCTExtras.h */, 225 | 24F6EE8F158A3F6500CEDD41 /* UIViewController+DCTExtras.m */, 226 | 24F6EE90158A3F6500CEDD41 /* UIViewController+DCTViewController.h */, 227 | 24F6EE91158A3F6500CEDD41 /* UIViewController+DCTViewController.m */, 228 | 24F6EE92158A3F6600CEDD41 /* UIWindow+DCTFirstResponder.h */, 229 | 24F6EE93158A3F6600CEDD41 /* UIWindow+DCTFirstResponder.m */, 230 | 24F6EE94158A3F6600CEDD41 /* UIImageView+DCTImageSizing.h */, 231 | 24F6EE95158A3F6600CEDD41 /* UIImageView+DCTImageSizing.m */, 232 | 24F6EEBA158A40A400CEDD41 /* UIColor+DCTMixing.h */, 233 | 24F6EEBB158A40A400CEDD41 /* UIColor+DCTMixing.m */, 234 | 24F6EEBC158A40A400CEDD41 /* UITableView+DCTExtras.h */, 235 | 24F6EEBD158A40A400CEDD41 /* UITableView+DCTExtras.m */, 236 | ); 237 | path = DCTUIKit; 238 | sourceTree = ""; 239 | }; 240 | 24F6EE5F158A3F1E00CEDD41 /* DCTUIKitTests */ = { 241 | isa = PBXGroup; 242 | children = ( 243 | 24F6EE65158A3F1E00CEDD41 /* DCTUIKitTests.h */, 244 | 24F6EE66158A3F1E00CEDD41 /* DCTUIKitTests.m */, 245 | 24F6EE60158A3F1E00CEDD41 /* Supporting Files */, 246 | ); 247 | path = DCTUIKitTests; 248 | sourceTree = ""; 249 | }; 250 | 24F6EE60158A3F1E00CEDD41 /* Supporting Files */ = { 251 | isa = PBXGroup; 252 | children = ( 253 | 24F6EE61158A3F1E00CEDD41 /* DCTUIKitTests-Info.plist */, 254 | 24F6EE62158A3F1E00CEDD41 /* InfoPlist.strings */, 255 | ); 256 | name = "Supporting Files"; 257 | sourceTree = ""; 258 | }; 259 | /* End PBXGroup section */ 260 | 261 | /* Begin PBXNativeTarget section */ 262 | 2437B6F115B97DD500750117 /* DCTUIKit */ = { 263 | isa = PBXNativeTarget; 264 | buildConfigurationList = 2437B6FB15B97DD600750117 /* Build configuration list for PBXNativeTarget "DCTUIKit" */; 265 | buildPhases = ( 266 | 2437B6EE15B97DD500750117 /* Sources */, 267 | 2437B6EF15B97DD500750117 /* Frameworks */, 268 | 2437B6F015B97DD500750117 /* CopyFiles */, 269 | ); 270 | buildRules = ( 271 | ); 272 | dependencies = ( 273 | ); 274 | name = DCTUIKit; 275 | productName = DCTUIKit; 276 | productReference = 2437B6F215B97DD500750117 /* libDCTUIKit.a */; 277 | productType = "com.apple.product-type.library.static"; 278 | }; 279 | 24F6EE55158A3F1E00CEDD41 /* DCTUIKitTests */ = { 280 | isa = PBXNativeTarget; 281 | buildConfigurationList = 24F6EE6D158A3F1E00CEDD41 /* Build configuration list for PBXNativeTarget "DCTUIKitTests" */; 282 | buildPhases = ( 283 | 24F6EE51158A3F1E00CEDD41 /* Sources */, 284 | 24F6EE52158A3F1E00CEDD41 /* Frameworks */, 285 | 24F6EE53158A3F1E00CEDD41 /* Resources */, 286 | 24F6EE54158A3F1E00CEDD41 /* ShellScript */, 287 | ); 288 | buildRules = ( 289 | ); 290 | dependencies = ( 291 | ); 292 | name = DCTUIKitTests; 293 | productName = DCTUIKitTests; 294 | productReference = 24F6EE56158A3F1E00CEDD41 /* DCTUIKitTests.octest */; 295 | productType = "com.apple.product-type.bundle"; 296 | }; 297 | /* End PBXNativeTarget section */ 298 | 299 | /* Begin PBXProject section */ 300 | 24F6EE3D158A3F1E00CEDD41 /* Project object */ = { 301 | isa = PBXProject; 302 | attributes = { 303 | LastUpgradeCheck = 0440; 304 | ORGANIZATIONNAME = "Daniel Tull"; 305 | }; 306 | buildConfigurationList = 24F6EE40158A3F1E00CEDD41 /* Build configuration list for PBXProject "DCTUIKit" */; 307 | compatibilityVersion = "Xcode 3.2"; 308 | developmentRegion = English; 309 | hasScannedForEncodings = 0; 310 | knownRegions = ( 311 | en, 312 | ); 313 | mainGroup = 24F6EE3B158A3F1E00CEDD41; 314 | productRefGroup = 24F6EE47158A3F1E00CEDD41 /* Products */; 315 | projectDirPath = ""; 316 | projectRoot = ""; 317 | targets = ( 318 | 2437B6F115B97DD500750117 /* DCTUIKit */, 319 | 24F6EE55158A3F1E00CEDD41 /* DCTUIKitTests */, 320 | ); 321 | }; 322 | /* End PBXProject section */ 323 | 324 | /* Begin PBXResourcesBuildPhase section */ 325 | 24F6EE53158A3F1E00CEDD41 /* Resources */ = { 326 | isa = PBXResourcesBuildPhase; 327 | buildActionMask = 2147483647; 328 | files = ( 329 | 24F6EE64158A3F1E00CEDD41 /* InfoPlist.strings in Resources */, 330 | ); 331 | runOnlyForDeploymentPostprocessing = 0; 332 | }; 333 | /* End PBXResourcesBuildPhase section */ 334 | 335 | /* Begin PBXShellScriptBuildPhase section */ 336 | 24F6EE54158A3F1E00CEDD41 /* ShellScript */ = { 337 | isa = PBXShellScriptBuildPhase; 338 | buildActionMask = 2147483647; 339 | files = ( 340 | ); 341 | inputPaths = ( 342 | ); 343 | outputPaths = ( 344 | ); 345 | runOnlyForDeploymentPostprocessing = 0; 346 | shellPath = /bin/sh; 347 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 348 | }; 349 | /* End PBXShellScriptBuildPhase section */ 350 | 351 | /* Begin PBXSourcesBuildPhase section */ 352 | 2437B6EE15B97DD500750117 /* Sources */ = { 353 | isa = PBXSourcesBuildPhase; 354 | buildActionMask = 2147483647; 355 | files = ( 356 | 2437B70015B97E0B00750117 /* DCTTableViewController.m in Sources */, 357 | 2437B70215B97E0B00750117 /* DCTViewController.m in Sources */, 358 | 2437B70415B97E0B00750117 /* UIAlertView+DCTErrorHandling.m in Sources */, 359 | 2437B70615B97E0B00750117 /* UIColor+DCTComponents.m in Sources */, 360 | 2437B70815B97E0B00750117 /* UIColor+DCTHex.m in Sources */, 361 | 2437B70A15B97E0B00750117 /* UIDevice+DCTFeatureCheck.m in Sources */, 362 | 2437B70C15B97E0B00750117 /* UIDevice+DCTSystemVersion.m in Sources */, 363 | 2437B70E15B97E0B00750117 /* UINib+DCTExtensions.m in Sources */, 364 | 2437B71015B97E0B00750117 /* UIResponder+DCTNextResponderExtensions.m in Sources */, 365 | 2437B71215B97E0B00750117 /* UITableViewCell+DCTExtensions.m in Sources */, 366 | 2437B71415B97E0B00750117 /* UIView+DCTAnimation.m in Sources */, 367 | 2437B71615B97E0B00750117 /* UIView+DCTFirstResponder.m in Sources */, 368 | 2437B71815B97E0B00750117 /* UIView+DCTLogging.m in Sources */, 369 | 2437B71A15B97E0B00750117 /* UIView+DCTSubviewExtensions.m in Sources */, 370 | 2437B71C15B97E0B00750117 /* UIViewController+DCTExtras.m in Sources */, 371 | 2437B71E15B97E0B00750117 /* UIViewController+DCTViewController.m in Sources */, 372 | 2437B72015B97E0B00750117 /* UIWindow+DCTFirstResponder.m in Sources */, 373 | 2437B72215B97E0B00750117 /* UIImageView+DCTImageSizing.m in Sources */, 374 | 2437B72415B97E0B00750117 /* UIColor+DCTMixing.m in Sources */, 375 | 2437B72615B97E0B00750117 /* UITableView+DCTExtras.m in Sources */, 376 | ); 377 | runOnlyForDeploymentPostprocessing = 0; 378 | }; 379 | 24F6EE51158A3F1E00CEDD41 /* Sources */ = { 380 | isa = PBXSourcesBuildPhase; 381 | buildActionMask = 2147483647; 382 | files = ( 383 | 24F6EE67158A3F1E00CEDD41 /* DCTUIKitTests.m in Sources */, 384 | ); 385 | runOnlyForDeploymentPostprocessing = 0; 386 | }; 387 | /* End PBXSourcesBuildPhase section */ 388 | 389 | /* Begin PBXVariantGroup section */ 390 | 24F6EE62158A3F1E00CEDD41 /* InfoPlist.strings */ = { 391 | isa = PBXVariantGroup; 392 | children = ( 393 | 24F6EE63158A3F1E00CEDD41 /* en */, 394 | ); 395 | name = InfoPlist.strings; 396 | sourceTree = ""; 397 | }; 398 | /* End PBXVariantGroup section */ 399 | 400 | /* Begin XCBuildConfiguration section */ 401 | 2437B6FC15B97DD600750117 /* Debug */ = { 402 | isa = XCBuildConfiguration; 403 | buildSettings = { 404 | CLANG_CXX_LIBRARY = "libc++"; 405 | DSTROOT = /tmp/DCTUIKit.dst; 406 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 407 | GCC_PREFIX_HEADER = ""; 408 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 409 | OTHER_LDFLAGS = "-ObjC"; 410 | PRODUCT_NAME = "$(TARGET_NAME)"; 411 | SKIP_INSTALL = YES; 412 | }; 413 | name = Debug; 414 | }; 415 | 2437B6FD15B97DD600750117 /* Release */ = { 416 | isa = XCBuildConfiguration; 417 | buildSettings = { 418 | CLANG_CXX_LIBRARY = "libc++"; 419 | DSTROOT = /tmp/DCTUIKit.dst; 420 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 421 | GCC_PREFIX_HEADER = ""; 422 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 423 | OTHER_LDFLAGS = "-ObjC"; 424 | PRODUCT_NAME = "$(TARGET_NAME)"; 425 | SKIP_INSTALL = YES; 426 | }; 427 | name = Release; 428 | }; 429 | 24F6EE68158A3F1E00CEDD41 /* Debug */ = { 430 | isa = XCBuildConfiguration; 431 | buildSettings = { 432 | ALWAYS_SEARCH_USER_PATHS = NO; 433 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 434 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 435 | CLANG_ENABLE_OBJC_ARC = YES; 436 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 437 | COPY_PHASE_STRIP = NO; 438 | GCC_C_LANGUAGE_STANDARD = gnu99; 439 | GCC_DYNAMIC_NO_PIC = NO; 440 | GCC_OPTIMIZATION_LEVEL = 0; 441 | GCC_PREPROCESSOR_DEFINITIONS = ( 442 | "DEBUG=1", 443 | "$(inherited)", 444 | ); 445 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 446 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 447 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 448 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 449 | GCC_WARN_UNUSED_VARIABLE = YES; 450 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 451 | SDKROOT = iphoneos; 452 | }; 453 | name = Debug; 454 | }; 455 | 24F6EE69158A3F1E00CEDD41 /* Release */ = { 456 | isa = XCBuildConfiguration; 457 | buildSettings = { 458 | ALWAYS_SEARCH_USER_PATHS = NO; 459 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 460 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 461 | CLANG_ENABLE_OBJC_ARC = YES; 462 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 463 | COPY_PHASE_STRIP = YES; 464 | GCC_C_LANGUAGE_STANDARD = gnu99; 465 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 466 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 467 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 468 | GCC_WARN_UNUSED_VARIABLE = YES; 469 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 470 | SDKROOT = iphoneos; 471 | VALIDATE_PRODUCT = YES; 472 | }; 473 | name = Release; 474 | }; 475 | 24F6EE6E158A3F1E00CEDD41 /* Debug */ = { 476 | isa = XCBuildConfiguration; 477 | buildSettings = { 478 | FRAMEWORK_SEARCH_PATHS = ( 479 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 480 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 481 | ); 482 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 483 | GCC_PREFIX_HEADER = "DCTUIKit/DCTUIKit-Prefix.pch"; 484 | INFOPLIST_FILE = "DCTUIKitTests/DCTUIKitTests-Info.plist"; 485 | PRODUCT_NAME = "$(TARGET_NAME)"; 486 | WRAPPER_EXTENSION = octest; 487 | }; 488 | name = Debug; 489 | }; 490 | 24F6EE6F158A3F1E00CEDD41 /* Release */ = { 491 | isa = XCBuildConfiguration; 492 | buildSettings = { 493 | FRAMEWORK_SEARCH_PATHS = ( 494 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 495 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 496 | ); 497 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 498 | GCC_PREFIX_HEADER = "DCTUIKit/DCTUIKit-Prefix.pch"; 499 | INFOPLIST_FILE = "DCTUIKitTests/DCTUIKitTests-Info.plist"; 500 | PRODUCT_NAME = "$(TARGET_NAME)"; 501 | WRAPPER_EXTENSION = octest; 502 | }; 503 | name = Release; 504 | }; 505 | /* End XCBuildConfiguration section */ 506 | 507 | /* Begin XCConfigurationList section */ 508 | 2437B6FB15B97DD600750117 /* Build configuration list for PBXNativeTarget "DCTUIKit" */ = { 509 | isa = XCConfigurationList; 510 | buildConfigurations = ( 511 | 2437B6FC15B97DD600750117 /* Debug */, 512 | 2437B6FD15B97DD600750117 /* Release */, 513 | ); 514 | defaultConfigurationIsVisible = 0; 515 | }; 516 | 24F6EE40158A3F1E00CEDD41 /* Build configuration list for PBXProject "DCTUIKit" */ = { 517 | isa = XCConfigurationList; 518 | buildConfigurations = ( 519 | 24F6EE68158A3F1E00CEDD41 /* Debug */, 520 | 24F6EE69158A3F1E00CEDD41 /* Release */, 521 | ); 522 | defaultConfigurationIsVisible = 0; 523 | defaultConfigurationName = Release; 524 | }; 525 | 24F6EE6D158A3F1E00CEDD41 /* Build configuration list for PBXNativeTarget "DCTUIKitTests" */ = { 526 | isa = XCConfigurationList; 527 | buildConfigurations = ( 528 | 24F6EE6E158A3F1E00CEDD41 /* Debug */, 529 | 24F6EE6F158A3F1E00CEDD41 /* Release */, 530 | ); 531 | defaultConfigurationIsVisible = 0; 532 | defaultConfigurationName = Release; 533 | }; 534 | /* End XCConfigurationList section */ 535 | }; 536 | rootObject = 24F6EE3D158A3F1E00CEDD41 /* Project object */; 537 | } 538 | -------------------------------------------------------------------------------- /DCTUIKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DCTUIKit/DCTTableViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | DCTTableViewController.h 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 9.8.2010. 6 | 7 | 8 | 9 | Copyright (c) 2010 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import 38 | #import "DCTViewController.h" 39 | 40 | /** Custom table view controller based on UITableViewController, but with some enhancements. 41 | */ 42 | @interface DCTTableViewController : UITableViewController 43 | 44 | @property (nonatomic, strong) id tableViewDataSource; 45 | - (void)loadTableViewDataSource; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /DCTUIKit/DCTTableViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | DCTTableViewController.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 9.8.2010. 6 | 7 | 8 | 9 | Copyright (c) 2010 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import "DCTTableViewController.h" 38 | #import "UIViewController+DCTViewController.h" 39 | 40 | @interface DCTTableViewController () 41 | - (void)dctInternal_setupDataSource; 42 | @end 43 | 44 | @implementation DCTTableViewController { 45 | CGPoint savedOffset; 46 | NSIndexPath *savedIndexPath; 47 | } 48 | 49 | @synthesize tableViewDataSource; 50 | 51 | #pragma mark - NSObject 52 | 53 | - (id)initWithCoder:(NSCoder *)coder { 54 | 55 | if (!(self = [super initWithCoder:coder])) return nil; 56 | 57 | [self dct_sharedInit]; 58 | 59 | return self; 60 | } 61 | 62 | #pragma mark - UIViewController 63 | 64 | 65 | - (id)initWithNibName:(NSString *)nibName bundle:(NSBundle *)bundle { 66 | 67 | if (!(self = [super initWithNibName:nibName bundle:bundle])) return nil; 68 | 69 | [self dct_sharedInit]; 70 | 71 | return self; 72 | } 73 | 74 | - (void)viewDidUnload { 75 | [super viewDidUnload]; 76 | tableViewDataSource = nil; 77 | } 78 | 79 | - (void)viewDidLoad { 80 | [super viewDidLoad]; 81 | [self dct_viewDidLoad]; 82 | [self tableViewDataSource]; 83 | } 84 | 85 | - (void)loadView { 86 | [self dct_loadView]; 87 | 88 | if (![self isViewLoaded]) [super loadView]; 89 | } 90 | 91 | - (NSString *)title { 92 | NSString *t = super.title; 93 | 94 | if (!(t) || [t isEqualToString:@""]) { 95 | [self loadTitle]; 96 | t = super.title; 97 | } 98 | 99 | return t; 100 | } 101 | 102 | // Saving and reloading the position of the table view - if memory warning removes table. 103 | 104 | - (void)viewWillDisappear:(BOOL)animated { 105 | [super viewWillDisappear:animated]; 106 | [self dct_viewWillDisappear:animated]; 107 | savedOffset = self.tableView.contentOffset; 108 | savedIndexPath = [self.tableView indexPathForSelectedRow]; 109 | } 110 | 111 | - (void)viewWillAppear:(BOOL)animated { 112 | [self.tableView selectRowAtIndexPath:savedIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; 113 | self.tableView.contentOffset = savedOffset; 114 | 115 | [self tableViewDataSource]; 116 | [super viewWillAppear:animated]; 117 | [self dct_viewWillAppear:animated]; 118 | } 119 | 120 | #pragma mark - DCTTableViewController 121 | 122 | - (id)tableViewDataSource { 123 | 124 | if (!tableViewDataSource) 125 | [self loadTableViewDataSource]; 126 | 127 | return tableViewDataSource; 128 | } 129 | 130 | - (void)setTableViewDataSource:(id)tvds { 131 | 132 | if (tableViewDataSource == tvds) return; 133 | 134 | tableViewDataSource = tvds; 135 | 136 | [self dctInternal_setupDataSource]; 137 | } 138 | 139 | - (void)setTableView:(UITableView *)tableView { 140 | [super setTableView:tableView]; 141 | [self dctInternal_setupDataSource]; 142 | } 143 | 144 | - (void)loadTableViewDataSource {} 145 | 146 | #pragma mark - DCTViewController 147 | 148 | - (IBAction)dismissModalViewController:(id)sender { 149 | [self dct_dismissModalViewController:sender]; 150 | } 151 | 152 | - (void)sharedInit {} 153 | - (void)loadTitle {} 154 | - (void)keyboardWillShowNotification:(NSNotification *)notification {} 155 | - (void)keyboardDidShowNotification:(NSNotification *)notification {} 156 | - (void)keyboardWillHideNotification:(NSNotification *)notification {} 157 | - (void)keyboardDidHideNotification:(NSNotification *)notification {} 158 | 159 | #pragma mark - Internal 160 | 161 | - (void)dctInternal_setupDataSource { 162 | 163 | if (self.tableViewDataSource == nil) return; 164 | 165 | self.tableView.dataSource = self.tableViewDataSource; 166 | [self.tableView reloadData]; 167 | } 168 | 169 | @end 170 | -------------------------------------------------------------------------------- /DCTUIKit/DCTUIKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // DCTUIKit.h 3 | // DCTUIKit 4 | // 5 | // Created by Daniel Tull on 27.01.2012. 6 | // Copyright (c) 2012 Daniel Tull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #ifndef dctuikit 12 | 13 | #define dctuikit_1_0 10000 14 | #define dctuikit_1_0_1 10001 15 | #define dctuikit_1_0_2 10002 16 | #define dctuikit_1_0_3 10003 17 | #define dctuikit_1_0_4 10004 18 | 19 | #define dctuikit_1_1 10100 20 | #define dctuikit_1_1_4 10104 21 | #define dctuikit_1_1_5 10105 22 | #define dctuikit_1_1_6 10106 23 | #define dctuikit_1_1_7 10107 24 | #define dctuikit_1_1_8 10108 25 | 26 | #define dctuikit_1_2 10200 27 | #define dctuikit_1_2_1 10201 28 | #define dctuikit_1_2_2 10202 29 | #define dctuikit_1_2_3 10203 30 | #define dctuikit_1_2_4 10204 31 | #define dctuikit_1_2_5 10205 32 | 33 | #define dctuikit_2_0 20000 34 | #define dctuikit_2_0_1 20001 35 | #define dctuikit_2_0_2 20002 36 | #define dctuikit_2_1 20100 37 | 38 | #define dctuikit dctuikit_2_1 39 | 40 | #endif 41 | 42 | #import 43 | #import 44 | #import 45 | #import 46 | #import 47 | #import 48 | #import 49 | #import 50 | #import 51 | #import 52 | #import 53 | #import 54 | #import 55 | #import 56 | #import 57 | #import 58 | #import 59 | #import 60 | -------------------------------------------------------------------------------- /DCTUIKit/DCTViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | DCTViewController.h 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 19.9.2010. 6 | 7 | 8 | 9 | Copyright (c) 2010 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import 38 | 39 | 40 | 41 | 42 | @protocol DCTViewController 43 | 44 | - (void)keyboardWillShowNotification:(NSNotification *)notification; 45 | - (void)keyboardDidShowNotification:(NSNotification *)notification; 46 | - (void)keyboardWillHideNotification:(NSNotification *)notification; 47 | - (void)keyboardDidHideNotification:(NSNotification *)notification; 48 | 49 | - (IBAction)dismissModalViewController:(id)sender; 50 | 51 | - (void)loadTitle; 52 | 53 | - (void)sharedInit; 54 | 55 | @end 56 | 57 | 58 | 59 | /** Subclass of UIViewController. 60 | */ 61 | @interface DCTViewController : UIViewController 62 | @property (nonatomic, assign) BOOL resizeViewToFitKeyboard; 63 | @property (nonatomic, assign) BOOL resizeViewToBottomEdgeOfScreenBeforeResizingForKeyboard; 64 | @end 65 | -------------------------------------------------------------------------------- /DCTUIKit/DCTViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | DCTViewController.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 19.9.2010. 6 | 7 | 8 | 9 | Copyright (c) 2010 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import "DCTViewController.h" 38 | #import "UIResponder+DCTNextResponderExtensions.h" 39 | #import "UIView+DCTAnimation.h" 40 | #import "UINib+DCTExtensions.h" 41 | #import "UIViewController+DCTViewController.h" 42 | 43 | @interface DCTViewController () 44 | - (void)dctInternal_keyboardWillHide:(BOOL)hidden withNotification:(NSNotification *)notification; 45 | @end 46 | 47 | @implementation DCTViewController 48 | 49 | @synthesize resizeViewToFitKeyboard; 50 | @synthesize resizeViewToBottomEdgeOfScreenBeforeResizingForKeyboard; 51 | 52 | #pragma mark - NSObject 53 | 54 | - (id)initWithCoder:(NSCoder *)coder { 55 | 56 | if (!(self = [super initWithCoder:coder])) return nil; 57 | 58 | [self dct_sharedInit]; 59 | 60 | return self; 61 | } 62 | 63 | #pragma mark - UIViewController 64 | 65 | - (id)initWithNibName:(NSString *)nibName bundle:(NSBundle *)bundle { 66 | 67 | if (!(self = [super initWithNibName:nibName bundle:bundle])) return nil; 68 | 69 | [self dct_sharedInit]; 70 | 71 | return self; 72 | } 73 | 74 | - (void)viewDidLoad { 75 | [super viewDidLoad]; 76 | [self dct_viewDidLoad]; 77 | } 78 | 79 | - (void)loadView { 80 | [self dct_loadView]; 81 | 82 | if (![self isViewLoaded]) [super loadView]; 83 | } 84 | 85 | - (NSString *)title { 86 | NSString *t = super.title; 87 | 88 | if (!(t) || [t isEqualToString:@""]) { 89 | [self loadTitle]; 90 | t = super.title; 91 | } 92 | 93 | return t; 94 | } 95 | 96 | - (void)viewWillDisappear:(BOOL)animated { 97 | [super viewWillDisappear:animated]; 98 | [self dct_viewWillDisappear:animated]; 99 | } 100 | 101 | - (void)viewWillAppear:(BOOL)animated { 102 | [super viewWillAppear:animated]; 103 | [self dct_viewWillAppear:animated]; 104 | } 105 | 106 | #pragma mark - DCTViewController 107 | 108 | - (IBAction)dismissModalViewController:(id)sender { 109 | [self dct_dismissModalViewController:sender]; 110 | } 111 | 112 | - (void)sharedInit {} 113 | - (void)loadTitle {} 114 | - (void)keyboardWillShowNotification:(NSNotification *)notification { 115 | if (self.resizeViewToFitKeyboard) 116 | [self dctInternal_keyboardWillHide:NO withNotification:notification]; 117 | } 118 | - (void)keyboardDidShowNotification:(NSNotification *)notification {} 119 | 120 | - (void)keyboardWillHideNotification:(NSNotification *)notification { 121 | if (self.resizeViewToFitKeyboard) 122 | [self dctInternal_keyboardWillHide:YES withNotification:notification]; 123 | } 124 | 125 | - (void)keyboardDidHideNotification:(NSNotification *)notification {} 126 | 127 | - (void)dctInternal_keyboardWillHide:(BOOL)hidden withNotification:(NSNotification *)notification { 128 | 129 | UIView *view = self.view; 130 | 131 | NSDictionary *userInfo = [notification userInfo]; 132 | 133 | CGRect keyboardEndRect, keyboardBeginRect; 134 | [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] getValue:&keyboardEndRect]; 135 | [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] getValue:&keyboardBeginRect]; 136 | 137 | if (keyboardEndRect.origin.y == keyboardBeginRect.origin.y) return; 138 | 139 | UIWindow *window = view.window; 140 | CGRect endRect = [window convertRect:keyboardEndRect toView:view]; 141 | 142 | CGRect originalRect; 143 | 144 | if (!hidden) originalRect = view.frame; 145 | 146 | if (self.resizeViewToBottomEdgeOfScreenBeforeResizingForKeyboard) { 147 | 148 | CGRect beginRect = [window convertRect:keyboardBeginRect toView:view]; 149 | 150 | [UIView animateWithDuration:0.0f animations:^(void) { 151 | view.frame = CGRectMake(originalRect.origin.x, 152 | originalRect.origin.y, 153 | originalRect.size.width, 154 | beginRect.origin.y); 155 | }]; 156 | } 157 | 158 | UIViewAnimationCurve curve; 159 | [[userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] getValue:&curve]; 160 | UIViewAnimationOptions animationOptions = [UIView dct_animationOptionCurveForAnimationCurve:curve]; 161 | 162 | double duration = [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; 163 | 164 | [UIView animateWithDuration:duration 165 | delay:0.0f 166 | options:animationOptions 167 | animations:^(void) { 168 | 169 | if (hidden && !self.resizeViewToBottomEdgeOfScreenBeforeResizingForKeyboard) 170 | view.frame = originalRect; 171 | else 172 | view.frame = CGRectMake(originalRect.origin.x, 173 | originalRect.origin.y, 174 | originalRect.size.width, 175 | endRect.origin.y); 176 | 177 | } completion:^(BOOL finished) { 178 | 179 | if (hidden && self.resizeViewToBottomEdgeOfScreenBeforeResizingForKeyboard) 180 | view.frame = originalRect; 181 | }]; 182 | } 183 | 184 | @end 185 | -------------------------------------------------------------------------------- /DCTUIKit/UIAlertView+DCTErrorHandling.h: -------------------------------------------------------------------------------- 1 | /* 2 | UIAlertView+DCTErrorHandling.h 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 24.10.2010. 6 | 7 | 8 | 9 | Copyright (c) 2010 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import 38 | 39 | 40 | @interface UIAlertView (DCTErrorHandling) 41 | 42 | /** Creates and presents a UIAlertView with the given error. 43 | 44 | Uses dct_alertViewWithError: to create the alert view and calls show on it. 45 | 46 | @param error The error to use for the information to display in the alert view. 47 | @return The created Alert View. 48 | */ 49 | + (id)dct_presentAlertViewWithError:(NSError *)error; 50 | 51 | /** Creates a UIAlertView with the given error. 52 | 53 | @param error The error to use for the information to display in the alert view. 54 | 55 | @return The created Alert View. 56 | */ 57 | + (id)dct_alertViewWithError:(NSError *)error; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /DCTUIKit/UIAlertView+DCTErrorHandling.m: -------------------------------------------------------------------------------- 1 | /* 2 | UIAlertView+DCTErrorHandling.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 24.10.2010. 6 | 7 | 8 | 9 | Copyright (c) 2010 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import "UIAlertView+DCTErrorHandling.h" 38 | 39 | 40 | @implementation UIAlertView (DCTErrorHandling) 41 | 42 | + (id)dct_presentAlertViewWithError:(NSError *)error { 43 | UIAlertView *alertView = [self dct_alertViewWithError:error]; 44 | [alertView show]; 45 | return alertView; 46 | } 47 | 48 | + (id)dct_alertViewWithError:(NSError *)error { 49 | 50 | NSArray *options = [error localizedRecoveryOptions]; 51 | NSInteger count = [options count]; 52 | 53 | NSString *cancelTitle = @"OK"; 54 | if (count > 0) cancelTitle = [options objectAtIndex:0]; 55 | 56 | NSArray *otherButtons = nil; 57 | if (count > 1) { 58 | NSMutableArray *mutableOptions = [options mutableCopy]; 59 | [mutableOptions removeObjectAtIndex:0]; 60 | otherButtons = [mutableOptions copy]; 61 | } 62 | 63 | id alertView = [[self alloc] initWithTitle:[error domain] 64 | message:[error localizedDescription] 65 | delegate:nil 66 | cancelButtonTitle:cancelTitle 67 | otherButtonTitles:nil]; 68 | 69 | for (NSString *s in otherButtons) 70 | [alertView addButtonWithTitle:s]; 71 | 72 | return alertView; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /DCTUIKit/UIColor+DCTComponents.h: -------------------------------------------------------------------------------- 1 | /* 2 | UIColor+DCTComponents.h 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 8.1.2011. 6 | 7 | 8 | 9 | Copyright (c) 2011 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import 38 | 39 | @interface UIColor (DCTComponents) 40 | 41 | @property (nonatomic, readonly) CGFloat dct_red; 42 | @property (nonatomic, readonly) CGFloat dct_green; 43 | @property (nonatomic, readonly) CGFloat dct_blue; 44 | @property (nonatomic, readonly) CGFloat dct_alpha; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /DCTUIKit/UIColor+DCTComponents.m: -------------------------------------------------------------------------------- 1 | /* 2 | UIColor+DCTComponents.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 8.1.2011. 6 | 7 | 8 | 9 | Copyright (c) 2011 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import "UIColor+DCTComponents.h" 38 | 39 | @implementation UIColor (DCTComponents) 40 | 41 | - (CGFloat)dct_red { 42 | const CGFloat *components = CGColorGetComponents(self.CGColor); 43 | return components[0]; 44 | } 45 | 46 | - (CGFloat)dct_green { 47 | const CGFloat *components = CGColorGetComponents(self.CGColor); 48 | return components[1]; 49 | } 50 | 51 | - (CGFloat)dct_blue { 52 | const CGFloat *components = CGColorGetComponents(self.CGColor); 53 | return components[2]; 54 | } 55 | 56 | - (CGFloat)dct_alpha { 57 | const CGFloat *components = CGColorGetComponents(self.CGColor); 58 | return components[3]; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /DCTUIKit/UIColor+DCTHex.h: -------------------------------------------------------------------------------- 1 | /* 2 | UIColor+DCTHex.h 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 8.1.2011. 6 | 7 | 8 | 9 | Copyright (c) 2011 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import 38 | 39 | @interface UIColor (DCTHex) 40 | 41 | 42 | 43 | /** Accessor to get a color object from a hexadecimal-based string. The returned 44 | color has an alpha value of 1. 45 | 46 | @param string The string in hexadecimal format for example: @"FFE378". 47 | 48 | @return The created UIColor object. 49 | */ 50 | + (UIColor *)dct_colorWithHexString:(NSString *)string; 51 | 52 | 53 | 54 | /** Accessor to get a color object from a hexadecimal-based string. 55 | 56 | @param string The string in hexadecimal format for example: @"FFE378". 57 | @param alpha The value to use for the alpha. 58 | 59 | @return The created UIColor object. 60 | */ 61 | + (UIColor *)dct_colorWithHexString:(NSString *)string alpha:(CGFloat)alpha; 62 | 63 | 64 | 65 | /** Accessor to get a color object from a hexadecimal value. The returned 66 | color has an alpha value of 1. 67 | 68 | @param value The value in hexadecimal format for example: 0xFFE378. 69 | 70 | @return The created UIColor object. 71 | */ 72 | + (UIColor *)dct_colorWithHexValue:(NSInteger)value; 73 | 74 | 75 | 76 | /** Accessor to get a color object from a hexadecimal value. 77 | 78 | @param value The value in hexadecimal format for example: 0xFFE378. 79 | @param alpha The value to use for the alpha. 80 | 81 | @return The created UIColor object. 82 | */ 83 | + (UIColor *)dct_colorWithHexValue:(NSInteger)value alpha:(CGFloat)alpha; 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /DCTUIKit/UIColor+DCTHex.m: -------------------------------------------------------------------------------- 1 | /* 2 | UIColor+DCTHex.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 8.1.2011. 6 | 7 | 8 | 9 | Copyright (c) 2011 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | 38 | #import "UIColor+DCTHex.h" 39 | 40 | @implementation UIColor (DCTHex) 41 | 42 | + (UIColor *)dct_colorWithHexString:(NSString *)string { 43 | return [self dct_colorWithHexString:string alpha:1.0f]; 44 | } 45 | 46 | + (UIColor *)dct_colorWithHexString:(NSString *)string alpha:(CGFloat)alpha { 47 | 48 | unsigned int value; 49 | 50 | [[NSScanner scannerWithString:string] scanHexInt:&value]; 51 | 52 | return [self dct_colorWithHexValue:(NSInteger)value alpha:alpha]; 53 | } 54 | 55 | + (UIColor *)dct_colorWithHexValue:(NSInteger)value { 56 | return [UIColor dct_colorWithHexValue:value alpha:1.0f]; 57 | } 58 | 59 | + (UIColor *)dct_colorWithHexValue:(NSInteger)value alpha:(CGFloat)alpha { 60 | 61 | CGFloat red = ((CGFloat)((value & 0xFF0000) >> 16))/255.0f; 62 | CGFloat green = ((CGFloat)((value & 0xFF00) >> 8))/255.0f; 63 | CGFloat blue = ((CGFloat)(value & 0xFF))/255.0f; 64 | 65 | return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /DCTUIKit/UIColor+DCTMixing.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+DCTMixing.h 3 | // Tweetopolis 4 | // 5 | // Created by Daniel Tull on 12.03.2012. 6 | // Copyright (c) 2012 Daniel Tull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (DCTMixing) 12 | 13 | - (UIColor *)dct_colorWithAlpha:(CGFloat)alpha; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /DCTUIKit/UIColor+DCTMixing.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+DCTMixing.m 3 | // Tweetopolis 4 | // 5 | // Created by Daniel Tull on 12.03.2012. 6 | // Copyright (c) 2012 Daniel Tull. All rights reserved. 7 | // 8 | 9 | #import "UIColor+DCTMixing.h" 10 | 11 | @implementation UIColor (DCTMixing) 12 | 13 | - (UIColor *)dct_colorWithAlpha:(CGFloat)alpha { 14 | 15 | CGColorRef selfColorRef = self.CGColor; 16 | const CGFloat *components = CGColorGetComponents(selfColorRef); 17 | int selfNumberOfComponents = CGColorGetNumberOfComponents(selfColorRef); 18 | 19 | if (selfNumberOfComponents == 2) 20 | return [UIColor colorWithWhite:components[0] alpha:alpha]; 21 | 22 | return [UIColor colorWithRed:components[0] 23 | green:components[1] 24 | blue:components[2] 25 | alpha:alpha]; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /DCTUIKit/UIDevice+DCTFeatureCheck.h: -------------------------------------------------------------------------------- 1 | /* 2 | UIDevice+DCTFeatureCheck.h 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 28.8.2010. 6 | 7 | 8 | 9 | Copyright (c) 2010 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import 38 | 39 | /** Feature checking category. 40 | */ 41 | @interface UIDevice (DCTFeatureCheck) 42 | 43 | /** A safe method to use for any OS. 44 | 45 | Ths method checks to see if `isMultitaskingSupported` exists on UIDevice, if 46 | it doesn't it returns NO. 47 | 48 | If the method does exist, it returns the result of calling it. 49 | 50 | @return YES if the device supports multitasking. 51 | */ 52 | - (BOOL)dct_multitaskingSupported; 53 | 54 | /** Method to check for blocks support on the current device's OS. 55 | 56 | Blocks were brought in iOS4, so this checks if the major version number is 57 | greater than or equal to 4. 58 | 59 | @return YES if blocks are supported. 60 | 61 | @see [UIDevice(DCTSystemVersion) dct_majorSystemVersion] 62 | */ 63 | - (BOOL)dct_blocksSupported; 64 | @end 65 | -------------------------------------------------------------------------------- /DCTUIKit/UIDevice+DCTFeatureCheck.m: -------------------------------------------------------------------------------- 1 | /* 2 | UIDevice+DCTFeatureCheck.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 28.8.2010. 6 | 7 | 8 | 9 | Copyright (c) 2010 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import "UIDevice+DCTFeatureCheck.h" 38 | #import "UIDevice+DCTSystemVersion.h" 39 | 40 | @implementation UIDevice (DCTFeatureCheck) 41 | 42 | - (BOOL)dct_multitaskingSupported { 43 | 44 | if (![self respondsToSelector:@selector(isMultitaskingSupported)]) return NO; 45 | 46 | return self.multitaskingSupported; 47 | } 48 | 49 | - (BOOL)dct_blocksSupported { 50 | return ([self dct_majorSystemVersion] >= 4); 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /DCTUIKit/UIDevice+DCTSystemVersion.h: -------------------------------------------------------------------------------- 1 | /* 2 | UIDevice+DCTSystemVersion.h 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 26.6.2009. 6 | 7 | 8 | 9 | Copyright (c) 2009 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import 38 | 39 | /** Category to show the version numbers for the system. */ 40 | @interface UIDevice (DCTSystemVersion) 41 | 42 | /** Returns the major part of the system version. 43 | 44 | If the system version is `4.2.1`, this returns `4`. 45 | 46 | @return The major part of the system version. 47 | */ 48 | - (NSInteger)dct_majorSystemVersion; 49 | 50 | /** Returns the minor part of the system version. 51 | 52 | If the system version is `4.2.1`, this returns `2`. 53 | 54 | @return The minor part of the system version. 55 | */ 56 | - (NSInteger)dct_minorSystemVersion; 57 | 58 | /** Returns the maintenance part of the system version. 59 | 60 | If the system version is `4.2.1`, this returns `1`. 61 | 62 | @return The maintenance part of the system version. 63 | */ 64 | - (NSInteger)dct_maintenanceSystemVersion; 65 | @end 66 | -------------------------------------------------------------------------------- /DCTUIKit/UIDevice+DCTSystemVersion.m: -------------------------------------------------------------------------------- 1 | /* 2 | UIDevice+DCTSystemVersion.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 26.6.2009. 6 | 7 | 8 | 9 | Copyright (c) 2009 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import "UIDevice+DCTSystemVersion.h" 38 | 39 | @interface UIDevice (DCTSystemVersionInternal) 40 | - (NSInteger)dctSystemVersionInternal_systemVersionComponentAtIndex:(NSUInteger)theIndex; 41 | @end 42 | 43 | @implementation UIDevice (DCTSystemVersion) 44 | 45 | - (NSInteger)dct_majorSystemVersion { 46 | return [self dctSystemVersionInternal_systemVersionComponentAtIndex:0]; 47 | } 48 | 49 | - (NSInteger)dct_minorSystemVersion { 50 | return [self dctSystemVersionInternal_systemVersionComponentAtIndex:1]; 51 | } 52 | 53 | - (NSInteger)dct_maintenanceSystemVersion { 54 | return [self dctSystemVersionInternal_systemVersionComponentAtIndex:2]; 55 | } 56 | 57 | #pragma mark - Internal 58 | 59 | - (NSInteger)dctSystemVersionInternal_systemVersionComponentAtIndex:(NSUInteger)theIndex { 60 | 61 | NSArray *components = [self.systemVersion componentsSeparatedByString:@"."]; 62 | 63 | if ([components count] <= theIndex) return -1; 64 | 65 | return [[components objectAtIndex:theIndex] integerValue]; 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /DCTUIKit/UIImageView+DCTImageSizing.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+DCTImageSizing.h 3 | // Tweetville 4 | // 5 | // Created by Daniel Tull on 17/05/2012. 6 | // Copyright (c) 2012 Daniel Tull Limited. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImageView (DCTImageSizing) 12 | - (CGSize)dct_imageSize; 13 | @end 14 | -------------------------------------------------------------------------------- /DCTUIKit/UIImageView+DCTImageSizing.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+DCTImageSizing.m 3 | // Tweetville 4 | // 5 | // Created by Daniel Tull on 17/05/2012. 6 | // Copyright (c) 2012 Daniel Tull Limited. All rights reserved. 7 | // 8 | 9 | #import "UIImageView+DCTImageSizing.h" 10 | 11 | @implementation UIImageView (DCTImageSizing) 12 | 13 | - (CGSize)dct_imageSize { 14 | CGFloat scale = [UIScreen mainScreen].scale; 15 | CGSize imageViewSize = self.bounds.size; 16 | return CGSizeMake(imageViewSize.width*scale, imageViewSize.height*scale); 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /DCTUIKit/UINib+DCTExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINib+DCTExtensions.h 3 | // DCTUIKit 4 | // 5 | // Created by Daniel Tull on 9.07.2011. 6 | // Copyright 2011 Daniel Tull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UINib (DCTExtensions) 12 | 13 | + (BOOL)dct_nibExistsWithNibName:(NSString *)nibName bundle:(NSBundle *)bundle; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /DCTUIKit/UINib+DCTExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UINib+DCTExtensions.m 3 | // DCTUIKit 4 | // 5 | // Created by Daniel Tull on 9.07.2011. 6 | // Copyright 2011 Daniel Tull. All rights reserved. 7 | // 8 | 9 | #import "UINib+DCTExtensions.h" 10 | 11 | @implementation UINib (DCTExtensions) 12 | 13 | + (BOOL)dct_nibExistsWithNibName:(NSString *)nibName bundle:(NSBundle *)bundle { 14 | 15 | if (nibName == nil) return NO; 16 | 17 | if (bundle == nil) bundle = [NSBundle mainBundle]; 18 | 19 | NSString *path = [bundle pathForResource:nibName ofType:@"nib"]; 20 | 21 | if (path == nil) path = [bundle pathForResource:nibName ofType:@"xib"]; // Is this check needed? All xibs will get compiled to nibs right? 22 | 23 | if (path == nil) return NO; 24 | 25 | return YES; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /DCTUIKit/UIResponder+DCTNextResponderExtensions.h: -------------------------------------------------------------------------------- 1 | /* 2 | UIResponder+DCTNextResponderExtensions.h 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 26.10.2009. 6 | 7 | 8 | 9 | Copyright (c) 2009 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import 38 | 39 | @interface UIResponder (DCTNextResponderExtensions) 40 | 41 | - (id)dct_nearestResponderOfClass:(Class)aClass; 42 | - (id)dct_furthestResponderOfClass:(Class)aClass; 43 | - (NSArray *)dct_allRespondersOfClass:(Class)aClass; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /DCTUIKit/UIResponder+DCTNextResponderExtensions.m: -------------------------------------------------------------------------------- 1 | /* 2 | UIResponder+DCTNextResponderExtensions.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 26.10.2009. 6 | 7 | 8 | 9 | Copyright (c) 2009 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import "UIResponder+DCTNextResponderExtensions.h" 38 | 39 | 40 | @implementation UIResponder (DCTNextResponderExtensions) 41 | 42 | - (id)dct_nearestResponderOfClass:(Class)aClass { 43 | 44 | if ([self isKindOfClass:aClass]) return self; 45 | 46 | return [[self nextResponder] dct_nearestResponderOfClass:aClass]; 47 | } 48 | 49 | - (id)dct_furthestResponderOfClass:(Class)aClass { 50 | 51 | NSArray *responders = [self dct_allRespondersOfClass:aClass]; 52 | 53 | return [responders lastObject]; 54 | } 55 | 56 | - (NSArray *)dct_allRespondersOfClass:(Class)aClass { 57 | 58 | UIResponder *nextResponder = self; 59 | 60 | NSMutableArray *array = [[NSMutableArray alloc] init]; 61 | 62 | do { 63 | 64 | if ([nextResponder isKindOfClass:aClass]) 65 | [array addObject:nextResponder]; 66 | 67 | } while ((nextResponder = [nextResponder nextResponder])); 68 | 69 | return array; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /DCTUIKit/UITableView+DCTExtras.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+DCTExtras.h 3 | // Tweetopolis 4 | // 5 | // Created by Daniel Tull on 05.05.2012. 6 | // Copyright (c) 2012 Daniel Tull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UITableView (DCTExtras) 12 | - (void)dct_scrollToBottomAnimated:(BOOL)animated; 13 | - (void)dct_scrollToTopAnimated:(BOOL)animated; 14 | - (NSIndexPath *)dct_indexPathOfLastCell; 15 | - (NSIndexPath *)dct_indexPathOfLastCellInSection:(NSInteger)section; 16 | @end 17 | -------------------------------------------------------------------------------- /DCTUIKit/UITableView+DCTExtras.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+DCTExtras.m 3 | // Tweetopolis 4 | // 5 | // Created by Daniel Tull on 05.05.2012. 6 | // Copyright (c) 2012 Daniel Tull. All rights reserved. 7 | // 8 | 9 | #import "UITableView+DCTExtras.h" 10 | 11 | @implementation UITableView (DCTExtras) 12 | 13 | - (void)dct_scrollToBottomAnimated:(BOOL)animated { 14 | NSIndexPath *indexPath = [self dct_indexPathOfLastCell]; 15 | if (!indexPath) return; 16 | [self scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:animated]; 17 | } 18 | 19 | - (void)dct_scrollToTopAnimated:(BOOL)animated { 20 | NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; 21 | [self scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:animated]; 22 | } 23 | 24 | - (NSIndexPath *)dct_indexPathOfLastCell { 25 | NSInteger section = [self numberOfSections] - 1; 26 | if (section < 0) return nil; 27 | return [self dct_indexPathOfLastCellInSection:section]; 28 | } 29 | 30 | - (NSIndexPath *)dct_indexPathOfLastCellInSection:(NSInteger)section { 31 | NSInteger row = [self numberOfRowsInSection:section] - 1; 32 | if (row < 0) return nil; 33 | return [NSIndexPath indexPathForRow:row inSection:section]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /DCTUIKit/UITableViewCell+DCTExtensions.h: -------------------------------------------------------------------------------- 1 | /* 2 | UITableViewCell+DCTExtensions.h 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 22.10.2009. 6 | 7 | 8 | 9 | Copyright (c) 2009 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import 38 | 39 | /** Extensions to UITableViewCell. */ 40 | @interface UITableViewCell (DCTExtensions) 41 | 42 | /** Searches for the parent tableview of the receiving cell. 43 | 44 | @return The table view if one is found, nil if not. 45 | 46 | @see [UIView(DCTSubviewExtensions) dct_superviewOfKindOfClass:] 47 | */ 48 | - (UITableView *)dct_tableView; 49 | @end 50 | -------------------------------------------------------------------------------- /DCTUIKit/UITableViewCell+DCTExtensions.m: -------------------------------------------------------------------------------- 1 | /* 2 | UITableViewCell+DCTExtensions.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 22.10.2009. 6 | 7 | 8 | 9 | Copyright (c) 2009 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import "UITableViewCell+DCTExtensions.h" 38 | #import "UIView+DCTSubviewExtensions.h" 39 | 40 | @implementation UITableViewCell (DCTExtensions) 41 | 42 | - (UITableView *)dct_tableView { 43 | return [self dct_superviewOfKindOfClass:[UITableView class]]; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /DCTUIKit/UIView+DCTAnimation.h: -------------------------------------------------------------------------------- 1 | /* 2 | UIView+DCTAnimation.h 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 14.5.2011. 6 | 7 | 8 | 9 | Copyright (c) 2011 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | 38 | #import 39 | 40 | 41 | @interface UIView (DCTAnimation) 42 | 43 | + (UIViewAnimationCurve)dct_animationCurveForAnimationOptionCurve:(UIViewAnimationOptions)options; 44 | + (UIViewAnimationOptions)dct_animationOptionCurveForAnimationCurve:(UIViewAnimationCurve)curve; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /DCTUIKit/UIView+DCTAnimation.m: -------------------------------------------------------------------------------- 1 | /* 2 | UIView+DCTAnimation.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 14.5.2011. 6 | 7 | 8 | 9 | Copyright (c) 2011 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import "UIView+DCTAnimation.h" 38 | 39 | 40 | @implementation UIView (DCTAnimation) 41 | 42 | + (UIViewAnimationCurve)dct_animationCurveForAnimationOptionCurve:(UIViewAnimationOptions)options { 43 | 44 | if ((options & UIViewAnimationOptionCurveEaseInOut) == UIViewAnimationOptionCurveEaseInOut) return UIViewAnimationCurveEaseInOut; 45 | if ((options & UIViewAnimationOptionCurveEaseIn) == UIViewAnimationOptionCurveEaseIn) return UIViewAnimationCurveEaseIn; 46 | if ((options & UIViewAnimationOptionCurveEaseOut) == UIViewAnimationOptionCurveEaseOut) return UIViewAnimationCurveEaseOut; 47 | if ((options & UIViewAnimationOptionCurveLinear) == UIViewAnimationOptionCurveLinear) return UIViewAnimationCurveLinear; 48 | 49 | return UIViewAnimationCurveEaseInOut; 50 | } 51 | 52 | + (UIViewAnimationOptions)dct_animationOptionCurveForAnimationCurve:(UIViewAnimationCurve)curve { 53 | 54 | if (curve == UIViewAnimationCurveEaseInOut) return UIViewAnimationOptionCurveEaseInOut; 55 | if (curve == UIViewAnimationCurveEaseIn) return UIViewAnimationOptionCurveEaseIn; 56 | if (curve == UIViewAnimationCurveEaseOut) return UIViewAnimationOptionCurveEaseOut; 57 | if (curve == UIViewAnimationCurveLinear) return UIViewAnimationOptionCurveLinear; 58 | 59 | return UIViewAnimationOptionCurveEaseInOut; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /DCTUIKit/UIView+DCTFirstResponder.h: -------------------------------------------------------------------------------- 1 | /* 2 | UIView+DCTFirstResponder.h 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 12.5.2011. 6 | 7 | 8 | 9 | Copyright (c) 2011 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import 38 | 39 | @interface UIView (DCTFirstResponder) 40 | - (UIResponder *)dct_findFirstResponder; 41 | @end 42 | -------------------------------------------------------------------------------- /DCTUIKit/UIView+DCTFirstResponder.m: -------------------------------------------------------------------------------- 1 | /* 2 | UIView+DCTFirstResponder.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 12.5.2011. 6 | 7 | 8 | 9 | Copyright (c) 2011 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import "UIView+DCTFirstResponder.h" 38 | 39 | @implementation UIView (DCTFirstResponder) 40 | 41 | - (UIResponder *)dct_findFirstResponder { 42 | 43 | if ([self isFirstResponder]) return self; 44 | 45 | for (UIView *v in self.subviews) { 46 | UIResponder *r = [v dct_findFirstResponder]; 47 | if ((r)) return r; 48 | } 49 | 50 | return nil; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /DCTUIKit/UIView+DCTLogging.h: -------------------------------------------------------------------------------- 1 | /* 2 | UIView+DCTLogging.h 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 13.10.2009. 6 | 7 | 8 | 9 | Copyright (c) 2009 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import 38 | 39 | /** Category to add nicer log output of a view hierarchy */ 40 | @interface UIView (DCTLogging) 41 | 42 | /** Calling this will traverse the view hierarchy starting at the receiver, 43 | building a string which it will then output to the console. The output shows 44 | the hierarchy as indentated. */ 45 | - (void)dct_logHierarchy; 46 | @end 47 | -------------------------------------------------------------------------------- /DCTUIKit/UIView+DCTLogging.m: -------------------------------------------------------------------------------- 1 | /* 2 | UIView+DCTLogging.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 13.10.2009. 6 | 7 | 8 | 9 | Copyright (c) 2009 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import "UIView+DCTLogging.h" 38 | 39 | @interface UIView (DCTLoggingInternal) 40 | - (void)dctLoggingInternal_logHierarchyValue:(NSInteger)integer; 41 | @end 42 | 43 | 44 | @implementation UIView (DCTLogging) 45 | 46 | - (void)dct_logHierarchy { 47 | NSLog(@"-----------------"); 48 | NSLog(@"Logging Hierarchy"); 49 | NSLog(@"-----------------"); 50 | 51 | [self dctLoggingInternal_logHierarchyValue:0]; 52 | 53 | NSLog(@"-----------------"); 54 | } 55 | 56 | #pragma mark - 57 | #pragma mark Internal 58 | 59 | - (void)dctLoggingInternal_logHierarchyValue:(NSInteger)integer { 60 | 61 | 62 | NSMutableString *string = [[NSMutableString alloc] init]; 63 | 64 | 65 | for (NSInteger x = 0; x < integer; x++) 66 | [string appendString:@" "]; 67 | 68 | NSLog(@"%@%@", string, self); 69 | 70 | 71 | for (UIView *v in self.subviews) 72 | [v dctLoggingInternal_logHierarchyValue:integer+1]; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /DCTUIKit/UIView+DCTSubviewExtensions.h: -------------------------------------------------------------------------------- 1 | /* 2 | UIView+DCTSubviewExtensions.h 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 13.10.2009. 6 | 7 | 8 | 9 | Copyright (c) 2009 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import 38 | 39 | @interface UIView (DCTSubviewExtensions) 40 | 41 | /** Removes all subviews from the receiver. */ 42 | - (void)dct_removeAllSubviews; 43 | 44 | 45 | 46 | /** Finds a subview of the receiver with the kind of the given class. 47 | 48 | This traverses down the view hierachy until a suitable class is found. 49 | 50 | @param aClass The class the returned view should be. 51 | @return A view of kind of the given class. 52 | */ 53 | - (id)dct_subviewOfKindOfClass:(Class)aClass; 54 | 55 | 56 | 57 | /** Finds a superview of the receiver with the kind of the given class. 58 | 59 | This traverses up the view hierachy until a suitable class is found. 60 | 61 | @param aClass The class the returned view should be. 62 | @return A view of kind of the given class. 63 | */ 64 | - (id)dct_superviewOfKindOfClass:(Class)aClass; 65 | 66 | /** Returns whether or not the receiver has subviews. 67 | 68 | @return YES if the receiver has any subviews, NO if it doesn't. 69 | */ 70 | - (BOOL)dct_hasSubviews; 71 | @end 72 | -------------------------------------------------------------------------------- /DCTUIKit/UIView+DCTSubviewExtensions.m: -------------------------------------------------------------------------------- 1 | /* 2 | UIView+DCTSubviewExtensions.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 13.10.2009. 6 | 7 | 8 | 9 | Copyright (c) 2009 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import "UIView+DCTSubviewExtensions.h" 38 | 39 | @implementation UIView (DCTSubviewExtensions) 40 | 41 | - (void)dct_removeAllSubviews { 42 | [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; 43 | } 44 | 45 | - (id)dct_subviewOfKindOfClass:(Class)aClass { 46 | 47 | if ([self isKindOfClass:aClass]) 48 | return self; 49 | 50 | for (UIView *v in self.subviews) 51 | if ([v dct_subviewOfKindOfClass:aClass]) 52 | return v; 53 | 54 | return nil; 55 | } 56 | 57 | - (id)dct_superviewOfKindOfClass:(Class)aClass { 58 | 59 | if ([self isKindOfClass:aClass]) 60 | return self; 61 | 62 | UIView *v = self; 63 | 64 | while ((v = v.superview)) 65 | if ([v isKindOfClass:aClass]) 66 | return v; 67 | 68 | return nil; 69 | } 70 | 71 | - (BOOL)dct_hasSubviews { 72 | return ([self.subviews count] > 0); 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /DCTUIKit/UIViewController+DCTExtras.h: -------------------------------------------------------------------------------- 1 | /* 2 | UIViewController+DCTExtras.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 2.1.2011. 6 | 7 | 8 | 9 | Copyright (c) 2011 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | 38 | #import 39 | 40 | @interface UIViewController (DCTExtras) 41 | 42 | @property (nonatomic, readonly) UIViewController *dct_topViewController; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /DCTUIKit/UIViewController+DCTExtras.m: -------------------------------------------------------------------------------- 1 | /* 2 | UIViewController+DCTExtras.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 2.1.2011. 6 | 7 | 8 | 9 | Copyright (c) 2011 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | 38 | #import "UIViewController+DCTExtras.h" 39 | #import "UIResponder+DCTNextResponderExtensions.h" 40 | 41 | @implementation UIViewController (DCTExtras) 42 | 43 | - (UIViewController *)dct_topViewController { 44 | return [self dct_furthestResponderOfClass:[UIViewController class]]; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /DCTUIKit/UIViewController+DCTViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | UIViewController+DCTViewController.h 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 17.08.2011. 6 | 7 | 8 | 9 | Copyright (c) 2011 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import 38 | 39 | @interface UIViewController (DCTViewController) 40 | 41 | - (void)dct_sharedInit; 42 | - (void)dct_viewDidLoad; 43 | - (void)dct_loadView; 44 | - (void)dct_viewWillDisappear:(BOOL)animated; 45 | - (void)dct_viewWillAppear:(BOOL)animated; 46 | - (void)dct_dismissModalViewController:(id)sender; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /DCTUIKit/UIViewController+DCTViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | UIViewController+DCTViewController.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 17.08.2011. 6 | 7 | 8 | 9 | Copyright (c) 2011 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import "UIViewController+DCTViewController.h" 38 | #import "UINib+DCTExtensions.h" 39 | #import "UIResponder+DCTNextResponderExtensions.h" 40 | #import "UIView+DCTAnimation.h" 41 | #import "DCTViewController.h" 42 | 43 | @interface UIViewController (DCTViewControllerInternal) 44 | - (void)dctViewControllerInternal_addKeyboardObservers; 45 | - (void)dctViewControllerInternal_removeKeyboardObservers; 46 | 47 | - (void)dctViewControllerInternal_keyboardWillShowNotification:(NSNotification *)notification; 48 | - (void)dctViewControllerInternal_keyboardDidShowNotification:(NSNotification *)notification; 49 | - (void)dctViewControllerInternal_keyboardWillHideNotification:(NSNotification *)notification; 50 | - (void)dctViewControllerInternal_keyboardDidHideNotification:(NSNotification *)notification; 51 | 52 | - (void)dctViewControllerInternal_safeLoadNibNamed:(NSString *)nibName inBundle:(NSBundle *)bundle; 53 | 54 | @property (nonatomic, readonly) UIViewController *dctViewControllerInternal_dctViewController; 55 | 56 | @end 57 | 58 | @implementation UIViewController (DCTViewController) 59 | 60 | - (void)dct_viewWillAppear:(BOOL)animated { 61 | [self dctViewControllerInternal_addKeyboardObservers]; 62 | } 63 | 64 | - (void)dct_viewWillDisappear:(BOOL)animated { 65 | [self dctViewControllerInternal_removeKeyboardObservers]; 66 | } 67 | 68 | - (void)dct_viewDidLoad { 69 | [self title]; 70 | } 71 | 72 | - (void)dct_loadView { 73 | 74 | // If the subclass has loaded a view and called super, return so that 75 | // multiple views aren't loaded. 76 | 77 | if ([self isViewLoaded]) return; 78 | 79 | // Making the nib loading nature explicit. Will try to load a nib that has 80 | // the same name as the view controller class or one of its superclasses. 81 | 82 | NSBundle *bundle = self.nibBundle; 83 | if (!bundle) bundle = [NSBundle mainBundle]; 84 | 85 | [self dctViewControllerInternal_safeLoadNibNamed:self.nibName inBundle:bundle]; 86 | 87 | if ([self isViewLoaded]) return; 88 | 89 | Class theClass = [self class]; 90 | 91 | while (![self isViewLoaded] && [theClass isSubclassOfClass:[UIViewController class]]) { 92 | [self dctViewControllerInternal_safeLoadNibNamed:NSStringFromClass(theClass) inBundle:bundle]; 93 | theClass = [theClass superclass]; 94 | } 95 | } 96 | 97 | #pragma mark - DCTViewController 98 | 99 | - (void)dct_dismissModalViewController:(id)sender { 100 | [self.parentViewController dismissModalViewControllerAnimated:YES]; 101 | } 102 | 103 | - (void)dct_sharedInit { 104 | [self title]; 105 | [self.dctViewControllerInternal_dctViewController sharedInit]; 106 | } 107 | 108 | @end 109 | 110 | @implementation UIViewController (DCTViewControllerInternal) 111 | 112 | - (void)dctViewControllerInternal_keyboardWillShowNotification:(NSNotification *)notification { 113 | [self.dctViewControllerInternal_dctViewController keyboardWillShowNotification:notification]; 114 | } 115 | 116 | - (void)dctViewControllerInternal_keyboardDidShowNotification:(NSNotification *)notification { 117 | [self.dctViewControllerInternal_dctViewController keyboardDidShowNotification:notification]; 118 | } 119 | 120 | - (void)dctViewControllerInternal_keyboardWillHideNotification:(NSNotification *)notification { 121 | [self.dctViewControllerInternal_dctViewController keyboardWillHideNotification:notification]; 122 | } 123 | 124 | - (void)dctViewControllerInternal_keyboardDidHideNotification:(NSNotification *)notification { 125 | [self.dctViewControllerInternal_dctViewController keyboardDidHideNotification:notification]; 126 | } 127 | 128 | 129 | 130 | - (void)dctViewControllerInternal_addKeyboardObservers { 131 | [[NSNotificationCenter defaultCenter] addObserver:self 132 | selector:@selector(dctViewControllerInternal_keyboardWillShowNotification:) 133 | name:UIKeyboardWillShowNotification 134 | object:nil]; 135 | 136 | [[NSNotificationCenter defaultCenter] addObserver:self 137 | selector:@selector(dctViewControllerInternal_keyboardDidShowNotification:) 138 | name:UIKeyboardDidShowNotification 139 | object:nil]; 140 | 141 | [[NSNotificationCenter defaultCenter] addObserver:self 142 | selector:@selector(dctViewControllerInternal_keyboardWillHideNotification:) 143 | name:UIKeyboardWillHideNotification 144 | object:nil]; 145 | 146 | [[NSNotificationCenter defaultCenter] addObserver:self 147 | selector:@selector(dctViewControllerInternal_keyboardDidHideNotification:) 148 | name:UIKeyboardDidHideNotification 149 | object:nil]; 150 | } 151 | 152 | - (void)dctViewControllerInternal_removeKeyboardObservers { 153 | [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; 154 | [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardDidShowNotification object:nil]; 155 | [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil]; 156 | [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardDidHideNotification object:nil]; 157 | } 158 | 159 | - (void)dctViewControllerInternal_safeLoadNibNamed:(NSString *)nibName inBundle:(NSBundle *)bundle { 160 | 161 | if ([UINib dct_nibExistsWithNibName:nibName bundle:bundle]) 162 | [bundle loadNibNamed:nibName owner:self options:nil]; 163 | } 164 | 165 | - (UIViewController *)dctViewControllerInternal_dctViewController { 166 | 167 | if ([self conformsToProtocol:@protocol(DCTViewController)]) 168 | return (UIViewController *)self; 169 | 170 | return nil; 171 | 172 | } 173 | 174 | 175 | @end 176 | -------------------------------------------------------------------------------- /DCTUIKit/UIWindow+DCTFirstResponder.h: -------------------------------------------------------------------------------- 1 | /* 2 | UIWindow+DCTFirstResponder.h 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 12.5.2011. 6 | 7 | 8 | 9 | Copyright (c) 2011 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import 38 | 39 | @interface UIWindow (DCTFirstResponder) 40 | @property (nonatomic, readonly) UIResponder *dct_firstResponder; 41 | @end 42 | -------------------------------------------------------------------------------- /DCTUIKit/UIWindow+DCTFirstResponder.m: -------------------------------------------------------------------------------- 1 | /* 2 | UIWindow+DCTFirstResponder.m 3 | DCTUIKit 4 | 5 | Created by Daniel Tull on 12.5.2011. 6 | 7 | 8 | 9 | Copyright (c) 2011 Daniel Tull. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | * Neither the name of the author nor the names of its contributors may be used 22 | to endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #import "UIWindow+DCTFirstResponder.h" 38 | #import "UIView+DCTFirstResponder.h" 39 | 40 | @implementation UIWindow (DCTFirstResponder) 41 | 42 | - (UIResponder *)dct_firstResponder { 43 | return [self dct_findFirstResponder]; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /DCTUIKitTests/DCTUIKitTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | uk.co.danieltull.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /DCTUIKitTests/DCTUIKitTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // DCTUIKitTests.h 3 | // DCTUIKitTests 4 | // 5 | // Created by Daniel Tull on 14.06.2012. 6 | // Copyright (c) 2012 Daniel Tull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DCTUIKitTests : SenTestCase 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DCTUIKitTests/DCTUIKitTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DCTUIKitTests.m 3 | // DCTUIKitTests 4 | // 5 | // Created by Daniel Tull on 14.06.2012. 6 | // Copyright (c) 2012 Daniel Tull. All rights reserved. 7 | // 8 | 9 | #import "DCTUIKitTests.h" 10 | 11 | @implementation DCTUIKitTests 12 | 13 | - (void)setUp 14 | { 15 | [super setUp]; 16 | 17 | // Set-up code here. 18 | } 19 | 20 | - (void)tearDown 21 | { 22 | // Tear-down code here. 23 | 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample 28 | { 29 | STFail(@"Unit tests are not implemented yet in DCTUIKitTests"); 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /DCTUIKitTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | --------------------------------------------------------------------------------