Add macOS support (#23)

* Add macOS support

* Update README

* Update to v0.2.0

* Document breaking changes

* Delete widget tests
This commit is contained in:
Ben Hagen
2025-05-13 16:24:58 +02:00
committed by GitHub
parent c391cc5f26
commit abe519dae7
103 changed files with 3444 additions and 169 deletions
+37
View File
@@ -0,0 +1,37 @@
//
// NearbyCommand.swift
// nearby_service
//
// Created by Kseniia Nikitina on 4/2/24.
//
import Foundation
import MultipeerConnectivity
class NearbyStartCommand {
init(id: String, senderName: String, filesCount: Int) {
self.id = id
self.senderName = senderName
self.filesCount = filesCount
}
static func fromUserInfo(userInfo: NearbyUserInfo)-> NearbyStartCommand? {
if let name = userInfo.dictionary["name"] as? String,
let filesCount = userInfo.dictionary["filesCount"] as? Int,
let id = userInfo.dictionary["id"] as? String
{
return NearbyStartCommand(id: id, senderName: name, filesCount: filesCount)
}
return nil
}
func toDictionary() -> [String: Any] {
return ["name": senderName, "filesCount": filesCount, "id": id]
}
let id: String
let senderName: String
let filesCount: Int
}