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

delegate problem #11

Closed
iKisliy opened this issue Aug 10, 2017 · 1 comment
Closed

delegate problem #11

iKisliy opened this issue Aug 10, 2017 · 1 comment

Comments

@iKisliy
Copy link

iKisliy commented Aug 10, 2017

Hello! I had issue with delegate. When I tried several methods to assign delegate to another view controller, not that one, which contains HorizontalDial, I had problem: inside VCs delegate is the same object, but inside HorizontalDial object delegate is nil. I tried a lot of fixes in a good way, but helped me only this kludge:

  private var delegateTemp: HorizontalDialDelegate? = nil
    @IBOutlet public weak var delegate: HorizontalDialDelegate? {
        set {
            delegateTemp = newValue
        }
        get {
            return delegateTemp
        }
    }

As you see, I changed delegate from AnyObject? to protocol optional, and have buffer variable delegateTemp. It's not in clean way, but it's works. It's not a big deal, but I bet you can fix it

@iKisliy
Copy link
Author

iKisliy commented Oct 22, 2019

Who cares :)

@iKisliy iKisliy closed this as completed Oct 22, 2019
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