Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 573 Bytes

README.md

File metadata and controls

25 lines (21 loc) · 573 Bytes

MJRepresentable

UIView or UIView Controller created using UIKit can be easily converted into view in SwiftUI.

Example

struct ContentView: View {
    var body: some View {
    
        UILabel()
            .set(\.backgroundColor, value: .red)
            .set(\.text, value: "asdfasdf")
            .swiftUIView()
            .fixedSize()
        
        MJViewRepresenter {
            let b = UIButton()
            b.setTitle("asdfasdf", for: .normal)
            b.backgroundColor = .blue
            return b
        }
        .fixedSize()
    }
}