Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jacksonrakena/abyssalkit
My extensions and utilities for Swift and SwiftUI
https://github.com/jacksonrakena/abyssalkit
hacktoberfest
Last synced: about 11 hours ago
JSON representation
My extensions and utilities for Swift and SwiftUI
- Host: GitHub
- URL: https://github.com/jacksonrakena/abyssalkit
- Owner: jacksonrakena
- Created: 2020-10-05T07:57:19.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-25T07:38:55.000Z (about 4 years ago)
- Last Synced: 2024-11-05T11:21:47.140Z (about 2 months ago)
- Topics: hacktoberfest
- Language: Swift
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AbyssalKit
My extensions and utilities for Swift and SwiftUI. You can add this to your projects by adding it with Swift Package Manager in Xcode.
### 🔨 Contents
- `Direction` enum with values `forward`, `nearest`, `back`
- Extensions to the date/time models
- Commonly used date formats (English/New Zealand)
- `DateFormats.longDate = "EEEE, MMM d, yyyy"`
- `DateFormats.time = "h:mm aa"`
- `Date#asLongDateString` converts self to a string with `DateFormats.longDate`
- `Date#asTimeString` converts self to a string with `DateFormats.time`
- `Date#string(String)` converts self to a string using the provided format string
- `Date#getWeekday(Direction)` finds the nearest date that's a weekday (M-F) using the provided direction
- If self is already a weekday, it will return itself
- `forward` will return the next Monday if self is Saturday or Sunday
- `nearest` will return Monday if self is Sunday, and the previous Friday if self is a Saturday
- `back` will return the previous Friday if self is a Saturday or Sunday
- `String#date(String)` is essentially the reverse of `Date#string(String)`
- `String#asPcsDate` is a niche method that converts the string to a date using the format `DD/MM/YYYY`
- `String#randomUIColor` generates a random `UIColor` using `self` as a seed
- `String#randomColor` generates a SwiftUI `Color` object from `String#randomUIColor` with opacity `1`
- Extensions to `UIColor`
- `UIColor#init?(String)` generates a `UIColor` object from a hex colour string
- `UIColor#toHexString` does the reverse of the above
- `UIColor#toHSBComponents` returns a `(CGFloat, CGFloat, CGFloat)` representing hue, saturation, and brightness
- `hueComponent`, `saturationComponent`, and `brightnessComponent` are `CGFloat` variables representing the above
### License
MIT