Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Syntax changes for next update. #61

Closed
crashoverride777 opened this issue Sep 20, 2016 · 5 comments
Closed

Syntax changes for next update. #61

crashoverride777 opened this issue Sep 20, 2016 · 5 comments

Comments

@crashoverride777
Copy link

crashoverride777 commented Sep 20, 2016

Thanks for the quick swift 3 update. Could you please do the following syntax changes for the next update to make it even more swift 3 like and closer to NSUserDefaults.

Change the singleton access to either default, standard or shared. So instead of

KeychainWrapper.defaultKeychainWrapper.set(...)

it reads

KeychainWrapper.default.set(...)
or
KeychainWrapper.standard.set(...)
or
KeychainWrapper.shared.set(...)

Change the remove method from

...remove(key: ....)

to

...removeObject(forKey: ...)

@jrendel
Copy link
Owner

jrendel commented Sep 20, 2016

Thanks for the suggestions. I went back and forth on what to do with remove, but I do like the idea of keeping it closer to NSUserDefaults and more consistent with the other functions.

The singleton access cleanup looks good too, I like keeping it more concise.

Everything else working for you ok? Between the unit test issues on iOS 10 simulator and CocoaPod submission problems, this update was less tested than I would have liked. But I also didn't want to delay it anymore.

@crashoverride777
Copy link
Author

crashoverride777 commented Sep 20, 2016

Hey, thanks for the reply, big fan of your helper.

I have been reading through your helper and thats the 2 main things I noticed that are different from UserDefaults. If you do those changes you are basically identical.

I am not sure what singleton access you should use, I use "shared" for all my projects now (sharedInstance prior to swift 3).
Apple also seems to now use "shared" for most singletons, e.g ReplayKit.
UserDefaults uses "standard" and iCloud uses "default", so its really up to you what you prefer.

I have been using your helper since xCode 8 GM with my own changes to make it work with Swift 3. I haven't had any problems at all so far.

I just updated to your official version and everything seems fine too, I will report back incase I find something.

Thanks again for your continued support.

@crashoverride777
Copy link
Author

crashoverride777 commented Sep 20, 2016

Oh yeah I opened another issue but it would be so awesome if you could provide cocoa pods support for tvOS. All my projects are iOS and tvOS universal and its a bit of a hassle without the cocoa pods support for tvOS. Is that much work for you to do? I have been using your helper for at least 8 months on tvOS and it works flawlessly.

@jrendel
Copy link
Owner

jrendel commented Oct 1, 2016

I've update the syntax as suggested. I went with .standard for singleton access to keep consistent with UserDefaults. These are in version 2.2.1, which I'm pushing to CocoaPods now.

As for tvOS support, I will get to that eventually. I've also got requests for watchOS support and macOS support, so I need to go through them all one by one and see what is required. I think tvOS and watchOS are relatively simple.

@jrendel jrendel closed this as completed Oct 1, 2016
@crashoverride777
Copy link
Author

Hey, thanks for the update.

In regarde to tvOS, there is literally nothing you have to do. I have been using your helper on tvOS for over 1 year and never had a problem.
Would be great if you can get cocoa pods support. I am not sure about watchOS as I dont have an apple watch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants