QSLHomeViewModel.swift 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // QSLHomeViewModel.swift
  3. // QuickSearchLocation
  4. //
  5. // Created by mac on 2024/4/11.
  6. //
  7. import UIKit
  8. class QSLHomeViewModel: NSObject {
  9. struct UX {
  10. static let viewRight: CGFloat = -12
  11. static let twofriendViewHeight: CGFloat = 281
  12. static let moreThanTwoFriViewHeight: CGFloat = 320
  13. static let friendViewHeight: CGFloat = 355.rpx
  14. }
  15. var friendViewHeight: CGFloat = 0
  16. var friendList: [QSLUserModel] = [QSLUserModel]()
  17. var friendLocationList: [QSLMapPointModel] = [QSLMapPointModel]()
  18. typealias completionClosure = () -> Void
  19. func initUIData() {
  20. friendViewHeight = UX.friendViewHeight
  21. }
  22. }
  23. extension QSLHomeViewModel {
  24. // func refreshDataSoure(complete: completionClosure) {
  25. //
  26. // friendList = [QSLUserModel]()
  27. // for _ in 0...4 {
  28. // let model = QSLUserModel()
  29. // friendList?.append(model)
  30. // }
  31. // if let friendList = self.friendList {
  32. // if friendList.count < 2 {
  33. // friendViewHeight = UX.twofriendViewHeight
  34. // } else {
  35. // friendViewHeight = UX.moreThanTwoFriViewHeight
  36. // }
  37. // }
  38. // complete()
  39. // }
  40. }