自定义 UIView 应该更容易。使用 DesignableView 来设计你想要的视图。
要使用 CocoaPods 将 DesignableView 集成到你的 Xcode 项目中,请在你的 Podfile 中指定它
Podfile
pod 'DesignableView'