├── .gitignore ├── .swiftpm └── xcode │ └── package.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── LICENSE ├── Package.resolved ├── Package.swift ├── README.md ├── Sources └── SwiftWebUI │ └── SwiftWebUI.swift ├── Tests ├── LinuxMain.swift └── SwiftWebUITests │ ├── SwiftWebUITests.swift │ └── XCTestManifests.swift ├── tableScreenshot.png └── testing.html /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | # Package.resolved 41 | .build/ 42 | 43 | # CocoaPods 44 | # 45 | # We recommend against adding the Pods directory to your .gitignore. However 46 | # you should judge for yourself, the pros and cons are mentioned at: 47 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 48 | # 49 | # Pods/ 50 | 51 | # Carthage 52 | # 53 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 54 | # Carthage/Checkouts 55 | 56 | Carthage/Build 57 | 58 | # fastlane 59 | # 60 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 61 | # screenshots whenever they are needed. 62 | # For more information about the recommended setup visit: 63 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 64 | 65 | fastlane/report.xml 66 | fastlane/Preview.html 67 | fastlane/screenshots/**/*.png 68 | fastlane/test_output 69 | -------------------------------------------------------------------------------- /.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "Vaux", 6 | "repositoryURL": "https://github.com/dokun1/Vaux.git", 7 | "state": { 8 | "branch": null, 9 | "revision": "664443da14a65f8068e4f0b672409c81be20255b", 10 | "version": "0.1.1" 11 | } 12 | } 13 | ] 14 | }, 15 | "version": 1 16 | } 17 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.0 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "SwiftWebUI", 8 | products: [ 9 | // Products define the executables and libraries produced by a package, and make them visible to other packages. 10 | .library( 11 | name: "SwiftWebUI", 12 | targets: ["SwiftWebUI"]), 13 | ], 14 | dependencies: [ 15 | .package(url: "https://github.com/dokun1/Vaux.git", from: "0.1.1") 16 | // Dependencies declare other packages that this package depends on. 17 | // .package(url: /* package url */, from: "1.0.0"), 18 | ], 19 | targets: [ 20 | // Targets are the basic building blocks of a package. A target can define a module or a test suite. 21 | // Targets can depend on other targets in this package, and on products in packages which this package depends on. 22 | .target( 23 | name: "SwiftWebUI", 24 | dependencies: ["Vaux"]), 25 | .testTarget( 26 | name: "SwiftWebUITests", 27 | dependencies: ["SwiftWebUI"]), 28 | ] 29 | ) 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwiftWebUI 2 | 3 | # Table of Contents 4 | 1. [Introduction](#introduction) 5 | 2. [The Sample Code](#the-sample-code) 6 | 3. [The Problem](#the-problem) 7 | 4. [The Proposal](#the-proposal) 8 | 9 | ## Introduction 10 | This is not a fully functioning UI framework, and does not intend to be. This is meant to be a demonstration of how an opinionated web UI framework can be built on top of my other recent project, [Vaux](https://github.com/dokun1/Vaux). I want to encourage you to read this and either tear this approach to pieces, or get inspired to make your own framework to do this! 11 | 12 | ## The Sample Code 13 | 14 | Rather than use Vaux directly, we can use the example in this library to write a table like so: 15 | 16 | ```swift 17 | import SwiftWebUI 18 | 19 | class SomeClass: TableDataSource { 20 | init() { 21 | createTable() 22 | } 23 | 24 | func createTable() { 25 | let table = SwiftWebUI.Table() 26 | table.datasource = self 27 | table.numberOfRows = 7 28 | table.numberOfColumns = 7 29 | table.filename = "table" 30 | table.fileLocation = "/tmp/" 31 | table.headerTitle = "Sample Title" 32 | do { 33 | try table.render() 34 | } catch let error { 35 | print(error.localizedDescription) 36 | } 37 | } 38 | 39 | func valueForIndex(row: Int, column: Int) -> HTML? { 40 | return "(\(row), \(column))" 41 | } 42 | } 43 | ``` 44 | 45 | This will create a file called `table.html` in your `/tmp/` directory. When loaded in a web browser, it looks like this: 46 | 47 | ![table screenshot](./tableScreenshot.png) 48 | 49 | The HTML code for this file looks like so, and is completely generated at runtime by `SwiftWebUI`, using `Vaux` under the hood: 50 | 51 | ```markup 52 | 53 | 54 | 55 | 56 | 59 | 60 | 63 | 66 | 69 | 72 | 75 | 78 | 79 | 80 | 83 | 86 | 89 | 92 | 95 | 98 | 99 | 100 | 103 | 106 | 109 | 112 | 115 | 118 | 119 | 120 | 123 | 126 | 129 | 132 | 135 | 138 | 139 | 140 | 143 | 146 | 149 | 152 | 155 | 158 | 159 | 160 | 163 | 166 | 169 | 172 | 175 | 178 | 179 | 180 | 183 | 186 | 189 | 192 | 195 | 198 | 199 |
57 | Sample Title 58 |
61 | (1, 1) 62 | 64 | (1, 2) 65 | 67 | (1, 3) 68 | 70 | (1, 4) 71 | 73 | (1, 5) 74 | 76 | (1, 6) 77 |
81 | (2, 1) 82 | 84 | (2, 2) 85 | 87 | (2, 3) 88 | 90 | (2, 4) 91 | 93 | (2, 5) 94 | 96 | (2, 6) 97 |
101 | (3, 1) 102 | 104 | (3, 2) 105 | 107 | (3, 3) 108 | 110 | (3, 4) 111 | 113 | (3, 5) 114 | 116 | (3, 6) 117 |
121 | (4, 1) 122 | 124 | (4, 2) 125 | 127 | (4, 3) 128 | 130 | (4, 4) 131 | 133 | (4, 5) 134 | 136 | (4, 6) 137 |
141 | (5, 1) 142 | 144 | (5, 2) 145 | 147 | (5, 3) 148 | 150 | (5, 4) 151 | 153 | (5, 5) 154 | 156 | (5, 6) 157 |
161 | (6, 1) 162 | 164 | (6, 2) 165 | 167 | (6, 3) 168 | 170 | (6, 4) 171 | 173 | (6, 5) 174 | 176 | (6, 6) 177 |
181 | (7, 1) 182 | 184 | (7, 2) 185 | 187 | (7, 3) 188 | 190 | (7, 4) 191 | 193 | (7, 5) 194 | 196 | (7, 6) 197 |
200 | 201 | 202 | ``` 203 | 204 | If you want to try this yourself, import this library into your own project, or clone this repo and open up `SwiftWebUITests.swift` and play with the unit test I've written for this example. 205 | 206 | ## The Problem 207 | 208 | Thanks to Vaux and the [function builder](https://github.com/apple/swift-evolution/blob/3e6b78c0e7ddc60f88d2c126722e1a319d3b1749/proposals/XXXX-function-builders.md) capacity in Swift 5.1, you have the ability to write pure HTML using Swift functions. This is awesome functionality, but requires an understanding of HTML and its procedural nature. Given the above example, even with looping built into Vaux, this creates a main problem: Swift developers should not have to worry about interfacing directly with HTML. 209 | 210 | Thus, the goal of this repository is to **demonstrate that it is indeed possible to create an opinionated UI framework for the web that can generate HTML that is fully annotated for style and function**. 211 | 212 | ## The Proposal 213 | 214 | I, David Okun, intend to keep maintaining Vaux as a functioning DSL library. Vaux should provide an intermediate level to writing HTML for Swift developers. I am hoping that others notice this and take action to work on such a framework. Some points: 215 | 216 | 1. **Vaux and other upcoming HTML DSLs are still works in progress**. While this is true, the entire DOM and all possible attributes are available through the `attr(key:value:)` and `custom(tag:child:)` functions in Vaux. As Vaux continues to grow, I hope that other libraries that take advantage of this functionality and move the needle for what Vaux needs to turn into. 217 | 2. **The API in this example repo is poorly built.** It probably is, and I am hoping that others take this as an opportunity to provide something more feature complete and functional to use. I built this API as a minimum example to demonstrate my manifesto for how DSLs in Swift can be used. Given all of the buzz around SwiftUI, it would make sense that its web counterpart also be functional and declarative - I have not yet fully grasped that model of programming, so I am hoping you, the reader, are that person! 218 | 3. **But will anyone use this?** That depends. Templating libraries, such as [Stencil](https://stencil.fuller.li/en/latest/) are heavily used today as a front end web solution right now, and not just for Swift. Given the popularity of Swift DSLs to HTML since the announcement of the feature, it will be awesome to see someone take this all the way and do something meaningful with it. I hope that person is you, reader! 219 | 4. **But isn't your full time job all about convincing people to use Swift on the server?** Sure it is, and I sure would love it if you tried [Kitura](https://kitura.io), but my goal here is to try and get the ecosystem moving for Swift on the web, and this works with Swift anywhere it can compile today - not just Kitura. 220 | 221 | Thanks for reading this far, and I hope this has inspired you to get working on something! 222 | 223 | -------------------------------------------------------------------------------- /Sources/SwiftWebUI/SwiftWebUI.swift: -------------------------------------------------------------------------------- 1 | import Vaux 2 | 3 | public protocol TableDataSource: class { 4 | func valueForIndex(row: Int, column: Int) -> HTML? 5 | } 6 | 7 | struct SwiftWebUI { 8 | 9 | class Table { 10 | var datasource: TableDataSource? = nil 11 | var numberOfRows: Int = 0 12 | var numberOfColumns: Int = 0 13 | var rows: [Int: [HTML]] = [0: [""]] 14 | var headerTitle: String = "" 15 | var filename: String = "testing" 16 | var fileLocation: String = "/tmp/" 17 | var cellAlignment: Alignment = .center 18 | var border: Int = 2 19 | var cellSpacing: Int = 1 20 | var cellPadding: Int = 4 21 | 22 | init() {} 23 | 24 | public func render() throws { 25 | 26 | func renderRows() -> HTML { 27 | forEach(0.. HTML { 33 | if self.headerTitle.isEmpty { 34 | return "" 35 | } else { 36 | return renderedHeaderRow() 37 | } 38 | } 39 | 40 | func renderedHeaderRow() -> HTML { 41 | tableHeadData { 42 | self.headerTitle 43 | }.scope(.columnGroup).columnSpan(self.numberOfRows) 44 | } 45 | 46 | func renderTableRow(rowIndex: Int) -> HTML { 47 | tableRow { 48 | forEach(0.. HTML { 55 | tableData { 56 | content 57 | }.alignment(self.cellAlignment) 58 | } 59 | 60 | func topTable() -> HTML { 61 | html { 62 | body { 63 | tableGrid { 64 | renderHeaderRow() 65 | renderRows() 66 | }.attr("border", String(self.border)).attr("cellspacing", String(self.cellSpacing)).attr("cellpadding", String(self.cellPadding)) 67 | } 68 | } 69 | } 70 | 71 | let vaux = Vaux() 72 | vaux.outputLocation = .file(name: self.filename, path: self.fileLocation) 73 | do { 74 | try vaux.render(topTable()) 75 | } catch let error { 76 | throw error 77 | } 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Tests/LinuxMain.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | import SwiftWebUITests 4 | 5 | var tests = [XCTestCaseEntry]() 6 | tests += SwiftWebUITests.allTests() 7 | XCTMain(tests) 8 | -------------------------------------------------------------------------------- /Tests/SwiftWebUITests/SwiftWebUITests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | import Vaux 3 | @testable import SwiftWebUI 4 | 5 | final class SwiftWebUITests: XCTestCase, TableDataSource { 6 | func testTable() { 7 | createTable() 8 | XCTAssert(1 == 1) 9 | } 10 | 11 | func createTable() { 12 | let table = SwiftWebUI.Table() 13 | table.datasource = self 14 | table.numberOfRows = 7 15 | table.numberOfColumns = 6 16 | table.headerTitle = "Sample Title" 17 | do { 18 | try table.render() 19 | } catch let error { 20 | print(error.localizedDescription) 21 | } 22 | } 23 | 24 | func valueForIndex(row: Int, column: Int) -> HTML? { 25 | return "(\(row + 1), \(column + 1))" 26 | } 27 | 28 | static var allTests = [ 29 | ("testTable", testTable) 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /Tests/SwiftWebUITests/XCTestManifests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | #if !canImport(ObjectiveC) 4 | public func allTests() -> [XCTestCaseEntry] { 5 | return [ 6 | testCase(SwiftWebUITests.allTests), 7 | ] 8 | } 9 | #endif 10 | -------------------------------------------------------------------------------- /tableScreenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dokun1/SwiftWebUI/0f20a9ac6c4e76345b8919da2a56a4d4fc0811fb/tableScreenshot.png -------------------------------------------------------------------------------- /testing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 12 | 15 | 18 | 21 | 24 | 27 | 28 | 29 | 32 | 35 | 38 | 41 | 44 | 47 | 48 | 49 | 52 | 55 | 58 | 61 | 64 | 67 | 68 | 69 | 72 | 75 | 78 | 81 | 84 | 87 | 88 | 89 | 92 | 95 | 98 | 101 | 104 | 107 | 108 | 109 | 112 | 115 | 118 | 121 | 124 | 127 | 128 | 129 | 132 | 135 | 138 | 141 | 144 | 147 | 148 |
6 | Sample Title 7 |
10 | (1, 1) 11 | 13 | (1, 2) 14 | 16 | (1, 3) 17 | 19 | (1, 4) 20 | 22 | (1, 5) 23 | 25 | (1, 6) 26 |
30 | (2, 1) 31 | 33 | (2, 2) 34 | 36 | (2, 3) 37 | 39 | (2, 4) 40 | 42 | (2, 5) 43 | 45 | (2, 6) 46 |
50 | (3, 1) 51 | 53 | (3, 2) 54 | 56 | (3, 3) 57 | 59 | (3, 4) 60 | 62 | (3, 5) 63 | 65 | (3, 6) 66 |
70 | (4, 1) 71 | 73 | (4, 2) 74 | 76 | (4, 3) 77 | 79 | (4, 4) 80 | 82 | (4, 5) 83 | 85 | (4, 6) 86 |
90 | (5, 1) 91 | 93 | (5, 2) 94 | 96 | (5, 3) 97 | 99 | (5, 4) 100 | 102 | (5, 5) 103 | 105 | (5, 6) 106 |
110 | (6, 1) 111 | 113 | (6, 2) 114 | 116 | (6, 3) 117 | 119 | (6, 4) 120 | 122 | (6, 5) 123 | 125 | (6, 6) 126 |
130 | (7, 1) 131 | 133 | (7, 2) 134 | 136 | (7, 3) 137 | 139 | (7, 4) 140 | 142 | (7, 5) 143 | 145 | (7, 6) 146 |
149 | 150 | 151 | --------------------------------------------------------------------------------