diff --git a/Package.swift b/Package.swift index c27328b..8d07528 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,13 @@ -// swift-tools-version: 5.8 +// swift-tools-version: 5.5 +// +// This source file is part of the SwiftLibs open source project +// +// Copyright (c) 2023 Röck+Cöde VoF. and the SwiftLibs project authors +// Licensed under the EUPL 1.2 or later. +// +// See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of SwiftLibs project authors +// import PackageDescription @@ -11,10 +20,10 @@ excludePlatforms = [] let package = Package( name: "SwiftLibs", platforms: [ - .iOS(.v13), - .macOS(.v10_15), - .tvOS(.v13), - .watchOS(.v6) + .iOS(.v15), + .macOS(.v12), + .tvOS(.v15), + .watchOS(.v8) ], products: [ .library( @@ -30,7 +39,6 @@ let package = Package( ], dependencies: [], targets: [ - // MARK: Targets .target( name: "Communications", dependencies: [] @@ -52,7 +60,6 @@ let package = Package( name: "Persistence", dependencies: [] ), - // MARK: Test targets .testTarget( name: "CommunicationsTests", dependencies: [ diff --git a/README.md b/README.md index 5b831fe..0a7fdb9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ -
- SwiftLibs logo +
+ + + Shows the hand-drawn SwiftLibs package logo centered in the page. +
# SwiftLibs @@ -16,3 +19,60 @@ To provide further details about the libraries included in this package: * `Core`: extensions we usually add to the base layer functionality and primitive types provided by the [Swift standard library](https://https://www.swift.org/documentation/#standard-library); * `Dependencies`: a ready-to-use, simple [Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection) mechanism that levers heavily on the [dynamic property wrappers](https://www.hackingwithswift.com/plus/intermediate-swiftui/creating-a-custom-property-wrapper-using-dynamicproperty) provided by the [Swift programming language](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/properties/#Projecting-a-Value-From-a-Property-Wrapper); * `Persistence`: protocols, extensions and a ready-to-use fetcher class to simplify the building of the [CoreData](https://developer.apple.com/documentation/coredata) persistence layer; + +## Installation + +It is possible to add this package to other libraries and applications by adding it as a dependency in a `Package.swift` file or in a Xcode project, through the *Package dependencies* interface. + +This package has minimum platform requirements that are important to take into account: +* *iOS 15.0 or higher*; +* *macOS 12.0 or higher*; +* *tvOS 15.0 or higher*; +* *watchOS 8.0 or higher*. + +### Package file + +In the intended `Package.swift` file, it is required to add the following dependency: + +```swift +dependencies: [ + // ... + .package(url: "https://github.com/rock-n-code/swift-libs.git", from: "0.1.3") + // ... +], +``` + +Then it is required to add the package to your target, like this: + +```swift +targets: [ + .target( + // ... + dependencies: [ + .product(name: "SwiftLibs", package: "swift-libs") + ], + // ... + ), +] +``` + +### Xcode + +In an opened Xcode project, it is required to follow these steps to install the package: + +1. click on the Xcode project file in the sidebar to display *Project* and *Targets*; +2. select the project under the *Project* section to show the *Info*, *Build Settings* and *Package Dependencies* options in the center menu just right on top; +3. select the *Package Dependencies* option to show the defined dependencies of the project; +4. press on the *+* (plus) button to add dependencies to the project; +5. enter the URL `https://github.com/rock-n-code/swift-libs.git` into the *Search or Enter Package URL* located in the upper right corner; +6. select the retrieved option; +7. define the dependency rule (the *Up to Next Major Version* option and the *0.1.3* text are recommended); +8. select the target to which the dependency will be applied (if required); +9. wait for the package to be resolved and included in the project; +10. now you should be ready to start using this package! + +### Other considerations + +This library is fully supported on Apple platforms only for the time being: *iOS*, *macOS*, *tvOS*, and *watchOS*. Support for other platforms such as *Linux* or *Windows* might be added in the future, depending on the type of changes those platforms require but this needs to be researched first. + +⚠️ Please notice that this library only supports the [Swift Package Manager](https://www.swift.org/package-manager/), and that support for other dependency managers such as *Cocoapods* and *Carthage* has not been prioritised. diff --git a/Sources/Coordination/Protocols/Router.swift b/Sources/Coordination/Protocols/Router.swift index 121bdfa..4943224 100644 --- a/Sources/Coordination/Protocols/Router.swift +++ b/Sources/Coordination/Protocols/Router.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -#if canImport(UIKit) +#if canImport(UIKit) && !os(watchOS) import UIKit #endif @@ -23,7 +23,7 @@ public protocol Router: AnyObject { // MARK: Functions - #if canImport(UIKit) + #if canImport(UIKit) && !os(watchOS) /// Present a view controller animatedly or not, depending on the given `animated` parameter, and also pass a closure that should be called on dismissal. /// - Parameters: /// - viewController: A `UIViewController` view controller instance to present. @@ -42,7 +42,7 @@ public protocol Router: AnyObject { } -#if canImport(UIKit) +#if canImport(UIKit) && !os(watchOS) // MARK: - Router+Implementations public extension Router { diff --git a/imgs/swiftlibs-logo-dark.svg b/imgs/swiftlibs-logo-dark.svg new file mode 100644 index 0000000..c5a0d53 --- /dev/null +++ b/imgs/swiftlibs-logo-dark.svg @@ -0,0 +1,10 @@ + + + SwiftLibs logo (dark) + + + + + + + \ No newline at end of file diff --git a/imgs/swiftlibs-logo-light.svg b/imgs/swiftlibs-logo-light.svg new file mode 100644 index 0000000..2d8c752 --- /dev/null +++ b/imgs/swiftlibs-logo-light.svg @@ -0,0 +1,10 @@ + + + SwiftLibs logo (light) + + + + + + + \ No newline at end of file diff --git a/swift-libs-logo.svg b/swift-libs-logo.svg deleted file mode 100644 index d4dac44..0000000 --- a/swift-libs-logo.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - Group - - - - - - - - - \ No newline at end of file