Skip to content

Instantly share code, notes, and snippets.

View Drag0ndust's full-sized avatar
🏠
Working from home

Thimo Bess Drag0ndust

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am drag0ndust on github.
  • I am drag0ndust (https://keybase.io/drag0ndust) on keybase.
  • I have a public key ASBqXXUYPD64UMm40Uc_U_Ka8LLLIuwC48gkVNlNkFZ9DQo

To claim this, I am signing this object:

@Drag0ndust
Drag0ndust / DeviceSwitcherView.swift
Created August 19, 2021 10:00
SwiftUI: Detect if view is displayed on iPhone or iPad
struct DeviceSwitchView<iPhoneView: View, iPadView: View>: View {
@Environment(\.horizontalSizeClass) var sizeClass
var iPhone: iPhoneView
var iPad: iPadView
init(@ViewBuilder iPhone: () -> iPhoneView, @ViewBuilder iPad: () -> iPadView) {
self.iPhone = iPhone()
self.iPad = iPad()
}
@Drag0ndust
Drag0ndust / TextEditorWithPlaceholder.swift
Created January 27, 2022 13:58
SwiftUI: Texteditor with Placeholder
import SwiftUI
struct TextEditorWithPlaceholder: View {
@Binding var text: String
var placeholder: String
var body: some View {
TextEditor(text: $text)
.background(
VStack {
@Drag0ndust
Drag0ndust / NavigationLinkExample
Created July 25, 2022 06:28
NavigationLink example (Twitch Live Coding "arconsis")
//
// ContentView.swift
// iOS16
//
// Created by arconsis on 22.07.22.
//
import SwiftUI
enum Route {
import SwiftUI
import Charts
struct Temperature: Identifiable {
var id: String { day }
let day: String
let degree: Double
}
struct City: Identifiable {
@Drag0ndust
Drag0ndust / BottomSheet.swift
Created October 11, 2022 08:08
iOS 16: Bottom Sheet
struct MyBottomSheet: View {
@State private var showSheet = false
var body: some View {
ZStack {
Color.green
.ignoresSafeArea()
Button {
showSheet.toggle()
} label: {