Post

Replies

Boosts

Views

Activity

Reply to Table view's `cellForRow(at:)` is `nil` in Unit Test
Guys, did you try reloading the table view altogether? I used table view over a view controller and it worked for me.     func test_firstRow() {         let tableView = myViewController().tableView // Reload data         tableView?.reloadData()         let indexPath0 = IndexPath(item: 0, section: 0)         let cell0 = tableView!.cellForRow(at: indexPath0)         let visibleRows = tableView?.indexPathsForVisibleRows         XCTAssert(visibleRows != nil)         XCTAssertTrue(((tableView?.indexPathsForVisibleRows!.contains(indexPath0)) != nil))         XCTAssert(cell0 != nil)     }
Nov ’21
Reply to WKWebView text size not matching UIWebView (or UILabel)?
Add the following to your HTML - <header><meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no'></header> Alternatively, you can add this where you're reading the html string in your swift class. let headerString = "<header><meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no'></header>" webView.loadHTMLString(headerString + yourHTMLString, baseURL: nil)
Oct ’20