Why I Cannot Add Variable to GeometryReader{} Closure Argument

Written by siyang-ren | Published 2020/07/11
Tech Story Tags: swift | under-the-hood | struct-type | generic-types | closures | web-monetization

TLDR A programmer has been using Javascrift for the past two years. He wants to use a GeometryReader{} to contain a view, so he can decide the position of the view base on the parent container property such as size, coordinates space, ect... But he gets an error like this: "Why I can not write variable inside a closure?" He then encountered another issue, Generic parameter`Content`could not be infered. So, I explicitly specify the arguments to fix this issue.via the TL;DR App

no story

Written by siyang-ren | I am a programmer focusing on Swift recently and have been using Javascrift for the past two years.
Published by HackerNoon on 2020/07/11