This file contains hidden or 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
// | |
// Created by Leonid Nifantyev on 2019-05-26. | |
// Copyright (c) 2019 Nifantyev. All rights reserved. | |
// | |
import UIKit | |
import SwiftyAttributes | |
typealias EventHandler<T> = ((T) -> Void) |
This file contains hidden or 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
func showActionSheet(actionsTitles: [String], currentIndex: Int) { | |
let optionMenu = UIAlertController(title: "Select League season", message: .none, preferredStyle: .actionSheet) | |
optionMenu.view.tintColor = .white | |
for ( index, title ) in actionsTitles.enumerated() { | |
let action = UIAlertAction(title: title, style: .default) { [weak self] _ in | |
self?.selectAction(index: index) | |
} | |
action.setValue(UIColor.white, forKey: "titleTextColor") | |
optionMenu.addAction(action) |
This file contains hidden or 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 Array where Element: Equatable { | |
func calculateNextIndex(for currentIndex: Int) -> Int { | |
let newIndex = currentIndex < self.count - 1 ? currentIndex + 1 : 0 | |
return newIndex | |
} | |
func fetchNextElement(after currentIndex: Int) -> Element { | |
let nextIndex = self.calculateNextIndex(for: currentIndex) | |
return self[nextIndex] | |
} |
This file contains hidden or 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
// | |
// EmailHelper.swift | |
// NurKZ | |
// | |
// Created by Nifantyev on 1/28/19. | |
// Copyright © 2019 Genesis. All rights reserved. | |
// | |
import MessageUI |
This file contains hidden or 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
// | |
// UIView+Tap.swift | |
// Tele2 | |
// | |
// Created by l.nifantyev on 10/11/18. | |
// Copyright © 2018 Tele2. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
This file contains hidden or 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
class DashBoardView: LoadableView {} |
This file contains hidden or 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
func config(imgUrl: String, estimatedSize: CGSize?, description: NSAttributedString?) { | |
postImageView.estimatedSize = estimatedSize | |
postImageView.loadImg(fromUrl: imgUrl) | |
} |
This file contains hidden or 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 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() |
This file contains hidden or 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
// | |
// UILinkedLabel.swift | |
// Tele2 | |
// | |
// Created by l.nifantyev on 10/10/18. | |
// Copyright © 2018 Tele2. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
NewerOlder