Datasets:
repo_name stringlengths 6 91 | ref stringlengths 12 59 | path stringlengths 7 936 | license stringclasses 15
values | copies stringlengths 1 3 | content stringlengths 61 714k | hash stringlengths 32 32 | line_mean float64 4.88 60.8 | line_max int64 12 421 | alpha_frac float64 0.1 0.92 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kumabook/StickyNotesiOS | refs/heads/master | StickyNotes/WebViewController+NewPage.swift | mit | 1 | //
// WebViewController+NewPage.swift
// StickyNotes
//
// Created by Hiroki Kumamoto on 2017/04/28.
// Copyright © 2017 kumabook. All rights reserved.
//
import Foundation
import UIKit
import RealmSwift
extension WebViewController: UISearchControllerDelegate, UISearchResultsUpdating, UISearchBarDelegate {
fu... | 3eea232541e5e1afdb4137c6d39e1484 | 44.806723 | 176 | 0.686846 | false | false | false | false |
Inquisitor0/LSB2 | refs/heads/master | Cocoapods/Pods/PKHUD/PKHUD/FrameView.swift | apache-2.0 | 9 | //
// HUDView.swift
// PKHUD
//
// Created by Philip Kluz on 6/16/14.
// Copyright (c) 2016 NSExceptional. All rights reserved.
// Licensed under the MIT license.
//
import UIKit
/// Provides the general look and feel of the PKHUD, into which the eventual content is inserted.
internal class FrameView: UIVisualEf... | 26410e1005d73926bf8de243a14cf91f | 27.492063 | 109 | 0.639554 | false | false | false | false |
TheSafo/Sinkr | refs/heads/master | ios stuff/Sinkr/Views/CupView.swift | gpl-3.0 | 1 | //
// CupView.swift
// Sinkr
//
// Created by Jake Saferstein on 6/18/16.
// Copyright © 2016 Jake Saferstein. All rights reserved.
//
import Foundation
import UIKit
protocol CupViewDelegate {
func cupViewTapped(cupVw: CupView)
}
class CupView : UIView {
static var cupWidthHeight: CGFloat {
... | 9dd273532175037b1ca978bac1f93a54 | 21.866667 | 95 | 0.58484 | false | false | false | false |
LeonClover/DouYu | refs/heads/master | DouYuZB/DouYuZB/Classes/Tools/Common.swift | mit | 1 | //
// Common.swift
// DouYuZB
//
// Created by Leon on 2017/6/7.
// Copyright © 2017年 pingan. All rights reserved.
//
import UIKit
let kStatusBarH: CGFloat = 20
let kNavigationBarH: CGFloat = 44
let kTabbarH: CGFloat = 49
let kScreenW: CGFloat = UIScreen.main.bounds.width
let kScreenH: CGFloat = UIScreen.main.b... | a0ba1ecab819e92c58def7275c2536ce | 15.9 | 51 | 0.710059 | false | false | false | false |
scotlandyard/expocity | refs/heads/master | expocity/View/Chat/Display/VChatDisplayMarks.swift | mit | 1 | import UIKit
class VChatDisplayMarks:UIView
{
weak var controller:CChat!
weak var button:UIButton?
private let kItemSize:CGFloat = 50
private let itemSize_2:CGFloat
init(controller:CChat)
{
itemSize_2 = kItemSize / 2.0
super.init(frame:CGRect.zero)
clipsToB... | de0db101fab2de8a4e10a8179967d1dc | 29.79798 | 110 | 0.567727 | false | false | false | false |
notbenoit/tvOS-Twitch | refs/heads/develop | Code/tvOS/Controllers/Streams/StreamsViewController.swift | bsd-3-clause | 1 | // Copyright (c) 2015 Benoit Layer
//
// 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, publish, ... | 8ca19c6b1a1df2bb725c6da36477e776 | 40.761538 | 155 | 0.774544 | false | false | false | false |
thebinaryarchitect/list | refs/heads/master | Today/TodayViewController.swift | mit | 1 | //
// TodayViewController.swift
// Today
//
// Copyright (C) 2015 Xiao Yao. All Rights Reserved.
// See LICENSE.txt for more information.
//
import UIKit
import NotificationCenter
import ListKit
class TodayViewController: UITableViewController, NCWidgetProviding {
var list: List
override init(style: ... | 49958d2c5b25f56a02aca6db8978ca0d | 35.547826 | 157 | 0.670711 | false | false | false | false |
amraboelela/swift | refs/heads/master | test/SILGen/reabstract-tuple.swift | apache-2.0 | 12 |
// RUN: %target-swift-emit-silgen -verify %s | %FileCheck %s
// SR-3090:
class Box<T> {
public let value: T
public init(_ value: T) {
self.value = value
}
}
// CHECK: sil [ossa] @$s4main7testBoxyyF : $@convention(thin) () -> () {
// CHECK: bb0:
// CHECK: // function_ref closure #1 in test... | e4c97a910eaf1eac09f449fd387abbdc | 52.058824 | 166 | 0.533999 | false | true | false | false |
resmio/TastyTomato | refs/heads/main | TastyTomato/Code/Types/CustomViews/ZoomView/ZoomView.swift | mit | 1 | //
// ZoomView.swift
// TastyTomato
//
// Created by Jan Nash on 11/29/16.
// Copyright © 2016 resmio. All rights reserved.
//
import Foundation
import SignificantSpices
// MARK: // Public
// MARK: -
public protocol ZoomViewDelegate: AnyObject {
func zoomed(to scale: CGFloat, in zoomView: ZoomView)
}
// MA... | 93de27194091e8bd6bdd6c0864aeee93 | 29.992771 | 135 | 0.639947 | false | false | false | false |
quen2404/absolute0 | refs/heads/develop | Sources/App/Models/Post.swift | mit | 1 | import Vapor
import Fluent
import Foundation
struct PostModel: Model {
static var entity = "posts"
var id: Node?
var content: String
var creationDate: Date?
var user: UserModel
var event: EventModel
var exists: Bool = false
}
extension PostModel: NodeConvertible {
i... | 4a79784b6863994e9294108a24e6339d | 24.849057 | 58 | 0.583942 | false | false | false | false |
overtake/TelegramSwift | refs/heads/master | Telegram-Mac/EmptyComposeController.swift | gpl-2.0 | 1 | //
// EmptyComposeController.swift
// TelegramMac
//
// Created by keepcoder on 27/11/2016.
// Copyright © 2016 Telegram. All rights reserved.
//
import Cocoa
import TGUIKit
import SwiftSignalKit
import TelegramCore
class ComposeState<T> {
let result:T
init(_ result:T) {
self.result = result
... | 74ef8a55e7ab591a66dd3b8d8028d0c6 | 21.870968 | 86 | 0.692525 | false | false | false | false |
steelwheels/Coconut | refs/heads/master | CoconutData/Source/Value/CNMutableSegment.swift | lgpl-2.1 | 1 | /*
* @file CNMutableSegmentValue.swift
* @brief Define CNMutableSegmentValue class
* @par Copyright
* Copyright (C) 2022 Steel Wheels Project
*/
import Foundation
public class CNMutableValueSegment: CNMutableValue
{
private var mSegmentValue: CNValueSegment
private var mContext: CNMutableValue?
public in... | 0bba933273f801feae96bdefeab90f30 | 30.130081 | 150 | 0.712196 | false | false | false | false |
JaSpa/swift | refs/heads/master | test/SILGen/scalar_to_tuple_args.swift | apache-2.0 | 2 | // RUN: %target-swift-frontend -Xllvm -new-mangling-for-tests -emit-silgen %s | %FileCheck %s
func inoutWithDefaults(_ x: inout Int, y: Int = 0, z: Int = 0) {}
func inoutWithCallerSideDefaults(_ x: inout Int, y: Int = #line) {}
func scalarWithDefaults(_ x: Int, y: Int = 0, z: Int = 0) {}
func scalarWithCallerSideDefa... | aab1e78414d663d5408742fc1b970ffa | 52.123077 | 126 | 0.607588 | false | false | false | false |
nathantannar4/NTComponents | refs/heads/master | NTComponents/Extensions/UIColor.swift | mit | 1 | //
// UIColor.swift
// NTComponents
//
// Copyright © 2017 Nathan Tannar.
//
// 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 rig... | 6a65d595c404f38d9fbb6f1dffc80e76 | 33.277108 | 111 | 0.555009 | false | false | false | false |
eliakorkmaz/iCard | refs/heads/master | iCard/iCreditCard.swift | mit | 1 | //
// iCreditCard.swift
// iCard
//
// Created by xcodewarrior on 14.08.2017.
// Copyright © 2017 EmrahKorkmaz. All rights reserved.
//
import UIKit
class iCreditCard: UIView {
lazy var contentView: UIView = {
let view:UIView = UIView()
view.backgroundColor = UIColor.clear
return ... | 371ad5ac29db6ffc021f9e3cb80470d0 | 34.461538 | 145 | 0.613938 | false | false | false | false |
timfuqua/Bourgeoisie | refs/heads/master | Bourgeoisie/Pods/Buckets/Source/Graph.swift | mit | 1 | //
// Graph.swift
// Buckets
//
// Created by Mauricio Santos on 2/19/15.
// Copyright (c) 2015 Mauricio Santos. All rights reserved.
//
import Foundation
/// A simple directed graph: that is, one with no loops (edges
/// connected at both ends to the same vertex) and no more than one edge
/// in the same directi... | 3514bc7a505c950ebed9497328bb65ed | 32.576142 | 143 | 0.593469 | false | false | false | false |
BOTDOTME/AZExpandableIconListView | refs/heads/master | Pod/Classes/AZExpandableIconListView.swift | mit | 1 | //
// AZExpandableIconListView.swift
// Pods
//
// Created by Chris Wu on 01/28/2016.
// Copyright (c) 2016 Chris Wu. All rights reserved.
//
import Foundation
open class AZExpandableIconListView: UIView {
fileprivate var icons: [(UILabel, UIImageView)] = []
fileprivate var scrollView: UIScrollView
... | c62ce7b2d7af484818c57a92014a3017 | 54.835962 | 300 | 0.641243 | false | false | false | false |
DianQK/LearnRxSwift | refs/heads/master | LearnRxSwift/Rx.playground/Pages/Transforming.xcplaygroundpage/Contents.swift | mit | 1 | //: [上一节](@previous) - [目录](Index)
import RxSwift
/*:
## 变换 Observables
下面的这些操作符可以变换一个序列发射的值。这样我们的序列功能就强大了许多,创建,然后进行变换。甚至这里就类似于一条生产线。先做出一个原型,然后再进行各种加工,最后出我们想要的成品。
*/
/*:
### `map`
map 就是用你指定的方法去**变换每一个值**,这里非常类似 Swift 中的 map ,特别是对 SequenceType 的操作,几乎就是一个道理。一个一个的改变里面的值,并返回一个新的 functor 。

enum NetworkStatus {
case noNetWork // 没有网络
case viaWWAN
case viaW... | 4f84de87ce5819155924ff6d66dc1be7 | 30.309524 | 108 | 0.546008 | false | false | false | false |
DrGo/LearningSwift | refs/heads/master | PLAYGROUNDS/LSB_D003_NamedParameters.playground/section-2.swift | gpl-3.0 | 2 | import UIKit
/*
// Named Parameters
//
// Based on:
// https://skillsmatter.com/skillscasts/6142-swift-beauty-by-default
/===================================*/
/*------------------------------------/
// Functions: Unnamed
//
// Looks like C
/------------------------------------*/
func add(x: Int, y: Int) -> In... | 97fccfc199d23b6aa6f685d01fcc503a | 18.066667 | 69 | 0.45035 | false | false | false | false |
wilfreddekok/Antidote | refs/heads/master | Antidote/HelperFunctions.swift | mpl-2.0 | 1 | // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
import Foundation
func isAddressString(string: String) -> Bool {
let nsstring = string as NSString
if nsstr... | 68e8aca131aab1cb9c532c54727c6229 | 32.473684 | 81 | 0.735849 | false | false | false | false |
yakaolife/TrackLocations | refs/heads/master | Example/TrackLocations/ViewController.swift | mit | 1 | //
// ViewController.swift
// TrackLocations
//
// Created by yakaolife@gmail.com on 07/17/2017.
// Copyright (c) 2017 yakaolife@gmail.com. All rights reserved.
//
import UIKit
import TrackLocations
class ViewController: UIViewController {
var locations : [Location]?
override func viewDidLoad() {
... | 9a47d6d110042302eedf487cb13a1fe7 | 28.813333 | 122 | 0.586315 | false | false | false | false |
2briancox/ioscreator | refs/heads/master | IOS8SwiftScreenEdgePanGesturesTutorial/IOS8SwiftScreenEdgePanGesturesTutorial/ViewController.swift | mit | 40 | //
// ViewController.swift
// IOS8SwiftScreenEdgePanGesturesTutorial
//
// Created by Arthur Knopper on 13/01/15.
// Copyright (c) 2015 Arthur Knopper. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet var imageView: UIImageView!
var screenEdgeRecognizer: UIScreenEdgeP... | 9686ada2f9571b6c115def8d877915c2 | 25.704545 | 110 | 0.707234 | false | false | false | false |
steelwheels/KiwiComponents | refs/heads/master | Source/Compiler/KMLinkEdgePass.swift | lgpl-2.1 | 1 | /**
* @file KMLinkEdgePass.swift
* @brief Define KMLinkEdgePass class
* @par Copyright
* Copyright (C) 2017 Steel Wheels Project
*/
import KiwiControls
import KiwiEngine
import Canary
import JavaScriptCore
import Foundation
public class KMLinkEdgePass: KMPass
{
public func linkEdge(rootView root: KMStackView... | 6c8a8d103bca8746750641d5d0a2cbf6 | 29.474227 | 160 | 0.716847 | false | false | false | false |
leotumwattana/WWC-Animations | refs/heads/master | WWC-Animations/Circle.swift | bsd-3-clause | 1 | //
// Circle.swift
// WWC-Animations
//
// Created by Leo Tumwattana on 27/5/15.
// Copyright (c) 2015 Innovoso Ltd. All rights reserved.
//
import UIKit
@IBDesignable class Circle: UIView {
// ==================
// MARK: - Properties
// ==================
@IBInspectable var cornerRadius... | e52344974e4cadfed859f74ccb1ab35f | 21.508475 | 86 | 0.542922 | false | false | false | false |
Allow2CEO/browser-ios | refs/heads/master | Client/Frontend/Widgets/SnackBar.swift | mpl-2.0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import Foundation
import SnapKit
import Shared
class SnackBarUX {
static var MaxWidth: CGFloat = 400
}
/**
... | aaa385c4106cca5ee984c62e46fceb2f | 32.859589 | 181 | 0.639527 | false | false | false | false |
TonnyTao/HowSwift | refs/heads/master | Funny Swift.playground/Pages/subscript_dic.xcplaygroundpage/Contents.swift | mit | 1 | import Foundation
extension Dictionary {
subscript(input: [Key]) -> [Value] {
get {
var result = [Value]()
result.reserveCapacity(input.count)
for key in input {
if let value = self[key] {
result.append(value)
}
... | 0ae10fad1dc85da182b69cb643fa45fd | 20.741935 | 66 | 0.4273 | false | false | false | false |
obdev/SocketWrapper | refs/heads/master | SocketWrapper/Extensions/String+UnsafeBufferPointer.swift | mit | 1 | //
// String+UnsafeBufferPointer.swift
// SocketWrapper
//
// Created by Christian Ludl on 2016-02-11.
// Copyright © 2016 Objective Development. All rights reserved.
//
import Foundation
extension String {
/// Initializes a `String` from a sequence of `NUL`-terminated `UTF8.CodeUnit` as a `WithUnsafeBufferP... | a843011d68d481dbc4814a14c3f015ba | 41.914634 | 187 | 0.710429 | false | false | false | false |
shnhrrsn/ImagePalette | refs/heads/master | src/ColorHistogram.swift | apache-2.0 | 1 | //
// ColorHistogram.swift
// ImagePalette
//
// Original created by Google/Android
// Ported to Swift/iOS by Shaun Harrison
//
import Foundation
import UIKit
/**
Class which provides a histogram for RGB values.
*/
public struct ColorHistogram {
/**
An array containing all of the distinct colors in the image.
... | 7944147ce652c729239422d1330c4d81 | 21.300971 | 77 | 0.69003 | false | false | false | false |
fitpay/fitpay-ios-sdk | refs/heads/develop | FitpaySDK/Rest/RestClientCreditCard.swift | mit | 1 | import Foundation
import Alamofire
extension RestClient {
// MARK: - Completion Handlers
/**
Completion handler
- parameter result: Provides collection of credit cards, or nil if error occurs
- parameter error: Provides error object, or nil if no error occurs
*/
public ... | 3863979d7747a66a5087e999cd552b3d | 44.051724 | 198 | 0.588902 | false | false | false | false |
jstn/IndependentRotation | refs/heads/master | IndependentRotationWithCamera/IndependentRotationWithCamera/AppDelegate.swift | mit | 1 | //
// AppDelegate.swift
// IndependentRotationWithCamera
//
// Created by Justin Ouellette on 3/1/15.
// Copyright (c) 2015 Justin Ouellette. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var fixedWindow: UIWindow!
var rotatingWindow: UIWin... | 7984b6bcb38293947bac076b3153cb7b | 33.030303 | 128 | 0.724844 | false | false | false | false |
saraheolson/360iDevMin-PokeMongo | refs/heads/master | PokeMongo/PokeMongo/Scenes/GameScene.swift | gpl-3.0 | 1 | //
// GameScene.swift
// PokeMongo
//
// Created by Floater on 8/21/16.
// Copyright © 2016 SarahEOlson. All rights reserved.
//
import SpriteKit
import GameplayKit
class GameScene: SKScene {
// So we can keep track of our monster!
var monster: SKSpriteNode?
// So we can keep track of our ball!
... | 7317d33dcd2f07aa59dfb45a89a328d8 | 28.325 | 145 | 0.543762 | false | false | false | false |
GitHub Swift Repositories
Dataset Description
Dataset Summary
This dataset comprises data extracted from GitHub repositories, specifically focusing on Swift code. It was extracted using Google BigQuery and contains detailed information such as the repository name, reference, path, and license.
Source Data
- Initial Data Collection and Normalization
The data was collected from GitHub repositories using Google BigQuery. The dataset includes data from over 2.8 million open-source repositories. The data extraction process focused specifically on Swift files, identifying them using the .swift extension.
- Who are the source data producers?
Developers and contributors to open-source projects on GitHub.
Dataset Metadata
Data Curators: The data was curated using Google BigQuery.
Last Update: 22 Aug 2023
Dataset Creation Date: 20 May 2023
Licensing Information
Please note that this dataset is a collection of open-source repositories. Each repository or file might come with its own license. Always refer to the license field associated with each entry.
Feedback and Contributions
We welcome feedback and contributions. If you notice any issues with the dataset or would like your code remove, please raise an issue.
- Downloads last month
- 30