Skip to content

Commit

Permalink
Merged PR 103: Merge feature/registration to develop
Browse files Browse the repository at this point in the history
1. Registration flow was added
2. Main color was changed and added to StyleKit
3. Material library was applied on registration textFields

Related work items: sujithkanna#22, sujithkanna#24
  • Loading branch information
Areej Nouh authored and Mumen Shabaro committed Dec 11, 2018
2 parents 2076f7f + 58816ef commit 2a7da35
Show file tree
Hide file tree
Showing 20 changed files with 434 additions and 90 deletions.
12 changes: 12 additions & 0 deletions MedcorPortal-IOS/MedcorPortal-IOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
89F6592121AFE1B000CD2BAF /* Encounters.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 89F6592021AFE1B000CD2BAF /* Encounters.storyboard */; };
89F6592321AFE1BD00CD2BAF /* Settings.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 89F6592221AFE1BD00CD2BAF /* Settings.storyboard */; };
89F6592621AFF88600CD2BAF /* MyEncountersTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89F6592521AFF88600CD2BAF /* MyEncountersTableViewCell.swift */; };
A023D84B21B930C5005CD388 /* MPRegisterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A023D84A21B930C5005CD388 /* MPRegisterViewController.swift */; };
A023D84D21B93204005CD388 /* MPRegisterViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A023D84C21B93204005CD388 /* MPRegisterViewModel.swift */; };
A0DC3B3421BD6CBB00F8C2BD /* ErrorTextField+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0DC3B3321BD6CBB00F8C2BD /* ErrorTextField+Extension.swift */; };
D148269443DF4EE40EEAB293 /* Pods_MedcorPortal_IOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F6D9BBA1801D8FBB75F440 /* Pods_MedcorPortal_IOS.framework */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -129,6 +132,9 @@
89F6592221AFE1BD00CD2BAF /* Settings.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Settings.storyboard; sourceTree = "<group>"; };
89F6592521AFF88600CD2BAF /* MyEncountersTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyEncountersTableViewCell.swift; sourceTree = "<group>"; };
92B28D4B9B76EE495C458209 /* Pods-MedcorPortal-IOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MedcorPortal-IOSTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MedcorPortal-IOSTests/Pods-MedcorPortal-IOSTests.debug.xcconfig"; sourceTree = "<group>"; };
A023D84A21B930C5005CD388 /* MPRegisterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPRegisterViewController.swift; sourceTree = "<group>"; };
A023D84C21B93204005CD388 /* MPRegisterViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPRegisterViewModel.swift; sourceTree = "<group>"; };
A0DC3B3321BD6CBB00F8C2BD /* ErrorTextField+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ErrorTextField+Extension.swift"; sourceTree = "<group>"; };
CCBC6A1A3BFA471C132F4F44 /* Pods-MedcorPortal-IOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MedcorPortal-IOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MedcorPortal-IOS/Pods-MedcorPortal-IOS.debug.xcconfig"; sourceTree = "<group>"; };
E3818F848D681EC7A3402789 /* Pods-MedcorPortal-IOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MedcorPortal-IOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-MedcorPortal-IOS/Pods-MedcorPortal-IOS.release.xcconfig"; sourceTree = "<group>"; };
ED2ACC515A0B8D3B237540AC /* Pods-MedcorPortal-IOSUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MedcorPortal-IOSUITests.release.xcconfig"; path = "Pods/Target Support Files/Pods-MedcorPortal-IOSUITests/Pods-MedcorPortal-IOSUITests.release.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -220,6 +226,7 @@
769F5D1421AAB9B3006A1540 /* UIViewController+StoryboardLoading.swift */,
89DA057B21AD557900C43AF1 /* MedcorPortalStyleKit+Extension.swift */,
893560A621AED7F40097324E /* UIDevice+Extension.swift */,
A0DC3B3321BD6CBB00F8C2BD /* ErrorTextField+Extension.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -255,6 +262,7 @@
children = (
760C499B21A44FC4008006EC /* MPSplashViewController.swift */,
7639626421A547250012E91B /* MPLoginViewController.swift */,
A023D84A21B930C5005CD388 /* MPRegisterViewController.swift */,
);
path = EntryViewControllers;
sourceTree = "<group>";
Expand Down Expand Up @@ -360,6 +368,7 @@
isa = PBXGroup;
children = (
769F5CFF21A8887F006A1540 /* MPLoginViewModel.swift */,
A023D84C21B93204005CD388 /* MPRegisterViewModel.swift */,
);
path = EntryViewModels;
sourceTree = "<group>";
Expand Down Expand Up @@ -714,7 +723,10 @@
7639626121A546E10012E91B /* MPHomeViewController.swift in Sources */,
8969558721AD6205006E1978 /* MPIconView.swift in Sources */,
89DA057C21AD557900C43AF1 /* MedcorPortalStyleKit+Extension.swift in Sources */,
A023D84D21B93204005CD388 /* MPRegisterViewModel.swift in Sources */,
A023D84B21B930C5005CD388 /* MPRegisterViewController.swift in Sources */,
769F5CF621A6FE31006A1540 /* AppFlow.swift in Sources */,
A0DC3B3421BD6CBB00F8C2BD /* ErrorTextField+Extension.swift in Sources */,
769F5D0221A88945006A1540 /* MPBaseViewModel.swift in Sources */,
89DA057A21AD553300C43AF1 /* MedcorPortalStyleKit.swift in Sources */,
769F5CFC21A7027C006A1540 /* MainFlow.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.66799789669999998" green="0.47512125970000002" blue="0.25860109930000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" red="0.42745098040000001" green="0.66274509800000003" blue="0.73725490199999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="xyr-q1-7Ug" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" constant="12" id="1rb-sw-O70"/>
<constraint firstItem="uHV-Ie-97P" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" priority="750" id="6mG-1Z-n1e"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// TextField+Extension.swift
// MedcorPortal-IOS
//
// Created by Areej Nouh on 12/9/18.
// Copyright © 2018 Mumen Shabaro. All rights reserved.
//

import UIKit
import Material

extension ErrorTextField {
func setupTextField(placeHolder: String , detail: String , error: String){
self.placeholder = placeHolder
self.detail = detail
self.error = error
self.clearButtonMode = .whileEditing
self.isClearIconButtonEnabled = true
self.isPlaceholderUppercasedWhenEditing = true

}

func customizeTextFieldColors() {
self.placeholderNormalColor = MedcorPortalStyleKit.mainColor
self.placeholderActiveColor = MedcorPortalStyleKit.mainColor
self.dividerNormalColor = Color.darkGray
self.dividerActiveColor = Color.darkGray
}
}
12 changes: 8 additions & 4 deletions MedcorPortal-IOS/MedcorPortal-IOS/Flows/AppFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class AppFlow: Flow {
return navigateToEntryScreen()
case .login:
return navigateToEntryScreen(withInternalStep: AppSteps.login)
case .register:
return navigateToEntryScreen(withInternalStep: AppSteps.register)
case .entryIsComplete, .home:
return navigateToMainScreen()
default:
Expand All @@ -43,18 +45,20 @@ class AppFlow: Flow {
private func navigateToEntryScreen(withInternalStep internalStep: Step = AppSteps.splash) -> NextFlowItems {
let entryFlow = EntryFlow()
Flows.whenReady(flow1: entryFlow) { [unowned self] (root) in
self.rootWindow.rootViewController = root
UIView.transition(with: self.rootWindow, duration: 0.3, options: .transitionCrossDissolve, animations: {
self.rootWindow.rootViewController = root
}, completion: nil)
}

return .one(flowItem: NextFlowItem(nextPresentable: entryFlow, nextStepper: OneStepper(withSingleStep: internalStep)))
}

private func navigateToMainScreen() -> NextFlowItems {
let mainFlow = MainFlow()
Flows.whenReady(flow1: mainFlow) { [unowned self] (root) in
self.rootWindow.rootViewController = root
UIView.transition(with: self.rootWindow, duration: 0.3, options: .transitionCrossDissolve, animations: {
self.rootWindow.rootViewController = root
}, completion: nil)
}

return .one(flowItem: NextFlowItem(nextPresentable: mainFlow, nextStepper: OneStepper(withSingleStep: AppSteps.home)))
}
}
Expand Down
2 changes: 2 additions & 0 deletions MedcorPortal-IOS/MedcorPortal-IOS/Flows/AppSteps.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ enum AppSteps: Step {
case splash
case login
case loginIsComplete
case register
case registerIsComplete
case entryIsComplete

//Base Main
Expand Down
15 changes: 13 additions & 2 deletions MedcorPortal-IOS/MedcorPortal-IOS/Flows/EntryFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class EntryFlow: Flow {
return navigateToSplashScreen()
case .login:
return navigateToLoginScreen()
case .loginIsComplete:
case .register:
return navigateToRegisterScreen()
case .registerIsComplete, .loginIsComplete:
return .end(withStepForParentFlow: AppSteps.entryIsComplete)
case .entry:
return .end(withStepForParentFlow: AppSteps.entry)
Expand All @@ -51,7 +53,6 @@ class EntryFlow: Flow {

self.rootViewController.pushViewController(splashViewController, animated: true)
return .one(flowItem: NextFlowItem(nextPresentable: splashViewController, nextStepper: splashViewController))

}

private func navigateToLoginScreen() -> NextFlowItems {
Expand All @@ -63,4 +64,14 @@ class EntryFlow: Flow {
self.rootViewController.pushViewController(loginViewController, animated: true)
return .one(flowItem: NextFlowItem(nextPresentable: loginViewController, nextStepper: loginViewController.viewModel))
}

private func navigateToRegisterScreen() -> NextFlowItems {
let registerViewModel = MPRegisterViewModel()

let registerViewController = MPRegisterViewController.loadFromStoryboard(storyboardNameOrNil: "Entry")

registerViewController.viewModel = registerViewModel
self.rootViewController.pushViewController(registerViewController, animated: true)
return .one(flowItem: NextFlowItem(nextPresentable: registerViewController, nextStepper: registerViewController.viewModel))
}
}
9 changes: 7 additions & 2 deletions MedcorPortal-IOS/MedcorPortal-IOS/Flows/MainFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ import RxFlow

class MainFlow: BaseMainFlow {

let containerViewController = UITabBarController()
let containerViewController: UITabBarController = {
let tabBarController = UITabBarController()
tabBarController.tabBar.tintColor = MedcorPortalStyleKit.mainColor
return tabBarController
}()

override init() {
super.init()
Expand All @@ -34,13 +38,14 @@ class MainFlow: BaseMainFlow {
return .end(withStepForParentFlow: AppSteps.home)
case .login:
return .end(withStepForParentFlow: AppSteps.login)
case .register:
return .end(withStepForParentFlow: AppSteps.register)
default:
return .none
}
}

private func navigateToMainScreen() -> NextFlowItems {

let homeViewStepper = HomeStepper()
let homeFlow = HomeFlow()

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified MedcorPortal-IOS/MedcorPortal-IOS/General/MedcorPortal.pcvd
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// MedcorPortalStyleKit.swift
// MedcorPortal-IOS
//
// Created by MedcorPortalTeam on 12/5/18.
// Created by MedcorPortalTeam on 12/10/18.
// Copyright © 2018 iConnect. All rights reserved.
//
// Generated by PaintCode
Expand All @@ -19,11 +19,13 @@ public class MedcorPortalStyleKit : NSObject {

private struct Cache {
static let defaultColor: UIColor = UIColor(red: 0.000, green: 0.000, blue: 0.000, alpha: 1.000)
static let mainColor: UIColor = UIColor(red: 0.427, green: 0.663, blue: 0.737, alpha: 1.000)
}

//// Colors

@objc dynamic public class var defaultColor: UIColor { return Cache.defaultColor }
@objc dynamic public class var mainColor: UIColor { return Cache.mainColor }

//// Drawing Methods

Expand Down

0 comments on commit 2a7da35

Please sign in to comment.