美文网首页swift
SwiftUI之与UIKit的对照关系

SwiftUI之与UIKit的对照关系

作者: 狂奔的胖蜗牛 | 来源:发表于2019-10-16 14:13 被阅读0次

https://github.com/flywo/SwiftUIPractice
自己写的SwiftUI练习项目,各位看官关注一下。


SwiftUI的组件中,有很多与UIKit是类似的,常用的组件对照表如下:

UIKit SwiftUI
UITableView List
UICollectionView 没有类似
UILabel Text
UITextField TextField
UITextField的isSecureTextEntry=true SecureField
UITextView 没有类似
UISwitch Toggle
UISlider Slider
UIButton Button
UINavigationController NavigationView
UIAlertController的style为.alert Alert
UIAlertController的style为.actionSheet ActionSheet
UIStackView水平排列时 HStack
UIStackView 垂直排列时 VStack
UIImageView Image
UISegmentedControl SegmentedControl
UIStepper Stepper
UIDatePicker DatePicker
NSAttributedString 没有类似,用Text代替
  • 另外,SwiftUI里有很多是UIKit没有的组件。

相关文章

网友评论

    本文标题:SwiftUI之与UIKit的对照关系

    本文链接:https://www.haomeiwen.com/subject/metumctx.html