clamp
Clamp
clamp
글쓰기 관리
전체 방문자
오늘
어제
  • 분류 전체보기 (509)
    • IOS (85)
    • SwiftUI+TCA+Combine (9)
    • RxSwift + MVVM (56)
    • Clean Architecture (12)
    • SWIFT (56)
    • iOS - TDD (2)
    • 디자인패턴 (4)
    • CS (56)
      • 알고리즘 (29)
      • 운영체제 (15)
      • 자료구조 (2)
      • 네트워킹 (4)
      • 기타 (6)
    • 회고 (0)
    • Firebase (18)
    • SwiftUI (10)
    • iOS - UIKit (11)
    • iOS - 오픈소스 (6)
    • 코딩테스트 (166)
      • 프로그래머스 (164)
    • 정보처리기사 (14)
    • GitHub (2)
글쓰기 / 관리자

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • Swift
  • Q
  • ㅅ
  • uikit

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
clamp

Clamp

IOS

[iOS] SnapKit

2023. 4. 5. 10:31

짧은 코드로 autolayout을 표현할 수 있도록 도와주는 프레임워크

https://github.com/SnapKit/SnapKit 

 

GitHub - SnapKit/SnapKit: A Swift Autolayout DSL for iOS & OS X

A Swift Autolayout DSL for iOS & OS X. Contribute to SnapKit/SnapKit development by creating an account on GitHub.

github.com

 

 

코드베이스로 UI를 구현하고 오토레이아웃으로 구현할 때 편리하다.

 

오토레이아웃

let view = UIView()
let square = UIView()

square.backgroundColor = .blue
square.frame = CGRect(x: 0, y: 0, width: 100, height: 100)

view.addSubview(square)

square.centerXanchor.constraint(equalTo: view.centerXanchor, constant: 0).isActive = true
square.centerYanchor.constraint(equalTo: view.centerYanchor, constant: 0).isActive = true

 

SnapKit

import SnapKit

view.addSubview(square)

square.snap.makeConstraints{
     $0.width.height.equalTo(100)
     $0.center.equalToSuperview()
 }

 

저작자표시 비영리 동일조건 (새창열림)
    'IOS' 카테고리의 다른 글
    • [iOS] KVO(Key-Value Observing)
    • [iOS] URLSessionTask failed with error: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection. HTTP접근 허용
    • [iOS] Push Notification(1). Remote Notification , APNs
    • [IOS] - UIWindow
    clamp
    clamp
    주니어 iOS개발자의 발악!!!!!!!

    티스토리툴바