View simpler.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 unitSquareIntersectionPoint(_ angle: Angle) -> UnitPoint { | |
let normalizedDegree = angle.degrees.truncatingRemainder(dividingBy: 360) | |
let degreeProportion = (normalizedDegree / 90).truncatingRemainder(dividingBy: 4) | |
switch degreeProportion { | |
case 0: return UnitPoint(x: 1.0, y: 1.0) | |
case 1: return UnitPoint(x: 1.0, y: 1.0 - (normalizedDegree - 270) / 90) | |
case 2: return UnitPoint(x: 1.0 - (normalizedDegree - 180) / 90, y: 0.0) | |
case 3: return UnitPoint(x: 0.0, y: (normalizedDegree - 90) / 90) | |
default: return .zero |
View yMunch.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 SwiftCSV | |
import Foundation | |
extension Double { | |
/// Rounds the double to decimal places value | |
func rounded(toPlaces places:Int) -> Double { | |
let divisor = pow(10.0, Double(places)) | |
return (self * divisor).rounded() / divisor | |
} | |
} |
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) |
NewerOlder