Skip to content

Instantly share code, notes, and snippets.

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

Bishal Ghimire bishalg

🏠
Working from home
View GitHub Profile
@bishalg
bishalg / FBLogin.swift
Created November 19, 2016 08:40
Facebook Login using FB Login Kit for Swift
import UIKit
import MBProgressHUD
import FacebookCore
import FacebookLogin
import FBSDKCoreKit
@IBAction func facebookAction(_ sender: UIButton) {
showHUDWithMessage("Facebook Login")
if let accessToken = AccessToken.current {
@bishalg
bishalg / AlamofireRequest+JSONSerializable.swift
Created November 11, 2016 08:37
Alamofire Request's JSON Response Serializable
//
// Created by Bishal Ghimire on 11/5/16.
// Copyright © 2016 bigBsoft. All rights reserved.
//
// Language - Swift 3.0
// IDE - Xcode 8.0
import Foundation
import Alamofire
import SwiftyJSON
@bishalg
bishalg / Request.swift
Last active January 25, 2024 13:59
Network Request Class for Alamofire using Router URLRequest and Response as SwiftyJSON - JSON
//
/// Router -
/// https://gist.github.com/bishalg/4d554cd79a138c43c00c17cebf6eb3d3
//
/// Alamofire - Swifty JSON Response Parser
/// https://gist.github.com/bishalg/0561c81f921858725731f2c36819e99c
///
import Foundation
import SwiftyJSON
@bishalg
bishalg / Router.swift
Created November 11, 2016 08:28
URLRequest Router for Alamofire URLRequestConvertible Swift 3.0
//
// Created by Bishal Ghimire on 11/6/16.
// Copyright © 2016 bigBsoft. All rights reserved.
//
import Foundation
import Alamofire
enum ActivitiesDate {
case currentDay // Activities Current Day
@bishalg
bishalg / CoreDataHelper.swift
Last active September 30, 2020 18:05
CoreData Helper to Delete All Entities
//
// CoreDataHelper.swift
// Xcode 8.0
// Swift 3.0
// Subclass of CoreDataStack -
// https://gist.github.com/bishalg/6e3a4fc4020b558f40b02c1d835aad8b
//
import Foundation
import CoreData
@bishalg
bishalg / CircularImageView.swift
Created May 18, 2016 14:10
Circular Image View UIImageView Subclass
// Created by Bishal Ghimire on 5/15/16.
import UIKit
@IBDesignable
class CircularImageView: UIImageView {
override func prepareForInterfaceBuilder() {
super.prepareForInterfaceBuilder()
makeCircularImage()
@bishalg
bishalg / NavigableOrderedTask.swift
Created May 12, 2016 12:40
Navigable Ordered Task in swift example of ORKNavigableOrderedTask ResearchKit
// Created by Bishal Ghimire on 5/6/16.
// Copyright © 2016 Bishal Ghimire. All rights reserved.
import Foundation
import ResearchKit
class SurveyQuestion {
var task: ORKNavigableOrderedTask?
@bishalg
bishalg / UIView+Extension.swift
Created May 5, 2016 03:27
Swift UIView Extension for Inspectable CornerRadius, BorderWidth and BoarderColors etc
//
// UIView+Extension.swift
//
// Created by Bishal Ghimire on 4/30/16.
// Copyright © 2016 Bishal Ghimire. All rights reserved.
//
import UIKit
//
@bishalg
bishalg / CoreDataStack.swift
Last active July 2, 2024 04:16
Core Data Stack in Swift for managing Managed Object Context for NSManagedObjectModel using NSPersistentStoreCoordinator
//
// CoreDataStack.swift
// Swift 3.0
// Xcode 8.0
//
import Foundation
import CoreData
class CoreDataStack: NSObject {
@bishalg
bishalg / AppInfo.swift
Last active November 3, 2017 16:51
AppInfo Swift - Util to get app infos like build / version number etc
//
// AppInfo.swift
// This is an Util to get app infos like build / version number etc
// Swift 3.0
// Xcode 8.0
//
import Foundation
import AVFoundation