Book Update: Thinking in SwiftUI
OBJC Blog
by
7M ago
Today we're very happy to announce that our book Thinking in SwiftUI is updated for iOS 17, and available in both PDF as well as print. After releasing the previous edition we have held a large number of workshops and gained a lot more experience with both SwiftUI itself as well as teaching the material. Because of this, we decided to rewrite the book from scratch. The new book contains better explanations, and a lot more visuals, diagrams, and examples. During the writing of this new edition iOS 17 came out, which brought a lot of updates to SwiftUI. We decided to include all the relevant cha ..read more
Visit website
Book Update: Thinking in SwiftUI
OBJC Blog
by
11M ago
During the last months, we have worked hard at updating our book Thinking in SwiftUI. Over the past years, we had the chance to conduct SwiftUI workshops for many companies. Based on this experience and the feedback we got, our approach to explaining SwiftUI has evolved a lot. Therefore, we chose to do a full rewrite of the book to be on par with our workshops. The general structure still is very similar to the previous edition, but the content is brand new. We put a lot of emphasis on explaining view trees (which in fact will be the first chapter of the book) in this new edition, as well as h ..read more
Visit website
Thinking in SwiftUI: Live Q&A
OBJC Blog
by
11M ago
During the last months, we have worked hard at updating our book Thinking in SwiftUI. Now that WWDC23 is behind us, we don't just want to release a finished book — instead, we will update it for all the new APIs. Due to this transition phase, we've decided to release the new edition as a beta version. We plan to put out the chapters one by one as we're integrating new iOS 17 topics. During this prerelease phase, we're also hosting a weekly Q&A live stream. The first live stream will be Friday the 16th at 18:00 CEST (9am PST). You can submit any questions you have for us over at this Github ..read more
Visit website
Transitions in SwiftUI
OBJC Blog
by
2y ago
During our SwiftUI Workshop we often notice that very few people seem to know about transitions, even though they're not very complicated and incredibly useful. Transitions happen when a view is removed from the view tree, or added to the view tree. However, if you've done some SwiftUI, you will have noticed that there is no actual way to add views to the view tree — there is no addSubview(_:). Instead, you can only add and remove views through the combination of a state change and using an if statement (or switch or ForEach). In other words, views are somehow added and removed for us automati ..read more
Visit website
Aspect Ratios in SwiftUI
OBJC Blog
by
2y ago
One of the modifiers that always puzzled me a bit was .aspectRatio. How does it really work? Once I figured it out, it turned out to be simpler than I thought. One place where we can find out a lot about how SwiftUI works is SwiftUI's .swiftinterface file. This is located inside of Xcode. Inside your Terminal, go to /Applications/Xcode.app, and perform the following command: find . -path "*/SwiftUI\.framework*swiftinterface" There are a few variants of the .aspectRatio API, but they all boil down to a single implementation: func aspectRatio(_ aspectRatio: CGFloat?, contentM ..read more
Visit website
Advanced Swift: 5th edition
OBJC Blog
by
2y ago
Today we're very happy to announce that the fifth edition of our book Advanced Swift is ready! This is a big update, including a new chapter about concurrency, as well as many other additions about result builders, property wrappers, opaque types, existentials and more. The book is available today, directly from our site. For the first time, the paper version of Advanced Swift is now available as a hardcover book directly from Amazon. If you already own an Ebook edition of Advanced Swift, this is a free update (please use the download link in the original receipt). Best from Berlin Chris, Ole ..read more
Visit website
Transactions and Animations
OBJC Blog
by
2y ago
In SwiftUI, there are many different ways to animate something on screen. You can have implicit animations, explicit animations, animated bindings, transactions, and even add animations to things like FetchRequest. Implicit animations are animations that are defined within the view tree. For example, consider the following code. It animates the color of a circle between red and green: struct Sample: View { @State var green = false var body: some View { Circle() .fill(green ? Color.red : Color.green) .frame(width: 50, height: 50) .ani ..read more
Visit website
Why Conditional View Modifiers are a Bad Idea
OBJC Blog
by
2y ago
In the SwiftUI community, many people come up with their own version of a conditional view modifier . It allows you to take a view, and only apply a view modifier when the condition holds. It typically looks something like this: // Please don't use this: extension View { @ViewBuilder func applyIfM: View>(condition: Bool, transform: (Self) -> M) -> some View { if condition { transform(self) } else { self } } } There are many blog posts out there with similar modifiers. I think all these blog posts should come with a ..read more
Visit website
SwiftUI Layout Explained: Free to watch!
OBJC Blog
by
3y ago
? As a little Christmas present to the community, we're making our entire SwiftUI Layout Explained video series free to watch until the end of the year. ? A central piece of every UI framework is its layout system, and SwiftUI is no exception. Without a good understanding of the layout system, building user interfaces quickly becomes frustrating. We did a lot of research for our book, Thinking in SwiftUI , but even so we kept encountering layout behavior that we couldn't really make sense of. We decided to go one step further, and reimplement SwiftUI's layout system, along with the layout beha ..read more
Visit website
Book Update: Thinking in SwiftUI
OBJC Blog
by
3y ago
Over the last few months, we have been busy updating our book, Thinking in SwiftUI . Today, we're glad to release it as a free update, improved and expanded for the latest version of SwiftUI. The new version refines existing explanations and adds sections for new features. Writing the original book, we decided to focus on the essence of SwiftUI, and luckily very little has changed: if you have read the first edition, you will be well-prepared for any upcoming changes. The most important additions include: New sections on function builders — they now support switch statements, if let , and ha ..read more
Visit website

Follow OBJC Blog on FeedSpot

Continue with Google
Continue with Apple
OR