evgenyneu / keychain-swift

Helper functions for saving text in Keychain securely for iOS, OS X, tvOS and watchOS.
MIT License
2.82k stars 345 forks source link

Swift-tools-version bump to 5.0 #140

Closed vvghost1 closed 2 years ago

vvghost1 commented 3 years ago

This fixes minimum deployment target version error when project generated in Xcode 12

evgenyneu commented 3 years ago

@vvghost1 thanks for the fix. What are the steps to reproduce the "deployment target version error" in Xcode 12? I just want to check that the bug exists locally and confirm that it goes away with your update. Thanks 👍

vvghost1 commented 3 years ago

@evgenyneu sorry for delayed answer. Steps to reproduce (using Xcode 12, swift-tools-version:5.x):

Now, if you will try to build generated project for iOS Simulator, you will have error "Compiling for iOS 9.0, but module 'KeychainSwift' has a minimum deployment target of iOS 14.x"

evgenyneu commented 3 years ago

Thanks for instructions, yes I can reproduce the issue. The recommended way of adding KeychainSwift package to an Xcode project is by using the menu File > Packages > Add Package Dependency. This does not result in any errors for me, I just tested in Xcode 12.3, both for a Mac and iOS app, see project attached. Do you think you can use this approach, or do you still need to create Xcode project from command line?

DemoKeychainSwift.zip

vvghost1 commented 3 years ago

@evgenyneu thank you for attention to this issue! I have already found a workaround, and, moreover, I had investigated that generate-xcodeproj is being deprecated: https://github.com/apple/swift-package-manager/pull/3062 However, I still think that bumping swift-tools-version is a good thing to reduce possible bugs in the future. Maybe you could do it with some additional changes later, it's up to you

bdolewski commented 2 years ago

Hello! What about current status with Xcode 13.2.1?

ChrisMarshallNY commented 2 years ago

It'sI'm using it in a native Swift (UIKit) app (version 19.0.0 -SPM).

It works fine (latest Xcode/Swift 5.5).

Have you encountered any issues?

I generally don't run prerelease Xcode, unless there's an explicit reason.

bdolewski commented 2 years ago

It'sI'm using it in a native Swift (UIKit) app (version 19.0.0 -SPM).

That's also the problem because SPM sees this lib as version 19.0.0 which is wrong because on GitHub there is a release 2.0.1. The mismatch is because 19 it's a tag in git and SPM cares only about tags. However this is different issue addressed here: https://github.com/evgenyneu/keychain-swift/issues/148

It works fine (latest Xcode/Swift 5.5).

Yeah, it works fine but Xcode displays a yellow warning because it wants to update this package into Swift 5. It's just outdated.

I generally don't run prerelease Xcode, unless there's an explicit reason.

I see but Xcode 13.2.1 was released on AppStore about 1 week ago.

ChrisMarshallNY commented 2 years ago

Ah. I see. I have 13.2.1. I was wondering if there was an issue with a prerelease.

I see that stupid warning. I was wondering what caused it.

That release is a few years old, and very much out of date. It should probably be deleted, or a bunch of new releases, set to various tags, should be added (at least the 19.0.0 tag).

Thanks!

evgenyneu commented 2 years ago

Done