diff --git a/iOS/app/MMMemory.xcodeproj/project.pbxproj b/iOS/app/MMMemory.xcodeproj/project.pbxproj index 4fdbece..fdbb878 100644 --- a/iOS/app/MMMemory.xcodeproj/project.pbxproj +++ b/iOS/app/MMMemory.xcodeproj/project.pbxproj @@ -8,24 +8,41 @@ /* Begin PBXBuildFile section */ 1F083A14C69F20A6BA92A63E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F16A7DD61EF6CD4FB4E3DE25 /* AppDelegate.swift */; }; + A6E529FBA0467549623E44A5 /* Main.Section16Buttons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 032C8E87061765718F550E70 /* Main.Section16Buttons.swift */; }; + AEDC5FB14A2EE027C2F7FDA7 /* Main.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC87DC40D65BB2748668CE65 /* Main.swift */; }; B19B3998FA2BA651ACB1E53C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C1742EFC5A1E818780679340 /* Assets.xcassets */; }; CAFD870CA84084E45011CC23 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4E32B0495E4BCEA4EE0508D4 /* LaunchScreen.storyboard */; }; + D65ED8EB653B36E6C4094996 /* Main.VC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EAF8AC4A5A1BCE77350565E /* Main.VC.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 032C8E87061765718F550E70 /* Main.Section16Buttons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Main.Section16Buttons.swift; sourceTree = ""; }; 4E32B0495E4BCEA4EE0508D4 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; + 6EAF8AC4A5A1BCE77350565E /* Main.VC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Main.VC.swift; sourceTree = ""; }; 9D774FEE86833E8A0A74387C /* App.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; C1742EFC5A1E818780679340 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + CC87DC40D65BB2748668CE65 /* Main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Main.swift; sourceTree = ""; }; F16A7DD61EF6CD4FB4E3DE25 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXGroup section */ + 43F40869C11E8EE85952F2E9 /* Main */ = { + isa = PBXGroup; + children = ( + 032C8E87061765718F550E70 /* Main.Section16Buttons.swift */, + CC87DC40D65BB2748668CE65 /* Main.swift */, + 6EAF8AC4A5A1BCE77350565E /* Main.VC.swift */, + ); + path = Main; + sourceTree = ""; + }; 667BC26EA8068A9FA707FC02 /* src */ = { isa = PBXGroup; children = ( F16A7DD61EF6CD4FB4E3DE25 /* AppDelegate.swift */, C1742EFC5A1E818780679340 /* Assets.xcassets */, 4E32B0495E4BCEA4EE0508D4 /* LaunchScreen.storyboard */, + 43F40869C11E8EE85952F2E9 /* Main */, ); name = src; path = ../src; @@ -110,6 +127,9 @@ buildActionMask = 2147483647; files = ( 1F083A14C69F20A6BA92A63E /* AppDelegate.swift in Sources */, + A6E529FBA0467549623E44A5 /* Main.Section16Buttons.swift in Sources */, + D65ED8EB653B36E6C4094996 /* Main.VC.swift in Sources */, + AEDC5FB14A2EE027C2F7FDA7 /* Main.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/iOS/app/MMMemory.xcodeproj/project.xcworkspace/xcuserdata/mk.xcuserdatad/UserInterfaceState.xcuserstate b/iOS/app/MMMemory.xcodeproj/project.xcworkspace/xcuserdata/mk.xcuserdatad/UserInterfaceState.xcuserstate index e886593..980e775 100644 Binary files a/iOS/app/MMMemory.xcodeproj/project.xcworkspace/xcuserdata/mk.xcuserdatad/UserInterfaceState.xcuserstate and b/iOS/app/MMMemory.xcodeproj/project.xcworkspace/xcuserdata/mk.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/iOS/src/AppDelegate.swift b/iOS/src/AppDelegate.swift index 405b089..c3f2d0a 100644 --- a/iOS/src/AppDelegate.swift +++ b/iOS/src/AppDelegate.swift @@ -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) - */ - } -} diff --git a/iOS/src/Main/Main.Section16Buttons.swift b/iOS/src/Main/Main.Section16Buttons.swift new file mode 100644 index 0000000..486e506 --- /dev/null +++ b/iOS/src/Main/Main.Section16Buttons.swift @@ -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 + } + } + } +} diff --git a/iOS/src/Main/Main.VC.swift b/iOS/src/Main/Main.VC.swift new file mode 100644 index 0000000..8a3ae05 --- /dev/null +++ b/iOS/src/Main/Main.VC.swift @@ -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) + } + } +} diff --git a/iOS/src/Main/Main.swift b/iOS/src/Main/Main.swift new file mode 100644 index 0000000..ab14183 --- /dev/null +++ b/iOS/src/Main/Main.swift @@ -0,0 +1 @@ +enum Main { }