IbrahimHassan

NewTestSwiftUI

Mar 23rd, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.86 KB | None | 0 0
  1. // Converted by Storyboard to SwiftUI Converter - https://objectivec2swift.com/#/converter/storyboard2swiftui
  2.  
  3. import SwiftUI
  4.  
  5. // --------------------------------------------------------------------------------
  6. // MainMenuViewController
  7. // --------------------------------------------------------------------------------
  8. struct MainMenuView: View {
  9. var body: some View {
  10. GeometryReader { geometry in
  11. ZStack(alignment: .topLeading) {
  12. Button(action: {}) {
  13. Text("PLAY")
  14. .frame(width: 264, height: 54, alignment: .center)
  15. }
  16. .aspectRatio(contentMode: .fill)
  17. .clipped()
  18. .font(.custom("HelveticaNeue-Light", size: 35))
  19. .offset(x: 55, y: 276)
  20. GetAttributedString()
  21. .offset(x: 50, y: 103)
  22. .frame(width: 275, height: 54)
  23.  
  24. }
  25. .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .topLeading)
  26. }
  27. }
  28. }
  29.  
  30. struct GetAttributedString: View {
  31.  
  32. var body: some View {
  33. Text("Tap")
  34. .foregroundColor(Color(red: 1.0, green: 0.2784314, blue: 0.101960786))
  35. .font(.custom("HelveticaNeue-Medium", size: 45))
  36. + Text(" ")
  37. .font(.custom("HelveticaNeue-Medium", size: 45))
  38. + Text("Tap")
  39. .foregroundColor(Color(red: 0.0, green: 0.8, blue: 0.4))
  40. .font(.custom("HelveticaNeue-Medium", size: 45))
  41. + Text(" ")
  42. .font(.custom("HelveticaNeue-Medium", size: 45))
  43. + Text("Too")
  44. .foregroundColor(Color(red: 0.0, green: 0.4, blue: 0.8))
  45. .font(.custom("HelveticaNeue-Medium", size: 45))
  46. }
  47. }
  48.  
  49. struct MainMenuView_Previews: PreviewProvider {
  50. static var previews: some View {
  51. MainMenuView()
  52. }
  53. }
  54. // --------------------------------------------------------------------------------
  55. // InGameViewController
  56. // --------------------------------------------------------------------------------
  57. struct InGameView: View {
  58. var body: some View {
  59. GeometryReader { geometry in
  60. ZStack(alignment: .topLeading) {
  61. Button(action: {
  62. //tap()
  63. }) {
  64. Text("Button 1\nTest").frame(width: 375, height: 310, alignment: .topLeading)
  65. }
  66. .aspectRatio(contentMode: .fill)
  67. .foregroundColor(Color(red: 0.5738505, green: 1.0, blue: 0.19474524))
  68. .background(Color(red: 1.0, green: 0.2784314, blue: 0.101960786, opacity: 0.75))
  69. .accentColor(Color(red: 0.63529414, green: 0.5176471, blue: 0.36862746))
  70.  
  71. Button(action: {
  72. //tap()
  73. }) {
  74. Text(" MARK: - 👉 ARSCNViewDelegate").frame(width: 375, height: 310)
  75. }
  76. .aspectRatio(contentMode: .fill)
  77. .background(Color(red: 0.0, green: 0.8, blue: 0.4, opacity: 0.75))
  78. .offset(x: 0, y: 357)
  79.  
  80. Text("Label")
  81. .font(.custom("HelveticaNeue-Light", size: 17))
  82. .multilineTextAlignment(.trailing)
  83. .accentColor(Color(red: 1.0, green: 0.23137255, blue: 0.1882353))
  84. .offset(x: 16, y: 319)
  85. .frame(width: 83, height: 31)
  86.  
  87. Text("Label")
  88. .font(.custom("HelveticaNeue-Light", size: 17))
  89. .multilineTextAlignment(.trailing)
  90. .offset(x: 276, y: 318)
  91. .frame(width: 83, height: 31)
  92.  
  93. Text("0")
  94. .font(.custom("HelveticaNeue-Light", size: 17))
  95. .offset(x: 106, y: 319)
  96. .frame(width: 69, height: 31)
  97.  
  98. Text(":")
  99. .font(.custom("HelveticaNeue-Light", size: 17))
  100. .offset(x: 184, y: 323)
  101. .frame(width: 7, height: 21)
  102.  
  103. Text("0")
  104. .font(.custom("HelveticaNeue-Light", size: 17))
  105. .offset(x: 199, y: 318)
  106. .frame(width: 69, height: 31)
  107.  
  108. Text("61")
  109. .font(.title)
  110. .multilineTextAlignment(.center)
  111. .foregroundColor(Color(white: 1.0))
  112. .offset(x: 0, y: 358)
  113. .frame(width: 375, height: 40)
  114.  
  115. Text("60")
  116. .font(.custom("HelveticaNeue", size: 25))
  117. .multilineTextAlignment(.center)
  118. .foregroundColor(Color(white: 1.0))
  119. .offset(x: 0, y: 270)
  120. .frame(width: 375, height: 40)
  121. }
  122. .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .topLeading)
  123. }
  124. }
  125. }
  126.  
  127. struct InGameView_Previews: PreviewProvider {
  128. static var previews: some View {
  129. InGameView()
  130. }
  131. }
Add Comment
Please, Sign In to add comment