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 | |
// Effects | |
// | |
// Created by Chris Eidhof on 13.07.20. | |
// | |
import SwiftUI | |
struct MyModifier: AnimatableModifier { |
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 | |
// TabBar | |
// | |
// Created by Chris Eidhof on 13.07.20. | |
// | |
import SwiftUI | |
struct ContentView: 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
// | |
// ContentView.swift | |
// AddressBook | |
// | |
// Created by Chris Eidhof on 13.07.20. | |
// | |
import SwiftUI | |
final class Contact: ObservableObject, Identifiable { |
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 | |
// Bug1 | |
// | |
// Created by Chris Eidhof on 03.07.20. | |
// | |
import SwiftUI | |
struct ContentView: 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
// | |
// ContentView.swift | |
// NotesClone | |
// | |
// Created by Chris Eidhof on 29.06.20. | |
// | |
import SwiftUI | |
@main |
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
(use-package org | |
:hook ((org-mode . org-display-inline-images)) | |
:config | |
(use-package ob | |
:bind (:map org-mode-map | |
("C-c C-c" . org-ctrl-c-ctrl-c)) | |
:config | |
(use-package ob-swift |
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 Cocoa | |
// Insipired by http://dcandi.com/post/cocoa-filesystem-browser/ | |
extension URL { | |
var isDirectory: Bool { | |
return (try? resourceValues(forKeys: [.isDirectoryKey]))?.isDirectory ?? false | |
} | |
var fileIcon : NSImage { |
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 | |
NSApplication.shared.run { | |
VStack { | |
Text("Hello, World") | |
.padding() | |
.background(Capsule().fill(Color.blue)) |
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 | |
// | |
// Created by Chris Eidhof on 20.04.20. | |
// Copyright © 2020 objc.io. All rights reserved. | |
// | |
import SwiftUI | |
import UIKit |
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 <#MyView#>: View { | |
var body: some View { | |
<#body#> | |
} | |
} | |
extension View { | |
func geometryPreference<P: PreferenceKey>(_ key: P.Type, value: @escaping (GeometryProxy) -> P.Value) -> some View { | |
overlay(GeometryReader { proxy in | |
Color.clear.preference(key: P.self, value: value(proxy)) |