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
############################## | |
## Java | |
############################## | |
*.class | |
*.jar | |
*.war | |
*.ear | |
*.nar | |
hs_err_pid* |
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
// Run any SwiftUI view as a Mac app. | |
import Cocoa | |
import SwiftUI | |
public func run<V: View>(view: V) { | |
let delegate = AppDelegate(view) | |
let app = NSApplication.shared | |
NSApp.setActivationPolicy(.regular) | |
app.mainMenu = app.customMenu |
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 PlaygroundSupport | |
struct Sunset: View { | |
@State var backgroundColor = Color.blue | |
@State var sunSetted = false | |
let sunGradient = [Color.yellow, Color.orange] | |
let moonGradient = [Color.gray, Color.black] | |
@State var alignment = Alignment.top | |
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 PlaygroundSupport | |
struct ContentView: View { | |
@State var gradientAngle: Double = 0 | |
var colors = [ | |
Color(UIColor.systemRed), | |
Color(UIColor.systemOrange), | |
Color(UIColor.systemYellow), | |
Color(UIColor.systemGreen), |
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 EnumPicker<T: Hashable & CaseIterable, V: View>: View { | |
@Binding var selected: T | |
var title: String? = nil | |
let mapping: (T) -> V | |
var body: some View { |
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
// | |
// Frost.swift | |
// | |
// Created by Clarko on 7/19/20. | |
// | |
// A SwiftUI representation of UIVisualEffectView | |
// and UIBlurEffect, that handles mostly like a | |
// SwiftUI Color view. Use it as a background. | |
// | |
// Comes with styles like Frost.thin and Frost.thick |
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
struct ExampleView: View { | |
var body: some View { | |
Text("Example") | |
.if(true) { $0.foregroundColor(.red) } | |
} | |
} |
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 PlaygroundSupport | |
struct app: View { | |
var appTitle: String | |
var appDesc: String | |
var appColor: Color | |
var body: some View { | |
HStack (alignment: .center, spacing: 14) { | |
VStack { |
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
struct SearchBar : View { | |
@Binding var searchText: String | |
var body: some View { | |
HStack { | |
Image(systemName: "magnifyingglass").foregroundColor(.secondary) | |
TextField( | |
$searchText, | |
placeholder: Text("Search")) { | |
UIApplication.shared.keyWindow?.endEditing(true) |
OlderNewer