Skip to content

Instantly share code, notes, and snippets.

View iRiziya's full-sized avatar
🏠
Working from home

Rinkal C iRiziya

🏠
Working from home
View GitHub Profile
@kcak11
kcak11 / App.md
Last active May 14, 2024 06:57
Country Codes

Country Codes

List of all Country Codes (ISO & Dialing) sorted in alphabetical order.

import SwiftUI
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
/// your push notification code goes here
return true
}
}
extension UISearchBar {
public var textField: UITextField? {
if #available(iOS 13, *) {
return searchTextField
}
let subViews = subviews.flatMap { $0.subviews }
guard let textField = (subViews.filter { $0 is UITextField }).first as? UITextField else {
return nil
}
return textField
@anubhavshrimal
anubhavshrimal / CountryCodes.json
Last active May 14, 2024 12:45 — forked from Goles/CountryCodes.json
Country and Dial or Phone codes in JSON format
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"code": "AX"
@winzig
winzig / Alamofire+UIImage.swift
Last active August 11, 2016 07:53
Ray Wenderlich's UIImage serializer for Alamofire, updated for Alamofire 3.0 and Swift 2
extension Alamofire.Request {
/** Response serializer for images from: http://www.raywenderlich.com/85080/beginning-alamofire-tutorial */
public static func imageResponseSerializer() -> ResponseSerializer<UIImage, NSError> {
return ResponseSerializer { request, response, data, error in
guard let validData = data else {
let failureReason = "Data could not be serialized. Input data was nil."
let error = Error.errorWithCode(.DataSerializationFailed, failureReason: failureReason)
return .Failure(error)