Skip to content

Instantly share code, notes, and snippets.

View Hadevs's full-sized avatar
🌴
Freelancer

Danil Kovalev Hadevs

🌴
Freelancer
View GitHub Profile
@Hadevs
Hadevs / roomplan.swift
Created December 6, 2023 18:36
roomplan.swift
override func viewDidLoad() {
super.viewDidLoad()
if let url = Bundle.main.url(forResource: "Room", withExtension: "json"),
let jsonData = try? Data(contentsOf: url) {
readAndTransform(jsonData: jsonData)
}
}
struct RoomPlan: Codable {
public List<String> getCommonColors(String blueprintId, List<String> printProviders) throws IOException {
List<String> commonColors = new ArrayList<String>();
Map<String, Boolean> colorsMap = new HashMap<>();
for (String printProvider : printProviders) {
VariantsResponse variantsResponse = getVariants(blueprintId, printProvider);
List<Variant> variants = variantsResponse.getVariants();
for (Variant variant : variants) {
Options options = variant.getOptions();
String color = options.getColor();
public List<String> getCommonColors(String blueprintId, List<String> printProviders) throws IOException {
List<String> commonColors = new ArrayList<String>();
for (String printProvider : printProviders) {
VariantsResponse variantsResponse = getVariants(blueprintId, printProvider);
List<Variant> variants = variantsResponse.getVariants();
for (Variant variant : variants) {
Options options = variant.getOptions();
String color = options.getColor();
if (!commonColors.contains(color)) {
В Swift модели делятся на ReferenceType и на ValueType.
// Set, Dictionary, Array - Типы коллекций в Swift, они имеют Value Type.
// Integer, String, Bool, Double, etc. - Примитивные типы в Swift, они имеют Value Type.
// Closures, UIView, UIViewController, классы - это Reference Type.
typealias VoidClosure = () -> Void // Пустое замыкание
typealias ItemClosure<T> = (T) -> Void // Замыкание с аргументом любого типа

Broniboy iOS Teamlead Plan

Митинги и созвоны

Митинг iOS Команды - Среда с 17-00 до 18-00

  • Обсуждение архитектурных решений, накопившихся за неделю.
  • Тимлид за неделю выписывает моменты в Pull Request'ах, на которые стоит обратить внимание
  • Вопрос/ответ
# Broniboy iOS Teamlead Plan
## Митинги и созвоны
### Митинг iOS Команды - Среда с 17-00 до 18-00
- Обсуждение архитектурных решений, накопившихся за неделю.
- Тимлид за неделю выписывает моменты в Pull Request'ах, на которые стоит
обратить внимание
- Вопрос/ответ
{
"title": "Меню",
"sections": [
{
"title": "",
"blocks": [
{
"text": "О сервисе",
"backgroundImage": "https://..."
},
import UIKit
import CoreLocation
class LocationProvider: NSObject, CLLocationManagerDelegate {
static let shared = LocationProvider()
var city: String?
var currentLocation: CLLocation?
var lastRealOneLocation: CLLocation?
private var locationList: [CLLocation] = []
import CoreLocation
struct LocationUtils {
let isGps: Bool
let accuracy: Double
let speed: Double
let latitude: Double
let longitude: Double
let previousValidLatitude: Double
let previousValidLongitude: Double