Extensions
Last updated
What is Extensions?
Extensions in Swift are a way to add new functionality to an existing class, structure, enumeration, or protocol type. They allow you to extend types even if you don't have access to the original source code. Extensions can add computed instance properties, define instance methods and type methods, provide new initializers, define subscripts, define and use new nested types, and make an existing type conform to a protocol.
Free resources to learn Extensions
More in stage 24: What is SwiftUI
Extensions: common questions
Can I learn Extensions in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Extensions in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this Extensions tutorial for beginners?
It is lesson 60 of 156 in the free Swift & Swift UI roadmap, in stage 24, What is SwiftUI. If you are new to Swift & Swift UI, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.