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 |
|---|---|---|---|---|---|
2ff3acadce8609f22ea79977eeb3d28e0677a1af | 1,360 | import Cocoa
import AuthenticationKit
// TODO: Fix example. Should work in theory
class ViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
let success: (accounts: [AccountType]) -> Void = { (accounts) -> Void in
print(accounts)
}
... | 29.565217 | 130 | 0.614706 |
c10da17f27dea30f9735e53329049a8d03dc091f | 3,979 | //
// BusinessesViewController.swift
// Yelp
//
// Created by Timothy Lee on 4/23/15.
// Copyright (c) 2015 Timothy Lee. All rights reserved.
//
import UIKit
class BusinessesViewController: UIViewController, UITableViewDataSource, UITableViewDelegate, UISearchBarDelegate, UIScrollViewDelegate {
var businesse... | 30.607692 | 200 | 0.656195 |
33a86ff909453f9b2c68094b227b7dcd8c99a813 | 2,171 | //
// AppDelegate.swift
// dtacComponent
//
// Created by ragopor on 02/05/2020.
// Copyright (c) 2020 ragopor. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishL... | 46.191489 | 285 | 0.754491 |
1ee9c669cbadaee41f3f85efbc47400b1a3156fd | 18,292 | import SwiftUI
import CloudKit
import CircularCheckmarkProgress
import os.log
#if DEBUG && true
fileprivate var log = Logger(
subsystem: Bundle.main.bundleIdentifier!,
category: "RecoveryPhraseView"
)
#else
fileprivate var log = Logger(OSLog.disabled)
#endif
struct RecoveryPhraseView: View {
@ViewBuilder
var bo... | 23.213198 | 98 | 0.640663 |
119fb781bd44be6a9bed48380f63d64ef173318c | 695 | //
// FormatarNumero.swift
// CommonsService
//
// Created by Leticia Sousa Siqueira on 27/01/21.
//
import Foundation
public class FormataNumero {
public init() {
}
public func formatarCotacao(cotacao: Double) -> String {
let formatter = NumberFor... | 23.166667 | 64 | 0.56259 |
ab9f85120514d8a8ced90b6c0b5040d4d9e9b7a7 | 2,997 | //
// PrivateKey.swift
// WalletKit
//
// Created by yuzushioh on 2018/02/06.
// Copyright © 2018 yuzushioh. All rights reserved.
//
public struct PrivateKey {
public let raw: Data
public let chainCode: Data
public let depth: UInt8
public let fingerprint: UInt32
public let index: UInt32
pub... | 34.056818 | 136 | 0.620287 |
9070e7ca3132f201a0660ee449aa1d41069fdb6a | 3,810 | //
// AppDelegate.swift
// Notes
//
// Created by Александр Андреев on 26/06/2019.
// Copyright © 2019 Alexander Andreev. All rights reserved.
//
import UIKit
import CocoaLumberjack
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ applic... | 45.903614 | 285 | 0.665354 |
619b96106bf0606c5aa0704ae75ee9c8ac30d666 | 302 | //
// ZoomableImageConstant.swift
// Buok
//
// Copyright © 2021 Buok. All rights reserved.
//
import Foundation
@objc public enum ScaleMode: Int {
case aspectFill
case aspectFit
case widthFill
case heightFill
}
@objc public enum Offset: Int {
case begining
case center
}
| 14.380952 | 47 | 0.678808 |
016d8d596921f54c8169c2e147deea4fd2328b8b | 17,265 | //
// Pushy.swift
// Pushy
//
// Created by Pushy on 10/7/16.
// Copyright © 2016 Pushy. All rights reserved.
//
import UIKit
import UserNotifications
public class Pushy : NSObject {
static var shared: Pushy?
private var appDelegate: UIApplicationDelegate
private var application: UIApplication
... | 41.90534 | 212 | 0.609731 |
e9b87a3d8bfba3a775674e0a91a0b27ce4b5acdd | 4,646 | import Foundation
/// This is the element for referencing other targets through content proxies.
public final class PBXTargetDependency: PBXObject {
// MARK: - Attributes
/// Target name.
public var name: String?
/// Target reference.
var targetReference: PBXObjectReference?
/// Target.
... | 35.465649 | 126 | 0.642488 |
212442e571fbda07109559812a9cc7119935e57e | 13,887 | import SafariServices
final class SafariExtensionHandler: SFSafariExtensionHandler {
private let service = SourceKitServiceProxy.shared
override func messageReceived(withName messageName: String, from page: SFSafariPage, userInfo: [String : Any]?) {
switch messageName {
case "initialize":
... | 48.555944 | 183 | 0.468136 |
0a31a122509af75fe1e582be4354a528f4495515 | 2,378 | //
// THMainViewController.swift
// AudioLooper_Swift
//
// Created by nathan on 2020/12/25.
//
import UIKit
class THMainViewController: UIViewController,THPlayerControllerDelegate {
@IBOutlet var rateKnob: THControlKnob!
@IBOutlet weak var playButton: THPlayButton!
@IBOutlet weak var pla... | 25.297872 | 73 | 0.584104 |
f9809d0dc36a7611ed4d3408feaf68b86138e84b | 6,627 | //
// SettingDeviceInfo.swift
// Chromatic
//
// Created by Lakr Aream on 2021/8/28.
// Copyright © 2021 Lakr Aream. All rights reserved.
//
import UIKit
extension SettingView {
func setupDeviceInfoSection(anchor: inout UIView, safeAnchor: UIView) {
let label0 = UILabel()
label0.font = .system... | 50.587786 | 210 | 0.52105 |
e5f81029387917e6559fdad70c1602717660bf10 | 1,216 | // Copyright © 2017 Oath. All rights reserved.
import UIKit
import OneMobileSDK
import PlayerControls
class ViewController: UIViewController {
@IBAction func playVideoTouched(_ sender: Any) {
OneSDK.Provider.default.getSDK()
.then { $0.getPlayer(videoID: "577cc23d50954952cc56bc47") }
... | 40.533333 | 100 | 0.54523 |
e0130548bac5e04f6eaa90c193d81ad01ce97db8 | 611 | //
// UIEdgeInsets.swift
// ARQuest
//
// Created by Anton Poltoratskyi on 30.04.2018.
// Copyright © 2018 Anton Poltoratskyi. All rights reserved.
//
import UIKit
extension UIEdgeInsets {
public var horizontal: CGFloat {
return left + right
}
public var vertical: CGFloat {
return top ... | 20.366667 | 61 | 0.594108 |
bfe8201b2fe8ceb4cde8390806b34fc2c63b8adc | 431 | //
// Copyright © 2021 Rosberry. All rights reserved.
//
public protocol HasGithubService {
var githubService: GithubService { get }
}
public protocol GithubService {
func getGitRepoPath(repo: String) throws -> String
func downloadFiles(at repo: String, filesHandler: ([FileInfo]) throws -> Void) throws
... | 25.352941 | 89 | 0.721578 |
cc9d21f42928dbaaedb034d8aefc22b99ea6098f | 5,035 | /// Test the generated private textual module interfaces and that the public
/// one doesn't leak SPI decls and info.
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module %S/Inputs/spi_helper.swift -module-name SPIHelper -emit-module-path %t/SPIHelper.swiftmodule -swift-version 5 -enable-library-ev... | 44.955357 | 325 | 0.769017 |
e80c84f666623992053b009236de120f32787ee8 | 3,931 | // REQUIRES: objc_interop
// RUN: rm -rf %t
// RUN: mkdir -p %t
// FIXME: BEGIN -enable-source-import hackaround
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/ObjectiveC.swift
// RUN: %target-swift-frontend(mock-... | 83.638298 | 354 | 0.736708 |
9b954132d2ed616fc45a18164d133521aafd0acf | 432 | import Foundation
import MealPorts
internal class MockPrice : Price {
var students: Double?
var employees: Double?
var pupils: Double?
var others: Double?
internal init(students: Double? = nil, employees: Double? = nil, pupils: Double? = nil, others: Double? = nil) {
self.students ... | 25.411765 | 116 | 0.634259 |
1653c9ece50a5cd9d0d07b386f2b4fa7f38cf676 | 1,735 | //
// AvailableCardsViewModel.swift
// MercadoPagoSDK
//
// Created by Eden Torres on 29/11/2018.
//
import Foundation
internal class AvailableCardsViewModel {
let MARGIN_X_SCROLL_VIEW: CGFloat = 32
let MIN_HEIGHT_PERCENT: CGFloat = 0.73
let screenSize: CGRect
let screenHeight: CGFloat
let scr... | 36.914894 | 248 | 0.732565 |
0125b0a7bce80794489c32d5ab586542a748e021 | 3,365 | //
// ViewController.swift
// RandomUserGenerator
//
// Created by Wilson Ding on 10/10/16.
// Copyright © 2016 Wilson Ding. All rights reserved.
//
import UIKit
import RandomUserSwift
class ViewController: UIViewController {
var randomUser: RandomUser! = RandomUser()
@IBOutlet weak var thumbnailIma... | 37.388889 | 189 | 0.60416 |
8f289d04c4d58f1f575a19a6cee17780f397d701 | 792 | //
// CoChannelReceiverProtocol.swift
// SwiftCoroutine
//
// Created by Alex Belozierov on 11.05.2020.
// Copyright © 2020 Alex Belozierov. All rights reserved.
//
internal protocol CoChannelReceiverProtocol {
associatedtype Output
func awaitReceive() throws -> Output
func poll() -> Output?
f... | 28.285714 | 84 | 0.693182 |
643be5c22b65e78e2ee654b1a3d8d8cb333b7638 | 6,041 | //
// Codable-DefaultValue.swift
// Enhancement
//
// Created by Weiwenshe on 2018/8/30.
// Copyright © 2018 com.weiwenshe. All rights reserved.
//
import Foundation
// MARK: - 参考https://github.com/Pircate/CleanJSON, 使用 Codable 协议时, json 中不存在该key-value时, 可以提供初始值, 而不是自己实现协议
public extension KeyedDecodingContaine... | 37.521739 | 127 | 0.607681 |
162f031e679081fe80d3a216599e05ff2d8eaf22 | 179 | import XCTest
#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
return [
testCase(MovieFrameTests.allTests)
]
}
#endif
| 17.9 | 49 | 0.603352 |
f9da7be205e676b6c4cf896cbb457c554119a76e | 4,935 | /* The MIT License
*
* Copyright (c) 2017 NBCO Yandex.Money 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,... | 33.344595 | 91 | 0.638298 |
16351cb6f9930c6df6131af02d8d340710f4a8c9 | 278 | //
// kampanya.swift
// JSON-Example
//
// Created by Caner Uçar on 14.09.2018.
// Copyright © 2018 Caner Uçar. All rights reserved.
//
import Foundation
struct Kampanya:Codable{
var baslik:String?
var icerik:String?
var tarih:String?
var resim:String?
}
| 15.444444 | 53 | 0.669065 |
de2dd170278768cb0355ab055a6a9afc1dca2328 | 1,443 | //
// Example5ViewController.swift
// StellarDemo
//
// Created by AugustRush on 6/1/16.
// Copyright © 2016 August. All rights reserved.
//
import UIKit
class Example5ViewController: UIViewController {
@IBOutlet weak var cyanView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
... | 28.294118 | 79 | 0.534997 |
d5eab7a5911037e684e70c966ce1b69f2d645c76 | 1,265 | //
// VDLBinaryExpressionsAPITests
// MockDummyOperand.swift
//
//
// Created by Valeriano Della Longa on 20/02/2020.
// Copyright (c) 2020 Valeriano Della Longa
//
import Foundation
import VDLBinaryExpressionsAPI
enum MockDummyOperand {
case dummy
enum Error: Swift.Error
{
case mapOper... | 21.810345 | 65 | 0.638735 |
ac337f20bacc53af68ea7f9a8dca7224cbe26b5b | 219 | import Foundation
final class RecursiveLock {
private let lock = NSRecursiveLock()
func sync<T>(function: () -> T) -> T {
lock.lock()
defer { lock.unlock() }
return function()
}
}
| 16.846154 | 42 | 0.56621 |
d618d2a72a97601dedebeae5b39c4de82cf251bd | 4,384 | //
// UnderlinedTextView.swift
// StatusApp
//
// Created by Massimiliano Bigatti on 26/09/14.
// Copyright (c) 2014 Massimiliano Bigatti. All rights reserved.
//
import UIKit
import QuartzCore
/**
Controls that embeds an UITextView and supports highlighting and auto-growth
*/
class UnderlinedTextView : UICo... | 28.653595 | 126 | 0.630018 |
39ec3dfb4eee13f5630b660921aa47192c02262b | 1,482 | //
// Solution.swift
// Problem 33
//
// Created by sebastien FOCK CHOW THO on 2019-06-27.
// Copyright © 2019 sebastien FOCK CHOW THO. All rights reserved.
//
import Foundation
extension Array where Element == Int {
func binarySearchInsertIndex(_ element: Int) -> Int {
var leftBoundary = 0
v... | 27.444444 | 114 | 0.518893 |
91692e32b0c32a8999f7801971ba7f3446ae6018 | 9,963 | //
// EFIconFontWeatherIcons.swift
// EFIconFont
//
// Created by EyreFree on 2019/3/20.
//
// Copyright (c) 2019 EyreFree <eyrefree@eyrefree.org>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// ... | 37.037175 | 81 | 0.649905 |
01b09e31f5a646e5292c682722d9460d11658b80 | 4,041 | //
// Notification.swift
// PeoplePortal
//
// Created by Anastasis Germanidis on 10/11/15.
// Copyright (c) 2015 Anastasis Germanidis. All rights reserved.
//
import UIKit
class Notification: Comparable {
var type : Int?
var users : [User]?
var tweet : Tweet?
var otherTweets: [Tweet]?
var... | 33.675 | 101 | 0.571393 |
906c10534231ba15be677f6f3d88303ac2398962 | 4,962 | //
// SwipeableStackView.swift
// Swipeable-View-Stack
//
// Created by Phill Farrugia on 10/21/17.
// Copyright © 2017 Phill Farrugia. All rights reserved.
//
import UIKit
class SwipeableCardViewContainer: UIView, SwipeableViewDelegate {
static let horizontalInset: CGFloat = 12.0
static let verticalIns... | 30.819876 | 105 | 0.635631 |
9cc0b83aa47ab1cd9b9465a4a0297cf2c1faff5f | 823 | //
// MainWindowModel.swift
// Postgres
//
// Created by Chris on 17/08/2016.
// Copyright © 2016 postgresapp. All rights reserved.
//
import Cocoa
class MainWindowModel: NSObject {
@objc dynamic var serverManager = ServerManager.shared
@objc dynamic var selectedServerIndices = IndexSet()
var firstSelectedSe... | 22.243243 | 68 | 0.735115 |
4833a1e63849038c427feeeb4579b9eb2fda925a | 2,154 | //
// ViewController.swift
// ChatClient
//
// Created by Anisha Jain on 4/12/17.
// Copyright © 2017 Anisha Jain. All rights reserved.
//
import UIKit
import Parse
class ViewController: UIViewController {
@IBOutlet weak var emailText: UITextField!
@IBOutlet weak var passwordText: UITextField!
o... | 29.108108 | 110 | 0.571959 |
fbff597c6226e1f57e21f5c7e09da18797a46903 | 636 | import XCTest
@testable import Puzzles
class SetAndForgetTest: XCTestCase {
func testPartOne() {
let scanner = SingleValueScanner<Int>(testCaseName: "17", separator: CharacterSet(charactersIn: ","))
let program = scanner.parse()
let sut = SetAndForget()
XCTAssertEqual(sut.solvePart... | 31.8 | 109 | 0.668239 |
11be1866dd5791019ee3e4d86b842ed8488e27e9 | 2,593 | /*
OSCDispatcher.swift
Koboshi
MIT LICENSE
Copyright 2018 nariakiiwatani
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, co... | 36.013889 | 460 | 0.767065 |
e2e25c474e8ec5448d205a7cd927b375fbdb7d40 | 2,111 | //
// AppDelegate.swift
// My App
//
// Created by Guanming Qiao on 6/15/17.
// Copyright © 2017 Guanming Qiao. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunc... | 44.914894 | 281 | 0.776883 |
ed6274dac00dfbe106b9e1ccd355663dc865a2e3 | 1,758 | //
// LoginRouter.swift
// Viper
//
// Created by Shridhar Mali on 7/7/17.
// Copyright (c) 2017 Shridhar Mali. All rights reserved.
//
// This file was generated by the Clean Swift Xcode Templates so
// you can apply clean architecture to your iOS and Mac projects,
// see http://clean-swift.com
//
import UIKit... | 28.819672 | 135 | 0.719568 |
f91040576b576a9b1d6ef2d9ad1f2bf7e6c0676d | 1,742 | //
// LibraryAPI.swift
// PokedexGo
//
// Created by Yi Gu on 7/10/16.
// Copyright © 2016 yigu. All rights reserved.
//
import UIKit
class LibraryAPI: NSObject {
static let sharedInstance = LibraryAPI()
let persistencyManager = PersistencyManager()
private override init() {
super.init()
Not... | 28.557377 | 118 | 0.654994 |
d5a09d92d896a5285f7f1e64a01301552b291d02 | 7,539 | //
// PhotoPreviewSelectedView.swift
// HXPHPickerExample
//
// Created by Slience on 2020/12/29.
// Copyright © 2020 Silence. All rights reserved.
//
import UIKit
protocol PhotoPreviewSelectedViewDelegate: AnyObject {
func selectedView(_ selectedView: PhotoPreviewSelectedView, didSelectItemAt photoAsset: Pho... | 36.597087 | 117 | 0.629924 |
ac8e94d96e43ca1f203461782b4754f7aa104277 | 508 | //
// Photos Plus, https://github.com/LibraryLoupe/PhotosPlus
//
// Copyright (c) 2016-2017 Matt Klosterman and contributors. All rights reserved.
//
import Foundation
extension Cameras.Manufacturers.Minolta {
public struct DiMAGEA1: CameraModel {
public init() {}
public let name = "Minolta DiMA... | 28.222222 | 97 | 0.73622 |
5d016edf547dce97527047e1fecc62ba0b8e0c17 | 1,041 | import Foundation
#if canImport(MapboxMaps)
@testable import MapboxMaps
#else
import MapboxMapsFoundation
@testable import MapboxMapsGestures
#endif
final class MockCameraManager: CameraManagerProtocol {
var mapView: BaseMapView?
var mapCameraOptions = MapCameraOptions()
struct SetCameraParameters {
... | 27.394737 | 70 | 0.603266 |
9babc74b11ebc4745a1b3193dfc5209d173dc32e | 1,042 | //
// StatisticsUiStateView.swift
// TodoApp
//
// Created by Shinya Kumagai on 2020/12/09.
//
import SwiftUI
struct StatisticsUiStateView: View {
let uiState: StatisticsUiState
var body: some View {
VStack(spacing: 24) {
VStack(spacing: 8) {
Text(L10n.Statistics.active... | 22.652174 | 56 | 0.492322 |
1e43469e82b9e5bf727c6d548f4b904689307702 | 3,666 | //
// EitherCollection.swift
// SwiftSpellBook
//
// Created by Braden Scothern on 10/30/20.
// Copyright © 2020-2021 Braden Scothern. All rights reserved.
//
public typealias EitherMutableCollection<Left, Right> = EitherCollection<Left, Right> where Left: MutableCollection, Right: MutableCollection, Left.Element ... | 46.405063 | 172 | 0.580196 |
8957a23f07102fe589cf4fb657d7abe4490c78ee | 441 | protocol ITransactionInfoView: class {
func showCopied()
}
protocol ITransactionInfoViewDelegate: class {
func onCopy(value: String)
func openFullInfo(coinCode: CoinCode, transactionHash: String)
}
protocol ITransactionInfoInteractor {
func onCopy(value: String)
}
protocol ITransactionInfoInteractorD... | 22.05 | 66 | 0.782313 |
62759d8f5d50122937930a2886bfefd725607a8b | 6,215 | //
// VideoSessionController.swift
// camRAWR
//
// Created by Daniel Love on 05/10/2015.
// Copyright © 2015 Shh Love Limited. All rights reserved.
//
import AVFoundation
enum VideoSessionPermission
{
case Requestable
case RestrictedByParent
case Denied
case Granted
}
class VideoSessionController : NSObject... | 24.277344 | 160 | 0.739019 |
9b53bd9d86f1c1835b2542d0f827cf9c2d01c959 | 584 | //
// iPhoneToggleButton.swift
// AudioKitSynthOne
//
// Created by Matthew Fecher on 1/8/19.
// Copyright © 2019 AudioKit. All rights reserved.
//
@IBDesignable
class iPhoneToggleButton: ToggleButton {
@IBInspectable open var buttonText: String = "Hello"
@IBInspectable open var textSize: Int = 1... | 27.809524 | 199 | 0.700342 |
1804c969dfeb0b7a2fb4ce5ee7712500f0a030f2 | 2,095 | // RUN: %target-swift-emit-silgen -enable-sil-ownership -enforce-exclusivity=checked %s | %FileCheck %s
class C {}
struct A {}
struct B { var owner: C }
var a = A()
// CHECK-LABEL: sil @main : $@convention(c) (Int32, UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>) -> Int32 {
// CHECK: assign {{%.*}} to ... | 38.796296 | 122 | 0.595227 |
4ad0f831d02d4022346b101f66ac48ad193663c2 | 2,925 | //: [Previous](@previous)
import Foundation
// Build order
// Given a list of projects, with their dependencies in pair (A, B) where B depends of A
// Print a build order
// Input
// project list: a, b ,c, d , e, f
// project dep (a,d), (f,b), (b,d ), (f, a), (d, c)
// output: f, e, a, b, d, c
// where: e does not m... | 22.328244 | 88 | 0.571966 |
d973b4fd60d004786269f60110a3eec566a279b7 | 1,392 | //
// SCBreedDataItem.swift
// MyCatInfo
//
// Created by Stephen Cao on 3/8/19.
// Copyright © 2019 Stephen Cao. All rights reserved.
//
import Foundation
struct SCBreedData: Codable{
let breeds: [SCBreedDataItem]?
let id: String?
let url: String?
let width: Int?
let height: Int?
}
struct SCBr... | 23.2 | 54 | 0.668103 |
461b5147c2467da4e8ed80c473a5a8151fabdce5 | 3,424 | //
// Client.swift
// network
//
// Created by Guilherme Ramos on 03/04/20.
// Copyright © 2020 Guilherme Ramos. All rights reserved.
//
import Foundation
struct NetworkClient {
typealias RequestHandler<T: Decodable> = (_ result: Result<T, NetworkError>) -> Void
static let shared = NetworkClient()
... | 36.817204 | 152 | 0.599883 |
288da3cfc3bc51ccbcc1a7fe1fb9e7f8037a156a | 1,038 | //
// SessionDataManager.swift
// AV TEST AID
//
// Created by Juan Pablo Mazza on 11/8/16.
// Copyright © 2016 Rootstrap. All rights reserved.
//
import UIKit
class SessionManager: NSObject {
static var currentSession: Session? {
get {
if let data = UserDefaults.standard.data(forKey: "AV... | 24.714286 | 152 | 0.599229 |
14ea9c8ff0e989a5e3c502ed13e5078604798684 | 8,533 | //
// UICheckoutRecipientView.swift
// PatissierStore
//
// Created by Roy Hsu on 09/07/2017.
// Copyright © 2017 TinyWorld. All rights reserved.
//
// MARK: - UICheckoutRecipientView
public final class UICheckoutRecipientView: UIView, Actionable {
@IBOutlet
private final weak var firstNameLabel: UILabel... | 23.378082 | 93 | 0.594515 |
71c48b707456902684aaaf9214768e95a22c481e | 10,471 | //
// GameScene.swift
// DoubleTap
//
// Created by Nikolaos Kechagias on 19/08/15.
// Copyright (c) 2015 Nikolaos Kechagias. All rights reserved.
//
import SpriteKit
class GameScene: SKScene {
/* 1 */
let soundMessage = SKAction.playSoundFileNamed("Message.m4a", waitForCompletion: false)
let soundMat... | 28.925414 | 112 | 0.50148 |
28ce49f7cb4bab12d5acc933044a68f0a4521f21 | 743 | import UIKit
/*
1. 정수 하나를 입력받은 뒤, 해당 숫자와 숫자 1사이에 있는 모든 정수의 합계 구하기
e.g. 5 -> 1 + 2 + 3 + 4 + 5 = 15, -2 -> -2 + -1 + 0 + 1 = -2
*/
class Add {
let num: Int
var sum = 0
init(_ number: Int) {
self.num = number
addition()
}
func addition() {
if num < 1 {
... | 16.886364 | 64 | 0.333782 |
fbcd7c7fd5f745c5cac04b08435bf376afdc26e2 | 1,659 | import Foundation
/// A Nimble matcher that succeeds when the actual value is less than the expected value.
public func beLessThan<T: Comparable>(_ expectedValue: T?) -> NonNilMatcherFunc<T> {
return NonNilMatcherFunc { actualExpression, failureMessage in
failureMessage.postfixMessage = "be less than <\(st... | 39.5 | 120 | 0.712477 |
1a5d119adc2628674fad875b96f1daadd56c45f8 | 1,534 | //
// CustomTabbarVC.swift
// Travel-IT
//
// Created by Ankit Singh on 22/03/18.
// Copyright © 2018 Ankit Singh. All rights reserved.
//
import UIKit
class CustomTabbarVC: UITabBarController, UITabBarControllerDelegate {
var previousSelectedIndex : Int?
var selectedTabUnderline : UIView?
o... | 29.5 | 77 | 0.645372 |
67b3f95146bec404795ce90f78aca6c5a45c7c01 | 1,979 | //
// Copyright (c) 2017 Google Inc.
//
// 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 agre... | 30.921875 | 106 | 0.686205 |
e8b2e6bf3d4c372ab17dff72ff9586e4c177d6b0 | 4,217 | //
// TableViewController.swift
// Notebook with firebase
//
// Created by Mads Bryde on 26/06/2020.
// Copyright © 2020 Mads Bryde. All rights reserved.
//
import UIKit
class TableViewController: UITableViewController {
var currentNote:Note?
override func viewDidLoad() {
super.viewDidLoad()
... | 38.688073 | 145 | 0.664216 |
db9f83170d59f7df596202a22cea1cfdd7fbaa5f | 246 | //
// IntervalEventProtocol.swift
// ConflictingAppointments
//
// Created by Rudy Gomez on 3/20/20.
// Copyright © 2020 JRudy Gaming. All rights reserved.
//
import Foundation
protocol IntervalProtocol {
var interval: Interval { get }
}
| 17.571429 | 55 | 0.719512 |
286c84ed8459fd0c45c2ed36c22c089d280bf617 | 1,975 | //
// LoggedOutInteractor.swift
// TicTacToe
//
// Created by Dinh, Nhat on 2019/03/11.
// Copyright © 2019 Uber. All rights reserved.
//
import RIBs
import RxSwift
protocol LoggedOutRouting: ViewableRouting {
// TODO: Declare methods the interactor can invoke to manage sub-tree via the router.
}
protocol Lo... | 30.859375 | 131 | 0.696709 |
7a37ff84ccb5a6bada80e9598501e29498944a52 | 1,472 | /*
* Copyright (c) 2019 Telekom Deutschland AG
*
* 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 agre... | 39.783784 | 119 | 0.72894 |
5dac6af9f1805f075f1703c0517cbe1464764d85 | 697 | //
// MobileWalletUITests.swift
// MobileWalletUITests
//
// Created by Jason van den Berg on 2019/10/28.
// Copyright © 2019 Jason van den Berg. All rights reserved.
//
import XCTest
class MobileWalletUITests: XCTestCase {
private let app = XCUIApplication()
override func setUp() {
continueA... | 22.483871 | 73 | 0.605452 |
729911c5263fbfc3398811c7f3d3471604fb8348 | 339 | //
// Category.swift
// App
//
// Created by Denis Zubkov on 05/08/2019.
//
import Fluent
import FluentMySQL
import Vapor
struct Category: Content {
var id: UUID?
var guid: String
var dataVersion: String
var name: String
var short: String
}
extension Category: MySQLUUIDModel {}
extension Categ... | 14.73913 | 42 | 0.687316 |
398cb0f9b38d46070dcd83b5ff53b5654b4750c4 | 543 | //
// PhotoCell.swift
// WK1LB1
//
// Created by Pedro Daniel Sanchez on 9/10/18.
// Copyright © 2018 Pedro Daniel Sanchez. All rights reserved.
//
import UIKit
class PhotoCell: UITableViewCell {
@IBOutlet weak var photoImage: UIImageView!
override func awakeFromNib() {
super.awakeFromNib()
... | 20.111111 | 65 | 0.662983 |
8f6c674c7e3e493f2ba32ca15db2dd80a9920e3b | 531 | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OriginPropertiesParametersProtocol is the JSON object that contains the pr... | 44.25 | 101 | 0.740113 |
3a44b87536b921b45efb8783456077c0c6740f11 | 6,778 | //
// ObserveOn.swift
// RxSwift
//
// Created by Krunoslav Zaher on 7/25/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
extension ObservableType {
/**
Wraps the source sequence in order to run its observer callbacks on the specified scheduler.
This only invokes observer callbacks... | 29.215517 | 138 | 0.62216 |
9b98daa063125c46fff9423c6e34dcc65eb11110 | 1,401 | // *******************************************
// File Name: DispatchQueue+BQextension.swift
// Author: MrBai
// Created Date: 2019/8/15 9:26 AM
//
// Copyright © 2019 baiqiang
// All rights reserved
// *******************************************
import Foundation
typealias TaskBlock = (_ cancel: ... | 26.433962 | 94 | 0.523198 |
e4f49039b10834db36a39fb27b521abafc2aa802 | 551 | import Foundation
import WatchKit
class InterfaceController: WKInterfaceController {
override func awake(withContext context: Any?) {
super.awake(withContext: context)
// Configure interface objects here.
}
override func willActivate() {
// This method is called when watch view co... | 26.238095 | 90 | 0.684211 |
481249126f952b228b9e0b93865fe4ff78728d09 | 921 | //
// PickerViewDemoTests.swift
// PickerViewDemoTests
//
// Created by K.Yawn Xoan on 3/20/15.
// Copyright (c) 2015 K.Yawn Xoan. All rights reserved.
//
import UIKit
import XCTest
class PickerViewDemoTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This ... | 24.891892 | 111 | 0.619978 |
33e77c8653be47fc2ec70154172d7e1006caa0f9 | 27,493 | import Foundation
import CoreLocation
import MapboxDirections
import Polyline
import MapboxMobileEvents
import Turf
protocol RouteControllerDataSource: AnyObject {
var location: CLLocation? { get }
var locationProvider: NavigationLocationManager.Type { get }
}
@available(*, deprecated, renamed: "RouteControll... | 46.677419 | 272 | 0.691558 |
461c37d77419d612b4311d3b062a37f749366030 | 2,497 | //
// This object stays in memory runtime and holds key data and operations on Schedules.
// The obect is the model for the Schedules but also acts as Controller when
// the ViewControllers reads or updates data.
//
// Created by Thomas Evensen on 09/05/16.
// Copyright © 2016 Thomas Evensen. All rights reserved.
... | 39.634921 | 104 | 0.614337 |
676ec637a470334d96fff99ce0c0f2e91efc590e | 5,468 | //
// FiatServiceTest.swift
// XWalletTests
//
// Created by loj on 11.03.18.
//
import XCTest
import iVault
class FiatServiceTest: XCTestCase {
private var testee: FiatService!
private var fiatProviderMock: FiatProviderMock!
private var dateProviderMock: DateProviderMock!
private var property... | 33.546012 | 123 | 0.622714 |
39f982f92d877e346c8e9d3e55e1c912de107784 | 4,322 | //
// ServiceGenerationTests.swift
//
//
// Created by Dmitry Demyanov on 13.11.2020.
//
import XCTest
@testable import SurfGenKit
import PathKit
import Stencil
/// Tests for generating full service code from prepared GAST tree
class ServiceGenerationTests: XCTestCase {
let serviceGenerator = ServiceGenerato... | 43.22 | 118 | 0.583526 |
abe52ab76f146980fe4686e6d15e109861e12df9 | 713 | //
// RouteCollection\.swift
// SampleRoutingPackageDescription
//
// Created by satoutakeshi on 2017/10/09.
//
import Foundation
import Vapor
import HTTP
import Routing
public class V3Collection: RouteCollection, EmptyInitializable {
public required init() {}
public func build(_ builder: RouteBuilder) {
... | 25.464286 | 70 | 0.646564 |
1dbe6527ea89d651a8da8ae45730f126294b4636 | 1,127 | // Copyright © 2018 Refrakt <info@refrakt.org>
// All rights reserved.
//
// This source code is licensed under the BSD 3-Clause license found in the
// LICENSE file in the root directory of this source tree.
import UIKit
import WebKit
class WebViewController: UIViewController, WKUIDelegate, WKNavigationDelegate {
... | 28.175 | 107 | 0.63354 |
7a3a144240b02b8fdaa0550c5f019790dd520673 | 8,216 | //
// BuildableItem.swift
// SmartAILibrary
//
// Created by Michael Rommel on 05.02.20.
// Copyright © 2020 Michael Rommel. All rights reserved.
//
import Foundation
public enum BuildableItemType: Int, Codable {
case unit
case building
case wonder
case district
case project
}
public class B... | 27.295681 | 90 | 0.584713 |
1f03b98dc66064fba985746d6d62587eec835c5b | 2,176 | //
// AppDelegate.swift
// Flappy Felipe
//
// Created by Rudrank Riyam on 22/06/19.
// Copyright © 2019 Rudrank. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinis... | 46.297872 | 285 | 0.755055 |
fbf005bbc7feba237996b7c443254a585390a49f | 2,851 | //
// PJComposeToolBar.swift
// WeiBo
//
// Created by 潘金强 on 16/7/19.
// Copyright © 2016年 潘金强. All rights reserved.
//
import UIKit
enum composeToolBarButtonType :Int{
case Picture = 0
case Mention = 1
case Trend = 2
case Emotion = 3
case Add = 4
}
class PJComposeToolBar: UIStackV... | 24.577586 | 124 | 0.597685 |
e67a5180e269abe5f15cf9367f71ef589b5edd3c | 3,230 | //
// DetailView.swift
// Scrumdinger
//
// Created by Andrew Morgan on 22/12/2020.
//
import SwiftUI
struct DetailView: View {
@Binding var scrum: DailyScrum
@State private var data = DailyScrum.Data()
@State private var isPresented = false
var body: some View {
List {
Sec... | 37.126437 | 316 | 0.435913 |
dd642d9a4366795094780e5b90c9f8b903a3324f | 38,775 | // Foundation/URLSession/URLSessionTask.swift - URLSession API
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for lice... | 41.738428 | 182 | 0.62499 |
896f2a6b5f4fdebde19e77158e38946a9ce3a01d | 2,715 | // RUN: %target-swift-frontend -typecheck -verify -dump-ast -enable-resilience %s 2>&1 | %FileCheck --check-prefix=RESILIENCE-ON %s
// RUN: %target-swift-frontend -typecheck -verify -dump-ast -enable-resilience -enable-testing %s 2>&1 | %FileCheck --check-prefix=RESILIENCE-ON %s
// RUN: not %target-swift-frontend -type... | 41.136364 | 151 | 0.765746 |
21d848020adb98738853b5c81cb8db9cc6885f07 | 530 | import Foundation
import SwiftClient
/// AuthenticationError error.
open class AuthenticationError: UpholdClientError {
/**
Constructor.
- parameter code: The HTTP status code.
- parameter message: The error message being shown to the user.
- parameter response: The HTTP response.
*/
... | 25.238095 | 70 | 0.673585 |
71a861efa4ab13027b7b408076cb831c0afe7197 | 6,269 | //
// Copyright © 2017 Jan Gorman. All rights reserved.
//
import UIKit
public enum CacheType {
case none, memory, disk
}
/// The class responsible for caching images. Images will be cached both in memory and on disk.
public final class Cache {
private static let prefix = "com.schnaub.Cache."
/// The defa... | 37.993939 | 141 | 0.68097 |
fb39d6542ea91915d986cfb7f936a35b9fa98a54 | 432 | //
// level6.swift
// baekjun-star
//
// Created by SwiftMan on 2021/09/06.
//
import Foundation
/*
첫째 줄에는 별 2×N-1개, 둘째 줄에는 별 2×N-3개, ..., N번째 줄에는 별 1개를 찍는 문제
별은 가운데를 기준으로 대칭이어야 한다.
*********
*******
*****
***
*
*/
func level6() {
let num = Int(readLine()!)!
var j = num * 2 - 1
for i in... | 15.428571 | 78 | 0.490741 |
75d52e812f8b1a7ee5b1f0f3efbeda4fa37b5288 | 581 | //
// ViewPrintable.swift
// UnitHelper
//
// Created by tsuf on 2019/9/17.
// Copyright © 2019 upmer. All rights reserved.
//
import UIKit
protocol ViewPrintable {
func treeDescription(_ level: Int) -> String
}
extension UIView: ViewPrintable {
func treeDescription(_ level: Int = 0) -> String {
var res ... | 18.741935 | 52 | 0.607573 |
69ac63e2684fafab14b5d6c2a7cd7b531b7ff558 | 1,976 | //
// MaskViewVC.swift
// UIScrollViewDemo
//
// Created by xiAo_Ju on 2018/10/27.
// Copyright © 2018 伯驹 黄. All rights reserved.
//
import UIKit
class MaskViewVC: UIViewController {
private lazy var maskView: MaskView = {
var rect = self.view.bounds
rect.size.height = 400
let mas... | 38.745098 | 179 | 0.652328 |
75c63e2f672ee92a66e0d1a5ad47e8301dfbac06 | 143 | import Foundation
extension Date {
func toString() -> String {
return CoreLogger.dateFormatter.string(from: self as Date)
}
}
| 17.875 | 66 | 0.671329 |
22b9cd50756ab124eca7f5f49ece8ef41418b694 | 1,105 | //
// PBHexTest.swift
// PBKit
//
// Created by pebble8888 on 2017/06/10.
// Copyright © 2017年 pebble8888. All rights reserved.
//
import XCTest
import PBKit
class PBHexTest: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invoca... | 25.113636 | 111 | 0.6 |
cc907776999bd98d9338e39bec330de820096718 | 600 | //
// CityNameView.swift
// WeatherApp
//
// Created by Gourav on 14/02/21.
//
import SwiftUI
struct CityNameView: View {
var city:String
var date:String
var body: some View {
HStack{
VStack(alignment: .center, spacing: 10, content: {
Text(city)
.... | 19.354839 | 62 | 0.52 |
f7bbb18cb24005ed1e8721ddcb5d902f46037148 | 1,565 | //
// TreeHeightofaBinaryTree.swift
// HackerRank
//
// Created by Fabrizio Duroni on 13/12/2016.
//
// https://www.hackerrank.com/challenges/tree-height-of-a-binary-tree
import Foundation
class Node {
var data: Int
var left: Node?
var right: Node?
init(d : Int) {
data ... | 19.085366 | 70 | 0.497764 |
72a3a7de5bef333b4c358dbb07e55da6b9b70ccb | 7,111 | //
// ViewController.swift
// WebRTC
//
// Created by Stasel on 20/05/2018.
// Copyright © 2018 Stasel. All rights reserved.
//
import UIKit
import AVFoundation
import WebRTC
class MainViewController: UIViewController {
deinit {
print("MainViewController 🔥")
}
private let signalClient = SignalingClient.... | 27.35 | 106 | 0.715089 |
610b24ab7e23f99131765e6efc5b494a67dbb026 | 3,315 | //
// SceneDelegate.swift
// Bookworm10
//
// Created by Viettasc on 2/1/20.
// Copyright © 2020 Viettasc. All rights reserved.
//
import UIKit
import SwiftUI
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSessi... | 46.041667 | 147 | 0.714329 |
fb4b00f6fc516d215dc4019c84e1f856656a84a9 | 19,665 | //
// Extensions.swift
// MozoSDK
//
// Created by Hoang Nguyen on 8/28/18.
// Copyright © 2018 Hoang Nguyen. All rights reserved.
//
import Foundation
import UIKit
public extension Bool {
var toString: String {
let value = self
return "\(value)"
}
}
public extension String {
func asM... | 38.03675 | 232 | 0.615713 |
6a7fc7c506bf32a31a25000a82ec3ea36ae97952 | 1,239 | //
// StringExtension.swift
// Pods-SwiftyOptional_Example
//
// Created by Elsayed Hussein on 11/8/18.
//
import Foundation
extension Optional where Wrapped == String {
//MARK: Unwrapping
public var swiftyValue: String {
return self ?? ""
}
public func swiftyDefault(value: String... | 23.826923 | 56 | 0.614205 |
ed3325257114f95c2d4bc9d7b0dd8489e3021fb9 | 8,395 | /*
Copyright (c) 2019, Apple Inc. 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 conditions and the follow... | 53.814103 | 128 | 0.625372 |
e4f5dc7c17f2d130d13c0ea8203dd767f1d9495d | 14,521 | //
// FeaturedPackageView.swift
// Sileo
//
// Created by CoolStar on 7/6/19.
// Copyright © 2019 Sileo Team. All rights reserved.
//
import UIKit
import Evander
class FeaturedPackageView: FeaturedBaseView, PackageQueueButtonDataProvider {
let imageView: PackageIconView
let titleLabel, authorLabel, versio... | 43.346269 | 204 | 0.621927 |
9b3e180cdfdecdc9548c7d41051a917ce4d936ba | 427 | // 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/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the li... | 42.7 | 79 | 0.749415 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.