- Proposal: SE-NNNN
- Authors: Karl Wagner
- Review Manager: TBD
- Status: Awaiting review
- Implementation: apple/swift#66247
- Upcoming Feature Flag:
NestedProtocols
- Review: (pitch)
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
public enum SortOrder { | |
case ascending | |
case descending | |
} | |
@inlinable @inline(__always) | |
public func isLessThan<Root, each Value: Comparable>( | |
_ leftRoot: Root, | |
_ rightRoot: Root, | |
comparing properties: repeat ((Root) -> each Value, SortOrder) |
In order to make it easier to read/write key-value pairs from URL components, WebURL 0.5.0 will include a new KeyValuePairs
type. The current formParams
view will be deprecated and removed in the next minor release.
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
test |
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
// Copyright The swift-url Contributors. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
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 ContentView: View { | |
@State var immutableForm = false | |
@State var data = Person( | |
name: "Johnny Appleseed", address: "The spaceship", dateOfBirth: Date(), | |
aSwitch: true, anImmutableString: "Hello, world!", anImmutableSwitch: false | |
) | |
var body: some View { |
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
// Use the following Package.swift: | |
// ----------------------------------------------------------- | |
// swift-tools-version:5.5 | |
// The swift-tools-version declares the minimum version of Swift required to build this package. | |
// | |
//import PackageDescription | |
// | |
//let package = Package( | |
// name: "uniqueid-test", | |
// dependencies: [ |
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
// This file contains a generic implementation of 'replaceSubrange' for contiguous buffers, | |
// including those only accessible indirectly such as `ManagedBuffer` subclasses. | |
// | |
// It includes optimisations for in-place replacement as well as consuming the original storage when additional | |
// capacity is required. The implementation is adapted from the standard library's source code, where it forms | |
// the basis of Array's implementation of replaceSubrange. | |
/// An object which contains a unique, mutable buffer. | |
/// This protocol is a required level of indirection so that `replaceElements` can allocate, fill, and return objects which provide their buffers indirectly. | |
/// |
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
extension Collection { | |
public subscript(inplace_slice bounds: Range<Index>) -> Slice<Self> { | |
get { fatalError() } | |
_modify { | |
var slice = Slice(base: self, bounds: bounds) | |
yield &slice | |
} | |
} | |
} |
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
public struct ASCII: Equatable, Comparable { | |
public var codePoint: UInt8 | |
@inlinable public init(_ v: UInt8) { self.codePoint = v } | |
} | |
extension ASCII { | |
// Homogenous comparisons. | |
@inlinable public static func < (lhs: ASCII, rhs: ASCII) -> Bool { | |
lhs.codePoint < rhs.codePoint | |
} |
NewerOlder