This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// String+Extensions.swift | |
// | |
// | |
// Created by Kusal Shrestha on 5/30/16. | |
// | |
// | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIView { | |
func makeTransparentView(withOpacity alphaValue: CGFloat, color: UIColor) { | |
let backgroundView = UIView() | |
self.superview?.insertSubview(backgroundView, belowSubview: self) | |
self.backgroundColor = UIColor.clearColor() | |
backgroundView.alpha = alphaValue | |
backgroundView.backgroundColor = color | |
backgroundView.layer.cornerRadius = self.layer.cornerRadius |