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
struct LoadingView: UIViewRepresentable { | |
@Environment(\.colorScheme) var colorScheme | |
func makeUIView(context: Context) -> GIFImageView { | |
let gifImageView = GIFImageView() | |
gifImageView.animate(withGIFNamed: colorScheme == .light ? "loader-black" : "loader-white") { | |
print("It's animating!") | |
} | |
return gifImageView |
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
UIApplication.shared.windows.first?.overrideUserInterfaceStyle = .dark // for Light mode: .light |
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
// | |
// SearchView.swift | |
// Branddose | |
// | |
// Created by Aakash on 10/07/2020. | |
// Copyright © 2020 Minhasoft. All rights reserved. | |
// | |
import SwiftUI |
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 UIApplication { | |
func endEditing(_ force: Bool) { | |
self.windows | |
.filter{$0.isKeyWindow} | |
.first? | |
.endEditing(force) | |
} | |
} | |
struct ResignKeyboardOnDragGesture: ViewModifier { |
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 Color { | |
init(hex: String) { | |
let scanner = Scanner(string: hex) | |
var rgbValue: UInt64 = 0 | |
scanner.scanHexInt64(&rgbValue) | |
let r = (rgbValue & 0xff0000) >> 16 | |
let g = (rgbValue & 0xff00) >> 8 | |
let b = rgbValue & 0xff |
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 Array{ | |
func collection(into size :Int) -> [[Element]]{ | |
return stride(from: 0, to: count, by:size).map{ | |
Array(self[$0 ..< Swift.min($0 + size, count)]) | |
} | |
} | |
} |
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 View { | |
/// Navigate to a new view. | |
/// - Parameters: | |
/// - view: View to navigate to. | |
/// - binding: Only navigates when this condition is `true`. | |
func navigate<SomeView: View>(to view: SomeView, when binding: Binding<Bool>) -> some View { | |
modifier(NavigateModifier(destination: view, binding: binding)) | |
} |
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
package com.mirrordust.gpscellinfodemo; | |
public class BaseStation { | |
private int mcc; // Mobile Country Code | |
private int mnc; // Mobile Network Code | |
private int lac; // Location Area Code or TAC(Tracking Area Code) for LTE |