This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import WidgetKit | |
import SwiftUI | |
@main | |
struct WidgetExtMain { | |
static func main() { | |
if #available(iOS 18.0, *) { | |
MyWidgets_18.main() | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Make Sketch use the middle mouse button for dragging like Figma, Fusion 360, etc. | |
local middleMouseDown = false | |
-- Function to handle the middle mouse down event | |
local function middleMouseDownHandler(event) | |
if event:getType() == hs.eventtap.event.types.otherMouseDown then | |
if event:getProperty(hs.eventtap.event.properties['mouseEventButtonNumber']) == 2 then | |
middleMouseDown = true | |
-- Simulate holding down the space bar | |
hs.eventtap.event.newKeyEvent(hs.keycodes.map['space'], true):post() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import WebKit | |
@main | |
struct WebViewActingUpApp: App { | |
var body: some Scene { | |
WindowGroup(id: "Main") { | |
ContentView() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import WebKit | |
@main | |
struct WebViewActingUpApp: App { | |
var body: some Scene { | |
WindowGroup(id: "Main") { | |
ContentView() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
@main | |
struct WindowPresentationFunApp: App { | |
@State var appState = AppState() | |
var body: some Scene { | |
WindowGroup { | |
RootView(appState: appState) | |
.onAppear { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
IceCreamView(viewModel: ViewModel(iceCream: "banana")) | |
} | |
} | |
struct IceCreamView: View { | |
@State var viewModel: ViewModel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
IceCreamView(viewModel: ViewModel(iceCream: "banana")) | |
} | |
} | |
struct IceCreamView: View { | |
@State var viewModel: ViewModel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// UnderstandSwiftUIChange | |
// | |
// Created by Christian Selig on 2024-04-04. | |
// | |
import SwiftUI | |
import WebKit | |
import UIKit |
NewerOlder