d
This commit is contained in:
@@ -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)
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
29
iOS/src/Main/Main.Section16Buttons.swift
Normal file
29
iOS/src/Main/Main.Section16Buttons.swift
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
15
iOS/src/Main/Main.VC.swift
Normal file
15
iOS/src/Main/Main.VC.swift
Normal 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
1
iOS/src/Main/Main.swift
Normal file
@@ -0,0 +1 @@
|
||||
enum Main { }
|
||||
Reference in New Issue
Block a user