.nsfw()

SwiftUI โŸฉ Views โŸฉ View Modifiers โŸฉ examples โŸฉ

NSFW ไปฃ่กจใ€ŒNot Safe For Workใ€๏ผŒใ€ŒไธŠ็ญไธๅฎœใ€็š„ๆ„ๆ€ใ€‚้€™ๅ€‹ไพ‹ๅญๅฏไปฅ็”จใ€Œ่งธๆŽงใ€ไพ†ๆŽงๅˆถ่ฆไธ่ฆๅฐ‡ๅœ–็‰‡ๆจก็ณŠๅŒ–ใ€‚

struct ContentView: View {

    var body: some View {
        HStack {
            tiger
            Color.orange.aspectRatio(1, contentMode: .fit)
        }.frame(height: 300)
    }
    
    var tiger: some View {
        // ไนŸๅฏ็”จ Image(playground: "...")
        Image(uiImage: #imageLiteral(resourceName: "tiger.heic"))
            .resizable()
            .scaledToFit()
            .shadow(radius: 4)
            .nsfw()                // โญ๏ธ view modifier: ๐ŸŒ€ .nsfw()
            .padding()
            .background(Color.gray)
    }
}

Last updated