Skip to content

Instantly share code, notes, and snippets.

View Leonif's full-sized avatar

LEONID NIFANTIJEV Leonif

  • iOS Developer
  • Kyiv
View GitHub Profile
//
// UIImageView+Extensions.swift
// GT_PhotoAlbums
//
// Created by Leonid Nifantyev on 11/24/18.
// Copyright © 2018 Leonid Nifantyev. All rights reserved.
//
import UIKit
import UIKit
protocol StoryboardIdentifiable {
static var storyboardIdentifier: String { get }
}
extension StoryboardIdentifiable where Self: UIViewController {
static var storyboardIdentifier: String {
return String(describing: self)
}
//
// EventHandler.swift
// PriceBar
//
// Created by l.nifantyev on 9/24/18.
// Copyright © 2018 LionLife. All rights reserved.
//
typealias EventHandler<T> = (T) -> Void
//
// BasePresenter.swift
// GT_PhotoAlbums
//
// Created by Leonid Nifantyev on 11/23/18.
// Copyright © 2018 Leonid Nifantyev. All rights reserved.
//
import Foundation
//
// UIColorsExtensions.swift
// PriceBar
//
// Created by Leonid Nifantyev on 4/1/18.
// Copyright © 2018 LionLife. All rights reserved.
//
import Foundation
import UIKit
//
// Extensions.swift
// PriceBar
//
// Created by Leonid Nifantyev on 1/4/18.
// Copyright © 2018 LionLife. All rights reserved.
//
import Foundation
import UIKit
import Foundation
import UIKit
let defaultFont = UIFont.systemFont(ofSize: 15)
extension NSMutableAttributedString {
@discardableResult func bold(_ text: String, font: UIFont = defaultFont) -> NSMutableAttributedString {
let attrs: [NSAttributedString.Key: Any] = [
.font: font
]
//
// UILinkedLabel.swift
// Tele2
//
// Created by l.nifantyev on 10/10/18.
// Copyright © 2018 Tele2. All rights reserved.
//
import Foundation
import UIKit
extension UISearchBar {
var textField: UITextField {
guard let tf = (value(forKey: "searchField") as? UITextField) else { fatalError() }
return tf
}
func addToolBar() {
//Add done button to numeric pad keyboard
let toolbarDone = UIToolbar.init()
toolbarDone.sizeToFit()
@Leonif
Leonif / Example.swift
Last active December 15, 2018 17:00
ImageView which can calculate own content and adjusted like UIlabel
func config(imgUrl: String, estimatedSize: CGSize?, description: NSAttributedString?) {
postImageView.estimatedSize = estimatedSize
postImageView.loadImg(fromUrl: imgUrl)
}