SwiftUI Handbook 📙
Welcome to the SwiftUI Handbook, your ultimate guide for mastering SwiftUI’s declarative UI framework. From foundational concepts to advanced techniques, this handbook offers practical insights and code examples for building beautiful iOS apps. Whether you’re a beginner or a seasoned developer, you’ll find valuable tips to streamline your development process and create high-quality apps.
GETTING STARTED WITH SWIFTUI
Introduction to the world of SwiftUI for all aspiring developers.
- Introduction to SwiftUI
- SwiftUI vs UIKit – Declarative vs. Imperative Programming
APP STRUCTURE
APP STRUCTURE: Navigation
- SwiftUI Navigation Patterns for Modern App Architecture
- NavigationStack in SwiftUI
- NavigationLink in SwiftUI
- TabView in SwiftUI
- NavigationBarItem in SwiftUI
- NavigationSplitView in SwiftUI
APP STRUCTURE: Navigation, Modal Presentations
APP STRUCTURE: App Lifecycle, Scenes, Scene Phases
APP STRUCTURE: Toolbars
APP STRUCTURE: Search
APP STRUCTURE: Design System
- How to create a Design System in your SwiftUI App
APP STRUCTURE: Design Patterns
- Frequently used App Design Patterns in SwiftUI
- MVVM Design Pattern in SwiftUI
- Observer Pattern in SwiftUI
- Singleton Pattern in SwiftUI
- Builder Pattern in SwiftUI
- Strategy Pattern in SwiftUI
- Factory Pattern in SwiftUI
- Adapter Pattern in SwiftUI
- Facade Design Pattern in SwiftUI
- Other Patterns: State Pattern, Delegation Pattern, Memento Pattern, Iterator Pattern, Prototype Pattern, Multicast Delegate Pattern, Flyweight Pattern, Mediator Pattern
APP STRUCTURE: Error Handling
VIEWS
VIEWS: Basics
- How to create Reusable Views in SwiftUI
- Modifier Order in SwiftUI
- View, ViewBuilder, ViewModifier in SwiftUI
- View LifeCycle Updates in SwfitUI: onAppear, onDisappear, task
- View configurations
- View styles
- AnyView, EmptyView, EquatableView, SubscriptionView, TupleView
VIEWS: Text input and output
- TextField in SwiftUI
- Text in SwiftUI
- SwiftUI Label
- TextEditor in SwiftUI
- SecureField in SwiftUI
- Fonts in SwiftUI – System Fonts, Custom Fonts, Font Designs, Font Style
- Text alignment and layout in SwiftUI
- Keyboard Types in SwiftUI
- Localizing Text in SwiftUI with LocalizedStringKey
- Testing Localizations in SwiftUI
VIEWS: Controls and Indicators
- Button
- Special-Purpose Buttons: EditButton, PasteButton, Rename Button
- Linking to other content: Link, ShareLink, SharePreview, TextFieldLink, HelpLink
- Slider, Stepper, Toggle in SwiftUI
- Choosing from a set of options: Picker, PaletteSelectionEffect
- DatePicker in SwiftUI
- MultiDatePicker in SwiftUI
- ColorPicker in SwiftUI
- Gauge in SwiftUI – Linear Gauge, Circular Gauge
- ProgressView in SwiftUI
- Indicating Missing Content: ContentUnavailableView
- Providing Haptic Feedback: SensoryFeedback
- Sizing Controls: ControlSize
- ControlActiveState
VIEWS: View Layout
- List
- ScrollView
- Safe Areas
- HStack, VStack, LazyHStack and LazyVStack
- SwiftUI ZStack Layering Techniques
- Spacer vs Frame Modifier – Effective Content Positioning
- Grids in SwiftUI, LazyHGrid, LazyVGrid, GridItem, GridRow
- View Groupings: Group, Form, ControlGroup
- Picking Container View for Content
- Fitting layout: ViewThatFIts Separators: Spacer, Divider
- Layout Adjustments: Margins, safe areas, direction, scale, paddings, margins, Edges
- Custom Layouts: LayoutSubview, ViewSpacing, AnyLayout, HStackLayout, VStackLayout, ZStackLayout, GridLayout
- Tables
- View Size and Framing: width, height, maxwidth…, resizing, scaledtofit
- View Positioning and Alignment
- View Padding and Margin
Views: Menus and Commands
Views: View Styles
- ButtonStyle
- PickerStyle and DatePickerStyle
- MenuStyle
- ToggleStyle
- GaugeStyle
- ProgressViewStyle
- LabelStyle
- TextfieldStyle
- TextEditorStyle
- TableStyle
- ListStyle
VIEWS: Images
VIEWS: Measuring a view
SHAPES
- Rectangular Shapes: Rectangle, RoundedRectangle, RoundedCornerStyle, UnevenRoundedRectangle
- Circular Shapes: Circle, Ellipse, Capsule
- Custom Shapes: Path Shape Behavior: ShaveRole, StrokeStyle, FillStyle, FullShapeView, StrokeBorderShapeView
- Transforming a shape: ScaledShape, ROtated Shape, OffsetShape, TransformedShape
DRAWING AND GRAPHICS
- Canvas, GraphicsContext, Border, Foregreound style, Background Style
- Styles: System Styles: System Colors, Materials, Hierarhical Styles, BlendMode,
- Gradients: Elliptical, Linear, Radial, Angular
- Semantic Colors in SwiftUI: AccentColor, primary, secondary, custom color
- Tint Color
EVENT HANDLING
DATA AND STORAGE
DATA AND STORAGE: Model Data
- State and StateObject in SwiftUI
- State and Binding in SwiftUI
- Bindable in SwiftUI
- @Bindable versus @State in SwiftUI
- Differences between @Binding and @Bindable in SwiftUI
- Observable protocol in SwiftUI
- Environment property wrapper in SwiftUI
- MVVM
- Structs Vs. Classes In SwiftUI: When To Use Each And Why We Use Classes In SwiftData
DATA AND STORAGE: Persistent Storage
DATA AND STORAGE: SwiftData
- SwiftData Tutorial – How To Implement SwiftData in SwiftUI App
- How To Display Sample SwiftData In SwiftUI With PreviewModifier
- Learn how to work with Xcode Previews in SwiftData App
DATA AND STORAGE: Files, Data Persistence, JSON
- Codable, Deodable, JSON Decoding