devicekit / DeviceKit

DeviceKit is a value-type replacement of UIDevice.
MIT License
4.47k stars 435 forks source link

Swift 6 Compliant #425

Open tazmancoder opened 1 month ago

tazmancoder commented 1 month ago

I am just wondering when DeviceKit will be Swift 6 compliant. On my import for DeviceKit I get the following suggestion.

Add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'DeviceKit'

I have and enum like so where I use it:

enum LAC {
    // MARK: - DeviceKit
    static let device = Device.current

    // MARK: - Submit Feedback
    static let categoryDescritionNotSet = String(localized: "Choose a category and enter a description.", table: "ContactUsView+Strings", comment: "Message to user that something is missing on view")
}

This way in my code I can call LAC.device.isPad or any of the other options DeviceKit offers.

Not sure if this is the best way to use this package, but I just wanted to instantiate this in one place instead of putting

import DeviceKit and 
let device = Device.current in many places in my code.

Can you provide some feedback on when this package will support Swift 6?

Thanks

Mark

kudit commented 1 month ago

You can probably add @MainActor to the static variable to silence the warning.

tazmancoder commented 1 month ago

I’ve done that, just not sure if you guys are working on making Swift 6 compliant.Thanks,-Mark/*Mark J PerrymanApple Product @. Oct 21, 2024, at 12:48, kudit @.> wrote: You can probably add @MainActor to the static variable to silence the warning.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

kudit commented 1 month ago

just not sure if you guys are working on making Swift 6 compliant

I'm not sure if that's on the roadmap for this team, but the similar project http://github.com/kudit/Device is Swift 6 compliant already and works on Linux.

tazmancoder commented 1 month ago

Thanks for the reply, one last question, Im not sure what this means when trying to add the package.

If the repository is private, use the following link to import: @.***/kudit/Device.git

What is ?

Or can I just add the package to my private repo https://github.com/kudit/Device?

Thanks,

-Mark/*

Mark J Perryman Apple Product Enthusiast @.***

On Oct 23, 2024, at 10:16, kudit @.***> wrote:

just not sure if you guys are working on making Swift 6 compliant

I'm not sure if that's on the roadmap for this team, but the similar project http://github.com/kudit/Device https://github.com/kudit/Device is Swift 6 compliant already and works on Linux.

— Reply to this email directly, view it on GitHub https://github.com/devicekit/DeviceKit/issues/425#issuecomment-2432762627, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF6AQV427R7IXQGTHIWWN7TZ47DUBAVCNFSM6AAAAABPIAYZCWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZSG43DENRSG4. You are receiving this because you authored the thread.