I wanted to check if it is necessary to compile the code before using a just created extension. As a test, I created a sample extension
extension String {
func checkExtension() {
}
}
When I did that, neither did I save the changes in the Swift file, nor did I compile the code. But checkExtension
was available for a String
variable.
Query : How does SDK know without compilation, that an extension has been created and it's functions can be used in the corresponding class ?