Discuss Scratch

Executec
Scratcher
100+ posts

IOS Online Scratch Project Loader

I have been working on a scratch project loader for ios so you can release scratch projects for the app store. It will basically just do the job of a web browser that doesn't let you go to other pages. So far the code is like this:
import UIKit
import WebKit
class ViewController: UIViewController, WKUIDelegate {

var webView: WKWebView!

override func loadView() {
let webConfiguration = WKWebViewConfiguration()
webView = WKWebView(frame: .zero, configuration: webConfiguration)
webView.uiDelegate = self
view = webView
}
override func viewDidLoad() {
super.viewDidLoad()

let myURL = URL(string:"https://scratch-mit-edu.ezproxyberklee.flo.org")
let myRequest = URLRequest(url: myURL!)
webView.load(myRequest)
}}

I use Swift Playgrounds for coding in swift because I don't have a mac. This code doesn't work. Can anyone explain why? In swift playgrounds when i click run code nothing happens.
Dot32
Scratcher
23 posts

IOS Online Scratch Project Loader

If you don't have a mac it is illegal to run X-code, and x-code includes swift. That is why people buy macs for coding.

This is incredibly annoying, but you probably wont be able to run that code.
(i could be wrong with everything i am saying here)
Executec
Scratcher
100+ posts

IOS Online Scratch Project Loader

I am not using xcode. I am using the swift playgrounds app on ipad. It is separate. All i have is a pc. I don't really know what i can do then, anyone who has a mac please help me…
Dot32
Scratcher
23 posts

IOS Online Scratch Project Loader

First: Xcode includes swift i am pretty sure.

Second: Huh, seeing as it an apple machine it *should* work, but i think i remember hearing sometime a while ago that people are annoyed at how you cant program at all on an ipad.

Third: I have a mac, but i have never tried running xcode so i am not sure how that works.
Executec
Scratcher
100+ posts

IOS Online Scratch Project Loader

Oh kay. First: I know xcode includes swift. It's apple's swift interpreter for devs.
Second: there are loads of xcode programs that work on swift playgrounds, which, btw, is made by apple.
Third: ‘My browser / operating system: MacOS Macintosh X 10.15.4, Safari 13.1.1, No Flash version detected’ That's what Scratch thinks. Actually I'm My browser / operating system: IPadOS IPad Pro 2019, Safari ??.?.?, No Flash version detected
Dot32
Scratcher
23 posts

IOS Online Scratch Project Loader

The fact that it thought you were using macos is because of a feature called desktop class browsing.

But it appears you have proven that i have no clue what i am talking about lmao
Executec
Scratcher
100+ posts

IOS Online Scratch Project Loader

Me neither. I just copied and pasted from the in-app script documentation XD
wai0901
Scratcher
40 posts

IOS Online Scratch Project Loader

Dot32 wrote:

First: Xcode includes swift i am pretty sure.

Second: Huh, seeing as it an apple machine it *should* work, but i think i remember hearing sometime a while ago that people are annoyed at how you cant program at all on an ipad.

Third: I have a mac, but i have never tried running xcode so i am not sure how that works.

So I have learned some Swift before bouncing into HTML and into UnityScript, and for me you can actually program Swift on an iPad by using Playgrounds (which is what Executec used) as it is made by Apple. It's just not as good nor as versatile as XCode. I have used Xcode before and if I was correct Swift comes standard with Xcode, Along with some neat features other text editors don't have like a actual Simulator for almost every apple iPhone and Apple TV (don't know if they have iPads yet) imaginable.
wai0901
Scratcher
40 posts

IOS Online Scratch Project Loader

Executec wrote:

I have been working on a scratch project loader for ios so you can release scratch projects for the app store. It will basically just do the job of a web browser that doesn't let you go to other pages. So far the code is like this:
import UIKit
import WebKit
class ViewController: UIViewController, WKUIDelegate {

var webView: WKWebView!

override func loadView() {
let webConfiguration = WKWebViewConfiguration()
webView = WKWebView(frame: .zero, configuration: webConfiguration)
webView.uiDelegate = self
view = webView
}
override func viewDidLoad() {
super.viewDidLoad()

let myURL = URL(string:"https://scratch-mit-edu.ezproxyberklee.flo.org")
let myRequest = URLRequest(url: myURL!)
webView.load(myRequest)
}}

I use Swift Playgrounds for coding in swift because I don't have a mac. This code doesn't work. Can anyone explain why? In swift playgrounds when i click run code nothing happens.

If you could make that work that would be really cool! Since I'm still trying to find ways to convert Scratch 3 projects to Windows EXEs without downloading many tools!

Last edited by wai0901 (June 17, 2020 20:29:18)

Executec
Scratcher
100+ posts

IOS Online Scratch Project Loader

Yeah the way the code is now, it should load the scratch homepage just fine. Idk
bigbrianman
Scratcher
100+ posts

IOS Online Scratch Project Loader

Executec wrote:

I have been working on a scratch project loader for ios so you can release scratch projects for the app store. It will basically just do the job of a web browser that doesn't let you go to other pages. So far the code is like this:
import UIKit
import WebKit
class ViewController: UIViewController, WKUIDelegate {

var webView: WKWebView!

override func loadView() {
let webConfiguration = WKWebViewConfiguration()
webView = WKWebView(frame: .zero, configuration: webConfiguration)
webView.uiDelegate = self
view = webView
}
override func viewDidLoad() {
super.viewDidLoad()

let myURL = URL(string:"https://scratch-mit-edu.ezproxyberklee.flo.org")
let myRequest = URLRequest(url: myURL!)
webView.load(myRequest)
}}

I use Swift Playgrounds for coding in swift because I don't have a mac. This code doesn't work. Can anyone explain why? In swift playgrounds when i click run code nothing happens.
Sounds cool, are you going to try to convert it to Xcode (Scratch is written in Django)
Executec
Scratcher
100+ posts

IOS Online Scratch Project Loader

Technically it's the same language, and I don't have a mac.
Executec
Scratcher
100+ posts

IOS Online Scratch Project Loader

GraceS119
Scratcher
1 post

IOS Online Scratch Project Loader

Is there going to be an iOS scratch app
Executec
Scratcher
100+ posts

IOS Online Scratch Project Loader

GraceS119 wrote:

Is there going to be an iOS scratch app
I was actually thinking of just making a converter, so you could publish scratch projects on the appstore
A-E-
Scratcher
100+ posts

IOS Online Scratch Project Loader

Dot32 wrote:

If you don't have a mac it is illegal to run X-code, and x-code includes swift. That is why people buy macs for coding.

This is incredibly annoying, but you probably wont be able to run that code.
(i could be wrong with everything i am saying here)
That is blatantly false. Swift is an open source project. (Sorry for the bump, I just wanted to make sure noone was scared away from Swift )

Last edited by A-E- (Nov. 18, 2020 21:50:03)

Executec
Scratcher
100+ posts

IOS Online Scratch Project Loader

A-E- wrote:

Dot32 wrote:

If you don't have a mac it is illegal to run X-code, and x-code includes swift. That is why people buy macs for coding.

This is incredibly annoying, but you probably wont be able to run that code.
(i could be wrong with everything i am saying here)
That is blatantly false. Swift is an open source project. (Sorry for the bump, I just wanted to make sure noone was scared away from Swift )
yea ok

Last edited by Executec (Nov. 18, 2020 22:37:41)

Powered by DjangoBB