Mixonomer-iOS/Music Tools/Model/LiveUser.swift

28 lines
624 B
Swift

//
// LiveUser.swift
// Music Tools
//
// Created by Andy Pack on 19/02/2020.
// Copyright © 2020 Sarsoo. All rights reserved.
//
import Foundation
class LiveUser: ObservableObject {
@Published var playlists: [Playlist]
@Published var tags: [Tag]
init(playlists: [Playlist], tags: [Tag]) {
self.playlists = playlists
self.tags = tags
}
func updatePlaylist(playlistIn: Playlist) {
guard let index = self.playlists.firstIndex(of: playlistIn) else {
fatalError("\(playlistIn) not found")
}
self.playlists[index] = playlistIn
}
}