Skip to content

Instantly share code, notes, and snippets.

@badlands
Created March 17, 2017 22:42
Show Gist options
  • Save badlands/b1a34c81a685234167f9eab563369444 to your computer and use it in GitHub Desktop.
Save badlands/b1a34c81a685234167f9eab563369444 to your computer and use it in GitHub Desktop.
Swift 3 Transparent UINavigationBar
//
// UINavigationBarExtensions.swift
// TransparentNavigationBar
//
// @see http://stackoverflow.com/questions/30545663/transparent-uinavigationbar-in-swift#30545730
// Created by Marco on 17/03/2017.
// Copyright © 2017 Marco Marengo. All rights reserved.
//
import UIKit
extension UINavigationBar {
func makeTransparent() {
self.setBackgroundImage(UIImage(), for: .default)
self.shadowImage = UIImage()
self.isTranslucent = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment