I figured out some of the iOS AudioKit examples (for example the Recorder-app) on a iPhone 4s but I have always the problem that there is no sound from the loudspeaker, just from the ear-speaker. I made a simple record and play-app with AudioKit but I could not fix it:
try AKSettings.setSession(category: .playAndRecord, with: .defaultToSpeaker)
does not do its work, why? I tried out other solutions which I found on different mailing lists like
AKSettings.defaultToSpeaker = true
or
try AVAudioSession.sharedInstance().overrideOutputAudioPort(AVAudioSession.PortOverride.speaker)
nothing helped. I use Xcode 11 with Swift 5 for my own coding and the current AudioKit-release. Thanks for sharing your ideas... (with my libpd apps the speaker worked always fine which means it is not a hardware problem)