Skip to content

Instantly share code, notes, and snippets.

View mimthath4's full-sized avatar

Imthath mimthath4

View GitHub Profile
import SwiftUI
struct SplitView: View {
@State var selected: Int? = nil
var body: some View {
HStack {
List(0...10, id: \.self, selection: $selected) { number in
HStack {
import Foundation
private let bgQueue = DispatchQueue(label: "MIUsecase")
/// Provide implementation for the execute method and then
/// call perform to get response in main thread
/// call execute to get response in background thread
public protocol MIUsecase: class {
associatedtype MIUsecaseRequest
associatedtype MIUsecaseResponse
import UIKit
import MINetworkKit
class AlbumsViewController: MITableViewController {
override func registerCells() {
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "albumCell")
updateAlbums()
}
}
import UIKit
class PostsViewController: MITableViewController {
init(posts: [Post]) {
super.init(style: .plain)
sections.append(SectionItem(id: "Post", header: nil, items: posts))
}
required init?(coder: NSCoder) {
class MITableViewController: UITableViewController {
var sections: [SectionItem] = []
override func viewDidLoad() {
super.viewDidLoad()
registerCells()
}
func registerCells() {
extension ViewController: UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
// your implementation goes here
}
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
// your implementation goes here
}