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 / GoogleAdsMob.swift
Created September 14, 2017 13:48
Easily integration banner and interstitial GoogleMobileAds in swift project.
import UIKit
import GoogleMobileAds
//MARK: - Google Ads Unit ID
struct GoogleAdsUnitID {
//Google Test Unit ID
struct Test {
static var strBannerAdsID = "ca-app-pub-XXXXXXXXXXXXXXXX/XXXXXXXXXXX"
static var strInterstitialAdsID = "ca-app-pub-XXXXXXXXXXXXXXXX/XXXXXXXXXXX"
@mspvirajpatel
mspvirajpatel / BaseScrollViewController.swift
Last active August 25, 2018 17:28
Smooth UIScrollView with custom paging in Swift 3.0.
import UIKit
public protocol ContainerViewControllerDelegate {
func outerScrollViewShouldScroll() -> Bool
}
public class BaseScrollViewController: UIViewController, UIScrollViewDelegate {
public var topVc: UIViewController?
public var leftVc: UIViewController!
@mspvirajpatel
mspvirajpatel / ImageUpload.Swift
Created September 8, 2017 07:31
Try This Code for Multiple upload Images in Single Request, This code is already working.
// For Pass Valid Parameters & number of Images in Array in Image Upload Function
var dicImgData : NSMutableDictionary? = NSMutableDictionary()
if let img = UIImage(named: "Your Image") {
if let data:Data = UIImagePNGRepresentation(img) {
var imageData : NSData = data
dicImgData! .setObject(imageData, forKey: "data" as NSCopying)
dicImgData! .setObject("file", forKey: "name" as NSCopying)
dicImgData! .setObject("file.png", forKey: "fileName" as NSCopying)
@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
@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 / 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) => {
**First Create BottomBar.js**
import React, { Component, PropTypes } from 'react';
import {
View,
Text,
StyleSheet,
Button,
Dimensions
@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) {
@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 / 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 {