Skip to content

Instantly share code, notes, and snippets.

struct user_Model:Codable {
var fullName:AnyCodableValue?
var age:AnyCodableValue?
var point:AnyCodableValue?
var isVerified:AnyCodableValue?
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.fullName = try container.decodeIfPresent(AnyCodableValue.self, forKey: .fullName)
//
// anyCodabelValue.swift
// Sajjad Sarkoobi
//
// Created by Sajjad Sarkoobi on 6/8/20.
// Copyright © 2020 Sajjad Sarkoobi. All rights reserved.
// Email: [email protected]
import Foundation
@sajjadsarkoobi
sajjadsarkoobi / userHolder.swift
Created September 3, 2018 08:52
Medium - UserDefaults
//
// userHolder.swift
// Medium_userDefaults
//
// Created by Sajjad Sarkoobi on 9/3/18.
// Copyright © 2018 sarkoobi. All rights reserved.
//
import Foundation
var UserHolder = userData()
@sajjadsarkoobi
sajjadsarkoobi / gist:4cb1fb9acb318ec9d00c7dce96eeaceb
Created March 14, 2018 09:16 — forked from snikch/gist:3661188
Find the current top view controller for your iOS application
- (UIViewController *)topViewController{
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController];
}
- (UIViewController *)topViewController:(UIViewController *)rootViewController
{
if (rootViewController.presentedViewController == nil) {
return rootViewController;
}