In Xcode 14.0 Beta 2 Combine has received a super welcome update! They've added primary associated types to Publisher so now we can write "some Publisher<Output, Error>" instead of erasing to AnyPublisher!
Learn more about primary associated types here: https://t.co/j4PxAAWHAB
@art_garzajr You could very easily make this work with more than just arrays, could even work with non-contiguous collections of any type that conforms to equatable and comparable. with only a few changes.
@swiftbysundell FYI you have the same issue in your post. You use a SettingsConvertible protocol when you should just add buildExpression to your result builder to convert the single setting into a settings group. It ends up much cleaner and one less type with extensions in code
@twannl in your "Result builders in Swift explained with code examples" you introduce a LayoutGroup protocol to fix the variadic error. You can fix this with result builders without needing to muddy NSLayoutConstraint with the protocol conformance. 1/2
@twannl 2/2 result builders have a buildExpression designed for this purpose, and you can use that instead. The "Write a DSL in Swift using result builders" WWDC video covers this exact error and solves it with the expression builder. https://t.co/zUYp7QHPmz
@twannl How’d you go with exploring this? I opened the post today to share it and noticed it’s still using the LayoutGroup protocol when it could use buildExpression.
⚠️ Don't skip UIKit!
If you are looking for an iOS developer job, I have one advice for you:
• Don't skip UIKit!
I know UIKit is hard to learn, but almost all apps are developed with UIKit.
P.S. With UIKit you will have more control.
#iosdev