fix UIKit dependency by moving import up

Because `UIView`, `UIColor`, `UIImage`, `CGFloat`, etc. are referenced before the import of UIKit, there are compilation errors.