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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEngine; | |
public static class IListExtensions { | |
public static void Shuffle<T>(this IList<T> ts) { | |
var count = ts.Count; | |
var last = count - 1; |
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 | |
import UIKit | |
class RelativeView: UIView { | |
@IBInspectable var width: CGFloat = 1.0 | |
@IBInspectable var height: CGFloat = 1.0 | |
override var intrinsicContentSize: CGSize { | |
return CGSize(width: width, height: height) | |
} |
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
// | |
// ContentView.swift | |
// LearningSwiftUI | |
// | |
// Created by Brian on 08/06/2019. | |
// Copyright © 2019 Eviathan. All rights reserved. | |
// | |
import SwiftUI |
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
// | |
// ContentView.swift | |
// LearningSwiftUI | |
// | |
// Created by Brian on 08/06/2019. | |
// Copyright © 2019 Eviathan. All rights reserved. | |
// | |
import SwiftUI |
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
// | |
// ConnectFourBoardView.swift | |
// TestForMeitar | |
// | |
// Created by Brian on 18/05/2019. | |
// Copyright © 2019 Eviathan. All rights reserved. | |
// | |
import Foundation | |
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
let next = { print($0) } | |
let error = { print($0) } | |
let completed = { print("Completed") } | |
let disposed = { print("Disposed") } | |
// Empty | |
let emptyObservable = Observable<Int>.empty() | |
emptyObservable.subscribe(onNext: next, onError: error, onCompleted: completed, onDisposed: disposed) |
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
// Publish Subjects | |
// Starts empty and only emits new elements to subscribers. | |
let publishSubject = PublishSubject<Int>() | |
publishSubject | |
.asObserver() | |
.subscribe(onNext: { | |
print("Publish Subject Sub 1: \($0)") | |
}) | |
.disposed(by: disposeBag) |