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
| import UIKit | |
| protocol OutputBuilder { | |
| func addElement(_ id: String) | |
| } | |
| class XMLBuilder: OutputBuilder { | |
| func addElement(_ id: String) {} | |
| } |
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 XMLBuilder { | |
| func addElement(_ id: String) {} | |
| } | |
| class RandomTest {} | |
| class XMLBuilderTest: RandomTest { | |
| private var builder: XMLBuilder | |
| public func testAddRoot() { |
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
| final class Car { | |
| var mark: String? | |
| var wheels: Int? | |
| var maxSpeed: Double? | |
| var oil: String? | |
| static func createMarkedCar(mark: String) -> Car { | |
| return self.init(mark: mark, wheels: nil, maxSpeed: nil, oil: nil) | |
| } | |
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 Car { | |
| var mark: String? | |
| var wheels: Int? | |
| var maxSpeed: Double? | |
| var oil: String? | |
| convenience init(mark: String) { | |
| self.init(mark: mark, wheels: nil, maxSpeed: nil, oil: nil) | |
| } | |
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
| let firstVC = UINavigationController(rootViewController: DialogsController(networkManager: networkManager, socketClient: chatManager)).userSideMenu() | |
| let secondVC = UINavigationController(rootViewController: MainController(networkManager: networkManager, offlineManager: OfflineManager(), categoryId: 1)).userSideMenu() | |
| let thirdVC = UINavigationController(rootViewController: NotificationsController(networkManager: networkManager)).userSideMenu() | |
| let fourthVC = UIViewController() | |
| firstVC.delegate = self | |
| secondVC.delegate = self | |
| thirdVC.delegate = self | |
| firstVC.tabBarItem = ESTabBarItem.init(ESTabBarItemContentView(), title: nil, image: #imageLiteral(resourceName: "comment-white-oval-bubble").withRenderingMode(.alwaysOriginal), selectedImage: #imageLiteral(resourceName: "comment-white-oval-bubble").withRenderingMode(.alwaysOriginal)) | |
| secondVC.tabBarItem = ESTabBarItem.init(ESTabBarItemContentView(), title: |
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
| import UIKit | |
| protocol State: class { | |
| var stateMachine: StateMachine { get } | |
| func loggedIn() | |
| func loggedOut() | |
| } | |
| extension State { | |
| func loggedIn() {} |
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
| import UIKit | |
| class ScrollableController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| setupViews() | |
| } | |
| private func setupViews() { |
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
| import csv | |
| class Email: | |
| def __init__(self, email, spamId): | |
| self.email = email | |
| self.spamId = spamId | |
| def parseLines(filename): | |
| lines = csv.reader(open(filename, "rb")) |
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
| let group = DispatchGroup() | |
| var items = [ProductViewModelItem]() | |
| func getData(with data: [String: Int], completion: @escaping () -> Void) { | |
| let queue = DispatchQueue(label: "serialQ") | |
| for (_, value) in data { | |
| makeRequest(with: value, queue: queue) | |
| } | |
| group.notify(queue: DispatchQueue.main) { | |
| completion() |
NewerOlder