Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Sources/NextcloudKitUI/Documentation.docc/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ Key traits of this package:

## Topics

### Onboarding

- ``OnboardingView``
- ``OnboardingFeature``

### Login

- ``ServerAddressView``
Expand Down
23 changes: 23 additions & 0 deletions Sources/NextcloudKitUI/Image+appIcon.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2026 Milen Pivchev
// SPDX-License-Identifier: GPL-3.0-or-later

import SwiftUI

extension Image {
///
/// The app's own icon, loaded from the largest icon file the build lists in the Info.plist.
///
public static var appIcon: Image? {
#if canImport(UIKit)
let icons = Bundle.main.object(forInfoDictionaryKey: "CFBundleIcons") as? [String: Any]
let primaryIcon = icons?["CFBundlePrimaryIcon"] as? [String: Any]

guard let name = (primaryIcon?["CFBundleIconFiles"] as? [String])?.last, let image = UIImage(named: name) else { return nil }

return Image(uiImage: image)
#else
return nil
#endif
}
}
Loading
Loading