iOS UUID大小写变更:Objective-C转Swift4后identifierForVendor返回值是否改变?
Will
identifierForVendor UUID Change When Upgrading from Objective-C to Swift 4? Hey there! Let’s break this down clearly—this is a solid question when transitioning app codebases, and the short answer is in most normal upgrade scenarios, the UUID string will NOT change.
Here’s the full breakdown:
- First, remember what
[[[UIDevice currentDevice] identifierForVendor] UUIDString](or its Swift equivalentUIDevice.current.identifierForVendor?.uuidString) actually does: Apple generates this UUID based on your developer account and the app’s Bundle ID. It’s designed to uniquely identify all apps from the same developer on a single device. - When you upload a Swift 4-built update for your existing Objective-C app, as long as you keep the exact same Bundle ID and use the same Apple Developer Account to sign and submit the update, the system will recognize this as the same app from the same developer. The underlying programming language (Objective-C vs Swift) has no impact on how this identifier is generated.
- The only edge case where this UUID would change is if the user deletes all apps associated with your developer account from their device before installing the Swift update. In that scenario, the system has no existing record of your developer presence on the device and will generate a new identifier. But this is rare—most users will just do a standard over-the-air update, which won’t trigger this.
So to wrap up: Keep your existing Bundle ID and developer account, and your users’ identifierForVendor values will stay consistent through the upgrade.
内容的提问来源于stack exchange,提问作者user3619441
相关产品推荐
相关产品推荐

