Skip to content

Instantly share code, notes, and snippets.

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

Virajkumar Patel mspvirajpatel

🏠
Working from home
View GitHub Profile
@mspvirajpatel
mspvirajpatel / BaseButton.swift
Created July 20, 2017 06:46
This is List of Base Button Type. If want to add new type just define in this and Handle that type in BaseButton Class.
//
// BaseButton.swift
// ViewControllerDemo
//
import UIKit
import Font_Awesome_Swift
/**
This is List of Base Button Type. If want to add new type just define in this and Handle that type in BaseButton Class.
import Foundation
typealias KVOContext = UInt8
var MyObservationContext = KVOContext()
class Observer: NSObject {
func startObservingPerson(person: Person) {
let options = NSKeyValueObservingOptions([.New, .Old])
person.addObserver(self, forKeyPath: "firstName", options: options, context: &MyObservationContext)
person.addObserver(self, forKeyPath: "lastName", options: options, context: &MyObservationContext)
@mspvirajpatel
mspvirajpatel / UIFont+SFUIDisplay.swift
Created August 2, 2017 10:43
Font Extension For Swift
import Foundation
import UIKit
struct SFUIDisplayFontType : OptionSetType
{
let rawValue: Int
init(rawValue: Int) { self.rawValue = rawValue }
static internal let None = SFUIDisplayFontType(rawValue: 0)
static internal let Bold = SFUIDisplayFontType(rawValue: 1)
@mspvirajpatel
mspvirajpatel / LocalScheduler.swift
Created August 2, 2017 10:46
local notification schedule
import Foundation
import UIKit
/// The maximum allowed notifications to be scheduled at a time by iOS.
///- important: Do not change this value. Changing this value to be over
/// 64 will cause some notifications to be discarded by iOS.
let MAX_ALLOWED_NOTIFICATIONS = 64
///- author: Ahmed Abdul Badie
class ABNScheduler {
@mspvirajpatel
mspvirajpatel / DLLocalNotifications.swift
Created August 2, 2017 10:50
Local Notifications Swift
import Foundation
import UserNotifications
import MapKit
public class DLNotificationScheduler{
public init () {
@mspvirajpatel
mspvirajpatel / AppUtility.swift
Last active August 20, 2017 07:58
Image Upload Manager with Almofire and Create With Model
import UIKit
import SystemConfiguration
import UserNotifications
class AppUtility: NSObject {
// MARK: - Network Connection Methods
class func isNetworkAvailableWithBlock(_ completion: @escaping (_ wasSuccessful: Bool) -> Void) {
**First Create BottomBar.js**
import React, { Component, PropTypes } from 'react';
import {
View,
Text,
StyleSheet,
Button,
Dimensions
@mspvirajpatel
mspvirajpatel / AppRouter.js
Last active August 24, 2017 08:01
Demo AppRouter
import { Router, Stack, Scene ,Reducer} from 'react-native-router-flux';
import LoginScreen from './LoginScreen'
import HomeView from './HomeView'
import {AsyncStorage} from "react-native";
const USER_KEY = "user-auth";
const reducerCreate = params => {
const defaultReducer = new Reducer(params);
return (state, action) => {
@mspvirajpatel
mspvirajpatel / HomeView.js
Last active August 26, 2017 12:18
offlineBarRef Error
import React from 'react';
import styles from './styles';
import Wallpaper from "../Wallpaper/index";
import BottomBar from "../BottomBar/index";
import {View,Image,Text,TouchableHighlight,Alert } from 'react-native';
import HomeTopBar from "../HomeTopBar/index";
import { Container, Header, Content ,Button,Icon} from 'native-base';
import home1 from '../../assets/images/home1.png';
import home2 from '../../assets/images/home2.png';
import home3 from '../../assets/images/home3.png';
@mspvirajpatel
mspvirajpatel / SwiftyProgressHUD.swift
Last active June 19, 2018 09:13
SwiftyProgressHUD is a Swift based clean and easy-to-use HUD meant to display the progress of an ongoing task on iOS
import UIKit
class SwiftyProgressHUD: UIView {
private var backView : UIView?
private var progressIndicator : UIActivityIndicatorView?
private var titleLabel : UILabel?
private var footerLabel : UILabel?
//Customizable properties