---
title: "Custom border color on UIView in iOS."  
description: "Custom border color on UIView in iOS."  
author: "Tarun Kumar"  
published: 2015-12-26  
updated: 2015-12-27  
canonical: https://www.mindstick.com/forum/33791/custom-border-color-on-uiview-in-ios  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# Custom border color on UIView in iOS.

I want to set border [color](https://www.mindstick.com/articles/77/how-to-split-form-background-color-in-c-sharp) of UIView [controller](https://www.mindstick.com/blog/273/passing-values-from-controller-to-view-in-asp-dot-net-mvc) in our [iPhone application](https://www.mindstick.com/forum/23139/can-i-embed-a-custom-font-in-an-iphone-application).\
Can I set [custom](https://www.mindstick.com/blog/12298/use-custom-writing-services-to-get-through-the-finals) border color by programmatically?

## Replies

### Reply by Tarun Kumar

I got a solution, we can set UIView border width and border color using this code:

```
view.layer.borderWidth = 1;view.layer.borderColor = UIColor.blueColor().CGColor;
```


---

Original Source: https://www.mindstick.com/forum/33791/custom-border-color-on-uiview-in-ios

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
