Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SFSymbolsの楽しみ方

 SFSymbolsの楽しみ方

SFSymbolsの説明と、見つけてしまったSFSymbolsの楽しみ方をお伝えします。

Avatar for Lil Ossa リルオッサ

Lil Ossa リルオッサ

January 15, 2022
Tweet

More Decks by Lil Ossa リルオッサ

Other Decks in Programming

Transcript

  1. scaleͱweight΋ઃఆͰ͖Δ let configuration = UIImage.SymbolConfiguration(pointSize: UIFont.systemFontSize, weight: .medium, scale: .large)

    let image = UIImage(systemName: "square.and.arrow.up", withConfiguration: configuration) Storyboard ίʔυ
  2. ύϨοτΧϥʔΛઃఆ͢Δ let image = UIImage(systemName: "face.smiling.fill") let configuration = UIImage.SymbolConfiguration(paletteColors:

    [.black, .systemYellow]) imageView.image = image imageView.preferredSymbolConfiguration = configuration iOS15͔Β࢖༻Ͱ͖Δ UIImage.SymbolCon fi guration.init(paletteColors:)Ͱ SymbolCon fi gurationΛੜ੒ͯ͠ઃఆ͢Δ͜ͱͰγϯϘϧͷΠϝʔδ ʹෳ਺ͷΧϥʔΛׂΓ౰ͯΔ͜ͱ͕ग़དྷ·͢
  3. ֊૚ΧϥʔΛઃఆ͢Δ iOS15͔Β࢖༻Ͱ͖Δ UIImage.SymbolCon fi guration.init(hierarchicalColor:) ͰSymbolCon fi gurationΛੜ੒ͯ͠ઃఆ͢Δ͜ͱͰࢦఆͨ͠جຊ৭ͷ ڧ౓ΛԼ͛ͨ৭ͷ஋Λଞͷ֊૚ͷϨΠϠʔͷׂΓ౰ͯ·͢ɻ let

    image = UIImage(systemName: "trash.slash") let configuration = UIImage.SymbolConfiguration(hierarchicalColor: .systemMint) imageView.preferredSymbolConfiguration = configuration imageView.image = image
  4. ϚϧνΧϥʔΛઃఆ͢Δ iOS15͔Β࢖༻Ͱ͖Δ UIImage.SymbolCon fi guration.preferringMulticolorϝιουΛ࢖༻ ͢ΔͱɺγϯϘϧ͕ϚϧνΧϥʔόϦΞϯτΛ͍࣋ͬͯΔ৔߹͸ ͦͷΧϥʔׂ͕Γ౰ͯΒΕ·͢ let image =

    UIImage(systemName: "ladybug.fill") imageView.preferredSymbolConfiguration = UIImage.SymbolConfiguration.preferringMulticolor() imageView.tintColor = .brown imageView.image = image