@@ -32,6 +32,7 @@ struct SettingsView: View {
|
||||
addTestDataCell
|
||||
clearDB
|
||||
whyBackgroundMode
|
||||
changeIcon
|
||||
Spacer()
|
||||
}
|
||||
.padding()
|
||||
@@ -126,6 +127,48 @@ struct SettingsView: View {
|
||||
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))
|
||||
}
|
||||
|
||||
let iconSets: [(String,String)] = [
|
||||
("PurpleFeelsAppIcon", "PurpleAppIcon"),
|
||||
("RedFeelsAppIcon", "RedAppIcon")
|
||||
]
|
||||
|
||||
private var changeIcon: some View {
|
||||
ZStack {
|
||||
Color(UIColor.systemBackground)
|
||||
VStack {
|
||||
Text("Change Icon")
|
||||
HStack {
|
||||
|
||||
Button(action: {
|
||||
UIApplication.shared.setAlternateIconName(nil)
|
||||
}, label: {
|
||||
Image("FeelsAppIcon", bundle: .main)
|
||||
.resizable()
|
||||
.frame(width: 50, height:50)
|
||||
.cornerRadius(10)
|
||||
})
|
||||
.padding()
|
||||
|
||||
ForEach(iconSets, id: \.self.0){ iconSet in
|
||||
Button(action: {
|
||||
UIApplication.shared.setAlternateIconName(iconSet.1) { (error) in
|
||||
// FIXME: Handle error
|
||||
}
|
||||
}, label: {
|
||||
Image(iconSet.0, bundle: .main)
|
||||
.resizable()
|
||||
.frame(width: 50, height:50)
|
||||
.cornerRadius(10)
|
||||
})
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))
|
||||
}
|
||||
|
||||
private func updateNotificationTimes(toDate date: Date) {
|
||||
LocalNotification.removeNotificaiton()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user