├── ABCAutoCompleteTextView.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── adamcooper.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── ABCAutoCompleteTextView.xcscheme │ └── xcschememanagement.plist ├── ABCAutoCompleteTextView ├── ABCAutoCompleteTextView.h ├── ABCAutoCompleteTextView.m ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ └── LaunchScreen.storyboard ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── ABCAutoCompleteTextViewTests ├── ABCAutoCompleteTextViewTests.m └── Info.plist ├── ABCAutoCompleteTextViewUITests ├── ABCAutoCompleteTextViewUITests.m └── Info.plist └── README.md /ABCAutoCompleteTextView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 87CBE2641BD20924003A161A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 87CBE2631BD20924003A161A /* main.m */; }; 11 | 87CBE2671BD20924003A161A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 87CBE2661BD20924003A161A /* AppDelegate.m */; }; 12 | 87CBE26A1BD20924003A161A /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 87CBE2691BD20924003A161A /* ViewController.m */; }; 13 | 87CBE26F1BD20924003A161A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 87CBE26E1BD20924003A161A /* Assets.xcassets */; }; 14 | 87CBE2721BD20924003A161A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 87CBE2701BD20924003A161A /* LaunchScreen.storyboard */; }; 15 | 87CBE27D1BD20924003A161A /* ABCAutoCompleteTextViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 87CBE27C1BD20924003A161A /* ABCAutoCompleteTextViewTests.m */; }; 16 | 87CBE2881BD20924003A161A /* ABCAutoCompleteTextViewUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 87CBE2871BD20924003A161A /* ABCAutoCompleteTextViewUITests.m */; }; 17 | 87CBE2971BD209B0003A161A /* ABCAutoCompleteTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 87CBE2961BD209B0003A161A /* ABCAutoCompleteTextView.m */; settings = {ASSET_TAGS = (); }; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 87CBE2791BD20924003A161A /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 87CBE2571BD20924003A161A /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 87CBE25E1BD20924003A161A; 26 | remoteInfo = ABCAutoCompleteTextView; 27 | }; 28 | 87CBE2841BD20924003A161A /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 87CBE2571BD20924003A161A /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 87CBE25E1BD20924003A161A; 33 | remoteInfo = ABCAutoCompleteTextView; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 87CBE25F1BD20924003A161A /* ABCAutoCompleteTextView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ABCAutoCompleteTextView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 87CBE2631BD20924003A161A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 40 | 87CBE2651BD20924003A161A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 41 | 87CBE2661BD20924003A161A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 42 | 87CBE2681BD20924003A161A /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 43 | 87CBE2691BD20924003A161A /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 44 | 87CBE26E1BD20924003A161A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 45 | 87CBE2711BD20924003A161A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 46 | 87CBE2731BD20924003A161A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | 87CBE2781BD20924003A161A /* ABCAutoCompleteTextViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ABCAutoCompleteTextViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 87CBE27C1BD20924003A161A /* ABCAutoCompleteTextViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ABCAutoCompleteTextViewTests.m; sourceTree = ""; }; 49 | 87CBE27E1BD20924003A161A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | 87CBE2831BD20924003A161A /* ABCAutoCompleteTextViewUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ABCAutoCompleteTextViewUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 87CBE2871BD20924003A161A /* ABCAutoCompleteTextViewUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ABCAutoCompleteTextViewUITests.m; sourceTree = ""; }; 52 | 87CBE2891BD20924003A161A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | 87CBE2951BD209B0003A161A /* ABCAutoCompleteTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABCAutoCompleteTextView.h; sourceTree = ""; }; 54 | 87CBE2961BD209B0003A161A /* ABCAutoCompleteTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ABCAutoCompleteTextView.m; sourceTree = ""; }; 55 | /* End PBXFileReference section */ 56 | 57 | /* Begin PBXFrameworksBuildPhase section */ 58 | 87CBE25C1BD20924003A161A /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | 87CBE2751BD20924003A161A /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | 87CBE2801BD20924003A161A /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | /* End PBXFrameworksBuildPhase section */ 80 | 81 | /* Begin PBXGroup section */ 82 | 87CBE2561BD20924003A161A = { 83 | isa = PBXGroup; 84 | children = ( 85 | 87CBE2611BD20924003A161A /* ABCAutoCompleteTextView */, 86 | 87CBE27B1BD20924003A161A /* ABCAutoCompleteTextViewTests */, 87 | 87CBE2861BD20924003A161A /* ABCAutoCompleteTextViewUITests */, 88 | 87CBE2601BD20924003A161A /* Products */, 89 | ); 90 | sourceTree = ""; 91 | }; 92 | 87CBE2601BD20924003A161A /* Products */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 87CBE25F1BD20924003A161A /* ABCAutoCompleteTextView.app */, 96 | 87CBE2781BD20924003A161A /* ABCAutoCompleteTextViewTests.xctest */, 97 | 87CBE2831BD20924003A161A /* ABCAutoCompleteTextViewUITests.xctest */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 87CBE2611BD20924003A161A /* ABCAutoCompleteTextView */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 87CBE2651BD20924003A161A /* AppDelegate.h */, 106 | 87CBE2661BD20924003A161A /* AppDelegate.m */, 107 | 87CBE2681BD20924003A161A /* ViewController.h */, 108 | 87CBE2691BD20924003A161A /* ViewController.m */, 109 | 87CBE2981BD21647003A161A /* ABCAutoCompleteTextView */, 110 | 87CBE26E1BD20924003A161A /* Assets.xcassets */, 111 | 87CBE2701BD20924003A161A /* LaunchScreen.storyboard */, 112 | 87CBE2731BD20924003A161A /* Info.plist */, 113 | 87CBE2621BD20924003A161A /* Supporting Files */, 114 | ); 115 | path = ABCAutoCompleteTextView; 116 | sourceTree = ""; 117 | }; 118 | 87CBE2621BD20924003A161A /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 87CBE2631BD20924003A161A /* main.m */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | 87CBE27B1BD20924003A161A /* ABCAutoCompleteTextViewTests */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 87CBE27C1BD20924003A161A /* ABCAutoCompleteTextViewTests.m */, 130 | 87CBE27E1BD20924003A161A /* Info.plist */, 131 | ); 132 | path = ABCAutoCompleteTextViewTests; 133 | sourceTree = ""; 134 | }; 135 | 87CBE2861BD20924003A161A /* ABCAutoCompleteTextViewUITests */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 87CBE2871BD20924003A161A /* ABCAutoCompleteTextViewUITests.m */, 139 | 87CBE2891BD20924003A161A /* Info.plist */, 140 | ); 141 | path = ABCAutoCompleteTextViewUITests; 142 | sourceTree = ""; 143 | }; 144 | 87CBE2981BD21647003A161A /* ABCAutoCompleteTextView */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | 87CBE2951BD209B0003A161A /* ABCAutoCompleteTextView.h */, 148 | 87CBE2961BD209B0003A161A /* ABCAutoCompleteTextView.m */, 149 | ); 150 | name = ABCAutoCompleteTextView; 151 | sourceTree = ""; 152 | }; 153 | /* End PBXGroup section */ 154 | 155 | /* Begin PBXNativeTarget section */ 156 | 87CBE25E1BD20924003A161A /* ABCAutoCompleteTextView */ = { 157 | isa = PBXNativeTarget; 158 | buildConfigurationList = 87CBE28C1BD20924003A161A /* Build configuration list for PBXNativeTarget "ABCAutoCompleteTextView" */; 159 | buildPhases = ( 160 | 87CBE25B1BD20924003A161A /* Sources */, 161 | 87CBE25C1BD20924003A161A /* Frameworks */, 162 | 87CBE25D1BD20924003A161A /* Resources */, 163 | ); 164 | buildRules = ( 165 | ); 166 | dependencies = ( 167 | ); 168 | name = ABCAutoCompleteTextView; 169 | productName = ABCAutoCompleteTextView; 170 | productReference = 87CBE25F1BD20924003A161A /* ABCAutoCompleteTextView.app */; 171 | productType = "com.apple.product-type.application"; 172 | }; 173 | 87CBE2771BD20924003A161A /* ABCAutoCompleteTextViewTests */ = { 174 | isa = PBXNativeTarget; 175 | buildConfigurationList = 87CBE28F1BD20924003A161A /* Build configuration list for PBXNativeTarget "ABCAutoCompleteTextViewTests" */; 176 | buildPhases = ( 177 | 87CBE2741BD20924003A161A /* Sources */, 178 | 87CBE2751BD20924003A161A /* Frameworks */, 179 | 87CBE2761BD20924003A161A /* Resources */, 180 | ); 181 | buildRules = ( 182 | ); 183 | dependencies = ( 184 | 87CBE27A1BD20924003A161A /* PBXTargetDependency */, 185 | ); 186 | name = ABCAutoCompleteTextViewTests; 187 | productName = ABCAutoCompleteTextViewTests; 188 | productReference = 87CBE2781BD20924003A161A /* ABCAutoCompleteTextViewTests.xctest */; 189 | productType = "com.apple.product-type.bundle.unit-test"; 190 | }; 191 | 87CBE2821BD20924003A161A /* ABCAutoCompleteTextViewUITests */ = { 192 | isa = PBXNativeTarget; 193 | buildConfigurationList = 87CBE2921BD20924003A161A /* Build configuration list for PBXNativeTarget "ABCAutoCompleteTextViewUITests" */; 194 | buildPhases = ( 195 | 87CBE27F1BD20924003A161A /* Sources */, 196 | 87CBE2801BD20924003A161A /* Frameworks */, 197 | 87CBE2811BD20924003A161A /* Resources */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | 87CBE2851BD20924003A161A /* PBXTargetDependency */, 203 | ); 204 | name = ABCAutoCompleteTextViewUITests; 205 | productName = ABCAutoCompleteTextViewUITests; 206 | productReference = 87CBE2831BD20924003A161A /* ABCAutoCompleteTextViewUITests.xctest */; 207 | productType = "com.apple.product-type.bundle.ui-testing"; 208 | }; 209 | /* End PBXNativeTarget section */ 210 | 211 | /* Begin PBXProject section */ 212 | 87CBE2571BD20924003A161A /* Project object */ = { 213 | isa = PBXProject; 214 | attributes = { 215 | LastUpgradeCheck = 0700; 216 | ORGANIZATIONNAME = "Adam Cooper"; 217 | TargetAttributes = { 218 | 87CBE25E1BD20924003A161A = { 219 | CreatedOnToolsVersion = 7.0.1; 220 | }; 221 | 87CBE2771BD20924003A161A = { 222 | CreatedOnToolsVersion = 7.0.1; 223 | TestTargetID = 87CBE25E1BD20924003A161A; 224 | }; 225 | 87CBE2821BD20924003A161A = { 226 | CreatedOnToolsVersion = 7.0.1; 227 | TestTargetID = 87CBE25E1BD20924003A161A; 228 | }; 229 | }; 230 | }; 231 | buildConfigurationList = 87CBE25A1BD20924003A161A /* Build configuration list for PBXProject "ABCAutoCompleteTextView" */; 232 | compatibilityVersion = "Xcode 3.2"; 233 | developmentRegion = English; 234 | hasScannedForEncodings = 0; 235 | knownRegions = ( 236 | en, 237 | Base, 238 | ); 239 | mainGroup = 87CBE2561BD20924003A161A; 240 | productRefGroup = 87CBE2601BD20924003A161A /* Products */; 241 | projectDirPath = ""; 242 | projectRoot = ""; 243 | targets = ( 244 | 87CBE25E1BD20924003A161A /* ABCAutoCompleteTextView */, 245 | 87CBE2771BD20924003A161A /* ABCAutoCompleteTextViewTests */, 246 | 87CBE2821BD20924003A161A /* ABCAutoCompleteTextViewUITests */, 247 | ); 248 | }; 249 | /* End PBXProject section */ 250 | 251 | /* Begin PBXResourcesBuildPhase section */ 252 | 87CBE25D1BD20924003A161A /* Resources */ = { 253 | isa = PBXResourcesBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | 87CBE2721BD20924003A161A /* LaunchScreen.storyboard in Resources */, 257 | 87CBE26F1BD20924003A161A /* Assets.xcassets in Resources */, 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | }; 261 | 87CBE2761BD20924003A161A /* Resources */ = { 262 | isa = PBXResourcesBuildPhase; 263 | buildActionMask = 2147483647; 264 | files = ( 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | 87CBE2811BD20924003A161A /* Resources */ = { 269 | isa = PBXResourcesBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | }; 275 | /* End PBXResourcesBuildPhase section */ 276 | 277 | /* Begin PBXSourcesBuildPhase section */ 278 | 87CBE25B1BD20924003A161A /* Sources */ = { 279 | isa = PBXSourcesBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | 87CBE2971BD209B0003A161A /* ABCAutoCompleteTextView.m in Sources */, 283 | 87CBE26A1BD20924003A161A /* ViewController.m in Sources */, 284 | 87CBE2671BD20924003A161A /* AppDelegate.m in Sources */, 285 | 87CBE2641BD20924003A161A /* main.m in Sources */, 286 | ); 287 | runOnlyForDeploymentPostprocessing = 0; 288 | }; 289 | 87CBE2741BD20924003A161A /* Sources */ = { 290 | isa = PBXSourcesBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | 87CBE27D1BD20924003A161A /* ABCAutoCompleteTextViewTests.m in Sources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | 87CBE27F1BD20924003A161A /* Sources */ = { 298 | isa = PBXSourcesBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | 87CBE2881BD20924003A161A /* ABCAutoCompleteTextViewUITests.m in Sources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | /* End PBXSourcesBuildPhase section */ 306 | 307 | /* Begin PBXTargetDependency section */ 308 | 87CBE27A1BD20924003A161A /* PBXTargetDependency */ = { 309 | isa = PBXTargetDependency; 310 | target = 87CBE25E1BD20924003A161A /* ABCAutoCompleteTextView */; 311 | targetProxy = 87CBE2791BD20924003A161A /* PBXContainerItemProxy */; 312 | }; 313 | 87CBE2851BD20924003A161A /* PBXTargetDependency */ = { 314 | isa = PBXTargetDependency; 315 | target = 87CBE25E1BD20924003A161A /* ABCAutoCompleteTextView */; 316 | targetProxy = 87CBE2841BD20924003A161A /* PBXContainerItemProxy */; 317 | }; 318 | /* End PBXTargetDependency section */ 319 | 320 | /* Begin PBXVariantGroup section */ 321 | 87CBE2701BD20924003A161A /* LaunchScreen.storyboard */ = { 322 | isa = PBXVariantGroup; 323 | children = ( 324 | 87CBE2711BD20924003A161A /* Base */, 325 | ); 326 | name = LaunchScreen.storyboard; 327 | sourceTree = ""; 328 | }; 329 | /* End PBXVariantGroup section */ 330 | 331 | /* Begin XCBuildConfiguration section */ 332 | 87CBE28A1BD20924003A161A /* Debug */ = { 333 | isa = XCBuildConfiguration; 334 | buildSettings = { 335 | ALWAYS_SEARCH_USER_PATHS = NO; 336 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 337 | CLANG_CXX_LIBRARY = "libc++"; 338 | CLANG_ENABLE_MODULES = YES; 339 | CLANG_ENABLE_OBJC_ARC = YES; 340 | CLANG_WARN_BOOL_CONVERSION = YES; 341 | CLANG_WARN_CONSTANT_CONVERSION = YES; 342 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 343 | CLANG_WARN_EMPTY_BODY = YES; 344 | CLANG_WARN_ENUM_CONVERSION = YES; 345 | CLANG_WARN_INT_CONVERSION = YES; 346 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 347 | CLANG_WARN_UNREACHABLE_CODE = YES; 348 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 349 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 350 | COPY_PHASE_STRIP = NO; 351 | DEBUG_INFORMATION_FORMAT = dwarf; 352 | ENABLE_STRICT_OBJC_MSGSEND = YES; 353 | ENABLE_TESTABILITY = YES; 354 | GCC_C_LANGUAGE_STANDARD = gnu99; 355 | GCC_DYNAMIC_NO_PIC = NO; 356 | GCC_NO_COMMON_BLOCKS = YES; 357 | GCC_OPTIMIZATION_LEVEL = 0; 358 | GCC_PREPROCESSOR_DEFINITIONS = ( 359 | "DEBUG=1", 360 | "$(inherited)", 361 | ); 362 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 363 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 364 | GCC_WARN_UNDECLARED_SELECTOR = YES; 365 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 366 | GCC_WARN_UNUSED_FUNCTION = YES; 367 | GCC_WARN_UNUSED_VARIABLE = YES; 368 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 369 | MTL_ENABLE_DEBUG_INFO = YES; 370 | ONLY_ACTIVE_ARCH = YES; 371 | SDKROOT = iphoneos; 372 | TARGETED_DEVICE_FAMILY = "1,2"; 373 | }; 374 | name = Debug; 375 | }; 376 | 87CBE28B1BD20924003A161A /* Release */ = { 377 | isa = XCBuildConfiguration; 378 | buildSettings = { 379 | ALWAYS_SEARCH_USER_PATHS = NO; 380 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 381 | CLANG_CXX_LIBRARY = "libc++"; 382 | CLANG_ENABLE_MODULES = YES; 383 | CLANG_ENABLE_OBJC_ARC = YES; 384 | CLANG_WARN_BOOL_CONVERSION = YES; 385 | CLANG_WARN_CONSTANT_CONVERSION = YES; 386 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 387 | CLANG_WARN_EMPTY_BODY = YES; 388 | CLANG_WARN_ENUM_CONVERSION = YES; 389 | CLANG_WARN_INT_CONVERSION = YES; 390 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 391 | CLANG_WARN_UNREACHABLE_CODE = YES; 392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 394 | COPY_PHASE_STRIP = NO; 395 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 396 | ENABLE_NS_ASSERTIONS = NO; 397 | ENABLE_STRICT_OBJC_MSGSEND = YES; 398 | GCC_C_LANGUAGE_STANDARD = gnu99; 399 | GCC_NO_COMMON_BLOCKS = YES; 400 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 401 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 402 | GCC_WARN_UNDECLARED_SELECTOR = YES; 403 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 404 | GCC_WARN_UNUSED_FUNCTION = YES; 405 | GCC_WARN_UNUSED_VARIABLE = YES; 406 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 407 | MTL_ENABLE_DEBUG_INFO = NO; 408 | SDKROOT = iphoneos; 409 | TARGETED_DEVICE_FAMILY = "1,2"; 410 | VALIDATE_PRODUCT = YES; 411 | }; 412 | name = Release; 413 | }; 414 | 87CBE28D1BD20924003A161A /* Debug */ = { 415 | isa = XCBuildConfiguration; 416 | buildSettings = { 417 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 418 | INFOPLIST_FILE = ABCAutoCompleteTextView/Info.plist; 419 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 420 | PRODUCT_BUNDLE_IDENTIFIER = com.adamCooper.ABCAutoCompleteTextView; 421 | PRODUCT_NAME = "$(TARGET_NAME)"; 422 | }; 423 | name = Debug; 424 | }; 425 | 87CBE28E1BD20924003A161A /* Release */ = { 426 | isa = XCBuildConfiguration; 427 | buildSettings = { 428 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 429 | INFOPLIST_FILE = ABCAutoCompleteTextView/Info.plist; 430 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 431 | PRODUCT_BUNDLE_IDENTIFIER = com.adamCooper.ABCAutoCompleteTextView; 432 | PRODUCT_NAME = "$(TARGET_NAME)"; 433 | }; 434 | name = Release; 435 | }; 436 | 87CBE2901BD20924003A161A /* Debug */ = { 437 | isa = XCBuildConfiguration; 438 | buildSettings = { 439 | BUNDLE_LOADER = "$(TEST_HOST)"; 440 | INFOPLIST_FILE = ABCAutoCompleteTextViewTests/Info.plist; 441 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 442 | PRODUCT_BUNDLE_IDENTIFIER = com.adamCooper.ABCAutoCompleteTextViewTests; 443 | PRODUCT_NAME = "$(TARGET_NAME)"; 444 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ABCAutoCompleteTextView.app/ABCAutoCompleteTextView"; 445 | }; 446 | name = Debug; 447 | }; 448 | 87CBE2911BD20924003A161A /* Release */ = { 449 | isa = XCBuildConfiguration; 450 | buildSettings = { 451 | BUNDLE_LOADER = "$(TEST_HOST)"; 452 | INFOPLIST_FILE = ABCAutoCompleteTextViewTests/Info.plist; 453 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 454 | PRODUCT_BUNDLE_IDENTIFIER = com.adamCooper.ABCAutoCompleteTextViewTests; 455 | PRODUCT_NAME = "$(TARGET_NAME)"; 456 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ABCAutoCompleteTextView.app/ABCAutoCompleteTextView"; 457 | }; 458 | name = Release; 459 | }; 460 | 87CBE2931BD20924003A161A /* Debug */ = { 461 | isa = XCBuildConfiguration; 462 | buildSettings = { 463 | INFOPLIST_FILE = ABCAutoCompleteTextViewUITests/Info.plist; 464 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 465 | PRODUCT_BUNDLE_IDENTIFIER = com.adamCooper.ABCAutoCompleteTextViewUITests; 466 | PRODUCT_NAME = "$(TARGET_NAME)"; 467 | TEST_TARGET_NAME = ABCAutoCompleteTextView; 468 | USES_XCTRUNNER = YES; 469 | }; 470 | name = Debug; 471 | }; 472 | 87CBE2941BD20924003A161A /* Release */ = { 473 | isa = XCBuildConfiguration; 474 | buildSettings = { 475 | INFOPLIST_FILE = ABCAutoCompleteTextViewUITests/Info.plist; 476 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 477 | PRODUCT_BUNDLE_IDENTIFIER = com.adamCooper.ABCAutoCompleteTextViewUITests; 478 | PRODUCT_NAME = "$(TARGET_NAME)"; 479 | TEST_TARGET_NAME = ABCAutoCompleteTextView; 480 | USES_XCTRUNNER = YES; 481 | }; 482 | name = Release; 483 | }; 484 | /* End XCBuildConfiguration section */ 485 | 486 | /* Begin XCConfigurationList section */ 487 | 87CBE25A1BD20924003A161A /* Build configuration list for PBXProject "ABCAutoCompleteTextView" */ = { 488 | isa = XCConfigurationList; 489 | buildConfigurations = ( 490 | 87CBE28A1BD20924003A161A /* Debug */, 491 | 87CBE28B1BD20924003A161A /* Release */, 492 | ); 493 | defaultConfigurationIsVisible = 0; 494 | defaultConfigurationName = Release; 495 | }; 496 | 87CBE28C1BD20924003A161A /* Build configuration list for PBXNativeTarget "ABCAutoCompleteTextView" */ = { 497 | isa = XCConfigurationList; 498 | buildConfigurations = ( 499 | 87CBE28D1BD20924003A161A /* Debug */, 500 | 87CBE28E1BD20924003A161A /* Release */, 501 | ); 502 | defaultConfigurationIsVisible = 0; 503 | }; 504 | 87CBE28F1BD20924003A161A /* Build configuration list for PBXNativeTarget "ABCAutoCompleteTextViewTests" */ = { 505 | isa = XCConfigurationList; 506 | buildConfigurations = ( 507 | 87CBE2901BD20924003A161A /* Debug */, 508 | 87CBE2911BD20924003A161A /* Release */, 509 | ); 510 | defaultConfigurationIsVisible = 0; 511 | }; 512 | 87CBE2921BD20924003A161A /* Build configuration list for PBXNativeTarget "ABCAutoCompleteTextViewUITests" */ = { 513 | isa = XCConfigurationList; 514 | buildConfigurations = ( 515 | 87CBE2931BD20924003A161A /* Debug */, 516 | 87CBE2941BD20924003A161A /* Release */, 517 | ); 518 | defaultConfigurationIsVisible = 0; 519 | }; 520 | /* End XCConfigurationList section */ 521 | }; 522 | rootObject = 87CBE2571BD20924003A161A /* Project object */; 523 | } 524 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextView.xcodeproj/xcuserdata/adamcooper.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextView.xcodeproj/xcuserdata/adamcooper.xcuserdatad/xcschemes/ABCAutoCompleteTextView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextView.xcodeproj/xcuserdata/adamcooper.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ABCAutoCompleteTextView.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 87CBE25E1BD20924003A161A 16 | 17 | primary 18 | 19 | 20 | 87CBE2771BD20924003A161A 21 | 22 | primary 23 | 24 | 25 | 87CBE2821BD20924003A161A 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextView/ABCAutoCompleteTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ABCAutoCompleteTextView.h 3 | // ABCAutoCompleteTextView 4 | // 5 | // Created by Adam Cooper on 10/16/15. 6 | // Copyright © 2015 Adam Cooper. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ABCAutoCompleteTextView : UITextView 12 | 13 | //Data Arrays 14 | @property (nonatomic, strong) NSArray *usernamesArray; 15 | @property (nonatomic, strong) NSArray *hashtagsArray; 16 | 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextView/ABCAutoCompleteTextView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ABCAutoCompleteTextView.m 3 | // ABCAutoCompleteTextView 4 | // 5 | // Created by Adam Cooper on 10/16/15. 6 | // Copyright © 2015 Adam Cooper. All rights reserved. 7 | // 8 | 9 | #import "ABCAutoCompleteTextView.h" 10 | 11 | @interface ABCAutoCompleteTextView () 12 | 13 | @property (nonatomic, strong) UITableView *tableView; 14 | @property (nonatomic, strong) NSMutableArray *matchingSearchResults; 15 | 16 | @end 17 | 18 | @implementation ABCAutoCompleteTextView { 19 | int _currentWordIndex; 20 | } 21 | 22 | 23 | - (instancetype)initWithCoder:(NSCoder *)coder 24 | { 25 | self = [super initWithCoder:coder]; 26 | if (self) { 27 | [self initialize]; 28 | } 29 | return self; 30 | } 31 | 32 | - (instancetype)initWithFrame:(CGRect)frame 33 | { 34 | self = [super initWithFrame:frame]; 35 | if (self) { 36 | [self initialize]; 37 | } 38 | return self; 39 | } 40 | 41 | - (void)initialize { 42 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textChanged:) name:UITextViewTextDidChangeNotification object:self]; 43 | 44 | [self setInputAccessoryView:self.tableView]; 45 | } 46 | 47 | #pragma mark - Methods 48 | 49 | - (void)textChanged:(NSNotification *)notification { 50 | [self setNeedsDisplay]; 51 | 52 | NSRange selectedRange = self.selectedRange; 53 | 54 | UITextPosition *beginning = self.beginningOfDocument; 55 | UITextPosition *start = [self positionFromPosition:beginning offset:selectedRange.location]; 56 | UITextPosition *end = [self positionFromPosition:start offset:selectedRange.length]; 57 | 58 | UITextRange* textRange = [self.tokenizer rangeEnclosingPosition:end withGranularity:UITextGranularityWord inDirection:UITextLayoutDirectionLeft]; 59 | 60 | NSString *wordTyped = [self textInRange:textRange]; 61 | 62 | //NSArray *wordsInSentence = [self.text componentsSeparatedByString:@" "];(This is Bug, according to me) 63 | NSArray *wordsInSentence = [self.text componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; 64 | 65 | int indexInSavedArray = 0; 66 | 67 | for (NSString *string in wordsInSentence) { 68 | 69 | NSRange textRange = [self.text rangeOfString:string]; 70 | 71 | if (selectedRange.location >= textRange.location && selectedRange.location <= (textRange.location + textRange.length) ) { 72 | NSLog(@"STRING: %@", string); 73 | 74 | if ([string hasPrefix:@"@"]) { 75 | NSLog(@"USER: %@", wordTyped); 76 | [self refreshSearchResultsWithUsername:string]; 77 | _currentWordIndex = indexInSavedArray; 78 | } else if ([string hasPrefix:@"#"]) { 79 | NSLog(@"Hashtag: %@", wordTyped); 80 | [self refreshSearchResultsWithHashtag:string]; 81 | _currentWordIndex = indexInSavedArray; 82 | } else { 83 | self.matchingSearchResults = [NSMutableArray array]; 84 | [self.tableView reloadData]; 85 | } 86 | } 87 | indexInSavedArray++; 88 | } 89 | } 90 | 91 | -(void)refreshSearchResultsWithHashtag: (NSString *)hashtag { 92 | 93 | if ([hashtag hasPrefix:@"#"]) { 94 | hashtag = [hashtag substringFromIndex:1]; 95 | } 96 | 97 | NSArray *array = nil; 98 | 99 | NSMutableArray *formattedResults = [NSMutableArray array]; 100 | 101 | if (hashtag.length > 0) { 102 | array = [self.hashtagsArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"self BEGINSWITH[c] %@", hashtag]]; 103 | } 104 | 105 | for (NSString *hashtag in array) { 106 | NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; 107 | [dictionary setObject:hashtag forKey:@"text"]; 108 | [dictionary setObject:@"hashtag" forKey:@"type"]; 109 | [formattedResults addObject:dictionary]; 110 | } 111 | 112 | self.matchingSearchResults = formattedResults; 113 | [self.tableView reloadData]; 114 | 115 | } 116 | 117 | -(void)refreshSearchResultsWithUsername: (NSString *)username { 118 | 119 | if ([username hasPrefix:@"@"]) { 120 | username = [username substringFromIndex:1]; 121 | } 122 | 123 | NSArray *array = nil; 124 | NSMutableArray *formattedResults = [NSMutableArray array]; 125 | 126 | if (username.length > 0) { 127 | array = [self.usernamesArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"self BEGINSWITH[c] %@", username]]; 128 | } 129 | 130 | for (NSString *username in array) { 131 | NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; 132 | [dictionary setObject:username forKey:@"text"]; 133 | [dictionary setObject:@"username" forKey:@"type"]; 134 | [formattedResults addObject:dictionary]; 135 | } 136 | 137 | self.matchingSearchResults = formattedResults; 138 | [self.tableView reloadData]; 139 | } 140 | 141 | #pragma mark - UITableView Delegate Methods 142 | 143 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 144 | 145 | NSDictionary *chosenDictionary = [self.matchingSearchResults objectAtIndex:indexPath.row]; 146 | NSString *chosenWord = [chosenDictionary objectForKey:@"text"]; 147 | 148 | NSMutableArray *array = [NSMutableArray arrayWithArray:[self.text componentsSeparatedByString:@" "]]; 149 | 150 | NSString *indexWord = [array objectAtIndex:_currentWordIndex]; 151 | 152 | 153 | if ([indexWord hasPrefix:@"@"]) { 154 | 155 | [array replaceObjectAtIndex:_currentWordIndex withObject:[NSString stringWithFormat:@"@%@ ",chosenWord]]; 156 | 157 | } else if ([indexWord hasPrefix:@"#"]) { 158 | 159 | [array replaceObjectAtIndex:_currentWordIndex withObject:[NSString stringWithFormat:@"#%@ ",chosenWord]]; 160 | } 161 | 162 | NSString *totalString = [array componentsJoinedByString:@" "]; 163 | [self setText:totalString]; 164 | self.matchingSearchResults = nil; 165 | [self.tableView reloadData]; 166 | } 167 | 168 | 169 | #pragma mark - UITableView Datasource Methods 170 | 171 | -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath 172 | { 173 | if ([cell respondsToSelector:@selector(setSeparatorInset:)]) { 174 | [cell setSeparatorInset:UIEdgeInsetsZero]; 175 | } 176 | 177 | if ([cell respondsToSelector:@selector(setLayoutMargins:)]) { 178 | [cell setLayoutMargins:UIEdgeInsetsZero]; 179 | } 180 | } 181 | 182 | -(void)viewDidLayoutSubviews 183 | { 184 | if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) { 185 | [self.tableView setSeparatorInset:UIEdgeInsetsZero]; 186 | } 187 | 188 | if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)]) { 189 | [self.tableView setLayoutMargins:UIEdgeInsetsZero]; 190 | } 191 | } 192 | 193 | -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 194 | return 1; 195 | } 196 | 197 | -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 198 | return self.matchingSearchResults.count; 199 | } 200 | 201 | -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 202 | 203 | NSDictionary *chosenDictionary = [self.matchingSearchResults objectAtIndex:indexPath.row]; 204 | NSString *word = [chosenDictionary objectForKey:@"text"]; 205 | NSString *type = [chosenDictionary objectForKey:@"type"]; 206 | 207 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"]; 208 | 209 | if (!cell) { 210 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"]; 211 | } 212 | 213 | if ([type isEqualToString:@"hashtag"]) { 214 | word = [NSString stringWithFormat:@"#%@",word]; 215 | } else { 216 | word = [NSString stringWithFormat:@"@%@",word]; 217 | } 218 | 219 | [cell.textLabel setText:word]; 220 | cell.transform = CGAffineTransformMakeRotation(M_PI); 221 | [cell setBackgroundColor:[UIColor whiteColor]]; 222 | 223 | return cell; 224 | } 225 | 226 | 227 | #pragma mark - Properties 228 | 229 | -(NSMutableArray *)matchingSearchResults { 230 | if (!_matchingSearchResults) { 231 | _matchingSearchResults = [NSMutableArray array]; 232 | } 233 | return _matchingSearchResults; 234 | } 235 | 236 | -(UITableView *)tableView { 237 | if (!_tableView) { 238 | _tableView= [[UITableView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 88) style:UITableViewStylePlain]; 239 | [_tableView setDelegate:self]; 240 | [_tableView setDataSource:self]; 241 | [_tableView setTransform:CGAffineTransformMakeRotation(-M_PI)]; 242 | [_tableView setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]]; 243 | [_tableView setBackgroundColor:[UIColor clearColor]]; 244 | } 245 | return _tableView; 246 | } 247 | 248 | 249 | 250 | 251 | 252 | 253 | @end 254 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ABCAutoCompleteTextView 4 | // 5 | // Created by Adam Cooper on 10/16/15. 6 | // Copyright © 2015 Adam Cooper. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ABCAutoCompleteTextView 4 | // 5 | // Created by Adam Cooper on 10/16/15. 6 | // Copyright © 2015 Adam Cooper. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | 22 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 23 | [self.window makeKeyAndVisible]; 24 | 25 | ViewController *exampleViewController = [[ViewController alloc] init]; 26 | UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:exampleViewController]; 27 | [navigationController.navigationBar setTranslucent:NO]; 28 | [navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:0.098 green:0.463 blue:0.824 alpha:1.000]]; 29 | [navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: 30 | [UIColor whiteColor], NSForegroundColorAttributeName, 31 | nil]]; 32 | self.window.rootViewController = navigationController; 33 | 34 | 35 | return YES; 36 | } 37 | 38 | - (void)applicationWillResignActive:(UIApplication *)application { 39 | // 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. 40 | // 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. 41 | } 42 | 43 | - (void)applicationDidEnterBackground:(UIApplication *)application { 44 | // 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. 45 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 46 | } 47 | 48 | - (void)applicationWillEnterForeground:(UIApplication *)application { 49 | // 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. 50 | } 51 | 52 | - (void)applicationDidBecomeActive:(UIApplication *)application { 53 | // 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. 54 | } 55 | 56 | - (void)applicationWillTerminate:(UIApplication *)application { 57 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextView/Assets.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" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /ABCAutoCompleteTextView/Base.lproj/LaunchScreen.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 | 27 | 28 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextView/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ABCAutoCompleteTextView 4 | // 5 | // Created by Adam Cooper on 10/16/15. 6 | // Copyright © 2015 Adam Cooper. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextView/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ABCAutoCompleteTextView 4 | // 5 | // Created by Adam Cooper on 10/16/15. 6 | // Copyright © 2015 Adam Cooper. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "ABCAutoCompleteTextView.h" 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | [self setTitle:@"ABCAutoCompleteTextView"]; 21 | 22 | 23 | [self.view setBackgroundColor:[UIColor colorWithRed:0.098 green:0.463 blue:0.824 alpha:1.000]]; 24 | 25 | NSArray *sampleUsernames = @[ @"adambco", @"muradosmann", @"hecktictravels", @"bipolaire61", @"fourjandals", @"yeatoeh", @"packsandbunks", @"sharolyn_w", @"1step2theleft", @"nineteenfiftyone", @"uncornered_market", @"pataexplorer", @"wildjunket", @"drewkelly", @"nomadicnotes", @"chmlh", @"natgeotraveler", @"ahmadziya", @"beersandbeans", @"bradtully", @"legalnomads", @"theodorekaye", @"theblondegypsy", @"_mihi", @"adventurouskate", @"adanvelez", @"theplanetd", @"fosterhunting", @"pausethemoment", @"seattlestravels", @"everythingeverywhere", @"landingstanding", @"MatadorNetwork", @"hostelbookers", @"traveling9to5"]; 26 | 27 | NSArray *sampleHashtags = @[ @"fashion", @"friends", @"smile", @"like4like", @"instamood", @"nofilter", @"family", @"amazing", @"style", @"sun", @"follow4follow", @"tflers", @"beach", @"lol", @"hair", @"followforfollow", @"iphoneonly", @"cool", @"webstagram", @"girls", @"iphonesia", @"funny", @"tweegram", @"my", @"black", @"igdaily", @"instacool", @"instagramhub", @"makeup", @"awesome", @"bored", @"nice", @"instafollow", @"eyes", @"all_shots"]; 28 | 29 | ABCAutoCompleteTextView *autoCompleteTextView = [[ABCAutoCompleteTextView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 120)]; 30 | [autoCompleteTextView setUsernamesArray:sampleUsernames]; 31 | [autoCompleteTextView setHashtagsArray:sampleHashtags]; 32 | [autoCompleteTextView setKeyboardType:UIKeyboardTypeTwitter]; 33 | [self.view addSubview:autoCompleteTextView]; 34 | 35 | [autoCompleteTextView becomeFirstResponder]; 36 | } 37 | 38 | - (void)didReceiveMemoryWarning { 39 | [super didReceiveMemoryWarning]; 40 | // Dispose of any resources that can be recreated. 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ABCAutoCompleteTextView 4 | // 5 | // Created by Adam Cooper on 10/16/15. 6 | // Copyright © 2015 Adam Cooper. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextViewTests/ABCAutoCompleteTextViewTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ABCAutoCompleteTextViewTests.m 3 | // ABCAutoCompleteTextViewTests 4 | // 5 | // Created by Adam Cooper on 10/16/15. 6 | // Copyright © 2015 Adam Cooper. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ABCAutoCompleteTextViewTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ABCAutoCompleteTextViewTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextViewTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextViewUITests/ABCAutoCompleteTextViewUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ABCAutoCompleteTextViewUITests.m 3 | // ABCAutoCompleteTextViewUITests 4 | // 5 | // Created by Adam Cooper on 10/16/15. 6 | // Copyright © 2015 Adam Cooper. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ABCAutoCompleteTextViewUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ABCAutoCompleteTextViewUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /ABCAutoCompleteTextViewUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ABCAutoCompleteTextView 2 | A subclass of UITextView that allows for autocompletion of hashtags and username mentions. 3 | --------------------------------------------------------------------------------