SwiftUI: GeometryReader<Rectangle>に紐づけた関数が実行されないはなし

p0dee
1 min readJun 3, 2020

--

ただの気づきのメモ。

GeometryReader内に存在するただのRectangleについて。

RectangleGeometryReaderに紐づいた.logが実行されず、ログ出力されないという現象にでくわした。

一方、RectangleRoundedRectangleに変更するとログ出力されるし、あるいはRectangleに対して.background(Color.clear)などの装飾を施してもログ出力される。

型がGeometryReader<Rectangle>のビューに関しては、その型に影響しない後続の処理については、省かれるのかもしれない。

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response