Skip to content

Commit

Permalink
πŸ”€ Feature/#123
Browse files Browse the repository at this point in the history
πŸ”€ Feature/#123
  • Loading branch information
hansolnoh95 authored Dec 17, 2021
2 parents c2aee9b + df4f6ac commit df45cb7
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 67 deletions.
8 changes: 5 additions & 3 deletions CA-PIN_IOS/CA-PIN_IOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,7 @@
BASE_URL = "http://3.37.75.200:6000";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = VTJLBZ2Q3F;
INFOPLIST_FILE = "CA-PIN_IOS/Supports/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
Expand All @@ -1531,7 +1532,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
Expand All @@ -1544,6 +1545,7 @@
BASE_URL = "http://3.37.75.200:6000";
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = VTJLBZ2Q3F;
INFOPLIST_FILE = "CA-PIN_IOS/Supports/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
Expand All @@ -1552,11 +1554,11 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = CAPIN;
PRODUCT_BUNDLE_IDENTIFIER = CAPIN.dist;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "AppStore CAPIN";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class LoginViewController: UIViewController {
layout()
setTextField()
keyboardObserver()
addAction()
}
}

Expand Down Expand Up @@ -151,16 +152,33 @@ extension LoginViewController {

func enableLoginButton() {
if emailTextField.text?.isEmpty == false || passwordTextField.text?.isEmpty == false {
self.loginButton.isEnabled = true
self.loginButton.isUserInteractionEnabled = true
self.loginButton.backgroundColor = .pointcolor1
}
}
func disableLoginButton() {
if emailTextField.text?.isEmpty == true || passwordTextField.text?.isEmpty == true {
self.loginButton.isEnabled = false
self.loginButton.isUserInteractionEnabled = false
self.loginButton.backgroundColor = .gray4
}
}

private func addAction() {
let gesture = UITapGestureRecognizer()
gesture.addTarget(self, action: #selector(self.loginButtonClicked))
loginButton.addGestureRecognizer(gesture)
}

private func validate() {
if passwordTextField.hasText && emailTextField.hasText {
loginButton.isUserInteractionEnabled = true
loginButton.backgroundColor = .pointcolor1
}
else {
self.loginButton.isUserInteractionEnabled = false
self.loginButton.backgroundColor = .gray4
}
}
/// 뷰의 λ‹€λ₯Έ κ³³ νƒ­ν•˜λ©΄ ν‚€λ³΄λ“œ λ‚΄λ €κ°€κ²Œ
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
self.view.endEditing(true)
Expand Down Expand Up @@ -260,7 +278,6 @@ extension LoginViewController {
$0.titleLabel?.letterSpacing = -0.48
$0.titleLabel?.font = UIFont.notoSansKRRegularFont(fontSize: 16)
$0.backgroundColor = .gray3
$0.addTarget(self, action: #selector(self.loginButtonClicked), for: .touchUpInside)
$0.setRounded(radius: 24.5)
$0.snp.makeConstraints {
$0.top.equalTo(self.passwordBorderView.snp.bottom).offset(42)
Expand Down Expand Up @@ -312,12 +329,19 @@ extension LoginViewController {
extension LoginViewController: UITextFieldDelegate {

func textFieldDidEndEditing(_ textField: UITextField) {
enableLoginButton()
validate()
}

func textFieldDidBeginEditing(_ textField: UITextField) {
enableLoginButton()

}

func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
if textField == passwordTextField && passwordTextField.hasText {
enableLoginButton()
}
return true
}

@objc func handleTapTextField(_ sender: UITapGestureRecognizer) {
self.emailTextField.resignFirstResponder()
Expand All @@ -327,7 +351,7 @@ extension LoginViewController: UITextFieldDelegate {
// ν‚€λ³΄λ“œ return λˆŒλ €μ„ λ•Œ Action
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
if textField == emailTextField {
emailTextField.becomeFirstResponder()
passwordTextField.becomeFirstResponder()
}
textField.resignFirstResponder()
return true
Expand All @@ -338,7 +362,7 @@ extension LoginViewController: UITextFieldDelegate {
UIView.animate(withDuration: 0.3, animations: { self.view.transform = CGAffineTransform(translationX: 0, y: -50) })
}
}
@objc func keyboardWillDisappear(_ notification: NSNotification){
@objc func keyboardWillDisappear(_ notification: NSNotification) {
self.view.transform = .identity
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class MapViewController: UIViewController, NMFLocationManagerDelegate {
let listProvider = MoyaProvider<CafeService>(plugins: [NetworkLoggerPlugin(verbose: true)])
let userProvider = MoyaProvider<UserService>()
var selectedCafeId = ""
var isInit: Bool = true

// MARK: - LifeCycles
override func viewDidLoad() {
Expand Down Expand Up @@ -83,6 +84,19 @@ class MapViewController: UIViewController, NMFLocationManagerDelegate {
informationRevealed = false
}
}

override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
if isInit {
if let x = currentLatitude, let y = currentLongitude {
mapView.mapView.moveCamera(
NMFCameraUpdate(
position: NMFCameraPosition(NMGLatLng(lat: x, lng: y), zoom: 12.0)),
completion: nil)
}
isInit = false
}
}
}

// MARK: - Extensions
Expand Down
4 changes: 1 addition & 3 deletions CA-PIN_IOS/CA-PIN_IOS/Supports/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NMFClientId</key>
Expand Down Expand Up @@ -80,8 +80,6 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
Expand Down
110 changes: 56 additions & 54 deletions CA-PIN_IOS/CA-PIN_IOS/Supports/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,60 +8,62 @@
import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?


func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
if let windowScene = scene as? UIWindowScene {

let window = UIWindow(windowScene: windowScene)
let rootNav = UINavigationController()
rootNav.navigationBar.isHidden = true
rootNav.hidesBottomBarWhenPushed = false
let rootVC = SplashViewController()
rootVC.view.backgroundColor = .logoWhite
rootVC.hidesBottomBarWhenPushed = false

rootNav.viewControllers = [rootVC]
rootNav.view.backgroundColor = .clear
window.rootViewController = rootNav
self.window = window
window.makeKeyAndVisible()

var window: UIWindow?


func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
if let windowScene = scene as? UIWindowScene {

let window = UIWindow(windowScene: windowScene)
window.overrideUserInterfaceStyle = UIUserInterfaceStyle.light

let rootNav = UINavigationController()
rootNav.navigationBar.isHidden = true
rootNav.hidesBottomBarWhenPushed = false
let rootVC = SplashViewController()
rootVC.view.backgroundColor = .logoWhite
rootVC.hidesBottomBarWhenPushed = false

rootNav.viewControllers = [rootVC]
rootNav.view.backgroundColor = .clear
window.rootViewController = rootNav
self.window = window
window.makeKeyAndVisible()
}
}
}

func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}

func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}

func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}

func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}

func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}



func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}

func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}

func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}

func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}

func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}


}

0 comments on commit df45cb7

Please sign in to comment.