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
platform :ios, '9.0' | |
target 'Photos' do | |
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks | |
use_frameworks! | |
inhibit_all_warnings! | |
# Pods for Photos | |
pod 'RxCocoa' | |
pod 'RxSwift' |
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
/** | |
Support snaping to the left as AppStore layout | |
*/ | |
class SnapingCollectionViewFlowLayout: UICollectionViewFlowLayout { | |
override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, | |
withScrollingVelocity velocity: CGPoint) -> CGPoint { | |
guard let collectionView = collectionView else { | |
return super.targetContentOffset(forProposedContentOffset: proposedContentOffset, | |
withScrollingVelocity: velocity) | |
} |
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
alias xcdd='rm -rf ~/Library/Developer/Xcode/DerivedData/*' | |
alias xctp='xcbuild_time_profiling' | |
function xcbuild_time_profiling { | |
local fileToOpen=''; | |
local is_workspace=true; | |
local scheme=$1; | |
if [ -n "$scheme" ] | |
then |
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
public class RoundedShadowView: UIView { | |
public var cornerRadius: CGFloat = 2.0 { | |
didSet { | |
setNeedsLayout() | |
} | |
} | |
public var fillColor: UIColor = .white { | |
didSet { |
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 | |
private var pTouchAreaEdgeInsets: Int = 0 | |
extension UIControl { | |
var touchAreaEdgeInsets: UIEdgeInsets { | |
get { | |
if let value = objc_getAssociatedObject(self, &pTouchAreaEdgeInsets) as? NSValue { | |
var edgeInsets: UIEdgeInsets = .zero |
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
final class SimpleAutoWrapView: UIView { | |
private var arrangedSubviews: [UIView] = [] | |
private var calculatedIntrinsicContentSize = CGSize.zero { | |
didSet { | |
if oldValue != calculatedIntrinsicContentSize { | |
invalidateIntrinsicContentSize() | |
} | |
} | |
} |
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
struct PriorityQueue<Element>: CustomDebugStringConvertible { | |
typealias PriorityFunc = (Element, Element) -> Bool | |
private let priorityFunc: PriorityFunc | |
private var elements: [Element] | |
init(priorityFunction: @escaping PriorityFunc) { | |
priorityFunc = priorityFunction | |
elements = [] | |
} |
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
BEGIN:VCARD | |
VERSION:4.0 | |
N:Schurig;Donny;;; | |
FN:Donny Schurig | |
TEL;type=HOME:+86 279 743 6473 | |
END:VCARD | |
BEGIN:VCARD | |
VERSION:4.0 | |
N:Ambrogiotti;Louella;;; | |
FN:Louella Ambrogiotti |