├── .gitignore ├── .travis.yml ├── Classes ├── OCUDL.h ├── OCUDLBuiltins.h ├── OCUDLBuiltins.m ├── OCUDLManager.h └── OCUDLManager.m ├── LICENSE ├── OCUDL.podspec ├── OCUDLExample ├── OCUDLExample.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── OCUDLExample.xcscheme ├── OCUDLExample.xcworkspace │ └── contents.xcworkspacedata ├── OCUDLExample │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── Main.storyboard │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── OCUDLExample-Info.plist │ ├── OCUDLExample-Prefix.pch │ ├── ViewController.h │ ├── ViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m ├── OCUDLExampleTests │ ├── OCUDLExampleTests-Info.plist │ ├── OCUDLExampleTests.m │ └── en.lproj │ │ └── InfoPlist.strings ├── Podfile └── Podfile.lock └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | *.hmap 18 | *.xccheckout 19 | 20 | #CocoaPods 21 | Pods 22 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | 3 | before_install: 4 | - gem install cocoapods 5 | - cd OCUDLExample 6 | 7 | script: xctool -workspace OCUDLExample.xcworkspace -scheme 'OCUDLExample' -configuration Debug -sdk iphonesimulator -arch i386 ONLY_ACTIVE_ARCH=NO test 8 | -------------------------------------------------------------------------------- /Classes/OCUDL.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCUDL.h 3 | // OCUDL 4 | // 5 | // Created by Dustin Bachrach on 10/10/13. 6 | // Copyright (c) 2013 Dustin Bachrach. All rights reserved. 7 | // 8 | 9 | #import "OCUDLManager.h" 10 | 11 | #define $(literal) [[OCUDLManager defaultManager] objectForLiteralString:@"" #literal] 12 | -------------------------------------------------------------------------------- /Classes/OCUDLBuiltins.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCUDLBuiltins.h 3 | // OCUDL 4 | // 5 | // Created by Dustin Bachrach on 10/15/13. 6 | // Copyright (c) 2013 Dustin Bachrach. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * Built-in user defined literals 13 | */ 14 | @interface OCUDLBuiltins : NSObject 15 | 16 | /** 17 | * Enable all built-in user defined literals. 18 | * Must call this method before any user defined literal is created. 19 | */ 20 | + (void)use; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/OCUDLBuiltins.m: -------------------------------------------------------------------------------- 1 | // 2 | // OCUDLBuiltins.m 3 | // OCUDL 4 | // 5 | // Created by Dustin Bachrach on 10/15/13. 6 | // Copyright (c) 2013 Dustin Bachrach. All rights reserved. 7 | // 8 | 9 | #import "OCUDLBuiltins.h" 10 | #import "OCUDL.h" 11 | 12 | @interface OCUDLBuiltins () 13 | 14 | + (void)registerNSNull; 15 | + (void)registerNSURL; 16 | + (void)registerNSUUID; 17 | + (void)registerUIColor; 18 | + (void)registerUIImage; 19 | + (void)registerUINib; 20 | + (void)registerUIStoryboard; 21 | 22 | @end 23 | 24 | @implementation OCUDLBuiltins 25 | 26 | + (void)registerNSNull 27 | { 28 | [[OCUDLManager defaultManager] registerPrefix:@"null" 29 | forBlock:^id(NSString *literal, NSString *prefix) { 30 | return [NSNull null]; 31 | }]; 32 | } 33 | 34 | + (void)registerNSURL 35 | { 36 | OCUDLBlock urlBlock = ^id(NSString *literal, NSString *prefix) { 37 | return [NSURL URLWithString:[NSString stringWithFormat:@"%@//%@", prefix, literal]]; 38 | }; 39 | [[OCUDLManager defaultManager] registerPrefix:@"http:" forBlock:urlBlock]; 40 | [[OCUDLManager defaultManager] registerPrefix:@"https:" forBlock:urlBlock]; 41 | } 42 | 43 | + (void)registerNSUUID 44 | { 45 | [[OCUDLManager defaultManager] registerSuffix:@"uuid" 46 | forBlock:^id(NSString *literal, NSString *prefix) { 47 | return [[NSUUID alloc] initWithUUIDString:literal]; 48 | }]; 49 | } 50 | 51 | + (void)registerUIColor 52 | { 53 | [[OCUDLManager defaultManager] registerPrefix:@"#" 54 | forBlock:^id(NSString *literal, NSString *prefix) { 55 | unsigned int value = 0; 56 | if ([[NSScanner scannerWithString:literal] scanHexInt:&value]) 57 | { 58 | if (literal.length == 6) 59 | { 60 | return [UIColor colorWithRed:((float)((value & 0xFF0000) >> 16)) / 255.0 61 | green:((float)((value & 0x00FF00) >> 8)) / 255.0 62 | blue:((float)(value & 0x0000FF)) / 255.0 63 | alpha:1.0]; 64 | } 65 | else if (literal.length == 3) 66 | { 67 | return [UIColor colorWithRed:((float)((value & 0xF00) >> 8)) / 15.0 68 | green:((float)((value & 0x0F0) >> 4)) / 15.0 69 | blue:((float)(value & 0x00F)) / 15.0 70 | alpha:1.0]; 71 | } 72 | } 73 | if ([literal caseInsensitiveCompare:@"black"] == NSOrderedSame) 74 | { 75 | return [UIColor blackColor]; 76 | } 77 | else if ([literal caseInsensitiveCompare:@"darkGray"] == NSOrderedSame) 78 | { 79 | return [UIColor darkGrayColor]; 80 | } 81 | else if ([literal caseInsensitiveCompare:@"lightGray"] == NSOrderedSame) 82 | { 83 | return [UIColor lightGrayColor]; 84 | } 85 | else if ([literal caseInsensitiveCompare:@"white"] == NSOrderedSame) 86 | { 87 | return [UIColor whiteColor]; 88 | } 89 | else if ([literal caseInsensitiveCompare:@"gray"] == NSOrderedSame) 90 | { 91 | return [UIColor grayColor]; 92 | } 93 | else if ([literal caseInsensitiveCompare:@"red"] == NSOrderedSame) 94 | { 95 | return [UIColor redColor]; 96 | } 97 | else if ([literal caseInsensitiveCompare:@"green"] == NSOrderedSame) 98 | { 99 | return [UIColor greenColor]; 100 | } 101 | 102 | else if ([literal caseInsensitiveCompare:@"blue"] == NSOrderedSame) 103 | { 104 | return [UIColor blueColor]; 105 | } 106 | else if ([literal caseInsensitiveCompare:@"cyan"] == NSOrderedSame) 107 | { 108 | return [UIColor cyanColor]; 109 | } 110 | else if ([literal caseInsensitiveCompare:@"yellow"] == NSOrderedSame) 111 | { 112 | return [UIColor yellowColor]; 113 | } 114 | else if ([literal caseInsensitiveCompare:@"magenta"] == NSOrderedSame) 115 | { 116 | return [UIColor magentaColor]; 117 | } 118 | else if ([literal caseInsensitiveCompare:@"orange"] == NSOrderedSame) 119 | { 120 | return [UIColor orangeColor]; 121 | } 122 | else if ([literal caseInsensitiveCompare:@"purple"] == NSOrderedSame) 123 | { 124 | return [UIColor purpleColor]; 125 | } 126 | else if ([literal caseInsensitiveCompare:@"brown"] == NSOrderedSame) 127 | { 128 | return [UIColor brownColor]; 129 | } 130 | else if ([literal caseInsensitiveCompare:@"clear"] == NSOrderedSame) 131 | { 132 | return [UIColor clearColor]; 133 | } 134 | return nil; 135 | }]; 136 | 137 | } 138 | 139 | + (void)registerUIImage 140 | { 141 | [[OCUDLManager defaultManager] registerSuffix:@".img" 142 | forBlock:^id(NSString *literal, NSString *prefix) { 143 | return [UIImage imageNamed:literal]; 144 | }]; 145 | } 146 | 147 | + (void)registerUINib 148 | { 149 | [[OCUDLManager defaultManager] registerSuffix:@".xib" 150 | forBlock:^id(NSString *literal, NSString *prefix) { 151 | return [UINib nibWithNibName:literal bundle:nil]; 152 | }]; 153 | } 154 | 155 | 156 | + (void)registerUIStoryboard 157 | { 158 | [[OCUDLManager defaultManager] registerSuffix:@".storyboard" 159 | forBlock:^id(NSString *literal, NSString *prefix) { 160 | return [UIStoryboard storyboardWithName:literal bundle:nil]; 161 | }]; 162 | } 163 | 164 | static dispatch_once_t s_pred; 165 | 166 | + (void)use 167 | { 168 | dispatch_once(&s_pred, ^{ 169 | [OCUDLBuiltins registerNSNull]; 170 | [OCUDLBuiltins registerNSURL]; 171 | [OCUDLBuiltins registerNSUUID]; 172 | [OCUDLBuiltins registerUIColor]; 173 | [OCUDLBuiltins registerUIImage]; 174 | [OCUDLBuiltins registerUINib]; 175 | [OCUDLBuiltins registerUIStoryboard]; 176 | }); 177 | } 178 | 179 | @end 180 | -------------------------------------------------------------------------------- /Classes/OCUDLManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCUDLManager.h 3 | // OCUDL 4 | // 5 | // Created by Dustin Bachrach on 10/10/13. 6 | // Copyright (c) 2013 Dustin Bachrach. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * Invoked when a user defined literal should be created. 13 | * The first parameter is the literal. 14 | * The second parameter is the prefix/suffix. 15 | */ 16 | typedef id (^OCUDLBlock)(NSString*, NSString*); 17 | 18 | 19 | /** 20 | * A protocol for any class, which can be constructed via a user defined literal. 21 | */ 22 | @protocol OCUDLClass 23 | 24 | @optional 25 | 26 | /** 27 | * Creates an instance of the class from a literal. 28 | * @param literal The literal. For example, for #FFF, FFF is the literal. 29 | * @param prefix The prefix. For example, for #FFF, # is the prefix. 30 | */ 31 | - (id)initWithLiteral:(NSString*)literal prefix:(NSString*)prefix; 32 | 33 | /** 34 | * Creates an instance of the class from a literal. 35 | * @param literal The literal. For example, for 25ul, 25 is the literal. 36 | * @param suffix The suffix. For example, for 25ul, ul is the suffix. 37 | */ 38 | - (id)initWithLiteral:(NSString*)literal suffix:(NSString*)suffix; 39 | 40 | @end 41 | 42 | 43 | /** 44 | * Manages all user defined literals. 45 | * User defined literals must be registered to the defaultManager. 46 | */ 47 | @interface OCUDLManager : NSObject 48 | 49 | /** 50 | * Gets the default manager. 51 | * All registrations should occur on this manager. 52 | */ 53 | + (instancetype)defaultManager; 54 | 55 | /** 56 | * Registers a user defined literal for a prefix. 57 | * When a literal is found that matches the prefix, the class is constructed 58 | * and receives the -initWithLiteral:prefix: message. 59 | * @param prefix The prefix. 60 | * @param class The class to construct when a literal is found. 61 | */ 62 | - (void)registerPrefix:(NSString*)prefix forClass:(Class)class; 63 | 64 | /** 65 | * Registers a user defined literal for a prefix. 66 | * When a literal is found that matches the prefix, the block is executed. 67 | * @param prefix The prefix. 68 | * @param block The block to execute when a literal is found. 69 | */ 70 | - (void)registerPrefix:(NSString*)prefix forBlock:(OCUDLBlock)block; 71 | 72 | /** 73 | * Registers a user defined literal for a suffix. 74 | * When a literal is found that matches the suffix, the class is constructed 75 | * and receives the -initWithLiteral:suffix: message. 76 | * @param suffix The suffix. 77 | * @param class The class to construct when a literal is found. 78 | */ 79 | - (void)registerSuffix:(NSString*)suffix forClass:(Class)class; 80 | 81 | /** 82 | * Registers a user defined literal for a suffix. 83 | * When a literal is found that matches the suffix, the block is executed. 84 | * @param suffix The suffix. 85 | * @param block The block to execute when a literal is found. 86 | */ 87 | - (void)registerSuffix:(NSString*)suffix forBlock:(OCUDLBlock)block; 88 | 89 | /** 90 | * Creates an object from a literal string. 91 | * If a literal is not found, returns nil. 92 | * @param str The string literal. 93 | * @return The created object based on the literal. 94 | */ 95 | - (id)objectForLiteralString:(NSString *)str; 96 | 97 | @end 98 | 99 | -------------------------------------------------------------------------------- /Classes/OCUDLManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // OCUDLManager.m 3 | // OCUDL 4 | // 5 | // Created by Dustin Bachrach on 10/10/13. 6 | // Copyright (c) 2013 Dustin Bachrach. All rights reserved. 7 | // 8 | 9 | #import "OCUDLManager.h" 10 | 11 | @interface OCUDLManager () 12 | 13 | /// All prefixes 14 | @property (strong, nonatomic) NSMutableDictionary *prefixMapping; 15 | 16 | /// All suffixes 17 | @property (strong, nonatomic) NSMutableDictionary *suffixMapping; 18 | 19 | @end 20 | 21 | 22 | @implementation OCUDLManager 23 | 24 | static dispatch_once_t s_pred; 25 | static OCUDLManager *s_manager = nil; 26 | 27 | + (instancetype)defaultManager 28 | { 29 | dispatch_once(&s_pred, ^{ 30 | s_manager = [[OCUDLManager alloc] init]; 31 | }); 32 | 33 | return s_manager; 34 | } 35 | 36 | - (id)init 37 | { 38 | if (self = [super init]) 39 | { 40 | self.prefixMapping = [[NSMutableDictionary alloc] init]; 41 | self.suffixMapping = [[NSMutableDictionary alloc] init]; 42 | } 43 | return self; 44 | } 45 | 46 | #pragma mark - Registration 47 | 48 | - (void)registerPrefix:(NSString*)prefix forClass:(Class)class 49 | { 50 | [self registerPrefix:prefix forBlock:^id(NSString *str, NSString *prefStr) { 51 | return (id)[[(Class)class alloc] initWithLiteral:str prefix:prefStr]; 52 | }]; 53 | } 54 | 55 | - (void)registerPrefix:(NSString*)prefix forBlock:(OCUDLBlock)block 56 | { 57 | self.prefixMapping[prefix] = block; 58 | } 59 | 60 | - (void)registerSuffix:(NSString*)suffix forClass:(Class)class 61 | { 62 | [self registerSuffix:suffix forBlock:^id(NSString *str, NSString *suffStr) { 63 | return (id)[[(Class)class alloc] initWithLiteral:str suffix:suffStr]; 64 | }]; 65 | } 66 | 67 | - (void)registerSuffix:(NSString*)suffix forBlock:(OCUDLBlock)block 68 | { 69 | self.suffixMapping[suffix] = block; 70 | } 71 | 72 | #pragma mark - Object Emitter 73 | 74 | - (id)objectForLiteralString:(NSString *)str { 75 | NSMutableDictionary *prefixMapping = self.prefixMapping; 76 | NSArray *sortedPrefixMappingKeys = [[prefixMapping allKeys] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) { 77 | return[@([obj1 length]) compare:@([obj2 length])]; 78 | }]; 79 | 80 | for (NSString *prefix in sortedPrefixMappingKeys) { 81 | if ([str hasPrefix:prefix]) { 82 | 83 | str = [str substringFromIndex:[prefix length]]; 84 | 85 | OCUDLBlock block = prefixMapping[prefix]; 86 | return block(str, prefix); 87 | } 88 | } 89 | 90 | NSMutableDictionary *suffixMapping = self.suffixMapping; 91 | NSArray *sortedSuffixMappingKeys = [[suffixMapping allKeys] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) { 92 | return[@([obj2 length]) compare:@([obj1 length])]; 93 | }]; 94 | 95 | for (NSString *suffix in sortedSuffixMappingKeys) { 96 | if ([str hasSuffix:suffix]) { 97 | 98 | str = [str substringToIndex:[str length] - [suffix length]]; 99 | 100 | OCUDLBlock block = suffixMapping[suffix]; 101 | return block(str, suffix); 102 | } 103 | } 104 | 105 | return nil; 106 | } 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) [2013] [Dustin Bachrach] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /OCUDL.podspec: -------------------------------------------------------------------------------- 1 | 2 | Pod::Spec.new do |s| 3 | 4 | s.name = "OCUDL" 5 | s.version = "0.2.1" 6 | s.summary = "User defined literals for Objective-C." 7 | s.homepage = "https://github.com/dbachrach/OCUDL" 8 | s.license = { :type => 'MIT', :file => 'LICENSE' } 9 | s.author = { "Dustin Bachrach" => "ahdustin@gmail.com" } 10 | s.source = { :git => "https://github.com/dbachrach/OCUDL.git", :tag => s.version.to_s } 11 | s.source_files = 'Classes', 'Classes/**/*.{h,m}' 12 | s.requires_arc = true 13 | s.platform = :ios 14 | 15 | end 16 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | archiveVersion 6 | 1 7 | classes 8 | 9 | objectVersion 10 | 46 11 | objects 12 | 13 | 01049FFA44444CBBB2C92880 14 | 15 | includeInIndex 16 | 1 17 | isa 18 | PBXFileReference 19 | lastKnownFileType 20 | text.xcconfig 21 | name 22 | Pods.xcconfig 23 | path 24 | Pods/Pods.xcconfig 25 | sourceTree 26 | <group> 27 | 28 | 0AA109B2F4E34D41A94E6585 29 | 30 | explicitFileType 31 | archive.ar 32 | includeInIndex 33 | 0 34 | isa 35 | PBXFileReference 36 | path 37 | libPods.a 38 | sourceTree 39 | BUILT_PRODUCTS_DIR 40 | 41 | 72D4D956EF7D4836BF6AC4D9 42 | 43 | buildActionMask 44 | 2147483647 45 | files 46 | 47 | inputPaths 48 | 49 | isa 50 | PBXShellScriptBuildPhase 51 | name 52 | Copy Pods Resources 53 | outputPaths 54 | 55 | runOnlyForDeploymentPostprocessing 56 | 0 57 | shellPath 58 | /bin/sh 59 | shellScript 60 | "${SRCROOT}/Pods/Pods-resources.sh" 61 | 62 | showEnvVarsInLog 63 | 0 64 | 65 | 9E4647AC91284ECCA24B6E7D 66 | 67 | buildActionMask 68 | 2147483647 69 | files 70 | 71 | inputPaths 72 | 73 | isa 74 | PBXShellScriptBuildPhase 75 | name 76 | Check Pods Manifest.lock 77 | outputPaths 78 | 79 | runOnlyForDeploymentPostprocessing 80 | 0 81 | shellPath 82 | /bin/sh 83 | shellScript 84 | diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null 85 | if [[ $? != 0 ]] ; then 86 | cat << EOM 87 | error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. 88 | EOM 89 | exit 1 90 | fi 91 | 92 | showEnvVarsInLog 93 | 0 94 | 95 | A60F698017354BB6A8D29AE5 96 | 97 | fileRef 98 | 0AA109B2F4E34D41A94E6585 99 | isa 100 | PBXBuildFile 101 | 102 | ABF66B9DCD4A4377A9E5BC70 103 | 104 | buildActionMask 105 | 2147483647 106 | files 107 | 108 | inputPaths 109 | 110 | isa 111 | PBXShellScriptBuildPhase 112 | name 113 | Check Pods Manifest.lock 114 | outputPaths 115 | 116 | runOnlyForDeploymentPostprocessing 117 | 0 118 | shellPath 119 | /bin/sh 120 | shellScript 121 | diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null 122 | if [[ $? != 0 ]] ; then 123 | cat << EOM 124 | error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. 125 | EOM 126 | exit 1 127 | fi 128 | 129 | showEnvVarsInLog 130 | 0 131 | 132 | DA9E8587180CF8F70034193E 133 | 134 | children 135 | 136 | DA9E8599180CF8F70034193E 137 | DA9E85B8180CF8F70034193E 138 | DA9E8592180CF8F70034193E 139 | DA9E8591180CF8F70034193E 140 | 01049FFA44444CBBB2C92880 141 | 142 | isa 143 | PBXGroup 144 | sourceTree 145 | <group> 146 | 147 | DA9E8588180CF8F70034193E 148 | 149 | attributes 150 | 151 | LastUpgradeCheck 152 | 0500 153 | ORGANIZATIONNAME 154 | Dustin Bachrach 155 | TargetAttributes 156 | 157 | DA9E85B0180CF8F70034193E 158 | 159 | TestTargetID 160 | DA9E858F180CF8F70034193E 161 | 162 | 163 | 164 | buildConfigurationList 165 | DA9E858B180CF8F70034193E 166 | compatibilityVersion 167 | Xcode 3.2 168 | developmentRegion 169 | English 170 | hasScannedForEncodings 171 | 0 172 | isa 173 | PBXProject 174 | knownRegions 175 | 176 | en 177 | Base 178 | 179 | mainGroup 180 | DA9E8587180CF8F70034193E 181 | productRefGroup 182 | DA9E8591180CF8F70034193E 183 | projectDirPath 184 | 185 | projectReferences 186 | 187 | projectRoot 188 | 189 | targets 190 | 191 | DA9E858F180CF8F70034193E 192 | DA9E85B0180CF8F70034193E 193 | 194 | 195 | DA9E858B180CF8F70034193E 196 | 197 | buildConfigurations 198 | 199 | DA9E85C0180CF8F70034193E 200 | DA9E85C1180CF8F70034193E 201 | 202 | defaultConfigurationIsVisible 203 | 0 204 | defaultConfigurationName 205 | Release 206 | isa 207 | XCConfigurationList 208 | 209 | DA9E858C180CF8F70034193E 210 | 211 | buildActionMask 212 | 2147483647 213 | files 214 | 215 | DA9E85AA180CF8F70034193E 216 | DA9E85A4180CF8F70034193E 217 | DA9E85A0180CF8F70034193E 218 | 219 | isa 220 | PBXSourcesBuildPhase 221 | runOnlyForDeploymentPostprocessing 222 | 0 223 | 224 | DA9E858D180CF8F70034193E 225 | 226 | buildActionMask 227 | 2147483647 228 | files 229 | 230 | DA9E8596180CF8F70034193E 231 | DA9E8598180CF8F70034193E 232 | DA9E8594180CF8F70034193E 233 | A60F698017354BB6A8D29AE5 234 | 235 | isa 236 | PBXFrameworksBuildPhase 237 | runOnlyForDeploymentPostprocessing 238 | 0 239 | 240 | DA9E858E180CF8F70034193E 241 | 242 | buildActionMask 243 | 2147483647 244 | files 245 | 246 | DA9E85AC180CF8F70034193E 247 | DA9E859E180CF8F70034193E 248 | DA9E85A7180CF8F70034193E 249 | 250 | isa 251 | PBXResourcesBuildPhase 252 | runOnlyForDeploymentPostprocessing 253 | 0 254 | 255 | DA9E858F180CF8F70034193E 256 | 257 | buildConfigurationList 258 | DA9E85C2180CF8F70034193E 259 | buildPhases 260 | 261 | ABF66B9DCD4A4377A9E5BC70 262 | DA9E858C180CF8F70034193E 263 | DA9E858D180CF8F70034193E 264 | DA9E858E180CF8F70034193E 265 | E62C789FF1DB4BD28868B11A 266 | 267 | buildRules 268 | 269 | dependencies 270 | 271 | isa 272 | PBXNativeTarget 273 | name 274 | OCUDLExample 275 | productName 276 | OCUDLExample 277 | productReference 278 | DA9E8590180CF8F70034193E 279 | productType 280 | com.apple.product-type.application 281 | 282 | DA9E8590180CF8F70034193E 283 | 284 | explicitFileType 285 | wrapper.application 286 | includeInIndex 287 | 0 288 | isa 289 | PBXFileReference 290 | path 291 | OCUDLExample.app 292 | sourceTree 293 | BUILT_PRODUCTS_DIR 294 | 295 | DA9E8591180CF8F70034193E 296 | 297 | children 298 | 299 | DA9E8590180CF8F70034193E 300 | DA9E85B1180CF8F70034193E 301 | 302 | isa 303 | PBXGroup 304 | name 305 | Products 306 | sourceTree 307 | <group> 308 | 309 | DA9E8592180CF8F70034193E 310 | 311 | children 312 | 313 | DA9E8593180CF8F70034193E 314 | DA9E8595180CF8F70034193E 315 | DA9E8597180CF8F70034193E 316 | DA9E85B2180CF8F70034193E 317 | 0AA109B2F4E34D41A94E6585 318 | 319 | isa 320 | PBXGroup 321 | name 322 | Frameworks 323 | sourceTree 324 | <group> 325 | 326 | DA9E8593180CF8F70034193E 327 | 328 | isa 329 | PBXFileReference 330 | lastKnownFileType 331 | wrapper.framework 332 | name 333 | Foundation.framework 334 | path 335 | System/Library/Frameworks/Foundation.framework 336 | sourceTree 337 | SDKROOT 338 | 339 | DA9E8594180CF8F70034193E 340 | 341 | fileRef 342 | DA9E8593180CF8F70034193E 343 | isa 344 | PBXBuildFile 345 | 346 | DA9E8595180CF8F70034193E 347 | 348 | isa 349 | PBXFileReference 350 | lastKnownFileType 351 | wrapper.framework 352 | name 353 | CoreGraphics.framework 354 | path 355 | System/Library/Frameworks/CoreGraphics.framework 356 | sourceTree 357 | SDKROOT 358 | 359 | DA9E8596180CF8F70034193E 360 | 361 | fileRef 362 | DA9E8595180CF8F70034193E 363 | isa 364 | PBXBuildFile 365 | 366 | DA9E8597180CF8F70034193E 367 | 368 | isa 369 | PBXFileReference 370 | lastKnownFileType 371 | wrapper.framework 372 | name 373 | UIKit.framework 374 | path 375 | System/Library/Frameworks/UIKit.framework 376 | sourceTree 377 | SDKROOT 378 | 379 | DA9E8598180CF8F70034193E 380 | 381 | fileRef 382 | DA9E8597180CF8F70034193E 383 | isa 384 | PBXBuildFile 385 | 386 | DA9E8599180CF8F70034193E 387 | 388 | children 389 | 390 | DA9E85A2180CF8F70034193E 391 | DA9E85A3180CF8F70034193E 392 | DA9E85A5180CF8F70034193E 393 | DA9E85A8180CF8F70034193E 394 | DA9E85A9180CF8F70034193E 395 | DA9E85AB180CF8F70034193E 396 | DA9E859A180CF8F70034193E 397 | 398 | isa 399 | PBXGroup 400 | path 401 | OCUDLExample 402 | sourceTree 403 | <group> 404 | 405 | DA9E859A180CF8F70034193E 406 | 407 | children 408 | 409 | DA9E859B180CF8F70034193E 410 | DA9E859C180CF8F70034193E 411 | DA9E859F180CF8F70034193E 412 | DA9E85A1180CF8F70034193E 413 | 414 | isa 415 | PBXGroup 416 | name 417 | Supporting Files 418 | sourceTree 419 | <group> 420 | 421 | DA9E859B180CF8F70034193E 422 | 423 | isa 424 | PBXFileReference 425 | lastKnownFileType 426 | text.plist.xml 427 | path 428 | OCUDLExample-Info.plist 429 | sourceTree 430 | <group> 431 | 432 | DA9E859C180CF8F70034193E 433 | 434 | children 435 | 436 | DA9E859D180CF8F70034193E 437 | 438 | isa 439 | PBXVariantGroup 440 | name 441 | InfoPlist.strings 442 | sourceTree 443 | <group> 444 | 445 | DA9E859D180CF8F70034193E 446 | 447 | isa 448 | PBXFileReference 449 | lastKnownFileType 450 | text.plist.strings 451 | name 452 | en 453 | path 454 | en.lproj/InfoPlist.strings 455 | sourceTree 456 | <group> 457 | 458 | DA9E859E180CF8F70034193E 459 | 460 | fileRef 461 | DA9E859C180CF8F70034193E 462 | isa 463 | PBXBuildFile 464 | 465 | DA9E859F180CF8F70034193E 466 | 467 | isa 468 | PBXFileReference 469 | lastKnownFileType 470 | sourcecode.c.objc 471 | path 472 | main.m 473 | sourceTree 474 | <group> 475 | 476 | DA9E85A0180CF8F70034193E 477 | 478 | fileRef 479 | DA9E859F180CF8F70034193E 480 | isa 481 | PBXBuildFile 482 | 483 | DA9E85A1180CF8F70034193E 484 | 485 | isa 486 | PBXFileReference 487 | lastKnownFileType 488 | sourcecode.c.h 489 | path 490 | OCUDLExample-Prefix.pch 491 | sourceTree 492 | <group> 493 | 494 | DA9E85A2180CF8F70034193E 495 | 496 | isa 497 | PBXFileReference 498 | lastKnownFileType 499 | sourcecode.c.h 500 | path 501 | AppDelegate.h 502 | sourceTree 503 | <group> 504 | 505 | DA9E85A3180CF8F70034193E 506 | 507 | isa 508 | PBXFileReference 509 | lastKnownFileType 510 | sourcecode.c.objc 511 | path 512 | AppDelegate.m 513 | sourceTree 514 | <group> 515 | 516 | DA9E85A4180CF8F70034193E 517 | 518 | fileRef 519 | DA9E85A3180CF8F70034193E 520 | isa 521 | PBXBuildFile 522 | 523 | DA9E85A5180CF8F70034193E 524 | 525 | children 526 | 527 | DA9E85A6180CF8F70034193E 528 | 529 | isa 530 | PBXVariantGroup 531 | name 532 | Main.storyboard 533 | sourceTree 534 | <group> 535 | 536 | DA9E85A6180CF8F70034193E 537 | 538 | isa 539 | PBXFileReference 540 | lastKnownFileType 541 | file.storyboard 542 | name 543 | Base 544 | path 545 | Base.lproj/Main.storyboard 546 | sourceTree 547 | <group> 548 | 549 | DA9E85A7180CF8F70034193E 550 | 551 | fileRef 552 | DA9E85A5180CF8F70034193E 553 | isa 554 | PBXBuildFile 555 | 556 | DA9E85A8180CF8F70034193E 557 | 558 | isa 559 | PBXFileReference 560 | lastKnownFileType 561 | sourcecode.c.h 562 | path 563 | ViewController.h 564 | sourceTree 565 | <group> 566 | 567 | DA9E85A9180CF8F70034193E 568 | 569 | isa 570 | PBXFileReference 571 | lastKnownFileType 572 | sourcecode.c.objc 573 | path 574 | ViewController.m 575 | sourceTree 576 | <group> 577 | 578 | DA9E85AA180CF8F70034193E 579 | 580 | fileRef 581 | DA9E85A9180CF8F70034193E 582 | isa 583 | PBXBuildFile 584 | 585 | DA9E85AB180CF8F70034193E 586 | 587 | isa 588 | PBXFileReference 589 | lastKnownFileType 590 | folder.assetcatalog 591 | path 592 | Images.xcassets 593 | sourceTree 594 | <group> 595 | 596 | DA9E85AC180CF8F70034193E 597 | 598 | fileRef 599 | DA9E85AB180CF8F70034193E 600 | isa 601 | PBXBuildFile 602 | 603 | DA9E85AD180CF8F70034193E 604 | 605 | buildActionMask 606 | 2147483647 607 | files 608 | 609 | DA9E85BF180CF8F70034193E 610 | 611 | isa 612 | PBXSourcesBuildPhase 613 | runOnlyForDeploymentPostprocessing 614 | 0 615 | 616 | DA9E85AE180CF8F70034193E 617 | 618 | buildActionMask 619 | 2147483647 620 | files 621 | 622 | DA9E85B3180CF8F70034193E 623 | DA9E85B5180CF8F70034193E 624 | DA9E85B4180CF8F70034193E 625 | EA51BE73D539494CA00417F2 626 | 627 | isa 628 | PBXFrameworksBuildPhase 629 | runOnlyForDeploymentPostprocessing 630 | 0 631 | 632 | DA9E85AF180CF8F70034193E 633 | 634 | buildActionMask 635 | 2147483647 636 | files 637 | 638 | DA9E85BD180CF8F70034193E 639 | 640 | isa 641 | PBXResourcesBuildPhase 642 | runOnlyForDeploymentPostprocessing 643 | 0 644 | 645 | DA9E85B0180CF8F70034193E 646 | 647 | buildConfigurationList 648 | DA9E85C5180CF8F70034193E 649 | buildPhases 650 | 651 | 9E4647AC91284ECCA24B6E7D 652 | DA9E85AD180CF8F70034193E 653 | DA9E85AE180CF8F70034193E 654 | DA9E85AF180CF8F70034193E 655 | 72D4D956EF7D4836BF6AC4D9 656 | 657 | buildRules 658 | 659 | dependencies 660 | 661 | DA9E85B7180CF8F70034193E 662 | 663 | isa 664 | PBXNativeTarget 665 | name 666 | OCUDLExampleTests 667 | productName 668 | OCUDLExampleTests 669 | productReference 670 | DA9E85B1180CF8F70034193E 671 | productType 672 | com.apple.product-type.bundle.unit-test 673 | 674 | DA9E85B1180CF8F70034193E 675 | 676 | explicitFileType 677 | wrapper.cfbundle 678 | includeInIndex 679 | 0 680 | isa 681 | PBXFileReference 682 | path 683 | OCUDLExampleTests.xctest 684 | sourceTree 685 | BUILT_PRODUCTS_DIR 686 | 687 | DA9E85B2180CF8F70034193E 688 | 689 | isa 690 | PBXFileReference 691 | lastKnownFileType 692 | wrapper.framework 693 | name 694 | XCTest.framework 695 | path 696 | Library/Frameworks/XCTest.framework 697 | sourceTree 698 | DEVELOPER_DIR 699 | 700 | DA9E85B3180CF8F70034193E 701 | 702 | fileRef 703 | DA9E85B2180CF8F70034193E 704 | isa 705 | PBXBuildFile 706 | 707 | DA9E85B4180CF8F70034193E 708 | 709 | fileRef 710 | DA9E8593180CF8F70034193E 711 | isa 712 | PBXBuildFile 713 | 714 | DA9E85B5180CF8F70034193E 715 | 716 | fileRef 717 | DA9E8597180CF8F70034193E 718 | isa 719 | PBXBuildFile 720 | 721 | DA9E85B6180CF8F70034193E 722 | 723 | containerPortal 724 | DA9E8588180CF8F70034193E 725 | isa 726 | PBXContainerItemProxy 727 | proxyType 728 | 1 729 | remoteGlobalIDString 730 | DA9E858F180CF8F70034193E 731 | remoteInfo 732 | OCUDLExample 733 | 734 | DA9E85B7180CF8F70034193E 735 | 736 | isa 737 | PBXTargetDependency 738 | target 739 | DA9E858F180CF8F70034193E 740 | targetProxy 741 | DA9E85B6180CF8F70034193E 742 | 743 | DA9E85B8180CF8F70034193E 744 | 745 | children 746 | 747 | DA9E85BE180CF8F70034193E 748 | DA9E85B9180CF8F70034193E 749 | 750 | isa 751 | PBXGroup 752 | path 753 | OCUDLExampleTests 754 | sourceTree 755 | <group> 756 | 757 | DA9E85B9180CF8F70034193E 758 | 759 | children 760 | 761 | DA9E85BA180CF8F70034193E 762 | DA9E85BB180CF8F70034193E 763 | 764 | isa 765 | PBXGroup 766 | name 767 | Supporting Files 768 | sourceTree 769 | <group> 770 | 771 | DA9E85BA180CF8F70034193E 772 | 773 | isa 774 | PBXFileReference 775 | lastKnownFileType 776 | text.plist.xml 777 | path 778 | OCUDLExampleTests-Info.plist 779 | sourceTree 780 | <group> 781 | 782 | DA9E85BB180CF8F70034193E 783 | 784 | children 785 | 786 | DA9E85BC180CF8F70034193E 787 | 788 | isa 789 | PBXVariantGroup 790 | name 791 | InfoPlist.strings 792 | sourceTree 793 | <group> 794 | 795 | DA9E85BC180CF8F70034193E 796 | 797 | isa 798 | PBXFileReference 799 | lastKnownFileType 800 | text.plist.strings 801 | name 802 | en 803 | path 804 | en.lproj/InfoPlist.strings 805 | sourceTree 806 | <group> 807 | 808 | DA9E85BD180CF8F70034193E 809 | 810 | fileRef 811 | DA9E85BB180CF8F70034193E 812 | isa 813 | PBXBuildFile 814 | 815 | DA9E85BE180CF8F70034193E 816 | 817 | isa 818 | PBXFileReference 819 | lastKnownFileType 820 | sourcecode.c.objc 821 | path 822 | OCUDLExampleTests.m 823 | sourceTree 824 | <group> 825 | 826 | DA9E85BF180CF8F70034193E 827 | 828 | fileRef 829 | DA9E85BE180CF8F70034193E 830 | isa 831 | PBXBuildFile 832 | 833 | DA9E85C0180CF8F70034193E 834 | 835 | buildSettings 836 | 837 | ALWAYS_SEARCH_USER_PATHS 838 | NO 839 | ARCHS 840 | $(ARCHS_STANDARD_INCLUDING_64_BIT) 841 | CLANG_CXX_LANGUAGE_STANDARD 842 | gnu++0x 843 | CLANG_CXX_LIBRARY 844 | libc++ 845 | CLANG_ENABLE_MODULES 846 | YES 847 | CLANG_ENABLE_OBJC_ARC 848 | YES 849 | CLANG_WARN_BOOL_CONVERSION 850 | YES 851 | CLANG_WARN_CONSTANT_CONVERSION 852 | YES 853 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE 854 | YES_ERROR 855 | CLANG_WARN_EMPTY_BODY 856 | YES 857 | CLANG_WARN_ENUM_CONVERSION 858 | YES 859 | CLANG_WARN_INT_CONVERSION 860 | YES 861 | CLANG_WARN_OBJC_ROOT_CLASS 862 | YES_ERROR 863 | CLANG_WARN__DUPLICATE_METHOD_MATCH 864 | YES 865 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 866 | iPhone Developer 867 | COPY_PHASE_STRIP 868 | NO 869 | GCC_C_LANGUAGE_STANDARD 870 | gnu99 871 | GCC_DYNAMIC_NO_PIC 872 | NO 873 | GCC_OPTIMIZATION_LEVEL 874 | 0 875 | GCC_PREPROCESSOR_DEFINITIONS 876 | 877 | DEBUG=1 878 | $(inherited) 879 | 880 | GCC_SYMBOLS_PRIVATE_EXTERN 881 | NO 882 | GCC_WARN_64_TO_32_BIT_CONVERSION 883 | YES 884 | GCC_WARN_ABOUT_RETURN_TYPE 885 | YES_ERROR 886 | GCC_WARN_UNDECLARED_SELECTOR 887 | YES 888 | GCC_WARN_UNINITIALIZED_AUTOS 889 | YES 890 | GCC_WARN_UNUSED_FUNCTION 891 | YES 892 | GCC_WARN_UNUSED_VARIABLE 893 | YES 894 | IPHONEOS_DEPLOYMENT_TARGET 895 | 7.0 896 | ONLY_ACTIVE_ARCH 897 | YES 898 | SDKROOT 899 | iphoneos 900 | 901 | isa 902 | XCBuildConfiguration 903 | name 904 | Debug 905 | 906 | DA9E85C1180CF8F70034193E 907 | 908 | buildSettings 909 | 910 | ALWAYS_SEARCH_USER_PATHS 911 | NO 912 | ARCHS 913 | $(ARCHS_STANDARD_INCLUDING_64_BIT) 914 | CLANG_CXX_LANGUAGE_STANDARD 915 | gnu++0x 916 | CLANG_CXX_LIBRARY 917 | libc++ 918 | CLANG_ENABLE_MODULES 919 | YES 920 | CLANG_ENABLE_OBJC_ARC 921 | YES 922 | CLANG_WARN_BOOL_CONVERSION 923 | YES 924 | CLANG_WARN_CONSTANT_CONVERSION 925 | YES 926 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE 927 | YES_ERROR 928 | CLANG_WARN_EMPTY_BODY 929 | YES 930 | CLANG_WARN_ENUM_CONVERSION 931 | YES 932 | CLANG_WARN_INT_CONVERSION 933 | YES 934 | CLANG_WARN_OBJC_ROOT_CLASS 935 | YES_ERROR 936 | CLANG_WARN__DUPLICATE_METHOD_MATCH 937 | YES 938 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 939 | iPhone Developer 940 | COPY_PHASE_STRIP 941 | YES 942 | ENABLE_NS_ASSERTIONS 943 | NO 944 | GCC_C_LANGUAGE_STANDARD 945 | gnu99 946 | GCC_WARN_64_TO_32_BIT_CONVERSION 947 | YES 948 | GCC_WARN_ABOUT_RETURN_TYPE 949 | YES_ERROR 950 | GCC_WARN_UNDECLARED_SELECTOR 951 | YES 952 | GCC_WARN_UNINITIALIZED_AUTOS 953 | YES 954 | GCC_WARN_UNUSED_FUNCTION 955 | YES 956 | GCC_WARN_UNUSED_VARIABLE 957 | YES 958 | IPHONEOS_DEPLOYMENT_TARGET 959 | 7.0 960 | SDKROOT 961 | iphoneos 962 | VALIDATE_PRODUCT 963 | YES 964 | 965 | isa 966 | XCBuildConfiguration 967 | name 968 | Release 969 | 970 | DA9E85C2180CF8F70034193E 971 | 972 | buildConfigurations 973 | 974 | DA9E85C3180CF8F70034193E 975 | DA9E85C4180CF8F70034193E 976 | 977 | defaultConfigurationIsVisible 978 | 0 979 | isa 980 | XCConfigurationList 981 | 982 | DA9E85C3180CF8F70034193E 983 | 984 | baseConfigurationReference 985 | 01049FFA44444CBBB2C92880 986 | buildSettings 987 | 988 | ASSETCATALOG_COMPILER_APPICON_NAME 989 | AppIcon 990 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME 991 | LaunchImage 992 | GCC_PRECOMPILE_PREFIX_HEADER 993 | YES 994 | GCC_PREFIX_HEADER 995 | OCUDLExample/OCUDLExample-Prefix.pch 996 | INFOPLIST_FILE 997 | OCUDLExample/OCUDLExample-Info.plist 998 | PRODUCT_NAME 999 | $(TARGET_NAME) 1000 | WRAPPER_EXTENSION 1001 | app 1002 | 1003 | isa 1004 | XCBuildConfiguration 1005 | name 1006 | Debug 1007 | 1008 | DA9E85C4180CF8F70034193E 1009 | 1010 | baseConfigurationReference 1011 | 01049FFA44444CBBB2C92880 1012 | buildSettings 1013 | 1014 | ASSETCATALOG_COMPILER_APPICON_NAME 1015 | AppIcon 1016 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME 1017 | LaunchImage 1018 | GCC_PRECOMPILE_PREFIX_HEADER 1019 | YES 1020 | GCC_PREFIX_HEADER 1021 | OCUDLExample/OCUDLExample-Prefix.pch 1022 | INFOPLIST_FILE 1023 | OCUDLExample/OCUDLExample-Info.plist 1024 | PRODUCT_NAME 1025 | $(TARGET_NAME) 1026 | WRAPPER_EXTENSION 1027 | app 1028 | 1029 | isa 1030 | XCBuildConfiguration 1031 | name 1032 | Release 1033 | 1034 | DA9E85C5180CF8F70034193E 1035 | 1036 | buildConfigurations 1037 | 1038 | DA9E85C6180CF8F70034193E 1039 | DA9E85C7180CF8F70034193E 1040 | 1041 | defaultConfigurationIsVisible 1042 | 0 1043 | isa 1044 | XCConfigurationList 1045 | 1046 | DA9E85C6180CF8F70034193E 1047 | 1048 | baseConfigurationReference 1049 | 01049FFA44444CBBB2C92880 1050 | buildSettings 1051 | 1052 | ARCHS 1053 | $(ARCHS_STANDARD_INCLUDING_64_BIT) 1054 | BUNDLE_LOADER 1055 | $(BUILT_PRODUCTS_DIR)/OCUDLExample.app/OCUDLExample 1056 | FRAMEWORK_SEARCH_PATHS 1057 | 1058 | $(SDKROOT)/Developer/Library/Frameworks 1059 | $(inherited) 1060 | $(DEVELOPER_FRAMEWORKS_DIR) 1061 | 1062 | GCC_PRECOMPILE_PREFIX_HEADER 1063 | YES 1064 | GCC_PREFIX_HEADER 1065 | OCUDLExample/OCUDLExample-Prefix.pch 1066 | GCC_PREPROCESSOR_DEFINITIONS 1067 | 1068 | DEBUG=1 1069 | $(inherited) 1070 | 1071 | INFOPLIST_FILE 1072 | OCUDLExampleTests/OCUDLExampleTests-Info.plist 1073 | PRODUCT_NAME 1074 | $(TARGET_NAME) 1075 | TEST_HOST 1076 | $(BUNDLE_LOADER) 1077 | WRAPPER_EXTENSION 1078 | xctest 1079 | 1080 | isa 1081 | XCBuildConfiguration 1082 | name 1083 | Debug 1084 | 1085 | DA9E85C7180CF8F70034193E 1086 | 1087 | baseConfigurationReference 1088 | 01049FFA44444CBBB2C92880 1089 | buildSettings 1090 | 1091 | ARCHS 1092 | $(ARCHS_STANDARD_INCLUDING_64_BIT) 1093 | BUNDLE_LOADER 1094 | $(BUILT_PRODUCTS_DIR)/OCUDLExample.app/OCUDLExample 1095 | FRAMEWORK_SEARCH_PATHS 1096 | 1097 | $(SDKROOT)/Developer/Library/Frameworks 1098 | $(inherited) 1099 | $(DEVELOPER_FRAMEWORKS_DIR) 1100 | 1101 | GCC_PRECOMPILE_PREFIX_HEADER 1102 | YES 1103 | GCC_PREFIX_HEADER 1104 | OCUDLExample/OCUDLExample-Prefix.pch 1105 | INFOPLIST_FILE 1106 | OCUDLExampleTests/OCUDLExampleTests-Info.plist 1107 | PRODUCT_NAME 1108 | $(TARGET_NAME) 1109 | TEST_HOST 1110 | $(BUNDLE_LOADER) 1111 | WRAPPER_EXTENSION 1112 | xctest 1113 | 1114 | isa 1115 | XCBuildConfiguration 1116 | name 1117 | Release 1118 | 1119 | E62C789FF1DB4BD28868B11A 1120 | 1121 | buildActionMask 1122 | 2147483647 1123 | files 1124 | 1125 | inputPaths 1126 | 1127 | isa 1128 | PBXShellScriptBuildPhase 1129 | name 1130 | Copy Pods Resources 1131 | outputPaths 1132 | 1133 | runOnlyForDeploymentPostprocessing 1134 | 0 1135 | shellPath 1136 | /bin/sh 1137 | shellScript 1138 | "${SRCROOT}/Pods/Pods-resources.sh" 1139 | 1140 | showEnvVarsInLog 1141 | 0 1142 | 1143 | EA51BE73D539494CA00417F2 1144 | 1145 | fileRef 1146 | 0AA109B2F4E34D41A94E6585 1147 | isa 1148 | PBXBuildFile 1149 | 1150 | 1151 | rootObject 1152 | DA9E8588180CF8F70034193E 1153 | 1154 | 1155 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExample.xcodeproj/xcshareddata/xcschemes/OCUDLExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // OCUDLExample 4 | // 5 | // Created by DUSTIN on 10/14/13. 6 | // Copyright (c) 2013 Dustin Bachrach. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // OCUDLExample 4 | // 5 | // Created by DUSTIN on 10/14/13. 6 | // Copyright (c) 2013 Dustin Bachrach. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExample/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExample/OCUDLExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.dustinbachrach.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExample/OCUDLExample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExample/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // OCUDLExample 4 | // 5 | // Created by DUSTIN on 10/14/13. 6 | // Copyright (c) 2013 Dustin Bachrach. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExample/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // OCUDLExample 4 | // 5 | // Created by DUSTIN on 10/14/13. 6 | // Copyright (c) 2013 Dustin Bachrach. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | - (void)didReceiveMemoryWarning 24 | { 25 | [super didReceiveMemoryWarning]; 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OCUDLExample 4 | // 5 | // Created by DUSTIN on 10/14/13. 6 | // Copyright (c) 2013 Dustin Bachrach. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExampleTests/OCUDLExampleTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.dustinbachrach.${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 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExampleTests/OCUDLExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // OCUDLExampleTests.m 3 | // OCUDLExampleTests 4 | // 5 | // Created by DUSTIN on 10/14/13. 6 | // Copyright (c) 2013 Dustin Bachrach. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | @interface OCUDLExampleTests : XCTestCase 14 | 15 | @end 16 | 17 | @implementation OCUDLExampleTests 18 | 19 | - (void)setUp 20 | { 21 | [super setUp]; 22 | [OCUDLBuiltins use]; 23 | } 24 | 25 | - (void)tearDown 26 | { 27 | [super tearDown]; 28 | } 29 | 30 | - (void)testNSNull 31 | { 32 | XCTAssertEqualObjects($(null), [NSNull null], @""); 33 | } 34 | 35 | - (void)testUIColor 36 | { 37 | XCTAssertEqualObjects($(#FF0000), 38 | [UIColor colorWithRed:255.0 39 | green:0 40 | blue:0 41 | alpha:1.0], 42 | @"Red is equal"); 43 | 44 | XCTAssertEqualObjects($(#00FF00), 45 | [UIColor colorWithRed:0 46 | green:255.0 47 | blue:0 48 | alpha:1.0], 49 | @"Green is equal"); 50 | 51 | XCTAssertEqualObjects($(#0000FF), 52 | [UIColor colorWithRed:0 53 | green:0 54 | blue:255.0 55 | alpha:1.0], 56 | @"Blue is equal"); 57 | 58 | XCTAssertEqualObjects($(#FFF), 59 | [UIColor colorWithRed:255.0 60 | green:255.0 61 | blue:255.0 62 | alpha:1.0], 63 | @"White is equal"); 64 | 65 | XCTAssertEqualObjects($(#yellow), 66 | [UIColor yellowColor], 67 | @"Yellow is equal"); 68 | } 69 | 70 | - (void)testNSUUID 71 | { 72 | NSUUID *uuid = $(68753A44-4D6F-1226-9C60-0050E4C00067uuid); 73 | XCTAssertEqualObjects(uuid.UUIDString, 74 | @"68753A44-4D6F-1226-9C60-0050E4C00067", 75 | @"68753A44-4D6F-1226-9C60-0050E4C00067 is equal"); 76 | } 77 | 78 | - (void)testNSURL 79 | { 80 | NSURL *url = $(http:apple.com); 81 | XCTAssertEqualObjects([url description], 82 | @"http://apple.com", 83 | @"http://apple.com is equal"); 84 | NSURL *url2 = $(https:apple.com); 85 | XCTAssertEqualObjects([url2 description], 86 | @"https://apple.com", 87 | @"https://apple.com is equal"); 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /OCUDLExample/OCUDLExampleTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /OCUDLExample/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '7.0' 2 | 3 | link_with ['OCUDLExample', 'OCUDLExampleTests'] 4 | 5 | pod 'OCUDL', :path => '../OCUDL.podspec' 6 | -------------------------------------------------------------------------------- /OCUDLExample/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - OCUDL (0.1.0) 3 | 4 | DEPENDENCIES: 5 | - OCUDL (from `../OCUDL.podspec`) 6 | 7 | EXTERNAL SOURCES: 8 | OCUDL: 9 | :path: ../OCUDL.podspec 10 | 11 | SPEC CHECKSUMS: 12 | OCUDL: a4bd276f387441dd391fe321d3fc868b6e7fdc6e 13 | 14 | COCOAPODS: 0.26.2 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # OCUDL 3 | 4 | OCUDL is an experiment to bring user defined literals to Objective-C. A literal is a shorthand expression that creates a value of a certain type. For example, `25ul` creates an unsigned long of *25*, and `@"hello"` creates an NSString of *hello*. User defined literals bring this brevity and expressivity to our own types. 5 | 6 | Literals are usually baked right in to the compiler. OCUDL, however, does not extend the compiler; it simply uses what already exists in the Objective-C runtime. You can learn more about OCUDL's internals at [OCUDL In Depth](http://dbachrach.com/posts/ocudl-in-depth/). 7 | 8 | The [OCUDL source](https://github.com/dbachrach/OCUDL) is available on GitHub under the [MIT License](http://opensource.org/licenses/MIT). Documentation is at [CocoaDocs](http://cocoadocs.org/docsets/OCUDL/). Pull requests, bugs, and issues are welcome. 9 | 10 | ## Example 11 | 12 | OCUDL defines literals using prefixes or suffixes. Here, we've defined a UIColor literal that uses the *#* prefix. 13 | 14 | ```objc 15 | // Creates a UIColor 16 | myView.backgroundColor = $(#FE22AA); 17 | ``` 18 | 19 | The *$* tells OCUDL to interpret this value as a user defined literal. If user defined literals were baked right into the language, you wouldn't need the *$* at all. 20 | 21 | Explore the Useful Literals section for additional examples of literals for UIKit and Foundation types. 22 | 23 | ## Experimental 24 | 25 | OCUDL is an experiment, and might not be appropriate for your project. Please read [OCUDL In Depth](http://dbachrach.com/posts/ocudl-in-depth/) to understand what's happening behind the scenes. **NOTE: OCUDL has been updated to not rely upon method swizzling.** 26 | 27 | ## Using OCUDL 28 | 29 | You can get OCUDL through [CocoaPods](http://cocoapods.org). You can [learn more] about dependency management with CocoaPods, but we'll cover the basics. 30 | 31 | Install CocoaPods: 32 | 33 | ``` bash 34 | gem install cocoapods 35 | pod setup 36 | ``` 37 | 38 | Create a `Podfile`, in your project directory. Add the following lines: 39 | 40 | ``` 41 | platform :ios 42 | 43 | pod 'OCUDL' 44 | ``` 45 | 46 | Then install the Podfile: 47 | 48 | ``` bash 49 | pod install 50 | ``` 51 | 52 | CocoaPods will create a `.xcworkspace` for you if you haven't already created one. You will need to open your code in Xcode through the workspace file and not the `.xcodeproj` file from now on. 53 | 54 | Now your project is all set to start using OCUDL. Get started by importing the header: 55 | 56 | ```objc 57 | #import 58 | ``` 59 | 60 | To create a literal for your class, first implement the `OCUDLClass` protocol. 61 | 62 | ```objc 63 | @interface YourClass : NSObject 64 | ``` 65 | 66 | Then, register a literal prefix or suffix for your class. 67 | 68 | ```objc 69 | @implementation YourClass 70 | + (void)load 71 | { 72 | [[OCUDLManager defaultManager] registerSuffix:@"your-suffix" forClass:[YourClass class]]; 73 | } 74 | @end 75 | ``` 76 | 77 | Finally, implement the literal initializer. 78 | 79 | ```objc 80 | - (id)initWithLiteral:(NSString*)literal suffix:(NSString*)suffix 81 | { 82 | if (self = [super init]) { 83 | // ... 84 | } 85 | return self; 86 | } 87 | ``` 88 | 89 | Now anywhere in your project you can use your literal. 90 | 91 | ```objc 92 | YourClass *foo = $(555your-suffix); 93 | ``` 94 | 95 | ## Blocks 96 | 97 | Sometimes you might want to add literals for classes you didn't author. Instead of using categories, just use OCUDL's support for blocks. 98 | 99 | ```objc 100 | [[OCUDLManager defaultManager] registerPrefix:@"#" forBlock:^id(NSString *literal, NSString *prefix) { 101 | // return a new instance of some class 102 | }]; 103 | ``` 104 | 105 | ## Useful literals 106 | 107 | OCUDL comes with a bunch of useful built-in literals for UIKit and Foundation types. 108 | 109 | ``` 110 | #import 111 | 112 | // ... 113 | 114 | [OCUDLBuiltins use]; 115 | ``` 116 | 117 | After you `[OCUDLBuiltins use]`, you can take advantage of all the built-in literals anywhere in your code. 118 | 119 | ### NSNull 120 | 121 | ```objc 122 | NSNull *n = $(null); 123 | ``` 124 | 125 | ### NSURL 126 | 127 | ```objc 128 | NSURL *url = $(http:www.apple.com); 129 | NSURL *url2 = $(https:www.gmail.com); 130 | ``` 131 | 132 | ### NSUUID 133 | 134 | ```objc 135 | NSUUID *uuid = $(68753A44-4D6F-1226-9C60-0050E4C00067uuid); 136 | ``` 137 | 138 | ### UIColor 139 | 140 | ```objc 141 | UIColor *color = $(#FE22AA); 142 | UIColor *color2 = $(#FFF); 143 | UIColor *color3 = $(#yellow); 144 | ``` 145 | 146 | ### UIImage 147 | 148 | ```objc 149 | UIImage *img = $(pic.img); 150 | ``` 151 | 152 | ### UINib 153 | 154 | ```objc 155 | UINib *nib = $(MyNib.xib); 156 | ``` 157 | 158 | ### UIStoryboard 159 | 160 | ```objc 161 | UIStoryboard *board = $(MyBoard.storyboard); 162 | ``` 163 | 164 | 165 | [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/dbachrach/ocudl/trend.png)](https://bitdeli.com/free "Bitdeli Badge") 166 | 167 | --------------------------------------------------------------------------------