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 WeakReference<T: AnyObject> { | |
weak var ref: T? | |
init (_ object: T) { | |
self.ref = object | |
} | |
} | |
extension WeakReference: CurrencyPresenterOutput where T: CurrencyPresenterOutput { | |
func present(_ currency: CurrencyPresenterModel) { |
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
#include <iostream> | |
/* | |
Вспомогательный метод. Проверяет содержит ли | |
число num в себе цифру k. Работает за O(n) | |
*/ | |
bool contains(int num, int k) { | |
if (k > 9) { | |
return false; | |
} |
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
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
// Override point for customization after application launch. | |
ThemeManager.setup() // theme settings | |
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 | |
import UIKit | |
//MARK: - RGB | |
/** | |
- Descriptioin: | |
RGB color settings | |
*/ | |
extension UIColor { | |
static func RGB (_ red: CGFloat, _ green: CGFloat, _ blue: CGFloat) -> UIColor { |
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 | |
import UIKit | |
class ThemeManager { | |
// Some hack is needed in ios 13 | |
// to make navigationBar color grey in largeTittle mode | |
static func setup() { | |
if #available(iOS 13.0, *) { | |
let navBarAppearance = UINavigationBarAppearance() |
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 | |
import UIKit | |
class HeadlinesVewController: UITableViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
setupUI() | |
} |