---
title: "In objectiveC extend a @protocol implementation"  
description: "In objectiveC extend a @protocol implementation"  
author: "Pravesh Singh"  
published: 2015-11-25  
updated: 2015-12-14  
canonical: https://www.mindstick.com/forum/33635/in-objectivec-extend-a-protocol-implementation  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# In objectiveC extend a @protocol implementation

I have created a [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp) **CountryListViewController** which [inherits](https://www.mindstick.com/interview/85/what-is-a-subclass) from **UIViewController**.\
I [define](https://yourviews.mindstick.com/audio/1110/lifestyles-choices-that-define-our-lives) an [delegate](https://www.mindstick.com/articles/777/delegate-and-event-in-c-sharp) '**CountryDelegate**' in this class.

[now](https://yourviews.mindstick.com/view/81402/it-s-liberals-vs-progressives-in-us-politics-now), how can I inherit this delegate in another class and also can I [extend](https://www.mindstick.com/forum/2353/how-to-implements-of-inheritance-in-java) the old **webViewDidFininshLoad:** [method](https://www.mindstick.com/forum/166/webservice-method); because I want to [execute](https://www.mindstick.com/interview/49/how-can-i-execute-a-php-script-using-command-line) some [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) after the webViewDidFinishLoad from the [super](https://yourviews.mindstick.com/story/4496/5-super-ayurvedic-food-for-bodybuilding) class.

## Replies

### Reply by Tarun Kumar

To override webViewDidFinishLoad: method after implimenting the protocol and change or extend the behavior like this:\
ViewController.h

```
ViewController : UIViewController {}- (void)customWebViewDidFinishLoad:(UIWebView *)customWebView;
```

ViewController.m

```
- (void)webViewDidFinishLoad:(UIWebView *)webView {    [self customWebViewDidFinishLoad:self.webView];} // Override this method in CustomViewController.m- (void)customWebViewDidFinishLoad:(UIWebView *)webView {    // Default behavior}
```

CustomViewController.h

```
CustomViewContorller : ViewController
```

CustomViewController.m

```
- (void)customWebViewDidFinishLoad:(UIWebView *)webView {  [super customWebViewDidFinishLoad:webView];  //Extend the behaviour here}
```


---

Original Source: https://www.mindstick.com/forum/33635/in-objectivec-extend-a-protocol-implementation

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
