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) { diff --git a/Classes/UI/HSIssueDetailViewController.m b/Classes/UI/HSIssueDetailViewController.m index a9f4e9c..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 @@ -135,6 +136,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); @@ -203,6 +205,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; @@ -417,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]; @@ -457,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 @@