diff --git "a/Icon\r" "b/Icon\r" new file mode 100644 index 0000000..e69de29 diff --git a/LGHTSG/LGHTSG.xcodeproj/project.pbxproj b/LGHTSG/LGHTSG.xcodeproj/project.pbxproj index 768cb2f..2825c0c 100644 --- a/LGHTSG/LGHTSG.xcodeproj/project.pbxproj +++ b/LGHTSG/LGHTSG.xcodeproj/project.pbxproj @@ -67,6 +67,10 @@ F0F6B166299139D900F8835D /* AccountSettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0F6B164299139D900F8835D /* AccountSettingViewController.swift */; }; F0F6B167299139D900F8835D /* MyPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0F6B165299139D900F8835D /* MyPageViewController.swift */; }; F0F6B16A29913ADB00F8835D /* UserApiModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0F6B16929913ADB00F8835D /* UserApiModel.swift */; }; + F51C6FF529991E8800048DEE /* RankViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F51C6FF429991E8800048DEE /* RankViewController.swift */; }; + F51C6FF729991EA600048DEE /* RankViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F51C6FF629991EA600048DEE /* RankViewCell.swift */; }; + F51C6FF92999207000048DEE /* RankingModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F51C6FF82999207000048DEE /* RankingModel.swift */; }; + F51C6FFC299A55A300048DEE /* MarqueeLabel in Frameworks */ = {isa = PBXBuildFile; productRef = F51C6FFB299A55A300048DEE /* MarqueeLabel */; }; F5DAEC00298AD1FA0098A11A /* login.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5DAEBFF298AD1FA0098A11A /* login.swift */; }; F5DAEC02298AD2050098A11A /* email.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5DAEC01298AD2050098A11A /* email.swift */; }; F5DAEC04298AD20E0098A11A /* join.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5DAEC03298AD20E0098A11A /* join.swift */; }; @@ -159,6 +163,9 @@ F0F6B164299139D900F8835D /* AccountSettingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountSettingViewController.swift; sourceTree = ""; }; F0F6B165299139D900F8835D /* MyPageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyPageViewController.swift; sourceTree = ""; }; F0F6B16929913ADB00F8835D /* UserApiModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserApiModel.swift; sourceTree = ""; }; + F51C6FF429991E8800048DEE /* RankViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RankViewController.swift; sourceTree = ""; }; + F51C6FF629991EA600048DEE /* RankViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RankViewCell.swift; sourceTree = ""; }; + F51C6FF82999207000048DEE /* RankingModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RankingModel.swift; sourceTree = ""; }; F5DAEBFF298AD1FA0098A11A /* login.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = login.swift; sourceTree = ""; }; F5DAEC01298AD2050098A11A /* email.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = email.swift; sourceTree = ""; }; F5DAEC03298AD20E0098A11A /* join.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = join.swift; sourceTree = ""; }; @@ -193,6 +200,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F51C6FFC299A55A300048DEE /* MarqueeLabel in Frameworks */, 07120DF3296EDF6E00ABF98F /* Alamofire in Frameworks */, 07120DF6296EDF7A00ABF98F /* SnapKit in Frameworks */, 8E910354CAD5238FB38C267D /* Pods_LGHTSG.framework in Frameworks */, @@ -285,6 +293,7 @@ F0F6B15D2991310000F8835D /* UserRoeModel.swift */, 078401C1298A486300CDE061 /* EstatePriceModel.swift */, 07F0D8872993D6D300D3C186 /* TopViewModel.swift */, + F51C6FF82999207000048DEE /* RankingModel.swift */, ); path = ViewModel; sourceTree = ""; @@ -305,6 +314,7 @@ 078401CA298A49D500CDE061 /* EstateDetailCell.swift */, 075BBA39298ACF1D00710F44 /* EstateSaleCell.swift */, 0764F26A298642EF00F446CB /* SearchItemCell.swift */, + F51C6FF629991EA600048DEE /* RankViewCell.swift */, 0764F284298959C600F446CB /* TopViewCell.swift */, F5DAEC1B298AD2F70098A11A /* LoginView.swift */, 078401D0298A49E200CDE061 /* ChartMarker.swift */, @@ -337,6 +347,7 @@ 078401B3298A484800CDE061 /* HomeViewController.swift */, 078401AE298A484800CDE061 /* MainTabController.swift */, 078401B0298A484800CDE061 /* StockChartViewController.swift */, + F51C6FF429991E8800048DEE /* RankViewController.swift */, ); path = Controller; sourceTree = ""; @@ -486,6 +497,7 @@ packageProductDependencies = ( 07120DF2296EDF6E00ABF98F /* Alamofire */, 07120DF5296EDF7A00ABF98F /* SnapKit */, + F51C6FFB299A55A300048DEE /* MarqueeLabel */, ); productName = LGHTSG; productReference = 071E053D296BB7B50020282F /* LGHTSG.app */; @@ -518,6 +530,7 @@ packageReferences = ( 07120DF1296EDF6E00ABF98F /* XCRemoteSwiftPackageReference "Alamofire" */, 07120DF4296EDF7A00ABF98F /* XCRemoteSwiftPackageReference "SnapKit" */, + F51C6FFA299A55A300048DEE /* XCRemoteSwiftPackageReference "MarqueeLabel" */, ); productRefGroup = 071E053E296BB7B50020282F /* Products */; projectDirPath = ""; @@ -620,6 +633,7 @@ F5DAEC04298AD20E0098A11A /* join.swift in Sources */, 078401DD298A49E300CDE061 /* StockDateSegmentControl.swift in Sources */, F5DAEC00298AD1FA0098A11A /* login.swift in Sources */, + F51C6FF529991E8800048DEE /* RankViewController.swift in Sources */, F5DAEC06298AD2180098A11A /* changePw.swift in Sources */, 078401BD298A484800CDE061 /* ExploreViewController.swift in Sources */, F5DAEC3B298AD46B0098A11A /* CheckPageServiceController.swift in Sources */, @@ -636,10 +650,12 @@ F5DAEC14298AD2A30098A11A /* CheckAgreeView.swift in Sources */, F5DAEC20298AD31E0098A11A /* FindPwView.swift in Sources */, F5DAEC1C298AD2F70098A11A /* LoginView.swift in Sources */, + F51C6FF729991EA600048DEE /* RankViewCell.swift in Sources */, 075BBA3A298ACF1D00710F44 /* EstateSaleCell.swift in Sources */, 075BBA30298A78FC00710F44 /* EstateController.swift in Sources */, 07F0D88C2995F3AA00D3C186 /* PasswordApiModel.swift in Sources */, F5DAEC0A298AD23D0098A11A /* LoginResultModel.swift in Sources */, + F51C6FF92999207000048DEE /* RankingModel.swift in Sources */, F5DAEC1E298AD3080098A11A /* StartView.swift in Sources */, 078401E7298A4B2D00CDE061 /* TableCellModel.swift in Sources */, 078401E9298A4C2600CDE061 /* TopViewController.swift in Sources */, @@ -797,12 +813,12 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 9KQS6UJ9YX; + DEVELOPMENT_TEAM = KSR8K3JPUM; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = LGHTSG/Info.plist; INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "위치 정보 제공을 허용합니까?"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen.storyboard; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; IPHONEOS_DEPLOYMENT_TARGET = 15.0; @@ -827,12 +843,12 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 9KQS6UJ9YX; + DEVELOPMENT_TEAM = KSR8K3JPUM; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = LGHTSG/Info.plist; INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "위치 정보 제공을 허용합니까?"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen.storyboard; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; IPHONEOS_DEPLOYMENT_TARGET = 15.0; @@ -889,6 +905,14 @@ kind = branch; }; }; + F51C6FFA299A55A300048DEE /* XCRemoteSwiftPackageReference "MarqueeLabel" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/cbpowell/MarqueeLabel"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 4.0.0; + }; + }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ @@ -902,6 +926,11 @@ package = 07120DF4296EDF7A00ABF98F /* XCRemoteSwiftPackageReference "SnapKit" */; productName = SnapKit; }; + F51C6FFB299A55A300048DEE /* MarqueeLabel */ = { + isa = XCSwiftPackageProductDependency; + package = F51C6FFA299A55A300048DEE /* XCRemoteSwiftPackageReference "MarqueeLabel" */; + productName = MarqueeLabel; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 071E0535296BB7B50020282F /* Project object */; diff --git a/LGHTSG/LGHTSG.xcworkspace/xcshareddata/swiftpm/Package.resolved b/LGHTSG/LGHTSG.xcworkspace/xcshareddata/swiftpm/Package.resolved index 68ad963..75e2a2a 100644 --- a/LGHTSG/LGHTSG.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/LGHTSG/LGHTSG.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -9,6 +9,15 @@ "version" : "5.6.4" } }, + { + "identity" : "marqueelabel", + "kind" : "remoteSourceControl", + "location" : "https://github.com/cbpowell/MarqueeLabel", + "state" : { + "revision" : "f2c72a5f8568579dade6350dc26a482076d3d346", + "version" : "4.3.0" + } + }, { "identity" : "snapkit", "kind" : "remoteSourceControl", diff --git a/LGHTSG/LGHTSG/App/AppDelegate.swift b/LGHTSG/LGHTSG/App/AppDelegate.swift index 8cc41c8..19d766c 100644 --- a/LGHTSG/LGHTSG/App/AppDelegate.swift +++ b/LGHTSG/LGHTSG/App/AppDelegate.swift @@ -14,6 +14,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + sleep(1) + NMFAuthManager.shared().clientId = "t1d90xy372" if #available(iOS 15, *) { let appearance = UINavigationBarAppearance() @@ -37,6 +39,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } + + func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { + + // 세로방향 고정 + return UIInterfaceOrientationMask.portrait + } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { // Called when the user discards a scene session. diff --git a/LGHTSG/LGHTSG/App/SceneDelegate.swift b/LGHTSG/LGHTSG/App/SceneDelegate.swift index 8db48da..ba977b0 100644 --- a/LGHTSG/LGHTSG/App/SceneDelegate.swift +++ b/LGHTSG/LGHTSG/App/SceneDelegate.swift @@ -6,6 +6,7 @@ // import UIKit +import Alamofire class SceneDelegate: UIResponder, UIWindowSceneDelegate { @@ -16,17 +17,43 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { guard let windowscene = (scene as? UIWindowScene) else { return } window = UIWindow(windowScene: windowscene) window?.backgroundColor = .systemBackground - -// var jwt : String = UserDefaults.standard.string(forKey: "savedToken") ?? "" -// if jwt != "" { -// print(jwt) -// window?.rootViewController = MainTabController() -// } -// else{ - window?.rootViewController = ViewController() -// } - //window?.rootViewController = UINavigationController(rootViewController: MainTabController()) - + //window?.rootViewController = ViewController() + + // MARK: 회원가입 체크 초기화 + UserDefaults.standard.set(false, forKey: "allcheck") + UserDefaults.standard.set(false, forKey: "check1") + UserDefaults.standard.set(false, forKey: "check2") + UserDefaults.standard.set(false, forKey: "check3") + + + + // MARK: 자동로그인을 위한 코드 + var loginSuccess : Bool = UserDefaults.standard.bool(forKey: "loginSuccess") ?? false + + print("자동로그인 \(loginSuccess)") + + if loginSuccess == true { + // MARK: 마지막 로그인 기록 + let email = UserDefaults.standard.string(forKey: "email") + let password = UserDefaults.standard.string(forKey: "password") + + let bodyData : Parameters = [ + "email" : email, + "password" : password + ] + + LoginApiModel().requestLoginDataModel(bodyData: bodyData){ + data in + print(data.accessToken) + print("자동로그인 성공") + UserDefaults.standard.set(data.accessToken, forKey: "savedToken") + self.window?.rootViewController = MainTabController() + } + } + else if loginSuccess == false { + window?.rootViewController = ViewController() + } + window?.tintColor = .label window?.makeKeyAndVisible() } diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/100.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/100.png new file mode 100644 index 0000000..45f4dd4 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/100.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/102.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/102.png new file mode 100644 index 0000000..2adb2f3 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/102.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/1024.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/1024.png new file mode 100644 index 0000000..5bf909b Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/1024.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/114.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/114.png new file mode 100644 index 0000000..9c26783 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/114.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/120.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/120.png new file mode 100644 index 0000000..b06b308 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/120.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/128.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/128.png new file mode 100644 index 0000000..7a5e226 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/128.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/144.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/144.png new file mode 100644 index 0000000..4f558a7 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/144.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/152.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/152.png new file mode 100644 index 0000000..d9cdd7e Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/152.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/16.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/16.png new file mode 100644 index 0000000..7fe22a1 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/16.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/167.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/167.png new file mode 100644 index 0000000..d0ecc4c Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/167.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/172.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/172.png new file mode 100644 index 0000000..d955a0a Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/172.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/180.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/180.png new file mode 100644 index 0000000..7a90a5a Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/180.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/196.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/196.png new file mode 100644 index 0000000..e4fa310 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/196.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/20.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/20.png new file mode 100644 index 0000000..849a2fe Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/20.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/216.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/216.png new file mode 100644 index 0000000..8883df1 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/216.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/256.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/256.png new file mode 100644 index 0000000..dff6182 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/256.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/29.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/29.png new file mode 100644 index 0000000..1190eb7 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/29.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/32.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/32.png new file mode 100644 index 0000000..6528078 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/32.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/40.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/40.png new file mode 100644 index 0000000..41fe68c Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/40.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/48.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/48.png new file mode 100644 index 0000000..9b5822a Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/48.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/50.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/50.png new file mode 100644 index 0000000..688622b Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/50.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/512.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/512.png new file mode 100644 index 0000000..32c4832 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/512.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/55.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/55.png new file mode 100644 index 0000000..6456702 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/55.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/57.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/57.png new file mode 100644 index 0000000..dd20012 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/57.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/58.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/58.png new file mode 100644 index 0000000..71d7309 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/58.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/60.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/60.png new file mode 100644 index 0000000..6f888c8 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/60.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/64.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/64.png new file mode 100644 index 0000000..ee50fdf Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/64.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/66.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/66.png new file mode 100644 index 0000000..7744e53 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/66.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/72.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/72.png new file mode 100644 index 0000000..491ed68 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/72.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/76.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/76.png new file mode 100644 index 0000000..aaadf4f Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/76.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/80.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/80.png new file mode 100644 index 0000000..cbd1aed Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/80.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/87.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/87.png new file mode 100644 index 0000000..a92bb70 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/87.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/88.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/88.png new file mode 100644 index 0000000..fa077c1 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/88.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/92.png b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/92.png new file mode 100644 index 0000000..d627e6a Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/92.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/Contents.json b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/Contents.json index 13613e3..6bf81eb 100644 --- a/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/LGHTSG/LGHTSG/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,9 +1,350 @@ { "images" : [ { - "idiom" : "universal", - "platform" : "ios", + "filename" : "40.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "60.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "filename" : "29.png", + "idiom" : "iphone", + "scale" : "1x", + "size" : "29x29" + }, + { + "filename" : "58.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "87.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "80.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "120.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "filename" : "57.png", + "idiom" : "iphone", + "scale" : "1x", + "size" : "57x57" + }, + { + "filename" : "114.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "57x57" + }, + { + "filename" : "120.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "filename" : "180.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "filename" : "20.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "filename" : "40.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "29.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "filename" : "58.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "40.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "filename" : "80.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "50.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "50x50" + }, + { + "filename" : "100.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "50x50" + }, + { + "filename" : "72.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "72x72" + }, + { + "filename" : "144.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "72x72" + }, + { + "filename" : "76.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "filename" : "152.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "filename" : "167.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "filename" : "1024.png", + "idiom" : "ios-marketing", + "scale" : "1x", "size" : "1024x1024" + }, + { + "filename" : "16.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "filename" : "32.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "filename" : "32.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "filename" : "64.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "filename" : "128.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "filename" : "256.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "filename" : "256.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "filename" : "512.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "filename" : "512.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "filename" : "1024.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + }, + { + "filename" : "48.png", + "idiom" : "watch", + "role" : "notificationCenter", + "scale" : "2x", + "size" : "24x24", + "subtype" : "38mm" + }, + { + "filename" : "55.png", + "idiom" : "watch", + "role" : "notificationCenter", + "scale" : "2x", + "size" : "27.5x27.5", + "subtype" : "42mm" + }, + { + "filename" : "58.png", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "87.png", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "66.png", + "idiom" : "watch", + "role" : "notificationCenter", + "scale" : "2x", + "size" : "33x33", + "subtype" : "45mm" + }, + { + "filename" : "80.png", + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "40x40", + "subtype" : "38mm" + }, + { + "filename" : "88.png", + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "44x44", + "subtype" : "40mm" + }, + { + "filename" : "92.png", + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "46x46", + "subtype" : "41mm" + }, + { + "filename" : "100.png", + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "50x50", + "subtype" : "44mm" + }, + { + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "51x51", + "subtype" : "45mm" + }, + { + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "54x54", + "subtype" : "49mm" + }, + { + "filename" : "172.png", + "idiom" : "watch", + "role" : "quickLook", + "scale" : "2x", + "size" : "86x86", + "subtype" : "38mm" + }, + { + "filename" : "196.png", + "idiom" : "watch", + "role" : "quickLook", + "scale" : "2x", + "size" : "98x98", + "subtype" : "42mm" + }, + { + "filename" : "216.png", + "idiom" : "watch", + "role" : "quickLook", + "scale" : "2x", + "size" : "108x108", + "subtype" : "44mm" + }, + { + "idiom" : "watch", + "role" : "quickLook", + "scale" : "2x", + "size" : "117x117", + "subtype" : "45mm" + }, + { + "idiom" : "watch", + "role" : "quickLook", + "scale" : "2x", + "size" : "129x129", + "subtype" : "49mm" + }, + { + "filename" : "1024.png", + "idiom" : "watch-marketing", + "scale" : "1x", + "size" : "1024x1024" + }, + { + "filename" : "102.png", + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "45x45", + "subtype" : "41mm" } ], "info" : { diff --git a/LGHTSG/LGHTSG/Assets.xcassets/box/tap-image.imageset/Contents.json b/LGHTSG/LGHTSG/Assets.xcassets/box/tap-image.imageset/Contents.json new file mode 100644 index 0000000..2e9e1d1 --- /dev/null +++ b/LGHTSG/LGHTSG/Assets.xcassets/box/tap-image.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Rectangle 172 (14).png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Rectangle 172 (13).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Rectangle 172 (12).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LGHTSG/LGHTSG/Assets.xcassets/box/tap-image.imageset/Rectangle 172 (12).png b/LGHTSG/LGHTSG/Assets.xcassets/box/tap-image.imageset/Rectangle 172 (12).png new file mode 100644 index 0000000..b5a6bbe Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/box/tap-image.imageset/Rectangle 172 (12).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/box/tap-image.imageset/Rectangle 172 (13).png b/LGHTSG/LGHTSG/Assets.xcassets/box/tap-image.imageset/Rectangle 172 (13).png new file mode 100644 index 0000000..df3c01b Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/box/tap-image.imageset/Rectangle 172 (13).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/box/tap-image.imageset/Rectangle 172 (14).png b/LGHTSG/LGHTSG/Assets.xcassets/box/tap-image.imageset/Rectangle 172 (14).png new file mode 100644 index 0000000..04f944a Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/box/tap-image.imageset/Rectangle 172 (14).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money-mini.imageset/Contents.json b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money-mini.imageset/Contents.json new file mode 100644 index 0000000..0a3cb55 --- /dev/null +++ b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money-mini.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Ellipse 10.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Ellipse 10 (1).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Ellipse 10 (2).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money-mini.imageset/Ellipse 10 (1).png b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money-mini.imageset/Ellipse 10 (1).png new file mode 100644 index 0000000..d630811 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money-mini.imageset/Ellipse 10 (1).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money-mini.imageset/Ellipse 10 (2).png b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money-mini.imageset/Ellipse 10 (2).png new file mode 100644 index 0000000..bee8d6e Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money-mini.imageset/Ellipse 10 (2).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money-mini.imageset/Ellipse 10.png b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money-mini.imageset/Ellipse 10.png new file mode 100644 index 0000000..1310747 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money-mini.imageset/Ellipse 10.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money.imageset/Contents.json b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money.imageset/Contents.json new file mode 100644 index 0000000..c10c9f1 --- /dev/null +++ b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Ellipse 10 (3).png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Ellipse 10 (4).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Ellipse 10 (5).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money.imageset/Ellipse 10 (3).png b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money.imageset/Ellipse 10 (3).png new file mode 100644 index 0000000..666670f Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money.imageset/Ellipse 10 (3).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money.imageset/Ellipse 10 (4).png b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money.imageset/Ellipse 10 (4).png new file mode 100644 index 0000000..1025bf8 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money.imageset/Ellipse 10 (4).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money.imageset/Ellipse 10 (5).png b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money.imageset/Ellipse 10 (5).png new file mode 100644 index 0000000..eb2c03d Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/iconImage/profile-money.imageset/Ellipse 10 (5).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/lghtsg-hg.imageset/1-removebg-preview 2 (2) 1 (3).png b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg-hg.imageset/1-removebg-preview 2 (2) 1 (3).png new file mode 100644 index 0000000..3029959 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg-hg.imageset/1-removebg-preview 2 (2) 1 (3).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/lghtsg-hg.imageset/1-removebg-preview 2 (2) 1 (4).png b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg-hg.imageset/1-removebg-preview 2 (2) 1 (4).png new file mode 100644 index 0000000..9c0f92c Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg-hg.imageset/1-removebg-preview 2 (2) 1 (4).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/lghtsg-hg.imageset/1-removebg-preview 2 (2) 1 (5).png b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg-hg.imageset/1-removebg-preview 2 (2) 1 (5).png new file mode 100644 index 0000000..bd348f2 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg-hg.imageset/1-removebg-preview 2 (2) 1 (5).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/lghtsg-hg.imageset/Contents.json b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg-hg.imageset/Contents.json new file mode 100644 index 0000000..f9707e4 --- /dev/null +++ b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg-hg.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "1-removebg-preview 2 (2) 1 (3).png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "1-removebg-preview 2 (2) 1 (4).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "1-removebg-preview 2 (2) 1 (5).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LGHTSG/LGHTSG/Assets.xcassets/lghtsg.imageset/Contents.json b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg.imageset/Contents.json new file mode 100644 index 0000000..dfb55de --- /dev/null +++ b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "appstore.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "appstore 1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "appstore 2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LGHTSG/LGHTSG/Assets.xcassets/lghtsg.imageset/appstore 1.png b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg.imageset/appstore 1.png new file mode 100644 index 0000000..5bf909b Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg.imageset/appstore 1.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/lghtsg.imageset/appstore 2.png b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg.imageset/appstore 2.png new file mode 100644 index 0000000..5bf909b Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg.imageset/appstore 2.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/lghtsg.imageset/appstore.png b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg.imageset/appstore.png new file mode 100644 index 0000000..5bf909b Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/lghtsg.imageset/appstore.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/new-logo.imageset/1-removebg-preview 2 (1).png b/LGHTSG/LGHTSG/Assets.xcassets/new-logo.imageset/1-removebg-preview 2 (1).png new file mode 100644 index 0000000..688582d Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/new-logo.imageset/1-removebg-preview 2 (1).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/new-logo.imageset/1-removebg-preview 2 (2).png b/LGHTSG/LGHTSG/Assets.xcassets/new-logo.imageset/1-removebg-preview 2 (2).png new file mode 100644 index 0000000..7bc0d22 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/new-logo.imageset/1-removebg-preview 2 (2).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/new-logo.imageset/1-removebg-preview 2.png b/LGHTSG/LGHTSG/Assets.xcassets/new-logo.imageset/1-removebg-preview 2.png new file mode 100644 index 0000000..65d9959 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/new-logo.imageset/1-removebg-preview 2.png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/new-logo.imageset/Contents.json b/LGHTSG/LGHTSG/Assets.xcassets/new-logo.imageset/Contents.json new file mode 100644 index 0000000..d5b6400 --- /dev/null +++ b/LGHTSG/LGHTSG/Assets.xcassets/new-logo.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "1-removebg-preview 2.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "1-removebg-preview 2 (1).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "1-removebg-preview 2 (2).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LGHTSG/LGHTSG/Assets.xcassets/rank.imageset/Contents.json b/LGHTSG/LGHTSG/Assets.xcassets/rank.imageset/Contents.json new file mode 100644 index 0000000..74f6aa0 --- /dev/null +++ b/LGHTSG/LGHTSG/Assets.xcassets/rank.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Group 144 (10).png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group 144 (11).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group 144 (12).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LGHTSG/LGHTSG/Assets.xcassets/rank.imageset/Group 144 (10).png b/LGHTSG/LGHTSG/Assets.xcassets/rank.imageset/Group 144 (10).png new file mode 100644 index 0000000..7d242e3 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/rank.imageset/Group 144 (10).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/rank.imageset/Group 144 (11).png b/LGHTSG/LGHTSG/Assets.xcassets/rank.imageset/Group 144 (11).png new file mode 100644 index 0000000..5909385 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/rank.imageset/Group 144 (11).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/rank.imageset/Group 144 (12).png b/LGHTSG/LGHTSG/Assets.xcassets/rank.imageset/Group 144 (12).png new file mode 100644 index 0000000..ce3fa28 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/rank.imageset/Group 144 (12).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/rank2.imageset/Contents.json b/LGHTSG/LGHTSG/Assets.xcassets/rank2.imageset/Contents.json new file mode 100644 index 0000000..7da92d5 --- /dev/null +++ b/LGHTSG/LGHTSG/Assets.xcassets/rank2.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Group 144 (4).png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group 144 (5).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group 144 (6).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LGHTSG/LGHTSG/Assets.xcassets/rank2.imageset/Group 144 (4).png b/LGHTSG/LGHTSG/Assets.xcassets/rank2.imageset/Group 144 (4).png new file mode 100644 index 0000000..344ee28 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/rank2.imageset/Group 144 (4).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/rank2.imageset/Group 144 (5).png b/LGHTSG/LGHTSG/Assets.xcassets/rank2.imageset/Group 144 (5).png new file mode 100644 index 0000000..877a6c6 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/rank2.imageset/Group 144 (5).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/rank2.imageset/Group 144 (6).png b/LGHTSG/LGHTSG/Assets.xcassets/rank2.imageset/Group 144 (6).png new file mode 100644 index 0000000..5e8e496 Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/rank2.imageset/Group 144 (6).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/rank3.imageset/Contents.json b/LGHTSG/LGHTSG/Assets.xcassets/rank3.imageset/Contents.json new file mode 100644 index 0000000..0c9dee8 --- /dev/null +++ b/LGHTSG/LGHTSG/Assets.xcassets/rank3.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Group 144 (7).png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group 144 (8).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group 144 (9).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LGHTSG/LGHTSG/Assets.xcassets/rank3.imageset/Group 144 (7).png b/LGHTSG/LGHTSG/Assets.xcassets/rank3.imageset/Group 144 (7).png new file mode 100644 index 0000000..f3a3ebf Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/rank3.imageset/Group 144 (7).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/rank3.imageset/Group 144 (8).png b/LGHTSG/LGHTSG/Assets.xcassets/rank3.imageset/Group 144 (8).png new file mode 100644 index 0000000..2e4b21a Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/rank3.imageset/Group 144 (8).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/rank3.imageset/Group 144 (9).png b/LGHTSG/LGHTSG/Assets.xcassets/rank3.imageset/Group 144 (9).png new file mode 100644 index 0000000..4d618be Binary files /dev/null and b/LGHTSG/LGHTSG/Assets.xcassets/rank3.imageset/Group 144 (9).png differ diff --git a/LGHTSG/LGHTSG/Assets.xcassets/save-btn.imageset/Contents.json b/LGHTSG/LGHTSG/Assets.xcassets/save-btn.imageset/Contents.json index e032330..60ae290 100644 --- a/LGHTSG/LGHTSG/Assets.xcassets/save-btn.imageset/Contents.json +++ b/LGHTSG/LGHTSG/Assets.xcassets/save-btn.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "하단 Btn 1.png", + "filename" : "하단 Btn (1) 1.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "하단 Btn (1).png", + "filename" : "하단 Btn (2) 1.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "하단 Btn (2).png", + "filename" : "하단 Btn 1.png", "idiom" : "universal", "scale" : "3x" } diff --git "a/LGHTSG/LGHTSG/Assets.xcassets/save-btn.imageset/\355\225\230\353\213\250 Btn (1).png" "b/LGHTSG/LGHTSG/Assets.xcassets/save-btn.imageset/\355\225\230\353\213\250 Btn (1) 1.png" similarity index 100% rename from "LGHTSG/LGHTSG/Assets.xcassets/save-btn.imageset/\355\225\230\353\213\250 Btn (1).png" rename to "LGHTSG/LGHTSG/Assets.xcassets/save-btn.imageset/\355\225\230\353\213\250 Btn (1) 1.png" diff --git "a/LGHTSG/LGHTSG/Assets.xcassets/save-btn.imageset/\355\225\230\353\213\250 Btn (2).png" "b/LGHTSG/LGHTSG/Assets.xcassets/save-btn.imageset/\355\225\230\353\213\250 Btn (2) 1.png" similarity index 100% rename from "LGHTSG/LGHTSG/Assets.xcassets/save-btn.imageset/\355\225\230\353\213\250 Btn (2).png" rename to "LGHTSG/LGHTSG/Assets.xcassets/save-btn.imageset/\355\225\230\353\213\250 Btn (2) 1.png" diff --git a/LGHTSG/LGHTSG/Controller/Authentication/FindPasswordController.swift b/LGHTSG/LGHTSG/Controller/Authentication/FindPasswordController.swift index c0f47e2..4da57f9 100644 --- a/LGHTSG/LGHTSG/Controller/Authentication/FindPasswordController.swift +++ b/LGHTSG/LGHTSG/Controller/Authentication/FindPasswordController.swift @@ -86,6 +86,16 @@ class FindPassWordController: UIViewController { }() + let codeSuccessLabel: UILabel = { + let label = UILabel() + label.text = "⎷ 이메일 인증이 완료되었습니다." + label.font = UIFont(name: "NanumSquareR", size: 12.0) + label.textColor = .systemGreen + label.translatesAutoresizingMaskIntoConstraints = false + return label + }() + + lazy var codeConfirmBtn: UIButton = { let btn = UIButton() btn.titleLabel?.font = UIFont(name: "NanumSquareB", size: 12.0) @@ -228,11 +238,16 @@ class FindPassWordController: UIViewController { // MARK: 인증번호 확인 함수 @objc func codeConfirmBtnClicked(){ + var code = codeTextField.text + code = code?.trimmingCharacters(in: [" "]) + codeTextField.text if codeTextField.text == self.code { codeConfirmheight.isActive = true emailTextField2.isUserInteractionEnabled = false codeTextField.isUserInteractionEnabled = false showPwChange() + codeConfirmSuccessheight.isActive = false + codeConfirmheight.isActive = true } else { codeConfirmheight.isActive = false @@ -324,6 +339,16 @@ class FindPassWordController: UIViewController { let changePw = ChangePwApiModel() + // 키보드때문에 화면이 가려질 경우 화면을 올린다 + @objc func keyboardWillShow(sender: NSNotification) { + self.view.frame.origin.y = -100 // Move view 150 points upward + } + + @objc func keyboardWillHide(sender: NSNotification) { + self.view.frame.origin.y = 0 // Move view to original position + } + + @objc func changePwBtnClicked(){ print("isCheck1=\(isCheck1), isCheck2=\(isCheck2)") if isCheck1 == true { @@ -348,7 +373,8 @@ class FindPassWordController: UIViewController { //Alert 선언 let msg = UIAlertController(title: "", message: "비밀번호 변경이 완료되었습니다", preferredStyle: .alert) //Alert에 부여할 Yes이벤트 선언 - let YES = UIAlertAction(title: "확인", style: .default, handler: { (action) in + let YES = UIAlertAction(title: "확인", style: .default, handler: { (action) -> Void in + self.YesClick3() }) msg.addAction(YES) self.present(msg, animated: true, completion: nil) @@ -356,10 +382,15 @@ class FindPassWordController: UIViewController { } } + @objc func YesClick3(){ + self.presentingViewController?.dismiss(animated: true) + } + // MARK: 인증번호 관련 동적 변화 라벨 var sendCodeheight: NSLayoutConstraint! var codeConfirmheight: NSLayoutConstraint! + var codeConfirmSuccessheight: NSLayoutConstraint! // MARK: 인증번호가 성공적이면 비밀번호 바꿀 수 있도록 함 var codeSuccessheight: NSLayoutConstraint! @@ -397,6 +428,9 @@ class FindPassWordController: UIViewController { codeSuccessheight4 = passwordCheckTextField2.heightAnchor.constraint(equalToConstant: 0) codeSuccessheight4.isActive = true + codeConfirmSuccessheight = codeSuccessLabel.heightAnchor.constraint(equalToConstant: 0) + codeConfirmSuccessheight.isActive = true + pwheight1 = pwValidLabel.heightAnchor.constraint(equalToConstant: 0) pwheight1.isActive = true @@ -432,10 +466,6 @@ class FindPassWordController: UIViewController { super.viewDidLoad() view.backgroundColor = .black - - - - // MARK: 네비게이션 컨트롤러 self.view.addSubview(navigationBar) let safeArea = self.view.safeAreaLayoutGuide @@ -449,15 +479,20 @@ class FindPassWordController: UIViewController { navigationBar.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor).isActive = true navigationBar.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor).isActive = true - let navItem = UINavigationItem(title: "비밀번호 찾기") + let navItem = UINavigationItem(title: "비밀번호 변경") let leftButton = UIBarButtonItem(image: UIImage(named: "back-arrow"), style: .plain, target: self, action: #selector(tapDismissButton)) navItem.leftBarButtonItem = leftButton navigationBar.setItems([navItem], animated: true) + // MARK: 키보드가 화면을 가릴 때 화면을 위로 올릴 수 있도록 + NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(sender:)), name: UIResponder.keyboardWillShowNotification, object: nil); + NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(sender:)), name: UIResponder.keyboardWillHideNotification, object: nil); + heightSetting() + view.addSubview(emailLabel) view.addSubview(emailSendImageView) view.addSubview(emailTextField2) @@ -466,6 +501,7 @@ class FindPassWordController: UIViewController { view.addSubview(codeSendImageView) view.addSubview(codeTextField) view.addSubview(codeConfirmLabel) + view.addSubview(codeSuccessLabel) view.addSubview(passwordLabel) @@ -550,6 +586,12 @@ class FindPassWordController: UIViewController { $0.left.equalTo(codeSendImageView.snp.left) } + // MARK: 인증번호가 다르다는 메세지를 띄움 + self.codeSuccessLabel.snp.makeConstraints{ + $0.top.equalTo(codeSendImageView.snp.bottom).offset(5) + $0.left.equalTo(codeSendImageView.snp.left) + } + // MARK: 비밀번호 변경 파트 self.passwordLabel.snp.makeConstraints{ diff --git a/LGHTSG/LGHTSG/Controller/Authentication/LoginController.swift b/LGHTSG/LGHTSG/Controller/Authentication/LoginController.swift index 610c200..86cc68b 100644 --- a/LGHTSG/LGHTSG/Controller/Authentication/LoginController.swift +++ b/LGHTSG/LGHTSG/Controller/Authentication/LoginController.swift @@ -14,11 +14,9 @@ import Alamofire class LoginController: UIViewController { - - let titleImageView2: UIImageView = { let image = UIImageView() - image.image = UIImage(named: "icon") + image.image = UIImage(named: "lghtsg-hg") image.translatesAutoresizingMaskIntoConstraints = false return image }() @@ -159,20 +157,29 @@ class LoginController: UIViewController { login.requestLoginDataModel(bodyData: bodyData){ data in - self.jwt = data.accessToken + + // MARK: main탭에 들어가기 위해 토큰 저장 UserDefaults.standard.set(data.accessToken,forKey: "savedToken") + UserDefaults.standard.set(true, forKey: "loginSuccess") + + // MARK: 패스워드 변경을 위한 저장 UserDefaults.standard.set(password,forKey: "pastPassword") + + //self.loginWrongheight.isActive = true let vc = MainTabController() vc.modalPresentationStyle = .fullScreen self.present(vc, animated: true) } + // MARK: 자동로그인을 위한 메일과 패스워드 저장 + UserDefaults.standard.set(email, forKey: "email") + UserDefaults.standard.set(password, forKey: "password") - var jwt : String = UserDefaults.standard.string(forKey: "savedToken") ?? "" - print("토큰은 \(jwt)") + let isTrue = UserDefaults.standard.bool(forKey: "loginSuccess") + print(isTrue) - - if jwt == "" { + + if isTrue == false { print("로그인안됨") loginWrongheight.isActive = false } @@ -212,20 +219,27 @@ class LoginController: UIViewController { view.addSubview(memberInquiryLabel) - // MARK: 맨 위 이미지 위치 - self.titleImageView2.snp.makeConstraints { - $0.top.equalToSuperview().offset(170) - $0.centerX.equalToSuperview() - } + UserDefaults.standard.set(false,forKey: "loginSuccess") + + self.emailImageView.snp.makeConstraints { - $0.top.equalTo(titleImageView2.snp.bottom).offset(100) + $0.top.equalToSuperview().offset(350) $0.left.equalToSuperview().offset(30) $0.right.equalToSuperview().offset(-30) } + // MARK: 맨 위 이미지 위치 + self.titleImageView2.snp.makeConstraints { + $0.top.equalToSuperview().offset(200) + $0.centerX.equalToSuperview() + $0.bottom.equalTo(emailImageView.snp.top).offset(-30) + $0.left.equalToSuperview().offset(90) + $0.right.equalToSuperview().offset(-90) + } + self.emailTextField.snp.makeConstraints { - $0.top.equalTo(titleImageView2.snp.bottom).offset(115) + $0.top.equalToSuperview().offset(365) $0.left.equalToSuperview().offset(50) $0.right.equalToSuperview().offset(-30) } @@ -255,7 +269,7 @@ class LoginController: UIViewController { // MARK: 로그인 버튼 self.loginBtn2.snp.makeConstraints { - $0.top.equalTo(pwImageView.snp.bottom).offset(40) + $0.top.equalTo(pwImageView.snp.bottom).offset(20) $0.left.equalToSuperview().offset(30) $0.right.equalToSuperview().offset(-30) } @@ -263,32 +277,33 @@ class LoginController: UIViewController { // MARK: 회원가입 및 비밀번호 찾기 self.middleLabel2.snp.makeConstraints{ - $0.top.equalTo(loginBtn2.snp.bottom).offset(25) + $0.top.equalTo(loginBtn2.snp.bottom).offset(15) $0.centerX.equalTo(loginBtn2) } self.joinBtn2.snp.makeConstraints{ - $0.top.equalTo(loginBtn2.snp.bottom).offset(20) + $0.top.equalTo(loginBtn2.snp.bottom).offset(10) $0.right.equalTo(middleLabel2.snp.left).offset(-20) } self.findPwBtn2.snp.makeConstraints{ - $0.top.equalTo(loginBtn2.snp.bottom).offset(20) + $0.top.equalTo(loginBtn2.snp.bottom).offset(10) $0.left.equalTo(middleLabel2.snp.right).offset(20) } - // MARK: 맨 밑 글자 위치 - self.memberInquiryLabel.snp.makeConstraints{ + + + self.privacyPolicyLabel.snp.makeConstraints{ $0.centerX.equalToSuperview() - $0.top.equalTo(privacyPolicyLabel.snp.bottom).offset(5) + $0.top.equalTo(findPwBtn2.snp.bottom).offset(50) } - self.privacyPolicyLabel.snp.makeConstraints{ + // MARK: 맨 밑 글자 위치 + self.memberInquiryLabel.snp.makeConstraints{ $0.centerX.equalToSuperview() - $0.bottom.equalToSuperview().offset(-100) - + $0.top.equalTo(privacyPolicyLabel.snp.bottom).offset(5) } } diff --git a/LGHTSG/LGHTSG/Controller/Authentication/RegisterationController.swift b/LGHTSG/LGHTSG/Controller/Authentication/RegisterationController.swift index 35412f9..7b7b52d 100644 --- a/LGHTSG/LGHTSG/Controller/Authentication/RegisterationController.swift +++ b/LGHTSG/LGHTSG/Controller/Authentication/RegisterationController.swift @@ -19,6 +19,35 @@ class RegisterationController: UIViewController { return navigationBar }() + let registerLabel : UILabel = { + let label = UILabel() + label.text = "똑똑한 투자를 시작해보세요!" + label.textColor = .systemBlue + label.font = UIFont(name: "NanumSquareEB", size: 20.0) + label.translatesAutoresizingMaskIntoConstraints = false + return label + }() + + + let registerLabel2 : UILabel = { + let label = UILabel() + label.text = ", 저희와 함께" + label.textColor = .white + label.font = UIFont(name: "NanumSquareEB", size: 20.0) + label.translatesAutoresizingMaskIntoConstraints = false + return label + }() + + let iconImageView : UIImageView = { + let image = UIImageView() + image.image = UIImage(named: "icon") + image.translatesAutoresizingMaskIntoConstraints = false + image.translatesAutoresizingMaskIntoConstraints = false + return image + }() + + + var profileImageData : String! // MARK: imagePicker var profileImagePicker = UIImagePickerController() @@ -72,6 +101,15 @@ class RegisterationController: UIViewController { return btn }() + let codeSuccessLabel: UILabel = { + let label = UILabel() + label.text = "⎷ 이메일 인증이 완료되었습니다." + label.font = UIFont(name: "NanumSquareR", size: 12.0) + label.textColor = .systemGreen + label.translatesAutoresizingMaskIntoConstraints = false + return label + }() + // MARK: 인증번호 발송 메세지 let codeSendLabel2: UILabel = { @@ -93,7 +131,6 @@ class RegisterationController: UIViewController { label.font = UIFont(name: "NanumSquareB", size: 15.0) label.borderStyle = .none label.enablesReturnKeyAutomatically = true - label.keyboardType = .numberPad return label }() @@ -248,6 +285,8 @@ class RegisterationController: UIViewController { codeConfirmheight2.isActive = true emailSuccess = "1" UserDefaults.standard.set(true, forKey: "ConfirmSuccess") + codeConfirmSuccessheight.isActive = false + codeConfirmheight2.isActive = true } else { codeConfirmheight2.isActive = false @@ -327,6 +366,8 @@ class RegisterationController: UIViewController { // MARK: 인증번호 관련 동적 변화 라벨 var sendCodeheight2: NSLayoutConstraint! var codeConfirmheight2: NSLayoutConstraint! + var codeConfirmSuccessheight: NSLayoutConstraint! + // MARK: 비밀번호에 따른 메세지 var pwheight3: NSLayoutConstraint! @@ -345,6 +386,9 @@ class RegisterationController: UIViewController { pwheight4 = pwSameLabel2.heightAnchor.constraint(equalToConstant: 0) pwheight4.isActive = true + + codeConfirmSuccessheight = codeSuccessLabel.heightAnchor.constraint(equalToConstant: 0) + codeConfirmSuccessheight.isActive = true } @@ -418,7 +462,7 @@ class RegisterationController: UIViewController { "email" : email, "password" : password, "emailCheck" : emailCheck, - "profileImg" : profileImg + //"profileImg" : profileImg ] joinAccess.requestJoinDataModel(bodyData: bodyData){ data in @@ -455,7 +499,10 @@ class RegisterationController: UIViewController { heightSetting2() view.backgroundColor = .black - view.addSubview(profileImageView) + view.addSubview(iconImageView) + view.addSubview(registerLabel) + view.addSubview(registerLabel2) + //view.addSubview(profileImageView) view.addSubview(nameImageView) view.addSubview(nameTextField) @@ -468,6 +515,7 @@ class RegisterationController: UIViewController { view.addSubview(codeTextField2) view.addSubview(codeConfirmBtn2) view.addSubview(codeConfirmLabel2) + view.addSubview(codeSuccessLabel) view.addSubview(pwImageView2) @@ -483,16 +531,34 @@ class RegisterationController: UIViewController { view.addSubview(nextBtn) + // MARK: 이름 설정 위치 + self.iconImageView.snp.makeConstraints{ + $0.top.equalToSuperview().offset(80) + $0.left.equalToSuperview().offset(20) + } + + self.registerLabel2.snp.makeConstraints{ + $0.top.equalToSuperview().offset(80) + $0.left.equalTo(iconImageView.snp.right).offset(5) + } + + // MARK: 이름 설정 위치 + self.registerLabel.snp.makeConstraints{ + $0.top.equalTo(iconImageView.snp.bottom).offset(20) + $0.left.equalToSuperview().offset(20) + $0.right.equalToSuperview().offset(-20) + } + // MARK: 이름 설정 위치 self.nameImageView.snp.makeConstraints{ - $0.top.equalToSuperview().offset(240) + $0.top.equalToSuperview().offset(200) $0.left.equalToSuperview().offset(20) $0.right.equalToSuperview().offset(-20) } self.nameTextField.snp.makeConstraints{ - $0.top.equalToSuperview().offset(255) + $0.top.equalToSuperview().offset(215) $0.left.equalToSuperview().offset(30) $0.right.equalToSuperview().offset(-20) } @@ -548,6 +614,11 @@ class RegisterationController: UIViewController { $0.left.equalTo(codeSendImageView2.snp.left) } + self.codeSuccessLabel.snp.makeConstraints{ + $0.top.equalTo(codeSendImageView2.snp.bottom).offset(5) + $0.left.equalTo(codeSendImageView2.snp.left) + } + // MARK: 비밀번호 설정 위치 self.pwImageView2.snp.makeConstraints{ @@ -592,14 +663,14 @@ class RegisterationController: UIViewController { } self.nextBtn.snp.makeConstraints{ - $0.top.equalTo(nextBtnImageView).offset(10) + $0.top.equalTo(nextBtnImageView.snp.top).offset(10) $0.left.equalToSuperview().offset(20) $0.right.equalToSuperview().offset(-20) + } - - + /* let tap = UITapGestureRecognizer(target: self, action: #selector(changeProfile)) profileImageView.addGestureRecognizer(tap) @@ -618,7 +689,7 @@ class RegisterationController: UIViewController { make.width.equalTo(100) } - + */ // MARK: 키보드 올라갔을 때 화면 터치해서 내려가게함 @@ -654,7 +725,7 @@ class RegisterationController: UIViewController { nextBtn.addTarget(self, action: #selector(joinBtnClicked2), for: .touchUpInside) } - } + } diff --git a/LGHTSG/LGHTSG/Controller/Authentication/RegisterationSuccessController.swift b/LGHTSG/LGHTSG/Controller/Authentication/RegisterationSuccessController.swift index 46ac86b..3f684fc 100644 --- a/LGHTSG/LGHTSG/Controller/Authentication/RegisterationSuccessController.swift +++ b/LGHTSG/LGHTSG/Controller/Authentication/RegisterationSuccessController.swift @@ -24,8 +24,25 @@ class RegisterationSuccessController: UIViewController { @objc func MoveHomeTab(){ - let vc = LoginController() - vc.modalPresentationStyle = .fullScreen - self.present(vc, animated: true) + + + //Alert 선언 + let msg = UIAlertController(title: "", message: "회원가입이 완료되었습니다.\n앱을 다시 실행하여 시작해보세요 :)", preferredStyle: .alert) + //Alert에 부여할 Yes이벤트 선언 + let YES = UIAlertAction(title: "확인", style: .default, handler: { (action) -> Void in + self.YesClick2() + }) + + // MARK: 자동로그인을 못하게 막는다 + UserDefaults.standard.set(false, forKey: "loginSuccess") + + msg.addAction(YES) + self.present(msg, animated: true, completion: nil) + } + + @objc func YesClick2(){ + UIApplication.shared.perform(#selector(NSXPCConnection.suspend)) + DispatchQueue.main.asyncAfter(deadline: .now()+0.5) {exit(0) + } } } diff --git a/LGHTSG/LGHTSG/Controller/CheckController/CheckAgreeController.swift b/LGHTSG/LGHTSG/Controller/CheckController/CheckAgreeController.swift index 17da51f..8f021ae 100644 --- a/LGHTSG/LGHTSG/Controller/CheckController/CheckAgreeController.swift +++ b/LGHTSG/LGHTSG/Controller/CheckController/CheckAgreeController.swift @@ -8,17 +8,17 @@ import UIKit class CheckAgreeController: UIViewController { - + + + + override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .black let CheckAgreeView = CheckAgreeView() view.addSubview(CheckAgreeView) - UserDefaults.standard.set(false, forKey: "allcheck") - UserDefaults.standard.set(false, forKey: "check1") - UserDefaults.standard.set(false, forKey: "check2") - UserDefaults.standard.set(false, forKey: "check3") + CheckAgreeView.translatesAutoresizingMaskIntoConstraints = false CheckAgreeView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true @@ -89,9 +89,13 @@ class CheckAgreeController: UIViewController { var isCheck4 = Int(isChecked4) if allChecked == 1{ + let vc = RegisterationController() + vc.modalPresentationStyle = .overFullScreen self.present(RegisterationController(), animated: true) } else if isCheck2 == 1 && isCheck3 == 1 && isCheck4 == 1{ + let vc = RegisterationController() + vc.modalPresentationStyle = .overFullScreen self.present(RegisterationController(), animated: true) } else{ diff --git a/LGHTSG/LGHTSG/Controller/CheckController/CheckPageMarketingController.swift b/LGHTSG/LGHTSG/Controller/CheckController/CheckPageMarketingController.swift index 5e46019..0fb6fb6 100644 --- a/LGHTSG/LGHTSG/Controller/CheckController/CheckPageMarketingController.swift +++ b/LGHTSG/LGHTSG/Controller/CheckController/CheckPageMarketingController.swift @@ -46,6 +46,7 @@ class CheckPageMarketingController: UIViewController { } @objc func tapDismissButton(){ + UserDefaults.standard.set(true, forKey: "check1") self.presentingViewController?.dismiss(animated: true) } diff --git a/LGHTSG/LGHTSG/Controller/CheckController/CheckPagePrivacyController.swift b/LGHTSG/LGHTSG/Controller/CheckController/CheckPagePrivacyController.swift index b8b9a31..41f1b81 100644 --- a/LGHTSG/LGHTSG/Controller/CheckController/CheckPagePrivacyController.swift +++ b/LGHTSG/LGHTSG/Controller/CheckController/CheckPagePrivacyController.swift @@ -46,6 +46,7 @@ class CheckPagePrivacyController: UIViewController { } @objc func tapDismissButton(){ + UserDefaults.standard.set(true, forKey: "check3") self.presentingViewController?.dismiss(animated: true) } diff --git a/LGHTSG/LGHTSG/Controller/CheckController/CheckPageServiceController.swift b/LGHTSG/LGHTSG/Controller/CheckController/CheckPageServiceController.swift index e626d81..9aeef00 100644 --- a/LGHTSG/LGHTSG/Controller/CheckController/CheckPageServiceController.swift +++ b/LGHTSG/LGHTSG/Controller/CheckController/CheckPageServiceController.swift @@ -46,6 +46,7 @@ class CheckPageServiceController: UIViewController { } @objc func tapDismissButton(){ + UserDefaults.standard.set(true, forKey: "check2") self.presentingViewController?.dismiss(animated: true) } diff --git a/LGHTSG/LGHTSG/Controller/EstateChartViewController.swift b/LGHTSG/LGHTSG/Controller/EstateChartViewController.swift index 450d88c..664fa44 100644 --- a/LGHTSG/LGHTSG/Controller/EstateChartViewController.swift +++ b/LGHTSG/LGHTSG/Controller/EstateChartViewController.swift @@ -31,38 +31,39 @@ class EstateChartViewController : UIViewController { dateFormatter.dateFormat = "yyyy-MM-dd" return dateFormatter }() + lazy var lineChartView : LineChartView = { let chartView = LineChartView() return chartView }() private lazy var nameLabel : UILabel = { let label = UILabel() - label.font = .systemFont(ofSize: 17, weight: .semibold) + label.font = UIFont(name: "NanumSquareEB", size: 17.0) label.textColor = UIColor.white label.text = nameText return label }() private lazy var priceLabel : UILabel = { let label = UILabel() - label.font = .systemFont(ofSize: 14, weight: .medium) + label.font = UIFont(name: "NanumSquareB", size: 14.0) label.textColor = UIColor.systemGray return label }() private lazy var pricePercent : UILabel = { let label = UILabel() - label.font = .systemFont(ofSize: 12, weight: .medium) + label.font = UIFont(name: "NanumSquareEB", size: 12.0) label.text = pricePercentText if (label.text!.prefix(1) == "-"){ - label.textColor = UIColor.blue + label.textColor = UIColor.systemBlue }else{ - label.textColor = UIColor.red + label.textColor = UIColor.systemRed } return label }() private lazy var changeDate : UILabel = { let label = UILabel() - label.font = .systemFont(ofSize: 12, weight : .medium) + label.font = UIFont(name: "NanumSquareB", size: 12.0) label.textColor = UIColor.systemGray label.text = changeDateText return label @@ -71,15 +72,15 @@ class EstateChartViewController : UIViewController { private lazy var dealLabel: UILabel = { let label = UILabel() label.text = "거래 이력" - label.font = UIFont.systemFont(ofSize: 12, weight: .light) + label.font = UIFont(name: "NanumSquareEB", size: 14.0) label.textColor = .white return label }() private lazy var revenueLabel: UILabel = { let label = UILabel() - label.textColor = .white - label.font = UIFont.systemFont(ofSize: 16, weight: .bold) + label.textColor = .systemBlue + label.font = UIFont(name: "NanumSquareEB", size: 16.0) return label }() @@ -98,14 +99,14 @@ class EstateChartViewController : UIViewController { seg.setTitleTextAttributes( [ NSAttributedString.Key.foregroundColor: UIColor.white, - .font: UIFont.systemFont(ofSize: 14, weight: .semibold) + .font: UIFont(name: "NanumSquareEB", size: 14) ], for: .selected ) seg.setTitleTextAttributes( [ NSAttributedString.Key.foregroundColor: UIColor.systemGray, - .font: UIFont.systemFont(ofSize: 14, weight: .semibold) + .font: UIFont(name: "NanumSquareEB", size: 14) ], for: .normal ) @@ -118,28 +119,31 @@ class EstateChartViewController : UIViewController { let btn = UIButton() var config = UIButton.Configuration.filled() config.attributedTitle = "원하시는 구매시점을 클릭해주세요" + config.attributedTitle?.font = UIFont(name: "NanumSquareEB", size: 14) btn.configuration = config btn.layer.cornerRadius = 10 - btn.backgroundColor = .blue - btn.tintColor = .blue - btn.layer.borderWidth = 1 + btn.backgroundColor = .systemBlue + btn.tintColor = .systemBlue btn.addTarget(self, action: #selector(sellbtnclicked), for: .touchUpInside) return btn }() - //MARK: - ButtonCustom + + + + //MARK: - ButtonCustom private func setSellButton(){ if(sellMode == true){ var config = UIButton.Configuration.plain() config.titleAlignment = .center if let markerDate = self.markerDate { var titleAttribute = AttributeContainer() - titleAttribute.font = .systemFont(ofSize: 10, weight: .medium) + titleAttribute.font = UIFont(name: "NanumSquareB", size: 10.0) config.attributedTitle = AttributedString(markerDate, attributes: titleAttribute) config.titlePadding = 3.0 } var subtitleAttribute = AttributeContainer() - subtitleAttribute.font = .systemFont(ofSize: 15, weight: .bold) + subtitleAttribute.font = UIFont(name: "NanumSquareEB", size: 15.0) config.attributedSubtitle = AttributedString("판매", attributes: subtitleAttribute) self.sellButton.configuration = config self.sellButton.backgroundColor = .white @@ -149,18 +153,20 @@ class EstateChartViewController : UIViewController { config.titleAlignment = .center if let markerDate = self.markerDate { var titleAttribute = AttributeContainer() - titleAttribute.font = .systemFont(ofSize: 10, weight: .medium) + titleAttribute.font = UIFont(name: "NanumSquareB", size: 10.0) config.attributedTitle = AttributedString(markerDate, attributes: titleAttribute) config.titlePadding = 3.0 } var subtitleAttribute = AttributeContainer() - subtitleAttribute.font = .systemFont(ofSize: 15, weight: .bold) + subtitleAttribute.font = UIFont(name: "NanumSquareEB", size: 15.0) subtitleAttribute.backgroundColor = .white config.attributedSubtitle = AttributedString("구매", attributes: subtitleAttribute) self.sellButton.configuration = config - self.sellButton.backgroundColor = .blue + self.sellButton.backgroundColor = .systemBlue } } + + //MARK: - MarkerDatachange @objc func markerchange(_ notification : Notification){ if let getValue = notification.userInfo as? [String : Int]{ @@ -203,6 +209,15 @@ class EstateChartViewController : UIViewController { self.tradeListData = data.body! //현재 가지고 있는 경우 if(data.body!.last?.sellCheck == 0){ + + let subData = Double( self.priceListDatas.last! - data.body!.last!.price ) / Double(data.body!.last!.price) * 100 + if subData > 0 { + self.revenueLabel.textColor = .systemBlue + } + else { + self.revenueLabel.textColor = .systemRed + } + self.revenueLabel.text = "구매시점에 비해서 \(String(format: "%.2f", Double(( self.priceListDatas.last! - data.body!.last!.price )) / Double(data.body!.last!.price) * 100))% " self.sellMode = true }else{ @@ -231,10 +246,10 @@ class EstateChartViewController : UIViewController { temppriceListDatas = daypricedata pricePercent.text = "\(String(format: "%.2f", Double((temppriceListDatas.last! - temppriceListDatas[0])) / Double(temppriceListDatas[0]) * 100))%" if(pricePercent.text?.prefix(1) == "-"){ - pricePercent.textColor = UIColor.blue + pricePercent.textColor = UIColor.systemBlue } else{ - pricePercent.textColor = UIColor.red + pricePercent.textColor = UIColor.systemRed } tableView.reloadData() case 1: @@ -246,10 +261,10 @@ class EstateChartViewController : UIViewController { temppriceListDatas = daypricedata pricePercent.text = "\(String(format: "%.2f", Double((temppriceListDatas.last! - temppriceListDatas[0])) / Double(temppriceListDatas[0]) * 100))%" if(pricePercent.text?.prefix(1) == "-"){ - pricePercent.textColor = UIColor.blue + pricePercent.textColor = UIColor.systemBlue } else{ - pricePercent.textColor = UIColor.red + pricePercent.textColor = UIColor.systemRed } tableView.reloadData() case 2: @@ -261,10 +276,10 @@ class EstateChartViewController : UIViewController { temppriceListDatas = daypricedata pricePercent.text = "\(String(format: "%.2f", Double((temppriceListDatas.last! - temppriceListDatas[0])) / Double(temppriceListDatas[0]) * 100))%" if(pricePercent.text?.prefix(1) == "-"){ - pricePercent.textColor = UIColor.blue + pricePercent.textColor = UIColor.systemBlue } else{ - pricePercent.textColor = UIColor.red + pricePercent.textColor = UIColor.systemRed } tableView.reloadData() case 3: @@ -272,10 +287,10 @@ class EstateChartViewController : UIViewController { self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: priceListDatas), xAxis: timeListDatas, recentPrice : Double(priceListDatas.last!)) pricePercent.text = "\(String(format: "%.2f", Double((priceListDatas.last! - priceListDatas[0])) / Double(priceListDatas[0]) * 100))%" if(pricePercent.text?.prefix(1) == "-"){ - pricePercent.textColor = UIColor.blue + pricePercent.textColor = UIColor.systemBlue } else{ - pricePercent.textColor = UIColor.red + pricePercent.textColor = UIColor.systemRed } tableView.reloadData() default: @@ -284,47 +299,60 @@ class EstateChartViewController : UIViewController { } //MARK: - btnclickevent @objc func sellbtnclicked(){ - let trademodel = StocktradeModel() - if(sellMode == true){ - trademodel.requestSellstock(assetIdx: self.idx!, category: "realestate", price: self.markerPrice!, transactionTime: self.markerDate!, token: mytoken!){ - data in - if(data.header.resultCode == 4009){ - let alertv = UIAlertController(title: "Error", message: "판매하려는 시기 이후에 구매하였습니다.", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true) - } - else if (data.header.resultCode == 4006){ - let alertv = UIAlertController(title: "Error", message: "이미 판매를 한 상품입니다.", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true) - } - else{ - let alertv = UIAlertController(title: "판매완료", message: "판매가 완료되었습니다", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true){ - self.getTradeLists() - self.tableView.reloadData() - } - }} - }else{ - //구매하기 - trademodel.requestBuystock(assetIdx: self.idx!, category: "realestate", price: self.markerPrice!, transactionTime: self.markerDate!, token: mytoken!) { - data in - if(data.header.resultCode == 4005){ - let alertv = UIAlertController(title: "Error", message: "이미 구매를 한 상품입니다.", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true) - } - else if(data.header.resultCode == 1000){ - let alertv = UIAlertController(title: "구매완료 ", message: "구매가 완료되었습니다", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true) - self.getTradeLists() - self.tableView.reloadData() - } - } - } - } + let trademodel = StocktradeModel() + if let markerDate = self.markerDate { + if(sellMode == true){ + trademodel.requestSellstock(assetIdx: self.idx!, category: "realestate", price: self.markerPrice!, transactionTime: markerDate, token: mytoken!){ + data in + if(data.header.resultCode == 4009){ + let alertv = UIAlertController(title: "Error", message: "판매하려는 시기 이후에 구매하였습니다.", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + } + else if (data.header.resultCode == 4006){ + let alertv = UIAlertController(title: "Error", message: "이미 판매를 한 상품입니다.", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + } + else if(data.header.resultCode == 1000){ + let alertv = UIAlertController(title: "판매완료", message: "판매가 완료되었습니다", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true){ + self.getTradeLists() + self.tableView.reloadData() + } + } + else{ + let alertv = UIAlertController(title: "Error", message: "판매가 되지 않았습니다.", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + } + } + }else{ + //구매하기 + trademodel.requestBuystock(assetIdx: self.idx!, category: "realestate", price: self.markerPrice!, transactionTime: markerDate, token: mytoken!) { + data in + if(data.header.resultCode == 4005){ + let alertv = UIAlertController(title: "Error", message: "이미 구매를 한 상품입니다.", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + } + else if(data.header.resultCode == 1000){ + let alertv = UIAlertController(title: "구매완료 ", message: "구매가 완료되었습니다", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + self.getTradeLists() + self.tableView.reloadData() + } + else if(data.header.resultCode == 4208){ + let alertv = UIAlertController(title: "구매실패", message: "동일 자산을 2번 이상 구매하였습니다.", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + } + } + } + } + } } extension EstateChartViewController : UITableViewDelegate, UITableViewDataSource { //cell 높이조절 @@ -338,17 +366,24 @@ class EstateChartViewController : UIViewController { guard let cell = tableView.dequeueReusableCell(withIdentifier: EstateDetailCell.identifier, for: indexPath) as? EstateDetailCell else { return UITableViewCell() } cell.selectionStyle = .none + + cell.date.font = UIFont(name: "NanumSquareEB", size: 13) + cell.price.font = UIFont(name: "NanumSquareEB", size: 13) + cell.buysell.font = UIFont(name: "NanumSquareEB", size: 13) + + cell.date.text = tradeListData[indexPath.row].transactionTime cell.date.textColor = .white cell.price.text = "\(tradeListData[indexPath.row].price)원" cell.price.textColor = .white if(tradeListData[indexPath.row].sellCheck == 0 ){ cell.buysell.text = "구매" + cell.buysell.textColor = .systemRed } else if(tradeListData[indexPath.row].sellCheck == 1){ cell.buysell.text = "판매" + cell.buysell.textColor = .systemBlue } - cell.buysell.textColor = .white return cell } } @@ -358,7 +393,7 @@ class EstateChartViewController : UIViewController { let lineChartdataSet = LineChartDataSet(entries: lineChartDataEntries, label: "주가") lineChartdataSet.drawValuesEnabled = false lineChartdataSet.drawCirclesEnabled = false - lineChartdataSet.colors = [.blue] + lineChartdataSet.colors = [.systemBlue] //선택했을때 라인 지워주기 lineChartdataSet.drawHorizontalHighlightIndicatorEnabled = false // lineChartdataSet.drawVerticalHighlightIndicatorEnabled = false diff --git a/LGHTSG/LGHTSG/Controller/ExploreViewController.swift b/LGHTSG/LGHTSG/Controller/ExploreViewController.swift index bfd1a28..5787d74 100644 --- a/LGHTSG/LGHTSG/Controller/ExploreViewController.swift +++ b/LGHTSG/LGHTSG/Controller/ExploreViewController.swift @@ -12,21 +12,26 @@ protocol searchDataFilterDelegate{ } class ExploreViewController : UIViewController { var delegate1 : searchDataFilterDelegate? - var segmentControl = UnderlineSegmentedControl(items: ["Top", "부동산", "주식", "리셀"]) + var segmentControl = UnderlineSegmentedControl(items: ["Rank","Top", "부동산", "주식", "리셀"]) let underline1 = UnderlineView() let underline2 = UnderlineView() let underline3 = UnderlineView() + let underline5 = UnderlineView() let underline4 = UnderlineView() - private var changepercent : String? + private var changepercent = "0%" var resellVC = resellView() static var isSearching = false let stockView = StockView() let TopView = TopViewController() let EstateVC = EstateController() + let rankVC = RankViewController() + private var mytoken = UserDefaults.standard.string(forKey: "savedToken") override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .black + + let userRoemodel = UserRoeModel() userRoemodel.getUserROE(token: mytoken!){ @@ -36,19 +41,28 @@ class ExploreViewController : UIViewController { } stockView.delegate = self setTobTabbar() - self.addChild(TopView) - self.view.addSubview(TopView.view) - TopView.view.snp.makeConstraints{ + + self.addChild(rankVC) + self.view.addSubview(rankVC.view) + rankVC.view.snp.makeConstraints{ $0.leading.trailing.equalToSuperview().inset(23) $0.top.equalTo(underline4.snp.bottom).offset(32) $0.bottom.equalTo(view.safeAreaLayoutGuide) } +// self.addChild(TopView) +// self.view.addSubview(TopView.view) +// TopView.view.snp.makeConstraints{ +// $0.leading.trailing.equalToSuperview().inset(23) +// $0.top.equalTo(underline4.snp.bottom).offset(32) +// $0.bottom.equalTo(view.safeAreaLayoutGuide) +// } } //keyboard override func touchesBegan(_ touches: Set, with event: UIEvent?) { view.endEditing(true) } + override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(true) let userRoemodel = UserRoeModel() @@ -64,6 +78,22 @@ class ExploreViewController : UIViewController { view.addSubview(underline2) view.addSubview(underline3) view.addSubview(underline4) + view.addSubview(underline5) + + // MARK: 세그먼트 폰트 설정 + // 선택안된 버튼 폰트 + segmentControl.setTitleTextAttributes([ + NSAttributedString.Key.foregroundColor: UIColor.systemGray, + NSAttributedString.Key.font: UIFont(name: "NanumSquareEB", size: 17) + ], for: .normal) + + // 선택된 버튼 폰트 + segmentControl.setTitleTextAttributes([ + NSAttributedString.Key.foregroundColor: UIColor.white, + NSAttributedString.Key.font: UIFont(name: "NanumSquareEB", size: 17) + ], for: .selected) + + segmentControl.addTarget(self, action: #selector(clickfoursegment), for: .valueChanged) segmentControl.snp.makeConstraints{ $0.top.equalTo(view.safeAreaLayoutGuide.snp.top) @@ -74,25 +104,31 @@ class ExploreViewController : UIViewController { underline1.snp.makeConstraints{ $0.leading.equalToSuperview().inset(18) $0.height.equalTo(1) - $0.width.equalTo((view.frame.width - 36 - 12.5) / 4) + $0.width.equalTo((view.frame.width - 36 - 12.5) / 5) $0.top.equalTo(segmentControl.snp.bottom).offset(-8) } underline2.snp.makeConstraints{ $0.leading.equalTo(underline1.snp.trailing).offset(4.5) $0.height.equalTo(1) - $0.width.equalTo((view.frame.width - 36 - 12.5) / 4) + $0.width.equalTo((view.frame.width - 36 - 12.5) / 5) $0.top.equalTo(segmentControl.snp.bottom).offset(-8) } underline3.snp.makeConstraints{ $0.leading.equalTo(underline2.snp.trailing).offset(3.5) $0.height.equalTo(1) - $0.width.equalTo((view.frame.width - 36 - 12.5) / 4) + $0.width.equalTo((view.frame.width - 36 - 12.5) / 5) $0.top.equalTo(segmentControl.snp.bottom).offset(-8) } underline4.snp.makeConstraints{ $0.leading.equalTo(underline3.snp.trailing).offset(4.5) $0.height.equalTo(1) - $0.width.equalTo((view.frame.width - 36 - 12.5) / 4) + $0.width.equalTo((view.frame.width - 36 - 12.5) / 5) + $0.top.equalTo(segmentControl.snp.bottom).offset(-8) + } + underline5.snp.makeConstraints{ + $0.leading.equalTo(underline4.snp.trailing).offset(4.5) + $0.height.equalTo(1) + $0.width.equalTo((view.frame.width - 36 - 12.5) / 5) $0.top.equalTo(segmentControl.snp.bottom).offset(-8) } } @@ -105,10 +141,35 @@ class ExploreViewController : UIViewController { resellVC.view.removeFromSuperview() EstateVC.removeFromParent() EstateVC.view.removeFromSuperview() + TopView.view.removeFromSuperview() + TopView.removeFromParent() underline1.backgroundColor = .white underline2.backgroundColor = .darkGray underline3.backgroundColor = .darkGray underline4.backgroundColor = .darkGray + underline5.backgroundColor = .darkGray + self.addChild(rankVC) + self.view.addSubview(rankVC.view) + rankVC.view.snp.makeConstraints{ + $0.leading.trailing.equalToSuperview().inset(23) + $0.top.equalTo(underline4.snp.bottom).offset(32) + $0.bottom.equalTo(view.safeAreaLayoutGuide) + } + + case 1: + rankVC.removeFromParent() + rankVC.view.removeFromSuperview() + stockView.removeFromParent() + stockView.view.removeFromSuperview() + resellVC.removeFromParent() + resellVC.view.removeFromSuperview() + EstateVC.removeFromParent() + EstateVC.view.removeFromSuperview() + underline1.backgroundColor = .darkGray + underline2.backgroundColor = .white + underline3.backgroundColor = .darkGray + underline4.backgroundColor = .darkGray + underline5.backgroundColor = .darkGray self.addChild(TopView) self.view.addSubview(TopView.view) TopView.view.snp.makeConstraints{ @@ -116,8 +177,12 @@ class ExploreViewController : UIViewController { $0.top.equalTo(underline4.snp.bottom).offset(32) $0.bottom.equalTo(view.safeAreaLayoutGuide) } + + - case 1: + case 2: + rankVC.removeFromParent() + rankVC.view.removeFromSuperview() stockView.removeFromParent() stockView.view.removeFromSuperview() resellVC.removeFromParent() @@ -132,12 +197,16 @@ class ExploreViewController : UIViewController { $0.bottom.equalTo(view.safeAreaLayoutGuide) } underline1.backgroundColor = .darkGray - underline2.backgroundColor = .white - underline3.backgroundColor = .darkGray + underline2.backgroundColor = .darkGray + underline3.backgroundColor = .white underline4.backgroundColor = .darkGray + underline5.backgroundColor = .darkGray + - - case 2: + + case 3: + rankVC.removeFromParent() + rankVC.view.removeFromSuperview() TopView.removeFromParent() TopView.view.removeFromSuperview() EstateVC.removeFromParent() @@ -146,8 +215,8 @@ class ExploreViewController : UIViewController { resellVC.view.removeFromSuperview() underline1.backgroundColor = .darkGray underline2.backgroundColor = .darkGray - underline3.backgroundColor = .white - underline4.backgroundColor = .darkGray + underline3.backgroundColor = .darkGray + underline4.backgroundColor = .white self.addChild(stockView) self.view.addSubview(stockView.view) stockView.view.snp.makeConstraints{ @@ -155,9 +224,11 @@ class ExploreViewController : UIViewController { $0.top.equalTo(underline4.snp.bottom).offset(32) $0.bottom.equalTo(view.safeAreaLayoutGuide) } - - - case 3: + underline5.backgroundColor = .darkGray + + case 4: + rankVC.removeFromParent() + rankVC.view.removeFromSuperview() TopView.removeFromParent() TopView.view.removeFromSuperview() stockView.removeFromParent() @@ -167,9 +238,8 @@ class ExploreViewController : UIViewController { underline1.backgroundColor = .darkGray underline2.backgroundColor = .darkGray underline3.backgroundColor = .darkGray - underline4.backgroundColor = .white - - + underline4.backgroundColor = .darkGray + underline5.backgroundColor = .white resellVC.delegate = self self.addChild(resellVC) self.view.addSubview(resellVC.view) @@ -191,23 +261,29 @@ extension ExploreViewController : showNavigationDelegate{ } func SetNavigationBar(){ ExploreViewController.isSearching = false + stockView.StockaTableView.reloadData() + resellVC.resellTableView.reloadData() + navigationItem.titleView = nil navigationController?.navigationBar.tintColor = .white let searchBtn = UIBarButtonItem(image: UIImage(systemName : "magnifyingglass"), style: .plain, target: self, action: #selector(showsearchbar)) searchBtn.tintColor = .white navigationItem.leftBarButtonItem = searchBtn var config = UIButton.Configuration.plain() - var attributeString = AttributedString(changepercent!) - attributeString.font = UIFont(name: "NanumSquareB", size: 12) + var attributeString = AttributedString(changepercent) + + attributeString.font = UIFont(name: "NanumSquareEB", size: 12) attributeString.foregroundColor = UIColor.systemBlue config.attributedTitle = attributeString config.titleAlignment = .leading - config.image = UIImage(named: "profile_mini") + config.image = UIImage(named: "profile-money-mini") config.imagePadding = 8 config.imagePlacement = .trailing + let realbtn = UIButton(configuration: config) let profileBtn = UIBarButtonItem(customView:realbtn ) realbtn.addTarget(self, action: #selector(mypageClicked), for: .touchUpInside) + navigationItem.rightBarButtonItem = profileBtn let navigationAppearance = UINavigationBarAppearance() navigationAppearance.backgroundColor = .black @@ -227,6 +303,7 @@ extension ExploreViewController : showNavigationDelegate{ let searchbar = UISearchBar() searchbar.delegate = self searchbar.placeholder = "검색어를 입력해주세요" + searchbar.searchTextField.font = UIFont(name: "NanumSquareB", size: 13) searchbar.searchTextField.backgroundColor = .clear searchbar.searchTextField.textColor = .white searchbar.tintColor = .white diff --git a/LGHTSG/LGHTSG/Controller/HomeViewController.swift b/LGHTSG/LGHTSG/Controller/HomeViewController.swift index 5b820c8..f3ef338 100644 --- a/LGHTSG/LGHTSG/Controller/HomeViewController.swift +++ b/LGHTSG/LGHTSG/Controller/HomeViewController.swift @@ -22,6 +22,7 @@ final class HomeViewController : UIViewController{ view.backgroundColor = .black super.viewDidLoad() let userRoemodel = UserRoeModel() + userRoemodel.getUserROE(token: mytoken!){ data in self.changepercent = String(format:"%.2f",data.rate)+"%" @@ -91,13 +92,13 @@ private extension HomeViewController{ searchBtn.tintColor = .white navigationItem.leftBarButtonItem = searchBtn var config = UIButton.Configuration.plain() - var attributeString = AttributedString(changepercent) - attributeString.font = UIFont(name: "NanumSquareB", size: 12) + attributeString.font = UIFont(name: "NanumSquareEB", size: 12) + attributeString.foregroundColor = UIColor.systemBlue config.attributedTitle = attributeString config.titleAlignment = .leading - config.image = UIImage(named: "profile_mini") + config.image = UIImage(named: "profile-money-mini") config.imagePadding = 8 config.imagePlacement = .trailing let realbtn = UIButton(configuration: config) @@ -176,6 +177,19 @@ extension HomeViewController : UITableViewDelegate,UITableViewDataSource { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableview.dequeueReusableCell(withIdentifier: "HomeTableCell", for: indexPath) as? HomeTableCell cell?.selectionStyle = .none + + // MARK: 세그먼트 폰트 설정 + // 선택안된 버튼 폰트 + segmentControl.setTitleTextAttributes([ + NSAttributedString.Key.foregroundColor: UIColor.systemGray, + NSAttributedString.Key.font: UIFont(name: "NanumSquareEB", size: 17) + ], for: .normal) + + // 선택된 버튼 폰트 + segmentControl.setTitleTextAttributes([ + NSAttributedString.Key.foregroundColor: UIColor.white, + NSAttributedString.Key.font: UIFont(name: "NanumSquareEB", size: 17) + ], for: .selected) let selectedIndex = self.segmentControl.selectedSegmentIndex switch selectedIndex{ @@ -214,6 +228,7 @@ extension HomeViewController : UITableViewDelegate,UITableViewDataSource { ChartVc.PriceText = "\(String(myAssetData[indexPath.row].price))원" ChartVc.idx = myAssetData[indexPath.row].assetIdx ChartVc.imageURL = myAssetData[indexPath.row].iconImage + ChartVc.navigationItem.leftBarButtonItem?.tintColor = .white self.navigationController?.pushViewController(ChartVc, animated: true) } else if (myAssetData[indexPath.row].category == "stock"){ @@ -223,8 +238,19 @@ extension HomeViewController : UITableViewDelegate,UITableViewDataSource { StockVC.pricePercentText = "\(myAssetData[indexPath.row].rateOfChange)%" // StockVC. = "\(String(myAssetData[indexPath.row].price))원" StockVC.idx = myAssetData[indexPath.row].assetIdx + StockVC.navigationItem.leftBarButtonItem?.tintColor = .white self.navigationController?.pushViewController(StockVC, animated: true) } + // 부동산일꺼아냐 + else{ + let estateChartVC = EstateChartViewController() + estateChartVC.nameText = myAssetData[indexPath.row].assetName + estateChartVC.changeDateText = myAssetData[indexPath.row].rateCalDateDiff + estateChartVC.pricePercentText = "\(myAssetData[indexPath.row].rateOfChange)%" + estateChartVC.idx = myAssetData[indexPath.row].assetIdx + estateChartVC.navigationItem.leftBarButtonItem?.tintColor = .white + self.navigationController?.pushViewController(estateChartVC, animated: true) + } case 1: if(SellAssetData[indexPath.row].category == "resell"){ let ChartVc = ReSellChartViewController() @@ -234,6 +260,7 @@ extension HomeViewController : UITableViewDelegate,UITableViewDataSource { ChartVc.PriceText = "\(String(SellAssetData[indexPath.row].price))원" ChartVc.idx = SellAssetData[indexPath.row].assetIdx ChartVc.imageURL = SellAssetData[indexPath.row].iconImage + ChartVc.navigationItem.leftBarButtonItem?.tintColor = .white self.navigationController?.pushViewController(ChartVc, animated: true) } else if (SellAssetData[indexPath.row].category == "stock"){ @@ -243,8 +270,18 @@ extension HomeViewController : UITableViewDelegate,UITableViewDataSource { StockVC.pricePercentText = "\(SellAssetData[indexPath.row].rateOfChange)%" // StockVC. = "\(String(myAssetData[indexPath.row].price))원" StockVC.idx = SellAssetData[indexPath.row].assetIdx + StockVC.navigationItem.leftBarButtonItem?.tintColor = .white self.navigationController?.pushViewController(StockVC, animated: true) } + else{ + let estateChartVC = EstateChartViewController() + estateChartVC.nameText = SellAssetData[indexPath.row].assetName + estateChartVC.changeDateText = SellAssetData[indexPath.row].rateCalDateDiff + estateChartVC.pricePercentText = "\(SellAssetData[indexPath.row].rateOfChange)%" + estateChartVC.idx = SellAssetData[indexPath.row].assetIdx + estateChartVC.navigationItem.leftBarButtonItem?.tintColor = .white + self.navigationController?.pushViewController(estateChartVC, animated: true) + } default: print("error") } } @@ -254,31 +291,50 @@ extension HomeViewController : UITableViewDelegate,UITableViewDataSource { } func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == .delete { -// tableView.beginUpdates() + // tableView.beginUpdates() let AssetModel = AssetModel() -// switch( self.segmentControl.selectedSegmentIndex){ -// case 0: - AssetModel.deleteMyAsset(token: self.mytoken!, transactionIdx: myAssetData[indexPath.row].assetIdx, category: myAssetData[indexPath.row].category){ - data in - //요청에 성공한 경우 - if(data.header.resultCode == 1000){ - let alertv = UIAlertController(title: "삭제완료", message: "삭제가 완료되었습니다", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true){ -// tableView.deleteRows(at: [indexPath], with: .fade) - self.getmyAssetData() -// tableView.endUpdates() + switch( self.segmentControl.selectedSegmentIndex){ + case 0: + AssetModel.deleteMyAsset(token: self.mytoken!, transactionIdx: myAssetData[indexPath.row].assetIdx, category: myAssetData[indexPath.row].category){ + data in + //요청에 성공한 경우 + if(data.header.resultCode == 1000){ + let alertv = UIAlertController(title: "삭제완료", message: "삭제가 완료되었습니다", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true){ + // tableView.deleteRows(at: [indexPath], with: .fade) + self.getmyAssetData() + // tableView.endUpdates() + } + } + else{ + let alertv = UIAlertController(title: "ERROR", message: "삭제 실패", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv,animated: true) } } - else{ - let alertv = UIAlertController(title: "ERROR", message: "삭제 실패", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv,animated: true) + case 1: + AssetModel.deleteMyAsset(token: mytoken!, transactionIdx: SellAssetData[indexPath.row].assetIdx, category: SellAssetData[indexPath.row].category){ + data in + //요청에 성공한 경우 + if(data.header.resultCode == 1000){ + let alertv = UIAlertController(title: "삭제완료", message: "삭제가 완료되었습니다", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true){ + // tableView.deleteRows(at: [indexPath], with: .fade) + self.getmyAssetData() + // tableView.endUpdates() + } + } + else{ + let alertv = UIAlertController(title: "ERROR", message: "삭제 실패", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv,animated: true) + } } - } -// case 1: -// default: - } + default: + break + }} } func scrollViewDidScroll(_ scrollView: UIScrollView) { if self.tableview.contentOffset.y < 0 { diff --git a/LGHTSG/LGHTSG/Controller/MainTabController.swift b/LGHTSG/LGHTSG/Controller/MainTabController.swift index fb6f7e2..d340d0a 100644 --- a/LGHTSG/LGHTSG/Controller/MainTabController.swift +++ b/LGHTSG/LGHTSG/Controller/MainTabController.swift @@ -7,14 +7,28 @@ import UIKit import Foundation + class MainTabController: UITabBarController { + override func viewDidLoad() { view.backgroundColor = .black + + /* + view.addSubview(tapImage) + self.tapImage.heightAnchor.constraint(equalTo: self.view.heightAnchor, multiplier: 0.2).isActive = true + self.tapImage.snp.makeConstraints{ + $0.bottom.equalToSuperview() + $0.left.equalToSuperview().offset(10) + $0.right.equalToSuperview().offset(-10) + $0.centerX.equalToSuperview() + } + */ super.viewDidLoad() let tabbarApperance = UITabBarAppearance() let tabbaritemappearcne = UITabBarItemAppearance() - tabbaritemappearcne.normal.titleTextAttributes = [NSAttributedString.Key.foregroundColor : UIColor.darkGray, .font: UIFont.systemFont(ofSize: 12.0, weight: .semibold)] - tabbaritemappearcne.selected.titleTextAttributes = [NSAttributedString.Key.foregroundColor : UIColor.white, .font: UIFont.systemFont(ofSize: 12.0, weight: .semibold)] + + tabbaritemappearcne.normal.titleTextAttributes = [NSAttributedString.Key.foregroundColor : UIColor.darkGray, .font: UIFont(name: "NanumSquareEB", size: 12)] + tabbaritemappearcne.selected.titleTextAttributes = [NSAttributedString.Key.foregroundColor : UIColor.white, .font: UIFont(name: "NanumSquareEB", size: 12)] tabbarApperance.stackedLayoutAppearance = tabbaritemappearcne tabbarApperance.backgroundColor = .black tabBar.scrollEdgeAppearance = tabbarApperance @@ -30,8 +44,7 @@ class MainTabController: UITabBarController { tabBar.layer.borderColor = UIColor.white.cgColor tabBar.clipsToBounds = false viewControllers = [HomeVC,ExploreVC] - - addSeparatorToTabBar() + //addSeparatorToTabBar() diff --git a/LGHTSG/LGHTSG/Controller/New Group/AccountSettingViewController.swift b/LGHTSG/LGHTSG/Controller/New Group/AccountSettingViewController.swift index ce944a4..f234d98 100644 --- a/LGHTSG/LGHTSG/Controller/New Group/AccountSettingViewController.swift +++ b/LGHTSG/LGHTSG/Controller/New Group/AccountSettingViewController.swift @@ -35,7 +35,7 @@ class AccountSettingViewController: UIViewController, UIGestureRecognizerDelegat image.contentMode = .scaleToFill image.layer.borderColor = UIColor.clear.cgColor // 원형 이미지의 테두리 제거 image.clipsToBounds = true - image.image = UIImage(named: "profile") + image.image = UIImage(named: "profile-money") image.translatesAutoresizingMaskIntoConstraints = false return image }() @@ -51,13 +51,12 @@ class AccountSettingViewController: UIViewController, UIGestureRecognizerDelegat let nameTextLabel: UILabel = { let name = UILabel() name.text = "라고함" - name.textColor = .white // 글자색을 흰색으로 - name.font = UIFont(name: "NanumSquareR", size: 16.0) + name.textColor = .systemGray // 글자색을 흰색으로 + name.font = UIFont(name: "NanumSquareEB", size: 14.0) name.translatesAutoresizingMaskIntoConstraints = false return name }() - - + // MARK: 사용자 이메일 let emailImageView: UIImageView = { let image = UIImageView() @@ -69,8 +68,8 @@ class AccountSettingViewController: UIViewController, UIGestureRecognizerDelegat let emailTextLabel: UILabel = { let name = UILabel() name.text = "abc123@rghtsg.com" - name.textColor = .white // 글자색을 흰색으로 - name.font = UIFont(name: "NanumSquareR", size: 16.0) + name.textColor = .systemGray // 글자색을 흰색으로 + name.font = UIFont(name: "NanumSquareEB", size: 14.0) name.translatesAutoresizingMaskIntoConstraints = false return name }() @@ -91,7 +90,7 @@ class AccountSettingViewController: UIViewController, UIGestureRecognizerDelegat name.borderStyle = .none name.textColor = .white // 글자색을 흰색으로 name.isSecureTextEntry = true - name.font = UIFont(name: "NanumSquareR", size: 16.0) + name.font = UIFont(name: "NanumSquareB", size: 14.0) name.addTarget(self, action: #selector(pwFieldEdited2), for: UIControl.Event.editingChanged) name.enablesReturnKeyAutomatically = true name.translatesAutoresizingMaskIntoConstraints = false @@ -123,7 +122,7 @@ class AccountSettingViewController: UIViewController, UIGestureRecognizerDelegat name.borderStyle = .none name.textColor = .white // 글자색을 흰색으로 name.isSecureTextEntry = true - name.font = UIFont(name: "NanumSquareR", size: 16.0) + name.font = UIFont(name: "NanumSquareB", size: 14.0) name.addTarget(self, action: #selector(pwFieldEdited2), for: UIControl.Event.editingChanged) name.enablesReturnKeyAutomatically = true name.translatesAutoresizingMaskIntoConstraints = false @@ -189,8 +188,11 @@ class AccountSettingViewController: UIViewController, UIGestureRecognizerDelegat "x-access-token" : jwt] var pastPassword : String = UserDefaults.standard.string(forKey: "pastPassword") ?? "" + // profileImg print(pastPassword) + let image = profileImageView.image + let changePw = PasswordApiModel() guard let password = passwordTextLabel.text else {return} @@ -209,6 +211,10 @@ class AccountSettingViewController: UIViewController, UIGestureRecognizerDelegat }) msg.addAction(YES) self.present(msg, animated: true, completion: nil) + + self.saveBtn.setBackgroundImage(UIImage(named: "not-save-btn"), for: .normal) + self.passwordTextLabel.text = "" + self.passwordCheckTextLabel.text = "" } @@ -313,16 +319,24 @@ class AccountSettingViewController: UIViewController, UIGestureRecognizerDelegat } } - @objc func tapDismissButton(){ self.presentingViewController?.dismiss(animated: true) } + // 키보드때문에 화면이 가려질 경우 화면을 올린다 + @objc func keyboardWillShow(sender: NSNotification) { + self.view.frame.origin.y = -100 // Move view 150 points upward + } + + @objc func keyboardWillHide(sender: NSNotification) { + self.view.frame.origin.y = 0 // Move view to original position + } + override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .black AutoLayout() - loadData() + loadData() // MARK: 키보드 올라갔을 때 화면 터치해서 내려가게함 let tapGesture = UITapGestureRecognizer(target: self.view, action: #selector(self.view.endEditing(_:))) @@ -330,6 +344,11 @@ class AccountSettingViewController: UIViewController, UIGestureRecognizerDelegat self.view.addGestureRecognizer(tapGesture) + // MARK: 키보드가 화면을 가릴 때 화면을 위로 올릴 수 있도록 + NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(sender:)), name: UIResponder.keyboardWillShowNotification, object: nil); + NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(sender:)), name: UIResponder.keyboardWillHideNotification, object: nil); + + // MARK: 네비게이션 컨트롤러 self.view.addSubview(navigationBar) let safeArea = self.view.safeAreaLayoutGuide @@ -386,52 +405,52 @@ class AccountSettingViewController: UIViewController, UIGestureRecognizerDelegat // MARK: profile 위치 설정 self.profileImageView.snp.makeConstraints{ - $0.top.equalToSuperview().offset(150) + $0.top.equalToSuperview().offset(140) $0.centerX.equalToSuperview() } profileImageView.snp.makeConstraints { make in - make.height.equalTo(85) - make.width.equalTo(85) + make.height.equalTo(100) + make.width.equalTo(100) } // MARK: 이름 설정 위치 self.nameImageView.snp.makeConstraints{ $0.top.equalToSuperview().offset(280) - $0.left.equalToSuperview().offset(20) - $0.right.equalToSuperview().offset(-20) + $0.left.equalToSuperview().offset(30) + $0.right.equalToSuperview().offset(-30) } self.nameTextLabel.snp.makeConstraints{ $0.top.equalToSuperview().offset(295) - $0.left.equalToSuperview().offset(35) - $0.right.equalToSuperview().offset(-20) + $0.left.equalToSuperview().offset(45) + $0.right.equalToSuperview().offset(-30) } // MARK: 이메일 작성 및 전송 버튼 위치 self.emailImageView.snp.makeConstraints{ $0.top.equalTo(nameImageView.snp.bottom).offset(30) - $0.left.equalToSuperview().offset(20) - $0.right.equalToSuperview().offset(-20) + $0.left.equalToSuperview().offset(30) + $0.right.equalToSuperview().offset(-30) } self.emailTextLabel.snp.makeConstraints{ $0.top.equalTo(nameImageView.snp.bottom).offset(45) - $0.left.equalToSuperview().offset(35) - $0.right.equalToSuperview().offset(-120) + $0.left.equalToSuperview().offset(45) + $0.right.equalToSuperview().offset(-30) } self.passwordImageView.snp.makeConstraints{ $0.top.equalTo(emailImageView.snp.bottom).offset(30) - $0.left.equalToSuperview().offset(20) - $0.right.equalToSuperview().offset(-20) + $0.left.equalToSuperview().offset(30) + $0.right.equalToSuperview().offset(-30) } self.passwordTextLabel.snp.makeConstraints{ $0.top.equalTo(emailImageView.snp.bottom).offset(45) - $0.left.equalToSuperview().offset(35) - $0.right.equalToSuperview().offset(-120) + $0.left.equalToSuperview().offset(45) + $0.right.equalToSuperview().offset(-30) } self.passwordValidLabel.snp.makeConstraints{ @@ -441,14 +460,14 @@ class AccountSettingViewController: UIViewController, UIGestureRecognizerDelegat self.passwordCheckImageView.snp.makeConstraints{ $0.top.equalTo(passwordImageView.snp.bottom).offset(30) - $0.left.equalToSuperview().offset(20) - $0.right.equalToSuperview().offset(-20) + $0.left.equalToSuperview().offset(30) + $0.right.equalToSuperview().offset(-30) } self.passwordCheckTextLabel.snp.makeConstraints{ $0.top.equalTo(passwordImageView.snp.bottom).offset(45) - $0.left.equalToSuperview().offset(35) - $0.right.equalToSuperview().offset(-120) + $0.left.equalToSuperview().offset(45) + $0.right.equalToSuperview().offset(-30) } self.passwordSameLabel.snp.makeConstraints{ @@ -458,7 +477,7 @@ class AccountSettingViewController: UIViewController, UIGestureRecognizerDelegat // MARK: 저장 버튼 self.saveBtn.snp.makeConstraints{ - $0.bottom.equalToSuperview().offset(-50) + $0.top.equalTo(passwordCheckImageView.snp.bottom).offset(30) $0.left.equalToSuperview().offset(40) $0.right.equalToSuperview().offset(-40) $0.height.equalTo(passwordImageView.snp.height) diff --git a/LGHTSG/LGHTSG/Controller/New Group/MyPageViewController.swift b/LGHTSG/LGHTSG/Controller/New Group/MyPageViewController.swift index f2cbdfc..2e33863 100644 --- a/LGHTSG/LGHTSG/Controller/New Group/MyPageViewController.swift +++ b/LGHTSG/LGHTSG/Controller/New Group/MyPageViewController.swift @@ -58,11 +58,32 @@ class MyPageViewController: UIViewController { @objc func logoutBtnClicked(){ var jwt : String = UserDefaults.standard.string(forKey: "savedToken") ?? "" print("토큰은 \(jwt)") - let vc = LoginController() + + //Alert 선언 + let msg = UIAlertController(title: "", message: "로그아웃 되었습니다.\n앱을 다시 실행하여 시작해보세요 :)", preferredStyle: .alert) + //Alert에 부여할 Yes이벤트 선언 + let YES = UIAlertAction(title: "확인", style: .default, handler: { (action) -> Void in + self.YesClick2() + }) + + // MARK: 자동로그인을 못하게 막는다 + UserDefaults.standard.set(false, forKey: "loginSuccess") + + msg.addAction(YES) + self.present(msg, animated: true, completion: nil) + /*let vc = LoginController() vc.modalPresentationStyle = .fullScreen self.present(vc, animated: true) + */ } + @objc func YesClick2(){ + UIApplication.shared.perform(#selector(NSXPCConnection.suspend)) + DispatchQueue.main.asyncAfter(deadline: .now()+0.5) {exit(0) + } + } + + @objc func tapDismissButton(){ self.presentingViewController?.dismiss(animated: true) } diff --git a/LGHTSG/LGHTSG/Controller/RankViewController.swift b/LGHTSG/LGHTSG/Controller/RankViewController.swift new file mode 100644 index 0000000..358a950 --- /dev/null +++ b/LGHTSG/LGHTSG/Controller/RankViewController.swift @@ -0,0 +1,176 @@ +// +// RankViewController.swift +// LGHTSG +// +// Created by HA on 2023/02/10. +// + +import UIKit +import SnapKit +import Alamofire +import Kingfisher + +class RankViewController: UIViewController, UITableViewDelegate, UITableViewDataSource{ + //MARK: - Properties + + + lazy var label: UILabel = { + let label = UILabel() + label.text = "🏆 Ranking TOP 10 🏆" + label.font = UIFont(name: "NanumSquareEB", size: 20.0) + label.textColor = .white + return label + }() + + + lazy var tableView: UITableView = { + let table = UITableView() + table.backgroundColor = .clear + return table + }() + + //MARK: - Api + + + var userNameList = [String]() + var userAssetList = [Int]() + var userProfileList = [String]() + + + func getRankList() { + let url = "http://api.lghtsg.site:8090/event/demoday/user-ranking" + let header: HTTPHeaders = ["Content-Type" : "application/json"] + + AF.request(url, method: .get, headers: header) + .validate(statusCode: 200..<300) + .responseDecodable(of : RankingModel.self) { response in + switch response.result { + case .success(let res): + do { + + for index in 0.. CGFloat { + return 65 + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return userAssetList.count + + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + guard let cell = tableView.dequeueReusableCell(withIdentifier: RankViewCell.identifier, for: indexPath) as? RankViewCell else { return UITableViewCell() } + + cell.number.font = UIFont(name: "NanumSquareEB", size: 25.0) + cell.userName.font = UIFont(name: "NanumSquareEB", size: 15.0) + cell.userAsset.font = UIFont(name: "NanumSquareEB", size: 12.0) + cell.transCount.font = UIFont(name: "NanumSquareEB", size: 12.0) + cell.backgroundColor = .darkGray + cell.userName.textColor = .white + cell.userAsset.textColor = .lightGray + cell.layer.cornerRadius = 15 + cell.layer.borderWidth = 5 + cell.layer.masksToBounds = true + cell.number.text = String(indexPath.row + 1) + cell.backgroundColor = .darkGray + + if 2 < indexPath.row && indexPath.row < 9 { + cell.number.text! += " " + } + + if indexPath.row == 0 { + cell.number.text = "🥇 " + cell.number.font = UIFont(name: "NanumSquareB", size: 16) + cell.backgroundColor = .systemGray2 + cell.userName.textColor = .black + cell.userAsset.textColor = .systemPink + cell.transCount.textColor = .darkGray + //cell.iconImage.image = UIImage(named: "rank") + } + else if indexPath.row == 1 { + cell.number.text = "🥈 " + cell.number.font = UIFont(name: "NanumSquareB", size: 16) + cell.backgroundColor = .systemGray2 + cell.userName.textColor = .black + cell.userAsset.textColor = .systemPink + cell.transCount.textColor = .darkGray + // cell.iconImage.image = UIImage(named: "rank2") + } + else if indexPath.row == 2 { + cell.number.text = "🥉 " + cell.number.font = UIFont(name: "NanumSquareB", size: 16) + cell.backgroundColor = .systemGray2 + cell.userName.textColor = .black + cell.userAsset.textColor = .systemPink + cell.transCount.textColor = .darkGray + // cell.iconImage.image = UIImage(named: "rank3") + } + + else if indexPath.row == 9 { + cell.number.text = (cell.number.text ?? "") + "" + } + else { + cell.number.text = (cell.number.text ?? "") + "" + } + + + // cell.iconImage.kf.setImage(with: URL(string: estateDataLists[indexPath.row].iconImage)) + cell.userName.text = self.userNameList[indexPath.row] + cell.userAsset.text = "[자산 : \(self.userAssetList[indexPath.row])]" + // cell.iconImage.kf.setImage(with: URL(string: userProfileList[indexPath.row])) + cell.selectionStyle = .none + + return cell + + + } + +} + diff --git a/LGHTSG/LGHTSG/Controller/ReSellChartViewController.swift b/LGHTSG/LGHTSG/Controller/ReSellChartViewController.swift index 723f198..c7a1868 100644 --- a/LGHTSG/LGHTSG/Controller/ReSellChartViewController.swift +++ b/LGHTSG/LGHTSG/Controller/ReSellChartViewController.swift @@ -47,33 +47,33 @@ class ReSellChartViewController : UIViewController { }() private lazy var nameLabel : UILabel = { let label = UILabel() - label.font = .systemFont(ofSize: 16, weight: .semibold) + label.font = UIFont(name: "NanumSquareEB", size: 17.0) label.text = nameText label.textColor = .white return label }() private lazy var priceLabel : UILabel = { let label = UILabel() - label.font = .systemFont(ofSize: 14, weight: .medium) + label.font = UIFont(name: "NanumSquareB", size: 14.0) label.textColor = UIColor.systemGray label.text = PriceText return label }() private lazy var pricePercent : UILabel = { let label = UILabel() - label.font = .systemFont(ofSize: 12, weight: .medium) - label.textColor = UIColor.red + label.font = UIFont(name: "NanumSquareEB", size: 12.0) + label.textColor = UIColor.systemRed label.text = pricePercentText if (label.text!.prefix(1) == "-"){ - label.textColor = UIColor.blue + label.textColor = UIColor.systemBlue }else{ - label.textColor = UIColor.red + label.textColor = UIColor.systemRed } return label }() private lazy var changeDate : UILabel = { let label = UILabel() - label.font = .systemFont(ofSize: 12, weight : .medium) + label.font = UIFont(name: "NanumSquareB", size: 12.0) label.textColor = UIColor.systemGray label.text = changeDateText return label @@ -82,15 +82,15 @@ class ReSellChartViewController : UIViewController { private lazy var dealLabel: UILabel = { let label = UILabel() label.text = "거래 이력" - label.font = UIFont.systemFont(ofSize: 12, weight: .light) + label.font = UIFont(name: "NanumSquareEB", size: 14.0) label.textColor = .white return label }() private lazy var revenueLabel: UILabel = { let label = UILabel() - label.textColor = .white - label.font = UIFont.systemFont(ofSize: 16, weight: .bold) + label.textColor = .systemBlue + label.font = UIFont(name: "NanumSquareEB", size: 16.0) return label }() private lazy var imageView : UIImageView = { @@ -107,7 +107,7 @@ class ReSellChartViewController : UIViewController { //MARK: - SegmentControl private lazy var segmentCtrl: UISegmentedControl = { - let items = ["일","월", "1년", "3년"] + let items = ["3년","반년", "1년", "3년"] let seg = UISegmentedControl(items: items) seg.addTarget(self, action: #selector(indexChanged(_:)), for: .valueChanged) seg.layer.cornerRadius = 0.7 @@ -117,14 +117,14 @@ class ReSellChartViewController : UIViewController { seg.setTitleTextAttributes( [ NSAttributedString.Key.foregroundColor: UIColor.white, - .font: UIFont.systemFont(ofSize: 14, weight: .semibold) + .font: UIFont(name: "NanumSquareEB", size: 14.0) ], for: .selected ) seg.setTitleTextAttributes( [ NSAttributedString.Key.foregroundColor: UIColor.systemGray, - .font: UIFont.systemFont(ofSize: 14, weight: .semibold) + .font: UIFont(name: "NanumSquareEB", size: 14.0) ], for: .normal ) @@ -137,11 +137,12 @@ class ReSellChartViewController : UIViewController { let btn = UIButton() var config = UIButton.Configuration.filled() config.attributedTitle = "원하시는 구매시점을 클릭해주세요" + config.attributedTitle?.font = UIFont(name: "NanumSquareEB", size: 14.0) + btn.configuration = config btn.layer.cornerRadius = 10 - btn.backgroundColor = .blue - btn.tintColor = .blue - btn.layer.borderWidth = 1 + btn.backgroundColor = .systemBlue + btn.tintColor = .systemBlue btn.addTarget(self, action: #selector(sellbtnclicked), for: .touchUpInside) return btn }() @@ -151,13 +152,14 @@ class ReSellChartViewController : UIViewController { config.titleAlignment = .center if let markerDate = self.markertime { var titleAttribute = AttributeContainer() - titleAttribute.font = .systemFont(ofSize: 10, weight: .medium) + titleAttribute.font = UIFont(name: "NanumSquareB", size: 10.0) config.attributedTitle = AttributedString(markerDate, attributes: titleAttribute) config.titlePadding = 3.0 } var subtitleAttribute = AttributeContainer() - subtitleAttribute.font = .systemFont(ofSize: 15, weight: .bold) + subtitleAttribute.font = UIFont(name: "NanumSquareEB", size: 15.0) config.attributedSubtitle = AttributedString("판매", attributes: subtitleAttribute) + self.sellButton.configuration = config self.sellButton.backgroundColor = .white } @@ -166,60 +168,72 @@ class ReSellChartViewController : UIViewController { config.titleAlignment = .center if let markerDate = self.markertime { var titleAttribute = AttributeContainer() - titleAttribute.font = .systemFont(ofSize: 10, weight: .medium) + titleAttribute.font = UIFont(name: "NanumSquareB", size: 10.0) config.attributedTitle = AttributedString(markerDate, attributes: titleAttribute) config.titlePadding = 3.0 } var subtitleAttribute = AttributeContainer() - subtitleAttribute.font = .systemFont(ofSize: 15, weight: .bold) + subtitleAttribute.font = UIFont(name: "NanumSquareEB", size: 15.0) subtitleAttribute.backgroundColor = .white config.attributedSubtitle = AttributedString("구매", attributes: subtitleAttribute) self.sellButton.configuration = config - self.sellButton.backgroundColor = .blue + self.sellButton.backgroundColor = .systemBlue } } //MARK: - btnclickevent @objc func sellbtnclicked(){ let trademodel = StocktradeModel() - if(sellMode == true){ - trademodel.requestSellstock(assetIdx: self.idx!, category: "resell", price: self.markerprice!, transactionTime: self.markertime!, token: mytoken!){ - data in - if(data.header.resultCode == 4009){ - let alertv = UIAlertController(title: "Error", message: "판매하려는 시기 이후에 구매하였습니다.", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true) - } - else if (data.header.resultCode == 4006){ - let alertv = UIAlertController(title: "Error", message: "이미 판매를 한 상품입니다.", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true) - } - else{ - let alertv = UIAlertController(title: "판매완료", message: "판매가 완료되었습니다", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true){ - self.getTradeLists() - self.tableView.reloadData() - } - }} - }else{ - //구매하기 - trademodel.requestBuystock(assetIdx: self.idx!, category: "resell", price: self.markerprice!, transactionTime: self.markertime!, token: mytoken!) { - data in - if(data.header.resultCode == 4005){ - let alertv = UIAlertController(title: "Error", message: "이미 구매를 한 상품입니다.", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true) - } - else if(data.header.resultCode == 1000){ - let alertv = UIAlertController(title: "구매완료 ", message: "구매가 완료되었습니다", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true) - self.getTradeLists() - self.tableView.reloadData() - } - } - } + if let markertime = self.markertime { + if(sellMode == true){ + trademodel.requestSellstock(assetIdx: self.idx!, category: "resell", price: self.markerprice!, transactionTime: markertime, token: mytoken!){ + data in + if(data.header.resultCode == 4009){ + let alertv = UIAlertController(title: "Error", message: "판매하려는 시기 이후에 구매하였습니다.", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + } + else if (data.header.resultCode == 4006){ + let alertv = UIAlertController(title: "Error", message: "이미 판매를 한 상품입니다.", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + } + else if(data.header.resultCode == 1000){ + let alertv = UIAlertController(title: "판매완료", message: "판매가 완료되었습니다", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true){ + self.getTradeLists() + self.tableView.reloadData() + } + } + else{ + let alertv = UIAlertController(title: "Error", message: "Error.", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + }} + }else{ + //구매하기 + trademodel.requestBuystock(assetIdx: self.idx!, category: "resell", price: self.markerprice!, transactionTime: markertime, token: mytoken!) { + data in + if(data.header.resultCode == 4005){ + let alertv = UIAlertController(title: "Error", message: "이미 구매를 한 상품입니다.", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + } + else if(data.header.resultCode == 1000){ + let alertv = UIAlertController(title: "구매완료 ", message: "구매가 완료되었습니다", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + self.getTradeLists() + self.tableView.reloadData() + } + else if(data.header.resultCode == 4208){ + let alertv = UIAlertController(title: "구매실패", message: "동일 자산을 2번 이상 구매하였습니다.", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + } + } + } + } } //MARK: - TableView private lazy var tableView: UITableView = { @@ -229,6 +243,8 @@ class ReSellChartViewController : UIViewController { }() + + //MARK: - LifeCycle override func viewDidLoad() { super.viewDidLoad() @@ -275,6 +291,15 @@ class ReSellChartViewController : UIViewController { self.tradeListData = data.body! //현재 가지고 있는 경우 if(data.body!.last?.sellCheck == 0){ + + let subData = Double( self.priceListDatas.last! - data.body!.last!.price ) / Double(data.body!.last!.price) * 100 + if subData > 0 { + self.revenueLabel.textColor = .systemBlue + } + else { + self.revenueLabel.textColor = .systemRed + } + self.revenueLabel.text = "구매시점에 비해서 \(String(format: "%.2f", Double(( self.priceListDatas.last! - data.body!.last!.price )) / Double(data.body!.last!.price) * 100))% " self.sellMode = true }else{ @@ -288,8 +313,8 @@ class ReSellChartViewController : UIViewController { @objc func indexChanged(_ sender: UISegmentedControl){ switch sender.selectedSegmentIndex{ case 0: - changeDate.text = "일주일 대비" - let monthagoday = Calendar.current.date(byAdding: .day, value: -7, to: todayDate)! + changeDate.text = "세달 대비" + let monthagoday = Calendar.current.date(byAdding: .day, value: -90, to: todayDate)! let monthagodate = dateFormatter.string(from: monthagoday) // 만약 첫 거래가 7일 최근인경우 if(timeListDatas[0] > monthagodate ) { @@ -310,16 +335,16 @@ class ReSellChartViewController : UIViewController { self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: temppriceListDatas), xAxis: temptimeListDatas, recentPrice : Double(temppriceListDatas.last!)) pricePercent.text = "\(String(format: "%.2f", Double((temppriceListDatas.last! - temppriceListDatas[0])) / Double(temppriceListDatas[0]) * 100))%" if(pricePercent.text?.prefix(1) == "-"){ - pricePercent.textColor = UIColor.blue + pricePercent.textColor = UIColor.systemBlue } else{ - pricePercent.textColor = UIColor.red + pricePercent.textColor = UIColor.systemRed } tableView.reloadData() } case 1: - changeDate.text = "한달 대비" - let yearagoday = Calendar.current.date(byAdding: .day, value: -30, to: todayDate)! + changeDate.text = "반년 대비" + let yearagoday = Calendar.current.date(byAdding: .day, value: -180, to: todayDate)! let yearagodate = dateFormatter.string(from: yearagoday) // 만약 첫 거래가1년보다 최근인경우 let firstTradeDate = timeListDatas[0] @@ -358,10 +383,10 @@ class ReSellChartViewController : UIViewController { self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: temppriceListDatas), xAxis: temptimeListDatas, recentPrice : Double(temppriceListDatas.last!)) pricePercent.text = "\(String(format: "%.2f", Double((temppriceListDatas.last! - temppriceListDatas[0])) / Double(temppriceListDatas[0]) * 100))%" if(pricePercent.text?.prefix(1) == "-"){ - pricePercent.textColor = UIColor.blue + pricePercent.textColor = UIColor.systemBlue } else{ - pricePercent.textColor = UIColor.red + pricePercent.textColor = UIColor.systemRed } tableView.reloadData() } @@ -407,10 +432,10 @@ class ReSellChartViewController : UIViewController { self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: temppriceListDatas), xAxis: temptimeListDatas, recentPrice : Double(temppriceListDatas.last!)) pricePercent.text = "\(String(format: "%.2f", Double((temppriceListDatas.last! - temppriceListDatas[0])) / Double(temppriceListDatas[0]) * 100))%" if(pricePercent.text?.prefix(1) == "-"){ - pricePercent.textColor = UIColor.blue + pricePercent.textColor = UIColor.systemBlue } else{ - pricePercent.textColor = UIColor.red + pricePercent.textColor = UIColor.systemRed } tableView.reloadData() } @@ -455,10 +480,10 @@ class ReSellChartViewController : UIViewController { self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: temppriceListDatas), xAxis: temptimeListDatas, recentPrice : Double(temppriceListDatas.last!)) pricePercent.text = "\(String(format: "%.2f", Double((temppriceListDatas.last! - temppriceListDatas[0])) / Double(temppriceListDatas[0]) * 100))%" if(pricePercent.text?.prefix(1) == "-"){ - pricePercent.textColor = UIColor.blue + pricePercent.textColor = UIColor.systemBlue } else{ - pricePercent.textColor = UIColor.red + pricePercent.textColor = UIColor.systemRed } tableView.reloadData() } @@ -478,6 +503,12 @@ extension ReSellChartViewController : UITableViewDelegate, UITableViewDataSource func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let cell = tableView.dequeueReusableCell(withIdentifier: EstateDetailCell.identifier, for: indexPath) as? EstateDetailCell else { return UITableViewCell() } + + cell.date.font = UIFont(name: "NanumSquareEB", size: 13) + cell.price.font = UIFont(name: "NanumSquareEB", size: 13) + cell.buysell.font = UIFont(name: "NanumSquareEB", size: 13) + + cell.date.text = tradeListData[indexPath.row].transactionTime cell.date.textColor = .white cell.price.text = "\(tradeListData[indexPath.row].price)원" @@ -486,11 +517,12 @@ extension ReSellChartViewController : UITableViewDelegate, UITableViewDataSource if(tradeListData[indexPath.row].sellCheck == 0 ){ cell.buysell.text = "구매" + cell.buysell.textColor = .systemRed } else if(tradeListData[indexPath.row].sellCheck == 1){ cell.buysell.text = "판매" + cell.buysell.textColor = .systemBlue } - cell.buysell.textColor = .white return cell } } @@ -500,7 +532,7 @@ extension ReSellChartViewController { let lineChartdataSet = LineChartDataSet(entries: lineChartDataEntries, label: "주가") lineChartdataSet.drawValuesEnabled = false lineChartdataSet.drawCirclesEnabled = false - lineChartdataSet.colors = [.blue] + lineChartdataSet.colors = [.systemBlue] //선택했을때 라인 지워주기 lineChartdataSet.drawHorizontalHighlightIndicatorEnabled = false // lineChartdataSet.drawVerticalHighlightIndicatorEnabled = false @@ -604,7 +636,7 @@ extension ReSellChartViewController { } private func configure(){ - lineImage.backgroundColor = .label + lineImage.backgroundColor = .white self.view.addSubview(contentScrollView) self.view.addSubview(sellButton) // 스크롤뷰 세로로 diff --git a/LGHTSG/LGHTSG/Controller/StockChartViewController.swift b/LGHTSG/LGHTSG/Controller/StockChartViewController.swift index b6244e7..18809e3 100644 --- a/LGHTSG/LGHTSG/Controller/StockChartViewController.swift +++ b/LGHTSG/LGHTSG/Controller/StockChartViewController.swift @@ -10,7 +10,8 @@ import UIKit import Charts import SnapKit class StockChartViewController : UIViewController { - var stockPriceData = StockPriceModel() + + var stockPriceData = StockPriceModel() var EstatePriceData = EstatePriceModel() var nameText : String? private var mytoken = UserDefaults.standard.string(forKey: "savedToken") @@ -37,32 +38,32 @@ class StockChartViewController : UIViewController { }() private lazy var nameLabel : UILabel = { let label = UILabel() - label.font = .systemFont(ofSize: 17, weight: .semibold) + label.font = UIFont(name: "NanumSquareEB", size: 17.0) label.textColor = UIColor.white label.text = nameText return label }() private lazy var priceLabel : UILabel = { let label = UILabel() - label.font = .systemFont(ofSize: 14, weight: .medium) + label.font = UIFont(name: "NanumSquareB", size: 14.0) label.textColor = UIColor.systemGray return label }() private lazy var pricePercent : UILabel = { let label = UILabel() - label.font = .systemFont(ofSize: 12, weight: .medium) + label.font = UIFont(name: "NanumSquareEB", size: 12.0) label.text = pricePercentText if (label.text!.prefix(1) == "-"){ - label.textColor = UIColor.blue + label.textColor = UIColor.systemBlue }else{ - label.textColor = UIColor.red + label.textColor = UIColor.systemRed } return label }() private lazy var changeDate : UILabel = { let label = UILabel() - label.font = .systemFont(ofSize: 12, weight : .medium) + label.font = UIFont(name: "NanumSquareB", size: 12.0) label.textColor = UIColor.systemGray label.text = changeDateText return label @@ -71,15 +72,15 @@ class StockChartViewController : UIViewController { private lazy var dealLabel: UILabel = { let label = UILabel() label.text = "거래 이력" - label.font = UIFont.systemFont(ofSize: 12, weight: .light) + label.font = UIFont(name: "NanumSquareEB", size: 14.0) label.textColor = .white return label }() private lazy var revenueLabel: UILabel = { let label = UILabel() - label.textColor = .white - label.font = UIFont.systemFont(ofSize: 16, weight: .bold) + label.textColor = .systemBlue + label.font = UIFont(name: "NanumSquareEB", size: 16.0) return label }() @@ -98,14 +99,14 @@ class StockChartViewController : UIViewController { seg.setTitleTextAttributes( [ NSAttributedString.Key.foregroundColor: UIColor.white, - .font: UIFont.systemFont(ofSize: 14, weight: .semibold) + .font: UIFont(name: "NanumSquareEB", size: 14.0) ], for: .selected ) seg.setTitleTextAttributes( [ NSAttributedString.Key.foregroundColor: UIColor.systemGray, - .font: UIFont.systemFont(ofSize: 14, weight: .semibold) + .font: UIFont(name: "NanumSquareEB", size: 14.0) ], for: .normal ) @@ -118,11 +119,11 @@ class StockChartViewController : UIViewController { let btn = UIButton() var config = UIButton.Configuration.filled() config.attributedTitle = "원하시는 구매시점을 클릭해주세요" + config.attributedTitle?.font = UIFont(name: "NanumSquareEB", size: 14.0) btn.configuration = config btn.layer.cornerRadius = 10 - btn.backgroundColor = .blue - btn.tintColor = .blue - btn.layer.borderWidth = 1 + btn.backgroundColor = .systemBlue + btn.tintColor = .systemBlue btn.addTarget(self, action: #selector(sellbtnclicked), for: .touchUpInside) return btn @@ -134,12 +135,12 @@ class StockChartViewController : UIViewController { config.titleAlignment = .center if let markerDate = self.markerDate { var titleAttribute = AttributeContainer() - titleAttribute.font = .systemFont(ofSize: 10, weight: .medium) + titleAttribute.font = UIFont(name: "NanumSquareB", size: 10.0) config.attributedTitle = AttributedString(markerDate, attributes: titleAttribute) config.titlePadding = 3.0 } var subtitleAttribute = AttributeContainer() - subtitleAttribute.font = .systemFont(ofSize: 15, weight: .bold) + subtitleAttribute.font = UIFont(name: "NanumSquareEB", size: 15.0) config.attributedSubtitle = AttributedString("판매", attributes: subtitleAttribute) self.sellButton.configuration = config self.sellButton.backgroundColor = .white @@ -149,16 +150,16 @@ class StockChartViewController : UIViewController { config.titleAlignment = .center if let markerDate = self.markerDate { var titleAttribute = AttributeContainer() - titleAttribute.font = .systemFont(ofSize: 10, weight: .medium) + titleAttribute.font = UIFont(name: "NanumSquareB", size: 10.0) config.attributedTitle = AttributedString(markerDate, attributes: titleAttribute) config.titlePadding = 3.0 } var subtitleAttribute = AttributeContainer() - subtitleAttribute.font = .systemFont(ofSize: 15, weight: .bold) + subtitleAttribute.font = UIFont(name: "NanumSquareEB", size: 15.0) subtitleAttribute.backgroundColor = .white config.attributedSubtitle = AttributedString("구매", attributes: subtitleAttribute) self.sellButton.configuration = config - self.sellButton.backgroundColor = .blue + self.sellButton.backgroundColor = .systemBlue } } //MARK: - MarkerDatachange @@ -203,6 +204,17 @@ class StockChartViewController : UIViewController { self.tradeListData = data.body! //현재 가지고 있는 경우 if(data.body!.last?.sellCheck == 0){ + + let subData = Double( self.priceListDatas.last! - data.body!.last!.price ) / Double(data.body!.last!.price) * 100 + if subData > 0 { + self.revenueLabel.textColor = .systemBlue + } + else { + self.revenueLabel.textColor = .systemRed + } + + + self.revenueLabel.text = "구매시점에 비해서 \(String(format: "%.2f", Double(( self.priceListDatas.last! - data.body!.last!.price )) / Double(data.body!.last!.price) * 100))% " self.sellMode = true }else{ @@ -231,10 +243,10 @@ class StockChartViewController : UIViewController { temppriceListDatas = daypricedata pricePercent.text = "\(String(format: "%.2f", Double((temppriceListDatas.last! - temppriceListDatas[0])) / Double(temppriceListDatas[0]) * 100))%" if(pricePercent.text?.prefix(1) == "-"){ - pricePercent.textColor = UIColor.blue + pricePercent.textColor = UIColor.systemBlue } else{ - pricePercent.textColor = UIColor.red + pricePercent.textColor = UIColor.systemRed } tableView.reloadData() case 1: @@ -246,10 +258,10 @@ class StockChartViewController : UIViewController { temptimeListDatas = monthtimeListDatas pricePercent.text = "\(String(format: "%.2f", Double((temppriceListDatas.last! - temppriceListDatas[0])) / Double(temppriceListDatas[0]) * 100))%" if(pricePercent.text?.prefix(1) == "-"){ - pricePercent.textColor = UIColor.blue + pricePercent.textColor = UIColor.systemBlue } else{ - pricePercent.textColor = UIColor.red + pricePercent.textColor = UIColor.systemRed } tableView.reloadData() case 2: @@ -293,10 +305,10 @@ class StockChartViewController : UIViewController { self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: temppriceListDatas), xAxis: temptimeListDatas, recentPrice : Double(temppriceListDatas.last!)) pricePercent.text = "\(String(format: "%.2f", Double((temppriceListDatas.last! - temppriceListDatas[0])) / Double(temppriceListDatas[0]) * 100))%" if(pricePercent.text?.prefix(1) == "-"){ - pricePercent.textColor = UIColor.blue + pricePercent.textColor = UIColor.systemBlue } else{ - pricePercent.textColor = UIColor.red + pricePercent.textColor = UIColor.systemRed } tableView.reloadData() } @@ -326,10 +338,10 @@ class StockChartViewController : UIViewController { self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: priceListDatas), xAxis: timeListDatas, recentPrice : Double(priceListDatas.last!)) pricePercent.text = "\(String(format: "%.2f", Double((temppriceListDatas.last! - temppriceListDatas[0])) / Double(temppriceListDatas[0]) * 100))%" if(pricePercent.text?.prefix(1) == "-"){ - pricePercent.textColor = UIColor.blue + pricePercent.textColor = UIColor.systemBlue } else{ - pricePercent.textColor = UIColor.red + pricePercent.textColor = UIColor.systemRed } tableView.reloadData() } @@ -347,10 +359,10 @@ class StockChartViewController : UIViewController { self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: temppriceListDatas), xAxis: temptimeListDatas, recentPrice : Double(temppriceListDatas.last!)) pricePercent.text = "\(String(format: "%.2f", Double((temppriceListDatas.last! - temppriceListDatas[0])) / Double(temppriceListDatas[0]) * 100))%" if(pricePercent.text?.prefix(1) == "-"){ - pricePercent.textColor = UIColor.blue + pricePercent.textColor = UIColor.systemBlue } else{ - pricePercent.textColor = UIColor.red + pricePercent.textColor = UIColor.systemRed } tableView.reloadData() } @@ -360,48 +372,56 @@ class StockChartViewController : UIViewController { } //MARK: - btnclickevent @objc func sellbtnclicked(){ - let trademodel = StocktradeModel() - if(sellMode == true){ - trademodel.requestSellstock(assetIdx: self.idx!, category: "stock", price: self.markerPrice!, transactionTime: self.markerDate!, token: mytoken!){ - data in - if(data.header.resultCode == 4009){ - let alertv = UIAlertController(title: "Error", message: "판매하려는 시기 이후에 구매하였습니다.", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true) - } - else if (data.header.resultCode == 4006){ - let alertv = UIAlertController(title: "Error", message: "이미 판매를 한 상품입니다.", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true) - } - else{ - let alertv = UIAlertController(title: "판매완료", message: "판매가 완료되었습니다", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true){ - self.getTradeLists() - self.tableView.reloadData() + let trademodel = StocktradeModel() + if let markerDate = self.markerDate { + if(sellMode == true){ + trademodel.requestSellstock(assetIdx: self.idx!, category: "stock", price: self.markerPrice!, transactionTime: markerDate, token: mytoken!){ + data in + if(data.header.resultCode == 4009){ + let alertv = UIAlertController(title: "Error", message: "판매하려는 시기 이후에 구매하였습니다.", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + } + else if (data.header.resultCode == 4006){ + let alertv = UIAlertController(title: "Error", message: "이미 판매를 한 상품입니다.", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + } + else{ + let alertv = UIAlertController(title: "판매완료", message: "판매가 완료되었습니다", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true){ + self.getTradeLists() + self.tableView.reloadData() + } + }} + }else{ + //구매하기 + trademodel.requestBuystock(assetIdx: self.idx!, category: "stock", price: self.markerPrice!, transactionTime: markerDate, token: mytoken!) { + data in + if(data.header.resultCode == 4005){ + let alertv = UIAlertController(title: "Error", message: "이미 구매를 한 상품입니다.", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + } + else if(data.header.resultCode == 1000){ + let alertv = UIAlertController(title: "구매완료 ", message: "구매가 완료되었습니다", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + self.getTradeLists() + self.tableView.reloadData() + } + else if(data.header.resultCode == 4208){ + let alertv = UIAlertController(title: "구매실패", message: "동일 자산을 2번 이상 구매하였습니다.", preferredStyle: UIAlertController.Style.alert) + alertv.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(alertv, animated: true) + } } - }} - }else{ - //구매하기 - trademodel.requestBuystock(assetIdx: self.idx!, category: "stock", price: self.markerPrice!, transactionTime: self.markerDate!, token: mytoken!) { - data in - if(data.header.resultCode == 4005){ - let alertv = UIAlertController(title: "Error", message: "이미 구매를 한 상품입니다.", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true) - } - else if(data.header.resultCode == 1000){ - let alertv = UIAlertController(title: "구매완료 ", message: "구매가 완료되었습니다", preferredStyle: UIAlertController.Style.alert) - alertv.addAction(UIAlertAction(title: "OK", style: .default)) - self.present(alertv, animated: true) - self.getTradeLists() - self.tableView.reloadData() } } + } } - } extension StockChartViewController : UITableViewDelegate, UITableViewDataSource { //cell 높이조절 func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { @@ -413,6 +433,10 @@ class StockChartViewController : UIViewController { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let cell = tableView.dequeueReusableCell(withIdentifier: EstateDetailCell.identifier, for: indexPath) as? EstateDetailCell else { return UITableViewCell() } cell.selectionStyle = .none + + cell.date.font = UIFont(name: "NanumSquareEB", size: 13) + cell.price.font = UIFont(name: "NanumSquareEB", size: 13) + cell.buysell.font = UIFont(name: "NanumSquareEB", size: 13) cell.date.text = tradeListData[indexPath.row].transactionTime cell.date.textColor = .white @@ -420,11 +444,12 @@ class StockChartViewController : UIViewController { cell.price.textColor = .white if(tradeListData[indexPath.row].sellCheck == 0 ){ cell.buysell.text = "구매" + cell.buysell.textColor = .systemRed } else if(tradeListData[indexPath.row].sellCheck == 1){ cell.buysell.text = "판매" + cell.buysell.textColor = .systemBlue } - cell.buysell.textColor = .white return cell } } @@ -434,7 +459,7 @@ class StockChartViewController : UIViewController { let lineChartdataSet = LineChartDataSet(entries: lineChartDataEntries, label: "주가") lineChartdataSet.drawValuesEnabled = false lineChartdataSet.drawCirclesEnabled = false - lineChartdataSet.colors = [.blue] + lineChartdataSet.colors = [.systemBlue] //선택했을때 라인 지워주기 lineChartdataSet.drawHorizontalHighlightIndicatorEnabled = false // lineChartdataSet.drawVerticalHighlightIndicatorEnabled = false diff --git a/LGHTSG/LGHTSG/LaunchScreen.storyboard b/LGHTSG/LGHTSG/LaunchScreen.storyboard index 865e932..85ec7a8 100644 --- a/LGHTSG/LGHTSG/LaunchScreen.storyboard +++ b/LGHTSG/LGHTSG/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - - + + + - + + + + @@ -11,15 +15,36 @@ - + - + + + + + + + + + + + - + + + + + + + + + + + + diff --git a/LGHTSG/LGHTSG/View/ChartMarker.swift b/LGHTSG/LGHTSG/View/ChartMarker.swift index 4e549fc..d0ac393 100644 --- a/LGHTSG/LGHTSG/View/ChartMarker.swift +++ b/LGHTSG/LGHTSG/View/ChartMarker.swift @@ -31,7 +31,7 @@ class ChartMarker: MarkerView { // if (self.pricepercent[self.pricepercent.startIndex] == "-") { // let attributeStr = NSMutableAttributedString(string: text) // } - text = "이때 샀다면 지금\(self.pricepercent)" + text = "이때 샀다면 지금 \(self.pricepercent)" if(priceDate != pricedatelists[Int(entry.x)]){ let data = [pricedatelists[Int(entry.x)] : Int(entry.y)] NotificationCenter.default.post(name: Notification.Name("markerdata"), object: nil, userInfo: data) @@ -44,8 +44,8 @@ class ChartMarker: MarkerView { override func draw(context: CGContext, point: CGPoint) { super.draw(context: context, point: point) var drawAttributes = [NSAttributedString.Key : Any]() - drawAttributes[.font] = UIFont.systemFont(ofSize: 12) - drawAttributes[.foregroundColor] = UIColor.white + drawAttributes[.font] = UIFont(name: "NanumSquareEB", size: 12) + drawAttributes[.foregroundColor] = UIColor.systemGreen drawAttributes[.backgroundColor] = UIColor.clear self.bounds.size = ("\(text)" as NSString).size(withAttributes: drawAttributes) self.offset = CGPoint(x: -self.bounds.size.width / 2, y: self.bounds.size.height * 2) @@ -59,10 +59,10 @@ class ChartMarker: MarkerView { } drawText(text: " \(text) " as NSString, rect: CGRect(origin: CGPoint(x: point.x + offset.x, y: 0), size: self.bounds.size), withAttributes: drawAttributes) self.bounds.size = ("\(pricetext)" as NSString).size(withAttributes: drawAttributes) - drawAttributes[.font] = UIFont.systemFont(ofSize: 10) + drawAttributes[.font] = UIFont(name: "NanumSquareEB", size: 10) drawAttributes[.foregroundColor] = UIColor.lightGray drawText(text: "\(priceDate)" as NSString, rect: CGRect(origin: CGPoint(x: point.x + offset.x / 2, y: offset.y), size: self.bounds.size ), withAttributes: drawAttributes) - drawAttributes[.font] = UIFont.systemFont(ofSize: 12) + drawAttributes[.font] = UIFont(name: "NanumSquareEB", size: 12) drawAttributes[.foregroundColor] = UIColor.white drawText(text: "\(pricetext)" as NSString, rect: CGRect(origin: CGPoint(x: point.x + offset.x / 2, y: offset.y / 2 ), size: self.bounds.size ), withAttributes: drawAttributes) // let data = [priceDate : price!] diff --git a/LGHTSG/LGHTSG/View/EstateDetailCell.swift b/LGHTSG/LGHTSG/View/EstateDetailCell.swift index b485095..eebb022 100644 --- a/LGHTSG/LGHTSG/View/EstateDetailCell.swift +++ b/LGHTSG/LGHTSG/View/EstateDetailCell.swift @@ -12,21 +12,21 @@ class EstateDetailCell: UITableViewCell { lazy var date: UILabel = { let label = UILabel() - label.font = UIFont(name: "NanumSquareR", size: 14.0) + label.font = UIFont(name: "NanumSquareB", size: 14.0) label.textColor = .white return label }() lazy var price: UILabel = { let label = UILabel() - label.font = UIFont(name: "NanumSquareR", size: 14.0) + label.font = UIFont(name: "NanumSquareB", size: 14.0) label.textColor = .white return label }() lazy var buysell: UILabel = { let label = UILabel() - label.font = UIFont(name: "NanumSquareR", size: 14.0) + label.font = UIFont(name: "NanumSquareB", size: 14.0) label.textColor = .white return label }() @@ -34,8 +34,7 @@ class EstateDetailCell: UITableViewCell { override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) contentView.frame = contentView.frame.inset(by: UIEdgeInsets(top: 6, left: 6, bottom: 6, right: 6)) - self.backgroundColor = .black - + self.backgroundColor = .black self.cellSetting() } diff --git a/LGHTSG/LGHTSG/View/EstateSaleCell.swift b/LGHTSG/LGHTSG/View/EstateSaleCell.swift index 056b52c..418224f 100644 --- a/LGHTSG/LGHTSG/View/EstateSaleCell.swift +++ b/LGHTSG/LGHTSG/View/EstateSaleCell.swift @@ -19,6 +19,7 @@ class EstateSaleCell: UITableViewCell { lazy var title: UILabel = { let label = UILabel() + label.font = UIFont(name: "NanumSquareEB", size: 10.0) return label }() @@ -29,7 +30,7 @@ class EstateSaleCell: UITableViewCell { lazy var pow: UILabel = { let label = UILabel() - label.font = UIFont(name: "NanumSquareB", size: 10.0) + label.font = UIFont(name: "NanumSquareEB", size: 10.0) return label }() @@ -95,3 +96,5 @@ class EstateSaleCell: UITableViewCell { } } + + diff --git a/LGHTSG/LGHTSG/View/ExploreVC/EstateController.swift b/LGHTSG/LGHTSG/View/ExploreVC/EstateController.swift index 872bad0..3cd6f28 100644 --- a/LGHTSG/LGHTSG/View/ExploreVC/EstateController.swift +++ b/LGHTSG/LGHTSG/View/ExploreVC/EstateController.swift @@ -18,9 +18,20 @@ class EstateController: UIViewController, ChartViewDelegate, CLLocationManagerDe var estateModel = EstatePriceModel() //MARK: - SearchBar var items = [String]() - var samples = [String]() - let disposeBag = DisposeBag() + var samples = [String]() + let disposeBag = DisposeBag() + private let todayDate = Date() + var dateFormatter : DateFormatter = { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd" + return dateFormatter + }() + var temppriceListDatas = [Int]() + var temptimeListDatas = [String]() + + var estateDataLists = [EstatePriceDetailModel.EstateBody]() + private lazy var searchBar: UISearchBar = { let search = UISearchBar() search.searchTextField.font = UIFont(name: "NanumSquareB", size: 15) @@ -32,7 +43,9 @@ class EstateController: UIViewController, ChartViewDelegate, CLLocationManagerDe search.searchTextField.leftView?.tintColor = .white return search }() - var Areaname = "대전광역시+유성구+계산동" + + var Areaname = "" + func searchBarSearchButtonClicked(_ searchBar: UISearchBar) { tableView2.alpha = 1 } @@ -78,7 +91,7 @@ class EstateController: UIViewController, ChartViewDelegate, CLLocationManagerDe let lineChartdataSet = LineChartDataSet(entries: lineChartDataEntries, label: "가격") lineChartdataSet.drawValuesEnabled = false lineChartdataSet.drawCirclesEnabled = false - lineChartdataSet.colors = [.blue] + lineChartdataSet.colors = [.systemBlue] //선택했을때 라인 지워주기 lineChartdataSet.drawHorizontalHighlightIndicatorEnabled = false lineChartdataSet.highlightColor = .white @@ -125,13 +138,12 @@ class EstateController: UIViewController, ChartViewDelegate, CLLocationManagerDe } private func setLineChartView(Areaname : String) { estateModel.requestStockPrice(EstateName: Areaname, onCompleted: { (pricelists, transctiontime) in - DispatchQueue.main.async { - self.view.addSubview(self.lineChartView) + let sortedtimeLists = transctiontime.sorted{$0.compare($1, options: .numeric) == .orderedAscending} self.pricelists = pricelists self.timeLists = sortedtimeLists self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: pricelists), xAxis: sortedtimeLists, recentPrice : Double(pricelists.last!)) - }})} + })} @@ -178,12 +190,27 @@ class EstateController: UIViewController, ChartViewDelegate, CLLocationManagerDe private lazy var segmentCtrl: UISegmentedControl = { let items = ["1주", "3달", "1년", "5년"] let seg = UISegmentedControl(items: items) + seg.addTarget(self, action: #selector(indexChanged(_:)), for: .valueChanged) seg.layer.cornerRadius = 5.0 seg.backgroundColor = UIColor(named: "dropdown") - seg.tintColor = .lightGray - seg.selectedSegmentTintColor = .white seg.selectedSegmentIndex = 1 + seg.selectedSegmentTintColor = .darkGray + + seg.setTitleTextAttributes( + [ + NSAttributedString.Key.foregroundColor: UIColor.white, + .font: UIFont(name: "NanumSquareEB", size: 14.0) + ], + for: .selected + ) + seg.setTitleTextAttributes( + [ + NSAttributedString.Key.foregroundColor: UIColor.systemGray, + .font: UIFont(name: "NanumSquareEB", size: 14.0) + ], + for: .normal + ) return seg }() @@ -220,6 +247,9 @@ class EstateController: UIViewController, ChartViewDelegate, CLLocationManagerDe override func viewDidLoad() { super.viewDidLoad() + + self.view.addSubview(self.lineChartView) + mapView.touchDelegate = self searchBar.delegate = self configure() @@ -228,7 +258,7 @@ class EstateController: UIViewController, ChartViewDelegate, CLLocationManagerDe getEstateList(name: Areaname) getAreaList() input() - setLineChartView(Areaname: Areaname) + //setLineChartView(Areaname: Areaname) view.backgroundColor = .black } @@ -317,6 +347,7 @@ class EstateController: UIViewController, ChartViewDelegate, CLLocationManagerDe //MARK: - EstateList + var idxLists = [Int]() var nameLists = [String]() var rateOfChange = [Double]() var rateCalDateDiff = [String]() @@ -336,6 +367,7 @@ class EstateController: UIViewController, ChartViewDelegate, CLLocationManagerDe do { for index in 0..= yearagodate{ + // estimateDate = k + // break + // } + // } + // let firstindex = timeLists.firstIndex(of: estimateDate!)! + // temptimeListDatas = Array(timeLists.dropFirst(firstindex)) + // temppriceListDatas = Array(pricelists.dropFirst(firstindex)) + // self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: temppriceListDatas), xAxis: temptimeListDatas, recentPrice : Double(temppriceListDatas.last!)) + case 1: + let daypricedata : [Int] = pricelists.suffix(90) + let daytimeListDatas : [String] = timeLists.suffix(90) + self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: daypricedata), xAxis: daytimeListDatas, recentPrice : Double(daypricedata.last!)) + // let yearagoday = Calendar.current.date(byAdding: .day, value: -90, to: todayDate)! + // let yearagodate = dateFormatter.string(from: yearagoday) + // var estimateDate : String? + // for k in self.timeLists { + // if k >= yearagodate{ + // estimateDate = k + // break + // } + // } + // let firstindex = timeLists.firstIndex(of: estimateDate!)! + // temptimeListDatas = Array(timeLists.dropFirst(firstindex)) + // temppriceListDatas = Array(pricelists.dropFirst(firstindex)) + // self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: temppriceListDatas), xAxis: temptimeListDatas, recentPrice : Double(temppriceListDatas.last!)) + case 2: + let daypricedata : [Int] = pricelists.suffix(360) + let daytimeListDatas : [String] = timeLists.suffix(360) + self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: daypricedata), xAxis: daytimeListDatas, recentPrice : Double(daypricedata.last!)) + // let yearagoday = Calendar.current.date(byAdding: .day, value: -365, to: todayDate)! + // let yearagodate = dateFormatter.string(from: yearagoday) + // var estimateDate : String? + // for k in self.timeLists { + // if k >= yearagodate{ + // estimateDate = k + // break + // } + // } + // let firstindex = timeLists.firstIndex(of: estimateDate!)! + // temptimeListDatas = Array(timeLists.dropFirst(firstindex)) + // temppriceListDatas = Array(pricelists.dropFirst(firstindex)) + // self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: temppriceListDatas), xAxis: temptimeListDatas, recentPrice : Double(temppriceListDatas.last!)) + case 3: + let daypricedata : [Int] = pricelists.suffix(1000) + let daytimeListDatas : [String] = timeLists.suffix(1000) + self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: daypricedata), xAxis: daytimeListDatas, recentPrice : Double(daypricedata.last!)) + // let yearagoday = Calendar.current.date(byAdding: .day, value: -1200, to: todayDate)! + // let yearagodate = dateFormatter.string(from: yearagoday) + // var estimateDate : String? + // for k in self.timeLists { + // if k >= yearagodate{ + // estimateDate = k + // break + // } + // } + // let firstindex = timeLists.firstIndex(of: estimateDate!)! + // temptimeListDatas = Array(timeLists.dropFirst(firstindex)) + // temppriceListDatas = Array(pricelists.dropFirst(firstindex)) + // self.setLineData(lineChartView: self.lineChartView, lineChartDataEntries: self.entryData( yvalues: temppriceListDatas), xAxis: temptimeListDatas, recentPrice : Double(temppriceListDatas.last!)) default: break } @@ -585,9 +680,9 @@ class EstateController: UIViewController, ChartViewDelegate, CLLocationManagerDe guard let cell = tableView.dequeueReusableCell(withIdentifier: EstateSaleCell.identifier, for: indexPath) as? EstateSaleCell else { return UITableViewCell() } cell.number.font = UIFont(name: "NanumSquareB", size: 13) - cell.title.font = UIFont(name: "NanumSquareB", size: 13) + cell.title.font = UIFont(name: "NanumSquareEB", size: 13) cell.area.font = UIFont(name: "NanumSquareB", size: 13) - cell.pow.font = UIFont(name: "NanumSquareB", size: 13) + cell.pow.font = UIFont(name: "NanumSquareEB", size: 13) cell.price.font = UIFont(name: "NanumSquareB", size: 13) cell.period.font = UIFont(name: "NanumSquareB", size: 13) @@ -596,7 +691,9 @@ class EstateController: UIViewController, ChartViewDelegate, CLLocationManagerDe cell.number.textColor = .white cell.title.text = self.nameLists[indexPath.row] cell.title.textColor = .white - cell.area.text = "\(self.price[indexPath.row])원/m" + cell.area.text = String(self.price[indexPath.row].withCommas())+"원/m" + + cell.area.textColor = .gray cell.pow.text = "2" cell.pow.textColor = .gray @@ -609,6 +706,8 @@ class EstateController: UIViewController, ChartViewDelegate, CLLocationManagerDe cell.period.text = self.rateCalDateDiff[indexPath.row] cell.period.textColor = .gray + cell.selectionStyle = .none + return cell } @@ -619,18 +718,30 @@ class EstateController: UIViewController, ChartViewDelegate, CLLocationManagerDe return cell } } + + // cell row 선택 시 옵션 func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if tableView == tableView1{ + let estateChartVc = EstateChartViewController() + + estateChartVc.idx = self.idxLists[indexPath.row] + estateChartVc.nameText = self.nameLists[indexPath.row] + estateChartVc.changeDateText = "\(self.price[indexPath.row])" + estateChartVc.pricePercentText = "\(self.rateOfChange[indexPath.row])%" + + self.navigationController?.pushViewController(estateChartVc, animated: true) + } else{ - tableView2.deselectRow(at: indexPath, animated: true) print(self.items[indexPath.row]) self.searchBar.searchTextField.text = self.items[indexPath.row] geocodeget(cityName: self.searchBar.searchTextField.text!) + view.endEditing(true) tableView2.alpha = 0 + self.setLineChartView(Areaname:self.searchBar.searchTextField.text!) } } diff --git a/LGHTSG/LGHTSG/View/ExploreVC/StockView.swift b/LGHTSG/LGHTSG/View/ExploreVC/StockView.swift index b40538b..a37ff18 100644 --- a/LGHTSG/LGHTSG/View/ExploreVC/StockView.swift +++ b/LGHTSG/LGHTSG/View/ExploreVC/StockView.swift @@ -11,7 +11,7 @@ class StockView : UIViewController { var delegate : showNavigationDelegate? lazy private var segment : UISegmentedControl = { let control = UnderlineSegmentedControl(items: ["급상승", "급하락", "거래량", "시가총액"]) - control.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.darkGray, .font : UIFont.systemFont(ofSize: 16, weight: .semibold)], for: .normal) + control.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.darkGray, .font : UIFont(name: "NanumSquareEB", size: 16)], for: .normal) control.selectedSegmentIndex = 0 AssetModel.requestTableCellModel(segmentIndex: 0){ data in @@ -20,6 +20,8 @@ class StockView : UIViewController { } return control }() + + let AssetModel = TableCellModel() var stockDataLists = [asset.body]() var stockSearchLists = [asset.body]() diff --git a/LGHTSG/LGHTSG/View/ExploreVC/TopViewController.swift b/LGHTSG/LGHTSG/View/ExploreVC/TopViewController.swift index b501b47..7dbf644 100644 --- a/LGHTSG/LGHTSG/View/ExploreVC/TopViewController.swift +++ b/LGHTSG/LGHTSG/View/ExploreVC/TopViewController.swift @@ -215,9 +215,9 @@ class TopViewController: UIViewController, UITableViewDelegate, UITableViewDataS guard let cell = tableView.dequeueReusableCell(withIdentifier: TopViewCell.identifier, for: indexPath) as? TopViewCell else { return UITableViewCell() } cell.number.font = UIFont(name: "NanumSquareB", size: 15.0) - cell.title.font = UIFont(name: "NanumSquareEB", size: 15.0) + cell.title.font = UIFont(name: "NanumSquareEB", size: 14.0) cell.price.font = UIFont(name: "NanumSquareB", size: 12.0) - cell.percentage.font = UIFont(name: "NanumSquareB", size: 12.0) + cell.percentage.font = UIFont(name: "NanumSquareEB", size: 12.0) cell.period.font = UIFont(name: "NanumSquareB", size: 12.0) //let rurl = URL(string: riconList[indexPath.row]) @@ -228,8 +228,11 @@ class TopViewController: UIViewController, UITableViewDelegate, UITableViewDataS cell.number.text = String(indexPath.row + 1) cell.iconImage.kf.setImage(with: URL(string: AreaDataLists[indexPath.row].iconImage)) cell.title.text = AreaDataLists[indexPath.row].name - cell.price.text = "\(AreaDataLists[indexPath.row].price)원/m" cell.percentage.text = "\(AreaDataLists[indexPath.row].rateOfChange)%" + cell.price.text = String(AreaDataLists[indexPath.row].price.withCommas())+"원/m2" + + + if AreaDataLists[indexPath.row].rateOfChange > 0 { cell.percentage.textColor = .systemRed }else{ @@ -243,8 +246,12 @@ class TopViewController: UIViewController, UITableViewDelegate, UITableViewDataS cell.number.text = String(indexPath.row + 1) cell.iconImage.kf.setImage(with: URL(string: stockDataLists[indexPath.row].iconImage)) cell.title.text = stockDataLists[indexPath.row].name - cell.price.text = "\(stockDataLists[indexPath.row].price)원" cell.percentage.text = "\(stockDataLists[indexPath.row].rateOfChange)%" + cell.price.text = String(stockDataLists[indexPath.row].price.withCommas())+"원" + + + + if stockDataLists[indexPath.row].rateOfChange > 0 { cell.percentage.textColor = .systemRed }else{ @@ -259,8 +266,11 @@ class TopViewController: UIViewController, UITableViewDelegate, UITableViewDataS cell.number.text = String(indexPath.row + 1) cell.iconImage.kf.setImage(with: URL(string: resellDataLists[indexPath.row].imageUrl)) cell.title.text = resellDataLists[indexPath.row].name - cell.price.text = "\(resellDataLists[indexPath.row].price)원" cell.percentage.text = "\(resellDataLists[indexPath.row].rateOfChange)%" + cell.price.text = String(resellDataLists[indexPath.row].price.withCommas())+"원" + + + if resellDataLists[indexPath.row].rateOfChange > 0 { cell.percentage.textColor = .systemRed }else{ diff --git a/LGHTSG/LGHTSG/View/ExploreVC/TopViewDetailController.swift b/LGHTSG/LGHTSG/View/ExploreVC/TopViewDetailController.swift index 292730d..0615f87 100644 --- a/LGHTSG/LGHTSG/View/ExploreVC/TopViewDetailController.swift +++ b/LGHTSG/LGHTSG/View/ExploreVC/TopViewDetailController.swift @@ -83,7 +83,17 @@ class TopViewDetailController: UIViewController, UITableViewDelegate, UITableVie stockChartVC.idx = stockDataLists[indexPath.row].idx self.navigationController?.pushViewController(stockChartVC, animated: true) } - else if label.text! == "#어제 급등한 리셀"{} + else if label.text! == "#어제 급등한 리셀"{ + + let resellchartVC = ReSellChartViewController() + resellchartVC.nameText = resellDataLists[indexPath.row].name + resellchartVC.changeDateText = resellDataLists[indexPath.row].rateCalDateDiff + resellchartVC.pricePercentText = "\(resellDataLists[indexPath.row].rateOfChange)%" + resellchartVC.idx = resellDataLists[indexPath.row].idx + resellchartVC.imageURL = resellDataLists[indexPath.row].imageUrl + self.navigationController?.pushViewController(resellchartVC, animated: true) + + } } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { @@ -91,13 +101,13 @@ class TopViewDetailController: UIViewController, UITableViewDelegate, UITableVie cell.number.font = UIFont(name: "NanumSquareB", size: 15.0) cell.title.font = UIFont(name: "NanumSquareEB", size: 15.0) cell.price.font = UIFont(name: "NanumSquareB", size: 12.0) - cell.percentage.font = UIFont(name: "NanumSquareB", size: 12.0) + cell.percentage.font = UIFont(name: "NanumSquareEB", size: 12.0) cell.period.font = UIFont(name: "NanumSquareB", size: 12.0) if label.text! == "#강남구 집값 Top 10"{ cell.number.text = String(indexPath.row + 1) cell.iconImage.kf.setImage(with: URL(string: estateDataLists[indexPath.row].iconImage)) cell.title.text = self.estateDataLists[indexPath.row].name - cell.price.text = "\(self.estateDataLists[indexPath.row].price)원/m" + cell.price.text = "\(self.estateDataLists[indexPath.row].price.withCommas())원/m2" cell.percentage.text = "\(self.estateDataLists[indexPath.row].rateOfChange)%" if estateDataLists[indexPath.row].rateOfChange > 0 { cell.percentage.textColor = .systemRed @@ -112,7 +122,7 @@ class TopViewDetailController: UIViewController, UITableViewDelegate, UITableVie cell.number.text = String(indexPath.row + 1) cell.iconImage.kf.setImage(with: URL(string: stockDataLists[indexPath.row].iconImage)) cell.title.text = self.stockDataLists[indexPath.row].name - cell.price.text = "\(self.stockDataLists[indexPath.row].price)원" + cell.price.text = "\(self.stockDataLists[indexPath.row].price.withCommas())원" cell.percentage.text = "\(self.stockDataLists[indexPath.row].rateOfChange)%" if stockDataLists[indexPath.row].rateOfChange > 0 { cell.percentage.textColor = .systemRed @@ -127,7 +137,7 @@ class TopViewDetailController: UIViewController, UITableViewDelegate, UITableVie cell.number.text = String(indexPath.row + 1) cell.iconImage.kf.setImage(with: URL(string: resellDataLists[indexPath.row].imageUrl)) cell.title.text = self.resellDataLists[indexPath.row].name - cell.price.text = "\(self.resellDataLists[indexPath.row].price)원/m" + cell.price.text = "\(self.resellDataLists[indexPath.row].price.withCommas())원" cell.percentage.text = "\(self.resellDataLists[indexPath.row].rateOfChange)%" if resellDataLists[indexPath.row].rateOfChange > 0 { cell.percentage.textColor = .systemRed diff --git a/LGHTSG/LGHTSG/View/ExploreVC/resellView.swift b/LGHTSG/LGHTSG/View/ExploreVC/resellView.swift index 9b2cfe3..755c2f4 100644 --- a/LGHTSG/LGHTSG/View/ExploreVC/resellView.swift +++ b/LGHTSG/LGHTSG/View/ExploreVC/resellView.swift @@ -20,7 +20,7 @@ class resellView : UIViewController{ var resellSearchLists = [resellData.body]() lazy private var segment : UISegmentedControl = { let control = UnderlineSegmentedControl(items: ["급상승", "급하락"]) - control.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.darkGray, .font : UIFont.systemFont(ofSize: 16, weight: .semibold)], for: .normal) + control.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.darkGray, .font : UIFont(name: "NanumSquareEB", size: 16)], for: .normal) control.selectedSegmentIndex = 0 AssetModel.requestResellModel(segmentIndex: 0){ data in @@ -44,6 +44,7 @@ class resellView : UIViewController{ resellTableView.delegate = self segment.addTarget(self, action: #selector(clickSegment), for: .valueChanged) } + //segment이벤트 받아서 급상승, 급하락, 거래량 @objc func clickSegment(_ sender : UISegmentedControl){ switch sender.selectedSegmentIndex { @@ -65,11 +66,12 @@ class resellView : UIViewController{ required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } + func setView() { resellTableView.register(HomeTableCell.self, forCellReuseIdentifier: "HomeTabeCell") resellTableView.separatorStyle = .none - resellTableView.backgroundColor = .black + self.view.addSubview(segment) segment.snp.makeConstraints{ $0.leading.top.equalToSuperview() @@ -90,17 +92,22 @@ extension resellView : UITableViewDataSource , UITableViewDelegate, UIScrollView }else{ return resellDataLists.count }} func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + guard let cell = tableView.dequeueReusableCell(withIdentifier: "HomeTabeCell", for: indexPath) as? HomeTableCell else {return UITableViewCell()} + if(ExploreViewController.isSearching){ cell.setup(with: resellSearchLists[indexPath.row]) }else{ cell.setup(with: resellDataLists[indexPath.row])} + + cell.countLabel.text = "\(indexPath.row+1)" cell.selectionStyle = .none return cell } + func scrollViewDidScroll(_ scrollView: UIScrollView) { if resellTableView.contentOffset.y < 0 { delegate?.showSearchBar() @@ -109,24 +116,24 @@ extension resellView : UITableViewDataSource , UITableViewDelegate, UIScrollView delegate?.hideSearchBar() } } + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let ChartVc = ReSellChartViewController() - if(ExploreViewController.isSearching){ ChartVc.nameText = resellSearchLists[indexPath.row].name ChartVc.changeDateText = resellSearchLists[indexPath.row].rateCalDateDiff ChartVc.pricePercentText = "\(resellSearchLists[indexPath.row].rateOfChange)%" - ChartVc.PriceText = "\(String(resellSearchLists[indexPath.row].price))원" + ChartVc.PriceText = "\(String(resellSearchLists[indexPath.row].price.withCommas()))원" ChartVc.idx = resellSearchLists[indexPath.row].idx ChartVc.imageURL = resellSearchLists[indexPath.row].imageUrl - + }else{ ChartVc.nameText = resellDataLists[indexPath.row].name ChartVc.changeDateText = resellDataLists[indexPath.row].rateCalDateDiff ChartVc.pricePercentText = "\(resellDataLists[indexPath.row].rateOfChange)%" - ChartVc.PriceText = "\(String(resellDataLists[indexPath.row].price))원" + ChartVc.PriceText = "\(String(resellDataLists[indexPath.row].price.withCommas()))원" ChartVc.idx = resellDataLists[indexPath.row].idx ChartVc.imageURL = resellDataLists[indexPath.row].imageUrl } diff --git a/LGHTSG/LGHTSG/View/FindPwView.swift b/LGHTSG/LGHTSG/View/FindPwView.swift index 26e7b5e..4ecfcf1 100644 --- a/LGHTSG/LGHTSG/View/FindPwView.swift +++ b/LGHTSG/LGHTSG/View/FindPwView.swift @@ -554,13 +554,14 @@ class FindPwView: UIView { // MARK: 비밀번호 변경 버튼 self.nextBtnImageView2.snp.makeConstraints{ - $0.bottom.equalToSuperview().offset(-50) + + $0.top.equalTo(pwCheckImageView.snp.bottom).offset(30) $0.left.equalToSuperview().offset(20) $0.right.equalToSuperview().offset(-20) } self.pwChangeBtn.snp.makeConstraints{ - $0.top.equalTo(nextBtnImageView2).offset(10) + $0.top.equalTo(pwCheckImageView.snp.bottom).offset(10) $0.left.equalToSuperview().offset(20) $0.right.equalToSuperview().offset(-20) } diff --git a/LGHTSG/LGHTSG/View/HomeVC/HomeTableCell.swift b/LGHTSG/LGHTSG/View/HomeVC/HomeTableCell.swift index 727db1e..d524057 100644 --- a/LGHTSG/LGHTSG/View/HomeVC/HomeTableCell.swift +++ b/LGHTSG/LGHTSG/View/HomeVC/HomeTableCell.swift @@ -4,11 +4,12 @@ // // Created by SunHo Lee on 2023/01/14. // - +import MarqueeLabel import Foundation import UIKit import SnapKit import Kingfisher + class HomeTableCell : UITableViewCell { var countLabel : UILabel = { let label = UILabel() @@ -19,7 +20,7 @@ class HomeTableCell : UITableViewCell { private lazy var nameLabel : UILabel = { let label = UILabel() - label.font = UIFont(name: "NanumSquareB", size: 14.0) + label.font = UIFont(name: "NanumSquareEB", size: 14.0) label.textColor = .white return label }() @@ -57,23 +58,17 @@ extension HomeTableCell { addSubview($0) } - nameLabel.font = UIFont(name: "NanumSquareB", size: 13) - priceLabel.font = UIFont(name: "NanumSquareB", size: 13) - changeDate.font = UIFont(name: "NanumSquareB", size: 13) - pricePercent.font = UIFont(name: "NanumSquareB", size: 13) - - nameLabel.text = assetinfo.name - priceLabel.text = String(assetinfo.price)+"원" + priceLabel.text = String(assetinfo.price.withCommas())+"원" changeDate.text = assetinfo.rateCalDateDiff let stringofratechange = String(assetinfo.rateOfChange) if(stringofratechange[stringofratechange.startIndex] == "-"){ pricePercent.text = "\(stringofratechange)%" - pricePercent.textColor = .blue + pricePercent.textColor = .systemBlue }else { pricePercent.text = "+\(stringofratechange)%" - pricePercent.textColor = .red + pricePercent.textColor = .systemRed } let url = URL(string: assetinfo.iconImage) iconimage.clipsToBounds = true @@ -105,7 +100,7 @@ extension HomeTableCell { $0.top.equalTo(priceLabel.snp.top) } pricePercent.snp.makeConstraints{ - $0.leading.equalTo(priceLabel.snp.trailing).offset(15) + $0.leading.equalTo(priceLabel.snp.trailing).offset(8) $0.top.equalTo(priceLabel.snp.top) } } @@ -118,23 +113,19 @@ extension HomeTableCell { } - - nameLabel.font = UIFont(name: "NanumSquareB", size: 13) - priceLabel.font = UIFont(name: "NanumSquareB", size: 13) - changeDate.font = UIFont(name: "NanumSquareB", size: 13) - pricePercent.font = UIFont(name: "NanumSquareB", size: 13) + nameLabel.text = resellinfo.name - priceLabel.text = String(resellinfo.price)+"원" + priceLabel.text = String(resellinfo.price.withCommas())+"원" changeDate.text = resellinfo.rateCalDateDiff let stringofratechange = String( resellinfo.rateOfChange) if(stringofratechange[stringofratechange.startIndex] == "-"){ pricePercent.text = "\(stringofratechange)%" - pricePercent.textColor = .blue + pricePercent.textColor = .systemBlue }else { pricePercent.text = "+\(stringofratechange)%" - pricePercent.textColor = .red + pricePercent.textColor = .systemRed } let url = URL(string: resellinfo.imageUrl) @@ -171,7 +162,7 @@ extension HomeTableCell { $0.top.equalTo(priceLabel.snp.top) } pricePercent.snp.makeConstraints{ - $0.trailing.equalTo(changeDate.snp.leading).offset(-15) + $0.leading.equalTo(priceLabel.snp.trailing).offset(8) $0.top.equalTo(priceLabel.snp.top) } } @@ -180,17 +171,17 @@ extension HomeTableCell { addSubview($0) } nameLabel.text = home.assetName - priceLabel.text = String(home.price)+"원" + priceLabel.text = String(home.price.withCommas())+"원" changeDate.text = home.rateCalDateDiff pricePercent.text = String(home.rateOfChange) let url = URL(string: home.iconImage) let stringofratechange = String(home.rateOfChange) if(stringofratechange[stringofratechange.startIndex] == "-"){ pricePercent.text = "\(stringofratechange)%" - pricePercent.textColor = .blue + pricePercent.textColor = .systemBlue }else { pricePercent.text = "+\(stringofratechange)%" - pricePercent.textColor = .red + pricePercent.textColor = .systemRed } // kf 이미지 둥그렇 iconimage.clipsToBounds = true @@ -213,17 +204,24 @@ extension HomeTableCell { $0.top.equalToSuperview() } priceLabel.snp.makeConstraints{ - $0.leading.equalTo(nameLabel.snp.leading) $0.top.equalTo(nameLabel.snp.bottom).offset(5) + $0.leading.equalTo(nameLabel.snp.leading) } changeDate.snp.makeConstraints{ - $0.trailing.equalToSuperview().inset(40) + $0.trailing.equalToSuperview().inset(20) $0.top.equalTo(pricePercent.snp.top) } pricePercent.snp.makeConstraints{ - $0.trailing.equalTo(changeDate.snp.leading).offset(-15) + $0.leading.equalTo(priceLabel.snp.trailing).offset(8) $0.top.equalTo(priceLabel.snp.top) } } } +extension Int { + func withCommas() -> String { + let numberFormatter = NumberFormatter() + numberFormatter.numberStyle = .decimal + return numberFormatter.string(from: NSNumber(value:self))! + } +} diff --git a/LGHTSG/LGHTSG/View/HomeVC/StockDateSegmentControl.swift b/LGHTSG/LGHTSG/View/HomeVC/StockDateSegmentControl.swift index 2b6316c..44720b7 100644 --- a/LGHTSG/LGHTSG/View/HomeVC/StockDateSegmentControl.swift +++ b/LGHTSG/LGHTSG/View/HomeVC/StockDateSegmentControl.swift @@ -4,26 +4,27 @@ // // Created by SunHo Lee on 2023/01/19. // +//b import Foundation import UIKit final class StockDateSegmentControl : UnderlineSegmentedControl{ - + override func removeBackgroundAndDivider() { super.removeBackgroundAndDivider() self.backgroundColor = .darkGray self.setTitleTextAttributes( [ NSAttributedString.Key.foregroundColor: UIColor.lightGray, - .font: UIFont.systemFont(ofSize: 16, weight: .semibold) + .font: UIFont(name: "NanumSquareEB", size: 14.0) ], for: .normal ) self.setTitleTextAttributes( [ - NSAttributedString.Key.foregroundColor: UIColor.tintColor, - .font: UIFont.systemFont(ofSize: 16, weight: .semibold) + NSAttributedString.Key.foregroundColor: UIColor.white, + .font: UIFont(name: "NanumSquareEB", size: 14.0) ], for: .selected ) diff --git a/LGHTSG/LGHTSG/View/HomeVC/UnderlineSegmentedControl.swift b/LGHTSG/LGHTSG/View/HomeVC/UnderlineSegmentedControl.swift index 3fcc578..1ea6ecb 100644 --- a/LGHTSG/LGHTSG/View/HomeVC/UnderlineSegmentedControl.swift +++ b/LGHTSG/LGHTSG/View/HomeVC/UnderlineSegmentedControl.swift @@ -11,16 +11,19 @@ class UnderlineSegmentedControl: UISegmentedControl { super.init(frame: frame) self.removeBackgroundAndDivider() } + + + override init(items: [Any]?) { super.init(items: items) self.removeBackgroundAndDivider() self.selectedSegmentIndex = 0 - self.setTitleTextAttributes([NSAttributedString.Key.font : UIFont.systemFont(ofSize: 16, weight: .semibold)], for: .normal) - self.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.white, .font : UIFont.systemFont(ofSize: 16, weight: .semibold)], for: .normal) + self.setTitleTextAttributes([NSAttributedString.Key.font : UIFont(name: "NanumSquareB", size: 16.0)], for: .normal) + self.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.white, .font : UIFont(name: "NanumSquareB", size: 16.0)], for: .normal) self.setTitleTextAttributes( [ NSAttributedString.Key.foregroundColor: UIColor.white, - .font: UIFont.systemFont(ofSize: 16, weight: .bold) + .font: UIFont(name: "NanumSquareB", size: 16.0) ], for: .selected ) diff --git a/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckAgreeView.swift b/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckAgreeView.swift index 977c7c2..f11ac1e 100644 --- a/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckAgreeView.swift +++ b/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckAgreeView.swift @@ -350,12 +350,12 @@ class CheckAgreeView: UIView { // MARK: 모두 동의하기 self.checkBox.snp.makeConstraints{ - $0.top.equalTo(agreeLabel.snp.bottom).offset(50) + $0.top.equalTo(agreeLabel.snp.bottom).offset(30) $0.left.equalToSuperview().offset(20) } self.allAgreeLabel.snp.makeConstraints{ - $0.top.equalTo(agreeLabel.snp.bottom).offset(55) + $0.top.equalTo(agreeLabel.snp.bottom).offset(35) $0.left.equalTo(checkBox.snp.right).offset(20) } @@ -416,14 +416,14 @@ class CheckAgreeView: UIView { // MARK: 다음으로 버튼 self.nextBtnImageView2.snp.makeConstraints{ - $0.bottom.equalToSuperview().offset(-10) + $0.bottom.equalToSuperview().offset(-50) $0.left.equalToSuperview().offset(20) $0.right.equalToSuperview().offset(-20) } self.nextBtn2.snp.makeConstraints{ - $0.top.equalTo(nextBtnImageView2).offset(10) + $0.top.equalTo(nextBtnImageView2.snp.top).offset(10) $0.left.equalToSuperview().offset(20) $0.right.equalToSuperview().offset(-20) diff --git a/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckPageMarketingView.swift b/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckPageMarketingView.swift index 2b5c754..282ac68 100644 --- a/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckPageMarketingView.swift +++ b/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckPageMarketingView.swift @@ -77,13 +77,13 @@ class CheckPageMarketingView: UIView { } self.nextBtnImageView5.snp.makeConstraints{ - $0.bottom.equalToSuperview().offset(-10) + $0.bottom.equalToSuperview().offset(-50) $0.left.equalToSuperview().offset(20) $0.right.equalToSuperview().offset(-20) } self.nextLabel5.snp.makeConstraints{ - $0.top.equalTo(nextBtnImageView5).offset(10) + $0.top.equalTo(nextBtnImageView5.snp.top).offset(10) $0.left.equalToSuperview().offset(20) $0.right.equalToSuperview().offset(-20) diff --git a/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckPagePrivacyView.swift b/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckPagePrivacyView.swift index d4fa957..6437b51 100644 --- a/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckPagePrivacyView.swift +++ b/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckPagePrivacyView.swift @@ -41,12 +41,43 @@ class CheckPagePrivacyView: UIView { return view }() + let contentScrollView : UIScrollView = { + let scrollView = UIScrollView() + scrollView.translatesAutoresizingMaskIntoConstraints = false + scrollView.backgroundColor = .clear + scrollView.showsVerticalScrollIndicator = true + return scrollView + }() + + func addSubview() { + + addSubview(textboxImageView3) + textboxImageView3.addSubview(contentScrollView) + contentScrollView.addSubview(textContentLabel2) + + NSLayoutConstraint.activate([ + contentScrollView.topAnchor.constraint(equalTo: textboxImageView3.topAnchor), + contentScrollView.leadingAnchor.constraint(equalTo: textboxImageView3.leadingAnchor, constant: 10), + contentScrollView.trailingAnchor.constraint(equalTo: textboxImageView3.trailingAnchor,constant: -10), + contentScrollView.heightAnchor.constraint(equalTo: textboxImageView3.heightAnchor, constant: 1000) + ]) + + + NSLayoutConstraint.activate([ + textContentLabel2.topAnchor.constraint(equalTo: contentScrollView.topAnchor, constant: 10), + textContentLabel2.leadingAnchor.constraint(equalTo: contentScrollView.leadingAnchor), + textContentLabel2.trailingAnchor.constraint(equalTo: contentScrollView.trailingAnchor), + textContentLabel2.bottomAnchor.constraint(equalTo: textboxImageView3.bottomAnchor) + ]) + } + + let textContentLabel2 : UILabel = { let label = UILabel() - label.text = "< 라고할때살걸 >('https://api.lghtsg.site'이하 '라고할때살걸')은(는) 「개인정보 보호법」 제30조에 따라 정보주체의 개인정보를 보호하고 이와 관련한 고충을 신속하고 원활하게 처리할 수 있도록 하기 위하여 다음과 같이 개인정보 처리방침을 수립·공개합니다\n\n제1조(개인정보의 처리목적)\n< 라고할때살걸 >(이)가 개인정보 보호법 제32조에 따라 등록․공개하는 개인정보파일의 처리목적은 다음과 같습니다.\n\n1. 개인정보 파일명 : 라고할때살걸 사용자 정보\n개인정보의 처리목적 : 서비스 기능 제공을 위한 사용자 구분\n수집방법 : 앱\n보유근거 : 서비스 기능 제공을 위한 사용자 구분\n보유기간 : 1년\n관련법령 : 신용정보의 수집/처리 및 이용 등에 관한 기록 : 3년\n\n\n제2조(처리하는 개인정보의 항목)\n\n① < 라고할때살걸 >은(는) 다음의 개인정보 항목을 처리하고 있습니다.\n\n1< 라고할때살걸 사용자 정보 >\n필수항목 : 이메일, 비밀번호, 로그인ID, 이름, 서비스 이용 기록, 쿠키\n선택항목 :\n 1. 개인정보분쟁조정위원회 : (국번없이) 1833-6972 (www.kopico.go.kr)\n" + label.text = "< 라고할때살걸 >('https://api.lghtsg.site'이하 '라고할때살걸')은(는) 「개인정보 보호법」 제30조에 따라 정보주체의 개인정보를 보호하고 이와 관련한 고충을 신속하고 원활하게 처리할 수 있도록 하기 위하여 다음과 같이 개인정보 처리방침을 수립·공개합니다\n\n제1조(개인정보의 처리목적)\n< 라고할때살걸 >(이)가 개인정보 보호법 제32조에 따라 등록․공개하는 개인정보파일의 처리목적은 다음과 같습니다.\n\n1. 개인정보 파일명 : 라고할때살걸 사용자 정보\n개인정보의 처리목적 : 서비스 기능 제공을 위한 사용자 구분\n수집방법 : 앱\n보유근거 : 서비스 기능 제공을 위한 사용자 구분\n보유기간 : 1년\n관련법령 : 신용정보의 수집/처리 및 이용 등에 관한 기록 : 3년\n\n\n제2조(처리하는 개인정보의 항목)\n\n① < 라고할때살걸 >은(는) 다음의 개인정보 항목을 처리하고 있습니다.\n\n1< 라고할때살걸 사용자 정보 >\n필수항목 : 이메일, 비밀번호, 로그인ID, 이름, 서비스 이용 기록, 쿠키\n선택항목 :\n 1. 개인정보분쟁조정위원회 : (국번없이) 1833-6972 (www.kopico.go.kr)\n안녕 스크롤뷰가 되는지 보러왔어어ㅓ엉어어어사용자 정보\n개인정보의 처리목적 : 서비스 기능 제공을 위한 사용자 구분\n수집방법 : 앱\n보유근거 : 서비스 기능 제공을 위한 사용자 구분\n보유기간 : 1년\n관련법령 : 신용정보의 수집/처리 및 이용 등에 관한 기록 : 3년\n\n\n제2조(처리하는 개인정보의 항목)\n\n① < 라고할때살걸 >은(는) 다음의 개인정보 항목을 처리하고 있습니다.\n\n1< 라고할때살걸 사용자 정보 >\n필수항목 : 이메일, 비밀번호, 로그인ID, 이름, 서비스 이용 기록, 쿠키\n선택항목 :\n 1. 개인정보분쟁조정위원회 : (국번없이) 1833-6972 (www.kopico.go.kr)\n안녕 스크롤뷰가 되는지 보러왔어어ㅓ엉어어어앱\n보유근거 : 서비스 기능 제공을 위한 사용자 구분\n보유기간 : 1년\n관련법령 : 신용정보의 수집/처리 및 이용 등에 관한 기록 : 3년\n\n\n제2조(처리하는 개인정보의 항목)\n\n① < 라고할때살걸 >은(는) 다음의 개인정보 항목을 처리하고 있습니다.\n\n1< 라고할때살걸 사용자 정보 >\n필수항목 : 이메일, 비밀번호, 로그인ID, 이름, 서비스 이용 기록, 쿠키\n선택항목 :\n 앱\n보유근거 : 서비스 기능 제공을 위한 사용자 구분\n보유기간 : 1년\n관련법령 : 신용정보의 수집/처리 및 이용 등에 관한 기록 : 3년\n\n\n제2조(처리하는 개인정보의 항목)\n\n① < 라고할때살걸 >은(는) 다음의 개인정보 항목을 처리하고 있습니다.\n\n1< 라고할때살걸 사용자 정보 >\n필수항목 : 이메일, 비밀번호, 로그인ID, 이름, 서비스 이용 기록, 쿠키\n선택항목 :\n 앱\n보유근거 : 서비스 기능 제공을 위한 사용자 구분\n보유기간 : 1년\n관련법령 : 신용정보의 수집/처리 및 이용 등에 관한 기록 : 3년\n\n\n제2조(처리하는 개인정보의 항목)\n\n① < 라고할때살걸 >은(는) 다음의 개인정보 항목을 처리하고 있습니다.\n\n1< 라고할때살걸 사용자 정보 >\n필수항목 : 이메일, 비밀번호, 로그인ID, 이름, 서비스 이용 기록, 쿠키\n선택항목 :\n 앱\n보유근거 : 서비스 기능 제공을 위한 사용자 구분\n보유기간 : 1년\n관련법령 : 신용정보의 수집/처리 및 이용 등에 관한 기록 : 3년\n\n\n제2조(처리하는 개인정보의 항목)\n\n① < 라고할때살걸 >은(는) 다음의 개인정보 항목을 처리하고 있습니다.\n\n1< 라고할때살걸 사용자 정보 >\n필수항목 : 이메일, 비밀번호, 로그인ID, 이름, 서비스 이용 기록, 쿠키\n선택항목 :\n 앱\n보유근거 : 서비스 기능 제공을 위한 사용자 구분\n보유기간 : 1년\n관련법령 : 신용정보의 수집/처리 및 이용 등에 관한 기록 : 3년\n\n\n제2조(처리하는 개인정보의 항목)\n\n① < 라고할때살걸 >은(는) 다음의 개인정보 항목을 처리하고 있습니다.\n\n1< 라고할때살걸 사용자 정보 >\n필수항목 : 이메일, 비밀번호, 로그인ID, 이름, 서비스 이용 기록, 쿠키\n선택항목 :\n 앱\n보유근거 : 서비스 기능 제공을 위한 사용자 구분\n보유기간 : 1년\n관련법령 : 신용정보의 수집/처리 및 이용 등에 관한 기록 : 3년\n\n\n제2조(처리하는 개인정보의 항목)\n\n① < 라고할때살걸 >은(는) 다음의 개인정보 항목을 처리하고 있습니다.\n\n1< 라고할때살걸 사용자 정보 >\n필수항목 : 이메일, 비밀번호, 로그인ID, 이름, 서비스 이용 기록, 쿠키\n선택항목 :\n " label.textColor = .white label.numberOfLines = 0 - label.font = UIFont(name: "NanumSquareR", size: 13.0) + label.font = UIFont(name: "NanumSquareB", size: 10.0) label.translatesAutoresizingMaskIntoConstraints = false return label }() @@ -72,11 +103,7 @@ class CheckPagePrivacyView: UIView { override init(frame: CGRect) { super.init(frame: frame) - - addSubview(textboxImageView3) - addSubview(textContentLabel2) - - textContentLabel2.addSubview(scrollView2) + addSubview() addSubview(nextBtnImageView4) addSubview(nextLabel4) @@ -85,33 +112,38 @@ class CheckPagePrivacyView: UIView { $0.top.equalToSuperview().offset(80) $0.left.equalToSuperview().offset(20) $0.right.equalToSuperview().offset(-20) + $0.bottom.equalToSuperview().offset(-100) } - + +/* self.textContentLabel2.snp.makeConstraints{ $0.top.equalTo(textboxImageView3.snp.top).offset(20) $0.left.equalTo(textboxImageView3.snp.left).offset(20) $0.right.equalTo(textboxImageView3.snp.right).offset(-20) $0.bottom.equalTo(textboxImageView3.snp.bottom).offset(-20) } + */ self.nextBtnImageView4.snp.makeConstraints{ - $0.bottom.equalToSuperview().offset(-10) + $0.top.equalTo(textboxImageView3.snp.bottom).offset(10) + $0.bottom.equalToSuperview().offset(-50) $0.left.equalToSuperview().offset(20) $0.right.equalToSuperview().offset(-20) } self.nextLabel4.snp.makeConstraints{ - $0.top.equalTo(nextBtnImageView4).offset(10) + $0.top.equalTo(nextBtnImageView4.snp.top).offset(5) $0.left.equalToSuperview().offset(20) $0.right.equalToSuperview().offset(-20) } - + /* scrollView2.leadingAnchor.constraint(equalTo: textContentLabel2.leadingAnchor).isActive = true scrollView2.trailingAnchor.constraint(equalTo: textContentLabel2.trailingAnchor).isActive = true scrollView2.topAnchor.constraint(equalTo: textContentLabel2.bottomAnchor).isActive = true scrollView2.bottomAnchor.constraint(equalTo: textContentLabel2.bottomAnchor).isActive = true + */ } diff --git a/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckPageServiceView.swift b/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckPageServiceView.swift index 02dc539..efdda78 100644 --- a/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckPageServiceView.swift +++ b/LGHTSG/LGHTSG/View/JoinVC/CheckVc/CheckPageServiceView.swift @@ -80,13 +80,13 @@ class CheckPageServiceView: UIView { self.nextBtnImageView3.snp.makeConstraints{ - $0.bottom.equalToSuperview().offset(-10) + $0.bottom.equalToSuperview().offset(-50) $0.left.equalToSuperview().offset(20) $0.right.equalToSuperview().offset(-20) } self.nextLabel3.snp.makeConstraints{ - $0.top.equalTo(nextBtnImageView3).offset(10) + $0.top.equalTo(nextBtnImageView3.snp.top).offset(10) $0.left.equalToSuperview().offset(20) $0.right.equalToSuperview().offset(-20) diff --git a/LGHTSG/LGHTSG/View/JoinVC/RegisterView.swift b/LGHTSG/LGHTSG/View/JoinVC/RegisterView.swift index c4824d4..fa2e57b 100644 --- a/LGHTSG/LGHTSG/View/JoinVC/RegisterView.swift +++ b/LGHTSG/LGHTSG/View/JoinVC/RegisterView.swift @@ -512,13 +512,13 @@ class RegisterView : UIView { // MARK: 다음으로 버튼 self.nextBtnImageView.snp.makeConstraints{ - $0.bottom.equalToSuperview().offset(-10) + $0.bottom.equalToSuperview().offset(-50) $0.left.equalToSuperview().offset(20) $0.right.equalToSuperview().offset(-20) } self.nextBtn.snp.makeConstraints{ - $0.top.equalTo(nextBtnImageView).offset(10) + $0.top.equalTo(nextBtnImageView.snp.bottom).offset(10) $0.left.equalToSuperview().offset(20) $0.right.equalToSuperview().offset(-20) diff --git a/LGHTSG/LGHTSG/View/LoginView.swift b/LGHTSG/LGHTSG/View/LoginView.swift index eee371e..ca43146 100644 --- a/LGHTSG/LGHTSG/View/LoginView.swift +++ b/LGHTSG/LGHTSG/View/LoginView.swift @@ -102,7 +102,7 @@ class LoginView: UIViewController { let findPwBtn2: UIButton = { let btn = UIButton() - btn.setTitle("비밀번호 찾기", for: .normal) + btn.setTitle("비밀번호 변경", for: .normal) btn.setTitleColor(.white, for: .normal) btn.titleLabel?.font = UIFont(name: "NanumSquareR", size: 12.0) btn.translatesAutoresizingMaskIntoConstraints = false @@ -148,16 +148,11 @@ class LoginView: UIViewController { login.requestLoginDataModel(bodyData: bodyData){ data in -// self.jwt = data.accessToken - // print(data) - } - - /* - loginMsgCode.requestLoginDataModel(bodyData: bodyData){ - data in - print(data) + + self.jwt = data.accessToken + UserDefaults.standard.set(email, forKey: "email") + UserDefaults.standard.set(password, forKey: "email") } - */ var loginSuccess = UserDefaults.standard.bool(forKey: "loginSuccess") loginSuccess = UserDefaults.standard.bool(forKey: "loginSuccess") @@ -219,7 +214,7 @@ class LoginView: UIViewController { // MARK: 맨 위 이미지 위치 self.titleImageView2.snp.makeConstraints { - $0.top.equalToSuperview().offset(170) + $0.top.equalToSuperview().offset(150) $0.centerX.equalToSuperview() } @@ -235,7 +230,6 @@ class LoginView: UIViewController { $0.right.equalToSuperview().offset(-30) } - // MARK: 비밀번호 위치 및 배경 // 나중에 에러 메세지 위치랑 고려해서 바꿔야함 @@ -260,7 +254,7 @@ class LoginView: UIViewController { // MARK: 로그인 버튼 self.loginBtn2.snp.makeConstraints { - $0.top.equalTo(pwImageView.snp.bottom).offset(40) + $0.top.equalTo(pwImageView.snp.bottom).offset(33) $0.left.equalToSuperview().offset(30) $0.right.equalToSuperview().offset(-30) } @@ -282,18 +276,17 @@ class LoginView: UIViewController { $0.top.equalTo(loginBtn2.snp.bottom).offset(20) $0.left.equalTo(middleLabel2.snp.right).offset(20) } - - // MARK: 맨 밑 글자 위치 - self.memberInquiryLabel.snp.makeConstraints{ + self.privacyPolicyLabel.snp.makeConstraints{ $0.centerX.equalToSuperview() - $0.top.equalTo(privacyPolicyLabel.snp.bottom).offset(5) + $0.top.equalTo(findPwBtn2.snp.bottom).offset(30) + //$0.bottom.equalToSuperview().offset(-100) } - self.privacyPolicyLabel.snp.makeConstraints{ + // MARK: 맨 밑 글자 위치 + self.memberInquiryLabel.snp.makeConstraints{ $0.centerX.equalToSuperview() - $0.bottom.equalToSuperview().offset(-100) - + $0.top.equalTo(privacyPolicyLabel.snp.bottom).offset(5) } diff --git a/LGHTSG/LGHTSG/View/MyPageView.swift b/LGHTSG/LGHTSG/View/MyPageView.swift index 1c65ec2..8e8854b 100644 --- a/LGHTSG/LGHTSG/View/MyPageView.swift +++ b/LGHTSG/LGHTSG/View/MyPageView.swift @@ -27,7 +27,7 @@ class MyPageView : UIView { image.contentMode = .scaleToFill image.layer.borderColor = UIColor.clear.cgColor // 원형 이미지의 테두리 제거 image.clipsToBounds = true - image.image = UIImage(named: "profile") + image.image = UIImage(named: "profile-money") image.translatesAutoresizingMaskIntoConstraints = false return image }() @@ -71,7 +71,7 @@ class MyPageView : UIView { addSubview(logoutLine) self.profileImageView2.snp.makeConstraints { - $0.top.equalToSuperview().offset(100) + $0.top.equalToSuperview().offset(150) $0.centerX.equalToSuperview() } diff --git a/LGHTSG/LGHTSG/View/RankViewCell.swift b/LGHTSG/LGHTSG/View/RankViewCell.swift new file mode 100644 index 0000000..809d918 --- /dev/null +++ b/LGHTSG/LGHTSG/View/RankViewCell.swift @@ -0,0 +1,100 @@ +// +// RankViewCell.swift +// LGHTSG +// +// Created by HA on 2023/01/31. +// + +import UIKit + +class RankViewCell: UITableViewCell { + private enum Constant { + static let thumbnailSize = 70.0 + static let thumbnailCGSize = CGSize(width: Constant.thumbnailSize, height: Constant.thumbnailSize) + static let borderWidth = 2.0 + static let spacing = 4.0 + } + static let identifier = "RankViewCell" + + lazy var number: UILabel = { + let label = UILabel() + label.textColor = .white + return label + }() + + lazy var userName: UILabel = { + let label = UILabel() + label.textColor = .white + label.font = UIFont(name: "NanumSquareB", size: 14.0) + return label + }() + + lazy var userAsset: UILabel = { + let label = UILabel() + label.textColor = .lightGray + label.font = UIFont(name: "NanumSquareB", size: 14.0) + return label + }() + + lazy var transCount: UILabel = { + let label = UILabel() + label.textColor = .lightGray + label.font = UIFont(name: "NanumSquareR", size: 12.0) + return label + }() + + var iconImage = UIImageView() + + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + contentView.frame = contentView.frame.inset(by: UIEdgeInsets(top: 6, left: 6, bottom: 12, right: 6)) + /* self.containerView.layer.cornerRadius = 8 + self.containerView.layer.masksToBounds = true*/ + self.cellSetting() + + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func cellSetting() { + self.backgroundColor = .black + + [number, userName, userAsset, transCount, iconImage] + .forEach {contentView.addSubview($0)} + + + iconImage.clipsToBounds = true + iconImage.layer.cornerRadius = 16.5 + iconImage.snp.makeConstraints{ + + $0.leading.equalTo(number.snp.trailing).offset(15) + $0.top.equalToSuperview().inset(13) + $0.height.width.equalTo(33) + + } + + number.snp.makeConstraints { + $0.leading.equalToSuperview().inset(15) + $0.centerY.equalToSuperview() + } + + userName.snp.makeConstraints { + $0.leading.equalTo(iconImage.snp.trailing).offset(21) + $0.top.equalToSuperview().inset(15) + } + + userAsset.snp.makeConstraints { + $0.leading.equalTo(iconImage.snp.trailing).offset(21) + $0.top.equalTo(userName.snp.bottom).offset(5) + } + + + transCount.snp.makeConstraints { + $0.leading.equalTo(userAsset.snp.trailing).offset(21) + $0.top.equalTo(userName.snp.bottom).offset(5) + } + } +} diff --git a/LGHTSG/LGHTSG/View/StartView.swift b/LGHTSG/LGHTSG/View/StartView.swift index 68da637..6f0bbf5 100644 --- a/LGHTSG/LGHTSG/View/StartView.swift +++ b/LGHTSG/LGHTSG/View/StartView.swift @@ -33,7 +33,7 @@ class StartView: UIView { let findPwBtn: UIButton = { let btn = UIButton() - btn.setTitle("비밀번호 찾기", for: .normal) + btn.setTitle("비밀번호 변경", for: .normal) btn.setTitleColor(.white, for: .normal) btn.titleLabel?.font = UIFont(name: "NanumSquareR", size: 12.0) btn.translatesAutoresizingMaskIntoConstraints = false @@ -86,7 +86,7 @@ class StartView: UIView { // MARK: 맨 위 이미지 위치 self.titleImageView.snp.makeConstraints { - $0.top.equalToSuperview().offset(200) + $0.top.equalToSuperview().offset(280) $0.centerX.equalToSuperview() } @@ -94,7 +94,7 @@ class StartView: UIView { // MARK: 로그인 버튼 self.loginBtn.snp.makeConstraints { - $0.top.equalTo(titleImageView.snp.bottom).offset(100) + $0.top.equalTo(titleImageView.snp.bottom).offset(50) $0.centerX.equalToSuperview() $0.left.equalToSuperview().offset(30) $0.right.equalToSuperview().offset(-30) diff --git a/LGHTSG/LGHTSG/View/TopViewCell.swift b/LGHTSG/LGHTSG/View/TopViewCell.swift index 4dc47eb..63db26f 100644 --- a/LGHTSG/LGHTSG/View/TopViewCell.swift +++ b/LGHTSG/LGHTSG/View/TopViewCell.swift @@ -38,15 +38,15 @@ class TopViewCell: UITableViewCell { lazy var percentage: UILabel = { let label = UILabel() - label.textColor = .red - label.font = UIFont(name: "NanumSquareR", size: 12.0) + label.textColor = .systemRed + label.font = UIFont(name: "NanumSquareEB", size: 12.0) return label }() lazy var period: UILabel = { let label = UILabel() label.textColor = .gray - label.font = UIFont(name: "NanumSquareR", size: 12.0) + label.font = UIFont(name: "NanumSquareB", size: 12.0) return label }() @@ -120,8 +120,12 @@ class TopViewCell: UITableViewCell { } period.snp.makeConstraints { - $0.leading.equalTo(percentage.snp.trailing).offset(8) + $0.trailing.equalToSuperview().inset(20) $0.top.equalTo(title.snp.bottom).offset(5) } } } + + + + diff --git a/LGHTSG/LGHTSG/ViewController.swift b/LGHTSG/LGHTSG/ViewController.swift index a70d89a..ab1e90b 100644 --- a/LGHTSG/LGHTSG/ViewController.swift +++ b/LGHTSG/LGHTSG/ViewController.swift @@ -39,7 +39,7 @@ class ViewController: UIViewController { @objc func joinBtnClicked() { let vc = CheckAgreeController() - vc.modalPresentationStyle = .fullScreen + vc.modalPresentationStyle = .overFullScreen self.present(vc, animated: true) } diff --git a/LGHTSG/LGHTSG/ViewModel/AssetModel.swift b/LGHTSG/LGHTSG/ViewModel/AssetModel.swift index 1e1b21b..7efdadf 100644 --- a/LGHTSG/LGHTSG/ViewModel/AssetModel.swift +++ b/LGHTSG/LGHTSG/ViewModel/AssetModel.swift @@ -27,7 +27,7 @@ class AssetModel { guard let url = URL(string: urlString) else {return} let headers : HTTPHeaders = ["x-access-token" : token] let body : Parameters = [ - "transactionIdx" : transactionIdx, + "assetIdx" : transactionIdx, "category" : category ] AF.request(url, method: .patch, parameters: body, encoding: JSONEncoding.default, headers: headers ).responseDecodable(of: TradeDateError.self){ diff --git a/LGHTSG/LGHTSG/ViewModel/EstatePriceModel.swift b/LGHTSG/LGHTSG/ViewModel/EstatePriceModel.swift index 091d109..33b1108 100644 --- a/LGHTSG/LGHTSG/ViewModel/EstatePriceModel.swift +++ b/LGHTSG/LGHTSG/ViewModel/EstatePriceModel.swift @@ -11,7 +11,9 @@ class EstatePriceModel { var PriceLists : [Int] = [] var transactionTimeLists : [String] = [] func requestStockPrice(EstateName : String, onCompleted : @escaping([Int],[String]) -> Void){ - let urlString = "http://api.lghtsg.site:8090/realestates/prices?area=\(EstateName)" + PriceLists = [] + transactionTimeLists = [] + let urlString = "http://api.lghtsg.site:8090/realestates/prices?area=\(EstateName)" let encodedStr = urlString.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! let url = URL(string: encodedStr)! AF.request(url).responseDecodable(of: realEstates.self) { [weak self] response in diff --git a/LGHTSG/LGHTSG/ViewModel/RankingModel.swift b/LGHTSG/LGHTSG/ViewModel/RankingModel.swift new file mode 100644 index 0000000..0fe2792 --- /dev/null +++ b/LGHTSG/LGHTSG/ViewModel/RankingModel.swift @@ -0,0 +1,23 @@ +// +// RankingModel.swift +// LGHTSG +// +// Created by HA on 2023/02/11. +// + +import Foundation + +// MARK: - RankingModel +struct RankingModel: Codable { + let body: [zBody] +} + +// MARK: - Body +struct zBody: Codable { + let userIdx: Int + let userName: String + let userAsset: Int + // let profileImg: URL +} + + diff --git a/LGHTSG/LGHTSG/ViewModel/loginVM/LoginApiModel.swift b/LGHTSG/LGHTSG/ViewModel/loginVM/LoginApiModel.swift index fc1108d..a43f25f 100644 --- a/LGHTSG/LGHTSG/ViewModel/loginVM/LoginApiModel.swift +++ b/LGHTSG/LGHTSG/ViewModel/loginVM/LoginApiModel.swift @@ -30,7 +30,6 @@ class LoginApiModel { print("error") print(response.debugDescription) UserDefaults.standard.set(false, forKey: "loginSuccess") - } }