When your @IBDesignable is either too complex or requires data not available when previewing in the interface builder, here is how you deal with those errors.
In situation where our @IBDesignable is too complex to complete in under 200ms we need a way to still get it's benefits without the complex errors that it throws. You may argue that "well my code still builds just fine". Sure, but now you have a bunch of errors and when you actually get one, you may have trouble debugging. Here . . .
The ios-charts framework says to use the "android" documentation. However it turns out that there is enough difference in the properties each framework uses that it can be frustrating to learn how to use the ios-charts library. Here is a quick reference.
Android: Simple Formatter
// usage on axis, could also use on data object or dataset yAxis.setValueFormatter(new MyValueFormatter());
iOS: Simple Formatter
var myValueFormatter = NSNumberFormatter() // normal value formatter configuration myValueFormatter.numberStyle = . . . .
UIScrollView is something that can be very confusing because it uses constraints in a way that they aren't normally used. Because of this there is so much confusion.
Implementing a UIScrollView is actually really easy when you know/do three fundamental things. There is a video I uploaded that walks you through this process UIScrollView Video but incase you forget you can use the following as a reference.
Use a View (let's call it, ContentView) in your ScrollView to keep the layout of . . .
Two design patterns which can be used to implement Singletons in Swift.
The Singleton pattern makes sure only one instance of a given class exists. Usually that single instance is lazily loaded when it is needed. There are a bunch of examples of this built into iOS such as:
I'm not going to tell you when you might need . . .
Attributed strings build in the storyboard editor which use a custom font does not render correctly. Here are the steps to get around it.
When setting attributed text in Xcode storyboard editor you will find that any custom font selected will show up in the storyboard, but not when run in the simulator.
Online people talk about making sure you add your custom fonts to the plist or to make sure you aren't picking a font style that the font . . .