Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
| /* | |
| * Copyright 2026 Kyriakos Georgiopoulos | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| @file:OptIn(ExperimentalPathApi::class) | |
| import kotlin.io.path.* | |
| /** | |
| * This scripts remove all IntelliJ Platform extracted copies from the Gradle Transformer Cache. | |
| */ | |
| fun main() { | |
| val userHome = Path(System.getProperty("user.home")) | |
| val caches = userHome.resolve(".gradle/caches") |
| Kotlin K2 FIR Example. Related Post: https://handstandsam.com/2024/05/30/kotlin-k2-fir-quickstart-guide/ |
| @Stable | |
| fun Modifier.drawHorizontalFadingEdges( | |
| target: Color = Color.White, | |
| width: Dp = 10.dp, | |
| scrollState: ScrollableState, | |
| ) = | |
| if (!scrollState.canScrollForward && !scrollState.canScrollBackward) this | |
| else drawWithCache { | |
| val gradientWidth = width.toPx() |
| class MainActivity : ComponentActivity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContent { | |
| PlaygroundTheme { | |
| Surface( | |
| modifier = Modifier.fillMaxSize(), | |
| color = MaterialTheme.colorScheme.background, | |
| ) { | |
| Box { |
| @Composable | |
| actual fun PlatformColors(statusBarColor: Color, navBarColor: Color){ | |
| val sysUiController = rememberSystemUiController() | |
| SideEffect { | |
| sysUiController.setSystemBarsColor(color = topColor) | |
| sysUiController.setNavigationBarColor(color = bottomColor) | |
| } | |
| } |
| @file:OptIn(ExperimentalComposeUiApi::class) | |
| @file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") | |
| package net.peanuuutz.compose.desktop | |
| import androidx.compose.ui.ExperimentalComposeUiApi | |
| import androidx.compose.ui.Modifier | |
| import androidx.compose.ui.draw.BuildDrawCacheParams | |
| import androidx.compose.ui.draw.CacheDrawScope | |
| import androidx.compose.ui.draw.DrawResult |
์๋ ํ์ธ์! ์ฑ๋น๋๋ ์คํฐ๋ ๊ณต์ง ๋๋ฆฝ๋๋ค. ์ฑ๋น๋๋ ๋ฉ์ธ ํ๋ก์ ํธ ๊ฐ๋ฐ์ ์์ํ๊ธฐ ์ ์ ํ ๋ฌ๊ฐ ์ฝ๋ฃจํด๊ณผ ์๋๋ก์ด๋ ํ๋ ์์ํฌ ๋ด๋ถ ๋ฅ๋ค์ด๋ธ ์คํฐ๋๋ฅผ ์งํํ๋ ค๊ณ ํฉ๋๋ค. ํ์ ํผ์ ๊ณต๋ถํ๋ ํธ์ด์ง๋ง ์๋ ์ด๋ ต๊ณ ์ข์ ์ฃผ์ ์ธ ๋งํผ ํจ๊ป ๊ณต๋ถํด ๋ณด๋ฉด ์ข์ ๊ฑฐ ๊ฐ์ ์คํฐ๋์์ ๋ชจ์งํ๊ฒ ๋์ต๋๋ค.
์ต์ ๋ด์ฉ์ ์ฑ๋น๋๋ ๊ณต์ง๋ฅผ ํตํด ํ์ธํด ์ฃผ์ธ์!
์ด ์คํฐ๋์ ์ฒซ ๋ฒ์งธ ๋ชฉ์ ์ ์์ง๋์ด์ ๊ด์ ์์ ์ญ๋์ ํค์ฐ๊ธฐ ์ํจ์ ๋๋ค. ๋ํ ๋ด๋ถ๋ฅผ ์๊ณ ์ค๊ณํ๋ ๊ฒ๊ณผ ๋ด๋ถ๋ฅผ ๋ชจ๋ฅด๊ณ ์ค๊ณํ๋ ๊ฒ์์ ๋ถ๋ช ํ ์ฐจ์ด๊ฐ ์์์ ์ ๊ฐ ์ปดํฌ์ฆ ๋ด๋ถ ๊ณต๋ถ๋ฅผ ํตํด ๋๊ผ์ผ๋ฏ๋ก ๋ ์ข์ ์๋๋ก์ด๋ ๊ฐ๋ฐ์ ์ํ ๋ชฉ์ ๋ ์์ต๋๋ค.
์ ๊ฐ ์ปดํฌ์ฆ ๋ด๋ถ๋ฅผ ๊ณต๋ถํ๋ฉด์ ๋๋ ์ ์ด ํผ์์ ์ด ๋ง์ ๋ด์ฉ์ ์ดํดํ๊ธฐ๊ฐ ๋๋ฌด ์ด๋ ต๋ค๋ ๊ฑฐ์์ต๋๋ค. ์ด๋ฐ์ ์ด๋ ํ๋ฆ์ ๋ด์ผ ํ ์ง๋ ๋ชจ๋ฅด๊ฒ ์ด์ ๋ฐฉํฉํ๋ ์๊ฐ์ด ๋๋ฌด ๋ง์์ต๋๋ค. ์ด๋ฅผ ๊ทน๋ณตํ๊ธฐ ์ํด ์ ๊ฐ ์๋ํ๋ ์ผ๋ค์ ์ ๊ฐ ์ฐธ๊ณ ํ ์ปดํฌ์ฆ ๋ด๋ถ ๋ ํผ๋ฐ์ค์ ์์ฑ์๋ถ๊ณผ ์ธ๊ตญ ์๋๋ก์ด๋ GDE ์ด์ ๋ถ๋ค, StackOverflow, kotlinlang ์ฌ๋, ๊ทธ๋ฆฌ๊ณ ๊ตฌ๊ธ ์ปดํฌ์ฆ ํ์ ๊ณ์ ๋ถ๋ค์๊ฒ ์ฌ๋ฌ ๋ฒ ์ง๋ฌธ์ ํตํด 6๊ฐ์๊ฐ ์จ๋ฆ ๋์ ๋๋์ด ๋ฐฉํฅ์ ์ก๊ณ ์ดํดํ ์ ์์๊ณ , ์ฑ๋น๋๋์ ์ปดํฌ์ฆ ๋ด๋ถ ๊ธ์ ์์ฑํ ์ ์์์ต๋๋ค.
| package foo.bar | |
| import kotlinx.coroutines.delay | |
| import kotlinx.coroutines.launch | |
| import kotlinx.coroutines.runBlocking | |
| import kotlinx.coroutines.* | |
| private val testingScope = CoroutineScope(CoroutineName("TestingScope")) |