You may want to check the open source github library for authentication: https://github.com/MSOpenTech/azure-activedirectory-library-for-ios. I am currently the main contributor, so feel free to ask me further questions on the library. The readme file will give you an idea on how to authenticate and start using the provided access token.
Here is a sample code for obtaining access token. Keep in mind that access tokens are internally cached, so all you need is to call the acquireTokenWithResource below every time you need it, the library takes care of the authentication (asking user for credentials if needed) and leveraging refresh tokens over the OAuth 2.0 protocol.
ADAuthenticationError *error;
authContext = [ADAuthenticationContext authenticationContextWithAuthority:authority
error:&error];
NSURL *redirectUri = [NSURL URLWithString:redirectUriString];
[authContext acquireTokenWithResource:resourceId
clientId:clientId
redirectUri:redirectUri
completionBlock:^(ADAuthenticationResult *result) {
if (AD_SUCCEEDED != result.status){
// display error on the screen
[self showError:result.error.errorDetails];
}
else{
//Use result.accessToken to access any services.
}
}];