Sobes.tech

Can you explain what the Chain of Response pattern is and how it is used?

Junior — Middle
235

How is the memory structure organized for data storage in the program?

Junior — Middle
234

Can you list other types of memory used in programming, besides the stack and heap?

Junior — Middle
233

Is it possible to programmatically change the height of a specific cell in UITableView to a forced value?

231

What exactly is specified when creating a Semaphore object for initialization?

Junior — Middle
231

// Enum for HTTP methods enum HTTPMethod: String { case post = "POST" } // Enum for errors enum Errors: Error { case invalidUrl case invalidQuery case invalidResponse case httpStatus(Int) } // Protocol for decoding protocol MyDecoder { func decode<T: Decodable>(_: T.Type, from data: Data) throws -> T } // Network service class final class NetworkService { private let session: URLSession private let encoder = JSONEncoder() private let decoder: MyDecoder init( session: URLSession = .shared, decoder: MyDecoder ) { self.session = session self.decoder = decoder } // Request method func request<Response: Decodable, Body: Encodable>( urlString: String, method: HTTPMethod, body: Body? = nil, headers: [String: String] = [:], query: [String: String] = [:] ) async throws -> Response { guard var components = URLComponents(string: urlString) else { throw Errors.invalidUrl } if !query.isEmpty { components.queryItems = query.map { URLQueryItem(name: $0.key, value: $0.value) } } guard let url = components.url else { throw Errors.invalidQuery } var request = URLRequest(url: url)

Middle+
231

In what situations is it recommended to use NSLock for thread synchronization?

Junior — Middle
230

Explain the stages of the lifecycle of a ViewController instance in an iOS application.

Junior — Middle
229
/7