Apply UIAppearance immediately on the screen

·1 min read
Apply UIAppearance immediately on the screen

I was looking for how to apply changes made with UIAppearance’s proxy method immediately.

I found a solution in a library UISS, that handles Stylesheets written with JSON format.

This code detaches all subviews of window and attach them again.

I also tried setNeedsDisplay and setNeedsLayout, but didn’t work. So I adapted this hack.

Here is Swift version.