-
Что такое
полиморфизм
? -
Что такое *инкапсуляция? Что такое *нарушение инкапсуляции?
-
Чем
абстрактный
класс отличается отинтерфейса
? -
Расскажите о
паттерне MVC
. Чем отличаетсяпассивная
модель отактивной
?
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
//: Playground - noun: a place where people can play | |
import Foundation | |
protocol JSONSerializable { | |
func toJSON() throws -> Any? | |
} | |
enum CouldNotSerializeError: Error { | |
case noImplementation(source: Any, type: String) |
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 | |
protocol JSONSerializable { | |
func toJSON() throws -> Any? | |
} | |
enum CouldNotSerializeError: Error { | |
case noImplementation(source: Any, type: String) | |
case undefinedKey(source: Any, type: String) | |
} |
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 XCTest | |
protocol AutoEquatable: Equatable {} | |
extension AutoEquatable { | |
static func ==(lhs: Self, rhs: Self) -> Bool { | |
var lhsDump = String() | |
dump(lhs, to: &lhsDump) |
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
git log --graph --pretty=oneline --abbrev-commit |
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 URLRequest { | |
/** | |
Returns a cURL command representation of this URL request. | |
*/ | |
public var curlString: String { | |
guard let url = url else { return "" } | |
var baseCommand = "curl \(url.absoluteString)" | |
if httpMethod == "HEAD" { |
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
/// This is free and unencumbered software released into the public domain. | |
/// | |
/// Anyone is free to copy, modify, publish, use, compile, sell, or | |
/// distribute this software, either in source code form or as a compiled | |
/// binary, for any purpose, commercial or non-commercial, and by any | |
/// means. | |
/// | |
/// In jurisdictions that recognize copyright laws, the author or authors | |
/// of this software dedicate any and all copyright interest in the | |
/// software to the public domain. We make this dedication for the benefit |
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
{ | |
"usages": [ | |
{ | |
"additionalUsage": 0, | |
"freeResourcGroups": [ | |
{ | |
"groupId": "1002", | |
"groupName": "VOICE", | |
"resourceUnit": "102", | |
"resources": [ |
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 | |
// MARK: - Locks | |
protocol Lock { | |
func lock() | |
func unlock() | |
} | |
extension NSLock: Lock {} |
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
// MARK: - DispatchQueue | |
class DispatchQueueAtomicProperty { | |
private let queue = DispatchQueue(label: "com.vadimbulavin.DispatchQueueAtomicProperty") | |
private var underlyingFoo = 0 | |
var foo: Int { | |
get { | |
return queue.sync { underlyingFoo } | |
} |
OlderNewer