Anchor preferences in SwiftUI | Majid’s blog about Swift development
Today we will continue mastering view preferences in SwiftUI that we touched a few weeks ago. Anchor preferences are another type of view preferences provided by SwiftUI. The main goal of anchor preferences is to…
Argument passed to call that takes no arguments SwiftUI 5.1
If your getting this error it could be because you have added to many subviews to the main view of your SwiftUI Views body. You are only allows 10 subviews in the main view but…
Custom Text is being cut off at the top SwiftUI 5.1
My Text was looking like the above and I was trying everything to stop the top part being cut off. Here is the solution: I ended up adding \n at the start of the Text…
Comparison Operator Swift 5.1 Challenge
Challenge Find out which string is longer in the below code using a comparison operator Not sure what that is…. You will have to do some research. 🙂 Good luck! HINT – try searching comparison…
Compound Assignment Operator Swift 5.1
Challenge Make the below var change to Hello everyone! by using a compound assignment operator.
Hide back button in NavigationView SwiftUI 5.1
Make sure to place this after the first view element in the body of the Content.
Make the leading and trailing edges of the view fit within the view SwiftUI 5.1
If your textview isn’t fitting in the view how you think it should try this code out. It allows you to customise the padding to your view.
Make a Text view have two lines SwiftUI 5.1
Just use \n to add your new lines to the Text view.
Make a shadow of your text SwiftUI 5.1
The radius amount if increased causes the shadow to become more blurred. When you change the x and y values that will change where the shadow is located in relation to the Text its shadowing.