# HG changeset patch # User Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> # Date 1614429863 0 # Node ID 4cdd0b7f807c5f0abbc840befb9ca31092a9490d # Parent 4e3f510ad14dee3980f83f2d1aea91ce31e41646 Delete IconRow diff -r 4e3f510ad14d -r 4cdd0b7f807c LazyBear/UI/IconRow.swift --- a/LazyBear/UI/IconRow.swift Sat Feb 27 12:44:13 2021 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -// -// IconRow.swift -// LazyBear -// -// Created by Dennis Concepción Martín on 26/2/21. -// - -import SwiftUI - -struct IconRow: View { - var icon: IconModel - - var body: some View { - Button(action: { changeIcon(key: icon.file) }) { - HStack { - Image(icon.file) - .resizable() - .frame(width: 70, height: 70) - - Text(icon.name) - Spacer() - - if UIApplication.shared.alternateIconName ?? "defaultIcon" == icon.file { - Text("Selected") - } - } - } - } - - private func changeIcon(key: String) { - if key != "defaultIcon" { - UIApplication.shared.setAlternateIconName(key) { error in - if let error = error { - print(error.localizedDescription) - } else { - print("Success!") - } - } - } else { - UIApplication.shared.setAlternateIconName(nil) - } - } -} - -struct IconRow_Previews: PreviewProvider { - static var previews: some View { - IconRow(icon: icons[0]) - } -}