a native ios client for gitbay

client ios swift

https://gitbay.org

gitbay/Discovery/ExploreViewModel.swift

main
gitbay-ios/gitbay/Discovery/ExploreViewModel.swift history · blame · raw

14 lines · 485 bytes

 1import Foundation
 2
 3/// One row of `explore`  a public repository on this instance.
 4nonisolated struct PublicRepo: Decodable, Sendable, Hashable, Identifiable {
 5    let path: String
 6    let description: String?
 7    let archived: Bool?
 8    let topics: [String]?
 9
10    var id: String { path }
11    var isArchived: Bool { archived ?? false }
12    var name: String { String(path.split(separator: "/").last ?? "") }
13    var owner: String { String(path.split(separator: "/").first ?? "") }
14}