View RankingsView.view
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
// | |
// RankingsView.swift | |
// ChessClub | |
// | |
// Created by Oliver Drobnik on 22.04.22. | |
// | |
import SwiftUI | |
struct RankingsView: View |
View Observing.swift
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 Combine | |
import ProoficsSDK | |
import SwiftUI | |
class BundleViewModel: ObservableObject | |
{ | |
@Published var title: String = "" | |
@Published var subtitle: String? |
View FastnotesSettings.swift
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 SwiftUI | |
struct Modifier: Identifiable | |
{ | |
let id = UUID() | |
@State var title: String | |
} | |
struct FastnotesSettings: View |
View PlatformSpecific.swift
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 SwiftUI | |
struct Platform: OptionSet | |
{ | |
let rawValue: Int | |
static let iOS = Platform(rawValue: 1<<0) | |
static let tvOS = Platform(rawValue: 1<<1) | |
static let watchOS = Platform(rawValue: 1<<2) | |
View ContentView.swift
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 SwiftUI | |
struct RegularEventCell: View { | |
let color: Color | |
let title: String | |
let description: String? | |
var body: some View { |
View Refreshable.swift
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
@objc protocol Refreshable | |
{ | |
/// The refresh control | |
var refreshControl: UIRefreshControl? { get set } | |
/// The table view | |
var tableView: UITableView! { get set } | |
/// the function to call when the user pulls down to refresh | |
@objc func handleRefresh(_ sender: Any); |
View expectation.swift
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
func testHangSquareBracket() | |
{ | |
let input = "Text [-( Text" | |
let expectation = self.expectation(description: "Should not hang") | |
DispatchQueue.global().async { | |
let builder = BBCodeAttributedStringBuilder(bbcode: input) | |
let output = builder.attributedString | |
XCTAssertNotNil(output) |
View UIImage+Util.swift
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 | |
extension UIImage | |
{ | |
/// Creates an image from drawing into a context | |
convenience init(size: CGSize, opaque: Bool = true, operations: (CGContext)->()) | |
{ | |
UIGraphicsBeginImageContextWithOptions(size, opaque, 0) | |
let ctx = UIGraphicsGetCurrentContext()! |
View TypeInfer.swift
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
public enum VanillaRequestError: Error | |
{ | |
case unexpectedResult(String) | |
case restfulError(NSError) | |
} | |
// the result from a Vanilla API request | |
public enum VanillaRequestResult<T> | |
{ |
NewerOlder