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
// | |
// SFSymbolImage.swift | |
// SFSymbolVariableValueAnimationWrong | |
// | |
// Created by Matthew Young on 12/22/22. | |
// | |
import SwiftUI | |
struct AnimatableVariableValueModifier: Animatable, ViewModifier { |
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
// Author: SwiftUI-Lab (www.swiftui-lab.com) | |
// Description: This code is part of the "Advanced SwiftUI Animations - Part 5" | |
// Article: https://swiftui-lab.com/swiftui-animations-part5/ | |
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
DigitalRain() | |
} |
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 WebKit | |
import Combine | |
class WebViewData: ObservableObject { | |
@Published var loading: Bool = false | |
@Published var scrollPercent: Float = 0 | |
@Published var url: URL? = nil | |
@Published var urlBar: String = "https://nasa.gov" | |
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 | |
extension Calendar { | |
func generateDates( | |
inside interval: DateInterval, | |
matching components: DateComponents | |
) -> [Date] { | |
var dates: [Date] = [] | |
dates.append(interval.start) |
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 Foundation | |
// Diff objects for better test assertions. | |
// | |
// Implemented in a way that: | |
// 1. The compiler generates as much code as possible | |
// 2. You'll get a compiler error if you forget a property | |
// | |
// Nested support and collections left as an exercise for the reader. |
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
// | |
// DeviceConstants.swift | |
// SampleApp | |
// | |
// Created by RoLY roLLs on 12/31/19. | |
// Copyright © 2019 RoLYroLLs Enterprises, LLC. All rights reserved. | |
// | |
/// Taken from https://developer.apple.com/documentation/swiftui/securefield/3289399-previewdevice |
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
// | |
// PagerView.swift | |
// | |
// Created by Majid Jabrayilov on 12/5/19. | |
// Copyright © 2019 Majid Jabrayilov. All rights reserved. | |
// | |
import SwiftUI | |
struct PagerView<Content: View>: View { | |
let pageCount: Int |
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 UIKit | |
public enum ColorSupport { | |
public static var label: UIColor { | |
if #available(iOS 13, *) { | |
return .label | |
} | |
return UIColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0) | |
} |
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 RealityKit | |
import UIKit | |
class ViewController: UIViewController { | |
let arView: ARView | |
func addGestures() { | |
// Use any entity. Here we're using a cube with size 0.5m | |
let entity = ModelEntity(mesh: MeshResource.generateBox(size: 0.5)) | |
entity.generateCollisionShapes(recursive: true) |
NewerOlder