Hacer una captuta de pantalla del simulator encendido
xcrun simctl io booted screenshot [filename].[extension]
import Foundation | |
struct Query<Element> { | |
let key: String | |
let value: Element | |
var filter: String { | |
return "\(key)=\(String(describing: value))" | |
} | |
} |
final class VoyagerMessageHandler: MessageHandler { | |
var nextHandler: MessageHandler? | |
func process(_ message: String) throws { | |
let regex = #/^VYYR\s{1,4}(?<id>\d{1})\s{1,4}(?<distance>\d{1,}\.\d{1,3})\s{1,}/# | |
let match = try regex.firstMatch(in: message) | |
if let match { | |
print("🛸 La sonda Voyager \(match.id) se encuentra a \(match.distance) millones de kilómetros") | |
} else if let nextHandler { |
final class MessageManager { | |
private var handlers: [MessageHandler] | |
init() { | |
handlers = [ | |
OrionMessageHandler(), | |
VoyagerMessageHandler(), | |
PerseveranceMessageHandler() | |
] | |
protocol MessageHandler { | |
var nextHandler: MessageHandler? { get set } | |
func process(_ message: String) throws | |
} |
#!/bin/zsh | |
# Close Xcode, then run this script | |
xcrun simctl --set previews delete all |
// | |
// KeyboardResponder.swift | |
// MoveMAD | |
// | |
// Created by Adolfo Vera Blasco on 19/11/2019. | |
// Copyright © 2019 desappstre {eStudio}. All rights reserved. | |
// | |
import Combine | |
import SwiftUI |
// | |
// KeyboardResponder.swift | |
// MoveMAD | |
// | |
// Created by Adolfo Vera Blasco on 19/11/2019. | |
// Copyright © 2019 desappstre {eStudio}. All rights reserved. | |
// | |
import SwiftUI |
#!/bin/zsh | |
# The right time | |
xcrun simctl status_bar booted override --time 09:41 | |
# WiFi & Cellular network | |
xcrun simctl status_bar booted override --dataNetwork wifi | |
xcrun simctl status_bar booted override --wifiBars 3 | |
xcrun simctl status_bar booted override --cellularBars 4 | |
# 100% battery level | |
xcrun simctl status_bar booted override --batteryLevel 100 |