这是用系统提供的二维码方法实现的,性能要比第三方好,
注意:一定要在plist中配置NSPhotoLibraryUsageDescription和NSPhotoLibraryUsageDescription
否则会崩溃提示:
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.
和
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.