mirror of
https://github.com/home-assistant/iOS.git
synced 2026-06-17 17:49:07 -05:00
This is somewhat in prep of being able to make the project file generated, but also just organizes things into more concrete directory structures.
This pulls out _all_ of the build settings from the root level, and most from the target level, into xcconfigs.
The new directory structure looks like:
- Sources
- App
- (everything from HomeAssistant/)
- WatchApp
- Shared
- MacBridge
- Extensions
- Intents
- NotificationContent
- NotificationService
- Share
- Today
- Watch
- Widgets
- Tests
- App
- UI
- Shared
Somewhat intentionally, the file structure under these is not yet standardized/organized.
The project targets are now:
- App
- WatchApp
- Shared-iOS
- Shared-watchOS
- MacBridge
- Tests-App
- Tests-UI
- Tests-Shared
- Extension-Intents
- Extension-NotificationContent
- Extension-NotificationService
- Extension-Share
- Extension-Today
- Extension-Widget
- WatchExtension-Watch
This does not yet clean up resources vs. sources, nor does it handle some of the "it's in Sources/App but it's part of Shared" crossover directory issues.
27 lines
725 B
Swift
27 lines
725 B
Swift
//
|
|
// UNNotificationContent+ClientEvent.swift
|
|
// Shared
|
|
//
|
|
// Created by Stephan Vanterpool on 8/26/18.
|
|
// Copyright © 2018 Robbie Trencheny. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import UserNotifications
|
|
|
|
public extension UNNotificationContent {
|
|
var clientEventTitle: String {
|
|
var eventText: String = ""
|
|
if !self.title.isEmpty {
|
|
eventText = "\(self.title)"
|
|
if !self.subtitle.isEmpty {
|
|
eventText += " - \(self.subtitle)"
|
|
}
|
|
} else if let message = (self.userInfo["aps"] as? [String: Any])?["alert"] as? String {
|
|
eventText = message
|
|
}
|
|
|
|
return L10n.ClientEvents.EventType.Notification.title(eventText)
|
|
}
|
|
}
|