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 "RxObservable.h" | |
@interface RxArraySource : RxObservable | |
+ (instancetype)createWithElements: (NSArray *)array; | |
- (void)subscribe:(NSInvocation *)invocation; | |
@end |
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
@dynamicMemberLookup | |
class Variable<T> { | |
var value: T { | |
get { sub.value } | |
set { sub.value = newValue } | |
} | |
var stream: AnyPublisher<T, Never> { | |
return sub.eraseToAnyPublisher() | |
} |
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
/* | |
* Hedgewars-iOS, a Hedgewars port for iOS devices | |
* Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com> | |
* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; version 2 of the License | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Tic Tac Toe</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> |
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 UIKit | |
class ContainerViewController: UIViewController { | |
private var childVwCtrl: UIViewController | |
var contentViewController: UIViewController { | |
get { childVwCtrl } | |
set { set(contentViewController: newValue, animationDuration: nil) } | |
} |
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 UIKit | |
struct Colors { | |
static var normal = UIColor.blue | |
static var selected = UIColor.red | |
} | |
extension CGPoint { | |
static func add(_ left: CGPoint, _ right: CGPoint) -> CGPoint { | |
return CGPoint(x: left.x + right.x, y: left.y + right.y) |
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
// | |
// AsyncLoading.cpp | |
// | |
// Created by Sid on 11/10/14. | |
// Copyright (c) 2014 whackylabs. All rights reserved. | |
// | |
// Context: http://www.reddit.com/r/gamedev/comments/2ivsp6/async_loading_and_syncing_threads_with_your/ | |
/** Output: |
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
class ViewController: UIViewController { | |
private let imagePicker = UIImagePickerController() | |
private let colorPicker = UIColorPickerViewController() | |
private let imageView = UIImageView(image: nil) | |
private let colorView = UIView() | |
private let isSetUp = false | |
override func viewDidLayoutSubviews() { | |
if !isSetUp { |
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
--- | |
BasedOnStyle: WebKit | |
AccessModifierOffset: -4 | |
AlignAfterOpenBracket: DontAlign | |
AlignConsecutiveAssignments: false | |
AlignConsecutiveDeclarations: false | |
AlignEscapedNewlines: Right | |
AlignOperands: false | |
AlignTrailingComments: false | |
AllowAllArgumentsOnNextLine: true |
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 UIKit | |
// MARK: - ViewController | |
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
view.backgroundColor = .red | |
} | |
} |
NewerOlder