Skip to content

Commit

Permalink
Initial release.
Browse files Browse the repository at this point in the history
  • Loading branch information
GetToSet committed Jun 4, 2021
0 parents commit 6afb3ae
Show file tree
Hide file tree
Showing 391 changed files with 27,496 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# https://github.com/github/gitignore/blob/master/Swift.gitignore

## User settings
xcuserdata/

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

.idea/
46 changes: 46 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# https://github.com/airbnb/swift

whitelist_rules:
- closure_spacing
- colon
- empty_enum_arguments
- fatal_error_message
- force_try
# - force_cast
# - force_unwrapping
# - implicitly_unwrapped_optional
- legacy_cggeometry_functions
- legacy_constant
- legacy_constructor
- legacy_nsgeometry_functions
- operator_usage_whitespace
- redundant_string_enum_value
- redundant_void_return
- return_arrow_whitespace
- trailing_newline
- trailing_whitespace
- trailing_semicolon
- type_name
- generic_type_name
- unused_closure_parameter
- unused_optional_binding
- vertical_whitespace
- void_return
- custom_rules
- file_header
- trailing_comma

excluded:
- "PlaygroundBook/Modules/SnapKit.playgroundmodule"
- "PlaygroundBook/Modules/DifferenceKit.playgroundmodule"
- "PlaygroundBook/Modules/ASCollectionView.playgroundmodule"
# - Pods
# - AHDownloadButton

colon:
apply_to_dictionaries: true

indentation: 2

file_header:
required_pattern: "(\\/\\*\\n \\* Copyright © 2021 Ethan Wong\\. Licensed under MIT\\.\\n \\*)|(\\/\\/#-hidden-code\\n\\/\\/\\n\\/\\/ Copyright © 2021 Ethan Wong\\. Licensed under MIT\\.\\n\\/\\/\\n)"
58 changes: 58 additions & 0 deletions ConfigFiles/Base/BaseBuildSettings.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//
// See LICENSE folder for this template’s licensing information.
//
// Abstract:
// Provides build settings which should be used by all targets.
//

//
// Most of these build settings should not be edited.
// SUPPORTING_CONTENT_DIR may be edited if you move the SupportingContent directory out of the project directory.
//

// The path to the directory containing all of the supporting content for this project.
// By default, the supporting content is stored in the SupportingContent directory next to the xcodeproj.
SUPPORTING_CONTENT_DIR = $(PROJECT_DIR)/SupportingContent/

// The supporting content for this project is split by platform name.
// This value is generally the same as PLATFORM_NAME
PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME = $(__PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME_$(__PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME_IMPL))
// Use the platform's regular name if there isn't any override.
__PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME_ = $(PLATFORM_NAME)

// macOS and Mac Catalyst are handled specially (see below).
__PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME_macosx = macosx
__PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME_maccatalyst = maccatalyst

// Only set __PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME_IMPL if the value needs to be customized (instead of using the default PLATFORM_NAME).
// If PLATFORM_NAME can be used as-is, don't set __PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME_IMPL.
__PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME_IMPL = $(__PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME_IMPL_$(PLATFORM_NAME))
// Customize macosx based on the value of IS_MACCATALYST.
__PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME_IMPL_macosx = $(__PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME_IMPL_macosx_$(IS_MACCATALYST))
// If IS_MACCATALYST is YES, then use the value maccatalyst.
__PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME_IMPL_macosx_YES = maccatalyst
// If IS_MACCATALYST is NO (or unset), then use the value macosx.
__PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME_IMPL_macosx_NO = macosx
__PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME_IMPL_macosx_ = $(__PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME_IMPL_macosx_NO)

// The path to the directory containing the Swift Playgrounds frameworks (i.e. PlaygroundSupport and PlaygroundBluetooth).
// By default, these are stored in the PlaygroundsFrameworks directory in the supporting content directory.
PLAYGROUNDS_FRAMEWORKS_DIR = $(SUPPORTING_CONTENT_DIR)/PlaygroundsFrameworks/$(PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME)/

// The path to the directory containing other supporting frameworks.
// These are not usable in the Playground Book sources, but are usable in (and used by) LiveViewTestApp.
// By default, these are stored in the OtherFrameworks directory in the supporting content directory.
OTHER_FRAMEWORKS_DIR = $(SUPPORTING_CONTENT_DIR)/OtherFrameworks/$(PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME)/

// Ensure we include PLAYGROUNDS_FRAMEWORKS_DIR in the system frameworks search path.
// All targets should be able to import the Swift Playgrounds frameworks.
SYSTEM_FRAMEWORK_SEARCH_PATHS = "$(PLAYGROUNDS_FRAMEWORKS_DIR)" $(inherited)

// Since Swift Playgrounds only supports 64-bit devices, this project can only be built for 64-bit devices as well.
ARCHS = $(ARCHS_STANDARD_64_BIT)

// Since Swift Playgrounds only supports iPad, this project should only be built targeting iPad as well.
TARGETED_DEVICE_FAMILY = 2

// The supporting frameworks do not contain bitcode, so disable bitcode generation for this project.
ENABLE_BITCODE = NO
25 changes: 25 additions & 0 deletions ConfigFiles/BuildSettings.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// See LICENSE folder for this template’s licensing information.
//
// Abstract:
// A set of build settings which should be edited by the author of this project.
// Other build settings which need to be modified should generally be set in the Project Editor.
//

// This is the prefix for all bundle identifiers in this project, including the playground book's ContentIdentifier by default.
// This should be updated to something specific to your team.
BUNDLE_IDENTIFIER_PREFIX = cn.gettoset

// This is the base of the file name for the playground book produced by this project (e.g. "PlaygroundBook" in "PlaygroundBook.playgroundbook").
PLAYGROUND_BOOK_FILE_NAME = PlaygroundBook

// This is the ContentIdentifier of the playground book.
// This should be updated to something specific to your team and your specific content.
PLAYGROUND_BOOK_CONTENT_IDENTIFIER = $(BUNDLE_IDENTIFIER_PREFIX).$(PLAYGROUND_BOOK_FILE_NAME:rfc1034identifier)

// This is the ContentVersion of the playground book.
PLAYGROUND_BOOK_CONTENT_VERSION = 1.0

// Additionally, include some base build settings which this project requires but which shouldn't generally be edited.
// Do *not* remove this #include; if you do, the project will fail to build.
#include "Base/BaseBuildSettings.xcconfig"
78 changes: 78 additions & 0 deletions ConfigFiles/Overrides/BookOverridingBuildSettings.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
//
// See LICENSE folder for this template’s licensing information.
//
// Abstract:
// Provide build settings which make the PlaygroundBook "bundle" target build a .playgroundbook.
//

//
// The build settings in this file typically should *not* be edited or overridden in the PlaygroundBook target.
//

// Override the SHALLOW_BUNDLE build setting to NO, since the PlaygroundBook target does not produce a shallow bundle.
SHALLOW_BUNDLE = NO

// The PlaygroundBook target produces a wrapper with the extension ".playgroundbook".
WRAPPER_EXTENSION = playgroundbook

// Playground books store their contents in the Contents directory, so override the CONTENTS_FOLDER_PATH to point at that path.
CONTENTS_FOLDER_PATH = $(WRAPPER_NAME)/Contents

// Likewise, the resources for a playground book are stored in PrivateResources directory in the Contents directory.
UNLOCALIZED_RESOURCES_FOLDER_PATH = $(CONTENTS_FOLDER_PATH)/PrivateResources

// Playground books do not have an Info.plist file. (They do have a Manifest.plist file, but it's handled separately.)
INFOPLIST_FILE =

// Playground books are not code signed, so disable everything related to signing.
CODE_SIGN_IDENTITY =
CODE_SIGNING_ALLOWED = NO
CODE_SIGNING_REQUIRED = NO
CODE_SIGN_STYLE = Manual

// The PlaygroundBook target requires that build rules be applied to files in Copy Files build phases, as that's how the Manifest.plist for the book is copied.
APPLY_RULES_IN_COPY_FILES = YES

// The PlaygroundBook target requires that it build resources for all target devices, not just the active target device.
ENABLE_ONLY_ACTIVE_RESOURCES = NO

// Ensure that the strings files are copied consistently whether targeting a Mac or an iPad.
STRINGS_FILE_OUTPUT_ENCODING = binary

// Ensure that xibs, storyboards, asset catalogs, etc. are compiled consistently whether targeting a Mac or an iPad.
PLAYGROUND_BOOK_COMPILE_MACCATALYST_RESOURCES_LIKE_IOS = YES

RESOURCES_PLATFORM_NAME[sdk=macosx*] = $(__RESOURCES_PLATFORM_NAME_macosx_$(IS_MACCATALYST))
__RESOURCES_PLATFORM_NAME_macosx_NO = macosx
__RESOURCES_PLATFORM_NAME_macosx_ = macosx
__RESOURCES_PLATFORM_NAME_macosx_YES = $(__RESOURCES_PLATFORM_NAME_macosx_YES_$(PLAYGROUND_BOOK_COMPILE_MACCATALYST_RESOURCES_LIKE_IOS))
__RESOURCES_PLATFORM_NAME_macosx_YES_YES = iphoneos
__RESOURCES_PLATFORM_NAME_macosx_YES_NO = macosx

RESOURCES_UI_FRAMEWORK_FAMILY[sdk=macosx*] = $(__RESOURCES_UI_FRAMEWORK_FAMILY_macosx_$(IS_MACCATALYST))
__RESOURCES_UI_FRAMEWORK_FAMILY_macosx_NO =
__RESOURCES_UI_FRAMEWORK_FAMILY_macosx_ =
__RESOURCES_UI_FRAMEWORK_FAMILY_macosx_YES = $(__RESOURCES_UI_FRAMEWORK_FAMILY_macosx_YES_$(PLAYGROUND_BOOK_COMPILE_MACCATALYST_RESOURCES_LIKE_IOS))
__RESOURCES_UI_FRAMEWORK_FAMILY_macosx_YES_YES =
__RESOURCES_UI_FRAMEWORK_FAMILY_macosx_YES_NO = uikit

// Wrap DEPLOYMENT_TARGET_SETTING_NAME in a way that allows customization for platforms which can't use the default value.
__PLAYGROUND_BOOK_DEPLOYMENT_TARGET_SETTING_NAME = $(__PLAYGROUND_BOOK_DEPLOYMENT_TARGET_SETTING_NAME_$(__PLAYGROUND_BOOK_DEPLOYMENT_TARGET_SETTING_NAME_IMPL))
// For platforms which don't need custom behavior, use DEPLOYMENT_TARGET_SETTING_NAME.
__PLAYGROUND_BOOK_DEPLOYMENT_TARGET_SETTING_NAME_ = $(DEPLOYMENT_TARGET_SETTING_NAME)

// For Mac Catalyst, use IPHONEOS_DEPLOYMENT_TARGET instead of MACOSX_DEPLOYMENT_TARGET.
__PLAYGROUND_BOOK_DEPLOYMENT_TARGET_SETTING_NAME_maccatalyst = IPHONEOS_DEPLOYMENT_TARGET

// __PLAYGROUND_BOOK_DEPLOYMENT_TARGET_SETTING_NAME_IMPL is set to the platform name for platforms which need custom behavior.
__PLAYGROUND_BOOK_DEPLOYMENT_TARGET_SETTING_NAME_IMPL = $(__PLAYGROUND_BOOK_DEPLOYMENT_TARGET_SETTING_NAME_IMPL_$(PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME))
__PLAYGROUND_BOOK_DEPLOYMENT_TARGET_SETTING_NAME_IMPL_maccatalyst = maccatalyst

// The value for DeploymentTarget in the playground book's Manifest.plist, derived from the current platform and the current platform's deployment target for the PlaygroundBook target in the Xcode project.
PLAYGROUND_BOOK_DEPLOYMENT_TARGET_FOR_MANIFEST = $(__PLAYGROUND_BOOK_DEPLOYMENT_TARGET_PLATFORM_IDENTIFIER)$($(__PLAYGROUND_BOOK_DEPLOYMENT_TARGET_SETTING_NAME))

__PLAYGROUND_BOOK_DEPLOYMENT_TARGET_PLATFORM_IDENTIFIER = $(__PLAYGROUND_BOOK_DEPLOYMENT_TARGET_PLATFORM_IDENTIFIER_$(PLAYGROUNDBOOKTEMPLATE_PLATFORM_NAME))
__PLAYGROUND_BOOK_DEPLOYMENT_TARGET_PLATFORM_IDENTIFIER_iphoneos = ios
__PLAYGROUND_BOOK_DEPLOYMENT_TARGET_PLATFORM_IDENTIFIER_iphonesimulator = ios
// The playground book format treats iOS and Mac Catalyst the same, so use ios for this value.
__PLAYGROUND_BOOK_DEPLOYMENT_TARGET_PLATFORM_IDENTIFIER_maccatalyst = ios
37 changes: 37 additions & 0 deletions ConfigFiles/Overrides/ModuleOverridingBuildSettings.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// See LICENSE folder for this template’s licensing information.
//
// Abstract:
// Provide build settings which make a static library target build a .playgroundmodule.
//

//
// The build settings in this file typically should *not* be edited or overridden in the module target.
//
// To set the build settings up correctly for a new module target, do the following:
//
// 1. Create a new static library target.
// 2. Open the Build Settings tab of the Project Editor and select the new static library target.
// 3. Select the "Customized" option.
// 3. Click on a row in the table of build settings, then select all build settings using Edit > Select All (⌘A).
// 4. Delete all build setting overrides by pressing the Delete key.
// 5. In the Project Editor, select the project itself, and then open the Info tab.
// 6. In the Configurations area, select "ModuleOverridingBuildSettings" for your new static library target for both the Debug and Release configurations.
//
// More details for creating new module targets is available in the README.
//

// Disable code signing for this target.
CODE_SIGN_IDENTITIY =
CODE_SIGN_STYLE = Manual

// Ensure that this target supports Mac Catalyst.
SUPPORTS_MACCATALYST = YES

// Disable generation of the Objective-C compatibility header from Swift (i.e. -Swift.h.)
SWIFT_OBJC_INTERFACE_HEADER_NAME =

// Ensure that the static library is packaged correctly for use in the project.
SKIP_INSTALL = YES
OTHER_LD_FLAGS = -ObjC
PRODUCT_NAME = $(TARGET_NAME)
11 changes: 11 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# MIT License

Copyright © 2020 Ethan Wong

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

**See [License Folder](./Licences) for detailed license and attributions**
Loading

0 comments on commit 6afb3ae

Please sign in to comment.