parent
acf994d619
commit
5d79917804
@ -0,0 +1,20 @@
|
||||
//
|
||||
// MineDownloadViewController.swift
|
||||
// IndieMusic
|
||||
//
|
||||
// Created by WenLei on 2024/1/10.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class MineDownloadViewController: ViewController {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
//
|
||||
// MineDownloadViewModel.swift
|
||||
// IndieMusic
|
||||
//
|
||||
// Created by WenLei on 2024/1/10.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import RxSwift
|
||||
import RxCocoa
|
||||
|
||||
class MineDownloadViewModel: ViewModel, ViewModelType {
|
||||
|
||||
struct Input {
|
||||
let viewWillAppear: ControlEvent<Bool>
|
||||
let selection: Driver<IndexPath>
|
||||
|
||||
}
|
||||
|
||||
struct Output {
|
||||
let items: BehaviorRelay<[MineSingleSection]>
|
||||
let selection: Driver<IndexPath>
|
||||
let itemSelected: PublishSubject<MineSingle>
|
||||
|
||||
}
|
||||
|
||||
let itemSelected = PublishSubject<MineSingle>()
|
||||
let items = BehaviorRelay<[MineSingleSection]>.init(value: [])
|
||||
|
||||
func transform(input: Input) -> Output {
|
||||
|
||||
input.viewWillAppear.subscribe { (_) in
|
||||
|
||||
}.disposed(by: rx.disposeBag)
|
||||
|
||||
let mine = MineSingle.init(cover: "", title: "", detail: "")
|
||||
|
||||
items.accept([MineSingleSection.init(items: [mine, mine, mine])])
|
||||
|
||||
|
||||
input.selection.drive { indexPath in
|
||||
guard let sectionItem = self.items.value.first?.items[indexPath.row] else { return }
|
||||
self.itemSelected.onNext(sectionItem)
|
||||
}.disposed(by: rx.disposeBag)
|
||||
|
||||
|
||||
|
||||
return Output.init(items: items,
|
||||
selection: input.selection,
|
||||
itemSelected: itemSelected)
|
||||
}
|
||||
|
||||
}
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.3 KiB |
@ -1,15 +1,16 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "login_bakcground.svg",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "launch_bakcground@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "launch_bakcground@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
After Width: | Height: | Size: 231 KiB |
After Width: | Height: | Size: 491 KiB |
Before Width: | Height: | Size: 8.1 MiB |
Loading…
Reference in new issue