Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itztravelintime/swiftpackagesbase
A Swift Library containing useful code for Any Swift project.
https://github.com/itztravelintime/swiftpackagesbase
cross-platform ios ipados linux macos swift swift-package-manager tvos utility-library watchos
Last synced: 13 days ago
JSON representation
A Swift Library containing useful code for Any Swift project.
- Host: GitHub
- URL: https://github.com/itztravelintime/swiftpackagesbase
- Owner: ITzTravelInTime
- License: lgpl-2.1
- Created: 2022-05-31T15:29:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-11T07:18:54.000Z (over 1 year ago)
- Last Synced: 2024-11-24T14:02:13.876Z (about 1 month ago)
- Topics: cross-platform, ios, ipados, linux, macos, swift, swift-package-manager, tvos, utility-library, watchos
- Language: Swift
- Homepage:
- Size: 109 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SwiftPackagesBase
A Swift Library containing useful code for Any Swift project.## Features
- Many useful extensins for `String`, `Array` and more!
- The `SimulatableDetectable` family of protocols which allows for automated types of value fetching.
- The `FetchingProtocol` family of protcols which allows for a stanadard interface for value fetching.
- Extensions to the basic data types for easy type conversions.Here are some examples for some features:
**SimulatableDetectable**:
- A set of protocols for objects that needs to have simulated debug states.
Example usage:```swift
import SwiftPackagesBase
class Foo: SimulatableDetectable{
///if this property is nil the `actualStatus` property will be returned by the `status` propert, otherwise that will return the value of this property
static var simulatedStatus: Bool? = nil
///Returns the actual status
static func calculateStatus() -> Bool{
return false
}
///Initializer for compliance with the protocol
public required init(){ }
}print("Testing Foo status: ")
print("Foo status: \(Foo.status)") //returns false
print("Foo actual status: \(Foo.actualStatus)") //returns falseprint("Simulating a new status")
Foo.simulatedStatus = trueprint("Foo status: \(Foo.status)") //returns true
print("Foo actual status: \(Foo.actualStatus)") //returns falseprint("Foo testing is complete")
```
## What apps/programs is this Library intended for?
This library should be used by Swift apps/programs or libraries that needs the code provvided here.
This code should work across multiple platforms compatible with Swift and that provvides the necessary function calls using the Foundation module.
## About the project:
This code was created as part of my [TINU project](https://github.com/ITzTravelInTime/TINU) and it has been separated and made into it's own library to make the main project's source less complex and more focused on it's aim.
Also having this as it's own library allows for code to be updated separately and so various versions of the main TINU app will be able to be compiled all with the latest version of this library.
## Credits:
- ITzTravelInTime (Pietro Caruso) - Project creator and main developer.
## Contacts
- ITzTravelInTime (Pietro Caruso, project creator): [email protected]
## Legal info
A Swift Library containing useful utilities code for Any Swift project.
Copyright (C) 2022 Pietro CarusoThis library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA