Browse Source

Main Module configured

pull/1/head
gme_2 6 years ago
parent
commit
7c211c3108
  1. 18
      GMERemittance/AppDelegate.swift
  2. 4
      GMERemittance/Home/Home.storyboard
  3. 33
      GMERemittance/Home/HomeViewController.swift
  4. 10
      GMERemittance/Login/LoginViewController.swift
  5. 49
      GMERemittance/Module/Main/User Interface/View/MainViewController.swift
  6. 112
      GMERemittance/Module/Main/User Interface/Wireframe/MainWireframe.swift
  7. 1
      GMERemittance/Module/Main/User Interface/Wireframe/MainWireframeInput.swift
  8. 6
      GMERemittance/Module/SendMoneyParent/Application Logic/Interactor/SendMoneyParentInteractor.swift
  9. 1
      GMERemittance/Module/SendMoneyParent/User Interface/View/SendMoneyParent.storyboard
  10. 2
      GMERemittance/Module/SendMoneyParent/User Interface/Wireframe/SendMoneyParentWireframe.swift
  11. 4
      GMERemittance/Profile/Profile.storyboard
  12. 4
      GMERemittance/Recipient/RecipientListViewController.storyboard

18
GMERemittance/AppDelegate.swift

@ -251,13 +251,17 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
return
}
let storyboard = UIStoryboard.init(name: "Main", bundle: Bundle.main)
if let tabViewController = storyboard.instantiateViewController(withIdentifier: "TabBarController") as? UITabBarController {
nav.viewControllers = [tabViewController]
window?.rootViewController = nav
}
let mainWireFrame = MainWireframe.shared
let tabbarViewController = mainWireFrame?.getMainView()
window?.rootViewController = tabbarViewController
window?.makeKeyAndVisible()
// let storyboard = UIStoryboard.init(name: "Main", bundle: Bundle.main)
// if let tabViewController = storyboard.instantiateViewController(withIdentifier: "TabBarController") as? UITabBarController {
//
// nav.viewControllers = [tabViewController]
//
// window?.rootViewController = nav
// }
} else {

4
GMERemittance/Home/Home.storyboard

@ -1111,10 +1111,10 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8WZ-lQ-Im6" userLabel="LoadMoreView">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7wo-T4-XhL">
<rect key="frame" x="155.5" y="8" width="63" height="29"/>
<rect key="frame" x="155.5" y="7.5" width="63" height="29"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<state key="normal" title="Load More"/>
<connections>

33
GMERemittance/Home/HomeViewController.swift

@ -160,25 +160,26 @@ class HomeViewController: UIViewController, TableViewCellDelegate, FBSDKSharing
//--ALL NAV BAR FUNCTIONS HERE
func setNavBar() {
// UINavigationBar.setupImageAppearance()
// self.navigationController?.navigationBar
// self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
//
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
self.navigationController?.navigationBar.shadowImage = UIImage()
self.navigationController?.navigationBar.isTranslucent = false
self.tabBarController?.navigationItem.hidesBackButton = true
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.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
// 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
}
@objc func showSideMenu() {

10
GMERemittance/Login/LoginViewController.swift

@ -165,8 +165,14 @@ class LoginViewController: UIViewController {
}
}
func redirectToHomeViewController(){
self.performSegue(withIdentifier: "homeFromLogin", sender: nil)
func redirectToHomeViewController() {
// self.performSegue(withIdentifier: "homeFromLogin", sender: nil)
let wireFrame = MainWireframe.shared
let tabBarViewController = wireFrame?.getMainView()
if let delegate = UIApplication.shared.delegate as? AppDelegate {
delegate.window?.rootViewController = tabBarViewController
delegate.window?.makeKeyAndVisible()
}
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {

49
GMERemittance/Module/Main/User Interface/View/MainViewController.swift

@ -42,7 +42,8 @@ class MainViewController: UITabBarController {
}
private func setupTab() {
self.tabBar.barTintColor = Colors.TabBar.barTint
// self.tabBar.barTintColor = Colors.TabBar.barTint
self.tabBar.tintColor = Colors.defaultRed
self.tabBar.isTranslucent = false
self.tabBar.shadowImage = Colors.TabBar.shadow.image()
self.tabBar.backgroundImage = UIImage()
@ -61,28 +62,38 @@ extension MainViewController: MainViewInterface {
}
//0xec1c24
extension UINavigationBar {
static func setInsideAppearance() {
let navBarAppearance = UINavigationBar.appearance()
navBarAppearance.isTranslucent = false
navBarAppearance.barTintColor = Colors.NavBar.barTint
navBarAppearance.setBackgroundImage(UIImage(), for: .default)
navBarAppearance.shadowImage = UIImage() //Colors.NavBar.shadow.image()
navBarAppearance.barTintColor = UIColor.white
// navBarAppearance.shadowImage = UIImage() //Colors.NavBar.shadow.image()
let font = Fonts.NavBar.titleFont
// let font = Fonts.NavBar.titleFont
//
// navBarAppearance.titleTextAttributes = [
// NSAttributedStringKey.foregroundColor: Colors.NavBar.tint,
// NSAttributedStringKey.font: font]
// navBarAppearance.tintColor = Colors.NavBar.tint
}
static func setOutsideAppearance() {
self.setInsideAppearance()
let navBarAppearance = UINavigationBar.appearance()
navBarAppearance.barTintColor = Colors.defaultRed
let font = Fonts.NavBar.titleFont
navBarAppearance.titleTextAttributes = [
NSAttributedStringKey.foregroundColor: Colors.NavBar.tint,
NSAttributedStringKey.foregroundColor: UIColor.black,
NSAttributedStringKey.font: font]
navBarAppearance.tintColor = Colors.NavBar.tint
navBarAppearance.tintColor = UIColor.black
}
static func setOutsideAppearance() {
self.setInsideAppearance()
static func setupImageAppearance() {
// self.setInsideAppearance()
let navBarAppearance = UINavigationBar.appearance()
navBarAppearance.barTintColor = UIColor.white
navBarAppearance.barTintColor = Colors.defaultRed
let font = Fonts.NavBar.titleFont
navBarAppearance.titleTextAttributes = [
NSAttributedStringKey.foregroundColor: UIColor.black,
@ -104,20 +115,17 @@ extension UIViewController: Setup {
struct Colors {
static let separator = UIColor(hex: "#eeeeee")
static let defaultBlue = UIColor(hex: "#49AAEF")
static let defaultOrange = UIColor(hex: "#F9931E")
static let defaultRed = UIColor(hex: "#ea3751")
static let defaultRed = UIColor(hex: "#0xec1c24")
static let cartBadge = UIColor(hex: "#F5951D")
struct TabBar {
static let textItemSelected = Colors.defaultRed
static let textItemNotSelected = UIColor(hex: "#959595")
static let shadow = Colors.separator
static let barTint = UIColor.white
}
struct NavBar {
static let barTint = Colors.defaultBlue
// static let barTint =
static let tint = UIColor.white
static let shadow = Colors.separator
}
@ -127,17 +135,14 @@ struct Colors {
static let titleSelected = Colors.defaultRed
static let selectedBackground = Colors.defaultRed
}
}
struct Fonts {
private struct Family {
static let regular = "Helvetica"
static let light = "Helvetica-Light"
static let bold = "Helvetica-Bold"
static let regular = "SanFranciscoDisplay-regular"
static let light = "SanFranciscoDisplay-light"
static let bold = "SanFranciscoDisplay-Bold"
}
struct TabBar {

112
GMERemittance/Module/Main/User Interface/Wireframe/MainWireframe.swift

@ -10,42 +10,8 @@ import Foundation
import UIKit
class MainWireframe {
private static var _userShared: MainWireframe?
private static var _salesShared: MainWireframe? = MainWireframe(false)
static var userShared: MainWireframe {
if _userShared == nil {
_userShared = MainWireframe()
}
return _userShared!
}
static var salesShared: MainWireframe {
if _salesShared == nil {
_salesShared = MainWireframe(false)
}
return _salesShared!
}
init(_ isUser: Bool = true) {
self.isUserWireframe = isUser
}
static var shared: MainWireframe? = MainWireframe()
weak var view: UIViewController!
private var isUserWireframe: Bool
// MARK: Wireframes for user views
private lazy var homeWireFrame: HomeWireframeInput = {HomeWireframe()}()
private lazy var moreWireFrame: MoreWireFrameInput = {MoreWireframe()}()
private lazy var categoriesWireframe: CategoriesWireframeInput = {CategoriesWireframe()}()
private lazy var favoriteWireframe: FavouritesWireframeInput = {FavouritesWireframe()}()
private lazy var quickOrderWireframe: QuickOrderWireframeInput = {QuickOrderWireframe()}()
// MARK: Wireframes for sales
private lazy var salesDashboardWireframe: SalesDashboardWireframeInput = {SalesDashboardWireframe()}()
private lazy var storeListWireframe: StoreListWireframeInput = {StoreListWireframe()}()
private lazy var salesMoreWireframe: SalesMoreWireFrameInput = {SalesMoreWireframe()}()
}
extension MainWireframe: MainWireframeInput {
@ -54,7 +20,7 @@ extension MainWireframe: MainWireframeInput {
func getMainView() -> UIViewController {
let viewController = MainViewController()
let viewControllers: [UIViewController] = self.isUserWireframe ? self.getUser() : self.getSales()
let viewControllers: [UIViewController] = self.getViewControllers()
viewController.setup(viewControllers: viewControllers)
@ -67,74 +33,42 @@ extension MainWireframe: MainWireframeInput {
return viewController
}
private func getUser() -> [UIViewController] {
private func getViewControllers() -> [UIViewController] {
// home view controller
let homeViewController = self.homeWireFrame.getMainView()
let navHomeViewController = UINavigationController(rootViewController: homeViewController)
// user more view controller
let moreViewController = moreWireFrame.getMainView()
let navMoreViewController = UINavigationController(rootViewController: moreViewController)
// categories view controller
let categoriesViewController = categoriesWireframe.getMainView()
let navCategoriesViewController = UINavigationController(rootViewController: categoriesViewController)
// favorite view controller
let favoritesViewController = favoriteWireframe.getMainView()
let navFavoriteViewController = UINavigationController(rootViewController: favoritesViewController)
let quickOrderViewController = quickOrderWireframe.getMainView()
let navQuickOrderViewController = UINavigationController(rootViewController: quickOrderViewController)
return [navHomeViewController, navCategoriesViewController, navFavoriteViewController, navQuickOrderViewController, navMoreViewController]
}
let homeViewController = UIStoryboard.init(name: "Home", bundle: nil).instantiateViewController(withIdentifier: "Home") as! HomeViewController
let navHomeViewController = UINavigationController(rootViewController: homeViewController)
private func getSales() -> [UIViewController] {
// sales dashboard
let salesDashboardViewController = salesDashboardWireframe.getMainView()
let navSalesDashboardViewController = UINavigationController(rootViewController: salesDashboardViewController)
// user send money view controller
let sendMoneyViewController = UIStoryboard.init(name: "RecipientListViewController", bundle: nil).instantiateViewController(withIdentifier: "RecipientListViewController") as! RecipientListViewController
let navSendMoneyViewController = UINavigationController(rootViewController: sendMoneyViewController)
// store list
let storeListViewController = storeListWireframe.getMainView()
let navSalesListViewController = UINavigationController(rootViewController: storeListViewController)
// Constacts view controller
let contactsViewController = GmeContactsWireframe().getMainView()
let navContactsViewController = UINavigationController(rootViewController: contactsViewController)
// store more
let salesMoreViewController = salesMoreWireframe.getMainView()
let navSalesMoreViewController = UINavigationController(rootViewController: salesMoreViewController)
// profile view controller
let profileViewController = UIStoryboard.init(name: "Profile", bundle: nil).instantiateViewController(withIdentifier: "ProfileViewController") as! ProfileViewController
let navProfileViewController = UINavigationController(rootViewController: profileViewController)
return [navSalesDashboardViewController, navSalesListViewController, navSalesMoreViewController]
return [navHomeViewController, navSendMoneyViewController, navContactsViewController, navProfileViewController]
}
func show(index: Int) {
if let view = self.view as? MainViewController {
view.selectedIndex = index
}
}
func replaceLoginToProfile() {
// let profileView = self.profileWireframe.getMainView()
//
// let nav = UINavigationController(rootViewController: profileView)
// if let view = self.view as? MainViewController {
// view.viewControllers?.remove(at: 3)
// view.viewControllers?.insert(nav, at: 3)
// }
//
// self.show(index: 3)
}
func showStoreListing () {
if !self.isUserWireframe {
self.show(index: 1)
self.storeListWireframe.changeOrderType(alphabetic: false)
}
}
static func logout() {
guard let window = (MainWireframe._salesShared?.window ?? MainWireframe._userShared?.window) else {return}
MainWireframe._salesShared = nil
MainWireframe._userShared = nil
LoginWireframe().openMainViewAsNavigationControllerIn(window: window)
}
// func showStoreListing () {
// if !self.isUserWireframe {
// self.show(index: 1)
// self.storeListWireframe.changeOrderType(alphabetic: false)
// }
// }
}

1
GMERemittance/Module/Main/User Interface/Wireframe/MainWireframeInput.swift

@ -10,5 +10,4 @@ import Foundation
protocol MainWireframeInput: WireframeInput {
func show(index: Int)
func showStoreListing()
}

6
GMERemittance/Module/SendMoneyParent/Application Logic/Interactor/SendMoneyParentInteractor.swift

@ -14,11 +14,11 @@ class SendMoneyParentInteractor {
weak var output: SendMoneyParentInteractorOutput?
private let service: SendMoneyParentServiceType
var reciepient: Recipient
var reciepient: Recipient?
// MARK: Initialization
init(service: SendMoneyParentServiceType, reciepient: Recipient) {
init(service: SendMoneyParentServiceType, reciepient: Recipient?) {
self.service = service
self.reciepient = reciepient
}
@ -30,6 +30,8 @@ class SendMoneyParentInteractor {
extension SendMoneyParentInteractor: SendMoneyParentInteractorInput {
func viewIsReady() {
if let reciepient = self.reciepient {
self.output?.show(model: reciepient)
}
}
}

1
GMERemittance/Module/SendMoneyParent/User Interface/View/SendMoneyParent.storyboard

@ -151,6 +151,7 @@
<constraint firstItem="TTM-k8-r9y" firstAttribute="leading" secondItem="9Uc-9s-KgO" secondAttribute="leading" constant="8" id="x8x-1L-uBa"/>
</constraints>
</view>
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
<connections>
<outlet property="containerView" destination="TTM-k8-r9y" id="nQw-NX-HCc"/>
<outlet property="exchangeRateButton" destination="UXe-yi-f7S" id="5x2-7M-I3V"/>

2
GMERemittance/Module/SendMoneyParent/User Interface/Wireframe/SendMoneyParentWireframe.swift

@ -10,7 +10,7 @@ import UIKit
class SendMoneyParentWireframe {
weak var view: UIViewController!
var reciepient: Recipient!
var reciepient: Recipient?
}
extension SendMoneyParentWireframe: SendMoneyParentWireframeInput {

4
GMERemittance/Profile/Profile.storyboard

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ift-aL-bsv">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ift-aL-bsv">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
@ -27,7 +27,7 @@
<!--Profile-->
<scene sceneID="d42-Q8-kmE">
<objects>
<viewController id="ift-aL-bsv" customClass="ProfileViewController" customModule="GMERemittance" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="ProfileViewController" id="ift-aL-bsv" customClass="ProfileViewController" customModule="GMERemittance" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ead-ne-CIv">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>

4
GMERemittance/Recipient/RecipientListViewController.storyboard

@ -848,7 +848,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" ambiguous="YES" text="Service Fee: " textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1Pl-xL-Gm3">
<rect key="frame" x="94" y="50.5" width="65" height="12"/>
<rect key="frame" x="94" y="50.5" width="201" height="12"/>
<constraints>
<constraint firstAttribute="height" constant="12" id="5yS-wJ-1QD"/>
</constraints>
@ -857,7 +857,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="upto" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dYw-vK-a2G">
<rect key="frame" x="162" y="52.5" width="20" height="12"/>
<rect key="frame" x="298" y="52.5" width="19" height="12"/>
<constraints>
<constraint firstAttribute="height" constant="12" id="d7X-dM-wj1"/>
</constraints>

Loading…
Cancel
Save