Si Jong Tech Blog
close
프로필 배경
프로필 로고

Si Jong Tech Blog

  • 분류 전체보기 (236)
    • ◽️ Programming (236)
      • T I L (89)
      • Swift 문법 (22)
      • UIKit (18)
      • SwiftUI (11)
      • TCA (6)
      • RxSwift (7)
      • iOS (34)
      • 회고 (5)
      • ◽️ Algorithm (32)
      • ◽️ Computer Science (12)
  • 홈
  • 태그
  • 방명록

코드로 오토레이아웃 함수 모아 놓기

오토레이아웃 잡을때 class ViewController: UIViewController { let emailTextFieldView = UIView() override func viewDidLoad() { super.viewDidLoad() makeUI } func makeUI() { emailTextFieldView.backgroundColor = .darkGray view.addSubview(emailTextFieldView) emailTextFieldView.translatesAutoresizingMaskIntoConstraints = false emailTextFieldView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 30..

  • format_list_bulleted ◽️ Programming/UIKit
  • · 2024. 3. 9.
  • textsms

UIKit 사용법

버튼의 타이틀 변경 button.setTitle("my text here", forSate: .normal) 레이블 텍스트 변경 label.text = "안녕하세요" 버튼의 테두리 둥글게 하는법 @IBOutlet weak var calculateButton: UIButton! // 버튼 변수 설정 후 calculateButton.clipsToBounds = true calculateButton.layer.cornerRadius = 5 버튼 누르면 이전 내용으로 돌아가는 메서드 @IBAction func backButtonTapped(_ sender: UIButton) { dismiss(animated: true, completion: nil) }

  • format_list_bulleted ◽️ Programming/UIKit
  • · 2024. 3. 9.
  • textsms

텍스트 필드 ( Text Field )

텍스트 필드 사용법 textField.keyboardType = UIKeyboardType.emailAddress // 텍스트필드의 키보드 스타일 textField.placeholder = "이메일 입력" textField.borderStyle = .roundedRect // 텍스트필드의 선 스타일 textField.clearButtonMode = .always // 텍스트삭제 버튼 textField.returnKeyType = .go // 엔터의 형태 설정 텍스트 필드 선택 함수 정리 // 텍스트필드의 입력을 시작할때 호출 되는 메서드 ( 시작할지 말지 여부 허락 하는 것 ) func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool { re..

  • format_list_bulleted ◽️ Programming/UIKit
  • · 2024. 3. 9.
  • textsms

핸드폰 번호 가리기

문제 설명 프로그래머스 모바일은 개인정보 보호를 위해 고지서를 보낼 때 고객들의 전화번호의 일부를 가립니다. 전화번호가 문자열 phone_number로 주어졌을 때, 전화번호의 뒷 4자리를 제외한 나머지 숫자를 전부 *으로 가린 문자열을 리턴하는 함수, solution을 완성해주세요. func solution(_ phone_number: String) -> String { guard phone_number.count >= 4 else { return phone_number } let number = phone_number.index(phone_number.endIndex, offsetBy: -4) let remove = String(repeating: "*", count: phone_number.coun..

  • format_list_bulleted ◽️ Programming/◽️ Algorithm
  • · 2024. 3. 8.
  • textsms

델리게이트 패턴 , 텍스트 필드

델리게이트 패턴은 객체 지향 프로그래밍에서 자주 사용되는 디자인 패턴 중 하나이다. 하나의 객체가 다른 객체의 동작을 직접 구현할 필요가 없을때 객체 간의 결합도를 낮추고 유연성을 높이고자 할 때 이벤트 처리, 데이터 소스 및 테이블 뷰와 같은 UI 구성 요소에서 사용자 이벤트를 처리할 때 등 델리게이트(Delegate) : 델리게이트는 특정 작업을 수행하기 위해 다른 객체에게 일부 책임을 위임하는 객체(대리자) , 델리게이트는 프로토콜을 준수하여 정의되며, 메서드를 호출하여 작업을 수행한다. 델리게이트 프로토콜(Delegate Protocol): 델리게이트를 구현하기 위해 정의된 프로토콜 이다. 델리게이트 프로토콜은 델리게이트 객체가 구현해야 하는 메서드를 정의하고 있다. 델리게이트 객체(Delegat..

  • format_list_bulleted ◽️ Programming/T I L
  • · 2024. 3. 7.
  • textsms

음양 더하기

문제 설명 어떤 정수들이 있습니다. 이 정수들의 절댓값을 차례대로 담은 정수 배열 absolutes와 이 정수들의 부호를 차례대로 담은 불리언 배열 signs가 매개변수로 주어집니다. 실제 정수들의 합을 구하여 return 하도록 solution 함수를 완성해주세요. import Foundation func solution(_ absolutes:[Int], _ signs:[Bool]) -> Int { var plusValue = 0 for i in 0..

  • format_list_bulleted ◽️ Programming/◽️ Algorithm
  • · 2024. 3. 7.
  • textsms
  • navigate_before
  • 1
  • ···
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • ···
  • 40
  • navigate_next
프로필 로고

Si Jong Tech Blog

전체 카테고리
  • 분류 전체보기 (236)
    • ◽️ Programming (236)
      • T I L (89)
      • Swift 문법 (22)
      • UIKit (18)
      • SwiftUI (11)
      • TCA (6)
      • RxSwift (7)
      • iOS (34)
      • 회고 (5)
      • ◽️ Algorithm (32)
      • ◽️ Computer Science (12)
최근 글
인기 글
최근 댓글
태그
  • #TIL
  • #uikit
  • #tableView
  • #티스토리챌린지
  • #오블완
  • #project
  • #MVC
  • #IOS
  • #알고리즘
  • #swift
전체 방문자
오늘
어제
전체
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바