BLACK FRIDAY: Save 50% on all my Swift books and bundles! >>

proyect 14

Forums > 100 Days of SwiftUI

I am in proyect 14 and uo until this moment, i thougt that when you create a method in a class/Struct you should call it when you use it.

But in the mapkitView whe are creating methods an we are not calling them in any place, can some one tell me why this works?

3      

Are you talking about the methods inside struct MapView: UIViewRepresentable eg

func makeUIView(context: Context) -> MKMapView { }

func updateUIView(_ view: MKMapView, context: Context) { }

func makeCoordinator() -> Coordinator { }

These are called by the complier this is why they are required in the protocol of UIViewRepresentable so even if you do not call them directly when you put MapView() in your View you are call them via that.

3      

woooo, thank you!!!

That's the thing i miss about all the courses not this. I lost a lot of time with this little things. It will be cool if they explain how to read the documentation in real time while doing the apps.

I thougth it was call automatic but not why.

3      

Save 50% in my WWDC sale.

SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.