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 AnimatingMeshView: View { | |
let referenceDate: Date | |
var body: some View { | |
TimelineView(.animation) { context in | |
let t = context.date.timeIntervalSince(referenceDate) | |
MeshGradient(width: 5, height: 4, points: [ |
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 | |
protocol ImageDownloadProtocol { | |
func downloadImage(from url: URL, completion: @escaping (UIImage?) -> Void) | |
} | |
extension ImageDownloadProtocol { | |
func downloadImage(from url: URL, completion: @escaping (UIImage?) -> Void) { | |
let session = URLSession(configuration: .default) | |
DispatchQueue.global(qos: .background).async { |