Skip to content

hhfa008/SwiftUINow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftUI is available in iOS 13 and later.

But Most App must be backward compatible to iOS 12 and before.

SwiftUINow takes advantage of the new features of Swift 5.x, just like SwiftUI.

SwiftUINow is not limited by iOS version and available in iOS 9 and later.

Note that SwiftUINow must be build in Xcode 11 and later

Example

  • First, write UI Code by SwiftUINow
import SwiftUINow
var body: View {
       VStack {
           Text("Hello SwiftUINow").color(.blue)
           ForEach([0,1]){ number in
               Text("Hello SwiftUINow \(number)").color(.blue)
           }
       }
   }
  • Then, show the UI
import SnapKit

//UIViewController.viewDidLoad
override func viewDidLoad() {
       super.viewDidLoad()
       let aView = body.content
       view.addSubview(aView)
       aView.snp.makeConstraints { make in
           make.center.equalToSuperview()
       }
   }

Install by CocoaPods

pod 'SwiftUINow'

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published