WFCUInviteGroupMemberViewController.m 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // InviteGroupMemberViewController.m
  3. // WFChat UIKit
  4. //
  5. // Created by WF Chat on 2017/9/18.
  6. // Copyright © 2017年 WildFireChat. All rights reserved.
  7. //
  8. #import "WFCUInviteGroupMemberViewController.h"
  9. #import "WFCUUtilities.h"
  10. @interface WFCUInviteGroupMemberViewController ()
  11. @property (nonatomic, strong)UITextField *memberField;
  12. @end
  13. @implementation WFCUInviteGroupMemberViewController
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:WFCString(@"Cancel") style:UIBarButtonItemStyleDone target:self action:@selector(onCancel:)];
  17. self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:WFCString(@"Ok") style:UIBarButtonItemStyleDone target:self action:@selector(onDone:)];
  18. CGRect rect = self.view.bounds;
  19. self.memberField = [[UITextField alloc] initWithFrame:CGRectMake(20, [WFCUUtilities wf_navigationFullHeight] + 50, rect.size.width - 40, 40)];
  20. [self.memberField setBackgroundColor:[UIColor whiteColor]];
  21. [self.view addSubview:self.memberField];
  22. [self.view setBackgroundColor:[UIColor grayColor]];
  23. [self.memberField becomeFirstResponder];
  24. }
  25. - (void)onCancel:(id)sender {
  26. [self dismissViewControllerAnimated:YES completion:nil];
  27. }
  28. - (void)onDone:(id)sender {
  29. if (self.inviteMember && self.memberField.text) {
  30. self.inviteMember(self.groupId, @[self.memberField.text]);
  31. }
  32. [self dismissViewControllerAnimated:YES completion:nil];
  33. }
  34. - (void)didReceiveMemoryWarning {
  35. [super didReceiveMemoryWarning];
  36. }
  37. /*
  38. #pragma mark - Navigation
  39. // In a storyboard-based application, you will often want to do a little preparation before navigation
  40. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  41. // Get the new view controller using [segue destinationViewController].
  42. // Pass the selected object to the new view controller.
  43. }
  44. */
  45. @end