mirror of
https://github.com/yattee/yattee.git
synced 2024-12-15 06:40:32 +05:30
18 lines
506 B
Swift
18 lines
506 B
Swift
|
import Defaults
|
||
|
import SwiftyJSON
|
||
|
|
||
|
struct RecentlyOpenedImporter {
|
||
|
var json: JSON
|
||
|
|
||
|
func performImport() {
|
||
|
if let recentlyOpened = json["recentlyOpened"].array {
|
||
|
recentlyOpened.forEach { recentlyOpenedJSON in
|
||
|
let dict = recentlyOpenedJSON.dictionaryValue.mapValues { json in json.stringValue }
|
||
|
if let item = RecentItemBridge().deserialize(dict) {
|
||
|
RecentsModel.shared.add(item)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|