From 25bc4f1357252dc0aeee70f0a638a4226231d5fb Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 28 Jun 2017 22:36:47 +0300 Subject: inputAccessoryView --- Juick/Supporting Files/Juick-Prefix.pch | 1 + Juick/ViewControllers/MessagesViewController.h | 2 +- Juick/ViewControllers/MessagesViewController.m | 21 +++++++++++++++++++++ Podfile | 1 + Podfile.lock | 8 +++++++- 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Juick/Supporting Files/Juick-Prefix.pch b/Juick/Supporting Files/Juick-Prefix.pch index 5b3ccf0..f69266f 100644 --- a/Juick/Supporting Files/Juick-Prefix.pch +++ b/Juick/Supporting Files/Juick-Prefix.pch @@ -23,4 +23,5 @@ #import #import #import + #import #endif diff --git a/Juick/ViewControllers/MessagesViewController.h b/Juick/ViewControllers/MessagesViewController.h index 613ac64..3dac200 100644 --- a/Juick/ViewControllers/MessagesViewController.h +++ b/Juick/ViewControllers/MessagesViewController.h @@ -8,7 +8,7 @@ #import -@interface MessagesViewController : UITableViewController +@interface MessagesViewController : UITableViewController - (void)loadFromPath:(NSString *)messagesPath withParams:(NSDictionary *)params withTitle:(NSString *)title; - (void) refreshData; - (void) composePressed; diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m index 33c23e4..95879bf 100644 --- a/Juick/ViewControllers/MessagesViewController.m +++ b/Juick/ViewControllers/MessagesViewController.m @@ -28,6 +28,7 @@ static NSString *CellIdentifier = @"MessageCell"; @property(nonatomic, strong) NSString *path; @property(nonatomic, strong) NSMutableDictionary *params; @property(nonatomic, strong) dispatch_queue_t concurrent_queue; +@property (nonatomic, readwrite, retain) UIView *inputAccessoryView; @end @@ -197,4 +198,24 @@ static NSString *CellIdentifier = @"MessageCell"; } } +- (BOOL) canBecomeFirstResponder { + return [self.path isEqualToString:[Message threadUrl]]; +} + +- (UIView *)inputAccessoryView { + if (!_inputAccessoryView) { + CGRect viewBounds = self.view.bounds; + CGRect frame = CGRectMake(0, viewBounds.size.height - PHFComposeBarViewInitialHeight, viewBounds.size.width, + PHFComposeBarViewInitialHeight); + PHFComposeBarView *_view = [[PHFComposeBarView alloc] initWithFrame:frame]; + _view.backgroundColor = [UIColor whiteColor]; + _view.buttonTintColor = [ColorScheme linkColor]; + _view.maxLinesCount = 4; + _view.utilityButtonImage = [UIImage imageNamed:@"Camera"]; + _view.delegate = self; + _inputAccessoryView = _view; + } + return _inputAccessoryView; +} + @end diff --git a/Podfile b/Podfile index f12bc3c..6e76662 100644 --- a/Podfile +++ b/Podfile @@ -13,5 +13,6 @@ target "Juick" do pod 'DateTools' pod 'SIAlertView' pod 'XLForm' + pod 'PHFComposeBarView' end diff --git a/Podfile.lock b/Podfile.lock index 39b7af0..b21b86c 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -26,6 +26,9 @@ PODS: - MWFeedParser/NSDate+InternetDateTime (1.0.1) - MWFeedParser/NSString+HTML (1.0.1) - PDKeychainBindingsController (0.0.1) + - PHFComposeBarView (2.1.0): + - PHFDelegateChain (~> 1.0) + - PHFDelegateChain (1.0.1) - SIAlertView (1.3) - SWRevealViewController (2.3.0) - TTTAttributedLabel (2.0.0) @@ -45,6 +48,7 @@ DEPENDENCIES: - FontAwesome+iOS - MWFeedParser - PDKeychainBindingsController + - PHFComposeBarView - SIAlertView - SWRevealViewController - TTTAttributedLabel @@ -58,6 +62,8 @@ SPEC CHECKSUMS: FontAwesome+iOS: 9070b682a9255ca0fdc34bcfb129ad0ba2b73b87 MWFeedParser: 2cf646014c1baf6ad1b08c480b40a08180079247 PDKeychainBindingsController: fa8cb3cf99f2ea9240d61066ed0549f34e2cec3c + PHFComposeBarView: 6382ab846e2f4d8634273c4a78d074bc5deed07f + PHFDelegateChain: 491f9cd8a3fb8761f390ff05f74a0e168d48d285 SIAlertView: 20c794b55eaf44d888773ea51647cf8907723919 SWRevealViewController: 6d3fd97f70112fd7cef9de14df4260eacce4c63a TTTAttributedLabel: 8cffe8e127e4e82ff3af1e5386d4cd0ad000b656 @@ -67,6 +73,6 @@ SPEC CHECKSUMS: YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30 YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928 -PODFILE CHECKSUM: 3f9b19e9dd1cf7eda49e88b0cbe7e46708c4d9f0 +PODFILE CHECKSUM: dae1bc87d85cea7ed430015ea421177d4442cd93 COCOAPODS: 1.2.1 -- cgit v1.2.3