Skip to content
المشاريع

fabiangruss/playful-swiftui-examples

عرض على GitHub

حول

A collection of SwiftUI examples to use

التعلّم والتعليم

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
٠
خلال 15 يومًا
٠
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

playful-swiftui-examples

A growing collection of pretty SwiftUI code snippets to use in your projects based on code from my projects.

Most examples are focused on having a great UX and adding a little bit of fun for the user.

Feel free to star the repo and follow @fabiangruss on Twitter - many more examples to come :)


Playful, squishy play button

This button toggles between play and pause and is a squishy button that changes its shape when pressed. It uses a combination of animations and symbol effects to achieve a playful look.

https://github.com/fabiangruss/swiftui-examples/assets/22966490/6bba3c00-b21a-4f3e-bc69-a97642b6129a

Go to code


Squishy waveform button

This button handles audio playback (provided as Data) and displays an animated waveform when music/voicenotes are playing. Works like this:

  • audio data is divided into chunks
  • each chunk's average amplitude is converted to decibels to create waveform bars
  • these are rendered in SwiftUI

https://github.com/fabiangruss/swiftui-examples/assets/22966490/094e8db2-2d65-46bc-adbc-4dcd52eeb2b2

Go to code


Highlighted search

This code snippet shows how to highlight the search term in a list of results. It builds a custom HStack with multiple text elements in which the search term is highlighted and contrasted against the rest of the text.

Highlighted search

Go to code


Custom pull to refresh/action

This code snippet shows how to build a custom pull to refresh and attach it to a scroll view. It replaces iOS' default ProgressView by your own view. This view receives the current pull down percentage from 0 to 1 to be used for custom interactions. Inspiration to this refresh view is based on kavsoft.dev

https://github.com/fabiangruss/playful-swiftui-examples/assets/22966490/dbdb39ac-f69e-412c-9a90-450a0652e329

Go to code


Notification animation

This code snippet shows an animation of a stack of notifications that I used in a notification permission priming screen. Add custom image/avatar paths to make the file runnable.

https://github.com/fabiangruss/playful-swiftui-examples/assets/22966490/3d68a940-2dc9-4450-8f9f-858a6a3daeac

Go to code

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…