Skip to content

Commit

Permalink
Drop tvOS, watchOS support and support 'navigationDestination' modifi…
Browse files Browse the repository at this point in the history
…er in iOS15. (#42)

* drop tvOS and watchOS support
add swiftui-navigation dependency

* fix tests for macOS

* add '.navigationDestination'  modifier for iOS15.

* update copyright

Co-authored-by: Oguz Yuksel <[email protected]>
  • Loading branch information
OguzYuuksel and Oguz Yuksel authored Jan 26, 2023
1 parent ed3555d commit 2aad724
Show file tree
Hide file tree
Showing 45 changed files with 329 additions and 243 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Lautsprecher Teufel GmbH
Copyright (c) 2023 Lautsprecher Teufel GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
36 changes: 36 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@
"version": "6.2.0"
}
},
{
"package": "swift-case-paths",
"repositoryURL": "https://github.com/pointfreeco/swift-case-paths",
"state": {
"branch": null,
"revision": "c3a42e8d1a76ff557cf565ed6d8b0aee0e6e75af",
"version": "0.11.0"
}
},
{
"package": "swift-custom-dump",
"repositoryURL": "https://github.com/pointfreeco/swift-custom-dump",
"state": {
"branch": null,
"revision": "ead7d30cc224c3642c150b546f4f1080d1c411a8",
"version": "0.6.1"
}
},
{
"package": "SnapshotTesting",
"repositoryURL": "https://github.com/pointfreeco/swift-snapshot-testing.git",
Expand All @@ -46,6 +64,15 @@
"version": "0.8.9"
}
},
{
"package": "swiftui-navigation",
"repositoryURL": "https://github.com/pointfreeco/swiftui-navigation.git",
"state": {
"branch": null,
"revision": "bf0fb9d53019cbde1a1e0cf290b560a0a0411282",
"version": "0.6.0"
}
},
{
"package": "TestingExtensions",
"repositoryURL": "https://github.com/SwiftRex/TestingExtensions.git",
Expand All @@ -54,6 +81,15 @@
"revision": "a756fadb92e1871a26f24369b7b00435c050aa14",
"version": "0.2.11"
}
},
{
"package": "xctest-dynamic-overlay",
"repositoryURL": "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state": {
"branch": null,
"revision": "16b23a295fa322eb957af98037f86791449de60f",
"version": "0.8.1"
}
}
]
},
Expand Down
15 changes: 11 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,30 @@ import PackageDescription

let package = Package(
name: "UIExtensions",
platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6)],
platforms: [.macOS(.v10_15), .iOS(.v13)],
products: [
.library(name: "UIExtensions", targets: ["UIExtensions"]),
.library(name: "UIExtensionsDynamic", type: .dynamic, targets: ["UIExtensions"]),
],
dependencies: [
.package(url: "https://github.com/teufelaudio/FoundationExtensions.git", .exact("0.1.20")),
.package(url: "https://github.com/SwiftRex/TestingExtensions.git", .upToNextMajor(from: "0.2.7"))
.package(url: "https://github.com/SwiftRex/TestingExtensions.git", .upToNextMajor(from: "0.2.7")),
.package(url: "https://github.com/pointfreeco/swiftui-navigation.git", .upToNextMajor(from: "0.6.0"))
],
targets: [
.target(
name: "UIExtensions",
dependencies: [.product(name: "FoundationExtensions", package: "FoundationExtensions")]
dependencies: [
.product(name: "FoundationExtensions", package: "FoundationExtensions"),
.product(name: "SwiftUINavigation", package: "swiftui-navigation"),
]
),
.target(
name: "UIExtensionsDynamic",
dependencies: [.product(name: "FoundationExtensionsDynamic", package: "FoundationExtensions")]
dependencies: [
.product(name: "FoundationExtensionsDynamic", package: "FoundationExtensions"),
.product(name: "SwiftUINavigation", package: "swiftui-navigation"),
]
),
.testTarget(name: "UIExtensionsTests", dependencies: ["TestingExtensions", "UIExtensions"]),
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2021 Lautsprecher Teufel GmbH. All rights reserved.
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

import SwiftUI

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2021 Lautsprecher Teufel GmbH. All rights reserved.
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

import SwiftUI

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2021 Lautsprecher Teufel GmbH. All rights reserved.
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

import CoreGraphics
import Foundation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// GeometryPreferenceReporter.swift
// UIExtensions
//
// Created by Luis Reisewitz on 01.10.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

import SwiftUI

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// HorizontalSizeClassView.swift
// UIExtensions
//
// Created by Luiz Rodrigo Martins Barbosa on 22.05.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

import SwiftUI

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// MultipleSpacer.swift
// UIExtensions
//
// Created by Luiz Rodrigo Martins Barbosa on 15.04.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

import SwiftUI

Expand Down
28 changes: 28 additions & 0 deletions Sources/UIExtensions/Components/SwiftUI/Pure/NavigationStack.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

import SwiftUI

struct NavigationStack<Content: View>: View {
private let content: () -> Content

init(@ViewBuilder _ content: @escaping () -> Content) {
self.content = content
}

var body: some View {
if #available(iOS 16, macOS 13, tvOS 16, watchOS 9, *) {
SwiftUI.NavigationStack {
content()
}
} else {
// FIXME: If you deeplink more than two level, navigation will stay at the second level.
// This is a known `NavigationLink` bug.
NavigationView {
content()
}
#if os(iOS)
.navigationViewStyle(.stack)
#endif
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// PageControlDotsView.swift
// UIExtensions
//
// Created by Thomas Mellenthin on 29.03.21.
// Copyright © 2021 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

import SwiftUI

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// AttributedText.swift
// UIExtensions
//
// Created by Luiz Barbosa on 25.11.19.
// Copyright © 2019 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

#if canImport(UIKit)
import SwiftUI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// PageControlView.swift
// UIExtensions
//
// Created by Luiz Rodrigo Martins Barbosa on 10.06.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

#if canImport(UIKit)
import SwiftUI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// PageView.swift
// UIExtensions
//
// Created by Luis Reisewitz on 20.01.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

#if canImport(UIKit)
import FoundationExtensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// PagingScrollView.swift
// UIExtensions
//
// Created by Luis Reisewitz on 21.01.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

#if canImport(UIKit)
import FoundationExtensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// SafariView.swift
// UIExtensions
//
// Created by Luis Reisewitz on 14.02.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

#if canImport(UIKit) && canImport(SafariServices)
import SafariServices
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// ScrollableView.swift
// UIExtensions
//
// Created by Luis Reisewitz on 24.03.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

#if canImport(UIKit)
import SwiftUI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// ShareSheetView.swift
// UIExtensions
//
// Created by Luiz Rodrigo Martins Barbosa on 08.12.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

#if canImport(UIKit)
import SwiftUI
Expand Down
8 changes: 1 addition & 7 deletions Sources/UIExtensions/Environment/DisableAnimations.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// DisableAnimations.swift
// Components
//
// Created by Luiz Barbosa on 09.01.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

import Foundation
import SwiftUI
Expand Down
8 changes: 1 addition & 7 deletions Sources/UIExtensions/Environment/DisableKerning.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// DisableKerning.swift
// Components
//
// Created by Luis Reisewitz on 06.05.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

import SwiftUI

Expand Down
8 changes: 1 addition & 7 deletions Sources/UIExtensions/Extensions/Binding+Debug.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// Binding+Debug.swift
// UIExtensions
//
// Created by Luis Reisewitz on 11.12.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

// The following additions are only to be used in Debug mode.
#if DEBUG && canImport(SwiftUI)
Expand Down
8 changes: 1 addition & 7 deletions Sources/UIExtensions/Extensions/Binding+Optional.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// Binding+ToOptional.swift
// UIExtensions
//
// Created by Luiz Rodrigo Martins Barbosa on 14.09.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

import SwiftUI

Expand Down
9 changes: 2 additions & 7 deletions Sources/UIExtensions/Extensions/CGPoint+SwiftUI.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
//
// CGPoint+SwiftUI.swift
// UIExtensions
//
// Created by Luis Reisewitz on 29.01.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

#if canImport(SwiftUI)

import CoreGraphics
Expand Down
8 changes: 1 addition & 7 deletions Sources/UIExtensions/Extensions/CGSize+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// CGSize+Extensions.swift
// UIExtensions
//
// Created by Luis Reisewitz on 22.06.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

import CoreGraphics

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// GeometryProxy+Extensions.swift
// UIExtensions
//
// Created by Luis Reisewitz on 22.01.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

import SwiftUI

Expand Down
8 changes: 1 addition & 7 deletions Sources/UIExtensions/Extensions/Spacer+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// Spacer+Extensions.swift
// UIExtensions
//
// Created by Luiz Rodrigo Martins Barbosa on 29.04.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

import Foundation
import SwiftUI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// UIRectCorner+Extensions.swift
// UIExtensions
//
// Created by Luis Reisewitz on 16.01.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

#if canImport(UIKit)
import UIKit
Expand Down
8 changes: 1 addition & 7 deletions Sources/UIExtensions/Extensions/View+Debug.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// View+Debug.swift
// UIExtensions
//
// Created by Luis Reisewitz on 11.12.20.
// Copyright © 2020 Lautsprecher Teufel GmbH. All rights reserved.
//
// Copyright © 2023 Lautsprecher Teufel GmbH. All rights reserved.

// The following additions are only to be used in Debug mode.
#if DEBUG && canImport(SwiftUI)
Expand Down
Loading

0 comments on commit 2aad724

Please sign in to comment.