Skip to content

Commit

Permalink
dismiss keyboard and clean textfield on screen change
Browse files Browse the repository at this point in the history
  • Loading branch information
grenos committed Apr 10, 2020
1 parent 6238c25 commit 43f3b3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Binary file not shown.
5 changes: 5 additions & 0 deletions GHFollowers/Screens/SearchVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class SearchVC: UIViewController {
// hide navbar on this screen
// called in this lifecycle because we need to hide it everytime we enter this screen
navigationController?.setNavigationBarHidden(true, animated: true)
// clear input on screen focus
userNameTextFiled.text = ""
}


Expand Down Expand Up @@ -67,6 +69,9 @@ class SearchVC: UIViewController {
return
}

// dismiss keyboard when changing view
userNameTextFiled.resignFirstResponder()

let followerListVC = FollowerListVC()
// pass the value of the input to the FollowersVC View
followerListVC.username = userNameTextFiled.text
Expand Down

0 comments on commit 43f3b3f

Please sign in to comment.