a preambula,   i created a helper function:   func cast(_ value: Any?, to: T.Type) -> T? {     return value != nil ? (value as! T) : nil }   to use it like this:   let dog = cast(any, to: Dog.self)   the…

I have a simple app with a WKWebView. When running on iOS 9.3, the memory usage stays around 5 Mb with is expected since WKWebView runs in a separate process. But memory usage for “other processes” goes high after a couple of navigations, especially on…

I’m trying to make my app have a simple crash log feature where, when the app crashes, a small text file is created and saved in a crash log directory in the app’s Documents directory. I’ve already got all the code working to create the…

I’ve been working on a small program that opens files and performs various operations on them. The code to select and open the file is standard:   var file = Data() var filename = “”        let openPanel = NSOpenPanel() // other OpenPanel settings       …

I am trying to display text in a UILabel vertically after the device changes to landscape from portrait.   I’ve managed to (forcefully) stack them vertically by changing its frame size and setting numberOfLines = 0. This sort of produces the result I want, except…

Greetings,   I’m a long time programmer, but totally new to Swift.  I have some experience with Objective-C, but most of my historical training and work has been done in procedural languages (C, Fortran, Pascal, etc.).   I’ve written a simple application on MacOS (Xcode…