Few.swift icon indicating copy to clipboard operation
Few.swift copied to clipboard

iOS improvements

Open Adlai-Holler opened this issue 9 years ago • 2 comments

@joshaber This one's a biggie, sorry. I wanted to get the demo working in decent shape before PR. What we've got is

  • Add Switch element for UISwitch
  • Make Button lay itself out correctly
  • Make Button respect more control states
  • Use isEqualToAttributedString: when possible
  • Add contentInset and scrollIndicatorInsets to TableView
  • Spruce up the demo with a fancy navigation controller

The changes seemed to have exposed layout bugs in other chunks of the framework, so we'll tackle those later. The layout of elements in the table header is wonky when you switch between demo screens and on first appearance. Curious if you have ideas about the causes there.

Adlai-Holler avatar Jul 14 '15 04:07 Adlai-Holler

Hmm, so if I apply the following patch:

diff --git a/Few-iOS/TableView.swift b/Few-iOS/TableView.swift
index de5c1bf..eaf8269 100644
--- a/Few-iOS/TableView.swift
+++ b/Few-iOS/TableView.swift
@@ -322,14 +322,10 @@ public class TableView: Element {
        tableView.scrollIndicatorInsets = scrollIndicatorInsets
        if let header = header {
            handler.headerView.updateWithElement(header)
-           let layout = header.assembleLayoutNode().layout(maxWidth: tableView.frame.width)
-           layout.apply(handler.headerView)
            tableView.tableHeaderView = handler.headerView
        }
        if let footer = footer {
            handler.footerView.updateWithElement(footer)
-           let layout = footer.assembleLayoutNode().layout(maxWidth: tableView.frame.width)
-           layout.apply(handler.footerView)
            tableView.tableFooterView = handler.footerView
        }
        return tableView

It gets rid of the table header jank. But the section header still shifts. I'm not sure what's going on there.

joshaber avatar Jul 18 '15 03:07 joshaber

The new report. Don't understand. Is the front end development. I am learning.

ghost avatar Aug 04 '16 02:08 ghost