최승기

@cellpig

100 Points 2 Followers

27 Posts

0 Answers

User has not added any information in their about section.

최승기 · 4 years ago

[SwiftUI] Add a popover segue

sheets, animation, transitions 3가지 방법을 이용하여 비스한 효과를 낸다. .sheet .sheet(isPresented: $showOrNotBool, content { }) 을 사용한다. 원래 뷰로 돌아 올때는 environment를 이용하는...

최승기 · 4 years ago

[SwiftUI] .animation() & withAnimation()

.animation() & withAnimation() withAnimation() {} : 중괄호 안에서 변화되는 값에 영향을 받는 것은 애니메이션 처리 하라는 말이다. .offset을 이용하면 뷰의 위치를 바꾸는 에니메이션을 만들...

최승기 · 4 years ago

[SwiftUI] ternary operators

Ternary operators ? 참 인 경우 : 거짓인 경우 Text( isTrue ? "참이지라": "거짓이지라")

최승기 · 4 years ago

[SwiftUI] If else

#if else

최승기 · 4 years ago

[SwiftUI] @Binding

@Binding @State 와 짝이다. struct BindingBootcamp: View { @State var backgroundColor: Color = Color.green @State var title: String = "Title" var body: some View {...

최승기 · 4 years ago

[SwiftUI] Extract Subviews

Extract Subviews 서브뷰를 같은 뷰 구조체 안에 넣는 방법 struct ExtractSubviewsBootcamp: View { var body: some View { ZStack { // background layer Color(#c...

최승기 · 4 years ago

[SwiftUI] Extract Functions & Views

Extract Functions & View function을 만들고 적용한다. buttonPress() 우클릭후 jump to definition으로 찾아 갈 수 있다. 뷰를 분리하여 새로운 뷰를 만들수 있다. 원하는 뷰를 선택한 후 var body...

최승기 · 4 years ago

[SwiftUI] @State

@State property wrapper code struct StateBootcamp: View { // 다음의 변수를 뷰 가 알아야 한다. 그래서 property wrapper를 사용한다. // @State를 사용하면 뷰가 항상 감시하고 있다가...

최승기 · 4 years ago

[SwiftUI] Button()

Button() struct ButtonsBootcamp: View { // 아래는 변수는 @State를 붙이지 않으면 에러가 발생한다. @State var title: String = "This is my title" var body: some...

최승기 · 4 years ago

[SwiftUI] SafeArea

.ignoresSafeArea() .edgesIgnoringSafeArea() 애플 디벨롭퍼 사이트에서 Human Interface Guidelines를 참고한다. Visual Design 항목을 참고함 애플에서는 .edgesIgnoringSafeArea() 대신 .ignoresSaf...

최승기 · 4 years ago

[SwiftUI] LazyVGrid()

LazyVGrid() fixed struct GridBootcamp: View { // 그리드를 사용하기 위해서는 GridItem 배열이 필요하다. let columns: [GridItem] = [ // 필요한 컬럼의 수 만큼 만든다. GridIt...

최승기 · 4 years ago

[SwiftUI] ScrollView()

ScrollView() 이렇게 하면 화면이 넘어간다. struct ScrollViewBootcamp: View { var body: some View { VStack { Rectangle() .frame(height: 300)...

최승기 · 4 years ago

[Swift UI] ForEach()

ForEach() 기본적으로 루프다. 아래처럼 코딩을 하는 것은 매우 성가신일이다. struct ForEachBootcamp: View { var body: some View { VStack { Text("ONE")...

최승기 · 4 years ago

[SwiftUI] init() & enum

init() & enum init struct InitBootCamp: View { //let backgroundColor: Color = Color.blue //아래의 경우처럼 초기화를 하지 않은 경우는 초기화를 하여야 한다. let backgroundColor: Color le...

최승기 · 4 years ago

[SwiftUI] Spacer()

Spacer() HStack(spacing:nil) { // nil은 기본값을 의미함 Rectangle() .frame(width:100, height: 100) Spacer() // 가능한 최대의 영역을 확보한다. .frame(height: 10 ) // 스페이서의 영역을...

최승기 · 4 years ago

[SwiftUI] Padding()

Padding() Text("Hello,World") .background(Color.yellow) .padding() //텍스트 주면에 여유공간을 추가한다. .padding(.all, 10) // 이런식으로 표현할 수 있다. .padding(.leading, 20...

최승기 · 4 years ago

[SwiftUI] Stacks

VStack(), HStack(), ZStack() VStack { // 구성요소들이 상하로 쌓인다. HStack { // 구성요소들이 좌우로 쌓인다. ZStack { // 구성요소들이 바닥에서 상부로 쌓인다. Rectangle() .fill(Color.red)...

최승기 · 4 years ago

[SwiftUI] background & overlay

background code // background도 코드의 아랫쪽부터 쌓인다. // 정확히는 frame이 아랫쪽에서 부터 쌓이는 것인것 같다. // 이 프레임에 대한 배경을 정해주는 것같다. Text("Hello,World")...

최승기 · 4 years ago

[SwiftUI] .frame()

.frame() 어떤 종류의 요소든 프레임을 갖는다. 텍스트도 기본 프레임을 갖는다. Code Text("Hello,World") .background(Color.green) // 텍스트 배경이 변화 .frame(width:100, height:100,...

최승기 · 4 years ago

[SwiftUI] Image()

Image() 이미지는 xcode에 미리 등록해야한다. Assets 파일에 등록한다. 예) SampleImage 참고) 뭔가 에러가 생기면 Clean build folder를 이용한다. Command+Shift+K Code Image("SampleImage&quo...

최승기 · 4 years ago

[SwiftUI] System Icons

System Icons SF Symbols 구글에서 검색하여 설치한다. 예 struct IconsBootcamp: View { var body: some View { Image(systemName: "heart.fill") .font(.system(size:50)) .foregrou...

최승기 · 4 years ago

[SwiftUI] Gradients

Gradients 예 struct GradientsSample: View { var body: some view { RoundedRectangle(cornerRadius: 25.0) .fill( //Color.red // gradient를 타이핑하...

최승기 · 4 years ago

[SwiftUI] Color

Color 예 RoundedRectangle(cornerRadius: 25.0 ) .frame(width: 300, height: 200) .shadow(radius: 10) // 쉐도우를 설정할 수 있다. .shadow(color:Color.red, radius:10, x:20, y:20) .sh...

최승기 · 4 years ago

[SwiftUI]Shapes

Shapes Component Circle() // 원 Ellipse() // 타원 Capsule(style: .continuous) // 캡슐형태 // . continuous -> 좀더 약처럼 생김 // . circular -> 좀더 둥글다. Rectangle() //사각형...

최승기 · 4 years ago

[SwiftUI] Text()

Text() 우측 inspector에서 modifiers을 변경할 수 있다. 익숙해 지면 직접 코딩을 한다. Text("Hello, World") // 이것은 컴포넌트 이고 .font(.title) // 이것은 모디파이어 다. Mo...

최승기 · 4 years ago

AppData 접근

파일탐색기 경로창에 %appdata%를 입력한다.

최승기 · 4 years ago

[Swift] throws

에러처리는 3단계로 처리한다. 에러를 정의한다. 발생한 에러를 알려준다(정보를 던진다.) 받은 에러를 처리한다. 1. 에러를 정의한다. enum으로 정한다. enum myError: Error { case tooMany cas...

Loading More Content