├── BSWQuickType
├── .DS_Store
├── BSWQuickType
│ ├── .DS_Store
│ ├── AppDelegate.h
│ ├── main.m
│ ├── ViewController.h
│ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Info.plist
│ ├── Base.lproj
│ │ ├── Main.storyboard
│ │ └── LaunchScreen.xib
│ ├── ViewController.m
│ ├── BSWQuickType.h
│ ├── AppDelegate.m
│ └── BSWQuickType.m
├── BSWQuickType.xcodeproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── project.pbxproj
└── BSWQuickTypeTests
│ ├── Info.plist
│ └── BSWQuickTypeTests.m
├── .gitignore
├── LICENSE
└── README.md
/BSWQuickType/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BisonSoftware/BSWQuickType/HEAD/BSWQuickType/.DS_Store
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickType/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BisonSoftware/BSWQuickType/HEAD/BSWQuickType/BSWQuickType/.DS_Store
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickType.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickType/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // BSWQuickType
4 | //
5 | // Created by Zane Helton on 2/6/15.
6 | // Copyright (c) 2015 BisonSoftware. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickType/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // BSWQuickType
4 | //
5 | // Created by Zane Helton on 2/6/15.
6 | // Copyright (c) 2015 BisonSoftware. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickType/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // BSWQuickType
4 | //
5 | // Created by Zane Helton on 2/6/15.
6 | // Copyright (c) 2015 BisonSoftware. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "BSWQuickType.h"
11 |
12 | // UITextFieldDelegate is NOT required.
13 | @interface ViewController : UIViewController
14 |
15 | @end
16 |
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | xcuserdata
13 | *.xccheckout
14 | *.moved-aside
15 | DerivedData
16 | *.hmap
17 | *.ipa
18 | *.xcuserstate
19 |
20 | # CocoaPods
21 | #
22 | # We recommend against adding the Pods directory to your .gitignore. However
23 | # you should judge for yourself, the pros and cons are mentioned at:
24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
25 | #
26 | # Pods/
27 |
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickType/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" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickTypeTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | us.BisonSoftware.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickTypeTests/BSWQuickTypeTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // BSWQuickTypeTests.m
3 | // BSWQuickTypeTests
4 | //
5 | // Created by Zane Helton on 2/6/15.
6 | // Copyright (c) 2015 BisonSoftware. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface BSWQuickTypeTests : XCTestCase
13 |
14 | @end
15 |
16 | @implementation BSWQuickTypeTests
17 |
18 | - (void)setUp {
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 | // Put teardown code here. This method is called after the invocation of each test method in the class.
25 | [super tearDown];
26 | }
27 |
28 | - (void)testExample {
29 | // This is an example of a functional test case.
30 | XCTAssert(YES, @"Pass");
31 | }
32 |
33 | - (void)testPerformanceExample {
34 | // This is an example of a performance test case.
35 | [self measureBlock:^{
36 | // Put the code you want to measure the time of here.
37 | }];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, 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,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickType/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | us.BisonSoftware.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickType/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 |
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickType/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // BSWQuickType
4 | //
5 | // Created by Zane Helton on 2/6/15.
6 | // Copyright (c) 2015 BisonSoftware. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | @interface ViewController () {
12 | UITextField *_exampleTextField;
13 | BSWQuickType *quickTypeView;
14 | NSArray *_namesArray;
15 | }
16 |
17 | @end
18 |
19 | @implementation ViewController
20 |
21 | - (void)viewDidLoad {
22 | [super viewDidLoad];
23 | [self.view setBackgroundColor:[UIColor whiteColor]];
24 | _namesArray = @[@"Bison", @"Software's", @"Quick", @"Type", @"Library", @"Enjoy! 😀", @"Really Long Words!"];
25 | _exampleTextField = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMidX(self.view.frame) - 200/2,
26 | 55,
27 | 200,
28 | 40)];
29 | [_exampleTextField setBorderStyle:UITextBorderStyleRoundedRect];
30 | [_exampleTextField setPlaceholder:@"Start typing!"];
31 | [_exampleTextField setTextColor:[UIColor whiteColor]];
32 | [_exampleTextField setBackgroundColor:[UIColor lightGrayColor]];
33 | quickTypeView = [[BSWQuickType alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 36)
34 | suggestionArray:_namesArray
35 | filterSuggestions:YES
36 | onTextField:_exampleTextField];
37 | quickTypeView.quickTypeShouldScroll = YES;
38 | quickTypeView.quickTypePagingEnabled = YES;
39 | quickTypeView.delegate = self;
40 |
41 | [_exampleTextField setDelegate:self];
42 | [self.view addSubview:_exampleTextField];
43 | }
44 |
45 | - (void)quickType:(BSWQuickType *)quickType selectedButtonAtIndex:(NSInteger)buttonIndex withArray:(NSArray *)resultsArray {
46 | [quickTypeView.textField insertText:resultsArray[buttonIndex]];
47 | }
48 |
49 | - (BOOL)textFieldShouldReturn:(UITextField *)textField {
50 | [textField resignFirstResponder];
51 | return YES;
52 | }
53 |
54 | - (void)didReceiveMemoryWarning {
55 | [super didReceiveMemoryWarning];
56 | }
57 |
58 | @end
59 |
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickType/BSWQuickType.h:
--------------------------------------------------------------------------------
1 | //
2 | // BSWQuickType.h
3 | // BSWQuickType
4 | //
5 | // Created by Zane Helton on 2/6/15.
6 | // Copyright (c) 2015 BisonSoftware. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @protocol BSWQuickTypeDelegate;
12 |
13 | @interface BSWQuickType : UIScrollView {
14 | __weak id delegate;
15 | }
16 |
17 | #pragma mark - Configurations
18 | @property (assign) BOOL quickTypeShouldScroll;
19 | @property (assign) BOOL quickTypePagingEnabled;
20 | @property (assign) BOOL quickTypeBouncingEnabled;
21 | @property (assign) BOOL quickTypeFilter;
22 | #pragma mark -
23 |
24 | @property (nonatomic, strong) UITextField *textField;
25 |
26 | @property (weak) id delegate;
27 |
28 | /**
29 | * Initializes the InputAccessoryView that can be used later on your TextField.
30 | *
31 | * @param frame The frame in which you want the accessory view to be. Defaults to the size of QuickType.
32 | * @param suggestionArray An array of words you want placed inside the QuickType bar.
33 | * @param filter Whether or not you want the words to adjust based on what the user types.
34 | *
35 | * @return Returns a UIScrollView in which your can place in the InputAccessoryView of your TextField.
36 | */
37 | - (instancetype)initWithFrame:(CGRect)frame
38 | suggestionArray:(NSArray *)suggestionArray
39 | filterSuggestions:(BOOL)filter
40 | onTextField:(UITextField *)textField;
41 |
42 | - (void)hideQuickType;
43 |
44 | - (void)showQuickType;
45 |
46 | @end
47 |
48 | @protocol BSWQuickTypeDelegate
49 |
50 | @required
51 | /**
52 | * Called whenever a user taps one of the suggestions.
53 | *
54 | * @param quickType The QuickType object that sent the message.
55 | * @param buttonIndex The index in the suggestions array that was tapped.
56 | * @param resultsArray Returns the array used in the QuickType view. If you are using the filter, you must use this array rather than your own.
57 | */
58 | - (void)quickType:(BSWQuickType *)quickType selectedButtonAtIndex:(NSInteger)buttonIndex withArray:(NSArray *)resultsArray;
59 |
60 | @end
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickType/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // BSWQuickType
4 | //
5 | // Created by Zane Helton on 2/6/15.
6 | // Copyright (c) 2015 BisonSoftware. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 | - (void)applicationWillResignActive:(UIApplication *)application {
24 | // 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.
25 | // 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.
26 | }
27 |
28 | - (void)applicationDidEnterBackground:(UIApplication *)application {
29 | // 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.
30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
31 | }
32 |
33 | - (void)applicationWillEnterForeground:(UIApplication *)application {
34 | // 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.
35 | }
36 |
37 | - (void)applicationDidBecomeActive:(UIApplication *)application {
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 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickType/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BSWQuickType
2 | Imitates the functionality of Apple's QuickType with the ability to fill in custom elements rather than suggested words.
3 |
4 | `BSWQuickType` is a great way to suggest more relevant words to your users than Apple's QuickType will. This `UIScrollView` works by attaching to the top of the users keyboard and allowing them to tap the suggestions.
5 |
6 | - Bison Software: http://www.bison.software/
7 |
8 | 
9 |
10 | ## Usage
11 | ### Import
12 | First you're going to want to import the `BSWQuickType` files by adding the files to your project then adding an import statement to the top of your .h file like so:
13 |
14 | `#import "BSWQuickType.h"`
15 |
16 | ### Delegate
17 | You'll then want to conform your current class to the `BSWQuickTypeDelegate` by adding `` to your .h file.
18 |
19 | ### Initialize
20 | Now you'll be able to create a `BSWQuickType` object in your .m file. It's recommended you make your `BSWQuickType` object an instance variable in case you need to use it outside of the method it's being initialized in. To create your `BSWQuickType` object, use the following lines:
21 |
22 | ```objective-c
23 | BSWQuickType *quickTypeView = [[BSWQuickType alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 36) suggestionArray:@[@"Text", @"For", @"You"] filterSuggestions:YES onTextField:_demoTextField];
24 | ```
25 |
26 | This'll create a `BSWQuickType` view object automatically, and nothing else is required in order for it to work, although there are a few configurations.
27 |
28 | ## Configurations
29 | - `quickTypeShouldScroll` - Should the user be able to scroll the suggestions. (BOOL)
30 | - `quickTypePagingEnabled` - Should the scroll view have "pages" of suggestions when scrolling, or should it be continuous scrolling. (BOOL)
31 | - `quickTypeBouncingEnabled` - Determines if the scroll view should bounce if the user goes too far to once side when scrolling. (BOOL)
32 | - `quickTypeFilter` - Should the BSWQuickType filter through your suggestions and give the most relevant ones first. (BOOL)
33 |
34 | ## Protocols
35 | ```objective-c
36 | - (void)quickType:(BSWQuickType *)quickType selectedButtonAtIndex:(NSInteger)buttonIndex withArray:(NSArray *)resultsArray;
37 | ```
38 |
39 | This is the only protocol currently available in `BSWQuickType` and is called whenever a user taps a suggestion. The method allows the use of the current `BSWQuickType` object, the suggestion button's index, and finally the array used if filtering is enabled.
40 |
41 | ## Methods
42 | ```- (void)hideQuickType;```
43 | Hides the QuickType view from the user.
44 |
45 | ```- (void)showQuickType;```
46 | Shows the QuickType view to the user.
47 |
48 | ## TODO
49 | - [x] Make it visually more similar to Apple's QuickType
50 |
51 | ## License
52 | The MIT License (MIT)
53 |
54 | Copyright (c) 2015
55 |
56 | Permission is hereby granted, free of charge, to any person obtaining a copy
57 | of this software and associated documentation files (the "Software"), to deal
58 | in the Software without restriction, including without limitation the rights
59 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
60 | copies of the Software, and to permit persons to whom the Software is
61 | furnished to do so, subject to the following conditions:
62 |
63 | The above copyright notice and this permission notice shall be included in all
64 | copies or substantial portions of the Software.
65 |
66 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
67 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
68 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
69 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
70 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
71 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
72 | SOFTWARE.
73 |
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickType/BSWQuickType.m:
--------------------------------------------------------------------------------
1 | //
2 | // BSWQuickType.m
3 | // BSWQuickType
4 | //
5 | // Created by Zane Helton on 2/6/15.
6 | // Copyright (c) 2015 BisonSoftware. All rights reserved.
7 | //
8 |
9 | #import "BSWQuickType.h"
10 |
11 | @implementation BSWQuickType {
12 | NSArray *_suggestionArray;
13 | NSArray *_contents;
14 | NSArray *_searchResults;
15 | CGRect _frame;
16 | }
17 | @synthesize delegate;
18 |
19 | #pragma mark - Initializer / Dealloc
20 | - (instancetype)initWithFrame:(CGRect)frame
21 | suggestionArray:(NSArray *)suggestionArray
22 | filterSuggestions:(BOOL)filter
23 | onTextField:(UITextField *)textField {
24 | self = [super initWithFrame:frame];
25 | // change this if you need a different background color (only seen if bounce is enabled)
26 | [self setBackgroundColor:[UIColor clearColor]];
27 |
28 | _suggestionArray = suggestionArray;
29 | _textField = textField;
30 | _frame = frame;
31 | _quickTypeFilter = filter;
32 | _searchResults = _suggestionArray;
33 |
34 | [self updateQuickTypeWithContents:suggestionArray frame:frame];
35 |
36 | [_textField addTarget:self
37 | action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
38 |
39 | [textField setInputAccessoryView:self];
40 | [textField setAutocorrectionType:UITextAutocorrectionTypeNo];
41 | return self;
42 | }
43 |
44 | - (void)dealloc {
45 | [_textField removeTarget:self
46 | action:@selector(textFieldDidChange:)
47 | forControlEvents:UIControlEventEditingChanged];
48 | }
49 | #pragma mark -
50 |
51 | #pragma mark - Do'er methods
52 | - (void)drawRect:(CGRect)rect {
53 | [self setContentSize:CGSizeMake(rect.size.width, rect.size.height)];
54 |
55 | if (_quickTypeShouldScroll) {
56 | // makes the scroll view bigger so it can actually scroll
57 | [self setContentSize:CGSizeMake(_contents.count*rect.size.width/3, self.frame.size.height)];
58 | }
59 |
60 | if (_quickTypePagingEnabled) {
61 | [self setPagingEnabled:YES];
62 | }
63 |
64 | if (_quickTypeBouncingEnabled) {
65 | [self setBounces:YES];
66 | }
67 | }
68 |
69 | - (IBAction)suggestionTapped:(UIButton *)sender {
70 | [delegate quickType:self selectedButtonAtIndex:sender.tag withArray:_searchResults];
71 | }
72 |
73 | - (void)textFieldDidChange:(UITextField *)sender {
74 | NSArray *tempArray = _suggestionArray;
75 | NSString *searchString = sender.text;
76 |
77 | NSPredicate *searchSearch = [NSPredicate predicateWithFormat:@"self BEGINSWITH[cd] %@", searchString];
78 | NSArray *searchResults = [tempArray filteredArrayUsingPredicate:searchSearch];
79 |
80 | if (searchResults.count == 0 || !_quickTypeFilter) {
81 | _searchResults = _suggestionArray;
82 | [self updateQuickTypeWithContents:_suggestionArray frame:_frame];
83 | } else {
84 | _searchResults = searchResults;
85 | [self updateQuickTypeWithContents:searchResults frame:_frame];
86 | }
87 | }
88 |
89 | - (void)updateQuickTypeWithContents:(NSArray *)contents frame:(CGRect)frame {
90 | _contents = contents;
91 | [self drawRect:frame];
92 | [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
93 |
94 | // displays all the buttons in the scroll view
95 | for (int i = 0; i < contents.count; i++) {
96 | CALayer *borderLeft = [CALayer layer];
97 | borderLeft.frame = CGRectMake(0, 0, 0.5, frame.size.height);
98 | [borderLeft setBackgroundColor:[UIColor colorWithWhite:1 alpha:0.5].CGColor];
99 | CALayer *borderRight = [CALayer layer];
100 | borderRight.frame = CGRectMake(0, 0, 0.5, frame.size.height);
101 | [borderRight setBackgroundColor:[UIColor colorWithWhite:1 alpha:0.5].CGColor];
102 |
103 | UIButton *suggestionButton = [[UIButton alloc] initWithFrame:CGRectMake(i*frame.size.width/3,
104 | 0,
105 | frame.size.width/3,
106 | frame.size.height)];
107 |
108 | [suggestionButton setTitle:contents[i] forState:UIControlStateNormal];
109 | [suggestionButton.titleLabel setLineBreakMode:NSLineBreakByTruncatingTail];
110 |
111 | // styling
112 | [suggestionButton setBackgroundImage:[self setColor:[UIColor colorWithRed:173.0/255 green:180.0/255 blue:190.0/255 alpha:1]]
113 | forState:UIControlStateNormal];
114 | [suggestionButton setBackgroundImage:[self setColor:[UIColor colorWithRed:235.0/255 green:237.0/255 blue:239.0/255 alpha:1]]
115 | forState:UIControlStateHighlighted];
116 | [suggestionButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
117 | [suggestionButton setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted];
118 |
119 | [suggestionButton setTag:i];
120 | [suggestionButton setClipsToBounds:YES];
121 | [suggestionButton.layer addSublayer:borderLeft];
122 | [suggestionButton.layer addSublayer:borderRight];
123 | [suggestionButton addTarget:self
124 | action:@selector(suggestionTapped:) forControlEvents:UIControlEventTouchUpInside];
125 | [self addSubview:suggestionButton];
126 | }
127 | }
128 |
129 | - (void)hideQuickType {
130 | [self setHidden:YES];
131 | }
132 |
133 | - (void)showQuickType {
134 | [self setHidden:NO];
135 | }
136 | #pragma mark -
137 |
138 | #pragma mark - Helper methods
139 | - (UIImage *)setColor:(UIColor *)color
140 | {
141 | UIView *colorView = [[UIView alloc] initWithFrame:self.frame];
142 | colorView.backgroundColor = color;
143 |
144 | UIGraphicsBeginImageContext(colorView.bounds.size);
145 | [colorView.layer renderInContext:UIGraphicsGetCurrentContext()];
146 |
147 | UIImage *colorImage = UIGraphicsGetImageFromCurrentImageContext();
148 | UIGraphicsEndImageContext();
149 |
150 | return colorImage;
151 | }
152 | #pragma -
153 |
154 | @end
155 |
--------------------------------------------------------------------------------
/BSWQuickType/BSWQuickType.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 2F6DD9421A858B2D00E6BC7D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F6DD9411A858B2D00E6BC7D /* main.m */; };
11 | 2F6DD9451A858B2D00E6BC7D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F6DD9441A858B2D00E6BC7D /* AppDelegate.m */; };
12 | 2F6DD9481A858B2D00E6BC7D /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F6DD9471A858B2D00E6BC7D /* ViewController.m */; };
13 | 2F6DD94B1A858B2D00E6BC7D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2F6DD9491A858B2D00E6BC7D /* Main.storyboard */; };
14 | 2F6DD94D1A858B2D00E6BC7D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2F6DD94C1A858B2D00E6BC7D /* Images.xcassets */; };
15 | 2F6DD9501A858B2D00E6BC7D /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2F6DD94E1A858B2D00E6BC7D /* LaunchScreen.xib */; };
16 | 2F6DD95C1A858B2D00E6BC7D /* BSWQuickTypeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F6DD95B1A858B2D00E6BC7D /* BSWQuickTypeTests.m */; };
17 | 2F6DD96B1A85919E00E6BC7D /* BSWQuickType.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F6DD96A1A85919E00E6BC7D /* BSWQuickType.m */; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXContainerItemProxy section */
21 | 2F6DD9561A858B2D00E6BC7D /* PBXContainerItemProxy */ = {
22 | isa = PBXContainerItemProxy;
23 | containerPortal = 2F6DD9341A858B2D00E6BC7D /* Project object */;
24 | proxyType = 1;
25 | remoteGlobalIDString = 2F6DD93B1A858B2D00E6BC7D;
26 | remoteInfo = BSWQuickType;
27 | };
28 | /* End PBXContainerItemProxy section */
29 |
30 | /* Begin PBXFileReference section */
31 | 2F6DD93C1A858B2D00E6BC7D /* BSWQuickType.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BSWQuickType.app; sourceTree = BUILT_PRODUCTS_DIR; };
32 | 2F6DD9401A858B2D00E6BC7D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
33 | 2F6DD9411A858B2D00E6BC7D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
34 | 2F6DD9431A858B2D00E6BC7D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
35 | 2F6DD9441A858B2D00E6BC7D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
36 | 2F6DD9461A858B2D00E6BC7D /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
37 | 2F6DD9471A858B2D00E6BC7D /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
38 | 2F6DD94A1A858B2D00E6BC7D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
39 | 2F6DD94C1A858B2D00E6BC7D /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
40 | 2F6DD94F1A858B2D00E6BC7D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
41 | 2F6DD9551A858B2D00E6BC7D /* BSWQuickTypeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BSWQuickTypeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
42 | 2F6DD95A1A858B2D00E6BC7D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
43 | 2F6DD95B1A858B2D00E6BC7D /* BSWQuickTypeTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BSWQuickTypeTests.m; sourceTree = ""; };
44 | 2F6DD9691A85919E00E6BC7D /* BSWQuickType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSWQuickType.h; sourceTree = ""; };
45 | 2F6DD96A1A85919E00E6BC7D /* BSWQuickType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSWQuickType.m; sourceTree = ""; };
46 | /* End PBXFileReference section */
47 |
48 | /* Begin PBXFrameworksBuildPhase section */
49 | 2F6DD9391A858B2D00E6BC7D /* Frameworks */ = {
50 | isa = PBXFrameworksBuildPhase;
51 | buildActionMask = 2147483647;
52 | files = (
53 | );
54 | runOnlyForDeploymentPostprocessing = 0;
55 | };
56 | 2F6DD9521A858B2D00E6BC7D /* Frameworks */ = {
57 | isa = PBXFrameworksBuildPhase;
58 | buildActionMask = 2147483647;
59 | files = (
60 | );
61 | runOnlyForDeploymentPostprocessing = 0;
62 | };
63 | /* End PBXFrameworksBuildPhase section */
64 |
65 | /* Begin PBXGroup section */
66 | 2F6DD9331A858B2D00E6BC7D = {
67 | isa = PBXGroup;
68 | children = (
69 | 2F6DD93E1A858B2D00E6BC7D /* BSWQuickType */,
70 | 2F6DD9581A858B2D00E6BC7D /* BSWQuickTypeTests */,
71 | 2F6DD93D1A858B2D00E6BC7D /* Products */,
72 | );
73 | sourceTree = "";
74 | };
75 | 2F6DD93D1A858B2D00E6BC7D /* Products */ = {
76 | isa = PBXGroup;
77 | children = (
78 | 2F6DD93C1A858B2D00E6BC7D /* BSWQuickType.app */,
79 | 2F6DD9551A858B2D00E6BC7D /* BSWQuickTypeTests.xctest */,
80 | );
81 | name = Products;
82 | sourceTree = "";
83 | };
84 | 2F6DD93E1A858B2D00E6BC7D /* BSWQuickType */ = {
85 | isa = PBXGroup;
86 | children = (
87 | 2F6DD9431A858B2D00E6BC7D /* AppDelegate.h */,
88 | 2F6DD9441A858B2D00E6BC7D /* AppDelegate.m */,
89 | 2F6DD9461A858B2D00E6BC7D /* ViewController.h */,
90 | 2F6DD9471A858B2D00E6BC7D /* ViewController.m */,
91 | 2F6DD96C1A8591A400E6BC7D /* Source */,
92 | 2F6DD9491A858B2D00E6BC7D /* Main.storyboard */,
93 | 2F6DD94C1A858B2D00E6BC7D /* Images.xcassets */,
94 | 2F6DD94E1A858B2D00E6BC7D /* LaunchScreen.xib */,
95 | 2F6DD93F1A858B2D00E6BC7D /* Supporting Files */,
96 | );
97 | path = BSWQuickType;
98 | sourceTree = "";
99 | };
100 | 2F6DD93F1A858B2D00E6BC7D /* Supporting Files */ = {
101 | isa = PBXGroup;
102 | children = (
103 | 2F6DD9401A858B2D00E6BC7D /* Info.plist */,
104 | 2F6DD9411A858B2D00E6BC7D /* main.m */,
105 | );
106 | name = "Supporting Files";
107 | sourceTree = "";
108 | };
109 | 2F6DD9581A858B2D00E6BC7D /* BSWQuickTypeTests */ = {
110 | isa = PBXGroup;
111 | children = (
112 | 2F6DD95B1A858B2D00E6BC7D /* BSWQuickTypeTests.m */,
113 | 2F6DD9591A858B2D00E6BC7D /* Supporting Files */,
114 | );
115 | path = BSWQuickTypeTests;
116 | sourceTree = "";
117 | };
118 | 2F6DD9591A858B2D00E6BC7D /* Supporting Files */ = {
119 | isa = PBXGroup;
120 | children = (
121 | 2F6DD95A1A858B2D00E6BC7D /* Info.plist */,
122 | );
123 | name = "Supporting Files";
124 | sourceTree = "";
125 | };
126 | 2F6DD96C1A8591A400E6BC7D /* Source */ = {
127 | isa = PBXGroup;
128 | children = (
129 | 2F6DD9691A85919E00E6BC7D /* BSWQuickType.h */,
130 | 2F6DD96A1A85919E00E6BC7D /* BSWQuickType.m */,
131 | );
132 | name = Source;
133 | sourceTree = "";
134 | };
135 | /* End PBXGroup section */
136 |
137 | /* Begin PBXNativeTarget section */
138 | 2F6DD93B1A858B2D00E6BC7D /* BSWQuickType */ = {
139 | isa = PBXNativeTarget;
140 | buildConfigurationList = 2F6DD95F1A858B2D00E6BC7D /* Build configuration list for PBXNativeTarget "BSWQuickType" */;
141 | buildPhases = (
142 | 2F6DD9381A858B2D00E6BC7D /* Sources */,
143 | 2F6DD9391A858B2D00E6BC7D /* Frameworks */,
144 | 2F6DD93A1A858B2D00E6BC7D /* Resources */,
145 | );
146 | buildRules = (
147 | );
148 | dependencies = (
149 | );
150 | name = BSWQuickType;
151 | productName = BSWQuickType;
152 | productReference = 2F6DD93C1A858B2D00E6BC7D /* BSWQuickType.app */;
153 | productType = "com.apple.product-type.application";
154 | };
155 | 2F6DD9541A858B2D00E6BC7D /* BSWQuickTypeTests */ = {
156 | isa = PBXNativeTarget;
157 | buildConfigurationList = 2F6DD9621A858B2D00E6BC7D /* Build configuration list for PBXNativeTarget "BSWQuickTypeTests" */;
158 | buildPhases = (
159 | 2F6DD9511A858B2D00E6BC7D /* Sources */,
160 | 2F6DD9521A858B2D00E6BC7D /* Frameworks */,
161 | 2F6DD9531A858B2D00E6BC7D /* Resources */,
162 | );
163 | buildRules = (
164 | );
165 | dependencies = (
166 | 2F6DD9571A858B2D00E6BC7D /* PBXTargetDependency */,
167 | );
168 | name = BSWQuickTypeTests;
169 | productName = BSWQuickTypeTests;
170 | productReference = 2F6DD9551A858B2D00E6BC7D /* BSWQuickTypeTests.xctest */;
171 | productType = "com.apple.product-type.bundle.unit-test";
172 | };
173 | /* End PBXNativeTarget section */
174 |
175 | /* Begin PBXProject section */
176 | 2F6DD9341A858B2D00E6BC7D /* Project object */ = {
177 | isa = PBXProject;
178 | attributes = {
179 | LastUpgradeCheck = 0610;
180 | ORGANIZATIONNAME = BisonSoftware;
181 | TargetAttributes = {
182 | 2F6DD93B1A858B2D00E6BC7D = {
183 | CreatedOnToolsVersion = 6.1.1;
184 | };
185 | 2F6DD9541A858B2D00E6BC7D = {
186 | CreatedOnToolsVersion = 6.1.1;
187 | TestTargetID = 2F6DD93B1A858B2D00E6BC7D;
188 | };
189 | };
190 | };
191 | buildConfigurationList = 2F6DD9371A858B2D00E6BC7D /* Build configuration list for PBXProject "BSWQuickType" */;
192 | compatibilityVersion = "Xcode 3.2";
193 | developmentRegion = English;
194 | hasScannedForEncodings = 0;
195 | knownRegions = (
196 | en,
197 | Base,
198 | );
199 | mainGroup = 2F6DD9331A858B2D00E6BC7D;
200 | productRefGroup = 2F6DD93D1A858B2D00E6BC7D /* Products */;
201 | projectDirPath = "";
202 | projectRoot = "";
203 | targets = (
204 | 2F6DD93B1A858B2D00E6BC7D /* BSWQuickType */,
205 | 2F6DD9541A858B2D00E6BC7D /* BSWQuickTypeTests */,
206 | );
207 | };
208 | /* End PBXProject section */
209 |
210 | /* Begin PBXResourcesBuildPhase section */
211 | 2F6DD93A1A858B2D00E6BC7D /* Resources */ = {
212 | isa = PBXResourcesBuildPhase;
213 | buildActionMask = 2147483647;
214 | files = (
215 | 2F6DD94B1A858B2D00E6BC7D /* Main.storyboard in Resources */,
216 | 2F6DD9501A858B2D00E6BC7D /* LaunchScreen.xib in Resources */,
217 | 2F6DD94D1A858B2D00E6BC7D /* Images.xcassets in Resources */,
218 | );
219 | runOnlyForDeploymentPostprocessing = 0;
220 | };
221 | 2F6DD9531A858B2D00E6BC7D /* Resources */ = {
222 | isa = PBXResourcesBuildPhase;
223 | buildActionMask = 2147483647;
224 | files = (
225 | );
226 | runOnlyForDeploymentPostprocessing = 0;
227 | };
228 | /* End PBXResourcesBuildPhase section */
229 |
230 | /* Begin PBXSourcesBuildPhase section */
231 | 2F6DD9381A858B2D00E6BC7D /* Sources */ = {
232 | isa = PBXSourcesBuildPhase;
233 | buildActionMask = 2147483647;
234 | files = (
235 | 2F6DD96B1A85919E00E6BC7D /* BSWQuickType.m in Sources */,
236 | 2F6DD9481A858B2D00E6BC7D /* ViewController.m in Sources */,
237 | 2F6DD9451A858B2D00E6BC7D /* AppDelegate.m in Sources */,
238 | 2F6DD9421A858B2D00E6BC7D /* main.m in Sources */,
239 | );
240 | runOnlyForDeploymentPostprocessing = 0;
241 | };
242 | 2F6DD9511A858B2D00E6BC7D /* Sources */ = {
243 | isa = PBXSourcesBuildPhase;
244 | buildActionMask = 2147483647;
245 | files = (
246 | 2F6DD95C1A858B2D00E6BC7D /* BSWQuickTypeTests.m in Sources */,
247 | );
248 | runOnlyForDeploymentPostprocessing = 0;
249 | };
250 | /* End PBXSourcesBuildPhase section */
251 |
252 | /* Begin PBXTargetDependency section */
253 | 2F6DD9571A858B2D00E6BC7D /* PBXTargetDependency */ = {
254 | isa = PBXTargetDependency;
255 | target = 2F6DD93B1A858B2D00E6BC7D /* BSWQuickType */;
256 | targetProxy = 2F6DD9561A858B2D00E6BC7D /* PBXContainerItemProxy */;
257 | };
258 | /* End PBXTargetDependency section */
259 |
260 | /* Begin PBXVariantGroup section */
261 | 2F6DD9491A858B2D00E6BC7D /* Main.storyboard */ = {
262 | isa = PBXVariantGroup;
263 | children = (
264 | 2F6DD94A1A858B2D00E6BC7D /* Base */,
265 | );
266 | name = Main.storyboard;
267 | sourceTree = "";
268 | };
269 | 2F6DD94E1A858B2D00E6BC7D /* LaunchScreen.xib */ = {
270 | isa = PBXVariantGroup;
271 | children = (
272 | 2F6DD94F1A858B2D00E6BC7D /* Base */,
273 | );
274 | name = LaunchScreen.xib;
275 | sourceTree = "";
276 | };
277 | /* End PBXVariantGroup section */
278 |
279 | /* Begin XCBuildConfiguration section */
280 | 2F6DD95D1A858B2D00E6BC7D /* Debug */ = {
281 | isa = XCBuildConfiguration;
282 | buildSettings = {
283 | ALWAYS_SEARCH_USER_PATHS = NO;
284 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
285 | CLANG_CXX_LIBRARY = "libc++";
286 | CLANG_ENABLE_MODULES = YES;
287 | CLANG_ENABLE_OBJC_ARC = YES;
288 | CLANG_WARN_BOOL_CONVERSION = YES;
289 | CLANG_WARN_CONSTANT_CONVERSION = YES;
290 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
291 | CLANG_WARN_EMPTY_BODY = YES;
292 | CLANG_WARN_ENUM_CONVERSION = YES;
293 | CLANG_WARN_INT_CONVERSION = YES;
294 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
295 | CLANG_WARN_UNREACHABLE_CODE = YES;
296 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
297 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
298 | COPY_PHASE_STRIP = NO;
299 | ENABLE_STRICT_OBJC_MSGSEND = YES;
300 | GCC_C_LANGUAGE_STANDARD = gnu99;
301 | GCC_DYNAMIC_NO_PIC = NO;
302 | GCC_OPTIMIZATION_LEVEL = 0;
303 | GCC_PREPROCESSOR_DEFINITIONS = (
304 | "DEBUG=1",
305 | "$(inherited)",
306 | );
307 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
308 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
309 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
310 | GCC_WARN_UNDECLARED_SELECTOR = YES;
311 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
312 | GCC_WARN_UNUSED_FUNCTION = YES;
313 | GCC_WARN_UNUSED_VARIABLE = YES;
314 | IPHONEOS_DEPLOYMENT_TARGET = 8.1;
315 | MTL_ENABLE_DEBUG_INFO = YES;
316 | ONLY_ACTIVE_ARCH = YES;
317 | SDKROOT = iphoneos;
318 | };
319 | name = Debug;
320 | };
321 | 2F6DD95E1A858B2D00E6BC7D /* Release */ = {
322 | isa = XCBuildConfiguration;
323 | buildSettings = {
324 | ALWAYS_SEARCH_USER_PATHS = NO;
325 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
326 | CLANG_CXX_LIBRARY = "libc++";
327 | CLANG_ENABLE_MODULES = YES;
328 | CLANG_ENABLE_OBJC_ARC = YES;
329 | CLANG_WARN_BOOL_CONVERSION = YES;
330 | CLANG_WARN_CONSTANT_CONVERSION = YES;
331 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
332 | CLANG_WARN_EMPTY_BODY = YES;
333 | CLANG_WARN_ENUM_CONVERSION = YES;
334 | CLANG_WARN_INT_CONVERSION = YES;
335 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
336 | CLANG_WARN_UNREACHABLE_CODE = YES;
337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
339 | COPY_PHASE_STRIP = YES;
340 | ENABLE_NS_ASSERTIONS = NO;
341 | ENABLE_STRICT_OBJC_MSGSEND = YES;
342 | GCC_C_LANGUAGE_STANDARD = gnu99;
343 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
344 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
345 | GCC_WARN_UNDECLARED_SELECTOR = YES;
346 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
347 | GCC_WARN_UNUSED_FUNCTION = YES;
348 | GCC_WARN_UNUSED_VARIABLE = YES;
349 | IPHONEOS_DEPLOYMENT_TARGET = 8.1;
350 | MTL_ENABLE_DEBUG_INFO = NO;
351 | SDKROOT = iphoneos;
352 | VALIDATE_PRODUCT = YES;
353 | };
354 | name = Release;
355 | };
356 | 2F6DD9601A858B2D00E6BC7D /* Debug */ = {
357 | isa = XCBuildConfiguration;
358 | buildSettings = {
359 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
360 | INFOPLIST_FILE = BSWQuickType/Info.plist;
361 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
362 | PRODUCT_NAME = "$(TARGET_NAME)";
363 | };
364 | name = Debug;
365 | };
366 | 2F6DD9611A858B2D00E6BC7D /* Release */ = {
367 | isa = XCBuildConfiguration;
368 | buildSettings = {
369 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
370 | INFOPLIST_FILE = BSWQuickType/Info.plist;
371 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
372 | PRODUCT_NAME = "$(TARGET_NAME)";
373 | };
374 | name = Release;
375 | };
376 | 2F6DD9631A858B2D00E6BC7D /* Debug */ = {
377 | isa = XCBuildConfiguration;
378 | buildSettings = {
379 | BUNDLE_LOADER = "$(TEST_HOST)";
380 | FRAMEWORK_SEARCH_PATHS = (
381 | "$(SDKROOT)/Developer/Library/Frameworks",
382 | "$(inherited)",
383 | );
384 | GCC_PREPROCESSOR_DEFINITIONS = (
385 | "DEBUG=1",
386 | "$(inherited)",
387 | );
388 | INFOPLIST_FILE = BSWQuickTypeTests/Info.plist;
389 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
390 | PRODUCT_NAME = "$(TARGET_NAME)";
391 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BSWQuickType.app/BSWQuickType";
392 | };
393 | name = Debug;
394 | };
395 | 2F6DD9641A858B2D00E6BC7D /* Release */ = {
396 | isa = XCBuildConfiguration;
397 | buildSettings = {
398 | BUNDLE_LOADER = "$(TEST_HOST)";
399 | FRAMEWORK_SEARCH_PATHS = (
400 | "$(SDKROOT)/Developer/Library/Frameworks",
401 | "$(inherited)",
402 | );
403 | INFOPLIST_FILE = BSWQuickTypeTests/Info.plist;
404 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
405 | PRODUCT_NAME = "$(TARGET_NAME)";
406 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BSWQuickType.app/BSWQuickType";
407 | };
408 | name = Release;
409 | };
410 | /* End XCBuildConfiguration section */
411 |
412 | /* Begin XCConfigurationList section */
413 | 2F6DD9371A858B2D00E6BC7D /* Build configuration list for PBXProject "BSWQuickType" */ = {
414 | isa = XCConfigurationList;
415 | buildConfigurations = (
416 | 2F6DD95D1A858B2D00E6BC7D /* Debug */,
417 | 2F6DD95E1A858B2D00E6BC7D /* Release */,
418 | );
419 | defaultConfigurationIsVisible = 0;
420 | defaultConfigurationName = Release;
421 | };
422 | 2F6DD95F1A858B2D00E6BC7D /* Build configuration list for PBXNativeTarget "BSWQuickType" */ = {
423 | isa = XCConfigurationList;
424 | buildConfigurations = (
425 | 2F6DD9601A858B2D00E6BC7D /* Debug */,
426 | 2F6DD9611A858B2D00E6BC7D /* Release */,
427 | );
428 | defaultConfigurationIsVisible = 0;
429 | };
430 | 2F6DD9621A858B2D00E6BC7D /* Build configuration list for PBXNativeTarget "BSWQuickTypeTests" */ = {
431 | isa = XCConfigurationList;
432 | buildConfigurations = (
433 | 2F6DD9631A858B2D00E6BC7D /* Debug */,
434 | 2F6DD9641A858B2D00E6BC7D /* Release */,
435 | );
436 | defaultConfigurationIsVisible = 0;
437 | };
438 | /* End XCConfigurationList section */
439 | };
440 | rootObject = 2F6DD9341A858B2D00E6BC7D /* Project object */;
441 | }
442 |
--------------------------------------------------------------------------------