Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  Old_ChatBarButton.swift   Sprache: JAVA

 

import UIKit

// MARK: - Old_ChatBarButton.Configuration

extension Old_ChatBarButton {
    struct Configuration {
        var size: CGFloat = ChatBarConfiguration.defaultSize
        var scaledSize: CGFloat {
            UIFontMetrics(forTextStyle: .body).scaledValue(for: size)
        }
    }
}

@available(*, deprecated, message: "Use for pre iOS 26 only. For newer version use ChatBarButton instead.")
final class Old_ChatBarButton: ThemedCodeButton {
    
    private lazy var buttonConfiguration = Configuration()
    
    private var defaultColor: () -> UIColor
    
    private var sfSymbolName: String?
    
    init(
        sfSymbolName: String,
        accessibilityLabel: String,
        defaultColor: @escaping (() -> UIColor) = { .tintColor },
        customScalableSize: CGFloat? = nil,
        action: @escaping Action
    ) {
        
        self.defaultColor = defaultColor
        
        // Setting the actual frame size fixes an Auto Layout error that probably occurs when
        // there is no superview
        let initFrame = CGRect(
            x: 0, y: 0,
            width: 44,
            height: 44
        )
        
        super.init(frame: initFrame, action: action)
        
        if let customScalableSize {
            buttonConfiguration.size = customScalableSize
        }
        
        configureButton(with: sfSymbolName)
        updateColors()
        
        self.accessibilityLabel = accessibilityLabel
    }
    
    // MARK: - Configure
    
    public func updateButton(with sfSymbolName: String) {
        configureButton(with: sfSymbolName)
    }
    
    private func configureButton(
        with sfSymbolName: String
    ) {
        guard self.sfSymbolName != sfSymbolName else {
            return
        }
        
        self.sfSymbolName = sfSymbolName
        
        let image = UIImage(systemName: sfSymbolName)?.withRenderingMode(.alwaysTemplate)
        setImage(image, for: .normal)
        
        let configuration = UIImage.SymbolConfiguration(
            pointSize: buttonConfiguration.scaledSize,
            weight: .regular,
            scale: .large
        )
        setPreferredSymbolConfiguration(configuration, forImageIn: .normal)
    }
    
    // MARK: - Updates
    
    override func updateColors() {
        super.updateColors()
        imageView?.tintColor = defaultColor()
    }
}

Messung
CHZG
859710094

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-11-04) ¤

*© 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1104857
#Domains=439316