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
require 'date' | |
require 'xcodeproj' | |
project_path = 'path/to/ProjectName.xcodeproj' | |
project = Xcodeproj::Project.open(project_path) | |
# Флаг для инкремента версии хотфикса | |
increment_hotfix = ARGV.include?('--increment-hotfix') | |
# Находим нужную конфигурацию сборки и читаем текущую marketing_version |
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 final class GenericTableCell<View: UIView>: UITableViewCell { | |
let view = View() | |
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | |
super.init(style: style, reuseIdentifier: reuseIdentifier) | |
contentView.addSubview(view) | |
makeConstraints() | |
} |
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
#!/bin/bash | |
function addFilesToLint { | |
filename="" | |
count=$2 | |
for item in $1 | |
do | |
if [[ $item == *".swift"* ]]; then | |
filename+="$item" | |
export SCRIPT_INPUT_FILE_$count="$filename" |
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
@IBDesignable | |
class XibView : UIView { | |
var contentView:UIView? | |
@IBInspectable var nibName:String? | |
override func awakeFromNib() { | |
super.awakeFromNib() | |
xibSetup() | |
} |
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 UITextView { | |
open override func invalidateIntrinsicContentSize() { | |
// UITextView intrinsicContentSize only exists if scrolling is disabled | |
self.isScrollEnabled = false | |
super.invalidateIntrinsicContentSize() | |
} | |
open override func layoutSubviews() { | |
super.layoutSubviews() | |
let contentSize = self.sizeThatFits(self.bounds.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 UINavigationController { | |
open override class func initialize() { | |
if self != UINavigationController.self { return } | |
let swizzlingClosure: () = { | |
UINavigationController().swizzlePushViewController() | |
}() | |
swizzlingClosure | |
} | |