This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AnchorPane anchorPane = (AnchorPane) FXMLLoader.load(fx.GuiAppAppointmentController.class.getResource("creatAppointmentView.fxml")); | |
Scene scene = new Scene(anchorPane); | |
stage.setScene(scene); | |
stage.setTitle("heHo"); | |
stage.show(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController+Instatiation.swift | |
// CardScore | |
// | |
// Created by Lukas Schmidt on 17.09.15. | |
// Copyright © 2015 Lukas Schmidt. All rights reserved. | |
// License MIT | |
// | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Array { | |
/** | |
Hacky way to may a Array with Type Elemnet to an arry with Supertype T. T must be Supertype of Array.Element | |
- returns: array of type T | |
*/ | |
func mapType<T>() -> Array<T> { | |
let mappedCategorys: Array<T> = self.map { return $0 as! T } | |
return mappedCategorys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Array { | |
/** | |
Hacky way to may a Array with Type Elemnet to an arry with Supertype T. T must be Supertype of Array.Element | |
- returns: array of type T | |
*/ | |
func mapType<T>() -> Array<T> { | |
let mappedCategorys: Array<T> = self.map { return $0 as! T } | |
return mappedCategorys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Train { | |
let name: String | |
let date: Date | |
} | |
extension Train: Equatable { | |
static func ==(lhs: Train, rhs: Train) -> Bool { | |
return lhs.name == rhs.name | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
struct Event<T> { | |
let key: String | |
} | |
extension Event { | |
var notificationName: Notification.Name { | |
return Notification.Name(key) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final public class NameDifferentDataProvider<Element>: DataProviding { | |
/// Closure which gets called, when a data inside the provider changes and those changes should be propagated to the datasource. | |
/// **Warning:** Only set this when you are updating the datasource. | |
public var whenDataProviderChanged: ProcessUpdatesCallback<Element>? { | |
get { | |
return realWhenDataProviderChanged | |
} | |
set { | |
newValue.map { didChanges.append($0) } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MyModel { | |
let created: Date | |
var mutableData: [String] | |
var text: Text | |
} | |
let content = MyModel(created: Date(), mutableData: [], text: Text("hi")) | |
let document = Automerge<MyModel>(content: content) | |
// accessing data |