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
protocol MainViewModelDelegate { | |
func requestCompleted() | |
} |
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
class MainViewModel { | |
var delegate: MainViewModelDelegate? | |
} |
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
// MARK: - Auxiliary Methods | |
extension MainViewModel { | |
func getValues() { | |
if let path = Bundle.main.path(_: _:) { // ... } | |
// ... Fetch values from test.json | |
self.delegate?.requestCompleted() | |
} | |
} |
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
class MainViewController: UIViewController { | |
// ... | |
private lazy var viewModel: MainViewModel = { | |
let vm = MainViewModel() | |
vm.delegate = self | |
return vm | |
}() |
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
// MARK: - MainViewModelDelegate | |
extension MainViewController: MainViewModelDelegate { | |
func requestCompleted() { | |
DispatchQueue.main.async { | |
self.tblView.reloadData() | |
} | |
} | |
} |
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
// Terminal Komutu | |
find . -type f -name \*.swift -print0 | xargs -0 genstrings -o Base.lproj |
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
class Person { | |
// static var count = 120 | |
static var count: Int { | |
return 120 | |
} | |
class var averageCount: Double { | |
return 23.6 |
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
import UIKit | |
class RootViewManager { | |
static func setRootView(_ targetVC: UIViewController) { | |
let appDelegate = UIApplication.shared.delegate as! AppDelegate | |
appDelegate.window?.rootViewController = targetVC | |
} | |
} |
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 | |
// demoLottie | |
// | |
// Created by Burak Furkan Asilturk on 8.03.2020. | |
// Copyright © 2020 Burak Furkan Asilturk. All rights reserved. | |
// | |
import UIKit | |
import Lottie |
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
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_height="200dp" | |
android:layout_width="200dp"> | |
<item> | |
<shape android:shape="rectangle"> | |
<solid android:color="#edf2f6"/> |
OlderNewer