diff --git a/Documentation.docc/tutorials/Chapter1-1.tutorial b/Documentation.docc/tutorials/Chapter1-1.tutorial new file mode 100644 index 000000000..ba31c43b6 --- /dev/null +++ b/Documentation.docc/tutorials/Chapter1-1.tutorial @@ -0,0 +1,29 @@ +@Tutorial(time: 10) { + @Intro(title: "Chapter 1.2: Exploring ScribbleLab's targets and configs") { + In this Chatpter you'll get a basic understanding of ScribbleLab's build targets and configs + + @Image(source: <#file#>, alt: "<#accessible description#>") + } + + @Section(title: "<#text#>") { + @ContentAndMedia { + <#text#> + + @Image(source: <#file#>, alt: "<#accessible description#>") + } + + @Steps { + @Step { + <#text#> + + @Image(source: <#file#>, alt: "<#accessible description#>") + } + + @Step { + <#text#> + + @Code(name: "<#display name#>", file: <#filename.swift#>) + } + } + } +} diff --git a/LICENSE_AGREEMENT.md b/LICENSE_AGREEMENT.md index e69de29bb..9020d2042 100644 --- a/LICENSE_AGREEMENT.md +++ b/LICENSE_AGREEMENT.md @@ -0,0 +1,678 @@ +ScribbleLab and ScribbleLab Extensions Agreement: +PLEASE SCROLL DOWN AND READ ALL OF THE FOLLOWING TERMS AND CONDITIONS +CAREFULLY BEFORE USING THE ScribbleLab SOFTWARE OR ScribbleLab SERVICES. THIS IS A LEGAL +AGREEMENT BETWEEN YOU AND ScribbleLabApp. IF YOU AGREE TO BE BOUND BY ALL OF THE TERMS +AND CONDITIONS, CLICK THE “AGREE” BUTTON. BY CLICKING “AGREE” OR BY +DOWNLOADING, USING OR COPYING ANY PART OF THIS ScribbleLab SOFTWARE OR USING ANY +PART OF THE ScribbleLab SERVICES, YOU ARE AGREEING ON YOUR OWN BEHALF AND/OR ON +BEHALF OF YOUR COMPANY OR ORGANIZATION TO THE TERMS AND CONDITIONS STATED +BELOW. IF YOU DO NOT OR CANNOT AGREE TO THE TERMS OF THIS AGREEMENT, YOU +CANNOT USE THIS ScribbleLab SOFTWARE OR THE ScribbleLab SERVICES. DO NOT DOWNLOAD OR USE +THIS ScribbleLab SOFTWARE OR ScribbleLab SERVICES IN THAT CASE. +IMPORTANT NOTE: THIS SOFTWARE IS AUTHORIZED ONLY FOR EXECUTION ON AN APPLE-BRANDED PRODUCT +RUNNING MACOS, IOS AND IPADOS. ANY OTHER DOWNLOAD OR USE OF THIS SOFTWARE IS NOT AUTHORIZED +AND IS IN BREACH OF THIS AGREEMENT. + +1. Definitions +Whenever capitalized in this Agreement: +“Agreement” means this ScribbleLab and ScribbleLabApp Agreement. +“ScribbleLab” means ScribbleLabApp Inc. +“ScribbleLab Developer Program License Agreement” means a separate agreement that may be entered +into between You and ScribbleLabApp regarding the development to this App +"ScribbleLab Services” or “Services” means the services that ScribbleLab provides to You under this +Agreement solely for use with OUR Applications that may be provided to You by ScribbleLabApp. +"ScribbleLab Software” means the ScribbleLab app and the ScribbleLab Account (SLA), including any Updates +thereto (if any) that may be provided to You by ScribbleLab. +“Application” means a software program (including extensions and media that are enclosed in a single +software bundle) developed by us hereunder, for use under Our own name, trademark or brand, and +specifically for use on Apple-branded products running macOS, iOS, watchOS, iPadOS, tvOS, visionOS +as applicable, including new releases and new versions of such software program, but excluding +libraries for iOS, watchOS, iPadOS, tvOS, visionOS applications. +For clarity, the term Application as used in this Agreement excludes libraries that are for use in +Applications designed for iOS, watchOS, iPadOS, tvOS or visionOS. Such libraries can be developed by +You only under the terms of the Apple Developer Program License Agreement. +“Authorized Developers” means Your employees and contractors, members of Your organization or, if +You are an educational institution, Your faculty, staff and students, who: (a) have a demonstrable need +to know or use the Apple Software or Apple Services in order to develop and test Applications, and (b) +to the extent they will access Apple Confidential Information, have written and binding agreements with +You that prohibit the unauthorized use and disclosure of such confidential information. +“Authorized Test Units” means Apple-branded hardware units owned or controlled by You that have +been designated by You for Your own testing and development purposes, and, if You permit, Applebranded hardware units owned or controlled by Your Authorized Developers so long as such units are +used for testing and development purposes on Your behalf and only as permitted hereunder. +“Documentation” means the technical or other specifications or documentation that Apple may provide +to You for use in connection with the Apple Software, Apple Services, Apple certificates, or as otherwise +provided hereunder. +“FOSS” (Free and Open Source Software) means any software that is subject to terms that, as a +condition of use, copying, modification or redistribution, require such software and/or derivative works +thereof to be disclosed or distributed in source code form, to be licensed for the purpose of making +derivative works, or to be redistributed free of charge, including without limitation software distributed +under the GNU General Public License or GNU Lesser/Library GPL. +“macOS SDK” means the Apple-proprietary Software Development Kits (SDKs) provided hereunder, +including but not limited to header files, APIs, libraries, simulators, and software (source code and object +code) labeled as part of the macOS SDK and included in the Xcode Developer Tools package for +purposes of targeting Apple-branded products running macOS. +“Map Data” means any content, data or information provided through the Apple Maps Service including, +but not limited to, imagery, terrain data, latitude and longitude coordinates, transit data, points of +interest and traffic data. +“Program Requirements” mean the technical, human interface, design, product category, security, +performance, and other criteria and requirements for Applications specified by Apple in the Apple +Developer Program License Agreement. +“Provisioning Profiles” means the time-limited files (including applicable entitlements, certificates or +other identifiers) that may be provided by Apple for use by You in connection with Your Application +development and testing. +“Updates” means bug fixes, updates, upgrades, modifications, enhancements and supplements to the +Apple Software or Apple Services, and any new releases or versions thereof. +“Xcode Developer Tools” means the Apple-proprietary development platform, including but not limited +to software tools, compilers, sample code, Documentation, programming languages, and overall design +package provided by Apple hereunder, excluding the Apple SDKs. +“You” or “Your” means the person(s) or entity using the Apple Software or Services or otherwise +exercising rights under this Agreement. If You are entering into this Agreement on behalf of Your +company, organization, educational institution, or an agency, instrumentality, or department of the +federal government, “You” or “Your” refers to your company, organization, educational institution or +agency, instrumentality, or department of the federal government as well. +2. Internal Use License and Restrictions +2.1 Authority to Enter into Agreements +You certify to Apple that You have the right and authority to enter into this Agreement on Your own +behalf, or if You are entering into this Agreement on behalf of Your company, organization, educational +institution, or agency, instrumentality, or department of the federal government, that You have the right +and authority to legally bind such entity or organization to the terms and obligations of this Agreement. +Further, You agree to comply with the terms of and fulfill Your obligations under this Agreement, +including obtaining any required consents for Your Authorized Developers’ use of the Apple Software +and Services (e.g., as part of Your Applications), and You agree to monitor and be fully responsible for +all such use by Your Authorized Developers and their compliance with the terms of this Agreement. You +acknowledge that You will be solely responsible for all costs, expenses, losses and liabilities incurred, +and activities undertaken by You and Your Authorized Developers in connection with the Apple Software +and Apple Services, Your Applications and Your related development and limited distribution efforts. +2.2 Permitted Uses and Restrictions +Subject to the terms and conditions of this Agreement, Apple hereby grants You during the Term, a +limited, non-exclusive, personal, revocable, non-sublicensable, non-transferable, and internal use license +to: +A. Install a reasonable number of copies of the Apple Software on Apple-branded computers that +are owned or controlled by You to be used internally by You or Your Authorized Developers only as +follows: +(i) You may use the Xcode Developer Tools to test and develop application and other software; +(ii) You may use the macOS SDKs to test and develop application and other software; +(iii) You may use the Apple SDKs (excluding the macOS SDK) solely to test and develop +Applications that are specifically for use with the applicable Apple-branded products for which the SDK +is targeted, unless otherwise permitted by Apple in writing; and +(iv) You may use the Apple Services solely to test and develop Applications that are specifically for +use on Apple-branded products, unless otherwise permitted by Apple in writing. +Except as otherwise expressly set forth in Section 2.2.B., You may not distribute any Applications +developed using the Apple SDKs (excluding the macOS SDK) absent entering into a separate written +agreement with Apple. +B. Use Provisioning Profiles to install Your Applications onto a reasonable, limited number of +Authorized Test Units solely for use by You and/or Your Authorized Developers and only for internal +testing and development of Your Applications, or for Your own personal, non-commercial use. +Apple reserves the right to limit the number of Authorized Test Units that You may provision for +iOS, watch OS, iPadOS, tvOS, and visionOS as well as the number of Authorized Developers (and +Apple IDs) that You may register with the Apple Software for such provisioning. You agree to be +solely responsible for determining which Authorized Developers in Your company or organization should +have access to and use of Your Applications and such Authorized Test Units. You agree to clearly +inform Your Authorized Developers that Your Applications that are deployed using Your Provisioning +Profiles are to be used only by them (and not by any third parties) and are solely for use for internal +testing and development purposes on Your behalf. You will be responsible for attaching or otherwise +including, at Your discretion, any relevant usage terms for such Applications. Apple will not be +responsible for any violations of Your usage terms. You will be solely responsible for all user assistance, +warranty and support of Your Applications that are deployed by You under this Agreement. +2.3 Apple IDs +You agree to register only a reasonable number of Apple IDs in the Apple Software and Apple Services +for deployment and provisioning purposes. You agree to ensure that such Apple IDs are associated with +You or Your Authorized Developers. You agree that all information provided to Apple by You or Your +Authorized Developers in obtaining such Apple IDs or entering them into the Apple Software or Services +will be current, true, accurate, supportable and complete. You agree not to fraudulently misrepresent or +improperly acquire more Apple IDs than are necessary for Your own reasonable testing and +development purposes. You understand that Apple may disable Your right to use Apple IDs within the +Apple Software or may revoke Your Provisioning Profiles at any time in its sole discretion (e.g., if Apple +suspects fraudulent or malicious activity with Your use of the Apple Software or Services). +2.4 Apple Developer Program +If You would like a third-party to use Your Application for iOS, watchOS, iPadOS, tvOS, or visionOS, or +You would like to distribute Your Application for macOS through the App Store, then You must enter into +a separate written agreement with Apple (the Apple Developer Program License Agreement) and Your +Application must comply with the Program Requirements and Documentation. Information regarding the +Program Requirements is available at: http://developer.apple.com/programs/ios/information/index.html. +Apple reserves the right to change the Program Requirements and/or the terms of the Apple Developer +Program License Agreement from time to time. You are fully responsible for any and all costs, expenses +or other liabilities You may incur as a result of Your development or use of the Apple Software or +Services. For clarity, macOS applications and libraries may be distributed without entering into a +separate written agreement with Apple so long as such applications and libraries comply with the terms +of this Agreement. +2.5 Copies +You agree to retain and reproduce in full the Apple copyright, disclaimers and other proprietary notices +in all copies of the Apple Software that You are permitted to make under this Agreement. For clarity, +You may copy only the entire package or piece of the Apple Software and Services in its entirety and +only for use as permitted herein. You may not alter the Apple Software or Services in any way in such +copy, e.g., You are expressly prohibited from separately using the Apple SDKs or attempting to run any +part of the Apple Software on non-Apple-branded hardware. Images contained in the Documentation +may not be separately copied or used outside of the Documentation. +2.6 Ownership +Apple retains all rights, title, and interest in and to the Apple Software and Apple Services. The parties +acknowledge that this Agreement does not give Apple any ownership interest in Your Applications. +2.7 Restrictions; No Other Permitted Uses +The grants set forth in this Agreement do not permit You to, and You agree not to, install, use or run the +Apple Software or Apple Services on any non-Apple-branded computer or device, or to enable others to +do so. This Agreement does not allow the Apple Software or Services to be made available over a +network where they could be run or used by multiple computers at the same time, unless otherwise +expressly permitted in writing by Apple. Further, unless otherwise expressly permitted by Apple in +writing, You agree not to rent, lease, lend, upload to or host on any website or server, sell, redistribute, +or sublicense the Apple Software and Apple Services, in whole or in part, or to enable others to do so. +You may not use the Apple Software and Apple Services for any purpose not expressly permitted by this +Agreement. You may not and You agree not to, or to enable others to, copy (except as expressly +permitted under this Agreement), decompile, reverse engineer, disassemble, attempt to derive the +source code of, modify, decrypt, or create derivative works of the Apple Software or Services, or any +part thereof (except as and only to the extent any foregoing restriction is prohibited by applicable law, or +to the extent as may be permitted by licensing terms governing use of open-sourced components or +sample code included with the Apple Software). You agree not to exploit the Apple Services or Apple +Software in any unauthorized way whatsoever, including but not limited to, by trespass or burdening +network capacity. Further, as a condition to using the Apple Software and Apple Services, You agree +that You will not, directly or indirectly, commit any act intended to interfere with the Apple Software or +Apple Services. All licenses not expressly granted in this Agreement are reserved and no other licenses, +immunity or rights, express or implied are granted by Apple, by implication or otherwise. This +Agreement does not grant You any rights to use any trademarks, logos or service marks belonging to +Apple, including but not limited to the iPhone or iPod word marks. If You make reference to any Apple +products or technology or use Apple’s trademarks, You agree to comply with the guidelines at: http:// +www.apple.com/legal/trademark/guidelinesfor3rdparties.html, as modified by Apple from time to time. +2.8 Updates; No Support or Maintenance +Apple may extend, enhance, or otherwise modify the Apple Software and Apple Services at any time +without notice, but Apple is not obligated to provide You with any Updates to the Apple Software and +Apple Services. If Apple makes Updates available, the terms of this Agreement will govern such +Updates, unless the Update is accompanied by a separate license in which case the terms of that +license will govern. If You choose to allow automatic updates for the Apple Software in System +Preferences, then Your Apple-branded computer will periodically check with Apple for updates and +upgrades to the Apple Software and, if an update or upgrade is available, the update or upgrade will +automatically download and install onto Your Apple-branded computer and, if applicable, +Your peripheral devices. You can turn off the automatic updates for the Apple Software at any time by +changing the automatic updates settings within System Preferences. Apple is not obligated to provide +any maintenance, technical or other support for the Apple Software and Apple Services. You +acknowledge that Apple has no express or implied obligation to announce or make available any +Updates of the Apple Software and Apple Services to anyone in the future. Should an Update be made +available, it may have APIs, features, services, content, or functionality that are different from those +found in the Apple Software and Apple Services licensed hereunder. +2.9 Use of Apple Services in Your Applications +Apple may provide access to Apple Services that Your Applications may call through APIs in the Apple +Software and/or that Apple makes available to You through other mechanisms, e.g., through the use of +keys that Apple may make accessible to You through the Apple Software or Apple Services. You agree +to access such Apple Services only through the mechanisms provided by Apple for such access and +only for use on Apple-branded products. Except as expressly permitted by Apple in writing, You agree +not to share access to mechanisms provided to You by Apple for the use of Apple Services with any +third party. Further, You agree not to create or attempt to create a substitute or similar service through +use of or access to the Apple Services. +You agree to access and use such Services only as necessary for providing services and functionality for +Your Applications that are eligible to use such Services and only as permitted by Apple in writing, +including in the Documentation. You may not use the Apple Services in any manner that is inconsistent +with the terms of this Agreement or that infringes any intellectual property rights of a third party or Apple, +or that violates any applicable laws or regulations. You agree that the Apple Services contain proprietary +content, information and material owned by Apple and its licensors, and protected by applicable +intellectual property and other laws. You may not use such proprietary content, information or materials +in any way whatsoever, except for the permitted uses of the Apple Services under this Agreement, or as +otherwise separately and expressly permitted by Apple in writing. +You acknowledge that there may be storage capacity, transmission, and/or transactional limits for the +Apple Services both for You as a developer and for Your Authorized Developers. If You reach or Your +Authorized Developers reach such limits, then You or Your Authorized Developer may be unable to use +the Apple Services or may be unable to access or retrieve data from Your Applications or through the +applicable end-user accounts. You agree not to charge any fees to Your Authorized Developers solely +for access to or use of the Apple Services through Your Application or for any content, data or +information provided therein, and You agree not to sell access to the Apple Services in any way. +Apple Services may not be available in all languages or in all countries, and Apple makes no +representation that any such Services would be appropriate, accurate or available for use in any +particular location or product. To the extent You choose to use the Apple Services with Your +Applications, You do so at Your own initiative and are responsible for compliance with any applicable +laws. +Apple reserves the right to change, suspend, deprecate, remove, limit, or disable access to the Apple +Services, or any part thereof, at any time without notice (including revoking entitlements or changing any +APIs in the Apple Software that enable access to the Services). In no event will Apple be liable for the +removal of or disabling of access to any of the foregoing. Apple may also impose limits and restrictions +on the use of or access to the Apple Services, may remove the Apple Services for indefinite time +periods, may revoke Your access to the Apple Services, or may cancel the Apple Services (or any part +thereof) at any time without notice or liability to You and in its sole discretion. +Apple does not guarantee the availability, accuracy, completeness, reliability, or timeliness of any data or +information displayed by any Apple Services. You are responsible for Your use of the Apple Software +and Apple Services, and if You use such Services to store any content, data, or information, then it is +Your responsibility to maintain appropriate alternate backup of all Your content, information, and data. +You understand and agree that You may not be able to access certain Apple Services upon expiration or +termination of this Agreement and that Apple reserves the right to suspend access to or delete content, +data or information that You have stored through Your use of such Services provided hereunder. You +should review the Documentation and policy notices posted by Apple prior to using any Apple Services. +Certain Apple Services may not be made available for Applications on all Apple-branded products and +may not be made available to all developers. Apple reserves the right to not provide (or to cease +providing) the Apple Services to any or all developers at any time in its sole discretion. +2.10 Xcode Server +If You access the Xcode Server feature of the Apple Software (e.g., via the command line tools), then +You may use the Xcode Server feature for Your own personal use or within Your company or +organization, but solely for Your own internal testing and development purposes. You may not provide a +service to any other party that integrates with or leverages services or information provided by Xcode +Server or uses the Xcode Server feature in any way. As a condition of using the Xcode Server feature of +the Apple Software, You represent and warrant to Apple that You (and any user of a client-computer that +You permit to access Xcode Server on Your behalf) are appropriately licensed to use the applicable +services, features or functionality of the Xcode Developer Tools, the Apple SDKs and/or the Apple +Developer Program account and associated resources accessed through Xcode Server (e.g., anyone +attempting to gain access to Your Apple Developer certificates stored on Xcode Server must be a +member of Your paid Apple Developer Program account team). You agree to monitor and will be +responsible for all such use by any user of a client-computer that You permit to access Xcode Server +and their compliance with the terms of this Agreement and other applicable license agreements. +2.11 QuickTime Development Software +You may use the QuickTime development software only to develop application software that is +compatible with, and runs only on supported macOS and/or Windows platforms with QuickTime +installed. Your software application may not interfere with the functionality of QuickTime Player or the +QuickTime Plug-in, including but not limited to file type or MIME type associations that are registered to +QuickTime. +2.12 Digital Materials, Reality Composer and Reality Composer Pro Software +A. The Reality Composer and/or Reality Composer Pro software (“Composer Software”) that may +be included with the Apple Software may contain, display and provide access to certain content, +photographs, text, images, graphics, artwork, audio, video, augmented reality or similar assets +(collectively, the “Digital Materials”). Title and intellectual property rights in the Digital Materials belong +to Apple or the respective content owner, and such Digital Materials may be protected by copyright or +other intellectual property laws and treaties, or subject to terms of use of the third party providing such +Digital Materials. Apple is not obligated to provide for, and does not guarantee, the availability of the +Composer Software or any specific Digital Materials. Any Updates to the Composer Software may +therefore contain some Digital Materials different from the previous versions. +B. Automatic Updates of the Composer Software may also include updates to the library of Digital +Materials that are provided as part of the Composer Software. Regardless of whether automatic updates +are enabled or not, when the Composer Software is in use, the Composer Software will automatically +check with Apple for Updates to the Digital Materials. If an Update is available, You will be prompted to +download the updated or new Digital Materials. Apple reserves the right to automatically modify, +remove, or delete any Digital Materials on Your Apple-branded computer from time to time if +Apple becomes aware of or has reason to believe that it is necessary to cease the distribution and +use of such Digital Materials, due to reasons such as legal or regulatory requirements, public +morals, or technical considerations. By using the Apple Software, You understand and agree that +Apple may automatically modify, remove or delete any Digital Materials. +C. Except as otherwise provided in this Agreement, You may use the Digital Materials, on a royaltyfree basis, to create your own original content for your game, application, or other audiovisual project +(“User Content”) subject to Apple’s right to modify, remove or delete specific Digital Materials on Your +Apple-branded computer as set forth in Section 2.12B above. You may display and distribute User +Content that was created using the Digital Materials as part of or in connection with Your game, +application or other audiovisual project; however, individual Digital Materials may not be commercially or +otherwise distributed on a standalone basis, or repackaged in whole or in part as audio clips, visual +content, or asset packs. +D. Except as otherwise provided in this Agreement, (i) this Agreement does not grant You any rights +to use such Digital Materials, nor does it obligate Apple to make any such Digital Materials available to +You continually or for any specific term, and (ii) You may not use the Digital Materials outside the context +of their intended use as part of the Apple Software. Without prejudice to Section 2.14C below, You +agree not to use the Composer Software, including any Digital Materials, for any unlawful or illegal +activity or to create User Content or assets that are offensive or inappropriate. You further agree not to +interfere with, disrupt, or create an undue burden on servers or networks connected to Your Applebranded computer or Apple Software or violate the regulations, policies or procedures of such networks. +2.13 System-Provided Images +The system-provided images and symbols owned by Apple and documented as such in Apple's Human +Interface Guidelines for iOS, watchOS, iPadOS, tvOS, macOS, or visionOS (“System-Provided +Images”) are licensed to You solely for the purpose of developing Applications for Apple-branded +products that run on the system for which the image was provided. You agree that you shall not use or +incorporate the System-Provided Images or any substantially or confusingly similar images into app +icons, logos or make any other trademark use of the System-Provided Images. Your use of the SystemProvided Images shall also be subject to any specific use restrictions with respect thereto as set forth in +the Apple Software or Apple’s Human Interface Guidelines. Apple reserves the right to review and, in its +sole discretion, require modification or discontinuance of use of any System-Provided images used in +violation of the foregoing restrictions, and you agree to promptly comply with any such request. Upon +termination of this Agreement, You may continue to distribute the System-Provided Images as used +within Applications You developed using the Apple Software. +2.14 Additional Restrictions for Applications +A. Use of the Apple Maps Service; Location +If Your Application uses or accesses the Map Kit API and/or the Apple Maps Server API from a device +running iOS version 6 or later, Your Application will access and use the Apple Maps Service. All use of +the Map Kit API, Apple Maps Server API and Apple Maps Service must be in accordance with the terms +of this Agreement, and You agree that the Apple Maps Service is solely for use by Applications running +on Apple-branded products. Your Application may use the MapKit API and/or Apple Maps Server API +only to access the Apple Maps Service and/or Map Data in Your Applications (except as otherwise set +forth below). +As part of such access to the Apple Maps Service and/or Map Data through the MapKit API or Apple +Maps Server API: +- Your Application must not remove, obscure or alter Apple’s or its licensors’ copyright notices, +trademarks, or any other proprietary rights or legal notices, documents or hyperlinks that may appear in +or be provided through the Apple Maps Service; +- You must not use the Apple Maps Service in any manner that enables or permits bulk downloads or +feeds of the Map Data, or any portion thereof, or that in any way attempts to extract, scrape or reutilize +any portions of the Map Data. For example, neither You nor Your Application may use or make available +the Map Data, or any portion thereof, as part of any secondary or derived database; +- Your Application may display the Map Data only as permitted herein, and when displaying it on a map, +You agree that it will be displayed only on an Apple map provided through the Apple Maps Service; +- Except to the extent expressly permitted herein, You agree not to copy, modify, translate, create a +derivative work of, publish or publicly display the Map Data in any way. Further, You may not use or +compare the data provided by the Apple Maps Service for the purpose of improving or creating another +mapping service; +- Unless otherwise expressly permitted in writing by Apple, Map Data may not be cached, pre-fetched, +or stored by You or Your Application, other than on a temporary and limited basis solely as necessary (i) +for Your use of the Apple Maps Service as permitted herein or in the MapKit Documentation, and/or (ii) +solely to improve the performance of the Apple Maps Service with Your Application after which, in all +cases, You must delete any such Map Data and, upon Apple’s request, provide to Apple written +certification of the deletion; +- You acknowledge and agree that results You may receive from the Apple Maps Service may vary from +actual conditions due to variable factors that can affect the accuracy of Map Data, such as road or +weather conditions; and +- If Your Application accesses the MapKit API from a device running iOS version 5 or earlier, Your +Application will access and use only the Google Mobile Maps (GMM) service. Such use of the GMM is +subject to the following terms: http://code.google.com/apis/maps/terms/iPhone.html. If You do not +accept such terms, You may not use the GMM service in Your Application, and You acknowledge and +agree that such use will constitute Your acceptance of such terms. +Applications that use location-based APIs (e.g., Core Location, MapKit API) or otherwise provide +location-based services may not be designed or marketed for automatic or autonomous control of +vehicle behavior, or for emergency or life-saving purposes. Map Data and other location data +provided by Apple is not intended to be relied upon in situations where precise location information is +needed or where erroneous, delayed, non-existent, inaccurate or incomplete location data may lead to +death, personal injury, property or environmental damage. +If You choose to provide Your own location-based service, data and/or information in conjunction with +the Apple maps provided through the Apple Maps Service (e.g., overlaying a map or route You have +created on top of an Apple map), You are solely responsible for ensuring that Your service, data and/or +information correctly aligns with any Apple maps used. For Applications that use location-based APIs +for real-time navigation (including, but not limited to, turn-by-turn route guidance and other routing that +is enabled through the use of a sensor), You must have an end-user license agreement that includes the +following notice: YOUR USE OF THIS REAL TIME ROUTE GUIDANCE APPLICATION IS AT YOUR SOLE +RISK. LOCATION DATA MAY NOT BE ACCURATE. Further, any Applications that offer location-based +services or location-based functionality must notify and obtain consent from an individual before his or +her location data is collected, transmitted or otherwise used by the Application. +B. Use of the HealthKit APIs and the HomeKit APIs +You may use the HealthKit APIs only for internal testing and development purposes for Your Application. +Your Application must not access the HealthKit APIs unless it is primarily designed to provide health +and/or fitness services. You must not use the HealthKit APIs, or any information obtained through the +HealthKit APIs, to disclose or provide an end-user’s health and/or fitness information to any third party +and may only use such APIs for internal testing and development purposes for Your Application. If Your +Application accesses NikeFuel points information through the HealthKit APIs, then Your use of the +NikeFuel points information is subject to the NikeFuel points terms of service set forth at: https:// +developer.nike.com/healthkit/nikefuel-use-agreement.html. If You do not accept such NikeFuel points +terms of service, including, but not limited to all limitations and restrictions therein, You may not use +such NikeFuel points information in Your Application, and You acknowledge and agree that such use will +constitute Your acceptance of such terms of service. +You may use the HomeKit APIs only for internal testing and development purposes for Your Application. +Your Application must not access the HomeKit APIs unless it is primarily designed to provide home +configuration or home automation services (e.g., turning on a light, lifting a garage door) for hardware +accessories licensed under Apple’s MFi Program. You agree not to use the HomeKit APIs for any +purpose other than interfacing, communicating, interoperating with or otherwise controlling hardware +accessories licensed under Apple’s MFi Program or for using the HomeKit database, and then only for +home configuration or home automation purposes in connection with Your Application. Your Application +may use information obtained from the HomeKit APIs and/or the HomeKit database only on supported +Apple-branded products. You agree not to export, remotely access, or transfer such information off +such device (e.g., a lock password cannot be sent off an end-user’s device to be stored in an external +non-Apple database). +C. Compliance with Laws +You agree that neither You nor Your Applications will disable, override or otherwise interfere with any +Apple-implemented system alerts, warnings, display panels, consent panels and the like. You +understand and agree that You and Your Applications must comply with all applicable criminal, civil and +statutory laws and regulations (including privacy, data collection and location service laws and +regulations) in any jurisdictions in which Your Applications may be delivered. You shall be solely +responsible for, and Apple shall have no responsibility or liability whatsoever with respect to, any and all +claims, suits, liabilities, losses, damages, costs and expenses arising from, related or attributable to, or +otherwise involving Your Application. +You agree not to use the Apple Software and Services for any unlawful or illegal activity, nor to develop +any Application that would commit or facilitate the commission of a crime, or other tortious, unlawful, or +illegal act. You agree that, to the best of Your knowledge and belief, Your Applications will not violate, +misappropriate, or infringe any Apple or third party copyrights, trademarks, rights of privacy and +publicity, trade secrets, patents, or other proprietary or legal rights (e.g. musical composition or +performance rights, video rights, photography or image rights, logo rights, third party data rights, etc. for +content and materials that may be included in Your Application). Further, You agree not to use the +Apple Software or Apple Services to create any Application or other software program that would +disable, hack or otherwise interfere with any security, digital signing, digital rights management, content +protection, verification or authentication mechanisms implemented in or by the Apple Software or the +Apple Services, or by other Apple software, services or technology, or enable others to do so, unless +otherwise permitted by Apple in writing. +Applications must not contain any malware, malicious or harmful code, program, or other internal +component (e.g. computer viruses, trojan horses, “backdoors”) and may not use any Apple Software or +services in a way that could damage, destroy, or adversely affect Apple hardware, software or services, +or any other software, firmware, hardware, data, systems, services, or networks. If Your Application +includes any FOSS, You agree to comply with all applicable FOSS licensing terms, and You agree not to +use any FOSS in the development of Your Application in such a way that would cause the non-FOSS +portions of the Provisioning Profiles, Apple Software, Services, or any Apple-issued certificates to be +subject to any FOSS licensing terms or obligations. +3. Pre-Release Software and Services +Note: This Agreement applies to both the commercial release versions of the Apple Software and +pre-release versions of the Apple Software, as applicable. You should review the release notes +provided with the Apple Software if You are uncertain about Your confidentiality obligations or +visit developer.apple.com for more information about pre-release versions. +3.1 Using Pre-Release Apple Software and Services +Pre-release versions of the Apple Software or Apple Services should not be relied upon to perform in the +same manner as a final-release, commercial-grade product, nor should they be used with data that is +not sufficiently and regularly backed up. The pre-release Apple Software and Apple Services may +contain inaccuracies or errors that could cause failures or loss of data and may be incomplete. You +should back up Your data prior to using any pre-release Apple Software and Apple Services and not rely +on them to perform in the same way as a commercial release of the Apple Software and Services. +3.2 Confidentiality +You agree that pre-release versions of the Apple Software and Apple Services (including pre-release +Documentation) will be deemed “Apple Confidential Information”; provided however that upon the +commercial release of the Apple Software and Apple Services, such pre-release versions of the Apple +Software and Apple Services will no longer be confidential. Notwithstanding the foregoing, Apple +Confidential Information will not include: (i) information that is generally and legitimately available to the +public through no fault or breach of Yours, (ii) information that is generally made available to the public +by Apple, (iii) information that is independently developed by You without the use of any Apple +Confidential Information, (iv) information that was rightfully obtained from a third party who had the right +to transfer or disclose it to You without limitation, or (v) any FOSS included in the Apple Software and +Apple Services and accompanied by licensing terms that do not impose confidentiality obligations on +the use or disclosure of such FOSS. Further, Apple agrees that You will not be bound by the foregoing +confidentiality terms with regard to technical information about pre-release Apple Software or Apple +Services disclosed by Apple at WWDC (Apple’s Worldwide Developers Conference), except that You +may not post screen shots of, write public reviews of, or redistribute any pre-release Apple Software or +Services. +You agree to protect Apple Confidential Information using at least the same degree of care that You use +to protect Your own confidential information of similar importance, but no less than a reasonable degree +of care. You agree to use Apple Confidential Information solely for the purpose of exercising Your rights +and performing Your obligations under this Agreement and agree not to use Apple Confidential +Information for any other purpose, for Your own or any third party’s benefit, without Apple's prior written +consent. You further agree not to disclose or disseminate Apple Confidential Information to anyone +other than: (i) Authorized Developers; or (ii) as otherwise agreed or permitted in writing by Apple. You +may disclose Apple Confidential Information to the extent required by law, provided that You take +reasonable steps to notify Apple of such requirement before disclosing the Apple Confidential +Information and to obtain protective treatment of the Apple Confidential Information. You acknowledge +that damages for improper disclosure of Apple Confidential Information may be irreparable; therefore, +Apple is entitled to seek equitable relief, including injunction and preliminary injunction, in addition to all +other remedies. +4. Indemnification +To the extent permitted by applicable law, You agree to indemnify, defend and hold harmless Apple, its +directors, officers, employees, independent contractors and agents (each an “Apple Indemnified +Party”) from any and all claims, losses, liabilities, damages, expenses and costs (including without +limitation attorneys' fees and court costs) (collectively “Losses”) incurred by an Apple Indemnified Party +as a result of Your breach of this Agreement, a breach of any certification, covenant, representation or +warranty made by You in this Agreement, any claims that Your Applications violate or infringe any third +party intellectual property or proprietary rights, or otherwise related to or arising from Your use of the +Apple Software and Apple Services, Your Applications, Your development of Applications, or Your +loading of Applications and limited distribution as permitted hereunder. You acknowledge that the +Apple Software and Apple Services is not intended for use in the development of Applications in which +errors or inaccuracies in the content, functionality, services, data or information provided by the +Application or the failure of the Application could lead to death, personal injury, or severe physical or +environmental damage, and, to the extent permitted by law, You hereby agree to indemnify, defend and +hold harmless each Apple Indemnified Party from any Losses incurred by such Apple Indemnified Party +by reason of any such use. In no event may You enter into any settlement or like agreement with a third +party that affects Apple's rights or binds Apple in any way, without the prior written consent of Apple. +5. Term and Termination +The license to use this version of the Apple Software and Apple Services is effective until terminated as +set forth herein. +This Agreement and all rights under this Agreement will terminate automatically or cease to be effective +without notice from Apple if You or any of Your Authorized Developers fail to comply with any term(s) of +this Agreement. All rights hereunder in any beta or pre-release versions of the Apple Software for a +particular release will terminate upon the commercial release of such Apple Software. +Upon the termination of this Agreement for any reason, You agree to immediately cease all use of the +Apple Software and Apple Services and erase and destroy all copies, full or partial, of the Apple +Software and Apple Services and all copies of Apple Confidential Information in Your and Your +Authorized Developers' possession or control. At Apple’s request, You agree to provide written +certification of such destruction to Apple. +Apple reserves the right to revoke, disable or suspend any Provisioning Profiles or any access to +the device deployment and provisioning features of the Apple Software and Services at any time, +in its sole discretion. By way of example, Apple may do this if Apple has reason to believe that +Apple IDs were fraudulently obtained, that an unreasonable number of devices have been entered +into the Apple Software, and/or that the Services are being used in a fraudulent, suspicious, or +improper manner. +The following terms shall survive termination: Section 1, the last sentence of Section 2.1, the last two +sentences of Section 2.2B., the second to last sentence of Section 2.4, Section 2.6, Section 2.7, Section +2.12B, 2.12D, the last sentence of 2.13, and Sections 3, 4, 5, 6, 7, and 8. Apple will not be liable for +compensation, indemnity, or damages of any sort as a result of terminating this Agreement in +accordance with its terms, and termination of this Agreement will be without prejudice to any other right +or remedy Apple may have, now or in the future. +6. NO WARRANTY +A. YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT, TO THE EXTENT PERMITTED BY +APPLICABLE LAW, USE OF THE APPLE SOFTWARE AND APPLE SERVICES IS AT YOUR SOLE RISK +AND THAT THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND +EFFORT IS WITH YOU. +B. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE APPLE SOFTWARE AND +APPLE SERVICES ARE PROVIDED “AS IS” AND “AS AVAILABLE”, WITH ALL FAULTS AND WITHOUT +WARRANTY OF ANY KIND, AND APPLE AND APPLE'S LICENSORS (COLLECTIVELY REFERRED TO +AS “APPLE” FOR THE PURPOSES OF SECTIONS 6 AND 7) HEREBY DISCLAIM ALL WARRANTIES +AND CONDITIONS WITH RESPECT TO THE APPLE SOFTWARE AND APPLE SERVICES, EITHER +EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES +AND CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR +PURPOSE, ACCURACY, TIMELINESS, AND NON-INFRINGEMENT OF THIRD PARTY RIGHTS. +C. APPLE DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE +APPLE SOFTWARE AND APPLE SERVICES, THAT THE APPLE SOFTWARE AND APPLE SERVICES +WILL MEET YOUR REQUIREMENTS, THAT THE OPERATION OF THE APPLE SOFTWARE AND APPLE +SERVICES WILL BE UNINTERRUPTED OR ERROR-FREE, THAT DEFECTS IN THE APPLE SOFTWARE +AND APPLE SERVICES WILL BE CORRECTED, OR THAT THE APPLE SOFTWARE AND APPLE +SERVICES WILL BE COMPATIBLE WITH FUTURE APPLE PRODUCTS OR SOFTWARE. INSTALLATION +OF THIS APPLE SOFTWARE AND USE OF THE APPLE SERVICES MAY AFFECT THE USABILITY OF +THIRD PARTY SOFTWARE, APPLICATIONS OR THIRD PARTY SERVICES AS WELL AS OTHER APPLE +PRODUCTS OR SERVICES. +D. YOU FURTHER ACKNOWLEDGE THAT THE APPLE SOFTWARE AND APPLE SERVICES ARE +NOT INTENDED OR SUITABLE FOR USE IN SITUATIONS OR ENVIRONMENTS WHERE THE FAILURE +OR TIME DELAYS OF, OR ERRORS OR INACCURACIES IN THE CONTENT, DATA OR INFORMATION +PROVIDED BY, THE APPLE SOFTWARE OR APPLE SERVICES COULD LEAD TO DEATH, PERSONAL +INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE, INCLUDING WITHOUT LIMITATION +THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR COMMUNICATION +SYSTEMS, AIR TRAFFIC CONTROL, LIFE SUPPORT OR WEAPONS SYSTEMS. +E. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE OR AN APPLE +AUTHORIZED REPRESENTATIVE WILL CREATE A WARRANTY. SHOULD THE APPLE SOFTWARE +AND APPLE SERVICES PROVE DEFECTIVE, YOU ASSUME THE ENTIRE COST OF ALL NECESSARY +SERVICING, REPAIR OR CORRECTION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION +OF IMPLIED WARRANTIES OR LIMITATIONS ON APPLICABLE STATUTORY RIGHTS OF A +CONSUMER, SO THE ABOVE EXCLUSION AND LIMITATIONS MAY NOT APPLY TO YOU. +7. LIMITATION OF LIABILITY +TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, IN NO EVENT WILL APPLE BE LIABLE FOR +PERSONAL INJURY, OR ANY INCIDENTAL, SPECIAL, INDIRECT, CONSEQUENTIAL OR PUNITIVE +DAMAGES WHATSOEVER, INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, +CORRUPTION OR LOSS OF DATA, FAILURE TO TRANSMIT OR RECEIVE ANY DATA OR +INFORMATION, BUSINESS INTERRUPTION OR ANY OTHER COMMERCIAL DAMAGES OR LOSSES, +ARISING OUT OF OR RELATED TO THIS AGREEMENT, YOUR USE OF OR INABILITY TO USE THE +APPLE SOFTWARE AND APPLE SERVICES, OR YOUR DEVELOPMENT EFFORTS, HOWEVER +CAUSED, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING +NEGLIGENCE), PRODUCTS LIABILITY, OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES, AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL +PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR +LIMITATION OF LIABILITY FOR PERSONAL INJURY, OR OF INCIDENTAL OR CONSEQUENTIAL +DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event shall Apple’s total liability +to You under this Agreement for all damages (other than as may be required by applicable law in +cases involving personal injury) exceed the amount of fifty dollars ($50.00). +8. General Legal Terms +8.1 Third Party Notices +Portions of the Apple Software and Apple Services utilize or include third party software and other +copyrighted material. Acknowledgements, licensing terms and disclaimers for such material are +contained in the electronic documentation for the Apple Software and Apple Services, and Your use of +such material is governed by their respective terms. Further, certain software libraries and other third +party software included with the Apple Software are free software and licensed under the terms of the +GNU General Public License (GPL) or the GNU Library/Lesser General Public License (LGPL), as the +case may be. You may obtain a complete machine-readable copy of the source code for such free +software under the terms of the GPL or LGPL, as the case may be, without charge except for the cost of +media, shipping, and handling, upon written request to Apple at opensource@apple.com. The GPL/ +LGPL software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy +of the GPL and LGPL is included with the Apple Software. +8.2 Consent to Collection and Use of Data +A. Diagnostic and Usage Data +- If You are running a pre-release version of the Apple Software and Services, then unless You opt out +of diagnostic and usage collection, You agree that Apple and its subsidiaries and agents will collect, +maintain, process and use diagnostic, technical, usage and related information, including but not limited +to unique system or hardware identifiers, information about Your computer, system and application +software, and peripherals, that is gathered periodically and automatically as part of the pre-release +seeding process to test, provide and improve Apple’s products and services, facilitate the provision of +software updates, product support and other services to You (if any) related to the Apple Software, and +to verify compliance with the terms of this Agreement. +- If You are running a commercial version of the Apple Software and Services, then if You choose to +allow diagnostic and usage collection, You agree that Apple and its subsidiaries and agents may collect, +maintain, process and use diagnostic, technical, usage and related information, including but not limited +to unique system or hardware identifiers, information about Your computer, system and application +software, and peripherals, that is gathered periodically to provide and improve Apple’s products and +services, facilitate the provision of software updates, product support and other services to You (if any) +related to the Apple Software, and to verify compliance with the terms of this Agreement. +- You may change Your preferences for Diagnostics & Usage collection at any time by going to the +Diagnostics & Usage setting in Your system software and deselecting the checkbox. The Diagnostics & +Usage setting is found in the Security & Privacy pane within System Preferences. Apple may use this +information, so long as it is collected in a form that does not personally identify You, for the purposes +described above. To enable Apple’s partners and third party developers to improve their software, +hardware and services designed for use with Apple products, Apple may also provide any such partner +or third party developer with a subset of diagnostic information that is relevant to that partner’s or +developer’s software, hardware and/or services, so long as the diagnostic information is in a form that +does not personally identify You. +B. Device Provisioning Data +In order to set up and use the device provisioning, account authentication, and deployment features of +the Apple Software and Services, certain unique identifiers for Your computer, iOS devices, watchOS +devices, iPadOS devices, tvOS devices, visionOS devices, and account information may be needed. +These unique identifiers may include Your email address, Your Apple ID, a hardware identifier for Your +computer, and device identifiers entered by You into the Apple Software for Apple-branded products +running iOS, watchOS, iPadOS, tvOS, or visionOS. Such identifiers and information may be logged in +association with Your interaction with the Service and Your use of these features and the Apple Software +and Services. By using the Apple Software or Services, You agree that Apple may transmit, +collect, maintain, process and use these identifiers and information for the purpose of providing +the Apple Software and Services, including using such identifiers for account verification and antifraud measures. If You do not want to provide this information, do not use the device deployment and +provisioning features of the Apple Software or Services. +C. Privacy Policy +At all times Your information will be treated in accordance with Apple’s Privacy Policy, which can be +viewed at: http://www.apple.com/legal/privacy/. +8.3 Severability; Waiver +If a court of competent jurisdiction finds any clause of this Agreement to be unenforceable for any +reason, that clause of this Agreement shall be enforced to the maximum extent permissible so as to +effect the intent of the parties, and the remainder of this Agreement shall continue in full force and effect. +However, if applicable law prohibits or restricts You from fully and specifically complying with the +Sections of this Agreement entitled “Internal Use License and Restrictions” or prevents the +enforceability of either of those Sections, this Agreement will immediately terminate and You must +immediately discontinue any use of the Apple Software and Apple Services as described in the Section +entitled “Term and Termination.” Failure by Apple to enforce any provision of this Agreement shall not +be deemed a waiver of future enforcement of that or any other provision. Any laws or regulations that +provide that the language of a contract will be construed against the drafter will not apply to this +Agreement. Section headings are for convenience only and are not to be considered in construing or +interpreting this Agreement. +8.4 Export Control +You may not use, export, re-export, import, sell or transfer the Apple Software and Apple Services +except as authorized by United States law, the laws of the jurisdiction in which You obtained the Apple +Software and Apple Services, and any other applicable laws and regulations. In particular, but without +limitation, the Apple Software and Apple Services may not be exported or re-exported (a) into any U.S. +embargoed countries or (b) to anyone on the U.S. Treasury Department’s list of Specially Designated +Nationals or the U.S. Department of Commerce Denied Person’s List or Entity List or any other restricted +party lists. By using the Apple Software and Apple Services, You represent and warrant that You are not +located in any such country or on any such list. You also agree that You will not use the Apple Software +and Apple Services for any purposes prohibited by United States law, including, without limitation, the +development, design, manufacture or production of nuclear, chemical or biological weapons. +8.5 Government End Users +The Apple Software and Apple Services and Documentation are “Commercial Items”, as that term is +defined at 48 C.F.R. §2.101, consisting of “Commercial Computer Software” and “Commercial +Computer Software Documentation”, as such terms are used in 48 C.F.R. §12.212 or 48 C.F.R. +§227.7202, as applicable. Consistent with 48 C.F.R. §12.212 or 48 C.F.R. §227.7202-1 through +227.7202-4, as applicable, the Commercial Computer Software and Commercial Computer Software +Documentation are being licensed to U.S. Government end users (a) only as Commercial Items and (b) +with only those rights as are granted to all other end users pursuant to the terms and conditions herein. +Unpublished-rights reserved under the copyright laws of the United States. +8.6 Dispute Resolution; Governing Law +Any litigation or other dispute resolution between You and Apple arising out of or relating to this +Agreement, the Apple Software and/or Apple Services will take place in the Northern District of +California, and You and Apple hereby consent to the personal jurisdiction of and exclusive venue in the +state and federal courts within that District with respect any such litigation or dispute resolution. This +Agreement will be governed by and construed in accordance with the laws of the United States and the +State of California, except that body of California law concerning conflicts of law. Notwithstanding the +foregoing, the following shall apply as exceptions to You, but solely to the limited extent that You are +entering into this Agreement for the sole purpose of acting on behalf of Your entity: +A. If You (as an entity entering into this Agreement) are an agency, instrumentality or department of the +federal government of the United States, then this Agreement shall be governed in accordance with the +laws of the United States of America, and in the absence of applicable federal law, the laws of the State +of California will apply. Further, and notwithstanding anything to the contrary in this Agreement +(including but not limited to Section 4 (Indemnification)), all claims, demands, complaints and disputes +will be subject to the Contract Disputes Act (41 U.S.C. §§601-613), the Tucker Act (28 U.S.C. § 1346(a) +and § 1491), or the Federal Tort Claims Act (28 U.S.C. §§ 1346(b), 2401-2402, 2671-2672, 2674-2680), +as applicable, or other applicable governing authority; +B. If You (as an entity entering into this Agreement) are a U.S. public and accredited educational +institution, then (a) this Agreement will be governed and construed in accordance with the laws of the +state (within the U.S.) in which Your educational institution is domiciled, except that body of state law +concerning conflicts of law; and (b) any litigation or other dispute resolution between You and Apple +arising out of or relating to this Agreement, the Apple Software and Apple Services, or Your relationship +with Apple will take place in federal court within the Northern District of California, and You and Apple +hereby consent to the personal jurisdiction of and exclusive venue of such District unless such consent +is expressly prohibited by the laws of the state in which Your educational institution is domiciled; and +C. If You (as an entity entering into this Agreement) are an international, intergovernmental organization +that has been conferred immunity from the jurisdiction of national courts through Your intergovernmental +charter or agreement, then any controversy or claim arising out of or relating to this Agreement, or the +breach thereof, shall be determined by arbitration administered by the International Centre for Dispute +Resolution in accordance with its International Arbitration Rules. The place of arbitration shall be +London, England; the language shall be English; and the number of arbitrators shall be three. Upon +Apple’s request, You agree to provide evidence of Your status as an intergovernmental organization with +such privileges and immunities. +This Agreement shall not be governed by the United Nations Convention on Contracts for the +International Sale of Goods, the application of which is expressly excluded. +8.7 Entire Agreement; Governing Language +This Agreement constitutes the entire agreement between the parties with respect to the use of the +Apple Software and Apple Services licensed hereunder and supersedes all prior understandings +regarding such subject matter. Notwithstanding the foregoing, to the extent that You have entered into +the Apple Developer Program License Agreement (PLA) with Apple and are validly licensed by Apple to +exercise additional rights, or to use additional features or functionality of the Apple Software or Apple +Services under the PLA, You acknowledge and agree that the PLA shall govern Your use of such +additional rights and privileges. No amendment to or modification of this Agreement will be binding +unless in writing and signed by Apple. The parties hereto confirm that they have requested that this +Agreement and all related documents be drafted in English. Les parties ont exigé que le présent contrat +et tous les documents connexes soient rédigés en anglais. +EA1863 +11/17/2023 \ No newline at end of file diff --git a/ScribbleLab.xcodeproj/project.pbxproj b/ScribbleLab.xcodeproj/project.pbxproj index 818291e1b..23c6ccd48 100644 --- a/ScribbleLab.xcodeproj/project.pbxproj +++ b/ScribbleLab.xcodeproj/project.pbxproj @@ -107,6 +107,8 @@ 38AE9CB12AD0751100B761E8 /* ScribbleLabTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38AE9CB02AD0751100B761E8 /* ScribbleLabTests.swift */; }; 38AE9CBB2AD0751100B761E8 /* ScribbleLabUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38AE9CBA2AD0751100B761E8 /* ScribbleLabUITests.swift */; }; 38AE9CBD2AD0751100B761E8 /* ScribbleLabUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38AE9CBC2AD0751100B761E8 /* ScribbleLabUITestsLaunchTests.swift */; }; + 38C68B982B0D134300D16E86 /* SLButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38C68B972B0D134300D16E86 /* SLButton.swift */; }; + 38C68B9A2B0D1CA100D16E86 /* SLButton+Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38C68B992B0D1CA100D16E86 /* SLButton+Image.swift */; }; 38D56F062AF59A0000CE3781 /* ImagePicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38D56F052AF59A0000CE3781 /* ImagePicker.swift */; }; 38D5C68B2AD28B9D00D943A5 /* SLDarkmodeSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38D5C68A2AD28B9D00D943A5 /* SLDarkmodeSettingsView.swift */; }; 38D5C68D2AD28D6F00D943A5 /* SLUpdateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38D5C68C2AD28D6F00D943A5 /* SLUpdateView.swift */; }; @@ -119,6 +121,7 @@ 38EFBE202AD6D1A400CF0ECD /* RedemtionSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38EFBE1F2AD6D1A400CF0ECD /* RedemtionSheetView.swift */; }; 38EFBE232AD6E4EF00CF0ECD /* RestartAppView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38EFBE222AD6E4EF00CF0ECD /* RestartAppView.swift */; }; 38F59B8B2AEC4E0D00475B0B /* ResetPasswordView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38F59B8A2AEC4E0D00475B0B /* ResetPasswordView.swift */; }; + 38F9080D2B0920ED0092EC58 /* PageIntro.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38F9080C2B0920ED0092EC58 /* PageIntro.swift */; }; 38FFF9322AE3C18B006719E2 /* FirebaseAuth in Frameworks */ = {isa = PBXBuildFile; productRef = 38FFF9312AE3C18B006719E2 /* FirebaseAuth */; }; 38FFF9342AE3C18B006719E2 /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = 38FFF9332AE3C18B006719E2 /* FirebaseCrashlytics */; }; 38FFF9362AE3C18B006719E2 /* FirebaseDatabase in Frameworks */ = {isa = PBXBuildFile; productRef = 38FFF9352AE3C18B006719E2 /* FirebaseDatabase */; }; @@ -294,6 +297,8 @@ 38AE9CB62AD0751100B761E8 /* ScribbleLabUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ScribbleLabUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 38AE9CBA2AD0751100B761E8 /* ScribbleLabUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScribbleLabUITests.swift; sourceTree = ""; }; 38AE9CBC2AD0751100B761E8 /* ScribbleLabUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScribbleLabUITestsLaunchTests.swift; sourceTree = ""; }; + 38C68B972B0D134300D16E86 /* SLButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SLButton.swift; sourceTree = ""; }; + 38C68B992B0D1CA100D16E86 /* SLButton+Image.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SLButton+Image.swift"; sourceTree = ""; }; 38D56F052AF59A0000CE3781 /* ImagePicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImagePicker.swift; sourceTree = ""; }; 38D5C68A2AD28B9D00D943A5 /* SLDarkmodeSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SLDarkmodeSettingsView.swift; sourceTree = ""; }; 38D5C68C2AD28D6F00D943A5 /* SLUpdateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SLUpdateView.swift; sourceTree = ""; }; @@ -305,6 +310,7 @@ 38EFBE1F2AD6D1A400CF0ECD /* RedemtionSheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RedemtionSheetView.swift; sourceTree = ""; }; 38EFBE222AD6E4EF00CF0ECD /* RestartAppView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestartAppView.swift; sourceTree = ""; }; 38F59B8A2AEC4E0D00475B0B /* ResetPasswordView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResetPasswordView.swift; sourceTree = ""; }; + 38F9080C2B0920ED0092EC58 /* PageIntro.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageIntro.swift; sourceTree = ""; }; 38FFF93F2AE3C55F006719E2 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 38FFF9412AE3C7C9006719E2 /* SignInWithGoogleModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInWithGoogleModel.swift; sourceTree = ""; }; 38FFF9442AE3CA6F006719E2 /* Application_utility.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Application_utility.swift; sourceTree = ""; }; @@ -460,6 +466,7 @@ 38355ED52AD3D50F00392674 /* Componets */ = { isa = PBXGroup; children = ( + 38C68B962B0D133100D16E86 /* Views */, 3852D71D2B054D07007FAFF1 /* Effects */, 3852D7182B053C24007FAFF1 /* Shaders */, 38355ED62AD3D52D00392674 /* IGTextFieldModifier.swift */, @@ -690,7 +697,8 @@ 385F78B42AD5E9000096E504 /* Tour */ = { isa = PBXGroup; children = ( - 385F78B52AD5E9120096E504 /* TourViewBeginning.swift */, + 38F9080B2B0920CE0092EC58 /* View */, + 38F9080A2B0920C80092EC58 /* Model */, ); path = Tour; sourceTree = ""; @@ -970,6 +978,15 @@ path = ScribbleLabUITests; sourceTree = ""; }; + 38C68B962B0D133100D16E86 /* Views */ = { + isa = PBXGroup; + children = ( + 38C68B972B0D134300D16E86 /* SLButton.swift */, + 38C68B992B0D1CA100D16E86 /* SLButton+Image.swift */, + ); + path = Views; + sourceTree = ""; + }; 38D56F042AF599EA00CE3781 /* Profile */ = { isa = PBXGroup; children = ( @@ -1145,6 +1162,22 @@ path = AppAuth; sourceTree = ""; }; + 38F9080A2B0920C80092EC58 /* Model */ = { + isa = PBXGroup; + children = ( + 38F9080C2B0920ED0092EC58 /* PageIntro.swift */, + ); + path = Model; + sourceTree = ""; + }; + 38F9080B2B0920CE0092EC58 /* View */ = { + isa = PBXGroup; + children = ( + 385F78B52AD5E9120096E504 /* TourViewBeginning.swift */, + ); + path = View; + sourceTree = ""; + }; 38FFF9432AE3CA52006719E2 /* ViewController */ = { isa = PBXGroup; children = ( @@ -1467,7 +1500,9 @@ 381E0B362ADC136400A2A836 /* PomodoroModel.swift in Sources */, 385F78BE2AD5ED720096E504 /* SLHelpView.swift in Sources */, 38140A642AE3F6D200753FB6 /* LoginViewModel.swift in Sources */, + 38C68B982B0D134300D16E86 /* SLButton.swift in Sources */, 381F1F132AD72DD6001B3B10 /* TestView.swift in Sources */, + 38F9080D2B0920ED0092EC58 /* PageIntro.swift in Sources */, 38ADB4D92AF6952C0019375B /* Documentation.docc in Sources */, 38140A622AE3F61000753FB6 /* SLAuthService.swift in Sources */, 38E304702AF639F300103D71 /* Crop.swift in Sources */, @@ -1489,6 +1524,7 @@ 3868A3E32AD2FE6600D4CAEC /* ProfileView.swift in Sources */, 38355ED92AD3D71900392674 /* IGButtonModifier.swift in Sources */, 385F468E2AD31CD100D85410 /* SignUpView.swift in Sources */, + 38C68B9A2B0D1CA100D16E86 /* SLButton+Image.swift in Sources */, 38EFBE202AD6D1A400CF0ECD /* RedemtionSheetView.swift in Sources */, 385F78BA2AD5ECC10096E504 /* SLInfoView.swift in Sources */, 38EFBE1D2AD6965C00CF0ECD /* PackageLicense.swift in Sources */, diff --git a/ScribbleLab/Core/Auth/View/LogInView.swift b/ScribbleLab/Core/Auth/View/LogInView.swift index 7b1d40491..d34ee9c2d 100644 --- a/ScribbleLab/Core/Auth/View/LogInView.swift +++ b/ScribbleLab/Core/Auth/View/LogInView.swift @@ -36,6 +36,7 @@ struct LogInView: View { VStack(spacing: 20) { VStack { + /* Button { vm.signInWithGoogle() } label: { @@ -57,9 +58,15 @@ struct LogInView: View { .fill(Color(red: 248/255, green: 248/255, blue: 248/255)) .strokeBorder(Color(red: 194/255, green: 194/255, blue: 194/255), lineWidth: 0.5) } + }*/ + SLImageButton(text: "Continue With Google", font: .subheadline, backgroundColor: .clear, textColor: .black, cornerRadius: 10, image: Image("google"), imageWidth: 30, imageHeight: 30) { + vm.signInWithGoogle() } - - Button { + SLImageButton(text: "Continue With Apple", font: .subheadline, backgroundColor: .clear, textColor: .black, cornerRadius: 10, image: Image("apple-logo-black"), imageWidth: 30, imageHeight: 30) { + // TODO: Sign In With Apple (SIWA) + print("Sign in with apple") + } + /*Button { } label: { HStack { @@ -80,7 +87,7 @@ struct LogInView: View { .fill(Color(red: 248/255, green: 248/255, blue: 248/255)) .strokeBorder(Color(red: 194/255, green: 194/255, blue: 194/255), lineWidth: 0.5) } - } + }*/ } Divider() diff --git a/ScribbleLab/Core/Auth/View/SignUpView.swift b/ScribbleLab/Core/Auth/View/SignUpView.swift index beef08020..cc75be53e 100644 --- a/ScribbleLab/Core/Auth/View/SignUpView.swift +++ b/ScribbleLab/Core/Auth/View/SignUpView.swift @@ -88,7 +88,7 @@ struct SignUpView: View { .fontWeight(.semibold) .foregroundStyle(.black) } - .padding(.horizontal, 12) + .padding(.horizontal, 18) .padding(.vertical, 13) .background { RoundedRectangle(cornerRadius: 13) diff --git a/ScribbleLab/Core/Componets/Shaders/Shaders.metal b/ScribbleLab/Core/Componets/Shaders/Shaders.metal index f899d304a..f3ff3ff55 100644 --- a/ScribbleLab/Core/Componets/Shaders/Shaders.metal +++ b/ScribbleLab/Core/Componets/Shaders/Shaders.metal @@ -9,9 +9,90 @@ #include using namespace metal; +// `colorEffect()` +// - half4 name(float2 position, half4 color, args...) +// `distortionEffect()` +// - float2 name(float2 position, args...) +// `layerEffect()` +// - half4 name(float2 position, SwiftUI::Layer layer, args...) + // Grayscale shader [[ stitchable ]] half4 grayscale(float2 position, SwiftUI::Layer layer) { half4 originalColor = layer.sample(position); float grayscaleValue = (originalColor.r + originalColor.g + originalColor.b) / 3.0; return half4(grayscaleValue, grayscaleValue, grayscaleValue, originalColor.a); } + +[[ stitchable ]] half4 passthrough(float2 pos, half4 color) { + return color; +} + +[[ stitchable ]] half4 recolor(float2 pos, half4 color) { + return half4(1, 0, 0, color.a); /// ` half4(r, g, b, a)` r: red, g; green, b: blue, a: alpha (opacity) +} + +[[ stitchable ]] half4 invertAlpha(float2 pos, half4 color) { + return half4(1, 0, 0, 1 - color.a); +} + +// Gardient fill shader +[[ stitchable ]] half4 gradient(float2 pos, half4 color) { + return half4( + pos.x / pos.y, + 0, + pos.y / pos.x, + color.a + ); +} + +// animated gradient +[[ stitchable ]] half4 rainbow(float2 pos, half4 color, float t, float2 s) { // t: time, s: size + float angle = atan2(pos.y, pos.x) + t; + + return half4( + sin(angle), + sin(angle + 2), + sin(angle + 4), + color.a + ); +} + +[[ stitchable ]] float2 wave(float2 pos, float t, float2 s) { + float2 distance = pos / s; + pos.y += sin(t * 5 + pos.y / 20) * distance.x * 10; + return pos; +} + +[[ stitchable ]] half4 loupe(float2 pos, SwiftUI::Layer layer, float2 s, float2 touch) { + float maxDistance = 0.05; + + float2 uv = pos / s; + float2 center = touch / s; + float2 delta = uv - center; + + float aspectRatio = s.x / s.y; + float distance = (delta.x * delta.x) + (delta.y * delta.y) / aspectRatio; + + float totalZoom = 1; + + if (distance < maxDistance) { + totalZoom /= 2; + totalZoom += distance * 10; + } + + float2 newPos = delta * totalZoom + center; + return layer.sample(newPos * s); +} + +[[ stitchable ]] half4 circles(float2 pos, half4 color, float2 s, float ammount) { + float2 uv = pos / s; + float strenght = 20; + float2 f = fract(pos / strenght); + float d = distance(f, 0.5); + + if (d + uv.x + uv.y < ammount * 3) { + return color; + } else { + return 0; + } +} diff --git a/ScribbleLab/Core/Componets/Views/SLButton+Image.swift b/ScribbleLab/Core/Componets/Views/SLButton+Image.swift new file mode 100644 index 000000000..d87582b96 --- /dev/null +++ b/ScribbleLab/Core/Componets/Views/SLButton+Image.swift @@ -0,0 +1,199 @@ +// +// SLButton+Image.swift +// ScribbleLab +// +// Created by Nevio Hirani on 21.11.23. +// + +import SwiftUI + +/// A customizable button view that supports displaying either a custom image or a system image along with text. +/// +/// Example Usage: +/// ```swift +/// SLButton_Image( +/// text: "Button Text", +/// font: .headline, +/// textColor: .white, +/// backgroundColor: .blue, +/// cornerRadius: 8, +/// action: { print("Button tapped") }, +/// image: Image("customImage"), +/// imageWidth: 35, +/// imageHeight: 35 +/// ) +/// ``` +/// +/// - Parameters: +/// - text: The text to display on the button. +/// - font: The font to apply to the button text. +/// - backgroundColor: The background color of the button. +/// - textColor: The color of the button's text. +/// - cornerRadius: The corner radius of the button. +/// - action: The action to perform when the button is tapped. +/// - imageName: The name of the system image to display on the left side. +/// - imageName: The name of the system image to display on the left side. +/// - imageWidth: The width of the image. +/// - imageHeight: The height of the image. +/// +/// - Returns: A view representing the styled button with an image on the left side. +/// +struct SLButton_Image: View { + var text: String + var font: Font + var textColor: Color + var backgroundColor: Color + var cornerRadius: CGFloat + var action: () -> Void + + var image: Image? + var systemImageName: String? + + var imageWidth: CGFloat // 35 for Auth + var imageHeight: CGFloat // 35 for Auth + + + var body: some View { + Button(action: { + action() + }) { + HStack { + if let image = image { + image + .resizable() + .frame(width: imageWidth, height: imageHeight) +// .padding() + } else if let systemImageName = systemImageName { + Image(systemName: systemImageName) + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: imageWidth, height: imageHeight) +// .padding() + } + +// Spacer() + + Text(text) + .font(font) // .subheadline + .fontWeight(.semibold) + .foregroundColor(textColor) // .black + +// Spacer() + } + .frame(width: 360, height: 44) + .background(backgroundColor) + .cornerRadius(cornerRadius) // 10 + + // MARK: - Stroke of the Button (if backgroundColor = .clear): + .background { + RoundedRectangle(cornerRadius: 13) + .fill(Color(red: 248/255, green: 248/255, blue: 248/255)) + .strokeBorder(Color(red: 194/255, green: 194/255, blue: 194/255), lineWidth: 0.5) + } + + } + } +} + +extension View { + /// Creates a styled button with an image on the left side. + /// + /// Use this function to create a button with a specific text, font, colors, corner radius, an associated action, and an image on the left side. + /// + /// - Parameters: + /// - text: The text to display on the button. + /// - font: The font to apply to the button text. + /// - backgroundColor: The background color of the button. + /// - textColor: The color of the button's text. + /// - cornerRadius: The corner radius of the button. + /// - action: The action to perform when the button is tapped. + /// - imageName: The name of the system image to display on the left side. + /// - imageName: The name of the system image to display on the left side. + /// - imageWidth: The width of the image. + /// - imageHeight: The height of the image. + /// + /// - Returns: A view representing the styled button with an image on the left side. + /// + /// If you want to use this Button with a custom Image you need to use this code: + /// ```swift + /// SLImageButton(text: "Press Me", + /// font: .system(size: 18), + /// backgroundColor: .blue, + /// textColor: .white, + /// cornerRadius: 10, + /// image: Image("customImage"), // Provide your custom image + /// imageWidth: 30, + /// imageHeight: 30) { + /// // action to perform when the button is tapped + /// } + /// ``` + /// + /// If you want to use this Button with a system Image you need to use this code: + /// ```swift + /// SLImageButton(text: "Press Me", + /// font: .system(size: 18), + /// backgroundColor: .blue, + /// textColor: .white, + /// cornerRadius: 10, + /// systemImageName: "heart.fill", // Provide system image name + /// imageWidth: 30, + /// imageHeight: 30) { + /// // The action to perform when the button is tapped comes here. + /// } + /// ``` + /// + /// Note: To use this Button for Auth use as background Color .clear + func SLImageButton(text: String, font: Font, backgroundColor: Color, textColor: Color, cornerRadius: CGFloat, image: Image? = nil, systemImageName: String? = nil, imageWidth: CGFloat, imageHeight: CGFloat, action: @escaping () -> Void) -> some View { + SLButton_Image(text: text, font: font, textColor: textColor, backgroundColor: backgroundColor, cornerRadius: cornerRadius, action: action, image: image, systemImageName: systemImageName, imageWidth: imageWidth, imageHeight: imageHeight) + } +} + +// MARK: - SLButton Test View +/// A view to test the functionality of the `SLImageButton`. +/// +/// This view provides examples of using the `SLImageButton` with different configurations and images. +/// +/// Example Usage: +/// ```swift +/// SLImageButton(text: String, +/// font: Font, +/// backgroundColor: Color, +/// textColor: Color, +/// cornerRadius: CGFloat, +/// image: Image?, +/// imageWidth: CGFloat, +/// imageHeight: CGFloat, +/// action: @escaping () -> Void) +/// ``` +struct SLButton_ImageTestView: View { + var body: some View { + VStack { + Text("This is a View to test the SLImageButtons!") + .padding() + + // Example of using SLImageButton with a custom image + SLImageButton(text: "Continue With Google", font: .subheadline, backgroundColor: Color(.clear), textColor: .black, cornerRadius: 10, image: Image("google"), imageWidth: 30, imageHeight: 30) { + print("Button was pressed!") + } + + // Example of using SLImageButton with a different custom image + SLImageButton(text: "Continue With Apple", font: .subheadline, backgroundColor: Color(.clear), textColor: .black, cornerRadius: 10, image: Image("apple-logo-black"), imageWidth: 30, imageHeight: 30) { + print("Button was pressed!") + } + + // Example of using SLImageButton with a system image + SLImageButton(text: "Continue With Email", font: .subheadline, backgroundColor: Color(.clear), textColor: .black, cornerRadius: 10, systemImageName: "envelope.fill", imageWidth: 30, imageHeight: 30) { + print("Button was pressed!") + }.tint(.black) + + // Example of using SLImageButton with a system image and different background color + SLImageButton(text: "Tab on me", font: .subheadline, backgroundColor: .orange, textColor: .black, cornerRadius: 10, systemImageName: "gearshape", imageWidth: 30, imageHeight: 30) { + print("Button was pressed") + }.tint(.black) + } + } +} + +#Preview { + SLButton_ImageTestView() +} diff --git a/ScribbleLab/Core/Componets/Views/SLButton.swift b/ScribbleLab/Core/Componets/Views/SLButton.swift new file mode 100644 index 000000000..77ded8329 --- /dev/null +++ b/ScribbleLab/Core/Componets/Views/SLButton.swift @@ -0,0 +1,95 @@ +// +// SLButton.swift +// ScribbleLab +// +// Created by Nevio Hirani on 21.11.23. +// + +import SwiftUI + +/// A customizable button view. +/// +/// This view creates a styled button with customizable appearance and action. +/// +/// Example Usage: +/// ```swift +/// SLButton(text: String, +/// font: Font, +/// backgroundColor: Color, +/// textColor: Color, +/// cornerRadius: CGFloat, +/// action: @escaping () -> Void) +/// ``` +struct SLButtonView: View { + var text: String + var font: Font + var backgroundColor: Color + var textColor: Color + var cornerRadius: CGFloat + var action: () -> Void + + var body: some View { + Button(action: { + action() + }) { + Text(text) + .font(font) // .subheadline + .fontWeight(.semibold) + .foregroundColor(textColor) // .black + .frame(width: 360, height: 44) + .background(backgroundColor) + .cornerRadius(cornerRadius) // 10 + // MARK: - Stroke of the Button (if backgroundColor = .clear): + .background { + RoundedRectangle(cornerRadius: 13) + .fill(Color(red: 248/255, green: 248/255, blue: 248/255)) + .strokeBorder(Color(red: 194/255, green: 194/255, blue: 194/255), lineWidth: 0.5) + } + } + } +} + +extension View { + /// Creates a styled button with customizable appearance and action. + /// + /// Use this function to create a button with specific text, font, colors, corner radius, and an associated action. + /// + /// - Parameters: + /// - text: The text to display on the button. + /// - font: The font to apply to the button text. + /// - color: The background color of the button. + /// - textColor: The color of the button's text. + /// - cornerRadius: The corner radius of the button. + /// - action: The action to perform when the button is tapped. + /// + /// - Returns: A view representing the styled button. + /// + func SLButton(text: String, font: Font, backgroundColor: Color, textColor: Color, cornerRadius: CGFloat, action: @escaping () -> Void) -> some View { + SLButtonView(text: text, font: font, backgroundColor: backgroundColor, textColor: textColor, cornerRadius: cornerRadius, action: action) + } +} + +// MARK: - SLButton Test View +/// A test view for the ```SLButton```'s +/// +/// Use this view to test the SLButtonView functionality. +/// This view provides examples of using the `SLButton` with different configurations. +/// +struct SLButtonTestView: View { + var body: some View { + VStack { + Text("This is a View to test the SLButton!") + + SLButton(text: "Tab on me", font: .subheadline, backgroundColor: .orange, textColor: .black, cornerRadius: 10) { + print("Button was pressed!") + } + SLButton(text: "Tab on me", font: .subheadline, backgroundColor: .clear, textColor: .black, cornerRadius: 10) { + print("Button was pressed!") + } + } + } +} + +#Preview { + SLButtonTestView() +} diff --git a/ScribbleLab/Core/SideBar/SLSideBarView.swift b/ScribbleLab/Core/SideBar/SLSideBarView.swift index b3be110b5..6d0c318b7 100644 --- a/ScribbleLab/Core/SideBar/SLSideBarView.swift +++ b/ScribbleLab/Core/SideBar/SLSideBarView.swift @@ -71,6 +71,7 @@ struct SLSideBarView: View { } .listStyle(SidebarListStyle()) + .tint(.black) .navigationTitle("Documents") .navigationBarTitleDisplayMode(.large) diff --git a/ScribbleLab/Core/Tour/Model/PageIntro.swift b/ScribbleLab/Core/Tour/Model/PageIntro.swift new file mode 100644 index 000000000..0e93dfae0 --- /dev/null +++ b/ScribbleLab/Core/Tour/Model/PageIntro.swift @@ -0,0 +1,25 @@ +// +// PageIntro.swift +// ScribbleLab +// +// Created by Nevio Hirani on 18.11.23. +// + +import SwiftUI + +/// Page Intro Model +struct PageIntro: Identifiable, Hashable { + var id: UUID = .init() + var introAssetImage: String + var title: String + var subtitle: String + var description: String + var displayAction: Bool = false +} + +//var pageIntro: [PageIntro] = [ +// .init(introAssetImage: "people-intro", title: "Welcome to ScribbleLab", subtitle: "Start your note-taking journey by following this Tutorial", description: "To become a ScribbleLab Pro follow this Tutorial in order to become more familiar with ScribbleLab.", displayAction: <#T##Bool#>), +// .init(introAssetImage: "person-illustartion-grade", title: "Explore our Editor functionalities", subtitle: "", description: <#String#>, displayAction: <#T##Bool#>), +// .init(introAssetImage: <#T##String#>, title: <#T##String#>, subtitle: <#T##String#>, description: <#String#>, displayAction: <#T##Bool#>), +// .init(introAssetImage: <#T##String#>, title: <#T##String#>, subtitle: <#T##String#>, description: <#String#>, displayAction: <#T##Bool#>) +//] diff --git a/ScribbleLab/Core/Tour/TourViewBeginning.swift b/ScribbleLab/Core/Tour/View/TourViewBeginning.swift similarity index 100% rename from ScribbleLab/Core/Tour/TourViewBeginning.swift rename to ScribbleLab/Core/Tour/View/TourViewBeginning.swift diff --git a/ScribbleLab/Ressources/Assets.xcassets/Illustration/people-intro.imageset/Contents.json b/ScribbleLab/Ressources/Assets.xcassets/Illustration/people-intro.imageset/Contents.json new file mode 100644 index 000000000..2ca2f1deb --- /dev/null +++ b/ScribbleLab/Ressources/Assets.xcassets/Illustration/people-intro.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "people-intro.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "people-intro 1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "people-intro 2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ScribbleLab/Ressources/Assets.xcassets/Illustration/people-intro.imageset/people-intro 1.png b/ScribbleLab/Ressources/Assets.xcassets/Illustration/people-intro.imageset/people-intro 1.png new file mode 100644 index 000000000..90e98c7c0 Binary files /dev/null and b/ScribbleLab/Ressources/Assets.xcassets/Illustration/people-intro.imageset/people-intro 1.png differ diff --git a/ScribbleLab/Ressources/Assets.xcassets/Illustration/people-intro.imageset/people-intro 2.png b/ScribbleLab/Ressources/Assets.xcassets/Illustration/people-intro.imageset/people-intro 2.png new file mode 100644 index 000000000..90e98c7c0 Binary files /dev/null and b/ScribbleLab/Ressources/Assets.xcassets/Illustration/people-intro.imageset/people-intro 2.png differ diff --git a/ScribbleLab/Ressources/Assets.xcassets/Illustration/people-intro.imageset/people-intro.png b/ScribbleLab/Ressources/Assets.xcassets/Illustration/people-intro.imageset/people-intro.png new file mode 100644 index 000000000..90e98c7c0 Binary files /dev/null and b/ScribbleLab/Ressources/Assets.xcassets/Illustration/people-intro.imageset/people-intro.png differ diff --git a/ScribbleLab/Ressources/Localizable.xcstrings b/ScribbleLab/Ressources/Localizable.xcstrings index 3d8a99560..52cac2fe2 100644 --- a/ScribbleLab/Ressources/Localizable.xcstrings +++ b/ScribbleLab/Ressources/Localizable.xcstrings @@ -1188,6 +1188,9 @@ }, "This application needs to restart to update the configuration.\n\nDo you want to restart the application?" : { + }, + "This is a View to test the SLButton!" : { + }, "This is an example widget." : { @@ -1284,6 +1287,9 @@ } } } + }, + "Verify" : { + }, "Version" : { "extractionState" : "stale",