Browse Source

image shown in navigation title

pull/1/head
gme_2 6 years ago
parent
commit
a52bdc60a4
  1. 80
      GMERemittance/Home/HomeViewController.swift

80
GMERemittance/Home/HomeViewController.swift

@ -113,17 +113,11 @@ class HomeViewController: UIViewController, TableViewCellDelegate, FBSDKSharing
self.tabBarController?.tabBar.isHidden = false
setNavBar()
setActionBarIcons(showNotificationParameter: false)
// setUpRefreshControl()
bindUserStatusToUI()
profileViewModel.fetchUserInfo(userId: nil)
// socialfeedviewmodel.socialFeedsRxValue.value = nil
//
// socialfeedviewmodel.setAccessType(accessType: "public")
// self.bindFeedsDataToUI()
tableView.reloadSections(NSIndexSet(index: 3) as IndexSet, with: .none)
@ -152,34 +146,22 @@ class HomeViewController: UIViewController, TableViewCellDelegate, FBSDKSharing
@objc func refresh(_ sender: AnyObject) {
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
func setNavBar() {
// UINavigationBar.setupImageAppearance()
// self.navigationController?.navigationBar
// self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
//
self.navigationController?.navigationBar.isTranslucent = false
let rightButton = UIBarButtonItem(image: UIImage(named: "ic_hamburger"), style: .plain, target: self, action: #selector(showSideMenu))
//
// self.navigationController?.navigationBar.isTranslucent = false
//
// 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() {
@ -274,6 +256,7 @@ class HomeViewController: UIViewController, TableViewCellDelegate, FBSDKSharing
@developer : Suraj Shrestha
@date : 2018/02/12
@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){
let supportImage = UIImage(named: "ic_support")?.withRenderingMode(.alwaysOriginal)
@ -285,7 +268,7 @@ class HomeViewController: UIViewController, TableViewCellDelegate, FBSDKSharing
notificationImage = UIImage(named: "ic_notification")?.withRenderingMode(.alwaysOriginal)
}
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)
}
// 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() {
super.viewDidLoad()
setupDelegates()
@ -1065,11 +1029,6 @@ extension HomeViewController: UITableViewDelegate, UITableViewDataSource {
switch index {
case .balance:
return 100
// if (UserDefaults.standard.object(forKey: "com.gmeremit.isVerified") as! Bool) {
// return 136
// } else {
// return 100
// }
case .collection:
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
if isVerifiedUser() {
// cell.viewVerify.alpha = 0
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.addTarget(self, action:#selector(rewardTap(_:)), for:.touchUpInside)
setAvailableBalanceInStringAttributeFormat(label: cell.labelAvailableBalance)
let nickName = UserDefaults.standard.object(forKey: "com.gmeremit.nickName") as? String
if nickName == nil || nickName == "" {
let nameArray = (UserDefaults.standard.object(forKey: "com.gmeremit.fullName") as! String).split(separator: " ")
@ -1159,9 +1111,6 @@ extension HomeViewController: UITableViewDelegate, UITableViewDataSource {
} 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!.")
cell.btnAgnet.addTarget(self, action:#selector(agentTap(_:)), for:.touchUpInside)
}
@ -1415,11 +1364,6 @@ extension HomeViewController: UICollectionViewDelegate, UICollectionViewDataSour
case 5:
self.alert(message: "This feature is comming soon")
return
// if (UserDefaults.standard.object(forKey: "com.gmeremit.isVerified") as! Bool) {
// self.performSegue(withIdentifier: "walletTransfer", sender: nil)
// } else {
// self.popUpMessage(value: 13)
// }
case 6:
showAllCollectionViewCells = true

Loading…
Cancel
Save