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 UIColor { | |
convenience public init(r: CGFloat, g: CGFloat, b: CGFloat) { | |
self.init(r: r, g: g, b: b, a: 1) | |
} | |
convenience public init(r: CGFloat, g: CGFloat, b: CGFloat, a: CGFloat) { | |
self.init(red: r/255, green: g/255, blue: b/255, alpha: a) | |
} | |
} |
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 | |
extension UIView { | |
enum gradientType { | |
case vertical | |
case horizontal | |
case cross | |
} | |
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
// | |
// CachedImageView.swift | |
// | |
// Created by Yash Thaker on 01/01/18. | |
// Copyright © 2018 YashThaker. All rights reserved. | |
// | |
import UIKit | |
open class CachedImageView: UIImageView { |
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
// how to use | |
// call addKeyboardObserver() in viewWillAppear | |
// call removeKeyboardObserver() in viewDidDisappear to prevent memory leak | |
// override changeKeyboardFrame function in viewController | |
extension UIViewController { | |
func addKeyboardObserver() { | |
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow), name: UIResponder.keyboardWillShowNotification, object: nil) | |
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide), name: UIResponder.keyboardWillHideNotification, object: nil) |
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
// GenericTableViewController.swift | |
// Generics | |
// | |
// Created by Yash Thaker on 01/07/18. | |
// Copyright © 2018 YashThaker. All rights reserved. | |
import UIKit | |
/* | |
// <---------- HERE IS HOW TO USE. ----------> |
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
// Service.swift | |
// Generics | |
// | |
// Created by Yash Thaker on 25/05/20. | |
// Copyright © 2020 YashThaker. All rights reserved. | |
// | |
/* | |
// ------------- How to use ------------- | |
Service.shared.fetchUnsplashPhotos { result in |
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+UIViewController.swift | |
// | |
// Created by Yash on 15/01/19. | |
// Copyright © 2019 Yash. All rights reserved. | |
// | |
import UIKit | |
import AVKit |
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
// | |
// NetworkManager.swift | |
// | |
// | |
// Created by SOTSYS138 on 12/05/21. | |
// | |
import Alamofire | |
final class NetworkManager { |
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
// | |
// SwipeUpDownTransition.swift | |
// CustomTransition | |
// | |
// Created by Yash Thaker on 18/04/18. | |
// Copyright © 2018 YashThaker. All rights reserved. | |
// | |
import UIKit |
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
// | |
// TYAudioVideoManager.swift | |
// Yash Thaker | |
// | |
// Created by Yash Thaker on 05/12/18. | |
// Copyright © 2018 Yash Thaker. All rights reserved. | |
// | |
/* | |
1) mergeVideos(videoUrls: [URL], exportUrl: URL, preset: String? = nil, progress: @escaping Progress, completion: @escaping Completion) |
OlderNewer