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
TAGS="TODO:|FIXME:" | |
ERRORTAG="ERROR:" | |
OUTPUT=$(find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$|($ERRORTAG).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/" | perl -p -e "s/($ERRORTAG)/ error: \$1/") | |
ECHO "$OUTPUT" | |
if [[ $OUTPUT == *" error: "* ]] | |
then | |
exit 1 | |
fi |
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 | |
class SelfSizedTableView: UITableView { | |
lazy var heightConstraint: NSLayoutConstraint = { | |
let constraint = NSLayoutConstraint(item: self, attribute: .height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: bounds.height) | |
return constraint | |
}() | |
override init(frame: CGRect, style: UITableViewStyle) { | |
super.init(frame: frame, style: style) |
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 | |
extension UIBezierPath { | |
/// Makes a bezier path which can be used for a rounded polygon | |
/// layer | |
/// | |
/// - Parameters: | |
/// - rect: uiview rect bounds | |
/// - lineWidth: width border line | |
/// - sides: number of polygon's sides |
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 | |
@IBDesignable | |
class SteppedSlider: UISlider { | |
@IBInspectable var stepSize: Int = 1 | |
@IBInspectable var normalThumbImage: UIImage? { | |
get { | |
return thumbImage(for: .normal) | |
} |
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 | |
/* | |
Usage: | |
1. Create new xib file. | |
2. Create new swift file containg class subclassed from CustomXibView. | |
3. In xib set recently created class name as File's owner. | |
*/ |
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 | |
@IBDesignable | |
class ImageView: UIImageView { | |
// MARK: - Layer stuff | |
@IBInspectable | |
var cornerRadius: CGFloat { | |
get { | |
return layer.cornerRadius |
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 | |
@IBDesignable | |
public class View: UIView { | |
// MARK: - Layer stuff | |
@IBInspectable | |
public var cornerRadius: CGFloat { | |
get { | |
return layer.cornerRadius | |
} |
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 | |
open class KeyboardManager: NSObject { | |
public enum KeyboardEvent { | |
case willShow | |
case didShow | |
case willHide | |
case didHide | |
case willChangeFrame | |
case didChangeFrame |
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 Foundation | |
fileprivate extension String { | |
var sourceFileName: String { | |
let fileName = self.components(separatedBy: "/").last?.split(separator: ".").first ?? "" | |
return String(fileName) | |
} | |
} | |
public class Logger { |
NewerOlder