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

UIStackView and OAStackView as a single class #68

Open
Katafalkas opened this issue Nov 27, 2015 · 2 comments
Open

UIStackView and OAStackView as a single class #68

Katafalkas opened this issue Nov 27, 2015 · 2 comments

Comments

@Katafalkas
Copy link

Hey. This is not bug nor it is an issue. Rather a question someone in this project could answer.

Is there a way of creating a subclass that would use UIStackView or OAStackView as a superclass depending on ios version ?

something like that ? (this does not work)

if #available(iOS 9.0, *) {
    class StackView: UIStackView {}
} else {
    class StackView: OAStackView {}
}

Any ideas of achieving something similar ?

@harlanhaskins
Copy link
Contributor

Swift's type system won't let you do this. The compiler can't guarantee that UIStackView and OAStackView are isomorphic, and there's no facility for ensuring it anyway.

@paleozogt
Copy link
Contributor

Is this a dupe of #2?

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

3 participants