Git Product home page Git Product logo

tca_ver_verify's Introduction

tca_ver_verify

The Composable ArchitectureによるNavigationStack関連の挙動を確認するためのサンプルです。

概要

TCA ver 1.9においてNavigationStackを実装すると

Perceptible state was accessed but is not being tracked. Track changes to state by wrapping your view in a 'WithPerceptionTracking' view.

という警告が出て画面の操作が反映されない。なおこの問題はiOS17以降では発生しない。
そこでこのリポジトリではver1.6とver1.9の両方のアプリを作成して挙動の違いを確認する。

compilation_capture.mov

スクリーンショット 2024-03-29 14 00 05(3)

TCA ver 1.6

NavigationStackStoreによる挙動を確認できています。
確認手順は以下の通りです。

  1. 以下のコマンドを実行
$ git checkout -b v1.6.0 v1.6.0
$ open tca_ver_verify/tca_ver_verify.xcodeproj
  1. アプリを開いて"push nav"をタップする
  2. pushでカウンターをincreamentしながらナビゲーションに画面をpushする

ver1.6で生じる警告について

iOS16でアプリを動作するとカウンターのデモ画面において以下の警告が発せられます。

Publishing changes from within view updates is not allowed, this will cause undefined behavior.

ただこれは本家のアプリでも同様のことが起こっています。

$ git clone [email protected]:pointfreeco/swift-composable-architecture.git
$ git checkout -b 1.6.0 1.6.0
$ open swift-composable-architecture/Examples/CaseStudies/CaseStudies.xcodeproj

このアプリでの動作を確認するに異常な挙動を示すものがないため警告として留める。

TCA ver 1.9

NavigationStackによる挙動で不具体を確認できています。 確認手順は以下の通りです。

  1. 以下のコマンドを実行
$ git checkout -b v1.9.0 v1.9.0
$ open tca_ver_verify/tca_ver_verify.xcodeproj

不具合

  • push navをタップした後のデモ画面でpushをタップしても正常にナビゲーションがプッシュされない
  • ナビゲーションによるバックボタンで空白が表示される
  • デモ画面のdismissで一つ前の画面に戻りたいが積んでいるスタック全てが全てが破棄される

警告

Perceptible state was accessed but is not being trackeの警告が出る。
ただし上記の警告はViewStoreのパッチ 136~138行目を当てることでなくなる。

iOS17での挙動

TCA ver1.6, ver1.9のいずれにおいてもiOS17以上であれば不具合は生じない。

tca_ver_verify's People

Watchers

SAKASHITA Kenji avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.