This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Data { | |
private static let mimeTypeSignatures: [UInt8 : String] = [ | |
0xFF : "image/jpeg", | |
0x89 : "image/png", | |
0x47 : "image/gif", | |
0x49 : "image/tiff", | |
0x4D : "image/tiff", | |
0x25 : "application/pdf", | |
0xD0 : "application/vnd", | |
0x46 : "text/plain", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class CustomSlider: UISlider { | |
private var toolTip: ToolTipPopupView? | |
override func awakeFromNib() { | |
super.awakeFromNib() | |
self.initToolTip() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
@objc class MyAPI: NSObject { | |
static let keyError: String = "Error" | |
static let keyResult: String = "Result" | |
static let unknownError: String = "Unknown error" | |
static let notificationMyAPIDidEnd = Notification.Name(rawValue: "notificationMyAPIDidEnd") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MovieTransitionsVC.swift | |
// VideoAnimations | |
// | |
// Created by Tula on 2018-06-14. | |
// Copyright © 2018 Tula. All rights reserved. | |
// | |
import UIKit | |
import AVFoundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zip -r smart.zip . -x "*.DS_Store" -x "__MACOSX" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV ANDROID_HOME_DIR=/opt/tools/android-sdk-linux | |
ENV SDK_MANAGER=$ANDROID_HOME/cmdline-tools/bin/sdkmanager | |
ENV TEMP_DIR=<Path to a temporary directory you download files to. e.g. /tmp/install> | |
ENV ANDROID_TOOLS_VERSION=30.0.3 | |
ENV ANDROID_BUILD_VERSION=32 | |
ADD <path to SDK tools. Refer command line tools in https://developer.android.com/studio#downloads> $TEMP_DIR/ | |
RUN mkdir -p $ANDROID_HOME_DIR && \ | |
cd $ANDROID_HOME_DIR && \ | |
unzip $TEMP_DIR/<zip file name downloaded above> && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
protocol TouchDetectingViewDelegate: NSObjectProtocol { | |
func touchDetectingViewDidDetectPan(view: TouchDetectingView, | |
direction: TouchDetectingView.Direction, | |
displacement: CGFloat, | |
state: UIGestureRecognizer.State) | |
func touchDetectingViewPanEnded(view: TouchDetectingView) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class FYISession { | |
let savedUserKey = "savedUser" | |
static let sharedInstance = FYISession() | |
var user:FYIUser = FYIUser(userId: 0, userMobile: "", userEmail: "", userName: "") | |
func userLoggedIn() -> Bool{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Photos | |
class VideoHelper { | |
private static func createAlbum(name: String, completion: @escaping ((_ collection: PHAssetCollection?) -> Void)) { | |
//Get PHFetch Options | |
let fetchOptions = PHFetchOptions() | |
fetchOptions.predicate = NSPredicate(format: "title = %@", name) | |
let collection : PHFetchResult = PHAssetCollection.fetchAssetCollections(with: .album, subtype: .any, options: fetchOptions) | |
//Check return value - If found, then get the first album out |
NewerOlder