One approach is to define a protocol:
SettingsDelegate.h:
@protocol SettingsDelegate
- (void)settingsUpdated:(NSDictionary *)newSettings
@end
Include this header in both of your view controllers. Have viewController conform to this protocol. Establish a weak reference from settings controller to viewcontroller, e.g.
SettingsViewController.m:
@interface SettingsViewController ()
@property (readwrite, weak) id<SettingsDelegate> settingsDelegate;
@end
When settingscontroller is instantiated, set self.settingsDelegate
to the viewcontroller. Assuming you create the settingscontroller from the viewcontroller, it would be something like this:
viewController.m:
SettingsController *settingsController = [[SettingsController alloc] init];
settingsController.settingsDelegate = self;
// present the settingsController
In settings controller, when the settings are updated:
if (self.settingsDelegate) {
NSDictionary *newSettings = ...; // set this value
[self.settingsDelegate settingsUpdated:newSettings];
}
For more details, see Apple's Working with Protocols: https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithProtocols/WorkingwithProtocols.html