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
// | |
// ChartsDemo-OSX | |
// | |
// Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda | |
// Copyright © 2017 thierry Hentic. | |
// A port of MPAndroidChart for iOS | |
// Licensed under Apache License 2.0 | |
// | |
// https://github.com/danielgindi/ios-charts |
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
//convert values withCommas as indian rupees | |
extension Int { | |
func withCommas() -> String { | |
let numberFormatter = NumberFormatter() | |
numberFormatter.numberStyle = .decimal | |
numberFormatter.locale = Locale(identifier: "en_IN") // English (Indian) locale with english language is used | |
return numberFormatter.string(from: NSNumber(value:self))! | |
} | |
} |
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 UIFont { | |
// MARK: Poppins UIFont | |
static func poppinsBold(size:CGFloat)-> UIFont?{ | |
return UIFont(name: "Poppins-Bold", size: size) | |
} | |
static func poppinsLight(size:CGFloat)-> UIFont?{ | |
return UIFont(name: "Poppins-Light", size: size) | |
} | |
static func poppinsMedium(size:CGFloat)-> UIFont?{ | |
return UIFont(name: "Poppins-Medium", size: size) |
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{ | |
//activityIndicator loader | |
func loader() -> UIAlertController { | |
let alert = UIAlertController(title: "", message: "", preferredStyle: .alert) | |
alert.view.subviews.first?.subviews.first?.subviews.first?.backgroundColor = UIColor("#EBF6FF") | |
let messageAttributes = [NSAttributedString.Key.font: UIFont.poppinsMedium(size: 20), NSAttributedString.Key.foregroundColor: UIColor("#295084")] | |
let messageString = NSAttributedString(string: "Please wait...", attributes: messageAttributes as [NSAttributedString.Key : Any]) | |
alert.setValue(messageString, forKey: "attributedMessage") | |
let width = messageString.size().width + 40 |