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

Infinite loop when loading my view #51

Closed
nico75005 opened this issue Feb 21, 2017 · 1 comment
Closed

Infinite loop when loading my view #51

nico75005 opened this issue Feb 21, 2017 · 1 comment

Comments

@nico75005
Copy link

I have a UITableViewCell that contains two UIView both extending NibDesignable.

In each of those view I have an initializer like the following.

required init?(coder aDecoder: NSCoder) {
	super.init(coder: aDecoder)
		
	setup()
}

This init triggers

// MARK: - NSCoding
    required public init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        self.setupNib()
    }

of NibDesignable.
Then everytime this line gets called

```return nib.instantiate(withOwner: self, options: nil)[0] as! UIView // swiftlint:disable:this force_castit calls myrequired init?


 and I end up having an infinite loop.

I used the same type of initialisation in another view (not in a table view cell) and it works fine.

Any idea what's wrong?

Thanks
@nico75005
Copy link
Author

Nevermind... I didn't set the File's Owner class but the view's instead.

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

1 participant