How to make ViewController comply with several protocols?

I want to enable Core Location, and I'm trying to follow this guide: http://www.mobileorchard.com/hello-there-a-corelocation-tutorial/ , and I am using SDK 3.2.2.

@interface MainViewController : UIViewController <FlipsideViewControllerDelegate>{ is the code right now.

+4
source share
2 answers

If you want the class to conform to several protocols, you simply separate the protocol names in <> commas:

 @interface MyClass : TheSuperclass <Protocol1, Protocol2, Protocol3> ... @end 

etc.

In your case:

 @interface MainViewController : UIViewController <FlipsideViewControllerDelegate, CLLocationManagerDelegate> ... @end 
+8
source

@interface MainViewController : UIViewController <FlipsideViewControllerDelegate, CLLocationManagerDelegate>{

+1
source

Source: https://habr.com/ru/post/1306421/


All Articles