I am using UUID to get Unique code from iOS Devices but while uninstalling or deleting and re-installing id Changed.. Suggest Without saving to Keychain and ASIdentifierManager.
let deviceId = (UIDevice.current.identifierForVendor?.uuidString)!
But in android - ANDROID_ID working fine
Note :Keeping the apple privacy and security