Few.swift
Few.swift copied to clipboard
iOS improvements
@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 forUISwitch
- Make
Button
lay itself out correctly - Make
Button
respect more control states - Use
isEqualToAttributedString:
when possible - Add
contentInset
andscrollIndicatorInsets
toTableView
- 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.
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.
The new report. Don't understand. Is the front end development. I am learning.