Managing safe area in SwiftUI 03 Nov 2021 A safe area defines the area within a view that isn’t covered by a navigation bar, tab bar, toolbar, or other views. SwiftUI views respect safe areas out of the box. But there are plenty of situations when you need to customize this behavior. This week we will learn how to manage the safe area in SwiftUI. Enhancing the Xcode Simulators. Compare designs, sh
Every year as new OS and Swift versions are released, the question comes up over and over again: “how do I use this new thing while also supporting older versions?”. While we have a bunch of “availability” tools at our disposal (and I’ll be using them in this post), they always come across as somewhat cumbersome: we need to do inline checks, or we have conditional logic flow that obfuscates the in
struct LabelView: View { @Binding var outputText: String // ←この `@Binding var` var body: some View { Text(outputText) } } 何故このようなコードを書くかと言うと、おそらく多くの人は特に深く考えたことなく、単純に「@State var の inputText の値を流し込むから、@Binding var を条件反射で書いた」的な思考ではないかと思います。 しかし、実は outputText に関しては、@Binding var にする必要なく、単純に let でも問題ないのです。 何故 let でいけるのかと言うと、@Binding の役割と、View が何のかを理解しておく必要があります。 まず @Binding はどう言う役割かと言うと、これは「この値を変更するので、変
unit and acceptance testing, automation, productivity How do you write unit tests for a SwiftUI application? SwiftUI, with its declarative approach to UI development and its opaque types, doesn't lend itself to writing unit tests. Are UI and snapshot tests our only option? Should we generate multiple Previews for every behavior permutation of our views? The answer is simpler and doesn't require an
The Complete Guide to SF Symbols Example code, tips, and techniques for both SwiftUI and UIKit SF Symbols allows us to render a huge and growing variety of icons inside our apps, and every year it gets bigger – not only do many more icons get added, but iOS 14 added the ability to render multicolor icons and iOS 15 added the ability to have complete control over individual layers. In this article
The Ultimate Guide to the SwiftUI 2 Application Life CycleSwiftUI 2 For the longest time, iOS developers have used AppDelegates as the main entry point for their applications. With the launch of SwiftUI2 at WWDC 2020, Apple has introduced a new application life cycle that (almost) completely does away with AppDelegate, making way for a DSL-like approach. In this article, I will discuss why this ch
SwiftUI simplifies the development process by providing a clean, easy-to-learn syntax and reducing the amount of boilerplate code required to create responsive, modern user interfaces, making it a powerful tool for building apps quickly and efficiently. Do take note that building your project with SwiftUI means your app only runs on iOS 13, macOS 10.15, tvOS 13, and watchOS 6 ViewVStackHStackZStac
Bye-bye AppDelegate! You can now build SwiftUI apps with the new App protocol and lifecycle, without needing an app- or scene delegate. How does the SwiftUI App lifecycle work? And how do you configure it? Let’s find out! In this app development tutorial, we’ll discuss: How the SwiftUI App lifecycle and your App struct worksWorking with @main, scenes and lifecycle eventsBootstrapping your app’s UI
What does the SceneDelegate class in your iOS project do? In Xcode, the scene delegate and/or app delegate is added automatically for the default iOS app project template. What are these delegates for, exactly? In this tutorial, we’ll dive into the scene and app delegates in Xcode, and how they affect SwiftUI, Storyboards and XIB based UIs. You’ll learn about: The app delegate and scene delegateHo
Before you switch to a custom font don’t overlook how much you can tweak the appearance of the system fonts. A quick review of some font APIs that work for both UIKit and SwiftUI. Tweaking The System Fonts Here’s my starting point. I’m using dynamic type with a large title and body text. I’m not going to spend time on the layout details. (See this post on scroll view layouts for a UIKit example).
Mastering SwiftUI previews 10 Mar 2021 This week, I want to talk about one of the most powerful Xcode features, SwiftUI previews. SwiftUI previews allow you to look at your SwiftUI views inside Xcode without running the app in the simulator. You can also preview UIKit views and controllers by wrapping them in SwiftUI. Today we will learn about all the powerful features of previews in Xcode. Enhanc
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く