Skip to content

Instantly share code, notes, and snippets.

View freddyh's full-sized avatar
📐

Freddy Hernandez Jr. freddyh

📐
View GitHub Profile
@freddyh
freddyh / UIScrollView+Combine.swift
Last active October 12, 2021 08:59
UIScrollViewDelegatePublisher
import Combine
import UIKit
public enum ScrollViewDelegateEvent {
case didScroll(scrollView: UIScrollView)
case didZoom(scrollView: UIScrollView)
case willBeginDragging(scrollView: UIScrollView)
case willEndDragging((scrollView: UIScrollView, velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>))
case didEndDragging((scrollView: UIScrollView, willDecelerate: Bool))
case willBeginDecelerating(scrollView: UIScrollView)
@freddyh
freddyh / UIView+IBInspectable.swift
Created April 8, 2019 18:32
Adds various inspectable elements to UIView
extension UIView {
@IBInspectable
var cornerRadius: CGFloat {
get {
return layer.cornerRadius
}
set {
layer.cornerRadius = newValue
}
}
@freddyh
freddyh / UINavigationBar+Extensions.swift
Last active April 6, 2019 02:48
Navigation Bar w/o Underline
//
// UINavigationBar+Extensions.swift
// Reels
//
// Created by Freddy Hernandez on 4/5/19.
// Copyright © 2019 POP, Inc. All rights reserved.
//
import UIKit
@freddyh
freddyh / UIColor+Extension.swift
Created April 5, 2019 20:01
Color Convenience
import UIKit
extension UIColor {
/**
Initializes and returns a color object using the specified RGB component values.
- Parameter red: Red value of the color object
- Parameter green: Green value of the color object
- Parameter blue: Green value of the color object
extension UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.setNeedsStatusBarAppearanceUpdate()
}
override var preferredStatusBarStyle : UIStatusBarStyle {
return .lightContent
}
}