Created
November 25, 2021 19:19
-
-
Save Emin-Emini/1c6b9ea0958aa0e1d399e5feeb93fc32 to your computer and use it in GitHub Desktop.
Structure your Swift code in ViewControllers with Code Burger Method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// Code Burger Method | |
// | |
// Created by Emin Emini on 25.11.21. | |
// | |
import UIKit | |
class ViewController: UIViewController { | |
// MARK: - Outlets (Bun) | |
@IBOutlet weak var myLabel: UILabel! | |
@IBOutlet weak var backButton: UIButton! | |
@IBOutlet weak var forwardButton: UIButton! | |
// MARK: - Properties (Cheese) | |
let someStringProperty = "" | |
// MARK: - View Functions (Pattie/s) | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view. | |
} | |
// MARK: - Actions (Bun) | |
@IBAction func goBack(_ sender: Any) { | |
loadLess() | |
} | |
@IBAction func goNext(_ sender: Any) { | |
loadMore() | |
} | |
} | |
// MARK: - Functions (Fries) | |
extension ViewController { | |
func loadLess() { | |
<#code#> | |
} | |
func loadMore() { | |
<#code#> | |
} | |
} | |
// MARK: - Table View (Soda) | |
extension ViewController: UITableViewDelegate, UITableViewDataSource { | |
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
<#code#> | |
} | |
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
<#code#> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment