Craig Grummitt – Before I forget

Discoveries in Swift and iOS development.

Writing

The public notebook: Swift, iOS, Flutter, and a long trail of “I will definitely remember this.”

  • Tiling a background image – sans code!

    Tiling a background image – sans code!

    I recently wrote an article on a simple custom UIView class you can use to tile an image. Unfortunately – this doesn’t help us in a LaunchScreen, where custom classes are not…

    Keep reading

  • Tiled background image in custom UIView class

    Tiled background image in custom UIView class

    Sometimes you need a repeated or tiled image in your app, often for a background. Something like these rain-drops for example: Here’s a simple UIView subclass that accepts an image parameter, and…

    Keep reading

  • Presentation Style default in iOS 13

    This week is International Week of the Deaf, so to thank the community that have been a big part of my app Subtitles Viewer‘s success, Subtitles Viewer PRO is free for the whole…

    Keep reading

  • Property Wrappers and User Defaults

    Property Wrappers and User Defaults

    I love magical new features that help us abstract away boiler-plate code and let us focus on the unique features of our apps. Property wrappers is such a feature, and seriously –…

    Keep reading

  • SF Symbols in iOS 13

    SF Symbols in iOS 13

    I was playing with the amazing SwiftUI with Apple’s tutorials (stay tuned, I hope to write something on SwiftUI soon) when I noticed something interesting: Where does this “star.fill” come from, I…

    Keep reading

  • Swift 5 – it’s alive!

    Swift 5 – it’s alive!

    It’s been a couple of weeks now since Swift 5 has arrived, with a bunch of features, such as: ABI stability source compatibility isMultiple – a fancy technique for checking if a…

    Keep reading

  • Optionals in Swift explained – with a cat in a box!

    Optionals in Swift explained – with a cat in a box!

    If you’ve come to Swift from a language that doesn’t use optionals, you might find the concept a little strange and the syntax unfamiliar at first. Sometimes it helps to learn the…

    Keep reading

  • Get a continent from longitude-latitude

    Get a continent from longitude-latitude

    For a project I’m working on I needed to know if a point (latitude,longitude) was in a continent, and if so, which one! To do this, first I set up a Continent…

    Keep reading

  • Getting the keyboard height

    Getting the keyboard height

    Some time ago I answered a question in StackOverflow comparing the keyboard height on the iPhone X and the iPhone 8: I got these heights by: 1. Adding an observer of the UIResponder.keyboardWillShowNotification notification:…

    Keep reading

  • Lightning tour of closures in Swift

    Check out this video tutorial with a lightning tour of closures in Swift. It covers: Functions as data types Basic closure syntax Trailing closures   If you’re interested in more of these sorts…

    Keep reading