From 52f4c31d05a52f1a0a6337e286e63f29f561e533 Mon Sep 17 00:00:00 2001 From: alexruperez Date: Fri, 11 Sep 2015 10:15:14 +0200 Subject: [PATCH] Release 0.1.0 --- ARAutocompleteTextView.podspec | 4 +- .../project.pbxproj | 36 +- .../ARAutocompleteManager.m | 2 +- .../project.pbxproj | 165 ++------- .../contents.xcworkspacedata | 0 ...tViewAutocompletionExampleSwiftTests.swift | 36 -- .../Info.plist | 24 -- .../AppDelegate.swift | 0 .../Base.lproj/LaunchScreen.xib | 0 .../Base.lproj/Main.storyboard | 0 .../Classes/ARAutocompleteManager.h | 21 -- .../Classes/ARAutocompleteManager.m | 326 ------------------ .../Classes/ARAutocompleteTextView.h | 71 ---- .../Classes/ARAutocompleteTextView.m | 304 ---------------- .../Classes/AREmailAutocompleteTextView.h | 15 - .../Classes/AREmailAutocompleteTextView.m | 79 ----- .../Classes/ARTwitterAutocompleteTextView.h | 15 - .../Classes/ARTwitterAutocompleteTextView.m | 86 ----- .../AppIcon.appiconset/Contents.json | 0 .../Info.plist | 0 .../ViewController.swift | 0 Classes/ARTwitterAutocompleteTextView.m | 2 +- README.md | 9 +- 23 files changed, 53 insertions(+), 1142 deletions(-) rename {ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift.xcodeproj => ARTextViewAutocompletionExampleSwift.xcodeproj}/project.pbxproj (67%) rename {ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift.xcodeproj => ARTextViewAutocompletionExampleSwift.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (100%) delete mode 100644 ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwiftTests/ARTextViewAutocompletionExampleSwiftTests.swift delete mode 100644 ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwiftTests/Info.plist rename ARTextViewAutocompletionExampleSwift/{ARTextViewAutocompletionExampleSwift => }/AppDelegate.swift (100%) rename ARTextViewAutocompletionExampleSwift/{ARTextViewAutocompletionExampleSwift => }/Base.lproj/LaunchScreen.xib (100%) rename ARTextViewAutocompletionExampleSwift/{ARTextViewAutocompletionExampleSwift => }/Base.lproj/Main.storyboard (100%) delete mode 100755 ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteManager.h delete mode 100755 ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteManager.m delete mode 100755 ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteTextView.h delete mode 100755 ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteTextView.m delete mode 100755 ARTextViewAutocompletionExampleSwift/Classes/AREmailAutocompleteTextView.h delete mode 100755 ARTextViewAutocompletionExampleSwift/Classes/AREmailAutocompleteTextView.m delete mode 100755 ARTextViewAutocompletionExampleSwift/Classes/ARTwitterAutocompleteTextView.h delete mode 100755 ARTextViewAutocompletionExampleSwift/Classes/ARTwitterAutocompleteTextView.m rename ARTextViewAutocompletionExampleSwift/{ARTextViewAutocompletionExampleSwift => }/Images.xcassets/AppIcon.appiconset/Contents.json (100%) rename ARTextViewAutocompletionExampleSwift/{ARTextViewAutocompletionExampleSwift => }/Info.plist (100%) rename ARTextViewAutocompletionExampleSwift/{ARTextViewAutocompletionExampleSwift => }/ViewController.swift (100%) diff --git a/ARAutocompleteTextView.podspec b/ARAutocompleteTextView.podspec index 9d26495..2e5b127 100644 --- a/ARAutocompleteTextView.podspec +++ b/ARAutocompleteTextView.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'ARAutocompleteTextView' - s.version = '0.0.1' + s.version = '0.1.0' s.summary = "Subclass of UITextView that automatically displays text suggestions in real-time." s.homepage = 'https://github.com/alexruperez/ARAutocompleteTextView' s.screenshots = 'https://raw.githubusercontent.com/alexruperez/ARAutocompleteTextView/master/ARTextViewAutocompletion.png' @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.author = { "alexruperez" => "contact@alexruperez.com" } s.social_media_url = 'https://twitter.com/alexruperez' s.platform = :ios - s.source = { :git => 'https://github.com/alexruperez/ARAutocompleteTextView.git', :tag => '0.0.1' } + s.source = { :git => 'https://github.com/alexruperez/ARAutocompleteTextView.git', :tag => s.version.to_s } s.source_files = 'ARAutocompleteTextView', "Classes/*.{h,m}" s.requires_arc = true end \ No newline at end of file diff --git a/ARTextViewAutocompletionExample.xcodeproj/project.pbxproj b/ARTextViewAutocompletionExample.xcodeproj/project.pbxproj index 2e5e013..e72fbf8 100755 --- a/ARTextViewAutocompletionExample.xcodeproj/project.pbxproj +++ b/ARTextViewAutocompletionExample.xcodeproj/project.pbxproj @@ -10,9 +10,6 @@ 8DF4A805168B7C610025E16D /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DF4A804168B7C610025E16D /* UIKit.framework */; }; 8DF4A807168B7C610025E16D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DF4A806168B7C610025E16D /* Foundation.framework */; }; 8DF4A809168B7C610025E16D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DF4A808168B7C610025E16D /* CoreGraphics.framework */; }; - D547716618069AED0065533A /* ARTwitterAutocompleteTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D547715D18069AED0065533A /* ARTwitterAutocompleteTextView.m */; }; - D547716718069AED0065533A /* ARAutocompleteTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D547715F18069AED0065533A /* ARAutocompleteTextView.m */; }; - D547716818069AED0065533A /* AREmailAutocompleteTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D547716118069AED0065533A /* AREmailAutocompleteTextView.m */; }; D547717618069B440065533A /* ARAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D547717018069B440065533A /* ARAppDelegate.m */; }; D547717718069B440065533A /* ARAutocompleteManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D547717218069B440065533A /* ARAutocompleteManager.m */; }; D547717818069B440065533A /* ARSampleFieldsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D547717418069B440065533A /* ARSampleFieldsTableViewController.m */; }; @@ -21,6 +18,9 @@ D547718218069B7E0065533A /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = D547717D18069B7E0065533A /* Default.png */; }; D547718318069B7E0065533A /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D547717E18069B7E0065533A /* Default@2x.png */; }; D547718418069B7E0065533A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D547717F18069B7E0065533A /* main.m */; }; + D59957701BA2BD020089C1AB /* ARAutocompleteTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D599576B1BA2BD020089C1AB /* ARAutocompleteTextView.m */; }; + D59957711BA2BD020089C1AB /* AREmailAutocompleteTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D599576D1BA2BD020089C1AB /* AREmailAutocompleteTextView.m */; }; + D59957721BA2BD020089C1AB /* ARTwitterAutocompleteTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D599576F1BA2BD020089C1AB /* ARTwitterAutocompleteTextView.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -28,12 +28,6 @@ 8DF4A804168B7C610025E16D /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 8DF4A806168B7C610025E16D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 8DF4A808168B7C610025E16D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - D547715C18069AED0065533A /* ARTwitterAutocompleteTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARTwitterAutocompleteTextView.h; path = Classes/ARTwitterAutocompleteTextView.h; sourceTree = SOURCE_ROOT; }; - D547715D18069AED0065533A /* ARTwitterAutocompleteTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ARTwitterAutocompleteTextView.m; path = Classes/ARTwitterAutocompleteTextView.m; sourceTree = SOURCE_ROOT; }; - D547715E18069AED0065533A /* ARAutocompleteTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARAutocompleteTextView.h; path = Classes/ARAutocompleteTextView.h; sourceTree = SOURCE_ROOT; }; - D547715F18069AED0065533A /* ARAutocompleteTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ARAutocompleteTextView.m; path = Classes/ARAutocompleteTextView.m; sourceTree = SOURCE_ROOT; }; - D547716018069AED0065533A /* AREmailAutocompleteTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AREmailAutocompleteTextView.h; path = Classes/AREmailAutocompleteTextView.h; sourceTree = SOURCE_ROOT; }; - D547716118069AED0065533A /* AREmailAutocompleteTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AREmailAutocompleteTextView.m; path = Classes/AREmailAutocompleteTextView.m; sourceTree = SOURCE_ROOT; }; D547716F18069B440065533A /* ARAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARAppDelegate.h; path = ARTextViewAutocompletionExample/ARAppDelegate.h; sourceTree = SOURCE_ROOT; }; D547717018069B440065533A /* ARAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ARAppDelegate.m; path = ARTextViewAutocompletionExample/ARAppDelegate.m; sourceTree = SOURCE_ROOT; }; D547717118069B440065533A /* ARAutocompleteManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARAutocompleteManager.h; path = ARTextViewAutocompletionExample/ARAutocompleteManager.h; sourceTree = SOURCE_ROOT; }; @@ -47,6 +41,12 @@ D547717D18069B7E0065533A /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = ARTextViewAutocompletionExample/Default.png; sourceTree = SOURCE_ROOT; }; D547717E18069B7E0065533A /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "ARTextViewAutocompletionExample/Default@2x.png"; sourceTree = SOURCE_ROOT; }; D547717F18069B7E0065533A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ARTextViewAutocompletionExample/main.m; sourceTree = SOURCE_ROOT; }; + D599576A1BA2BD020089C1AB /* ARAutocompleteTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARAutocompleteTextView.h; path = Classes/ARAutocompleteTextView.h; sourceTree = SOURCE_ROOT; }; + D599576B1BA2BD020089C1AB /* ARAutocompleteTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ARAutocompleteTextView.m; path = Classes/ARAutocompleteTextView.m; sourceTree = SOURCE_ROOT; }; + D599576C1BA2BD020089C1AB /* AREmailAutocompleteTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AREmailAutocompleteTextView.h; path = Classes/AREmailAutocompleteTextView.h; sourceTree = SOURCE_ROOT; }; + D599576D1BA2BD020089C1AB /* AREmailAutocompleteTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AREmailAutocompleteTextView.m; path = Classes/AREmailAutocompleteTextView.m; sourceTree = SOURCE_ROOT; }; + D599576E1BA2BD020089C1AB /* ARTwitterAutocompleteTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARTwitterAutocompleteTextView.h; path = Classes/ARTwitterAutocompleteTextView.h; sourceTree = SOURCE_ROOT; }; + D599576F1BA2BD020089C1AB /* ARTwitterAutocompleteTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ARTwitterAutocompleteTextView.m; path = Classes/ARTwitterAutocompleteTextView.m; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -123,12 +123,12 @@ 8DF4A83A168B7CFC0025E16D /* Core */ = { isa = PBXGroup; children = ( - D547715C18069AED0065533A /* ARTwitterAutocompleteTextView.h */, - D547715D18069AED0065533A /* ARTwitterAutocompleteTextView.m */, - D547715E18069AED0065533A /* ARAutocompleteTextView.h */, - D547715F18069AED0065533A /* ARAutocompleteTextView.m */, - D547716018069AED0065533A /* AREmailAutocompleteTextView.h */, - D547716118069AED0065533A /* AREmailAutocompleteTextView.m */, + D599576A1BA2BD020089C1AB /* ARAutocompleteTextView.h */, + D599576B1BA2BD020089C1AB /* ARAutocompleteTextView.m */, + D599576C1BA2BD020089C1AB /* AREmailAutocompleteTextView.h */, + D599576D1BA2BD020089C1AB /* AREmailAutocompleteTextView.m */, + D599576E1BA2BD020089C1AB /* ARTwitterAutocompleteTextView.h */, + D599576F1BA2BD020089C1AB /* ARTwitterAutocompleteTextView.m */, ); name = Core; path = HTTextFieldAutocompletionExample; @@ -200,13 +200,13 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D547716618069AED0065533A /* ARTwitterAutocompleteTextView.m in Sources */, - D547716718069AED0065533A /* ARAutocompleteTextView.m in Sources */, - D547716818069AED0065533A /* AREmailAutocompleteTextView.m in Sources */, + D59957701BA2BD020089C1AB /* ARAutocompleteTextView.m in Sources */, D547717618069B440065533A /* ARAppDelegate.m in Sources */, + D59957711BA2BD020089C1AB /* AREmailAutocompleteTextView.m in Sources */, D547717718069B440065533A /* ARAutocompleteManager.m in Sources */, D547717818069B440065533A /* ARSampleFieldsTableViewController.m in Sources */, D547718418069B7E0065533A /* main.m in Sources */, + D59957721BA2BD020089C1AB /* ARTwitterAutocompleteTextView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/ARTextViewAutocompletionExample/ARAutocompleteManager.m b/ARTextViewAutocompletionExample/ARAutocompleteManager.m index d4978d4..b715582 100755 --- a/ARTextViewAutocompletionExample/ARAutocompleteManager.m +++ b/ARTextViewAutocompletionExample/ARAutocompleteManager.m @@ -187,7 +187,7 @@ - (NSString *)textView:(ARAutocompleteTextView *)textView @"temple.edu", @"cinci.rr.com", @"alexruperez.com", - @"gigigo.com"]; + @"feverup.com"]; }); // Check that text field contains an @ diff --git a/ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift.xcodeproj/project.pbxproj b/ARTextViewAutocompletionExampleSwift.xcodeproj/project.pbxproj similarity index 67% rename from ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift.xcodeproj/project.pbxproj rename to ARTextViewAutocompletionExampleSwift.xcodeproj/project.pbxproj index 9807d5b..da22aa8 100644 --- a/ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift.xcodeproj/project.pbxproj +++ b/ARTextViewAutocompletionExampleSwift.xcodeproj/project.pbxproj @@ -12,23 +12,12 @@ C2B3C4011BA2671B002344AE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C2B3C3FF1BA2671B002344AE /* Main.storyboard */; }; C2B3C4031BA2671B002344AE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C2B3C4021BA2671B002344AE /* Images.xcassets */; }; C2B3C4061BA2671B002344AE /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C2B3C4041BA2671B002344AE /* LaunchScreen.xib */; }; - C2B3C4121BA2671B002344AE /* ARTextViewAutocompletionExampleSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2B3C4111BA2671B002344AE /* ARTextViewAutocompletionExampleSwiftTests.swift */; }; - C2B3C4221BA26730002344AE /* ARAutocompleteTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = C2B3C41D1BA26730002344AE /* ARAutocompleteTextView.m */; }; - C2B3C4231BA26730002344AE /* AREmailAutocompleteTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = C2B3C41F1BA26730002344AE /* AREmailAutocompleteTextView.m */; }; - C2B3C4241BA26730002344AE /* ARTwitterAutocompleteTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = C2B3C4211BA26730002344AE /* ARTwitterAutocompleteTextView.m */; }; - C2B3C42D1BA26843002344AE /* ARAutocompleteManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C2B3C42C1BA26843002344AE /* ARAutocompleteManager.m */; }; + D59957791BA2BD450089C1AB /* ARAutocompleteTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D59957741BA2BD450089C1AB /* ARAutocompleteTextView.m */; }; + D599577A1BA2BD450089C1AB /* AREmailAutocompleteTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D59957761BA2BD450089C1AB /* AREmailAutocompleteTextView.m */; }; + D599577B1BA2BD450089C1AB /* ARTwitterAutocompleteTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D59957781BA2BD450089C1AB /* ARTwitterAutocompleteTextView.m */; }; + D599577F1BA2BD890089C1AB /* ARAutocompleteManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D599577E1BA2BD890089C1AB /* ARAutocompleteManager.m */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - C2B3C40C1BA2671B002344AE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C2B3C3EE1BA2671B002344AE /* Project object */; - proxyType = 1; - remoteGlobalIDString = C2B3C3F51BA2671B002344AE; - remoteInfo = ARTextViewAutocompletionExampleSwift; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXFileReference section */ C2B3C3F61BA2671B002344AE /* ARTextViewAutocompletionExampleSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ARTextViewAutocompletionExampleSwift.app; sourceTree = BUILT_PRODUCTS_DIR; }; C2B3C3FA1BA2671B002344AE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -37,18 +26,17 @@ C2B3C4001BA2671B002344AE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; C2B3C4021BA2671B002344AE /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; C2B3C4051BA2671B002344AE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - C2B3C40B1BA2671B002344AE /* ARTextViewAutocompletionExampleSwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ARTextViewAutocompletionExampleSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; C2B3C4101BA2671B002344AE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C2B3C4111BA2671B002344AE /* ARTextViewAutocompletionExampleSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ARTextViewAutocompletionExampleSwiftTests.swift; sourceTree = ""; }; - C2B3C41C1BA26730002344AE /* ARAutocompleteTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARAutocompleteTextView.h; sourceTree = ""; }; - C2B3C41D1BA26730002344AE /* ARAutocompleteTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARAutocompleteTextView.m; sourceTree = ""; }; - C2B3C41E1BA26730002344AE /* AREmailAutocompleteTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AREmailAutocompleteTextView.h; sourceTree = ""; }; - C2B3C41F1BA26730002344AE /* AREmailAutocompleteTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AREmailAutocompleteTextView.m; sourceTree = ""; }; - C2B3C4201BA26730002344AE /* ARTwitterAutocompleteTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTwitterAutocompleteTextView.h; sourceTree = ""; }; - C2B3C4211BA26730002344AE /* ARTwitterAutocompleteTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTwitterAutocompleteTextView.m; sourceTree = ""; }; - C2B3C4281BA267AD002344AE /* ARTextViewAutocompletionExampleSwift-bridging-header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ARTextViewAutocompletionExampleSwift-bridging-header.h"; sourceTree = ""; }; - C2B3C42B1BA26843002344AE /* ARAutocompleteManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARAutocompleteManager.h; sourceTree = ""; }; - C2B3C42C1BA26843002344AE /* ARAutocompleteManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARAutocompleteManager.m; sourceTree = ""; }; + D59957731BA2BD450089C1AB /* ARAutocompleteTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARAutocompleteTextView.h; sourceTree = ""; }; + D59957741BA2BD450089C1AB /* ARAutocompleteTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARAutocompleteTextView.m; sourceTree = ""; }; + D59957751BA2BD450089C1AB /* AREmailAutocompleteTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AREmailAutocompleteTextView.h; sourceTree = ""; }; + D59957761BA2BD450089C1AB /* AREmailAutocompleteTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AREmailAutocompleteTextView.m; sourceTree = ""; }; + D59957771BA2BD450089C1AB /* ARTwitterAutocompleteTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTwitterAutocompleteTextView.h; sourceTree = ""; }; + D59957781BA2BD450089C1AB /* ARTwitterAutocompleteTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTwitterAutocompleteTextView.m; sourceTree = ""; }; + D599577C1BA2BD4F0089C1AB /* ARTextViewAutocompletionExampleSwift-bridging-header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ARTextViewAutocompletionExampleSwift-bridging-header.h"; sourceTree = ""; }; + D599577D1BA2BD890089C1AB /* ARAutocompleteManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARAutocompleteManager.h; path = ARTextViewAutocompletionExample/ARAutocompleteManager.h; sourceTree = SOURCE_ROOT; }; + D599577E1BA2BD890089C1AB /* ARAutocompleteManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ARAutocompleteManager.m; path = ARTextViewAutocompletionExample/ARAutocompleteManager.m; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -59,20 +47,12 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - C2B3C4081BA2671B002344AE /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ C2B3C3ED1BA2671B002344AE = { isa = PBXGroup; children = ( - C2B3C4281BA267AD002344AE /* ARTextViewAutocompletionExampleSwift-bridging-header.h */, C2B3C41B1BA26730002344AE /* Classes */, C2B3C3F81BA2671B002344AE /* ARTextViewAutocompletionExampleSwift */, C2B3C40E1BA2671B002344AE /* ARTextViewAutocompletionExampleSwiftTests */, @@ -84,7 +64,6 @@ isa = PBXGroup; children = ( C2B3C3F61BA2671B002344AE /* ARTextViewAutocompletionExampleSwift.app */, - C2B3C40B1BA2671B002344AE /* ARTextViewAutocompletionExampleSwiftTests.xctest */, ); name = Products; sourceTree = ""; @@ -92,6 +71,9 @@ C2B3C3F81BA2671B002344AE /* ARTextViewAutocompletionExampleSwift */ = { isa = PBXGroup; children = ( + D599577D1BA2BD890089C1AB /* ARAutocompleteManager.h */, + D599577E1BA2BD890089C1AB /* ARAutocompleteManager.m */, + D599577C1BA2BD4F0089C1AB /* ARTextViewAutocompletionExampleSwift-bridging-header.h */, C2B3C3FB1BA2671B002344AE /* AppDelegate.swift */, C2B3C3FD1BA2671B002344AE /* ViewController.swift */, C2B3C3FF1BA2671B002344AE /* Main.storyboard */, @@ -130,14 +112,12 @@ C2B3C41B1BA26730002344AE /* Classes */ = { isa = PBXGroup; children = ( - C2B3C41C1BA26730002344AE /* ARAutocompleteTextView.h */, - C2B3C41D1BA26730002344AE /* ARAutocompleteTextView.m */, - C2B3C41E1BA26730002344AE /* AREmailAutocompleteTextView.h */, - C2B3C41F1BA26730002344AE /* AREmailAutocompleteTextView.m */, - C2B3C4201BA26730002344AE /* ARTwitterAutocompleteTextView.h */, - C2B3C4211BA26730002344AE /* ARTwitterAutocompleteTextView.m */, - C2B3C42B1BA26843002344AE /* ARAutocompleteManager.h */, - C2B3C42C1BA26843002344AE /* ARAutocompleteManager.m */, + D59957731BA2BD450089C1AB /* ARAutocompleteTextView.h */, + D59957741BA2BD450089C1AB /* ARAutocompleteTextView.m */, + D59957751BA2BD450089C1AB /* AREmailAutocompleteTextView.h */, + D59957761BA2BD450089C1AB /* AREmailAutocompleteTextView.m */, + D59957771BA2BD450089C1AB /* ARTwitterAutocompleteTextView.h */, + D59957781BA2BD450089C1AB /* ARTwitterAutocompleteTextView.m */, ); path = Classes; sourceTree = ""; @@ -162,24 +142,6 @@ productReference = C2B3C3F61BA2671B002344AE /* ARTextViewAutocompletionExampleSwift.app */; productType = "com.apple.product-type.application"; }; - C2B3C40A1BA2671B002344AE /* ARTextViewAutocompletionExampleSwiftTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = C2B3C4181BA2671B002344AE /* Build configuration list for PBXNativeTarget "ARTextViewAutocompletionExampleSwiftTests" */; - buildPhases = ( - C2B3C4071BA2671B002344AE /* Sources */, - C2B3C4081BA2671B002344AE /* Frameworks */, - C2B3C4091BA2671B002344AE /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - C2B3C40D1BA2671B002344AE /* PBXTargetDependency */, - ); - name = ARTextViewAutocompletionExampleSwiftTests; - productName = ARTextViewAutocompletionExampleSwiftTests; - productReference = C2B3C40B1BA2671B002344AE /* ARTextViewAutocompletionExampleSwiftTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -193,10 +155,6 @@ C2B3C3F51BA2671B002344AE = { CreatedOnToolsVersion = 6.4; }; - C2B3C40A1BA2671B002344AE = { - CreatedOnToolsVersion = 6.4; - TestTargetID = C2B3C3F51BA2671B002344AE; - }; }; }; buildConfigurationList = C2B3C3F11BA2671B002344AE /* Build configuration list for PBXProject "ARTextViewAutocompletionExampleSwift" */; @@ -213,7 +171,6 @@ projectRoot = ""; targets = ( C2B3C3F51BA2671B002344AE /* ARTextViewAutocompletionExampleSwift */, - C2B3C40A1BA2671B002344AE /* ARTextViewAutocompletionExampleSwiftTests */, ); }; /* End PBXProject section */ @@ -229,13 +186,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - C2B3C4091BA2671B002344AE /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -244,32 +194,16 @@ buildActionMask = 2147483647; files = ( C2B3C3FE1BA2671B002344AE /* ViewController.swift in Sources */, - C2B3C4231BA26730002344AE /* AREmailAutocompleteTextView.m in Sources */, - C2B3C42D1BA26843002344AE /* ARAutocompleteManager.m in Sources */, - C2B3C4221BA26730002344AE /* ARAutocompleteTextView.m in Sources */, - C2B3C4241BA26730002344AE /* ARTwitterAutocompleteTextView.m in Sources */, + D599577A1BA2BD450089C1AB /* AREmailAutocompleteTextView.m in Sources */, + D599577F1BA2BD890089C1AB /* ARAutocompleteManager.m in Sources */, + D59957791BA2BD450089C1AB /* ARAutocompleteTextView.m in Sources */, + D599577B1BA2BD450089C1AB /* ARTwitterAutocompleteTextView.m in Sources */, C2B3C3FC1BA2671B002344AE /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - C2B3C4071BA2671B002344AE /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C2B3C4121BA2671B002344AE /* ARTextViewAutocompletionExampleSwiftTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - C2B3C40D1BA2671B002344AE /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = C2B3C3F51BA2671B002344AE /* ARTextViewAutocompletionExampleSwift */; - targetProxy = C2B3C40C1BA2671B002344AE /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ C2B3C3FF1BA2671B002344AE /* Main.storyboard */ = { isa = PBXVariantGroup; @@ -378,7 +312,7 @@ INFOPLIST_FILE = ARTextViewAutocompletionExampleSwift/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "ARTextViewAutocompletionExampleSwift-bridging-header.h"; + SWIFT_OBJC_BRIDGING_HEADER = "ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift-bridging-header.h"; }; name = Debug; }; @@ -389,41 +323,7 @@ INFOPLIST_FILE = ARTextViewAutocompletionExampleSwift/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "ARTextViewAutocompletionExampleSwift-bridging-header.h"; - }; - name = Release; - }; - C2B3C4191BA2671B002344AE /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = ARTextViewAutocompletionExampleSwiftTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ARTextViewAutocompletionExampleSwift.app/ARTextViewAutocompletionExampleSwift"; - }; - name = Debug; - }; - C2B3C41A1BA2671B002344AE /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - INFOPLIST_FILE = ARTextViewAutocompletionExampleSwiftTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ARTextViewAutocompletionExampleSwift.app/ARTextViewAutocompletionExampleSwift"; + SWIFT_OBJC_BRIDGING_HEADER = "ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift-bridging-header.h"; }; name = Release; }; @@ -448,15 +348,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C2B3C4181BA2671B002344AE /* Build configuration list for PBXNativeTarget "ARTextViewAutocompletionExampleSwiftTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C2B3C4191BA2671B002344AE /* Debug */, - C2B3C41A1BA2671B002344AE /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ }; rootObject = C2B3C3EE1BA2671B002344AE /* Project object */; diff --git a/ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ARTextViewAutocompletionExampleSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to ARTextViewAutocompletionExampleSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwiftTests/ARTextViewAutocompletionExampleSwiftTests.swift b/ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwiftTests/ARTextViewAutocompletionExampleSwiftTests.swift deleted file mode 100644 index f42d5c8..0000000 --- a/ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwiftTests/ARTextViewAutocompletionExampleSwiftTests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// ARTextViewAutocompletionExampleSwiftTests.swift -// ARTextViewAutocompletionExampleSwiftTests -// -// Created by Lucas Farah on 9/10/15. -// Copyright (c) 2015 Lucas Farah. All rights reserved. -// - -import UIKit -import XCTest - -class ARTextViewAutocompletionExampleSwiftTests: XCTestCase { - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testExample() { - // This is an example of a functional test case. - XCTAssert(true, "Pass") - } - - func testPerformanceExample() { - // This is an example of a performance test case. - self.measureBlock() { - // Put the code you want to measure the time of here. - } - } - -} diff --git a/ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwiftTests/Info.plist b/ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwiftTests/Info.plist deleted file mode 100644 index e460a3e..0000000 --- a/ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwiftTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - farah.lucas.$(PRODUCT_NAME:rfc1034identifier) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift/AppDelegate.swift b/ARTextViewAutocompletionExampleSwift/AppDelegate.swift similarity index 100% rename from ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift/AppDelegate.swift rename to ARTextViewAutocompletionExampleSwift/AppDelegate.swift diff --git a/ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift/Base.lproj/LaunchScreen.xib b/ARTextViewAutocompletionExampleSwift/Base.lproj/LaunchScreen.xib similarity index 100% rename from ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift/Base.lproj/LaunchScreen.xib rename to ARTextViewAutocompletionExampleSwift/Base.lproj/LaunchScreen.xib diff --git a/ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift/Base.lproj/Main.storyboard b/ARTextViewAutocompletionExampleSwift/Base.lproj/Main.storyboard similarity index 100% rename from ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift/Base.lproj/Main.storyboard rename to ARTextViewAutocompletionExampleSwift/Base.lproj/Main.storyboard diff --git a/ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteManager.h b/ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteManager.h deleted file mode 100755 index 33c8a0a..0000000 --- a/ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteManager.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// ARAutocompleteManager.h -// alexruperez -// -// Created by Alejandro Rupérez on 12/6/12. -// Copyright (c) 2013 alexruperez. All rights reserved. -// - -#import -#import "ARAutocompleteTextView.h" - -typedef enum { - ARAutocompleteTypeEmail, // Default - ARAutocompleteTypeNames, -} ARAutocompleteType; - -@interface ARAutocompleteManager : NSObject - -+ (ARAutocompleteManager *)sharedManager; - -@end diff --git a/ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteManager.m b/ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteManager.m deleted file mode 100755 index d4978d4..0000000 --- a/ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteManager.m +++ /dev/null @@ -1,326 +0,0 @@ -// -// ARAutocompleteManager.m -// alexruperez -// -// Created by Alejandro Rupérez on 12/6/12. -// Copyright (c) 2013 alexruperez. All rights reserved. -// - -#import "ARAutocompleteManager.h" - -static ARAutocompleteManager *sharedManager; - -@implementation ARAutocompleteManager - -+ (ARAutocompleteManager *)sharedManager -{ - static dispatch_once_t done; - dispatch_once(&done, ^{ sharedManager = [[ARAutocompleteManager alloc] init]; }); - return sharedManager; -} - -#pragma mark - ARAutocompleteTextViewDelegate - -- (NSString *)textView:(ARAutocompleteTextView *)textView - completionForPrefix:(NSString *)prefix - ignoreCase:(BOOL)ignoreCase -{ - if (textView.autocompleteType == ARAutocompleteTypeEmail) - { - static dispatch_once_t onceToken; - static NSArray *autocompleteArray; - dispatch_once(&onceToken, ^ - { - autocompleteArray = @[ @"gmail.com", - @"yahoo.com", - @"hotmail.com", - @"aol.com", - @"comcast.net", - @"me.com", - @"msn.com", - @"live.com", - @"sbcglobal.net", - @"ymail.com", - @"att.net", - @"mac.com", - @"cox.net", - @"verizon.net", - @"hotmail.co.uk", - @"bellsouth.net", - @"rocketmail.com", - @"aim.com", - @"yahoo.co.uk", - @"earthlink.net", - @"charter.net", - @"optonline.net", - @"shaw.ca", - @"yahoo.ca", - @"googlemail.com", - @"mail.com", - @"qq.com", - @"btinternet.com", - @"mail.ru", - @"live.co.uk", - @"naver.com", - @"rogers.com", - @"juno.com", - @"yahoo.com.tw", - @"live.ca", - @"walla.com", - @"163.com", - @"roadrunner.com", - @"telus.net", - @"embarqmail.com", - @"hotmail.fr", - @"pacbell.net", - @"sky.com", - @"sympatico.ca", - @"cfl.rr.com", - @"tampabay.rr.com", - @"q.com", - @"yahoo.co.in", - @"yahoo.fr", - @"hotmail.ca", - @"windstream.net", - @"hotmail.it", - @"web.de", - @"asu.edu", - @"gmx.de", - @"gmx.com", - @"insightbb.com", - @"netscape.net", - @"icloud.com", - @"frontier.com", - @"126.com", - @"hanmail.net", - @"suddenlink.net", - @"netzero.net", - @"mindspring.com", - @"ail.com", - @"windowslive.com", - @"netzero.com", - @"yahoo.com.hk", - @"yandex.ru", - @"mchsi.com", - @"cableone.net", - @"yahoo.com.cn", - @"yahoo.es", - @"yahoo.com.br", - @"cornell.edu", - @"ucla.edu", - @"us.army.mil", - @"excite.com", - @"ntlworld.com", - @"usc.edu", - @"nate.com", - @"outlook.com", - @"nc.rr.com", - @"prodigy.net", - @"wi.rr.com", - @"videotron.ca", - @"yahoo.it", - @"yahoo.com.au", - @"umich.edu", - @"ameritech.net", - @"libero.it", - @"yahoo.de", - @"rochester.rr.com", - @"cs.com", - @"frontiernet.net", - @"swbell.net", - @"msu.edu", - @"ptd.net", - @"proxymail.facebook.com", - @"hotmail.es", - @"austin.rr.com", - @"nyu.edu", - @"sina.com", - @"centurytel.net", - @"usa.net", - @"nycap.rr.com", - @"uci.edu", - @"hotmail.de", - @"yahoo.com.sg", - @"email.arizona.edu", - @"yahoo.com.mx", - @"ufl.edu", - @"bigpond.com", - @"unlv.nevada.edu", - @"yahoo.cn", - @"ca.rr.com", - @"google.com", - @"yahoo.co.id", - @"inbox.com", - @"fuse.net", - @"hawaii.rr.com", - @"talktalk.net", - @"gmx.net", - @"walla.co.il", - @"ucdavis.edu", - @"carolina.rr.com", - @"comcast.com", - @"live.fr", - @"blueyonder.co.uk", - @"live.cn", - @"cogeco.ca", - @"abv.bg", - @"tds.net", - @"centurylink.net", - @"yahoo.com.vn", - @"uol.com.br", - @"osu.edu", - @"san.rr.com", - @"rcn.com", - @"umn.edu", - @"live.nl", - @"live.com.au", - @"tx.rr.com", - @"eircom.net", - @"sasktel.net", - @"post.harvard.edu", - @"snet.net", - @"wowway.com", - @"live.it", - @"att.com", - @"vt.edu", - @"rambler.ru", - @"temple.edu", - @"cinci.rr.com", - @"alexruperez.com", - @"gigigo.com"]; - }); - - // Check that text field contains an @ - NSRange atSignRange = [prefix rangeOfString:@"@"]; - if (atSignRange.location == NSNotFound) - { - return @""; - } - - // Stop autocomplete if user types dot after domain - NSString *domainAndTLD = [prefix substringFromIndex:atSignRange.location]; - NSRange rangeOfDot = [domainAndTLD rangeOfString:@"."]; - if (rangeOfDot.location != NSNotFound) - { - return @""; - } - - // Check that there aren't two @-signs - NSArray *textComponents = [prefix componentsSeparatedByString:@"@"]; - if ([textComponents count] > 2) - { - return @""; - } - - if ([textComponents count] > 1) - { - // If no domain is entered, use the first domain in the list - if ([(NSString *)textComponents[1] length] == 0) - { - return [autocompleteArray objectAtIndex:0]; - } - - NSString *textAfterAtSign = textComponents[1]; - - NSString *stringToLookFor; - if (ignoreCase) - { - stringToLookFor = [textAfterAtSign lowercaseString]; - } - else - { - stringToLookFor = textAfterAtSign; - } - - for (NSString *stringFromReference in autocompleteArray) - { - NSString *stringToCompare; - if (ignoreCase) - { - stringToCompare = [stringFromReference lowercaseString]; - } - else - { - stringToCompare = stringFromReference; - } - - if ([stringToCompare hasPrefix:stringToLookFor]) - { - return [stringFromReference stringByReplacingCharactersInRange:[stringToCompare rangeOfString:stringToLookFor] withString:@""]; - } - - } - } - } - else if (textView.autocompleteType == ARAutocompleteTypeNames) - { - static dispatch_once_t colorOnceToken; - static NSArray *colorAutocompleteArray; - dispatch_once(&colorOnceToken, ^ - { - colorAutocompleteArray = @[ @"Alex", - @"Alfred", - @"Beth", - @"Carlos", - @"Cris", - @"Daniel", - @"Ethan", - @"Fred", - @"George", - @"Helen", - @"Inis", - @"Jennifer", - @"Kylie", - @"Liam", - @"Melissa", - @"Noah", - @"Omar", - @"Penelope", - @"Quan", - @"Rachel", - @"Seth", - @"Timothy", - @"Ulga", - @"Vanessa", - @"William", - @"Xao", - @"Yilton", - @"Zander"]; - }); - - NSString *stringToLookFor; - NSArray *componentsString = [prefix componentsSeparatedByString:@","]; - NSString *prefixLastComponent = [componentsString.lastObject stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; - if (ignoreCase) - { - stringToLookFor = [prefixLastComponent lowercaseString]; - } - else - { - stringToLookFor = prefixLastComponent; - } - - for (NSString *stringFromReference in colorAutocompleteArray) - { - NSString *stringToCompare; - if (ignoreCase) - { - stringToCompare = [stringFromReference lowercaseString]; - } - else - { - stringToCompare = stringFromReference; - } - - if ([stringToCompare hasPrefix:stringToLookFor]) - { - return [stringFromReference stringByReplacingCharactersInRange:[stringToCompare rangeOfString:stringToLookFor] withString:@""]; - } - - } - } - - return @""; -} - -@end diff --git a/ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteTextView.h b/ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteTextView.h deleted file mode 100755 index 70890ea..0000000 --- a/ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteTextView.h +++ /dev/null @@ -1,71 +0,0 @@ -// -// ARAutocompleteTextView.h -// alexruperez -// -// Created by Alejandro Rupérez on 11/29/12. -// Inspired by DOautocompleteTextView by DoAT. -// -// Copyright (c) 2013 alexruperez. All rights reserved. -// - -#import - -@class ARAutocompleteTextView; - -@protocol ARAutocompleteDataSource - -- (NSString*)textView:(ARAutocompleteTextView*)textView - completionForPrefix:(NSString*)prefix - ignoreCase:(BOOL)ignoreCase; - -@end - -@protocol ARAutocompleteTextViewDelegate - -@optional -- (void)autoCompleteTextViewDidAutoComplete:(ARAutocompleteTextView *)autoCompleteField; -- (void)autoCompleteTextView:(ARAutocompleteTextView *)autocompleteTextView didChangeAutocompleteText:(NSString *)autocompleteText; - -@end - -@interface ARAutocompleteTextView : UITextView - -/* - * Designated programmatic initializer (also compatible with Interface Builder) - */ -- (id)initWithFrame:(CGRect)frame; - -/* - * Autocomplete behavior - */ -@property (nonatomic, assign) NSUInteger autocompleteType; // Can be used by the dataSource to provide different types of autocomplete behavior -@property (nonatomic, assign) BOOL autocompleteDisabled; -@property (nonatomic, assign) BOOL ignoreCase; -@property (nonatomic, assign) id autoCompleteTextViewDelegate; -@property (nonatomic, assign) id innerTextViewDelegate; - -/* - * Configure text field appearance - */ -@property (nonatomic, strong) UILabel *autocompleteLabel; -- (void)setFont:(UIFont *)font; -@property (nonatomic, assign) CGPoint autocompleteTextOffset; - -/* - * Specify a data source responsible for determining autocomplete text. - */ -@property (nonatomic, assign) id autocompleteDataSource; -+ (void)setDefaultAutocompleteDataSource:(id)dataSource; - -/* - * Subclassing: - */ -- (CGRect)autocompleteRectForBounds:(CGRect)bounds; // Override to alter the position of the autocomplete text -- (void)setupAutocompleteTextView; // Override to perform setup tasks. Don't forget to call super. - -/* - * Refresh the autocomplete text manually (useful if you want the text to change while the user isn't editing the text) - */ -- (void)forceRefreshAutocompleteText; - -@end \ No newline at end of file diff --git a/ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteTextView.m b/ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteTextView.m deleted file mode 100755 index 60e30dc..0000000 --- a/ARTextViewAutocompletionExampleSwift/Classes/ARAutocompleteTextView.m +++ /dev/null @@ -1,304 +0,0 @@ -// -// ARAutocompleteTextView.m -// alexruperez -// -// Created by Alejandro Rupérez on 11/29/12. -// Inspired by DOautocompleteTextView by DoAT. -// -// Copyright (c) 2013 alexruperez. All rights reserved. -// - -#import "ARAutocompleteTextView.h" - -static NSObject *DefaultAutocompleteDataSource = nil; - -@interface ARAutocompleteTextView () - -@property (nonatomic, strong) NSString *autocompleteString; -@property (nonatomic, assign) BOOL autocompleted; - -@end - -@implementation ARAutocompleteTextView - -- (id)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) - { - [self setupAutocompleteTextView]; - } - return self; -} - -- (void)awakeFromNib -{ - [super awakeFromNib]; - - [self setupAutocompleteTextView]; -} - -- (void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self name:UITextViewTextDidChangeNotification object:self]; -} - -- (void)setupAutocompleteTextView -{ - [super setDelegate:self]; - - self.autocompleteLabel = [[UILabel alloc] initWithFrame:CGRectZero]; - self.autocompleteLabel.font = self.font; - self.autocompleteLabel.backgroundColor = [UIColor clearColor]; - self.autocompleteLabel.textColor = [UIColor lightGrayColor]; - -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 - NSLineBreakMode lineBreakMode = NSLineBreakByClipping; -#else - UILineBreakMode lineBreakMode = UILineBreakModeClip; -#endif - - self.autocompleteLabel.lineBreakMode = lineBreakMode; - self.autocompleteLabel.hidden = YES; - [self addSubview:self.autocompleteLabel]; - [self bringSubviewToFront:self.autocompleteLabel]; - - self.autocompleteString = @""; - self.autocompleted = NO; - - self.ignoreCase = YES; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ar_textDidChange:) name:UITextViewTextDidChangeNotification object:self]; -} - -#pragma mark - Configuration - -+ (void)setDefaultAutocompleteDataSource:(id)dataSource -{ - DefaultAutocompleteDataSource = dataSource; -} - -- (void)setFont:(UIFont *)font -{ - [super setFont:font]; - [self.autocompleteLabel setFont:font]; -} - -- (void)setDelegate:(id)delegate -{ - self.innerTextViewDelegate = delegate; -} - -#pragma mark - UIResponder - -- (BOOL)becomeFirstResponder -{ - if (!self.autocompleteDisabled) - { - self.autocompleteLabel.hidden = NO; - } - - return [super becomeFirstResponder]; -} - -- (BOOL)resignFirstResponder -{ - if (!self.autocompleteDisabled) - { - self.autocompleteLabel.hidden = YES; - - if ([self commitAutocompleteText]) { - // Only notify if committing autocomplete actually changed the text. - - - // This is necessary because committing the autocomplete text changes the text field's text, but for some reason UITextView doesn't post the UITextViewTextDidChangeNotification notification on its own - [[NSNotificationCenter defaultCenter] postNotificationName:UITextViewTextDidChangeNotification object:self]; - } - } - return [super resignFirstResponder]; -} - -#pragma mark - Autocomplete Logic - -- (CGRect)autocompleteRectForBounds:(CGRect)bounds -{ - CGRect caretRect = [self caretRectForPosition:self.selectedTextRange.start]; - - CGRect returnRect = CGRectMake(caretRect.origin.x + 1.0f, caretRect.origin.y, self.frame.size.width, caretRect.size.height); - - return returnRect; -} - -- (void)ar_textDidChange:(NSNotification*)notification -{ - [self refreshAutocompleteText]; -} - -- (void)updateAutocompleteLabel -{ - [self.autocompleteLabel setText:self.autocompleteString]; - [self.autocompleteLabel sizeToFit]; - [self.autocompleteLabel setFrame: [self autocompleteRectForBounds:self.bounds]]; - - if ([self.autoCompleteTextViewDelegate respondsToSelector:@selector(autoCompleteTextView:didChangeAutocompleteText:)]) { - [self.autoCompleteTextViewDelegate autoCompleteTextView:self didChangeAutocompleteText:self.autocompleteString]; - } -} - -- (void)refreshAutocompleteText -{ - if (!self.autocompleteDisabled) - { - id dataSource = nil; - - if ([self.autocompleteDataSource respondsToSelector:@selector(textView:completionForPrefix:ignoreCase:)]) - { - dataSource = (id )self.autocompleteDataSource; - } - else if ([DefaultAutocompleteDataSource respondsToSelector:@selector(textView:completionForPrefix:ignoreCase:)]) - { - dataSource = DefaultAutocompleteDataSource; - } - - if (dataSource) - { - self.autocompleteString = [dataSource textView:self completionForPrefix:self.text ignoreCase:self.ignoreCase]; - - if (self.autocompleteString.length > 0) - { - if ([self.text hasSuffix:@" "]) { - self.text = [self.text substringToIndex:[self.text length] - 1]; - [self autocompleteText:self]; - } - } - - [self updateAutocompleteLabel]; - } - } -} - -- (BOOL)commitAutocompleteText -{ - NSString *currentText = self.text; - if (self.autocompleteString && [self.autocompleteString isEqualToString:@""] == NO - && self.autocompleteDisabled == NO) - { - self.text = [NSString stringWithFormat:@"%@%@", self.text, self.autocompleteString]; - - self.autocompleteString = @""; - [self updateAutocompleteLabel]; - - if ([self.autoCompleteTextViewDelegate respondsToSelector:@selector(autoCompleteTextViewDidAutoComplete:)]) { - [self.autoCompleteTextViewDelegate autoCompleteTextViewDidAutoComplete:self]; - } - } - return ![currentText isEqualToString:self.text]; -} - -- (void)forceRefreshAutocompleteText -{ - [self refreshAutocompleteText]; -} - -#pragma mark - UITextView Delegate Methods - -- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text -{ - if (self.autocompleted) { - if ([text isEqualToString:@". "]) { - self.autocompleted = NO; - return NO; - } - } - - if (self.innerTextViewDelegate && [self.innerTextViewDelegate respondsToSelector:@selector(textView:shouldChangeTextInRange:replacementText:)]) { - return [self.innerTextViewDelegate textView:textView shouldChangeTextInRange:range replacementText:text]; - } - return YES; -} - -- (BOOL)textView:(UITextView *)textView shouldInteractWithTextAttachment:(NSTextAttachment *)textAttachment inRange:(NSRange)characterRange -{ - if (self.innerTextViewDelegate && [self.innerTextViewDelegate respondsToSelector:@selector(textView:shouldInteractWithTextAttachment:inRange:)]) { - return [self.innerTextViewDelegate textView:textView shouldInteractWithTextAttachment:textAttachment inRange:characterRange]; - } - return YES; -} - -- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange -{ - if (self.innerTextViewDelegate && [self.innerTextViewDelegate respondsToSelector:@selector(textView:shouldInteractWithURL:inRange:)]) { - return [self.innerTextViewDelegate textView:textView shouldInteractWithURL:URL inRange:characterRange]; - } - return YES; -} - -- (void)textViewDidBeginEditing:(UITextView *)textView -{ - if (self.innerTextViewDelegate && [self.innerTextViewDelegate respondsToSelector:@selector(textViewDidBeginEditing:)]) { - [self.innerTextViewDelegate textViewDidBeginEditing:textView]; - } -} - -- (void)textViewDidChange:(UITextView *)textView -{ - if (self.innerTextViewDelegate && [self.innerTextViewDelegate respondsToSelector:@selector(textViewDidChange:)]) { - [self.innerTextViewDelegate textViewDidChange:textView]; - } -} - -- (void)textViewDidChangeSelection:(UITextView *)textView -{ - if (self.innerTextViewDelegate && [self.innerTextViewDelegate respondsToSelector:@selector(textViewDidChangeSelection:)]) { - [self.innerTextViewDelegate textViewDidChangeSelection:textView]; - } -} - -- (void)textViewDidEndEditing:(UITextView *)textView -{ - if (self.innerTextViewDelegate && [self.innerTextViewDelegate respondsToSelector:@selector(textViewDidEndEditing:)]) { - [self.innerTextViewDelegate textViewDidEndEditing:textView]; - } -} - -- (BOOL)textViewShouldBeginEditing:(UITextView *)textView -{ - if (self.innerTextViewDelegate && [self.innerTextViewDelegate respondsToSelector:@selector(textViewShouldBeginEditing:)]) { - return [self.innerTextViewDelegate textViewShouldBeginEditing:textView]; - } - return YES; -} - -- (BOOL)textViewShouldEndEditing:(UITextView *)textView -{ - if (self.innerTextViewDelegate && [self.innerTextViewDelegate respondsToSelector:@selector(textViewShouldEndEditing:)]) { - return [self.innerTextViewDelegate textViewShouldEndEditing:textView]; - } - return YES; -} - -#pragma mark - Accessors - -- (void)setAutocompleteString:(NSString *)autocompleteString -{ - _autocompleteString = autocompleteString; -} - -#pragma mark - Private Methods - -- (void)autocompleteText:(id)sender -{ - if (!self.autocompleteDisabled) - { - self.autocompleteLabel.hidden = NO; - - [self commitAutocompleteText]; - - self.autocompleted = YES; - - // This is necessary because committing the autocomplete text changes the text field's text, but for some reason UITextView doesn't post the UITextViewTextDidChangeNotification notification on its own - [[NSNotificationCenter defaultCenter] postNotificationName:UITextViewTextDidChangeNotification object:self]; - } -} - -@end diff --git a/ARTextViewAutocompletionExampleSwift/Classes/AREmailAutocompleteTextView.h b/ARTextViewAutocompletionExampleSwift/Classes/AREmailAutocompleteTextView.h deleted file mode 100755 index 8e685cc..0000000 --- a/ARTextViewAutocompletionExampleSwift/Classes/AREmailAutocompleteTextView.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// AREmailAutocompleteTextView.h -// ARTextViewAutocompletionExample -// -// Created by Alejandro Rupérez on 2/27/13. -// Copyright (c) 2013 alexruperez. All rights reserved. -// - -#import "ARAutocompleteTextView.h" - -@interface AREmailAutocompleteTextView : ARAutocompleteTextView - -@property (nonatomic, copy) NSArray *emailDomains; // modify to use your own custom list of email domains - -@end diff --git a/ARTextViewAutocompletionExampleSwift/Classes/AREmailAutocompleteTextView.m b/ARTextViewAutocompletionExampleSwift/Classes/AREmailAutocompleteTextView.m deleted file mode 100755 index c5de04b..0000000 --- a/ARTextViewAutocompletionExampleSwift/Classes/AREmailAutocompleteTextView.m +++ /dev/null @@ -1,79 +0,0 @@ -// -// AREmailAutocompleteTextView.m -// ARTextViewAutocompletionExample -// -// Created by Alejandro Rupérez on 2/27/13. -// Copyright (c) 2013 alexruperez. All rights reserved. -// - -#import "AREmailAutocompleteTextView.h" - -@implementation AREmailAutocompleteTextView - -- (void)setupAutocompleteTextView -{ - [super setupAutocompleteTextView]; - - // Default email domains to suggest - self.emailDomains = @[ @"gmail.com", @"yahoo.com", @"hotmail.com", @"aol.com", @"comcast.net", @"me.com", @"msn.com", @"live.com", @"sbcglobal.net", @"ymail.com", @"att.net", @"mac.com", @"cox.net", @"verizon.net", @"hotmail.co.uk", @"bellsouth.net", @"rocketmail.com", @"aim.com", @"yahoo.co.uk", @"earthlink.net", @"charter.net", @"optonline.net", @"shaw.ca", @"yahoo.ca", @"googlemail.com", @"mail.com", @"qq.com", @"btinternet.com", @"mail.ru", @"live.co.uk", @"naver.com", @"rogers.com", @"juno.com", @"yahoo.com.tw", @"live.ca", @"walla.com", @"163.com", @"roadrunner.com", @"telus.net", @"embarqmail.com", @"hotmail.fr", @"pacbell.net", @"sky.com", @"sympatico.ca", @"cfl.rr.com", @"tampabay.rr.com", @"q.com", @"yahoo.co.in", @"yahoo.fr", @"hotmail.ca", @"windstream.net", @"hotmail.it", @"web.de", @"asu.edu", @"gmx.de", @"gmx.com", @"insightbb.com", @"netscape.net", @"icloud.com", @"frontier.com", @"126.com", @"hanmail.net", @"suddenlink.net", @"netzero.net", @"mindspring.com", @"ail.com", @"windowslive.com", @"netzero.com", @"yahoo.com.hk", @"yandex.ru", @"mchsi.com", @"cableone.net", @"yahoo.com.cn", @"yahoo.es", @"yahoo.com.br", @"cornell.edu", @"ucla.edu", @"us.army.mil", @"excite.com", @"ntlworld.com", @"usc.edu", @"nate.com", @"outlook.com", @"nc.rr.com", @"prodigy.net", @"wi.rr.com", @"videotron.ca", @"yahoo.it", @"yahoo.com.au", @"umich.edu", @"ameritech.net", @"libero.it", @"yahoo.de", @"rochester.rr.com", @"cs.com", @"frontiernet.net", @"swbell.net", @"msu.edu", @"ptd.net", @"proxymail.facebook.com", @"hotmail.es", @"austin.rr.com", @"nyu.edu", @"sina.com", @"centurytel.net", @"usa.net", @"nycap.rr.com", @"uci.edu", @"hotmail.de", @"yahoo.com.sg", @"email.arizona.edu", @"yahoo.com.mx", @"ufl.edu", @"bigpond.com", @"unlv.nevada.edu", @"yahoo.cn", @"ca.rr.com", @"google.com", @"yahoo.co.id", @"inbox.com", @"fuse.net", @"hawaii.rr.com", @"talktalk.net", @"gmx.net", @"walla.co.il", @"ucdavis.edu", @"carolina.rr.com", @"comcast.com", @"live.fr", @"blueyonder.co.uk", @"live.cn", @"cogeco.ca", @"abv.bg", @"tds.net", @"centurylink.net", @"yahoo.com.vn", @"uol.com.br", @"osu.edu", @"san.rr.com", @"rcn.com", @"umn.edu", @"live.nl", @"live.com.au", @"tx.rr.com", @"eircom.net", @"sasktel.net", @"post.harvard.edu", @"snet.net", @"wowway.com", @"live.it", @"att.com", @"vt.edu", @"rambler.ru", @"temple.edu", @"cinci.rr.com", @"alexruperez.com"]; - - self.autocompleteDataSource = self; -} - -#pragma mark - ARAutocompleteDataSource - -- (NSString *)textView:(ARAutocompleteTextView *)textView completionForPrefix:(NSString *)prefix ignoreCase:(BOOL)ignoreCase -{ - // Check that text field contains an @ - NSRange atSignRange = [prefix rangeOfString:@"@"]; - if (atSignRange.location == NSNotFound) - { - return @""; - } - - // Stop autocomplete if user types dot after domain - NSString *domainAndTLD = [prefix substringFromIndex:atSignRange.location]; - NSRange rangeOfDot = [domainAndTLD rangeOfString:@""]; - if (rangeOfDot.location != NSNotFound) - { - return @""; - } - - NSArray *textComponents = [prefix componentsSeparatedByString:@"@"]; - - if ([textComponents count] > 1) - { - NSString *lastText = [[textComponents lastObject] stringByReplacingOccurrencesOfString:@" " withString:@""]; - // If no domain is entered, use the first domain in the list - if ([lastText length] == 0) - { - return [self.emailDomains objectAtIndex:0]; - } - - NSString *stringToLookFor = lastText; - if (ignoreCase) - { - stringToLookFor = [stringToLookFor lowercaseString]; - } - - for (NSString *stringFromReference in self.emailDomains) - { - NSString *stringToCompare = stringFromReference; - if (ignoreCase) - { - stringToCompare = [stringToCompare lowercaseString]; - } - - if ([stringToCompare hasPrefix:stringToLookFor]) - { - return [stringFromReference stringByReplacingCharactersInRange:[stringToCompare rangeOfString:stringToLookFor] withString:@""]; - } - - } - } - - return @""; -} - - -@end diff --git a/ARTextViewAutocompletionExampleSwift/Classes/ARTwitterAutocompleteTextView.h b/ARTextViewAutocompletionExampleSwift/Classes/ARTwitterAutocompleteTextView.h deleted file mode 100755 index cb07542..0000000 --- a/ARTextViewAutocompletionExampleSwift/Classes/ARTwitterAutocompleteTextView.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ARTwitterAutocompleteTextView.h -// ARTextViewAutocompletionExample -// -// Created by Alejandro Rupérez on 2/27/13. -// Copyright (c) 2013 alexruperez. All rights reserved. -// - -#import "ARAutocompleteTextView.h" - -@interface ARTwitterAutocompleteTextView : ARAutocompleteTextView - -@property (nonatomic, copy) NSArray *autocomplete; // modify to use your own custom list - -@end diff --git a/ARTextViewAutocompletionExampleSwift/Classes/ARTwitterAutocompleteTextView.m b/ARTextViewAutocompletionExampleSwift/Classes/ARTwitterAutocompleteTextView.m deleted file mode 100755 index 38eb6eb..0000000 --- a/ARTextViewAutocompletionExampleSwift/Classes/ARTwitterAutocompleteTextView.m +++ /dev/null @@ -1,86 +0,0 @@ -// -// ARTwitterAutocompleteTextView.m -// ARTextViewAutocompletionExample -// -// Created by Alejandro Rupérez on 2/27/13. -// Copyright (c) 2013 alexruperez. All rights reserved. -// - -#import "ARTwitterAutocompleteTextView.h" - -@implementation ARTwitterAutocompleteTextView - -- (void)setupAutocompleteTextView -{ - [super setupAutocompleteTextView]; - - // Default list to suggest - self.autocomplete = @[ @"@alexruperez", @"@gigigoapps", @"@GigigoMexico", @"@KimberlySunster", @"@sbaro_gigigo", @"@davidr_79", @"#alexruperez", @"#gigigo", @"#google", @"#facebook", @"#twitter", @"#hashtag" ]; - - self.autocompleteDataSource = self; -} - -#pragma mark - ARAutocompleteDataSource - -- (NSString *)textView:(ARAutocompleteTextView *)textView completionForPrefix:(NSString *)prefix ignoreCase:(BOOL)ignoreCase -{ - // Check that text field contains an @ or # - NSString *contains = @"@"; - NSRange atSignRange = [prefix rangeOfString:@"@" options:NSBackwardsSearch]; - NSRange atSignRange2 = [prefix rangeOfString:@"#" options:NSBackwardsSearch]; - - if ((atSignRange.location == NSNotFound) && (atSignRange2.location == NSNotFound)) { - return @""; - } - - if ((atSignRange.location == NSNotFound) || (((atSignRange.location != NSNotFound) && (atSignRange2.location != NSNotFound)) && (atSignRange2.location > atSignRange.location))) { - atSignRange = atSignRange2; - contains = @"#"; - } - - NSArray *textComponents = [prefix componentsSeparatedByString:contains]; - - if ([textComponents count] > 1) - { - NSString *lastText = [[textComponents lastObject] stringByReplacingOccurrencesOfString:@" " withString:@""]; - // Use the first in the list by default - if ([lastText length] == 0) - { - for (NSString *stringFromReference in self.autocomplete) - { - if ([stringFromReference hasPrefix:contains]) - { - return [stringFromReference stringByReplacingOccurrencesOfString:contains withString:@""]; - } - } - } - - NSString *stringToLookFor = lastText; - if (ignoreCase) - { - stringToLookFor = [stringToLookFor lowercaseString]; - } - - for (NSString *stringFromReference in self.autocomplete) - { - NSString *stringToCompare = [stringFromReference stringByReplacingOccurrencesOfString:contains withString:@""]; - if (ignoreCase) - { - stringToCompare = [stringToCompare lowercaseString]; - } - - if ([stringToCompare hasPrefix:stringToLookFor]) - { - NSRange range = [stringToCompare rangeOfString:stringToLookFor]; - range.length++; - return [stringFromReference stringByReplacingCharactersInRange:range withString:@""]; - } - - } - } - - return @""; - -} - -@end diff --git a/ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift/Images.xcassets/AppIcon.appiconset/Contents.json b/ARTextViewAutocompletionExampleSwift/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift/Images.xcassets/AppIcon.appiconset/Contents.json rename to ARTextViewAutocompletionExampleSwift/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift/Info.plist b/ARTextViewAutocompletionExampleSwift/Info.plist similarity index 100% rename from ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift/Info.plist rename to ARTextViewAutocompletionExampleSwift/Info.plist diff --git a/ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift/ViewController.swift b/ARTextViewAutocompletionExampleSwift/ViewController.swift similarity index 100% rename from ARTextViewAutocompletionExampleSwift/ARTextViewAutocompletionExampleSwift/ViewController.swift rename to ARTextViewAutocompletionExampleSwift/ViewController.swift diff --git a/Classes/ARTwitterAutocompleteTextView.m b/Classes/ARTwitterAutocompleteTextView.m index 38eb6eb..ea458ff 100755 --- a/Classes/ARTwitterAutocompleteTextView.m +++ b/Classes/ARTwitterAutocompleteTextView.m @@ -15,7 +15,7 @@ - (void)setupAutocompleteTextView [super setupAutocompleteTextView]; // Default list to suggest - self.autocomplete = @[ @"@alexruperez", @"@gigigoapps", @"@GigigoMexico", @"@KimberlySunster", @"@sbaro_gigigo", @"@davidr_79", @"#alexruperez", @"#gigigo", @"#google", @"#facebook", @"#twitter", @"#hashtag" ]; + self.autocomplete = @[ @"@alexruperez", @"@feverapp", @"@JavierQuerol", @"#alexruperez", @"#fever", @"#google", @"#facebook", @"#twitter", @"#hashtag" ]; self.autocompleteDataSource = self; } diff --git a/README.md b/README.md index df9418d..eabdf6e 100755 --- a/README.md +++ b/README.md @@ -1,17 +1,14 @@ # ARAutocompleteTextView [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/alexruperez/ARAutocompleteTextView?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - [![Twitter](http://img.shields.io/badge/contact-@alexruperez-blue.svg?style=flat)](http://twitter.com/alexruperez) [![GitHub Issues](http://img.shields.io/github/issues/alexruperez/ARAutocompleteTextView.svg?style=flat)](http://github.com/alexruperez/ARAutocompleteTextView/issues) -[![License Status](http://img.shields.io/cocoapods/l/ARAutocompleteTextView.svg?style=flat)](http://opensource.org/licenses/MIT) -[![Platform Status](http://img.shields.io/cocoapods/p/ARAutocompleteTextView.svg?style=flat)](https://developer.apple.com) +[![Version Status](http://img.shields.io/cocoapods/v/ARAutocompleteTextView.svg?style=flat)](http://cocoadocs.org/docsets/ARAutocompleteTextView) +[![License Status](http://img.shields.io/cocoapods/l/ARAutocompleteTextView.svg?style=flat)](http://cocoadocs.org/docsets/ARAutocompleteTextView) +[![Platform Status](http://img.shields.io/cocoapods/p/ARAutocompleteTextView.svg?style=flat)](http://cocoadocs.org/docsets/ARAutocompleteTextView) [![Pod Status](http://img.shields.io/cocoapods/v/ARAutocompleteTextView.svg?style=flat)](https://github.com/CocoaPods/Specs/blob/master/Specs/ARAutocompleteTextView/0.0.1/ARAutocompleteTextView.podspec.json) -[![Dependency Status](http://www.versioneye.com/objective-c/arautocompletetextview/0.0.1/badge.svg?style=flat)](http://www.versioneye.com/objective-c/arautocompletetextview/0.0.1) [![Analytics](https://ga-beacon.appspot.com/UA-55329295-1/ARAutocompleteTextView/readme?pixel)](https://github.com/igrigorik/ga-beacon) - - ## Overview ARAutocompleteTextView is a subclass of UITextView that automatically displays text suggestions in real-time. This is perfect for automatically suggesting the domain as a user types an email address, #hashtag or @handle.