Go to https://squarespace.com/seanallen to save 10% off your first purchase of a website or domain using code SEANALLEN.
In this video I show you how to use add interactivity to a chart using the Swift Charts framework with some nice animations. This allows your user to drag along the chart and show the selected information in an annotation view above the chart. We add an opacity animation so all other bars are faded out and only the selected one remains for a nice touch.
Starter Project Download:
https://www.dropbox.com/scl/fo/vpjpxxsnoxxb1f81kkgf8/AG2Xj6QU6TT-CygIxvZ6arc?rlkey=qwwueryssnyo18zkb7xkyvvpr&st=k0gasddt&dl=0
My Basic Bar Chart Video Tutorial:
https://youtu.be/4utsyqhnS4g
My iOS Dev Courses:
https://seanallen.teachable.com/
My Source Code:
https://seanallen.teachable.com/p/source-code-youtube-videos
X (Twitter):
Sean Allen - https://twitter.com/seanallen_dev
Hired.com:
https://hired.com/x/1n01g
Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):
Antoine Van Der Lee - Going Indie Course:
https://courses.avanderlee.com/p/from-side-project-to-going-indie?affcode=2082304_o9res6rn
Helm (25% Discount) - The all-in-one macOS app that enhances App Store Connect, supercharging your app updates, localization, and ASO with AI-powered tools.
https://gumroad.com/a/692357651/ymbbmh
Mark Moeyken’s SwiftUI Books:
https://www.bigmountainstudio.com/a/fzc51
Paul Hudson's Hacking With Swift:
https://gumroad.com/a/762098803
RocketSim - Enhance Your Xcode Simulator:
https://gumroad.com/a/51797971/ftvbh
Objc.io Books (Thinking in SwiftUI & Advanced Swift):
https://gumroad.com/a/656585843
Timestamps:
0:00 - Interactive Chart Example
0:17 - Starter Project Explanation
0:48 - Interactivity - chartXSelection Modifier
2:51 - Matching data to selection
6:28 - Building the UI based on selection
7:00 - Bars fade in and out based on selection
10:06 - Lolli-pop annotation view UI
#swift #softwaredeveloper #iosdeveloper