Trying to get all properties of UIView or UIViewController with the follownig:
func propertysNames()->[String]{
var s = [String]()
for c in Mirror(reflecting: self).children
{
if let name = c.label{
s.append(name)
}
}
return s
}
This works on UIVIewController, but UIView does not seem to return properties, any advice?
Not sure what you are trying to achieve but UIView inherits NSObject. Because of this, you have much of the objc runtime at your disposal. So as an alternative, you could do the following:
Also, I do see some weirdness applying your code to UIKit objects. Not sure what the variable is that causes it to fail. It seems to work fine on NSObject types written in Swift:
So either this is a bug or there is some limitation in the Swift <-> ObjC in the current version of Swift. Perhaps it has to do with what @user3441734 pointed out in his answer.
BTW, all code was run on the most current version of Xcode (that's 7.1.1) in a playground.
You are right! Just fill the bug report ...
or it is sabotage, because i found this