Skip to content

Instantly share code, notes, and snippets.

Toni Suter tonisuter

Block or report user

Report or block tonisuter

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View processGyb.sh
#!/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
View ACCU-lessons-swift-ide.md

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

View ACCU-Intro-Swift.md

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 Sep 20, 2017
Modify pixels of a UIImage
View applyfilter.swift
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 Sep 20, 2017
UIAlertController Example
View UIAlertController.swift
@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 {
View SolutionLoggerExample.swift
import Foundation
struct LogEntry: Codable {
let task: String
let solution: String
}
class ViewController: UIViewController {
// ...other code...
@tonisuter
tonisuter / main.swift
Last active Jul 10, 2017
Testing libSwiftPM
View main.swift
import Basic
import PackageGraph
import PackageLoading
import Workspace
class MyWorkspaceDelegate: WorkspaceDelegate {
func packageGraphWillLoad(currentGraph: PackageGraph, dependencies: AnySequence<ManagedDependency>, missingURLs: Set<String>) {
print("packageGraphWillLoad")
}
View Memory4.swift
coreDataStack.context.delete(memoryPair)
coreDataStack.saveContext()
View Memory3.swift
let memoryPair = MemoryPair(context: coreDataStack.context)
memoryPair.creationDate = Date()
memoryPair.image1 = image1
memoryPair.text1 = code1
memoryPair.image2 = image2
memoryPair.text2 = code2
coreDataStack.saveContext()
View Memory2.swift
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)
}
You can’t perform that action at this time.