Skip to content

Instantly share code, notes, and snippets.

Session Proposal - ACCU 2018

Toni Suter (Presenter Bio)

Toni is a software engineer at the Institute for Software at FHO/HSR in Rapperswil, Switzerland. In the past few years he has worked on refactoring tools for the C++ IDE Cevelop and since the beginning of his master thesis, he has been working on a new Swift IDE called Tifig.

Mario Meili (Presenter Bio)

Mario is a software engineer at the Institute for Software at FHO/HSR in Rapperswil, Switzerland. For his master thesis, he has been implementing the necessary changes in Tifig to support the enhanced generics that were introduced with Swift 4.

Lessons learned from developing a Swift IDE

Session Proposal - ACCU 2018

Toni Suter (Presenter Bio)

Toni is a software engineer at the Institute for Software at FHO/HSR in Rapperswil, Switzerland. In the past few years he has worked on refactoring tools for the C++ IDE Cevelop and since the beginning of his master thesis, he has been working on a new Swift IDE called Tifig.

Mario Meili (Presenter Bio)

Mario is a software engineer at the Institute for Software at FHO/HSR in Rapperswil, Switzerland. For his master thesis, he has been implementing the necessary changes in Tifig to support the enhanced generics that were introduced with Swift 4.

@tonisuter
tonisuter / applyfilter.swift
Created September 20, 2017 09:34
Modify pixels of a UIImage
func applyFilter(to image: UIImage) -> UIImage? {
guard let context = prepareContext(for: image),
let pixelBuffer = getPixelBuffer(from: context) else {
return nil
}
// TODO: Hier müssen wir die einzelnen Pixel im pixelBuffer modifizieren und wieder
// zurück in den pixelBuffer schreiben.
guard let outputCGImage = context.makeImage() else {
@tonisuter
tonisuter / UIAlertController.swift
Created September 20, 2017 08:07
UIAlertController Example
@IBAction func logSolution(sender: UIBarButtonItem) {
let alertController = UIAlertController(title: "Log Solution",
message: "Please enter your solution.",
preferredStyle: .alert)
alertController.addTextField(configurationHandler: { textField in
textField.autocorrectionType = .no
})
alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel))
alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: { _ in
guard let solution = alertController.textFields?[0].text else {
@tonisuter
tonisuter / main.swift
Last active July 10, 2017 02:26
Testing libSwiftPM
import Basic
import PackageGraph
import PackageLoading
import Workspace
class MyWorkspaceDelegate: WorkspaceDelegate {
func packageGraphWillLoad(currentGraph: PackageGraph, dependencies: AnySequence<ManagedDependency>, missingURLs: Set<String>) {
print("packageGraphWillLoad")
}
#!/bin/bash
for f in `ls *.gyb`
do
echo "Processing $f"
name=${f%.gyb}
../../../utils/gyb -D CMAKE_SIZEOF_VOID_P=8 -o $name $f --line-directive ""
done
coreDataStack.context.delete(memoryPair)
coreDataStack.saveContext()
let memoryPair = MemoryPair(context: coreDataStack.context)
memoryPair.creationDate = Date()
memoryPair.image1 = image1
memoryPair.text1 = code1
memoryPair.image2 = image2
memoryPair.text2 = code2
coreDataStack.saveContext()
let fetchRequest: NSFetchRequest<MemoryPair> = MemoryPair.fetchRequest()
fetchRequest.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: true)]
do {
let pairs: [MemoryPair] = try coreDataStack.context.fetch(fetchRequest)
// display the memory pairs
} catch {
print(error)
}
@IBAction func captureImageWithQRCode(_ sender: UIButton) {
let solutionLogger = SolutionLogger(viewController: self)
solutionLogger.scanQRCodeAndCaptureImage { (qrCode: String, image: UIImage) in
// use qrCode and image
}
}