This is the code for how to deal with iOS delegates.