Skip to content

SwiftfulThinking/IdentifiableByString

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reusable protocol for Identifiable where ID is a String ✅

The protocol:

public protocol StringIdentifiable: Identifiable {
    var id: String { get }
}

Typical usage:

import IdentifiableByString

struct MyModel: StringIdentifiable {
    let id: String
}

(Optional) Create a typealias to avoid importing the package into every file of your project:

import IdentifiableByString

typealias StringIdentifiable = IdentifiableByString.StringIdentifiable

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages