├── README.md
└── MailSuffix-master
├── MailSuffix.xcodeproj
├── xcuserdata
│ ├── GSH.xcuserdatad
│ │ ├── xcdebugger
│ │ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ │ ├── xcschememanagement.plist
│ │ │ └── MailSuffix.xcscheme
│ └── mac020.xcuserdatad
│ │ ├── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── MailSuffix.xcscheme
│ │ └── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ ├── GSH.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
│ │ └── mac020.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── project.pbxproj
├── MailSuffix
├── ViewController.h
├── AppDelegate.h
├── main.m
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── ViewController.m
├── XLTextField.h
├── AppDelegate.m
└── XLTextField.m
├── MailSuffixTests
├── Info.plist
└── MailSuffixTests.m
└── MailSuffixUITests
├── Info.plist
└── MailSuffixUITests.m
/README.md:
--------------------------------------------------------------------------------
1 | # MailMatching
2 | 在邮箱textField中输入邮箱地址自动进行优先级的匹配
3 |
4 | 详细用法与原理可查看简书博客地址:http://www.jianshu.com/p/729ea7ea3f60
5 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix.xcodeproj/xcuserdata/GSH.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix.xcodeproj/project.xcworkspace/xcuserdata/GSH.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RadishLin/MailMatching/HEAD/MailSuffix-master/MailSuffix.xcodeproj/project.xcworkspace/xcuserdata/GSH.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix.xcodeproj/project.xcworkspace/xcuserdata/mac020.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RadishLin/MailMatching/HEAD/MailSuffix-master/MailSuffix.xcodeproj/project.xcworkspace/xcuserdata/mac020.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // MailSuffix
4 | //
5 | // Created by XL10014 on 15/10/28.
6 | // Copyright © 2015年 XL10014. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // MailSuffix
4 | //
5 | // Created by XL10014 on 15/10/28.
6 | // Copyright © 2015年 XL10014. 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 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // MailSuffix
4 | //
5 | // Created by XL10014 on 15/10/28.
6 | // Copyright © 2015年 XL10014. 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 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffixTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffixUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix.xcodeproj/xcuserdata/GSH.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | MailSuffix.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 58D1D42E1BE9D5F90087D7D9
16 |
17 | primary
18 |
19 |
20 | 58D1D4471BE9D5F90087D7D9
21 |
22 | primary
23 |
24 |
25 | 58D1D4521BE9D5F90087D7D9
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix.xcodeproj/xcuserdata/mac020.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | MailSuffix.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 58D1D42E1BE9D5F90087D7D9
16 |
17 | primary
18 |
19 |
20 | 58D1D4471BE9D5F90087D7D9
21 |
22 | primary
23 |
24 |
25 | 58D1D4521BE9D5F90087D7D9
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix.xcodeproj/xcuserdata/mac020.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffixTests/MailSuffixTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // MailSuffixTests.m
3 | // MailSuffixTests
4 | //
5 | // Created by XL10014 on 15/10/28.
6 | // Copyright © 2015年 XL10014. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface MailSuffixTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation MailSuffixTests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 | // Put setup code here. This method is called before the invocation of each test method in the class.
20 | }
21 |
22 | - (void)tearDown {
23 | // Put teardown code here. This method is called after the invocation of each test method in the class.
24 | [super tearDown];
25 | }
26 |
27 | - (void)testExample {
28 | // This is an example of a functional test case.
29 | // Use XCTAssert and related functions to verify your tests produce the correct results.
30 | }
31 |
32 | - (void)testPerformanceExample {
33 | // This is an example of a performance test case.
34 | [self measureBlock:^{
35 | // Put the code you want to measure the time of here.
36 | }];
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffixUITests/MailSuffixUITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // MailSuffixUITests.m
3 | // MailSuffixUITests
4 | //
5 | // Created by XL10014 on 15/10/28.
6 | // Copyright © 2015年 XL10014. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface MailSuffixUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation MailSuffixUITests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 |
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 |
22 | // In UI tests it is usually best to stop immediately when a failure occurs.
23 | self.continueAfterFailure = NO;
24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
25 | [[[XCUIApplication alloc] init] launch];
26 |
27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
28 | }
29 |
30 | - (void)tearDown {
31 | // Put teardown code here. This method is called after the invocation of each test method in the class.
32 | [super tearDown];
33 | }
34 |
35 | - (void)testExample {
36 | // Use recording to get started writing UI tests.
37 | // Use XCTAssert and related functions to verify your tests produce the correct results.
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "83.5x83.5",
66 | "scale" : "2x"
67 | }
68 | ],
69 | "info" : {
70 | "version" : 1,
71 | "author" : "xcode"
72 | }
73 | }
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // MailSuffix
4 | //
5 | // Created by XL10014 on 15/10/28.
6 | // Copyright © 2015年 XL10014. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "XLTextField.h"
11 |
12 | @interface ViewController ()
13 |
14 | @property (weak, nonatomic) IBOutlet XLTextField *textField;
15 |
16 | @end
17 |
18 | @implementation ViewController
19 |
20 | - (void)viewDidLoad {
21 | [super viewDidLoad];
22 | // Do any additional setup after loading the view, typically from a nib.
23 |
24 | /**
25 | 手动frame创建XLTextField
26 | */
27 | // XLTextField * Field = [[XLTextField alloc] initWithFrame:CGRectMake(100, 200, 200, 30) fontSize:12];
28 | // Field.placeholder = @"输入邮箱地址";
29 | // Field.mailTypeArray = [NSMutableArray arrayWithObjects:@"@qq.com",@"@163.com",@"@126.com",@"@yahoo.com",@"@139.com",@"@henu.com", nil];
30 | // // Field.mailMatchColor = [UIColor redColor];
31 | // Field.didPressedReturnCompletion = ^(UITextField * textField){
32 | // NSLog(@"textFieldText%@",textField);
33 | // };
34 | // [self.view addSubview:Field];
35 |
36 |
37 | /**
38 | 利用xib创建XLTextField
39 | */
40 | self.textField.mailTypeArray = [NSMutableArray arrayWithObjects:@"@qq.com",@"@163.com",@"@126.com",@"@yahoo.com",@"@139.com",@"@henu.com", nil];
41 | self.textField.didPressedReturnCompletion = ^(UITextField * textField){
42 | NSLog(@"textFieldText%@",textField);
43 | };
44 | // self.textField.mailMatchColor = [UIColor redColor];
45 | }
46 |
47 |
48 |
49 | - (void)didReceiveMemoryWarning {
50 | [super didReceiveMemoryWarning];
51 | // Dispose of any resources that can be recreated.
52 | }
53 |
54 |
55 | - (IBAction)tapEnd:(id)sender {
56 | [self.textField resignFirstResponder];
57 | }
58 |
59 |
60 |
61 | @end
62 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix/XLTextField.h:
--------------------------------------------------------------------------------
1 | //
2 | // XLTextField.h
3 | // MailSuffix
4 | //
5 | // Created by XL10014 on 16/7/8.
6 | // Copyright © 2016年 XL10014. All rights reserved.
7 | //
8 |
9 | /* 用法指南
10 | * textField可通过两种方式创建 auaulayout or frame
11 | * 第一种在xib中创建,textField样式可在xib自行设置,匹配的邮箱区域颜色可自行设置
12 | * 第二种通过手动frame创建 两个基本参数设置大小和字号,其他设置可额外自行设置
13 | */
14 |
15 | #import
16 |
17 | /**
18 | * 如果接入的类需要在textField的代理方法中做操作 可实现对应的协议即可
19 | */
20 | @protocol XLEmailTextFieldDelegate
21 |
22 | @optional
23 |
24 | - (BOOL)XLTextFieldShouldBeginEditing:(UITextField *)textField;
25 | - (void)XLTextFieldDidBeginEditing:(UITextField *)textField;
26 | - (void)XLTextFieldDidEndEditing:(UITextField *)textField;
27 | - (BOOL)XLTextField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string;
28 | - (BOOL)XLTextFieldShouldReturn:(UITextField *)textField;
29 |
30 | @end
31 |
32 | typedef void(^didPressedReturn)(UITextField *);
33 |
34 | @interface XLTextField : UITextField
35 |
36 | - (instancetype)init __attribute__((unavailable("init方法不可用,请用initWithName:fontSzie:")));
37 | + (instancetype)new __attribute__((unavailable("new方法不可用,请用initWithName:fontSzie:")));
38 |
39 | /**
40 | * optional 根据自己需求
41 | */
42 | @property (nonatomic, weak) id customDelegate;
43 |
44 | /**
45 | * Optional 点击return的回调block 根据自己需求
46 | */
47 | @property (nonatomic, copy) didPressedReturn didPressedReturnCompletion;
48 |
49 |
50 | /**
51 | * Optional 匹配的邮箱类型后缀默认是RGB为170 170 170的颜色,可自行设置
52 | */
53 | @property (nonatomic, strong) UIColor * mailMatchColor;
54 |
55 |
56 | /**
57 | *
58 | * 1.通过xib创建只需要赋值此参数 即可
59 | * @param mailTypeArray 邮箱匹配类型
60 | *
61 | */
62 | @property (nonatomic, strong) NSMutableArray *mailTypeArray;
63 |
64 |
65 | /**
66 | * 2.通过手写创建textField时候调用
67 | *
68 | * @param frame frame大小
69 | * @param fontSize textField大小
70 | *
71 | * @return self
72 | */
73 | - (instancetype)initWithFrame:(CGRect)frame fontSize:(CGFloat)fontSize;
74 |
75 |
76 | @end
77 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // MailSuffix
4 | //
5 | // Created by XL10014 on 15/10/28.
6 | // Copyright © 2015年 XL10014. 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 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix/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 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix.xcodeproj/xcuserdata/GSH.xcuserdatad/xcschemes/MailSuffix.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix.xcodeproj/xcuserdata/mac020.xcuserdatad/xcschemes/MailSuffix.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix/XLTextField.m:
--------------------------------------------------------------------------------
1 | //
2 | // XLTextField.m
3 | // MailSuffix
4 | //
5 | // Created by XL10014 on 16/7/8.
6 | // Copyright © 2016年 XL10014. All rights reserved.
7 | //
8 | #define RGBA(r,g,b,a) [UIColor colorWithRed:(float)r/255.0f green:(float)g/255.0f blue:(float)b/255.0f alpha:a]
9 |
10 | #import "XLTextField.h"
11 |
12 | /**
13 | * textField布局类型
14 | */
15 | typedef NS_ENUM( NSUInteger,XLLayoutType) {
16 | XLLayoutTypeAuto, // 自动布局
17 | XLLayoutTypeHand //手动布局
18 | };
19 |
20 | @interface XLTextField()
21 |
22 | @property (nonatomic, copy) UILabel * mailLabel;
23 | @property (nonatomic, strong) NSString * email; //完整的邮箱
24 |
25 | @end
26 |
27 | @implementation XLTextField
28 |
29 | - (void)awakeFromNib
30 | {
31 | [self configInitializeMessage:XLLayoutTypeAuto];
32 | }
33 |
34 | - (instancetype)initWithFrame:(CGRect)frame fontSize:(CGFloat)fontSize
35 | {
36 | if (self== [super init]) {
37 | self.frame = frame;
38 | self.font = [UIFont systemFontOfSize:fontSize];
39 | [self configInitializeMessage:XLLayoutTypeHand];
40 | }
41 | return self;
42 | }
43 |
44 | /**
45 | * 匹配邮箱过程
46 | *
47 | * @param range range
48 | * @param string 用户输入string
49 | */
50 | - (void)configMailMatchingRange:(NSRange)range replacementString:(NSString *)string
51 | {
52 | //获取完整的输入文本
53 | NSString *completeStr = [self.text stringByReplacingCharactersInRange:range withString:string];
54 | //以@符号分割文本
55 | NSArray *temailArray = [completeStr componentsSeparatedByString:@"@"];
56 | //获取邮箱前缀
57 | NSString *emailString = [temailArray firstObject];
58 |
59 | //邮箱匹配 没有输入@符号时 用@匹配
60 | NSString *matchString = @"@";
61 | if(temailArray.count > 1){
62 | //如果已经输入@符号 截取@符号以后的字符串作为匹配字符串
63 | matchString = [completeStr substringFromIndex:emailString.length];
64 | }
65 | //匹配邮箱 得到所有跟当前输入匹配的邮箱后缀
66 | NSMutableArray *suffixArray = [self checkEmailStr:matchString];
67 |
68 | //边界控制 如果没有跟当前输入匹配的后缀置为@""
69 | NSString *fixStr = suffixArray.count > 0 ? [suffixArray firstObject] : @"";
70 | //将lblEmail部分字段隐藏
71 | NSInteger cutLenth = suffixArray.count > 0 ? completeStr.length : emailString.length;
72 |
73 | //最终的邮箱地址
74 | self.email = fixStr.length > 0 ? [NSString stringWithFormat:@"%@%@",emailString,fixStr] : completeStr;
75 |
76 | //设置lblEmail 的attribute
77 | NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%@",emailString,fixStr]];
78 | [attributeString addAttribute:NSForegroundColorAttributeName value:[UIColor clearColor] range:NSMakeRange(0,cutLenth)];
79 | self.mailLabel.attributedText = attributeString;
80 |
81 | //清空文本框内容时 隐藏lblEmail
82 | if(completeStr.length == 0){
83 | self.mailLabel.text = @"";
84 | self.email = @"";
85 | }
86 | }
87 |
88 | /**
89 | * 结束输入操作
90 | */
91 | - (void)didEndEditing
92 | {
93 | self.text = self.email;
94 | self.mailLabel.text = @"";
95 | }
96 |
97 | /**
98 | * 替换邮箱匹配类型
99 | *
100 | * @param string 匹配的字段
101 | *
102 | * @return 匹配成功的Array
103 | */
104 | - (NSMutableArray *)checkEmailStr:(NSString *)string{
105 | NSMutableArray *filterArray = [NSMutableArray arrayWithCapacity:0];
106 | for (NSString *str in self.mailTypeArray) {
107 | if([str hasPrefix:string]){
108 | [filterArray addObject:str];
109 | }
110 | }
111 | return filterArray;
112 | }
113 |
114 | /**
115 | * 初始化信息
116 | */
117 | - (void)configInitializeMessage:(XLLayoutType)layoutType
118 | {
119 | self.delegate = self;
120 | _email = [[ NSMutableString alloc]initWithCapacity:0];
121 | _mailLabel = [[UILabel alloc] init];
122 | [_mailLabel setTextColor:RGBA(170, 170, 170, 1)];
123 | [_mailLabel setFont:self.font];
124 |
125 | if (layoutType == XLLayoutTypeAuto)
126 | {
127 | [self addSubview:_mailLabel];
128 | _mailLabel.translatesAutoresizingMaskIntoConstraints = NO;
129 | self.translatesAutoresizingMaskIntoConstraints = NO;
130 |
131 | NSLayoutConstraint * leftConstant = [NSLayoutConstraint constraintWithItem:_mailLabel
132 | attribute:NSLayoutAttributeLeft
133 | relatedBy:NSLayoutRelationEqual
134 | toItem:self
135 | attribute:NSLayoutAttributeLeft
136 | multiplier:1
137 | constant:6];
138 | NSLayoutConstraint * rightConstant = [NSLayoutConstraint constraintWithItem:_mailLabel
139 | attribute:NSLayoutAttributeRight
140 | relatedBy:NSLayoutRelationEqual
141 | toItem:self
142 | attribute:NSLayoutAttributeRight
143 | multiplier:1
144 | constant:0];
145 | NSLayoutConstraint * topConstant = [NSLayoutConstraint constraintWithItem:_mailLabel
146 | attribute:NSLayoutAttributeTop
147 | relatedBy:NSLayoutRelationEqual
148 | toItem:self
149 | attribute:NSLayoutAttributeTop
150 | multiplier:1
151 | constant:0];
152 | NSLayoutConstraint * bottomConstant = [NSLayoutConstraint constraintWithItem:_mailLabel
153 | attribute:NSLayoutAttributeBottom
154 | relatedBy:NSLayoutRelationEqual
155 | toItem:self
156 | attribute:NSLayoutAttributeBottom
157 | multiplier:1
158 | constant:-1];
159 | [self addConstraint:leftConstant];
160 | [self addConstraint:rightConstant];
161 | [self addConstraint:topConstant];
162 | [self addConstraint:bottomConstant];
163 |
164 | } else if (layoutType == XLLayoutTypeHand)
165 | {
166 | _mailLabel.frame = CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds) - 2);
167 | [self addSubview:_mailLabel];
168 | }
169 | }
170 |
171 | - (void)setMailMatchColor:(UIColor *)mailMatchColor
172 | {
173 | _mailMatchColor = mailMatchColor;
174 | [_mailLabel setTextColor:mailMatchColor];
175 | }
176 |
177 |
178 | #pragma mark - UITextFieldDelegate
179 |
180 | - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
181 | if (self.customDelegate && [self.customDelegate respondsToSelector:@selector(XLTextFieldShouldBeginEditing:)]) {
182 | [self.customDelegate XLTextFieldShouldBeginEditing:textField];
183 | }
184 | return YES;
185 | }
186 |
187 | - (void)textFieldDidBeginEditing:(UITextField *)textField {
188 | if (self.customDelegate && [self.customDelegate respondsToSelector:@selector(XLTextFieldDidBeginEditing:)]) {
189 | [self.customDelegate XLTextFieldDidBeginEditing:textField];
190 | }
191 | }
192 |
193 | - (void)textFieldDidEndEditing:(UITextField *)textField{
194 | [self didEndEditing];
195 | if (self.customDelegate && [self.customDelegate respondsToSelector:@selector(XLTextFieldDidEndEditing:)]) {
196 | [self.customDelegate XLTextFieldDidEndEditing:textField];
197 | }
198 | }
199 |
200 | - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
201 | [self configMailMatchingRange:range replacementString:string];
202 | if (self.customDelegate && [self.customDelegate respondsToSelector:@selector(XLTextField:shouldChangeCharactersInRange:replacementString:)]) {
203 | [self.customDelegate XLTextField:textField shouldChangeCharactersInRange:range replacementString:string];
204 | }
205 | return YES;
206 | }
207 |
208 | - (BOOL)textFieldShouldReturn:(UITextField *)textField
209 | {
210 | self.text = self.email;
211 | self.mailLabel.text = @"";
212 | if (self.didPressedReturnCompletion) {
213 | self.didPressedReturnCompletion(self);
214 | }
215 | if (self.customDelegate && [self.customDelegate respondsToSelector:@selector(XLTextFieldShouldReturn:)]) {
216 | [self.customDelegate XLTextFieldShouldReturn:textField];
217 | }
218 | return YES;
219 | }
220 | @end
221 |
--------------------------------------------------------------------------------
/MailSuffix-master/MailSuffix.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 58D1D4341BE9D5F90087D7D9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 58D1D4331BE9D5F90087D7D9 /* main.m */; };
11 | 58D1D4371BE9D5F90087D7D9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 58D1D4361BE9D5F90087D7D9 /* AppDelegate.m */; };
12 | 58D1D43A1BE9D5F90087D7D9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58D1D4391BE9D5F90087D7D9 /* ViewController.m */; };
13 | 58D1D43D1BE9D5F90087D7D9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 58D1D43B1BE9D5F90087D7D9 /* Main.storyboard */; };
14 | 58D1D43F1BE9D5F90087D7D9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 58D1D43E1BE9D5F90087D7D9 /* Assets.xcassets */; };
15 | 58D1D4421BE9D5F90087D7D9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 58D1D4401BE9D5F90087D7D9 /* LaunchScreen.storyboard */; };
16 | 58D1D44D1BE9D5F90087D7D9 /* MailSuffixTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 58D1D44C1BE9D5F90087D7D9 /* MailSuffixTests.m */; };
17 | 58D1D4581BE9D5F90087D7D9 /* MailSuffixUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 58D1D4571BE9D5F90087D7D9 /* MailSuffixUITests.m */; };
18 | FCEF32001D6D8810007DBC82 /* XLTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = FCEF31FF1D6D8810007DBC82 /* XLTextField.m */; };
19 | /* End PBXBuildFile section */
20 |
21 | /* Begin PBXContainerItemProxy section */
22 | 58D1D4491BE9D5F90087D7D9 /* PBXContainerItemProxy */ = {
23 | isa = PBXContainerItemProxy;
24 | containerPortal = 58D1D4271BE9D5F90087D7D9 /* Project object */;
25 | proxyType = 1;
26 | remoteGlobalIDString = 58D1D42E1BE9D5F90087D7D9;
27 | remoteInfo = MailSuffix;
28 | };
29 | 58D1D4541BE9D5F90087D7D9 /* PBXContainerItemProxy */ = {
30 | isa = PBXContainerItemProxy;
31 | containerPortal = 58D1D4271BE9D5F90087D7D9 /* Project object */;
32 | proxyType = 1;
33 | remoteGlobalIDString = 58D1D42E1BE9D5F90087D7D9;
34 | remoteInfo = MailSuffix;
35 | };
36 | /* End PBXContainerItemProxy section */
37 |
38 | /* Begin PBXFileReference section */
39 | 58D1D42F1BE9D5F90087D7D9 /* MailSuffix.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MailSuffix.app; sourceTree = BUILT_PRODUCTS_DIR; };
40 | 58D1D4331BE9D5F90087D7D9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
41 | 58D1D4351BE9D5F90087D7D9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
42 | 58D1D4361BE9D5F90087D7D9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
43 | 58D1D4381BE9D5F90087D7D9 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
44 | 58D1D4391BE9D5F90087D7D9 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
45 | 58D1D43C1BE9D5F90087D7D9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
46 | 58D1D43E1BE9D5F90087D7D9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
47 | 58D1D4411BE9D5F90087D7D9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
48 | 58D1D4431BE9D5F90087D7D9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
49 | 58D1D4481BE9D5F90087D7D9 /* MailSuffixTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MailSuffixTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
50 | 58D1D44C1BE9D5F90087D7D9 /* MailSuffixTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MailSuffixTests.m; sourceTree = ""; };
51 | 58D1D44E1BE9D5F90087D7D9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
52 | 58D1D4531BE9D5F90087D7D9 /* MailSuffixUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MailSuffixUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
53 | 58D1D4571BE9D5F90087D7D9 /* MailSuffixUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MailSuffixUITests.m; sourceTree = ""; };
54 | 58D1D4591BE9D5F90087D7D9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
55 | FCEF31FE1D6D8810007DBC82 /* XLTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLTextField.h; sourceTree = ""; };
56 | FCEF31FF1D6D8810007DBC82 /* XLTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLTextField.m; sourceTree = ""; };
57 | /* End PBXFileReference section */
58 |
59 | /* Begin PBXFrameworksBuildPhase section */
60 | 58D1D42C1BE9D5F90087D7D9 /* Frameworks */ = {
61 | isa = PBXFrameworksBuildPhase;
62 | buildActionMask = 2147483647;
63 | files = (
64 | );
65 | runOnlyForDeploymentPostprocessing = 0;
66 | };
67 | 58D1D4451BE9D5F90087D7D9 /* Frameworks */ = {
68 | isa = PBXFrameworksBuildPhase;
69 | buildActionMask = 2147483647;
70 | files = (
71 | );
72 | runOnlyForDeploymentPostprocessing = 0;
73 | };
74 | 58D1D4501BE9D5F90087D7D9 /* Frameworks */ = {
75 | isa = PBXFrameworksBuildPhase;
76 | buildActionMask = 2147483647;
77 | files = (
78 | );
79 | runOnlyForDeploymentPostprocessing = 0;
80 | };
81 | /* End PBXFrameworksBuildPhase section */
82 |
83 | /* Begin PBXGroup section */
84 | 58D1D4261BE9D5F90087D7D9 = {
85 | isa = PBXGroup;
86 | children = (
87 | 58D1D4311BE9D5F90087D7D9 /* MailSuffix */,
88 | 58D1D44B1BE9D5F90087D7D9 /* MailSuffixTests */,
89 | 58D1D4561BE9D5F90087D7D9 /* MailSuffixUITests */,
90 | 58D1D4301BE9D5F90087D7D9 /* Products */,
91 | );
92 | sourceTree = "";
93 | };
94 | 58D1D4301BE9D5F90087D7D9 /* Products */ = {
95 | isa = PBXGroup;
96 | children = (
97 | 58D1D42F1BE9D5F90087D7D9 /* MailSuffix.app */,
98 | 58D1D4481BE9D5F90087D7D9 /* MailSuffixTests.xctest */,
99 | 58D1D4531BE9D5F90087D7D9 /* MailSuffixUITests.xctest */,
100 | );
101 | name = Products;
102 | sourceTree = "";
103 | };
104 | 58D1D4311BE9D5F90087D7D9 /* MailSuffix */ = {
105 | isa = PBXGroup;
106 | children = (
107 | FCEF31FE1D6D8810007DBC82 /* XLTextField.h */,
108 | FCEF31FF1D6D8810007DBC82 /* XLTextField.m */,
109 | 58D1D4351BE9D5F90087D7D9 /* AppDelegate.h */,
110 | 58D1D4361BE9D5F90087D7D9 /* AppDelegate.m */,
111 | 58D1D4381BE9D5F90087D7D9 /* ViewController.h */,
112 | 58D1D4391BE9D5F90087D7D9 /* ViewController.m */,
113 | 58D1D43B1BE9D5F90087D7D9 /* Main.storyboard */,
114 | 58D1D43E1BE9D5F90087D7D9 /* Assets.xcassets */,
115 | 58D1D4401BE9D5F90087D7D9 /* LaunchScreen.storyboard */,
116 | 58D1D4431BE9D5F90087D7D9 /* Info.plist */,
117 | 58D1D4321BE9D5F90087D7D9 /* Supporting Files */,
118 | );
119 | path = MailSuffix;
120 | sourceTree = "";
121 | };
122 | 58D1D4321BE9D5F90087D7D9 /* Supporting Files */ = {
123 | isa = PBXGroup;
124 | children = (
125 | 58D1D4331BE9D5F90087D7D9 /* main.m */,
126 | );
127 | name = "Supporting Files";
128 | sourceTree = "";
129 | };
130 | 58D1D44B1BE9D5F90087D7D9 /* MailSuffixTests */ = {
131 | isa = PBXGroup;
132 | children = (
133 | 58D1D44C1BE9D5F90087D7D9 /* MailSuffixTests.m */,
134 | 58D1D44E1BE9D5F90087D7D9 /* Info.plist */,
135 | );
136 | path = MailSuffixTests;
137 | sourceTree = "";
138 | };
139 | 58D1D4561BE9D5F90087D7D9 /* MailSuffixUITests */ = {
140 | isa = PBXGroup;
141 | children = (
142 | 58D1D4571BE9D5F90087D7D9 /* MailSuffixUITests.m */,
143 | 58D1D4591BE9D5F90087D7D9 /* Info.plist */,
144 | );
145 | path = MailSuffixUITests;
146 | sourceTree = "";
147 | };
148 | /* End PBXGroup section */
149 |
150 | /* Begin PBXNativeTarget section */
151 | 58D1D42E1BE9D5F90087D7D9 /* MailSuffix */ = {
152 | isa = PBXNativeTarget;
153 | buildConfigurationList = 58D1D45C1BE9D5F90087D7D9 /* Build configuration list for PBXNativeTarget "MailSuffix" */;
154 | buildPhases = (
155 | 58D1D42B1BE9D5F90087D7D9 /* Sources */,
156 | 58D1D42C1BE9D5F90087D7D9 /* Frameworks */,
157 | 58D1D42D1BE9D5F90087D7D9 /* Resources */,
158 | );
159 | buildRules = (
160 | );
161 | dependencies = (
162 | );
163 | name = MailSuffix;
164 | productName = MailSuffix;
165 | productReference = 58D1D42F1BE9D5F90087D7D9 /* MailSuffix.app */;
166 | productType = "com.apple.product-type.application";
167 | };
168 | 58D1D4471BE9D5F90087D7D9 /* MailSuffixTests */ = {
169 | isa = PBXNativeTarget;
170 | buildConfigurationList = 58D1D45F1BE9D5F90087D7D9 /* Build configuration list for PBXNativeTarget "MailSuffixTests" */;
171 | buildPhases = (
172 | 58D1D4441BE9D5F90087D7D9 /* Sources */,
173 | 58D1D4451BE9D5F90087D7D9 /* Frameworks */,
174 | 58D1D4461BE9D5F90087D7D9 /* Resources */,
175 | );
176 | buildRules = (
177 | );
178 | dependencies = (
179 | 58D1D44A1BE9D5F90087D7D9 /* PBXTargetDependency */,
180 | );
181 | name = MailSuffixTests;
182 | productName = MailSuffixTests;
183 | productReference = 58D1D4481BE9D5F90087D7D9 /* MailSuffixTests.xctest */;
184 | productType = "com.apple.product-type.bundle.unit-test";
185 | };
186 | 58D1D4521BE9D5F90087D7D9 /* MailSuffixUITests */ = {
187 | isa = PBXNativeTarget;
188 | buildConfigurationList = 58D1D4621BE9D5F90087D7D9 /* Build configuration list for PBXNativeTarget "MailSuffixUITests" */;
189 | buildPhases = (
190 | 58D1D44F1BE9D5F90087D7D9 /* Sources */,
191 | 58D1D4501BE9D5F90087D7D9 /* Frameworks */,
192 | 58D1D4511BE9D5F90087D7D9 /* Resources */,
193 | );
194 | buildRules = (
195 | );
196 | dependencies = (
197 | 58D1D4551BE9D5F90087D7D9 /* PBXTargetDependency */,
198 | );
199 | name = MailSuffixUITests;
200 | productName = MailSuffixUITests;
201 | productReference = 58D1D4531BE9D5F90087D7D9 /* MailSuffixUITests.xctest */;
202 | productType = "com.apple.product-type.bundle.ui-testing";
203 | };
204 | /* End PBXNativeTarget section */
205 |
206 | /* Begin PBXProject section */
207 | 58D1D4271BE9D5F90087D7D9 /* Project object */ = {
208 | isa = PBXProject;
209 | attributes = {
210 | LastUpgradeCheck = 0700;
211 | ORGANIZATIONNAME = GSH;
212 | TargetAttributes = {
213 | 58D1D42E1BE9D5F90087D7D9 = {
214 | CreatedOnToolsVersion = 7.0;
215 | };
216 | 58D1D4471BE9D5F90087D7D9 = {
217 | CreatedOnToolsVersion = 7.0;
218 | TestTargetID = 58D1D42E1BE9D5F90087D7D9;
219 | };
220 | 58D1D4521BE9D5F90087D7D9 = {
221 | CreatedOnToolsVersion = 7.0;
222 | TestTargetID = 58D1D42E1BE9D5F90087D7D9;
223 | };
224 | };
225 | };
226 | buildConfigurationList = 58D1D42A1BE9D5F90087D7D9 /* Build configuration list for PBXProject "MailSuffix" */;
227 | compatibilityVersion = "Xcode 3.2";
228 | developmentRegion = English;
229 | hasScannedForEncodings = 0;
230 | knownRegions = (
231 | en,
232 | Base,
233 | );
234 | mainGroup = 58D1D4261BE9D5F90087D7D9;
235 | productRefGroup = 58D1D4301BE9D5F90087D7D9 /* Products */;
236 | projectDirPath = "";
237 | projectRoot = "";
238 | targets = (
239 | 58D1D42E1BE9D5F90087D7D9 /* MailSuffix */,
240 | 58D1D4471BE9D5F90087D7D9 /* MailSuffixTests */,
241 | 58D1D4521BE9D5F90087D7D9 /* MailSuffixUITests */,
242 | );
243 | };
244 | /* End PBXProject section */
245 |
246 | /* Begin PBXResourcesBuildPhase section */
247 | 58D1D42D1BE9D5F90087D7D9 /* Resources */ = {
248 | isa = PBXResourcesBuildPhase;
249 | buildActionMask = 2147483647;
250 | files = (
251 | 58D1D4421BE9D5F90087D7D9 /* LaunchScreen.storyboard in Resources */,
252 | 58D1D43F1BE9D5F90087D7D9 /* Assets.xcassets in Resources */,
253 | 58D1D43D1BE9D5F90087D7D9 /* Main.storyboard in Resources */,
254 | );
255 | runOnlyForDeploymentPostprocessing = 0;
256 | };
257 | 58D1D4461BE9D5F90087D7D9 /* Resources */ = {
258 | isa = PBXResourcesBuildPhase;
259 | buildActionMask = 2147483647;
260 | files = (
261 | );
262 | runOnlyForDeploymentPostprocessing = 0;
263 | };
264 | 58D1D4511BE9D5F90087D7D9 /* Resources */ = {
265 | isa = PBXResourcesBuildPhase;
266 | buildActionMask = 2147483647;
267 | files = (
268 | );
269 | runOnlyForDeploymentPostprocessing = 0;
270 | };
271 | /* End PBXResourcesBuildPhase section */
272 |
273 | /* Begin PBXSourcesBuildPhase section */
274 | 58D1D42B1BE9D5F90087D7D9 /* Sources */ = {
275 | isa = PBXSourcesBuildPhase;
276 | buildActionMask = 2147483647;
277 | files = (
278 | 58D1D43A1BE9D5F90087D7D9 /* ViewController.m in Sources */,
279 | FCEF32001D6D8810007DBC82 /* XLTextField.m in Sources */,
280 | 58D1D4371BE9D5F90087D7D9 /* AppDelegate.m in Sources */,
281 | 58D1D4341BE9D5F90087D7D9 /* main.m in Sources */,
282 | );
283 | runOnlyForDeploymentPostprocessing = 0;
284 | };
285 | 58D1D4441BE9D5F90087D7D9 /* Sources */ = {
286 | isa = PBXSourcesBuildPhase;
287 | buildActionMask = 2147483647;
288 | files = (
289 | 58D1D44D1BE9D5F90087D7D9 /* MailSuffixTests.m in Sources */,
290 | );
291 | runOnlyForDeploymentPostprocessing = 0;
292 | };
293 | 58D1D44F1BE9D5F90087D7D9 /* Sources */ = {
294 | isa = PBXSourcesBuildPhase;
295 | buildActionMask = 2147483647;
296 | files = (
297 | 58D1D4581BE9D5F90087D7D9 /* MailSuffixUITests.m in Sources */,
298 | );
299 | runOnlyForDeploymentPostprocessing = 0;
300 | };
301 | /* End PBXSourcesBuildPhase section */
302 |
303 | /* Begin PBXTargetDependency section */
304 | 58D1D44A1BE9D5F90087D7D9 /* PBXTargetDependency */ = {
305 | isa = PBXTargetDependency;
306 | target = 58D1D42E1BE9D5F90087D7D9 /* MailSuffix */;
307 | targetProxy = 58D1D4491BE9D5F90087D7D9 /* PBXContainerItemProxy */;
308 | };
309 | 58D1D4551BE9D5F90087D7D9 /* PBXTargetDependency */ = {
310 | isa = PBXTargetDependency;
311 | target = 58D1D42E1BE9D5F90087D7D9 /* MailSuffix */;
312 | targetProxy = 58D1D4541BE9D5F90087D7D9 /* PBXContainerItemProxy */;
313 | };
314 | /* End PBXTargetDependency section */
315 |
316 | /* Begin PBXVariantGroup section */
317 | 58D1D43B1BE9D5F90087D7D9 /* Main.storyboard */ = {
318 | isa = PBXVariantGroup;
319 | children = (
320 | 58D1D43C1BE9D5F90087D7D9 /* Base */,
321 | );
322 | name = Main.storyboard;
323 | sourceTree = "";
324 | };
325 | 58D1D4401BE9D5F90087D7D9 /* LaunchScreen.storyboard */ = {
326 | isa = PBXVariantGroup;
327 | children = (
328 | 58D1D4411BE9D5F90087D7D9 /* Base */,
329 | );
330 | name = LaunchScreen.storyboard;
331 | sourceTree = "";
332 | };
333 | /* End PBXVariantGroup section */
334 |
335 | /* Begin XCBuildConfiguration section */
336 | 58D1D45A1BE9D5F90087D7D9 /* Debug */ = {
337 | isa = XCBuildConfiguration;
338 | buildSettings = {
339 | ALWAYS_SEARCH_USER_PATHS = NO;
340 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
341 | CLANG_CXX_LIBRARY = "libc++";
342 | CLANG_ENABLE_MODULES = YES;
343 | CLANG_ENABLE_OBJC_ARC = YES;
344 | CLANG_WARN_BOOL_CONVERSION = YES;
345 | CLANG_WARN_CONSTANT_CONVERSION = YES;
346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
347 | CLANG_WARN_EMPTY_BODY = YES;
348 | CLANG_WARN_ENUM_CONVERSION = YES;
349 | CLANG_WARN_INT_CONVERSION = YES;
350 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
351 | CLANG_WARN_UNREACHABLE_CODE = YES;
352 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
353 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
354 | COPY_PHASE_STRIP = NO;
355 | DEBUG_INFORMATION_FORMAT = dwarf;
356 | ENABLE_STRICT_OBJC_MSGSEND = YES;
357 | ENABLE_TESTABILITY = YES;
358 | GCC_C_LANGUAGE_STANDARD = gnu99;
359 | GCC_DYNAMIC_NO_PIC = NO;
360 | GCC_NO_COMMON_BLOCKS = YES;
361 | GCC_OPTIMIZATION_LEVEL = 0;
362 | GCC_PREPROCESSOR_DEFINITIONS = (
363 | "DEBUG=1",
364 | "$(inherited)",
365 | );
366 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
367 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
368 | GCC_WARN_UNDECLARED_SELECTOR = YES;
369 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
370 | GCC_WARN_UNUSED_FUNCTION = YES;
371 | GCC_WARN_UNUSED_VARIABLE = YES;
372 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
373 | MTL_ENABLE_DEBUG_INFO = YES;
374 | ONLY_ACTIVE_ARCH = YES;
375 | SDKROOT = iphoneos;
376 | TARGETED_DEVICE_FAMILY = "1,2";
377 | };
378 | name = Debug;
379 | };
380 | 58D1D45B1BE9D5F90087D7D9 /* Release */ = {
381 | isa = XCBuildConfiguration;
382 | buildSettings = {
383 | ALWAYS_SEARCH_USER_PATHS = NO;
384 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
385 | CLANG_CXX_LIBRARY = "libc++";
386 | CLANG_ENABLE_MODULES = YES;
387 | CLANG_ENABLE_OBJC_ARC = YES;
388 | CLANG_WARN_BOOL_CONVERSION = YES;
389 | CLANG_WARN_CONSTANT_CONVERSION = YES;
390 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
391 | CLANG_WARN_EMPTY_BODY = YES;
392 | CLANG_WARN_ENUM_CONVERSION = YES;
393 | CLANG_WARN_INT_CONVERSION = YES;
394 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
395 | CLANG_WARN_UNREACHABLE_CODE = YES;
396 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
397 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
398 | COPY_PHASE_STRIP = NO;
399 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
400 | ENABLE_NS_ASSERTIONS = NO;
401 | ENABLE_STRICT_OBJC_MSGSEND = YES;
402 | GCC_C_LANGUAGE_STANDARD = gnu99;
403 | GCC_NO_COMMON_BLOCKS = YES;
404 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
405 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
406 | GCC_WARN_UNDECLARED_SELECTOR = YES;
407 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
408 | GCC_WARN_UNUSED_FUNCTION = YES;
409 | GCC_WARN_UNUSED_VARIABLE = YES;
410 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
411 | MTL_ENABLE_DEBUG_INFO = NO;
412 | SDKROOT = iphoneos;
413 | TARGETED_DEVICE_FAMILY = "1,2";
414 | VALIDATE_PRODUCT = YES;
415 | };
416 | name = Release;
417 | };
418 | 58D1D45D1BE9D5F90087D7D9 /* Debug */ = {
419 | isa = XCBuildConfiguration;
420 | buildSettings = {
421 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
422 | INFOPLIST_FILE = MailSuffix/Info.plist;
423 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
424 | PRODUCT_BUNDLE_IDENTIFIER = com.MailSuffix;
425 | PRODUCT_NAME = "$(TARGET_NAME)";
426 | };
427 | name = Debug;
428 | };
429 | 58D1D45E1BE9D5F90087D7D9 /* Release */ = {
430 | isa = XCBuildConfiguration;
431 | buildSettings = {
432 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
433 | INFOPLIST_FILE = MailSuffix/Info.plist;
434 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
435 | PRODUCT_BUNDLE_IDENTIFIER = com.MailSuffix;
436 | PRODUCT_NAME = "$(TARGET_NAME)";
437 | };
438 | name = Release;
439 | };
440 | 58D1D4601BE9D5F90087D7D9 /* Debug */ = {
441 | isa = XCBuildConfiguration;
442 | buildSettings = {
443 | BUNDLE_LOADER = "$(TEST_HOST)";
444 | INFOPLIST_FILE = MailSuffixTests/Info.plist;
445 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
446 | PRODUCT_BUNDLE_IDENTIFIER = com.MailSuffixTests;
447 | PRODUCT_NAME = "$(TARGET_NAME)";
448 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MailSuffix.app/MailSuffix";
449 | };
450 | name = Debug;
451 | };
452 | 58D1D4611BE9D5F90087D7D9 /* Release */ = {
453 | isa = XCBuildConfiguration;
454 | buildSettings = {
455 | BUNDLE_LOADER = "$(TEST_HOST)";
456 | INFOPLIST_FILE = MailSuffixTests/Info.plist;
457 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
458 | PRODUCT_BUNDLE_IDENTIFIER = com.MailSuffixTests;
459 | PRODUCT_NAME = "$(TARGET_NAME)";
460 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MailSuffix.app/MailSuffix";
461 | };
462 | name = Release;
463 | };
464 | 58D1D4631BE9D5F90087D7D9 /* Debug */ = {
465 | isa = XCBuildConfiguration;
466 | buildSettings = {
467 | INFOPLIST_FILE = MailSuffixUITests/Info.plist;
468 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
469 | PRODUCT_BUNDLE_IDENTIFIER = com.MailSuffixUITests;
470 | PRODUCT_NAME = "$(TARGET_NAME)";
471 | TEST_TARGET_NAME = MailSuffix;
472 | USES_XCTRUNNER = YES;
473 | };
474 | name = Debug;
475 | };
476 | 58D1D4641BE9D5F90087D7D9 /* Release */ = {
477 | isa = XCBuildConfiguration;
478 | buildSettings = {
479 | INFOPLIST_FILE = MailSuffixUITests/Info.plist;
480 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
481 | PRODUCT_BUNDLE_IDENTIFIER = com.MailSuffixUITests;
482 | PRODUCT_NAME = "$(TARGET_NAME)";
483 | TEST_TARGET_NAME = MailSuffix;
484 | USES_XCTRUNNER = YES;
485 | };
486 | name = Release;
487 | };
488 | /* End XCBuildConfiguration section */
489 |
490 | /* Begin XCConfigurationList section */
491 | 58D1D42A1BE9D5F90087D7D9 /* Build configuration list for PBXProject "MailSuffix" */ = {
492 | isa = XCConfigurationList;
493 | buildConfigurations = (
494 | 58D1D45A1BE9D5F90087D7D9 /* Debug */,
495 | 58D1D45B1BE9D5F90087D7D9 /* Release */,
496 | );
497 | defaultConfigurationIsVisible = 0;
498 | defaultConfigurationName = Release;
499 | };
500 | 58D1D45C1BE9D5F90087D7D9 /* Build configuration list for PBXNativeTarget "MailSuffix" */ = {
501 | isa = XCConfigurationList;
502 | buildConfigurations = (
503 | 58D1D45D1BE9D5F90087D7D9 /* Debug */,
504 | 58D1D45E1BE9D5F90087D7D9 /* Release */,
505 | );
506 | defaultConfigurationIsVisible = 0;
507 | defaultConfigurationName = Release;
508 | };
509 | 58D1D45F1BE9D5F90087D7D9 /* Build configuration list for PBXNativeTarget "MailSuffixTests" */ = {
510 | isa = XCConfigurationList;
511 | buildConfigurations = (
512 | 58D1D4601BE9D5F90087D7D9 /* Debug */,
513 | 58D1D4611BE9D5F90087D7D9 /* Release */,
514 | );
515 | defaultConfigurationIsVisible = 0;
516 | defaultConfigurationName = Release;
517 | };
518 | 58D1D4621BE9D5F90087D7D9 /* Build configuration list for PBXNativeTarget "MailSuffixUITests" */ = {
519 | isa = XCConfigurationList;
520 | buildConfigurations = (
521 | 58D1D4631BE9D5F90087D7D9 /* Debug */,
522 | 58D1D4641BE9D5F90087D7D9 /* Release */,
523 | );
524 | defaultConfigurationIsVisible = 0;
525 | defaultConfigurationName = Release;
526 | };
527 | /* End XCConfigurationList section */
528 | };
529 | rootObject = 58D1D4271BE9D5F90087D7D9 /* Project object */;
530 | }
531 |
--------------------------------------------------------------------------------