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
class func folderSize(folderPath:String) -> UInt{ | |
// @see http://stackoverflow.com/questions/2188469/calculate-the-size-of-a-folder | |
let filesArray:[String] = NSFileManager.defaultManager().subpathsOfDirectoryAtPath(folderPath, error: nil)! as [String] | |
var fileSize:UInt = 0 | |
for fileName in filesArray{ | |
let filePath = folderPath.stringByAppendingPathComponent(fileName) | |
let fileDictionary:NSDictionary = NSFileManager.defaultManager().attributesOfItemAtPath(filePath, error: 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
import UIKit | |
public extension UIStatusBarManager { | |
func scrollToTop() { | |
let selector = NSSelectorFromString("handleTapAction:") | |
let action = UIStatusBarTapAction() | |
perform(selector, with: action) | |
} | |
} |
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 | |
public extension UIColor { | |
/** | |
Blend current color with some overlay | |
Source - [JordanDelcros's JS algorithm](https://gist.github.com/JordanDelcros/518396da1c13f75ee057) | |
*/ | |
func blended(with overlay: UIColor) -> UIColor { |