Yeah, the doc was not updated, you need to add this to your app delegate, so your app know how to handle the Twitter SDK callback.
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
return Twitter.sharedInstance().application(app, open: url, options: options)
}
But please Twitter, update the doc… it’ll avoid future headache.