Last active
August 29, 2015 14:16
-
-
Save fozoglu/2350a45d2bb53a97e69b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@class A_ContainerVC; | |
@protocol A_ContainerVCDelegate <NSObject> | |
-(void)sendValue:(NSString *)Name; | |
@optional | |
@end | |
@interface A_ContainerViewController : UIViewController | |
@property(nonatomic,assign) id <A_ContainerVCDelegate> delegate; | |
- (IBAction)btnSend:(id)sender; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "A_ContainerViewController.h" | |
@interface A_ContainerViewController () | |
@end | |
@implementation A_ContainerViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view. | |
} | |
- (void)didReceiveMemoryWarning { | |
[super didReceiveMemoryWarning]; | |
// Dispose of any resources that can be recreated. | |
} | |
/* | |
#pragma mark - Navigation | |
// In a storyboard-based application, you will often want to do a little preparation before navigation | |
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | |
// Get the new view controller using [segue destinationViewController]. | |
// Pass the selected object to the new view controller. | |
} | |
*/ | |
- (IBAction)btnSend:(id)sender { | |
NSString *text=@"Tutorial"; | |
[self.delegate sendValue:text]; | |
} | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
#import "ViewController.h" | |
#import "A_ContainerViewController.h" | |
@interface B_ContainerViewController : UIViewController | |
@property (strong, nonatomic) IBOutlet UILabel *lbl_B_VC; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "B_ContainerViewController.h" | |
@interface B_ContainerViewController ()<MainVCDelegate> | |
@end | |
@implementation B_ContainerViewController | |
@synthesize lbl_B_VC; | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view. | |
} | |
- (void)didReceiveMemoryWarning { | |
[super didReceiveMemoryWarning]; | |
// Dispose of any resources that can be recreated. | |
} | |
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender | |
{ | |
if ([segue.identifier isEqualToString:@"B"]) { | |
[(ViewController *)segue.destinationViewController setDelegate:self]; | |
/* | |
LayersViewController *layersViewController = (LayersViewController*)segue.destinationViewController; | |
layersViewController.name=@"Deneme"; | |
*/ | |
} | |
} | |
-(void)sendValue2:(NSString *)Name{ | |
lbl_B_VC.text=Name; | |
} | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
#import "A_ContainerViewController.h" | |
@class MainVC; | |
@protocol MainVCDelegate <NSObject> | |
-(void)sendValue2:(NSString *)Name; | |
@end | |
@interface ViewController : UIViewController | |
@property(nonatomic,assign) id <MainVCDelegate> delegate; | |
@property (strong, nonatomic) IBOutlet UILabel *lblVC; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "ViewController.h" | |
@interface ViewController () <A_ContainerVCDelegate> | |
@end | |
@implementation ViewController | |
@synthesize lblVC; | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view, typically from a nib. | |
} | |
- (void)didReceiveMemoryWarning { | |
[super didReceiveMemoryWarning]; | |
// Dispose of any resources that can be recreated. | |
} | |
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender | |
{ | |
if ([segue.identifier isEqualToString:@"A"]) { | |
[(A_ContainerViewController *)segue.destinationViewController setDelegate:self]; | |
} | |
} | |
-(void)sendValue:(NSString *)Name{ | |
lblVC.text = Name; | |
[self.delegate sendValue2:Name]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment