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 MKCoordinateRegion { | |
/// Initialize a `MKCoordinateRegion` from a set of `MKAnnotations` | |
/// - Parameter annotations: Annotations | |
init(for annotations: [MKAnnotation]) { | |
var minLat: CLLocationDegrees = 90.0 | |
var maxLat: CLLocationDegrees = -90.0 | |
var minLon: CLLocationDegrees = 180.0 | |
var maxLon: CLLocationDegrees = -180.0 | |
for annotation in annotations { |
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
/// 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 |
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
import Foundation | |
import SwiftUI | |
#if canImport(UIKit) | |
import UIKit | |
#elseif canImport(AppKit) | |
import AppKit | |
#endif | |
extension Image { | |
/// Initializes a SwiftUI `Image` from data. |
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
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 } |
NewerOlder