mirror of
https://github.com/home-assistant/iOS.git
synced 2026-02-04 21:15:17 -06:00
Adds new fastlane lanes: - `fastlane lint` which checks the linters - `fastlane autocorrect` which applies the linters which can autocorrect (Rubocop, SwiftFormat) Adds a build step to the Codegen abstract target which runs SwiftFormat in lint mode, pointing out what it's going to change when run. Applies SwiftFormat to nearly all code -- exempts a few externally-sourced files and generated code.
31 lines
972 B
Swift
31 lines
972 B
Swift
import Foundation
|
|
import Shared
|
|
import UIKit
|
|
|
|
/// View controller responsible for displaying the details of a client event.
|
|
class ClientEventPayloadViewController: UIViewController {
|
|
@IBOutlet var textView: UITextView!
|
|
private var jsonString: String?
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
|
|
navigationItem.rightBarButtonItems = [
|
|
UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(share(_:))),
|
|
]
|
|
textView.text = jsonString
|
|
}
|
|
|
|
@objc private func share(_ sender: UIBarButtonItem) {
|
|
let controller = UIActivityViewController(activityItems: [jsonString ?? "?"], applicationActivities: nil)
|
|
with(controller.popoverPresentationController) {
|
|
$0?.barButtonItem = sender
|
|
}
|
|
present(controller, animated: true, completion: nil)
|
|
}
|
|
|
|
func showEvent(_ event: ClientEvent) {
|
|
jsonString = event.jsonPayloadDescription
|
|
}
|
|
}
|