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 UIKit | |
final class CustomIntensityVisualEffectView: UIVisualEffectView { | |
/// Create visual effect view with given effect and its intensity | |
/// | |
/// - Parameters: | |
/// - effect: visual effect, eg UIBlurEffect(style: .dark) | |
/// - intensity: custom intensity from 0.0 (no effect) to 1.0 (full effect) using linear scale | |
init(effect: UIVisualEffect, intensity: CGFloat) { | |
theEffect = effect |
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 | |
public struct FormattedTextField<Formatter: TextFieldFormatter>: View { | |
public init(_ title: String, | |
value: Binding<Formatter.Value>, | |
formatter: Formatter) { | |
self.title = title | |
self.value = value | |
self.formatter = formatter | |
} |
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 | |
public extension View { | |
func onSizeChange( | |
ignoreSafeArea: Bool = false, | |
round: Bool = false, | |
perform action: @escaping (CGSize) -> Void | |
) -> some View { | |
modifier(SizeChangeModifier( | |
ignoreSafeArea: ignoreSafeArea, |
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 EmojiPickerView: UIViewRepresentable { | |
@Binding var isFirstResponder: Bool | |
var onPick: (String) -> Void | |
var onDelete: () -> Void | |
func makeUIView(context: Context) -> UIViewType { | |
UIViewType(view: self) | |
} |
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 Combine | |
import CoreData | |
public final class FetchedResultsPublisher | |
<ResultType> | |
: Publisher | |
where | |
ResultType: NSFetchRequestResult | |
{ | |
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 | |
public extension View { | |
/// Perform action when interface orientation of the view changes | |
/// - Parameter perform: Action to perform | |
/// - Returns: Modified view | |
func onInterfaceOrientationChange(perform: @escaping (UIInterfaceOrientation) -> Void) -> some View { | |
modifier(OnInterfaceOrientationChangeViewModifier(onChange: perform)) | |
} | |
} |
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 | |
public struct NumberField: View { | |
public init(_ title: String, | |
value: Binding<NSNumber?>, | |
decorator: @escaping (String) -> String = { $0 }) { | |
self.title = title | |
self.value = value | |
let formatter = NumberFormatter() |
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 CryptoKit | |
import Dependencies | |
import Foundation | |
import XCTestDynamicOverlay | |
public struct GravatarJSON: Equatable, Sendable, Codable { | |
public init(entry: [Entry]) { | |
self.entry = entry | |
} |
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 ComposableArchitecture | |
import Logging | |
extension _ReducerPrinter { | |
/// Logs info about received actions and state changes to swift-log's Logger with provided label. | |
/// | |
/// Example usage: | |
/// ``` | |
/// let store = Store(initialState: AppFeature.State()) { | |
/// AppFeature()._printChanges(.swiftLog(label: "tca")) |
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
// swiftlint:disable identifier_name | |
// MARK: - ForwardApplication | |
precedencegroup ForwardApplication { | |
associativity: left | |
higherThan: AssignmentPrecedence | |
} | |
infix operator |>: ForwardApplication |
NewerOlder