Swift 64

[iOS : Toy Project] Apple Music App (6) : 뷰사이 데이터 이동

이전 포스팅 - AppleMusicApp(1) : 뷰 구성 - AppleMusicApp(2) : Track 모델 (데이터 구조) - AppleMusicApp(3) : UiCollectionViewCell 업데이트 - AppleMusicApp(4) : HeaderView (CollectionReusableView) - AppleMusicApp(5) : Player 화면 + 싱글톤 자세한 코드는 여기로! https://github.com/yexjin/iOS_Study/tree/main/AppleMusicApp GitHub - yexjin/iOS_Study: iOS 토이프로젝트 모음집📱 iOS 토이프로젝트 모음집📱. Contribute to yexjin/iOS_Study development by creati..

iOS/Toy project 2022.09.21

[iOS] UICollectionViewDelegate

🌱 UICollectionViewDelegate - 사용자와 CollectionView의 아이템 사이의 상호작용을 관리해주기 위한 객체들에 의해 채택된 방식 - 이 프로토콜의 메소드들은 모두 Optional! 이 프로토콜을 통해 CollectionView의 Cell 클릭시 일어날 이벤트를 설정할 수 있다. 실습 해볼 내용 - HomeViewController의 CollectionViewCell 클릭 시, PlayerViewController를 가져와서 HomeView 에서 PlayerView로 전환시켜보겠다 extension HomeViewController: UICollectionViewDelegate { // 클릭했을때 어떻게 할까? func collectionView(_ collectionView:..

iOS 2022.09.15

[iOS : Toy Project] Apple Music App (5) : Player 화면 + 싱글톤

이전 포스팅 - AppleMusicApp(1) : 뷰 구성 - AppleMusicApp(2) : Track 모델 (데이터 구조) - AppleMusicApp(3) : UiCollectionViewCell 업데이트 - AppleMusicApp(4) : HeaderView (CollectionReusableView) 자세한 코드는 여기로! https://github.com/yexjin/iOS_Study/tree/main/AppleMusicApp GitHub - yexjin/iOS_Study: iOS 토이프로젝트 모음집📱 iOS 토이프로젝트 모음집📱. Contribute to yexjin/iOS_Study development by creating an account on GitHub. github.com 9..

iOS/Toy project 2022.09.13

[iOS : Toy Project] Apple Music App (4) : HeaderView (CollectionReusableView)

이전 포스팅 - AppleMusicApp(1) : 뷰 구성 - AppleMusicApp(2) : Track 모델 (데이터 구조) - AppleMusicApp(3) : UICollectionView 업데이트 자세한 코드는 여기로! https://github.com/yexjin/iOS_Study/tree/main/AppleMusicApp GitHub - yexjin/iOS_Study: iOS 토이프로젝트 모음집📱 iOS 토이프로젝트 모음집📱. Contribute to yexjin/iOS_Study development by creating an account on GitHub. github.com 9/13 - 이번엔 CollectionReusableView로 만들어뒀던 HeaderView를 마무리지어보겠다!..

iOS/Toy project 2022.09.13

[iOS : Toy Project] Apple Music App (3) : UICollectionViewCell 업데이트

이전 포스팅 - AppleMusicApp(1) : 뷰 구성 - AppleMusicApp(2) : Track 모델 (데이터 구조) 자세한 코드는 여기로! https://github.com/yexjin/iOS_Study/tree/main/AppleMusicApp GitHub - yexjin/iOS_Study: iOS 토이프로젝트 모음집📱 iOS 토이프로젝트 모음집📱. Contribute to yexjin/iOS_Study development by creating an account on GitHub. github.com 이전 포스팅에서 TrackModel을 통해 Track 폴더에서 데이터구조를 완성했었다. 이번 포스팅은 이 모델 객체를 통해 HomeView의 collection view cell을 업데이트..

iOS/Toy project 2022.09.13

[iOS : Toy Project] Apple Music App (2) : Track 모델 (데이터 구조 잡기)

이전 포스팅 - AppleMusicApp(1) : 뷰 구성 자세한 코드는 여기로! https://github.com/yexjin/iOS_Study/tree/main/AppleMusicApp GitHub - yexjin/iOS_Study: iOS 토이프로젝트 모음집📱 iOS 토이프로젝트 모음집📱. Contribute to yexjin/iOS_Study development by creating an account on GitHub. github.com 9/12 오늘은 Track 모델을 구현해봤다! 자세히 말하면 Track 구조체와 이 Track을 View와 연결해줄 Track Manager을 만들었다. 이 부분은 Track 폴더로 묶어줄건데, Track 폴더안의 파일은 1. Track.swift : Tra..

iOS/Toy project 2022.09.13

[iOS : Toy Project] Apple Music App (1) : 뷰 구성

오랜만에 하는 iOS 개발.. 요즘 다른 활동들이 너무 빡세기도 했고 iOS 스터디가 좀 정체되는 감이 있었어서 한동안 쉬었지만 다시 아자아자😇 이번주부터 2주간 진행될 과제는 Apple Music App 클론 프로젝트! 이번에도 이미 완성된 프로젝트의 코드를 따라가면서 천천히 구현해볼 예정이다 자세한 코드는 여기로! https://github.com/yexjin/iOS_Study/tree/main/AppleMusicApp GitHub - yexjin/iOS_Study: iOS 토이프로젝트 모음집📱 iOS 토이프로젝트 모음집📱. Contribute to yexjin/iOS_Study development by creating an account on GitHub. github.com 9/6 1. 폴더 구..

iOS/Toy project 2022.09.06

[Swift] Extension

Extension - 구조체, 열거형, 클래스, 프로토콜 타입에 기능을 추가할 수 있는 기능 - 기능 추가는 가능하나, 기존 기능들은 재정의는 불가능 📌 추가할 기능 정의 extension 확장할타입이름 { } 기존에 존재하는 타입이 추가적으로 다른 프로토콜들을 채택할 수 있게도 정의 가능 extension 확장할타입이름: 프로토콜1, 프로토콜2, 프로토콜3... { /* 프로토콜 요구사항 구현 */ } 🚀 Extension 구현하기 1) Int 타입에 두개의 연산 프로퍼티 추가 (isOdd, isEven) extension Int { var isEven: Bool { return self % 2 == 10 } var isOdd: Bool { return self % 2 == 1 } } print(1.i..

Swift 2022.08.24

[Swift] Protocol

Protocol? - 특정 역할을 수행하기 위한 method, property, initializer 등의 요구사항을 정의한다. 📌 Protocol 정의 protocol 프로토콜이름 { } 📌 Protocol 구현 protocol Talk { // 1) 프로퍼티 요구 var topic: String { get set } var language: String { get } // 2) 매서드 요구 func talk() // 3) 이니셜라이저 요구 init(topic: String, language: String) } → 프로퍼티 요구에서, 꼭 var 키워드로 선언되어야 하며 get은 읽기 전용, get과 set이 함께 쓰일 경우 읽기+쓰기 모두 가능한 프로퍼티 여야한다. 💡 Protocol 을 채택한다 ? ..

Swift 2022.08.24

[Swift] lazy?

저번 스터디에 참여하면서 스터디장님이 내주신 문제가 있었는데 7. 몬스터를 클래스로 추상화하려고 한다. MARK: 몬스터는 다음과 같은 속성들과 특징을 가지고 있다. - hp, mp, atk, level, damage - hp는 level * 50의 값을 가지고 있다. MARK: (Hint : lazy) - 각 속성들은 생성된 인스턴스에서 접근할 수 없다. - damage는 atk * level의 값을 반환하는 읽기 전용 변수이다. MARK: 몬스터는 다음과 같은 스킬을 가지고 있다. - attack(enemy: Monster) - enemy에게 damage를 입힌다. - checkMyHp() - 객체의 hp를 출력한다. - getDamage(damage: Int) - 받은 damage만큼 체력이 감소된..

Swift 2022.08.21