Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retain cycle #2

Closed
pilot34 opened this issue Oct 31, 2015 · 2 comments
Closed

Retain cycle #2

pilot34 opened this issue Oct 31, 2015 · 2 comments
Assignees

Comments

@pilot34
Copy link

pilot34 commented Oct 31, 2015

Hi!

I have some misunderstanding. In you code we have retain-cycle ViewController <-> Presenter. How do you avoid leaks?

@interface ExamplePresenter : NSObject <ExampleModuleInterface>

@property (nonatomic, strong) ExampleInteractor *interactor;
@property (nonatomic, strong) ExampleWireframe *wireframe;

@property (nonatomic, strong) UIViewController<ExampleViewInterface> *userInterface;

@end



@interface ExampleViewController : UIViewController <ExampleViewInterface>

@property (nonatomic, strong) id<ExampleModuleInterface> eventHandler;

// *** add UI events here

@end
@pilot34
Copy link
Author

pilot34 commented Oct 31, 2015

PS: found similar issues for tutorials:
mutualmobile/VIPER-TODO#2
objcio/issue-13-viper#4

I think the easiest way is to make reference from presenter to viewController weak.

@exoszajzbuk
Copy link
Member

@pilot34 Thanks for pointing it out! The issue is fixed with eda0f7b and the updated gem is published with version 0.3.2

How long do you use boa in your projects? We're glad to receive any feedbacks! :)

@exoszajzbuk exoszajzbuk self-assigned this Nov 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants