24.06.24 Today I Learned

2024. 6. 24. 20:47·Today I Learned/2024

약수의 합

 


StroyBoardUI로 구현

 

import UIKit

class ViewController: UIViewController {
    
    private var number: Int = 0
    
    

    @IBOutlet weak var label: UILabel!
    
    
    @IBOutlet weak var minusButton: UIButton!
    
    @IBAction func minusButtonTapped(_ sender: Any) {
        self.number -= 1
        label.text = "\(self.number)"
    }
    
    @IBOutlet weak var plusButton: UIButton!
    
    @IBAction func plusButtonTapped(_ sender: Any) {
        self.number += 1
        label.text = "\(self.number)"
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }


}

 


calculator 앱 만들기

Level.1 구현

  • 속성
    • backgroundColor = .black
    • textColor = .white
    • 텍스트는 12345로 고정
    • 텍스트 오른쪽 정렬
    • Font = 시스템 볼드체, 사이즈 60
  • AutoLayout
    • leading, trailing = superView 로부터 30 떨어뜨리기
    • top = superView 로부터 200 떨어뜨리기
    • height = 100

  • UIButton 속성
    • font = .boldSystemFont(ofSize: 30)
    • backgroundColor(red: 58/255, green: 58/255, blue: 58/255, alpha: 1.0)
    • frame.size.height = 80
    • frame.size.width = 80
    • layer.cornerRadius = 40
  • horizontalStackView 속성
    • axis = .horizontal
    • backgroundColor = .black
    • spacing = 10
    • distribution = .fillEqually
  • horizontalStackView AutoLayout
    • height = 80
  • verticalStackView 속성
    • axis = .vertical
    • backgroundColor = .black
    • spacing = 10
    • distribution = . fillEqually
  • horizontalStackView AutoLayout
    • width = 350
    • top = label의 bottom으로부터 60 떨어지도록
    • centerX = superView와 같도록

 

'Today I Learned > 2024' 카테고리의 다른 글

24.06.26 Today I Learned  (0) 2024.06.26
24.06.25 Today I Learned  (0) 2024.06.25
24.06.21 Today I Learned  (0) 2024.06.21
24.06.20 Today I Learned  (0) 2024.06.20
24.06.19 Today I Learned  (0) 2024.06.19
'Today I Learned/2024' 카테고리의 다른 글
  • 24.06.26 Today I Learned
  • 24.06.25 Today I Learned
  • 24.06.21 Today I Learned
  • 24.06.20 Today I Learned
이도서
이도서
  • 이도서
    도서의 코딩노트
    이도서
  • 전체
    오늘
    어제
    • 분류 전체보기 (209)
      • Today I Learned (79)
        • 2024 (78)
      • Swift (25)
        • Swift 문법 정리 (19)
        • RxSwift (5)
      • Swift Study (12)
        • Playground (2)
        • Storyboard (9)
        • UIKit (1)
      • Git (3)
      • 코딩테스트 (60)
      • Dart 언어 (16)
      • Flutter (11)
        • Flutter Study (11)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

    • 개발 공부 공유 링크
  • 인기 글

  • 태그

    Swift
    계산기만들기
    함수
    Playground
    Til
    코딩 테스트
    구조체
    코딩테스트Level.1
    storyboard
    DART
    Xcode
    객체지향
    Flutter
    내일배움캠프
    iOS앱개발
    코딩테스트
    ios앱개발자
    ios
    widget
    코딩테스트 level.1
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
이도서
24.06.24 Today I Learned
상단으로

티스토리툴바