├── Screen Shot.png
├── APAutocompleteTextField
├── en.lproj
│ └── InfoPlist.strings
├── APViewController.h
├── APAppDelegate.h
├── main.m
├── APAutocompleteTextFieldExample-Prefix.pch
├── Images.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── LaunchImage.launchimage
│ │ └── Contents.json
├── APAutocompleteTextFieldExample-Info.plist
├── Base.lproj
│ └── Main.storyboard
├── APAppDelegate.m
└── APViewController.m
├── APAutocompleteTextFieldTests
├── en.lproj
│ └── InfoPlist.strings
├── APAutocompleteTextFieldExampleTests-Info.plist
└── APAutocompleteTextFieldTests.m
├── APAutocompleteTextFieldExample.xcodeproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
├── xcuserdata
│ └── anatolypeshkov.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── APAutocompleteTextField.xcscheme
└── project.pbxproj
├── .gitignore
├── README.md
├── APAutocompleteTextField.podspec
├── APAutocompleteTextField.h
├── LICENSE
└── APAutocompleteTextField.m
/Screen Shot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Antol/APAutocompleteTextField/HEAD/Screen Shot.png
--------------------------------------------------------------------------------
/APAutocompleteTextField/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/APAutocompleteTextFieldTests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/APAutocompleteTextFieldExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/APAutocompleteTextField/APViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // APViewController.h
3 | // APAutocompleteTextField
4 | //
5 | // Created by Antol Peshkov on 13.12.13.
6 | // Copyright (c) 2013 brainSTrainer. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface APViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | .DS_Store
3 | */build/*
4 | build/*
5 | *.pbxuser
6 | !default.pbxuser
7 | *.mode1v3
8 | !default.mode1v3
9 | *.mode2v3
10 | !default.mode2v3
11 | *.perspectivev3
12 | !default.perspectivev3
13 | xcuserdata
14 | profile
15 | *.moved-aside
16 | <<<<<<< HEAD
17 | DerivedData
18 | .idea/
19 | *.hmap
20 | *.xccheckout
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | APAutocompleteTextField
2 | =======================
3 |
4 | Autocomplete text field. It works like Safari (iOS) or Chrome (iOS) search / address bar
5 |
6 | 
7 |
8 | ###How to install
9 |
10 | Install using CocoaPods.
11 |
12 | pod 'APAutocompleteTextField'
13 |
--------------------------------------------------------------------------------
/APAutocompleteTextField/APAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // APAppDelegate.h
3 | // APAutocompleteTextField
4 | //
5 | // Created by Antol Peshkov on 13.12.13.
6 | // Copyright (c) 2013 brainSTrainer. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface APAppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/APAutocompleteTextField/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // APAutocompleteTextField
4 | //
5 | // Created by Antol Peshkov on 13.12.13.
6 | // Copyright (c) 2013 brainSTrainer. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #import "APAppDelegate.h"
12 |
13 | int main(int argc, char * argv[])
14 | {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([APAppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/APAutocompleteTextField/APAutocompleteTextFieldExample-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header
3 | //
4 | // The contents of this file are implicitly included at the beginning of every source file.
5 | //
6 |
7 | #import
8 |
9 | #ifndef __IPHONE_5_0
10 | #warning "This project uses features only available in iOS SDK 5.0 and later."
11 | #endif
12 |
13 | #ifdef __OBJC__
14 | #import
15 | #import
16 | #endif
17 |
--------------------------------------------------------------------------------
/APAutocompleteTextField/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "40x40",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "60x60",
16 | "scale" : "2x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/APAutocompleteTextField/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "scale" : "2x"
9 | },
10 | {
11 | "orientation" : "portrait",
12 | "idiom" : "iphone",
13 | "subtype" : "retina4",
14 | "extent" : "full-screen",
15 | "minimum-system-version" : "7.0",
16 | "scale" : "2x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/APAutocompleteTextField.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "APAutocompleteTextField"
3 | s.version = "1.0.2"
4 | s.summary = "Autocompletable text field"
5 | s.description = <<-DESC
6 | Autocompletion text field works like Safari (iOS) or Chrome (iOS) search / address bar
7 | DESC
8 | s.homepage = "https://github.com/Antol/APAutocompleteTextField"
9 | s.license = 'MIT'
10 | s.author = { "Antol" => "antol.peshkov@gmail.com" }
11 | s.platform = :ios, '7.0'
12 | s.source = { :git => "https://github.com/Antol/APAutocompleteTextField.git", :tag => "1.0.2" }
13 | s.source_files = 'APAutocompleteTextField.{h,m}'
14 | s.requires_arc = "true"
15 | end
16 |
--------------------------------------------------------------------------------
/APAutocompleteTextFieldExample.xcodeproj/xcuserdata/anatolypeshkov.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | APAutocompleteTextField.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 359D9043185B1A6600A96263
16 |
17 | primary
18 |
19 |
20 | 359D9064185B1A6600A96263
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/APAutocompleteTextFieldTests/APAutocompleteTextFieldExampleTests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | AP.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/APAutocompleteTextField.h:
--------------------------------------------------------------------------------
1 | //
2 | // APAutocompleteTextField.h
3 | // APAutocompleteTextField
4 | //
5 | // Created by Antol Peshkov on 13.12.13.
6 | // Copyright (c) 2013 brainSTrainer. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class APAutocompleteTextField;
12 |
13 | @protocol APAutocompleteTextFieldDelegate
14 | - (NSString *)autocompleteTextField:(APAutocompleteTextField *)textField completedStringForOriginString:(NSString *)originString;
15 | @end
16 |
17 | #pragma mark -
18 |
19 | @interface APAutocompleteTextField : UITextField
20 |
21 | @property(nonatomic,assign) id delegate;
22 |
23 | @property (nonatomic, readonly) BOOL autocompleted;
24 | @property (nonatomic, strong) UIColor *selectionColor;
25 |
26 | - (void)applyCompletion;
27 | - (void)removeCompletion;
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/APAutocompleteTextFieldTests/APAutocompleteTextFieldTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // APAutocompleteTextFieldTests.m
3 | // APAutocompleteTextFieldTests
4 | //
5 | // Created by Antol Peshkov on 13.12.13.
6 | // Copyright (c) 2013 brainSTrainer. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface APAutocompleteTextFieldTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation APAutocompleteTextFieldTests
16 |
17 | - (void)setUp
18 | {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown
24 | {
25 | // Put teardown code here. This method is called after the invocation of each test method in the class.
26 | [super tearDown];
27 | }
28 |
29 | - (void)testExample
30 | {
31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
32 | }
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013 Анатолий Пешков
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/APAutocompleteTextField/APAutocompleteTextFieldExample-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | AP.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/APAutocompleteTextField/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/APAutocompleteTextField/APAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // APAppDelegate.m
3 | // APAutocompleteTextField
4 | //
5 | // Created by Antol Peshkov on 13.12.13.
6 | // Copyright (c) 2013 brainSTrainer. All rights reserved.
7 | //
8 |
9 | #import "APAppDelegate.h"
10 |
11 | @implementation APAppDelegate
12 |
13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
14 | {
15 | // Override point for customization after application launch.
16 | return YES;
17 | }
18 |
19 | - (void)applicationWillResignActive:(UIApplication *)application
20 | {
21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
23 | }
24 |
25 | - (void)applicationDidEnterBackground:(UIApplication *)application
26 | {
27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
29 | }
30 |
31 | - (void)applicationWillEnterForeground:(UIApplication *)application
32 | {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | - (void)applicationDidBecomeActive:(UIApplication *)application
37 | {
38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
39 | }
40 |
41 | - (void)applicationWillTerminate:(UIApplication *)application
42 | {
43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/APAutocompleteTextField/APViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // APViewController.m
3 | // APAutocompleteTextField
4 | //
5 | // Created by Antol Peshkov on 13.12.13.
6 | // Copyright (c) 2013 brainSTrainer. All rights reserved.
7 | //
8 |
9 | #import "APViewController.h"
10 | #import "APAutocompleteTextField.h"
11 |
12 | @interface APViewController ()
13 | @end
14 |
15 | @implementation APViewController {
16 | APAutocompleteTextField *_textField;
17 | }
18 |
19 | - (void)viewDidLoad
20 | {
21 | [super viewDidLoad];
22 |
23 | CGFloat centerX = self.view.bounds.size.width/2.f;
24 | CGFloat centerY = self.view.bounds.size.height/2.f;
25 |
26 | UILabel *info = [[UILabel alloc] initWithFrame:CGRectZero];
27 | info.text = @"Input \'Soft Kitty\'";
28 | [info sizeToFit];
29 | info.center = CGPointMake(centerX, centerY/3.f);
30 | [self.view addSubview:info];
31 |
32 | _textField = [[APAutocompleteTextField alloc] initWithFrame:CGRectMake(0.f, 0.f, 310.f, 40.f)];
33 | _textField.delegate = self;
34 | [_textField addTarget:self action:@selector(textFieldEditingChanged:) forControlEvents:UIControlEventEditingChanged];
35 | _textField.center = CGPointMake(centerX, centerY/2.f);
36 | _textField.borderStyle = UITextBorderStyleRoundedRect;
37 | [self.view addSubview:_textField];
38 |
39 | UIButton *buttonChangeAllText = [[UIButton alloc] initWithFrame:CGRectMake(0.f, 0.f, 150.f, 40.f)];
40 | buttonChangeAllText.center = CGPointMake(centerX, centerY);
41 | buttonChangeAllText.backgroundColor = [UIColor lightGrayColor];
42 | [buttonChangeAllText setTitle:@"Change all" forState:UIControlStateNormal];
43 | [buttonChangeAllText addTarget:self action:@selector(touchUpInsideButtonChangeAllText:) forControlEvents:UIControlEventTouchUpInside];
44 | [self.view addSubview:buttonChangeAllText];
45 | }
46 |
47 | - (BOOL)textFieldShouldReturn:(UITextField *)textField
48 | {
49 | NSLog(@"=> return pressed");
50 | return YES;
51 | }
52 |
53 | - (void)textFieldEditingChanged:(UITextField *)textField
54 | {
55 | NSLog(@"=> entered text: %@", textField.text);
56 | }
57 |
58 | - (void)touchUpInsideButtonChangeAllText:(UIButton *)button
59 | {
60 | _textField.text = @"triam";
61 | }
62 |
63 | - (NSString *)autocompleteTextField:(APAutocompleteTextField *)textField completedStringForOriginString:(NSString *)originString
64 | {
65 | NSString *completedString = @"Soft Kitty, Warm Kitty, little ball of fur";
66 | NSRange originStringRange = [completedString rangeOfString:originString];
67 |
68 | if (originStringRange.location != 0) {
69 | completedString = nil;
70 | }
71 |
72 | return completedString;
73 | }
74 |
75 | @end
76 |
--------------------------------------------------------------------------------
/APAutocompleteTextFieldExample.xcodeproj/xcuserdata/anatolypeshkov.xcuserdatad/xcschemes/APAutocompleteTextField.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
61 |
62 |
68 |
69 |
70 |
71 |
72 |
73 |
79 |
80 |
86 |
87 |
88 |
89 |
91 |
92 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/APAutocompleteTextField.m:
--------------------------------------------------------------------------------
1 | //
2 | // APAutocompleteTextField.m
3 | // APAutocompleteTextField
4 | //
5 | // Created by Antol Peshkov on 13.12.13.
6 | // Copyright (c) 2013 brainSTrainer. All rights reserved.
7 | //
8 |
9 | #import "APAutocompleteTextField.h"
10 |
11 | @interface APAutocompleteTextField ()
12 | @end
13 |
14 | @implementation APAutocompleteTextField {
15 | BOOL _autocompleted;
16 | NSUInteger _lengthOriginString;
17 | }
18 |
19 | @synthesize selectionColor = _selectionColor;
20 | @synthesize autocompleted = _autocompleted;
21 |
22 | - (id)initWithFrame:(CGRect)frame
23 | {
24 | self = [super initWithFrame:frame];
25 | if (self) {
26 | self.autocorrectionType = UITextAutocorrectionTypeNo;
27 |
28 | _autocompleted = NO;
29 |
30 | self.selectionColor = [UIColor colorWithRed:0.8f green:0.87f blue:0.93f alpha:1.f];
31 | }
32 | return self;
33 | }
34 |
35 | - (void)applyCompletion
36 | {
37 | if (_autocompleted) {
38 | NSAttributedString *notMarkedString = [[NSAttributedString alloc] initWithString:self.text];
39 |
40 | self.attributedText = notMarkedString;
41 | _autocompleted = NO;
42 | }
43 | }
44 |
45 | - (void)removeCompletion
46 | {
47 | if (_autocompleted) {
48 | NSString *notCompletedString = self.text;
49 |
50 | if (notCompletedString.length > _lengthOriginString) {
51 | notCompletedString = [self.text substringToIndex:_lengthOriginString];
52 | }
53 |
54 | NSAttributedString *notCompletedAndNotMarkedString = [[NSAttributedString alloc] initWithString:notCompletedString];
55 | self.attributedText = notCompletedAndNotMarkedString;
56 |
57 | _autocompleted = NO;
58 | }
59 | }
60 |
61 | #pragma mark - UIKeyInput
62 |
63 | - (void)deleteBackward
64 | {
65 | if (_autocompleted) {
66 | [self removeCompletion];
67 | }
68 | else {
69 | [super deleteBackward];
70 | }
71 | }
72 |
73 | - (void)insertText:(NSString *)text
74 | {
75 | if ([self isItReturnButtonPressed:text]) {
76 | [self handleReturnButton];
77 | return;
78 | }
79 |
80 | [self removeCompletion];
81 |
82 | [super insertText:text];
83 | _lengthOriginString = self.text.length;
84 |
85 | [self completeString];
86 | }
87 |
88 | - (CGRect)caretRectForPosition:(UITextPosition *)position
89 | {
90 | CGRect caretRect = CGRectZero;
91 | if (!_autocompleted) {
92 | caretRect = [super caretRectForPosition:position];
93 | }
94 | return caretRect;
95 | }
96 |
97 | #pragma mark - Properties
98 |
99 | - (void)setText:(NSString *)text
100 | {
101 | [self removeCompletion];
102 | [super setText:text];
103 | }
104 |
105 | - (BOOL)resignFirstResponder
106 | {
107 | [self applyCompletion];
108 | return [super resignFirstResponder];
109 | }
110 |
111 | #pragma mark - Internal
112 |
113 | - (BOOL)isItReturnButtonPressed:(NSString *)text
114 | {
115 | BOOL isItReturnButton = NO;
116 |
117 | if (text.length > 0) {
118 | unichar symbol = [text characterAtIndex:0];
119 | isItReturnButton = (symbol == 10);
120 | }
121 |
122 | return isItReturnButton;
123 | }
124 |
125 | - (void)handleReturnButton
126 | {
127 | if (_autocompleted) {
128 | NSAttributedString *stringWithoutSelection = [[NSAttributedString alloc] initWithString:self.text];
129 | self.attributedText = stringWithoutSelection;
130 |
131 | _autocompleted = NO;
132 | }
133 | }
134 |
135 | - (void)completeString
136 | {
137 | NSMutableAttributedString *completedAndMarkedString = nil;
138 |
139 | NSString *endingString = [self endingString];
140 | if (endingString.length > 0) {
141 | NSString *completedString = [NSString stringWithFormat:@"%@%@", self.text, endingString];
142 |
143 | NSRange markRange = NSMakeRange(_lengthOriginString, endingString.length);
144 | UIColor *markColor = self.selectionColor;
145 |
146 | completedAndMarkedString = [[NSMutableAttributedString alloc] initWithString:completedString];
147 | [completedAndMarkedString addAttribute:NSBackgroundColorAttributeName value:markColor range:markRange];
148 | }
149 |
150 | if (completedAndMarkedString.length > 0) {
151 | self.attributedText = completedAndMarkedString;
152 | _autocompleted = YES;
153 | }
154 | }
155 |
156 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
157 | {
158 | [super touchesBegan:touches withEvent:event];
159 | [self applyCompletion];
160 | }
161 |
162 | - (NSString *)endingString
163 | {
164 | NSString *endingString = nil;
165 |
166 | if (self.text.length > 0) {
167 | NSString *completedString = [self.delegate autocompleteTextField:self completedStringForOriginString:self.text];
168 |
169 | if (completedString.length > 0) {
170 | NSRange rangeOriginString = [completedString rangeOfString:self.text];
171 | NSAssert(rangeOriginString.location == 0, @"Wrong completion string");
172 |
173 | endingString = [completedString substringFromIndex:self.text.length];
174 | }
175 | }
176 | return endingString;
177 | }
178 |
179 | @end
180 |
181 |
182 |
--------------------------------------------------------------------------------
/APAutocompleteTextFieldExample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 359D9048185B1A6600A96263 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 359D9047185B1A6600A96263 /* Foundation.framework */; };
11 | 359D904A185B1A6600A96263 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 359D9049185B1A6600A96263 /* CoreGraphics.framework */; };
12 | 359D904C185B1A6600A96263 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 359D904B185B1A6600A96263 /* UIKit.framework */; };
13 | 359D9052185B1A6600A96263 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 359D9050185B1A6600A96263 /* InfoPlist.strings */; };
14 | 359D9054185B1A6600A96263 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 359D9053185B1A6600A96263 /* main.m */; };
15 | 359D9058185B1A6600A96263 /* APAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 359D9057185B1A6600A96263 /* APAppDelegate.m */; };
16 | 359D905B185B1A6600A96263 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 359D9059185B1A6600A96263 /* Main.storyboard */; };
17 | 359D905E185B1A6600A96263 /* APViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 359D905D185B1A6600A96263 /* APViewController.m */; };
18 | 359D9060185B1A6600A96263 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 359D905F185B1A6600A96263 /* Images.xcassets */; };
19 | 359D9067185B1A6600A96263 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 359D9066185B1A6600A96263 /* XCTest.framework */; };
20 | 359D9068185B1A6600A96263 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 359D9047185B1A6600A96263 /* Foundation.framework */; };
21 | 359D9069185B1A6600A96263 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 359D904B185B1A6600A96263 /* UIKit.framework */; };
22 | 359D9071185B1A6600A96263 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 359D906F185B1A6600A96263 /* InfoPlist.strings */; };
23 | 359D9073185B1A6600A96263 /* APAutocompleteTextFieldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 359D9072185B1A6600A96263 /* APAutocompleteTextFieldTests.m */; };
24 | 359D90831861BDCD00A96263 /* APAutocompleteTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 359D90821861BDCD00A96263 /* APAutocompleteTextField.m */; };
25 | /* End PBXBuildFile section */
26 |
27 | /* Begin PBXContainerItemProxy section */
28 | 359D906A185B1A6600A96263 /* PBXContainerItemProxy */ = {
29 | isa = PBXContainerItemProxy;
30 | containerPortal = 359D903C185B1A6600A96263 /* Project object */;
31 | proxyType = 1;
32 | remoteGlobalIDString = 359D9043185B1A6600A96263;
33 | remoteInfo = APAutocompleteTextField;
34 | };
35 | /* End PBXContainerItemProxy section */
36 |
37 | /* Begin PBXFileReference section */
38 | 359D9044185B1A6600A96263 /* APAutocompleteTextFieldExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = APAutocompleteTextFieldExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
39 | 359D9047185B1A6600A96263 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
40 | 359D9049185B1A6600A96263 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
41 | 359D904B185B1A6600A96263 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
42 | 359D904F185B1A6600A96263 /* APAutocompleteTextFieldExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "APAutocompleteTextFieldExample-Info.plist"; sourceTree = ""; };
43 | 359D9051185B1A6600A96263 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
44 | 359D9053185B1A6600A96263 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
45 | 359D9055185B1A6600A96263 /* APAutocompleteTextFieldExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "APAutocompleteTextFieldExample-Prefix.pch"; sourceTree = ""; };
46 | 359D9056185B1A6600A96263 /* APAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APAppDelegate.h; sourceTree = ""; };
47 | 359D9057185B1A6600A96263 /* APAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = APAppDelegate.m; sourceTree = ""; };
48 | 359D905A185B1A6600A96263 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
49 | 359D905C185B1A6600A96263 /* APViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APViewController.h; sourceTree = ""; };
50 | 359D905D185B1A6600A96263 /* APViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = APViewController.m; sourceTree = ""; };
51 | 359D905F185B1A6600A96263 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
52 | 359D9065185B1A6600A96263 /* APAutocompleteTextFieldExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = APAutocompleteTextFieldExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
53 | 359D9066185B1A6600A96263 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
54 | 359D906E185B1A6600A96263 /* APAutocompleteTextFieldExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "APAutocompleteTextFieldExampleTests-Info.plist"; sourceTree = ""; };
55 | 359D9070185B1A6600A96263 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
56 | 359D9072185B1A6600A96263 /* APAutocompleteTextFieldTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = APAutocompleteTextFieldTests.m; sourceTree = ""; };
57 | 359D90811861BDCD00A96263 /* APAutocompleteTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAutocompleteTextField.h; sourceTree = SOURCE_ROOT; };
58 | 359D90821861BDCD00A96263 /* APAutocompleteTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAutocompleteTextField.m; sourceTree = SOURCE_ROOT; };
59 | /* End PBXFileReference section */
60 |
61 | /* Begin PBXFrameworksBuildPhase section */
62 | 359D9041185B1A6600A96263 /* Frameworks */ = {
63 | isa = PBXFrameworksBuildPhase;
64 | buildActionMask = 2147483647;
65 | files = (
66 | 359D904A185B1A6600A96263 /* CoreGraphics.framework in Frameworks */,
67 | 359D904C185B1A6600A96263 /* UIKit.framework in Frameworks */,
68 | 359D9048185B1A6600A96263 /* Foundation.framework in Frameworks */,
69 | );
70 | runOnlyForDeploymentPostprocessing = 0;
71 | };
72 | 359D9062185B1A6600A96263 /* Frameworks */ = {
73 | isa = PBXFrameworksBuildPhase;
74 | buildActionMask = 2147483647;
75 | files = (
76 | 359D9067185B1A6600A96263 /* XCTest.framework in Frameworks */,
77 | 359D9069185B1A6600A96263 /* UIKit.framework in Frameworks */,
78 | 359D9068185B1A6600A96263 /* Foundation.framework in Frameworks */,
79 | );
80 | runOnlyForDeploymentPostprocessing = 0;
81 | };
82 | /* End PBXFrameworksBuildPhase section */
83 |
84 | /* Begin PBXGroup section */
85 | 359D903B185B1A6600A96263 = {
86 | isa = PBXGroup;
87 | children = (
88 | 359D904D185B1A6600A96263 /* APAutocompleteTextField */,
89 | 359D906C185B1A6600A96263 /* APAutocompleteTextFieldTests */,
90 | 359D9046185B1A6600A96263 /* Frameworks */,
91 | 359D9045185B1A6600A96263 /* Products */,
92 | );
93 | sourceTree = "";
94 | };
95 | 359D9045185B1A6600A96263 /* Products */ = {
96 | isa = PBXGroup;
97 | children = (
98 | 359D9044185B1A6600A96263 /* APAutocompleteTextFieldExample.app */,
99 | 359D9065185B1A6600A96263 /* APAutocompleteTextFieldExampleTests.xctest */,
100 | );
101 | name = Products;
102 | sourceTree = "";
103 | };
104 | 359D9046185B1A6600A96263 /* Frameworks */ = {
105 | isa = PBXGroup;
106 | children = (
107 | 359D9047185B1A6600A96263 /* Foundation.framework */,
108 | 359D9049185B1A6600A96263 /* CoreGraphics.framework */,
109 | 359D904B185B1A6600A96263 /* UIKit.framework */,
110 | 359D9066185B1A6600A96263 /* XCTest.framework */,
111 | );
112 | name = Frameworks;
113 | sourceTree = "";
114 | };
115 | 359D904D185B1A6600A96263 /* APAutocompleteTextField */ = {
116 | isa = PBXGroup;
117 | children = (
118 | 359D907C185B1A8C00A96263 /* Autocomplete text field */,
119 | 359D9056185B1A6600A96263 /* APAppDelegate.h */,
120 | 359D9057185B1A6600A96263 /* APAppDelegate.m */,
121 | 359D9059185B1A6600A96263 /* Main.storyboard */,
122 | 359D905C185B1A6600A96263 /* APViewController.h */,
123 | 359D905D185B1A6600A96263 /* APViewController.m */,
124 | 359D905F185B1A6600A96263 /* Images.xcassets */,
125 | 359D904E185B1A6600A96263 /* Supporting Files */,
126 | );
127 | path = APAutocompleteTextField;
128 | sourceTree = "";
129 | };
130 | 359D904E185B1A6600A96263 /* Supporting Files */ = {
131 | isa = PBXGroup;
132 | children = (
133 | 359D904F185B1A6600A96263 /* APAutocompleteTextFieldExample-Info.plist */,
134 | 359D9050185B1A6600A96263 /* InfoPlist.strings */,
135 | 359D9053185B1A6600A96263 /* main.m */,
136 | 359D9055185B1A6600A96263 /* APAutocompleteTextFieldExample-Prefix.pch */,
137 | );
138 | name = "Supporting Files";
139 | sourceTree = "";
140 | };
141 | 359D906C185B1A6600A96263 /* APAutocompleteTextFieldTests */ = {
142 | isa = PBXGroup;
143 | children = (
144 | 359D9072185B1A6600A96263 /* APAutocompleteTextFieldTests.m */,
145 | 359D906D185B1A6600A96263 /* Supporting Files */,
146 | );
147 | path = APAutocompleteTextFieldTests;
148 | sourceTree = "";
149 | };
150 | 359D906D185B1A6600A96263 /* Supporting Files */ = {
151 | isa = PBXGroup;
152 | children = (
153 | 359D906E185B1A6600A96263 /* APAutocompleteTextFieldExampleTests-Info.plist */,
154 | 359D906F185B1A6600A96263 /* InfoPlist.strings */,
155 | );
156 | name = "Supporting Files";
157 | sourceTree = "";
158 | };
159 | 359D907C185B1A8C00A96263 /* Autocomplete text field */ = {
160 | isa = PBXGroup;
161 | children = (
162 | 359D90811861BDCD00A96263 /* APAutocompleteTextField.h */,
163 | 359D90821861BDCD00A96263 /* APAutocompleteTextField.m */,
164 | );
165 | name = "Autocomplete text field";
166 | sourceTree = "";
167 | };
168 | /* End PBXGroup section */
169 |
170 | /* Begin PBXNativeTarget section */
171 | 359D9043185B1A6600A96263 /* APAutocompleteTextFieldExample */ = {
172 | isa = PBXNativeTarget;
173 | buildConfigurationList = 359D9076185B1A6600A96263 /* Build configuration list for PBXNativeTarget "APAutocompleteTextFieldExample" */;
174 | buildPhases = (
175 | 359D9040185B1A6600A96263 /* Sources */,
176 | 359D9041185B1A6600A96263 /* Frameworks */,
177 | 359D9042185B1A6600A96263 /* Resources */,
178 | );
179 | buildRules = (
180 | );
181 | dependencies = (
182 | );
183 | name = APAutocompleteTextFieldExample;
184 | productName = APAutocompleteTextField;
185 | productReference = 359D9044185B1A6600A96263 /* APAutocompleteTextFieldExample.app */;
186 | productType = "com.apple.product-type.application";
187 | };
188 | 359D9064185B1A6600A96263 /* APAutocompleteTextFieldExampleTests */ = {
189 | isa = PBXNativeTarget;
190 | buildConfigurationList = 359D9079185B1A6600A96263 /* Build configuration list for PBXNativeTarget "APAutocompleteTextFieldExampleTests" */;
191 | buildPhases = (
192 | 359D9061185B1A6600A96263 /* Sources */,
193 | 359D9062185B1A6600A96263 /* Frameworks */,
194 | 359D9063185B1A6600A96263 /* Resources */,
195 | );
196 | buildRules = (
197 | );
198 | dependencies = (
199 | 359D906B185B1A6600A96263 /* PBXTargetDependency */,
200 | );
201 | name = APAutocompleteTextFieldExampleTests;
202 | productName = APAutocompleteTextFieldTests;
203 | productReference = 359D9065185B1A6600A96263 /* APAutocompleteTextFieldExampleTests.xctest */;
204 | productType = "com.apple.product-type.bundle.unit-test";
205 | };
206 | /* End PBXNativeTarget section */
207 |
208 | /* Begin PBXProject section */
209 | 359D903C185B1A6600A96263 /* Project object */ = {
210 | isa = PBXProject;
211 | attributes = {
212 | CLASSPREFIX = AP;
213 | LastUpgradeCheck = 0500;
214 | ORGANIZATIONNAME = brainSTrainer;
215 | TargetAttributes = {
216 | 359D9064185B1A6600A96263 = {
217 | TestTargetID = 359D9043185B1A6600A96263;
218 | };
219 | };
220 | };
221 | buildConfigurationList = 359D903F185B1A6600A96263 /* Build configuration list for PBXProject "APAutocompleteTextFieldExample" */;
222 | compatibilityVersion = "Xcode 3.2";
223 | developmentRegion = English;
224 | hasScannedForEncodings = 0;
225 | knownRegions = (
226 | en,
227 | Base,
228 | );
229 | mainGroup = 359D903B185B1A6600A96263;
230 | productRefGroup = 359D9045185B1A6600A96263 /* Products */;
231 | projectDirPath = "";
232 | projectRoot = "";
233 | targets = (
234 | 359D9043185B1A6600A96263 /* APAutocompleteTextFieldExample */,
235 | 359D9064185B1A6600A96263 /* APAutocompleteTextFieldExampleTests */,
236 | );
237 | };
238 | /* End PBXProject section */
239 |
240 | /* Begin PBXResourcesBuildPhase section */
241 | 359D9042185B1A6600A96263 /* Resources */ = {
242 | isa = PBXResourcesBuildPhase;
243 | buildActionMask = 2147483647;
244 | files = (
245 | 359D9060185B1A6600A96263 /* Images.xcassets in Resources */,
246 | 359D9052185B1A6600A96263 /* InfoPlist.strings in Resources */,
247 | 359D905B185B1A6600A96263 /* Main.storyboard in Resources */,
248 | );
249 | runOnlyForDeploymentPostprocessing = 0;
250 | };
251 | 359D9063185B1A6600A96263 /* Resources */ = {
252 | isa = PBXResourcesBuildPhase;
253 | buildActionMask = 2147483647;
254 | files = (
255 | 359D9071185B1A6600A96263 /* InfoPlist.strings in Resources */,
256 | );
257 | runOnlyForDeploymentPostprocessing = 0;
258 | };
259 | /* End PBXResourcesBuildPhase section */
260 |
261 | /* Begin PBXSourcesBuildPhase section */
262 | 359D9040185B1A6600A96263 /* Sources */ = {
263 | isa = PBXSourcesBuildPhase;
264 | buildActionMask = 2147483647;
265 | files = (
266 | 359D90831861BDCD00A96263 /* APAutocompleteTextField.m in Sources */,
267 | 359D9054185B1A6600A96263 /* main.m in Sources */,
268 | 359D905E185B1A6600A96263 /* APViewController.m in Sources */,
269 | 359D9058185B1A6600A96263 /* APAppDelegate.m in Sources */,
270 | );
271 | runOnlyForDeploymentPostprocessing = 0;
272 | };
273 | 359D9061185B1A6600A96263 /* Sources */ = {
274 | isa = PBXSourcesBuildPhase;
275 | buildActionMask = 2147483647;
276 | files = (
277 | 359D9073185B1A6600A96263 /* APAutocompleteTextFieldTests.m in Sources */,
278 | );
279 | runOnlyForDeploymentPostprocessing = 0;
280 | };
281 | /* End PBXSourcesBuildPhase section */
282 |
283 | /* Begin PBXTargetDependency section */
284 | 359D906B185B1A6600A96263 /* PBXTargetDependency */ = {
285 | isa = PBXTargetDependency;
286 | target = 359D9043185B1A6600A96263 /* APAutocompleteTextFieldExample */;
287 | targetProxy = 359D906A185B1A6600A96263 /* PBXContainerItemProxy */;
288 | };
289 | /* End PBXTargetDependency section */
290 |
291 | /* Begin PBXVariantGroup section */
292 | 359D9050185B1A6600A96263 /* InfoPlist.strings */ = {
293 | isa = PBXVariantGroup;
294 | children = (
295 | 359D9051185B1A6600A96263 /* en */,
296 | );
297 | name = InfoPlist.strings;
298 | sourceTree = "";
299 | };
300 | 359D9059185B1A6600A96263 /* Main.storyboard */ = {
301 | isa = PBXVariantGroup;
302 | children = (
303 | 359D905A185B1A6600A96263 /* Base */,
304 | );
305 | name = Main.storyboard;
306 | sourceTree = "";
307 | };
308 | 359D906F185B1A6600A96263 /* InfoPlist.strings */ = {
309 | isa = PBXVariantGroup;
310 | children = (
311 | 359D9070185B1A6600A96263 /* en */,
312 | );
313 | name = InfoPlist.strings;
314 | sourceTree = "";
315 | };
316 | /* End PBXVariantGroup section */
317 |
318 | /* Begin XCBuildConfiguration section */
319 | 359D9074185B1A6600A96263 /* Debug */ = {
320 | isa = XCBuildConfiguration;
321 | buildSettings = {
322 | ALWAYS_SEARCH_USER_PATHS = NO;
323 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
324 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
325 | CLANG_CXX_LIBRARY = "libc++";
326 | CLANG_ENABLE_MODULES = YES;
327 | CLANG_ENABLE_OBJC_ARC = YES;
328 | CLANG_WARN_BOOL_CONVERSION = YES;
329 | CLANG_WARN_CONSTANT_CONVERSION = YES;
330 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
331 | CLANG_WARN_EMPTY_BODY = YES;
332 | CLANG_WARN_ENUM_CONVERSION = YES;
333 | CLANG_WARN_INT_CONVERSION = YES;
334 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
335 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
336 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
337 | COPY_PHASE_STRIP = NO;
338 | GCC_C_LANGUAGE_STANDARD = gnu99;
339 | GCC_DYNAMIC_NO_PIC = NO;
340 | GCC_OPTIMIZATION_LEVEL = 0;
341 | GCC_PREPROCESSOR_DEFINITIONS = (
342 | "DEBUG=1",
343 | "$(inherited)",
344 | );
345 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
346 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
347 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
348 | GCC_WARN_UNDECLARED_SELECTOR = YES;
349 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
350 | GCC_WARN_UNUSED_FUNCTION = YES;
351 | GCC_WARN_UNUSED_VARIABLE = YES;
352 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
353 | ONLY_ACTIVE_ARCH = YES;
354 | SDKROOT = iphoneos;
355 | };
356 | name = Debug;
357 | };
358 | 359D9075185B1A6600A96263 /* Release */ = {
359 | isa = XCBuildConfiguration;
360 | buildSettings = {
361 | ALWAYS_SEARCH_USER_PATHS = NO;
362 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
363 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
364 | CLANG_CXX_LIBRARY = "libc++";
365 | CLANG_ENABLE_MODULES = YES;
366 | CLANG_ENABLE_OBJC_ARC = YES;
367 | CLANG_WARN_BOOL_CONVERSION = YES;
368 | CLANG_WARN_CONSTANT_CONVERSION = YES;
369 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
370 | CLANG_WARN_EMPTY_BODY = YES;
371 | CLANG_WARN_ENUM_CONVERSION = YES;
372 | CLANG_WARN_INT_CONVERSION = YES;
373 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
374 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
375 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
376 | COPY_PHASE_STRIP = YES;
377 | ENABLE_NS_ASSERTIONS = NO;
378 | GCC_C_LANGUAGE_STANDARD = gnu99;
379 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
380 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
381 | GCC_WARN_UNDECLARED_SELECTOR = YES;
382 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
383 | GCC_WARN_UNUSED_FUNCTION = YES;
384 | GCC_WARN_UNUSED_VARIABLE = YES;
385 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
386 | SDKROOT = iphoneos;
387 | VALIDATE_PRODUCT = YES;
388 | };
389 | name = Release;
390 | };
391 | 359D9077185B1A6600A96263 /* Debug */ = {
392 | isa = XCBuildConfiguration;
393 | buildSettings = {
394 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
395 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
396 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
397 | GCC_PREFIX_HEADER = "APAutocompleteTextField/APAutocompleteTextFieldExample-Prefix.pch";
398 | INFOPLIST_FILE = "APAutocompleteTextField/APAutocompleteTextFieldExample-Info.plist";
399 | PRODUCT_NAME = APAutocompleteTextFieldExample;
400 | WRAPPER_EXTENSION = app;
401 | };
402 | name = Debug;
403 | };
404 | 359D9078185B1A6600A96263 /* Release */ = {
405 | isa = XCBuildConfiguration;
406 | buildSettings = {
407 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
408 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
409 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
410 | GCC_PREFIX_HEADER = "APAutocompleteTextField/APAutocompleteTextFieldExample-Prefix.pch";
411 | INFOPLIST_FILE = "APAutocompleteTextField/APAutocompleteTextFieldExample-Info.plist";
412 | PRODUCT_NAME = APAutocompleteTextFieldExample;
413 | WRAPPER_EXTENSION = app;
414 | };
415 | name = Release;
416 | };
417 | 359D907A185B1A6600A96263 /* Debug */ = {
418 | isa = XCBuildConfiguration;
419 | buildSettings = {
420 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
421 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/APAutocompleteTextField.app/APAutocompleteTextField";
422 | FRAMEWORK_SEARCH_PATHS = (
423 | "$(SDKROOT)/Developer/Library/Frameworks",
424 | "$(inherited)",
425 | "$(DEVELOPER_FRAMEWORKS_DIR)",
426 | );
427 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
428 | GCC_PREFIX_HEADER = "APAutocompleteTextField/APAutocompleteTextField-Prefix.pch";
429 | GCC_PREPROCESSOR_DEFINITIONS = (
430 | "DEBUG=1",
431 | "$(inherited)",
432 | );
433 | INFOPLIST_FILE = "APAutocompleteTextFieldTests/APAutocompleteTextFieldExampleTests-Info.plist";
434 | PRODUCT_NAME = APAutocompleteTextFieldExampleTests;
435 | TEST_HOST = "$(BUNDLE_LOADER)";
436 | WRAPPER_EXTENSION = xctest;
437 | };
438 | name = Debug;
439 | };
440 | 359D907B185B1A6600A96263 /* Release */ = {
441 | isa = XCBuildConfiguration;
442 | buildSettings = {
443 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
444 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/APAutocompleteTextField.app/APAutocompleteTextField";
445 | FRAMEWORK_SEARCH_PATHS = (
446 | "$(SDKROOT)/Developer/Library/Frameworks",
447 | "$(inherited)",
448 | "$(DEVELOPER_FRAMEWORKS_DIR)",
449 | );
450 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
451 | GCC_PREFIX_HEADER = "APAutocompleteTextField/APAutocompleteTextField-Prefix.pch";
452 | INFOPLIST_FILE = "APAutocompleteTextFieldTests/APAutocompleteTextFieldExampleTests-Info.plist";
453 | PRODUCT_NAME = APAutocompleteTextFieldExampleTests;
454 | TEST_HOST = "$(BUNDLE_LOADER)";
455 | WRAPPER_EXTENSION = xctest;
456 | };
457 | name = Release;
458 | };
459 | /* End XCBuildConfiguration section */
460 |
461 | /* Begin XCConfigurationList section */
462 | 359D903F185B1A6600A96263 /* Build configuration list for PBXProject "APAutocompleteTextFieldExample" */ = {
463 | isa = XCConfigurationList;
464 | buildConfigurations = (
465 | 359D9074185B1A6600A96263 /* Debug */,
466 | 359D9075185B1A6600A96263 /* Release */,
467 | );
468 | defaultConfigurationIsVisible = 0;
469 | defaultConfigurationName = Release;
470 | };
471 | 359D9076185B1A6600A96263 /* Build configuration list for PBXNativeTarget "APAutocompleteTextFieldExample" */ = {
472 | isa = XCConfigurationList;
473 | buildConfigurations = (
474 | 359D9077185B1A6600A96263 /* Debug */,
475 | 359D9078185B1A6600A96263 /* Release */,
476 | );
477 | defaultConfigurationIsVisible = 0;
478 | defaultConfigurationName = Release;
479 | };
480 | 359D9079185B1A6600A96263 /* Build configuration list for PBXNativeTarget "APAutocompleteTextFieldExampleTests" */ = {
481 | isa = XCConfigurationList;
482 | buildConfigurations = (
483 | 359D907A185B1A6600A96263 /* Debug */,
484 | 359D907B185B1A6600A96263 /* Release */,
485 | );
486 | defaultConfigurationIsVisible = 0;
487 | defaultConfigurationName = Release;
488 | };
489 | /* End XCConfigurationList section */
490 | };
491 | rootObject = 359D903C185B1A6600A96263 /* Project object */;
492 | }
493 |
--------------------------------------------------------------------------------