적당한 고통은 희열이다

- 댄 브라운 '다빈치 코드' 중에서

반응형

Swift iOS 앱 개발 173

[실전] Swift Adding ActivityIndicator 로딩화면 띄우기

Activity Indicator 추가 및 사용법 from material-components-github 컬렉션뷰에서 셀 터치 후 Storage로부터 파일을 다운받는동안 AcivityIndicator 돌아가게 만들기. 1. pod file에 pod 'MaterialComponents' 설치 후 import해주기 import MaterialComponents.MaterialActivityIndicator 2. 컬렉션 뷰 컨트롤러 클라스에서 새로운 uiview instance와 activityIndicator 생성해주기 let overlayView = UIView() let activityIndicator = MDCActivityIndicator() 3. setupView() 에서 overlayView 및..

[Swift] Multiple asynchronous tasks 비동기로 여러 파일 다운로드 실행하기

Firebase Storage에서 폴더 리스트를 받아온 컬렉션 뷰에서 해당 셀을 터치하면 해당 폴더 내 파일들의 리스트를 받아와 각 파일의 경로(StorageReference)를 리스트[]로 저장하고 DispatchGroup()을 통해 각 파일들을 비동기 다운로드하여 localURL에 저장하고, 파일들이 다 다운이 되었을 때 UINavigationController를 사용하여 새 화면으로 넘어가는 코드를 구현해보았다. override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { print(files[indexPath.item]) let listRef = ref.child(file..

[실전] Firebase Storage 활용한 Test App 구현

다운받은 MaterialComponent kit를 활용하여 테스트 어플리케이션을 구현해보고자 한다. 나는 MDCDragon 내 CollectionsSimpleSwiftDemo 파일을 활용하여 프로젝트의 코어 시스템을 구현해보겠다. 아래 CollectionView를 활용한 데모 코드를 복사해와 Firebase 항목들을 추가해나가겠다. import UIKit import MaterialComponents.MaterialCollections class CollectionsSimpleSwiftDemo: MDCCollectionViewController { let reusableIdentifierItem = "itemCellIdentifier" let colors = [ "red", "blue", "green",..

[실전] Swift Material components iOS 로 UI 가져오기

https://github.com/material-components/material-components-ios material-components/material-components-ios Modular and customizable Material Design UI components for iOS - material-components/material-components-ios github.com UI를 코드로 직접 다 구현하지 않고, material components kit를 받아와서 사용할 수 있다. Wow! 1. Terminal에서 git clone 하는 법 % git clone https://github.com/material-components/material-components-ios ..

[Swift iOS] UIGestureRecognizer 터치 이벤트 제어하기

● UIGestureRecognizer Swift 에서 터치 이벤트를 구현해주는 아주 편리한 헬퍼 클라스!! UIGestureRecognizer 의 subclass 들에는 아래 항목들이 있다. - UITapGestureRecognizer - UIPinchGestureRecognizer - UIRotationGestureRecognizer - UISwipeGestureRecognizer - UIPanGestureRecognizer - UIScreenEdgePanGestureRecognizer - UILongPressGestureRecognizer 1. UITapGestureRecognizer 터치 이벤트 함수는 다음과 같이 작성할 수 있다. @objc func handleTap(sender: UITapGe..

[Swift 용어] Value Type / Reference Type

컴퓨터 프로그래밍을 할 때, 데이터 타입에는 Value Type(값 유형), Reference Type(참조 유형)의 두 가지 종류가 있다. ● Value Type (값 유형) - value type의 instance들은 값이 복사되었을 때, 다른 instance의 값이 변경되어도 원본은 고유의 데이터를 유지한다. (독립적) - swift에서 value type에는 struct, enum, tuple 등이 있다. - 값 복사 시 독립 인스턴스 생성. ● Reference Type (참조 유형) - reference type의 instance들은 데이터의 사본을 '공유'하기 때문에, 데이터가 수정될 경우 원본 값도 함께 바뀐다. - swift에서 reference type에는 class, closure 등..

6. Swift SceneKit Tutorial _3D 게임 만들기

SceneKit Tutorial 1 - Getting Started SceneKit Tutorial 2 - Nodes SceneKit Tutorial 3 - Physics SceneKit Tutorial 4 - Render Loop SceneKit Tutorial 5 - Particle Systems * 현재 진행중인 프로젝트에서는 Physics와 Particle은 필요하지 않아, 필자는 튜토리얼 1, 2, 4 만 참고를 하였다. SceneKit : Apple의 내장 3D 게임 프레임 워크 Geometry Fighter 게임을 만들어보며 SceneKit를 활용한 3D 그래픽 제어를 공부해보자! 1. 초기화 작업 2. Nodes 노드란? 3. Geometry 개체 만들기 4. Rend..

[Swift 용어] Closures 클로저란?

● Closures 클로저란? 간단하게 말하자면, 특정 함수가 반환되어 사라져도 그 속의 instance들은 소멸되지 않도록 보존해주는 캡쳐본(복사본)이라고 할 수 있다. 1) 클로저는 특정 context에서 모든 상수 및 변수에 대한 참조를 캡쳐하고 저장할 수 있다. * Capturing Values 값 캡쳐 : 클로저는 특정 context의 상수(constants)나 변수(variables)의 값을 캡쳐하여, 원본 값이 사라지더라도 클로저의 body 안에서 그 값을 활용할 수 있도록 해준다. (Swift에서 값을 캡처 할 수 있는 가장 간단한 형태의 클로저는 다른 함수의 본문 내에 작성된 중첩 함수(Nested functions)로, 중첩함수는 외부 함수의 인수 및 외부 함수 내에 정의된 모든 상수나..

5. 돈 없어도 서버를 만들 수 있는 세상! _Swift Firebase Tutorial for iOS

www.raywenderlich.com/3-firebase-tutorial-getting-started Firebase Tutorial: Getting Started In this Firebase tutorial, you’ll learn Firebase fundamentals including saving data, real-time sync, authentication, user status, and offline support. www.raywenderlich.com Swift Tutorial 5. Firebase 서버 연동하기 Grocery list App을 만들어보며 데이터 저장, 실시간 동기화, 인증, 사용자 상태, 오프라인 지원 등을 포함한 Firebase 기본 사항 배우기. ● Firebas..

728x90
반응형