NSToolbar (Mac API) UIWindowScene.titlebar.toolbar — access
func scene(_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions) {
// setup the window| // | |
| // ScrollingTextView.swift | |
| // | |
| // Created by Kevin Hayes on 2021-10-30. | |
| // | |
| import SwiftUI | |
| struct ScrollingTextView: View { | |
| @State private var textOffset: CGFloat = 0.0 |
| # Copyright (c) 2020 Eugene Berdnikov | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| # copies of the Software, and to permit persons to whom the Software is | |
| # furnished to do so, subject to the following conditions: | |
| # | |
| # The above copyright notice and this permission notice shall be included in all |
| #!/bin/bash | |
| CYAN="$(tput bold; tput setaf 6)" | |
| RESET="$(tput sgr0)" | |
| clear | |
| if command -v python3 > /dev/null 2>&1; then | |
| if [ $(python3 -c "print('ye')") = "ye" ]; then | |
| clear |
| /// An iOS style TabView that doesn't reset it's childrens navigation stacks when tabs are switched. | |
| public struct UIKitTabView: View { | |
| private var viewControllers: [UIHostingController<AnyView>] | |
| private var selectedIndex: Binding<Int>? | |
| @State private var fallbackSelectedIndex: Int = 0 | |
| public init(selectedIndex: Binding<Int>? = nil, @TabBuilder _ views: () -> [Tab]) { | |
| self.viewControllers = views().map { | |
| let host = UIHostingController(rootView: $0.view) | |
| host.tabBarItem = $0.barItem |
| // The SwiftUI Lab | |
| // Website: https://swiftui-lab.com | |
| // Article: https://swiftui-lab.com/alignment-guides | |
| import SwiftUI | |
| struct ContentView: View { | |
| @State var position: Int = 0 | |
| var body: some View { |
| //------------------------------------------------------------------------ | |
| // The SwiftUI Lab: Advanced SwiftUI Animations | |
| // https://swiftui-lab.com/swiftui-animations-part1 (Animating Paths) | |
| // https://swiftui-lab.com/swiftui-animations-part2 (GeometryEffect) | |
| // https://swiftui-lab.com/swiftui-animations-part3 (AnimatableModifier) | |
| //------------------------------------------------------------------------ | |
| import SwiftUI | |
| struct ContentView: View { | |
| // | |
| // TimingFunction.swift | |
| // | |
| // Created by tcldr on 04/11/2018. | |
| // https://github.com/tcldr | |
| // Copyright © 2018 tcldr. | |
| // | |
| // Permission is hereby granted, free of charge, | |
| // to any person obtaining a copy of this software and | |
| // associated documentation files (the "Software"), to |
| #!/bin/sh | |
| # Set the macOS installer path as a variable | |
| MACOS_INSTALLER="/Applications/$(ls /Applications | grep "Install macOS")" | |
| MOUNT_POINT="$MACOS_INSTALLER/Contents/SharedSupport" | |
| echo "macOS installer is \"$MACOS_INSTALLER\"" | |
| # Set the target disk as a variable | |
| TARGET=$(diskutil info "$(bless --info --getBoot)" | awk -F':' '/Volume Name/ { print $2 }' | sed -e 's/^[[:space:]]*//') | |
| echo "Target disk is \"$TARGET\"" |