-
-
Save jasdev/6711e2d8651c5be1603d87a2086d56fb to your computer and use it in GitHub Desktop.
Teeing up two dictionaries of tabs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
struct Tab { | |
let id = UUID() | |
let url: URL | |
} | |
let twitter = Tab(url: URL(string: "https://twitter.com/")!) | |
let pointFree = Tab(url: URL(string: "https://www.pointfree.co/")!) | |
let feedbin = Tab(url: URL(string: "https://feedbin.com/")!) | |
let gitHub = Tab(url: URL(string: "https://github.com/")!) | |
let tabGroup1 = Dictionary(uniqueKeysWithValues: [twitter, pointFree].map { ($0.id, $0) }) | |
let tabGroup2 = Dictionary(uniqueKeysWithValues: [feedbin, gitHub].map { ($0.id, $0) }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment