├── MyChat ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── BaseController │ ├── BaseViewController.h │ └── BaseViewController.m ├── Chat │ ├── ChatCell │ │ ├── BaseCell │ │ │ ├── BaseChatTableViewCell.h │ │ │ └── BaseChatTableViewCell.m │ │ ├── CellDataType │ │ │ ├── BaseCellDataType.h │ │ │ └── BaseCellDataType.m │ │ ├── OtherChatTableViewCell.h │ │ ├── OtherChatTableViewCell.m │ │ ├── OtherChatTableViewCell.xib │ │ ├── OwnChatTableViewCell.h │ │ ├── OwnChatTableViewCell.m │ │ └── OwnChatTableViewCell.xib │ ├── ChatViewController.h │ ├── ChatViewController.m │ ├── ChatViewController.xib │ ├── ResizableImage │ │ ├── ResizableImageTool.h │ │ └── ResizableImageTool.m │ ├── VoiceButton │ │ ├── VoiceButton.h │ │ └── VoiceButton.m │ └── XunFei │ │ ├── IATConfig.h │ │ ├── IATConfig.m │ │ ├── ISRDataHelper.h │ │ └── ISRDataHelper.m ├── Default-568h@2x.png ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── chatIcon@2x.png │ │ └── chatIcon@3x.png │ ├── BrandAsset.launchimage │ │ └── Contents.json │ ├── Chat │ │ ├── Contents.json │ │ ├── chatTableViewBackImage.imageset │ │ │ ├── Contents.json │ │ │ └── chatTableViewBackImage.jpg │ │ ├── myChat.imageset │ │ │ ├── Contents.json │ │ │ └── myChat.png │ │ ├── otherChat.imageset │ │ │ ├── Contents.json │ │ │ └── otherChat.png │ │ └── voiceChat.imageset │ │ │ ├── Contents.json │ │ │ └── voiceChat.png │ ├── Contents.json │ └── title │ │ └── title_back.imageset │ │ ├── Contents.json │ │ └── title_back@2x.png ├── Info.plist ├── Login │ ├── LoginViewController.h │ ├── LoginViewController.m │ └── LoginViewController.xib ├── Register │ ├── RegisterViewController.h │ ├── RegisterViewController.m │ └── RegisterViewController.xib ├── icon.jpg ├── main.m ├── robotIcon.jpg └── voiceButtonBack.png ├── Podfile ├── Podfile.lock ├── Pods ├── AFNetworking │ ├── AFNetworking │ │ ├── AFHTTPRequestOperation.h │ │ ├── AFHTTPRequestOperation.m │ │ ├── AFHTTPRequestOperationManager.h │ │ ├── AFHTTPRequestOperationManager.m │ │ ├── AFHTTPSessionManager.h │ │ ├── AFHTTPSessionManager.m │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworkReachabilityManager.m │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFSecurityPolicy.m │ │ ├── AFURLConnectionOperation.h │ │ ├── AFURLConnectionOperation.m │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLRequestSerialization.m │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLResponseSerialization.m │ │ ├── AFURLSessionManager.h │ │ └── AFURLSessionManager.m │ ├── LICENSE │ ├── README.md │ └── UIKit+AFNetworking │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkActivityIndicatorManager.m │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIActivityIndicatorView+AFNetworking.m │ │ ├── UIAlertView+AFNetworking.h │ │ ├── UIAlertView+AFNetworking.m │ │ ├── UIButton+AFNetworking.h │ │ ├── UIButton+AFNetworking.m │ │ ├── UIImage+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIImageView+AFNetworking.m │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.m │ │ ├── UIRefreshControl+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.m │ │ ├── UIWebView+AFNetworking.h │ │ └── UIWebView+AFNetworking.m ├── Headers │ ├── Private │ │ ├── AFNetworking │ │ │ ├── AFHTTPRequestOperation.h │ │ │ ├── AFHTTPRequestOperationManager.h │ │ │ ├── AFHTTPSessionManager.h │ │ │ ├── AFNetworkActivityIndicatorManager.h │ │ │ ├── AFNetworkReachabilityManager.h │ │ │ ├── AFNetworking.h │ │ │ ├── AFSecurityPolicy.h │ │ │ ├── AFURLConnectionOperation.h │ │ │ ├── AFURLRequestSerialization.h │ │ │ ├── AFURLResponseSerialization.h │ │ │ ├── AFURLSessionManager.h │ │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ │ ├── UIAlertView+AFNetworking.h │ │ │ ├── UIButton+AFNetworking.h │ │ │ ├── UIImage+AFNetworking.h │ │ │ ├── UIImageView+AFNetworking.h │ │ │ ├── UIKit+AFNetworking.h │ │ │ ├── UIProgressView+AFNetworking.h │ │ │ ├── UIRefreshControl+AFNetworking.h │ │ │ └── UIWebView+AFNetworking.h │ │ └── IQKeyboardManager │ │ │ ├── IQBarButtonItem.h │ │ │ ├── IQKeyboardManager.h │ │ │ ├── IQKeyboardManagerConstants.h │ │ │ ├── IQKeyboardManagerConstantsInternal.h │ │ │ ├── IQKeyboardReturnKeyHandler.h │ │ │ ├── IQNSArray+Sort.h │ │ │ ├── IQSegmentedNextPrevious.h │ │ │ ├── IQTextView.h │ │ │ ├── IQTitleBarButtonItem.h │ │ │ ├── IQToolbar.h │ │ │ ├── IQUITextFieldView+Additions.h │ │ │ ├── IQUIView+Hierarchy.h │ │ │ ├── IQUIView+IQKeyboardToolbar.h │ │ │ ├── IQUIViewController+Additions.h │ │ │ ├── IQUIWindow+Hierarchy.h │ │ │ └── KeyboardManager.h │ └── Public │ │ ├── AFNetworking │ │ ├── AFHTTPRequestOperation.h │ │ ├── AFHTTPRequestOperationManager.h │ │ ├── AFHTTPSessionManager.h │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFURLConnectionOperation.h │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLSessionManager.h │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIAlertView+AFNetworking.h │ │ ├── UIButton+AFNetworking.h │ │ ├── UIImage+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.h │ │ └── UIWebView+AFNetworking.h │ │ └── IQKeyboardManager │ │ ├── IQBarButtonItem.h │ │ ├── IQKeyboardManager.h │ │ ├── IQKeyboardManagerConstants.h │ │ ├── IQKeyboardManagerConstantsInternal.h │ │ ├── IQKeyboardReturnKeyHandler.h │ │ ├── IQNSArray+Sort.h │ │ ├── IQSegmentedNextPrevious.h │ │ ├── IQTextView.h │ │ ├── IQTitleBarButtonItem.h │ │ ├── IQToolbar.h │ │ ├── IQUITextFieldView+Additions.h │ │ ├── IQUIView+Hierarchy.h │ │ ├── IQUIView+IQKeyboardToolbar.h │ │ ├── IQUIViewController+Additions.h │ │ ├── IQUIWindow+Hierarchy.h │ │ └── KeyboardManager.h ├── IQKeyboardManager │ ├── IQKeyBoardManager │ │ ├── Categories │ │ │ ├── IQNSArray+Sort.h │ │ │ ├── IQNSArray+Sort.m │ │ │ ├── IQUITextFieldView+Additions.h │ │ │ ├── IQUITextFieldView+Additions.m │ │ │ ├── IQUIView+Hierarchy.h │ │ │ ├── IQUIView+Hierarchy.m │ │ │ ├── IQUIViewController+Additions.h │ │ │ ├── IQUIViewController+Additions.m │ │ │ ├── IQUIWindow+Hierarchy.h │ │ │ └── IQUIWindow+Hierarchy.m │ │ ├── Constants │ │ │ ├── IQKeyboardManagerConstants.h │ │ │ └── IQKeyboardManagerConstantsInternal.h │ │ ├── IQKeyboardManager.h │ │ ├── IQKeyboardManager.m │ │ ├── IQKeyboardReturnKeyHandler.h │ │ ├── IQKeyboardReturnKeyHandler.m │ │ ├── IQSegmentedNextPrevious │ │ │ ├── IQSegmentedNextPrevious.h │ │ │ └── IQSegmentedNextPrevious.m │ │ ├── IQTextView │ │ │ ├── IQTextView.h │ │ │ └── IQTextView.m │ │ ├── IQToolbar │ │ │ ├── IQBarButtonItem.h │ │ │ ├── IQBarButtonItem.m │ │ │ ├── IQTitleBarButtonItem.h │ │ │ ├── IQTitleBarButtonItem.m │ │ │ ├── IQToolbar.h │ │ │ ├── IQToolbar.m │ │ │ ├── IQUIView+IQKeyboardToolbar.h │ │ │ └── IQUIView+IQKeyboardToolbar.m │ │ ├── KeyboardManager.h │ │ └── Resources │ │ │ └── IQKeyboardManager.bundle │ │ │ ├── IQButtonBarArrowLeft.png │ │ │ ├── IQButtonBarArrowLeft@2x.png │ │ │ ├── IQButtonBarArrowLeft@3x.png │ │ │ ├── IQButtonBarArrowRight.png │ │ │ ├── IQButtonBarArrowRight@2x.png │ │ │ ├── IQButtonBarArrowRight@3x.png │ │ │ ├── de.lproj │ │ │ └── IQKeyboardManager.strings │ │ │ ├── en.lproj │ │ │ └── IQKeyboardManager.strings │ │ │ ├── es.lproj │ │ │ └── IQKeyboardManager.strings │ │ │ ├── zh-Hans │ │ │ └── IQKeyboardManager.strings │ │ │ └── zh-Hant │ │ │ └── IQKeyboardManager.strings │ ├── LICENSE.md │ └── README.md ├── Manifest.lock ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── liuheng.xcuserdatad │ │ └── xcschemes │ │ ├── AFNetworking.xcscheme │ │ ├── IQKeyboardManager.xcscheme │ │ ├── Pods.xcscheme │ │ └── xcschememanagement.plist └── Target Support Files │ ├── AFNetworking │ ├── AFNetworking-Private.xcconfig │ ├── AFNetworking-dummy.m │ ├── AFNetworking-prefix.pch │ └── AFNetworking.xcconfig │ ├── IQKeyboardManager │ ├── IQKeyboardManager-Private.xcconfig │ ├── IQKeyboardManager-dummy.m │ ├── IQKeyboardManager-prefix.pch │ └── IQKeyboardManager.xcconfig │ └── Pods │ ├── Pods-acknowledgements.markdown │ ├── Pods-acknowledgements.plist │ ├── Pods-dummy.m │ ├── Pods-resources.sh │ ├── Pods.debug.xcconfig │ └── Pods.release.xcconfig ├── README.md ├── iflyMSC.framework ├── Headers │ ├── IFlyContact.h │ ├── IFlyDataUploader.h │ ├── IFlyDebugLog.h │ ├── IFlyISVDelegate.h │ ├── IFlyISVRecognizer.h │ ├── IFlyMSC.h │ ├── IFlyPcmRecorder.h │ ├── IFlyRecognizerView.h │ ├── IFlyRecognizerViewDelegate.h │ ├── IFlyResourceUtil.h │ ├── IFlySetting.h │ ├── IFlySpeechConstant.h │ ├── IFlySpeechError.h │ ├── IFlySpeechEvaluator.h │ ├── IFlySpeechEvaluatorDelegate.h │ ├── IFlySpeechEvent.h │ ├── IFlySpeechRecognizer.h │ ├── IFlySpeechRecognizerDelegate.h │ ├── IFlySpeechSynthesizer.h │ ├── IFlySpeechSynthesizerDelegate.h │ ├── IFlySpeechUnderstander.h │ ├── IFlySpeechUtility.h │ ├── IFlyTextUnderstander.h │ └── IFlyUserWords.h └── iflyMSC ├── screenshot ├── 1.PNG ├── 2.PNG └── 3.PNG ├── 小恒机器人.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ ├── bjmac1.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── liuheng.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── bjmac1.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ ├── IOSBmobDemo.xcscheme │ │ └── xcschememanagement.plist │ └── liuheng.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── IOSBmobDemo.xcscheme │ └── xcschememanagement.plist └── 小恒机器人.xcworkspace ├── contents.xcworkspacedata └── xcuserdata └── liuheng.xcuserdatad ├── UserInterfaceState.xcuserstate └── xcdebugger └── Breakpoints_v2.xcbkptlist /MyChat/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // IOSBmobDemo 4 | // 5 | // Created by BJMac1 on 15/8/27. 6 | // Copyright (c) 2015年 cn.com.hibor. 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 | -------------------------------------------------------------------------------- /MyChat/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // IOSBmobDemo 4 | // 5 | // Created by BJMac1 on 15/8/27. 6 | // Copyright (c) 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "LoginViewController.h" 12 | 13 | #import "KeyboardManager.h" 14 | 15 | #import "iflyMSC/IFlyMSC.h" 16 | 17 | //讯飞语音接口ID 18 | #define XunFei_APPID_VALUE @"5610d121" 19 | 20 | @interface AppDelegate (){ 21 | 22 | } 23 | 24 | @end 25 | 26 | @implementation AppDelegate 27 | 28 | 29 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 30 | 31 | /* 32 | 初始化NavigationController导航控制器 33 | */ 34 | self.window=[[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 35 | 36 | LoginViewController *loginController=[[LoginViewController alloc] init]; 37 | 38 | UINavigationController *nacCtrl=[[UINavigationController alloc] initWithRootViewController:loginController]; 39 | 40 | self.window.rootViewController=nacCtrl; 41 | 42 | //隐藏UINavigationBar 43 | [nacCtrl setNavigationBarHidden:YES animated:YES]; 44 | 45 | //开始显示 46 | [self.window makeKeyAndVisible]; 47 | 48 | 49 | /* 50 | 初始化IQKeyboardManager 51 | */ 52 | IQKeyboardManager *manager = [IQKeyboardManager sharedManager]; 53 | manager.enable = YES; 54 | 55 | /* 56 | 初始化讯飞语音接口 57 | */ 58 | NSString *initString = [[NSString alloc] initWithFormat:@"appid=%@",XunFei_APPID_VALUE]; 59 | [IFlySpeechUtility createUtility:initString]; 60 | 61 | return YES; 62 | } 63 | 64 | - (void)applicationWillResignActive:(UIApplication *)application { 65 | // 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. 66 | // 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. 67 | } 68 | 69 | - (void)applicationDidEnterBackground:(UIApplication *)application { 70 | // 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. 71 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 72 | } 73 | 74 | - (void)applicationWillEnterForeground:(UIApplication *)application { 75 | // 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. 76 | } 77 | 78 | - (void)applicationDidBecomeActive:(UIApplication *)application { 79 | // 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. 80 | } 81 | 82 | - (void)applicationWillTerminate:(UIApplication *)application { 83 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /MyChat/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /MyChat/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 | -------------------------------------------------------------------------------- /MyChat/BaseController/BaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseViewController.h 3 | // IOSBmobDemo 4 | // 5 | // Created by 刘恒 on 15/10/2. 6 | // Copyright (c) 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BaseViewController : UIViewController{ 12 | 13 | } 14 | 15 | /** 16 | 17 | 显示弹出框的方法 18 | 19 | message :  弹出框中需要显示的信息 20 | 21 | */ 22 | -(void) showAlertDialogWithMessage:(NSString *) message; 23 | 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /MyChat/BaseController/BaseViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BaseViewController.m 3 | // IOSBmobDemo 4 | // 5 | // Created by 刘恒 on 15/10/2. 6 | // Copyright (c) 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import "BaseViewController.h" 10 | 11 | @interface BaseViewController (){ 12 | 13 | } 14 | 15 | @end 16 | 17 | @implementation BaseViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | 22 | //去除ScrollView顶部预留位置 23 | self.automaticallyAdjustsScrollViewInsets=NO; 24 | 25 | } 26 | 27 | 28 | /** 29 | 30 | 显示弹出框的方法 31 | 32 | message :  弹出框中需要显示的信息 33 | 34 | */ 35 | -(void) showAlertDialogWithMessage:(NSString *) message{ 36 | 37 | UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:message delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; 38 | 39 | [alert show]; 40 | 41 | 42 | 43 | } 44 | 45 | 46 | - (void)didReceiveMemoryWarning { 47 | [super didReceiveMemoryWarning]; 48 | // Dispose of any resources that can be recreated. 49 | } 50 | 51 | /* 52 | #pragma mark - Navigation 53 | 54 | // In a storyboard-based application, you will often want to do a little preparation before navigation 55 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 56 | // Get the new view controller using [segue destinationViewController]. 57 | // Pass the selected object to the new view controller. 58 | } 59 | */ 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /MyChat/Chat/ChatCell/BaseCell/BaseChatTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseChatTableViewCell.h 3 | // 小恒机器人 4 | // 5 | // Created by 刘恒 on 15/10/3. 6 | // Copyright © 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BaseChatTableViewCell : UITableViewCell{ 12 | 13 | } 14 | 15 | //chatImageView居右的约束 16 | @property (strong, nonatomic) IBOutlet NSLayoutConstraint *chatImageViewTrailingConstraint; 17 | 18 | //cell真正的高度 19 | @property (nonatomic) float currentCellHeight; 20 | 21 | 22 | @property (strong, nonatomic) IBOutlet UIImageView *chatContentImageView; 23 | 24 | @property (strong, nonatomic) IBOutlet UILabel *chatLabel; 25 | 26 | /** 27 | 设置此Cell聊天内容的方法,此方法在设置chatLabel内容的同时,也会自动设置聊天内容的背景图片 28 | */ 29 | -(void) setChatContentString:(NSString *) chatString; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /MyChat/Chat/ChatCell/BaseCell/BaseChatTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // BaseChatTableViewCell.m 3 | // 小恒机器人 4 | // 5 | // Created by 刘恒 on 15/10/3. 6 | // Copyright © 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import "BaseChatTableViewCell.h" 10 | 11 | #import "ResizableImageTool.h" 12 | 13 | #import "OtherChatTableViewCell.h" 14 | 15 | #import "OwnChatTableViewCell.h" 16 | 17 | //chatLabel居左的距离 18 | #define chatLabelLeftMagin 75 19 | 20 | //屏幕宽度 21 | #define screenWidth [UIScreen mainScreen].bounds.size.width 22 | 23 | 24 | @interface BaseChatTableViewCell(){ 25 | 26 | //聊天label真正的大小 27 | CGSize chatLabelTrueSize; 28 | } 29 | 30 | @end 31 | 32 | @implementation BaseChatTableViewCell 33 | 34 | /** 35 | 设置此Cell聊天内容的方法,此方法在设置chatLabel内容的同时,也会自动设置聊天内容的背景图片 36 | */ 37 | -(void) setChatContentString:(NSString *) chatString{ 38 | 39 | /* 40 | 因为cell会复用,但你不知道是真正原来位置的复用,还是别的位置取你的来进行复用 41 | 42 | 假如只有三个cell,拖拽向上滑动一些,消失了,在撒手,这就是真正原来位置的复用 43 | 44 | 假如有一百个cell,滑动到最底端,就可能去最上面的cell来进行填充,所以必须要进行判断 45 | 46 | 如果要显示的内容不一样的话,重新生成 47 | 48 | */ 49 | if (![self.chatLabel.text isEqualToString:chatString]) { 50 | 51 | 52 | //1.设置聊天内容 53 | self.chatLabel.text = chatString; 54 | 55 | 56 | //得到真实高度 57 | [self getMyCurrentHeightAndLabelCurrentSize]; 58 | 59 | 60 | //如果是其他人聊天的话 61 | if ([NSStringFromClass([self class]) isEqualToString:NSStringFromClass([OtherChatTableViewCell class])]) { 62 | 63 | //设置其他人的聊天的背景图片 64 | [self.chatContentImageView setImage:[ResizableImageTool getResizableImageWithImageName:@"otherChat.png" andTopMagin:45 LeftMagin:30 ButtomMagin:15 RightMagin:15]]; 65 | 66 | //设置聊天的背景图片的大小 67 | self.chatImageViewTrailingConstraint.constant = -(screenWidth-chatLabelLeftMagin-chatLabelTrueSize.width-5); 68 | 69 | }else { 70 | 71 | //设置自己的聊天的背景图片 72 | [self.chatContentImageView setImage:[ResizableImageTool getResizableImageWithImageName:@"myChat.png" andTopMagin:45 LeftMagin:15 ButtomMagin:15 RightMagin:30]]; 73 | 74 | //设置聊天的背景图片的大小 75 | self.chatImageViewTrailingConstraint.constant = screenWidth-chatLabelLeftMagin-chatLabelTrueSize.width-5; 76 | } 77 | 78 | } 79 | 80 | 81 | 82 | } 83 | 84 | /** 85 | 1.得到这个cell的currentCellHeight值 86 | 2.得到里面label正确的大小 87 | */ 88 | -(void) getMyCurrentHeightAndLabelCurrentSize{ 89 | 90 | 91 | chatLabelTrueSize = [self.chatLabel.text boundingRectWithSize: 92 | //注意第一个参数是指定的label的宽度 93 | CGSizeMake(screenWidth-95, CGFLOAT_MAX) 94 | options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading 95 | attributes:[NSDictionary dictionaryWithObjectsAndKeys:self.chatLabel.font,NSFontAttributeName, nil] context:nil].size; 96 | 97 | //得到chatlabel的高度 98 | CGFloat chatLabelHeight = chatLabelTrueSize.height; 99 | 100 | //得到并设置自己的真实高度 101 | self.currentCellHeight = chatLabelHeight+30; 102 | 103 | 104 | } 105 | 106 | 107 | 108 | /** 109 | 110 | 废弃的方法,使用这个方法在第二次获取高度的时候会获取错误,还是不适用这种自动获取了,略坑 111 | 112 | 得到这个cell的currentCellHeight值 113 | */ 114 | //-(void) getMyCurrentHeight{ 115 | // 116 | // 117 | // 118 | // //设置label的最大宽度,其中95是chatLabel左边的约束加上右边的约束, 119 | // /* 120 | // 但是我们需要注意的是,我们的chatLabel右边本来是没有约束的,这样做的好处就是得到chatLabel的宽高是其 121 | // 真实宽高 122 | // 123 | // 因为假如我们约束了chatLabel的上下左右的话,如果chatLabel只有一行字的话,那么他的宽高就不是真实的宽高 124 | // 125 | // 而我们向下面这种约束的话,设置了label的最大宽度,但是label的实际宽度是可以少于这个最大宽度的,这种方法就能得到label的最大宽度了 126 | // */ 127 | // self.chatLabel.preferredMaxLayoutWidth = screenWidth - 95; 128 | // 129 | // //调整布局 130 | // [self setNeedsUpdateConstraints]; 131 | // [self updateConstraintsIfNeeded]; 132 | // [self setNeedsLayout]; 133 | // [self layoutIfNeeded]; 134 | // 135 | // 136 | // //得到并设置自己的真实高度 137 | // self.currentCellHeight = [self.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height + 1; 138 | // 139 | // 140 | //} 141 | 142 | @end 143 | -------------------------------------------------------------------------------- /MyChat/Chat/ChatCell/CellDataType/BaseCellDataType.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseCellDataType.h 3 | // 小恒机器人 4 | // 5 | // Created by 刘恒 on 15/10/3. 6 | // Copyright © 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | 整个聊天TableView中cell的基本数据类型 13 | */ 14 | @interface BaseCellDataType : NSObject{ 15 | 16 | } 17 | 18 | //聊天的信息 19 | @property (nonatomic) NSString *chatString; 20 | 21 | //是否是自己发出的消息 22 | @property (nonatomic) BOOL isOwn; 23 | 24 | //初始化方法 25 | -(instancetype) initWithChatString:(NSString *) chatString andIsOwn:(BOOL) isOwn; 26 | 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /MyChat/Chat/ChatCell/CellDataType/BaseCellDataType.m: -------------------------------------------------------------------------------- 1 | // 2 | // BaseCellDataType.m 3 | // 小恒机器人 4 | // 5 | // Created by 刘恒 on 15/10/3. 6 | // Copyright © 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import "BaseCellDataType.h" 10 | 11 | @implementation BaseCellDataType 12 | 13 | -(instancetype) initWithChatString:(NSString *) chatString andIsOwn:(BOOL) isOwn{ 14 | 15 | self = [super init]; 16 | 17 | if (self) { 18 | 19 | self.chatString = chatString; 20 | 21 | self.isOwn = isOwn; 22 | 23 | } 24 | 25 | return self; 26 | 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /MyChat/Chat/ChatCell/OtherChatTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // OwnChatTableViewCell.h 3 | // 小恒机器人 4 | // 5 | // Created by 刘恒 on 15/10/2. 6 | // Copyright © 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BaseChatTableViewCell.h" 12 | 13 | @interface OtherChatTableViewCell : BaseChatTableViewCell{ 14 | 15 | } 16 | 17 | //chatImageView居左的约束 18 | @property (strong, nonatomic) IBOutlet NSLayoutConstraint *chatImageViewTrailingConstraint; 19 | 20 | @property (strong, nonatomic) IBOutlet UIImageView *chatContentImageView; 21 | 22 | @property (strong, nonatomic) IBOutlet UILabel *chatLabel; 23 | 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /MyChat/Chat/ChatCell/OtherChatTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // OwnChatTableViewCell.m 3 | // 小恒机器人 4 | // 5 | // Created by 刘恒 on 15/10/2. 6 | // Copyright © 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import "OtherChatTableViewCell.h" 10 | 11 | 12 | @implementation OtherChatTableViewCell 13 | 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MyChat/Chat/ChatCell/OwnChatTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // OwnChatTableViewCell.h 3 | // 小恒机器人 4 | // 5 | // Created by 刘恒 on 15/10/3. 6 | // Copyright © 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BaseChatTableViewCell.h" 12 | 13 | @interface OwnChatTableViewCell : BaseChatTableViewCell{ 14 | 15 | } 16 | 17 | //chatImageView居左的约束 18 | @property (strong, nonatomic) IBOutlet NSLayoutConstraint *chatImageViewTrailingConstraint; 19 | 20 | @property (strong, nonatomic) IBOutlet UIImageView *chatContentImageView; 21 | 22 | @property (strong, nonatomic) IBOutlet UILabel *chatLabel; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /MyChat/Chat/ChatCell/OwnChatTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // OwnChatTableViewCell.m 3 | // 小恒机器人 4 | // 5 | // Created by 刘恒 on 15/10/3. 6 | // Copyright © 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import "OwnChatTableViewCell.h" 10 | 11 | @implementation OwnChatTableViewCell 12 | 13 | - (void)awakeFromNib { 14 | // Initialization code 15 | } 16 | 17 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 18 | [super setSelected:selected animated:animated]; 19 | 20 | // Configure the view for the selected state 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /MyChat/Chat/ChatViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChatViewController.h 3 | // 小恒机器人 4 | // 5 | // Created by 刘恒 on 15/10/2. 6 | // Copyright © 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BaseViewController.h" 12 | 13 | #import "iflyMSC/iflyMSC.h" 14 | 15 | #import "IATConfig.h" 16 | 17 | #import "ISRDataHelper.h" 18 | 19 | #import "VoiceButton.h" 20 | 21 | @interface ChatViewController : BaseViewController{ 22 | 23 | 24 | } 25 | 26 | @property (strong,nonatomic) IFlySpeechRecognizer *iFlySpeechRecognizer;//不带界面的识别对象 27 | 28 | 29 | @property (strong, nonatomic) IBOutlet NSLayoutConstraint *baseScrollViewButtomConstraint; 30 | 31 | 32 | //聊天的展示tableView 33 | @property (strong, nonatomic) IBOutlet UITableView *chatTableView; 34 | 35 | //聊天的输入框 36 | @property (strong, nonatomic) IBOutlet UITextField *editTextField; 37 | 38 | 39 | @property (strong, nonatomic) IBOutlet VoiceButton *voiceButton; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /MyChat/Chat/ResizableImage/ResizableImageTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // ResizableImageTool.h 3 | // 小恒机器人 4 | // 5 | // Created by 刘恒 on 15/10/2. 6 | // Copyright © 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import 12 | 13 | /** 14 | 获取拉伸图片的工具类 15 | */ 16 | @interface ResizableImageTool : NSObject{ 17 | 18 | } 19 | 20 | /** 21 | 22 | 得到一个指定图片名称的可拉伸图片 23 | 4个数分别是图片拉伸区域距顶,距左,距下,距右的距离。 24 | 25 | 比如(10,10,10,10)即是拉伸区域距离原图上左下右都为10pt 26 | 27 | UIImageResizingModeStretch:拉伸模式,通过拉伸UIEdgeInsets指定的矩形区域来填充图片 28 | UIImageResizingModeTile:平铺模式,通过重复显示UIEdgeInsets指定的矩形区域来填充图 29 | 30 | */ 31 | +(UIImage *) getResizableImageWithImageName:(NSString *) resizableImageName andTopMagin:(CGFloat) top LeftMagin:(CGFloat) left ButtomMagin:(CGFloat) bottom RightMagin:(CGFloat) right; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /MyChat/Chat/ResizableImage/ResizableImageTool.m: -------------------------------------------------------------------------------- 1 | // 2 | // ResizableImageTool.m 3 | // 小恒机器人 4 | // 5 | // Created by 刘恒 on 15/10/2. 6 | // Copyright © 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import "ResizableImageTool.h" 10 | 11 | 12 | 13 | @implementation ResizableImageTool 14 | 15 | 16 | +(UIImage *) getResizableImageWithImageName:(NSString *) resizableImageName andTopMagin:(CGFloat) top LeftMagin:(CGFloat) left ButtomMagin:(CGFloat) bottom RightMagin:(CGFloat) right{ 17 | 18 | UIImage* resizableImage =[UIImage imageNamed:resizableImageName]; 19 | 20 | UIEdgeInsets insets = UIEdgeInsetsMake(top, left, bottom, right); 21 | 22 | resizableImage = [resizableImage resizableImageWithCapInsets:insets resizingMode:UIImageResizingModeStretch]; 23 | 24 | return resizableImage; 25 | 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /MyChat/Chat/VoiceButton/VoiceButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // VoiceButton.h 3 | // 小恒机器人 4 | // 5 | // Created by 刘恒 on 15/10/4. 6 | // Copyright © 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | VoiceButton的触摸回调协议 13 | */ 14 | @protocol VoiceButtonTouchDelegate 15 | 16 | @required 17 | /** 18 | VoiceButton开始触摸的时候 19 | */ 20 | -(void) voiceButtonTouchBegan; 21 | /** 22 | VoiceButton结束触摸的时候 23 | */ 24 | -(void) voiceButtonTouchEnded; 25 | 26 | @end 27 | 28 | /** 29 | 自定义的语音按钮 30 | 可响应开始触摸和取消触摸事件 31 | */ 32 | @interface VoiceButton : UIButton{ 33 | 34 | } 35 | 36 | @property (nonatomic) id buttonTouchDelegate; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /MyChat/Chat/VoiceButton/VoiceButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // VoiceButton.m 3 | // 小恒机器人 4 | // 5 | // Created by 刘恒 on 15/10/4. 6 | // Copyright © 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import "VoiceButton.h" 10 | 11 | @implementation VoiceButton 12 | 13 | -(instancetype) initWithCoder:(NSCoder *)aDecoder{ 14 | self = [super initWithCoder:aDecoder]; 15 | if (self) { 16 | NSLog(@"调用了VoiceButton的initWithCoder方法"); 17 | } 18 | return self; 19 | } 20 | 21 | -(instancetype) initWithFrame:(CGRect)frame{ 22 | self = [super initWithFrame:frame]; 23 | if (self) { 24 | NSLog(@"调用了VoiceButton的initWithFrame方法"); 25 | } 26 | return self; 27 | } 28 | 29 | 30 | 31 | /** 32 | 重写点击事件 33 | */ 34 | -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ 35 | 36 | [self.buttonTouchDelegate voiceButtonTouchBegan]; 37 | } 38 | 39 | 40 | -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ 41 | 42 | [self.buttonTouchDelegate voiceButtonTouchEnded]; 43 | } 44 | 45 | /** 46 | 每回创建的时候都会调用drawRect方法 47 | */ 48 | - (void)drawRect:(CGRect)rect { 49 | NSLog(@"调用了VoiceButton的drawRect方法");} 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /MyChat/Chat/XunFei/IATConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // IATConfig.h 3 | // MSCDemo_UI 4 | // 5 | // Created by wangdan on 15-4-25. 6 | // Copyright (c) 2015年 iflytek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface IATConfig : NSObject 12 | 13 | +(IATConfig *)sharedInstance; 14 | 15 | 16 | +(NSString *)mandarin; 17 | +(NSString *)cantonese; 18 | +(NSString *)henanese; 19 | +(NSString *)chinese; 20 | +(NSString *)english; 21 | +(NSString *)lowSampleRate; 22 | +(NSString *)highSampleRate; 23 | +(NSString *)isDot; 24 | +(NSString *)noDot; 25 | 26 | 27 | /** 28 | 以下参数,需要通过 29 | iFlySpeechRecgonizer 30 | 进行设置 31 | ****/ 32 | @property (nonatomic, strong) NSString *speechTimeout; 33 | @property (nonatomic, strong) NSString *vadEos; 34 | @property (nonatomic, strong) NSString *vadBos; 35 | 36 | @property (nonatomic, strong) NSString *language; 37 | @property (nonatomic, strong) NSString *accent; 38 | 39 | @property (nonatomic, strong) NSString *dot; 40 | @property (nonatomic, strong) NSString *sampleRate; 41 | 42 | 43 | /** 44 | 以下参数无需设置 45 | 不必关 46 | ****/ 47 | @property (nonatomic, assign) BOOL haveView; 48 | @property (nonatomic, strong) NSArray *accentIdentifer; 49 | @property (nonatomic, strong) NSArray *accentNickName; 50 | 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /MyChat/Chat/XunFei/IATConfig.m: -------------------------------------------------------------------------------- 1 | // 2 | // IATConfig.m 3 | // MSCDemo_UI 4 | // 5 | // Created by wangdan on 15-4-25. 6 | // Copyright (c) 2015年 iflytek. All rights reserved. 7 | // 8 | 9 | #define PUTONGHUA @"mandarin" 10 | #define YUEYU @"cantonese" 11 | #define HENANHUA @"henanese" 12 | #define ENGLISH @"en_us" 13 | #define CHINESE @"zh_cn"; 14 | 15 | #import "IATConfig.h" 16 | 17 | @implementation IATConfig 18 | 19 | -(id)init { 20 | self = [super init]; 21 | if (self) { 22 | [self defaultSetting]; 23 | return self; 24 | } 25 | return nil; 26 | } 27 | 28 | 29 | +(IATConfig *)sharedInstance { 30 | static IATConfig * instance = nil; 31 | static dispatch_once_t predict; 32 | dispatch_once(&predict, ^{ 33 | instance = [[IATConfig alloc] init]; 34 | }); 35 | return instance; 36 | } 37 | 38 | 39 | -(void)defaultSetting { 40 | _speechTimeout = @"30000"; 41 | _vadEos = @"3000"; 42 | _vadBos = @"3000"; 43 | _dot = @"1"; 44 | _sampleRate = @"16000"; 45 | _language = CHINESE; 46 | _accent = PUTONGHUA; 47 | _haveView = NO;//默认是不dai界面的 48 | _accentNickName = [[NSArray alloc] initWithObjects:@"粤语",@"普通话",@"河南话",@"英文", nil]; 49 | 50 | } 51 | 52 | 53 | +(NSString *)mandarin { 54 | return PUTONGHUA; 55 | } 56 | +(NSString *)cantonese { 57 | return YUEYU; 58 | } 59 | +(NSString *)henanese { 60 | return HENANHUA; 61 | } 62 | +(NSString *)chinese { 63 | return CHINESE; 64 | } 65 | +(NSString *)english { 66 | return ENGLISH; 67 | } 68 | 69 | +(NSString *)lowSampleRate { 70 | return @"8000"; 71 | } 72 | 73 | +(NSString *)highSampleRate { 74 | return @"16000"; 75 | } 76 | 77 | +(NSString *)isDot { 78 | return @"1"; 79 | } 80 | 81 | +(NSString *)noDot { 82 | return @"0"; 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /MyChat/Chat/XunFei/ISRDataHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // ISRDataHander.h 3 | // MSC 4 | // 5 | // Created by ypzhao on 12-11-19. 6 | // Copyright (c) 2012年 iflytek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ISRDataHelper : NSObject 12 | 13 | 14 | // 解析命令词返回的结果 15 | + (NSString*)stringFromAsr:(NSString*)params; 16 | 17 | /** 18 | 解析JSON数据 19 | ****/ 20 | + (NSString *)stringFromJson:(NSString*)params;// 21 | 22 | 23 | /** 24 | 解析语法识别返回的结果 25 | ****/ 26 | + (NSString *)stringFromABNFJson:(NSString*)params; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /MyChat/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/MyChat/Default-568h@2x.png -------------------------------------------------------------------------------- /MyChat/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 | "size" : "60x60", 25 | "idiom" : "iphone", 26 | "filename" : "chatIcon@2x.png", 27 | "scale" : "2x" 28 | }, 29 | { 30 | "size" : "60x60", 31 | "idiom" : "iphone", 32 | "filename" : "chatIcon@3x.png", 33 | "scale" : "3x" 34 | }, 35 | { 36 | "idiom" : "ipad", 37 | "size" : "29x29", 38 | "scale" : "1x" 39 | }, 40 | { 41 | "idiom" : "ipad", 42 | "size" : "29x29", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "idiom" : "ipad", 47 | "size" : "40x40", 48 | "scale" : "1x" 49 | }, 50 | { 51 | "idiom" : "ipad", 52 | "size" : "40x40", 53 | "scale" : "2x" 54 | }, 55 | { 56 | "idiom" : "ipad", 57 | "size" : "76x76", 58 | "scale" : "1x" 59 | }, 60 | { 61 | "idiom" : "ipad", 62 | "size" : "76x76", 63 | "scale" : "2x" 64 | } 65 | ], 66 | "info" : { 67 | "version" : 1, 68 | "author" : "xcode" 69 | } 70 | } -------------------------------------------------------------------------------- /MyChat/Images.xcassets/AppIcon.appiconset/chatIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/MyChat/Images.xcassets/AppIcon.appiconset/chatIcon@2x.png -------------------------------------------------------------------------------- /MyChat/Images.xcassets/AppIcon.appiconset/chatIcon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/MyChat/Images.xcassets/AppIcon.appiconset/chatIcon@3x.png -------------------------------------------------------------------------------- /MyChat/Images.xcassets/BrandAsset.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "ipad", 6 | "minimum-system-version" : "7.0", 7 | "extent" : "full-screen", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "landscape", 12 | "idiom" : "ipad", 13 | "minimum-system-version" : "7.0", 14 | "extent" : "full-screen", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "orientation" : "landscape", 19 | "idiom" : "ipad", 20 | "minimum-system-version" : "7.0", 21 | "extent" : "full-screen", 22 | "scale" : "2x" 23 | }, 24 | { 25 | "orientation" : "portrait", 26 | "idiom" : "iphone", 27 | "minimum-system-version" : "7.0", 28 | "scale" : "2x" 29 | }, 30 | { 31 | "orientation" : "portrait", 32 | "idiom" : "iphone", 33 | "minimum-system-version" : "7.0", 34 | "subtype" : "retina4", 35 | "scale" : "2x" 36 | }, 37 | { 38 | "orientation" : "portrait", 39 | "idiom" : "ipad", 40 | "minimum-system-version" : "7.0", 41 | "extent" : "full-screen", 42 | "scale" : "1x" 43 | } 44 | ], 45 | "info" : { 46 | "version" : 1, 47 | "author" : "xcode" 48 | } 49 | } -------------------------------------------------------------------------------- /MyChat/Images.xcassets/Chat/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MyChat/Images.xcassets/Chat/chatTableViewBackImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "chatTableViewBackImage.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyChat/Images.xcassets/Chat/chatTableViewBackImage.imageset/chatTableViewBackImage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/MyChat/Images.xcassets/Chat/chatTableViewBackImage.imageset/chatTableViewBackImage.jpg -------------------------------------------------------------------------------- /MyChat/Images.xcassets/Chat/myChat.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "myChat.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyChat/Images.xcassets/Chat/myChat.imageset/myChat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/MyChat/Images.xcassets/Chat/myChat.imageset/myChat.png -------------------------------------------------------------------------------- /MyChat/Images.xcassets/Chat/otherChat.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "otherChat.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyChat/Images.xcassets/Chat/otherChat.imageset/otherChat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/MyChat/Images.xcassets/Chat/otherChat.imageset/otherChat.png -------------------------------------------------------------------------------- /MyChat/Images.xcassets/Chat/voiceChat.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "voiceChat.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyChat/Images.xcassets/Chat/voiceChat.imageset/voiceChat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/MyChat/Images.xcassets/Chat/voiceChat.imageset/voiceChat.png -------------------------------------------------------------------------------- /MyChat/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MyChat/Images.xcassets/title/title_back.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "title_back@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyChat/Images.xcassets/title/title_back.imageset/title_back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/MyChat/Images.xcassets/title/title_back.imageset/title_back@2x.png -------------------------------------------------------------------------------- /MyChat/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSAppTransportSecurity 6 | 7 | NSAllowsArbitraryLoads 8 | 9 | 10 | CFBundleDevelopmentRegion 11 | en 12 | CFBundleExecutable 13 | $(EXECUTABLE_NAME) 14 | CFBundleIdentifier 15 | $(PRODUCT_BUNDLE_IDENTIFIER) 16 | CFBundleInfoDictionaryVersion 17 | 6.0 18 | CFBundleName 19 | $(PRODUCT_NAME) 20 | CFBundlePackageType 21 | APPL 22 | CFBundleShortVersionString 23 | 1.0 24 | CFBundleSignature 25 | ???? 26 | CFBundleVersion 27 | 1 28 | LSRequiresIPhoneOS 29 | 30 | UILaunchStoryboardName 31 | LaunchScreen 32 | UIMainStoryboardFile 33 | Main 34 | UIRequiredDeviceCapabilities 35 | 36 | armv7 37 | 38 | UISupportedInterfaceOrientations 39 | 40 | UIInterfaceOrientationPortrait 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /MyChat/Login/LoginViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoginViewController.h 3 | // IOSBmobDemo 4 | // 5 | // Created by 刘恒 on 15/10/2. 6 | // Copyright (c) 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BaseViewController.h" 12 | 13 | /** 14 | 15 | 登陆界面 16 | 17 | */ 18 | @interface LoginViewController : BaseViewController{ 19 | 20 | } 21 | 22 | 23 | //imageView距离顶部的约束 24 | @property (strong, nonatomic) IBOutlet NSLayoutConstraint *imageViewMaginTopConstraint; 25 | 26 | //imageView与ScrollView纵向中心的约束 27 | @property (strong, nonatomic) IBOutlet NSLayoutConstraint *imageViewCenterScrollConstraint; 28 | 29 | 30 | //登录button距离密码输入框的约束 31 | @property (strong, nonatomic) IBOutlet NSLayoutConstraint *loginButtonMaginFiedConstraint; 32 | 33 | 34 | 35 | 36 | 37 | //头像imageView 38 | @property (strong, nonatomic) IBOutlet UIImageView *imageView; 39 | 40 | //登录的输入框 41 | @property (strong, nonatomic) IBOutlet UITextField *loginTextField; 42 | 43 | //密码的输入框 44 | @property (strong, nonatomic) IBOutlet UITextField *passWordTextField; 45 | 46 | //登录按钮 47 | @property (strong, nonatomic) IBOutlet UIButton *loginButton; 48 | 49 | //注册按钮 50 | @property (strong, nonatomic) IBOutlet UIButton *registerButton; 51 | 52 | 53 | 54 | 55 | 56 | 57 | @property (strong, nonatomic) IBOutlet NSLayoutConstraint *baseScrollViewButtomConstraint; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /MyChat/Login/LoginViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LoginViewController.m 3 | // IOSBmobDemo 4 | // 5 | // Created by 刘恒 on 15/10/2. 6 | // Copyright (c) 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import "LoginViewController.h" 10 | 11 | #import "RegisterViewController.h" 12 | 13 | #import "ChatViewController.h" 14 | 15 | 16 | 17 | @interface LoginViewController (){ 18 | 19 | } 20 | 21 | @end 22 | 23 | @implementation LoginViewController 24 | 25 | 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | 30 | 31 | 32 | 33 | //开始动画,记得有一定时间的延迟 34 | //动画网址: http: //blog.sina.com.cn/s/blog_8d1bc23f0102vqs1.html 35 | //UIViewAnimationOptionCurveEaseInOut 此枚举值为时间曲线函数,由慢到快 36 | [UIView animateWithDuration:1.0f delay:0.2f options:UIViewAnimationOptionCurveEaseInOut animations:^{ 37 | 38 | //更改约束 39 | self.imageViewMaginTopConstraint.priority = UILayoutPriorityDefaultLow; 40 | self.imageViewCenterScrollConstraint.priority = UILayoutPriorityDefaultHigh; 41 | 42 | self.loginButtonMaginFiedConstraint.constant = 50; 43 | 44 | //更改透明度 45 | [self setAllViewAlpha:1.0]; 46 | 47 | //记得要一定使用此方法,否则会直接更新约束 48 | [self.view layoutIfNeeded]; 49 | 50 | } completion:^(BOOL finished) { 51 | 52 | [self.loginTextField setPlaceholder:@"请输入用户名"]; 53 | 54 | [self.passWordTextField setPlaceholder:@"请输入密码"]; 55 | 56 | }]; 57 | 58 | } 59 | 60 | /** 61 | 62 | 设置所有组件透明度的方法 63 | 64 | */ 65 | -(void) setAllViewAlpha:(CGFloat) alpha{ 66 | 67 | 68 | [self.imageView setAlpha:alpha]; 69 | [self.loginTextField setAlpha:alpha]; 70 | [self.passWordTextField setAlpha:alpha]; 71 | [self.loginButton setAlpha:alpha]; 72 | [self.registerButton setAlpha:alpha]; 73 | 74 | 75 | 76 | } 77 | 78 | 79 | /** 80 | 81 | 登陆按钮的点击事件 82 | 83 | */ 84 | - (IBAction)loginClickEvent:(id)sender { 85 | 86 | 87 | [self.view endEditing:YES]; 88 | 89 | //跳转到聊天界面 90 | ChatViewController * chatViewController = [[ChatViewController alloc] init]; 91 | 92 | [self.navigationController pushViewController:chatViewController animated:YES]; 93 | 94 | 95 | } 96 | 97 | 98 | /** 99 | 100 | 注册按钮的点击事件 101 | 102 | */ 103 | - (IBAction)registerClickEvent:(id)sender { 104 | 105 | RegisterViewController *registerViewController = [[RegisterViewController alloc] init]; 106 | 107 | [self.navigationController pushViewController:registerViewController animated:YES]; 108 | 109 | 110 | } 111 | 112 | 113 | - (void)didReceiveMemoryWarning { 114 | [super didReceiveMemoryWarning]; 115 | // Dispose of any resources that can be recreated. 116 | } 117 | 118 | 119 | 120 | @end 121 | -------------------------------------------------------------------------------- /MyChat/Register/RegisterViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RegisterViewController.h 3 | // IOSBmobDemo 4 | // 5 | // Created by 刘恒 on 15/10/2. 6 | // Copyright (c) 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BaseViewController.h" 12 | 13 | @interface RegisterViewController : BaseViewController{ 14 | 15 | } 16 | 17 | @property (strong, nonatomic) IBOutlet NSLayoutConstraint *userNameMaginTopConstraint; 18 | 19 | @property (strong, nonatomic) IBOutlet NSLayoutConstraint *userNameCenterScrollConstraint; 20 | 21 | 22 | @property (strong, nonatomic) IBOutlet NSLayoutConstraint *registerButtonMaginFiledConstraint; 23 | 24 | 25 | 26 | 27 | 28 | @property (strong, nonatomic) IBOutlet UIView *titleView; 29 | 30 | 31 | @property (strong, nonatomic) IBOutlet UITextField *userNameTextField; 32 | 33 | 34 | @property (strong, nonatomic) IBOutlet UITextField *firstPassWordTextField; 35 | 36 | 37 | @property (strong, nonatomic) IBOutlet UITextField *secondPassWrodTextField; 38 | 39 | 40 | @property (strong, nonatomic) IBOutlet UIButton *registerButton; 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | @property (strong, nonatomic) IBOutlet NSLayoutConstraint *baseScrollViewButtomConstraint; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /MyChat/Register/RegisterViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RegisterViewController.m 3 | // IOSBmobDemo 4 | // 5 | // Created by 刘恒 on 15/10/2. 6 | // Copyright (c) 2015年 cn.com.hibor. All rights reserved. 7 | // 8 | 9 | #import "RegisterViewController.h" 10 | 11 | @interface RegisterViewController (){ 12 | 13 | } 14 | 15 | @end 16 | 17 | @implementation RegisterViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | 22 | //开始动画,记得有一定时间的延迟 23 | [UIView animateWithDuration:0.7f delay:0.2f options:UIViewAnimationOptionCurveEaseInOut animations:^{ 24 | 25 | //更改约束 26 | self.userNameMaginTopConstraint.priority = UILayoutPriorityDefaultLow; 27 | self.userNameCenterScrollConstraint.priority = UILayoutPriorityDefaultHigh; 28 | 29 | self.registerButtonMaginFiledConstraint.constant = 50; 30 | 31 | //更改透明度 32 | [self setViewAlpha:1.0]; 33 | 34 | //记得要一定使用此方法,否则会直接更新约束 35 | [self.view layoutIfNeeded]; 36 | 37 | } completion:^(BOOL finished) { 38 | 39 | [self.userNameTextField setPlaceholder:@"请输入6-14位英文账号"]; 40 | 41 | [self.firstPassWordTextField setPlaceholder:@"请输入6位以上字符的密码"]; 42 | 43 | [self.secondPassWrodTextField setPlaceholder:@"请再次输入上面的密码"]; 44 | 45 | 46 | 47 | 48 | }]; 49 | 50 | } 51 | 52 | 53 | /** 54 | 55 | 设置所有View透明度的问题 56 | 57 | */ 58 | -(void) setViewAlpha:(CGFloat) alpha{ 59 | 60 | [self.titleView setAlpha:alpha]; 61 | [self.userNameTextField setAlpha:alpha]; 62 | [self.firstPassWordTextField setAlpha:alpha]; 63 | [self.secondPassWrodTextField setAlpha:alpha]; 64 | [self.registerButton setAlpha:alpha]; 65 | 66 | } 67 | 68 | 69 | /** 70 | 71 | 注册按钮的点击事件 72 | 73 | */ 74 | - (IBAction)registerButtonClickEvent:(id)sender { 75 | 76 | 77 | NSString *userNameText = self.userNameTextField.text; 78 | 79 | long userNameTextLength = userNameText.length; 80 | 81 | NSString *firstPassWordText = self.firstPassWordTextField.text; 82 | 83 | NSString *secondPassWordText = self.secondPassWrodTextField.text; 84 | 85 | //用户名长度限制 86 | if (userNameTextLength>=6&&userNameTextLength<=14) { 87 | 88 | //用户名是否有空格 89 | if ([userNameText rangeOfString:@" "].location==NSNotFound) { 90 | 91 | //密码长度限制 92 | if(firstPassWordText.length>=6&&firstPassWordText.length<=22){ 93 | 94 | //两次输入的密码是否正确 95 | if ([firstPassWordText isEqualToString:secondPassWordText]) { 96 | 97 | 98 | NSLog(@"账号为%@\n密码为%@",userNameText,firstPassWordText); 99 | 100 | 101 | } 102 | else{ 103 | 104 | [self showAlertDialogWithMessage:@"两次输入的密码不一致"]; 105 | 106 | } 107 | 108 | } 109 | else{ 110 | 111 | [self showAlertDialogWithMessage:@"密码长度不正确"]; 112 | 113 | } 114 | 115 | }else{ 116 | 117 | [self showAlertDialogWithMessage:@"用户名不能含有空格"]; 118 | 119 | } 120 | 121 | }else{ 122 | 123 | 124 | [self showAlertDialogWithMessage:@"用户名长度不正确"]; 125 | 126 | } 127 | 128 | 129 | 130 | } 131 | 132 | 133 | 134 | /** 135 | 136 | 顶部返回按钮的点击事件 137 | 138 | */ 139 | - (IBAction)backButtonClickEvent:(id)sender { 140 | 141 | [self.navigationController popViewControllerAnimated:YES]; 142 | 143 | 144 | 145 | } 146 | 147 | 148 | 149 | 150 | - (void)didReceiveMemoryWarning { 151 | [super didReceiveMemoryWarning]; 152 | // Dispose of any resources that can be recreated. 153 | } 154 | 155 | /* 156 | #pragma mark - Navigation 157 | 158 | // In a storyboard-based application, you will often want to do a little preparation before navigation 159 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 160 | // Get the new view controller using [segue destinationViewController]. 161 | // Pass the selected object to the new view controller. 162 | } 163 | */ 164 | 165 | @end 166 | -------------------------------------------------------------------------------- /MyChat/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/MyChat/icon.jpg -------------------------------------------------------------------------------- /MyChat/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // IOSBmobDemo 4 | // 5 | // Created by BJMac1 on 15/8/27. 6 | // Copyright (c) 2015年 cn.com.hibor. 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 | -------------------------------------------------------------------------------- /MyChat/robotIcon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/MyChat/robotIcon.jpg -------------------------------------------------------------------------------- /MyChat/voiceButtonBack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/MyChat/voiceButtonBack.png -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '7.0' 2 | pod "AFNetworking", "~> 2.0" 3 | 4 | 5 | pod 'IQKeyboardManager' 6 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (2.6.0): 3 | - AFNetworking/NSURLConnection (= 2.6.0) 4 | - AFNetworking/NSURLSession (= 2.6.0) 5 | - AFNetworking/Reachability (= 2.6.0) 6 | - AFNetworking/Security (= 2.6.0) 7 | - AFNetworking/Serialization (= 2.6.0) 8 | - AFNetworking/UIKit (= 2.6.0) 9 | - AFNetworking/NSURLConnection (2.6.0): 10 | - AFNetworking/Reachability 11 | - AFNetworking/Security 12 | - AFNetworking/Serialization 13 | - AFNetworking/NSURLSession (2.6.0): 14 | - AFNetworking/Reachability 15 | - AFNetworking/Security 16 | - AFNetworking/Serialization 17 | - AFNetworking/Reachability (2.6.0) 18 | - AFNetworking/Security (2.6.0) 19 | - AFNetworking/Serialization (2.6.0) 20 | - AFNetworking/UIKit (2.6.0): 21 | - AFNetworking/NSURLConnection 22 | - AFNetworking/NSURLSession 23 | - IQKeyboardManager (3.3.2) 24 | 25 | DEPENDENCIES: 26 | - AFNetworking (~> 2.0) 27 | - IQKeyboardManager 28 | 29 | SPEC CHECKSUMS: 30 | AFNetworking: 79f7eb1a0fcfa7beb409332b2ca49afe9ce53b05 31 | IQKeyboardManager: d863eb0bca424d1f6dad6bdd1f856af52664add8 32 | 33 | COCOAPODS: 0.38.2 34 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | // AFHTTPRequestOperation.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | #import "AFURLConnectionOperation.h" 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | /** 28 | `AFHTTPRequestOperation` is a subclass of `AFURLConnectionOperation` for requests using the HTTP or HTTPS protocols. It encapsulates the concept of acceptable status codes and content types, which determine the success or failure of a request. 29 | */ 30 | @interface AFHTTPRequestOperation : AFURLConnectionOperation 31 | 32 | ///------------------------------------------------ 33 | /// @name Getting HTTP URL Connection Information 34 | ///------------------------------------------------ 35 | 36 | /** 37 | The last HTTP response received by the operation's connection. 38 | */ 39 | @property (readonly, nonatomic, strong, nullable) NSHTTPURLResponse *response; 40 | 41 | /** 42 | Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an AFHTTPResponse serializer, which uses the raw data as its response object. The serializer validates the status code to be in the `2XX` range, denoting success. If the response serializer generates an error in `-responseObjectForResponse:data:error:`, the `failure` callback of the session task or request operation will be executed; otherwise, the `success` callback will be executed. 43 | 44 | @warning `responseSerializer` must not be `nil`. Setting a response serializer will clear out any cached value 45 | */ 46 | @property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; 47 | 48 | /** 49 | An object constructed by the `responseSerializer` from the response and response data. Returns `nil` unless the operation `isFinished`, has a `response`, and has `responseData` with non-zero content length. If an error occurs during serialization, `nil` will be returned, and the `error` property will be populated with the serialization error. 50 | */ 51 | @property (readonly, nonatomic, strong, nullable) id responseObject; 52 | 53 | ///----------------------------------------------------------- 54 | /// @name Setting Completion Block Success / Failure Callbacks 55 | ///----------------------------------------------------------- 56 | 57 | /** 58 | Sets the `completionBlock` property with a block that executes either the specified success or failure block, depending on the state of the request on completion. If `error` returns a value, which can be caused by an unacceptable status code or content type, then `failure` is executed. Otherwise, `success` is executed. 59 | 60 | This method should be overridden in subclasses in order to specify the response object passed into the success block. 61 | 62 | @param success The block to be executed on the completion of a successful request. This block has no return value and takes two arguments: the receiver operation and the object constructed from the response data of the request. 63 | @param failure The block to be executed on the completion of an unsuccessful request. This block has no return value and takes two arguments: the receiver operation and the error that occurred during the request. 64 | */ 65 | - (void)setCompletionBlockWithSuccess:(nullable void (^)(AFHTTPRequestOperation *operation, id responseObject))success 66 | failure:(nullable void (^)(AFHTTPRequestOperation *operation, NSError *error))failure; 67 | 68 | @end 69 | 70 | NS_ASSUME_NONNULL_END 71 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | // AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #import 24 | #import 25 | 26 | #ifndef _AFNETWORKING_ 27 | #define _AFNETWORKING_ 28 | 29 | #import "AFURLRequestSerialization.h" 30 | #import "AFURLResponseSerialization.h" 31 | #import "AFSecurityPolicy.h" 32 | #if !TARGET_OS_WATCH 33 | #import "AFNetworkReachabilityManager.h" 34 | #import "AFURLConnectionOperation.h" 35 | #import "AFHTTPRequestOperation.h" 36 | #import "AFHTTPRequestOperationManager.h" 37 | #endif 38 | 39 | #if ( ( defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) || \ 40 | ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 ) || \ 41 | TARGET_OS_WATCH ) 42 | #import "AFURLSessionManager.h" 43 | #import "AFHTTPSessionManager.h" 44 | #endif 45 | 46 | #endif /* _AFNETWORKING_ */ 47 | -------------------------------------------------------------------------------- /Pods/AFNetworking/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | // AFNetworkActivityIndicatorManager.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | /** 33 | `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a network request operation has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero. 34 | 35 | You should enable the shared instance of `AFNetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code: 36 | 37 | [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; 38 | 39 | By setting `enabled` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself. 40 | 41 | See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information: 42 | http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44 43 | */ 44 | NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.") 45 | @interface AFNetworkActivityIndicatorManager : NSObject 46 | 47 | /** 48 | A Boolean value indicating whether the manager is enabled. 49 | 50 | If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO. 51 | */ 52 | @property (nonatomic, assign, getter = isEnabled) BOOL enabled; 53 | 54 | /** 55 | A Boolean value indicating whether the network activity indicator is currently displayed in the status bar. 56 | */ 57 | @property (readonly, nonatomic, assign) BOOL isNetworkActivityIndicatorVisible; 58 | 59 | /** 60 | Returns the shared network activity indicator manager object for the system. 61 | 62 | @return The systemwide network activity indicator manager. 63 | */ 64 | + (instancetype)sharedManager; 65 | 66 | /** 67 | Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator. 68 | */ 69 | - (void)incrementActivityCount; 70 | 71 | /** 72 | Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator. 73 | */ 74 | - (void)decrementActivityCount; 75 | 76 | @end 77 | 78 | NS_ASSUME_NONNULL_END 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | @class AFURLConnectionOperation; 31 | 32 | /** 33 | This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a request operation or session task. 34 | */ 35 | @interface UIActivityIndicatorView (AFNetworking) 36 | 37 | ///---------------------------------- 38 | /// @name Animating for Session Tasks 39 | ///---------------------------------- 40 | 41 | /** 42 | Binds the animating state to the state of the specified task. 43 | 44 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 45 | */ 46 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 47 | - (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; 48 | #endif 49 | 50 | ///--------------------------------------- 51 | /// @name Animating for Request Operations 52 | ///--------------------------------------- 53 | 54 | /** 55 | Binds the animating state to the execution state of the specified operation. 56 | 57 | @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. 58 | */ 59 | - (void)setAnimatingWithStateOfOperation:(nullable AFURLConnectionOperation *)operation; 60 | 61 | @end 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+AFNetworking.h 3 | // 4 | // 5 | // Created by Paulo Ferreira on 08/07/15. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 26 | 27 | #import 28 | 29 | @interface UIImage (AFNetworking) 30 | 31 | + (UIImage*) safeImageWithData:(NSData*)data; 32 | 33 | @end 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIKit+AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #if TARGET_OS_IOS 24 | #import 25 | 26 | #ifndef _UIKIT_AFNETWORKING_ 27 | #define _UIKIT_AFNETWORKING_ 28 | 29 | #import "AFNetworkActivityIndicatorManager.h" 30 | 31 | #import "UIActivityIndicatorView+AFNetworking.h" 32 | #import "UIAlertView+AFNetworking.h" 33 | #import "UIButton+AFNetworking.h" 34 | #import "UIImageView+AFNetworking.h" 35 | #import "UIProgressView+AFNetworking.h" 36 | #import "UIRefreshControl+AFNetworking.h" 37 | #import "UIWebView+AFNetworking.h" 38 | #endif /* _UIKIT_AFNETWORKING_ */ 39 | #endif 40 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFURLConnectionOperation; 33 | 34 | /** 35 | This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task or request operation. 36 | */ 37 | @interface UIProgressView (AFNetworking) 38 | 39 | ///------------------------------------ 40 | /// @name Setting Session Task Progress 41 | ///------------------------------------ 42 | 43 | /** 44 | Binds the progress to the upload progress of the specified session task. 45 | 46 | @param task The session task. 47 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 48 | */ 49 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 50 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 51 | animated:(BOOL)animated; 52 | #endif 53 | 54 | /** 55 | Binds the progress to the download progress of the specified session task. 56 | 57 | @param task The session task. 58 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 59 | */ 60 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 61 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 62 | animated:(BOOL)animated; 63 | #endif 64 | 65 | ///------------------------------------ 66 | /// @name Setting Session Task Progress 67 | ///------------------------------------ 68 | 69 | /** 70 | Binds the progress to the upload progress of the specified request operation. 71 | 72 | @param operation The request operation. 73 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 74 | */ 75 | - (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation 76 | animated:(BOOL)animated; 77 | 78 | /** 79 | Binds the progress to the download progress of the specified request operation. 80 | 81 | @param operation The request operation. 82 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 83 | */ 84 | - (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation 85 | animated:(BOOL)animated; 86 | 87 | @end 88 | 89 | NS_ASSUME_NONNULL_END 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2014 AFNetworking (http://afnetworking.com) 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | #import 26 | 27 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 28 | 29 | #import 30 | 31 | NS_ASSUME_NONNULL_BEGIN 32 | 33 | @class AFURLConnectionOperation; 34 | 35 | /** 36 | This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a request operation or session task. 37 | */ 38 | @interface UIRefreshControl (AFNetworking) 39 | 40 | ///----------------------------------- 41 | /// @name Refreshing for Session Tasks 42 | ///----------------------------------- 43 | 44 | /** 45 | Binds the refreshing state to the state of the specified task. 46 | 47 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 48 | */ 49 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 50 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 51 | #endif 52 | 53 | ///---------------------------------------- 54 | /// @name Refreshing for Request Operations 55 | ///---------------------------------------- 56 | 57 | /** 58 | Binds the refreshing state to the execution state of the specified operation. 59 | 60 | @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. 61 | */ 62 | - (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation; 63 | 64 | @end 65 | 66 | NS_ASSUME_NONNULL_END 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPRequestOperationManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLConnectionOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLConnectionOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIAlertView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQBarButtonItem.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQToolbar/IQBarButtonItem.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQKeyboardManager.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQKeyboardManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQKeyboardManagerConstants.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/Constants/IQKeyboardManagerConstants.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQKeyboardManagerConstantsInternal.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/Constants/IQKeyboardManagerConstantsInternal.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQKeyboardReturnKeyHandler.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQKeyboardReturnKeyHandler.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQNSArray+Sort.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/Categories/IQNSArray+Sort.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQSegmentedNextPrevious.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQSegmentedNextPrevious/IQSegmentedNextPrevious.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQTextView.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQTextView/IQTextView.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQTitleBarButtonItem.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQToolbar/IQTitleBarButtonItem.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQToolbar.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQToolbar/IQToolbar.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQUITextFieldView+Additions.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/Categories/IQUITextFieldView+Additions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQUIView+Hierarchy.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/Categories/IQUIView+Hierarchy.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQUIView+IQKeyboardToolbar.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQToolbar/IQUIView+IQKeyboardToolbar.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQUIViewController+Additions.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/Categories/IQUIViewController+Additions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQUIWindow+Hierarchy.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/Categories/IQUIWindow+Hierarchy.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/KeyboardManager.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/KeyboardManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPRequestOperationManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLConnectionOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLConnectionOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIAlertView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQBarButtonItem.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQToolbar/IQBarButtonItem.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQKeyboardManager.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQKeyboardManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQKeyboardManagerConstants.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/Constants/IQKeyboardManagerConstants.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQKeyboardManagerConstantsInternal.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/Constants/IQKeyboardManagerConstantsInternal.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQKeyboardReturnKeyHandler.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQKeyboardReturnKeyHandler.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQNSArray+Sort.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/Categories/IQNSArray+Sort.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQSegmentedNextPrevious.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQSegmentedNextPrevious/IQSegmentedNextPrevious.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQTextView.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQTextView/IQTextView.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQTitleBarButtonItem.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQToolbar/IQTitleBarButtonItem.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQToolbar.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQToolbar/IQToolbar.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQUITextFieldView+Additions.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/Categories/IQUITextFieldView+Additions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQUIView+Hierarchy.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/Categories/IQUIView+Hierarchy.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQUIView+IQKeyboardToolbar.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/IQToolbar/IQUIView+IQKeyboardToolbar.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQUIViewController+Additions.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/Categories/IQUIViewController+Additions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQUIWindow+Hierarchy.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/Categories/IQUIWindow+Hierarchy.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/KeyboardManager.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyBoardManager/KeyboardManager.h -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Categories/IQNSArray+Sort.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+Sort.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | /** 27 | UIView.subviews sorting category. 28 | */ 29 | @interface NSArray (IQ_NSArray_Sort) 30 | 31 | ///-------------- 32 | /// @name Sorting 33 | ///-------------- 34 | 35 | /** 36 | Returns the array by sorting the UIView's by their tag property. 37 | */ 38 | - (NSArray*)sortedArrayByTag; 39 | 40 | /** 41 | Returns the array by sorting the UIView's by their tag property. 42 | */ 43 | - (NSArray*)sortedArrayByPosition; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Categories/IQNSArray+Sort.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+Sort.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQNSArray+Sort.h" 25 | #import "IQUIView+Hierarchy.h" 26 | 27 | #import 28 | 29 | @implementation NSArray (IQ_NSArray_Sort) 30 | 31 | - (NSArray*)sortedArrayByTag 32 | { 33 | return [self sortedArrayUsingComparator:^NSComparisonResult(UIView *view1, UIView *view2) { 34 | 35 | if ([view1 respondsToSelector:@selector(tag)] && [view2 respondsToSelector:@selector(tag)]) 36 | { 37 | if ([view1 tag] < [view2 tag]) return NSOrderedAscending; 38 | 39 | else if ([view1 tag] > [view2 tag]) return NSOrderedDescending; 40 | 41 | else return NSOrderedSame; 42 | } 43 | else 44 | return NSOrderedSame; 45 | }]; 46 | } 47 | 48 | - (NSArray*)sortedArrayByPosition 49 | { 50 | return [self sortedArrayUsingComparator:^NSComparisonResult(UIView *view1, UIView *view2) { 51 | 52 | CGFloat x1 = CGRectGetMinX(view1.frame); 53 | CGFloat y1 = CGRectGetMinY(view1.frame); 54 | CGFloat x2 = CGRectGetMinX(view2.frame); 55 | CGFloat y2 = CGRectGetMinY(view2.frame); 56 | 57 | if (y1 < y2) return NSOrderedAscending; 58 | 59 | else if (y1 > y2) return NSOrderedDescending; 60 | 61 | //Else both y are same so checking for x positions 62 | else if (x1 < x2) return NSOrderedAscending; 63 | 64 | else if (x1 > x2) return NSOrderedDescending; 65 | 66 | else return NSOrderedSame; 67 | }]; 68 | } 69 | 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Categories/IQUITextFieldView+Additions.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQUITextFieldView+Additions.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | /** 27 | UIView category for managing UITextField/UITextView 28 | */ 29 | 30 | @interface UIView (Additions) 31 | 32 | /** 33 | To set customized distance from keyboard for textField/textView. Can't be less than zero 34 | */ 35 | @property(nonatomic, assign) CGFloat keyboardDistanceFromTextField; 36 | 37 | @end 38 | 39 | ///------------------------------------------- 40 | /// @name Custom KeyboardDistanceFromTextField 41 | ///------------------------------------------- 42 | 43 | /** 44 | Uses default keyboard distance for textField. 45 | */ 46 | extern CGFloat const kIQUseDefaultKeyboardDistance; 47 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Categories/IQUITextFieldView+Additions.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQUITextFieldView+Additions.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQUITextFieldView+Additions.h" 25 | #import 26 | 27 | @implementation UIView (Additions) 28 | 29 | -(void)setKeyboardDistanceFromTextField:(CGFloat)keyboardDistanceFromTextField 30 | { 31 | //Can't be less than zero. Minimum is zero. 32 | keyboardDistanceFromTextField = MAX(keyboardDistanceFromTextField, 0); 33 | 34 | objc_setAssociatedObject(self, @selector(keyboardDistanceFromTextField), [NSNumber numberWithFloat:keyboardDistanceFromTextField], OBJC_ASSOCIATION_RETAIN_NONATOMIC); 35 | } 36 | 37 | -(CGFloat)keyboardDistanceFromTextField 38 | { 39 | NSNumber *keyboardDistanceFromTextField = objc_getAssociatedObject(self, @selector(keyboardDistanceFromTextField)); 40 | 41 | return (keyboardDistanceFromTextField)?[keyboardDistanceFromTextField floatValue]:kIQUseDefaultKeyboardDistance; 42 | } 43 | 44 | @end 45 | 46 | ///------------------------------------ 47 | /// @name keyboardDistanceFromTextField 48 | ///------------------------------------ 49 | 50 | /** 51 | Uses default keyboard distance for textField. 52 | */ 53 | CGFloat const kIQUseDefaultKeyboardDistance = CGFLOAT_MAX; 54 | 55 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Categories/IQUIViewController+Additions.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQUIViewController+Additions.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | @interface UIViewController (Additions) 27 | 28 | #ifdef NSFoundationVersionNumber_iOS_5_1 29 | 30 | /** 31 | Top/Bottom Layout constraint which help library to manage keyboardTextField distance 32 | */ 33 | @property(nonatomic, strong) IBOutlet NSLayoutConstraint *IQLayoutGuideConstraint; 34 | 35 | #endif 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Categories/IQUIViewController+Additions.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQUIViewController+Additions.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQUIViewController+Additions.h" 25 | #import 26 | 27 | @implementation UIViewController (Additions) 28 | 29 | #ifdef NSFoundationVersionNumber_iOS_5_1 30 | 31 | -(void)setIQLayoutGuideConstraint:(NSLayoutConstraint *)IQLayoutGuideConstraint 32 | { 33 | objc_setAssociatedObject(self, @selector(IQLayoutGuideConstraint), IQLayoutGuideConstraint, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 34 | } 35 | 36 | -(NSLayoutConstraint *)IQLayoutGuideConstraint 37 | { 38 | return objc_getAssociatedObject(self, @selector(IQLayoutGuideConstraint)); 39 | } 40 | 41 | #endif 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Categories/IQUIWindow+Hierarchy.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWindow+Hierarchy.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | @class UIViewController; 27 | 28 | /** 29 | UIWindow hierarchy category. 30 | */ 31 | @interface UIWindow (IQ_UIWindow_Hierarchy) 32 | 33 | ///---------------------- 34 | /// @name viewControllers 35 | ///---------------------- 36 | 37 | /** 38 | Returns the current Top Most ViewController in hierarchy. 39 | */ 40 | @property (nonatomic, readonly, strong) UIViewController *topMostController; 41 | 42 | /** 43 | Returns the topViewController in stack of topMostController. 44 | */ 45 | @property (nonatomic, readonly, strong) UIViewController *currentViewController; 46 | 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Categories/IQUIWindow+Hierarchy.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIWindow+Hierarchy.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQUIWindow+Hierarchy.h" 25 | #import 26 | 27 | @implementation UIWindow (IQ_UIWindow_Hierarchy) 28 | 29 | - (UIViewController*)topMostController 30 | { 31 | UIViewController *topController = [self rootViewController]; 32 | 33 | // Getting topMost ViewController 34 | while ([topController presentedViewController]) topController = [topController presentedViewController]; 35 | 36 | // Returning topMost ViewController 37 | return topController; 38 | } 39 | 40 | - (UIViewController*)currentViewController; 41 | { 42 | UIViewController *currentViewController = [self topMostController]; 43 | 44 | while ([currentViewController isKindOfClass:[UINavigationController class]] && [(UINavigationController*)currentViewController topViewController]) 45 | currentViewController = [(UINavigationController*)currentViewController topViewController]; 46 | 47 | return currentViewController; 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Constants/IQKeyboardManagerConstantsInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQKeyboardManagerConstantsInternal.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #ifndef IQKeyboardManagerConstantsInternal_h 25 | #define IQKeyboardManagerConstantsInternal_h 26 | 27 | 28 | ///----------------------------------- 29 | /// @name IQLayoutGuidePosition 30 | ///----------------------------------- 31 | 32 | /** 33 | `IQLayoutGuidePositionNone` 34 | If there are no IQLayoutGuideConstraint associated with viewController 35 | 36 | `IQLayoutGuidePositionTop` 37 | If provided IQLayoutGuideConstraint is associated with with viewController topLayoutGuide 38 | 39 | `IQLayoutGuidePositionBottom` 40 | If provided IQLayoutGuideConstraint is associated with with viewController bottomLayoutGuide 41 | */ 42 | #ifndef NS_ENUM 43 | typedef enum IQLayoutGuidePosition { 44 | IQLayoutGuidePositionNone, 45 | IQLayoutGuidePositionTop, 46 | IQLayoutGuidePositionBottom, 47 | }IQLayoutGuidePosition; 48 | #else 49 | typedef NS_ENUM(NSInteger, IQLayoutGuidePosition) { 50 | IQLayoutGuidePositionNone, 51 | IQLayoutGuidePositionTop, 52 | IQLayoutGuidePositionBottom, 53 | }; 54 | #endif 55 | 56 | //Xcode 5 compatibility check 57 | #ifdef NSFoundationVersionNumber_iOS_6_1 58 | #define IQ_IS_IOS7_OR_GREATER (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) 59 | #else 60 | #define IQ_IS_IOS7_OR_GREATER NO 61 | #endif 62 | 63 | //Xcode 6 compatibility check 64 | #ifdef NSFoundationVersionNumber_iOS_7_1 65 | #define IQ_IS_IOS8_OR_GREATER (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1) 66 | #else 67 | #define IQ_IS_IOS8_OR_GREATER NO 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/IQKeyboardReturnKeyHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQKeyboardReturnKeyHandler.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQKeyboardManagerConstants.h" 25 | 26 | #import 27 | #import 28 | 29 | #import 30 | #import 31 | 32 | #if !(__has_feature(objc_instancetype)) 33 | #define instancetype id 34 | #endif 35 | 36 | @class UITextField,UIView, UIViewController; 37 | 38 | /** 39 | Manages the return key to work like next/done in a view hierarchy. 40 | */ 41 | @interface IQKeyboardReturnKeyHandler : NSObject 42 | 43 | ///---------------------- 44 | /// @name Initializations 45 | ///---------------------- 46 | 47 | /** 48 | Add all the textFields available in UIViewController's view. 49 | */ 50 | -(instancetype)initWithViewController:(UIViewController*)controller NS_DESIGNATED_INITIALIZER; 51 | 52 | ///--------------- 53 | /// @name Settings 54 | ///--------------- 55 | 56 | /** 57 | Delegate of textField/textView. 58 | */ 59 | @property(nonatomic, weak) id delegate; 60 | 61 | /** 62 | It help to choose the lastTextField instance from sibling responderViews. Default is IQAutoToolbarBySubviews. 63 | */ 64 | @property(nonatomic, assign) IQAutoToolbarManageBehaviour toolbarManageBehaviour; 65 | 66 | /** 67 | Set the last textfield return key type. Default is UIReturnKeyDefault. 68 | */ 69 | @property(nonatomic, assign) UIReturnKeyType lastTextFieldReturnKeyType; 70 | 71 | ///---------------------------------------------- 72 | /// @name Registering/Unregistering textFieldView 73 | ///---------------------------------------------- 74 | 75 | /** 76 | Should pass UITextField/UITextView intance. Assign textFieldView delegate to self, change it's returnKeyType. 77 | 78 | @param textFieldView UITextField/UITextView object to register. 79 | */ 80 | -(void)addTextFieldView:(UIView*)textFieldView; 81 | 82 | /** 83 | Should pass UITextField/UITextView intance. Restore it's textFieldView delegate and it's returnKeyType. 84 | 85 | @param textFieldView UITextField/UITextView object to unregister. 86 | */ 87 | -(void)removeTextFieldView:(UIView*)textFieldView; 88 | 89 | /** 90 | Add all the UITextField/UITextView responderView's. 91 | 92 | @param UIView object to register all it's responder subviews. 93 | */ 94 | -(void)addResponderFromView:(UIView*)view; 95 | 96 | /** 97 | Remove all the UITextField/UITextView responderView's. 98 | 99 | @param UIView object to unregister all it's responder subviews. 100 | */ 101 | -(void)removeResponderFromView:(UIView*)view; 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/IQSegmentedNextPrevious/IQSegmentedNextPrevious.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQSegmentedNextPrevious.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQKeyboardManagerConstants.h" 25 | 26 | #import 27 | 28 | #import 29 | 30 | #if !(__has_feature(objc_instancetype)) 31 | #define instancetype id 32 | #endif 33 | 34 | 35 | /** 36 | Custom SegmentedControl for Previous/Next button. 37 | 38 | @deprecated Deprecated in iOS 7 39 | */ 40 | @interface IQSegmentedNextPrevious : UISegmentedControl 41 | 42 | /** 43 | Initialization function for IQSegmentedNextPrevious. 44 | 45 | @param target Target object for selector. Usually 'self'. 46 | @param previousAction Previous button action name. Usually 'previousAction:(IQSegmentedNextPrevious*)segmentedControl'. 47 | @param nextAction Next button action name. Usually 'nextAction:(IQSegmentedNextPrevious*)segmentedControl'. 48 | */ 49 | - (instancetype)initWithTarget:(id)target previousAction:(SEL)previousAction nextAction:(SEL)nextAction NS_DESIGNATED_INITIALIZER; 50 | 51 | /** 52 | initWithTarget:previousAction:nextAction should be used. 53 | */ 54 | - (instancetype)init __attribute__((unavailable("init is not available, should use initWithTarget:previousAction:nextAction instead"))); 55 | 56 | /** 57 | initWithTarget:previousAction:nextAction should be used. 58 | */ 59 | + (instancetype)new __attribute__((unavailable("new is not available, should use initWithTarget:previousAction:nextAction instead"))); 60 | 61 | @end 62 | 63 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/IQSegmentedNextPrevious/IQSegmentedNextPrevious.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQSegmentedNextPrevious.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQSegmentedNextPrevious.h" 25 | #import "IQKeyboardManagerConstantsInternal.h" 26 | #import 27 | 28 | @interface IQSegmentedNextPrevious () 29 | 30 | // UISegmentedControl selector for value change. 31 | - (void)segmentedControlHandler:(IQSegmentedNextPrevious*)sender; 32 | 33 | @end 34 | 35 | 36 | @implementation IQSegmentedNextPrevious 37 | { 38 | id buttonTarget; 39 | SEL previousSelector; 40 | SEL nextSelector; 41 | } 42 | 43 | // Initialize method 44 | -(instancetype)initWithTarget:(id)target previousAction:(SEL)previousAction nextAction:(SEL)nextAction 45 | { 46 | // Creating it with two items, Previous/Next. 47 | self = [super initWithItems:[NSArray arrayWithObjects:IQLocalizedString(@"Previous", nil),IQLocalizedString(@"Next", nil), nil]]; 48 | 49 | if (self) 50 | { 51 | if (IQ_IS_IOS7_OR_GREATER == NO) 52 | { 53 | #pragma GCC diagnostic push 54 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 55 | [self setSegmentedControlStyle:UISegmentedControlStyleBar]; 56 | #pragma GCC diagnostic pop 57 | } 58 | 59 | [self setMomentary:YES]; 60 | [self setTintColor:[UIColor blackColor]]; 61 | // Adding self as it's valueChange selector. 62 | [self addTarget:self action:@selector(segmentedControlHandler:) forControlEvents:UIControlEventValueChanged]; 63 | 64 | // Setting target and selectors. 65 | buttonTarget = target; 66 | previousSelector = previousAction; 67 | nextSelector = nextAction; 68 | } 69 | return self; 70 | } 71 | 72 | // Value has changed 73 | - (void)segmentedControlHandler:(IQSegmentedNextPrevious*)sender 74 | { 75 | // Switching to selected segmenteIndex. 76 | switch ([sender selectedSegmentIndex]) 77 | { 78 | // Previous selected. 79 | case 0: 80 | { 81 | // Invoking selector. 82 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[buttonTarget class] instanceMethodSignatureForSelector:previousSelector]]; 83 | invocation.target = buttonTarget; 84 | invocation.selector = previousSelector; 85 | [invocation invoke]; 86 | } 87 | break; 88 | // Next selected. 89 | case 1: 90 | { 91 | // Invoking selector. 92 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[buttonTarget class] instanceMethodSignatureForSelector:nextSelector]]; 93 | invocation.target = buttonTarget; 94 | invocation.selector = nextSelector; 95 | [invocation invoke]; 96 | } 97 | default: 98 | break; 99 | } 100 | } 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/IQTextView/IQTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQTextView.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQKeyboardManagerConstants.h" 25 | 26 | #import 27 | 28 | /** 29 | UITextView with placeholder support 30 | */ 31 | @interface IQTextView : UITextView 32 | 33 | /** 34 | Set textView's placeholder text. Default is nil. 35 | */ 36 | @property(nonatomic,copy) NSString *placeholder; 37 | 38 | @end 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/IQTextView/IQTextView.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQTextView.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQTextView.h" 25 | 26 | #import 27 | #import 28 | 29 | #if !(__has_feature(objc_instancetype)) 30 | #define instancetype id 31 | #endif 32 | 33 | //Xcode 4.5 compatibility check 34 | #ifndef NSFoundationVersionNumber_iOS_5_1 35 | #define NSLineBreakByWordWrapping UILineBreakModeWordWrap 36 | #endif 37 | 38 | @interface IQTextView () 39 | 40 | -(void)refreshPlaceholder; 41 | 42 | @end 43 | 44 | @implementation IQTextView 45 | { 46 | UILabel *placeHolderLabel; 47 | } 48 | 49 | @synthesize placeholder = _placeholder; 50 | 51 | -(void)initialize 52 | { 53 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshPlaceholder) name:UITextViewTextDidChangeNotification object:self]; 54 | } 55 | 56 | -(void)dealloc 57 | { 58 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 59 | } 60 | 61 | - (instancetype)init 62 | { 63 | self = [super init]; 64 | if (self) { 65 | [self initialize]; 66 | } 67 | return self; 68 | } 69 | 70 | -(void)awakeFromNib 71 | { 72 | [super awakeFromNib]; 73 | [self initialize]; 74 | } 75 | 76 | -(void)refreshPlaceholder 77 | { 78 | if([[self text] length]) 79 | { 80 | [placeHolderLabel setAlpha:0]; 81 | } 82 | else 83 | { 84 | [placeHolderLabel setAlpha:1]; 85 | } 86 | 87 | [self setNeedsLayout]; 88 | [self layoutIfNeeded]; 89 | } 90 | 91 | - (void)setText:(NSString *)text 92 | { 93 | [super setText:text]; 94 | [self refreshPlaceholder]; 95 | } 96 | 97 | -(void)setFont:(UIFont *)font 98 | { 99 | [super setFont:font]; 100 | placeHolderLabel.font = self.font; 101 | 102 | [self setNeedsLayout]; 103 | [self layoutIfNeeded]; 104 | } 105 | 106 | -(void)layoutSubviews 107 | { 108 | [super layoutSubviews]; 109 | 110 | [placeHolderLabel sizeToFit]; 111 | placeHolderLabel.frame = CGRectMake(8, 8, CGRectGetWidth(self.frame)-16, CGRectGetHeight(placeHolderLabel.frame)); 112 | } 113 | 114 | -(void)setPlaceholder:(NSString *)placeholder 115 | { 116 | _placeholder = placeholder; 117 | 118 | if ( placeHolderLabel == nil ) 119 | { 120 | placeHolderLabel = [[UILabel alloc] init]; 121 | placeHolderLabel.autoresizingMask = (UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight); 122 | placeHolderLabel.lineBreakMode = NSLineBreakByWordWrapping; 123 | placeHolderLabel.numberOfLines = 0; 124 | placeHolderLabel.font = self.font; 125 | placeHolderLabel.backgroundColor = [UIColor clearColor]; 126 | placeHolderLabel.textColor = [UIColor colorWithWhite:0.7 alpha:1.0]; 127 | placeHolderLabel.alpha = 0; 128 | [self addSubview:placeHolderLabel]; 129 | } 130 | 131 | placeHolderLabel.text = self.placeholder; 132 | [self refreshPlaceholder]; 133 | } 134 | 135 | //When any text changes on textField, the delegate getter is called. At this time we refresh the textView's placeholder 136 | -(id)delegate 137 | { 138 | [self refreshPlaceholder]; 139 | return [super delegate]; 140 | } 141 | 142 | @end 143 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/IQToolbar/IQBarButtonItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQBarButtonItem.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | 25 | #import 26 | 27 | /** 28 | IQBarButtonItem used for IQToolbar. 29 | */ 30 | @interface IQBarButtonItem : UIBarButtonItem 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/IQToolbar/IQBarButtonItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQBarButtonItem.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQBarButtonItem.h" 25 | #import "IQToolbar.h" 26 | 27 | @implementation IQBarButtonItem 28 | 29 | +(void)initialize 30 | { 31 | [super initialize]; 32 | 33 | [[self appearance] setTintColor:nil]; 34 | [[self appearance] setTitleTextAttributes:nil forState:UIControlStateNormal]; 35 | [[self appearance] setTitleTextAttributes:nil forState:UIControlStateHighlighted]; 36 | [[self appearance] setTitleTextAttributes:nil forState:UIControlStateDisabled]; 37 | [[self appearance] setTitleTextAttributes:nil forState:UIControlStateSelected]; 38 | [[self appearance] setTitleTextAttributes:nil forState:UIControlStateApplication]; 39 | [[self appearance] setTitleTextAttributes:nil forState:UIControlStateReserved]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/IQToolbar/IQTitleBarButtonItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQTitleBarButtonItem.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | #import "IQKeyboardManagerConstants.h" 26 | #import "IQBarButtonItem.h" 27 | 28 | #if !(__has_feature(objc_instancetype)) 29 | #define instancetype id 30 | #endif 31 | 32 | 33 | /** 34 | BarButtonItem with title text. 35 | */ 36 | @interface IQTitleBarButtonItem : IQBarButtonItem 37 | 38 | /** 39 | Font to be used in bar button. Default is (system font 12.0 bold). 40 | */ 41 | @property(nonatomic, strong) UIFont *font; 42 | 43 | /** 44 | Initialize with frame and title. 45 | 46 | @param frame Initial frame of barButtonItem 47 | @param title Title of barButtonItem. 48 | */ 49 | -(instancetype)initWithFrame:(CGRect)frame title:(NSString *)title; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/IQToolbar/IQTitleBarButtonItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQTitleBarButtonItem.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQTitleBarButtonItem.h" 25 | #import "IQKeyboardManagerConstants.h" 26 | #import "IQKeyboardManagerConstantsInternal.h" 27 | #import 28 | 29 | #ifndef NSFoundationVersionNumber_iOS_5_1 30 | #define NSTextAlignmentCenter UITextAlignmentCenter 31 | #endif 32 | 33 | @implementation IQTitleBarButtonItem 34 | { 35 | UIView *_titleView; 36 | UILabel *_titleLabel; 37 | } 38 | @synthesize font = _font; 39 | 40 | 41 | -(instancetype)initWithFrame:(CGRect)frame title:(NSString *)title 42 | { 43 | self = [self initWithTitle:nil style:UIBarButtonItemStylePlain target:nil action:nil]; 44 | if (self) 45 | { 46 | _titleView = [[UIView alloc] initWithFrame:frame]; 47 | _titleView.backgroundColor = [UIColor clearColor]; 48 | _titleView.autoresizingMask = UIViewAutoresizingFlexibleWidth; 49 | 50 | _titleLabel = [[UILabel alloc] initWithFrame:_titleView.bounds]; 51 | 52 | if (IQ_IS_IOS7_OR_GREATER) 53 | { 54 | [_titleLabel setTextColor:[UIColor lightGrayColor]]; 55 | } 56 | else 57 | { 58 | [_titleLabel setTextColor:[UIColor whiteColor]]; 59 | } 60 | 61 | [_titleLabel setBackgroundColor:[UIColor clearColor]]; 62 | [_titleLabel setTextAlignment:NSTextAlignmentCenter]; 63 | [_titleLabel setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; 64 | [self setTitle:title]; 65 | [self setFont:[UIFont boldSystemFontOfSize:12.0]]; 66 | [_titleView addSubview:_titleLabel]; 67 | 68 | self.customView = _titleView; 69 | self.enabled = NO; 70 | } 71 | return self; 72 | } 73 | 74 | -(void)setFont:(UIFont *)font 75 | { 76 | _font = font; 77 | [_titleLabel setFont:font]; 78 | } 79 | 80 | -(void)setTitle:(NSString *)title 81 | { 82 | [super setTitle:title]; 83 | _titleLabel.text = title; 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/IQToolbar/IQToolbar.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQToolbar.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | /** 27 | IQToolbar for IQKeyboardManager. 28 | */ 29 | @interface IQToolbar : UIToolbar 30 | 31 | /** 32 | Title font for toolbar. 33 | */ 34 | @property(nonatomic, strong) UIFont *titleFont; 35 | 36 | /** 37 | Toolbar title 38 | */ 39 | @property(nonatomic, strong) NSString *title; 40 | 41 | @end 42 | 43 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/IQToolbar/IQToolbar.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQToolbar.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQToolbar.h" 25 | #import "IQKeyboardManagerConstantsInternal.h" 26 | #import "IQTitleBarButtonItem.h" 27 | #import "IQUIView+Hierarchy.h" 28 | 29 | #import 30 | 31 | #if !(__has_feature(objc_instancetype)) 32 | #define instancetype id 33 | #endif 34 | 35 | 36 | @implementation IQToolbar 37 | @synthesize titleFont = _titleFont; 38 | @synthesize title = _title; 39 | 40 | +(void)initialize 41 | { 42 | [super initialize]; 43 | 44 | [[self appearance] setTintColor:nil]; 45 | 46 | #ifdef NSFoundationVersionNumber_iOS_6_1 47 | if ([[self appearance] respondsToSelector:@selector(setBarTintColor:)]) 48 | { 49 | [[self appearance] setBarTintColor:nil]; 50 | } 51 | #endif 52 | 53 | [[self appearance] setBackgroundColor:nil]; 54 | } 55 | 56 | -(void)initialize 57 | { 58 | [self sizeToFit]; 59 | self.autoresizingMask = UIViewAutoresizingFlexibleWidth;// | UIViewAutoresizingFlexibleHeight; 60 | 61 | if (IQ_IS_IOS7_OR_GREATER) 62 | { 63 | [self setTintColor:[UIColor blackColor]]; 64 | } 65 | else 66 | { 67 | [self setBarStyle:UIBarStyleBlackTranslucent]; 68 | } 69 | } 70 | 71 | - (instancetype)initWithFrame:(CGRect)frame 72 | { 73 | self = [super initWithFrame:frame]; 74 | if (self) 75 | { 76 | [self initialize]; 77 | } 78 | return self; 79 | } 80 | 81 | - (instancetype)initWithCoder:(NSCoder *)coder 82 | { 83 | self = [super initWithCoder:coder]; 84 | if (self) 85 | { 86 | [self initialize]; 87 | } 88 | return self; 89 | } 90 | 91 | -(CGSize)sizeThatFits:(CGSize)size 92 | { 93 | CGSize sizeThatFit = [super sizeThatFits:size]; 94 | 95 | sizeThatFit.height = 44; 96 | 97 | return sizeThatFit; 98 | } 99 | 100 | -(void)setTintColor:(UIColor *)tintColor 101 | { 102 | [super setTintColor:tintColor]; 103 | 104 | for (UIBarButtonItem *item in self.items) 105 | { 106 | [item setTintColor:tintColor]; 107 | } 108 | } 109 | 110 | -(void)setTitleFont:(UIFont *)titleFont 111 | { 112 | _titleFont = titleFont; 113 | 114 | for (UIBarButtonItem *item in self.items) 115 | { 116 | if ([item isKindOfClass:[IQTitleBarButtonItem class]]) 117 | { 118 | [(IQTitleBarButtonItem*)item setFont:titleFont]; 119 | } 120 | } 121 | } 122 | 123 | -(void)setTitle:(NSString *)title 124 | { 125 | _title = title; 126 | 127 | for (UIBarButtonItem *item in self.items) 128 | { 129 | if ([item isKindOfClass:[IQTitleBarButtonItem class]]) 130 | { 131 | [(IQTitleBarButtonItem*)item setTitle:title]; 132 | } 133 | } 134 | } 135 | 136 | #pragma mark - UIInputViewAudioFeedback delegate 137 | - (BOOL) enableInputClicksWhenVisible 138 | { 139 | return YES; 140 | } 141 | 142 | @end 143 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/KeyboardManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // KeyboardManager.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-15 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | 25 | #ifndef KeyboardManager_h 26 | #define KeyboardManager_h 27 | 28 | #import "IQBarButtonItem.h" 29 | #import "IQKeyboardManager.h" 30 | #import "IQKeyboardManagerConstants.h" 31 | #import "IQKeyboardReturnKeyHandler.h" 32 | #import "IQSegmentedNextPrevious.h" 33 | #import "IQTextView.h" 34 | #import "IQTitleBarButtonItem.h" 35 | #import "IQToolbar.h" 36 | #import "IQUIView+Hierarchy.h" 37 | #import "IQUIView+IQKeyboardToolbar.h" 38 | #import "IQUIWindow+Hierarchy.h" 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowLeft.png -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowLeft@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowLeft@2x.png -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowLeft@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowLeft@3x.png -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowRight.png -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowRight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowRight@2x.png -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowRight@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowRight@3x.png -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/de.lproj/IQKeyboardManager.strings: -------------------------------------------------------------------------------- 1 | 2 | "enabled" = "aktiviert"; 3 | 4 | "disabled" = "deaktiviert"; 5 | 6 | "already disabled" = "bereits deaktiviert"; 7 | 8 | "already enabled" = "bereits aktiviert"; 9 | 10 | "You must set UIWindow.rootViewController in your AppDelegate to work with IQKeyboardManager" = "Sie müssen im AppDelegate UIWindow.rootViewController setzen um mit IQKeyboardManager zu arbeiten"; 11 | 12 | "Previous" = "Zurück"; 13 | "Next" = "Vor"; 14 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/en.lproj/IQKeyboardManager.strings: -------------------------------------------------------------------------------- 1 | 2 | "enabled" = "enabled"; 3 | 4 | "disabled" = "disabled"; 5 | 6 | "already disabled" = "already disabled"; 7 | 8 | "already enabled" = "already enabled"; 9 | 10 | "You must set UIWindow.rootViewController in your AppDelegate to work with IQKeyboardManager" = "You must set UIWindow.rootViewController in your AppDelegate to work with IQKeyboardManager"; 11 | 12 | "Previous" = "Previous"; 13 | "Next" = "Next"; 14 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/es.lproj/IQKeyboardManager.strings: -------------------------------------------------------------------------------- 1 | 2 | "enabled" = "activado"; 3 | 4 | "disabled" = "desactivado"; 5 | 6 | "already disabled" = "ya está desactivado"; 7 | 8 | "already enabled" = "ya está activado"; 9 | 10 | "You must set UIWindow.rootViewController in your AppDelegate to work with IQKeyboardManager" = "Debe establecer UIWindow.rootViewController en su AppDelegate para trabajar con IQKeyboardManager"; 11 | 12 | "Previous" = "Anterior"; 13 | 14 | "Next" = "Siguiente"; 15 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/zh-Hans/IQKeyboardManager.strings: -------------------------------------------------------------------------------- 1 | 2 | "enabled" = "开启"; 3 | 4 | "disabled" = "关闭"; 5 | 6 | "already disabled" = "已经开启"; 7 | 8 | "already enabled" = "已经关闭"; 9 | 10 | "You must set UIWindow.rootViewController in your AppDelegate to work with IQKeyboardManager" = "为了使用IQKeyboardManager,必须在你的 AppDelegate 中设置 UIWindow.rootViewController。"; 11 | 12 | "Previous" = "前一个"; 13 | "Next" = "下一个"; 14 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyBoardManager/Resources/IQKeyboardManager.bundle/zh-Hant/IQKeyboardManager.strings: -------------------------------------------------------------------------------- 1 | 2 | "enabled" = "開啟"; 3 | 4 | "disabled" = "關閉"; 5 | 6 | "already disabled" = "已經開啟"; 7 | 8 | "already enabled" = "已經關閉"; 9 | 10 | "You must set UIWindow.rootViewController in your AppDelegate to work with IQKeyboardManager" = "為了使用IQKeyboardManager,必須在妳的 AppDelegate 中設置 UIWindow.rootViewController。"; 11 | 12 | "Previous" = "前一個"; 13 | "Next" = "下一個"; 14 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/LICENSE.md: -------------------------------------------------------------------------------- 1 | IQKeyboardManager license 2 | ========================= 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (c) 2013-14 Iftekhar Qurashi 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of 9 | this software and associated documentation files (the "Software"), to deal in 10 | the Software without restriction, including without limitation the rights to 11 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | of the Software, and to permit persons to whom the Software is furnished to do 13 | so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (2.6.0): 3 | - AFNetworking/NSURLConnection (= 2.6.0) 4 | - AFNetworking/NSURLSession (= 2.6.0) 5 | - AFNetworking/Reachability (= 2.6.0) 6 | - AFNetworking/Security (= 2.6.0) 7 | - AFNetworking/Serialization (= 2.6.0) 8 | - AFNetworking/UIKit (= 2.6.0) 9 | - AFNetworking/NSURLConnection (2.6.0): 10 | - AFNetworking/Reachability 11 | - AFNetworking/Security 12 | - AFNetworking/Serialization 13 | - AFNetworking/NSURLSession (2.6.0): 14 | - AFNetworking/Reachability 15 | - AFNetworking/Security 16 | - AFNetworking/Serialization 17 | - AFNetworking/Reachability (2.6.0) 18 | - AFNetworking/Security (2.6.0) 19 | - AFNetworking/Serialization (2.6.0) 20 | - AFNetworking/UIKit (2.6.0): 21 | - AFNetworking/NSURLConnection 22 | - AFNetworking/NSURLSession 23 | - IQKeyboardManager (3.3.2) 24 | 25 | DEPENDENCIES: 26 | - AFNetworking (~> 2.0) 27 | - IQKeyboardManager 28 | 29 | SPEC CHECKSUMS: 30 | AFNetworking: 79f7eb1a0fcfa7beb409332b2ca49afe9ce53b05 31 | IQKeyboardManager: d863eb0bca424d1f6dad6bdd1f856af52664add8 32 | 33 | COCOAPODS: 0.38.2 34 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/liuheng.xcuserdatad/xcschemes/AFNetworking.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 47 | 48 | 54 | 55 | 57 | 58 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/liuheng.xcuserdatad/xcschemes/IQKeyboardManager.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 47 | 48 | 54 | 55 | 57 | 58 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/liuheng.xcuserdatad/xcschemes/Pods.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 47 | 48 | 54 | 55 | 57 | 58 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/liuheng.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AFNetworking.xcscheme 8 | 9 | isShown 10 | 11 | 12 | IQKeyboardManager.xcscheme 13 | 14 | isShown 15 | 16 | 17 | Pods.xcscheme 18 | 19 | isShown 20 | 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | AF57CA374F885C618FDFAE5FE02990FF 26 | 27 | primary 28 | 29 | 30 | C126563D1EB03E56C3E9B71F3EA596A2 31 | 32 | primary 33 | 34 | 35 | D0FE37C0242CD633A1AF7CF9F543976C 36 | 37 | primary 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "AFNetworking.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" 4 | OTHER_LDFLAGS = ${AFNETWORKING_OTHER_LDFLAGS} 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AFNetworking : NSObject 3 | @end 4 | @implementation PodsDummy_AFNetworking 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #ifndef TARGET_OS_IOS 6 | #define TARGET_OS_IOS TARGET_OS_IPHONE 7 | #endif 8 | 9 | #ifndef TARGET_OS_WATCH 10 | #define TARGET_OS_WATCH 0 11 | #endif 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig: -------------------------------------------------------------------------------- 1 | AFNETWORKING_OTHER_LDFLAGS = -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" -------------------------------------------------------------------------------- /Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "IQKeyboardManager.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/IQKeyboardManager" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_IQKeyboardManager : NSObject 3 | @end 4 | @implementation PodsDummy_IQKeyboardManager 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager.xcconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager.xcconfig -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AFNetworking 5 | 6 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | ## IQKeyboardManager 28 | 29 | IQKeyboardManager license 30 | ========================= 31 | 32 | The MIT License (MIT) 33 | 34 | Copyright (c) 2013-14 Iftekhar Qurashi 35 | 36 | Permission is hereby granted, free of charge, to any person obtaining a copy of 37 | this software and associated documentation files (the "Software"), to deal in 38 | the Software without restriction, including without limitation the rights to 39 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 40 | of the Software, and to permit persons to whom the Software is furnished to do 41 | so, subject to the following conditions: 42 | 43 | The above copyright notice and this permission notice shall be included in all 44 | copies or substantial portions of the Software. 45 | 46 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 47 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 48 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 49 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 50 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 51 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 52 | SOFTWARE. 53 | 54 | Generated by CocoaPods - http://cocoapods.org 55 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | Title 38 | AFNetworking 39 | Type 40 | PSGroupSpecifier 41 | 42 | 43 | FooterText 44 | IQKeyboardManager license 45 | ========================= 46 | 47 | The MIT License (MIT) 48 | 49 | Copyright (c) 2013-14 Iftekhar Qurashi 50 | 51 | Permission is hereby granted, free of charge, to any person obtaining a copy of 52 | this software and associated documentation files (the "Software"), to deal in 53 | the Software without restriction, including without limitation the rights to 54 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 55 | of the Software, and to permit persons to whom the Software is furnished to do 56 | so, subject to the following conditions: 57 | 58 | The above copyright notice and this permission notice shall be included in all 59 | copies or substantial portions of the Software. 60 | 61 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 62 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 63 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 64 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 65 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 66 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 67 | SOFTWARE. 68 | 69 | Title 70 | IQKeyboardManager 71 | Type 72 | PSGroupSpecifier 73 | 74 | 75 | FooterText 76 | Generated by CocoaPods - http://cocoapods.org 77 | Title 78 | 79 | Type 80 | PSGroupSpecifier 81 | 82 | 83 | StringsTable 84 | Acknowledgements 85 | Title 86 | Acknowledgements 87 | 88 | 89 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/IQKeyboardManager" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"IQKeyboardManager" -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/IQKeyboardManager" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"IQKeyboardManager" -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #描述 2 | 一个iOS端的可以打字聊天、或者语音聊天的智能机器人。 3 | 4 | #技术栈 5 | [AFNetworking](https://github.com/AFNetworking/AFNetworking) 为项目的网络请求库 6 | 7 | [IQKeyboardManager](https://github.com/hackiftekhar/IQKeyboardManager) 用来处理项目中的键盘弹出事件 8 | 9 | #第三方SDK 10 | [科大讯飞SDK](http://www.xfyun.cn) 项目中的语音识别SDK 11 | 12 | [图灵机器人](http://www.tuling123.com) 提供智能机器人接口 13 | 14 | #程序截图 15 | 截图1 16 | 截图2 17 | 截图3 18 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlyContact.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlyContact.h 3 | // msc 4 | // 5 | // Created by ypzhao on 13-3-1. 6 | // Copyright (c) 2013年 IFLYTEK. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /*! 12 | * 此接口为获取通信录中的联系人 13 | * 获取联系人是为了在进行语音识别时(sms)能更好的识别出您说的人名,联系人上传是属于个性化的 14 | * 一部分. 15 | */ 16 | @interface IFlyContact : NSObject 17 | 18 | /*! 19 | * 获取联系人 20 | * 调用此方法需要添加 AddressBook.framework 到工程中,调用此方法后可以直接将通信录中的联系 21 | * 人转化为语音云识别的数据结构。您可以将获取的数据通过IFlyDataUploader类,上传到语音云,我们 22 | * 只获取通信录中的人名 23 | * 24 | * @return 返回联系人信息 25 | */ 26 | - (NSString *) contact; 27 | @end 28 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlyDataUploader.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlyDataUploader.h 3 | // MSC 4 | // 5 | // Created by ypzhao on 13-4-8. 6 | // Copyright (c) 2013年 iflytek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @class IFlySpeechError; 13 | 14 | /*! 15 | * 数据上传类 16 | */ 17 | @interface IFlyDataUploader : NSObject 18 | 19 | /*! 20 | * 数据名称 21 | */ 22 | @property(nonatomic,copy) NSString *dataName; 23 | /*! 24 | * 数据 25 | */ 26 | @property(nonatomic,copy) NSString *data; 27 | 28 | /*! 29 | * 上传完成回调 30 | * 31 | * @param result 结果 32 | * @param error 错误码 33 | */ 34 | typedef void(^IFlyUploadDataCompletionHandler)(NSString* result,IFlySpeechError * error); 35 | 36 | /*! 37 | * 上传数据 38 | * 此函数用于上传数据,下载的过程是**异步**的。 39 | * 40 | * @param completionHandler -[in] 上传完成回调 41 | * @param name -[in] 上传的内容名称,名称最好和你要上传的数据内容相关,不可以为nil 42 | * @param data -[in] 上传的数据,以utf8编码,不可以为nil 43 | */ 44 | - (void) uploadDataWithCompletionHandler:(IFlyUploadDataCompletionHandler)completionHandler name:(NSString *)name data:(NSString *)data; 45 | 46 | /*! 47 | * 设置上传数据参数 48 | * 49 | * @param parameter 参数值 50 | * @param key 参数名 51 | */ 52 | -(void) setParameter:(NSString*) parameter forKey:(NSString*) key; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlyDebugLog.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlyDebugLog.h 3 | // MSC 4 | 5 | // description: 程序中的log处理类 6 | 7 | // Created by ypzhao on 12-11-22. 8 | // Copyright (c) 2012年 iflytek. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | /*! 14 | * 调试信息 15 | */ 16 | @interface IFlyDebugLog : NSObject 17 | 18 | /*! 19 | * 打印调试信息 20 | * 21 | * @param format -[in] 要打印的内容格式 22 | * @param ... -[in] 要打印的内容 23 | */ 24 | + (void) showLog:(NSString *)format, ...; 25 | 26 | /*! 27 | * 将log写入文件中 28 | */ 29 | + (void) writeLog; 30 | 31 | /*! 32 | * 设置是否显示log 33 | * 34 | * @param showLog YES:显示;NO:不显示 35 | */ 36 | + (void) setShowLog:(BOOL) showLog; 37 | @end 38 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlyISVDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlyISVDelegate.h 3 | // msc_UI 4 | // 5 | // Created by admin on 14-9-15. 6 | // Copyright (c) 2014年 iflytek. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | @class IFlySpeechError; 13 | 14 | /** 15 | * 声纹回调协议 16 | */ 17 | @protocol IFlyISVDelegate 18 | 19 | /** 20 | * 声纹结果回调 21 | * 22 | * @param dic 结果 23 | */ 24 | -(void) onResult:(NSDictionary *)dic; 25 | 26 | /** 27 | * 错误码回调 28 | * 29 | * @param errorCode 错误码 30 | */ 31 | -(void) onError:(IFlySpeechError *) errorCode; 32 | 33 | @optional 34 | 35 | /** 36 | * 等待结果 37 | */ 38 | -(void) onRecognition; 39 | 40 | /** 41 | * 音量改变回调 42 | * 43 | * @param volume 音量值 44 | */ 45 | -(void) onVolumeChanged: (int)volume; 46 | 47 | @end 48 | 49 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlyISVRecognizer.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlyISVRecognizer.h 3 | // ISV 4 | // 5 | // Created by wangdan on 14-9-6. 6 | // Copyright (c) 2014年 IFlyTEK. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | #import "IFlyISVDelegate.h" 12 | 13 | /** 14 | * 声纹接口类 15 | */ 16 | @interface IFlyISVRecognizer : NSObject 17 | { 18 | 19 | } 20 | @property (assign) id delegate; 21 | 22 | 23 | 24 | /* 25 | * FlyISVRecognizer is a kind of Singleton calss 26 | * the function can be used as below: 27 | IFLyISVRecognizer *recognizer=[IFlyISVRecognizer creteRecognizer: self]; 28 | */ 29 | 30 | +(IFlyISVRecognizer *) sharedInstance; 31 | 32 | 33 | /* 34 | * genrerate a serial number password 35 | * princeple: 36 | 1.number serial has no 1 in itself; 37 | 2.the nuber serial has no same number("98765432"is right while "99876543" is wrong) 38 | * @length: the serial number's length,length of "98765432" is 8, 39 | generally length is 8 and other value is forbidden 40 | */ 41 | 42 | -(NSString*) generatePassword:(int)length; 43 | 44 | 45 | 46 | /* 47 | * Used to get password from server 48 | * @pwdt: 49 | when pwdt is 1,the function will return chinese text; 50 | while pwdt is 2, the funciton will return number serial 51 | */ 52 | 53 | -(NSArray*) getPasswordList:(int)pwdt; 54 | 55 | 56 | /* 57 | * Used to judge if the engine is running in listenning 58 | * return value: 59 | YES: the engine is listenning; 60 | No : the engine is not listenning 61 | */ 62 | -(BOOL) isListening; 63 | 64 | 65 | 66 | /* 67 | * Used to query or delete the voiceprint model in server 68 | * @cmd: 69 | "del": delete model 70 | "que": query model 71 | * @authid: user id ,can be @"tianxia" or other; 72 | * @pwdt: voiceprint type 73 | 1: fixed txt voiceprint code ,like @"我的地盘我做主" 74 | 2: free voiceprint code , user can speek anything,but 5 times 75 | trainning the speech shall be same 76 | 3: number serial voiceprint code ,like @"98765432" and so on 77 | * @ptxt: voiceprint txt,only fixed voiceprint and number serial have this, 78 | in free voiceprint model this param shall be set nil 79 | * @vid: another voiceprint type model,user can use this to query or delete 80 | model in server can be @"jakillasdfasdjjjlajlsdfhdfdsadff",totally 32 bits; 81 | * NOTES: 82 | when vid is not nil,then the server will judge the vid first 83 | while the vid is nil, server can still query or delete the voiceprint model 84 | by other params 85 | */ 86 | -(BOOL) sendRequest:(NSString*)cmd authid:(NSString *)auth_id pwdt:(int)pwdt ptxt:(NSString *)ptxt vid:(NSString *)vid err:(int *)err; 87 | 88 | 89 | /* 90 | * set the voiceprint params 91 | * @"sst" : @"train" or @"verify" 92 | * @"auth_id" : @"tianxia" or ther 93 | * @"sub" : @"ivp" 94 | * @"ptxt" : 95 | * @"rgn" : @"5" 96 | * @"pwdt" : @"1",or @"2", or @"3" 97 | * @"auf" : @"audio/L16;rate=16000" or @"audio/L16;rate=8000" 98 | * @"vad_enable : @"1" or @"0" 99 | * @"vad_timeout" : @"3000" 100 | * @"vad_speech_tail": @"100" 101 | */ 102 | -(BOOL) setParameter:(NSString *)value forKey:(NSString *)key; 103 | 104 | 105 | 106 | /* 107 | * get the voiceprint params 108 | * used the same as function of setParameter 109 | */ 110 | -(NSString*) getParameter:(NSString *)key; 111 | 112 | 113 | /* 114 | * start recording 115 | */ 116 | -(void) startListening; 117 | 118 | 119 | /* 120 | * stop recording 121 | */ 122 | -(void) stopListening; 123 | 124 | 125 | /* 126 | * cancel recording,like function stopListening 127 | */ 128 | -(void) cancel; /* cancel recognization */ 129 | 130 | 131 | 132 | 133 | @end 134 | 135 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlyMSC.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlyMSC.h 3 | // msc 4 | // 5 | // Created by 张剑 on 15/1/14. 6 | // Copyright (c) 2015年 iflytek. All rights reserved. 7 | // 8 | 9 | #ifndef MSC_IFlyMSC_h 10 | #define MSC_IFlyMSC_h 11 | 12 | #import "IFlyContact.h" 13 | #import "IFlyDataUploader.h" 14 | #import "IFlyDebugLog.h" 15 | #import "IFlyISVDelegate.h" 16 | #import "IFlyISVRecognizer.h" 17 | #import "IFlyRecognizerView.h" 18 | #import "IFlyRecognizerViewDelegate.h" 19 | #import "IFlyResourceUtil.h" 20 | #import "IFlySetting.h" 21 | #import "IFlySpeechConstant.h" 22 | #import "IFlySpeechError.h" 23 | #import "IFlySpeechEvaluator.h" 24 | #import "IFlySpeechEvaluatorDelegate.h" 25 | #import "IFlySpeechEvent.h" 26 | #import "IFlySpeechRecognizer.h" 27 | #import "IFlySpeechRecognizerDelegate.h" 28 | #import "IFlySpeechSynthesizer.h" 29 | #import "IFlySpeechSynthesizerDelegate.h" 30 | #import "IFlySpeechUnderstander.h" 31 | #import "IFlySpeechUtility.h" 32 | #import "IFlyTextUnderstander.h" 33 | #import "IFlyUserWords.h" 34 | #import "IFlyPcmRecorder.h" 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlyPcmRecorder.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlyPcmRecorder.h 3 | // MSC 4 | 5 | // description: 6 | 7 | // Created by ypzhao on 12-11-15. 8 | // Copyright (c) 2012年 iflytek. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | 19 | 20 | @class IFlyPcmRecorder; 21 | 22 | /** 23 | * 录音协议 24 | */ 25 | @protocol IFlyPcmRecorderDelegate 26 | 27 | /** 28 | * 回调音频数据 29 | * 30 | * @param buffer 音频数据 31 | * @param size 表示音频的长度 32 | */ 33 | - (void) onIFlyRecorderBuffer: (const void *)buffer bufferSize:(int)size; 34 | 35 | /** 36 | * 回调音频的错误码 37 | * 38 | * @param recoder 录音器 39 | * @param error 错误码 40 | */ 41 | - (void) onIFlyRecorderError:(IFlyPcmRecorder*)recoder theError:(int) error; 42 | 43 | @optional 44 | 45 | /** 46 | * 回调录音音量 47 | * 48 | * @param power 音量值 49 | */ 50 | - (void) onIFlyRecorderVolumeChanged:(int) power; 51 | 52 | @end 53 | 54 | 55 | /** 56 | * 录音封装 57 | */ 58 | @interface IFlyPcmRecorder : NSObject 59 | 60 | /** 61 | * 录音委托对象 62 | */ 63 | @property (assign) id delegate; 64 | 65 | /** 66 | * 单例模式 67 | * 68 | * @return 返回录音对象单例 69 | */ 70 | + (id) sharedInstance; 71 | 72 | /** 73 | * 开始录音 74 | * 75 | * @return 开启录音成功返回YES,否则返回NO 76 | */ 77 | - (BOOL) start; 78 | 79 | /** 80 | * 停止录音 81 | */ 82 | - (void) stop; 83 | 84 | /** 85 | * 设置音频采样率 86 | * 87 | * @param rate -[in] 采样率,8k/16k 88 | */ 89 | - (void) setSample:(NSString *) rate; 90 | 91 | /* 92 | * 设置录音时间间隔参数 93 | */ 94 | - (void) setPowerCycle:(float) cycle; 95 | 96 | /** 97 | * 保存录音 98 | * 99 | * @param savePath 音频保存路径 100 | */ 101 | -(void) setSaveAudioPath:(NSString *)savePath; 102 | 103 | @end 104 | 105 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlyRecognizerViewDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlyRecognizerDelegate.h 3 | // MSC 4 | // 5 | // Created by admin on 13-4-16. 6 | // Copyright (c) 2013年 iflytek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class IFlyRecognizerView; 12 | @class IFlySpeechError; 13 | 14 | /*! 15 | * 识别回调委托 16 | */ 17 | @protocol IFlyRecognizerViewDelegate 18 | 19 | /*! 20 | * 回调返回识别结果 21 | * 22 | * @param resultArray 识别结果,NSArray的第一个元素为NSDictionary,NSDictionary的key为识别结果,sc为识别结果的置信度 23 | * @param isLast -[out] 是否最后一个结果 24 | */ 25 | - (void)onResult:(NSArray *)resultArray isLast:(BOOL) isLast; 26 | 27 | /*! 28 | * 识别结束回调 29 | * 30 | * @param error 识别结束错误码 31 | */ 32 | - (void)onError: (IFlySpeechError *) error; 33 | 34 | @optional 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlyResourceUtil.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlyResourceUtil.h 3 | // MSCDemo 4 | // 5 | // Created by admin on 14-6-20. 6 | // Copyright (c) 2014年 iflytek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /*! 12 | * 资源工具类 13 | */ 14 | @interface IFlyResourceUtil : NSObject 15 | 16 | /*! 17 | * 获取通过MSPSetParam,启动引擎的标识 18 | * 19 | * @return 通过MSPSetParam,启动引擎的标识 20 | */ 21 | +(NSString*) ENGINE_START; 22 | 23 | /*! 24 | * 获取通过MSPSetParam,销毁引擎的标识 25 | * 26 | * @return 通过MSPSetParam,销毁引擎的标识 27 | */ 28 | +(NSString*) ENGINE_DESTROY; 29 | 30 | /*! 31 | * 获取识别引擎的资源目录标识 32 | * 33 | * @return 识别引擎的资源目录标识 34 | */ 35 | +(NSString*) ASR_RES_PATH; 36 | 37 | /*! 38 | * 得到语法构建目录 39 | * 40 | * @return 语法构建目录 41 | */ 42 | +(NSString*) GRM_BUILD_PATH; 43 | 44 | /*! 45 | * 获取合成引擎的资源目录标识,同时需要先传入voice_name方可生效 46 | * 47 | * @return 合成引擎的资源目录标识,同时需要先传入voice_name方可生效 48 | */ 49 | +(NSString*) TTS_RES_PATH; 50 | 51 | /*! 52 | * 获取唤醒资源的资源目录标识 53 | * 54 | * @return 唤醒资源的资源目录标识 55 | */ 56 | +(NSString*) IVW_RES_PATH; 57 | 58 | /*! 59 | * 语法类型 60 | * 61 | * @return 语法类型 62 | */ 63 | +(NSString*) GRAMMARTYPE; 64 | 65 | /*! 66 | * 资源存放路径 67 | * 68 | * @param path 设置的路径 69 | * 70 | * @return 资源目录 71 | */ 72 | +(NSString*) generateResourcePath:(NSString *)path; 73 | 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlySetting.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlySetting.h 3 | // MSC 4 | // 5 | // Created by iflytek on 13-4-12. 6 | // Copyright (c) 2013年 iflytek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /*! 12 | * 日志打印等级 13 | */ 14 | typedef NS_OPTIONS(NSInteger, LOG_LEVEL){ 15 | /*! 16 | * 全部打印 17 | */ 18 | LVL_ALL = -1, 19 | /*! 20 | * 高,异常分析需要的级别 21 | */ 22 | LVL_DETAIL = 31, 23 | /*! 24 | * 中,打印基本日志信息 25 | */ 26 | LVL_NORMAL = 15, 27 | /*! 28 | * 低,只打印主要日志信息 29 | */ 30 | LVL_LOW = 7, 31 | /*! 32 | * 不打印 33 | */ 34 | LVL_NONE = 0 35 | }; 36 | 37 | /*! 38 | * 此接口为iflyMSC sdk 配置接口。 39 | * 可以获取版本号,设置日志打印等级等 40 | */ 41 | @interface IFlySetting : NSObject 42 | 43 | /*! 44 | * 获取版本号 45 | * 46 | * @return 版本号 47 | */ 48 | + (NSString *) getVersion; 49 | 50 | /*! 51 | * 获取日志等级 52 | * 53 | * @return 返回日志等级 54 | */ 55 | + (LOG_LEVEL) logLvl; 56 | 57 | /*! 58 | * 是否打印控制台log 59 | * 在软件发布时,建议关闭此log。 60 | * 61 | * @param showLog -[in] YES,打印log;NO,不打印 62 | */ 63 | + (void) showLogcat:(BOOL) showLog; 64 | 65 | /*! 66 | * 设置日志msc.log生成路径以及日志等级 67 | * 68 | * 69 | * 70 | * 71 | * 72 | * 73 | * 74 | * 75 | * 76 | * 77 | * 78 | * 79 | *
*日志打印等级描述
LVL_ALL全部打印
LVL_DETAIL高,异常分析需要的级别
LVL_NORMAL中,打印基本日志信息
LVL_LOW低,只打印主要日志信息
LVL_NONE不打印
80 | * 81 | * @param level -[in] 日志打印等级 82 | */ 83 | + (void) setLogFile:(LOG_LEVEL) level; 84 | 85 | /*! 86 | * 设置日志文件的路径 87 | * 日志文件默认存放在Documents目录。 88 | * 89 | * @param path -[in] 日志文件的全路径 90 | */ 91 | + (void) setLogFilePath:(NSString*) path; 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlySpeechError.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlySpeechError.h 3 | // MSC 4 | // 5 | // Created by iflytek on 13-3-19. 6 | // Copyright (c) 2013年 iflytek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /*! 12 | * 错误描述类 13 | */ 14 | @interface IFlySpeechError : NSObject 15 | 16 | /*! 17 | * 错误码 18 | */ 19 | @property(nonatomic,assign) int errorCode; 20 | 21 | /*! 22 | * 错误码类 23 | */ 24 | @property(nonatomic,assign) int errorType; 25 | 26 | /*! 27 | * 错误描述 28 | */ 29 | @property(nonatomic,retain) NSString* errorDesc; 30 | 31 | /*! 32 | * 初始化 33 | * 34 | * @param errorCode -[in] 错误码 35 | * 36 | * @return IFlySpeechError对象 37 | */ 38 | + (id) initWithError:(int) errorCode; 39 | 40 | /*! 41 | * 获取错误码 42 | * 43 | * @return 错误码 44 | */ 45 | -(int) errorCode; 46 | 47 | /*! 48 | * 获取错误描述 49 | * 50 | * @return 错误描述 51 | */ 52 | - (NSString *) errorDesc; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlySpeechEvaluator.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlySpeechEvaluator.h 3 | // msc 4 | // 5 | // Created by jianzhang on 14-1-13 6 | // Copyright (c) 2013年 iflytek. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | #import "IFlySpeechEvaluatorDelegate.h" 12 | 13 | /*! 14 | * 语音评测类 15 | */ 16 | @interface IFlySpeechEvaluator : NSObject 17 | 18 | /*! 19 | * 设置委托对象 20 | */ 21 | @property (assign) id delegate; 22 | 23 | /*! 24 | * 返回评测对象的单例 25 | * 26 | * @return 别对象的单例 27 | */ 28 | + (id)sharedInstance; 29 | 30 | /*! 31 | * 销毁评测对象。 32 | * 33 | * @return 成功返回YES,失败返回NO。 34 | */ 35 | - (BOOL)destroy; 36 | 37 | /*! 38 | * 设置评测引擎的参数 39 | * 40 | * @param value 评测引擎参数值 41 | * @param key 评测引擎参数 42 | * 43 | * @return 设置的参数和取值正确返回YES,失败返回NO 44 | */ 45 | - (BOOL)setParameter:(NSString *)value forKey:(NSString *)key; 46 | 47 | 48 | /*! 49 | * 获得评测引擎的参数 50 | * 51 | * @param key 评测引擎参数 52 | * 53 | * @return key对应的参数值 54 | */ 55 | - (NSString*)parameterForKey:(NSString *)key; 56 | 57 | /*! 58 | * 开始评测 59 | * 同时只能进行一路会话,这次会话没有结束不能进行下一路会话,否则会报错 60 | * 61 | * @param data 评测的试题 62 | * @param params 评测的参数 63 | */ 64 | - (void)startListening:(NSData *)data params:(NSString *)params; 65 | 66 | /*! 67 | * 停止录音 68 | * 调用此函数会停止录音,并开始进行语音识别 69 | */ 70 | - (void)stopListening; 71 | 72 | /*! 73 | * 取消本次会话 74 | */ 75 | - (void)cancel; 76 | 77 | @end 78 | 79 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlySpeechEvaluatorDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlySpeechEvaluatorDelegate.h 3 | // msc 4 | // 5 | // Created by admin on 13-6-19. 6 | // Copyright (c) 2013年 iflytek. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | @class IFlySpeechError; 13 | 14 | /*! 15 | * 评测协议 16 | */ 17 | @protocol IFlySpeechEvaluatorDelegate 18 | 19 | /*! 20 | * 音量和数据回调 21 | * 22 | * @param volume 音量 23 | * @param buffer 音频数据 24 | */ 25 | - (void)onVolumeChanged:(int)volume buffer:(NSData *)buffer; 26 | 27 | /*! 28 | * 开始录音回调 29 | * 当调用了`startListening`函数之后,如果没有发生错误则会回调此函数。如果发生错误则回调onError:函数 30 | */ 31 | - (void)onBeginOfSpeech; 32 | 33 | /*! 34 | * 停止录音回调 35 | * 当调用了`stopListening`函数或者引擎内部自动检测到断点,如果没有发生错误则回调此函数。 36 | * 如果发生错误则回调onError:函数 37 | */ 38 | - (void)onEndOfSpeech; 39 | 40 | /*! 41 | * 正在取消 42 | */ 43 | - (void)onCancel; 44 | 45 | /*! 46 | * 评测错误回调 47 | * 在进行语音评测过程中的任何时刻都有可能回调此函数,你可以根据errorCode进行相应的处理. 48 | * 当errorCode没有错误时,表示此次会话正常结束,否则,表示此次会话有错误发生。特别的当调用 49 | * `cancel`函数时,引擎不会自动结束,需要等到回调此函数,才表示此次会话结束。在没有回调此函 50 | * 数之前如果重新调用了`startListenging`函数则会报错误。 51 | * 52 | * @param errorCode 错误描述类 53 | */ 54 | - (void)onError:(IFlySpeechError *)errorCode; 55 | 56 | /*! 57 | * 评测结果回调 58 | * 在评测过程中可能会多次回调此函数,你最好不要在此回调函数中进行界面的更改等操作,只需要将回调的结果保存起来。 59 | * 60 | * @param results -[out] 评测结果。 61 | * @param isLast -[out] 是否最后一条结果 62 | */ 63 | - (void)onResults:(NSData *)results isLast:(BOOL)isLast; 64 | 65 | @end 66 | 67 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlySpeechEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlySpeechEvent.h 3 | // MSCDemo 4 | // 5 | // Created by admin on 14-8-12. 6 | // Copyright (c) 2014年 iflytek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /*! 12 | * 事件类型 13 | */ 14 | typedef NS_ENUM(NSUInteger,IFlySpeechEventType){ 15 | /*! 16 | * 网络状态消息 17 | * 在消息到达时,可通过onEvent的第2个参数arg1,获取当前网络连接状态值 18 | */ 19 | IFlySpeechEventTypeNetPref = 10001, 20 | /** 21 | * 转写音频文件消息 22 | * 在录音模式下,成功创建音频文件时返回。可通过onEvent 23 | * 第4个参数data 指定Key为[IFlySpeechConstant IST_AUDIO_PATH],获取音频文件绝对路径. 24 | * 或通过[IFlySpeechTranscripter getParameter:[IFlySpeechConstant IST_AUDIO_PATH]], 25 | * 获取音频文件绝对路径. 26 | */ 27 | IFlySpeechEventTypeISTAudioFile = 10004, 28 | /** 29 | * 转写已上传字节消息 30 | * 在消息到达时,通过onEvent 31 | * 的第二个参数arg1,获取已确认上传到服务器的字节数. 32 | * 若当前音频源为非写音频模式,还可通过onEvent 33 | * 的第三个参数arg2,获取当前所有音频的字节大小.录音模式时,由于所有音频字节大小会变。 34 | * 当停止音频输入后(等待录音时间超时 35 | * [IFlySpeechConstant SPEECH_TIMEOUT] 36 | * ,或调用[IFlySpeechTranscripter stopTranscripting]), 37 | * 且服务器收到所有音频时,第四个参数data,将包含完成标记的布尔值(true),可通过data调用 38 | * 指定KEY为KCIFlySpeechEventKeyISTUploadComplete获取。 39 | * 此消息可能多次返回. 40 | */ 41 | IFlySpeechEventTypeISTUploadBytes = 10006, 42 | 43 | /** 44 | * 转写缓存剩余 45 | * 此消息仅在音频源为-1时需要关注 46 | * 在调用[IFlySpeechTranscripter writeAudio]写音频时,应该关注此事件。 47 | * 此事件在调用写音频接口、及音频最后被写入底库库时分别回调一次。当事件回调时,通过onEvent 48 | * 的第二个参数arg1,获取当前剩余的缓存大小,当缓存小于要写入的音频时,应该先暂停写音频数据,直到下次缓存大小大于要写入的音频时. 49 | * 最大缓存为128KByte。 50 | */ 51 | IFlySpeechEventTypeISTCacheLeft = 10007, 52 | 53 | /** 54 | * 转写结果等待时间消息 55 | * 在消息到达时,通过 onEvent 56 | * 的第二个参数arg1,获取当前结果需要的时间. 57 | * 此消息可能多次返回,返回时间不定,且不一定会返回. 58 | */ 59 | IFlySpeechEventTypeISTResultTime= 10008, 60 | 61 | /** 62 | * 转写转写音频同步ID消息 63 | * 在消息到达时,通过 onEvent 64 | * 的第二个参数arg1,获取当前写音频同步ID. 65 | * 此消息可能多次返回. 66 | */ 67 | IFlySpeechEventTypeISTSyncID= 10009, 68 | 69 | /** 70 | * 会话开始消息 71 | * 在会话开始成功后返回 72 | */ 73 | IFlySpeechEventTypeSessionBegin = 10010, 74 | 75 | /** 76 | * 会话结束消息 77 | * 在会话结束前返回 78 | */ 79 | IFlySpeechEventTypeSessionEnd = 10011, 80 | 81 | /** 82 | * 音量消息,在得到音量时抛出,暂时只有身份验证的声纹业务用到 83 | */ 84 | IFlySpeechEventTypeVolume = 10012, 85 | 86 | /** 87 | * VAD后端点消息,在检测到VAD后端点时抛出,暂时只有身份验证的声纹业务用到 88 | */ 89 | IFlySpeechEventTypeVadEOS = 10013, 90 | 91 | /*! 92 | * 服务端会话id 93 | * 在消息到达时,可通过onEvent的第4个参数data(字典类型), 94 | * 指定key KCIFlySpeechEventKeySessionID,获取服务端会话id. 95 | */ 96 | IFlySpeechEventTypeSessionID = 20001, 97 | 98 | /*! 99 | * TTS合成数据消息 100 | * -(void)onEvent:(int)eventType arg0:(int)arg0 arg1:(int)arg1 data:(NSData *)eventData 101 | * 其中eventData中包含数据 102 | * 103 | */ 104 | IFlySpeechEventTypeTTSBuffer = 21001, 105 | 106 | /*! 107 | * 通知cancel方法被调用的回调 108 | * 109 | */ 110 | IFlySpeechEventTypeTTSCancel = 21002, 111 | 112 | /*! 113 | * IVW onshot 听写 or 识别结果 114 | * 在消息到达时,第2个参数arg1包含是否为最后一个结果:1为是,0为否; 115 | * 第4个参数data中包含数据,通过指定KEY为KCIFlySpeechEventKeyIVWResult获取. 116 | */ 117 | IFlySpeechEventTypeIVWResult = 22001, 118 | 119 | /*! 120 | * 开始处理录音数据 121 | * 122 | */ 123 | IFlySpeechEventTypeSpeechStart= 22002, 124 | 125 | /*! 126 | * 录音停止 127 | * 128 | */ 129 | IFlySpeechEventTypeRecordStop= 22003, 130 | 131 | /*! 132 | * 服务端音频url 133 | * 在消息到达时, 134 | * 第4个参数data,包含数据,通过 135 | * 指定KEY为KCIFlySpeechEventKeyAudioUrl获取. 136 | */ 137 | IFlySpeechEventTypeAudioUrl = 23001, 138 | 139 | /*! 140 | * 变声数据结果返回 141 | * 142 | * 设置voice_change参数获取结果. 143 | */ 144 | IFlySpeechEventTypeVoiceChangeResult = 24001 145 | 146 | }; 147 | 148 | #pragma mark - keys for event data 149 | 150 | /** 151 | * 转写是否已上传完标记key 152 | */ 153 | extern NSString* const KCIFlySpeechEventKeyISTUploadComplete; 154 | 155 | /** 156 | * 服务端会话key 157 | */ 158 | extern NSString* const KCIFlySpeechEventKeySessionID; 159 | /** 160 | * TTS取音频数据key 161 | */ 162 | extern NSString* const KCIFlySpeechEventKeyTTSBuffer; 163 | /** 164 | * IVW oneshot 听写 or 识别结果 key 165 | */ 166 | extern NSString* const KCIFlySpeechEventKeyIVWResult; 167 | /** 168 | * 服务端音频url key 169 | */ 170 | extern NSString* const KCIFlySpeechEventKeyAudioUrl; 171 | 172 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlySpeechRecognizerDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlySpeechRecognizerDelegate.h 3 | // MSC 4 | // 5 | // Created by ypzhao on 13-3-27. 6 | // Copyright (c) 2013年 iflytek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class IFlySpeechError; 12 | 13 | /*! 14 | * 构建语法结束回调 15 | * 16 | * @param grammarId 语法id 17 | * @param error 错误描述 18 | */ 19 | typedef void(^IFlyOnBuildFinishCompletionHandler)(NSString* grammarId,IFlySpeechError * error); 20 | 21 | 22 | /*! 23 | * 语音识别协议 24 | * 在使用语音识别时,需要实现这个协议中的方法. 25 | */ 26 | @protocol IFlySpeechRecognizerDelegate 27 | 28 | @required 29 | 30 | /*! 31 | * 识别结果回调 32 | * 在进行语音识别过程中的任何时刻都有可能回调此函数,你可以根据errorCode进行相应的处理, 33 | * 当errorCode没有错误时,表示此次会话正常结束;否则,表示此次会话有错误发生。特别的当调用 34 | * `cancel`函数时,引擎不会自动结束,需要等到回调此函数,才表示此次会话结束。在没有回调此函数 35 | * 之前如果重新调用了`startListenging`函数则会报错误。 36 | * 37 | * @param errorCode 错误描述 38 | */ 39 | - (void) onError:(IFlySpeechError *) errorCode; 40 | 41 | /*! 42 | * 识别结果回调 43 | * 在识别过程中可能会多次回调此函数,你最好不要在此回调函数中进行界面的更改等操作,只需要将回调的结果保存起来。 44 | * 使用results的示例如下: 45 | *

 46 |  *  - (void) onResults:(NSArray *) results{
 47 |  *     NSMutableString *result = [[NSMutableString alloc] init];
 48 |  *     NSDictionary *dic = [results objectAtIndex:0];
 49 |  *     for (NSString *key in dic){
 50 |  *        [result appendFormat:@"%@",key];//合并结果
 51 |  *     }
 52 |  *   }
 53 |  *  
54 | * 55 | * @param results -[out] 识别结果,NSArray的第一个元素为NSDictionary,NSDictionary的key为识别结果,sc为识别结果的置信度。 56 | * @param isLast -[out] 是否最后一个结果 57 | */ 58 | - (void) onResults:(NSArray *) results isLast:(BOOL)isLast; 59 | 60 | @optional 61 | 62 | /*! 63 | * 音量变化回调 64 | * 在录音过程中,回调音频的音量。 65 | * 66 | * @param volume -[out] 音量,范围从0-100 67 | */ 68 | - (void) onVolumeChanged: (int)volume; 69 | 70 | /*! 71 | * 开始录音回调 72 | * 当调用了`startListening`函数之后,如果没有发生错误则会回调此函数。 73 | * 如果发生错误则回调onError:函数 74 | */ 75 | - (void) onBeginOfSpeech; 76 | 77 | /*! 78 | * 停止录音回调 79 | * 当调用了`stopListening`函数或者引擎内部自动检测到断点,如果没有发生错误则回调此函数。 80 | * 如果发生错误则回调onError:函数 81 | */ 82 | - (void) onEndOfSpeech; 83 | 84 | /*! 85 | * 取消识别回调 86 | * 当调用了`cancel`函数之后,会回调此函数,在调用了cancel函数和回调onError之前会有一个 87 | * 短暂时间,您可以在此函数中实现对这段时间的界面显示。 88 | */ 89 | - (void) onCancel; 90 | 91 | #ifdef _EDUCATION_ 92 | /** 93 | * 返回音频Key 94 | * 95 | * @param key 音频Key 96 | */ 97 | - (void) getAudioKey:(NSString *)key; 98 | 99 | #endif 100 | 101 | /** 扩展事件回调 102 | 103 | 根据事件类型返回额外的数据 104 | 105 | @param eventType 事件类型,具体参见IFlySpeechEventType的IFlySpeechEventTypeVoiceChangeResult枚举。 106 | 107 | */ 108 | - (void) onEvent:(int)eventType arg0:(int)arg0 arg1:(int)arg1 data:(NSData *)eventData; 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlySpeechSynthesizer.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlySpeechSynthesizer.h 3 | // MSC 4 | // 5 | // Created by ypzhao on 13-3-21. 6 | // Copyright (c) 2013年 iflytek. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "IFlySpeechSynthesizerDelegate.h" 11 | 12 | /*! 13 | * 语音合成 14 | */ 15 | @interface IFlySpeechSynthesizer : NSObject 16 | 17 | /*! 18 | * 设置识别的委托对象 19 | */ 20 | @property(nonatomic,assign) id delegate; 21 | 22 | /*! 23 | * 返回合成对象的单例 24 | * 25 | * @return 合成对象 26 | */ 27 | + (id) sharedInstance; 28 | 29 | /*! 30 | * 销毁合成对象。 31 | * 32 | * @return 成功返回YES,失败返回NO. 33 | */ 34 | + (BOOL) destroy; 35 | 36 | /* 37 | * | ------------- |----------------------------------------------------------- 38 | * | 参数 | 描述 39 | * | ------------- |----------------------------------------------------------- 40 | * | speed |合成语速,取值范围 0~100 41 | * | ------------- |----------------------------------------------------------- 42 | * | volume |合成的音量,取值范围 0~100 43 | * | ------------- |----------------------------------------------------------- 44 | * | voice_name |默认为”xiaoyan”;可以设置的参数列表可参考个性化发音人列表 45 | * | ------------- |----------------------------------------------------------- 46 | * | sample_rate |采样率:目前支持的采样率设置有 16000 和 8000。 47 | * | ------------- |----------------------------------------------------------- 48 | * | tts_audio_path|音频文件名 设置此参数后,将会自动保存合成的音频文件。 49 | * | |路径为Documents/(指定值)。不设置或者设置为nil,则不保存音频。 50 | * | ------------- |----------------------------------------------------------- 51 | * | params |扩展参数: 对于一些特殊的参数可在此设置。 52 | * | ------------- |----------------------------------------------------------- 53 | * 54 | */ 55 | 56 | /*! 57 | * 设置合成参数 58 | * 59 | * 60 | * 61 | * 62 | * 63 | * 64 | * 65 | * 66 | * 67 | * 68 | * 69 | * 70 | * 71 | *
参数描述
speed合成语速,取值范围 0~100
volume合成的音量,取值范围 0~100
voice_name默认为”xiaoyan”;可以设置的参数列表可参考个性化发音人列表
sample_rate采样率:目前支持的采样率设置有 16000 和 8000。
tts_audio_path音频文件名 设置此参数后,将会自动保存合成的音频文件。
路径为Documents/(指定值)。不设置或者设置为nil,则不保存音频。
params扩展参数: 对于一些特殊的参数可在此设置。
72 | * 73 | * @param value 参数取值 74 | * @param key 合成参数 75 | * 76 | * @return 设置成功返回YES,失败返回NO 77 | */ 78 | -(BOOL) setParameter:(NSString *) value forKey:(NSString*)key; 79 | 80 | /*! 81 | * 获取合成参数 82 | * 83 | * @param key 参数key 84 | * 85 | * @return 参数值 86 | */ 87 | -(NSString*) parameterForKey:(NSString *)key; 88 | 89 | /*! 90 | * 开始合成(播放) 91 | * 调用此函数进行合成,如果发生错误会回调错误`onCompleted` 92 | * 93 | * @param text 合成的文本,最大的字节数为1k 94 | */ 95 | - (void) startSpeaking:(NSString *)text; 96 | 97 | /*! 98 | * 开始合成(不播放) 99 | * 调用此函数进行合成,如果发生错误会回调错误`onCompleted` 100 | * 101 | * @param text 合成的文本,最大的字节数为1k 102 | * @param uri 合成后,保存再本地的音频路径 103 | */ 104 | -(void)synthesize:(NSString *)text toUri:(NSString*)uri; 105 | 106 | /*! 107 | * 暂停播放 108 | * 暂停播放之后,合成不会暂停,仍会继续,如果发生错误则会回调错误`onCompleted` 109 | */ 110 | - (void) pauseSpeaking; 111 | 112 | /*! 113 | * 恢复播放 114 | */ 115 | - (void) resumeSpeaking; 116 | 117 | /*! 118 | * 停止播放并停止合成 119 | */ 120 | - (void) stopSpeaking; 121 | 122 | /*! 123 | * 是否正在播放 124 | */ 125 | @property (nonatomic, readonly) BOOL isSpeaking; 126 | 127 | @end 128 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlySpeechSynthesizerDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlySpeechSynthesizerDelegate.h 3 | // MSC 4 | // 5 | // Created by ypzhao on 13-3-20. 6 | // Copyright (c) 2013年 iflytek. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "IFlySpeechEvent.h" 11 | 12 | /** 语音合成回调 */ 13 | 14 | @class IFlySpeechError; 15 | @protocol IFlySpeechSynthesizerDelegate 16 | 17 | @required 18 | /** 结束回调 19 | 20 | 当整个合成结束之后会回调此函数 21 | 22 | @param error 错误码 23 | */ 24 | - (void) onCompleted:(IFlySpeechError*) error; 25 | 26 | @optional 27 | /** 开始合成回调 */ 28 | - (void) onSpeakBegin; 29 | 30 | /** 缓冲进度回调 31 | 32 | @param progress 缓冲进度,0-100 33 | @param msg 附件信息,此版本为nil 34 | */ 35 | - (void) onBufferProgress:(int) progress message:(NSString *)msg; 36 | 37 | /** 播放进度回调 38 | 39 | @param progress 播放进度,0-100 40 | */ 41 | - (void) onSpeakProgress:(int) progress; 42 | 43 | /** 暂停播放回调 */ 44 | - (void) onSpeakPaused; 45 | 46 | /** 恢复播放回调 */ 47 | - (void) onSpeakResumed; 48 | 49 | /** 正在取消回调 50 | 51 | 当调用`cancel`之后会回调此函数 52 | */ 53 | - (void) onSpeakCancel; 54 | 55 | /** 扩展事件回调 56 | 57 | 根据事件类型返回额外的数据 58 | 59 | @param eventType 事件类型,具体参见IFlySpeechEventType枚举。目前只支持EVENT_TTS_BUFFER也就是实时返回合成音频。 60 | 61 | */ 62 | - (void) onEvent:(int)eventType arg0:(int)arg0 arg1:(int)arg1 data:(NSData *)eventData; 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlySpeechUtility.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlySpeechUtility.h 3 | // MSCDemo 4 | // 5 | // Created by admin on 14-5-7. 6 | // Copyright (c) 2014年 iflytek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define iOS_EXCLUSIVE //iOS平台独占API 12 | 13 | @class IFlySpeechError; 14 | 15 | /** 16 | * 引擎模式 17 | */ 18 | typedef NS_ENUM(NSUInteger,IFlyEngineMode){ 19 | /** 20 | * 云端使用MSC,本地优先使用语音+ 21 | */ 22 | IFlyEngineModeAuto = 0, 23 | /** 24 | * 只使用MSC 25 | */ 26 | IFlyEngineModeMsc, 27 | /** 28 | * 本地只使用语音+(受平台限制,云端无法使用语音+) 29 | */ 30 | IFlyEngineModePlus, 31 | }; 32 | 33 | 34 | /** 35 | * 服务类型 36 | */ 37 | typedef NS_ENUM(NSUInteger,IFlySpeechPlusServiceType){ 38 | /** 39 | * 打开语音+主界面 40 | */ 41 | IFlySpeechPlusServiceTypeNone, 42 | /** 43 | * 获取合成资源 44 | */ 45 | IFlySpeechPlusServiceTypeTTS, 46 | /** 47 | * 获取识别资源(未开放) 48 | */ 49 | IFlySpeechPlusServiceTypeISR, 50 | /** 51 | * 获取唤醒资源(未开放) 52 | */ 53 | IFlySpeechPlusServiceTypeIVW, 54 | } ; 55 | 56 | /** 语音+返回回调 57 | */ 58 | @protocol IFlySpeechplusDelegate 59 | 60 | - (void)onError:(int)errorCode; /*发生错误,errorCode,错误码*/ 61 | 62 | - (void)onCompleted; /*服务正常结束*/ 63 | 64 | @end 65 | 66 | /** 用户配置 67 | */ 68 | @interface IFlySpeechUtility : NSObject 69 | 70 | /*! 71 | * 创建用户语音配置 72 | * 注册应用请前往语音云开发者网站。
73 | * 网站:http://www.xfyun.cn 74 | * 75 | * @param params 启动参数,必须保证appid参数传入,示例:appid=123456 76 | * 77 | * @return 语音配置对象 78 | */ 79 | + (IFlySpeechUtility*) createUtility:(NSString *) params; 80 | 81 | /*! 82 | * 销毁用户配置对象 83 | * 84 | * @return 成功返回YES,失败返回NO 85 | */ 86 | +(BOOL) destroy; 87 | 88 | /*! 89 | * 获取用户配置对象 90 | * 91 | * @return 用户配置对象 92 | */ 93 | +(IFlySpeechUtility *) getUtility; 94 | 95 | /*! 96 | * 设置MSC引擎的状态参数 97 | * 98 | * @param value 参数值 99 | * @param key 参数名称 100 | * 101 | * @return 成功返回YES,失败返回NO 102 | */ 103 | -(BOOL) setParameter:(NSString *) value forKey:(NSString*)key; 104 | 105 | /** 106 | * 获取MSC引擎状态参数 107 | * 108 | * @param key 参数名 109 | * 110 | * @return 参数值 111 | */ 112 | - (NSString *)parameterForKey:(NSString *)key; 113 | 114 | /** 115 | * 引擎类型 116 | */ 117 | @property (nonatomic, readonly) IFlyEngineMode engineMode; 118 | 119 | @property (nonatomic, assign) id delegate; 120 | 121 | @end 122 | 123 | /** 124 | * 讯飞语音+类别 125 | */ 126 | @interface IFlySpeechUtility (SpeechPlus) 127 | 128 | /** 129 | * 检查讯飞语音+是否安装 130 | * 131 | * @return 已安装返回YES,否则返回NO 132 | */ 133 | - (BOOL)checkServiceInstalled; 134 | 135 | /** 136 | * 获取讯飞语音+下载地址进行下载,安装完成后即可使用服务。 137 | * 下载地址需要通过[[UIApplication sharedApplication] openUrl:]打开 138 | * 139 | * @return 讯飞语音+在App Store下载地址 140 | */ 141 | - (NSString *)componentUrl; 142 | 143 | 144 | /** 145 | * 处理语音+使用URL启动第三方应用程序时传递的数据 146 | * 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用。 147 | * 148 | * @param url 语音+启动第三方应用程序时传递过来的URL 149 | * 150 | * @return 成功返回YES,失败返回NO。 151 | */ 152 | - (BOOL)handleOpenURL:(NSURL *)url iOS_EXCLUSIVE; 153 | 154 | /** 155 | * 打开讯飞语音+获取相应类型服务,0表示打开主界面 156 | * 157 | * @param serviceType 服务类型 158 | * 159 | * @return 成功打开返回YES,否则返回NO 160 | */ 161 | - (BOOL)openSpeechPlus:(IFlySpeechPlusServiceType)serviceType iOS_EXCLUSIVE; 162 | 163 | @end 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlyTextUnderstander.h: -------------------------------------------------------------------------------- 1 | // 2 | // TextUnderstand.h 3 | // MSCDemo 4 | // 5 | // Created by iflytek on 4/24/14. 6 | // Copyright (c) 2014 iflytek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class IFlySpeechError; 12 | 13 | /*! 14 | * 文本转语义完成回调函数 15 | * 16 | * @param result 成功,返回文本语义理解结果 17 | * @param error 错误描述 18 | */ 19 | typedef void(^IFlyUnderstandTextCompletionHandler)(NSString* result, IFlySpeechError * error); 20 | 21 | /*! 22 | * 文本转语义类 23 | */ 24 | @interface IFlyTextUnderstander : NSObject 25 | 26 | /*! 27 | * 是否正在文本转语义 28 | */ 29 | @property (readonly, atomic) __block BOOL isUnderstanding; 30 | 31 | /*! 32 | * 文本转语义接口 33 | * 输入文本内容,获取语义理解结果 34 | * 35 | * @param text 输入的文本内容 36 | * @param completionHandler 文本转语义完成回调函数 37 | * 38 | * @return 错误码 39 | */ 40 | -(int) understandText:(NSString*)text withCompletionHandler:(IFlyUnderstandTextCompletionHandler) completionHandler; 41 | 42 | /*! 43 | * 设置文本转语义参数 44 | * 45 | * @param value 参数对应的取值 46 | * @param key 文本转语义参数参数 47 | * 48 | * @return 成功返回YES,失败返回NO 49 | */ 50 | -(BOOL) setParameter:(NSString *) value forKey:(NSString*)key; 51 | 52 | /*! 53 | * 取消本次会话 54 | */ 55 | -(void)cancel; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /iflyMSC.framework/Headers/IFlyUserWords.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFlyUserWords.h 3 | // MSC 4 | // 5 | // Created by ypzhao on 13-2-26. 6 | // Copyright (c) 2013年 iflytek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /*! 12 | * 用户词表类 13 | * 获取用户词表是为了更好的语音识别(iat),用户词表也属于个性化的一部分. 14 | */ 15 | @interface IFlyUserWords : NSObject 16 | 17 | /*! 18 | * 初始化对象 19 | * 在进行初始化时,需要传入的格式如下: 20 | *
{\"userword\":[{\"name\":\"iflytek\",\"words\":[\"科大讯飞\",
21 |  *  \"云平台\",\"用户词条\",\"开始上传词条\"]}]}
22 | * 23 | * @param json 初始化时传入的数据 24 | * 25 | * @return IFlyUserWords对象 26 | */ 27 | - (id) initWithJson:(NSString *)json; 28 | 29 | /*! 30 | * 将数据转化为上传的数据格式 31 | * 32 | * @return 没有数据或者格式不对时返回nil 33 | */ 34 | - (NSString *) toString; 35 | 36 | /*! 37 | * 返回key对应的数据 38 | * 39 | * @param key 在putword:value中设置的key 40 | * 41 | * @return key对应的数组 42 | */ 43 | - (NSArray *) getWords: (NSString *) key; 44 | 45 | /*! 46 | * 添加一条用户词数据 47 | * 48 | * @param key 用户词对应的key 49 | * @param value 上传的用户词数据 50 | * 51 | * @return 成功返回YES,失败返回NO 52 | */ 53 | - (BOOL) putWord: (NSString *) key value:(NSString *)value; 54 | 55 | /*! 56 | * 添加一组数据 57 | * 58 | * @param key 用户词对应的key 59 | * @param words 上传的用户词数据 60 | * 61 | * @return 成功返回YES,失败返回NO 62 | */ 63 | - (BOOL) putwords: (NSString *) key words:(NSArray *)words; 64 | 65 | /*! 66 | * 是否包含key对应的用户词数据 67 | * 68 | * @param key 用户词对应的key 69 | * 70 | * @return 成功返回YES,失败返回NO 71 | */ 72 | - (BOOL) containsKey: (NSString *) key; 73 | @end 74 | -------------------------------------------------------------------------------- /iflyMSC.framework/iflyMSC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/iflyMSC.framework/iflyMSC -------------------------------------------------------------------------------- /screenshot/1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/screenshot/1.PNG -------------------------------------------------------------------------------- /screenshot/2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/screenshot/2.PNG -------------------------------------------------------------------------------- /screenshot/3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/screenshot/3.PNG -------------------------------------------------------------------------------- /小恒机器人.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /小恒机器人.xcodeproj/project.xcworkspace/xcuserdata/bjmac1.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/小恒机器人.xcodeproj/project.xcworkspace/xcuserdata/bjmac1.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /小恒机器人.xcodeproj/project.xcworkspace/xcuserdata/liuheng.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/小恒机器人.xcodeproj/project.xcworkspace/xcuserdata/liuheng.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /小恒机器人.xcodeproj/xcuserdata/bjmac1.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /小恒机器人.xcodeproj/xcuserdata/bjmac1.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | IOSBmobDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 0686558E1B8EEA8800EA9E62 16 | 17 | primary 18 | 19 | 20 | 068655A71B8EEA8800EA9E62 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /小恒机器人.xcodeproj/xcuserdata/liuheng.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /小恒机器人.xcodeproj/xcuserdata/liuheng.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | IOSBmobDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 0686558E1B8EEA8800EA9E62 16 | 17 | primary 18 | 19 | 20 | 068655A71B8EEA8800EA9E62 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /小恒机器人.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /小恒机器人.xcworkspace/xcuserdata/liuheng.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happyheng/HengRobot/edf886feb994030e4e224f70a5e9dc8f2e0f7398/小恒机器人.xcworkspace/xcuserdata/liuheng.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /小恒机器人.xcworkspace/xcuserdata/liuheng.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 23 | 24 | --------------------------------------------------------------------------------