본문 바로가기
728x90

전체 글48

Android Studio 4.1 업데이트, 새로운 기능과 변경사항 Android Studio 4.1 업데이트로 새롭게 추가된 기능과 변경사항을 알아보자 !! 1. New Database Inspector 첫번째는 Database Instpector 이다. 해당 기능을 사용하면 앱을 사용하면서 데이터베이스 내용을 수정한 것을 앱에 반영할 수 있다. 해당 기능을 사용하기 위해서는 API 26 이상이어야 하며, View > Tool Windows > Database Inspector 에서 사용할 수 있다. 자세한 사용 방법은 아래를 참고해보자 !! https://developer.android.com/studio/inspect/database Debug your database with the Database Inspector | Android 개발자 In Android S.. 2020. 10. 18.
[Kotlin] 코틀린 표준 라이브러리 let(), also(), apply(), run(), with() - (3) https://thkim-study.tistory.com/6 - let() 함수 https://thkim-study.tistory.com/7 - also() 함수 코틀린 표준 라이브러리 중 apply()를 알아보자. apply()란 무엇인가 apply() 함수는 람다식 접근 방법이 this이고 반환 방법도 this이다. 또한 이전에 스터디했던 let(), also()와 다르게 람다식이 확장 함수로 처리된다. 간단한 예제를 통해 알아보자. data class Car(var name: String, var speed: Int) var car = Car("Sports Car", 100) car.apply { this.speed = 120 } println(car) val returnObj = car.apply.. 2020. 7. 22.
[Kotlin] 코틀린 표준 라이브러리 let(), also(), apply(), run(), with() - (2) https://thkim-study.tistory.com/6 - let() 함수 https://thkim-study.tistory.com/8 - apply(), run() with() 함수 아래 표를 참고하면서 스터디해보자. 함수의 람다식 접근 방법 함수 이름 람다식 접근 방법 반환 방법 let it block 결과 also it it apply this this run this block 결과 with this Unit also() 함수 활용 also() 함수는 함수를 호출하는 객체 T를 이어지는 block에 전달하고 객체 T 자체를 반환한다. let() 함수는 마지막으로 수행된 코드 블록의 결과를 반환하고 also() 함수는 블록 안의 코드 수행 결과와 상관없이 T인 객체 this를 반환한다. var.. 2020. 7. 22.
[Kotlin] 코틀린 표준 라이브러리 let(), also(), apply(), run(), with() - (1) https://thkim-study.tistory.com/7 - also() 함수 https://thkim-study.tistory.com/8 - apply(), run(), with() 함수 람다식을 사용하는 코틀린의 표준 라이브러리에서 let(), apply(), with(), also(), run() 등 여러가지 표준함수가 있다. 이 표준 함수를 활용하여 복잡한 코드를 단순화하고 효율적으로 만들 수 있다. 함수의 람다식 접근 방법 함수 이름 람다식 접근 방법 반환 방법 let it block 결과 also it it apply this this run this block 결과 with this Unit let() 함수 let() 함수는 함수를 호출하는 객체 T를 이어지는 block의 인자로 넘기고 .. 2020. 7. 22.
728x90