Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. struct MessageView : View {
  2. var body: some View {
  3. HStack {
  4. HStack(alignment: .center) {
  5. RoundImage(image: Image("turtlerock"))
  6. .frame(width: 35)
  7. .alignmentGuide(.bottomImageAndText) { d in
  8. d[.bottom]
  9. }
  10. VStack(alignment: .leading) {
  11. Text("AR demo from Apple site 🤣 AR demo from Apple site 🤣 AR demo from Apple site 🤣 AR demo from Apple site 🤣")
  12. .fontWeight(.regular)
  13. .padding(EdgeInsets(top: 10, leading: 10, bottom: 10, trailing: 10))
  14. .lineLimit(5)
  15. .border(Color.gray, width: 1, cornerRadius: 15)
  16. .layoutPriority(2)
  17. .alignmentGuide(.bottomImageAndText) { d in
  18. d[.bottom]
  19. }
  20. HStack {
  21. Image(systemName: "heart.fill")
  22. .foregroundColor(.red)
  23. RoundImage(image: Image("turtlerock"))
  24. .frame(height: 16)
  25. }
  26. .padding(.leading)
  27. }
  28. }.padding(EdgeInsets(top: 0, leading: 10, bottom:0 , trailing: 0))
  29. .layoutPriority(1)
  30. Spacer()} }
  31. }
  32.  
  33. extension VerticalAlignment {
  34. private enum BottomImageAndText : AlignmentID {
  35. static func defaultValue(in d: ViewDimensions) -> Length {
  36. return d[.bottom]
  37. }
  38. }
  39.  
  40. static let bottomImageAndText = VerticalAlignment(BottomImageAndText.self)
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement