SwiftUI - Text Modifier을 이용하여 스타워즈 효과

김시온·2021년 5월 2일
0

Swift

목록 보기
2/8


import SwiftUI

struct ContentView: View {
    var body: some View {
        Text("""
        The dead speak! The galaxy has heard a mysterious broadcast, a threat of REVENGE in the sinister voice of the late EMPEROR PALPATINE.
                    GENERAL LEIA ORGANA dispatches secret agents to gather intelligence, while REY, the last hope of the Jedi, trains for battle against the diabolical FIRST ORDER.
                    Meanwhile, Supreme Leader KYLO REN rages in search of the phantom Emperor, determined to destroy any threat to his power....
        """)
            .font(.system(.title))
            .fontWeight(.black)
            .foregroundColor(.yellow)
            .background(Color.black)
            .lineLimit(10)
            .multilineTextAlignment(.center)
            .truncationMode(.head)
            .lineSpacing(10.0)
            .padding()
            .rotation3DEffect(
                .degrees(45),
                axis: (x: 1.0, y: 0.0, z: 0.0)
            )
            
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

0개의 댓글