From a9271d61918299737cd15e1374b4aa17c6e8fcb3 Mon Sep 17 00:00:00 2001 From: Pradeep Rajkumar Date: Sun, 8 Jan 2017 12:29:50 +0530 Subject: [PATCH 1/4] Auto enabled return key for message textview. Return key "Go" in the keyboard has been auto enabled based on the textview value. --- Classes/UI/HSIssueDetailViewController.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Classes/UI/HSIssueDetailViewController.m b/Classes/UI/HSIssueDetailViewController.m index a9f4e9c..7dfceb4 100644 --- a/Classes/UI/HSIssueDetailViewController.m +++ b/Classes/UI/HSIssueDetailViewController.m @@ -135,6 +135,7 @@ - (void)addMessageView { } self.messageText.returnKeyType = UIReturnKeyGo; + self.messageText.enablesReturnKeyAutomatically = YES; self.messageText.font = [UIFont systemFontOfSize:14.0f]; self.messageText.delegate = self; self.messageText.internalTextView.scrollIndicatorInsets = UIEdgeInsetsMake(5, 0, 5, 0); From 3d161a10db42430eda7bc30ca60015e9c56ea74c Mon Sep 17 00:00:00 2001 From: Pradeep Rajkumar Date: Sun, 8 Jan 2017 12:35:15 +0530 Subject: [PATCH 2/4] Keyboard Return button action implemented. On click of return key("GO") in keyboard, called the send reply method to post the message to server. --- Classes/UI/HSIssueDetailViewController.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Classes/UI/HSIssueDetailViewController.m b/Classes/UI/HSIssueDetailViewController.m index 7dfceb4..4ba9145 100644 --- a/Classes/UI/HSIssueDetailViewController.m +++ b/Classes/UI/HSIssueDetailViewController.m @@ -204,6 +204,10 @@ -(void)growingTextViewDidEndEditing:(HSGrowingTextView *)growingTextView{ } } +-(BOOL)growingTextViewShouldReturn:(HSGrowingTextView *)growingTextView { + [self sendReply:nil]; +} + -(void)removeInsetsOnChatTable{ UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0, 0 , 0.0); self.chatTableView.contentInset = contentInsets; From ec10fbf23057b696f2914a0f69851ede14f7ee9f Mon Sep 17 00:00:00 2001 From: Pradeep Rajkumar Date: Sun, 8 Jan 2017 12:38:45 +0530 Subject: [PATCH 3/4] Saved the ticket Id in deskcase object. Saved the ticket Id in DeskCase object, After creating the ticket successfully. --- Classes/Stacks/Desk/HSDeskGear.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Classes/Stacks/Desk/HSDeskGear.m b/Classes/Stacks/Desk/HSDeskGear.m index 88689aa..1cd426e 100644 --- a/Classes/Stacks/Desk/HSDeskGear.m +++ b/Classes/Stacks/Desk/HSDeskGear.m @@ -89,12 +89,14 @@ - (void)createNewTicket:(HSNewTicket *)newTicket byUser:(HSUser *)user success:( NSDictionary* responsedata = (NSDictionary*)responseObject; NSString* subject = [responsedata objectForKey:@"subject"]; + NSString* ticketId = [responsedata objectForKey:@"id"]; NSString* caseLink = [[[responsedata objectForKey:@"_links"] objectForKey:@"self"] objectForKey:@"href"]; //report success HSDeskCase* deskCase = [[HSDeskCase alloc] init]; deskCase.subject = subject; deskCase.apiHref = caseLink; + deskCase.ticketID = ticketId; if (newTicket.attachments && [newTicket.attachments count] > 0) { From 33985cda9ca7dcbf391408d749d4191f5c2307d5 Mon Sep 17 00:00:00 2001 From: Pradeep Rajkumar Date: Sun, 8 Jan 2017 13:06:42 +0530 Subject: [PATCH 4/4] =?UTF-8?q?Added=20an=20outlet=20link=20to=20the=20mes?= =?UTF-8?q?sage=20view=E2=80=99s=20bottom=20layout=20constraint.=20When=20?= =?UTF-8?q?keyboard=20is=20shown,=20message=20view=20is=20moved=20up=20and?= =?UTF-8?q?=20when=20keyboard=20is=20hidden,=20message=20view=E2=80=99s=20?= =?UTF-8?q?constant=20is=20set=200,=20so=20that=20it=20goes=20to=20the=20b?= =?UTF-8?q?ottom=20of=20the=20screen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Classes/UI/HSIssueDetailViewController.m | 7 + Resources/HelpStackStoryboard.storyboard | 238 ++++++++++++----------- 2 files changed, 130 insertions(+), 115 deletions(-) diff --git a/Classes/UI/HSIssueDetailViewController.m b/Classes/UI/HSIssueDetailViewController.m index 4ba9145..9c1e8db 100644 --- a/Classes/UI/HSIssueDetailViewController.m +++ b/Classes/UI/HSIssueDetailViewController.m @@ -44,6 +44,7 @@ @interface HSIssueDetailViewController () { @property UIImagePickerController *imagePickerViewController; @property HSEditImageViewController *editImageViewController; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *messageViewBottomLayoutConstraint; @end @@ -422,6 +423,9 @@ -(void) keyboardWillHide:(NSNotification *)note{ CGRect keyboardBounds; [[note.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] getValue: &keyboardBounds]; + //Move the message view to the bottom of the screen along with the keyboard + self.messageViewBottomLayoutConstraint.constant = 0; + // Need to translate the bounds to account for rotation. keyboardBounds = [self.view convertRect:keyboardBounds toView:nil]; @@ -462,6 +466,9 @@ - (void)keyboardFrameWillChange: (NSNotification *)notification { if (UIDeviceOrientationIsPortrait([UIDevice currentDevice].orientation)) { containerFrame.origin.y = kKeyBoardFrame.origin.y - containerFrame.size.height - 64; + + //Move the message view up by Keyboard's height + self.messageViewBottomLayoutConstraint.constant = kKeyBoardFrame.size.height; } else { // On ios 7 landscape x == ios 8 landscape y diff --git a/Resources/HelpStackStoryboard.storyboard b/Resources/HelpStackStoryboard.storyboard index ad0e443..bb39050 100644 --- a/Resources/HelpStackStoryboard.storyboard +++ b/Resources/HelpStackStoryboard.storyboard @@ -1,9 +1,13 @@ - - + + + + + - + + - + @@ -11,11 +15,11 @@ - + - + - + @@ -24,13 +28,13 @@ - + - + - + @@ -64,21 +68,22 @@ - + - + - + + @@ -86,14 +91,15 @@ - + - + + @@ -101,14 +107,15 @@ - + - + + @@ -139,33 +146,33 @@ - + - - + + - + - + - + @@ -180,15 +187,15 @@ - + - + - - + + @@ -232,14 +239,15 @@ - + + - + @@ -255,11 +263,11 @@ - + - + - + @@ -268,10 +276,10 @@ - + - + @@ -308,15 +316,15 @@ - + - - + + - + @@ -339,6 +347,7 @@ + @@ -361,20 +370,20 @@ - + - + - + - + - + @@ -382,7 +391,7 @@ - + @@ -398,22 +407,22 @@ - + - + - + - + @@ -430,10 +439,10 @@ - + - + @@ -441,18 +450,20 @@ - + @@ -464,13 +475,13 @@ - + - + - + @@ -478,18 +489,20 @@ - + @@ -501,13 +514,13 @@ - + - + - + @@ -515,11 +528,12 @@ - + @@ -531,13 +545,13 @@ - + - + - + @@ -545,11 +559,12 @@ - + @@ -561,7 +576,7 @@ - + @@ -580,8 +595,8 @@ - - + + @@ -595,7 +610,7 @@ - + @@ -606,13 +621,13 @@ - + - + @@ -628,7 +643,7 @@ - + @@ -636,11 +651,10 @@ - + - @@ -652,13 +666,13 @@ - + @@ -683,10 +697,10 @@ - + - + @@ -711,13 +725,13 @@ - + - + - + @@ -741,21 +755,22 @@ - + - + - + - + + @@ -763,14 +778,15 @@ - + - + + @@ -778,14 +794,15 @@ - + - + + @@ -820,14 +837,14 @@ - + - + - + @@ -835,10 +852,10 @@