repo_name stringlengths 6 91 | path stringlengths 8 968 | copies stringclasses 210
values | size stringlengths 2 7 | content stringlengths 61 1.01M | license stringclasses 15
values | hash stringlengths 32 32 | line_mean float64 6 99.8 | line_max int64 12 1k | alpha_frac float64 0.3 0.91 | ratio float64 2 9.89 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ilyapuchka/SwiftNetworking | SwiftNetworking/NSData+Multipart.swift | 1 | 7842 | //
// NSData+Multipart.swift
// SwiftNetworking
//
// Created by Ilya Puchka on 11.09.15.
// Copyright © 2015 Ilya Puchka. All rights reserved.
//
import Foundation
public struct MultipartBodyItem: APIRequestDataEncodable, Equatable {
let data: NSData
let contentType: MIMEType
let headers: [HTTPHeader... | mit | 35fdd2424d7c3a0aed3adf077d848408 | 35.138249 | 111 | 0.647494 | 5.101496 | false | false | false | false |
lieonCX/Live | Live/Others/Lib/RITLImagePicker/Photofiles/Photo/RITLPhotoPreviewController.swift | 1 | 1725 | //
// RITLPhotoPreviewController.swift
// RITLImagePicker-Swift
//
// Created by YueWen on 2017/1/22.
// Copyright © 2017年 YueWen. All rights reserved.
//
import UIKit
import Photos
/// 响应3D Touch的视图
class RITLPhotoPreviewController: UIViewController
{
/// 当前显示的资源对象
var showAsset : PHAsset = PHAsset()
... | mit | bae73f1c6c57ebd9979e78ef8f6d01d9 | 22.623188 | 111 | 0.58589 | 4.969512 | false | false | false | false |
AlphaJian/LarsonApp | LarsonApp/LarsonApp/Class/JobDetail/WorkOrderViews/WorkOrderScrollView.swift | 1 | 5466 | //
// WorkOrderScrollView.swift
// LarsonApp
//
// Created by Perry Z Chen on 11/10/16.
// Copyright © 2016 Jian Zhang. All rights reserved.
//
import UIKit
class WorkOrderScrollView: UIView {
/*
// Only override draw() if you perform custom drawing.
// An empty implementation adversely affects perfo... | apache-2.0 | 74202722b691cd6ec97d7995a83bdff8 | 43.430894 | 161 | 0.691491 | 4.832007 | false | false | false | false |
bluquar/emoji_keyboard | EmojiKeyboard/EmojiSelectKB/KBButton.swift | 1 | 4124 | //
// KBButton.swift
// EmojiKeyboard
//
// Created by Chris Barker on 10/2/14.
// Copyright (c) 2014 Chris Barker. All rights reserved.
//
import UIKit
class KBButton: NSObject {
var parentView: UIView
var layoutManager: ButtonLayoutManager
var button: UIButton
var image: UIImageView
var... | gpl-2.0 | 99c65cb9a7239c7d7a3d84a6251e0dfe | 46.402299 | 203 | 0.682105 | 4.273575 | false | false | false | false |
AnthonyMDev/AmazonS3RequestManager | Example/Tests/AmazonS3ACLTests.swift | 2 | 12214 | //
// AmazonS3ACLTests.swift
// AmazonS3RequestManager
//
// Created by Anthony Miller on 6/9/15.
// Copyright (c) 2015 Anthony Miller. All rights reserved.
//
import Quick
import Nimble
import AmazonS3RequestManager
class AmazonS3ACLSpec: QuickSpec {
override func spec() {
describe("Predefi... | mit | 6c23bae9bc7ffa155f05e89297c58f0c | 42.935252 | 120 | 0.447519 | 6.12845 | false | true | false | false |
vimeo/VimeoNetworking | Sources/Shared/Requests/Request+Video.swift | 1 | 4223 | //
// Request+Video.swift
// VimeoNetworkingExample-iOS
//
// Created by Huebner, Rob on 4/5/16.
// Copyright © 2016 Vimeo. 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 deal
// i... | mit | 0f5d31c527c7c8c46f276975a1d6ed79 | 31.728682 | 130 | 0.664377 | 4.544672 | false | false | false | false |
zisko/swift | stdlib/public/core/Filter.swift | 1 | 14053 | //===--- Filter.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... | apache-2.0 | 595b30309efc43bcc45cba54e175554e | 33.026634 | 113 | 0.66975 | 4.216322 | false | false | false | false |
MartinLasek/vaporberlinBE | Sources/App/Backend/Helper.swift | 1 | 601 | final class Helper {
static func validateEmail(_ email: String) -> Bool {
/// email must at least have 6 characters e.g: a@b.cd
let minLength = 6
if
email.range(of: "@") == nil ||
email.range(of: ".") == nil ||
email.count < minLength
{
return false
}
return tru... | mit | 5269b97687e561912ea71a96a7a983dc | 23.04 | 70 | 0.590682 | 4.088435 | false | false | false | false |
exyte/Macaw | Source/animation/layer_animation/FuncBounds.swift | 1 | 2753 | func solveEquation(a: Double, b: Double, c: Double) -> (s1: Double?, s2: Double?) {
let epsilon: Double = 0.000000001
if abs(a) < epsilon {
if abs(b) < epsilon {
return (.none, .none)
}
let s = -c / b
if 0.0 < s && s < 1.0 {
return (s, .none)
}
... | mit | 3b4a3e720b36f3f75ef8cb2dc81bccba | 22.134454 | 83 | 0.401744 | 2.780808 | false | false | false | false |
rdgonzalez85/BTHorizontalPageableView | BTHorizontalPageableView/BTHorizontalPageableView/BTHorizontalPageableView.swift | 1 | 5738 | //
// BTHorizontalPageableView.swift
//
// Created by Rodrigo Gonzalez on 1/21/16.
// Copyright © 2016 Rodrigo Gonzalez. All rights reserved.
//
import UIKit
/**
The BTHorizontalPageableView class defines a rectangular area on the screen and the interfaces for managing the content in that area. It provides suppo... | mit | 2c65870fcb99909670da95d295429dde | 30.877778 | 281 | 0.602231 | 5.336744 | false | false | false | false |
LimCrazy/SwiftProject3.0-Master | SwiftPreject-Master/SwiftPreject-Master/Class/CustomTabBarVC.swift | 1 | 3414 | //
// CustomTabBarVC.swift
// SwiftPreject-Master
//
// Created by lim on 2016/12/11.
// Copyright © 2016年 Lim. All rights reserved.
//
import UIKit
class CustomTabBarVC: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
func setupUI() -> ... | apache-2.0 | fbf1e5d972dcb669aa33678d397379a2 | 44.689189 | 172 | 0.683821 | 4.59375 | false | true | false | false |
fs/ios-base-swift | Swift-Base/Tools/Views/TextView.swift | 1 | 1651 | //
// TextView.swift
// Tools
//
// Created by Oleg Gorelov on 30/05/2018.
// Copyright © 2018 Flatstack. All rights reserved.
//
import UIKit
@IBDesignable public class TextView: UITextView {
// MARK: - Instance Properties
@IBInspectable public var bottomOutset: CGFloat {
get {
retu... | mit | 0242338e2a14fae0e11f872e64ffa5ef | 23.626866 | 110 | 0.585455 | 4.824561 | false | false | false | false |
wrutkowski/Lucid-Weather-Clock | Pods/Charts/Charts/Classes/Renderers/ChartYAxisRendererHorizontalBarChart.swift | 6 | 11759 | //
// ChartYAxisRendererHorizontalBarChart.swift
// Charts
//
// Created by Daniel Cohen Gindi on 3/3/15.
//
// Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
// A port of MPAndroidChart for iOS
// Licensed under Apache License 2.0
//
// https://github.com/danielgindi/Charts
//
import Foundation
import Core... | mit | 80541dbc58da248a2ecf96dc08a21418 | 32.985549 | 233 | 0.535675 | 5.733301 | false | false | false | false |
mmllr/CleanTweeter | CleanTweeter/UseCases/NewPost/UI/Presenter/TagAndMentionHighlightingTransformer.swift | 1 | 1306 |
import Foundation
class TagAndMentionHighlightingTransformer : ValueTransformer {
let resourceFactory: ResourceFactory
init(factory: ResourceFactory) {
self.resourceFactory = factory
super.init()
}
override class func transformedValueClass() -> AnyClass {
return NSAttributedString.self
}
override class ... | mit | 03b18801fdb2a4951da019544a3bd069 | 33.864865 | 204 | 0.744186 | 3.644068 | false | false | false | false |
pixelmaid/piper | Palette-Knife/SocketManager.swift | 2 | 5085 | //
// SocketManager.swift
// PaletteKnife
//
// Created by JENNIFER MARY JACOBS on 6/27/16.
// Copyright © 2016 pixelmaid. All rights reserved.
//
import Foundation
import Starscream
//central manager for all requests to web socket
class SocketManager: WebSocketDelegate{
var socket = WebSocket(url: NSURL(str... | mit | 525b48d219d28b2dfe6a23f3b0983bad | 29.08284 | 114 | 0.531275 | 4.551477 | false | false | false | false |
jjochen/photostickers | MessagesExtension/Scenes/Messages App/Application.swift | 1 | 1303 | //
// MessageApp.swift
// PhotoStickers
//
// Created by Jochen on 29.03.19.
// Copyright © 2019 Jochen Pfeiffer. All rights reserved.
//
import Foundation
final class Application {
private let stickerService: StickerService
private let imageStoreService: ImageStoreService
private let stickerRenderSer... | mit | 75e1ddec21036c7aea21f228e5289695 | 33.263158 | 148 | 0.745776 | 5.007692 | false | false | false | false |
abertelrud/swift-package-manager | Sources/SPMTestSupport/SwiftPMProduct.swift | 2 | 1298 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2019 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt f... | apache-2.0 | a0a8c02f331be9fbe2f59c2de702aefe | 29.904762 | 80 | 0.581664 | 5.430962 | false | true | false | false |
SwiftStudies/OysterKit | Sources/STLR/Generated/Extensions/STLR+CustomStringConvertable.swift | 1 | 4474 | // Copyright (c) 2016, RED When Excited
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this
// ... | bsd-2-clause | 87ca12dfea49570d054cb7881a5eb35c | 37.239316 | 137 | 0.639473 | 4.960089 | false | false | false | false |
manticarodrigo/FieldTextView | FieldTextView.swift | 1 | 1576 | //
// FieldTextView.swift
// Edumate
//
// Created by Rodrigo Mantica on 12/9/16.
// Copyright © 2016 Rodrigo Mantica. All rights reserved.
//
import UIKit
class FieldTextView : UITextView, UITextViewDelegate {
override var contentSize: CGSize {
didSet {
var topCorrection = (self.boun... | apache-2.0 | 3702506ea6664a3fdda6cef533299337 | 32.510638 | 121 | 0.652063 | 4.399441 | false | false | false | false |
sf-arte/Spica | Spica/Flickr.swift | 1 | 8409 | //
// Flickr.swift
// Spica
//
// Created by Suita Fujino on 2016/09/28.
// Copyright © 2016年 ARTE Co., Ltd. All rights reserved.
//
import OAuthSwift
import SwiftyJSON
/**
FlickrのAPIを呼ぶクラス
*/
class Flickr {
// MARK: 定数
/// Flickr APIのURL
private let apiURL = "https://api.flickr.com/servic... | mit | 1b9180b1852aaa9c880831a01c942019 | 32.670996 | 131 | 0.559913 | 4.657485 | false | false | false | false |
Legoless/iOS-Course | 2015-1/Lesson13/Gamebox/Gamebox/GameManager.swift | 3 | 1607 | //
// GameManager.swift
// Gamebox
//
// Created by Dal Rupnik on 21/10/15.
// Copyright © 2015 Unified Sense. All rights reserved.
//
import Foundation
class GameManager : NSObject
{
static let shared = GameManager()
var games : [Game]?
var allGames : [Game] {
if games == nil {
... | mit | c0a1b83b90a2c77d13e2e4c5a96f5421 | 21.957143 | 92 | 0.528643 | 5.30033 | false | false | false | false |
Dynamit/DTCalendarView-iOS | Example/DTCalendarView/ViewController.swift | 1 | 5543 | //
// ViewController.swift
// DTCalendarView
//
// Created by timle8n1-dynamit on 06/14/2017.
// Copyright (c) 2017 timle8n1-dynamit. All rights reserved.
//
import UIKit
import DTCalendarView
class ViewController: UIViewController {
fileprivate let now = Date()
fileprivate let calendar = Calend... | mit | 162681ae45772faa329a92b6d0e21e9c | 30.494318 | 98 | 0.578928 | 5.570854 | false | false | false | false |
codefellows/sea-c24-iOS-F2 | Day 5-8 AutoLayout:Camera:plist:Archiver/AutoLayout/Person.swift | 1 | 1086 | //
// Person.swift
// AutoLayout
//
// Created by Bradley Johnson on 11/10/14.
// Copyright (c) 2014 Code Fellows. All rights reserved.
//
import Foundation
import UIKit
class Person : NSObject, NSCoding {
var firstName : String
var lastName : String
var image : UIImage?
init (first : St... | mit | ab100a9cfb3913772e45a2c2666920ce | 25.487805 | 80 | 0.622468 | 4.432653 | false | false | false | false |
thehorbach/instagram-clone | Pods/SwiftKeychainWrapper/SwiftKeychainWrapper/KeychainItemAccessibility.swift | 1 | 6158 | //
// KeychainOptions.swift
// SwiftKeychainWrapper
//
// Created by James Blair on 4/24/16.
// Copyright © 2016 Jason Rendel. All rights reserved.
//
// The MIT License (MIT)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation... | mit | cae47754db65166efae510d9122570ce | 47.480315 | 380 | 0.730388 | 5.303187 | false | false | false | false |
soapyigu/LeetCode_Swift | DFS/CombinationSum.swift | 1 | 953 | /**
* Question Link: https://leetcode.com/problems/combination-sum/
* Primary idea: Classic Depth-first Search
*
* Time Complexity: O(n^n), Space Complexity: O(2^n - 1)
*
*/
class CombinationSum {
func combinationSum(candidates: [Int], _ target: Int) -> [[Int]] {
var res = [[Int]]()
var path... | mit | 3a11c8060eb6e6af84aa84ef4b84d49b | 26.257143 | 114 | 0.498426 | 3.905738 | false | false | false | false |
coolmacmaniac/swift-ios | rw/BullsEye/BullsEye/ViewController.swift | 1 | 3219 | //
// ViewController.swift
// BullsEye
//
// Created by Sourabh on 11/03/18.
// Copyright © 2018 Home. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
var targetValue = 0
var currentValue = 0
var score = 0
var round = 0
@IBOutlet weak var slider: UISlider!
@IBOutlet weak va... | gpl-3.0 | 936942cd012aa1c248ad609d14b4980d | 23.945736 | 129 | 0.699814 | 3.698851 | false | false | false | false |
ostatnicky/kancional-ios | Cancional/UI/Song Detail/AppereanceThemeButton.swift | 1 | 1524 | //
// AppereanceColorButton.swift
// Cancional
//
// Created by Jiri Ostatnicky on 11/06/2017.
// Copyright © 2017 Jiri Ostatnicky. All rights reserved.
//
import UIKit
class AppearanceThemeButton: UIButton {
@objc var theme: AppearanceTheme?
override var isSelected: Bool {
didSet {
... | mit | 26c8653f9f8b55d2e7d906486bae0b77 | 20.757143 | 73 | 0.568615 | 4.789308 | false | false | false | false |
safx/MioDashboard-swift | MioDashboard-swift WatchKit Extension/InterfaceController.swift | 1 | 5741 | //
// InterfaceController.swift
// MioDashboard-swift WatchKit Extension
//
// Created by Safx Developer on 2015/05/17.
// Copyright (c) 2015年 Safx Developers. All rights reserved.
//
import WatchKit
import Foundation
import IIJMioKit
class TableRow : NSObject {
@IBOutlet weak var hddServiceCode: WKInterface... | mit | 826ecca945253815261b4f525139d4ae | 30.883333 | 136 | 0.60115 | 4.851226 | false | false | false | false |
seeRead/roundware-ios-framework-v2 | Pod/Classes/RWFrameworkHTTP.swift | 1 | 26066 | //
// RWFrameworkHTTP.swift
// RWFramework
//
// Created by Joe Zobkiw on 2/6/15.
// Copyright (c) 2015 Roundware. All rights reserved.
//
import Foundation
import MobileCoreServices
extension RWFramework: URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate /*, NSURLSessionDownloadDelegate */ {
... | mit | 2484e4c73a9e07a6362911828301fcf8 | 55.176724 | 233 | 0.64471 | 4.82525 | false | false | false | false |
JakeLin/IBAnimatable | Sources/Views/AnimatableView.swift | 2 | 6072 | //
// Created by Jake Lin on 11/18/15.
// Copyright © 2015 IBAnimatable. All rights reserved.
//
import UIKit
@IBDesignable
open class AnimatableView: UIView, CornerDesignable, FillDesignable, BorderDesignable,
RotationDesignable, ShadowDesignable, BlurDesignable,
... | mit | 558dc77dce67c730cfff5e4e84c8ace0 | 23.479839 | 91 | 0.670236 | 4.864583 | false | true | false | false |
AgaKhanFoundation/WCF-iOS | Steps4Impact/OnboardingV2/OnboardingPageViewController.swift | 1 | 3394 | /**
* Copyright © 2019 Aga Khan Foundation
* 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 c... | bsd-3-clause | 9c2b6dc81c6993f4b48b0cc7c868004c | 35.880435 | 99 | 0.739169 | 4.511968 | false | false | false | false |
aucl/YandexDiskKit | YandexDiskKit/YandexDiskKit/String+YDisk.swift | 1 | 2020 | //
// String+YDisk.swift
//
// Copyright (c) 2014-2015, Clemens Auer
// 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 copyrig... | bsd-2-clause | 2f2e37e8bb66d51de68adade88964ab6 | 43.888889 | 98 | 0.720792 | 4.708625 | false | false | false | false |
asp2insp/CodePathFinalProject | Pretto/AddEventDateCell.swift | 1 | 1506 | //
// AddEventDateCell.swift
// Pretto
//
// Created by Francisco de la Pena on 6/14/15.
// Copyright (c) 2015 Pretto. All rights reserved.
//
import UIKit
class AddEventDateCell: UITableViewCell {
@IBOutlet var startOrEndLabel: UILabel!
@IBOutlet var dateLabel: UILabel!
var isStartDate: Bool! {... | mit | 6ce39dfb3dd198cd6477d3f2e342ee40 | 27.961538 | 72 | 0.578353 | 4.811502 | false | false | false | false |
MTR2D2/TIY-Assignments | Forecaster/Forecaster/APIController.swift | 1 | 2899 | //
// APIController.swift
// Forecaster
//
// Created by Michael Reynolds on 10/29/15.
// Copyright © 2015 The Iron Yard. All rights reserved.
//
import Foundation
class APIController
{
var delegate: APIControllerProtocol
init(delegate: APIControllerProtocol)
{
self.delegate = delega... | cc0-1.0 | e85d8557d4fc18bd7b0d07ce1e4f4257 | 28.571429 | 146 | 0.52588 | 5.231047 | false | false | false | false |
Donny8028/Swift-Animation | Emoji Slot Machine/Emoji Slot Machine/ViewController.swift | 1 | 3159 | //
// ViewController.swift
// Emoji Slot Machine
//
// Created by 賢瑭 何 on 2016/5/19.
// Copyright © 2016年 Donny. All rights reserved.
//
import UIKit
class ViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource {
let emojis = ["😂","😎","😡","😱","💩","👽","👀","🐷","🐨","🐣","🙉"... | mit | 8f6493d42257112b77dc1041f06f6108 | 28.628571 | 134 | 0.541305 | 4.515239 | false | false | false | false |
ntaku/SwiftEssential | SwiftEssential/ExtImage.swift | 1 | 4239 | import Foundation
import UIKit
public extension UIImage {
/**
中心を正方形にクロップする (Exifの画像の向きは考慮されない)
*/
@objc func crop() -> UIImage {
let w = self.size.width
let h = self.size.height
let size = (w < h) ? w : h
let sx = self.size.width/2 - size/2
let sy = self.si... | mit | 5a3914b4ded0538f462b971f7996573f | 28.834646 | 104 | 0.58274 | 3.910217 | false | false | false | false |
rad182/CellSignal | Watch Extension/InterfaceController.swift | 1 | 2088 | //
// InterfaceController.swift
// Watch Extension
//
// Created by Royce Albert Dy on 14/11/2015.
// Copyright © 2015 rad182. All rights reserved.
//
import WatchKit
import Foundation
class InterfaceController: WKInterfaceController {
@IBOutlet weak var radioTechnologyLabel: WKInterfaceLabel!
privat... | mit | 2106ec571699f2c69dc7697cb7b58ccf | 31.123077 | 136 | 0.632487 | 5.928977 | false | false | false | false |
Turistforeningen/SjekkUT | ios/SjekkUt/views/style/DntTextView.swift | 1 | 677 | //
// DntTextView.swift
// SjekkUt
//
// Created by Henrik Hartz on 14.02.2017.
// Copyright © 2017 Den Norske Turistforening. All rights reserved.
//
import Foundation
@IBDesignable
class DntTextView: UITextView {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
... | mit | ce1d766dfd42fc6376a0da877a761de2 | 23.142857 | 68 | 0.650888 | 3.976471 | false | false | false | false |
gregomni/swift | validation-test/compiler_crashers_fixed/00237-swift-declrefexpr-setspecialized.swift | 3 | 3053 | // 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... | apache-2.0 | 266aa4cb8abd1eb7365a4b5fe426d117 | 14.818653 | 92 | 0.494268 | 2.578547 | false | false | false | false |
heitara/swift-3 | playgrounds/Lecture4.playground/Contents.swift | 1 | 8796 | //: Playground - noun: a place where people can play
import UIKit
/*
Какво е playground?
Това вид проект, който се изпозлва от xCode. Интерактивно показва какво е състоянието на паметта на компютъра във всеки един ред на изпълнение на код-а. Позволява лесно онагледяване на примерния код. Много по лесно може да се... | mit | 88e2fdf99d191d48bfd646480a0587be | 22.528302 | 325 | 0.637129 | 2.876586 | false | false | false | false |
richardpiazza/MiseEnPlace | Sources/MiseEnPlace/Double+MiseEnPlace.swift | 1 | 1151 | import Foundation
public extension Double {
/// Rounds to the number of decimal-places specified
func rounded(to places: Int) -> Double {
let divisor = pow(10.0, Double(places))
return (self * divisor).rounded() / divisor
}
/// An interpreted representation of the value, composed o... | mit | a8a51b0769b9d00604f71395f025dbb1 | 28.512821 | 68 | 0.537793 | 4.961207 | false | false | false | false |
weby/Stencil | Sources/Filters.swift | 1 | 601 | func toString(value: Any?) -> String? {
if let value = value as? String {
return value
} else if let value = value as? CustomStringConvertible {
return value.description
}
return nil
}
func capitalise(value: Any?) -> Any? {
if let value = toString(value: value) {
return value.capitalized
}
... | bsd-2-clause | 2382985d6acaa2faa69c1c59381dabd2 | 17.212121 | 59 | 0.647255 | 3.687117 | false | false | false | false |
ksco/swift-algorithm-club-cn | Segment Tree/SegmentTree.swift | 1 | 2429 | /*
Segment tree
Performance:
building the tree is O(n)
query is O(log n)
replace item is O(log n)
*/
public class SegmentTree<T> {
private var value: T
private var function: (T, T) -> T
private var leftBound: Int
private var rightBound: Int
private var leftChild: SegmentTree<T>?
priva... | mit | 104444d8bdd9168087ea6462a4e4f926 | 34.202899 | 112 | 0.683821 | 4.465074 | false | false | false | false |
aleph7/PlotKit | PlotKit/Model/PointSet.swift | 1 | 2141 | // Copyright © 2015 Venture Media Labs. All rights reserved.
//
// This file is part of PlotKit. The full PlotKit copyright notice, including
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.
import Foundation
public enum Po... | mit | 9ba71cd9edb700caf118d9619482d814 | 24.47619 | 80 | 0.549533 | 4.115385 | false | false | false | false |
OscarSwanros/swift | test/SourceKit/CodeComplete/complete_filter.swift | 31 | 3678 | struct Foo {
func aaa() {}
func aab() {}
func abc() {}
func b() {}
func c() {}
}
func foo() {
let x = Foo()
x.#^FOO,,a,aa,ab,abc,abcd^#
}
// XFAIL: broken_std_regex
// RUN: %sourcekitd-test -req=complete.open -pos=11:5 %s -- %s > %t.all
// RUN: %FileCheck -check-prefix=CHECK-ALL %s < %t.all
// CHECK-ALL... | apache-2.0 | c517cc6bfbc788716bc745b2cbe6cfc6 | 28.190476 | 90 | 0.630234 | 2.718404 | false | true | false | false |
LoopKit/LoopKit | LoopKitUI/View Controllers/GlucoseEntryTableViewController.swift | 1 | 2171 | //
// GlucoseEntryTableViewController.swift
// LoopKitUI
//
// Created by Michael Pangburn on 11/24/18.
// Copyright © 2018 LoopKit Authors. All rights reserved.
//
import UIKit
import HealthKit
import LoopKit
public protocol GlucoseEntryTableViewControllerDelegate: AnyObject {
func glucoseEntryTableViewCont... | mit | 208bbeacc66ea0c108325c662dcdfc6f | 30.911765 | 103 | 0.70553 | 5.880759 | false | false | false | false |
LoopKit/LoopKit | LoopKit/DailyValueSchedule.swift | 1 | 9251 | //
// QuantitySchedule.swift
// Naterade
//
// Created by Nathan Racklyeft on 1/18/16.
// Copyright © 2016 Nathan Racklyeft. All rights reserved.
//
import Foundation
import HealthKit
public struct RepeatingScheduleValue<T> {
public var startTime: TimeInterval
public var value: T
public init(startTi... | mit | bb92449674215c58608c78017f2313bf | 32.636364 | 151 | 0.632216 | 4.970446 | false | false | false | false |
grafele/Prototyper | Prototyper/Classes/APIHandler.swift | 2 | 8060 | //
// APIHandler.swift
// Prototype
//
// Created by Stefan Kofler on 17.06.15.
// Copyright (c) 2015 Stephan Rabanser. All rights reserved.
//
import Foundation
import UIKit
let sharedInstance = APIHandler()
private let defaultBoundary = "------VohpleBoundary4QuqLuM1cE5lMwCy"
class APIHandler {
let session... | mit | 3a4b3541e5d2ae0dcc3001e9c59982b0 | 44.027933 | 210 | 0.637097 | 4.878935 | false | false | false | false |
gottesmm/swift | test/expr/expressions.swift | 2 | 36345 | // RUN: %target-typecheck-verify-swift
//===----------------------------------------------------------------------===//
// Tests and samples.
//===----------------------------------------------------------------------===//
// Comment. With unicode characters: ¡ç®åz¥!
func markUsed<T>(_: T) {}
// Various function t... | apache-2.0 | 727d6083f1b5625ec91e18251af69ce7 | 38.32684 | 310 | 0.611619 | 3.629082 | false | true | false | false |
bman4789/bpm | BPM/BPM/MainViewController.swift | 1 | 3203 | //
// MainViewController.swift
// BPM
//
// Created by Brian Mitchell and Zach Litzinger on 4/8/16.
// Copyright © 2016 Brian Mitchell. All rights reserved.
//
import UIKit
import Foundation
import ChameleonFramework
import FontAwesome_swift
class MainViewController: UIViewController {
var loadTheme: Bool = {... | mit | 4e31549b39f950801a14ca43ed1775c5 | 30.087379 | 143 | 0.6193 | 4.453408 | false | false | false | false |
petroladkin/SwiftyBluetooth | SwiftyBluetooth/Source/CBExtensions.swift | 1 | 6437 | //
// CBExtensions.swift
//
// Copyright (c) 2016 Jordane Belanger
//
// 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
// ... | mit | 74425c98fddec6ce61b10acde25ebd6c | 44.013986 | 161 | 0.675781 | 5.145484 | false | false | false | false |
Fenrikur/ef-app_ios | Eurofurence/Modules/Event Feedback/Presenter/EventFeedbackPresenterFactoryImpl.swift | 1 | 2035 | import EurofurenceModel
struct EventFeedbackPresenterFactoryImpl: EventFeedbackPresenterFactory {
private let eventService: EventsService
private let dayOfWeekFormatter: DayOfWeekFormatter
private let startTimeFormatter: HoursDateFormatter
private let endTimeFormatter: HoursDateFormatter
priva... | mit | d23b3476ccbbdc216d521f574a05723f | 44.222222 | 84 | 0.635381 | 7.593284 | false | false | false | false |
mercadopago/px-ios | MercadoPagoSDK/MercadoPagoSDK/Core/PaymentMethodSelector/Extensions/PXPaymentMethodSelector+Tracking.swift | 1 | 4972 | import Foundation
// MARK: Tracking
extension PXPaymentMethodSelector {
func startTracking(then: @escaping (() -> Void)) {
viewModel?.trackingConfiguration?.updateTracker()
MPXTracker.sharedInstance.startNewSession()
// Track init event
var properties: [String: Any] = [:]
i... | mit | 356d44ba4bd9de5d122c80878e7395a6 | 45.037037 | 133 | 0.682019 | 5.057986 | false | false | false | false |
tokyovigilante/CesiumKit | CesiumKit/Scene/GridImageryProvider.swift | 1 | 13191 | //
// GridImageryProvider.swift
// CesiumKit
//
// Created by Ryan Walklin on 29/09/14.
// Copyright (c) 2014 Test Toast. All rights reserved.
//
/**
* An {@link ImageryProvider} that draws a wireframe grid on every tile with controllable background and glow.
* May be useful for custom rendering effects or debuggi... | apache-2.0 | f4a44f328923622d939cbc9102a80492 | 34.847826 | 142 | 0.659692 | 4.3235 | false | false | false | false |
linusnyberg/RepoList | Pods/OAuthSwift/Sources/String+OAuthSwift.swift | 1 | 2643 | //
// String+OAuthSwift.swift
// OAuthSwift
//
// Created by Dongri Jin on 6/21/14.
// Copyright (c) 2014 Dongri Jin. All rights reserved.
//
import Foundation
extension String {
var urlEncodedString: String {
let customAllowedSet = CharacterSet(charactersIn: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM... | mit | d7578d37bba1f97eaa7f2f458e822c80 | 27.728261 | 128 | 0.663261 | 5.053537 | false | false | false | false |
suifengqjn/CatLive | CatLive/CatLive/Classes/Home/CLPageView/CLPageView.swift | 1 | 2466 | //
// CLPageView.swift
// CatLive
//
// Created by qianjn on 2017/6/11.
// Copyright © 2017年 SF. All rights reserved.
//
import UIKit
class CLPageView: UIView {
// MARK: 定义属性
fileprivate var titles : [String]!
fileprivate var style : CLTitleStyle!
fileprivate var childVcs : [UIViewController]!
... | apache-2.0 | 5f1f8bba779d6f8d9fcb451fa60c981b | 29.576923 | 126 | 0.672956 | 4.750996 | false | false | false | false |
mlilback/rc2SwiftClient | MacClient/session/output/OutputTabController.swift | 1 | 11634 | //
// OutputTabController.swift
//
// Copyright ©2016 Mark Lilback. This file is licensed under the ISC license.
//
import Cocoa
import Rc2Common
import MJLLogger
import Networking
import ClientCore
import ReactiveSwift
import SwiftyUserDefaults
enum OutputTab: Int {
case console = 0, preview, webKit, image, help... | isc | 831f7d68b3489ecba59a6a139a50b017 | 32.048295 | 128 | 0.75303 | 4.184532 | false | false | false | false |
Swiftline/Swiftline | Source/Env.swift | 3 | 2313 | //
// Env.swift
// Swiftline
//
// Created by Omar Abdelhafith on 24/11/2015.
// Copyright © 2015 Omar Abdelhafith. All rights reserved.
//
import Darwin
public class Env {
/// Return the list of all the enviromenment keys passed to the script
public static var keys: [String] {
let keyValues = run("en... | mit | 26bcb1bdd31484bb1bac9c012e599b20 | 23.336842 | 94 | 0.641436 | 4.188406 | false | false | false | false |
banxi1988/Staff | Pods/BXiOSUtils/Pod/Classes/CGRectExtentions.swift | 1 | 1611 | //
// CGRectExtentions.swift
// Pods
//
// Created by Haizhen Lee on 15/12/18.
//
//
import Foundation
import UIKit
public extension CGSize{
public func sizeByScaleToWidth(width:CGFloat) -> CGSize{
let factor = width / self.width
let h = self.height * factor
return CGSize(width: width, height: h)... | mit | 5a6499a58474e0ec756c039ea2dbc1bf | 23.059701 | 87 | 0.6437 | 3.30123 | false | false | false | false |
RocketChat/Rocket.Chat.iOS | Pods/MobilePlayer/MobilePlayer/MobilePlayerViewController.swift | 1 | 25438 | //
// MobilePlayerViewController.swift
// MobilePlayer
//
// Created by Baris Sencan on 12/02/15.
// Copyright (c) 2015 MovieLaLa. All rights reserved.
//
import UIKit
import MediaPlayer
/// A view controller for playing media content.
open class MobilePlayerViewController: MPMoviePlayerViewController {
// MARK... | mit | 322acc0f9bf79140745494f5148a3a28 | 38.371517 | 186 | 0.721672 | 5.495678 | false | false | false | false |
ben-ng/swift | test/type/self.swift | 10 | 866 | // RUN: %target-typecheck-verify-swift
struct S0<T> {
func foo(_ other: Self) { } // expected-error{{'Self' is only available in a protocol or as the result of a method in a class; did you mean 'S0'?}}{{21-25=S0}}
}
class C0<T> {
func foo(_ other: Self) { } // expected-error{{'Self' is only available in a protoco... | apache-2.0 | e45fe9b01cc6cf66b9c8800eb02a8be0 | 31.074074 | 167 | 0.648961 | 3.115108 | false | false | false | false |
adrfer/swift | stdlib/public/core/StringCharacterView.swift | 1 | 10908 | //===--- StringCharacterView.swift - String's Collection of Characters ----===//
//
// 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/LI... | apache-2.0 | b2413d36ffe464e44e6d12720de3438c | 30.98827 | 88 | 0.656124 | 4.645656 | false | false | false | false |
fschneider1509/RuleBasedXMLParserDelegate | RuleBasedXMLParserDelegateKit/XMLRuleBasedParserDelegate.swift | 1 | 3710 | //
// XMLRuleBasedParserDelegate.swift
// RuleBasedXMLParserDelegate
//
// Created by Fabian Schneider
// fabian(at)fabianschneider.org
// MIT License
//
import Foundation
class XMLRuleBasedParserDelegate<T: XMLParserNodeProtocol> : NSObject, XMLParserDelegate, XMLRuleBasedParserDelegateProtocol {
private le... | mit | e44aa9048f3f84dd98c423ece7186b04 | 40.685393 | 218 | 0.645013 | 5.338129 | false | false | false | false |
mcomisso/hellokiwi | kiwi/BWWalkthroughViewController.swift | 1 | 10144 | //
// BWWalkthroughViewController.swift
//
// Created by Yari D'areglia on 15/09/14 (wait... why do I wrote code the Day of my Birthday?! C'Mon Yari... )
// Copyright (c) 2014 Yari D'areglia. All rights reserved.
//
import UIKit
// MARK: - Protocols -
/**
Walkthrough Delegate:
This delegate performs basic operati... | apache-2.0 | 53bf878094dba4dd0091f98fe36cac79 | 37.139098 | 194 | 0.633182 | 5.297128 | false | false | false | false |
actilot/ACMaterialDesignIcons | ACMaterialDesignIcons.swift | 1 | 45525 | //
// ACMaterialDesignIcons.swift
// ACMaterialDesignIcons
//
// Created by Axel Ros Campaña on 9/5/17.
// Copyright © 2017 Axel Ros Campaña. All rights reserved.
//
import Foundation
import UIKit
public class ACMaterialDesignIcons {
public var iconAttributedString: NSMutableAttributedString?
public var f... | mit | b85e76bc4323e7b7737e6697ee38ce4b | 53.387097 | 141 | 0.633628 | 6.328653 | false | false | false | false |
naoto0822/try-reactive-swift | TryRxSwift/TryRxSwift/Item.swift | 1 | 775 | //
// Item.swift
// TryRxSwift
//
// Created by naoto yamaguchi on 2016/04/11.
// Copyright © 2016年 naoto yamaguchi. All rights reserved.
//
import UIKit
public struct Item {
// MARK: - Property
public let id: String
public let title: String
public let url: String
public let user: Us... | mit | ef0cc2f96eb0b132d7ed77c3cb548d31 | 22.393939 | 76 | 0.563472 | 4.084656 | false | false | false | false |
Wakup/Wakup-iOS-SDK | Wakup/UIImageView+Fade.swift | 1 | 787 | //
// UIImageView+Fade.swift
// Wuakup
//
// Created by Guillermo Gutiérrez on 08/01/15.
// Copyright (c) 2015 Yellow Pineapple. All rights reserved.
//
import Foundation
import SDWebImage
extension UIImageView {
func setImageAnimated(url: URL!, completed: SDExternalCompletionBlock? = nil) {
sd_setIma... | mit | 03097c69c0b46769a4c0038a8f0e2b85 | 28.111111 | 83 | 0.575064 | 4.491429 | false | false | false | false |
Octadero/TensorFlow | Sources/CAPI/Session.swift | 1 | 20856 | /* Copyright 2017 The Octadero Authors. All Rights Reserved.
Created by Volodymyr Pavliukevych on 2017.
Licensed under the GPL License, Version 3.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.gnu.org/licenses/gpl-3.0.txt
Unless ... | gpl-3.0 | 52db69e84acd43ccb05455b28443b711 | 34.529813 | 154 | 0.663262 | 4.651204 | false | false | false | false |
xwu/swift | test/Generics/rdar83687967.swift | 1 | 2090 | // RUN: %target-typecheck-verify-swift
// RUN: %target-swift-frontend -typecheck -debug-generic-signatures %s 2>&1 | %FileCheck %s
// RUN: %target-swift-frontend -emit-ir %s
public protocol P1 {}
public protocol P2 {
associatedtype A: P1
}
public protocol P3 {
associatedtype B: P2
associatedtype A where B.A ==... | apache-2.0 | d3d4c67869810836a9f645d363943ca6 | 30.666667 | 94 | 0.658373 | 2.985714 | false | false | false | false |
Tomikes/eidolon | KioskTests/App/RAC/RACFunctionsTests.swift | 7 | 4576 | import Quick
import Nimble
@testable
import Kiosk
import ReactiveCocoa
class RACFunctionsTests: QuickSpec {
override func spec() {
describe("email address check") {
it("requires @") {
let valid = stringIsEmailAddress("ashartsymail.com") as! Bool
expect(valid) == ... | mit | dbc67c933fde9e0d4412c42341578988 | 35.608 | 92 | 0.521853 | 5.017544 | false | false | false | false |
Bouke/HAP | Sources/HAP/Base/Predefined/Characteristics/Characteristic.SupportedDiagnosticsModes.swift | 1 | 2101 | import Foundation
public extension AnyCharacteristic {
static func supportedDiagnosticsModes(
_ value: UInt32 = 0,
permissions: [CharacteristicPermission] = [.read],
description: String? = "Supported Diagnostics Modes",
format: CharacteristicFormat? = .uint32,
unit: Characte... | mit | 7d629690389b0eeb3401b08813debcc6 | 33.442623 | 66 | 0.591147 | 5.528947 | false | false | false | false |
mcgraw/dojo-custom-camera | dojo-custom-camera/XMCCameraViewController.swift | 3 | 3787 | //
// XMCCameraViewController.swift
// dojo-custom-camera
//
// Created by David McGraw on 11/13/14.
// Copyright (c) 2014 David McGraw. All rights reserved.
//
import UIKit
import AVFoundation
enum Status: Int {
case Preview, Still, Error
}
class XMCCameraViewController: UIViewController, XMCCameraDelegate ... | mit | 66422b139983047a85aa8220567b627b | 31.930435 | 89 | 0.57671 | 4.848912 | false | false | false | false |
GabrielGhe/SwiftProjects | App13CardTilt/CardTilt/TipInCellAnimator.swift | 1 | 1464 | //
// TipInCellAnimator.swift
// CardTilt
//
// Created by Gabriel Gheorghian on 2014-09-08.
// Copyright (c) 2014 RayWenderlich.com. All rights reserved.
//
import UIKit
import QuartzCore
let TipInCellAnimatorStartTransform:CATransform3D = {
// Variables
let rotationDegrees: CGFloat = -15.0
let rotat... | mit | 41badfe2c2236195b0bfacadc574b549 | 27.173077 | 84 | 0.655055 | 4.280702 | false | false | false | false |
ihomway/RayWenderlichCourses | Intermediate Swift 3/Intermediate Swift 3.playground/Pages/Classes Challenge.xcplaygroundpage/Contents.swift | 1 | 892 | //: [Previous](@previous)
import UIKit
/*:
#### Intermediate Swift Video Tutorial Series - raywenderlich.com
#### Video 5: Classes
**Note:** If you're seeing this text as comments rather than nicely-rendered text, select Editor\Show Rendered Markup in the Xcode menu.
Make the following objects and determine whether... | mit | 87a76953b520c2428033a29b7cecba13 | 20.238095 | 136 | 0.702915 | 3.582329 | false | false | false | false |
wordpress-mobile/WordPress-iOS | WordPress/Classes/Utility/Media/MediaThumbnailExporter.swift | 2 | 11255 | import Foundation
import MobileCoreServices
/// Media export handling of thumbnail images from videos or images.
///
class MediaThumbnailExporter: MediaExporter {
/// Directory type for the ThumbnailExporter, defaults to the .cache directory.
///
var mediaDirectoryType: MediaDirectory = .cache
// MAR... | gpl-2.0 | ce5fc0f312d31d9fb7308b0c82ac0df5 | 41.632576 | 164 | 0.627099 | 5.580069 | false | false | false | false |
Roommate-App/roomy | roomy/Pods/Starscream/Sources/WebSocket.swift | 2 | 54234 | //////////////////////////////////////////////////////////////////////////////////////////////////
//
// Websocket.swift
//
// Created by Dalton Cherry on 7/16/14.
// Copyright (c) 2014-2017 Dalton Cherry.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in ... | mit | cf248536a4dac655b7535cee46202589 | 39.352679 | 226 | 0.586422 | 5.343778 | false | false | false | false |
Cleverlance/Pyramid | Example/Tests/Scope Management/Application/InstanceProviderImplTests.swift | 1 | 1303 | //
// Copyright © 2016 Cleverlance. All rights reserved.
//
import XCTest
import Nimble
import Pyramid
class InstanceProviderImplTests: XCTestCase {
func test_ItConformsToInstanceProvider() {
let _: InstanceProvider<Int>? = (nil as InstanceProviderImpl<Int>?)
}
func test_ItDependsOnScopeControl... | mit | fe319de64185cb45658524e5485977c0 | 25.571429 | 82 | 0.682028 | 4.398649 | false | true | false | false |
GermanCentralLibraryForTheBlind/LargePrintMusicNotes | LargePrintMusicNotesViewer/PdfViewerController.swift | 1 | 2561 | // Created by Lars Voigt.
//
//The MIT License (MIT)
//Copyright (c) 2016 German Central Library for the Blind (DZB)
//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, inclu... | mit | 171a53cb3a8bc2edf444d3418b5b0825 | 39.650794 | 141 | 0.696993 | 4.656364 | false | false | false | false |
lenssss/whereAmI | Whereami/Controller/Personal/PublishTourPhotoCollectionTableViewCell.swift | 1 | 4600 | //
// PublishTourPhotoCollectionTableViewCell.swift
// Whereami
//
// Created by A on 16/4/28.
// Copyright © 2016年 WuQifei. All rights reserved.
//
import UIKit
//import TZImagePickerController
class PublishTourPhotoCollectionTableViewCell: UITableViewCell,UICollectionViewDataSource,UICollectionViewDelegate,UICo... | mit | b0dd7e4939f865abedd2a0742acecd06 | 37.957627 | 177 | 0.676746 | 5.73192 | false | false | false | false |
GermanCentralLibraryForTheBlind/LargePrintMusicNotes | LargePrintMusicNotesViewer/RESTConnector.swift | 1 | 5168 | // Created by Lars Voigt.
//
//The MIT License (MIT)
//Copyright (c) 2016 German Central Library for the Blind (DZB)
//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, inclu... | mit | 24dbea54285cfc0f922e7c50bb724c55 | 40.312 | 132 | 0.524593 | 5.481953 | false | false | false | false |
apple/swift-experimental-string-processing | Sources/_StringProcessing/Engine/Consume.swift | 1 | 1521 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2021-2022 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LIC... | apache-2.0 | 8ae4c08cb800d216d13cbb961abc383d | 25.224138 | 80 | 0.596318 | 4.798107 | false | false | false | false |
bsmith11/ScoreReporter | ScoreReporterCore/ScoreReporterCore/View Models/GameViewModel.swift | 1 | 2366 | //
// GameViewModel.swift
// ScoreReporter
//
// Created by Bradley Smith on 9/25/16.
// Copyright © 2016 Brad Smith. All rights reserved.
//
import Foundation
import UIKit
public enum GameViewState {
case full
case normal
case minimal
}
public struct GameViewModel {
public let game: Game?
pu... | mit | 982e737d9c6eafdce0e68b3fa15cf3ea | 30.118421 | 89 | 0.657082 | 5.06424 | false | false | false | false |
kenshin03/Cherry | Cherry/Shared/Utils/KTActivityManager.swift | 5 | 8784 | //
// KTActivityManager.swift
// Cherry
//
// Created by Kenny Tang on 2/22/15.
//
//
import UIKit
protocol KTActivityManagerDelegate {
func activityManager(manager:KTActivityManager?, activityDidUpdate model:KTPomodoroActivityModel?)
func activityManager(manager:KTActivityManager?, activityDidPauseForBrea... | mit | 89bdb51480dff1825e64fb2bfdc0ddd7 | 32.022556 | 139 | 0.672587 | 5.369193 | false | false | false | false |
apple/swift-package-manager | Sources/PackageModel/Snippets/Model/Snippet.swift | 2 | 1197 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2014-2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.... | apache-2.0 | eab70f3493f0c086472b5e980a024f25 | 32.25 | 80 | 0.609023 | 5.115385 | false | false | false | false |
balthild/Mathemalpha | Mathemalpha/SchemesView.swift | 1 | 1120 | //
// TypesView.swift
// Mathemalpha
//
// Created by Balthild Ires on 18/09/2017.
// Copyright © 2017 Balthild Ires. All rights reserved.
//
import Cocoa
class SchemesView: NSView {
var selected = 0
override func draw(_ dirtyRect: NSRect) {
super.draw(dirtyRect)
var y: CGFloat = 0
... | gpl-3.0 | 96a93f9903a48c53edb4b8a8843f86ee | 23.866667 | 101 | 0.575514 | 4.238636 | false | false | false | false |
apple/swift-async-algorithms | Sources/AsyncAlgorithms/AsyncChannel.swift | 1 | 8882 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Async Algorithms open source project
//
// Copyright (c) 2022 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift... | apache-2.0 | 22cd6fc50d44239a67eaa5184c038bb5 | 31.298182 | 120 | 0.640059 | 5.07833 | false | false | false | false |
coderMONSTER/ioscelebrity | YStar/YStar/Scenes/Controller/SetPayPwdVC.swift | 1 | 7655 | //
// SetPayPwdVC.swift
// YStar
//
// Created by MONSTER on 2017/7/18.
// Copyright © 2017年 com.yundian. All rights reserved.
//
import UIKit
import SVProgressHUD
fileprivate func < <T : Comparable>(lhs: T?, rhs: T?) -> Bool {
switch (lhs, rhs) {
case let (l?, r?):
return l < r
case (nil, _?)... | mit | 46c59129b1bfe9019e4efddceda3c568 | 34.239437 | 155 | 0.534772 | 4.961005 | false | false | false | false |
kz56cd/ios_sandbox_animate | IosSandboxAnimate/CustomParts/BottomShadowButton.swift | 1 | 776 | //
// BottomShadowButton.swift
// e-park
//
// Created by KaiKeima on 2015/12/22.
// Copyright © 2015年 OHAKO,inc. All rights reserved.
//
import UIKit
@IBDesignable class BottomShadowButton: UIButton {
override func drawRect(rect: CGRect) {
self.layer.backgroundColor = self.backgroundCol... | mit | b73c569f210d8366ffbb5b4b08033ddc | 25.655172 | 125 | 0.649418 | 4.005181 | false | false | false | false |
tad-iizuka/swift-sdk | Source/RetrieveAndRankV1/Models/SearchResponse.swift | 3 | 3712 | /**
* Copyright IBM Corporation 2016
*
* 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... | apache-2.0 | 8ce291fc11baec3e99d644d92d7f90a2 | 34.352381 | 152 | 0.684267 | 4.651629 | false | false | false | false |
imitationgame/pokemonpassport | pokepass/View/Create/VCreateFinder.swift | 1 | 5961 | import UIKit
class VCreateFinder:UIView, UITextFieldDelegate
{
weak var controller:CCreate!
weak var field:UITextField!
convenience init(controller:CCreate)
{
self.init()
self.controller = controller
clipsToBounds = true
backgroundColor = UIColor.white
trans... | mit | 3d88e50f75b4f4e6516648412b1919db | 33.258621 | 112 | 0.612984 | 5.961 | false | false | false | false |
FuckBoilerplate/RxCache | iOS/Pods/Nimble/Sources/Nimble/Adapters/NMBObjCMatcher.swift | 140 | 3116 | import Foundation
#if _runtime(_ObjC)
public typealias MatcherBlock = (_ actualExpression: Expression<NSObject>, _ failureMessage: FailureMessage) -> Bool
public typealias FullMatcherBlock = (_ actualExpression: Expression<NSObject>, _ failureMessage: FailureMessage, _ shouldNotMatch: Bool) -> Bool
public class NMBO... | mit | 0c601a117d5d85b29494791a6d9e0b60 | 37.469136 | 144 | 0.650513 | 5.554367 | false | false | false | false |
Groupr-Purdue/Groupr-Backend | Sources/Library/Models/Course.swift | 1 | 2373 | import Vapor
import Fluent
import HTTP
public final class Course: Model {
public var id: Node?
public var exists: Bool = false
/// The course's name (i.e. 'CS 408').
public var name: String
/// The course's title (i.e. 'Software Testing').
public var title: String
/// The course's curren... | mit | 246fd976c4fb41fe8df728d5fde7aa6d | 28.6625 | 93 | 0.605984 | 4.370166 | false | false | false | false |
urbn/URBNValidator | URBNValidator.playground/Pages/Object Validation.xcplaygroundpage/Contents.swift | 1 | 1040 | //: [Block Rules](@previous)
/*:
# Object Validation
This is what it's all about. Here we're
giving a map of keys to rules, and validating against them
*/
import Foundation
import URBNValidator
class Tester: Validateable {
typealias V = AnyObject
var requiredString: String?
var children = [String]()
... | mit | 61a6e4583a2ffe5ed58b5bb869877fe3 | 23.186047 | 101 | 0.639423 | 4.297521 | false | false | false | false |
mrchenhao/American-TV-Series-Calendar | American-tv-series-calendar/SettingTableViewController.swift | 1 | 6565 | //
// SettingTableViewController.swift
// American-tv-series-calendar
//
// Created by ChenHao on 10/27/15.
// Copyright © 2015 HarriesChen. All rights reserved.
//
import UIKit
import EventKitUI
class SettingTableViewController: UITableViewController {
var showStart: Bool = false
var showEnd: Bool =... | mit | 77f4b28a2565f4763aad8e987c17f725 | 39.271605 | 192 | 0.631974 | 5.496209 | false | false | false | false |
airspeedswift/swift | test/SourceKit/CodeComplete/complete_checkdeps_avoid_check.swift | 4 | 2606 | import ClangFW
import SwiftFW
func foo() {
/*HERE*/
}
// Checks that, due to default check delay, a modification will be ignored and fast completion will still activate.
// REQUIRES: shell
// RUN: %empty-directory(%t/Frameworks)
// RUN: %empty-directory(%t/MyProject)
// RUN: COMPILER_ARGS=( \
// RUN: -target %t... | apache-2.0 | f497d179938569fba3d7df85e70dfdc0 | 33.746667 | 187 | 0.656178 | 3.139759 | false | false | false | false |
JuanjoArreola/AllCache | Sources/ImageCache/ImageResizer.swift | 1 | 3133 | //
// ImageResizer.swift
// ImageCache
//
// Created by JuanJo on 31/08/20.
//
import Foundation
import AllCache
#if os(OSX)
import AppKit
#elseif os(iOS) || os(tvOS) || os(watchOS)
import UIKit
#endif
public enum ImageProcessError: Error {
case resizeError
}
private let resizeFunctions: [DefaultImageRes... | mit | aa41a83283bf0307d5db8aba1eb7222d | 25.777778 | 122 | 0.602617 | 4.443972 | false | false | false | false |
trujillo138/MyExpenses | MyExpenses/MyExpenses/Services/ModelController.swift | 1 | 1168 | //
// ModelController.swift
// MyExpenses
//
// Created by Tomas Trujillo on 5/22/17.
// Copyright © 2017 TOMApps. All rights reserved.
//
import Foundation
class ModelController {
//MARK: Properties
var user: User
private let documentsDirectoryURL = FileManager.default.urls(for: .docum... | apache-2.0 | 3ee24d2ab044c093f8a00543e44f924c | 22.34 | 117 | 0.61868 | 4.882845 | false | false | false | false |
aofan/ZKSwift | ZKSwift/ZKBaseTableViewController.swift | 1 | 5707 | //
// ZKBaseTableViewController.swift
// ZKSwift
//
// Created by lizhikai on 16/7/4.
// Copyright © 2016年 ZK. All rights reserved.
//
import UIKit
public class ZKBaseTableViewController: UITableViewController {
/// 数据源
public var dataArray : Array<AnyObject>?;
/// 是否分组
public var isGroup:Boo... | mit | a2dd10c54c4419799443e3fa573f8058 | 24.174757 | 151 | 0.551485 | 5.129575 | false | false | false | false |
yichizhang/YZLibrary | YZLibraryDemo/Pods/Nimble/Sources/Nimble/Matchers/BeEmpty.swift | 55 | 4255 | import Foundation
/// A Nimble matcher that succeeds when a value is "empty". For collections, this
/// means the are no items in that collection. For strings, it is an empty string.
public func beEmpty<S: SequenceType>() -> NonNilMatcherFunc<S> {
return NonNilMatcherFunc { actualExpression, failureMessage in
... | mit | 2c63e99b3f536896440058fa0337ad2c | 45.25 | 137 | 0.698942 | 5.089713 | false | false | false | false |
AliSoftware/Dip | Sources/AutoWiring.swift | 2 | 3528 | //
// Dip
//
// Copyright (c) 2015 Olivier Halligon <olivier@halligon.net>
//
// 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
/... | mit | f0c820e94ecd1e72c24ff7583937cd65 | 40.023256 | 112 | 0.71712 | 4.443325 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.