Skip to content

Instantly share code, notes, and snippets.

View sourleangchhean168's full-sized avatar
🎯
Focusing

Sour LeangChhean sourleangchhean168

🎯
Focusing
View GitHub Profile
@sourleangchhean168
sourleangchhean168 / collectionView_cell_animation.swift
Created April 11, 2018 13:35
CollectionView Cell Animation in Swift 4
let cell = collectionView.cellForItem(at: indexPath)
UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 5, options: [],
animations: {
cell!.transform = CGAffineTransform(scaleX: 0.9, y: 0.9)
},
completion: { finished in
UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 5, options: .curveEaseInOut,
animations: {
@brennanMKE
brennanMKE / directoryExistsAtPath.swift
Created April 20, 2017 22:23
Directory Exists at Path in Swift
fileprivate func directoryExistsAtPath(_ path: String) -> Bool {
var isDirectory = ObjCBool(true)
let exists = FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory)
return exists && isDirectory.boolValue
}