This week we rebuild SwiftUI's binding from scratch so that it can be used to power navigation in UIKit.
It sounds intimidating to rebuild Binding, but we take it one step at a time and employ some advanced features of Swift to accomplish this feat.
👉
Apple engineers have done something incredible at this year’s WWDC.
Thanks to @Observable, macros and more, you can write Composable Architecture features in a succinct manner, while enjoying the benefits of value types, effect management, exhaustive testing and more!
🥹
🎉 Today we are extremely excited to open-source the Composable Architecture, a library for building Swift applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.
We can't wait to see what you build 😃
Swift macros unlock a lot of new potential!
We can make Case Paths, a library that brings key path-like functionality to enums, safer and more ergonomic:
🙅♀️ No runtime reflection
🙅 No operator overloads
🙋♂️ Better autocomplete
🙇♀️ More concise call sites
After two consecutive days of 5 hour recording sessions on SwiftUI navigation, we met up for the first time since January 2020.
We were exhausted, but next week we begin one of our most ambitious series of episodes yet!
We’re excited to released our first DocC interactive tutorial for the Composable Architecture. It walks you through the basics of creating a feature, layering on some side effects, and writing a full test suite.
And we have more coming soon!
👉
One more thing… we’re open sourcing the entire code base of our newly released game,
@isowords
!
This includes the iOS client (built in SwiftUI and the Composable Architecture) and the server (built in Swift) 🤯
👉 👈
The Composable Architecture has reached a major milestone: version 1.0. To celebrate this release we are doing a fresh tour of the library so that folks can become comfortable building applications with it in its most modern form.
👉
New year, new library! 🥳
swift-dependencies is a dependency injection library inspired by SwiftUI’s environment. It helps you control your dependencies and avoid letting them control you with a simple, safe API.
In just a year and a half the Composable Architecture has surpassed 5k starts on GitHub! 🤩
And we've got some exciting things planned for the library in 2022. Keep an eye out! 👀
A few weeks ago we posted a teaser for a new project we began working on, and we now have more to share.
We are writing a book on Composable Architecture, and we'd like to share the preface to give you an idea of what it's about.
We hope you enjoy!
We are experimenting with the new @Observation tools in Swift, and the ramifications for the Composable
Architecture are off the charts.
* Access state directly on Store.
* Send action directly to Store.
* And support restricting what actions can be sent from views.
🤯🤯🤯
🎉 Announcing Perception: a backport of Swift 5.9’s @Observable tools for older platforms.
Still targeting iOS 13 but want to take advantage of this powerful new framework? Take a look at the library:
No new episode this week, as we prepare our next series, a highly anticipated revamp of our Composable Architecture tour, and release (finally!) of 1.0:
We’re begging Apple: please, *please* Sherlock us! 😂
At the end of our series on modern SwiftUI we ended up utilizing 9(!) libraries that we feel mostly fill in gaps that Apple hasn’t yet dealt with.
Check out this except from this week’s episode:
This week marks the 4 year anniversary of Point-Free! 🥳
176 episodes, 100 hours of video, 20 open source projects, 17k stars on GitHub, and we still have so much more planned!
We couldn’t do it without our subscribers, and we’re eternally grateful for their support 🙏
With this week’s release of the Xcode 11.4 beta, you can *finally* pass a key path to map, filter, and wherever else a “getter” function is allowed! We’re gonna have to retire our custom “^” operator.
The Composable Architecture is 3 years old! 🥳🎂
Since pushing that initial commit:
• 960 more commits onto main
• 76 backwards compatible releases cut
• 119 contributors
• 716 PRs merged
• 8.7k stars
Thanks to all who’ve joined us along the way!
Remember this tweet from a few months ago?
Well, next week we are finally ready to share how we accomplished this. We will begin a brand new series of episodes that brings the Observation framework to the Composable Architecture.
Stay tuned!
Apple engineers have done something incredible at this year’s WWDC.
Thanks to @Observable, macros and more, you can write Composable Architecture features in a succinct manner, while enjoying the benefits of value types, effect management, exhaustive testing and more!
🥹
We are hard at work building a library for the Composable Architecture with all the bells and whistles: full SwiftUI and UIKit support, documentation, example apps, and more.
We can't wait to release it 🙌
Until then, learn more:
Swift's new observation tools revolutionizes nearly every aspect of the Composable Architecture.
This week we show how it immediately obsoletes the concept of a “view store” for observing state in a view. That alone is huge, and it's just the start!
👉
Luckily there is an overload of the .animation() method that takes an Equatable value, which can be used to focus animations to occur on a subset of state changes:
Implicit animations in SwiftUI are broad and un-targeted, making it easy to animate lots of things at once, but also making it tricky to understand how it works.
In this code snippet the offset will not animate with a spring as expected 🙁.
Learn why 👉
Each WWDC comes with a flagship demo app, like “Fruta” and “Food Truck.”
But our favorite demo shipped outside of WWDC and kinda flew under the radar: “Scrumdinger.” It covers many complex, real world problems that other code samples do not.
Take a tour:
🎉 Announcing: UIKitNavigation
Today we are releasing all new tools for UIKit inspired by SwiftUI, including observation, 2-way bindings, navigation, animation, and more!
Try the beta out today:
This week we concluded our 5-part series on Swift concurrency, going back 2 decades to understand threads and queues from first principles, and finally diving deep into async/await and actors.
Watch all 5 episodes here:
You can now instantly get instrumentation for applications built in the Composable Architecture, allowing you to see how long every user action and effect takes to execute, as well as insight into what effects are currently running.
Learn more here:
UICollectionView is an absolute powerhouse in UIKit. If you need large, complex, performant lists, then sorry to say that SwiftUI is not your friend.
So this week we show off our take on modern collection views powered by an @Observable model. It is an actual joy to use! 🙂
We’re trying something new: a public beta for the Composable Architecture! 🎉
The “Concurrency Beta” is our biggest release ever, with dozens of features that make working with TCA and concurrency a breeze.
🤠 And we’d love your feedback:
For the past 2 weeks we dove deep into Swift 5.9’s new @Observable macro. It allows us to completely rethink how the Composable Architecture interacts with SwiftUI.
We will have plenty of episodes about this in the future, but for now here is a thread of our explorations: 🧵
This WWDC Apple introduced a bunch of APIs that use structs with closure properties instead of delegate protocols, a style that may be familiar to Point-Free viewers!
With observability and macros, we couldn’t be more excited for the future of the Composable Architecture.
We will be able to get rid of a whole suite of custom views and rely instead on the tools that come with Swift and SwiftUI!
👋 IfLetStore
👋 ForEachStore
👋 SwitchStore
People often ask: “How should I perform async work from a synchronous context?”, like in a SwiftUI button closure.
In such cases, it seems you have no choice but to spin up an unstructured “Task{…}”, but where should it go? 🤔
Watch for the answer:
The animation(_:) view modifier has been deprecated in SwiftUI, and for good reason! This modifier tried animating *everything* in a view, which is fraught and difficult to get right.
It is safer to use animation(_:value:) for implicit and withAnimation for explicit animations!
Combine's .assign(to:) operator is great because it avoids retain cycles and you don't have to worry about cancellables.
But you can't animate state changes since you can't wrap mutations in withAnimation.
Well... animated schedulers to the rescue!
👉
Good news for those of you that like to control time for previews and tests: our Swift Evolution proposal, “Add `sleep(for:)` to Clock” was accepted and will be back-ported in a future version of Swift!
🥳🕛🥳🕧🥳🕐🥳🕜🥳🕑🥳🕝
We are hard at work putting the finishing touches on the Composable Architecture library.
The repo comes with lots of demo apps and case studies, like this one: a reusable download component that packages up the dependencies and logic necessary to drive this functionality:
We're excited to announce that we are speaking at try! Swift in March!
We will be giving a presentation on testing macros, and we are giving a 3 hour workshop on the Composable Architecture! 😲
Hope to see you there:
We just open sourced a new project: Custom Dump 🎉
Custom Dump is a collection of tools for debugging, diffing, and testing your app’s data structures.
It comes with a nicer replacement for XCTAssertEqual, and can be used to build powerful debug tools.
🎉 Yesterday was Point-Free’s 1 year anniversary! 🎉
Thanks to all of our subscribers that made the first year possible. We’re excited to share what we have planned for 2019!
We just published documentation for several of our open source projects, including the Composable Architecture
📖
Thanks to
@mattt
and all of the
@SwiftDocOrg
contributors, and to
@lukeredpath
for the nudge!
As WWDC24 and 5 years of SwiftUI approaches, let’s talk about…UIKit! 😜
We love SwiftUI, but there are still times you must drop down to UIKit, so we want to show what *modern* UIKit looks like when you model your domains as concisely as possible.
We're celebrating the release of Xcode 13 by making our WWDC 2021 videos free!
Explore SwiftUI's new refreshable and FocusState APIs in vanilla SwiftUI and Composable Architecture, and build a map-powered application from scratch using the searchable API.
Our tour of the Composable Architecture 1.0 has finally come to an end. If you are curious what the library has to offer, then check out the full series here:
We cover navigation, domain modeling, dependencies, and a whole bunch more!
Awesome to see so many functionally-inspired announcements today. A declarative view framework, a reactive framework, and even an Evolution proposal for better DSLs! It’s never been a better time to get into functional programming 😄
We’re about to completely revolutionize the Composable Architecture with Swift’s new Observation framework!
But first, a sneak peek: we’ll take the public beta for a spin to see the concept of a “view store” completely vanish when using the new tools.
👉
Pop quiz time!
How well do you know the Observation framework in Swift?
This seemingly simple view is completely broken. Incrementing does not work at all, but why?
The day is almost over and we just realized that today is the 2 year anniversary of Point-Free! 🎂
Thanks to everyone that has joined us on this journey. We have a lot more planned in the future, this is only the beginning 😉
Oh, and did we mention that the new observation tools in the library have been back-ported all the way back to iOS 13?
This means you can use the tools immediately, even if you aren't able to target iOS 17+! 🤯
We’re about to completely revolutionize the Composable Architecture with Swift’s new Observation framework!
But first, a sneak peek: we’ll take the public beta for a spin to see the concept of a “view store” completely vanish when using the new tools.
👉
The Composable Architecture is now 4 years old! 🥳
We released 0.1.0 of the library on May 4th, 2020, and since then have had:
• 191 contributors
• 116 releases
• 1,270 pull requests
• 57,000 Slack messages
• …more than 1,200 GitHub discussions.
The macro bonanza train keeps on rollin’…
Today we are releasing a huge update to our Dependencies library that makes it easier than ever to use structs-of-closures to design your dependencies, and ditch the protocols.
Learn more:
We almost missed this, but today marks the 2 year anniversary since we released the Composable Architecture, and we recently just crossed 6k stars! 🥳
We've got some really excited updates coming very soon. Stay tuned!
Macros are one of the most celebrated new features of Swift, and many of us are excited to adopt them in our projects.
But unfortunately, there seems to be hidden costs and open questions: what does it take to actually ship a library of macros?!
Next week Xcode 15 and Swift 5.9 are officially released, and to celebrate we are going to start a brand new series of episodes.
And we even have a brand new open source project we are releasing! 👀
This week we finished our 7-part tour of the Composable Architecture. If you are interested in learning more about the library this is where to start.
We have some really big plans for the library, but that will have to wait a bit more time.
Until then:
Finally, an update to SnapshotTesting! 🤳
We just released 1.10.0, with contributions from 26 members of the community, including better support for diffing images between Intel/M1 Macs, 90+% speed improvement for images, Windows support, and more:
It's been a fascinating project bringing up Arc on Windows. Thanks to
#pointfree
's work on TCA, we've been able to readily share a remarkable amount of code across macOS and Windows using Swift -- all while building out a truly native UX powered by Win UI 3.
Want to use Swift's new observation tools but stuck on iOS 16 or earlier?
No problem. We’ve backported those tools, and their SwiftUI counterparts, all the way back to iOS 13!
Check it out:
Our tour of the Composable Architecture 1.0 begins with:
• domain modeling
• side effects
• effect cancellation
• dependency management
• testing
• …and more!
That's a lot of material to cover in just 57 mins, and the episode is ✨free✨!
Our PR to add Clock.sleep(for:) to the Swift standard library has been merged into the 5.8 branch!
Soon you will be able to easily make your time-based asynchronous code more controllable and testable. 😊
Which code base would you rather work in?
• One gigantic app target with all your source files
• Or, individual modules for each feature that can be built, tested and previewed without building the whole app?
Learn more in this week's 🆓 episode:
Which of the following test failure messages would you rather come across in Xcode?
If you said the second, then you might be interested in our new Custom Dump library which ships with a drop-in replacement XCTAssertEqual.
Learn more here:
We just released 1.1 of Perception, our backport of Swift's observation tools.
• Support for scenes, commands, tables, etc…
• Support for @Environment and environment(_:)
• Support for visionOS
• Small fixes and improvements.
Enjoy!
Wanna peek into how we plan episodes? 👀
Check out the 17,000 word document that we wrote for the last 4 episodes on Point-Free:
We worked on this episode for weeks and then performed a marathon recording session of over 6 hours in a single day 🥵
People keep asking us why the Composable Architecture is not 1.0 yet, and so we decided to share our roadmap for the next few months. Feedback welcome!
A “fun” part of running a video series for 5 years is that we get to see how our styles have changed over time.
So, who wore it best?
Stephen or Shrek?
Brandon or Rachel?
It’s hard to believe it’s been a whole year since we first open sourced the Composable Architecture! 🥳🎂 Since then:
- 22 releases
- 3.7k stars
- 284 pull requests
- 84 GitHub discussions + 222 Swift forum posts
- Many apps in production you’ve shared!
We are open sourcing two new libraries today!
URLRouting: A general purpose URL router for both client-side and server-side applications.
VaporRouting: A bidirectional Vapor router with more type safety and less fuss.
Read more:
There already is! Just do the following in Xcode:
1. File > Add Packages...
2. Click the "+" in the bottom-left
3. Paste in the URL
4. Click "Load" and then "Add Collection"
5. Import one of our libraries in any Swift file!
@pointfreeco
, will there be an official swift package collection of all your open source libraries?
While its not crucial in any way, I think it would be an awesome 🎄🎁 for your follower cult (myself included 😀).
This is a cool way to visualize the modularity of a code base, such as
@isowords
:
This is 92 Swift modules that can be built, tested, and many can even be run, in isolation. It's a fantastic way to develop.
A week ago today we released a brand new open source library, SwiftUI Navigation:
Since then the library has been starred over 500 times! 💫
Thanks to everyone for their interest! Navigation seems to be quite the evergreen topic in iOS 😁
We've got a new open source project to announce: Identified Collections
It sits somewhere between an OrderedSet and an OrderedDictionary, and is perfect for list views that use Identifiable, such as ForEach in SwiftUI.
Check it out!
Today (well, yesterday) is the 5 year anniversary of Point-Free! 🥳
There's no episode this week, but we do have two special announcements:
• Our first ever livestream will be this Wednesday, Feb 1st.
• A new Point-Free Slack that anyone can join.
There’s no new episode this week while we let the WWDC dust settle, but next week we will be kicking off a brand new series on a very important topic: testing async code.
We’re also already planning episodes on macros, observability, and more. Stay tuned!
A few weeks ago we made use of Swift's powerful runtime metadata to compute the "tag" of any enum.
Then we realized we could leverage that power to provide a huge performance boost to a critical part of the Composable Architecture 🤯
Learn how 👉
Swift 5.9 and macros are here! 🎉
To celebrate, we are releasing a brand new tool to aid in writing tests for them. First, let’s explore testing macros using the tools that Apple provides, evaluate their shortcomings, and see how we can address them.
👉
The 1.0 release of the Composable Architecture is finally on the horizon!
So, how can you prepare? We just outlined steps you can take today to ensure your project is ready:
This week we published an interesting blog post showing how to create noticeable, yet unobtrusive, runtime warnings in Xcode.
We now use this technique in the Composable Architecture to notify users when certain internal invariants are broken.
Learn how:
This demo is showing that TCA can be used to build UIKit apps just as easily as SwiftUI apps.
Both versions run off the same source of truth, which means when you close one game and open the other, it automatically resumes where you left off.
Deep-linking without the pain 🤯
This week we are releasing the biggest update to the Composable Architecture in over 2 years ago, bringing Swift’s concurrency tools to the library. To celebrate we will demonstrate how these tools can massively simplify a few real-world applications.
👉
We celebrate the release of the Composable Architecture’s new reducer protocol and dependency management system by showing how they improve the case studies and demos that come with the library, as well as a larger more real-world application.
👉
We published a 2018 Year-in-Review to summarize some of our favorite Point-Free accomplishments this year.
* 41 episodes
* 19 hours of video
* 25 blog posts
* 8 open source libraries based on our episodes
* and more!
The Composable Architecture's fundamental unit of effect is modeled on Combine publishers because it was the most modern asynchrony tool at the time. Now Swift has native concurrency tools, and so we want to make use of those tools in the library.
👉
Today also marks our 100th episode! 🥳
To celebrate, let’s take a tour of our brand new open source library. We’ll look at what’s changed from previous episodes and build a brand new app with it: