Posts

Showing posts from 2019

Golang: Get Results from a MySQL Stored Procedure with Parameters

After much research and thought, I figured out how to call a MySQL stored procedure and get the results from it. The key is using multiStatements=true and autocommit=true in the connection string. Make sure your stored procedure returns a result set, like: ... -- return one result set SELECT v_record_id AS id; END;; Connection string: myDb , err := sql. Open ( " mysql " , " user:password@/somedb?multiStatements=true&autocommit=true " ) Golang query code: var id sql. NullInt64 row := myDb. QueryRow ( " CALL SaveUrl(?, ?) " , data. URL , data. Title , ) if err := row. Scan (&id); err != nil { return - 1 , fmt. Errorf ( " unable to save URL: %s " , err) } More detailed  Github Gist  code sample. I hope it helps someone else. Soli Deo gloria

How to remove, update, or replace the WKWebView inputAccessoryView

Many others, including myself, have been trying to safely modify the WKWebView.inputAccessoryView. Now in iOS 13+, you can do it! TL;DR; The WebKit team update the code, Apple updated their dependency in iOS 13. Swift code sample: import WebKit class RichEditorWebView: WKWebView { var accessoryView: UIView? override var inputAccessoryView: UIView? { // remove/replace the default accessory view return accessoryView } } In another class somewhere: // set accessory view to replace it, if left untouched, then it will be removed let webView = RichEditorWebView() webView.accessoryView = SomeAwesomeInputAccessoryView() Because WebKit is a library that iOS uses (like SQLite), I assumed that Apple would update that dependency as well for iOS 13, since the change was resolved around June 2019. References: https://trac.webkit.org/changeset/246229/webkit#file1 https://bugs.webkit.org/show_bug.cgi?id=198631 It was too difficult to find the answer, s