@@ -143,7 +143,7 @@ Example:
143143
144144``` swift
145145Text (" SwiftUI" )
146- .color (.orange )
146+ .foregroundColor (.orange )
147147 .bold ()
148148 .font (.system (.largeTitle ))
149149 .fontWeight (.medium )
@@ -177,7 +177,7 @@ TextField(self.$name, placeholder: self.nameText, onEditingChanged: { changed in
177177}}
178178.padding (10 )
179179.frame (height : 50 )
180- .textFieldStyle (. roundedBorder )
180+ .textFieldStyle (RoundedBorderTextFieldStyle () )
181181.padding (EdgeInsets (top : 0 , leading : 20 , bottom : 0 , trailing : 20 ))
182182
183183```
@@ -201,8 +201,8 @@ The `Image` control is used to display images, example:
201201``` swift
202202Image (" icon" )
203203 .resizable ()
204- .frame (width : Length ( 100 ) ,
205- height : Length ( 100 ) ,
204+ .frame (width : 100 ,
205+ height : 100 ,
206206 alignment : .center )
207207```
208208
@@ -224,10 +224,10 @@ var body: some View {
224224 Image (uiImage : self .uiImage ?? placeholderImage)
225225 .resizable ()
226226 .onAppear (perform : downloadWebImage)
227- .frame (width : Length ( 80 ) ,
228- height : Length ( 80 ) ,
227+ .frame (width : 80 ,
228+ height : 80 ,
229229 alignment : .center )
230- .tapAction {
230+ .onTapGesture {
231231 print (" Tap " )
232232 }
233233 }
@@ -276,9 +276,12 @@ Waiting for release.
276276Example:
277277
278278``` swift
279- NavigationButton (destination : NavigationButtonPage ()) {
280- Text (" NavigationButton" ).bold ().color (.orange ).font (.largeTitle )
281- }.navigationBarItem (title : Text (" Page" ))
279+ NavigationLink (destination : NavigationButtonPage ()) {
280+ Text (" NavigationButton" ).bold ()
281+ .foregroundColor (.orange )
282+ .font (.largeTitle )
283+ }
284+ .navigationBarTitle (Text (" Page" ))
282285```
283286
284287<details close >
@@ -288,23 +291,10 @@ NavigationButton(destination: NavigationButtonPage()) {
288291
289292[ 🔝] ( #Button_D )
290293
291- <h4 id =" PresentationButton " > PresentationButton </h4 >
294+ <h4 id =" PresentationButton " style = ' color : red ' > PresentationButton is deprecated </h4 >
292295
293- ` PresentationButton ` is used to pop up a page.
296+ ` PresentationButton ` ~~ is used to pop up a page.~~ has deprecated, please use ` NavigationLink `
294297
295- Example:
296-
297- ``` swift
298- PresentationButton (PageRow (title : " PresentationButton" , subTitle : " pop up a page" ),
299- destination : Text (" I'm Text" )) {
300- print (" Present 🦄" )
301- }
302- ```
303-
304- <details close >
305- <summary >View running results</summary >
306- <img width =" 40% " src =" images/example/PresentationButton.png " />
307- </details >
308298
309299[ 🔝] ( #Button_D )
310300
@@ -358,16 +348,12 @@ Picker(selection: $leftIndex, label: Text("Picker")) {
358348Example:
359349
360350``` swift
361- DatePicker (
362- $server.date ,
363- minimumDate : Calendar.current .date (byAdding : .year ,
364- value : -1 ,
365- to : server.date ),
366- maximumDate : Calendar.current .date (byAdding : .year ,
367- value : 1 ,
368- to : server.date ),
369- displayedComponents : .date
370- )
351+
352+ DatePicker (selection : $server.date ,
353+ in : server.spaceDate ,
354+ displayedComponents : .date , label : {
355+ Text (" " )
356+ })
371357```
372358
373359<details close >
@@ -428,7 +414,7 @@ Stepper(value: $value, step: 2, onEditingChanged: { c in
428414
429415[ 🔝] ( #Picker_D )
430416
431- <h4 id =" SegmentedControl " > SegmentedControl </h4 >
417+ <h4 id =" SegmentedControl " style = " color : red " > SegmentedControl is deprecated </h4 >
432418
433419` SegmentedControl ` is used for segmentation condition selection, example:
434420
@@ -615,9 +601,10 @@ ScrollView {
615601 Divider ()
616602 Text (" Views and ... user interface." )
617603 }
618- .border (style, width : 1 ,cornerRadius : 10 )
619- .padding (10 )
620- .navigationBarTitle (Text (" ScrollView" ))
604+ .border (Color.gray .gradient , width : 1 )
605+ .cornerRadius (10 )
606+ .padding (10 )
607+ .navigationBarTitle (Text (" ScrollView" ))
621608```
622609
623610<details close >
@@ -634,7 +621,7 @@ ScrollView {
634621Example:
635622
636623``` swift
637- let data = (0 ..< 5 ). map { $0 }
624+ let data = (0 ..< 5 )
638625var body: some View {
639626 ForEach (data) { e in
640627 Text (" Hello \( e ) " )
@@ -705,9 +692,13 @@ Example:
705692
706693```swift
707694NavigationView {
708- Text (" 🧚♂️🧚♀️🧜♂️🧜♀️🧞♂️🧞♀️" ).blur (radius : 5 )
709- Text (" Swifter Swifter" ).bold ().color (.orange ).font (.largeTitle )
710- }.navigationBarTitle (Text (" NavigationView" ))
695+ Text (" 🧚♂️🧚♀️🧜♂️🧜♀️🧞♂️🧞♀️" ).blur (radius : 5 )
696+ Text (" Swifter Swifter" )
697+ .bold ()
698+ .foregroundColor (.orange )
699+ .font (.largeTitle )
700+ }
701+ .navigationBarTitle (Text (" NavigationView" ))
711702```
712703
713704< details close>
@@ -757,14 +748,17 @@ Waiting for release.
757748Example:
758749
759750```swift
760- presentation ($showsAlert, alert : {
761- Alert (title : Text (" Hello" ))
762- })
751+ alert (isPresented : $showAlert, content : {
752+ Alert (title : Text (" 确定要支付这100000000美元吗?" ),
753+ message : Text (" 请谨慎操作\n 一旦确认,钱款将立即转入对方账户" ),
754+ primaryButton : .destructive (Text (" 确认" )) { print (" 转出中..." ) },
755+ secondaryButton : .cancel ())
756+ }).navigationBarTitle (Text (" Alert" ))
763757```
764758
765759< details close>
766760 < summary> View running results</ summary>
767- < img width= " 80%" src= " images/example/Alert.png " />
761+ < img width= " 80%" src= " images/example/AlertPage.jpg " />
768762</ details>
769763
770764[🔝](#Alert_D )
@@ -792,6 +786,10 @@ ActionSheet(title: Text("Title"),
792786 })])
793787```
794788
789+ usage:
790+ ```swift
791+ .actionSheet (isPresented : $showSheet, content : {sheet})
792+ ```
795793< details close>
796794 < summary> View running results</ summary>
797795< img width= " 80%" src= " images/example/ActionSheet.png" />
@@ -827,9 +825,9 @@ Modal(Text("Modal View"),onDismiss: {
827825Example:
828826
829827```swift
830- Popover ( content : Text ( " Popover View " )) {
831- print ( " Popover Dismiss ! " )
832- }
828+ . popover ( isPresented : $showPop, content : {
829+ ImagePage ( )
830+ })
833831```
834832
835833< details close>
0 commit comments