This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const gpio = require('node-wiring-pi') | |
| export function turnOffLED(pinNum, isOn) { | |
| if (typeof pinNum == 'number' && typeof isOn == 'boolean') { | |
| if (pinNum === 27 || pinNum === 28 || pinNum === 29) { | |
| gpio.digitalWrite(pinNum, isOn ? 1 : 0) | |
| } else { | |
| throw Error('색상값을 확인해야합니다.') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_main) | |
| /* actionbar를 자동으로 네비게이션에 맞추어 출력되도록합니다. */ | |
| val config = AppBarConfiguration(setOf(R.id.friendsFragment,R.id.homeFragment)) | |
| setupActionBarWithNavController(findNavController(R.id.my_nav_host_fragment), config) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MotherClass { | |
| enum class County(val label: String) { | |
| KOREA("한국"), JAPAN("일본") | |
| } | |
| object KoreanFactoryNo { | |
| var currentNumber = 1 | |
| set(value) { | |
| println("현재까지 한국에서 생산된 자전거는 ${currentNumber}개입니다.") | |
| field = value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct ContentView: View { | |
| @State var step:CGFloat = 0 | |
| var body: some View { | |
| VStack{ | |
| LottieView(step: $step) | |
| HStack{ | |
| Button( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| import Lottie | |
| struct LottieView: UIViewRepresentable { | |
| //filename을 인자로 받습니다. | |
| @Binding var step:CGFloat | |
| ////생략 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct ContentView: View { | |
| @State var filename = "loading" | |
| var body: some View { | |
| VStack{ | |
| //값을 전달합니다. | |
| LottieView(filename: $filename) | |
| HStack{ | |
| Button( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct LottieView: UIViewRepresentable { | |
| //filename을 바인딩 프로퍼티래퍼로 받습니다. | |
| @Binding var filename:String | |
| ///////////////// | |
| //////생략 | |
| ///////////////// | |
| //애니메이션이 계속 반복되게합니다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct ContentView: View { | |
| var body: some View { | |
| VStack{ | |
| LottieView(filename: "loading") | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| import Lottie | |
| struct LottieView: UIViewRepresentable { | |
| //makeCoordinator를 구현하여 제약사항을 구현합니다. | |
| func makeCoordinator() -> Coordinator { | |
| Coordinator(self) | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @State var text = "hello world" | |
| var body: some View { | |
| VStack{ | |
| MyTextView(text: $text) | |
| } | |
| } |