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

How did I build an Open-Source SwiftUI Toast Li...

How did I build an Open-Source SwiftUI Toast Library

Elvis Shi

August 04, 2024
Tweet

More Decks by Elvis Shi

Other Decks in Programming

Transcript

  1. var job = "iOS Developer" var livingIn = "Fukuoka, Japan"

    var organizerOf = "HAKATA.swift" var favoriteLanguage = "Swift" var twitter = "@lovee" var github = "el-hoshino" var additionalInfo = """ I don't write any programming languages other than Swift for religion reasons😎 """ final class Me: Developable, Talkable { }
  2. What is a Toast •A UI component that shows some

    notifications to the user without interrupting his/her use. •Apple doesn't provide an official component for this use case. •So I build one😎
  3. Most important value as a UI library* •Views should be

    fully customizable •Every user has his own request. •You can't satisfy every one. •Instead, let them customize their own views •All you need is just providing APIs to observe the properties required to customize the view. •In Tardiness you can customize your toast's size, layout, color and even animation of showing/hiding! *.0
  4. •How to leverage `@Environment`'s potential •Where to use callAsFunction •Why

    chose Event-Driven over State-Driven •and check out the repo for more! Other fun techniques