![color ui text view color border xcode cg color color ui text view color border xcode cg color](https://venturebeat.com/wp-content/uploads/2020/03/aiskinshine.jpg)
Material components use these theme colors and their variations to style their individual backgrounds, text, and more. This product uses the primary color (purple 500) for the bottom app bar and the secondary color (teal 200) as an accent for the floating action button and selection controls. In this system, two theme colors are selected to express different parts of a UI: a primary color and a secondary color. The color theme for this app consists of a primary color (purple 500) with a primary dark variant (purple 600) and a secondary color (teal 200). This solves the problem of having to remember the name and type of the property that you want to modify. The Material Design color theming system uses an organized approach to applying color to your UI.
![color ui text view color border xcode cg color color ui text view color border xcode cg color](https://miro.medium.com/max/552/1*Qzad1mq39c9W2gWYRW10Kg.png)
Now you have a convenient way of modifying that property without having to type it manually in the user-defined runtime attributes section. IBInspectableĪdding an attribute to a property in your class will expose that property to the Attributes Inspector tab of Xcode.
![color ui text view color border xcode cg color color ui text view color border xcode cg color](https://dhhmzgirqh63s.cloudfront.net/37068.gif)
Starting with Xcode 6, there is a new mechanism that solves a lot of these problems. You also had to run your project in order to see the effect of the runtime attribute. There are 5 colors within the theme: basic - main text color, used on top of basic backgrounds alternate - alternative color used on top of alternate backgrounds, control - used on top of status colors (primary, success, etc), disabled color - to indicate text/component disabled state and hint - for secondary texts (for example placeholders and captions). This solution had no type checking-you had to type the property you wanted to modify by hand and often had to look up what it was called. In this post, I’ll show you an extension that will add a border, a corner radius, and a shadow to any UIView, UIButton, or UILabel and allow you to preview what it will look like in Interface Builder.īack in 2014, I wrote a blog post on Expanding User-Defined Runtime Attributes in Xcode where I added a border, corner radius, and shadow to a UIView using Interface Builder’s user-defined runtime attributes. These are smaller Swift extensions or control overrides that are applicable to many projects. I’m not talking about large frameworks or CocoaPods here.
#Color ui text view color border xcode cg color code#
During my iOS work, I’ve assembled a set of code that I bring with me on every iOS project.