-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat/week1 UI #2
Conversation
μ§λκ°λ νμΈμ
λλ€.. κ°μ₯ μμ μκΈΈλ λ€μ΄μλ΄€λλ°μ. |
-> Factory Method ν¨ν΄μ΄λΌκ³ ν΄μ.. κ·Έ ν΄λμ€ μΈμ€ν΄μ€ μμ±νλ κ²°μ μ 무쑰건 νμ ν΄λμ€(factory)κ° νλλ‘ μν€λ ν¨ν΄μ
λλΉ λ³΄ν΅ νλ©΄μ νμ μ§νν λ ν΄λμ€ μΈμ€ν΄μ€λ₯Ό κ° ν΄λμ€ λ΄μμ μ§ννκ² λλλ° factoryλ‘ λ°λ‘ λ½μλ΄μ μ§ννλ ννμμ!! |
μ.. νλ λ°°μκ°λλ€ π |
func press(for controlEvents: UIControl.Event = .touchUpInside, _ closure: @escaping()->()) { | ||
self.clicked { _ in | ||
if #available(iOS 14.0, *) { | ||
self.addAction(UIAction { (action: UIAction) in closure() }, for: controlEvents) | ||
} else { | ||
@objc class ClosureSleeve: NSObject { | ||
let closure:()->() | ||
init(_ closure: @escaping()->()) { self.closure = closure } | ||
@objc func invoke() { closure() } | ||
} | ||
let sleeve = ClosureSleeve(closure) | ||
self.addTarget(sleeve, action: #selector(ClosureSleeve.invoke), for: controlEvents) | ||
objc_setAssociatedObject(self, "\(UUID())", sleeve, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN) | ||
|
||
if #available(iOS 14.0, *) { | ||
self.addAction(UIAction { (action: UIAction) in closure() | ||
self.clickedAnimation() | ||
}, for: controlEvents) | ||
} else { | ||
@objc class ClosureSleeve: NSObject { | ||
let closure:()->() | ||
init(_ closure: @escaping()->()) { self.closure = closure } | ||
@objc func invoke() { closure() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closure λ무 μμ°μλ€μ . . νμ³κ°κ³ μΆλ€μ .. .. μλ νμ³κ°λλ€
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λ§€λ² νμ ν λλ§λ€ κ³ μ ν΄λκ³ μ°λλ° λ§€μ° νΈνκ² μ°κ³ μμλλ€..
μΌμΌμ΄ addTargetνκ³ λ©μλ μ°κ²°μνκ³ pressλ‘ λΉΌλκ² νΈν΄μ μ¬μ©μ€μ΄μμ!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λ νλ λ°°μκ°λλ€π
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ μ΄κ±° μ’λ€μ... μ λ μ€μ€ν λμ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ μ λ μ€μ€ ν©λλ€..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ£Όμκ°λλ€
if #available(iOS 14.0, *) { | ||
self.addAction(UIAction { (action: UIAction) in closure() | ||
self.clickedAnimation() | ||
}, for: controlEvents) | ||
} else { | ||
@objc class ClosureSleeve: NSObject { | ||
let closure:()->() | ||
init(_ closure: @escaping()->()) { self.closure = closure } | ||
@objc func invoke() { closure() } | ||
} | ||
let sleeve = ClosureSleeve(closure) | ||
self.addTarget(sleeve, action: #selector(ClosureSleeve.invoke), for: controlEvents) | ||
objc_setAssociatedObject(self, "\(UUID())", sleeve, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ λ§ μ΄μμμ μ²μ 보λ μ½λμΈλ° μ΄κ±΄ μ΄λ€ μ΅μ€ν
μ
μ΄μ£ ?
μ΄λ€ μ λλ©μ΄μ
μ μ£Όλ μ½λμΈκ°μ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
button.press {
// λ²νΌμ λλ μ λ λμνλ μ½λλ€
}
μ΄λ κ² μ°κΈ° μν΄μ λ€μκ³Ό κ°μ΄ Extensionμ λΊ΄λ¨λλ°μ...
κ·Έ clickAnimationμ λ£μ μ΄μ λ , μ£Όμμ μ΄κ±°μ²λΌ λ²νΌμ λλ₯Έ ν¨κ³Όλ₯Ό μ£ΌκΈ° μν΄ μ€μ΄λ€μλ€.. 컀μ‘λ€ μ λλ©μ΄μ
μ μ§§κ² μ€μ μ²λ¦¬νκ³ μμ΄λλ€.. λ€λ₯Έ νλ‘λνΈ λ³΄λκΉ μ΄λ°μμΌλ‘ λ²νΌ μ λλ©μ΄μ
μ μνκ³³μ΄ λ§μμ.. μ°Έκ³ ν΄λ΄€μ΅λλ€!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ꡬλμμ λ³΄κ³ μλλ° μ§μ΄€ λν μΌ μ§±..ππ» λ°°μκ°λλ€π₯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ λλ©μ΄μ ν¨κ³Ό λν μΌ μ΅κ³ μ λλ€..π€μ λ μΌλ₯Έ νμ©ν΄λ³΄κ³ μΆλ€μ
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λΉμΉΈ μ£Όμ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ γ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ κ° λΉμΉΈμ μ’ λ§μ΄ μ¨μ ^^,,,,, μ‘°μ¬ν κ²μ...
μΌλ¨ μ€λ μμ λ¬λ €λ©΄ μ΄ μ½λλ€ μ λ§ λͺ¨λ₯΄κ² μ΄μ λ§μ΄μ Έ λ΄ μ΄μμμ μ²μ 보λ μ½λλ€μ΄λΌ γ γ γ γ γ γ γ γ μΌλ¨ λ΄μΌλ‘ λ―Έλ£¨κ² μ΅λλ€. μΌλ¨ μ κ° λ¬ μ μλ κ²μ λΉ μΉΈμ μ£Όμνμλ©΄ μ’μ κ² κ°κ³ μ,, μλ,, κ·Όλ° μλ°°μΌ. μ΄λ° μμΌλ‘. μ΄? μ΄λ κ²κΉμ§ νμ μΌ λλκ³ . μ΄? μ§κΈ ? μ΄? μ½κ°. μ΄? μ λ§.. κ΅μ₯ν λ©μ§κ³ .. μ΄λ° μμΌλ‘λ ν μ μꡬλ νκ³ λ§μ΄ λ°°μλλ€.. μ¬μ€ μΌλ¨ λ€μνκ² μ»΄ν¬λνΈλ₯Ό λΉΌλ κ±Έ μμκ³ μ. κ·Όλ° μ²« νμ μλ€λ€ μκΈ°μ λ μ΄λ ΅κΈ°μ μ°¨κ·Όμ°¨κ·Ό 곡λΆν΄λ³΄λλ‘ νκ² μ΅λλ€..ππ» λ΄ μ½λλ μ ν£ μ€ νμ΄λ μ€ λ―ΈμΈλ¨Όμ§μ€... γ |
--> λ€ λΉμΉΈκ³Ό λ§ν¬κ΅¬λ¬Έ μ‘°μ¬ν κ²μ... μ κ° λ§ν¬κ΅¬λ¬Έμ ν νλ¦ΏμΌλ‘ μ΅κ΄μ μΌλ‘ λ§λ€μ΄ λ£μ΄μ κ³ κ±΄ μ‘°μ¬ν΄λ³΄λλ‘ νκ²μ΅λλ€... κ·Έλ¦¬κ³ ν¨μλͺ λ€μ κ΄νΈ λΆμ΄λκ±° μ΄κ²λ μ¬μ€ code conventionμΌλ‘ μ νκΈ° λλ¦μΈλ°... 루ν¬λμ λκ° λ 보기 νΈν κΉμ νν μ΄κ±΄ λ€κ°μ΄ λ Όμ ν΄λ΄μΌν λ¬Έμ μΌκ²κ°λ€μ!!
--> μ κ° λΉμΉΈμ μ΅κ΄μ μΌλ‘ μμ² λ§μ΄ μ¨μ ^^,,, λ€ μμΌλ‘ λ§μΆ°λκ°κ²μ ..... λ£¨ν¬ μ λ°°λμκ² κ±°μ¬λ¦¬μ§ μλλ‘... μμΌλ‘ μ¨λ³΄λλ‘ νκ² μ΅λλ€ νλλμ νμ΄ν ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λ§μ΄ λ°°μκ°λλ€π₯π₯
κ·Έλ¦¬κ³ μ§κ΄μ μΈ λ€μ΄λ°μ΄ μ μ€μνμ§ μκ² μ΄μ,,λνλ ν¨μμΈμ§ λλππ»
μ..λ무 λ§μ΄ν΄μ ν± μνλ€μ..
if #available(iOS 14.0, *) { | ||
self.addAction(UIAction { (action: UIAction) in closure() | ||
self.clickedAnimation() | ||
}, for: controlEvents) | ||
} else { | ||
@objc class ClosureSleeve: NSObject { | ||
let closure:()->() | ||
init(_ closure: @escaping()->()) { self.closure = closure } | ||
@objc func invoke() { closure() } | ||
} | ||
let sleeve = ClosureSleeve(closure) | ||
self.addTarget(sleeve, action: #selector(ClosureSleeve.invoke), for: controlEvents) | ||
objc_setAssociatedObject(self, "\(UUID())", sleeve, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ꡬλμμ λ³΄κ³ μλλ° μ§μ΄€ λν μΌ μ§±..ππ» λ°°μκ°λλ€π₯
private func setDefaultSetting(){ | ||
layer.cornerRadius = 8 | ||
self.titleLabel?.font = .boldSystemFont(ofSize: 16) | ||
setState(isEnable: false) | ||
} | ||
|
||
func setButtonTitle(title : String){ | ||
self.setTitle(title, for: .normal) | ||
} | ||
|
||
func setState(isEnable : Bool){ | ||
self.isEnabled = isEnable | ||
self.titleLabel?.textColor = isEnable ? .white : .gray | ||
self.tintColor = isEnable ? .white : .gray | ||
self.layer.backgroundColor = isEnable ? UIColor.mainBlue.cgColor : UIColor.lightGray.cgColor | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μκ±°λ λ²νΌμ΄ enableν λμ μλ λμ μνλ₯Ό λλ μ μΈν
ν΄μ£Όλκ±°μ£ ..?
λ²νΌμ΄λ ν
μ€νΈνλ κ°μ΄ λ°λ³΅λμ΄ μ¬μ©λλ κ²λ€μ ν΄λμ€λ‘ λ°λ‘ λΆλ¦¬ν΄μ μ°μλ κ±° μΈμκΉλ€μ..μ§μ§ μ΅κ³ ..ππΌππΌ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
컀μ€ν ν λ²νΌμ΄λ€ 보λκΉ, enable/disableμ λν μ€νμΌμ 미리 μ§μ ν΄μ ν¨μλ‘ λΉΌλκ±°μμ!!
|
||
private func setUIComponents(){ | ||
okButton.setButtonTitle(title: I18N.Components.ok) | ||
okButton.setState(isEnable: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ν΄λμ€μ λ²νΌ μνμ λ°λΌ μΈν ν΄λμ κ±° μκΈ°μ νΈμΆμ ν΅ν΄ enable μνμΌ λμ κ°μΌλ‘ μΈν λλλ‘ νλ건κ°μ??π€
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ μκ±° setState(true)λ μλ¬΄λ° state μ€μ μ μνμλ λ²νΌ κΈ°λ³Έκ°μ΄ νμ±νλ μνλ‘ λκ³ μΆμ΄μ κ·Έλ¬λ건λ°..
μ건 μ‘°κΈ μ§μλ λλ μ½λκΈ΄ νλ€μ¬... λ°κ²¬ κ°μ¬ν©λλ€ ^__^
private var isAllInformationFilled = false{ | ||
didSet{ | ||
signupButton.setState(isEnable: isAllInformationFilled) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didSet νμ©νλ λ² λ°°μκ°λλ€π₯π₯
ν¨μ¬ κΉλνλ€μππ»ππ»
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swiftλ₯Ό μ’ λ λ°°μ΄ λ€μ λ€μ μ§νλ μ½λ λ³΄λ¬ μ€λ©΄ λ°°μΈμ μ΄ λ λ§μ΄ λ³΄μΌ κ² κ°μμγ γ λ€μ λ μ€κ² μ΅λλ€! μ¬μ©μλ₯Ό μν μκ°μ ν¨κ³Ό μ λλ©μ΄μ λ£μΌμ κ±° μΈμκΉμ΄π μΈμ¬ν μ½λ 보면μ λ§μ΄ μμκ°λλ€! λ³Ό μ½λκ° λ§μλ§νΌ λ°°μΈ μ½λκ° λ§μμ΄μ..!
private var isPasswordVisible = false{ | ||
didSet{ | ||
passwordTextField.isSecureTextEntry = !isPasswordVisible | ||
setCheckboxStateImage() | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ꡬν λͺ»νλ λμ κ³Όμ λΆλΆμΈλ° μ½λ 보면μ λ°°μκ°λλ€!
if #available(iOS 14.0, *) { | ||
self.addAction(UIAction { (action: UIAction) in closure() | ||
self.clickedAnimation() | ||
}, for: controlEvents) | ||
} else { | ||
@objc class ClosureSleeve: NSObject { | ||
let closure:()->() | ||
init(_ closure: @escaping()->()) { self.closure = closure } | ||
@objc func invoke() { closure() } | ||
} | ||
let sleeve = ClosureSleeve(closure) | ||
self.addTarget(sleeve, action: #selector(ClosureSleeve.invoke), for: controlEvents) | ||
objc_setAssociatedObject(self, "\(UUID())", sleeve, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ λλ©μ΄μ ν¨κ³Ό λν μΌ μ΅κ³ μ λλ€..π€μ λ μΌλ₯Έ νμ©ν΄λ³΄κ³ μΆλ€μ
class CustomBlueButton : UIButton{ | ||
|
||
// Storyboardsμμ μ§μ ν λ νΈμΆλ¨ | ||
required init(coder aDecoder: NSCoder) { | ||
super.init(coder: aDecoder)! | ||
setDefaultSetting() | ||
} | ||
|
||
override init(frame: CGRect){ | ||
super.init(frame: frame) | ||
setDefaultSetting() | ||
} | ||
|
||
init() { | ||
super.init(frame:CGRect.zero) | ||
setDefaultSetting() | ||
} | ||
|
||
private func setDefaultSetting(){ | ||
layer.cornerRadius = 8 | ||
self.titleLabel?.font = .boldSystemFont(ofSize: 16) | ||
setState(isEnable: false) | ||
} | ||
|
||
func setButtonTitle(title : String){ | ||
self.setTitle(title, for: .normal) | ||
} | ||
|
||
func setState(isEnable : Bool){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λ²νΌκ°μ κ²λ λ°λ³΅λλ ννλκΉ ν΄λμ€ μ¬μ©ν΄μ μ λ κ² νλ©΄ λ νΈνκ² λ€μ...! μ’μ μ½λ λ°°μκ°λλ€!
protocol CustomInputTextFieldDelegate{ | ||
func textfieldChanged(text : String) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protocolμ μ²μλ΄μ ꡬκΈλ§νκ³ μλλ°, μ¬κΈ°μλ κΌ μ¨μΌνλ건κ°μ?? μμ°λ©΄ μλλκ±΄μ§ κΆκΈν©λλ€!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ κ° Delegateλ₯Ό μ¬μ©ν μ΄μ λ κ·Έ
ν
μ€νΈ ContainerViewμμ ν
μ€νΈκ° λ³ν λ VCμκ² λ°λ‘λ°λ‘ κ°νΈνκ² μ리기 μν΄μ λ°λ‘ Protocolμ μμ±ν΄μ μ΄κ±°κ΅¬μ! μ΄νμ ν
μ€νΈ ContainerViewμμ λ€μν μ΄λ²€νΈλ€μ κ΄λ¦¬νκΈ° μν΄ νλ‘ν μ½μ μ¬μ©νκ±°μ§λ§, λ€λ₯ΈμμΌλ‘λ μΌλ§λ μ§ μ²λ¦¬κ° κ°λ₯νκΈ°μ... μμ λ‘κ² μ°λ©΄ λλ λΆλΆμΌκ±°κ°μμ!!
π κ΄λ ¨ μ΄μ
#1 1μ°¨ κ³Όμ Issues
λ₯Ό μ€μ¬μΌλ‘ νμꡬ
μ΅μ΄ νλ‘μ νΈλ€ 보λκΉ .. μ무λλ μΈν νλ νμΌμ΄ μ’ λ§μ΄ λ€μ΄κ°κΈ΄ νλ€μ!
π λ³κ²½ μ¬ν λ° μ΄μ
π PR Point
π μ°Έκ³ μ¬ν
νΌλλ°±μ΄λ μ§λ¬Έμ¬νμ λ§κ΅¬λ§κ΅¬ λ¨κ²¨μ£ΌμΈμ!! νΈνκ²!!!!!!