Files
SideStore/AltStore/Components/NavigationBar.swift
Riley Testut 52cb01c6c7 [AltStore] Revises AppViewController UI
- Fades in navigation bar as user scrolls down
- Displays version number, version date, and app size
2019-07-30 12:43:10 -07:00

47 lines
973 B
Swift

//
// NavigationBar.swift
// AltStore
//
// Created by Riley Testut on 7/15/19.
// Copyright © 2019 Riley Testut. All rights reserved.
//
import UIKit
import Roxas
class NavigationBar: UINavigationBar
{
override init(frame: CGRect)
{
super.init(frame: frame)
self.initialize()
}
required init?(coder aDecoder: NSCoder)
{
super.init(coder: aDecoder)
self.initialize()
}
private func initialize()
{
self.barTintColor = .white
self.shadowImage = UIImage()
}
override func layoutSubviews()
{
super.layoutSubviews()
// We can't easily shift just the back button up, so we shift the entire content view slightly.
for contentView in self.subviews
{
guard NSStringFromClass(type(of: contentView)).contains("ContentView") else { continue }
contentView.center.y -= 2
}
}
}