// // LicenseView.swift // Splits // // Created by Isaac Greene on 6/9/22. // import SwiftUI struct LicenseView: View { var fontSize:CGFloat {UIScreen.main.bounds.width > 700 ? 18 : 8} // figuring out how to do this came partly from tinyurl.com/9snwkrzt // and also partly from stackoverflow.com/questions/57727107/ // then I remembered about ternary operators and I optimized it // This allows the license to be properly formatted // on any screen size by getting the resolution then // setting fontSize to a value based on that where the whole // line can be viewed without scrolling horizontally // or with wrapped text, ruining the required formatting I have. // As of 2022-06-08, I have not tested this on a phone. var body: some View { ScrollView { VStack (alignment: .leading) { Text(""" -------------------------------------------------------------------- | THIS WORK, AND ALL SUBSEQUENT RELEASES, VERSIONS, MODIFICATIONS, | | AND UPDATES ARE COPYRIGHT © ISAAC GREENE, AND MAY BE RELEASED | | UNDER THIS LICENSE. | | | | COPIES OF THIS SOURCE CODE MAY BE MADE AVAILABLE BY WRITTEN | | REQUEST TO ISAAC GREENE. ISAAC GREENE IS GIVEN FULL DISCRETION | | TO APPROVE OR DENY THESE REQUESTS. | | CHANGES MAY BE MADE TO THIS LICENSE AT ANY TIME WITHOUT | | NOTICE OR WARNING. | | | | BY ANY USE OF THIS SOFTWARE AND/OR LICENSE YOU AGREE THAT: | | 1. YOU ARE SUBJECT TO THE TERMS PUT FORTH IN THIS LICENSE. | | 2. YOU HAVE NO GUARANTEED RIGHTS REGARDING THE USE OF THIS | | APPLICATION OR LICENSE. | | 3. YOUR ACCESS TO THIS SOFTWARE MAY BE REVOKED AT ANY TIME | | 3A. IF YOUR ACCESS IS REVOKED, YOU MAY CONTINUE TO USE | | AND KEEP YOUR CURRENT COPY OF THIS SOFTWARE AND THIS | | LICENSE MAY BE REPLACED WITH AN UPDATED VERSION FOR YOU | | TO USE | | | | Under the terms of this license, you agree that you may: | | - view source code and files contained in this package | | upon request | | - make copies of this code, in whole or in part, for | | personal use | | - share copies of this license and/or code, provided this | | work is never publicly available | | - test this code on your personal systems | | | | Under the terms of this license, you agree that may not: | | - use this code for commercial purposes | | - modify this code or license | | | | ANY RIGHTS NOT EXPLICITLY GRANTED TO YOU IN THIS LICENSE ARE | | AUTOMATICALLY UNDER CONTROL OF ISAAC GREENE. | | ALL PROVISIONS IN THIS LICENSE MAY BE MODIFIED ON A PER-CASE | | BASIS ON REQUEST, SUBJECT TO APPROVAL. | | Permission to distribute, modify, publish, monetize, or otherwise| | go against the preset terms of this license may be granted, in | | writing and by request, by Isaac Greene. | | | | ANY AND ALL REDISTRIBUTIONS OF THIS WORK(S) MUST INLCLUDE A COPY | | OF THIS LICENSE IN THE ABOVE FORM AND THE FOLLOWING DISCLAIMER | | IN THE DOCUMENTATION AND/OR OTHER MATERIALS PROVIDED. | | | | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND | | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES | | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR | | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | | THE POSSIBILITY OF SUCH DAMAGE. | -------------------------------------------------------------------- """) // this part's kind of self explanatory. // this is the Software License for all of the // code in this application. .font(.custom("Menlo", size: fontSize)) .textSelection(.enabled) .multilineTextAlignment(.leading) // these modifiers simply change the default font // font size, and allows you to select this text Text("\nCreated: 2022-06-08") Text("Updated: 2022-06-09") } .navigationTitle("Software License Agreement") // sets the top of the screen to this text which always // lets you know what page you're in .padding() .frame(maxWidth: .infinity) } } } struct LicenseProvider_Previews: PreviewProvider { static var previews: some View { LicenseView() } }