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 |
|---|---|---|---|---|---|
2fd0f3906db69aab26a29f53d1d0abbfa7632c7d | 360 | //
// Empty.swift
// BaseUI
//
// Copyright © 2020 E-SOFT, OOO. All rights reserved.
//
import XCTest
final class BaseUITests: XCTestCase {
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct resu... | 18.947368 | 96 | 0.641667 |
6180196fe1b51149c2484cbc7b4a45e9e9d68e55 | 2,778 | // RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Character
// RUN: %target-codesign %t/reflect_Character
// RUN: %target-run %target-swift-reflection-test %t/reflect_Character | %FileCheck %s --check-prefix=CHECK-%target-ptrsize %add_num_extra_inhabitants
// REQUIRE... | 45.540984 | 156 | 0.706983 |
915713b5c2f273688ddf5f2fdafc86048717b7b7 | 1,025 | // swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "{PROJECT}",
products: [
// Products define the executables and libraries produced by a package, and make them visible to o... | 35.344828 | 122 | 0.60878 |
69af03da82635488df9ea55546e391debed63a0a | 5,886 | //
// Calculate.swift
// News
//
// Created by 杨蒙 on 2017/12/10.
// Copyright © 2017年 hrscy. All rights reserved.
//
import UIKit
protocol Calculatable {
// MARK: 计算宽度
static func collectionViewWidth(_ count: Int) -> CGFloat
// MARK: 计算高度
static func collectionViewHeight(_ count: Int) -> CGFloat
... | 35.672727 | 209 | 0.599218 |
14883300cd75c720e1c0010c0531f92fefd03acb | 4,418 | //
// DataManager.swift
// insulin_calculator
//
// Created by 李灿晨 on 10/11/19.
// Copyright © 2019 李灿晨. All rights reserved.
//
import UIKit
import CoreData
class DataManager: NSObject {
/**
The shared instance of object `DataManager`.
*/
static var shared: DataManager = DataManager()
... | 32.485294 | 121 | 0.628112 |
22306d2541c1481b44bff9870cbb0dc98f0f7168 | 1,141 | // swift-tools-version:5.1
// We're hiding dev, test, and danger dependencies with // dev to make sure they're not fetched by users of this package.
import PackageDescription
let package = Package(
name: "UINotifications",
platforms: [
.iOS(.v13)
],
products: [
// dev .library(name: "Da... | 43.884615 | 187 | 0.650307 |
ab7e5b4e8dc4311d717796b8ca6d9185d3012ac3 | 1,512 | //
// ContactEntity+CoreDataProperties.swift
// iOS_Example
//
// Created by Seyed Samad Gholamzadeh on 9/15/18.
// Copyright © 2018 Seyed Samad Gholamzadeh. All rights reserved.
//
//
import Foundation
import CoreData
import ModelAssistant
extension ContactEntity: MAEntity {
@nonobjc public class func fetch... | 23.625 | 108 | 0.70172 |
1e4394ba25f593496349495754d31f71b5de5f7c | 10,304 | //
// CFAlertActionSheetInteractiveTransition.swift
// CFAlertViewControllerDemo
//
// Created by Shivam Bhalla on 1/20/17.
// Copyright © 2017 Codigami Inc. All rights reserved.
//
import UIKit
class CFAlertActionSheetInteractiveTransition: CFAlertBaseInteractiveTransition {
// MARK: - Initialisation Me... | 44.413793 | 199 | 0.586471 |
03929c4672e93fae63b89d4bb9df6ec837373bda | 505 | // 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 https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the li... | 22.954545 | 79 | 0.673267 |
26751a8c8513770aaa918f1216006cc527ad9a62 | 647 | //
// ElementInteraction.swift
// Skylark
//
// Created by Ross Butler on 3/3/19.
//
import Foundation
struct ElementInteraction: Codable {
typealias InteractionType = ElementInteractionType
let action: InteractionType
let element: Element.Identifier
init(action: InteractionType, ele... | 22.310345 | 87 | 0.680062 |
50d8a2fc3f2fd6cc1d59b8760cba00b0a3831722 | 403 | //: [< Sommaire](Sommaire)
/*:
# Gestion des erreurs
---
### Maxime Britto - Swift 4
*/
import Foundation
let url = URL(string: "http://www.addpple.fr")!
if let contenuHTML = try? String(contentsOf: url) {
print(contenuHTML)
}
do {
let contenuHTML = try String(contentsOf:url)
print(contenuHTML)
} cat... | 13.433333 | 51 | 0.630273 |
26e1f4b50b3c02d69109de63f7d4e7edc6e05b81 | 3,558 | /*
* Copyright IBM Corp. 2017
*
* 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 wri... | 35.58 | 111 | 0.606521 |
f5b94faec1926967715d018f43babc8711d49ed5 | 1,110 | //
// FooterKey.swift
// Refresh
//
// Created by Gesen on 2020/3/22.
// https://github.com/wxxsw/Refresh
import SwiftUI
@available(iOS 13.0, *)
extension EnvironmentValues {
var refreshFooterUpdate: Refresh.FooterUpdateKey.Value {
get { self[Refresh.FooterUpdateKey.self] }
set { self[Refresh.... | 21.764706 | 68 | 0.646847 |
d6e47792624b41a6ddbc297ab7246bc5472f8fe5 | 1,568 | //
// KeychainCreator.swift
// StandUp-iOS
//
// Created by Peter on 12/01/19.
// Copyright © 2019 BlockchainCommons. All rights reserved.
//
import Foundation
import LibWally
class KeychainCreator {
func createKeyChain(completion: @escaping ((mnemonic: String?, error: Bool)) -> Void) {
... | 28 | 101 | 0.453444 |
265d273818d4e10279575e5e8ca51fc4a1559278 | 10,218 | //
// MultiLineChartData.swift
//
//
// Created by Will Dale on 24/01/2021.
//
import SwiftUI
import Combine
/**
Data for drawing and styling a multi line, line chart.
This model contains all the data and styling information for a single line, line chart.
*/
public final class MultiLineChartData: CTLineChart... | 46.445455 | 175 | 0.56146 |
67f7db629e55b7ce5e763ede0e1647ec1d05c1de | 3,929 | //
// Todo+Networking.swift
// grokRouter
//
// Created by Christina Moulton on 2018-03-28.
// Copyright © 2018 Christina Moulton. All rights reserved.
//
import Foundation
import Alamofire
enum BackendError: Error {
case parsing(reason: String)
case urlError(reason: String)
}
struct CreateTodoResult: Codabl... | 30.937008 | 98 | 0.63044 |
03408dff7c805aa70359d4b92292a55ef33b58e5 | 3,011 | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | 46.323077 | 147 | 0.726005 |
7247a6a6c585ac9f9b43a94ecead34c39d56bf32 | 240 | //
// DetailsRouterInput.swift
// SwinjectDependencyInjection
//
// Created by Igor Kotkovets on 12/24/16.
// Copyright © 2016 Igor Kotkovets. All rights reserved.
//
import Foundation
protocol DetailsRouterInput {
func close()
}
| 17.142857 | 57 | 0.725 |
5baa5b1a34c8cd7b87848aa9ef82dc8a7ced96cd | 204 | //
// Clock.swift
// VIPER-SWIFT
//
// Created by Conrad Stoll on 6/4/14.
// Copyright (c) 2014 Mutual Mobile. All rights reserved.
//
import Foundation
protocol Clock {
func today() -> NSDate
} | 15.692308 | 58 | 0.651961 |
3963ce7399893e5dbe9efecb878f81b78034e227 | 4,708 | //
// MainViewController.swift
// DaangnMarketStyleApp
//
// Created by 윤병일 on 2021/12/23.
//
import UIKit
import RxSwift
import RxCocoa
import SnapKit
class MainViewController : UIViewController {
//MARK: - Properties
let disposeBag = DisposeBag()
let tableView = UITableView()
let submitButton = UIB... | 35.134328 | 160 | 0.684792 |
0ec4e56155fff95e0b0817567ef2c4b671c8081f | 236 | //
// File.swift
//
//
// Created by Виталий Зарубин on 31.01.2022.
//
import Foundation
struct Samsung: IPhone {
var cpu: ICPU = Snapdragon()
func call() {
print("\(cpu.work()) -> call samsung")
}
}
| 13.111111 | 46 | 0.542373 |
7168c9896afd859dae285fcbc38eabba0517c09a | 8,188 | //
// NSHTTPURLResponse+Utility.swift
// swiftlets
//
// Created by Frank Vernon on 6/27/16.
// Copyright © 2016 Frank Vernon. All rights reserved.
//
import Foundation
/**
Enumeration of HTTP result values categorized by class of status code.
This is useful in processing results of web service calls, for exam... | 30.102941 | 96 | 0.629213 |
484ef6bdaa11cafab2da6d6f0941bd67b29e9026 | 2,290 | @objc(MWMDiscoveryLocalExpertCell)
final class DiscoveryLocalExpertCell: UICollectionViewCell {
@IBOutlet private weak var avatar: UIImageView!
@IBOutlet private weak var name: UILabel!
@IBOutlet private weak var rating: RatingSummaryView! {
didSet {
rating.defaultConfig()
rating.textFont = UIFont... | 30.945946 | 166 | 0.632314 |
e4866b758ae6ad9d15e6da559668c6ee1f25961d | 7,971 | //
// ContactsCellContentView.swift
// MyMonero
//
// Created by Paul Shapiro on 6/15/17.
// Copyright (c) 2014-2019, MyMonero.com
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
... | 38.694175 | 451 | 0.752478 |
5beb63691737da0c0320e660a7c938f230484415 | 5,030 | //
// BooksListViewController.swift
// BooksList
//
// Created by Andrey Konstantinov on 04/06/2017.
// Copyright © 2017 8of. All rights reserved.
//
import UIKit
final class BooksListViewController: UIViewController {
fileprivate weak var output: BooksListViewOutput?
fileprivate let collectionView: UIColle... | 30.670732 | 198 | 0.733002 |
46be5688a2ab1813b8393b2653ad1b87466e044f | 338 | //:## User Data
import VisualRecognitionV3
let visualRecognition = setupVisualRecognitionV3()
//:### Delete labeled data
visualRecognition.deleteUserData(customerID: "my-customer-id") {
_, error in
if let error = error {
print(error.localizedDescription)
return
}
print("delete requ... | 17.789474 | 64 | 0.689349 |
dd87b24d7b6f615db0ba995641efa7e0794720f9 | 5,498 | //
// RSClient+Plugins.swift
// RudderStack
//
// Created by Pallab Maiti on 24/02/22.
// Copyright © 2021 Rudder Labs India Pvt Ltd. All rights reserved.
//
import Foundation
extension RSClient {
internal func addPlugins() {
add(plugin: RSReplayQueuePlugin())
let logPlugin =... | 32.152047 | 163 | 0.580029 |
fced4dc35bef6ecbb2bec3a7fb87d440a0666c5f | 2,030 | //
// HLSNative+ExposureContext+Creation.swift
// Exposure
//
// Created by Fredrik Sjöberg on 2017-11-27.
// Copyright © 2017 emp. All rights reserved.
//
import Foundation
import Player
import Exposure
/// Extends `Player` using `HLSNative` tech in an `ExposureContext` with a convenience initializer
extension P... | 48.333333 | 251 | 0.733498 |
6412d588f3ccab8bdfcc1c7046aa639170e56705 | 2,803 | // 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
import azureSwiftRuntime
internal struct ComputeNodeRebootHeadersData : Comp... | 42.469697 | 149 | 0.700321 |
de83c1f019c40660e506ab0778c0f353fece75da | 2,489 | //
// SceneDelegate.swift
// Assignment1
//
// Created by Mohmed Master on 2021/02/10.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions)... | 44.446429 | 147 | 0.71595 |
38989d90bf24b0dffbf6011c028c3bc8f82c6e1d | 2,526 | import Foundation
import StandardLibraries
public struct Day7 {
public init() {}
public typealias Reducer = (Int, (Int, Int)) throws -> Int
/*
Each submarine has a horizontal position (puzzle input). Moving 1 step costs 1 fuel. What is the least amount of fuel required to align all submarines to the ... | 25.515152 | 177 | 0.41053 |
508a0bb6cbdebec5954a76c391d48db9c1ef7ec6 | 898 | //
// MinifyCSSTransform.swift
// FilestackSDK
//
// Created by Ruben Nine on 13/08/2019.
// Copyright © 2019 Filestack. All rights reserved.
//
import Foundation
/**
Minifies your CSS files.
*/
@objc(FSMinifyCSSTransform) public class MinifyCSSTransform: Transform {
/**
Initializes a `MinifyCSSTransfo... | 22.45 | 86 | 0.632517 |
b91cbbecf40dea8dab37719bc5185a3c9f0b407d | 1,580 | // swift-tools-version:5.1
//
// Package.swift
//
// Copyright (c) Ramotion Inc. (https://www.ramotion.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 Software without restriction, in... | 35.909091 | 81 | 0.703165 |
f50a74722a8b70f43a42b493695236f551e8a611 | 16,011 | //
// Script.swift
//
// Copyright © 2018 BitcoinKit developers
//
// 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 ... | 32.944444 | 165 | 0.593217 |
29061467ac3d11b0d1ebac762fb66c8af4dbc726 | 17,052 | //
// IQKeyboardReturnKeyHandler.swift
// https://github.com/hackiftekhar/IQKeyboardManager
// Copyright (c) 2013-16 Iftekhar Qurashi.
//
// 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 w... | 36.358209 | 156 | 0.592482 |
7a5ea33310dc766c937f18f1283f772a065c17ec | 3,039 | //
// AppDelegate.swift
// iOSSwift
//
// Created by C.W. Betts on 10/3/14.
//
//
import UIKit
import CocoaLumberjack
import CocoaLumberjackSwift
let ddloglevel = DDLogLevel.verbose
private func printSomething() {
DDLogVerbose("Verbose")
DDLogDebug("Debug")
DDLogInfo("Info")
DDLogWarn("Warn")
... | 35.752941 | 279 | 0.731162 |
fe6e277c5751ee4090a3d7e3524117597ff91c4a | 653 | //
// Created by Papp Imre on 2019-02-15.
// Copyright (c) 2019 CocoaPods. All rights reserved.
//
import NMDEF_Base
import RxFlow
import Reusable
class Tab2Flow: TabFlow, FlowWithNavigationRoot, StoryboardSceneBased {
static var sceneIdentifier: String {
return "Tab2Navigation"
}
func navigate(t... | 25.115385 | 74 | 0.658499 |
f575bf4ff8455e5aa6b2f8c2b6545666d1afca6a | 181 | import Foundation
#if os(Linux)
import FoundationNetworking
#endif
public extension URL {
/// Easy request generation.
var urlRequest: URLRequest {
URLRequest(url: self)
}
}
| 13.923077 | 29 | 0.745856 |
f9ccf05d36d3158143718384827213947a640a9b | 1,126 | import UIKit
/**
Batch Actions View Controller, contains the replication and batch operation actions.
*/
class HomeActionsViewController: UIViewController {
//@IBOutlet weak var dfdfgd: UIButton!
fileprivate var eventAPI: EventAPI!
fileprivate var remoteReplicator: RemoteReplicator!
override func... | 30.432432 | 106 | 0.728242 |
383bff4d953659825864ce71a20ef98a38682463 | 1,161 | //: [⇐ Previous: 02 - Functions](@previous)
//: ## Episode 03: Challenge - Functions
/*:
## Challenge 1
- Create a closure version of the function below.
- Try out the function & closure!
*/
// --------------------------------------
func calculateFullName(firstName: String, lastName: String?) -> String {
firstNa... | 25.23913 | 84 | 0.569337 |
efec532266ece66de510f196bddd897f5d44ea86 | 2,358 | //
// Context.swift
// SlackBlocksModel
//
// Created by Helge Heß.
// Copyright © 2020 ZeeZide GmbH. All rights reserved.
//
public extension Block {
struct Context: Encodable {
/**
* Context's can contain just text (w/ or w/o markdown) and images.
*/
public enum Element: Encodable {
... | 23.117647 | 73 | 0.583545 |
03574c62496676d2903d1c440612a83d3ba3c5b8 | 2,288 | //
// SceneDelegate.swift
// LableWhisperer
//
// Created by asc on 11/12/21.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
... | 43.169811 | 147 | 0.71285 |
3847619aa1e01290175ef4b71979258bd60b8e3c | 94 | public protocol SpeculidConfigurationProtocol {
var mode: SpeculidApplicationMode { get }
}
| 23.5 | 47 | 0.808511 |
db55fc8ba938f0c3ca7c79529e584addad1e0155 | 3,488 | import UIKit
//: # Lesson 2 Exercises
//: ## Optionals
//: ### Exercise 1
//: When retrieving a value from a dictionary, Swift returns an optional.
//:
//: 1a) The variable, director, is an optional type. Its value cannot be used until it is unwrapped. Use `if let` to carefully unwrap the value returned by `moviesDict... | 44.717949 | 314 | 0.739392 |
ab522774bc3f8d38b66c443cee0614d99804c2e5 | 3,088 | //
// CGPointExtensions.swift
// SSTests
//
// Created by Omar Albeik on 07/12/2016.
// Copyright © 2016 Omar Albeik. All rights reserved.
//
#if os(macOS)
import Cocoa
#else
import UIKit
#endif
// MARK: - Methods
public extension CGPoint {
/// SwifterSwift: Distance from another CGPoint.
///
/// - Parame... | 27.087719 | 91 | 0.645725 |
c19a157c62fd5578fdb68363d9f9d72804bb87db | 1,244 | /*
Copyright 2017 Ryuichi Intellectual Property and the Yanagiba project contributors
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
... | 32.736842 | 85 | 0.737942 |
abe5534d2d4c5225008bc6df2641eb93e1a85571 | 5,332 | /*
THIS FILE WAS AUTOGENERATED! DO NOT EDIT!
file to edit: 00_load_data.ipynb
*/
import Foundation
import Just
import Path
public func shellCommand(_ launchPath: String, _ arguments: [String]) -> String?
{
let task = Process()
task.executableURL = URL.init(fileURLWithPath:launchPath)
task.argumen... | 37.286713 | 125 | 0.626594 |
26c82d6c72bffdb0d05282386b0ef9c209c725ea | 1,746 | //
// DrawTimerBarView.swift
// drawAI
//
// Created by Alessandro Negrão on 25/10/21.
//
import UIKit
protocol DrawTimerBarDelegate: AnyObject {
func didFinishTime()
}
class DrawTimerBarView: ANView {
private var timerValue: Double = 1.0
private var progressLayer = CAShapeLayer()
weak var del... | 26.861538 | 113 | 0.607102 |
3a3136d762cbea5f878a98f045af5aad3de7e9a9 | 2,237 | //
// UIViewController+JX.swift
// JXPhotoBrowser
//
// Created by JiongXing on 2018/10/14.
//
import Foundation
import UIKit
extension UIViewController: JXNamespaceWrappable {}
extension JXTypeWrapperProtocol where JXWrappedType == UIViewController {
/// Returns the current application's top most view c... | 36.080645 | 91 | 0.664283 |
eb3749fcf1a67449f39e5903f0511e85c7c1cc9f | 68 | import Foundation
enum FormatError: Error {
case stringError
}
| 11.333333 | 25 | 0.75 |
4829cf1c3baec0fcd6d704b58d984daa744f511a | 346 | //
// EmptyReuseView.swift
// musicSheet
//
// Created by Jz D on 2020/8/24.
// Copyright © 2020 Jz D. All rights reserved.
//
import UIKit
class EmptyReuseView: UICollectionReusableView {
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
backgroundCo... | 16.47619 | 48 | 0.624277 |
69dcb86b4e864ea1148b4c29a687eb5c54651023 | 8,755 | //
// Infallible+Tests.swift
// Tests
//
// Created by Shai Mishali on 11/20/20.
// Copyright © 2020 Krunoslav Zaher. All rights reserved.
//
import RxSwift
import RxCocoa
import RxRelay
import RxTest
import XCTest
class InfallibleTest: RxTest { }
extension InfallibleTest {
func testAsInfallible_OnErrorJustR... | 25.979228 | 98 | 0.52964 |
1646434524dbc8cab18dcffd598562c0aee6c48c | 1,812 | //
// BeNilSpec.swift
// Sleipnir
//
// Created by Artur Termenji on 7/16/14.
// Copyright (c) 2014 railsware. All rights reserved.
//
import Foundation
class BeNilSpec : SleipnirSpec {
var beNilSpec : () = describe("BeNil matcher") {
context("value") {
var value: Int?
... | 28.761905 | 75 | 0.370861 |
7521f8bab56026d86480f1aba131e9eb2070f02c | 7,660 | //
// LogViewHelper.swift
// TTBaseUIKit
//
// Created by Tuan Truong Quang on 9/11/19.
// Copyright © 2019 Truong Quang Tuan. All rights reserved.
//
import Foundation
import UIKit
open class LogViewHelper {
fileprivate var viewModel:LogTrackingViewModel = LogTrackingViewModel()
public static l... | 39.282051 | 144 | 0.591253 |
87571fa5b1e094bd1211e9235e4fcee7d69d49f8 | 1,391 | //
// UIButton-Extension.swift
// YoungWeibo
//
// Created by Young on 2016/12/10.
// Copyright © 2016年 杨羽. All rights reserved.
//
import UIKit
extension UIButton {
class func creatButton(_ iamgeName : String , bgImageName : String) -> UIButton {
let btn = UIButton()
btn.setImage(UIImage.in... | 32.348837 | 100 | 0.642703 |
236df7bb0dbfaa164dbe61627bef21dce12085b5 | 1,947 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Hummingbird server framework project
//
// Copyright (c) 2021-2021 the Hummingbird authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See hummingbird/CONTRIB... | 38.94 | 86 | 0.709296 |
3882191d5c940dbe118a2930dab00851219918af | 1,393 | //
// AppDelegate.swift
// iOSWriter
//
// Created by Reynaldo on 22/7/21.
// Copyright © 2021 Apple. All rights reserved.
//
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication... | 36.657895 | 179 | 0.744436 |
8921748773e83a6f9bc551b71923e4c1086f22a1 | 2,270 | //
// ComposeViewController.swift
// TwitZy
//
// Created by Savannah McCoy on 6/29/16.
// Copyright © 2016 Savannah McCoy. All rights reserved.
//
import UIKit
class ComposeViewController: UIViewController, UITextViewDelegate {
@IBOutlet weak var tweetTextView: UITextView!
@IBOutlet weak var countdo... | 24.148936 | 119 | 0.617181 |
e0479a41b6e24552a55d38993779a601036f6798 | 1,071 | //
// PyMultipeerHelper.swift
// Pyto
//
// Created by Emma Labbé on 21-01-20.
// Copyright © 2018-2021 Emma Labbé. All rights reserved.
//
import MultiPeer
import UIKit
@objc class PyMultipeerHelper: NSObject, MultiPeerDelegate {
static let delegate = PyMultipeerHelper()
@objc static var data: ... | 26.121951 | 81 | 0.647059 |
cc39ebc030f9976746bdd7f61d3d9fd931de0bf5 | 199 | //
// GroceryListItem+CoreDataClass.swift
// GroceryListSwiftUI
//
// Created by JoshRhee on 3/26/22.
//
//
import Foundation
import CoreData
public class GroceryListItem: NSManagedObject {
}
| 12.4375 | 47 | 0.733668 |
75bd2a08fb53289f0df7765348a438a78d180f5e | 1,405 | //
// AppDelegate.swift
// H4X0R News
//
// Created by jigar on 12/08/20.
// Copyright © 2020 jigar. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [U... | 36.973684 | 179 | 0.745907 |
2061ece6455f582710a554f48104885de6272e75 | 4,106 | //===-- NumpyConversion.swift ---------------------------------*- swift -*-===//
//
// 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... | 33.382114 | 80 | 0.69435 |
cc828b4d1a6c484a3cfd6fe961fec4fd4cab7022 | 12,904 | //
// DocumentController.swift
//
// CotEditor
// https://coteditor.com
//
// Created by nakamuxu on 2004-12-14.
//
// ---------------------------------------------------------------------------
//
// © 2004-2007 nakamuxu
// © 2014-2019 1024jp
//
// Licensed under the Apache License, Version 2.0 (the "License")... | 34.137566 | 154 | 0.592917 |
fbebe0e766db800ef8d5f30106fb5fcbae557c7e | 3,465 | //
// AlertViewController.swift
// SwiftCase
//
// Created by 伍腾飞 on 2017/4/30.
// Copyright © 2017年 Shepherd. All rights reserved.
//
import UIKit
class AlertViewController: UIViewController {
@IBOutlet weak var label: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
... | 30.130435 | 116 | 0.566522 |
5d5216cb5789b9ca264e9ebfd3ce71dc001caf14 | 11,305 | // SPDX-License-Identifier: MIT
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
import Foundation
extension TunnelConfiguration {
enum ParserState {
case inInterfaceSection
case inPeerSection
case notInASection
}
enum ParseError: Error {
case invalidLine(Stri... | 44.683794 | 139 | 0.602123 |
e6c46492c6247c88638ba88efb14cbd3a8076841 | 892 | //
// TNSFramebufferAttachmentParameter.swift
// CanvasNative
//
// Created by Osei Fortune on 4/18/20.
//
import Foundation
@objcMembers
@objc(TNSFramebufferAttachmentParameter)
public class TNSFramebufferAttachmentParameter: NSObject {
var _isTexture: Bool
var _isRenderbuffer: Bool
var _value: Int32
... | 21.238095 | 70 | 0.607623 |
1ef1b8655c3d82e40e28da8d727d3bbb7f889125 | 569 | //
// CEFDragData+Interop.g.swift
// CEF.swift
//
// This file was generated automatically from cef_drag_data.h.
//
import Foundation
extension cef_drag_data_t: CEFObject {}
/// Class used to represent drag data. The methods of this class may be called
/// on any thread.
public class CEFDragData: CEFProxy<cef_dra... | 23.708333 | 85 | 0.706503 |
5be6c3b79fa3e814f838020b874c00a9d31235ca | 2,264 | /**
* Copyright (c) 2017 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, publi... | 34.30303 | 89 | 0.731007 |
28419514a253b9deaf0a05547996848ffbc684b1 | 2,143 | //
// AppDelegate.swift
// Calculator
//
// Created by Dulio Denis on 5/1/16.
// Copyright © 2016 Dulio Denis. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaun... | 45.595745 | 285 | 0.753616 |
cc18945f148190f8165735d78cb1369b4369a12f | 1,016 | //
// Styles.swift
// Dash
//
// Created by zw on 2022/3/7.
//
import SwiftUI
struct StrokeStyle: ViewModifier{
var cornerRadius: CGFloat
@Environment(\.colorScheme) var colorScheme
func body(content: Content) -> some View {
content.overlay(RoundedRectangle(cornerRadius: cornerRadius, style: .c... | 27.459459 | 88 | 0.457677 |
1dfeea8939fb6f48be299909362ee375ed24d401 | 5,477 | //
// RemoteRedditImageLoader.swift
// Reddit-ShowcaseTests
//
// Created by Gustavo on 10/06/21.
//
import XCTest
import Reddit_Showcase
class RemoteRedditImageLoaderTest: XCTestCase {
func test_init_doesNotPerformAnyURLRequest() {
let (_, client) = makeSUT()
XCTAssertTrue(client.req... | 36.032895 | 134 | 0.612014 |
750fdd689326e0c2b7b920b085851f5d8068bfce | 1,561 | protocol View {
associatedtype Body: View
@ViewBuilder var body: Body { get }
}
protocol BuiltinView {
func _buildNodeTree(_ node: Node)
}
extension View {
func observeObjects(_ node: Node) {
let m = Mirror(reflecting: self)
for child in m.children {
guard let observedObjec... | 22.3 | 88 | 0.545163 |
334e9d587cb5ecaa180bac37e71919e4d1598117 | 1,598 | // Copyright © 2017 Schibsted. All rights reserved.
import XCTest
@testable import Layout
private func url(forXml name: String) throws -> URL {
guard let url = Bundle(for: LayoutViewControllerTests.self)
.url(forResource: name, withExtension: "xml") else {
throw NSError(domain: "Could not locate:... | 37.162791 | 94 | 0.734668 |
5078821daa0416546978026afded49af3b906de7 | 515 | import UIKit
struct FlutterBridgeConst {
// necessary
static let MethodChannel = "com.example.flutter/method"
static let EventChannel = "com.example.flutter/event"
static let BasicMessageChannel = "com.example.flutter/basicMessage"
/// 打开相册
static let OPEN_GALLERY = "OP... | 20.6 | 71 | 0.638835 |
eb69d9a8d041d033aaf54e81165e625e85a2e4f2 | 351 | //
// WindowController.swift
// Youtube-dl-GUI
//
// Created by Kevin De Koninck on 28/01/2017.
// Copyright © 2017 Kevin De Koninck. All rights reserved.
//
import Cocoa
class WindowController: NSWindowController {
override func windowDidLoad() {
super.windowDidLoad()
self.window!.background... | 18.473684 | 59 | 0.683761 |
9cde332da2c0f6ce6ae7838510c3838520076148 | 2,210 | //
// SceneDelegate.swift
// CountrySelectionPod
//
// Created by Fedor Volchkov on 10/4/19.
// Copyright © 2019 Fedor Volchkov. All rights reserved.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISce... | 39.464286 | 141 | 0.704977 |
0e297af96c0fa9d1c4ab0e270600c421b0f12fcb | 8,700 | //
// CheckoutViewController.swift
// HippoChat
//
// Created by Vishal on 05/11/19.
// Copyright © 2019 CL-macmini-88. All rights reserved.
//
import UIKit
import WebKit
class PrePaymentViewController: UIViewController {
@IBOutlet weak var navigationBar : NavigationBar!
var webView: WKWebView... | 40.277778 | 246 | 0.647356 |
e647daf5330b315ee19160a1447f9a647070d7d8 | 867 | //
// UIStackView+Extensions.swift
// Extensions
//
// Created by Ayşenur Bakırcı on 16.11.2021.
//
import UIKit
public extension UIStackView {
static func create(arrangedSubViews: [UIView] = [],
axis: NSLayoutConstraint.Axis = .vertical,
alignment: UIStackVie... | 30.964286 | 71 | 0.614764 |
d6d55ee6a9970529a69504c16fdeeb4abef278be | 617 | public struct VCSRootEntry {
public let id : String
public let vcsRoot : VCSRootSummary
public let checkoutRules: String?
init?(dictionary: [String: AnyObject]) {
guard let id = dictionary["id"] as? String,
let checkoutRules = dictionary["checkout-rules"] as? String,
... | 29.380952 | 85 | 0.614263 |
f87889dad857f2c6a242bc73c7e7c64bcc7ab634 | 3,685 | //
// AIPlayer.swift
// agario
//
// Created by Ming on 10/12/15.
//
//
import SpriteKit
class AIPlayer : Player {
var confidenceLevel = 0
override init(playerName name : String, parentNode parent : SKNode, initPosition p : CGPoint) {
super.init(playerName: name, parentNode: parent, initP... | 32.610619 | 119 | 0.503935 |
0abbb110da7ef4a9f134f2a2e6987ba48e9af341 | 1,356 | //
// RDPUIFont+Extension.swift
// Redpos
//
// Created by Jesus Nieves on 16/09/2019.
// Copyright © 2019 Jesus Nieves. All rights reserved.
//
import UIKit
extension UIFont {
private static func customFont(name: String, size: CGFloat) -> UIFont {
let font = UIFont(name: name, size: size)
ass... | 29.478261 | 75 | 0.648968 |
e5331de1de1fcd64501bab4a93843b4fbc0b9ae1 | 7,614 | //
// EventCell.swift
// SberDiplomaProject
//
// Created by Анна Ереськина on 09.07.2021.
//
import UIKit
/// Ячейка отображения события
final class EventCell: UITableViewCell {
/// Идентификатор переиспользования ячейки
static var reuseID: String { String(describing: EventCell.self) }
/// Нажатие на "Избран... | 35.579439 | 107 | 0.764381 |
5b3e230b9901013381b36bcb22840f8b8bfc1137 | 803 | //
// WhatsNewHeaderView.swift
// WhatsNewView
//
// Created by Jonathan Gander
//
// Display WhatsNewView's header with title and subtitle
//
import SwiftUI
struct WhatsNewHeaderView: View {
public var title: String
public var subtitle: String?
var body: some View {
VStack ... | 21.702703 | 58 | 0.496887 |
1ebf43a65690bba5dad9371c899d3bb08fa462df | 139 | /////
//// SaveCenter.swift
/// Copyright © 2020 Dmitriy Borovikov. All rights reserved.
//
import Foundation
protocol SaveCenter {}
| 13.9 | 62 | 0.683453 |
5d8d1294fda9aa5b2ac3b0cbad1c00e113efb30c | 4,049 | //
// SettingVC.swift
// CollectionView
//
// Created by Nick Lin on 2018/7/30.
// Copyright © 2018年 Nick Lin. All rights reserved.
//
import UIKit
enum SectionTitle: String {
case aboutYou = "關於您"
case aboutMe = "關於我"
}
enum SectionItem: String {
case yourFace = "您的臉"
case yourEye = "您的眼睛"
c... | 30.674242 | 112 | 0.617436 |
18f531de8208ea092a0b71a59c97af456c8242e0 | 3,388 | //
// NotificationPreference.swift
// PennMobile
//
// Created by Dominic Holmes on 12/27/19.
// Copyright © 2019 PennLabs. All rights reserved.
//
import Foundation
typealias NotificationPreferences = Dictionary<String, Bool>
/*
Notification preferences are stored in UserDefaults as a String:Bool mapping, wher... | 41.82716 | 224 | 0.751476 |
338ffba8f323cefe28227c03384097a1d5311b19 | 183,591 | /*
This source file is part of the Swift.org open source project
Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for Swift project au... | 39.245618 | 277 | 0.470432 |
9c186b441be3db8e3f57d35a5456f6db26bb19c6 | 1,874 | //
// PriceCalendarResultCell.swift
// AviasalesSDKTemplate
//
// Created by Dim on 20.02.2018.
// Copyright © 2018 Go Travel Un Limited. All rights reserved.
//
import UIKit
class PriceCalendarResultCell: UITableViewCell {
@IBOutlet weak var containerView: UIView!
@IBOutlet weak var cheapestContainerVie... | 32.877193 | 133 | 0.707577 |
e567c91aee63156a1574964f67f7dfcc8b8e2711 | 1,156 | //
// main.swift
// SierpinskiSwift
//
// Runs the main sierpinski algorithm.
import SVGLibrary
// YOUR CODE HERE
func draw_triangle(_ p1: Point, _ p2:Point, _ p3: Point, _ figure: SVG){
figure.draw_line(p1, p2)
figure.draw_line(p2, p3)
figure.draw_line(p3, p1)
}
// Draw a triangle between the thr... | 26.272727 | 85 | 0.665225 |
e0fc2cd3cc626cbe450b6ecc5da05c647a49475c | 1,404 | //
// KeyPadButtonView.swift
// Brieftasche
//
// Created by Lloyd on 2/21/22.
//
import SwiftUI
struct KeyPadButtonView: View {
var key: String
var body: some View {
Button(action: { self.action(self.key) }) {
Color.clear
// .overlay(RoundedRectangle(cor... | 27.529412 | 73 | 0.568376 |
46881e4831bbd8981bb17ed4303f67980947769e | 852 | import Foundation
private class PrivateToken {}
extension Decodable {
static func decodingResource(byName resourceName: String) -> Self {
guard let resourceURL = Bundle(for: PrivateToken.self).url(forResource: resourceName, withExtension: "json") else {
fatalError("Could not find resource '\(r... | 34.08 | 123 | 0.633803 |
76a881cd28826c4c7581ac3bb32579fb11b88de7 | 118 | import XCTest
import NvimViewTests
var tests = [XCTestCaseEntry]()
tests += NvimViewTests.allTests()
XCTMain(tests)
| 14.75 | 33 | 0.779661 |
fb538e7ceb093723fe3cbe79814bb7db09da2fa0 | 339 | //
// File.swift
// AdzerkSDK
//
// Created by Ben Scheirman on 10/4/20.
//
import Foundation
@testable import AdzerkSDK
class FakeKeyStore: UserKeyStore {
var currentUserKey: String?
func save(userKey: String) {
currentUserKey = userKey
}
func removeUserKey() {
currentUse... | 15.409091 | 40 | 0.628319 |
7130397e000d5c9972199e72880d34b7f2a84dd2 | 2,493 | // RUN: rm -rf %t && mkdir -p %t/before && mkdir -p %t/after
// RUN: %target-build-swift -emit-library -Xfrontend -enable-resilience -D BEFORE -c %S/Inputs/struct_add_remove_conformances.swift -o %t/before/struct_add_remove_conformances.o
// RUN: %target-build-swift -emit-module -Xfrontend -enable-resilience -D BEFORE... | 32.802632 | 177 | 0.727637 |
7663e3d4c67dc250ca62de76784e154f648539f2 | 466 | //
// OctopusCard.swift
// TRETJapanNFCReader
//
// Created by treastrain on 2019/09/20.
// Copyright © 2019 treastrain / Tanaka Ryoga. All rights reserved.
//
import Foundation
/// Octopus Card (八達通)
@available(iOS 13.0, *)
public struct OctopusCard: FeliCaCard {
public let tag: OctopusCardTag
public var... | 21.181818 | 68 | 0.67382 |
20035f18a8fa532aa9dfcebd64623443ab2fa903 | 9,869 | //
// APNetIndicatorClientTests.swift
// ApplepieTests
//
// Created by 山天大畜 on 2018/11/8.
// Copyright © 2018 山天大畜. All rights reserved.
//
import XCTest
import Applepie
import Alamofire
import ReactiveCocoa
extension String {
/// User info dictionary key representing the `Request` associated with the notifi... | 39.794355 | 135 | 0.617286 |
e47e91cdc796d91e64661204d4a5bbd8e2d0cf69 | 236 | import XCTest
public final class AutomaticCurrentTestCaseProvider: CurrentTestCaseProvider {
public init() {
}
public func currentTestCase() -> XCTestCase? {
return _XCTCurrentTestCase() as? XCTestCase
}
}
| 21.454545 | 78 | 0.699153 |
9bb0ea0508765931dbdbde097a47168a0b85f50e | 11,485 | //
// BRELocationManager.swift
// BeaconRangingExample
//
// Created by Sam Piggott on 05/04/2017.
// Copyright © 2017 Sam Piggott. All rights reserved.
//
import UIKit
import CoreLocation
import UserNotifications
enum BRELocationManagerError:Error {
case bluetoothIsDisabled
case locationServicesAreD... | 41.763636 | 366 | 0.604963 |
e68acb57673228b02b283e0c525ac7152eb99770 | 4,112 | //
// NativeAdViewController.swift
// AotterGoogleMediationAdSwift
//
// Created by JustinTsou on 2021/4/23.
//
import UIKit
import GoogleMobileAds
class NativeAdViewController: UIViewController {
@IBOutlet weak var nativeAdTableView: UITableView!
private let TestNativeAdUnit: String = "Your Native ... | 27.413333 | 164 | 0.66537 |
9b6a49ca3b0f743212e40f288085f5c86e6c024c | 3,270 | //
// Recoverable.swift
// SkeletonView
//
// Created by Juanpe Catalán on 13/05/2018.
// Copyright © 2018 SkeletonView. All rights reserved.
//
import UIKit
protocol Recoverable {
func saveViewState()
func recoverViewState(forced: Bool)
}
extension UIView: Recoverable {
var viewState: RecoverableVie... | 32.7 | 101 | 0.659633 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.