forked from AcaMate/AcaMate_iOS
Compare commits
No commits in common. "ca49db680c0f28c4095bc6625e418e6d072c59ab" and "3a7d3cbd0991bf06e42e549bd175e77b242b12ff" have entirely different histories.
ca49db680c
...
3a7d3cbd09
|
@ -317,7 +317,7 @@
|
||||||
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent;
|
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent;
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
|
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
|
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 17.6;
|
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
|
@ -328,7 +328,7 @@
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
SUPPORTS_MACCATALYST = NO;
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
|
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited) DEV LOCAL";
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited) DEV";
|
||||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = 1;
|
TARGETED_DEVICE_FAMILY = 1;
|
||||||
|
@ -359,7 +359,7 @@
|
||||||
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent;
|
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent;
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
|
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
|
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 17.6;
|
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
|
|
Binary file not shown.
|
@ -8,27 +8,14 @@ import SwiftUI
|
||||||
// MARK: - ACAMATE
|
// MARK: - ACAMATE
|
||||||
// APPSTORE_URL : https://apps.apple.com/us/app/%EC%95%84%EC%B9%B4%EB%8D%B0%EB%AF%B8%EB%A9%94%EC%9D%B4%ED%8A%B8/id6739448113
|
// APPSTORE_URL : https://apps.apple.com/us/app/%EC%95%84%EC%B9%B4%EB%8D%B0%EB%AF%B8%EB%A9%94%EC%9D%B4%ED%8A%B8/id6739448113
|
||||||
#if LOCAL
|
#if LOCAL
|
||||||
//public let API_URL: String = "http://0.0.0.0:5144"
|
public let API_URL: String = "http://localhost:5144"
|
||||||
public let API_URL: String = "https://localhost:7086"
|
|
||||||
public let WS_URL: String = "ws://localhost:5144"
|
public let WS_URL: String = "ws://localhost:5144"
|
||||||
|
//public let WS_URL: String = "ws://169.254.53.148:5144"
|
||||||
/// 회사 맥에서 사용할 경우의 URL
|
//#else
|
||||||
//public let WS_URL: String = "ws://10.149.217.64:5144"
|
|
||||||
|
|
||||||
/// 집 맥에서 사용할 경우의 URL
|
|
||||||
//public let WS_URL: String = "ws://192.168.0.71:5144"
|
|
||||||
//ipconfig getifaddr en0 이거는 와이파이 주소 알아내는거임
|
|
||||||
|
|
||||||
#elseif DEV
|
#elseif DEV
|
||||||
public let API_URL: String = "https://devacamate.ipstein.myds.me"
|
public let API_URL: String = "https://devacamate.ipstein.myds.me"
|
||||||
/// 서버용 웹소켓
|
//public let WS_URL: String = "ws://devacamate.ipstein.myds.me"
|
||||||
//public let WS_URL: String = "ws://ipstein.myds.me:7004"
|
public let WS_URL: String = "ws://192.168.0.71:5144"
|
||||||
|
|
||||||
/// 회사 맥에서 사용할 경우의 URL
|
|
||||||
public let WS_URL: String = "ws://10.149.217.64:5144"
|
|
||||||
|
|
||||||
/// 집 맥에서 사용할 경우의 URL
|
|
||||||
//public let WS_URL: String = "ws://192.168.0.71:5144"
|
|
||||||
//ipconfig getifaddr en0 이거는 와이파이 주소 알아내는거임
|
//ipconfig getifaddr en0 이거는 와이파이 주소 알아내는거임
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -22,12 +22,13 @@ struct NavigationView: View {
|
||||||
case .NONE:
|
case .NONE:
|
||||||
EmptyView()
|
EmptyView()
|
||||||
case .Intro:
|
case .Intro:
|
||||||
|
// IntroView(naviState: $naviState)
|
||||||
IntroView()
|
IntroView()
|
||||||
case .Login :
|
case .Login :
|
||||||
|
// LoginView(naviState: $naviState)
|
||||||
LoginView()
|
LoginView()
|
||||||
case .SelectAcademy(let bids):
|
|
||||||
SelectAcademyView(bids: bids)
|
|
||||||
case .Main:
|
case .Main:
|
||||||
|
// MainView(naviState: $naviState)
|
||||||
MainView()
|
MainView()
|
||||||
case .ChatRoom(let id):
|
case .ChatRoom(let id):
|
||||||
ChattingRoomView(roomID: id)
|
ChattingRoomView(roomID: id)
|
||||||
|
|
|
@ -43,9 +43,7 @@ struct LoginView: View {
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
// MARK: - TODO, 애플 계정 로그인 구현
|
// MARK: - TODO, 애플 계정 로그인 구현
|
||||||
// appVM.naviState.set(act: .MOVE, path: .Main)
|
appVM.naviState.set(act: .MOVE, path: .Main)
|
||||||
appVM.naviState.set(act: .ADD, path: .SelectAcademy(bids: ["AA0000", "AA0001"]))
|
|
||||||
|
|
||||||
} label: {
|
} label: {
|
||||||
makeButton(image: Image(.Logo.appleIcon), color: Color(.Text.black), "애플 계정으로 시작하기")
|
makeButton(image: Image(.Logo.appleIcon), color: Color(.Text.black), "애플 계정으로 시작하기")
|
||||||
}
|
}
|
||||||
|
@ -114,7 +112,6 @@ struct LoginView: View {
|
||||||
.frame(maxWidth: .infinity,maxHeight: .infinity)
|
.frame(maxWidth: .infinity,maxHeight: .infinity)
|
||||||
.fullDrawView(.Normal.normal)
|
.fullDrawView(.Normal.normal)
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeButton(image: Image, color: Color? = nil, _ body: String) -> some View {
|
func makeButton(image: Image, color: Color? = nil, _ body: String) -> some View {
|
||||||
return HStack {
|
return HStack {
|
||||||
image
|
image
|
||||||
|
@ -177,8 +174,7 @@ struct LoginView: View {
|
||||||
if let bids = ua.data.toStringDict()["bid"] {
|
if let bids = ua.data.toStringDict()["bid"] {
|
||||||
printLog(bids)
|
printLog(bids)
|
||||||
if let bidArray: [String] = jsonToSwift(bids) {
|
if let bidArray: [String] = jsonToSwift(bids) {
|
||||||
// 정상 적으로 학원 ID를 불러 온거니까 이제 여기서 할 걸 정해야 함
|
printLog(bidArray[0])
|
||||||
appVM.naviState.set(act: .ADD, path: .SelectAcademy(bids: bidArray))
|
|
||||||
} else {
|
} else {
|
||||||
printLog("JSON 변환 실패")
|
printLog("JSON 변환 실패")
|
||||||
}
|
}
|
||||||
|
@ -189,3 +185,6 @@ struct LoginView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//#Preview {
|
||||||
|
// LoginView()
|
||||||
|
//}
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
//
|
|
||||||
// SelectAcademyView.swift
|
|
||||||
// AcaMate
|
|
||||||
//
|
|
||||||
// Created by TAnine on 2/18/25.
|
|
||||||
//
|
|
||||||
|
|
||||||
import SwiftUI
|
|
||||||
import Combine
|
|
||||||
|
|
||||||
|
|
||||||
struct SelectAcademyView: View {
|
|
||||||
@State var cancellables: Set<AnyCancellable> = []
|
|
||||||
var bids: [String]
|
|
||||||
@State private var academyCode: String = ""
|
|
||||||
|
|
||||||
var body: some View {
|
|
||||||
VStack(spacing: 0) {
|
|
||||||
Spacer()
|
|
||||||
.frame(height: 100)
|
|
||||||
Image(.Logo.appIcon)
|
|
||||||
.resizable()
|
|
||||||
.frame(width: 200, height: 200)
|
|
||||||
CustomTextField(placeholder: "학원 코드 입력", text: $academyCode)
|
|
||||||
.frame(maxWidth: .infinity,maxHeight: 48)
|
|
||||||
.padding(EdgeInsets(top: 0, leading: 20, bottom: 0, trailing: 20))
|
|
||||||
.background {
|
|
||||||
RoundedRectangle(cornerRadius: 24)
|
|
||||||
.foregroundStyle(Color(.Normal.light))
|
|
||||||
}
|
|
||||||
// .padding([.leading, .trailing], 24)
|
|
||||||
.padding(EdgeInsets(top: 12, leading: 24, bottom: 12, trailing: 24))
|
|
||||||
|
|
||||||
}
|
|
||||||
.onAppear {
|
|
||||||
loadAPIData(url: "\(API_URL)",
|
|
||||||
path: "/api/v1/in/member/academy",
|
|
||||||
method: .post,
|
|
||||||
parameters: ["bids": bids],
|
|
||||||
decodingType: APIResponse<[AcademyName]>.self)
|
|
||||||
.sink { completion in
|
|
||||||
|
|
||||||
switch completion {
|
|
||||||
case .failure(let error):
|
|
||||||
printLog("\(error)")
|
|
||||||
// appVM.isLoading.toggle()
|
|
||||||
case .finished:
|
|
||||||
break
|
|
||||||
// appVM.isLoading.toggle()
|
|
||||||
}
|
|
||||||
} receiveValue: { response in
|
|
||||||
guard let ua = response as? APIResponse<[AcademyName]> else {return}
|
|
||||||
printLog(ua)
|
|
||||||
}
|
|
||||||
.store(in: &cancellables)
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ struct BottomView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(EdgeInsets(top: 12, leading: 24, bottom: 12, trailing: 24))
|
.padding(EdgeInsets(top: 12, leading: 24, bottom: 0, trailing: 24))
|
||||||
|
|
||||||
.background {
|
.background {
|
||||||
Rectangle()
|
Rectangle()
|
||||||
|
|
|
@ -21,6 +21,5 @@ struct EmptyBoxView: View {
|
||||||
.stroke(Color(.Second.normal), lineWidth: 2)
|
.stroke(Color(.Second.normal), lineWidth: 2)
|
||||||
.fill(Color(.Second.light))
|
.fill(Color(.Second.light))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ class Status: Codable {
|
||||||
let message: String
|
let message: String
|
||||||
}
|
}
|
||||||
|
|
||||||
// /api/v1/in/app/version ----------------
|
// ----------------
|
||||||
|
|
||||||
class VersionData: Codable {
|
class VersionData: Codable {
|
||||||
let os_type, final_ver, dev_ver, force_ver: String
|
let os_type, final_ver, dev_ver, force_ver: String
|
||||||
|
@ -25,16 +25,11 @@ class VersionData: Codable {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// /api/v1/in/user/login ----------------
|
// ----------------
|
||||||
|
|
||||||
class User_Academy: Codable {
|
class User_Academy: Codable {
|
||||||
let uid: String
|
let uid: String
|
||||||
let bid: [String]
|
let bid: [String]
|
||||||
}
|
}
|
||||||
|
|
||||||
// /api/v1/in/member/academy ----------------
|
|
||||||
class AcademyName: Codable {
|
|
||||||
let bid: String
|
|
||||||
let name: String
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ enum NaviAction: Hashable {
|
||||||
enum PathName: Hashable {
|
enum PathName: Hashable {
|
||||||
case Intro
|
case Intro
|
||||||
case Login
|
case Login
|
||||||
case SelectAcademy(bids: [String])
|
|
||||||
case Main
|
case Main
|
||||||
case ChatRoom(id: String)
|
case ChatRoom(id: String)
|
||||||
case NONE
|
case NONE
|
||||||
|
|
|
@ -13,15 +13,13 @@ import Alamofire
|
||||||
|
|
||||||
public func loadAPIData<T: Decodable>(url: String, path: String,
|
public func loadAPIData<T: Decodable>(url: String, path: String,
|
||||||
method: HTTPMethod = .get,
|
method: HTTPMethod = .get,
|
||||||
parameters: [String: Any],
|
parameters: [String: String],
|
||||||
headers: HTTPHeaders = [:],//["Accept": "application/json"],
|
headers: HTTPHeaders = [:],//["Accept": "application/json"],
|
||||||
decodingType: T.Type) -> Future<Any, Error> {
|
decodingType: T.Type) -> Future<Any, Error> {
|
||||||
return Future { promise in
|
return Future { promise in
|
||||||
printLog(parameters)
|
|
||||||
AF.request("\(url)\(path)",
|
AF.request("\(url)\(path)",
|
||||||
method: method,
|
method: method,
|
||||||
parameters: parameters,
|
parameters: parameters,
|
||||||
encoding: JSONEncoding.default,
|
|
||||||
headers: headers
|
headers: headers
|
||||||
)
|
)
|
||||||
.validate(statusCode: 200 ..< 300)
|
.validate(statusCode: 200 ..< 300)
|
||||||
|
|
|
@ -7,18 +7,8 @@
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
protocol MultilineStyle: View {
|
|
||||||
// func lineLimit(_ limit: Int?) -> Self
|
|
||||||
// func minimumScaleFactor(_ scale: CGFloat) -> Self
|
|
||||||
// func multilineTextAlignment(_ alignment: TextAlignment) -> Self
|
|
||||||
// func truncationMode(_ mode: Text.TruncationMode) -> Self
|
|
||||||
}
|
|
||||||
|
|
||||||
extension Text: MultilineStyle {
|
extension Text {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
extension MultilineStyle {
|
|
||||||
func multilineStyle(_ alignment: TextAlignment = .leading, limit: Int = 1, scale: CGFloat = 0.5) -> some View {
|
func multilineStyle(_ alignment: TextAlignment = .leading, limit: Int = 1, scale: CGFloat = 0.5) -> some View {
|
||||||
return self
|
return self
|
||||||
.lineLimit(limit)
|
.lineLimit(limit)
|
||||||
|
|
|
@ -20,9 +20,7 @@ struct CustomTextField: UIViewRepresentable {
|
||||||
// [필수] 초기화 시 UIView 생성
|
// [필수] 초기화 시 UIView 생성
|
||||||
func makeUIView(context: Context) -> UITextField {
|
func makeUIView(context: Context) -> UITextField {
|
||||||
let txf = UITextField()
|
let txf = UITextField()
|
||||||
// txf.placeholder = placeholder
|
txf.placeholder = placeholder
|
||||||
txf.attributedPlaceholder = NSAttributedString(string: "\(placeholder)", attributes: [NSAttributedString.Key.foregroundColor : UIColor(.Text.border)])
|
|
||||||
|
|
||||||
txf.isSecureTextEntry = isSecure.wrappedValue
|
txf.isSecureTextEntry = isSecure.wrappedValue
|
||||||
|
|
||||||
txf.textColor = textColor
|
txf.textColor = textColor
|
||||||
|
|
|
@ -14,7 +14,6 @@ struct NetworkModifier: ViewModifier {
|
||||||
@EnvironmentObject var appVM: AppViewModel
|
@EnvironmentObject var appVM: AppViewModel
|
||||||
|
|
||||||
func body(content: Content) -> some View {
|
func body(content: Content) -> some View {
|
||||||
if #available(iOS 17.0, *) {
|
|
||||||
content
|
content
|
||||||
.onChange(of: networkMonitor.isConnected) { _ , new in
|
.onChange(of: networkMonitor.isConnected) { _ , new in
|
||||||
if !new {
|
if !new {
|
||||||
|
@ -22,16 +21,6 @@ struct NetworkModifier: ViewModifier {
|
||||||
appVM.showAlert.toggle()
|
appVM.showAlert.toggle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
|
||||||
content
|
|
||||||
.onChange(of: networkMonitor.isConnected) { new in
|
|
||||||
if !new {
|
|
||||||
appVM.alertData = SetAlertData().setErrorNetwork()
|
|
||||||
appVM.showAlert.toggle()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,3 +145,8 @@ extension View {
|
||||||
// self.modifier(PressEffect(scale: scale, opacity: opacity, duration: duration))
|
// self.modifier(PressEffect(scale: scale, opacity: opacity, duration: duration))
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
extension View {
|
||||||
|
// func pressColorAnimation(backgroundColor: Color = Color.black.opacity(0.1), duration: Double = 0.1) -> some View {
|
||||||
|
// self.modifier(PressBackgroundEffect(backgroundColor: backgroundColor, duration: duration))
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user