How to add a hover effect to a UITableViewCell (Swift)

When iPadOS 13.4 was released so was much improved Mouse-Pointer support. While a non starter on your iPhone, iPad with a trackpad and external keyboard quickly turns into a very capable computing device. For my app – Open Access Helper – I wanted to support this feature, even if it wouldn’t be used a lot. […]

Swift 4: Adding new UI Elements to the Main.strings file, which Xcode auto-generates for you

When you are ready to localize your App, Xcode will auto-generate a Main.strings file for your Main Storboard. In that file every element of the User Interface (labels & more) are listed in the following format: /* Class = “UILabel”; text = “Subtitle”; ObjectID = “y5E-9n-LU8”; */ “y5E-9n-LU8.text” = “Untertitel”; That’s a pretty awesome format, […]

Swift 4: Help align UITextView to other labels, by avoiding the annoying inset

When aligning a UITextView with other labels on the screen, the inset becomes an issue. It is easy enough to work around, however if you wanted to just “switch” them off, you can add the following to your ViewDidLoad Function: textView.textContainerInset = .zero textView.textContainer.lineFragmentPadding = 0  

Swift 4: An extension to define UIColors with “normal” RGB values and set some named colors

UIColors require you to enter red, green and blue as values between 0 and 1. In pracitcal terms that means you need to divide your values by 255 to obtain the CGFloat required. Easy enough? Surely! Still it is a tad annoying, especially as the rest of the world will give you RGB values between […]

Swift 4: Pull To Refresh / UIRefreshControl

TableViews can have a useful feature to refresh the data inside of them, simply pull to refresh. Apple didn’t invent this, that was Loren Brichter of Tweetie, which was sold to Twitter and Twitter was eventually granted a Patent for the feature. Today this feature is absolutely ambiguous and very easy to implement. For example, […]

Swift 4: Show Network Activity Indicator

I sure am going to be unpopular, but I don’t get why an App is allowed to make “silent” network requests – in other words: I don’t get why the Network Indicator isn’t shown by the OS to alert users that there is network activity going on. However if you have a function, which makes […]

Scroll to top