Skip to content

Instantly share code, notes, and snippets.

View BrentMifsud's full-sized avatar

Brent Mifsud BrentMifsud

View GitHub Profile
@BrentMifsud
BrentMifsud / HTTPStatusCode.swift
Last active February 21, 2021 07:35 — forked from ollieatkinson/HTTPStatusCode.swift
HTTP status codes as a Swift enum.
/// This is a list of Hypertext Transfer Protocol (HTTP) response status codes.
/// It includes codes from IETF internet standards, other IETF RFCs, other specifications, and some additional commonly used codes.
/// The first digit of the status code specifies one of five classes of response; an HTTP client must recognise these five classes at a minimum.
#if canImport(Foundation)
import Foundation
#else
import FoundationNetworking
#endif
@BrentMifsud
BrentMifsud / Image+Data.swift
Last active March 14, 2024 16:19
SwiftUI Image from data
import Foundation
import SwiftUI
#if canImport(UIKit)
import UIKit
#elseif canImport(AppKit)
import AppKit
#endif
extension Image {
/// Initializes a SwiftUI `Image` from data.
import UIKit
extension UITabBarController {
/// Extends the size of the `UITabBarController` view frame, pushing the tab bar controller off screen.
/// - Parameters:
/// - hidden: Hide or Show the `UITabBar`
/// - animated: Animate the change
func setTabBarHidden(_ hidden: Bool, animated: Bool) {
guard let vc = selectedViewController else { return }
guard tabBarHidden != hidden else { return }