Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
import UIKit | |
import Foundation | |
// NOTE: This playground shows how to use Swift's AttributedString with Markdown. | |
// | |
// This code was used to display Markdown content in the Tot iOS Widget <https://tot.rocks> | |
// MARK: - Helpful Links | |
// NOTE: The following links helped me figure this stuff out. |
#!/bin/bash -euo pipefail | |
# | |
# Author: O.Halligon | |
# Jan 2021 | |
# | |
# Help | |
if [ "${1:-}" == "-h" -o "${1:-}" == "--help" ]; then | |
BASENAME=${0##*/} |
import CloudKit | |
import Combine | |
/// Fetches the user's CloudKit Account status. | |
/// | |
/// - Parameter container: The container to check the status in. | |
/// | |
/// - Returns: A deferred future that resolves to the user's CloudKit Account status. | |
func getAccountStatus(for container: CKContainer) -> AnyPublisher<CKAccountStatus, Error> { | |
Deferred { |
import SwiftUI | |
enum ScalableFont { | |
case system(size: CGFloat, weight: Font.Weight = .regular, design: Font.Design = .default) | |
case custom(_ name: String, size: CGFloat) | |
var size: CGFloat { | |
switch self { |
import Foundation | |
public protocol DefaultValue { | |
associatedtype Value: Codable | |
static var value: Value { get } | |
} | |
@propertyWrapper | |
public struct Default<Default: DefaultValue>: Codable { |
template <class _Ty> | |
_NODISCARD /* constexpr */ _Ty _Common_lerp(const _Ty _ArgA, const _Ty _ArgB, const _Ty _ArgT) noexcept { | |
// on a line intersecting {(0.0, _ArgA), (1.0, _ArgB)}, return the Y value for X == _ArgT | |
const int _Finite_mask = (int{isfinite(_ArgA)} << 2) | (int{isfinite(_ArgB)} << 1) | int{isfinite(_ArgT)}; | |
if (_Finite_mask == 0b111) { | |
// 99% case, put it first; this block comes from P0811R3 | |
if ((_ArgA <= 0 && _ArgB >= 0) || (_ArgA >= 0 && _ArgB <= 0)) { | |
// exact, monotonic, bounded, determinate, and (for _ArgA == _ArgB == 0) consistent: | |
return _ArgT * _ArgB + (1 - _ArgT) * _ArgA; |
// Copyright (c) 2019–20 Adam Sharp and thoughtbot, inc. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |