Datasets:
repo_name stringlengths 6 91 | path stringlengths 6 999 | copies stringclasses 283
values | size stringlengths 1 7 | content stringlengths 3 1.05M | license stringclasses 15
values |
|---|---|---|---|---|---|
dcutting/Syft | Package.swift | 1 | 406 | // swift-tools-version:4.0
import PackageDescription
let package = Package(
name: "Syft",
products: [
.library(name: "Syft", targets: ["Syft"])
],
targets: [
.target(
name: "Sample",
dependencies: ["Syft"]),
.target(
name: "Syft"),
.t... | mit |
FuckBoilerplate/RxCache | watchOS/Pods/RxSwift/RxSwift/DataStructures/Bag.swift | 12 | 7470 | //
// Bag.swift
// Rx
//
// Created by Krunoslav Zaher on 2/28/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
import Swift
let arrayDictionaryMaxSize = 30
/**
Class that enables using memory allocations as a means to uniquely identify objects.
*/
class Identity {
// weird ... | mit |
Q42/NoticeWindow | Pod/Classes/NoticeView.swift | 1 | 2780 | //
// NoticeView.swift
// Pods
//
// Created by Tim van Steenis on 09/12/15.
//
//
import Foundation
import UIKit
class NoticeView: UIView {
@IBOutlet weak var horizontalStackView: UIStackView!
@IBOutlet weak var leftImage: UIImageView!
@IBOutlet weak var rightImage: UIImageView!
@IBOutlet weak var left... | mit |
Brightify/ReactantUI | Sources/Tokenizer/Properties/AssignableProperty.swift | 1 | 3261 | //
// AssignablePropertyDescription.swift
// ReactantUI
//
// Created by Tadeas Kriz.
// Copyright © 2017 Brightify. All rights reserved.
//
import Foundation
#if canImport(UIKit)
import UIKit
#endif
/**
* Standard typed property obtained from an XML attribute.
*/
public struct AssignableProperty<T: AttributeS... | mit |
Zewo/TrieRouteMatcher | Package.swift | 1 | 299 | import PackageDescription
let package = Package(
name: "TrieRouteMatcher",
dependencies: [
.Package(url: "https://github.com/Zewo/HTTP.git", majorVersion: 0, minor: 7),
.Package(url: "https://github.com/Zewo/PathParameterMiddleware.git", majorVersion: 0, minor: 7),
]
)
| mit |
brentsimmons/Frontier | BeforeTheRename/Frontier/DB/DBViewController.swift | 1 | 250 | //
// DBViewController.swift
//
//
// Created by Brent Simmons on 4/19/17.
//
//
import Cocoa
class DBViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do view setup here.
}
}
| gpl-2.0 |
mownier/pyrobase | Pyrobase/Pyrobase.swift | 1 | 2029 | //
// Pyrobase.swift
// Pyrobase
//
// Created by Mounir Ybanez on 01/05/2017.
// Copyright © 2017 Ner. All rights reserved.
//
public class Pyrobase {
internal var path: RequestPathProtocol
internal var request: RequestProtocol
public var baseURL: String {
return path.baseURL
}
... | mit |
Quick/Spry | Source/Spry/Core/Helpers.swift | 1 | 327 | //
// Helpers.swift
// Spry
//
// Created by Shahpour Benkau on 22/02/2017.
//
//
import Foundation
extension Sequence {
func all(_ fn: (Iterator.Element) -> Bool) -> Bool {
for item in self {
if !fn(item) {
return false
}
}
return true
... | apache-2.0 |
Diego5529/tcc-swift3 | tcc-swift3/src/controllers/view/form/Commons/Login.swift | 2 | 272 | //
// Login.swift
// Former-Demo
//
// Created by Ryo Aoyama on 11/8/15.
// Copyright © 2015 Ryo Aoyama. All rights reserved.
//
import UIKit
final class Login {
static let sharedInstance = Login()
var username: String?
var password: String?
} | mit |
lukejmann/FBLA2017 | Pods/Instructions/Sources/Helpers/CoachMarkLayoutHelper.swift | 1 | 9860 | // CoachMarkLayoutHelper.swift
//
// Copyright (c) 2016 Frédéric Maquin <fred@ephread.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, including without limitat... | mit |
keyeMyria/edx-app-ios | Source/OEXStyles+Swift.swift | 4 | 3515 | //
// OEXStyles+Swift.swift
// edX
//
// Created by Ehmad Zubair Chughtai on 25/05/2015.
// Copyright (c) 2015 edX. All rights reserved.
//
import Foundation
import UIKit
extension OEXStyles {
var navigationTitleTextStyle : OEXTextStyle {
return OEXTextStyle(weight: .SemiBold, size: .Base, color ... | apache-2.0 |
relayr/apple-sdk | Sources/common/services/API/APIUsers.swift | 1 | 7530 | import ReactiveSwift
import Result
import Foundation
internal extension API {
/// User entity as represented on the relayr API platform.
struct User: JSONable {
let identifier: String
var email: String?
var nickname: String?
var name: (first: String?, last: String?)
var ... | mit |
tomas789/JustLog | JustLog/Extensions/Data+Representation.swift | 1 | 304 | //
// Data+Representation.swift
// JustLog
//
// Created by Alberto De Bortoli on 15/12/2016.
// Copyright © 2017 Just Eat. All rights reserved.
//
import Foundation
extension Data {
func stringRepresentation() -> String {
return String(data: self, encoding: .utf8) ?? ""
}
}
| apache-2.0 |
dnosk/Explore | Example/Explore/ViewController.swift | 1 | 1164 | //
// ViewController.swift
// Explore
//
// Created by dnosk on 04/26/2017.
// Copyright (c) 2017 dnosk. All rights reserved.
//
import Explore
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var tableView: UITableView!
var appsDownloaded = [String]()
override func view... | mit |
bm842/TradingLibrary | Sources/OandaRestV1Instrument.swift | 2 | 9009 | /*
The MIT License (MIT)
Copyright (c) 2016 Bertrand Marlier
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, mer... | mit |
pocketworks/Dollar.swift | Cent/Cent/Int.swift | 1 | 2807 | //
// Int.swift
// Cent
//
// Created by Ankur Patel on 6/30/14.
// Copyright (c) 2014 Encore Dev Labs LLC. All rights reserved.
//
import Foundation
extension Int {
/// Invoke a callback n times
///
/// :param callback The function to invoke that accepts the index
public func times(callback:... | mit |
natecook1000/swift | test/PlaygroundTransform/high_performance.swift | 7 | 1253 | // RUN: %empty-directory(%t)
// RUN: cp %s %t/main.swift
// RUN: %target-build-swift -Xfrontend -playground -Xfrontend -playground-high-performance -o %t/main %S/Inputs/PlaygroundsRuntime.swift %t/main.swift
// RUN: %target-codesign %t/main
// RUN: %target-run %t/main | %FileCheck %s
// RUN: %target-build-swift -Xfront... | apache-2.0 |
danfsd/FolioReaderKit | Example/Example/ViewController.swift | 1 | 1987 | //
// ViewController.swift
// Example
//
// Created by Heberti Almeida on 08/04/15.
// Copyright (c) 2015 Folio Reader. All rights reserved.
//
import UIKit
import FolioReaderKit
class ViewController: UIViewController {
@IBOutlet var bookOne: UIButton!
@IBOutlet var bookTwo: UIButton!
let epubSampleF... | bsd-3-clause |
coodly/TalkToCloud | Sources/TalkToCloud/APIKeyConsumer.swift | 1 | 683 | /*
* Copyright 2016 Coodly LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in wr... | apache-2.0 |
codercd/DPlayer | DPlayer/Model.swift | 1 | 1721 | //
// Model.swift
// DPlayer
//
// Created by LiChendi on 16/4/19.
// Copyright © 2016年 LiChendi. All rights reserved.
//
import UIKit
class Model: NSObject {
}
enum LiveBaseURL:String {
case rtmp = "rtmp://live.quanmin.tv/live/1456011"
case hls = "http://hls.quanmin.tv/live/1456011/playlist.m3u8"
c... | mit |
wunshine/FoodStyle | FoodStyle/FoodStyle/Classes/View/WXTextField.swift | 1 | 845 | //
// WXTextField.swift
// FoodStyle
//
// Created by Woz Wong on 16/3/5.
// Copyright © 2016年 code4Fun. All rights reserved.
//
import UIKit
class WXTextField: UITextField {
override func textRectForBounds(bounds: CGRect) -> CGRect {
super.textRectForBounds(bounds)
return CGRectMake(bounds.o... | mit |
ociata/OCIKeyboardAdjuster | OCIKeyboardAdjuster.swift | 1 | 7643 | //
// KeyboardAdjuster.swift
//
//
// Created by Hristo Todorov - Oci on 6/5/15.
// Copyright (c) 2015
//
import UIKit
class OCIKeyboardAdjuster: NSObject
{
static let sharedKeyboardAdjuster = OCIKeyboardAdjuster()
weak var focusedControl: UIView?
private override init() {
//this way ... | mit |
RCacheaux/BitbucketKit | Carthage/Checkouts/Swinject/Sources/SwinjectStoryboard/Container+SwinjectStoryboard.swift | 1 | 2302 | //
// Container+SwinjectStoryboard.swift
// Swinject
//
// Created by Yoichi Tagaya on 11/28/15.
// Copyright © 2015 Swinject Contributors. All rights reserved.
//
#if os(iOS) || os(OSX) || os(tvOS)
extension Container {
/// Adds a registration of the specified view or window controller that is configured in a... | apache-2.0 |
adamnemecek/SortedArray.swift | Cmdline/main.swift | 1 | 931 | //
// main.swift
// Cmdline
//
// Created by Adam Nemecek on 5/6/17.
//
//
import Foundation
import SortedArray
let s = SortedSet([5,2,1,2,3,6,7,8])
let a = [1,2,3,4,5,6]
let b = [1, 2, 2, 3, 3, 5, 6]
print(b)
//var u = UnionIterator(a: a, b: b) { $0 < $1 }
//print(s.contains(1))
//while let n = u.next() {
//... | mit |
KBryan/SwiftFoundation | Darwin Support/NSUUID.swift | 1 | 1268 | //
// NSUUID.swift
// SwiftFoundation
//
// Created by Alsey Coleman Miller on 7/4/15.
// Copyright © 2015 PureSwift. All rights reserved.
//
import Foundation
public extension NSUUID {
convenience init(byteValue: uuid_t) {
var value = byteValue
let buffer = withUnsafeMu... | mit |
chizcake/ReplayKitExample | ReplayKitExampleStarter/Carthage/Checkouts/CleanroomLogger/Tests/CleanroomLoggerTests/LogSeverityTests.swift | 2 | 974 | //
// LogSeverityTests.swift
// Cleanroom Project
//
// Created by Claudio Romandini on 5/19/15.
// Copyright © 2015 Gilt Groupe. All rights reserved.
//
import XCTest
import CleanroomLogger
class LogSeverityTests: XCTestCase {
func testLogSeverityEquality() {
XCTAssertTrue(LogSeverity.debug == LogSe... | mit |
EstebanVallejo/sdk-ios | MercadoPagoSDK/MercadoPagoSDK/MercadoPago.swift | 1 | 17199 |
//
// MercadoPago.swift
// MercadoPagoSDK
//
// Created by Matias Gualino on 28/12/14.
// Copyright (c) 2014 com.mercadopago. All rights reserved.
//
import Foundation
import UIKit
public class MercadoPago : NSObject {
public class var PUBLIC_KEY : String {
return "public_key"
}
public c... | mit |
xmartlabs/XLSlidingContainer | Example/Example/ScrollViewController.swift | 1 | 1800 | //
// ScrollViewController.swift
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.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, including without ... | mit |
abdullahselek/SwiftyNotifications | Sample/Sample/ViewController.swift | 1 | 2983 | //
// ViewController.swift
// Sample
//
// Created by Abdullah Selek on 03/04/2017.
// Copyright © 2017 Abdullah Selek. All rights reserved.
//
import UIKit
import SwiftyNotifications
class ViewController: UIViewController, SwiftyNotificationsDelegate {
private var notification: SwiftyNotifications!
priv... | mit |
tarun-talentica/TalNet | Source/Request/NetworkService.swift | 2 | 1023 | //
// NetworkService.swift
// GSignIn
//
// Created by Tarun Sharma on 07/05/16.
// Copyright © 2016 Appcoda. All rights reserved.
//
import Foundation
public protocol NetworkService {
var host: String { get }
var port: Int? {get}
var scheme: String { get }
var serviceType: NSURLRequestNetworkServiceType ... | mit |
agrippa1994/iOS-PLC | PLC/CoreData/Entities/StaticData+CoreDataProperties.swift | 1 | 374 | //
// StaticData+CoreDataProperties.swift
// PLC
//
// Created by Manuel Stampfl on 08.09.15.
// Copyright © 2015 mani1337. All rights reserved.
//
// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu
// to delete and recreate this implementation file for your updated model.
//
import Foun... | mit |
kallahir/MarvelFinder | MarvelFinder/CharacterDetailCollectionCell.swift | 1 | 359 | //
// CharacterDetailCollectionCell.swift
// MarvelFinder
//
// Created by Itallo Rossi Lucas on 10/01/17.
// Copyright © 2017 Kallahir Labs. All rights reserved.
//
import UIKit
class CharacterDetailCollectionCell: UICollectionViewCell {
@IBOutlet weak var collectionImage: UIImageView!
@IBOutlet wea... | mit |
wireapp/wire-ios | Wire-iOS Tests/DeviceManagement/CoreDataFixture+MockUserClient.swift | 1 | 1530 | //
// Wire
// Copyright (C) 2018 Wire Swiss GmbH
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This progr... | gpl-3.0 |
wireapp/wire-ios | Wire-iOS Tests/ConversationCell/ConversationCellBurstTimestampViewSnapshotTests.swift | 1 | 1759 | //
// Wire
// Copyright (C) 2021 Wire Swiss GmbH
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This progr... | gpl-3.0 |
derrh/CanvasKit | CanvasKitTests/Model Tests/CKIActivityStreamCollaborationItemTests.swift | 3 | 1036 | //
// CKIActivityStreamCollaborationItemTests.swift
// CanvasKit
//
// Created by Nathan Lambson on 7/17/14.
// Copyright (c) 2014 Instructure. All rights reserved.
//
import UIKit
import XCTest
class CKIActivityStreamCollaborationItemTests: XCTestCase {
override func setUp() {
super.setUp()
... | mit |
terhechte/SourceKittenDaemon | Tests/SourceKittenDaemonTests/Fixtures/Sources/CompleteMethodFromFrameworkFixture.swift | 2 | 70 | import Foundation
import AVFoundation
let devices = AVCaptureDevice.
| mit |
novi/i2c-swift-example | Sources/I2CDeviceModule/SHT21.swift | 1 | 1397 | //
// SHT21.swift
// I2CDeviceModule
//
// Created by Yusuke Ito on 3/1/17.
// Copyright © 2017 Yusuke Ito. All rights reserved.
//
import Foundation
import I2C
public final class SHT21 {
public let address: UInt8
public let device: I2CDevice
public init(device: I2CDevice, address: UInt8 = 0x40) {
... | mit |
HasanEdain/NPCColorPicker | NPCColorPicker/NPCPaleteUtility.swift | 1 | 4578 | //
// NPCPaleteUtility.swift
// NPCColorPicker
//
// Created by Hasan D Edain and Andrew Bush on 12/6/15.
// Copyright © 2015-2017 NPC Unlimited. All rights reserved.
//
import UIKit
open class NPCPaleteUtility {
open static func twelveColorWheel()->[UIColor] {
let colorArray =
[NPCColorUtili... | mit |
ByteriX/BxInputController | BxInputController/Sources/Rows/Boolean/View/BxInputCheckRowBinder.swift | 1 | 1126 | /**
* @file BxInputCheckRowBinder.swift
* @namespace BxInputController
*
* @details Binder for check box row subclasses
* @date 17.03.2017
* @author Sergey Balalaev
*
* @version last in https://github.com/ByteriX/BxInputController.git
* @copyright The MIT License (MIT) https://opensource.org/licenses/MIT
* C... | mit |
LunaGao/cnblogs-Mac-Swift | CNBlogsForMac/WebApi/BaseWebApi.swift | 1 | 1904 | //
// BaseWebApi.swift
// CNBlogsForMac
//
// Created by Luna Gao on 15/11/16.
// Copyright © 2015年 gao.luna.com. All rights reserved.
//
import Foundation
class BaseWebApi : NSObject {
func basicRequest(callback:(String?)->Void){
let basicAuth = "Basic 这个值是根据ClientId和ClientSercret计算得来,这里隐藏"
... | mit |
therealglazou/quaxe-for-swift | quaxe/protocols/core/DOMString.swift | 1 | 226 | /**
* Quaxe for Swift
*
* Copyright 2016-2017 Disruptive Innovations
*
* Original author:
* Daniel Glazman <daniel.glazman@disruptive-innovations.com>
*
* Contributors:
*
*/
public typealias DOMString = String
| mpl-2.0 |
noppoMan/SwiftJNChatApp | Package.swift | 1 | 655 | import PackageDescription
let package = Package(
name: "SwiftJNChatApp",
targets: [
Target(name: "Config"),
Target(name: "Migration", dependencies: ["Config"]),
Target(name: "SwiftJNChatApp", dependencies: ["Config"])
],
dependencies: [
.Package(url: "https://github.com/... | mit |
q231950/appwatch | AppWatch/ViewControllers/TimeTableViewController.swift | 1 | 1268 | //
// TimeTableViewController.swift
// AppWatch
//
// Created by Martin Kim Dung-Pham on 25.08.15.
// Copyright © 2015 Martin Kim Dung-Pham. All rights reserved.
//
import AppKit
class TimeTableViewController: NSViewController {
@IBOutlet weak var collectionView: NSCollectionView!
override func ... | mit |
natecook1000/swift-compiler-crashes | crashes-duplicates/18378-swift-lexer-leximpl.swift | 11 | 308 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
let d {
deinit {
protocol e {
let b =
{
case
{
func c
{
if true {
class a {
class
case ,
let {
{
{
[ {
{
[ [ {
{
{
{
{
{
{
{
{
{ {
{
c
"
"
| mit |
praca-japao/156 | PMC156Inteligente/MyProfileTableViewController.swift | 1 | 3269 | //
// MyProfileTableViewController.swift
// PMC156Inteligente
//
// Created by Giovanni Pietrangelo on 11/29/15.
// Copyright © 2015 Sigma Apps. All rights reserved.
//
import UIKit
class MyProfileTableViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
... | gpl-2.0 |
albertinopadin/SwiftBreakout | Breakout/AppDelegate.swift | 1 | 2153 | //
// AppDelegate.swift
// Breakout
//
// Created by Albertino Padin on 10/26/14.
// Copyright (c) 2014 Albertino Padin. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, did... | gpl-2.0 |
tdscientist/ShelfView-iOS | Example/Pods/Kingfisher/Sources/General/ImageSource/ImageDataProvider.swift | 1 | 5571 | //
// ImageDataProvider.swift
// Kingfisher
//
// Created by onevcat on 2018/11/13.
//
// Copyright (c) 2018 Wei Wang <onevcat@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the S... | mit |
therealbnut/swift | stdlib/public/SDK/Foundation/NSString.swift | 9 | 4420 | //===----------------------------------------------------------------------===//
//
// 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... | apache-2.0 |
Fenrikur/ef-app_ios | EurofurenceTests/Presenter Tests/Dealer Detail/Presenter Tests/WhenBindingAboutTheArtistComponent_DealerDetailPresenterShould.swift | 1 | 1348 | @testable import Eurofurence
import EurofurenceModel
import XCTest
class WhenBindingAboutTheArtistComponent_DealerDetailPresenterShould: XCTestCase {
func testBindTheArtistDescriptionOntoTheComponent() {
let aboutTheArtistViewModel = DealerDetailAboutTheArtistViewModel.random
let viewModel = FakeD... | mit |
grandiere/box | box/Metal/Texture/MetalTexture.swift | 1 | 1392 | import UIKit
import MetalKit
class MetalTexture
{
let totalFrames:Int
var currentFrame:Int
private var frameTick:Int
private let frames:[MTLTexture]
private let ticksPerFrame:Int
init(
ticksPerFrame:Int,
images:[UIImage],
textureLoader:MTKTextureLoader)
{
... | mit |
serieuxchat/SwiftySRP | SwiftySRP/SRPData+BigIntType.swift | 1 | 9367 | //
// SRPData+BigIntType.swift
// SwiftySRP
//
// Created by Sergey A. Novitsky on 20/03/2017.
// Copyright © 2017 Flock of Files. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to dea... | mit |
jatiwn/geocore-tutorial-1 | Carthage/Checkouts/PromiseKit/Categories/Foundation/NSNotificationCenter+Promise.swift | 1 | 986 | import Foundation.NSNotification
import PromiseKit
/**
To import the `NSNotificationCenter` category:
use_frameworks!
pod "PromiseKit/Foundation"
Or `NSNotificationCenter` is one of the categories imported by the umbrella pod:
use_frameworks!
pod "PromiseKit"
And then in your sources:
impor... | apache-2.0 |
tokyovigilante/CesiumKit | CesiumKit/Core/EllipsoidGeodesic.swift | 1 | 14805 | //
// EllipsoidGeodesic.swift
// CesiumKit
//
// Created by Ryan Walklin on 2/11/2015.
// Copyright © 2015 Test Toast. All rights reserved.
//
import Foundation
/**
* Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.
*
* @alias EllipsoidGeodesic
* @constructor
*
* @par... | apache-2.0 |
sarahspins/Loop | Loop/Extensions/NSBundle.swift | 1 | 683 | //
// NSBundle.swift
// Loop
//
// Created by Nate Racklyeft on 7/28/16.
// Copyright © 2016 Nathan Racklyeft. All rights reserved.
//
import Foundation
extension NSBundle {
var shortVersionString: String {
return objectForInfoDictionaryKey("CFBundleShortVersionString") as! String
}
var bund... | apache-2.0 |
3drobotics/SwiftIO | Sources/UDPChannel.swift | 1 | 9242 | //
// UDPMavlinkReceiver.swift
// SwiftIO
//
// Created by Jonathan Wight on 4/22/15.
//
// Copyright (c) 2014, Jonathan Wight
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * R... | mit |
jisudong/study | MyPlayground.playground/Pages/可选链式调用.xcplaygroundpage/Contents.swift | 1 | 1812 | //: [Previous](@previous)
import Foundation
class Person {
var residence: Residence?
}
class Residence {
var rooms = [Room]()
var address: Address?
var numberOfRooms: Int {
return rooms.count
}
subscript(i: Int) -> Room{
get {
return rooms[i]
}
set ... | mit |
STShenZhaoliang/Swift2Guide | Swift2Guide/Swift100Tips/Swift100Tips/ErrorController.swift | 1 | 3869 | //
// ErrorController.swift
// Swift100Tips
//
// Created by 沈兆良 on 16/5/30.
// Copyright © 2016年 ST. All rights reserved.
//
import UIKit
class ErrorController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let path = NSBundle.mainBundle().pathForResource("", ofType: ... | mit |
AaronMT/firefox-ios | Client/Frontend/AuthenticationManager/PagingPasscodeViewController.swift | 9 | 3110 | /* 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
private let PaneSwipeDuration: TimeInterval = 0.3
/// Base class for implementing a Passcode co... | mpl-2.0 |
heitorgcosta/Quiver | Quiver/Validating/Extensions/Validator+Misc.swift | 1 | 696 | //
// Validator+Misc.swift
// Quiver
//
// Created by Heitor Costa on 20/10/17.
// Copyright © 2017 Heitor Costa. All rights reserved.
//
import Foundation
// Misc Validators
public extension Validator {
static func required(message: String? = nil) -> Validator {
return RequiredValidator().with(messag... | mit |
rnystrom/GitHawk | Classes/Repository/RepositoryIssueSummaryModel+Filterable.swift | 1 | 699 | //
// RepositoryIssueSummaryModel+Filterable.swift
// Freetime
//
// Created by Ryan Nystrom on 10/14/17.
// Copyright © 2017 Ryan Nystrom. All rights reserved.
//
import Foundation
extension RepositoryIssueSummaryModel: Filterable {
func match(query: String) -> Bool {
if query.rangeOfCharacter(from:... | mit |
djq993452611/YiYuDaoJia_Swift | YiYuDaoJia/YiYuDaoJia/Classes/Main/Controller/BaseViewController.swift | 1 | 2249 | //
// BaseViewController.swift
// YiYuDaoJia
//
// Created by 蓝海天网Djq on 2017/4/25.
// Copyright © 2017年 蓝海天网Djq. All rights reserved.
//
import UIKit
class BaseViewController: UIViewController {
// MARK: 定义属性
var contentView : UIView?
var baseVM : BaseViewModel!
// MARK: 懒加载属性
filep... | mit |
adrfer/swift | validation-test/compiler_crashers_fixed/25512-swift-genericsignature-get.swift | 13 | 240 | // RUN: not %target-swift-frontend %s -parse
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
let c{{let c{class
case,
| apache-2.0 |
frootloops/swift | validation-test/Sema/type_checker_perf/slow/rdar35213699.swift | 1 | 359 | // RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=1
// REQUIRES: tools-release,no_asserts
func test() {
let x: UInt = 1 * 2 + 3 * 4 + 5 * 6 + 7 * 8 + 9 * 10 + 11 * 12 + 13 * 14
// expected-error@-1 {{expression was too complex to be solved in reasonable time; consider breaking up the express... | apache-2.0 |
IVA Swift GitHub Code Dataset
Dataset Description
This is the raw IVA Swift dataset extracted from GitHub. It contains uncurated Swift files gathered with the purpose to train a code generation model.
The dataset consists of 753693 swift code files from GitHub totaling ~700MB of data. The dataset was created from the public GitHub dataset on Google BiqQuery.
How to use it
To download the full dataset:
from datasets import load_dataset
dataset = load_dataset('mvasiliniuc/iva-swift-codeint', split='train')
from datasets import load_dataset
dataset = load_dataset('mvasiliniuc/iva-swift-codeint', split='train')
print(dataset[77723])
#OUTPUT:
{
"repo_name":"simpleandpretty/decider-ios",
"path":"MessagesExtension/MediaResources.swift",
"copies":"1",
"size":"1232",
"content":"import Foundation\nimport UIKit\n\nclass MediaResources {\n\n static func mediaURL(forGameOption option:FightMove) -> URL {\n let bundle = Bundle.main\n guard\n let mediaURL = bundle.url(forResource: option.rawValue, withExtension: \"mp4\")\n ...",
"license":"gpl-3.0"
}
Data Structure
Data Fields
| Field | Type | Description |
|---|---|---|
| repo_name | string | name of the GitHub repository |
| path | string | path of the file in GitHub repository |
| copies | string | number of occurrences in dataset |
| code | string | content of source file |
| size | string | size of the source file in bytes |
| license | string | license of GitHub repository |
Instance
{
"repo_name":"simpleandpretty/decider-ios",
"path":"MessagesExtension/MediaResources.swift",
"copies":"1",
"size":"1232",
"content":"import Foundation\nimport UIKit\n\nclass MediaResources {\n\n static func mediaURL(forGameOption option:FightMove) -> URL {\n let bundle = Bundle.main\n guard\n let mediaURL = bundle.url(forResource: option.rawValue, withExtension: \"mp4\")\n ...",
"license":"gpl-3.0"
}
Languages
The dataset contains only Swift files.
{
"Swift": [".swift"]
}
Licenses
Each entry in the dataset contains the associated license. The following is a list of licenses involved and their occurrences.
{
"agpl-3.0": 2775,
"apache-2.0": 180178,
"artistic-2.0": 314,
"bsd-2-clause": 5342,
"bsd-3-clause": 11429,
"cc0-1.0": 2718,
"epl-1.0": 980,
"gpl-2.0": 15751,
"gpl-3.0": 33074,
"isc": 1647,
"lgpl-2.1": 1741,
"lgpl-3.0": 6150,
"mit": 476518,
"mpl-2.0": 11799,
"unlicense": 3277
}
Dataset Statistics
{
"Total size": "~712 MB",
"Number of files": 753693,
"Number of files under 500 bytes": 129827,
"Average file size in bytes": 4245,
}
Dataset Creation
The dataset was created using Google Query for Github: https://cloud.google.com/blog/topics/public-datasets/github-on-bigquery-analyze-all-the-open-source-code
The following steps were pursued for data gathering:
- Creation of a dataset and a table in Google Big Query Project.
- Creation of a bucket in Google Cloud Storage.
- Creation of a query in Google Big Query Project.
- Running the query with the setting to output the results in the dataset and table created at step one.
- Exporting the resulting dataset into the bucket created in step 2. Export format of JSON with gzip compression.
The result of these steps leads to the following results:
- 2.7 TB Processed,
- number of extracted rows/Swift files was 464,215
- total logical bytes 1.46 GB.
- The result amounts to 7 json.gz files in a total of 700 MB
The SQL Query used is:
SELECT
f.repo_name, f.path, c.copies, c.size, c.content, l.license
FROM
(select f.*, row_number() over (partition by id order by path desc) as seqnum from `bigquery-public-data.github_repos.files` AS f) f
JOIN
`bigquery-public-data.github_repos.contents` AS c
ON
f.id = c.id AND seqnum=1
JOIN
`bigquery-public-data.github_repos.licenses` AS l
ON
f.repo_name = l.repo_name
WHERE
NOT c.binary AND ((f.path LIKE '%.swift') AND (c.size BETWEEN 0 AND 1048575))
Data Splits
The dataset only contains a train split.
Using the curated version of this dataset, a split was made into multiple repositories:
- Clean Version: https://huggingface.co/datasets/mvasiliniuc/iva-swift-codeint-clean
- Clean Version Train: https://huggingface.co/datasets/mvasiliniuc/iva-swift-codeint-clean-train
- Clean Version Valid: https://huggingface.co/datasets/mvasiliniuc/iva-swift-codeint-clean-valid
Considerations for Using the Data
The dataset comprises source code from various repositories, potentially containing harmful or biased code, along with sensitive information such as passwords or usernames.
Additional Information
Dataset Curators
Licensing Information
- The license of this open-source dataset is: other.
- The dataset is gathered from open-source repositories on GitHub using BigQuery.
- Find the license of each entry in the dataset in the corresponding license column.
Citation Information
@misc {mircea_vasiliniuc_2023,
author = { {Mircea Vasiliniuc} },
title = { iva-swift-codeint (Revision c09ebf8) },
year = 2023,
url = { https://huggingface.co/datasets/mvasiliniuc/iva-swift-codeint },
doi = { 10.57967/hf/0778 },
publisher = { Hugging Face }
}
- Downloads last month
- 21