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
// | |
// CharactersViewModelTests.swift | |
// RickyAndMortyCharacterTests | |
// | |
// Created by Arifin Firdaus on 13/02/23. | |
// | |
import Combine | |
import XCTest | |
@testable import RickyAndMortyCharacter |
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 | |
import SwiftUI | |
private let incomeOutcomeOptions: [String] = ["Income", "Outcome"] | |
private let categoryOptions: [Transaction.Category] = [.education, .food, .transport, .shopping, .software, .gift, .payment, .game, .transport, .medical] | |
final class TransactionsViewControllerFactory { | |
private init() { } | |
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
func test_load_shouldRespondSomething() { | |
let sut = makeSUT() | |
// ... | |
// other code | |
XCTAssertNotNil(sut) | |
} |
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
private func makeSUT() -> LoadLanguageIdPreferencesUseCase { | |
let analytic: Inalytic = AnalayticSpy() | |
let storageClient: IUserDefaults = UserDefaultsSpy() | |
let serviceClient: IHTTPClient = HTTPClientSpy() | |
let storage: TextToSpeechPreferencesStorage = TextToSpeechPreferencesStorageImpl(client: storageClient) | |
let service: TextToSpeechPreferencesService = TextToSpeechPreferencesServiceImpl(client: serviceClient) | |
let repository: TextToSpeechPreferencesRepository = TextToSpeechPreferencesRepositoryImpl( | |
storage: storage, | |
service: service | |
) |
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 | |
extension ViewController: UITableViewDelegate { | |
// Some UITableViewDelegate methods | |
// ... | |
func scrollViewDidScroll(_ scrollView: UIScrollView) { | |
let verticalOffset = tableView.contentOffset.y | |
if verticalOffset >= 64 { |
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 | |
extension ViewController: UITableViewDelegate { | |
// Some UITableViewDelegate method | |
// ... | |
func scrollViewDidScroll(_ scrollView: UIScrollView) { | |
let verticalOffset = tableView.contentOffset.y | |
verticalOffset >= 64 |
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 LoginVC: UIViewController { | |
// MARK: - Outlets | |
@IBOutlet weak var usernameTextField: UITextField! | |
@IBOutlet weak var passwordTextField: UITextField! | |
// MARK: - View life cycle | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
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 | |
import SDWebImage | |
class ViewController: UIViewController { | |
// MARK: - Outlet | |
@IBOutlet weak var headerImageView: UIImageView! | |
@IBOutlet weak var titleLabel: UILabel! | |
@IBOutlet weak var subtitleLabel: UILabel! | |
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 Foundation | |
class PhotoViewModel { | |
// MARK: - Properties | |
private var photo: Photo? { | |
didSet { | |
guard let p = photo else { return } | |
self.setupText(with: p) | |
self.didFinishFetch?() |
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 Foundation | |
import Alamofire | |
struct DataService { | |
// MARK: - Singleton | |
static let shared = DataService() | |
// MARK: - URL | |
private var photoUrl = "https://jsonplaceholder.typicode.com/photos" |
NewerOlder