This file contains 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 AMAlbumDetailsView: View { | |
let albumArt: Image | |
let title: String | |
let artist: String | |
let genre: String | |
let releaseYear: String | |
let quality: String | |
let tracks: [String] | |
@State private var playingTrack: String? |
This file contains 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
Apache License | |
Version 2.0, January 2004 | |
http://www.apache.org/licenses/ | |
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |
1. Definitions. | |
"License" shall mean the terms and conditions for use, reproduction, |
This file contains 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 androidx.compose.animation.core.* | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.layout.* | |
import androidx.compose.foundation.shape.CircleShape | |
import androidx.compose.material.MaterialTheme | |
import androidx.compose.material.Text | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.getValue | |
import androidx.compose.ui.Alignment | |
import androidx.compose.ui.Modifier |
This file contains 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
#if DEBUG | |
import SwiftUI | |
struct PreviewProviderModifier: ViewModifier { | |
/// Whether or not a basic light mode preview is included in the group. | |
var includeLightMode: Bool | |
/// Whether or not a basic dark mode preview is included in the group. | |
var includeDarkMode: Bool |
This file contains 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 UIKit | |
private struct ColorConversionError: Swift.Error { | |
let reason: String | |
} | |
extension Color { | |
var uiColor: UIColor { |
This file contains 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 Cocoa | |
extension Collection { | |
func firstMap<T>(_ transform: @escaping (Element) -> T?) -> T? { | |
for element in self { | |
if let transformed = transform(element) { | |
return transformed | |
} | |
} | |
return nil |
This file contains 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 User: Equatable { | |
var firstName: String | |
var lastName: String | |
} | |
@main | |
struct MyApp: App { | |
@State var value = User(firstName: "", lastName: "") | |
@State var showEdit = false | |
This file contains 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 | |
struct ConditionalContent<TrueContent: View, FalseContent: View>: View { | |
let value: Bool | |
let trueContent: () -> TrueContent | |
let falseContent: () -> FalseContent | |
var body: some View { | |
if value { | |
return AnyView(trueContent()) |
This file contains 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 PlaygroundSupport | |
struct iPod: View { | |
var body: some View { | |
VStack(spacing: 40) { | |
Screen() | |
ClickWheel() | |
Spacer() | |
} |
NewerOlder