SwiftKickMobile / SwiftMessages

A very flexible message bar for UIKit and SwiftUI.
MIT License
7.33k stars 747 forks source link

Custom view border color #326

Closed appleshine closed 5 years ago

appleshine commented 5 years ago

Hello, not sure if this is a silly question but how can I set the border color for my custom message view?

I have tried layer.borderUIColor and layer.borderColor but both doesn't work. I did set my layer.borderWidth to 2.

I have also tried setting

view.borderColor = UIColor.red
view.layer.borderColor = UIColor.red.cgColor

But it all doesn't work :( Dont know what am I doing wrong

wtmoose commented 5 years ago

You gotta set a border width

appleshine commented 5 years ago

As said above I did set the layer.borderWidth to 2

appleshine commented 5 years ago

I fixed the problem by using IBDesignable instead. Thanks though :)

martynovskij commented 5 years ago

You gotta set a border width

It is not works.

martynovskij commented 5 years ago

I fixed the problem by changing backgroundView.layer (not view.layer): view.backgroundView.layer.borderWidth = 3.0 view.backgroundView.layer.borderColor = UIColor.white.cgColor