Original Letter | Look-Alike(s) |
---|---|
a | а ạ ą ä à á ą |
c | с ƈ ċ |
d | ԁ ɗ |
e | е ẹ ė é è |
g | ġ |
h | һ |
import notify | |
import Combine | |
enum Notify {} | |
extension Notify { | |
struct Status: Error { | |
let rawValue: UInt32 | |
init(_ rawValue: UInt32) { | |
self.rawValue = rawValue |
// Backport SwiftUI.Toggle.init(_:sources:isOn:) | |
// https://developer.apple.com/documentation/swiftui/toggle/init(_:ison:)-8qx3l | |
@available(iOS, deprecated: 16.0) | |
@available(macOS, deprecated: 13.0) | |
@available(tvOS, deprecated: 16.0) | |
@available(watchOS, deprecated: 9.0) | |
private extension SwiftUI.Toggle where Label == SwiftUI.Text { | |
init<C>(_ titleKey: LocalizedStringKey, sources: C, isOn: KeyPath<C.Element, Binding<Bool>>) where C : RandomAccessCollection { |
struct ContentView: View { | |
@State var color: Color = .Pastel.random() | |
var body: some View { | |
Rectangle() | |
.foregroundColor(color) | |
.onTapGesture { | |
color = .Pastel.random() | |
} | |
} |
// | |
// LayoutThatFits.swift | |
// WWDC22Experiments | |
// | |
// Created by Ryan Lintott on 2022-06-08. | |
// | |
import SwiftUI | |
struct LayoutThatFits: Layout { |
// Excerpt from https://github.com/krzyzanowskim/CoreTextWorkshop | |
// Licence BSD-2 clause | |
// Marcin Krzyzanowski [email protected] | |
func getSizeThatFits(_ attributedString: NSAttributedString, maxWidth: CGFloat) -> CGSize { | |
let framesetter = CTFramesetterCreateWithAttributedString(attributedString) | |
let rectPath = CGRect(origin: .zero, size: CGSize(width: maxWidth, height: 50000)) | |
let ctFrame = CTFramesetterCreateFrame(framesetter, CFRange(), CGPath(rect: rectPath, transform: nil), nil) |
// | |
// MultilineLabel.swift | |
// | |
// Created by Marcin Krzyzanowski on 19/09/2019. | |
// | |
import UIKit | |
public class MultilineLabel: UILabel { | |
override public init(frame: CGRect) { |
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
-
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
-
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
Author: Chris Lattner
// | |
// LinkedTextView.h | |
// | |
// Created by Benjamin Bojko on 10/22/14. | |
// | |
// The MIT License (MIT) | |
// | |
// Copyright (c) 2014 Benjamin Bojko | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy |