https://github.com/lumaa-dev/probosciskit
A lightweight Mastodon Swift framework, made for iOS and macOS.
https://github.com/lumaa-dev/probosciskit
ios macos mastodon package spm swift
Last synced: 5 months ago
JSON representation
A lightweight Mastodon Swift framework, made for iOS and macOS.
- Host: GitHub
- URL: https://github.com/lumaa-dev/probosciskit
- Owner: lumaa-dev
- License: other
- Created: 2024-06-30T10:35:51.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-18T18:13:59.000Z (over 1 year ago)
- Last Synced: 2025-02-18T04:54:05.753Z (over 1 year ago)
- Topics: ios, macos, mastodon, package, spm, swift
- Language: Swift
- Homepage:
- Size: 227 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ProboscisKit
ProboscisKit is a lightweight Mastodon swift package.
A derivative is used in [Bubble](https://apps.lumaa.fr/app/bubble)
ProboscisKit is fully working, the only missing part is the documentation. Soon to be released...
---
# How to start
To start using ProboscisKit, you will have to import it using Xcode's Swift Package Manager, by going in **File > Add Package Dependencies...**

Then, you can simply paste the [GitHub link](https://github.com/lumaa-dev/ProboscisKit) into the search bar at the top right of the window, and then click on **Copy Dependency**.
Once this is done, congrats! You successfully added ProboscisKit to your project.
## Recognize an instance
To know if a certain URL is a real Mastodon instance or not, you will need to do the following
```swift
func isInstance(_ url: URL) async -> Bool {
let client: Client = .init(server: url)
do {
let instance: Instance = try await client.get(endpoint: Instances.instance)
return true // If the URL wasn't a Mastodon instance, it would throw an error
} catch {
print("\(instanceUrl) Error: \(error)") // It's always good to keep a error log here
return false
}
}
```
---
# Credits
- [Lumaa](https://lumaa.fr/)
- [Dimillian (Thomas Ricouard)](https://github.com/Dimillian)