• Stars
    star
    245
  • Rank 165,304 (Top 4 %)
  • Language
    Swift
  • License
    Other
  • Created almost 7 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Online Swift Playground

SwiftPlayground.run

Platform Twitter

Online Swift Playground. Implemented in Swift.

TBA. Checkout http://SwiftPlayground.run

SwiftPlayground.run

Installation & Run

$ git clone https://github.com/krzyzanowskim/OnlineSwiftPlayground.git
$ cd OnlineSwiftPlayground
$ ./run.sh

The run.sh script will generate Xcode project (on macOS) and bootstrap the environment. run.sh needs npm to be installed to work properly. Bootstraping involves

  1. Download Swift Toochains supported by the playground
  2. Pre-build support module using the toolchains
  3. Install dependencies
  4. Launches web server on localhost on port 8080

Now you could access playground pointing web browser to 127.0.0.1:8080.

Development

Xcode

Generate Xcode project

$ swift package generate-xcodeproj

React

Web user interface is build with React and webpack.

$ npm run build

Docker

krzyzanowskim/onlineswiftplayground

Download the latest image:

$ docker pull krzyzanowskim/onlineswiftplayground

or build docker image by yourself:

$ git clone https://github.com/krzyzanowskim/OnlineSwiftPlayground.git
$ cd OnlineSwiftPlayground
$ docker buildx create --use
$ docker buildx build --platform=linux/amd64,linux/arm64 . -t krzyzanowskim/onlineswiftplayground

then run container:

$ docker run -d -p 8080:8080 --name onlineswiftplayground -t krzyzanowskim/onlineswiftplayground

and wait until docker container is up (usually several seconds).

Playground is available at http://localhost:8080. If the docker setup uses VirtualBox, the you can get the IP address from docker-machine ip command.

$ open http://$(docker-machine ip):8080

Config

Third party frameworks should be copied to Frameworks directory (Frameworks are for macOS host only)

See config/ for GitHub auth. sample config.

Author

SwiftPlayground.run is owned and maintained by Marcin Krzyzanowski

You can follow me on Twitter at @krzyzanowskim for project updates and releases.

License

Creative Commons Attribution Non Commercial 4.0. See LICENSE file.

More Repositories

1

CryptoSwift

CryptoSwift is a growing collection of standard and secure cryptographic algorithms implemented in Swift
Swift
10,176
star
2

Natalie

Natalie - Storyboard Code Generator (for Swift)
Swift
1,167
star
3

STTextView

Performant and reusable text view component (TextKit 2), with line numbers and more. UITextView / NSTextView replacement.
Swift
1,073
star
4

OpenSSL

OpenSSL package for SwiftPM, CocoaPod, and Carthage, multiplatform
C
919
star
5

ObjectivePGP

ObjectivePGP is an open-source library for iOS and macOS that provides developers with tools for implementing OpenPGP encryption and decryption, digital signing, and signature verification in their applications, thereby enhancing security and data integrity.
Objective-C
667
star
6

CoreTextSwift

CoreText Swift bindings
Swift
158
star
7

NSTableView-Sections

NSTableView with sections (similar to UITableView)
Swift
89
star
8

SwiftUI.TextEdit

SwiftUI proof-of-concept text edit component
Swift
87
star
9

JSONCodable

JSON Codable is what we need 90% of the time
Swift
75
star
10

unnetpgp

*Deprecated* NetPGP wrapper. Use ObjectivePGP
C
67
star
11

reorder

Reorder Swift functions
Swift
57
star
12

SwiftUI.AnimatedImage

SwiftUI AnimatedImage View
Swift
56
star
13

SwiftUI.SplitView

Swift
48
star
14

RepetitiveTask

Swift
40
star
15

tree-sitter-xcframework

binary build of tree-sitter for apple platforms
C
37
star
16

BoyerMoore

Boyer-Moore algorithm sample
Swift
37
star
17

GeneratedResults-UITableView

Practical Swift: pages generator - build once, use many
Swift
36
star
18

STTextView-Plugin-Neon

Source Code Syntax Highlighting
C
33
star
19

STTextKitPlus

Collection of TextKit 2 helpers used to build STTextView.
Swift
28
star
20

MKDataScanner

NSScanner for NSData and files.
Objective-C
16
star
21

antlr-swift-playground

Antlr Swift Parser playground
Swift
14
star
22

CollectionSafeIndex

Get the element at the specified index only if it is within bounds, otherwise nil
Swift
11
star
23

CoreTextWorkshop

Take a look at the CoreText API - a foundation of layout and drawing text on macOS and iOS. In this workshop we’ll attempt to build Text Label (akin UILabel), learn about layers of CoreText API and how to use it.
Swift
10
star
24

AES256CBC

Most convenient AES256-CBC encryption for Swift 2 & 3
Swift
8
star
25

OpenSSL-Package

OpenSSL package for SwiftPM
Swift
8
star
26

RawData

Swift RawData CollectionType
Swift
7
star
27

STTextView-Plugin-Annotations

Annotations Plugin
Swift
7
star
28

STTextView-Plugin-Template

Template Plugin repository for STTextView
Swift
7
star
29

CodeEditView

custom text view implementation
Swift
6
star
30

Kitura-Session-Kuery

Kitura-Session store using Swift-Kuery (SQL database abstraction layer) as the backing store
Swift
6
star
31

CloudKitWebServices

CloudKit Web Services framework for everyone else...
6
star
32

TouchImageView

iOS UIImageView with convenient touch delegate
Objective-C
6
star
33

language-server-protocol

Language Server Protocol
Swift
6
star
34

sendable.wtf

HTML
5
star
35

Google1Password

1Password integration for Google sign-in view.
Objective-C
5
star
36

ChorusBirdie

Birdie singing songs game. SwiftCrunch hackathon project. Created over few hours from zero.
Swift
3
star
37

monaco-editor-vue-component

MonacoEditor component for Vue.js
Vue
2
star
38

AppleRadar-FileProviderEnumeratorNotificationSample

NSFileProviderManager.signalEnumerator does not trigger update of UIDocumentBrowserViewController
Swift
2
star
39

GNUGadu

GNU Gadu is instant messaging client designed to work with protocols common in Poland (but not only). Contrary to its name, is not part of the GNU project.
C
2
star
40

MKScrollView

Alternative to UIScrollView. Proof of concept implementation.
Objective-C
1
star