Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added support for View optionals, fixing @ViewBuilder conditionals.#58

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Samuel-IH wants to merge1 commit intoSwiftWebUI:develop
base:develop
Choose a base branch
Loading
fromSamuel-IH:ViewOptionals

Conversation

@Samuel-IH
Copy link

Previously conditionals had to have a trailing "else {...}" at the end because of lack of optional support from the View protocol.
This fix will introduce View optionals and make the behavior more like SwiftUI's View.

Note:
I had to add an optional check inside ComponentReflection.swift, I'm not 100% sure of the inner workings of this file but this doesn't seem to be causing any conflicts.

curveddesign reacted with heart emoji
Previously conditionals had to have a trailing "else {...}" at the end because of lack of optional support from the View protocol.This fix will introduce View optionals and make the behavior more like SwiftUI's View.(cherry picked from commit223bc36)
@helje5
Copy link
Member

Thanks for your PRs! It'll take me a while to find the time to review the things.

//support for optional Views, mainly for @ViewBuilder convenience
extensionOptional:Viewwhere Wrapped:View{
publicvarbody:EmptyView{
EmptyView()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Better late than never, but that seems wrong. The Optional View should be the wrapped if set, and EmptyView only in the .none case.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@helje5helje5helje5 left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Samuel-IH@helje5

[8]ページ先頭

©2009-2025 Movatter.jp