How to use UI Web View and receive OAuth Tokens

I have a Web Service SmartApp providing several REST API.
I have a problem with OAuth2 login:
when I click on login button in my smart App , I need to display the smart things login page on a Web View and able to login but I was not able to receive the OAuth Token. I have provided the HTTP request to get the authorization code with a “redirect_uri” specified. How can my iOS app get back the authorization code?
Is there any available source example how to solve this?

I was able to receive the OAuth tokens if I use an external browser. How can I use a WebView instead of external browser?

Thank you for your help!