Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Threema/Threema/SharedUI/Details/QuickActions/   (Social Medium ©)  Datei vom 26.9.2026 mit Größe 2 kB image not shown  

Quelle  QuickAction.swift   Sprache: JAVA

 

import Foundation

protocol QuickActionUpdate {
    func reload()
    func hide()
    func popOverSourceView() -> UIView?
}

/// Description of a quick action
///
/// Use it to define quick actions in a `QuickActionsView`.
struct QuickAction {
    typealias ImageNameProvider = () -> String
    
    /// String of image available as asset
    let imageNameProvider: ImageNameProvider
    
    /// Title of action
    let title: String
    
    let accessibilityIdentifier: String
    
    /// Action performed when selected
    let action: (QuickActionUpdate) -> Void
    
    /// Create a quick action
    /// - Parameters:
    ///   - imageNameProvider: Provider for name of current SF Symbol to show
    ///   - title: Quick action title
    ///   - action: Action called when quick action is invoked
    ///   - accessibilityIdentifier: Identifier to find the button in UI tests
    init(
        imageNameProvider: @escaping ImageNameProvider,
        title: String,
        accessibilityIdentifier: String,
        action: @escaping (QuickActionUpdate) -> Void
    ) {
        self.imageNameProvider = imageNameProvider
        self.title = title
        self.accessibilityIdentifier = accessibilityIdentifier
        self.action = action
    }
    
    /// Create a quick action with a fixed image
    /// - Parameters:
    ///   - imageName: Name of SF Symbol to show
    ///   - title: Quick action title
    ///   - action: Action called when quick action is invoked
    ///   - accessibilityIdentifier: Identifier to find the button in UI tests
    init(
        imageName: String,
        title: String,
        accessibilityIdentifier: String,
        action: @escaping (QuickActionUpdate) -> Void
    ) {
        self.init(
            imageNameProvider: { imageName },
            title: title,
            accessibilityIdentifier: accessibilityIdentifier,
            action: action
        )
    }
}

// MARK: - Hashable

extension QuickAction: Hashable {
    static func == (lhs: QuickAction, rhs: QuickAction) -> Bool {
        lhs.title == rhs.title
    }
    
    func hash(into hasher: inout Hasher) {
        hasher.combine(title)
    }
}

Messung
CHZG
9010010096

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.