focus room name input field at first appearance.

Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Ivan Sein 2018-06-21 09:47:57 +02:00
Родитель cc50fd7d1c
Коммит 0c3d24c886
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -41,6 +41,7 @@ NSString * const NCRoomCreatedNotification = @"NCRoomCreatedNotification";
@property (nonatomic, assign) NSInteger participantsToBeAdded;
@property (nonatomic, strong) NSString *passwordToBeSet;
@property (nonatomic, strong) NSString *createdRoomToken;
@property (nonatomic, assign) BOOL didFocusRoomNameOnce;
@end
@ -335,6 +336,17 @@ NSString * const NCRoomCreatedNotification = @"NCRoomCreatedNotification";
return nil;
}
- (void)tableView:(UITableView *)tableView willDisplayCell:(nonnull UITableViewCell *)cell forRowAtIndexPath:(nonnull NSIndexPath *)indexPath
{
BOOL isRoomNameCell = indexPath.row == 0 && indexPath.section == kCreationSectionName;
BOOL one2one = [self isOneToOneConversation];
if (isRoomNameCell && !_didFocusRoomNameOnce && !one2one) {
RoomNameTableViewCell *roomNameCell = (RoomNameTableViewCell *)cell;
[roomNameCell.roomNameTextField becomeFirstResponder];
_didFocusRoomNameOnce = YES;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = nil;
static NSString *publicCellIdentifier = @"PublicConversationCellIdentifier";