Advertisement
IbrahimHassan

Untitled

Feb 15th, 2022
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 64.79 KB | None | 0 0
  1. // Converted by Storyboard to SwiftUI Converter - https://swiftify.com/converter/storyboard2swiftui
  2.  
  3. import SwiftUI
  4.  
  5. import Introspect
  6. // TODO: install `SwiftUI-Introspect` package from https://github.com/siteline/SwiftUI-Introspect
  7.  
  8. // --------------------------------------------------------------------------------
  9. // NavAppearanceModifier
  10. // --------------------------------------------------------------------------------
  11. struct NavAppearanceModifier: ViewModifier {
  12. init() {
  13. let navBarAppearance = UINavigationBarAppearance()
  14.  
  15. navBarAppearance.configureWithOpaqueBackground()
  16.  
  17. UINavigationBar.appearance().prefersLargeTitles = true
  18.  
  19. UINavigationBar.appearance().standardAppearance = navBarAppearance
  20. UINavigationBar.appearance().compactAppearance = navBarAppearance
  21. UINavigationBar.appearance().scrollEdgeAppearance = navBarAppearance
  22. }
  23.  
  24. func body(content: Content) -> some View {
  25. content
  26. }
  27. }
  28.  
  29. extension View {
  30. func navigationAppearance() -> some View {
  31. self.modifier(NavAppearanceModifier())
  32. }
  33. }
  34.  
  35. // --------------------------------------------------------------------------------
  36. // LoginViewController
  37. // --------------------------------------------------------------------------------
  38. struct LoginView: View {
  39. @State private var passwordTextEdit = ""
  40. @State private var userNameTextEdit = ""
  41.  
  42. var body: some View {
  43. NavigationView {
  44. ZStack(alignment: .topLeading) {
  45. GeometryReader { geometry in
  46. ScrollView {
  47. VStack() {
  48. Group {
  49. ZStack(alignment: .topLeading) {
  50. GeometryReader { geometry in
  51. Image("logo-ios")
  52. .resizable()
  53. .aspectRatio(contentMode: .fit)
  54. .frame(dynamicWidth: 64, dynamicHeight: 64)
  55. .clipped()
  56. .offset(dynamicX: 8, dynamicY: 28)
  57.  
  58. Text("Tinode")
  59. .frame(dynamicWidth: 160, dynamicHeight: 44, alignment: .center)
  60. .font(.custom("Avenir-Medium", size: 32))
  61. .multilineTextAlignment(.center)
  62. .foregroundColor(Color(red: 0.22352941, green: 0.28627452, blue: 0.67058825))
  63. .offset(dynamicX: 80, dynamicY: 38)
  64. }
  65. }
  66. .frame(dynamicWidth: 260, dynamicHeight: 120)
  67. .background(Color(white: 0.0, opacity: 0.0))
  68.  
  69. Spacer().frame(dynamicHeight: 3)
  70.  
  71. TextField("User name", text: $userNameTextEdit)
  72. .textFieldStyle(RoundedBorderTextFieldStyle())
  73. .introspectTextField(customize: { textField in
  74. textField.adjustsFontSizeToFitWidth = true
  75. textField.isSelected = true
  76. textField.minimumFontSize = 17.0
  77. textField.smartDashesType = .no
  78. textField.smartQuotesType = .no
  79. textField.spellCheckingType = .no
  80. })
  81. .frame(dynamicWidth: 260, dynamicHeight: 40)
  82. .font(.system(size: 18, weight: .regular))
  83. .disableAutocorrection(true)
  84. .textContentType(.username)
  85.  
  86. Spacer().frame(dynamicHeight: 3)
  87.  
  88. ZStack(alignment: .topLeading) {
  89. GeometryReader { geometry in
  90. SecureField("Password", text: $passwordTextEdit)
  91. .textFieldStyle(RoundedBorderTextFieldStyle())
  92. .introspectTextField(customize: { textField in
  93. textField.adjustsFontSizeToFitWidth = true
  94. textField.minimumFontSize = 17.0
  95. textField.smartDashesType = .no
  96. textField.smartInsertDeleteType = .no
  97. textField.smartQuotesType = .no
  98. textField.spellCheckingType = .no
  99. })
  100. .frame(dynamicWidth: 260, dynamicHeight: 40)
  101. .font(.system(size: 18, weight: .regular))
  102. .disableAutocorrection(true)
  103. .textContentType(.password)
  104.  
  105. Button(action: {
  106. passwordVisibilityClicked()
  107. }) {
  108. Image("eye-30").foregroundColor(Color(white: 0.33333334)).layoutPriority(1.0)
  109. .frame(dynamicWidth: 20, dynamicHeight: 20, alignment: .center)
  110. }
  111. .aspectRatio(contentMode: .fill)
  112. .foregroundColor(Color.white)
  113. .offset(dynamicX: 210, dynamicY: 10)
  114.  
  115. Button(action: {
  116. passwordVisibilityClicked()
  117. }) {
  118. Image("invisible-30").foregroundColor(Color(white: 0.33333334)).layoutPriority(1.0)
  119. .frame(dynamicWidth: 20, dynamicHeight: 20, alignment: .center)
  120. }
  121. .aspectRatio(contentMode: .fill)
  122. .foregroundColor(Color.white)
  123. .offset(dynamicX: 210, dynamicY: 10)
  124. .hidden()
  125. }
  126. }
  127. .frame(dynamicWidth: 260, dynamicHeight: 40)
  128.  
  129. Spacer().frame(dynamicHeight: 3)
  130.  
  131. Button(action: {}) {
  132. Text("Forgot password?").lineLimit(1).font(.system(size: 16, weight: .light))
  133. .frame(dynamicWidth: 260, dynamicHeight: 32, alignment: .trailing)
  134. }
  135. .font(.system(size: 16, weight: .light))
  136. .foregroundColor(Color(white: 0.33333334))
  137.  
  138. Spacer().frame(dynamicHeight: 3)
  139.  
  140. Button(action: {
  141. loginClicked()
  142. }) {
  143. Text("Sign In").lineLimit(1).font(.system(size: 20, weight: .medium))
  144. .frame(dynamicWidth: 260, dynamicHeight: 36, alignment: .center)
  145. }
  146. .aspectRatio(contentMode: .fill)
  147. .font(.system(size: 20, weight: .medium))
  148.  
  149. Spacer().frame(dynamicHeight: 3)
  150. }
  151.  
  152. Group {
  153. Button(action: {}) {
  154. Text("Sign Up").lineLimit(1).font(.system(size: 18, weight: .regular))
  155. .frame(dynamicWidth: 260, dynamicHeight: 60, alignment: .bottom)
  156. }
  157. .aspectRatio(contentMode: .fill)
  158. .font(.system(size: 18, weight: .regular))
  159. }
  160. }
  161. .frame(dynamicWidth: 260, dynamicHeight: 343)
  162. .offset(dynamicX: 30, dynamicY: 16)
  163. }
  164. .introspectScrollView(customize: { scrollView in
  165. scrollView.clipsToBounds = true
  166. scrollView.showsHorizontalScrollIndicator = false
  167. })
  168. .frame(dynamicWidth: 320, dynamicHeight: 522)
  169. .offset(dynamicX: 47, dynamicY: 0)
  170. }
  171. }
  172. .frame(dynamicWidth: 414, dynamicHeight: 736)
  173. .edgesIgnoringSafeArea(.all)
  174. .navigationBarTitleDisplayMode(.automatic)
  175. }
  176. }
  177. }
  178.  
  179. struct LoginView_Previews: PreviewProvider {
  180. static var previews: some View {
  181. LoginView()
  182. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  183. .previewInterfaceOrientation(.portrait)
  184. .preferredColorScheme(.light)
  185. }
  186. }
  187.  
  188. // --------------------------------------------------------------------------------
  189. // ResetPasswordViewController
  190. // --------------------------------------------------------------------------------
  191. struct ResetPasswordView: View {
  192. @State private var credentialTextField = ""
  193.  
  194. var body: some View {
  195. NavigationView {
  196. ZStack(alignment: .topLeading) {
  197. GeometryReader { geometry in
  198. Text("Get reset code by email or phone")
  199. .frame(dynamicWidth: 318, dynamicHeight: 21, alignment: .leading)
  200. .font(.system(size: 17, weight: .regular))
  201. .offset(dynamicX: 48, dynamicY: 112)
  202.  
  203. TextField("", text: $credentialTextField)
  204. .textFieldStyle(RoundedBorderTextFieldStyle())
  205. .introspectTextField(customize: { textField in
  206. textField.adjustsFontSizeToFitWidth = true
  207. textField.minimumFontSize = 17.0
  208. })
  209. .frame(dynamicWidth: 318, dynamicHeight: 40)
  210. .font(.system(size: 18, weight: .regular))
  211. .offset(dynamicX: 48, dynamicY: 141)
  212.  
  213. Button(action: {
  214. onConfirm()
  215. }) {
  216. Text("Request").lineLimit(1).font(.system(size: 20, weight: .medium))
  217. .frame(dynamicWidth: 75, dynamicHeight: 36, alignment: .center)
  218. }
  219. .aspectRatio(contentMode: .fill)
  220. .font(.system(size: 20, weight: .medium))
  221. .offset(dynamicX: 169.67, dynamicY: 201)
  222. }
  223. }
  224. .frame(dynamicWidth: 414, dynamicHeight: 736)
  225. .edgesIgnoringSafeArea(.all)
  226. .navigationTitle("Reset Password")
  227. .navigationBarTitleDisplayMode(.automatic)
  228. }
  229. }
  230. }
  231.  
  232. struct ResetPasswordView_Previews: PreviewProvider {
  233. static var previews: some View {
  234. ResetPasswordView()
  235. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  236. .previewInterfaceOrientation(.portrait)
  237. .preferredColorScheme(.light)
  238. }
  239. }
  240.  
  241. // --------------------------------------------------------------------------------
  242. // ChatListViewController
  243. // --------------------------------------------------------------------------------
  244. struct ChatListView: View {
  245. @State private var tableViewItems = ["", "", "", "", "", ""]
  246. @State private var selectedTableViewItem: String?
  247.  
  248. var body: some View {
  249. NavigationView {
  250. List {
  251. ForEach(tableViewItems, id: \.self) { tableViewItem in
  252. CustomTableViewCell()
  253. .listRowInsets(EdgeInsets())
  254. .contentShape(Rectangle())
  255. // It seems that you do not have a UITableViewCell added from the storyboard.
  256. // If you have added the TableViewCell through a XIB, please convert the XIB and copy the result here.
  257. }
  258. }
  259. .introspectTableView(customize: { tableView in
  260. tableView.alwaysBounceHorizontal = true
  261. tableView.alwaysBounceVertical = true
  262. tableView.clipsToBounds = true
  263. })
  264. .listStyle(.plain)
  265. .navigationTitle("Tinode")
  266. .navigationBarTitleDisplayMode(.automatic)
  267. .navigationBarItems(leading: Button(action: {}) {
  268. Text("Profile")
  269. },
  270. trailing: Button(action: {}) {
  271. Text("New Chat")
  272. })
  273. .navigationAppearance()
  274. }
  275. }
  276. }
  277.  
  278. struct ChatListView_Previews: PreviewProvider {
  279. static var previews: some View {
  280. ChatListView()
  281. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  282. .previewInterfaceOrientation(.portrait)
  283. .preferredColorScheme(.light)
  284. }
  285. }
  286.  
  287. // --------------------------------------------------------------------------------
  288. // MessageViewController
  289. // --------------------------------------------------------------------------------
  290. struct MessageView: View {
  291. var body: some View {
  292. NavigationView {
  293. ZStack(content: {})
  294. .frame(dynamicWidth: 414, dynamicHeight: 736)
  295. .edgesIgnoringSafeArea(.all)
  296. .navigationBarTitleDisplayMode(.automatic)
  297. }
  298. }
  299. }
  300.  
  301. struct MessageView_Previews: PreviewProvider {
  302. static var previews: some View {
  303. MessageView()
  304. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  305. .previewInterfaceOrientation(.portrait)
  306. .preferredColorScheme(.light)
  307. }
  308. }
  309.  
  310. // --------------------------------------------------------------------------------
  311. // ImagePreviewController
  312. // --------------------------------------------------------------------------------
  313. struct ImagePreviewView: View {
  314. @State private var contentTypeLabel = "image/jpeg"
  315. @State private var fileNameLabel = "placeholder_file_name"
  316. @State private var sizeLabel = "128x365; 35KB"
  317.  
  318. var body: some View {
  319. NavigationView {
  320. ZStack(alignment: .topLeading) {
  321. GeometryReader { geometry in
  322. ScrollView {
  323. Image("")
  324. .resizable()
  325. .aspectRatio(contentMode: .fit)
  326. .frame(dynamicWidth: 413, dynamicHeight: 593.67)
  327. .clipped()
  328. }
  329. .clipped()
  330. .frame(dynamicWidth: 413, dynamicHeight: 593.67)
  331. .offset(dynamicX: 0, dynamicY: 96)
  332.  
  333. HStack() {
  334. VStack() {
  335. Text("File name:")
  336. .frame(dynamicWidth: 130, dynamicHeight: 20.33, alignment: .leading)
  337. .font(.system(size: 17, weight: .semibold))
  338.  
  339. Spacer().frame(dynamicHeight: 0)
  340.  
  341. Text(fileNameLabel)
  342. .frame(dynamicWidth: 130, dynamicHeight: 18, alignment: .leading)
  343. .font(.system(size: 15, weight: .regular))
  344. }
  345. .frame(dynamicWidth: 130, dynamicHeight: 38.33)
  346.  
  347. Spacer().frame(dynamicWidth: 0)
  348.  
  349. VStack() {
  350. Text("Content type:")
  351. .frame(dynamicWidth: 130, dynamicHeight: 20.33, alignment: .leading)
  352. .font(.system(size: 17, weight: .semibold))
  353.  
  354. Spacer().frame(dynamicHeight: 0)
  355.  
  356. Text(contentTypeLabel)
  357. .frame(dynamicWidth: 130, dynamicHeight: 18, alignment: .leading)
  358. .font(.system(size: 15, weight: .regular))
  359. }
  360. .frame(dynamicWidth: 130, dynamicHeight: 38.33)
  361.  
  362. Spacer().frame(dynamicWidth: 0)
  363.  
  364. VStack() {
  365. Text("Size:")
  366. .frame(dynamicWidth: 130, dynamicHeight: 20.33, alignment: .leading)
  367. .font(.system(size: 17, weight: .semibold))
  368.  
  369. Spacer().frame(dynamicHeight: 0)
  370.  
  371. Text(sizeLabel)
  372. .frame(dynamicWidth: 130, dynamicHeight: 18, alignment: .leading)
  373. .font(.system(size: 15, weight: .regular))
  374. }
  375. .frame(dynamicWidth: 130, dynamicHeight: 38.33)
  376. }
  377. .frame(dynamicWidth: 406, dynamicHeight: 38.33)
  378. .offset(dynamicX: 8, dynamicY: 697.67)
  379. }
  380. }
  381. .frame(dynamicWidth: 414, dynamicHeight: 736)
  382. .edgesIgnoringSafeArea(.all)
  383. .navigationTitle("Image Preview")
  384. .navigationBarTitleDisplayMode(.automatic)
  385. .navigationBarItems(trailing: Button(action: {}) {
  386. Image(systemName: "square.and.arrow.up")
  387. })
  388. }
  389. }
  390. }
  391.  
  392. struct ImagePreviewView_Previews: PreviewProvider {
  393. static var previews: some View {
  394. ImagePreviewView()
  395. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  396. .previewInterfaceOrientation(.portrait)
  397. .preferredColorScheme(.light)
  398. }
  399. }
  400.  
  401. // --------------------------------------------------------------------------------
  402. // FilePreviewController
  403. // --------------------------------------------------------------------------------
  404. struct FilePreviewView: View {
  405. @State private var contentTypeLabel = "image/jpeg"
  406. @State private var fileNameLabel = "placeholder_file_name"
  407. @State private var previewView = ""
  408. @State private var sizeLabel = "128x365; 35KB"
  409.  
  410. var body: some View {
  411. NavigationView {
  412. ZStack(alignment: .topLeading) {
  413. GeometryReader { geometry in
  414. ZStack(alignment: .topLeading) {
  415. GeometryReader { geometry in
  416. Image("")
  417. .resizable()
  418. .aspectRatio(contentMode: .fit)
  419. .frame(dynamicWidth: 128, dynamicHeight: 128)
  420. .clipped()
  421. .offset(dynamicX: 143, dynamicY: 224)
  422.  
  423. VStack() {
  424. HStack() {
  425. Text("File name:")
  426. .frame(dynamicWidth: 81, dynamicHeight: 20.33, alignment: .leading)
  427. .font(.system(size: 17, weight: .semibold))
  428.  
  429. Spacer().frame(dynamicWidth: 0)
  430.  
  431. Text(fileNameLabel)
  432. .frame(dynamicWidth: 155.33, dynamicHeight: 20.33, alignment: .trailing)
  433. .font(.system(size: 15, weight: .regular))
  434. .multilineTextAlignment(.trailing)
  435. }
  436. .frame(dynamicWidth: 244.33, dynamicHeight: 20.33)
  437.  
  438. Spacer().frame(dynamicHeight: 0)
  439.  
  440. HStack() {
  441. Text("Content type:")
  442. .frame(dynamicWidth: 109, dynamicHeight: 20.33, alignment: .leading)
  443. .font(.system(size: 17, weight: .semibold))
  444.  
  445. Spacer().frame(dynamicWidth: 0)
  446.  
  447. Text(contentTypeLabel)
  448. .frame(dynamicWidth: 127.33, dynamicHeight: 20.33, alignment: .trailing)
  449. .font(.system(size: 15, weight: .regular))
  450. .multilineTextAlignment(.trailing)
  451. }
  452. .frame(dynamicWidth: 244.33, dynamicHeight: 20.33)
  453.  
  454. Spacer().frame(dynamicHeight: 0)
  455.  
  456. HStack() {
  457. Text("Size: ")
  458. .frame(dynamicWidth: 42.67, dynamicHeight: 20.33, alignment: .leading)
  459. .font(.system(size: 17, weight: .semibold))
  460.  
  461. Spacer().frame(dynamicWidth: 0)
  462.  
  463. Text(sizeLabel)
  464. .frame(dynamicWidth: 193.67, dynamicHeight: 20.33, alignment: .trailing)
  465. .font(.system(size: 15, weight: .regular))
  466. .multilineTextAlignment(.trailing)
  467. }
  468. .frame(dynamicWidth: 244.33, dynamicHeight: 20.33)
  469. }
  470. .frame(dynamicWidth: 244.33, dynamicHeight: 77)
  471. .offset(dynamicX: 85, dynamicY: 360)
  472. }
  473. }
  474. .frame(dynamicWidth: 414, dynamicHeight: 576)
  475. .background(Color(.secondarySystemFill))
  476. .offset(dynamicX: 0, dynamicY: 96)
  477.  
  478. ZStack(alignment: .topLeading) {
  479. GeometryReader { geometry in
  480. Button(action: {
  481. cancelPreviewClicked()
  482. }) {
  483. Text("")
  484. .frame(dynamicWidth: 24.33, dynamicHeight: 24.33, alignment: .center)
  485. }
  486. .aspectRatio(contentMode: .fill)
  487. .foregroundColor(Color.white)
  488. .offset(dynamicX: 8, dynamicY: 10)
  489.  
  490. TextEditor(text: $previewView)
  491. .introspectTextView(customize: { textView in
  492. textView.clipsToBounds = true
  493. textView.isEditable = false
  494. textView.isSelectable = false
  495. })
  496. .frame(dynamicWidth: 318.67, dynamicHeight: 40)
  497. .font(.system(size: 14, weight: .regular))
  498. .foregroundColor(Color(.label))
  499. .offset(dynamicX: 40.33, dynamicY: 2)
  500. .allowsHitTesting(false)
  501. .autocapitalization(.sentences)
  502. }
  503. }
  504. .frame(dynamicWidth: 414, dynamicHeight: 44)
  505. .background(Color(.systemBackground))
  506. .offset(dynamicX: 0, dynamicY: 644)
  507.  
  508. HStack(alignment: .center) {
  509. ZStack(content: {})
  510. .frame(dynamicWidth: 342, dynamicHeight: 1)
  511. .background(Color(.separator))
  512.  
  513. Spacer().frame(dynamicWidth: 0)
  514.  
  515. Button(action: {
  516. sendFileAttachment()
  517. }) {
  518. Image("arrow-up-48").foregroundColor(Color(white: 1.0)).layoutPriority(1.0)
  519. .frame(dynamicWidth: 32, dynamicHeight: 32, alignment: .center)
  520. }
  521. .aspectRatio(contentMode: .fill)
  522. .foregroundColor(Color.white)
  523. .background(Color(red: 0.2509804, green: 0.7529412, blue: 0.2509804))
  524. }
  525. .frame(dynamicWidth: 382, dynamicHeight: 32)
  526. .offset(dynamicX: 16, dynamicY: 688)
  527. }
  528. }
  529. .frame(dynamicWidth: 414, dynamicHeight: 736)
  530. .background(Color(.systemBackground))
  531. .edgesIgnoringSafeArea(.all)
  532. .navigationBarTitleDisplayMode(.automatic)
  533. }
  534. }
  535. }
  536.  
  537. struct FilePreviewView_Previews: PreviewProvider {
  538. static var previews: some View {
  539. FilePreviewView()
  540. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  541. .previewInterfaceOrientation(.portrait)
  542. .preferredColorScheme(.light)
  543. }
  544. }
  545.  
  546. // --------------------------------------------------------------------------------
  547. // EditMembersViewController
  548. // --------------------------------------------------------------------------------
  549. struct EditMembersView: View {
  550. @State private var tableViewItems = ["", "", "", "", ""]
  551. @State private var selectedTableViewItem: String?
  552. // TODO: Replace the `minimumValue` below from the conversion result of UICollectionViewCell XIB
  553. let gridLayout = [GridItem(.adaptive(minimum: 150), spacing: 8)]
  554. @State private var collectionViewItems = ["String"]
  555.  
  556. var body: some View {
  557. NavigationView {
  558. ZStack(alignment: .topLeading) {
  559. GeometryReader { geometry in
  560. ScrollView {
  561. ZStack(alignment: .topLeading) {
  562. GeometryReader { geometry in
  563. Text("GROUP MEMBERS")
  564. .frame(dynamicWidth: 414, dynamicHeight: 40, alignment: .leading)
  565. .font(.custom(".AppleSystemUIFont", size: 13))
  566. .background(Color(.groupTableViewBackground))
  567.  
  568. ScrollView(.vertical) {
  569. LazyVGrid(columns: gridLayout, spacing: 8) {
  570. ForEach(collectionViewItems, id: \.self) { collectionViewItem in
  571. // No UICollectionViewCell cell found in the storyboard
  572. // If you have added the UICollectionViewCell through a `XIB`, please convert the `XIB` and use the result here.
  573. }
  574. }
  575. }
  576. .frame(dynamicWidth: 398, dynamicHeight: 92)
  577. .background(Color(.systemBackground))
  578. .clipped()
  579. .offset(dynamicX: 8, dynamicY: 40)
  580.  
  581. Text("ALL USERS")
  582. .frame(dynamicWidth: 414, dynamicHeight: 40, alignment: .leading)
  583. .font(.custom(".AppleSystemUIFont", size: 13))
  584. .background(Color(.groupTableViewBackground))
  585. .offset(dynamicX: 0, dynamicY: 132)
  586.  
  587. List {
  588. Section(footer: EditMembersViewControllerListFooterView()) {
  589. ForEach(tableViewItems, id: \.self) { tableViewItem in
  590. CustomTableViewCell()
  591. .listRowInsets(EdgeInsets())
  592. .contentShape(Rectangle())
  593.  
  594. // It seems that you do not have a UITableViewCell added from the storyboard.
  595. // If you have added the TableViewCell through a XIB, please convert the XIB and copy the result here.
  596. }
  597. }
  598. }
  599. .introspectTableView(customize: { tableView in
  600. tableView.alwaysBounceHorizontal = true
  601. tableView.alwaysBounceVertical = true
  602. tableView.clipsToBounds = true
  603. })
  604. .frame(dynamicWidth: 414, dynamicHeight: 488)
  605. .listStyle(.plain)
  606. .offset(dynamicX: 0, dynamicY: 172)
  607. }
  608. }
  609. .frame(dynamicWidth: 414, dynamicHeight: 660)
  610. }
  611. .clipped()
  612. .frame(dynamicWidth: 414, dynamicHeight: 660)
  613. .offset(dynamicX: 0, dynamicY: 56)
  614. }
  615. }
  616. .navigationTitle("Edit Members")
  617. .navigationBarTitleDisplayMode(.automatic)
  618. .navigationBarItems(leading: Button(action: {}) {
  619. Text("Cancel")
  620. },
  621. trailing: Button(action: {}) {
  622. Text("Save")
  623. })
  624. }
  625. }
  626. }
  627.  
  628. struct EditMembersView_Previews: PreviewProvider {
  629. static var previews: some View {
  630. EditMembersView()
  631. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  632. .previewInterfaceOrientation(.portrait)
  633. .preferredColorScheme(.light)
  634. }
  635. }
  636.  
  637. // --------------------------------------------------------------------------------
  638. // CredentialsViewController
  639. // --------------------------------------------------------------------------------
  640. struct CredentialsView: View {
  641. @State private var codeText = ""
  642.  
  643. var body: some View {
  644. NavigationView {
  645. ZStack(alignment: .topLeading) {
  646. GeometryReader { geometry in
  647. TextField("", text: $codeText)
  648. .textFieldStyle(RoundedBorderTextFieldStyle())
  649. .introspectTextField(customize: { textField in
  650. textField.adjustsFontSizeToFitWidth = true
  651. textField.minimumFontSize = 17.0
  652. })
  653. .frame(dynamicWidth: 334, dynamicHeight: 34)
  654. .font(.system(size: 14, weight: .regular))
  655. .offset(dynamicX: 40, dynamicY: 162.33)
  656.  
  657. Text("Confirmation code")
  658. .frame(dynamicWidth: 334, dynamicHeight: 50.33, alignment: .leading)
  659. .font(.system(size: 17, weight: .regular))
  660. .offset(dynamicX: 40, dynamicY: 104)
  661.  
  662. Button(action: {
  663. onConfirm()
  664. }) {
  665. Text("Confirm").lineLimit(1).font(.system(size: 20, weight: .medium))
  666. .frame(dynamicWidth: 73, dynamicHeight: 36, alignment: .center)
  667. }
  668. .aspectRatio(contentMode: .fill)
  669. .font(.system(size: 20, weight: .medium))
  670. .offset(dynamicX: 170.67, dynamicY: 216.33)
  671. }
  672. }
  673. .frame(dynamicWidth: 414, dynamicHeight: 736)
  674. .edgesIgnoringSafeArea(.all)
  675. .navigationTitle("Confirm credentials")
  676. .navigationBarTitleDisplayMode(.automatic)
  677. }
  678. }
  679. }
  680.  
  681. struct CredentialsView_Previews: PreviewProvider {
  682. static var previews: some View {
  683. CredentialsView()
  684. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  685. .previewInterfaceOrientation(.portrait)
  686. .preferredColorScheme(.light)
  687. }
  688. }
  689.  
  690. // --------------------------------------------------------------------------------
  691. // AddByIDViewController
  692. // --------------------------------------------------------------------------------
  693. struct AddByIDView: View {
  694. @State private var idTextField = ""
  695.  
  696. var body: some View {
  697. ZStack(alignment: .topLeading) {
  698. GeometryReader { geometry in
  699. Text("Topic or user ID")
  700. .frame(dynamicWidth: 382, dynamicHeight: 21, alignment: .leading)
  701. .font(.system(size: 17, weight: .regular))
  702. .offset(dynamicX: 16, dynamicY: 112)
  703.  
  704. TextField("usr123aBcDef", text: $idTextField)
  705. .textFieldStyle(RoundedBorderTextFieldStyle())
  706. .introspectTextField(customize: { textField in
  707. textField.adjustsFontSizeToFitWidth = true
  708. textField.minimumFontSize = 17.0
  709. })
  710. .frame(dynamicWidth: 382, dynamicHeight: 34)
  711. .font(.system(size: 14, weight: .regular))
  712. .offset(dynamicX: 16, dynamicY: 141)
  713.  
  714. Button(action: {
  715. okayClicked()
  716. }) {
  717. Text("OK").lineLimit(1).font(.system(size: 20, weight: .medium))
  718. .frame(dynamicWidth: 30, dynamicHeight: 36, alignment: .center)
  719. }
  720. .aspectRatio(contentMode: .fill)
  721. .font(.system(size: 20, weight: .medium))
  722. .offset(dynamicX: 192, dynamicY: 191)
  723. }
  724. }
  725. .frame(dynamicWidth: 414, dynamicHeight: 736)
  726. .edgesIgnoringSafeArea(.all)
  727. }
  728. }
  729.  
  730. struct AddByIDView_Previews: PreviewProvider {
  731. static var previews: some View {
  732. AddByIDView()
  733. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  734. .previewInterfaceOrientation(.portrait)
  735. .preferredColorScheme(.light)
  736. }
  737. }
  738.  
  739. // --------------------------------------------------------------------------------
  740. // SignupViewController
  741. // --------------------------------------------------------------------------------
  742. struct SignupView: View {
  743. @State private var tableViewItems = ["String", "", "", "", "", ""]
  744.  
  745. var body: some View {
  746. List {
  747. Section(footer: SignupViewControllerListFooterView()) {
  748. ForEach(tableViewItems, id: \.self) { tableViewItem in
  749. CustomTableViewCell()
  750. .listRowInsets(EdgeInsets())
  751. .contentShape(Rectangle())
  752.  
  753. // It seems that you do not have a UITableViewCell added from the storyboard.
  754. // If you have added the TableViewCell through a XIB, please convert the XIB and copy the result here.
  755. }
  756. }
  757. }
  758. .introspectTableView(customize: { tableView in
  759. tableView.alwaysBounceHorizontal = true
  760. tableView.alwaysBounceVertical = true
  761. tableView.clipsToBounds = true
  762. tableView.separatorInset = UIEdgeInsets(top: 0.0, left: 18.0, bottom: 0.0, right: 18.0)
  763. })
  764. .frame(dynamicWidth: 414, dynamicHeight: 736)
  765. .listStyle(.plain)
  766. }
  767. }
  768.  
  769. struct SignupView_Previews: PreviewProvider {
  770. static var previews: some View {
  771. SignupView()
  772. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  773. .previewInterfaceOrientation(.portrait)
  774. .preferredColorScheme(.light)
  775. }
  776. }
  777.  
  778. // --------------------------------------------------------------------------------
  779. // SettingsPersonalViewController
  780. // --------------------------------------------------------------------------------
  781. struct SettingsPersonalView: View {
  782. @State private var tableViewItems = ["String", "", "", "", "", "", ""]
  783. @State private var selectedTableViewItem: String?
  784.  
  785. var body: some View {
  786. NavigationView {
  787. List {
  788. ForEach(tableViewItems, id: \.self) { tableViewItem in
  789. CustomTableViewCell()
  790. .listRowInsets(EdgeInsets())
  791. .contentShape(Rectangle())
  792. // It seems that you do not have a UITableViewCell added from the storyboard.
  793. // If you have added the TableViewCell through a XIB, please convert the XIB and copy the result here.
  794. }
  795. }
  796. .introspectTableView(customize: { tableView in
  797. tableView.alwaysBounceHorizontal = true
  798. tableView.alwaysBounceVertical = true
  799. tableView.clipsToBounds = true
  800. })
  801. .listStyle(.grouped)
  802. .navigationTitle("Personal")
  803. .navigationBarTitleDisplayMode(.automatic)
  804. }
  805. }
  806. }
  807.  
  808. struct SettingsPersonalView_Previews: PreviewProvider {
  809. static var previews: some View {
  810. SettingsPersonalView()
  811. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  812. .previewInterfaceOrientation(.portrait)
  813. .preferredColorScheme(.light)
  814. }
  815. }
  816.  
  817. // --------------------------------------------------------------------------------
  818. // SettingsSecurityViewController
  819. // --------------------------------------------------------------------------------
  820. struct SettingsSecurityView: View {
  821. @State private var tableViewItems = ["", "", "", "", "", ""]
  822. @State private var selectedTableViewItem: String?
  823.  
  824. var body: some View {
  825. NavigationView {
  826. List {
  827. ForEach(tableViewItems, id: \.self) { tableViewItem in
  828. CustomTableViewCell()
  829. .listRowInsets(EdgeInsets())
  830. .contentShape(Rectangle())
  831. // It seems that you do not have a UITableViewCell added from the storyboard.
  832. // If you have added the TableViewCell through a XIB, please convert the XIB and copy the result here.
  833. }
  834. }
  835. .introspectTableView(customize: { tableView in
  836. tableView.alwaysBounceHorizontal = true
  837. tableView.alwaysBounceVertical = true
  838. tableView.clipsToBounds = true
  839. })
  840. .listStyle(.grouped)
  841. .navigationTitle("Account and Security")
  842. .navigationBarTitleDisplayMode(.automatic)
  843. }
  844. }
  845. }
  846.  
  847. struct SettingsSecurityView_Previews: PreviewProvider {
  848. static var previews: some View {
  849. SettingsSecurityView()
  850. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  851. .previewInterfaceOrientation(.portrait)
  852. .preferredColorScheme(.light)
  853. }
  854. }
  855.  
  856. // --------------------------------------------------------------------------------
  857. // AccountSettingsViewController
  858. // --------------------------------------------------------------------------------
  859. struct AccountSettingsView: View {
  860. @State private var tableViewItems = [""]
  861. @State private var selectedTableViewItem: String?
  862.  
  863. var body: some View {
  864. NavigationView {
  865. List {
  866. ForEach(tableViewItems, id: \.self) { tableViewItem in
  867. // It seems that you do not have a UITableViewCell added from the storyboard.
  868. // If you have added the TableViewCell through a XIB, please convert the XIB and copy the result here.
  869. }
  870. }
  871. .introspectTableView(customize: { tableView in
  872. tableView.alwaysBounceHorizontal = true
  873. tableView.alwaysBounceVertical = true
  874. tableView.clipsToBounds = true
  875. })
  876. .listStyle(.grouped)
  877. .navigationBarTitleDisplayMode(.automatic)
  878. }
  879. }
  880. }
  881.  
  882. struct AccountSettingsView_Previews: PreviewProvider {
  883. static var previews: some View {
  884. AccountSettingsView()
  885. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  886. .previewInterfaceOrientation(.portrait)
  887. .preferredColorScheme(.light)
  888. }
  889. }
  890.  
  891. // --------------------------------------------------------------------------------
  892. // TopicInfoViewController
  893. // --------------------------------------------------------------------------------
  894. struct TopicInfoView: View {
  895. @State private var tableViewItems = ["", "", "", "", "", ""]
  896. @State private var selectedTableViewItem: String?
  897.  
  898. var body: some View {
  899. NavigationView {
  900. List {
  901. ForEach(tableViewItems, id: \.self) { tableViewItem in
  902. CustomTableViewCell()
  903. .listRowInsets(EdgeInsets())
  904. .contentShape(Rectangle())
  905.  
  906. // It seems that you do not have a UITableViewCell added from the storyboard.
  907. // If you have added the TableViewCell through a XIB, please convert the XIB and copy the result here.
  908. }
  909. }
  910. .introspectTableView(customize: { tableView in
  911. tableView.alwaysBounceHorizontal = true
  912. tableView.alwaysBounceVertical = true
  913. tableView.clipsToBounds = true
  914. })
  915. .listStyle(.grouped)
  916. .navigationTitle("Settings")
  917. .navigationBarTitleDisplayMode(.automatic)
  918. }
  919. }
  920. }
  921.  
  922. struct TopicInfoView_Previews: PreviewProvider {
  923. static var previews: some View {
  924. TopicInfoView()
  925. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  926. .previewInterfaceOrientation(.portrait)
  927. .preferredColorScheme(.light)
  928. }
  929. }
  930.  
  931. // --------------------------------------------------------------------------------
  932. // ArchivedChatsTableViewController
  933. // --------------------------------------------------------------------------------
  934. struct ArchivedChatsTableView: View {
  935. @State private var tableViewItems = ["", "", "", "", "", "", ""]
  936. @State private var selectedTableViewItem: String?
  937.  
  938. var body: some View {
  939. NavigationView {
  940. List {
  941. Section(footer: ArchivedChatsTableViewControllerListFooterView()) {
  942. ForEach(tableViewItems, id: \.self) { tableViewItem in
  943. CustomTableViewCell()
  944. .listRowInsets(EdgeInsets())
  945. .contentShape(Rectangle())
  946. // It seems that you do not have a UITableViewCell added from the storyboard.
  947. // If you have added the TableViewCell through a XIB, please convert the XIB and copy the result here.
  948. }
  949. }
  950. }
  951. .introspectTableView(customize: { tableView in
  952. tableView.alwaysBounceHorizontal = true
  953. tableView.alwaysBounceVertical = true
  954. tableView.clipsToBounds = true
  955. })
  956. .listStyle(.plain)
  957. .navigationTitle("Archived chats")
  958. .navigationBarTitleDisplayMode(.automatic)
  959. }
  960. }
  961. }
  962.  
  963. struct ArchivedChatsTableView_Previews: PreviewProvider {
  964. static var previews: some View {
  965. ArchivedChatsTableView()
  966. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  967. .previewInterfaceOrientation(.portrait)
  968. .preferredColorScheme(.light)
  969. }
  970. }
  971.  
  972. // --------------------------------------------------------------------------------
  973. // BlockedContactsTableViewController
  974. // --------------------------------------------------------------------------------
  975. struct BlockedContactsTableView: View {
  976. @State private var tableViewItems = ["", "", "", "", "", ""]
  977.  
  978. var body: some View {
  979. NavigationView {
  980. List {
  981. Section(header: BlockedContactsTableViewControllerListHeaderView()) {
  982. ForEach(tableViewItems, id: \.self) { tableViewItem in
  983. CustomTableViewCell()
  984. .listRowInsets(EdgeInsets())
  985. .contentShape(Rectangle())
  986.  
  987. // It seems that you do not have a UITableViewCell added from the storyboard.
  988. // If you have added the TableViewCell through a XIB, please convert the XIB and copy the result here.
  989. }
  990. }
  991. }
  992. .introspectTableView(customize: { tableView in
  993. tableView.alwaysBounceHorizontal = true
  994. tableView.alwaysBounceVertical = true
  995. tableView.clipsToBounds = true
  996. })
  997. .listStyle(.plain)
  998. .navigationTitle("Blocked Contacts")
  999. .navigationBarTitleDisplayMode(.automatic)
  1000. }
  1001. }
  1002. }
  1003.  
  1004. struct BlockedContactsTableView_Previews: PreviewProvider {
  1005. static var previews: some View {
  1006. BlockedContactsTableView()
  1007. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  1008. .previewInterfaceOrientation(.portrait)
  1009. .preferredColorScheme(.light)
  1010. }
  1011. }
  1012.  
  1013. // --------------------------------------------------------------------------------
  1014. // SettingsNotificationsViewController
  1015. // --------------------------------------------------------------------------------
  1016. struct SettingsNotificationsView: View {
  1017. @State private var tableViewItems = ["", "", "", "", "", "", ""]
  1018. @State private var selectedTableViewItem: String?
  1019.  
  1020. var body: some View {
  1021. NavigationView {
  1022. List {
  1023. ForEach(tableViewItems, id: \.self) { tableViewItem in
  1024. CustomTableViewCell()
  1025. .listRowInsets(EdgeInsets())
  1026. .contentShape(Rectangle())
  1027.  
  1028. // It seems that you do not have a UITableViewCell added from the storyboard.
  1029. // If you have added the TableViewCell through a XIB, please convert the XIB and copy the result here.
  1030. }
  1031. }
  1032. .introspectTableView(customize: { tableView in
  1033. tableView.alwaysBounceHorizontal = true
  1034. tableView.alwaysBounceVertical = true
  1035. tableView.clipsToBounds = true
  1036. })
  1037. .listStyle(.grouped)
  1038. .navigationTitle("Notifications")
  1039. .navigationBarTitleDisplayMode(.automatic)
  1040. }
  1041. }
  1042. }
  1043.  
  1044. struct SettingsNotificationsView_Previews: PreviewProvider {
  1045. static var previews: some View {
  1046. SettingsNotificationsView()
  1047. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  1048. .previewInterfaceOrientation(.portrait)
  1049. .preferredColorScheme(.light)
  1050. }
  1051. }
  1052.  
  1053. // --------------------------------------------------------------------------------
  1054. // SettingsHelpViewController
  1055. // --------------------------------------------------------------------------------
  1056. struct SettingsHelpView: View {
  1057. @State private var tableViewItems = ["", "", "", "", "", ""]
  1058. @State private var selectedTableViewItem: String?
  1059.  
  1060. var body: some View {
  1061. NavigationView {
  1062. List {
  1063. ForEach(tableViewItems, id: \.self) { tableViewItem in
  1064. CustomTableViewCell()
  1065. .listRowInsets(EdgeInsets())
  1066. .contentShape(Rectangle())
  1067.  
  1068. // It seems that you do not have a UITableViewCell added from the storyboard.
  1069. // If you have added the TableViewCell through a XIB, please convert the XIB and copy the result here.
  1070. }
  1071. }
  1072. .introspectTableView(customize: { tableView in
  1073. tableView.alwaysBounceHorizontal = true
  1074. tableView.alwaysBounceVertical = true
  1075. tableView.clipsToBounds = true
  1076. })
  1077. .listStyle(.grouped)
  1078. .navigationTitle("Help and About")
  1079. .navigationBarTitleDisplayMode(.automatic)
  1080. }
  1081. }
  1082. }
  1083.  
  1084. struct SettingsHelpView_Previews: PreviewProvider {
  1085. static var previews: some View {
  1086. SettingsHelpView()
  1087. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  1088. .previewInterfaceOrientation(.portrait)
  1089. .preferredColorScheme(.light)
  1090. }
  1091. }
  1092.  
  1093. // --------------------------------------------------------------------------------
  1094. // FindViewController
  1095. // --------------------------------------------------------------------------------
  1096. struct FindView: View {
  1097. @State private var tableViewItems = ["String"]
  1098. @State private var selectedTableViewItem: String?
  1099.  
  1100. var body: some View {
  1101. List {
  1102. Section(footer: FindViewControllerListFooterView()) {
  1103. ForEach(tableViewItems, id: \.self) { tableViewItem in
  1104. TableViewCell()
  1105. .listRowInsets(EdgeInsets())
  1106. .contentShape(Rectangle())
  1107. .modifier(SelectionModifier(checked: selectedTableViewItem == tableViewItem))
  1108. .onTapGesture {
  1109. selectedTableViewItem = tableViewItem
  1110. }
  1111. }
  1112. }
  1113. }
  1114. .introspectTableView(customize: { tableView in
  1115. tableView.alwaysBounceHorizontal = true
  1116. tableView.alwaysBounceVertical = true
  1117. tableView.clipsToBounds = true
  1118. })
  1119. .frame(dynamicWidth: 414, dynamicHeight: 736)
  1120. .listStyle(.grouped)
  1121. }
  1122. }
  1123.  
  1124. struct FindView_Previews: PreviewProvider {
  1125. static var previews: some View {
  1126. FindView()
  1127. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  1128. .previewInterfaceOrientation(.portrait)
  1129. .preferredColorScheme(.light)
  1130. }
  1131. }
  1132.  
  1133. // --------------------------------------------------------------------------------
  1134. // NewGroupViewController
  1135. // --------------------------------------------------------------------------------
  1136. struct NewGroupView: View {
  1137. @State private var tableViewItems = ["String", "", "", "", "", "", ""]
  1138. @State private var selectedTableViewItem: String?
  1139.  
  1140. var body: some View {
  1141. List {
  1142. ForEach(tableViewItems, id: \.self) { tableViewItem in
  1143. CustomTableViewCell()
  1144. .listRowInsets(EdgeInsets())
  1145. .contentShape(Rectangle())
  1146.  
  1147. // It seems that you do not have a UITableViewCell added from the storyboard.
  1148. // If you have added the TableViewCell through a XIB, please convert the XIB and copy the result here.
  1149. }
  1150. }
  1151. .introspectTableView(customize: { tableView in
  1152. tableView.alwaysBounceHorizontal = true
  1153. tableView.alwaysBounceVertical = true
  1154. tableView.clipsToBounds = true
  1155. tableView.separatorInset = UIEdgeInsets(top: 0.0, left: 18.0, bottom: 0.0, right: 18.0)
  1156. })
  1157. .frame(dynamicWidth: 414, dynamicHeight: 736)
  1158. .listStyle(.grouped)
  1159. }
  1160. }
  1161.  
  1162. struct NewGroupView_Previews: PreviewProvider {
  1163. static var previews: some View {
  1164. NewGroupView()
  1165. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  1166. .previewInterfaceOrientation(.portrait)
  1167. .preferredColorScheme(.light)
  1168. }
  1169. }
  1170.  
  1171. // --------------------------------------------------------------------------------
  1172. // ForwardToViewController
  1173. // --------------------------------------------------------------------------------
  1174. struct ForwardToView: View {
  1175. @State private var tableViewItems = ["", "", "", "", "", "" ]
  1176. @State private var selectedTableViewItem: String?
  1177.  
  1178. var body: some View {
  1179. NavigationView {
  1180. List {
  1181. Section(footer: ForwardToViewControllerListFooterView()) {
  1182. ForEach(tableViewItems, id: \.self) { tableViewItem in
  1183. TableViewCell1()
  1184. .listRowInsets(EdgeInsets())
  1185. .contentShape(Rectangle())
  1186. .modifier(SelectionModifier(checked: selectedTableViewItem == tableViewItem))
  1187. .onTapGesture {
  1188. selectedTableViewItem = tableViewItem
  1189. }
  1190. }
  1191. }
  1192. }
  1193. .introspectTableView(customize: { tableView in
  1194. tableView.alwaysBounceHorizontal = true
  1195. tableView.alwaysBounceVertical = true
  1196. tableView.clipsToBounds = true
  1197. })
  1198. .listStyle(.plain)
  1199. .navigationTitle("Forward To")
  1200. .navigationBarTitleDisplayMode(.automatic)
  1201. .navigationBarItems(leading: Button(action: {}) {
  1202. Text("Cancel")
  1203. })
  1204. }
  1205. }
  1206. }
  1207.  
  1208. struct ForwardToView_Previews: PreviewProvider {
  1209. static var previews: some View {
  1210. ForwardToView()
  1211. .previewDevice(PreviewDevice(rawValue: "iPhone 8 Plus"))
  1212. .previewInterfaceOrientation(.portrait)
  1213. .preferredColorScheme(.light)
  1214. }
  1215. }
  1216.  
  1217. // --------------------------------------------------------------------------------
  1218. // NewChatTabController
  1219. // --------------------------------------------------------------------------------
  1220. struct NewChatTabView: View {
  1221. var body: some View {
  1222. TabView {
  1223. FindView()
  1224. .tabItem {
  1225. VStack {
  1226. Image("search-25")
  1227.  
  1228. Text("Find")
  1229. }
  1230. }
  1231.  
  1232. NewGroupView()
  1233. .tabItem {
  1234. VStack {
  1235. Image("new-group-25")
  1236.  
  1237. Text("New Group")
  1238. }
  1239. }
  1240.  
  1241. AddByIDView()
  1242. .tabItem {
  1243. VStack {
  1244. Image("data-25")
  1245.  
  1246. Text("By ID")
  1247. }
  1248. }
  1249. }
  1250. .introspectTabBarController(customize: { tabBarController in
  1251. tabBarController.tabBar.backgroundColor = UIColor(white: 0.0, alpha: 0.0)
  1252. })
  1253. }
  1254. }
  1255.  
  1256. // --------------------------------------------------------------------------------
  1257. // BlockedContactsTableViewControllerListHeaderView
  1258. // --------------------------------------------------------------------------------
  1259. struct BlockedContactsTableViewControllerListHeaderView: View {
  1260. var body: some View {
  1261. ZStack(content: {})
  1262. .frame(dynamicWidth: 414, dynamicHeight: 0)
  1263. .background(Color(.systemBackground))
  1264. .listRowInsets(EdgeInsets())
  1265. }
  1266. }
  1267.  
  1268. // --------------------------------------------------------------------------------
  1269. // EditMembersViewControllerListFooterView
  1270. // --------------------------------------------------------------------------------
  1271. struct EditMembersViewControllerListFooterView: View {
  1272. var body: some View {
  1273. ZStack(content: {})
  1274. .frame(dynamicWidth: 414, dynamicHeight: 100)
  1275. .background(Color(.yellow))
  1276. .listRowInsets(EdgeInsets())
  1277. }
  1278. }
  1279.  
  1280. // --------------------------------------------------------------------------------
  1281. // SignupViewControllerListFooterView
  1282. // --------------------------------------------------------------------------------
  1283. struct SignupViewControllerListFooterView: View {
  1284. var body: some View {
  1285. ZStack(content: {})
  1286. .frame(dynamicWidth: 414, dynamicHeight: 44)
  1287. .background(Color(white: 0.0, opacity: 0.0))
  1288. .listRowInsets(EdgeInsets())
  1289. }
  1290. }
  1291.  
  1292. // --------------------------------------------------------------------------------
  1293. // ArchivedChatsTableViewControllerListFooterView
  1294. // --------------------------------------------------------------------------------
  1295. struct ArchivedChatsTableViewControllerListFooterView: View {
  1296. var body: some View {
  1297. ZStack(content: {})
  1298. .frame(dynamicWidth: 414, dynamicHeight: 0)
  1299. .listRowInsets(EdgeInsets())
  1300. }
  1301. }
  1302.  
  1303. // --------------------------------------------------------------------------------
  1304. // FindViewControllerListFooterView
  1305. // --------------------------------------------------------------------------------
  1306. struct FindViewControllerListFooterView: View {
  1307. var body: some View {
  1308. ZStack(content: {})
  1309. .frame(dynamicWidth: 414, dynamicHeight: 0)
  1310. .background(Color(white: 1.0))
  1311. .listRowInsets(EdgeInsets())
  1312. }
  1313. }
  1314.  
  1315. // --------------------------------------------------------------------------------
  1316. // ForwardToViewControllerListFooterView
  1317. // --------------------------------------------------------------------------------
  1318. struct ForwardToViewControllerListFooterView: View {
  1319. var body: some View {
  1320. ZStack(content: {})
  1321. .frame(dynamicWidth: 414, dynamicHeight: 0)
  1322. .background(Color(white: 1.0))
  1323. .listRowInsets(EdgeInsets())
  1324. }
  1325. }
  1326.  
  1327. // --------------------------------------------------------------------------------
  1328. // TableViewCell
  1329. // --------------------------------------------------------------------------------
  1330. struct TableViewCell: View {
  1331. var body: some View {
  1332. Text("No results")
  1333. .frame(dynamicWidth: 358, dynamicHeight: 30, alignment: .center)
  1334. .font(.system(size: 20, weight: .light))
  1335. .multilineTextAlignment(.center)
  1336. .foregroundColor(Color(.secondaryLabel))
  1337. .offset(dynamicX: 28, dynamicY: 15)
  1338. }
  1339. }
  1340.  
  1341. // --------------------------------------------------------------------------------
  1342. // TableViewCell1
  1343. // --------------------------------------------------------------------------------
  1344. struct TableViewCell1: View {
  1345. var body: some View {
  1346. Text("No results")
  1347. .frame(dynamicWidth: 358, dynamicHeight: 30, alignment: .center)
  1348. .font(.system(size: 20, weight: .light))
  1349. .multilineTextAlignment(.center)
  1350. .foregroundColor(Color(.secondaryLabel))
  1351. .offset(dynamicX: 28, dynamicY: 15)
  1352. }
  1353. }
  1354.  
  1355. // --------------------------------------------------------------------------------
  1356. // SelectionModifier
  1357. // --------------------------------------------------------------------------------
  1358. struct SelectionModifier: ViewModifier {
  1359. var checked: Bool = false
  1360. func body(content: Content) -> some View {
  1361. Group {
  1362. if checked {
  1363. content
  1364. .background(Color(UIColor.systemGroupedBackground))
  1365. } else {
  1366. content
  1367. }
  1368. }
  1369. }
  1370. }
  1371.  
  1372. // --------------------------------------------------------------------------------
  1373. // AddByIDView - Actions
  1374. // --------------------------------------------------------------------------------
  1375. extension AddByIDView {
  1376. func okayClicked() {
  1377. //TODO: Paste the contents of AddByIDViewController.okayClicked()
  1378. }
  1379. }
  1380.  
  1381. // --------------------------------------------------------------------------------
  1382. // CredentialsView - Actions
  1383. // --------------------------------------------------------------------------------
  1384. extension CredentialsView {
  1385. func onConfirm() {
  1386. //TODO: Paste the contents of CredentialsViewController.onConfirm()
  1387. }
  1388. }
  1389.  
  1390. // --------------------------------------------------------------------------------
  1391. // FilePreviewView - Actions
  1392. // --------------------------------------------------------------------------------
  1393. extension FilePreviewView {
  1394. func cancelPreviewClicked() {
  1395. //TODO: Paste the contents of FilePreviewController.cancelPreviewClicked()
  1396. }
  1397.  
  1398. func sendFileAttachment() {
  1399. //TODO: Paste the contents of FilePreviewController.sendFileAttachment()
  1400. }
  1401. }
  1402.  
  1403. // --------------------------------------------------------------------------------
  1404. // LoginView - Actions
  1405. // --------------------------------------------------------------------------------
  1406. extension LoginView {
  1407. func passwordVisibilityClicked() {
  1408. //TODO: Paste the contents of LoginViewController.passwordVisibilityClicked()
  1409. }
  1410.  
  1411. func loginClicked() {
  1412. //TODO: Paste the contents of LoginViewController.loginClicked()
  1413. }
  1414. }
  1415.  
  1416. // --------------------------------------------------------------------------------
  1417. // ResetPasswordView - Actions
  1418. // --------------------------------------------------------------------------------
  1419. extension ResetPasswordView {
  1420. func onConfirm() {
  1421. //TODO: Paste the contents of ResetPasswordViewController.onConfirm()
  1422. }
  1423. }
  1424.  
  1425. // --------------------------------------------------------------------------------
  1426. // Dynamic Size Helper
  1427. // --------------------------------------------------------------------------------
  1428. struct DynamicSize {
  1429. static private let baseViewWidth: CGFloat = 414.0
  1430. static private let baseViewHeight: CGFloat = 736.0
  1431.  
  1432. static func getHeight(_ height: CGFloat) -> CGFloat {
  1433. return (height / baseViewHeight) * UIScreen.main.bounds.height
  1434. }
  1435.  
  1436. static func getWidth(_ width: CGFloat) -> CGFloat {
  1437. return (width / baseViewWidth) * UIScreen.main.bounds.width
  1438. }
  1439.  
  1440. static func getOffsetX(_ x: CGFloat) -> CGFloat {
  1441. return (x / baseViewWidth) * UIScreen.main.bounds.width
  1442. }
  1443.  
  1444. static func getOffsetY(_ y: CGFloat) -> CGFloat {
  1445. return (y / baseViewHeight) * UIScreen.main.bounds.height
  1446. }
  1447. }
  1448.  
  1449. // --------------------------------------------------------------------------------
  1450. // Frame and Offset Helper
  1451. // --------------------------------------------------------------------------------
  1452. extension View {
  1453. func frame(dynamicWidth: CGFloat? = nil, dynamicHeight: CGFloat? = nil, alignment: Alignment = .center) -> some View {
  1454. frame(
  1455. width: DynamicSize.getWidth(dynamicWidth ?? 0),
  1456. height: DynamicSize.getHeight(dynamicHeight ?? 0),
  1457. alignment: alignment)
  1458. }
  1459.  
  1460. func offset(dynamicX: CGFloat = 0, dynamicY: CGFloat = 0) -> some View {
  1461. offset(x: DynamicSize.getOffsetX(dynamicX), y: DynamicSize.getOffsetY(dynamicY))
  1462. }
  1463. }
  1464.  
  1465. // --------------------------------------------------------------------------------
  1466. // CustomTableViewCell
  1467. // --------------------------------------------------------------------------------
  1468. struct CustomTableViewCell: View {
  1469. var body: some View {
  1470. ZStack(alignment: .topLeading) {
  1471. GeometryReader { geometry in
  1472. Text("Test")
  1473. .frame(dynamicWidth: 374, dynamicHeight: 360, alignment: .center)
  1474. .font(.system(size: 52, weight: .regular))
  1475. .multilineTextAlignment(.center)
  1476. .foregroundColor(Color(white: 1.0))
  1477. .background(Color(red: 0.7176471, green: 0.60784316, blue: 0.49411765))
  1478. .offset(dynamicX: 20, dynamicY: 20)
  1479. }
  1480. }
  1481. .frame(dynamicWidth: 414, dynamicHeight: 400)
  1482. .background(Color(.systemPink))
  1483. }
  1484. }
  1485.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement