Skip to content

Instantly share code, notes, and snippets.

View simsaens's full-sized avatar

Sim Saëns simsaens

  • Two Lives Left
  • Adelaide, Australia
View GitHub Profile
@simsaens
simsaens / JAMLuaTokenizer.swift
Created April 9, 2024 12:31
Codea's Lua UITextInputTokenizer
//
// JAMLuaTokenizer.swift
// JamKit
//
// Created by Sim Saens on 7/4/2024.
// Copyright © 2024 Two Lives Left. All rights reserved.
//
import UIKit
/* global exports:true, module:true, require:true, define:true, global:true */
(function (root, name, factory) {
'use strict';
// Used to determine if values are of the language type `Object`
var objectTypes = {
'function': true
, 'object': true
}
@simsaens
simsaens / MainActorIsolationSample.swift
Created July 20, 2024 13:42
Unsure why warnings show in the second example unless the method is marked @mainactor
import AVFoundation
class Foo {
var x: AVAudioFile?
func someOtherMethod() async throws {
x = try AVAudioFile(forReading: URL(fileURLWithPath: "/path/to/file.m4a"))
}
//@MainActor annotation is not needed here and there are no warnings, why is it needed below?