Skip to content

Instantly share code, notes, and snippets.

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

Swapnanil Dhol SwapnanilDhol

🏠
Working from home
View GitHub Profile
import UIKit
import TipJarViewController
struct TipJarOptions: TipJarConfiguration {
static var topHeader = "Hi There"
static var topDescription = """
If you've been enjoying 'Your App Name here' and would like to show your support, please consider a tip. They go such a long way, and every little bit helps. Thanks! :)
"""
@SwapnanilDhol
SwapnanilDhol / deviceTypeEnum.swift
Last active February 23, 2020 09:15
Device Type Enum
enum DeviceType
{
case phone
case pad
case mac
}
@SwapnanilDhol
SwapnanilDhol / UIDeviceExtension.swift
Created February 23, 2020 09:18
UIDeviceExtension
extension UIDevice
{
var deviceType: DeviceType? {
#if targetEnvironment(macCatalyst)
return .mac
#else
switch UIDevice.current.userInterfaceIdiom
{
case .phone:
@SwapnanilDhol
SwapnanilDhol / viewDidLoad.swift
Last active February 23, 2020 09:22
DeviceType
guard let type = UIDevice.current.deviceType else {return}
print(type)
//
// SettingsViewController.swift
// ColorPicker
//
// Created by Swapnanil Dhol on 9/13/19.
// Copyright © 2019 Swapnanil Dhol. All rights reserved.
//
import UIKit
import TipJarViewController
import SafariServices
@SwapnanilDhol
SwapnanilDhol / AppIconChangeController.swift
Created July 17, 2020 13:10
Change App Icon in an iOS/iPadOS application.
//
// AppIconChangeController.swift
// Color Picker
//
// Created by Swapnanil Dhol on 2/5/20.
// Copyright © 2020 Swapnanil Dhol. All rights reserved.
//
import UIKit
class AppIconChangeController: UIViewController {
//
// UITableView+EmptyView.swift
// StickerTweet
//
// Created by Swapnanil Dhol on 7/6/20.
// Copyright © 2020 Swapnanil Dhol. All rights reserved.
//
import UIKit
@SwapnanilDhol
SwapnanilDhol / ItemDetailSource.swift
Created August 21, 2020 13:06
A UIActivity Helper Class to show thumbnail preview and text in the share sheet title area
//
// ItemDetailSource.swift
// StickerTweet
//
// Created by Swapnanil Dhol on 7/9/20.
// Copyright © 2020 Swapnanil Dhol. All rights reserved.
//
import UIKit
import LinkPresentation
@SwapnanilDhol
SwapnanilDhol / HapticsHelper.swift
Last active September 12, 2020 14:35
A Swift Helper class to generate different types of haptics from one class. Just initialize this once in your view controller and call the methods when you need them.
/*****************************************************************************
* FeedbackGenerators.swift
* Neon: Capture, Edit, Share
*****************************************************************************
* Copyright (c) 2020 Neon. All rights reserved.
*
* Authors: Swapnanil Dhol <swapnanildhol # gmail.com>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
{
"kind": "youtube#videoListResponse",
"etag": "uFAZK6gMs-vWa9z2Z_m7CX5asXM",
"items": [
{
"kind": "youtube#video",
"etag": "hYMZ2Vgp3in1woc8Ou0LH8XGN1Y",
"id": "ISdBAf-ysI0",
"snippet": {
"publishedAt": "2018-03-20T17:00:01Z",