This library is now deprecated in favour of a more complete and SwiftUI friendly TextEditor backport:
https://github.com/shaps80/SwiftUIBackports
See it in action here: https://twitter.com/shaps/status/1654972428286668800?s=20
| // | |
| // ContentView.swift | |
| // DeleteMe | |
| // | |
| // Created by Chris Eidhof on 02.02.21. | |
| // | |
| import SwiftUI | |
| /* |
| // SwiftUI Custom Styles (TripleToggleStyle) | |
| // https://swiftui-lab.com | |
| // https://swiftui-lab.com/custom-styling | |
| import SwiftUI | |
| // MARK: - TripleToggle View | |
| public struct TripleToggle: View { | |
| @Environment(\.tripleToggleStyle) var style: AnyTripleToggleStyle | |
| // | |
| // Color+UIColor.swift | |
| // Swatches | |
| // | |
| // Created by Timothy Sanders on 2019-11-15. | |
| import Foundation | |
| import SwiftUI | |
| import UIKit |
| import SwiftUI | |
| #if os(macOS) | |
| public typealias Font = NSFont | |
| public typealias FontDescriptor = NSFontDescriptor | |
| #else | |
| public typealias Font = UIFont | |
| public typealias FontDescriptor = UIFontDescriptor | |
| #endif |
This library is now deprecated in favour of a more complete and SwiftUI friendly TextEditor backport:
https://github.com/shaps80/SwiftUIBackports
See it in action here: https://twitter.com/shaps/status/1654972428286668800?s=20
| // Author: The SwiftUI-Lab | |
| // This code is part of the tutorial: https://swiftui-lab.com/swiftui-animations-part4/ | |
| import SwiftUI | |
| // Sample usage | |
| struct ContentView: View { | |
| var body: some View { | |
| VStack { | |
| GifImage(url: URL(string: "https://media.giphy.com/media/YAlhwn67KT76E/giphy.gif?cid=790b7611b26260b2ad23535a70e343e67443ff80ef623844&rid=giphy.gif&ct=g")!) | |
| .padding(10) |
| // Bigger iPhones = any Max, any Plus, iPhone XR, iPhone 11 | |
| switch (UITraitCollection.current.horizontalSizeClass, UITraitCollection.current.verticalSizeClass) { | |
| case (.compact, .compact): | |
| // Smaller iPhones in landscape | |
| case (.compact, .regular): | |
| // iPhones in portrait | |
| // iPads in portrait during any split screen, |