diff --git a/DiscoveryProject/DarkModeDiscovery/Configuration/FirstPartyCode/PDMSupportingStar.swift b/DiscoveryProject/DarkModeDiscovery/Configuration/FirstPartyCode/PDMSupportingStar.swift deleted file mode 100644 index 5a2da8f..0000000 --- a/DiscoveryProject/DarkModeDiscovery/Configuration/FirstPartyCode/PDMSupportingStar.swift +++ /dev/null @@ -1,739 +0,0 @@ -// -// PDMSupportingStar.swift -// Version: 2.0.1 -// -// The Darkness Support Classes (PerseusUISystemKit previously) -// -// -// For iOS and macOS only. Use Stars to adopt for the specifics you need. -// -// Created by Mikhail Zhigulin of Novosibirsk in 7530. -// -// The year starts from the creation of the world according to a Slavic calendar. -// September, the 1st of Slavic year. -// -// -// Unlicensed Free Software -// -// This is free and unencumbered software released into the public domain. -// -// Anyone is free to copy, modify, publish, use, compile, sell, or -// distribute this software, either in source code form or as a compiled -// binary, for any purpose, commercial or non-commercial, and by any -// means. -// -// In jurisdictions that recognize copyright laws, the author or authors -// of this software dedicate any and all copyright interest in the -// software to the public domain. We make this dedication for the benefit -// of the public at large and to the detriment of our heirs and -// successors. We intend this dedication to be an overt act of -// relinquishment in perpetuity of all present and future rights to this -// software under copyright law. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// -// For more information, please refer to -// -// swiftlint:disable file_length -// - -import PerseusDarkMode - -#if canImport(UIKit) -import UIKit -#elseif canImport(Cocoa) -import Cocoa -#endif - -#if os(iOS) -public typealias Color = UIColor -#elseif os(macOS) -public typealias Color = NSColor -#endif - -public func rgba255(_ red: CGFloat, - _ green: CGFloat, - _ blue: CGFloat, - _ alpha: CGFloat = 1.0) -> Color { - return Color(red: red/255, green: green/255, blue: blue/255, alpha: alpha) -} - -public extension Color { - - var RGBA255: (red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat) { - var red: CGFloat = 0 - var green: CGFloat = 0 - var blue: CGFloat = 0 - var alpha: CGFloat = 0 - - getRed(&red, green: &green, blue: &blue, alpha: &alpha) - - return (red*255, green*255, blue*255, alpha) - } -} - -public protocol SemanticColorProtocol { - -// MARK: - FOREGROUND CONTENT - - // MARK: - Label Colors - - /// Label. - /// - /// - Light: 0, 0, 0 - /// - Dark: 255, 255, 255 - static var labelPerseus: Color { get } - - /// Secondary label. - /// - /// - Light: 60, 60, 67, 0.6 - /// - Dark: 235, 235, 245, 0.6 - static var secondaryLabelPerseus: Color { get } - - /// Tertiary label. - /// - /// - Light: 60, 60, 67, 0.3 - /// - Dark: 235, 235, 245, 0.3 - static var tertiaryLabelPerseus: Color { get } - - /// Quaternary label. - /// - /// - Light: 60, 60, 67, 0.18 - /// - Dark: 235, 235, 245, 0.16 - static var quaternaryLabelPerseus: Color { get } - - // MARK: - Text Colors - - /// Placeholder text. - /// - /// - Light: 60, 60, 67, 0.3 - /// - Dark: 235, 235, 245, 0.3 - static var placeholderTextPerseus: Color { get } - - // MARK: - Separator Colors - - /// Separator. - /// - /// - Light: 60, 60, 67, 0.29 - /// - Dark: 84, 84, 88, 0.6 - static var separatorPerseus: Color { get } - - /// Opaque separator. - /// - /// - Light: 198, 198, 200 - /// - Dark: 56, 56, 58 - static var opaqueSeparatorPerseus: Color { get } - - // MARK: - Link Color - - /// Link. - /// - /// - Light: 0, 122, 255 - /// - Dark: 9, 132, 255 - static var linkPerseus: Color { get } - - // MARK: - Fill Colors - - /// System fill. - /// - /// - Light: 120, 120, 128, 0.2 - /// - Dark: 120, 120, 128, 0.36 - static var systemFillPerseus: Color { get } - - /// Secondary system fill. - /// - /// - Light: 120, 120, 128, 0.16 - /// - Dark: 120, 120, 128, 0.32 - static var secondarySystemFillPerseus: Color { get } - - /// Tertiary system fill. - /// - /// - Light: 118, 118, 128, 0.12 - /// - Dark: 118, 118, 128, 0.24 - static var tertiarySystemFillPerseus: Color { get } - - /// Quaternary system fill. - /// - /// - Light: 116, 116, 128, 0.08 - /// - Dark: 118, 118, 128, 0.18 - static var quaternarySystemFillPerseus: Color { get } - -// MARK: - BACKGROUND CONTENT - - // MARK: - Standard - - /// System background. - /// - /// - Light: 255, 255, 255 - /// - Dark: 28, 28, 30 - static var systemBackgroundPerseus: Color { get } - - /// Secondary system background. - /// - /// - Light: 242, 242, 247 - /// - Dark: 44, 44, 46 - static var secondarySystemBackgroundPerseus: Color { get } - - /// Tertiary system background. - /// - /// - Light: 255, 255, 255 - /// - Dark: 58, 58, 60 - static var tertiarySystemBackgroundPerseus: Color { get } - - // MARK: - Grouped - - /// System grouped background. - /// - /// - Light: 242, 242, 247 - /// - Dark: 28, 28, 30 - static var systemGroupedBackgroundPerseus: Color { get } - - /// Secondary system grouped background. - /// - /// - Light: 255, 255, 255 - /// - Dark: 44, 44, 46 - static var secondarySystemGroupedBackgroundPerseus: Color { get } - - /// Tertiary system grouped background. - /// - /// - Light: 242, 242, 247 - /// - Dark: 58, 58, 60 - static var tertiarySystemGroupedBackgroundPerseus: Color { get } -} - -public protocol SystemColorProtocol { - - /// Red is .systemRed - /// - /// - Light: 255, 59, 48 - /// - Dark: 255, 69, 58 - static var perseusRed: Color { get } - - /// Orange is .systemOrange - /// - /// - Light: 255, 149, 0 - /// - Dark: 255, 159, 10 - static var perseusOrange: Color { get } - - /// Yellow is .systemYellow - /// - /// - Light: 255, 204, 0 - /// - Dark: 255, 214, 10 - static var perseusYellow: Color { get } - - /// Green is .systemGreenGreen - /// - /// - Light: 52, 199, 89 - /// - Dark: 48, 209, 88 - static var perseusGreen: Color { get } - - /// Mint is .systemMint - /// - /// - Light: 0, 199, 190 - /// - Dark: 102, 212, 207 - static var perseusMint: Color { get } - - /// Teal is .systemTeal - /// - /// - Light: 48, 176, 199 - /// - Dark: 64, 200, 224 - static var perseusTeal: Color { get } - - /// Cyan is .systemCyan - /// - /// - Light: 50, 173, 230 - /// - Dark: 100, 210, 255 - static var perseusCyan: Color { get } - - /// Blue is .systemBlue - /// - /// - Light: 0, 122, 255 - /// - Dark: 10, 132, 255 - static var perseusBlue: Color { get } - - /// Indigo is .systemIndigo - /// - /// - Light: 88, 86, 214 - /// - Dark: 94, 92, 230 - static var perseusIndigo: Color { get } - - /// Purple is .systemPurple - /// - /// - Light: 175, 82, 222 - /// - Dark: 191, 90, 242 - static var perseusPurple: Color { get } - - /// Pink is .systemPink - /// - /// - Light: 255, 45, 85 - /// - Dark: 255, 55, 95 - static var perseusPink: Color { get } - - /// Brown is .systemBrown - /// - /// - Light: 162, 132, 94 - /// - Dark: 172, 142, 104 - static var perseusBrown: Color { get } - -// MARK: - System Gray Colors - - /// Gray is .systemGray - /// - /// - Light: 142, 142, 147 - /// - Dark: 142, 142, 147 - static var perseusGray: Color { get } - - /// Gray (2) is .systemGray62 - /// - /// - Light: 174, 174, 178 - /// - Dark: 99, 99, 102 - static var perseusGray2: Color { get } - - /// Gray (3) is .systemGray3 - /// - /// - Light: 199, 199, 204 - /// - Dark: 72, 72, 74 - static var perseusGray3: Color { get } - - /// Gray (4) is .systemGray4 - /// - /// - Light: 209, 209, 214 - /// - Dark: 58, 58, 60 - static var perseusGray4: Color { get } - - /// Gray (5) is .systemGray5 - /// - /// - Light: 229, 229, 234 - /// - Dark: 44, 44, 46 - static var perseusGray5: Color { get } - - /// Gray (6) is .systemGray6 - /// - /// - Light: 242, 242, 247 - /// - Dark: 28, 28, 30 - static var perseusGray6: Color { get } -} - -extension Color: SemanticColorProtocol { - - /// .label - public static var labelPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(0, 0, 0) : rgba255(255, 255, 255) - } - - /// .secondaryLabel - public static var secondaryLabelPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(60, 60, 67, 0.6) : rgba255(235, 235, 245, 0.6) - } - - /// .tertiaryLabel - public static var tertiaryLabelPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(60, 60, 67, 0.3) : rgba255(235, 235, 245, 0.3) - } - - /// .quaternaryLabel - public static var quaternaryLabelPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(60, 60, 67, 0.18) : rgba255(235, 235, 245, 0.16) - } - - /// .placeholderText - public static var placeholderTextPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(60, 60, 67, 0.3) : rgba255(235, 235, 245, 0.3) - } - - /// .separator - public static var separatorPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(60, 60, 67, 0.29) : rgba255(84, 84, 88, 0.6) - } - - /// .opaqueSeparator - public static var opaqueSeparatorPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(198, 198, 200) : rgba255(56, 56, 58) - } - - /// .link - public static var linkPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(0, 122, 255) : rgba255(9, 132, 255) - } - - /// .systemFill - public static var systemFillPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(120, 120, 128, 0.2) : rgba255(120, 120, 128, 0.36) - } - - /// .secondarySystemFill - public static var secondarySystemFillPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(120, 120, 128, 0.16) : rgba255(120, 120, 128, 0.32) - } - - /// .tertiarySystemFill - public static var tertiarySystemFillPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(118, 118, 128, 0.12) : rgba255(118, 118, 128, 0.24) - } - - /// .quaternarySystemFill - public static var quaternarySystemFillPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(116, 116, 128, 0.08) : rgba255(118, 118, 128, 0.18) - } - - /// .systemBackground - public static var systemBackgroundPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(255, 255, 255) : rgba255(28, 28, 30) - } - - /// .secondarySystemBackground - public static var secondarySystemBackgroundPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(242, 242, 247) : rgba255(44, 44, 46) - } - - /// .tertiarySystemBackground - public static var tertiarySystemBackgroundPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(255, 255, 255) : rgba255(58, 58, 60) - } - - /// .systemGroupedBackground - public static var systemGroupedBackgroundPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(242, 242, 247) : rgba255(28, 28, 30) - } - - /// .secondarySystemGroupedBackground - public static var secondarySystemGroupedBackgroundPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(255, 255, 255) : rgba255(44, 44, 46) - } - - /// .tertiarySystemGroupedBackground - public static var tertiarySystemGroupedBackgroundPerseus: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(242, 242, 247) : rgba255(58, 58, 60) - } -} - -extension Color: SystemColorProtocol { - - /// .systemRed - public static var perseusRed: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(255, 59, 48) : rgba255(255, 69, 58) - } - - /// .systemOrange - public static var perseusOrange: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(255, 149, 0) : rgba255(255, 159, 10) - } - - /// .systemYellow - public static var perseusYellow: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(255, 204, 0) : rgba255(255, 214, 10) - } - - /// .systemGreen - public static var perseusGreen: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(52, 199, 89) : rgba255(48, 209, 88) - } - - /// .systemMint - public static var perseusMint: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(0, 199, 190) : rgba255(102, 212, 207) - } - - /// .systemTeal - public static var perseusTeal: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(48, 176, 199) : rgba255(64, 200, 224) - } - - /// .systemCyan - public static var perseusCyan: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(50, 173, 230) : rgba255(100, 210, 255) - } - - /// .systemBlue - public static var perseusBlue: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(0, 122, 255) : rgba255(10, 132, 255) - } - - /// .systemIndigo - public static var perseusIndigo: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(88, 86, 214) : rgba255(94, 92, 230) - } - - /// .systemPurple - public static var perseusPurple: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(175, 82, 222) : rgba255(191, 90, 242) - } - - /// .systemPink - public static var perseusPink: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(255, 45, 85) : rgba255(255, 55, 95) - } - - /// .systemBrown - public static var perseusBrown: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(162, 132, 94) : rgba255(172, 142, 104) - } - - /// .systemGray - public static var perseusGray: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(142, 142, 147) : rgba255(142, 142, 147) - } - - /// .systemGray2 - public static var perseusGray2: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(174, 174, 178) : rgba255(99, 99, 102) - } - - /// .systemGray3 - public static var perseusGray3: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(199, 199, 204) : rgba255(72, 72, 74) - } - - /// .systemGray4 - public static var perseusGray4: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(209, 209, 214) : rgba255(58, 58, 60) - } - - /// .systemGray5 - public static var perseusGray5: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(229, 229, 234) : rgba255(44, 44, 46) - } - - /// .systemGray6 - public static var perseusGray6: Color { - return DarkModeAgent.shared.style == .light ? - rgba255(242, 242, 247) : rgba255(28, 28, 30) - } -} - -#if os(iOS) - -@IBDesignable -public class DarkModeImageView: UIImageView { - - @IBInspectable - public var imageLight: UIImage? { - didSet { - light = imageLight - image = DarkMode.style == .light ? light : dark - } - } - - @IBInspectable - public var imageDark: UIImage? { - didSet { - dark = imageDark - image = DarkMode.style == .light ? light : dark - } - } - - private(set) var theDarknessTrigger: DarkModeObserver? - - private(set) var light: UIImage? - private(set) var dark: UIImage? - - override init(frame: CGRect) { - super.init(frame: frame) - configure() - } - - required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - configure() - } - - private func configure() { - theDarknessTrigger = DarkModeObserver { style in - self.image = style == .light ? self.light : self.dark - } - - image = DarkMode.style == .light ? self.light : self.dark - } - - public func configure(_ light: UIImage?, _ dark: UIImage?) { - self.light = light - self.dark = dark - - theDarknessTrigger?.action = { style in - self.image = style == .light ? self.light : self.dark - } - - image = DarkMode.style == .light ? self.light : self.dark - } -} - -#elseif os(macOS) - -public enum ScaleImageViewMacOS: Int, CustomStringConvertible { - - case scaleNone = 0 // No scale at all - case axesIndependently = 1 // Aspect Fill - case proportionallyUpOrDown = 2 // Aspect Fit - case proportionallyDown = 3 // Center Top - case proportionallyClipToBounds = 4 // Aspect Fill with cliping to ImageView bounds - - public var description: String { - switch self { - case .scaleNone: - return "As is, no scaling." - case .axesIndependently: - return "Aspect Fill." - case .proportionallyUpOrDown: - return "Aspect Fit." - case .proportionallyDown: - return "Center Top." - case .proportionallyClipToBounds: - return "Aspect Fill cliped to bounds." - } - } - - public var value: NSImageScaling { - switch self { - case .scaleNone: - return .scaleNone - case .axesIndependently: - return .scaleAxesIndependently - case .proportionallyUpOrDown: - return .scaleProportionallyUpOrDown - case .proportionallyDown: - return .scaleProportionallyDown - case .proportionallyClipToBounds: - return .scaleNone - } - } -} - -@IBDesignable -public class DarkModeImageView: NSImageView { - - @IBInspectable - public var imageLight: NSImage? { - didSet { - image = DarkMode.style == .light ? imageLight : imageDark - } - } - - @IBInspectable - public var imageDark: NSImage? { - didSet { - image = DarkMode.style == .light ? imageLight : imageDark - } - } - - @IBInspectable - public var aspectFillClipToBounds: Bool = false - - public var customScale: ScaleImageViewMacOS = .scaleNone { - didSet { - guard customScale != .proportionallyClipToBounds else { - - self.setContentCompressionResistancePriority(.defaultLow, for: .horizontal) - self.setContentCompressionResistancePriority(.defaultLow, for: .vertical) - - self.aspectFillClipToBounds = true - self.imageScaling = .scaleNone - - return - } - - self.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal) - self.setContentCompressionResistancePriority(.defaultHigh, for: .vertical) - - self.aspectFillClipToBounds = false - self.imageScaling = customScale.value - } - } - - private(set) var theDarknessTrigger: DarkModeObserver? - - override public func awakeFromNib() { - guard aspectFillClipToBounds else { return } - - self.setContentCompressionResistancePriority(.defaultLow, for: .horizontal) - self.setContentCompressionResistancePriority(.defaultLow, for: .vertical) - - self.imageScaling = .scaleNone - } - - override init(frame: CGRect) { - super.init(frame: frame) - configure() - } - - required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - configure() - } - - public func configure(_ light: NSImage?, _ dark: NSImage?) { - configure() - - self.imageLight = light - self.imageDark = dark - } - - private func configure() { - theDarknessTrigger = DarkModeObserver { style in - self.image = style == .light ? self.imageLight : self.imageDark - } - } - - override public func draw(_ dirtyRect: NSRect) { - guard aspectFillClipToBounds, let image = self.image else { - super.draw(dirtyRect) - return - } - - let viewWidth = self.bounds.size.width - let viewHeight = self.bounds.size.height - - let width = image.size.width - let height = image.size.height - - let imageViewRatio = viewWidth / viewHeight - let imageRatio = width / height - - image.size.width = imageRatio < imageViewRatio ? viewWidth : viewHeight * imageRatio - image.size.height = imageRatio < imageViewRatio ? viewWidth / imageRatio : viewHeight - - super.draw(dirtyRect) - } -} - -#endif diff --git a/DiscoveryProject/DarkModeDiscovery/Configuration/FirstPartyCode/PGKSupportingStar.swift b/DiscoveryProject/DarkModeDiscovery/Configuration/FirstPartyCode/PGKSupportingStar.swift deleted file mode 100644 index 88c3f41..0000000 --- a/DiscoveryProject/DarkModeDiscovery/Configuration/FirstPartyCode/PGKSupportingStar.swift +++ /dev/null @@ -1,374 +0,0 @@ -// -// PGKSupportingStar.swift -// Version: 1.0.1 -// -// PerseusGeoKit Support Code -// -// -// For iOS and macOS only. Use Stars to adopt for the specifics you need. -// -// Created by Mikhail Zhigulin of Novosibirsk in 7533. -// -// The year starts from the creation of the world according to a Slavic calendar. -// September, the 1st of Slavic year. -// -// -// Unlicensed Free Software -// -// This is free and unencumbered software released into the public domain. -// -// Anyone is free to copy, modify, publish, use, compile, sell, or -// distribute this software, either in source code form or as a compiled -// binary, for any purpose, commercial or non-commercial, and by any -// means. -// -// In jurisdictions that recognize copyright laws, the author or authors -// of this software dedicate any and all copyright interest in the -// software to the public domain. We make this dedication for the benefit -// of the public at large and to the detriment of our heirs and -// successors. We intend this dedication to be an overt act of -// relinquishment in perpetuity of all present and future rights to this -// software under copyright law. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// -// For more information, please refer to -// -// swiftlint:disable file_length -// - -import ConsolePerseusLogger -import PerseusGeoKit - -#if os(iOS) -import UIKit -#endif -import MapKit - -// MARK: - Geo Constants - -let PREFERED_ACCURACY: GeoAccuracy = .threeKilometers - -let DEFAULT_MAP_POINT = CLLocation(latitude: 55.036857, longitude: 82.914063) -let DEFAULT_MAP_RADIUS: CLLocationDistance = 1000 - -let DEFAULT_VISIBLE_REGION = MKCoordinateRegion(center: DEFAULT_MAP_POINT.coordinate, - latitudinalMeters: DEFAULT_MAP_RADIUS, - longitudinalMeters: DEFAULT_MAP_RADIUS) - -var REDIRECT_ALERT_TITLES = ActionAlertText( - title: "Location Services.", - message: "The Current Location Services Status can be changed in System Services.", - buttonCancel: "OK", - buttonFunction: "System Services") - -extension ActionAlertText { - var titleWithStatus: String { - return "Location Services: \(GeoAgent.currentStatus.description.capitalized)." - } -} - -extension Notification.Name { - static let ReloadGeoDataNotification = Notification.Name("ReloadGeoDataNotification") -} - -#if os(iOS) - -extension UIView { - - func parentViewController() -> UIViewController? { - - guard let responder = self.next as? UIViewController else { - guard let responder = self.next as? UIView else { - return nil - } - - return responder.parentViewController() - } - - return responder - } -} - -#endif - -// MARK: - LocationDealer class - -class LocationDealer { - - // MARK: - iOS Contract - -#if os(iOS) - - public class func requestPermission(_ alertViewController: UIViewController? = nil) { - GeoAgent.shared.requestPermission { status in - if status != .allowed, let parentVC = alertViewController { - REDIRECT_ALERT_TITLES.title = REDIRECT_ALERT_TITLES.titleWithStatus - GeoAgent.showRedirectAlert(parentVC, REDIRECT_ALERT_TITLES) // Offer redirect. - } - } - } - - public class func requestCurrent(_ alertViewController: UIViewController? = nil) { - do { - try GeoAgent.shared.requestCurrentLocation() - } catch LocationError.permissionRequired(let status) { // Permission required. - - log.message("[\(type(of: self))].\(#function) permission required", .notice) - - if status == .notDetermined { - GeoAgent.shared.requestPermission() // Request permission. - } else if let parentVC = alertViewController { - REDIRECT_ALERT_TITLES.title = REDIRECT_ALERT_TITLES.titleWithStatus - GeoAgent.showRedirectAlert(parentVC, REDIRECT_ALERT_TITLES) // Offer redirect. - } - - } catch { - log.message("[\(type(of: self))].\(#function) something went wrong", .error) - } - } - - public class func requestUpdatingLocation(_ alertViewController: UIViewController? = nil) { - do { - try GeoAgent.shared.requestUpdatingLocation() - } catch LocationError.permissionRequired(let status) { // Permission required. - - if status == .notDetermined { - GeoAgent.shared.requestPermission() // Request permission. - } else if let parentVC = alertViewController { - REDIRECT_ALERT_TITLES.title = REDIRECT_ALERT_TITLES.titleWithStatus - GeoAgent.showRedirectAlert(parentVC, REDIRECT_ALERT_TITLES) // Offer redirect. - } - - } catch { - log.message("[\(type(of: self))].\(#function) something went wrong", .error) - } - } - -#elseif os(macOS) - - // MARK: - macOS Contract - - public class func requestPermission() { - GeoAgent.shared.requestPermission { status in - if status != .allowed { - REDIRECT_ALERT_TITLES.title = REDIRECT_ALERT_TITLES.titleWithStatus - GeoAgent.showRedirectAlert(REDIRECT_ALERT_TITLES) // Offer redirect. - } - } - } - - public class func requestCurrent() { - do { - try GeoAgent.shared.requestCurrentLocation() - } catch LocationError.permissionRequired(let status) { // Permission required. - - log.message("[\(type(of: self))].\(#function) permission required", .notice) - - if status == .notDetermined { - GeoAgent.shared.requestPermission() // Request permission. - } else { - REDIRECT_ALERT_TITLES.title = REDIRECT_ALERT_TITLES.titleWithStatus - GeoAgent.showRedirectAlert(REDIRECT_ALERT_TITLES) // Offer redirect. - } - - } catch { - log.message("[\(type(of: self))].\(#function) something went wrong", .error) - } - } - - public class func requestUpdatingLocation() { - do { - try GeoAgent.shared.requestUpdatingLocation() - } catch LocationError.permissionRequired(let status) { // Permission required. - - if status == .notDetermined { - GeoAgent.shared.requestPermission() // Request permission. - } else { - REDIRECT_ALERT_TITLES.title = REDIRECT_ALERT_TITLES.titleWithStatus - GeoAgent.showRedirectAlert(REDIRECT_ALERT_TITLES) // Offer redirect. - } - - } catch { - log.message("[\(type(of: self))].\(#function) something went wrong", .error) - } - } - -#endif - -} - -// MARK: - GeoCoordinator class - -class GeoCoordinator: NSObject { - - // MARK: - Properties - - public var notifier: NotificationCenter? - - public var locationRecieved: ((GeoPoint) -> Void)? - public var locationUpdatesRecieved: (([GeoPoint]) -> Void)? - - public var onStatusAllowed: (() -> Void)? - - // MARK: - Singletone - - public static let shared = GeoCoordinator() - - private override init() { - - log.message("[\(GeoCoordinator.self)].\(#function)", .info) - - super.init() - - GeoAgent.register(self, #selector(locationErrorHandler(_:)), .locationError) - GeoAgent.register(self, #selector(locationStatusHandler(_:)), .locationStatus) - GeoAgent.register(self, #selector(currentLocationHandler(_:)), .currentLocation) - GeoAgent.register(self, #selector(locationUpdatesHandler(_:)), .locationUpdates) - } - - // MARK: - Contract - - public static func register(stakeholder: Any, selector: Selector) { - shared.notifier?.addObserver(stakeholder, - selector: selector, - name: .ReloadGeoDataNotification, - object: nil) - } - - public static func reloadGeoComponents() { - log.message("[\(type(of: self))].\(#function)") - shared.updateGeoComponents() - } - - // MARK: - Implementation - - private func updateGeoComponents() { - log.message("[\(type(of: self))].\(#function)") - self.notifier?.post(name: .ReloadGeoDataNotification, object: nil) - } - - // MARK: - Event Handlers - - @objc private func locationErrorHandler(_ notification: Notification) { - - log.message("[\(type(of: self))].\(#function) [EVENT]") - var errtext = "" - - guard let error = notification.object as? LocationError else { - errtext = "nothing is about error" - log.message("[\(type(of: self))].\(#function) \(errtext)", .error) - return - } - - switch error { - case .failedRequest(let desc, let domain, let code): - if desc.contains("[NOTKNOWN]") { - errtext = "\(desc), domain: \(domain), code: \(code)" - } else { - let domaincode = "domain: \(domain), code: \(code)" - switch code { - case 0: - errtext = "hardware issue: try to tap Wi-Fi in system tray, \(domaincode)" - case 1: - errtext = "permission required, \(domaincode)" - default: - break - } - } - default: - break - } - - log.message("[\(type(of: self))].\(#function) \(errtext)", .error) - } - - @objc private func locationStatusHandler(_ notification: Notification) { - - guard let sysStatus = notification.object as? CLAuthorizationStatus else { - let errtext = "nothing is about status event" - log.message("[\(type(of: self))].\(#function) \(errtext)", .error) - return - } - - let lmStatus = GeoAgent.aboutLocationServices().auth - - if lmStatus != sysStatus { - let statues = "lm status: \(lmStatus), system status: \(sysStatus)" - log.message("[\(type(of: self))].\(#function) \(statues)", .error) - } - - let status = GeoAgent.currentStatus - - log.message("[\(type(of: self))].\(#function) currentStatus: \(status) [EVENT]") - - updateGeoComponents() - - if status == .allowed { - onStatusAllowed?() - } - } - - @objc private func currentLocationHandler(_ notification: Notification) { - - log.message("[\(type(of: self))].\(#function) [EVENT]") - - var errtext = "" - var location: GeoPoint? - - guard let result = notification.object as? Result else { - errtext = "nothing is about location" - log.message("[\(type(of: self))].\(#function) \(errtext)", .error) - return - } - - switch result { - case .success(let point): - location = point - case .failure(let error): - errtext = "\(error)" - } - - if let current = location { - locationRecieved?(current) - } else if !errtext.isEmpty { - log.message("[\(type(of: self))].\(#function) \(errtext)", .error) - } - - updateGeoComponents() - } - - @objc private func locationUpdatesHandler(_ notification: Notification) { - log.message("[\(type(of: self))].\(#function) [EVENT]") - - var errtext = "" - var updates: [GeoPoint]? - - guard let result = notification.object as? Result<[GeoPoint], LocationError> else { - errtext = "nothing is about location updates" - log.message("[\(type(of: self))].\(#function) \(errtext)", .error) - return - } - - switch result { - case .success(let points): - updates = points - case .failure(let error): - errtext = "\(error)" - } - - if let updates = updates { - locationUpdatesRecieved?(updates) - } else if !errtext.isEmpty { - log.message("[\(type(of: self))].\(#function) \(errtext)", .error) - } - - updateGeoComponents() - } -} diff --git a/DiscoveryProject/DarkModeDiscovery/Configuration/Info.plist b/DiscoveryProject/DarkModeDiscovery/Configuration/Info.plist index b270169..0ed5e2e 100644 --- a/DiscoveryProject/DarkModeDiscovery/Configuration/Info.plist +++ b/DiscoveryProject/DarkModeDiscovery/Configuration/Info.plist @@ -19,7 +19,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.1 + 2.4 CFBundleVersion 0 LSRequiresIPhoneOS diff --git a/DiscoveryProject/DarkModeDiscovery/DemoContent/MainScreen/Base.lproj/MainViewController.storyboard b/DiscoveryProject/DarkModeDiscovery/DemoContent/MainScreen/Base.lproj/MainViewController.storyboard index a650cfb..811d704 100644 --- a/DiscoveryProject/DarkModeDiscovery/DemoContent/MainScreen/Base.lproj/MainViewController.storyboard +++ b/DiscoveryProject/DarkModeDiscovery/DemoContent/MainScreen/Base.lproj/MainViewController.storyboard @@ -39,7 +39,7 @@ - + @@ -214,6 +214,11 @@ + + + + + diff --git a/DiscoveryProject/DarkModeDiscovery/DemoContent/MainScreen/DetailsViewController.storyboard b/DiscoveryProject/DarkModeDiscovery/DemoContent/MainScreen/DetailsViewController.storyboard index b218da9..e7bebc6 100644 --- a/DiscoveryProject/DarkModeDiscovery/DemoContent/MainScreen/DetailsViewController.storyboard +++ b/DiscoveryProject/DarkModeDiscovery/DemoContent/MainScreen/DetailsViewController.storyboard @@ -189,7 +189,7 @@ - + @@ -237,6 +237,11 @@ + + + + + diff --git a/DiscoveryProject/DarkModeDiscovery/DemoContent/SemanticTools/SemanticsViewController.storyboard b/DiscoveryProject/DarkModeDiscovery/DemoContent/SemanticTools/SemanticsViewController.storyboard index 5029784..654afe7 100644 --- a/DiscoveryProject/DarkModeDiscovery/DemoContent/SemanticTools/SemanticsViewController.storyboard +++ b/DiscoveryProject/DarkModeDiscovery/DemoContent/SemanticTools/SemanticsViewController.storyboard @@ -103,7 +103,7 @@ - + @@ -212,13 +212,13 @@ - + - + @@ -229,7 +229,7 @@ - + @@ -301,7 +301,7 @@ - + @@ -337,7 +337,7 @@ - + diff --git a/DiscoveryProject/DarkModeDiscovery/main.swift b/DiscoveryProject/DarkModeDiscovery/main.swift index d3d688e..da439eb 100644 --- a/DiscoveryProject/DarkModeDiscovery/main.swift +++ b/DiscoveryProject/DarkModeDiscovery/main.swift @@ -21,41 +21,46 @@ typealias DM_LOG = PerseusDarkMode.PerseusLogger typealias GEO_LOG = PerseusGeoKit.PerseusLogger // swiftlint:enable type_name -// MARK: - The log report +// MARK: - The PerseusDarkMode Logger -func report(_ instance: PerseusDarkMode.LogMessage) { - - let date = instance.localTime.date - let time = instance.localTime.time - - localReport.lastMessage = "[\(date)] [\(time)] \(instance.text)" +func report(_ message: PerseusDarkMode.LogMessage) { + let text = "[\(message.localTime.date)] [\(message.localTime.time)] \(message.text)" + localReport.lastMessage = "SUB_DM: " + text } -func report(_ instance: PerseusGeoKit.LogMessage) { +DM_LOG.customActionOnMessage = report(_:) +DM_LOG.output = .custom +// DM_LOG.turned = .off - let date = instance.localTime.date - let time = instance.localTime.time +// MARK: - The PerseusGeoKit Logger - localReport.lastMessage = "[\(date)] [\(time)] \(instance.text)" +func report(_ message: PerseusGeoKit.LogMessage) { + let text = "[\(message.localTime.date)] [\(message.localTime.time)] \(message.text)" + localReport.lastMessage = "SUB_GEO: " + text } -let localReport = ConsolePerseusLogger.PerseusLogger.Report() +GEO_LOG.customActionOnMessage = report(_:) +GEO_LOG.output = .custom +// GEO_LOG.turned = .off -// MARK: - The logger +// MARK: - The Logger -GEO_LOG.customActionOnMessage = report(_:) -DM_LOG.customActionOnMessage = report(_:) +let localReport = ConsolePerseusLogger.PerseusLogger.Report() log.customActionOnMessage = localReport.report(_:) +log.output = .custom +// log.turned = .off -log.message("The app's start point...", .info) +// MARK: - The start line -// MARK: - The app run +log.message("The start line...", .info) let globals = AppGlobals() - -// Determine the app run purpose let appPurpose: AnyClass = NSClassFromString("TestingAppDelegate") ?? AppDelegate.self +// MARK: - The app's run + +log.message("The app is about to run...", .info) + // Initialize the app object from the purpose UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, nil, NSStringFromClass(appPurpose)) diff --git a/DiscoveryProject/DarkModeDiscoveryTests/Info.plist b/DiscoveryProject/DarkModeDiscoveryTests/Configuration/Info.plist similarity index 96% rename from DiscoveryProject/DarkModeDiscoveryTests/Info.plist rename to DiscoveryProject/DarkModeDiscoveryTests/Configuration/Info.plist index fadf8c5..fd1c621 100644 --- a/DiscoveryProject/DarkModeDiscoveryTests/Info.plist +++ b/DiscoveryProject/DarkModeDiscoveryTests/Configuration/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.0 + 2.4 CFBundleVersion 0 diff --git a/DiscoveryProject/DarkModeDiscoveryTests/TestingAppDelegate.swift b/DiscoveryProject/DarkModeDiscoveryTests/Configuration/TestingAppDelegate.swift similarity index 81% rename from DiscoveryProject/DarkModeDiscoveryTests/TestingAppDelegate.swift rename to DiscoveryProject/DarkModeDiscoveryTests/Configuration/TestingAppDelegate.swift index 043b759..9f77d2f 100644 --- a/DiscoveryProject/DarkModeDiscoveryTests/TestingAppDelegate.swift +++ b/DiscoveryProject/DarkModeDiscoveryTests/Configuration/TestingAppDelegate.swift @@ -24,7 +24,11 @@ class TestingAppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - log.message("Launching with testing matter purpose", .info) + log.output = .standard + + log.message("The app's test bundle start point...", .info) + log.message("Launching with testing matter purpose...", .info) + log.message("[\(type(of: self))].\(#function)") return true diff --git a/DiscoveryProject/DarkModeDiscoveryTests/DarkModeDiscoveryTests.swift b/DiscoveryProject/DarkModeDiscoveryTests/DarkModeDiscoveryTests.swift index 96f6a3f..874f253 100644 --- a/DiscoveryProject/DarkModeDiscoveryTests/DarkModeDiscoveryTests.swift +++ b/DiscoveryProject/DarkModeDiscoveryTests/DarkModeDiscoveryTests.swift @@ -14,10 +14,35 @@ import ConsolePerseusLogger class DarkModeDiscoveryTests: XCTestCase { - // func test_zero() { XCTFail("Tests not yet implemented in \(type(of: self)).") } + override static func setUp() { + super.setUp() - func test_the_first_success() { + log.message("[\(type(of: self))].\(#function)") + + log.marks = true + log.directives = true log.time = true - log.message(#function) + log.owner = true + } + + override static func tearDown() { + super.tearDown() + + log.message("[\(type(of: self))].\(#function)") + } + + /* + + func test_zero() { XCTFail("Tests not yet implemented in \(type(of: self)).") } + + */ + + func test_the_first_success() { + log.message("[\(type(of: self))].\(#function)") + + let isReseted = log.loadConfig(.defaultDebug) + let result = isReseted ? "CPL options loaded." : "Failed to load options!" + + log.message(result) } } diff --git a/DiscoveryProject/TheOneRing.xcodeproj/project.pbxproj b/DiscoveryProject/TheOneRing.xcodeproj/project.pbxproj index 8876472..75691b9 100644 --- a/DiscoveryProject/TheOneRing.xcodeproj/project.pbxproj +++ b/DiscoveryProject/TheOneRing.xcodeproj/project.pbxproj @@ -17,8 +17,6 @@ 2EA971BD2D88798000E564CA /* LocationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EA971BC2D88798000E564CA /* LocationViewController.swift */; }; 2EAC22412E3DD3AE0062A768 /* MessageLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EAC22402E3DD3AE0062A768 /* MessageLabel.swift */; }; 2EC2CAF12E0289F00044F6E9 /* CPLConfig.json in Resources */ = {isa = PBXBuildFile; fileRef = 2EC2CAF02E0289CA0044F6E9 /* CPLConfig.json */; }; - 2EC81B5D2DAB7981004C7AA6 /* PDMSupportingStar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EC81B5C2DAB7981004C7AA6 /* PDMSupportingStar.swift */; }; - 2EDCE1782DCE33BD00CC15A9 /* PGKSupportingStar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EDCE1772DCE33BD00CC15A9 /* PGKSupportingStar.swift */; }; 2EE1B77B2DBE21D400375792 /* PerseusDarkMode in Frameworks */ = {isa = PBXBuildFile; productRef = 2EE1B77A2DBE21D400375792 /* PerseusDarkMode */; }; 2EE1B77E2DBE21E600375792 /* ConsolePerseusLogger in Frameworks */ = {isa = PBXBuildFile; productRef = 2EE1B77D2DBE21E600375792 /* ConsolePerseusLogger */; }; 2EE2C01C2EADEF1C000752AD /* PerseusGeoKit in Frameworks */ = {isa = PBXBuildFile; productRef = 2EE2C01B2EADEF1C000752AD /* PerseusGeoKit */; }; @@ -81,8 +79,6 @@ 2EA971BC2D88798000E564CA /* LocationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationViewController.swift; sourceTree = ""; }; 2EAC22402E3DD3AE0062A768 /* MessageLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageLabel.swift; sourceTree = ""; }; 2EC2CAF02E0289CA0044F6E9 /* CPLConfig.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = CPLConfig.json; sourceTree = ""; }; - 2EC81B5C2DAB7981004C7AA6 /* PDMSupportingStar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PDMSupportingStar.swift; sourceTree = ""; }; - 2EDCE1772DCE33BD00CC15A9 /* PGKSupportingStar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PGKSupportingStar.swift; sourceTree = ""; }; 2EE5FCCF2DD0941E000AC9CD /* UpdatingLocation.gpx */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = UpdatingLocation.gpx; sourceTree = ""; }; 2EEA5B6D2DF6D90700CEDAFE /* TabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarController.swift; sourceTree = ""; }; 4B6B3742298E29B50003AF01 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -158,13 +154,20 @@ path = Location; sourceTree = ""; }; + 2EEA60642F5BFD1E00377219 /* Configuration */ = { + isa = PBXGroup; + children = ( + E09538A527B36E7B00AAAAAA /* Info.plist */, + E09538C027B36ECA00AAAAAA /* TestingAppDelegate.swift */, + ); + path = Configuration; + sourceTree = ""; + }; 4B7EABE8298CC13A0063172D /* FirstPartyCode */ = { isa = PBXGroup; children = ( E03450EF27C368F70071443E /* CustomColors.swift */, E03450F127C36F870071443E /* HelpFunctions.swift */, - 2EC81B5C2DAB7981004C7AA6 /* PDMSupportingStar.swift */, - 2EDCE1772DCE33BD00CC15A9 /* PGKSupportingStar.swift */, 2EAC22402E3DD3AE0062A768 /* MessageLabel.swift */, ); path = FirstPartyCode; @@ -228,9 +231,8 @@ E09538A227B36E7B00AAAAAA /* DarkModeDiscoveryTests */ = { isa = PBXGroup; children = ( + 2EEA60642F5BFD1E00377219 /* Configuration */, E09538A327B36E7B00AAAAAA /* DarkModeDiscoveryTests.swift */, - E09538C027B36ECA00AAAAAA /* TestingAppDelegate.swift */, - E09538A527B36E7B00AAAAAA /* Info.plist */, ); path = DarkModeDiscoveryTests; sourceTree = ""; @@ -474,7 +476,6 @@ 2E8501D72D2660E800C60CD2 /* CurrentLocationPanel.swift in Sources */, E09183C527BD4CEF00475D2B /* SemanticColorsViewController.swift in Sources */, 2EA971BD2D88798000E564CA /* LocationViewController.swift in Sources */, - 2EC81B5D2DAB7981004C7AA6 /* PDMSupportingStar.swift in Sources */, E0FD2D3E27FD915800DC5405 /* SystemColorsViewList.swift in Sources */, E09183C727BD4D4500475D2B /* DynamicsViewController.swift in Sources */, E09183C127BD495500475D2B /* SystemColorsViewController.swift in Sources */, @@ -492,7 +493,6 @@ E03450F227C36F870071443E /* HelpFunctions.swift in Sources */, 2EAC22412E3DD3AE0062A768 /* MessageLabel.swift in Sources */, 4B6B3743298E29B50003AF01 /* AppDelegate.swift in Sources */, - 2EDCE1782DCE33BD00CC15A9 /* PGKSupportingStar.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -711,7 +711,7 @@ BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 6DRVN4F88C; - INFOPLIST_FILE = darkmodediscoveryTests/Info.plist; + INFOPLIST_FILE = darkmodediscoveryTests/configuration/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -733,7 +733,7 @@ BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 6DRVN4F88C; - INFOPLIST_FILE = darkmodediscoveryTests/Info.plist; + INFOPLIST_FILE = darkmodediscoveryTests/configuration/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -786,7 +786,7 @@ repositoryURL = "https://github.com/perseusrealdeal/PerseusDarkMode"; requirement = { kind = exactVersion; - version = 2.1.1; + version = 2.2.0; }; }; 2EE1B77C2DBE21E600375792 /* XCRemoteSwiftPackageReference "ConsolePerseusLogger" */ = { @@ -794,7 +794,7 @@ repositoryURL = "https://github.com/perseusrealdeal/ConsolePerseusLogger"; requirement = { kind = exactVersion; - version = 1.7.0; + version = 1.7.1; }; }; 2EE2C01A2EADEF1C000752AD /* XCRemoteSwiftPackageReference "PerseusGeoKit" */ = { @@ -802,7 +802,7 @@ repositoryURL = "https://github.com/perseusrealdeal/PerseusGeoKit"; requirement = { kind = exactVersion; - version = 1.1.1; + version = 1.2.1; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/README.md b/README.md index a32b5ff..d8cd26f 100644 --- a/README.md +++ b/README.md @@ -1,107 +1,234 @@ -# iOS discovery project — Xcode 14.2+ +
+ +The fan iOS app +== + +__Discovery project__ [![Actions Status](https://github.com/perseusrealdeal/theonering/actions/workflows/main.yml/badge.svg)](https://github.com/perseusrealdeal/theonering/actions/workflows/main.yml) [![Style](https://github.com/perseusrealdeal/theonering/actions/workflows/swiftlint.yml/badge.svg)](https://github.com/perseusrealdeal/theonering/actions/workflows/swiftlint.yml) -![Version](https://img.shields.io/badge/Version-2.3-green.svg) +[![Version](https://img.shields.io/badge/Version-2.4-green.svg)](/CHANGELOG.md) + [![Platforms](https://img.shields.io/badge/Platform-iOS%2012.4+-orange.svg)](https://en.wikipedia.org/wiki/IOS_12) [![Xcode](https://img.shields.io/badge/Xcode-14.2+-red.svg)](https://en.wikipedia.org/wiki/Xcode) [![Swift](https://img.shields.io/badge/Swift-5-orange.svg)](https://docs.swift.org/swift-book/RevisionHistory/RevisionHistory.html) [![SDK](https://img.shields.io/badge/SDK-UIKit%20-blueviolet.svg)](https://developer.apple.com/documentation/uikit) -[![License](http://img.shields.io/:License-Unlicense-green.svg)](/LICENSE) -> This is a great fan iOS app themed with the Middle-earth adventures from the motion picture `The Lord of The Rings` based on the novel by `J.R.R. Tolkien`. +[![PackageManager](http://img.shields.io/:PackageManager-SwiftPM-green.svg)](https://docs.swift.org/swiftpm/documentation) +[![ConsolePerseusLogger](http://img.shields.io/:ConsolePerseusLogger-1.7.1-green.svg)](https://github.com/perseusrealdeal/ConsolePerseusLogger.git) +[![PerseusDarkMode](http://img.shields.io/:PerseusDarkMode-2.2.0-green.svg)](https://github.com/perseusrealdeal/PerseusDarkMode.git) +[![PerseusGeoKit](http://img.shields.io/:PerseusGeoKit-1.2.1-green.svg)](https://github.com/perseusrealdeal/PerseusGeoKit.git) + +[`A3 Environment`](/APPROBATION.md) • [`Unlicense`](/LICENSE) + +
+ +--- + +Contents +== + +* [Announcement](#Announcement) + * [Our terms](#Our-terms) + * [The why](#The-why) + * [Preview material](#Preview-material) + * [Top features](#Top-features) +* [Requirements](#Requirements) +* [First-party software](#First-party-software) +* [Third-party software](#Third-party-software) +* [Account points](#Account-points) +* [License](#License) + * [Other required licenses details](#Other-required-licenses-details) +* [Credits](#Credits) +* [Contributing](#Contributing) +* [Prepared by](#Prepared-by) + * [Contact](#Contact) -> For details: [`Approbation and A3 Environment`](/APPROBATION.md). +--- -## Dependencies +Announcement +== -> Swift Package Manager. +The fan iOS app in the Middle-earth theme with screens from the motion picture `The Lord of The Rings` based on the novel by `J.R.R. Tolkien`. -[![ConsolePerseusLogger](http://img.shields.io/:ConsolePerseusLogger-1.7.0-green.svg)](https://github.com/perseusrealdeal/ConsolePerseusLogger.git) -[![PerseusDarkMode](http://img.shields.io/:PerseusDarkMode-2.1.1-green.svg)](https://github.com/perseusrealdeal/PerseusDarkMode.git) -[![PerseusGeoKit](http://img.shields.io/:PerseusGeoKit-1.1.1-green.svg)](https://github.com/perseusrealdeal/PerseusGeoKit.git) +Our Terms +-- -## Our Terms +| Acronym | Stands for | +| :-----: | --------------------------------------------------------------------------------------------------------- | +| CPL | [Console_Perseus_Logger](https://github.com/perseusrealdeal/ConsolePerseusLogger.git) | +| PDM | [Perseus_Dark_Mode](https://github.com/perseusrealdeal/PerseusDarkMode.git) | +| PGK | [Perseus_Geo_Kit](https://github.com/perseusrealdeal/PerseusGeoKit.git) | +| A3 | [Apple_Apps_Approbation](https://docs.google.com/document/d/1K2jOeIknKRRpTEEIPKhxO2H_1eBTof5uTXxyOm5g6nQ) | +| T3 | [The_Technological_Tree](https://github.com/perseusrealdeal/TheTechnologicalTree) | +| P2P | Person_to_Person | -> [`CPL`](https://github.com/perseusrealdeal/ConsolePerseusLogger.git) stands for `C`onsole `P`erseus `L`ogger.
-> [`PGK`](https://github.com/perseusrealdeal/PerseusGeoKit.git) stands for `P`erseus `G`eo `K`it.
-> [`PDM`](https://github.com/perseusrealdeal/PerseusDarkMode.git) stands for `P`erseus `D`ark `M`ode.
-> `P2P` stands for `P`erson-`to`-`P`erson.
-> [`A3`](https://docs.google.com/document/d/1K2jOeIknKRRpTEEIPKhxO2H_1eBTof5uTXxyOm5g6nQ) stands for `A`pple `A`pps `A`pprobation.
-> [`T3`](https://github.com/perseusrealdeal/TheTechnologicalTree) stands for `T`he `T`echnological `T`ree. +The why +-- -## Build system requirements +This app serves the only one purpose —— the first-party `software approbation`, but also and the third. -- [macOS Monterey 12.7.6+](https://apps.apple.com/by/app/macos-monterey/id1576738294) / [Xcode 14.2+](https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_14.2/Xcode_14.2.xip) +Preview material +-- -# In brief + -| Main Screen Light | Main Screen Dark | Colors Screen Light | Colors Screen Dark | -| :--------------------: | :----------------------: | :-------------------: | :---------------------: | -| | | | | + + + + + + + + + + + + + +
Main Screen DarkMain Screen LightColors Screen DarkColors Screen Light
+ + + + + + + +
> [!IMPORTANT] > The screenshot scenes taken from the motion picture `The Lord of The Rings` based on the novel by `J.R.R. Tolkien`. -# First-party software + + +Top features +-- + +- `Geo:` Current Location, Location Updates, Map Screen +- `Dark Mode:` Light, Dark, Auto +- `Colors:` Color in details, Color converter RGBA <> HEX + +Requirements +== + +`To build:` -| Type | Name | License | -| ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -| Package | [ConsolePerseusLogger](https://github.com/perseusrealdeal/ConsolePerseusLogger) / [1.7.0](https://github.com/perseusrealdeal/ConsolePerseusLogger/releases/tag/1.7.0) | MIT | -| Package | [PerseusDarkMode](https://github.com/perseusrealdeal/PerseusDarkMode) / [2.1.1](https://github.com/perseusrealdeal/PerseusDarkMode/releases/tag/2.1.1) | MIT | -| Package | [PerseusGeoKit](https://github.com/perseusrealdeal/PerseusGeoKit) / [1.1.1](https://github.com/perseusrealdeal/PerseusGeoKit/releases/tag/1.1.1) | MIT | +- [macOS Monterey 12.7.6+](https://apps.apple.com/by/app/macos-monterey/id1576738294) +- [Xcode 14.2+](https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_14.2/Xcode_14.2.xip) -# Third-party software +First-party software +== -| Type | Name | License | -| ------ | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | -| Style | [SwiftLint](https://github.com/realm/SwiftLint) / [v0.57.0 for Monterey+](https://github.com/realm/SwiftLint/releases/tag/0.57.0) | MIT | -| Action | [mxcl/xcodebuild@v3](https://github.com/mxcl/xcodebuild) | [Unlicense](https://unlicense.org) | -| Action | [cirruslabs/swiftlint-action@v1](https://github.com/cirruslabs/swiftlint-action/) | MIT | +| Type | Name | License | +| -------- | --------------------------------------------------------------------------------------------------------- | :-----: | +| Package | [ConsolePerseusLogger v1.7.1](https://github.com/perseusrealdeal/ConsolePerseusLogger/releases/tag/1.7.1) | MIT | +| Package | [PerseusDarkMode v2.2.0](https://github.com/perseusrealdeal/PerseusDarkMode/releases/tag/2.2.0) | MIT | +| Package | [PerseusGeoKit v1.2.1](https://github.com/perseusrealdeal/PerseusGeoKit/releases/tag/1.2.1) | MIT | +| Class | [MessageLabel](https://gist.github.com/PerseusRealDeal/dbfed6e01ed80be084983738ba713654) | MIT | + +Third-party software +== + +| Type | Name | License | +| ------ | ------------------------------------------------------------------------------------- | :--------------------------------: | +| Style | [SwiftLint v0.57.0 Monterey+](https://github.com/realm/SwiftLint/releases/tag/0.57.0) | MIT | +| Action | [mxcl/xcodebuild@v3](https://github.com/mxcl/xcodebuild) | [Unlicense](https://unlicense.org) | +| Action | [cirruslabs/swiftlint-action@v1](https://github.com/cirruslabs/swiftlint-action/) | MIT | | Class | [HexColorConverter](/DiscoveryProject/DarkModeDiscovery/Configuration/ThirdPartyCode/HexColorConverter.swift) - extracted, edited from [UIColor-Hex-Swift](https://github.com/yeahdongcn/UIColor-Hex-Swift) | MIT | -# Unlicensed Free Software +Account points +== + +- Explicit start point [main.swift](/DiscoveryProject/DarkModeDiscovery/main.swift) +- Explicit app delegate [TestingAppDelegate.swift](/DiscoveryProject/DarkModeDiscoveryTests/Configuration/TestingAppDelegate.swift) +- Explicit app globals [AppGlobals.swift](/DiscoveryProject/DarkModeDiscovery/AppGlobals.swift) +- [A3 environment specification](/APPROBATION.md) +- [GitHub CI build & test](/.github/workflows/main.yml) +- [GitHub CI SwiftLint](/.github/workflows/swiftlint.yml) +- [SwiftLint Rules](/DiscoveryProject/.swiftlint.yml) +- [Git Config](/.gitignore) +- SwiftLint shell script as a build phase, SwiftLint preinstallation required + +License +== -[`License doc`](/LICENSE) for details. +__Unlicensed Free Software__, see [LICENSE](/LICENSE) for details. -## Required License Notices +The project has been started in 7530 by `Mikhail A. Zhigulin of Novosibirsk`.
-© Mikhail A. Zhigulin of Novosibirsk **for** ConsolePerseusLogger, PerseusDarkMode, PerseusGeoKit
-© PerseusRealDeal **for** ConsolePerseusLogger, PerseusDarkMode, PerseusGeoKit
+- The year starts from the creation of the world according to a Slavic calendar. +- September, the 1st of Slavic year. For instance, "Sep 01, 2025" is the beginning of 7534. + +Other required licenses details +-- + +© Mikhail A. Zhigulin of Novosibirsk **for** ConsolePerseusLogger, PerseusDarkMode, PerseusGeoKit, MessageLabel
+© PerseusRealDeal **for** ConsolePerseusLogger, PerseusDarkMode, PerseusGeoKit, MessageLabel
© 2025 The SwiftLint Contributors **for** SwiftLint
© GitHub **for** GitHub Action cirruslabs/swiftlint-action@v1
© 2014 R0CKSTAR **for** UIColor-Hex-Swift
-# Credits +Credits +== - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +
Balance and Controlkept byMikhail A. Zhigulin
Source Codewritten byMikhail A. Zhigulin
Documentationprepared byMikhail A. Zhigulin
Product Approbationtested byMikhail A. Zhigulin
Balance and ControlMikhail Zhigulin
Source CodeMikhail Zhigulin
DocumentationMikhail Zhigulin
ApprobationMikhail Zhigulin
EnglishMikhail Zhigulin
-- Language support: [Reverso](https://www.reverso.net/) +- Language support: [Reverso](https://www.reverso.net/) - Git clients: [SmartGit](https://syntevo.com/) and [GitHub Desktop](https://github.com/apps/desktop) -# Prepared by +Contributing +== + +> [!NOTE] +> The product is constructed in `P2P` relationship paradigm that means the only one single and the same face in the product team during all preparation process. + +`Bug reports are welcome`, create an issue and give details. + +Prepared by +== + +
+ +`© Mikhail A. Zhigulin of Novosibirsk` + +
+ +Contact +-- + +
+ +[E-mail](mailto:mzhigulin@gmail.com) • [Telegram](https://t.me/velociraptor1985) • [GitHub](https://github.com/perseusrealdeal) -> © Mikhail A. Zhigulin of Novosibirsk. +