Skip to content

Instantly share code, notes, and snippets.

View apple-avadhesh's full-sized avatar
🏠
Working from home

Avadhesh Sharma apple-avadhesh

🏠
Working from home
View GitHub Profile
@apple-avadhesh
apple-avadhesh / vision_text_recognition_example_3.swift
Created July 7, 2022 09:31 — forked from terminox/vision_text_recognition_example_3.swift
Simple text recognition using Apple's Vision Framework (Part 3)
import UIKit
import Vision
let image = UIImage(named: "<image_name_goes_here>")
if let cgImage = image?.cgImage {
let requestHandler = VNImageRequestHandler(cgImage: cgImage)
let recognizeTextRequest = VNRecognizeTextRequest { (request, error) in
// 1. Parse the results
@apple-avadhesh
apple-avadhesh / TagCloudCollectionView.swift
Created February 21, 2022 04:42 — forked from descorp/TagCloudCollectionView.swift
Swift TagCloudCollectionView
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
class EdgeInsetLabel: UILabel {
private let textInsets: UIEdgeInsets
init(inset: UIEdgeInsets) {
textInsets = inset
import SceneKit
import PlaygroundSupport
var sceneView = SCNView()
PlaygroundPage.current.liveView = sceneView
sceneView.backgroundColor = .black
var scene = SCNScene()
sceneView.scene = scene
var universe = scene.rootNode
struct Notification<T> {
let name: NSNotification.Name
}
private let notificationData = "_notificationData"
extension NotificationCenter {
func post<T>(_ notification: Notification<T>, object: Any? = nil, data: T) {
post(name: notification.name, object: object, userInfo: [notificationData: data])
}
@apple-avadhesh
apple-avadhesh / IOS_OpenURL.m
Created September 20, 2021 17:29 — forked from monjer/IOS_OpenURL.m
IOS Open URL
#define SharedApplication [UIApplication sharedApplication]
// open tel call
[SharedApplication openURL:[NSURL URLWithString:@"tel:1-408-555-5555"]];
// open itunes application
[SharedApplication openURL:[NSURL URLWithString:@"https://itunes.apple.com/cn/app/numbers/id361304891?mt=8"]];
// open map
[SharedApplication openURL:[NSURL URLWithString:@"http://maps.apple.com/?q=cupertino"]];
//
// GradientView.swift
// Notion
//
// Created by Cody Robertson on 3/16/16.
// Copyright © 2016 Lift, Inc. All rights reserved.
//
import Foundation
import UIKit
@apple-avadhesh
apple-avadhesh / EasyTransparentNavigationBar.swift
Created September 6, 2021 20:47 — forked from zakbarlow1995/EasyTransparentNavigationBar.swift
Helper methods for quickly setting up a fully transparent navigation bar with black/white status bar text (use in viewWillAppear)
import UIKit
extension UIViewController {
func setupTransparentNavigationBarWithBlackText() {
setupTransparentNavigationBar()
navigationController?.navigationBar.barStyle = .default
navigationController?.navigationBar.tintColor = .black
}
func setupTransparentNavigationBarWithWhiteText() {
@apple-avadhesh
apple-avadhesh / swift-timer-example.swift
Created August 27, 2021 07:15 — forked from kiichi/swift-timer-example.swift
Swift 2.0, Protocol, Delegate and Timer Example using GC
//Swift 2.0
import UIKit
protocol SomethingDelegate {
func didUpdateSomething(SomethingHelper:SomethingHelper)
}
class SomethingHelper {
private var timer : dispatch_source_t! = nil
private var currentIntervalInSec = 0;
var delegate: SomethingDelegate?
@apple-avadhesh
apple-avadhesh / Model.swift
Created August 21, 2021 21:39 — forked from OctoberHammer/Model.swift
Запрос на консультацию. Последовательное получение картинок из PFFile для массива объектов PFObject
//
// Model.swift
// KidSpace
//
// Created by October Hammer on 4/19/17.
// Copyright © 2017 Ocotober Hammer. All rights reserved.
//
import Foundation
import Parse
import AVFoundation
import UIKit
class ScannerViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate {
var captureSession: AVCaptureSession!
var previewLayer: AVCaptureVideoPreviewLayer!
override func viewDidLoad() {
super.viewDidLoad()