Remove macOS target

This commit is contained in:
Justin Mazzocchi 2020-08-26 21:04:06 -07:00
parent d2e84c984c
commit 0b0548c1de
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C
110 changed files with 528 additions and 1213 deletions

View file

@ -3,6 +3,22 @@
import UIKit import UIKit
extension String { extension String {
private static let HTTPSPrefix = "https://"
func url() throws -> URL {
let url: URL?
if hasPrefix(Self.HTTPSPrefix) {
url = URL(string: self)
} else {
url = URL(string: Self.HTTPSPrefix + self)
}
guard let validURL = url else { throw URLError(.badURL) }
return validURL
}
func countEmphasizedAttributedString(count: Int, highlighted: Bool = false) -> NSAttributedString { func countEmphasizedAttributedString(count: Int, highlighted: Bool = false) -> NSAttributedString {
let countRange = (self as NSString).range(of: String.localizedStringWithFormat("%ld", count)) let countRange = (self as NSString).range(of: String.localizedStringWithFormat("%ld", count))

File diff suppressed because it is too large Load diff

View file

@ -16,7 +16,7 @@
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "D047FA8B24C3E21200AF17C5" BlueprintIdentifier = "D047FA8B24C3E21200AF17C5"
BuildableName = "Metatext.app" BuildableName = "Metatext.app"
BlueprintName = "Metatext (iOS)" BlueprintName = "Metatext"
ReferencedContainer = "container:Metatext.xcodeproj"> ReferencedContainer = "container:Metatext.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
@ -29,26 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES" shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES"> codeCoverageEnabled = "YES">
<Testables> <Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D047FA9B24C3E21200AF17C5"
BuildableName = "Tests iOS.xctest"
BlueprintName = "Tests iOS"
ReferencedContainer = "container:Metatext.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0666A0D24C6737800F3F04B"
BuildableName = "MetatextTests.xctest"
BlueprintName = "MetatextTests"
ReferencedContainer = "container:Metatext.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference <TestableReference
skipped = "NO"> skipped = "NO">
<BuildableReference <BuildableReference
@ -77,7 +57,7 @@
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "D047FA8B24C3E21200AF17C5" BlueprintIdentifier = "D047FA8B24C3E21200AF17C5"
BuildableName = "Metatext.app" BuildableName = "Metatext.app"
BlueprintName = "Metatext (iOS)" BlueprintName = "Metatext"
ReferencedContainer = "container:Metatext.xcodeproj"> ReferencedContainer = "container:Metatext.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
@ -94,7 +74,7 @@
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "D047FA8B24C3E21200AF17C5" BlueprintIdentifier = "D047FA8B24C3E21200AF17C5"
BuildableName = "Metatext.app" BuildableName = "Metatext.app"
BlueprintName = "Metatext (iOS)" BlueprintName = "Metatext"
ReferencedContainer = "container:Metatext.xcodeproj"> ReferencedContainer = "container:Metatext.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>

View file

@ -1,21 +0,0 @@
// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
extension String {
private static let HTTPSPrefix = "https://"
func url() throws -> URL {
let url: URL?
if hasPrefix(Self.HTTPSPrefix) {
url = URL(string: self)
} else {
url = URL(string: Self.HTTPSPrefix + self)
}
guard let validURL = url else { throw URLError(.badURL) }
return validURL
}
}

View file

@ -1,46 +0,0 @@
// Copyright © 2020 Metabolist. All rights reserved.
import SwiftUI
struct RootView: View {
@EnvironmentObject var sceneViewModel: SceneViewModel
@Environment(\.scenePhase) private var scenePhase
var body: some View {
if let identity = sceneViewModel.identity {
mainNavigation(identity: identity)
.onChange(of: scenePhase) {
if case .active = $0 {
sceneViewModel.refreshIdentity()
}
}
.alertItem($sceneViewModel.alertItem)
} else {
addIdentity
}
}
}
private extension RootView {
private func mainNavigation(identity: Identity) -> some View {
#if os(macOS)
return SidebarNavigation(identity: identity)
.frame(minWidth: 900, maxWidth: .infinity, minHeight: 500, maxHeight: .infinity)
#else
return TabNavigation(identity: identity)
#endif
}
private var addIdentity: some View {
AddIdentityView(viewModel: sceneViewModel.addIdentityViewModel())
}
}
#if DEBUG
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
RootView()
.environmentObject(SceneViewModel.development)
}
}
#endif

View file

@ -1,17 +0,0 @@
// Copyright © 2020 Metabolist. All rights reserved.
import SwiftUI
struct LazyView<V: View>: View {
typealias RenderClosure = () -> V
let render: RenderClosure
init(_ render: @autoclosure @escaping RenderClosure) {
self.render = render
}
var body: V {
render()
}
}

Some files were not shown because too many files have changed in this diff Show more