You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the feature you'd like:
I confirmed that the return type of figmaApply is view in SwiftUI.
The Code Connect document guides users to use figmaApply when expressing different property values or function for a component depending on a conditional statement.
However, when implementing components, they need to be implemented differently depending on various situations.
For example, there are several modifiers declared in a specific component, and each modifier may or may not be declared depending on each conditional statement.
However, because figmaApply returns a View, there is an issue of not being able to find the modifier for a specific component when there are multiple conditional statements.
If you check the code below, you will understand it faster.
@FigmaEnum(“Theme”, mapping: [“SubTle”:true])
var isSubtle: Bool = false
…
var body: some View {
RightItem()
.figmaApply(isStandard, { item in
...
})
.figmaApply(isSubtle, { item in
item**_.setTitle(“title")_**
})
}
}
When using ‘setTitle’ function, the modifier is not found.
Shouldn't a feature be added so that figmaApply's Retrun type can return to a specific View, rather than a View?
I would like to ask you to consider this matter.
The text was updated successfully, but these errors were encountered:
I already know that the problem will be solved if I use variants to use the function ’setTitle’.
However, Because Using Variants requires repetitive work like repeating code lines, I want to make simple code line using ‘figmaApply’.
But, no matter how much I read document about code-connect, there seems to be no way to implement it other than using variant.
Hi @amyleed2, thanks for the response! Unfortunately using variants is the only way to achieve this right now. We'll keep this open and will let you know if we make any changes here.
Describe the feature you'd like:
I confirmed that the return type of figmaApply is view in SwiftUI.
The Code Connect document guides users to use figmaApply when expressing different property values or function for a component depending on a conditional statement.
However, when implementing components, they need to be implemented differently depending on various situations.
For example, there are several modifiers declared in a specific component, and each modifier may or may not be declared depending on each conditional statement.
However, because figmaApply returns a View, there is an issue of not being able to find the modifier for a specific component when there are multiple conditional statements.
If you check the code below, you will understand it faster.
plublic struct RightItem: View {
...
}
public extension RightItem {
func setTitle(_ title: String) -> RightItem {
...
return self
}
}
struct RightItem: FigmaConnect {
…
@FigmaEnum(“Theme”, mapping: [“Standard”:true])
var isStandard: Bool = false
}
When using ‘setTitle’ function, the modifier is not found.
Shouldn't a feature be added so that figmaApply's Retrun type can return to a specific View, rather than a View?
I would like to ask you to consider this matter.
The text was updated successfully, but these errors were encountered: