Skip to content

Instantly share code, notes, and snippets.

View codewithsanthoshofficial's full-sized avatar

K Santhosh Kumar codewithsanthoshofficial

View GitHub Profile
@codewithsanthoshofficial
codewithsanthoshofficial / DecimalsHandleSwift5KSK
Last active March 17, 2021 05:55
DecimalsHandleSwift5KSK
extension Constant {
static func twoDecimalValueReturnDouble(_ total:Double) -> Double {
let val = String(format: "%.2f", total)
let final = (val as NSString).doubleValue
return final
}
static func twoDecimalValue(_ total:Double) -> String {
return String(format: "%.2f", total)
extension NSMutableAttributedString {
var fontSize:CGFloat { return 14 }
var boldFont:UIFont { return UIFont(name: "OpenSans-SemiBold", size: fontSize) ?? UIFont.boldSystemFont(ofSize: fontSize) }
var normalFont:UIFont { return UIFont(name: "OpenSans-Regular", size: fontSize) ?? UIFont.systemFont(ofSize: fontSize)}
// var smallSizeFont:UIFont { return UIFont(name: "OpenSans-Regular", size: CGFloat(7)) ?? UIFont.systemFont(ofSize: fontSize)}
func bold(_ value:String) -> NSMutableAttributedString {
// MARK?:- PDF
extension PaymentSuccessController {
@objc func shareData() {
self.sharePdf()
return
/*
let bounds = UIScreen.main.bounds
UIGraphicsBeginImageContextWithOptions(bounds.size, true, 0.0)
extension ProductDescriptionTableViewCell: WKNavigationDelegate, WKUIDelegate {
/*
import WebKit
import SafariServices
@IBOutlet weak var webViewLIveChat: WKWebView!
var activityIndicator: UIActivityIndicatorView!
*/
func setupURL(_ htmlString:String) {
1) Create New Repo for project
Cd path
Git remote -v (check have any old paths)
rm -rf .git (if have any old paths remove)
Git remote -v (check have any old paths)
Git init .
Git remote add origin SSHkey ( SSHKey will get from aws when click on create button and enter project name then get ssh keys and https keys)
Git checkout -b dev
Git add .
@codewithsanthoshofficial
codewithsanthoshofficial / SearchTextFieldSWift5KSK
Created April 16, 2021 12:26
Search UITextField Swift 5
@IBOutlet weak var searchTextField: UITextField!
searchTextField.delegate = self
extension FavoriteVC:UITextFieldDelegate {
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
return true
import Foundation
import UIKit
import Foundation
//CONSTANT
let BOUNDS = UIScreen.main.bounds
let KEY_WINDOW = UIApplication.shared.windows.filter {$0.isKeyWindow}.first
@codewithsanthoshofficial
codewithsanthoshofficial / RootViewController
Created September 16, 2022 10:57
Root View controller swift
import Foundation
import UIKit
// MARK: Switcher class
enum RootVC:String {
case LoginViewController, TabBarVC
}
class Switcher {
static let shared = Switcher()
@codewithsanthoshofficial
codewithsanthoshofficial / Firebase Push
Last active September 19, 2022 12:53
Firebase push notification
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
import UserNotifications
import UserNotificationsUI
import Firebase
import FirebaseMessaging
@codewithsanthoshofficial
codewithsanthoshofficial / UICollectionviewSwift
Created September 21, 2022 13:41
UICollectionviewSwift
@IBOutlet weak var collectionviewList: UICollectionView!
func baseSetup() {
self.headerTitles.removeAll()
collectionviewList.register(UINib(nibName: "TitleCollectionViewCell", bundle: nil), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "TitleCollectionViewCell")
collectionviewList.delegate = self
collectionviewList.dataSource = self
let layout = UICollectionViewFlowLayout()
layout.sectionInset = UIEdgeInsets(top: 5, left: 0, bottom: 5, right: 15)
layout.minimumInteritemSpacing = 0