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 keyTimeValues: [TimeInterval: Float] = [ | |
0.4: 0.0, | |
0.45: 1.0, | |
0.475: 1.0, | |
0.5: 1.0, | |
0.525: 1.0, | |
0.55: 0.0, | |
0.575: 1.0, | |
0.6: 1.0, | |
0.65: 1.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 ContentView: View { | |
var body: some View { | |
VStack { | |
Text("Hello, world!") | |
HStack(spacing: 10) { | |
ProductView( | |
title: "Monthly", | |
label: "POPULAR", | |
price: "€23", | |
tintColor: Color(uiColor: UIColor(red: 0.93, green: 0.79, blue: 0.47, alpha: 1.00)), |
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
ScrollView(.horizontal, showsIndicators: false) { | |
HStack(spacing: 0) { | |
ForEach(viewModel.criteria(for: category), id: \.valueProvider.title) { criteria in | |
StockCriteriaView(criteria: criteria) | |
.frame(width: UIScreen.main.bounds.width - 60) | |
.padding(.trailing, 12) | |
} | |
} | |
}.frame(width: UIScreen.main.bounds.width - 48) | |
.padding(.horizontal, 14) |
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 Content: NSManagedObject { | |
// MARK: - Mappable | |
func mapValues(using mapper: Mapping) throws { | |
let mapper = try mapper.mapper(for: self, destination: CKContent.self) | |
mapper.map(\.objectID, \.identifier, transform: { objectID -> String in | |
return objectID.uriRepresentation().absoluteString | |
}) | |
mapper.map(\.name, \.name) | |
mapper.map(\.url, \.url) | |
mapper.map(\.downloadURLExpiry, \.downloadURLExpiry) |
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
// | |
// ContentMapper.swift | |
// | |
// | |
// Created by Antoine van der Lee on 09/03/2021. | |
// | |
import Foundation | |
import ContentKit |
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 Cocoa | |
open class Content: Mappable { | |
var name: String = "" | |
init(name: String = "") { | |
self.name = name | |
} | |
func mapValues(using mapper: Mapping) throws { |
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 IssuesCountQualityCheck: RepositoryQualityCheck { | |
let id: String = UUID().uuidString | |
let title = "Issues count" | |
let score: Int | |
init(repository: Repository) { | |
switch repository.issuesCount { | |
case 0..<10: | |
score = 100 | |
case 10..<20: |
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 FileManager { | |
/* | |
Prints out the locations of the simulator and the shared group folder. | |
This is useful for debugging file issues. | |
Example usage: FileManager.default.printFileLocations() | |
*/ | |
func printFileLocations() { | |
let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) | |
let simulatorFolder = paths.last! |
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
// | |
// DarwinNotificationCenter.swift | |
// | |
// Copyright © 2017 WeTransfer. All rights reserved. | |
// | |
import Foundation | |
/// A Darwin notification payload. It does not contain any userInfo, a Darwin notification is purely event handling. | |
public struct DarwinNotification { |
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
find . -type f -name "*.swift" -exec grep -H -c '[^[:space:]]' {} \; | \sort -nr -t":" -k2 | awk -F: '{printf("Your largest file %s contains: %s lines \n", $1, $2); exit;}' |
NewerOlder