This commit is contained in:
Михаил Капелько
2023-05-01 18:03:36 +03:00
parent 3514fcb6fe
commit 041cdc0dea
6 changed files with 66 additions and 12 deletions

View File

@@ -10,21 +10,10 @@ extension AppDelegate {
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let vc = UIViewController()
vc.view.backgroundColor = .white
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = vc
window?.rootViewController = Main.VC()
window?.makeKeyAndVisible()
return true
}
}
extension AppDelegate {
private func setupMemory() {
/*
let w = Converter.World(converterModel)
converterS = Converter.Service(w)
*/
}
}

View File

@@ -0,0 +1,29 @@
import UIKit
// MARK: - Протоколы
protocol MainSection16Buttons {
}
// MARK: - Реализация
extension Main {
enum Section16Buttons {
static func setupCore(_ core: Main.VC) {
// Создаём 16 кнопок.
for i in 0..<16 {
let btn = UIButton()
core.buttons.append(btn)
btn.tag = i
//????btn.addTarget(self, action: #selector(selectButton), for: .touchUpInside)
core.view.addSubview(btn)
}
// Расставляем их в сетке 4x4.
for btn in core.buttons {
btn.frame = CGRect(x: 0, y: btn.tag * 60, width: 50, height: 50)
btn.backgroundColor = .blue
}
}
}
}

View File

@@ -0,0 +1,15 @@
import UIKit
extension Main {
class VC: UIViewController {
var buttons = [UIButton]()
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
Main.Section16Buttons.setupCore(self)
}
}
}

1
iOS/src/Main/Main.swift Normal file
View File

@@ -0,0 +1 @@
enum Main { }