Skip to content

Instantly share code, notes, and snippets.

@iosdevie
Created May 29, 2021 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iosdevie/a8853ab8744beac35fa5490a772998cd to your computer and use it in GitHub Desktop.
Save iosdevie/a8853ab8744beac35fa5490a772998cd to your computer and use it in GitHub Desktop.
class IconNames: ObservableObject {
var iconNames: [String?] = [nil]
@Published var currentIndex = 0
init() {
getAlternateIconNames()
if let currentIcon = UIApplication.shared.alternateIconName{
self.currentIndex = iconNames.firstIndex(of: currentIcon) ?? 0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment