AD
Boost Your Brand on BlueSky—Exclusive banner space to amplify your reach within the BlueSky community.
BSkyInfo LogoBskyInfo
All ToolsCategoriesCollectionsFeed DirectoryLabeler DirectoryArticlesGuidesGlossaryBluesky SDKsSponsor
Submit
All ToolsCategoriesCollectionsFeed DirectoryLabeler DirectoryGuidesGlossaryArticlesBluesky SDKsSponsorSubmit
  1. SDKs
  2. /Swift
  3. /swift-cbor
nnabeyang

swift-cbor

A Swift SDK for Bluesky and AT Protocol by nnabeyang

swift-cbor is a library of CBOR encoder & decoder for Swift based on Codable.

GitHub Stats

8stars
0forks
1contributors
0open issues

Dates

Created:May 9, 2024
Last updated:March 31, 2025

README

The following content is from swift-cbor's GitHub repository. All rights reserved by the original author.

swift-cbor

swift-cbor is a library of CBOR encoder & decoder for Swift based on Codable.

Usage

import SwiftCbor

struct Coordinate: Codable {
    let latitude: Double
    let longitude: Double
}

struct Landmark: Codable {
    let name: String
    let foundingYear: Int
    let location: Coordinate
}

let input = Landmark(
    name: "Mojave Desert",
    foundingYear: 0,
    location: Coordinate(
        latitude: 35.0110079,
        longitude: -115.4821313
    )
)
let encoder = CborEncoder()
let decoder = CborDecoder()
let data = try! encoder.encode(input)
let out = try! decoder.decode(Landmark.self, from: data)

print([UInt8](data))
// [163, 100, 110, 97, 109, 101, 109, 77, 111, 106,
//  97, 118, 101, 32, 68, 101, 115, 101, 114, 116,
//  108, 102, 111, 117, 110, 100, 105, 110, 103, 89,
//  101, 97, 114, 0, 104, 108, 111, 99, 97, 116,
//  105, 111, 110, 162, 104, 108, 97, 116, 105, 116,
//  117, 100, 101, 251, 64, 65, 129, 104, 180, 245,
//  63, 179, 105, 108, 111, 110, 103, 105, 116, 117,
//  100, 101, 251, 192, 92, 222, 219, 61, 61, 120,
//  49]

print(out)
// Landmark(
//   name: "Mojave Desert",
//   foundingYear: 0,
//   location: example.Coordinate(
//     latitude: 35.0110079,
//     longitude: -115.4821313
//   )
// )

Installation

SwiftPM

Add the SwiftCbor as a dependency:

let package = Package(
    // name, platforms, products, etc.
    dependencies: [
        // other dependencies
        .package(url: "https://github.com/nnabeyang/swift-cbor", from: "0.0.4"),
    ],
    targets: [
        .executableTarget(name: "<executable-target-name>", dependencies: [
            // other dependencies
                .product(name: "SwiftCbor", package: "swift-cbor"),
        ]),
        // other targets
    ]
)

License

swift-cbor is published under the MIT License, see LICENSE.

Author

Noriaki Watanabe@nnabeyang

Related SDKs

kphrxplc-handle-tracker

did:plc & atproto handle tracker

29•Swift
MasterJ93ATProtoKit

A straightforward solution for using AT Protocol and Bluesky, written in Swift.

140•Swift
aaronveghATProtoKit

A straightforward solution for using the AT Protocol and Bluesky, written in Swift.

1•Swift
andooownswift-atproto

Swift package that provides a AT Protocol libraries.

36•Swift
andooownlexicon-gen

CLI tool written in Swift to generate Swift codes from AT Proto's Lexicon files.

11•Swift
cheadSwiftBluesky

A package for interacting with the Bluesky Social API.

4•Swift

Resources

GitHub Repository

License

MIT

Author

nnabeyang
nnabeyang
did:plc:bnh3bvyqr3vzxyvjdnrrusbr

Activity

Last commit: March 31, 2025
Commit frequency: Unknown

Our Sponsors

Your Brand Here!

50K+ engaged viewers every month

Limited spots available!

📧 Contact us via email🦋 Contact us on Bluesky
BSkyInfo LogoBskyInfo

The Most Comprehensive Bluesky Tools Directory

Stay updated with the latest Bluesky tools and ecosystem news 🦋

Bluesky butterfly logo
Quick LinksSubmit a ToolSponsorAboutLegal Information
ToolsFeed DirectoryLabeler DirectorySchedulingAnalyticsAll ToolsCategoriesCollectionsTags
ResourcesArticlesBluesky GuidesBluesky GlossaryBluesky SDKsBluesky ResourcesSkyRaffleMeida Coverage
Our ProductsRaffleBlueAiTeach ToolsLaiewAI affiliate listFirsto

This website may contain affiliate links

© 2025 BskyInfo. All rights reserved.