The Github doesn't provide country code for Brazil (+55). To add this option, just run the code below in your console. The option Brazil +55
will be the first on the list, already selected:
🇧🇷 [pt-BR]
This file contains hidden or 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 UIImage { | |
var averageColor: UIColor? { | |
guard let inputImage = self.ciImage ?? CIImage(image: self) else { return nil } | |
guard let filter = CIFilter(name: "CIAreaAverage", parameters: [kCIInputImageKey: inputImage, kCIInputExtentKey: CIVector(extent: inputImage.extent)]) | |
else { return nil } | |
guard let outputImage = filter.outputImage else { return nil } |
This file contains hidden or 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 SwiftUI | |
struct TestCard: View { | |
private let cornerRadius: CGFloat = 12 | |
@Environment(\.displayScale) private var displayScale | |
@State private var isSelected = false | |
var body: some View { |
This file contains hidden or 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 SwiftUI | |
struct PullToRefreshView: View | |
{ | |
private static let minRefreshTimeInterval = TimeInterval(0.2) | |
private static let triggerHeight = CGFloat(100) | |
private static let indicatorHeight = CGFloat(100) | |
private static let fullHeight = triggerHeight + indicatorHeight | |
let backgroundColor: Color |
This file contains hidden or 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 SwiftUI | |
public struct ValuePicker<SelectionValue: Hashable, Content: View>: View { | |
private let title: LocalizedStringKey | |
private let selection: Binding<SelectionValue> | |
private let content: Content | |
public init( | |
_ title: LocalizedStringKey, | |
selection: Binding<SelectionValue>, |
This file contains hidden or 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 | |
import UIKit | |
extension UIBlurEffect { | |
public static func variableBlurEffect(radius: Double, imageMask: UIImage) -> UIBlurEffect? { | |
let methodType = (@convention(c) (AnyClass, Selector, Double, UIImage) -> UIBlurEffect).self | |
let selectorName = ["imageMask:", "effectWithVariableBlurRadius:"].reversed().joined() | |
let selector = NSSelectorFromString(selectorName) |
OlderNewer