Log in and Sign up in the same page

I am making my login/sign up page for my mobile app and I decided to make my login and sign up in the same page separated by a segment control other than having a link and opening a new page for logging in or signing up. So I have two questions regarding this:

1- Is this a better choice than going with what most apps do, ie, login and sign up in different pages?

2- Just wondering if there is even a better way of doing this than using a segment control.