vanilladocs
vanillapunch.com
API / ui/autolayout

ui/autolayout

오토레이아웃. (원본 ui/autolayout, Kiwi dual simplex 기반 Cassowary 제약 솔버)

  • layoutvariable: 솔버가 푸는 미지수 (값을 나눠 쥐는 핸들)
  • layoutterm, layoutexpression: 계수 * 변수 항과 선형 식
  • layoutconstraint, layoutrelation, layoutstrength, layoutpriority: 제약과 관계, 강도, UIKit 꼴 우선순위
  • layoutconstraintaxis: 가로, 세로 축 (UINode 의 hug, 압축 저항 우선순위가 쓴다)
  • layoutsymbol, layoutsymboltype, layoutrow: 솔버 안의 심볼과 tableau 행
  • layoutsolver: 제약 솔버 (여러 노드가 나눠 쥐는 핸들)
  • 원본과 달리 숫자는 f64 이고, 원본이 예외를 던지는 솔버 함수는 Result<(), LayoutError> 를 돌려준다.

Auto layout. (the original ui/autolayout, a Cassowary constraint solver based on Kiwi dual simplex)

  • layoutvariable: unknowns the solver solves (handles that share the value)
  • layoutterm, layoutexpression: coefficient * variable terms and linear expressions
  • layoutconstraint, layoutrelation, layoutstrength, layoutpriority: constraints and relations, strengths, UIKit style priorities
  • layoutconstraintaxis: horizontal and vertical axes (used by UINode's hugging and compression resistance priorities)
  • layoutsymbol, layoutsymboltype, layoutrow: symbols and tableau rows inside the solver
  • layoutsolver: the constraint solver (a handle shared by many nodes)
  • Unlike the original, numbers are f64, and solver functions where the original throws return Result<(), LayoutError>.