- Télécharger l'app gratuite Scriptable.
- Coller le code de
vaccin.jsdans un nouveau script Scriptable - Configurer le script (instructions dans le code)
- Ajouter un widget Scriptable
- Configurer le widget en sélectionnant votre script
| func visionOSModelIdentifier() -> String { | |
| if let identifier = ProcessInfo().environment["SIMULATOR_MODEL_IDENTIFIER"] { | |
| return identifier | |
| } else { | |
| var systemInfo = utsname() | |
| uname(&systemInfo) | |
| let machine = Mirror(reflecting: systemInfo.machine) | |
| return machine.children | |
| .compactMap({ $0.value as? Int8 }) |
| import SwiftUI | |
| /// Main Window content | |
| private struct MainView: View { | |
| @Environment(\.appState) private var appState | |
| @Environment(\.openWindow) private var openWindow | |
| var body: some View { | |
| NavigationStack { | |
| VStack { |
| // | |
| // ContentView.swift | |
| // SwiftUIBurgerMenu | |
| // | |
| // Created by Florent Morin on 02/06/2021. | |
| // | |
| import SwiftUI | |
| import Foundation |
| // | |
| // DarwinNotificationCenter.swift | |
| // | |
| // Copyright © 2017 WeTransfer. All rights reserved. | |
| // | |
| // Source: https://gist.github.com/florentmorin/35b15837cd4fb2a2a0630dbdf41d09aa | |
| // Original: https://gist.github.com/AvdLee/07de0b0fe7dbc351541ab817b9eb6c1c | |
| import Foundation |
vaccin.js dans un nouveau script Scriptable| struct User: Encodable { | |
| let firstName: String | |
| let lastName: String | |
| let admin: Bool | |
| } | |
| final class UserProtocol: URLProtocol { | |
| override class func canInit(with request: URLRequest) -> Bool { | |
| return true // Customize here |
| h1 { | |
| color: black; | |
| } | |
| @media (prefers-color-scheme: dark) { | |
| h1 { | |
| color: white; | |
| } | |
| } |
| import UIKit | |
| extension UIViewController { | |
| /// Top most view controller in view hierarchy | |
| var topMostViewController: UIViewController { | |
| // No presented view controller? Current controller is the most view controller | |
| guard let presentedViewController = self.presentedViewController else { | |
| return self |
| // | |
| // ContentView.swift | |
| // MailDemo | |
| // | |
| // Created by Florent Morin on 29/06/2019. | |
| // Copyright © 2019 Morin Innovation. All rights reserved. | |
| // | |
| // Medium link: https://medium.com/@florentmorin/messageui-swiftui-and-uikit-integration-82d91159b0bd | |
| // Sample source code: https://github.com/florentmorin/SwiftUIAndMessageUI |