Skip to content

Mastering Modern iOS Networking & Unleashing Swift Macros

S
Hosted By
Saraswathy R. and 3 others
Mastering Modern iOS Networking & Unleashing Swift Macros

Details

Hi Everyone,

Here we are, back again with yet another season of Expert Talks in Chennai. We are thrilled to host you on 19th July 2025 at Holiday Inn, Thiruvanmiyur (Wodeyar Conference Hall, 2nd Floor). Please join us from 10:00AM to 1:00PM. Event details are as follows:

Agenda :
1. Welcome & Intros (10 mins)
2. Talk 1: Mastering Modern iOS Networking: Async/Await, URLSession & Beyond (45 mins)
3. Break (15 mins)
4. Talk 2: Unleashing Swift Macros: Write Less, Do More with Compile-Time Power (45 mins)
5. Tea & Networking

Talk 1: Mastering Modern iOS Networking: Async/Await, URLSession & Beyond

The networking landscape in iOS has evolved dramatically with Swift Concurrency. In this talk, we’ll go beyond the basics and explore how to build a powerful, scalable, and testable networking layer using async/await, URLSession, and modern Swift patterns.

Through real-world examples, we'll cover advanced JSON decoding techniques, request interception using URLProtocol, task cancellation, retry strategies, typed endpoint modeling, and more. We'll also discuss clean architecture principles and how to future-proof your networking code for large-scale apps.

Whether you're building a simple client app or architecting for scale, this session will equip you with tools and patterns to make your networking code clean, robust, and secure.

Outline
1. The Basics, Done Right (3 minutes)

  • URLSession with async/await
  • Safe JSONDecoder usage (e.g., .convertFromSnakeCase, optional decoding)
  • Common pitfalls (e.g., force unwrapping, decoding failure crashes)

2. Advanced JSON Decoding Patterns (7 minutes)

  • enum CodingKeys, optional properties, default values
  • Nested containers, type aliases for clarity
  • Handling dynamic keys (dictionary-style JSON)
  • Polymorphic decoding (using a "type" discriminator)

3. Designing a Scalable API Layer (8 minutes)

  • Typed APIEndpoint enums with associated values
  • Generic NetworkClient with typed decode/return
  • Encapsulate headers, method, path, query

4. Auth, Token Refresh & Secure Practices (7 minutes)

  • Use an actor for safe token refresh
  • Automatic token injection (via middleware or request decorator)
  • Handling 401 errors and retrying

5. Retry, Cancellation, and Request Throttling (5 minutes)

  • Using Task {} and .cancel() on inflight tasks (e.g., search)
  • ExponentialBackoffRetry logic
  • Throttling API calls via AsyncSemaphore or rate limiter

6. Demo App Walkthrough, Q&A (15 minutes)

  • Typed endpoint enums
  • Token refresh & retry middleware
  • Decoding dynamic JSON from an API

Talk 2: Unleashing Swift Macros: Write Less, Do More with Compile-Time Power

Swift Macros mark a new era for meta-programming in Swift, empowering developers to generate boilerplate code at compile time. This leads to more concise and declarative code, enhancing safety, minimizing repetition, and facilitating smarter architectural designs.

This 45-minute session will delve into the core concepts of Swift macros, explore practical applications, and guide you through the process of creating your own macros using SwiftSyntax and compiler plugins. Attendees will gain a deep understanding of macro expansion mechanisms and learn how to leverage this feature to enforce coding patterns, boost consistency, and optimize their codebases.

Swift Macros will transform your approach to writing Swift, whether you're aiming to simplify your models or generate domain-specific code.

Outline
1. Introduction to Meta-Programming (5 minutes)

  • What is Meta Programming?
  • Examples from other languages (Rust, Kotlin, Python)

2. What are Swift Macros? (10 minutes)

  • Overview of Swift Macros (freestanding & attached)
  • Why they were introduced in Swift 5.9/6
  • Benefits: compile-time safety, zero runtime cost

3. Under the Hood: How Macros Work (5 minutes)

  • SwiftSyntax, macro expansion, and compiler plugins
  • How Xcode handles macros behind the scenes

4. Real-World Use Cases (10 minutes)

  • @AutoCodable: Generate Codable conformance
  • @LogCall: Automatic logging wrappers
  • @Builder: DSL-style macro for clean object creation
  • Reducing architectural boilerplate
  • Unit Test Generators

5. Demo (10 minutes)

  • Create a custom attached macro with SwiftSyntax
  • Show macro input → expansion → result
  • Debugging and tooling tips

6. Limitations and Q&A (5 minutes)

  • Debugging macro-generated code
  • Limitations (compile-time only, IDE support)
Photo of Expert Talks Chennai group
Expert Talks Chennai
See more events
Expert Talks Chennai
Photo of Expert Talks Chennai group
No ratings yet
Holiday Inn Chennai OMR IT Expressway, an IHG Hotel, 110 Rajiv Gandhi Salai, Old, Mahabalipuram Rd, PTK nagar, Thiruvanmiyur, Ch
Holiday Inn Chennai OMR IT Expressway, an IHG Hotel, 110 Rajiv Gandhi Salai, Old, Mahabalipuram Rd, PTK nagar, Thiruvanmiyur, Ch · Chennai
Google map of the user's next upcoming event's location
FREE
88 spots left