(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| import SwiftUI | |
| extension View where Self: Shape { | |
| func glow( | |
| fill: some ShapeStyle, | |
| lineWidth: Double, | |
| blurRadius: Double = 8.0, | |
| lineCap: CGLineCap = .round | |
| ) -> some View { | |
| self |
| import SwiftUI | |
| struct TaskTrigger<T: Equatable>: Equatable { | |
| fileprivate enum TaskState<S: Equatable>: Equatable { | |
| case inactive | |
| case active(value: S, uniqueId: UUID? = nil) | |
| } | |
| fileprivate var state: TaskState<T> = .inactive |
| [ | |
| { | |
| "code": "AED", | |
| "name": "UAE Dirham", | |
| "country": "United Arab Emirates", | |
| "countryCode": "AE", | |
| "flag": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAG5SURBVHja7JdLihRBEEBfVqUU6rQNggiCFxA8gswFRNy49gAeQdx4G8HbuHDvRkRUnKxPZ2dGhous6Y9TtavPZmITtYggXsWPSKOqrCkFK8stgAFKoOr1kiKAt8CD76/f/KYYj//u7bPpU28Mn199eGiBLabg7uWLUePLp08mB/j66xvA1gKVSkK9J/29guuxNCZrVX60905qZlD0xvd5XbPvmN22uo+XCFDZXI2Idjt0txuk9TFM+ve7Yk9MAkAPIKSuI3XdoEMX/aQAd4qSfYpHAI0RbVt0FGA/KYAtyvMMaBTUObRpBh2a0E3cgspewkkJQkDqGm3bQfNPL9/PtIQ+cmjC5OqbTaj9qppRcglCAFej3h9H8P9xnBUgCtRNBllYDj0QmxbWAkgxggiktFjg60PosAeMJnQtAIkRq7poBlIfK5cgRBQdzYC1dtLgVVVRluUJgEQo7XH0RminlBDCKUDK99AIwByXs4gcb0JJafaFc7aCjTlktQBIqpiVAPIYas5AcXEx6LCRzaxjKAn4465GjZ1zs13GBngMPAceLbyFfwJfTP8m2PR6SfGAM7eP07UB/g0Aw73uXdMbeJMAAAAASUVORK5CYII=" | |
| }, | |
| { | |
| "code": "AFN", |
| // A URLSession extension that fetches data from a URL and decodes to some Decodable type. | |
| // Usage: let user = try await URLSession.shared.decode(UserData.self, from: someURL) | |
| // Note: this requires Swift 5.5. | |
| extension URLSession { | |
| func decode<T: Decodable>( | |
| _ type: T.Type = T.self, | |
| from url: URL, | |
| keyDecodingStrategy: JSONDecoder.KeyDecodingStrategy = .useDefaultKeys, | |
| dataDecodingStrategy: JSONDecoder.DataDecodingStrategy = .deferredToData, | |
| dateDecodingStrategy: JSONDecoder.DateDecodingStrategy = .deferredToDate |
| import UIKit | |
| import AVFoundation | |
| import Photos | |
| import MobileCoreServices | |
| class ViewController: UIViewController { | |
| override func viewDidAppear(_ animated: Bool) { | |
| super.viewDidAppear(animated) | |
| startVideoToGIFProcess() |
| #install ffmpeg if it is not installed | |
| (brew list -1 | grep "ffmpeg" >/dev/null) || brew install ffmpeg | |
| #update your ffmpeg distribution to the latest version | |
| brew outdated ffmpeg || brew upgrade ffmpeg | |
| #cleanup the destination folder | |
| for file in `ls ffmpeg/*`; do rm -f $file; done; | |
| #determine the last local ffmpeg version |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| mr Marathi | |
| bs Bosnian | |
| ee_TG Ewe (Togo) | |
| ms Malay | |
| kam_KE Kamba (Kenya) | |
| mt Maltese | |
| ha Hausa | |
| es_HN Spanish (Honduras) | |
| ml_IN Malayalam (India) | |
| ro_MD Romanian (Moldova) |