hexsha stringlengths 40 40 | size int64 3 1.03M | content stringlengths 3 1.03M | avg_line_length float64 1.33 100 | max_line_length int64 2 1k | alphanum_fraction float64 0.25 0.99 |
|---|---|---|---|---|---|
e91c9ba2866b94ba9b2e1fb36ea22259d5f72c81 | 4,711 | //
// TMDBClient.swift
// TheMovieManager
//
// Created by Jarrod Parkes on 2/11/15.
// Copyright (c) 2015 Jarrod Parkes. All rights reserved.
//
import Foundation
// MARK: - TMDBClient: NSObject
class TMDBClient : NSObject {
// MARK: Properties
// shared session
var session = URLSession.sh... | 34.639706 | 208 | 0.594566 |
5629bd392e6769a766b92b07fea9d47d80df8f07 | 1,833 | //
// Usuario+CoreDataProperties.swift
// roadtrip
//
// Created by Alejo Martín Arias Filippo on 21/01/2021.
// Copyright © 2021 ual. All rights reserved.
//
//
import Foundation
import CoreData
extension Usuario {
@nonobjc public class func fetchRequest() -> NSFetchRequest<Usuario> {
return NSFetc... | 29.095238 | 92 | 0.744681 |
3ac73193d7a455e376e4cd275be0bebbd35cd5c1 | 3,609 | //
// View+Position.swift
// Proton
//
// Created by McDowell, Ian J [ITACD] on 4/5/16.
// Copyright © 2016 Ian McDowell. All rights reserved.
//
public extension View {
public func position(top top: Percent? = nil, bottom: Percent? = nil, left: Percent? = nil, right: Percent? = nil) -> Self {
self.pos... | 31.112069 | 136 | 0.581324 |
efb0e3a67d8f84978185d7c67ac3746119101914 | 171 | //
// BaseSectionCell.swift
// Pods
//
// Created by Vikas Goyal on 15/09/15.
//
//
import Foundation
public protocol BaseCellModel {
func identifier()->String;
} | 13.153846 | 39 | 0.666667 |
bbd524c8e367354776883a72c000b9c1fa07ed80 | 1,463 | //
// Weather.swift
// HeWeatherIO
//
// Created by iMac on 2018/5/30.
// Copyright © 2018年 iMac. All rights reserved.
//
import Foundation
public class Weather: HeWeatherBase {
let current: CurrentForecast?
let dailyForecast: [DailyForecast]?
let hourly: [HourlyForecast]?
let lifestyle: [Lifesty... | 29.26 | 90 | 0.678059 |
f835dc441f73e8cd6a822489969edb8a82f29a2e | 362 | //
// AnimationNavgator.swift
// testdemo
//
// Created by 常仲伟 on 2022/3/6.
// Copyright © 2022 常仲伟. All rights reserved.
//
import UIKit
enum AnimationChapter: CaseIterable, ViewControllerMaker, Navigation {
case animation
var viewController: UIViewController {
switch self {
case .animation: return... | 17.238095 | 70 | 0.698895 |
461c0a6c93fff4f48d54f85b9bb0b8ad8bfd6a84 | 7,797 | //
// File.swift
//
//
// Created by Fu Lam Diep on 14.01.21.
//
import Foundation
/// A dependency resolver class, that automtically finds the class that conforms
/// a given protocol and creates an instance of it.
///
/// If a property is declared with a protocol type, this class can be used to
/// assign the i... | 36.778302 | 85 | 0.640246 |
bbf52b6d356de4e1a958fe4d9e7145646ff12c5a | 853 | // Atom
//
// Copyright (c) 2020 Alaska Airlines
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law o... | 29.413793 | 75 | 0.704572 |
39ac2f7f07c76c279c30cb89a23009de5dda70d3 | 5,041 | /*
* Copyright (c) 2011-2018, Zingaya, Inc. All rights reserved.
*/
import UIKit
import UserNotifications
import AVFoundation
import Dispatch
class UIHelper {
fileprivate static var incomingCallAlert: UIAlertController?
fileprivate static var player: AVAudioPlayer?
class func ShowError(error: String!,... | 37.619403 | 200 | 0.617139 |
50981038042ceee757472a3c271ae0aaf4924575 | 45,793 | import Foundation
let input = [
"bkwzkqsxq-tovvilokx-nozvyiwoxd-172[fstek]",
"wifilzof-wbiwifuny-yhachyylcha-526[qrazx]",
"jvyyvzpcl-jhukf-shivyhavyf-487[zhtsi]",
"kwvacumz-ozilm-kivlg-kwvbiqvumvb-694[gknyw]",
"mvhkvbdib-kmjezxodgz-mvwwdo-omvdidib-837[dmvbi]",
"nzydfxpc-rclop-qwzhpc-lnbftdtetzy-171[cptzd]",
"vh... | 46.20888 | 67 | 0.770685 |
79b4ee6a7789b02c24dfdb7925614918559a4736 | 427 | //
// DiscoverItem.swift
// CosmoQuiz
//
// Created by Pablo Escriva on 18/04/2019.
// Copyright © 2019 Pablo Escriva. All rights reserved.
//
import Foundation
import Alamofire
class ApodItem{
var title:String
var image:UIImage
var description:String
var date:Date
init(){
self.ti... | 15.814815 | 56 | 0.606557 |
75e3969264db6bca8e0df9b009551b04950f18f9 | 201 | //
// JournalData.swift
// Feedetite
//
// Created by Vigneshwar Devendran on 17/05/18.
// Copyright © 2018 Vigneshwar Devendran. All rights reserved.
//
import Foundation
class JournalData{
}
| 13.4 | 63 | 0.706468 |
d6348b79bcabc52b3557b4e9add03be1e8c159ae | 31,062 | //
// Toast.swift
// Toast-Swift
//
// Copyright (c) 2015-2019 Charles Scalesse.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitat... | 39.120907 | 290 | 0.651117 |
01081e95d7627fafb341c96b4292f53226e743df | 9,341 | //
// Created by Kornel on 22/12/2016.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
import Foundation
let maxVersionsInFeed = 5
func findElement(name: String, parent: XMLElement) -> XMLElement? {
if let found = try? parent.nodes(forXPath: name) {
if found.count > 0 {
if let ... | 47.176768 | 252 | 0.631089 |
0819099771cba9b21d2b3214efa964b51fec35a0 | 989 | //
// ExtrasHeaderView.swift
// InventoryManager
//
// Created by Alex Grimes on 2/10/20.
// Copyright © 2020 Alex Grimes. All rights reserved.
//
import UIKit
class ExtrasHeaderView: UIView {
// MARK: - Properties
let barImageView: UIImageView = {
let imageView = UIImageView(frame: .zero)
... | 26.72973 | 90 | 0.658241 |
fe925102a86f5c471b79f4fbe7470477e0ba8512 | 8,703 | // Generated using Sourcery 0.15.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT
//
// EdgeAnchorGroup+RelationOperators.swift
// Layman
//
// Created by Brian Strobach on 1/4/19.
// Copyright © 2019 Brian Strobach. All rights reserved.
//
// MARK: EdgeAnchorGroup attribute inferred from Anchor
... | 32.595506 | 107 | 0.738021 |
9cf57f49ab596b1039c89d9fbb781699981e094c | 276 | //
// CColorerController.swift
// CColorer
//
// Created by Дмитрий Ахмеров on 02.08.2021.
//
import UIKit
open class CColorerViewController: UIViewController {
public func CCchange(color: UIColor, forView view: UIView) {
view.backgroundColor = color
}
}
| 18.4 | 64 | 0.699275 |
5d6b1fa0ec93c29d9d95f4d2464d48e7af8d0269 | 11,880 | import Foundation
import RxSwift
import Bow
import BowEffects
/// Witness for the `ObservableK<A>` data type. To be used in simulated Higher Kinded Types.
public final class ForObservableK {}
/// Partial application of the ObservableK type constructor, omitting the last type parameter.
public typealias ObservableKPar... | 35.675676 | 158 | 0.574916 |
5dd022fdcaa42de2740e8046b2ebb196e97b862f | 1,982 | //
// TitleScene.swift
// ios-spritekit-flappy-flying-bird
//
// Created by Astemir Eleev on 06/05/2018.
// Copyright © 2018 Astemir Eleev. All rights reserved.
//
import SpriteKit
class TitleScene: RoutingUtilityScene {
// MARK: - Overrides
override func didMove(to view: SKView) {
super... | 31.460317 | 110 | 0.606458 |
095b390f5429ca5085ff7e430cf5d78c00826945 | 1,927 | // ----------------------------------------------------------------------------
//
// LogcatLogger.Debug.swift
//
// @author Alexander Bragin <bragin-av@roxiemobile.com>
// @copyright Copyright (c) 2017, Roxie Mobile Ltd. All rights reserved.
// @link https://www.roxiemobile.com/
//
// ------------------... | 39.326531 | 104 | 0.548521 |
bbbdd4a5ff29055aa2b46effb248a42797de3206 | 1,500 | //
// File.swift
//
//
// Created by Alan Chu on 9/13/20.
//
import GeohashKit
import NationalWeatherService
extension WXPNationalWeatherService {
public static var region: Set<Geohash.Hash> {
return [
// Lower 48th
"c0", "f0", "f2", "f8", "9p", "9r", "9x", "9z", "dp", "dr", "9... | 31.914894 | 77 | 0.404 |
e4301b0d4ef68b2240b957bdad97c1d13efeb9de | 1,614 | import UIKit
open class Label: UILabel {
public typealias Action = (Label) -> Swift.Void
fileprivate var actionOnTouch: Action?
open var insets: UIEdgeInsets = .zero
override open func drawText(in rect: CGRect) {
// super.drawText(in: UIEdgeInsetsInsetRect(rect, insets))
... | 32.28 | 65 | 0.635068 |
acdeae36c69327110c1ae37d2707649aa94f1f8a | 15,061 | //
// Quote.swift
// StripeKit
//
// Created by Andrew Edwards on 7/25/21.
//
import Foundation
/// A Quote is a way to model prices that you'd like to provide to a customer. Once accepted, it will automatically create an invoice, subscription or subscription schedule.
public struct StripeQuote: StripeModel {
... | 52.477352 | 384 | 0.754996 |
d652901ac902b252bea9cc785973c423b01a03f8 | 1,453 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Async Algorithms open source project
//
// Copyright (c) 2022 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift... | 28.490196 | 90 | 0.580179 |
feea5faa8d08714729c41978bd4a0acecad5fef0 | 37,864 | /*
* SwiftLocation
* Easy and Efficent Location Tracker for Swift
*
* Created by: Daniele Margutti
* Email: hello@danielemargutti.com
* Web: http://www.danielemargutti.com
* Twitter: @danielemargutti
*
* Copyright © 2017 Daniele Margutti
*
*
* Permission is hereby granted, free of charge, to any person obtaining a ... | 37.864 | 258 | 0.73455 |
7a5957fc5b1e41780aac4d46787829d57fecebb1 | 534 | //
// Copyright © 2019 An Tran. All rights reserved.
//
import SwiftUI
struct GeometryReaderExampleView: View {
var body: some View {
ExampleView(
demoContentView: GeometryReaderExampleDemoView(),
remoteSourcePath: "Animation/Geometry/GeometryReader/GeometryReaderExampleDemoView.... | 23.217391 | 101 | 0.696629 |
792633451fb7f906078ec63f60a56a03b0e534af | 2,484 | /// Copyright (c) 2020 Razeware LLC
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, pu... | 40.064516 | 83 | 0.717794 |
5b9f0b225929bfb2ba1835420eaa63e2b91b7bf9 | 1,628 | /*
* Copyright (C) 2014-2019 halo https://github.com/halo/macosvpn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, cop... | 45.222222 | 133 | 0.738329 |
39235da6d49aebab433b3d05b3e95505a1cd17bd | 851 | //
// MainAssembly.swift
// Exemple
//
// Created by Bart on 26.10.2019
// Copyright © 2019 iDevs.io. All rights reserved.
//
import UIKit
typealias MainModule = Module<MainModuleInput, MainModuleOutput>
class MainAssembly: Assembly {
func build(coordinator: CoordinatorType) -> MainModule {
... | 24.314286 | 77 | 0.620447 |
72d3322c15f004709aa0bc19c7f9917d8748a637 | 2,364 | import Foundation
import PathKit
public class PackageManager {
public var path: Path
public var name: String
public var beakFile: BeakFile
public var sourcesPath: Path { return path + "Sources" }
public var packagePath: Path { return path + "Package.swift" }
public var mainFilePath: Path { re... | 28.142857 | 152 | 0.551607 |
4857526536dfa8f5e69fcc43be00e94986c3d0d0 | 737 | //
// DataViewController.swift
// XppIRCiOS
//
// Created by Michiel Hegemans on 08/01/2017.
// Copyright © 2017 Bromancer. All rights reserved.
//
import UIKit
class DataViewController: UIViewController {
@IBOutlet weak var dataLabel: UILabel!
var dataObject: String = ""
override func viewDidLoad(... | 21.057143 | 80 | 0.671642 |
bb58f43d5dc768488080fb12bfaf04565a6f9aec | 939 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | 30.290323 | 80 | 0.582535 |
905b5e76513371be9b74238413f4122749657088 | 782 | //
// WfmIntradayPlanningGroupListing.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
//
import Foundation
/** A list of IntradayPlanningGroup objects */
public class WfmIntradayPlanningGroupListing: Codable {
public enum NoDataReason: String, Codable {
case ... | 23 | 90 | 0.69821 |
08ecc25defd005c0fda1b7bf92267aee3fa54413 | 579 | //
// QueryFilterMethod.swift
// FluentExt
//
// Created by Gustavo Perdomo on 07/28/18.
// Copyright © 2018 Vapor Community. All rights reserved.
//
internal enum QueryFilterMethod: String {
case equal = "eq"
case notEqual = "neq"
case `in` = "in"
case notIn = "nin"
case greaterThan = "gt"
... | 23.16 | 58 | 0.630397 |
870857fb20a56ed10e365b464b50360fd433faf3 | 2,616 | // Flyweight - iOS client for GNU social
// Copyright 2017 Thomas Karpiniec
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unle... | 34.88 | 114 | 0.629587 |
769a092597befa72ec5478fcc7cd1e0b3e282ed0 | 1,040 | // swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "PodJimPlayKit",
products: [
// Products define the executables and libraries a package produces, and make them visible to ... | 35.862069 | 117 | 0.627885 |
ed6225ad1c4531f14dd7e4915d27d504b0df387d | 1,148 | //
// MoveStack.swift
// Solitaire
//
// Created by Juan on 11/06/2020.
// Copyright © 2020 Pixfans. All rights reserved.
//
import SpriteKit
class Move: Pile {
static let KZPos : CGFloat = 100
static let KOffset = CGSize(width: 0, height: -30)
var origin: InteractivePile
var destination: In... | 22.96 | 87 | 0.609756 |
29614265d6ada1958dcaea8bad6a432113cbd811 | 1,598 | //
// SWAppLoginManager.swift
// Switcher
//
// Created by X140Yu on 6/9/16.
// Copyright © 2016 X140Yu. All rights reserved.
//
import Foundation
import AppKit
class SWAppLoginManager {
static func loginWith(_ type: SWLoginType, appleID: String, password: String) {
var resourceName: String = ""
... | 31.96 | 131 | 0.639549 |
ed0cf8ee0f682792dbf4ae7de8ee08d889dbc7f3 | 627 | #if canImport(Darwin)
import Foundation
extension Bundle {
/**
Locates the first bundle with a '.xctest' file extension.
*/
internal static var currentTestBundle: Bundle? {
return allBundles.first { $0.bundlePath.hasSuffix(".xctest") }
}
/**
Return the module name of the bundl... | 24.115385 | 79 | 0.671451 |
1d3fa4fada01d1a2bdc87849a64403832c00bd6f | 2,945 | //
// AppDelegate.swift
// MERLinSample
//
// Created by Giuseppe Lanza on 02/09/18.
// Copyright © 2018 HBCDigital. All rights reserved.
//
import MERLin
import RxSwift
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, EventsProducer {
let moduleName: String = "app_launch... | 35.481928 | 167 | 0.689983 |
fc6bbd58d60567328683de0614151f60888a22c7 | 2,639 | /// The Trie class has the following attributes:
/// -root (the root of the trie)
/// -wordList (the words that currently exist in the trie)
/// -wordCount (the number of words in the trie)
public final class Trie {
typealias Node = TrieNode<Character>
public fileprivate(set) var words: Set<String> = []
... | 25.375 | 103 | 0.627889 |
0a6c8dadf5c678d21c2b81d230b7da5e10c1dec8 | 2,369 | //
// Library
//
// Created by Otto Suess on 04.07.18.
// Copyright © 2018 Zap. All rights reserved.
//
import Foundation
import Lightning
struct FilterSettings: Equatable, Codable {
var channelEvents: Bool
var transactionEvents: Bool
var createInvoiceEvents: Bool
var expiredInvoiceEvents: Bool
... | 27.546512 | 91 | 0.669903 |
3a89e1a3f7303d6e6d402364065751ce839a3ed3 | 2,137 | //
// AppDelegate.swift
// AutoLayout
//
// Created by WangBen on 16/4/28.
// Copyright © 2016年 WangBen. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingW... | 45.468085 | 285 | 0.753861 |
8a16c194c64854681c6e7594dd9f46aa9004ae47 | 5,095 | //
// WelcomeViewController.swift
// Truco Marcador
//
// Created by Joao Flores on 15/06/20.
// Copyright © 2020 Gustavo Lima. All rights reserved.
//
import UIKit
import StoreKit
class WelcomeViewController: UIViewController {
// MARK: - Variables
var products: [SKProduct] = []
var timerLoad... | 31.645963 | 145 | 0.579588 |
f79f51600eae145e5c4991877d0568c6d9fb7eb6 | 447 | //
// SwiftyReading.swift
// Files
//
// Created by Manuel Sánchez on 9/12/19.
//
import Foundation
struct SwiftyReading: Codable {
let firstReading: Reading?
let psalm: Reading?
let secondReading: Reading?
let gospel: Reading?
let date: String
enum CodingKeys: String, CodingKey {
... | 19.434783 | 45 | 0.651007 |
8965cbf2f000ce0cc97de11f09cef7f8de4d3a07 | 3,593 | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AudioKit
class AKDistortionTests: AKTestCase {
override func setUp() {
super.setUp()
duration = 1.0
}
func testCubicTerm() {
output = AKDistortion(input, cubicTerm: 0.65)
... | 30.193277 | 100 | 0.578068 |
29171e2a96da272ece3427efb9df0dec3fb8fe05 | 58 | //
// File.swift
// FiretvExample
//
import Foundation
| 8.285714 | 17 | 0.655172 |
22447747d82e60521bcb8415c449fc413b0f6a5d | 3,814 | /*******************************************************************************
* Copyright 2019 alladin-IT GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apach... | 41.010753 | 143 | 0.670425 |
e5bee5ac01b2ecd063d7987c491fe6e7347e7b16 | 12,056 | //
// CourseOutline.swift
// edX
//
// Created by Akiva Leffert on 4/29/15.
// Copyright (c) 2015 edX. All rights reserved.
//
import Foundation
import edXCore
public typealias CourseBlockID = String
public struct CourseOutline {
enum Fields : String, RawStringExtractable {
case Root = "root"
... | 37.209877 | 180 | 0.575647 |
46eaba629562f4ba9f232d6819e7141746378147 | 578 | //
// AppDelegate.swift
// School
//
// Created by mis on 17.02.21.
//
// Copyright (c) [2021] [Michael Schmidt, michael.schmidt@app-making.de]
// You can use it under the MIT License (You find it in file LICENSE)
//
import Cocoa
@main
class AppDelegate: NSObject, NSApplicationDelegate {
func applica... | 19.266667 | 73 | 0.690311 |
90b20ecb00a74f1e47993108f1888f66336b193a | 318 | func foo(_ a : inout [Int]) -> [Int] {
a[0] = 3
a[1] = 4
a[3] = 4
return a
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %refactor -extract-function -source-filename %s -pos=2:1 -end-pos=5:11 >> %t.result/L2-5.swift
// RUN: diff -u %S/Outputs/extract_sugar/L2-5.swift.expected %t.result/L2-5.swift
| 28.909091 | 102 | 0.606918 |
e867f5ffdc1a12f0303820647047a594d41405c3 | 1,740 | /************************************************************************//**
* PROJECT: SwiftDOM
* FILENAME: EntityRefNodeImpl.swift
* IDE: AppCode
* AUTHOR: Galen Rhodes
* DATE: 11/3/20
*
* Copyright © 2020 Galen Rhodes. All rights reserved.
*
* Permission to use, copy, modify, and... | 48.333333 | 183 | 0.662069 |
f9efb27aa99a42d1cd954e7ea2e13ac1a5ac3ca5 | 19,669 | //
// KingfisherOptionsInfo.swift
// Kingfisher
//
// Created by Wei Wang on 15/4/23.
//
// Copyright (c) 2019 Wei Wang <onevcat@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the... | 56.037037 | 139 | 0.72749 |
de8475be303b14c062541a4c3595c4c5d37a775d | 1,024 | //
// Helper.swift
// NSResultKitExample
//
// Created by Robert Armenski on 27.10.20.
//
import Foundation
import NSResultKit
enum RandomError: Error {
case oddNumberFailure(Int)
}
extension RandomError: LocalizedError {
var errorDescription: String? {
switch self {
case .oddNumberFailure... | 22.26087 | 87 | 0.597656 |
8aa355c4a1ac84c90c00a948adab4b8aea001130 | 2,227 | //
// SerialDisposable.swift
// Rx
//
// Created by Krunoslav Zaher on 3/12/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
/**
Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the... | 25.895349 | 192 | 0.566682 |
e50d7054a20d38eb448e6d997229261eb6c00e54 | 3,441 | /*
Copyright 2017 Avery Pierce
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwa... | 29.921739 | 120 | 0.684975 |
215fc59cc48f04b5e5751e03fb114b2d7d4e4291 | 1,532 | /*
* Copyright 2018 Tua Rua Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | 34.044444 | 108 | 0.624674 |
f41d83506bf330e3e10498dd03450d9547df7794 | 1,100 | // Copyright 2022 Pera Wallet, LDA
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in wr... | 32.352941 | 87 | 0.696364 |
f51ac4156533b0e0d4b0dfb3cad7d6827eb4d7d4 | 2,165 | //
// AppDelegate.swift
// HRGCD
//
// Created by obgniyum on 01/22/2018.
// Copyright (c) 2018 obgniyum. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchi... | 46.06383 | 285 | 0.753811 |
1dac1a4e5768fefac3985d1e51abdb1fe27319ad | 690 | //
// AnswerGame.swift
// arithmetical
//
// Created by Pedro Sandoval on 8/26/16.
// Copyright © 2016 Sandoval Software. All rights reserved.
//
import Foundation
import UIKit
class AnswerGame: Game {
var questionGenerator: ( () -> (String) )!
/* Instantiate a AnswerGame object looks like ... | 27.6 | 149 | 0.673913 |
89822a3fc60104523f1826af3b58f7993fec2bcf | 435 | //
// Bundle+BookReader.swift
//
// Created by Alex on 01/10/2018.
//
import Foundation
internal class DummyBookReaderClass {}
extension Bundle {
static var bookReader: Bundle {
get {
let bundle = Bundle(for: DummyBookReaderClass.self)
let bookReaderBundlePath = bundle.path(forR... | 21.75 | 95 | 0.643678 |
294a4104257bbece5f79b9be313f02fb37c5a91e | 896 | import UIKit
/// Represents an a proportional relationship between width and height.
public struct AspectRatio {
/// A 1:1 aspect ratio.
public static let square = AspectRatio(ratio: 1)
/// The width:height ratio value.
public var ratio: CGFloat
/// Initializes with a width & height ratio.
//... | 26.352941 | 71 | 0.633929 |
2f031358b735468bb2c23d0ee26e7f03c4cd246a | 1,729 | //
// Filter.swift
// RxSwift
//
// Created by Krunoslav Zaher on 2/17/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
class FilterSink<O : ObserverType>: Sink<O>, ObserverType {
typealias Predicate = (Element) throws -> Bool
typealias Element = O.E
private let ... | 29.305085 | 144 | 0.569693 |
6288fc89587940d4de3ee9f50db837f14b934818 | 166 | import CoreGraphics
import Foundation
internal protocol TimingParameters {
var duration: TimeInterval { get }
func value(at time: TimeInterval) -> CGFloat
}
| 20.75 | 48 | 0.759036 |
c1d992bd0015818b71838289a5b5160361b6ff75 | 3,888 | //
// ProfileHeaderView.swift
// LabShare-Front
//
// Created by Alexander Frazis on 20/9/20.
// Copyright © 2020 CITS3200. All rights reserved.
//
import SwiftUI
import Combine
struct ProfileHeaderView: View {
@EnvironmentObject var userAuthVM: UserAuthenticationViewModel
@ObservedObject var profileVM: P... | 42.725275 | 400 | 0.5643 |
875c3f1b07450fac5f465a6c49ce3619212912df | 2,101 | //
// APIEndpoints.swift
// WhatToWatch
//
// Created by Denis Novitsky on 23.04.2021.
//
import Foundation
struct APIEndpoints {
static func fetchTrends(type: MediaType, timeWindow: TimeWindow, page: Int) -> Endpoint<MediaPageDTO> {
let mediaString = APIEndpoints.mediaString(from: type)
let t... | 31.833333 | 107 | 0.588767 |
0ee208d1e5b61c44063effe376905bd3f35ed360 | 675 | //
// CrashCell.swift
// MTC-Rat
//
// Created by Кирилл Володин on 29.09.17.
// Copyright © 2017 Кирилл Володин. All rights reserved.
//
import UIKit
class CrashCell: UITableViewCell {
@IBOutlet weak var statusImage: UIImageView!
@IBOutlet weak var codeLabel: UILabel!
@IBOutlet weak var dateLabel: U... | 21.774194 | 65 | 0.66963 |
bbbd4ed92814310e7e8e8b478632db54581000c2 | 14,775 | // Generated using Sourcery 0.18.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT
// Generated with SwiftyMocky 4.0.0
import SwiftyMocky
import XCTest
import HealthKit
import CoreData
import Presentr
import CSV
import SwiftDate
import UserNotifications
import Instructions
@testable import Introspect... | 46.904762 | 231 | 0.700305 |
4889e3cae32eaf860207987c315b77edf4c72482 | 945 | #if canImport(UIKit)
import UIKit
#elseif canImport(AppKit)
import AppKit
#endif
public class ImageDownloadRequest: NetworkRequest {
#if canImport(UIKit)
public typealias Output = UIImage
#elseif canImport(AppKit)
public typealias Output = NSImage
#endif
public let url: URL?
public let ur... | 26.25 | 60 | 0.701587 |
1e1265f64dd8ec72c4b02872243b4b8549f58743 | 443 | // Copyright 2017-2020 Fitbit, Inc
// SPDX-License-Identifier: Apache-2.0
//
// UILabel+Rx.swift
// BluetoothConnection
//
// Created by Marcel Jackwerth on 11/20/17.
//
#if os(iOS)
import Foundation
import RxCocoa
import RxSwift
import UIKit
extension Reactive where Base: UILabel {
var textColor: Binder<UI... | 17.038462 | 50 | 0.663657 |
f8e5cb19c44a14d27ff59a873feca86564a7d8ef | 17,695 | //
// ChatViewController.swift
// TrackingAdvisor
//
// Created by Benjamin BARON on 5/22/18.
// Copyright © 2018 Benjamin BARON. All rights reserved.
//
import Foundation
import UIKit
import Alamofire
struct Message : Codable {
let text: String
let timestamp: Date
let sender: Bool
}
class ChatViewCo... | 42.434053 | 192 | 0.620458 |
16114fada0dd3bbb0fcf496d74602cca7b095f72 | 1,016 | import Foundation
public struct CurrentOrderSummaryReport: Codable {
public struct CurrentOrderSummary: Codable {
public let betId: String
public let marketId: String
public let selectionId: Int
public let handicap: Double
public let priceSize: PriceSize
public let bspLiability: Double
pu... | 29.882353 | 50 | 0.75 |
1ad9f5afe4c9cf5051473920c8cb21a4b5c2e046 | 2,557 | //
// AppDelegate.swift
// XBackgroundManager
//
// Created by dte2mdj on 03/31/2020.
// Copyright (c) 2020 dte2mdj. All rights reserved.
//
import UIKit
import XBackgroundManager
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
#if swift(>=5.0)
func ... | 42.616667 | 285 | 0.737583 |
1cba077f4b6b2e5aa71d4e3cd637963ea0be66eb | 1,424 | //
// LoggerUITests.swift
// LoggerUITests
//
// Created by Anton Kononenko on 9/18/21.
//
import XCTest
class LoggerUITests: XCTestCase {
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tes... | 33.116279 | 182 | 0.655197 |
f5951f0509ff884dbc076713d81249134ac4250f | 3,622 | // The MIT License (MIT) - Copyright (c) 2016 Carlos Vidal
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT H... | 29.447154 | 80 | 0.632247 |
642248479dbcd914bd0e2359e5da2bcc0df58700 | 251 | //
// RoomGroupVo.swift
// DYTV
//
// Created by 寂惺 on 2018/7/10.
// Copyright © 2018年 haha. All rights reserved.
//
import Foundation
struct RoomGroupVo {
var roomList : [RoomVo]?
var headerIcon : String?
var headerName : String?
}
| 15.6875 | 48 | 0.649402 |
296791d91d31c0d20081614a54d49270eea3bc09 | 103 | import Common
public let logger = LightLogger.self
public let analytics = Analytics<AnalyticsEvent>()
| 20.6 | 50 | 0.805825 |
91868b3af9a012ac4f1407b782b18826a9dbb0e9 | 1,012 | //
// AppDelegate.swift
// PrinceOfVersionsSample
//
// Created by Jasmin Abou Aldan on 13/09/2019.
// Copyright © 2019 infinum. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplica... | 28.914286 | 145 | 0.729249 |
e4dc96ec70431d6a71b536c113ca3d4eebd54d0c | 2,350 | //
// MussicListViewModel.swift
// iTunesPlayer
//
// Created by Ferdinando Furci on 20/03/2020.
// Copyright © 2020 Ferdinando Furci. All rights reserved.
//
import Foundation
// MARK: - SortingOptions
enum SortingOptions: Int {
case length = 0
case genre = 1
case price = 2
}
// MARK: - MusicListViewModelPro... | 28.313253 | 90 | 0.746809 |
4a46ceffda2d1d55e265ca8e92920d4b55a9ff1a | 1,657 | //
// IMDownloadImagesTest.swift
// iMoviesTests
//
// Created by Ricardo Casanova on 04/09/2018.
// Copyright © 2018 Careem. All rights reserved.
//
import XCTest
@testable import iMovies
class IMDownloadImagesTest: XCTestCase {
override func setUp() {
super.setUp()
}
override f... | 29.070175 | 95 | 0.639107 |
e476c1c426852a623fea9ec29333ecd88a21abc1 | 2,821 | //
// ReviewViewController.swift
// WeScan
//
// Created by Boris Emorine on 2/25/18.
// Copyright © 2018 WeTransfer. All rights reserved.
//
import UIKit
/// The `ReviewViewController` offers an interface to review the image after it has been cropped and deskwed according to the passed in quadrilateral.
final cl... | 34.402439 | 190 | 0.675292 |
334ec66f2ce6c8974c79fbbf2e6c25b4b7def84a | 1,094 | //
// AppDelegate.swift
// CleanArchitectureWithCoordinatorPatternDemo
//
// Created by Umbrella tech on 06.11.2017.
// Copyright © 2017 Umbrella. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var rootController: UIN... | 28.789474 | 144 | 0.711152 |
ccb264958f99033feb0133f38d8eca8b154afeaa | 270 | // OSLog+Extensions.swift
// Copyright (c) 2022 Joe Blau
import Foundation
import os.log
extension OSLog {
private static var subsystem = Bundle.main.bundleIdentifier!
static let hexSmartContract = OSLog(subsystem: subsystem, category: "hex_smart_contract")
}
| 24.545455 | 93 | 0.766667 |
693faf0875ceb7ef675b56548d925b3d48d2f7c5 | 37,457 | //
// ArticlesTable.swift
// NetNewsWire
//
// Created by Brent Simmons on 5/9/16.
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
//
import Foundation
import RSCore
import RSDatabase
import RSDatabaseObjC
import RSParser
import Articles
final class ArticlesTable: DatabaseTable {
let name: Stri... | 36.43677 | 236 | 0.743653 |
89a4af9ed32d623a94a0c204913b7023f4e416fb | 1,750 | //
// CharacterDetailsViewModel.swift
// MarvelApp
//
// Created by Igor Zarubin on 30.03.2022.
//
import Foundation
import Combine
final class CharacterDetailsViewModel: ObservableObject {
private let character: MarvelCharacter
private let service: ComicService
var name: String { self.character.n... | 30.172414 | 78 | 0.566857 |
09dd0e2385b2ab0f7068dfada37e0d9f7f30efd8 | 228 | //
// UICollectionViewCell.swift
// WaveLabs
//
// Created by Vlad Gorlov on 06.06.2020.
// Copyright © 2020 Vlad Gorlov. All rights reserved.
//
#if canImport(UIKit)
import UIKit
extension UICollectionViewCell {
}
#endif
| 15.2 | 54 | 0.714912 |
1a913c101bd7f5b0cdfb5fcd7b73b5a5a841a63e | 2,751 | import Foundation
import os.log
class SourceDisplays: PublishTerminateHandler {
let name: String?
let callback: (Float) -> Void
var source: SourceDisplay?
override var matchClass: String { return "AppleBacklightDisplay" }
init(name: String? = nil, _ callback: @escaping (Float) -> Void) throws {
self.name = na... | 30.230769 | 172 | 0.745184 |
8fbbfc84e0c65949db70a650e877e2931c68c122 | 447 | import XCTest
@testable import numsw
class MatrixTransformationTests: XCTestCase {
func testReshape() {
let a = Matrix<Int>.eye(4)
XCTAssertEqual(a.reshaped(rows: 2, columns: 8), Matrix([[1, 0, 0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 0, 1]]))
}
static var allTests: [(String, (Matrix... | 24.833333 | 117 | 0.552573 |
29301f2e0f398afe8224a0c455bd034424d5847f | 1,694 | //
// This source file is part of the MongoKitten open source project
//
// Copyright (c) 2016 - 2017 OpenKitten and the MongoKitten project authors
// Licensed under MIT
//
// See https://github.com/OpenKitten/MongoKitten/blob/mongokitten31/LICENSE.md for license information
// See https://github.com/OpenKitten/MongoK... | 37.644444 | 151 | 0.668241 |
507a6d6ab020d1137061d21be95511ee857dd72d | 9,276 | /*
* Copyright 2016 IBM Corp.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or a... | 46.38 | 155 | 0.639176 |
38d390b8b73d3ad37cdf3573c1aad342e609ba70 | 2,868 | import UIKit
@objc(SDCAlertAction)
public class AlertAction: NSObject {
/// Creates an action with a plain title.
///
/// parameter title: An optional title for the action
/// parameter style: The action's style
/// parameter image: The image of action
/// parameter handler: An optional c... | 32.965517 | 155 | 0.645049 |
16483432de05c9dd185761dfe3fcaf1144e3ee7e | 2,302 | //
// RelistenLegacyAPI.swift
// RelistenShared
//
// Created by Jacob Farkas on 8/12/18.
// Copyright © 2018 Alec Gorge. All rights reserved.
//
import Foundation
import Siesta
import SwiftyJSON
import Cache
public class RelistenLegacyAPI {
private let service = Service(baseURL:"http://iguana.app.alecgorge.... | 28.419753 | 86 | 0.591659 |
fb2fae52f831a17b17c58aab7fbe6fe274148cdb | 2,641 | // Generated using SwiftGen, by O.Halligon — https://github.com/SwiftGen/SwiftGen
#if os(OSX)
import AppKit.NSFont
typealias Font = NSFont
#elseif os(iOS) || os(tvOS) || os(watchOS)
import UIKit.UIFont
typealias Font = UIFont
#endif
// swiftlint:disable superfluous_disable_command
// swiftlint:disable file_le... | 37.197183 | 154 | 0.725483 |
e65bdd5b4d31ba63df19805ee82250f833e0f9ba | 708 | //
// ToDoCellModell.swift
// iOS_Bootstrap_Example
//
// Created by Ahmad Mahmoud on 12/21/18.
// Copyright © 2018 CocoaPods. All rights reserved.
//
struct ToDoCellModel: Decodable, Equatable {
var id: Int?
var name: String?
var createdAt: String?
var isDone: Bool?
// var tasks: [TaskEnt... | 25.285714 | 90 | 0.635593 |
dd9dc2cab646191e6ddbc341cf99b7b28b7605b5 | 278 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
var b = T>
func < {
struct S<S {
{
}
}
protocol c { func b<T where S<e> : String
protocol e : b {
{
}
func b
| 17.375 | 87 | 0.68705 |
d76a2af693d278ed8f558604eacb41babb648c83 | 2,184 | //
// AppDelegate.swift
// SampleSlimyCollectionView
//
// Created by Hiroto on 2017/09/24.
// Copyright © 2017年 hi-ro-to. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication,... | 46.468085 | 285 | 0.75641 |
23a0ddebe76254280699071b4b3d4d72d65bf6d4 | 13,704 | /*
* Copyright (c) 2019, Nordic Semiconductor
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of condit... | 36.739946 | 112 | 0.605881 |
87df548a9988fe132bbef49d5d47ee8ec5a55b1d | 1,042 | /*
See LICENSE folder for this sample’s licensing information.
Abstract:
A view showing a list of landmarks.
*/
import SwiftUI
struct LandmarkList: View {
@EnvironmentObject private var userData: UserData
var body: some View {
List {
Toggle(isOn: $userData.showFavoritesOnly) {
... | 24.809524 | 76 | 0.560461 |
187fdae7dabf75623c194f7755ac6569cff278bb | 4,594 | //
// Generated by SwagGen
// https://github.com/yonaskolb/SwagGen
//
import Foundation
public class MediaFile: APIModel {
/** The way in which the media file is delivered. */
public enum DeliveryType: String, Codable {
case stream = "Stream"
case progressive = "Progressive"
case down... | 32.125874 | 187 | 0.622987 |
ff6f5674a83f2c46ed0ebe0388c79035bd479b7d | 2,291 | //
// SceneDelegate.swift
// SegueExample
//
// Created by Yunjia Gao on 2/6/22.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
... | 43.226415 | 147 | 0.712789 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.