Using Macaw its pretty straight forward to use SVG images in your iOS and macOS apps.
Install via CocoaPods or Carthage. It doesn't support SPM at the time of writing but its pretty easy to fork their repo and add it.
// An exercise in implementing `@Invalidating` for UIView before Xcode 13.0 beta 2 | |
// was released, rendering it unnecessary | |
import UIKit | |
public extension UIView { | |
@propertyWrapper | |
class Invalidating<Value> where Value: Equatable { |
@_functionBuilder | |
public enum CollectionBuilder<Component> { | |
// MARK: - Building Expressions | |
/// Basic uplift of an `Expression` into a `Component` (aka `[Expression]`) | |
/// | |
public static func buildExpression(_ expression: Component) -> [Component] { | |
[expression] | |
} |
import Foundation | |
public extension JSONDecoder.DateDecodingStrategy { | |
static var betterISO8601: JSONDecoder.DateDecodingStrategy { | |
return .custom({ try decodeDate(from: $0, calendar: Calendar(identifier: .gregorian)) }) | |
} | |
static func betterISO8601 (calendar: Calendar) -> JSONDecoder.DateDecodingStrategy { | |
return .custom({ try decodeDate(from: $0, calendar: calendar) }) | |
} |
@_functionBuilder | |
public enum CollectionBuilder<Element>: SimpleBuilder { | |
public typealias Component = Element | |
} | |
public extension RangeReplaceableCollection { | |
mutating func collect (@CollectionBuilder<Element> _ builder: () -> Element) { | |
append(builder()) | |
} | |
// | |
// FileMonitorPublisher.swift | |
// Longinus | |
// | |
// Created by Rob Amos on 3/3/20. | |
// | |
import Foundation | |
import Combine |
Using Macaw its pretty straight forward to use SVG images in your iOS and macOS apps.
Install via CocoaPods or Carthage. It doesn't support SPM at the time of writing but its pretty easy to fork their repo and add it.
import Foundation | |
import Combine | |
@_functionBuilder | |
public struct AnyCancellableBuilder { | |
public static func buildBlock () -> [AnyCancellable] { | |
return [] | |
} | |
public static func buildBlock (_ child: AnyCancellable) -> [AnyCancellable] { |
// | |
// GridTest.swift | |
// | |
import SwiftUI | |
struct GridTest: View { | |
var items: [String] | |
var body: some View { |
# | |
# Makefile for Cards Deployment | |
# | |
PACKAGE = lambda.zip | |
PROFILE = unsignedapps | |
REGION = ap-southeast-2 | |
LAMBDA = Cards | |
SWIFT_DOCKER_IMAGE = swift:5.0 |
import UIKit | |
class ViewController: UIViewController { | |
override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillResize(_:)), name: UIResponder.keyboardWillChangeFrameNotification, object: nil) | |
} | |
override func viewWillDisappear(_ animated: Bool) { |