User Signup Flow
About
This is one part of my current work for the iOS app. It is a flow form for new user to submit some basic personal informations. I did the basic UI/UX part, because we don’t have a designer yet. Some ideas are coming from Airbnb app. I really like it.
During the research of Airbnb iOS app, I found their app has problem with calculating the real height of keyboard on screen when user use a bluetooth keyboard. But it is not a big problem(They have fixed the problem by making the bottom bar transparent. It is really nice). This feature right now only does information gathering job. I will integrate more features, like finding friends, subscribing official accounts, into this part in the future.
The whole process has five pages. The user profile needs several required fields such as display name, birthday and real name. So the first two pages are for required information. If user didn’t fill them out, the white circle next button can not be pressed. After first two pages, the interface will tell user that he/she can skip current page.
i didn’t use navigation controller with five UIViewControllers, because I want to keep the bottom bar in the screen without transfer animation all the time. However, I did like the navigation transfer animation between pages, so I use CATransition
to do the job:
1 | // Found firstView's index |
So, five pages (views) will be created at viewDidLoad, but only one of them will be added to the subview of the self.view at each time.
There are two things I cared about when keyboard came out. One is the bottom bar’s location that it should be at the top of the keyboard. And another is that textfield or textView should not be hidden by the keyboard.
So, I need to know when keyboard comes out and dismiss, and keyboard’s real height (not height got from notification, I will explain it) To do this, I need two notification: UIKeyboardWillShowNotification
and UIKeyboardWillHideNotification
.
1 |
|
And when keyboard comes out, I need to get the keyboard’s real height by:
1 | - (void)keyboardWillOpen:(NSNotification *)notification { |
The reason I got height by calculating is that when user use a physical keyboard, the keyboard on screen will show only part of itself. This will happen on iPad devices. I will show you the picture of Airbnb app. No offense.
The first image shows the normal software keyboard. the bottom bar moves up properly. But, in the second picture with physical keyboard, the bottom bar moves up like the first one. And more problem, in the third picture, the bar block one part of this page leading weird looking. The reason for this is using the height from userInfo directly.
1 | NSDictionary *info = [notification userInfo]; |
This height will not change when using a physical keyboard. The changed thing is the keyboard’s y position. Bingo!
So, after I got the real height, I can move the bottom bar up.
1 | - (void)keyboardWillOpen:(NSNotification *)notification { |
And for moving the textfield or textView, I chose to put them inside a scroll view. Then, by changing the contentInsets and contentOffset, I can move up the them. Something like this:
1 | UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0, height, 0.0); |
I used RSKImageCropper for my image cropping currently. Great library. Thanks a lot. I may change it later, because I want to add some image effects for users to modify their head image.
For the last done circle, I used CABasicAnimation to draw it.
1 | // create a circle layer |
I think that is it. Hope you find some problem to tell me. Happing learning.