Files
openhaystack/OpenHaystack/OpenHaystack/HaystackApp/Views/ActivityIndicator.swift
2021-03-08 22:34:45 +01:00

35 lines
847 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// OpenHaystack Tracking personal Bluetooth devices via Apple's Find My network
//
// Copyright © 2021 Secure Mobile Networking Lab (SEEMOO)
// Copyright © 2021 The Open Wireless Link Project
//
// SPDX-License-Identifier: AGPL-3.0-only
import AppKit
import Foundation
import SwiftUI
final class ActivityIndicator: NSViewRepresentable {
init(size: NSControl.ControlSize) {
self.size = size
}
let size: NSControl.ControlSize
typealias NSViewType = NSProgressIndicator
func makeNSView(context: Context) -> NSProgressIndicator {
let indicator = NSProgressIndicator()
indicator.style = .spinning
indicator.controlSize = self.size
indicator.startAnimation(nil)
return indicator
}
func updateNSView(_ nsView: NSProgressIndicator, context: Context) {
}
}