|
@ -113,17 +113,11 @@ class HomeViewController: UIViewController, TableViewCellDelegate, FBSDKSharing |
|
|
self.tabBarController?.tabBar.isHidden = false |
|
|
self.tabBarController?.tabBar.isHidden = false |
|
|
setNavBar() |
|
|
setNavBar() |
|
|
setActionBarIcons(showNotificationParameter: false) |
|
|
setActionBarIcons(showNotificationParameter: false) |
|
|
// setUpRefreshControl() |
|
|
|
|
|
|
|
|
|
|
|
bindUserStatusToUI() |
|
|
bindUserStatusToUI() |
|
|
|
|
|
|
|
|
profileViewModel.fetchUserInfo(userId: nil) |
|
|
profileViewModel.fetchUserInfo(userId: nil) |
|
|
|
|
|
|
|
|
// socialfeedviewmodel.socialFeedsRxValue.value = nil |
|
|
|
|
|
// |
|
|
|
|
|
// socialfeedviewmodel.setAccessType(accessType: "public") |
|
|
|
|
|
|
|
|
|
|
|
// self.bindFeedsDataToUI() |
|
|
|
|
|
|
|
|
|
|
|
tableView.reloadSections(NSIndexSet(index: 3) as IndexSet, with: .none) |
|
|
tableView.reloadSections(NSIndexSet(index: 3) as IndexSet, with: .none) |
|
|
|
|
|
|
|
@ -152,34 +146,22 @@ class HomeViewController: UIViewController, TableViewCellDelegate, FBSDKSharing |
|
|
|
|
|
|
|
|
@objc func refresh(_ sender: AnyObject) { |
|
|
@objc func refresh(_ sender: AnyObject) { |
|
|
newFeedsWillBeAppended = false |
|
|
newFeedsWillBeAppended = false |
|
|
// tableView.cellForRow(at: IndexPath(row: 0, section: 4))?.isHidden = true |
|
|
|
|
|
// socialfeedviewmodel.resetBeforeAfterFeedId() |
|
|
|
|
|
// socialfeedviewmodel.fetchSocialFeeds(isPublic: true, loadMore: false) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//--ALL NAV BAR FUNCTIONS HERE |
|
|
//--ALL NAV BAR FUNCTIONS HERE |
|
|
func setNavBar() { |
|
|
func setNavBar() { |
|
|
// UINavigationBar.setupImageAppearance() |
|
|
|
|
|
// self.navigationController?.navigationBar |
|
|
|
|
|
// self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default) |
|
|
|
|
|
// |
|
|
|
|
|
|
|
|
|
|
|
// |
|
|
|
|
|
// self.navigationController?.navigationBar.isTranslucent = false |
|
|
|
|
|
// |
|
|
|
|
|
|
|
|
self.navigationController?.navigationBar.isTranslucent = false |
|
|
|
|
|
let rightButton = UIBarButtonItem(image: UIImage(named: "ic_hamburger"), style: .plain, target: self, action: #selector(showSideMenu)) |
|
|
|
|
|
|
|
|
// let rightButton = UIBarButtonItem(image: UIImage(named: "ic_hamburger"), style: .plain, target: self, action: #selector(showSideMenu)) |
|
|
|
|
|
// |
|
|
|
|
|
// self.tabBarController?.navigationItem.leftBarButtonItem = rightButton |
|
|
|
|
|
// self.tabBarController?.navigationItem.leftBarButtonItem?.tintColor = UIColor.white |
|
|
|
|
|
// |
|
|
|
|
|
self.tabBarController?.navigationController?.navigationBar.barTintColor = UIColor(hex:0xec1c24) |
|
|
|
|
|
// let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 125, height: 30)) |
|
|
|
|
|
// imageView.contentMode = .scaleAspectFit |
|
|
|
|
|
// let image = UIImage(named: "ic_gme_new") |
|
|
|
|
|
// imageView.image = image |
|
|
|
|
|
// self.tabBarController?.navigationItem.titleView = imageView |
|
|
|
|
|
|
|
|
self.navigationItem.leftBarButtonItem = rightButton |
|
|
|
|
|
self.navigationItem.leftBarButtonItem?.tintColor = UIColor.white |
|
|
|
|
|
self.navigationController?.navigationBar.barTintColor = UIColor(hex:0xec1c24) |
|
|
|
|
|
let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 125, height: 30)) |
|
|
|
|
|
imageView.contentMode = .scaleAspectFit |
|
|
|
|
|
let image = UIImage(named: "ic_gme_new") |
|
|
|
|
|
imageView.image = image |
|
|
|
|
|
self.navigationItem.titleView = imageView |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@objc func showSideMenu() { |
|
|
@objc func showSideMenu() { |
|
@ -274,6 +256,7 @@ class HomeViewController: UIViewController, TableViewCellDelegate, FBSDKSharing |
|
|
@developer : Suraj Shrestha |
|
|
@developer : Suraj Shrestha |
|
|
@date : 2018/02/12 |
|
|
@date : 2018/02/12 |
|
|
@des : Add action bar icons i.e notification and support |
|
|
@des : Add action bar icons i.e notification and support |
|
|
|
|
|
code refractored by ccr, almost maney many good things added. all bad things are left by previous dev :D |
|
|
*/ |
|
|
*/ |
|
|
func setActionBarIcons(showNotificationParameter: Bool){ |
|
|
func setActionBarIcons(showNotificationParameter: Bool){ |
|
|
let supportImage = UIImage(named: "ic_support")?.withRenderingMode(.alwaysOriginal) |
|
|
let supportImage = UIImage(named: "ic_support")?.withRenderingMode(.alwaysOriginal) |
|
@ -285,7 +268,7 @@ class HomeViewController: UIViewController, TableViewCellDelegate, FBSDKSharing |
|
|
notificationImage = UIImage(named: "ic_notification")?.withRenderingMode(.alwaysOriginal) |
|
|
notificationImage = UIImage(named: "ic_notification")?.withRenderingMode(.alwaysOriginal) |
|
|
} |
|
|
} |
|
|
let notificationButton = UIBarButtonItem(image: notificationImage, style: .plain, target: self, action: #selector(showNotification)) |
|
|
let notificationButton = UIBarButtonItem(image: notificationImage, style: .plain, target: self, action: #selector(showNotification)) |
|
|
self.tabBarController?.navigationItem.rightBarButtonItems=[notificationButton,supportButton] |
|
|
|
|
|
|
|
|
self.navigationItem.rightBarButtonItems=[notificationButton,supportButton] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -345,25 +328,6 @@ class HomeViewController: UIViewController, TableViewCellDelegate, FBSDKSharing |
|
|
performSegue(withIdentifier: "notification", sender: nil) |
|
|
performSegue(withIdentifier: "notification", sender: nil) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// func checkNetwork() { |
|
|
|
|
|
// if !Reachability.isConnectedToNetwork() { |
|
|
|
|
|
// self.popUpMessage(value: 15) |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
func setUpNetworkListener() { |
|
|
|
|
|
// socialfeedviewmodel.internetConnection.value = nil |
|
|
|
|
|
|
|
|
|
|
|
// socialfeedviewmodel.internetConnection.bind { [unowned self] in |
|
|
|
|
|
// guard $0 != nil else { |
|
|
|
|
|
// return |
|
|
|
|
|
// } |
|
|
|
|
|
// self.enableUserInteractions() |
|
|
|
|
|
// self.popUpMessage(value: 15) |
|
|
|
|
|
// } |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override func viewDidLoad() { |
|
|
override func viewDidLoad() { |
|
|
super.viewDidLoad() |
|
|
super.viewDidLoad() |
|
|
setupDelegates() |
|
|
setupDelegates() |
|
@ -1065,11 +1029,6 @@ extension HomeViewController: UITableViewDelegate, UITableViewDataSource { |
|
|
switch index { |
|
|
switch index { |
|
|
case .balance: |
|
|
case .balance: |
|
|
return 100 |
|
|
return 100 |
|
|
// if (UserDefaults.standard.object(forKey: "com.gmeremit.isVerified") as! Bool) { |
|
|
|
|
|
// return 136 |
|
|
|
|
|
// } else { |
|
|
|
|
|
// return 100 |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
case .collection: |
|
|
case .collection: |
|
|
let widthCell = ((view.frame.width - (insetForCollectionView * 3) ) - 10) / 2 |
|
|
let widthCell = ((view.frame.width - (insetForCollectionView * 3) ) - 10) / 2 |
|
@ -1136,17 +1095,10 @@ extension HomeViewController: UITableViewDelegate, UITableViewDataSource { |
|
|
|
|
|
|
|
|
cell = tableView.dequeueReusableCell(withIdentifier: "topCell", for: indexPath) as! TableViewCell |
|
|
cell = tableView.dequeueReusableCell(withIdentifier: "topCell", for: indexPath) as! TableViewCell |
|
|
if isVerifiedUser() { |
|
|
if isVerifiedUser() { |
|
|
// cell.viewVerify.alpha = 0 |
|
|
|
|
|
cell.viewTop.alpha = 1 |
|
|
cell.viewTop.alpha = 1 |
|
|
// |
|
|
|
|
|
// cell.btnLoadBalance.addTarget(self, action:#selector(loadBalanceTap(_:)), for:.touchUpInside) |
|
|
|
|
|
|
|
|
|
|
|
cell.btnRewardPoint.setTitle(UserDefaults.standard.object(forKey: "com.gmeremit.rewardPoint") as? String, for: .normal) |
|
|
cell.btnRewardPoint.setTitle(UserDefaults.standard.object(forKey: "com.gmeremit.rewardPoint") as? String, for: .normal) |
|
|
|
|
|
|
|
|
cell.btnRewardPoint.addTarget(self, action:#selector(rewardTap(_:)), for:.touchUpInside) |
|
|
cell.btnRewardPoint.addTarget(self, action:#selector(rewardTap(_:)), for:.touchUpInside) |
|
|
|
|
|
|
|
|
setAvailableBalanceInStringAttributeFormat(label: cell.labelAvailableBalance) |
|
|
setAvailableBalanceInStringAttributeFormat(label: cell.labelAvailableBalance) |
|
|
|
|
|
|
|
|
let nickName = UserDefaults.standard.object(forKey: "com.gmeremit.nickName") as? String |
|
|
let nickName = UserDefaults.standard.object(forKey: "com.gmeremit.nickName") as? String |
|
|
if nickName == nil || nickName == "" { |
|
|
if nickName == nil || nickName == "" { |
|
|
let nameArray = (UserDefaults.standard.object(forKey: "com.gmeremit.fullName") as! String).split(separator: " ") |
|
|
let nameArray = (UserDefaults.standard.object(forKey: "com.gmeremit.fullName") as! String).split(separator: " ") |
|
@ -1159,9 +1111,6 @@ extension HomeViewController: UITableViewDelegate, UITableViewDataSource { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
// cell.viewTop.alpha = 0 |
|
|
|
|
|
// cell.viewVerify.alpha = 1 |
|
|
|
|
|
// todo: keep in view did load for first time dashboard entry. |
|
|
|
|
|
self.alert(message: "Your document is in verification process. Thereafter you can enjoy GME online service. Thank you for registering with us!.") |
|
|
self.alert(message: "Your document is in verification process. Thereafter you can enjoy GME online service. Thank you for registering with us!.") |
|
|
cell.btnAgnet.addTarget(self, action:#selector(agentTap(_:)), for:.touchUpInside) |
|
|
cell.btnAgnet.addTarget(self, action:#selector(agentTap(_:)), for:.touchUpInside) |
|
|
} |
|
|
} |
|
@ -1415,11 +1364,6 @@ extension HomeViewController: UICollectionViewDelegate, UICollectionViewDataSour |
|
|
case 5: |
|
|
case 5: |
|
|
self.alert(message: "This feature is comming soon") |
|
|
self.alert(message: "This feature is comming soon") |
|
|
return |
|
|
return |
|
|
// if (UserDefaults.standard.object(forKey: "com.gmeremit.isVerified") as! Bool) { |
|
|
|
|
|
// self.performSegue(withIdentifier: "walletTransfer", sender: nil) |
|
|
|
|
|
// } else { |
|
|
|
|
|
// self.popUpMessage(value: 13) |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
case 6: |
|
|
case 6: |
|
|
showAllCollectionViewCells = true |
|
|
showAllCollectionViewCells = true |
|
|