-
Notifications
You must be signed in to change notification settings - Fork 778
Open
Labels
Description
Just want to discuss about a potential feature.
Unfortunately I think we cannot do "Trait Variation" for "User Defined Runtime Attributes"
So when we define something, it is for all ipads and iphones
I make a little PoC using NSDataAsset, that can be variated
Inside I put just some text file with the wanted value of a maskType
- iphone file contains: circle
- ipad file contains: ellipse
Then in MaskType I add a code to parse NSDataAsset
public extension MaskType {
init(string: String?) {
....
case "dataAsset":
if let name = params[safe: 0],
let dataAsset = NSDataAsset(name: name),
let value = String(data: dataAsset.data, encoding: .utf8) {
self.init(string: value)
} else {
self = .none
}And finally I use it on my view in storyboard like this
dataAsset(mask)
Reactions are currently unavailable


