Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IDLE-180] 센터프로필 조회및 수정 #20

Merged
merged 5 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public enum IdleInfoPlist {
])

public static let exampleAppDefault: InfoPlist = .extendingDefault(with: [
"Privacy - Photo Library Usage Description" : "프로필 사진 설정을 위해 사진 라이브러리에 접근합니다.",
"UILaunchStoryboardName": "LaunchScreen.storyboard",
"CFBundleDisplayName" : "$(BUNDLE_DISPLAY_NAME)",
"UIApplicationSceneManifest": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// CenterFeatureDependency.swift
// DependencyPlugin
//
// Created by 최준영 on 6/21/24.
//

import ProjectDescription

public extension ModuleDependency.Presentation {

static let CenterFeature: TargetDependency = .project(target: "CenterFeature", path: .relativeToRoot("Projects/Presentation/Feature/Center"))
}
24 changes: 24 additions & 0 deletions project/Projects/Domain/Entity/VO/AlertContentVO.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// AlertContentVO.swift
// Entity
//
// Created by choijunios on 7/18/24.
//

import Foundation

public struct DefaultAlertContentVO {

public let title: String
public let message: String

public init(title: String, message: String) {
self.title = title
self.message = message
}

public static let `default` = DefaultAlertContentVO(
title: "오류",
message: "동작을 수행하지 못했습니다."
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {


window = UIWindow(windowScene: windowScene)
window?.rootViewController = ViewController2()
window?.rootViewController = ViewController3()
window?.makeKeyAndVisible()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
//
// ViewController3.swift
// DSKitExampleApp
//
// Created by choijunios on 7/17/24.
//

import UIKit
import DSKit
import RxSwift

class ViewController3: UIViewController {

let disposeBag = DisposeBag()

override func viewDidLoad() {

view.backgroundColor = .white

view.layoutMargins = .init(
top: 0,
left: 20,
bottom: 0,
right: 20
)

let field = MultiLineTextField(typography: .Body3, placeholderText: "Hello world")

let label = IdleLabel(typography: .Body3)
label.textString = "엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장엄청나게 긴 문장"
label.numberOfLines = 0

let centerImageEditButton: UIButton = {
let btn = UIButton()
btn.setImage(DSKitAsset.Icons.editPhoto.image, for: .normal)
btn.isUserInteractionEnabled = true
return btn
}()
[
field,
label,
centerImageEditButton
]
.forEach {
$0.translatesAutoresizingMaskIntoConstraints = false
view.addSubview($0)
}

NSLayoutConstraint.activate([
field.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
field.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor),
field.trailingAnchor.constraint(equalTo: view.layoutMarginsGuide.trailingAnchor),

label.topAnchor.constraint(equalTo: field.bottomAnchor, constant: 30),
label.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor),
label.trailingAnchor.constraint(equalTo: view.layoutMarginsGuide.trailingAnchor),

centerImageEditButton.topAnchor.constraint(equalTo: label.bottomAnchor, constant: 30),
centerImageEditButton.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor),
])
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "EditImage.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "location_image.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "location_image 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "location_image 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class TextButtonType2: UIView {

private var tapGesture: UITapGestureRecognizer!

public var eventPublisher: Signal<UITapGestureRecognizer> { tapGesture.rx.event.asSignal() }
public var eventPublisher: Observable<Void> { tapGesture.rx.event.map { _ in () } }

public init(
labelText: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class TextButtonType3: IdleLabel {

private var tapGesture: UITapGestureRecognizer!

public var eventPublisher: Signal<Void> { tapGesture.rx.event.asSignal().map { _ in () } }
public var eventPublisher: Observable<Void> { tapGesture.rx.event.map { _ in () } }

public override init(typography: Typography) {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// IdleImageView.swift
// DSKit
//
// Created by choijunios on 7/17/24.
//

import UIKit

public extension UIImageView {

static let backButton: UIImageView = {
let view = UIImageView(image: DSKitAsset.Icons.back.image)
view.contentMode = .scaleAspectFit
return view
}()

static let locationMark: UIImageView = {
let view = UIImageView(image: DSKitAsset.Icons.locationSmall.image)
view.contentMode = .scaleAspectFit
return view
}()

static let editPhotoImage: UIImageView = {
let view = UIImageView(image: DSKitAsset.Icons.editPhoto.image)
view.contentMode = .scaleAspectFit
return view
}()
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ public class IdleLabel: UILabel {

let size = super.intrinsicContentSize

return CGSize(width: size.width, height: typography.lineHeight * CGFloat(currentLineCount))
if currentLineCount != 0 {
return CGSize(width: size.width, height: typography.lineHeight * CGFloat(currentLineCount))
}
return super.intrinsicContentSize
}

public var typography: Typography {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ public class IdleTextField: UITextField {
bottom: 10,
right: 24
)
public var textString: String {
get {
return currentText
}
set {
currentText = newValue
updateText()
}
}

public init(typography: Typography) {

Expand Down Expand Up @@ -99,6 +108,9 @@ public class IdleTextField: UITextField {
)
}
}
private func updateText() {
self.rx.attributedText.onNext(NSAttributedString(string: textString, attributes: typography.attributes))
}
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// HStack.swift
// DSKit
//
// Created by choijunios on 7/18/24.
//

import UIKit

public class HStack: UIStackView {

public init(_ elements: [UIView], spacing: CGFloat = 0.0, alignment: UIStackView.Alignment = .center) {

super.init(frame: .zero)

self.spacing = spacing
self.axis = .horizontal
self.distribution = .fill
self.alignment = alignment

elements
.forEach {
self.addArrangedSubview($0)
}
}

required init(coder: NSCoder) { fatalError() }
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Stack.swift
// VStack.swift
// DSKit
//
// Created by choijunios on 7/15/24.
Expand Down Expand Up @@ -27,3 +27,4 @@ public class VStack: UIStackView {

required init(coder: NSCoder) { fatalError() }
}

Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ import UIKit
import RxSwift
import RxCocoa

/// 총 Height 44(42 + border(1pt)x2)
///
/// TextBox사이즈 24
/// inset
/// vertical: 11
/// horizontal: 20

public class IdleOneLineInputField: UIView {

public var isEnabled: Bool = true
Expand Down
Loading