I am wondering where I should put http basic auth delegate methods in my xcode project, given the conditions below.
- xcode 14.0 objective-c
- it has a tab bar controller, which has four view controllers.
– FirstView.m- secondView.m
- thirdView.m
- fourthView.m
– the secondView is the settings tab which has auth credentials.
- First, 2nd and 4th view have a web view each.
- each web view has a function of post with basic auth; auth credentials are common and defined in the second view.
My thought is, thus, didReceiveAuthenticationChallenge and other related delegate methods should be one and shared among three.
In that case, where should they be placed? for example, if it is written in firstView.m, the delegate method can not be seen nor called from web views in third and fourth view.
There is AppDelegate.m for delegates of app status changes.
Is this the best place?
I am wondering what is a common practice in such a case.
Thank you very much!
Have a nice day!