repo_name stringlengths 7 91 | path stringlengths 8 658 | copies stringclasses 125
values | size stringlengths 3 6 | content stringlengths 118 674k | license stringclasses 15
values | hash stringlengths 32 32 | line_mean float64 6.09 99.2 | line_max int64 17 995 | alpha_frac float64 0.3 0.9 | ratio float64 2 9.18 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
RevenueCat/purchases-ios | Tests/APITesters/SwiftAPITester/SwiftAPITester/CustomerInfoAPI.swift | 1 | 2128 | //
// Copyright RevenueCat Inc. All Rights Reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// CustomerInfoAPI.swift
//
// Created by Made... | mit | 1fae748b299876c73bc7f506d43bb112 | 34.466667 | 107 | 0.734023 | 4.172549 | false | false | false | false |
domenicosolazzo/practice-swift | File Management/Saving Objects to File/Saving Objects to File/AppDelegate.swift | 1 | 1073 | //
// AppDelegate.swift
// Saving Objects to File
//
// Created by Domenico on 27/05/15.
// License MIT
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptio... | mit | a777fa435a3dadc2cb011c5767895b3d | 28.805556 | 144 | 0.653308 | 5.208738 | false | false | false | false |
eramdam/BetterTweetDeck | safari/Better TweetDeck for Safari/Better TweetDeck for Safari Extension/SafariWebExtensionHandler.swift | 1 | 787 | //
// SafariWebExtensionHandler.swift
// Better TweetDeck for Safari Extension
//
// Created by Damien Erambert on 1/16/21.
//
import SafariServices
import os.log
let SFExtensionMessageKey = "message"
class SafariWebExtensionHandler: NSObject, NSExtensionRequestHandling {
func beginRequest(with context: NSExten... | mit | 4b3f73fa6a540d0ec7be064f20744a7f | 29.269231 | 108 | 0.72554 | 4.324176 | false | false | false | false |
codingpotato/SpriteWidget | Pod/Classes/SWFrame.swift | 1 | 1782 | //
// SWFrame.swift
// Pods
//
// Created by wangyw on 1/13/16.
//
//
import Foundation
import SpriteKit
public class SWFrame: SKNode {
private var buttons: [SWButtonController] = []
public override init() {
super.init()
userInteractionEnabled = true
}
public convenie... | mit | 4f771f30779c73e59b2011ba4dd9af83 | 26.84375 | 101 | 0.583614 | 4.868852 | false | false | false | false |
blockchain/My-Wallet-V3-iOS | Modules/FeatureAuthentication/Sources/FeatureAuthenticationUI/EmailLogin/RemoteDeviceAuthorization/AuthorizationResultView.swift | 1 | 3862 | // Copyright © Blockchain Luxembourg S.A. All rights reserved.
import BlockchainComponentLibrary
import FeatureAuthenticationDomain
import Localization
import SwiftUI
public struct AuthorizationResultView: View {
private enum Layout {
static let bottomPadding: CGFloat = 34
static let leadingPaddi... | lgpl-3.0 | 76c352fa34c5b89e09fe88ddf1f2f670 | 32.868421 | 103 | 0.665372 | 5.686303 | false | false | false | false |
marty-suzuki/QiitaWithFluxSample | Carthage/Checkouts/RxSwift/Tests/RxCocoaTests/UITextField+RxTests.swift | 2 | 1963 | //
// UITextField+RxTests.swift
// Tests
//
// Created by Krunoslav Zaher on 5/13/16.
// Copyright © 2016 Krunoslav Zaher. All rights reserved.
//
import UIKit
import RxSwift
import RxCocoa
import XCTest
// UITextField
final class UITextFieldTests : RxTest {
func test_completesOnDealloc() {
ensur... | mit | d069d5cca1dc90c9bc0320bd7e40a09c | 30.142857 | 163 | 0.654944 | 4.573427 | false | true | false | false |
the-grid/Portal | Portal/Models/CoverPreferences.swift | 1 | 1184 | import Argo
import Curry
import Foundation
import Ogra
/// Cover preferences.
public struct CoverPreferences {
public var crop: Bool
public var filter: Bool
public var overlay: Bool
public init(
crop: Bool = false,
filter: Bool = false,
overlay: Bool = false
) {
... | mit | b73b172aee1e0b19526412aaba62be0a | 19.77193 | 72 | 0.576858 | 4.274368 | false | false | false | false |
frankcjw/CJWUtilsS | CJWUtilsS/QPLib/UI/QPColumnsView.swift | 1 | 6399 | //
// QPColumnsView.swift
// CJWUtilsS
//
// Created by Frank on 19/03/2017.
// Copyright © 2017 cen. All rights reserved.
//
import UIKit
public class QPColumnsView: UIControl {
public var count = 2
public var labels: [UILabel] = []
public var lines: [UIView] = []
public var indicatorLines: [UIView] = []
p... | mit | 9697a79c3021c2fbe75e72babce81a6e | 22.696296 | 126 | 0.692404 | 3.270961 | false | false | false | false |
white-rabbit-apps/white-rabbit-common-ios | WhiteRabbitCommon/GiFHUD.swift | 1 | 14484 | //
// GiFHUD.swift
// GiFHUD-Swift
//
// Created by Cem Olcay on 07/11/14.
// Copyright (c) 2014 Cem Olcay. All rights reserved.
//
import ImageIO
import MobileCoreServices
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
}
// MARK: - UIImageView Extension
extension UIImageView... | mit | cbba21cc3610b934b59388b80039a847 | 28.026052 | 135 | 0.582436 | 5.249728 | false | false | false | false |
cscalcucci/Swift_Life | Swift_Life/AppDelegate.swift | 1 | 6114 | //
// AppDelegate.swift
// Swift_Life
//
// Created by Christopher Scalcucci on 2/11/16.
// Copyright © 2016 Christopher Scalcucci. All rights reserved.
//
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(appl... | mit | 973514e67b1c8d7dd6382b0456bef434 | 54.072072 | 291 | 0.720105 | 5.88921 | false | false | false | false |
quire-io/SwiftyChrono | Sources/Utils/JPUtil.swift | 1 | 1515 | //
// JPUtil.swift
// SwiftyChrono
//
// Created by Jerry Chen on 2/6/17.
// Copyright © 2017 Potix. All rights reserved.
//
import Foundation
// source: https://gist.github.com/sgr-ksmt/2dcf11a64cdb22d44517
extension String {
private func convertFullWidthToHalfWidth(reverse: Bool) -> String {
let str... | mit | ab9288bf6519177d623f1065c67e9e8f | 31.12766 | 107 | 0.656291 | 4.136986 | false | false | false | false |
someoneAnyone/Nightscouter | Common/Protocols/Chartable.swift | 1 | 2206 | //
// Chartable.swift
// Nightscouter
//
// Created by Peter Ina on 1/15/16.
// Copyright © 2016 Nothingonline. All rights reserved.
//
import Foundation
public protocol Chartable {
var chartDictionary: String { get }
var chartColor: String { get }
var chartDateFormatter: DateFormatter { get }
var... | mit | 4493f471a6512f6470706e354606a90c | 29.205479 | 254 | 0.61678 | 4.216061 | false | false | false | false |
yangligeryang/codepath | labs/ParseDemo/ParseDemo/LoginViewController.swift | 1 | 3071 | //
// LoginViewController.swift
// ParseDemo
//
// Created by Yang Yang on 11/29/16.
// Copyright © 2016 Yang Yang. All rights reserved.
//
import Parse
import UIKit
class LoginViewController: UIViewController {
@IBOutlet weak var emailField: UITextField!
@IBOutlet weak var passwordField: UIText... | apache-2.0 | e43ae6e252819b0e31a8298e211700aa | 35.987952 | 144 | 0.567101 | 5.293103 | false | false | false | false |
arslanbilal/cryptology-project | Cryptology Project/Cryptology Project/Classes/Views/Messages List Cell/MessagesListTableViewCell.swift | 1 | 3085 | //
// MessageListTableViewCell.swift
// Cryptology Project
//
// Created by Bilal Arslan on 15/03/16.
// Copyright © 2016 Bilal Arslan. All rights reserved.
//
import UIKit
class MessagesListTableViewCell: UITableViewCell {
private let profileImageView = UIImageView.newAutoLayoutView()
private let p... | mit | b272b7bcd3b37aa357d60e08cfbd1e98 | 40.675676 | 164 | 0.700389 | 5.317241 | false | false | false | false |
seungprk/PenguinJump | PenguinJump/PenguinJump/AboutScene.swift | 1 | 2974 | //
// AboutScene.swift
// PenguinJump
//
// Created by Seung Park on 6/6/16.
// Copyright © 2016 De Anza. All rights reserved.
//
import SpriteKit
class AboutScene: SKScene {
override func didMoveToView(view: SKView) {
backgroundColor = UIColor.whiteColor()
let logo = SKSpriteNod... | bsd-2-clause | ae9e2c94bb669c5203f49cd66e11f1c0 | 38.64 | 101 | 0.645812 | 4.140669 | false | false | false | false |
AlexChekanov/Gestalt | Gestalt/ModelLayer/Data/DataLayer.swift | 1 | 2160 | import Foundation
import CoreData
typealias TasksBlock = ([Task])->Void
protocol DataLayer {
func loadFromDB(finished: TasksBlock)
func save(dtos: [TaskDTO], translationLayer: TranslationLayer, finished: @escaping () -> Void)
}
class DataLayerImpl: DataLayer {
lazy var persistentContainer: NSPersist... | apache-2.0 | c95fd2ba6ef60bbb19cf3dcb2e0b4e7d | 31.238806 | 121 | 0.659259 | 5.359801 | false | false | false | false |
ijaureguialzo/GooglePlacesRow | Sources/GooglePlacesTableCell.swift | 1 | 3447 | //
// GooglePlacesTableCell.swift
// GooglePlacesRow
//
// Created by Mathias Claassen on 4/14/16.
//
//
import Foundation
import UIKit
open class GooglePlacesTableCell<TableViewCell: UITableViewCell>: GooglePlacesCell, UITableViewDelegate, UITableViewDataSource where TableViewCell: EurekaGooglePlacesTableViewCell... | mit | faf1e740f47f5f91898b257d8781b083 | 33.818182 | 181 | 0.665506 | 5.488854 | false | false | false | false |
kamawshuang/iOS---Animation | 3D动画(八)/3DSlideMenu/3DSlideMenu/ContainerViewController.swift | 1 | 6703 | //
// ContainerViewController.swift
// 3DSlideMenu
//
// Created by 51Testing on 15/12/9.
// Copyright © 2015年 HHW. All rights reserved.
//
import UIKit
import QuartzCore
class ContainerViewController: UIViewController {
let menuWidth: CGFloat = 80.0
let animationTime: NSTimeInterval = 0.5
... | apache-2.0 | d8d24639dfd77b72add75c39237315f1 | 29.984925 | 118 | 0.617742 | 4.948636 | false | false | false | false |
leotao2014/RTPhotoBrowser | RTPhotoBrowser/ImageCell.swift | 1 | 978 | //
// ImageCell.swift
// PtBrowser
//
// Created by leotao on 2017/2/14.
// Copyright © 2017年 leotao. All rights reserved.
//
import UIKit
import Kingfisher
class ImageCell: UICollectionViewCell {
let imageView = UIImageView();
var imageUrl:String = "" {
didSet {
imageView.kf.setImage(... | apache-2.0 | 6e48fc7adc86c7929e8531a2cf7d1ea6 | 24 | 119 | 0.611282 | 4.202586 | false | false | false | false |
thanhcuong1990/swift-sample-code | SampleCode/Utilities/Constants.swift | 1 | 873 | //
// Constants.swift
// SampleCode
//
// Created by Cuong Lam on 11/9/15.
// Copyright © 2015 Cuong Lam. All rights reserved.
//
import Foundation
import UIKit
// MARK: Storyboard
struct Storyboard {
static let Featured = "Featured"
static let Categories = "Categories"
static let Search =... | unlicense | 0e9983ab3e7b0b4b5af42d0536b32bea | 26.25 | 68 | 0.668578 | 3.824561 | false | false | false | false |
byu-oit-appdev/ios-byuSuite | byuSuite/Apps/LockerRental/controller/LockerRentalMyLockersViewController.swift | 1 | 5140 | //
// LockerRentalMyLockersViewController.swift
// byuSuite
//
// Created by Erik Brady on 7/19/17.
// Copyright © 2017 Brigham Young University. All rights reserved.
//
protocol LockerRentalDelegate {
func loadLockers()
}
class LockerRentalMyLockersViewController: ByuViewController2, UITableViewDataSource, L... | apache-2.0 | 63bc57152d04b7c1f292d8cf1ad16220 | 36.23913 | 169 | 0.578906 | 5.443856 | false | false | false | false |
michalciurus/KatanaRouter | Pods/Katana/Katana/Plastic/PlasticView.swift | 1 | 10249 | //
// PlasticView.swift
// Katana
//
// Copyright © 2016 Bending Spoons.
// Distributed under the MIT License.
// See the LICENSE file for more information.
import CoreGraphics
/// Enum that represents a constraint in the X axis
private enum ConstraintX {
case none, left, right, centerX, width
}
/// Enum that... | mit | 81e9eba7028dbcb393b7f850ac6a1af2 | 25.549223 | 113 | 0.664325 | 4.186275 | false | false | false | false |
rhcad/SwiftGraphics | SwiftGraphics/GenericGeometryTypes.swift | 1 | 3585 | //
// IntGeometry.swift
// SwiftGraphics
//
// Created by Jonathan Wight on 1/16/15.
// Copyright (c) 2015 schwa.io. All rights reserved.
//
// MARK: A generic arithmetic type.
/*
Note this seems to cause the compiler to get very unhappy when inferring types and complain about. You'll see errors like:
"er... | bsd-2-clause | 96c730e89c6fd8b0dd711596273990bf | 23.222973 | 175 | 0.690098 | 3.734375 | false | false | false | false |
rsmoz/swift-corelibs-foundation | TestFoundation/TestNSJSONSerialization.swift | 1 | 21098 | // This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the l... | apache-2.0 | d3a86d56a0b19ab060da5f931ae6669d | 36.507117 | 164 | 0.532331 | 5.030788 | false | true | false | false |
livio/HelloTrello | Pod/Classes/Card.swift | 1 | 744 | //
// Card.swift
// Pods
//
// Created by Joel Fischer on 4/8/16.
//
//
import Foundation
public struct Card: Codable {
public let id: String
public let name: String
public let description: String?
public let closed: Bool?
public let position: Int?
public let dueDate: Date?
public let l... | bsd-3-clause | ca8b7e222d256a20daf0c6b7e49b8263 | 22.25 | 60 | 0.630376 | 3.915789 | false | false | false | false |
ZwxWhite/V2EX | V2EX/V2EX/Class/Controller/Node(节点)/NodeViewController.swift | 1 | 2213 | //
// NodeViewController.swift
// V2EX
//
// Created by wenxuan.zhang on 15/11/12.
// Copyright © 2015年 张文轩. All rights reserved.
// 节点
import UIKit
import Alamofire
import RealmSwift
import SwiftyJSON
class NodeViewController: UICollectionViewController {
var nodes = [V2NodeModel]()
override func ... | mit | cb821ccc3c4991ba9bd8cffe9674ab5a | 28.72973 | 140 | 0.620455 | 5.188679 | false | false | false | false |
yonaskolb/XcodeGen | Sources/ProjectSpec/SpecOptions.swift | 1 | 10166 | import Foundation
import JSONUtilities
import Version
public struct SpecOptions: Equatable {
public static let settingPresetsDefault = SettingPresets.all
public static let createIntermediateGroupsDefault = false
public static let transitivelyLinkDependenciesDefault = false
public static let groupSortPo... | mit | bcfcf83df87325d5126765d0422b907f | 44.383929 | 152 | 0.705095 | 5.297551 | false | false | false | false |
avaidyam/Parrot | MochaUI/BlockTrampoline.swift | 1 | 2705 | import AppKit
import Mocha
public protocol BlockTrampolineSupporting: NSObjectProtocol {
/*weak*/ var target: AnyObject? { get set }
var action: Selector? { get set }
}
extension NSControl: BlockTrampolineSupporting {}
extension NSMenuItem: BlockTrampolineSupporting {}
public extension BlockTrampolineSupporti... | mpl-2.0 | d0d06681e419147d9cee2386167b65af | 30.091954 | 224 | 0.606654 | 5 | false | false | false | false |
wibosco/CoreDataMigration-Example | CoreDataMigration-Example/CoreData/CoreDataManager.swift | 1 | 2534 | //
// CoreDataManager.swift
// CoreDataMigration-Example
//
// Created by William Boles on 11/09/2017.
// Copyright © 2017 William Boles. All rights reserved.
//
import Foundation
import CoreData
class CoreDataManager {
let migrator: CoreDataMigrator
lazy var persistentContainer: NSPersistentCon... | mit | 3b572b5b4a59940139ba89e52651f344 | 27.784091 | 111 | 0.602448 | 6.045346 | false | false | false | false |
quickthyme/PUTcat | Tests/iOS/Project/ProjectSceneMock.swift | 1 | 1886 |
import UIKit
class ProjectSceneMock: ProjectScene {
var sceneData: ProjectSceneData = ProjectSceneData(section: [])
var projectID: String?
var parentSceneDataItem: SceneDataItem = ProjectSceneDataItem()
var resetSceneWasCalled = false
var refreshSceneWasCalled = false
var navigateWasCalled = f... | apache-2.0 | 66a9376faf73e7cb93004855a7652801 | 42.860465 | 112 | 0.750265 | 5.253482 | false | false | false | false |
APUtils/APExtensions | APExtensions/Classes/Core/_Extensions/_Foundation/Error+Utils.swift | 1 | 973 | //
// Error+Utils.swift
// APExtensions
//
// Created by Anton Plebanovich on 6/28/17.
// Copyright © 2019 Anton Plebanovich. All rights reserved.
//
import Foundation
public extension Error {
/// Checks if cancelled error
var isCancelledError: Bool {
guard _domain == NSURLErrorDomain else {... | mit | a96a4985a12bdc72837c3386b008eaad | 29.375 | 98 | 0.639918 | 5.554286 | false | false | false | false |
honghaoz/2048-Solver-AI | 2048 AI/AI/GameBoardAssistant.swift | 1 | 8012 | // Copyright © 2019 ChouTi. All rights reserved.
import Foundation
class GameboardAssistant: CustomStringConvertible {
private let _goal: Int = 2048
private var _won: Bool = false
// Size of the board
private var _size: Int
// Cells of the board
private var _cell: [[Int]]
// MARK: public properties
... | gpl-2.0 | 8b51607265fadc433c1a8077bc4f9946 | 24.034375 | 124 | 0.524154 | 3.36314 | false | false | false | false |
remirobert/Dotzu-Objective-c | Pods/Dotzu/Dotzu/Log.swift | 3 | 1561 | //
// Log.swift
// exampleWindow
//
// Created by Remi Robert on 17/01/2017.
// Copyright © 2017 Remi Robert. All rights reserved.
//
import UIKit
class Log: NSObject, NSCoding {
let level: LogLevel
let id: String
let fileInfo: String?
let content: String
let date: Date?
init(content: St... | mit | 0e7c1e25eca0757e87a787a5d8fb3c22 | 27.363636 | 85 | 0.61859 | 4.0625 | false | false | false | false |
damicreabox/Git2Swift | Sources/Git2Swift/repository/Repository+Open.swift | 1 | 4580 | //
// Repository+Init.swift
// Git2Swift
//
// Created by Damien Giron on 31/07/2016.
// Copyright © 2016 Creabox. All rights reserved.
//
import Foundation
import CLibgit2
// MARK: - Repository extension for openning
extension Repository {
/// Constructor with URL and manager
///
/// - parameter... | apache-2.0 | 88ad5bc89b5e7d9fda2416cb23b43ea7 | 32.669118 | 103 | 0.574798 | 4.8661 | false | false | false | false |
MailOnline/ImageViewer | ImageViewer/Source/Extensions/CAShapeLayer.swift | 2 | 4369 | //
// UIImage.swift
// ImageViewer
//
// Created by Kristian Angyal on 28/07/2016.
// Copyright © 2016 MailOnline. All rights reserved.
//
import UIKit
extension CAShapeLayer {
static func replayShape(_ fillColor: UIColor, triangleEdgeLength: CGFloat) -> CAShapeLayer {
let triangle = CAShapeLayer()
... | mit | ddcee5d3862cf53aefb7fddb4b9958d5 | 36.655172 | 125 | 0.680861 | 4.70183 | false | false | false | false |
TinyCrayon/TinyCrayon-iOS-SDK | TCMask/CanvasView.swift | 1 | 2008 | //
// CanvasView.swift
// TinyCrayon
//
// Created by Xin Zeng on 2/16/16.
//
//
import UIKit
class CanvasView : UIView {
let scaleFactor = UIScreen.main.scale
var cacheContext: CGContext!
var _data = [UInt8]()
var data: [UInt8] { get {return _data} }
required init?(coder aDecoder: NSCoder... | mit | 88d86651c9475b4c3815a670821c093e | 34.857143 | 222 | 0.64741 | 3.992048 | false | false | false | false |
benlangmuir/swift | test/attr/Inputs/PackageDescription.swift | 19 | 1399 | public enum SwiftVersion {
// CHECK: @available(_PackageDescription, introduced: 3.0, deprecated: 4.2, obsoleted: 5.0)
@available(_PackageDescription, introduced: 3.0, deprecated: 4.2, obsoleted: 5.0)
case v3
case v4
// CHECK: @available(_PackageDescription 5.0)
// CHECK-NEXT: @available(macOS... | apache-2.0 | cdb3e18073d420361a7168baebbd827d | 24.907407 | 95 | 0.606147 | 4.331269 | false | false | false | false |
wordpress-mobile/WordPress-iOS | WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailCommentsTableViewDelegate.swift | 1 | 6928 | import UIKit
/// Table View delegate to handle the Comments table displayed in Reader Post details.
///
class ReaderDetailCommentsTableViewDelegate: NSObject, UITableViewDataSource, UITableViewDelegate {
// MARK: - Private Properties
private(set) var totalComments = 0
private var post: ReaderPost?
pri... | gpl-2.0 | 75acf34e085581337cfca5e96b2993b8 | 39.046243 | 181 | 0.664261 | 5.802345 | false | false | false | false |
kellanburket/Passenger | Example/Pods/Wildcard/Pod/Classes/Wildcard.swift | 1 | 22728 | //
// Wildcard.swift
// Wildcard
//
// Created by Kellan Cummings on 6/6/15.
// Copyright (c) 2015 Kellan Cummings. All rights reserved.
//
import UIKit
private let consonant = "[b-df-hj-np-tv-z]"
private let vowel = "[aeiou]"
let plurals: [(String, String)] = [
("(?<=f)oo(?=t)$|(?<=t)oo(?=th)$|(?<=g)oo(?=s... | mit | f8f46d775b7914e4c726a4e8599e5d8f | 32.522124 | 153 | 0.526906 | 4.554509 | false | false | false | false |
tomtclai/swift-algorithm-club | Set Cover (Unweighted)/SetCover.playground/Sources/RandomArrayOfSets.swift | 7 | 1171 | import Foundation
public func randomArrayOfSets<T>(covering universe: Set<T>,
minArraySizeFactor: Double = 0.8,
maxSetSizeFactor: Double = 0.6) -> Array<Set<T>> {
var result = [Set<T>]()
var ongoingUnion = Set<T>()
let minArraySize = Int(Double(univers... | mit | 3737f0a8aa2b0b549f94a6bd4677dbd0 | 26.232558 | 80 | 0.614005 | 3.956081 | false | false | false | false |
WickedColdfront/Slide-iOS | Slide for Reddit/MediaViewController.swift | 1 | 6024 | //
// MediaViewController.swift
// Slide for Reddit
//
// Created by Carlos Crane on 12/28/16.
// Copyright © 2016 Haptic Apps. All rights reserved.
//
import UIKit
import reddift
import SDWebImage
import ImageViewer
import MaterialComponents.MaterialProgressView
class MediaViewController: UIViewController, UIVie... | apache-2.0 | 9cdd8643b263e0bee14aa874d306c32a | 38.887417 | 274 | 0.649676 | 5.283333 | false | false | false | false |
codingrhythm/traffic_lights | Traffic Lights/Traffic Lights/Modules/Views/TrafficLightsView.swift | 1 | 767 | //
// TrafficLightsView.swift
// Traffic Lights
//
// Created by Zack Zhu on 04/03/2017.
//
//
import UIKit
class TrafficLightsView: UIView {
@IBOutlet var greenLight: LightView?
@IBOutlet var yellowLight: LightView?
@IBOutlet var redLight: LightView?
var trafficLights: TrafficLight? {
... | mit | 80b99e2170cc74475dd68fea115178e6 | 20.914286 | 55 | 0.616688 | 4.408046 | false | false | false | false |
dautermann/500pxDemoBrowser | LevelMoney500pxBrowser/CircleImageView.swift | 1 | 1230 | //
// CircleImageView.swift
// LevelMoney500pxBrowser
//
// Created by Michael Dautermann on 2/18/16.
// Copyright © 2016 Michael Dautermann. All rights reserved.
//
import UIKit
class LMImageView: UIImageView {
// keep track of this image view's URL, super useful in case we want
// to cancel setting (or... | mit | 3b40277c0d0fbb2db04ff6352a98fb7e | 34.114286 | 103 | 0.637103 | 4.708812 | false | false | false | false |
YoungFuRui/douyu | douyuTV/douyuTV/Classes/Main/View/PageTitleView.swift | 1 | 6260 | //
// PageTitleView.swift
// douyuTV
//
// Created by free on 17/2/19.
// Copyright © 2017年 free. All rights reserved.
//
import UIKit
// MARK:- 定义协议
protocol PageTitleViewDelegate : class {
func pageTitleView(titleView : PageTitleView, selectedIndex index : Int)
}
// MARK:- 定义常量
private let kScrollLineH : C... | mit | 131755842110acdae5e431c28cd545f6 | 31.646409 | 174 | 0.609071 | 4.663773 | false | false | false | false |
michael-lehew/swift-corelibs-foundation | Foundation/Measurement.swift | 2 | 12525 | //===----------------------------------------------------------------------===//
//
// 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 | ef4701f1f86cbb4797f362d7e632af88 | 44.216606 | 276 | 0.66515 | 4.20161 | false | false | false | false |
natecook1000/swift | stdlib/public/core/ContiguousArrayBuffer.swift | 1 | 23459 | //===----------------------------------------------------------------------===//
//
// 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 | 14c4783b00216044b6290572e1369b8d | 30.570659 | 110 | 0.697148 | 4.748381 | false | false | false | false |
GeoThings/LakestoneGeometry | Source/BoundingBox.swift | 1 | 5834 | //
// BoundingBox.swift
// LakestoneGeometry
//
// Created by Volodymyr Andriychenko on 20/10/2016.
// Copyright © 2016 GeoThings. All rights reserved.
//
// --------------------------------------------------------
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file e... | apache-2.0 | 398f633b5d12381dedff031fd482a7cb | 25.625571 | 158 | 0.664037 | 3.635287 | false | false | false | false |
elysiumd/ios-wallet | BreadWallet/BRAPIProxy.swift | 1 | 5391 | //
// BRAPIProxy.swift
// BreadWallet
//
// Created by Samuel Sutch on 2/8/16.
// Copyright (c) 2016 breadwallet LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restr... | mit | b645e6416a89ec480d5c4f398b892c6a | 45.076923 | 115 | 0.595251 | 4.896458 | false | false | false | false |
a736220388/TestKitchen_1606 | TestKitchen/TestKitchen/classes/cookbook/recommend/model/CBRecommendModel.swift | 1 | 3838 | //
// CBRecommendModel.swift
// TestKitchen
//
// Created by qianfeng on 16/8/16.
// Copyright © 2016年 qianfeng. All rights reserved.
//
import UIKit
import SwiftyJSON
class CBRecommendModel: NSObject {
var code:NSNumber?
var msg:Bool?
var version:String?
var timestamp:NSNumber?
var data:CBRec... | mit | 2924e6870def24841816b1d873977b4a | 33.241071 | 72 | 0.663364 | 4.454123 | false | false | false | false |
mightydeveloper/swift | test/DebugInfo/linetable-cleanups.swift | 10 | 868 | // RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s
func markUsed<T>(t: T) {}
class Person {
var name = "No Name"
var age = 0
}
func main() {
var person = Person()
var b = [0,1,13]
for element in b {
markUsed("element = \(element)")
}
markUsed("Done with the for loop... | apache-2.0 | 83778a3dee4633d14020fa6b975b4e53 | 28.931034 | 78 | 0.573733 | 3.167883 | false | false | false | false |
Limon-O-O/Medusa | MED/Views/RingControl.swift | 1 | 4973 | //
// RingControl.swift
// VideoRecorderExample
//
// Created by Limon on 6/15/16.
// Copyright © 2016 VideoRecorder. All rights reserved.
//
import UIKit
@IBDesignable
class RingControl: UIControl {
enum TouchStatus {
case began
case press
case end
}
var toucheActions: ((_ s... | mit | 26709a20719586718d2aa8c58f71201a | 28.772455 | 160 | 0.651247 | 4.447227 | false | false | false | false |
ffried/FFUIKit | Sources/FFUIKit/ViewControllers/Notifications/NotificationAnimationController.swift | 1 | 4113 | //
// NotificationAnimationController.swift
// FFUIKit
//
// Copyright 2016 Florian Friedrich
//
// 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/L... | apache-2.0 | 0b21f4052565e9a3b09859bb63dc5b2c | 41.84375 | 132 | 0.640165 | 5.626539 | false | false | false | false |
marwen86/NHtest | NHTest/NHTest/Model/NHResultImagesParser.swift | 1 | 910 | //
// NHResultImagesParser.swift
// NHTest
//
// Created by Mohamed Marouane YOUSSEF on 07/10/2017.
// Copyright © 2017 Mohamed Marouane YOUSSEF. All rights reserved.
//
import UIKit
extension NHResultImages {
static func fromJson(_ data : Dictionary<String,AnyObject>)-> NHResultImages? {
... | mit | 35268e817828e8ffdce1b1d47234cf01 | 26.545455 | 114 | 0.564356 | 4.169725 | false | false | false | false |
PekanMmd/Pokemon-XD-Code | Objects/data types/enumerable/XGType.swift | 1 | 2651 | //
// XGTypeData.swift
// XG Tool
//
// Created by StarsMmd on 19/05/2015.
// Copyright (c) 2015 StarsMmd. All rights reserved.
//
import Foundation
let kCategoryOffset = 0x0
let kTypeIconBigIDOffset = 0x02
let kTypeIconSmallIDOffset = 0x04
let kTypeNameIDOffset = 0x8
let kFirstEffectivenessOffset = 0xD
let kSize... | gpl-2.0 | a6468b54df3171ac2906e22181f7f169 | 21.65812 | 97 | 0.723878 | 3.368488 | false | false | false | false |
vimeo/VimeoNetworking | Sources/Shared/Requests/Request+Picture.swift | 1 | 2250 | //
// Request+Picture.swift
// Pods
//
// Created by King, Gavin on 10/24/16.
//
//
public extension Request {
/// `Request` that returns a single `VIMPicture`
typealias PictureRequest = Request<VIMPicture>
/**
Create a `Request` to create a picture for a user
- parameter userURI: t... | mit | c0ea10ddcd8908011c99ca0879fe1864 | 27.481013 | 117 | 0.625778 | 4.420432 | false | false | false | false |
netguru/inbbbox-ios | Inbbbox/Source Files/ViewControllers/ProfileShotsViewController.swift | 1 | 12188 | //
// ProfileShotsViewController.swift
// Inbbbox
//
// Copyright © 2016 Netguru Sp. z o.o. All rights reserved.
//
import UIKit
import ZFDragableModalTransition
import PromiseKit
import PeekPop
fileprivate func < <T : Comparable>(lhs: T?, rhs: T?) -> Bool {
switch (lhs, rhs) {
case let (l?, r?):
return l ... | gpl-3.0 | 12ae0972509afff283e06b4fa9771695 | 37.444795 | 171 | 0.721178 | 5.775829 | false | false | false | false |
blockchain/My-Wallet-V3-iOS | Modules/FeatureSettings/Sources/FeatureSettingsUI/Routers/SettingsBuilder.swift | 1 | 2582 | // Copyright © Blockchain Luxembourg S.A. All rights reserved.
import DIKit
import FeatureCardPaymentDomain
import Localization
import PlatformKit
import UIKit
public protocol SettingsBuilding: AnyObject {
func removeCardPaymentMethodViewController(cardData: CardData) -> UIViewController
func removeBankPaymen... | lgpl-3.0 | 1e5c576ccf5dbe377632966654d74e97 | 37.522388 | 101 | 0.733437 | 5.960739 | false | false | false | false |
zhugejunwei/LeetCode | 375. Guess Number Higher or Lower II.swift | 1 | 1112 | import Darwin
// dp solution, 884 ms
//func getMoneyAmount(n: Int) -> Int {
// var num = Array(count: n+1, repeatedValue: Array(count: n+1, repeatedValue: 0))
// return dp(&num, 1, n)
//}
//
//func dp(inout num: [[Int]], _ s: Int, _ e: Int) -> Int {
// if s >= e {
// return 0
// }
// if num[s][e]... | mit | 88a907c6c2e1880b475cd15551400ab9 | 22.680851 | 85 | 0.444245 | 2.79397 | false | false | false | false |
LeeShiYoung/LSYWeibo | LSYWeiBo/Main/BaseTableViewController.swift | 1 | 1871 | //
// BaseTableViewController.swift
// LSYWeiBo
//
// Created by 李世洋 on 16/5/1.
// Copyright © 2016年 李世洋. All rights reserved.
//
import UIKit
class BaseTableViewController: UITableViewController {
var visitorView: VisitorView?
let login = UserAccount.userLogin()
override func loadView() {
... | artistic-2.0 | 8f42f030369088390dcd23ff8f9adbf4 | 25.716418 | 147 | 0.664804 | 5.014006 | false | false | false | false |
Antondomashnev/FBSnapshotsViewer | FBSnapshotsViewerTests/ApplicationTestLogFilesListenerSpec.swift | 1 | 4588 | //
// ApplicationTestLogFilesListenerSpec.swift
// FBSnapshotsViewer
//
// Created by Anton Domashnev on 26.04.17.
// Copyright © 2017 Anton Domashnev. All rights reserved.
//
import Quick
import Nimble
@testable import FBSnapshotsViewer
class ApplicationTestLogFilesListener_MockFolderEventsListenerFactory: Fold... | mit | 518336c4ed67c228b33065764494bb75 | 41.869159 | 178 | 0.679965 | 5.972656 | false | true | false | false |
Incipia/Goalie | PaintCode/BizeeBeeCharacterKit.swift | 1 | 12681 | //
// BizeeBeeCharacterKit.swift
// Goalie
//
// Created by Gregory Klein on 2/9/16.
// Copyright © 2016 Incipia. All rights reserved.
//
import UIKit
class BizeeBeeCharacterKit
{
class func drawAccessoriesForPriority(_ priority: TaskPriority)
{
switch priority
{
case .ages:
//// ... | apache-2.0 | d8dac2f7e3880dcbb6d423734565aa7d | 55.106195 | 153 | 0.635804 | 3.003316 | false | false | false | false |
uasys/swift | test/Parse/deprecated_where.swift | 13 | 4344 | // RUN: %target-swift-frontend -typecheck -verify %s -swift-version 4
protocol Mashable { }
protocol Womparable { }
// FuncDecl: Choose 0
func f1<T>(x: T) {}
// FuncDecl: Choose 1
// 1: Inherited constraint
func f2<T: Mashable>(x: T) {} // no-warning
// 2: Non-trailing where
func f3<T where T: Womparable>(x: T) {} /... | apache-2.0 | e79a8072793966ba8f4c75bfeb564e1f | 51.97561 | 215 | 0.673343 | 3.12743 | false | false | false | false |
tjw/swift | test/SILGen/init_ref_delegation.swift | 2 | 8556 | // RUN: %target-swift-frontend -emit-silgen %s -disable-objc-attr-requires-foundation-module | %FileCheck %s
struct X { }
// Initializer delegation within a struct.
struct S {
// CHECK-LABEL: sil hidden @$S19init_ref_delegation1SV{{[_0-9a-zA-Z]*}}fC : $@convention(method) (@thin S.Type) -> S {
init() {
// CHE... | apache-2.0 | 51cb4bd9b02b9a784381e85d845a3b8f | 42.85641 | 182 | 0.537886 | 2.703762 | false | false | false | false |
testpress/ios-app | ios-app/UI/AccessCodeExamsViewController.swift | 1 | 2580 | //
// AccessCodeExamsViewController.swift
// ios-app
//
// Copyright © 2017 Testpress. 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
// in the Software without restriction, in... | mit | abde428ba3a5403507124ae8a4323d26 | 36.926471 | 100 | 0.692904 | 4.723443 | false | false | false | false |
vector-im/vector-ios | RiotSwiftUI/Modules/Onboarding/Avatar/View/OnboardingAvatarScreen.swift | 1 | 5579 | //
// Copyright 2021 New Vector Ltd
//
// 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 | 6a8863f3864573e58731d41e9afe90a1 | 34.535032 | 99 | 0.59957 | 5.071818 | false | false | false | false |
fe9lix/TimeAway | TimeAway/src/AppDelegate.swift | 1 | 3347 | import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate, LockControllerDelegate, StatusBarMenuDelegate {
@IBOutlet weak var statusBarMenu: StatusBarMenu!
let mainWindowController = MainWindowController(windowNibName: "MainWindow")
let lockController = LockController(use... | mit | 0f5bdde92706bd1d7c9b4cfb9cff12dd | 30.280374 | 120 | 0.68539 | 5.653716 | false | false | false | false |
dnevera/IMProcessing | IMProcessing/Classes/Base/IMPGraphics.swift | 1 | 2811 | //
// IMPGraphics.swift
// IMProcessing
//
// Created by denis svinarchuk on 20.04.16.
// Copyright © 2016 Dehancer.photo. All rights reserved.
//
#if os(iOS)
import UIKit
#else
import Cocoa
#endif
import Metal
import simd
public protocol IMPGraphicsProvider {
var backgroundColor:IMPColor {get set}
... | mit | 083e754112140b6bbb80514586d4aae6 | 31.674419 | 139 | 0.631673 | 5.026834 | false | false | false | false |
PedroTrujilloV/TIY-Assignments | 33--The-Eagle-has-Landed/LaberintoLabyrinth/LaberintoLabyrinth/ModeSelectionViewController.swift | 1 | 2933 | //
// MainViewController.swift
// LaberintoLabyrinth
//
// Created by Pedro Trujillo on 12/6/15.
// Copyright © 2015 Pedro Trujillo. All rights reserved.
//
import UIKit
protocol playMazeProtocolDelegate
{
func gameResult(name:String, scoreTime:NSTimeInterval)
}
class ModeSelectionViewController: UIViewContr... | cc0-1.0 | acfe21b4e9aaf703f1be6a88efd9b529 | 30.869565 | 181 | 0.642906 | 4.280292 | false | false | false | false |
veeman961/Flicks | Flicks/MoviesViewController.swift | 1 | 8494 | //
// MoviesViewController.swift
// Flicks
//
// Created by Kevin Rajan on 1/10/16.
// Copyright © 2016 veeman961. All rights reserved.
//
import UIKit
import AFNetworking
import JTProgressHUD
class MoviesViewController: UIViewController, UITableViewDataSource, UITableViewDelegate, UICollectionViewDataSource, UIC... | apache-2.0 | 4b6bb23021238d267b9e546ccef6f538 | 34.3875 | 180 | 0.618038 | 5.580158 | false | false | false | false |
XGBCCC/JBImageBrowserViewController | JBImageBrowserViewController/JBImageBrowserViewController.swift | 1 | 19553 | //
// JBImageBrowserView.swift
// JBImageBrowserView
//
// Created by JimBo on 16/2/17.
// Copyright © 2016年 JimBo. All rights reserved.
//
import UIKit
import Kingfisher
open class JBImageBrowserViewController: UIViewController {
fileprivate var imageList:[JBImage]!
fileprivate let defaultZoomScale:CGF... | mit | 1fd5f7319dffdfb331092a82edff759a | 38.795309 | 274 | 0.581976 | 5.887697 | false | false | false | false |
RobotRebels/SwiftLessons | students_trashspace/pnaumov/Ticket2.playground/Contents.swift | 1 | 2001 | //: Playground - noun: a place where people can play
import UIKit
enum Books: String {
case Swift = "Swift. Основы разработки приложений под iOS и macOS"
case Java = "Java SE 8. Базовый курс"
case Python = "Простой Python. Современный стиль программирования"
}
struct Library {
public var moscow... | mit | c9b977773c83050183dc9955804ddf03 | 29.020833 | 82 | 0.69535 | 2.803502 | false | false | false | false |
apple/swift-corelibs-foundation | Darwin/Foundation-swiftoverlay/Foundation.swift | 1 | 11042 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | apache-2.0 | 4da25c7199db53e686d0bafbb8a90c60 | 44.016327 | 82 | 0.605948 | 4.963546 | false | false | false | false |
Ryukie/Ryubo | Ryubo/Ryubo/Classes/View/Home/Cell/RYBottomView.swift | 1 | 4098 | //
// RYBottomView.swift
// Ryubo
//
// Created by 王荣庆 on 16/2/18.
// Copyright © 2016年 Ryukie. All rights reserved.
//
import UIKit
class RYBottomView: UIView {
//找到自定义的入口
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
setClickEvents()
}
required init?(c... | mit | 426f2b1d2c7a9faae35593d914ada132 | 35.333333 | 173 | 0.622543 | 3.982255 | false | false | false | false |
Harry-L/5-3-1 | PlateMath/PlateMath/Plates.swift | 1 | 1214 | //
// Plates.swift
// PlateMath
//
// Created by Harry Liu on 2016-01-18.
// Copyright © 2016 HarryLiu. All rights reserved.
//
import UIKit
class Plates: NSObject {
func doTheMath(weight weight: Int, bar: Int, collar: Int, five: Int, ten: Int, twentyFive: Int, thirtyFive: Int, fortyFive: Int) -> [Int] {
... | mit | 6b6b831b4417d6314717f268a0325809 | 25.369565 | 143 | 0.493817 | 3.875399 | false | false | false | false |
austinzmchen/guildOfWarWorldBosses | GoWWorldBosses/Views/ACBorderedTextField.swift | 1 | 1769 | //
// ACBorderedTextField.swift
// GoWWorldBosses
//
// Created by Austin Chen on 2016-12-20.
// Copyright © 2016 Austin Chen. All rights reserved.
//
import UIKit
@IBDesignable
class ACBorderedTextField: UITextField {
@IBInspectable var cornerRadius: CGFloat = 0 {
didSet {
layer.corn... | mit | 27809a0f08d901db86f24512693a2631 | 28.966102 | 115 | 0.638575 | 5.109827 | false | false | false | false |
uias/Pageboy | Sources/Pageboy/Utilities/WeakContainer.swift | 1 | 483 | //
// WeakContainer.swift
// Pageboy iOS
//
// Created by Merrick Sapsford on 02/03/2019.
// Copyright © 2019 UI At Six. All rights reserved.
//
import Foundation
internal final class WeakWrapper<T: AnyObject> {
private(set) weak var object: T?
init(_ object: T) {
self.object = object
... | mit | 1b2728f3bd7bac48b6d841475e2ac69e | 18.28 | 65 | 0.622407 | 3.795276 | false | false | false | false |
ncalexan/firefox-ios | Client/Frontend/Widgets/PhotonActionSheetAnimator.swift | 4 | 3709 | /* 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 UIKit
class PhotonActionSheetAnimator: NSObject, UIViewControllerAnimatedTransitioning {
var pres... | mpl-2.0 | 256ab2fe8b775038e8892152ca49a4a0 | 45.949367 | 202 | 0.682664 | 5.795313 | false | false | false | false |
Legoless/Analytical | Analytical/Classes/Provider/FirebaseProvider.swift | 1 | 9066 | //
// FirebaseProvider.swift
// Analytical
//
// Created by Dal Rupnik on 30/05/17.
// Copyright © 2017 Unified Sense. All rights reserved.
//
import Analytical
import Firebase
public enum FirebaseProperties : String {
case customOne
case creativeName
case creativeSlot
case groupId
case index
... | mit | f9184f59f32fe958f30277a2f8547f1d | 30.151203 | 163 | 0.604302 | 5.647975 | false | false | false | false |
briancroom/XcodeUITestingExperiments | Swift/NetworkStubbingExperiment/NetworkStubbingExperiment/ViewController.swift | 1 | 1400 | import UIKit
class ViewController: UIViewController {
let session = NSURLSession.sharedSession()
@IBOutlet var label: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
let task = session.dataTaskWithURL(URLWithPath("hello")) { data, _, _ in
guard let data = data, stri... | mit | 0ab9259839b0231045a92ee77661d9aa | 30.818182 | 127 | 0.66 | 5.072464 | false | false | false | false |
kstaring/swift | validation-test/compiler_crashers_fixed/00788-t.swift | 11 | 705 | // This source file is part of the Swift.org open source project
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list... | apache-2.0 | 4a4771400717ce51281a410e8d47d2dd | 21.741935 | 78 | 0.642553 | 2.889344 | false | false | false | false |
wikimedia/wikipedia-ios | WMF Framework/ReadingList+CoreDataClass.swift | 1 | 3609 | import Foundation
import CoreData
public class ReadingList: NSManagedObject {
@objc public static let entriesLimitReachedNotification = NSNotification.Name(rawValue:"WMFEntriesLimitReachedNotification")
@objc public static let entriesLimitReachedReadingListKey = "readingList"
// Note that this re... | mit | c57985c2dddbf5f3f8577440c96c7d87 | 40.965116 | 128 | 0.605431 | 5.65674 | false | false | false | false |
hellogaojun/Swift-coding | 02-常量变量/02-常量变量/main.swift | 1 | 1629 | //
// main.swift
// 02-常量变量
//
// Created by gaojun on 16/4/2.
// Copyright © 2016年 高军. All rights reserved.
//
import Foundation
/*
输出:
C: printf("Hello, World!");
OC:NSLog(@"Hello, World!");
Swift1.2:println("Hello, World!")
Swift2.0:print("Hello, World!")
*/
print("Hello, World!")
/*
“使用let来声明常量,使用var来声明变量”
... | apache-2.0 | 8589e5e1359dca1c390526aed922e3e3 | 12.220779 | 101 | 0.687623 | 2.247241 | false | false | false | false |
akrio714/Wbm | Wbm/Component/Button/BaseButton.swift | 1 | 2490 | //
// BaseButton.swift
// Wbm
//
// Created by akrio on 2017/7/10.
// Copyright © 2017年 akrio. All rights reserved.
//
import UIKit
import SnapKit
@IBDesignable
public class BaseButton: UIButton {
internal var buttonTheme:UIColor.Theme = .blue
@IBInspectable public var theme:Int{
get {
... | apache-2.0 | 11304a5ed2431c81a2ee2be9a9b3f025 | 25.747126 | 114 | 0.529437 | 4.553816 | false | false | false | false |
matibot/MBAssetsImporter | MBAssetsImporter/PixabayImporter.swift | 1 | 4351 | //
// PanoramioImporter.swift
// MBAssetsImporter
//
// Created by Mati Bot on 7/28/15.
// Copyright © 2015 Mati Bot. All rights reserved.
//
import UIKit
import Photos
import Foundation
import CoreLocation
class PixabayImporter: Importer {
var numberOfPictures : Int
var task : URLSessionDataTask?
... | mit | b085170a76972b1bb23308bccf1b826f | 34.365854 | 177 | 0.511034 | 5.160142 | false | false | false | false |
laurentVeliscek/AudioKit | AudioKit/Common/Playgrounds/Synthesis.playground/Pages/Segment Operations.xcplaygroundpage/Contents.swift | 1 | 1810 | //: ## Segment Operations
//: ### You can create segments that vary parameters in operations linearly or exponentially over a certain duration.
//: ### Here we create an alien apocalypse.
//:
import XCPlayground
import AudioKit
let generator = AKOperationGenerator() { parameters in
let updateRate = parameters[0]
... | mit | f134aafb4be1c003b19532e290018482 | 28.193548 | 117 | 0.68011 | 4.513716 | false | false | false | false |
dcunited001/Spectra | Example/Tests/S3DXMLSpec.swift | 1 | 11401 | //
// S3DXMLSpec.swift
// Spectra
//
// Created by David Conner on 10/17/15.
// Copyright © 2015 CocoaPods. All rights reserved.
//
import Foundation
import Spectra
import Ono
import Quick
import Nimble
import Metal
class S3DXMLSpec: QuickSpec {
override func spec() {
let device = MTLCreateSy... | mit | 2073d5953d6240b4a955df60e685eb72 | 47.105485 | 122 | 0.597105 | 5.142084 | false | false | false | false |
malaonline/iOS | mala-ios/View/TeacherDetail/TeacherDetailsHighScoreTableView.swift | 1 | 5985 | //
// TeacherDetailsHighScoreTableView.swift
// mala-ios
//
// Created by Elors on 1/11/16.
// Copyright © 2016 Mala Online. All rights reserved.
//
import UIKit
private let TeacherDetailsHighScoreTableViewCellReuseId = "TeacherDetailsHighScoreTableViewCellReuseId"
class TeacherDetailsHighScoreTableView: UITable... | mit | 9a5322a07fd7380ba843c51b7e673a06 | 32.534091 | 131 | 0.633683 | 4.877686 | false | false | false | false |
marcelganczak/swift-js-transpiler | test/weheartswift/conditionals-4.swift | 1 | 177 | var a = 2
var b = 2
var c = 2
if (a == b) || (a == c) || (b == c) {
print("At least two variables have the same value")
} else {
print("All the values are different")
} | mit | 058860fd57e5d4fc702620dc9abde83a | 18.777778 | 55 | 0.542373 | 2.854839 | false | false | false | false |
huahuasj/ios-charts | Charts/Classes/Data/ScatterChartData.swift | 6 | 1407 | //
// ScatterChartData.swift
// Charts
//
// Created by Daniel Cohen Gindi on 26/2/15.
//
// Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
// A port of MPAndroidChart for iOS
// Licensed under Apache License 2.0
//
// https://github.com/danielgindi/ios-charts
//
import UIKit
public class ScatterChartData:... | apache-2.0 | f87dd67dadc1738a0b77ed80d836788e | 22.847458 | 96 | 0.538024 | 4.835052 | false | false | false | false |
haawa799/WaniKani-iOS | WaniKani/Views/Layouts/CriticalItemsLayout.swift | 1 | 1173 | //
// CriticalItemsLayout.swift
// WaniKani
//
// Created by Andriy K. on 11/5/15.
// Copyright © 2015 Andriy K. All rights reserved.
//
import UIKit
class CriticalItemsLayout: UICollectionViewFlowLayout {
private let aspectRatio: CGFloat = 724 / 170
private let defaultCellInset: CGFloat = 7
let rowsSpac... | gpl-3.0 | eb1ca58232025185ff2c5cf0572b0c14 | 31.555556 | 137 | 0.713311 | 4.406015 | false | false | false | false |
lilongcnc/Swift-weibo2015 | ILWEIBO04/ILWEIBO04/Classes/Tools/SQLite.swift | 1 | 4311 | //
// SQLite.swift
// 01-工资表
//
// Created by 刘凡 on 15/3/14.
// Copyright (c) 2015年 itheima. All rights reserved.
//
import Foundation
class SQLite {
/// 单例
private static let instance = SQLite()
class var sharedSQLite : SQLite {
return instance
}
/// database_connection 对象
v... | mit | 0fb66445897285988634b743decee5c4 | 29.607407 | 113 | 0.530622 | 3.945559 | false | false | false | false |
wireapp/wire-ios | Wire-iOS/Sources/UserInterface/App Lock/AppLockModule.Router.swift | 1 | 2900 | //
// Wire
// Copyright (C) 2020 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 | b911a270503cd028a22a93326b904a1e | 32.72093 | 143 | 0.721034 | 5.225225 | false | false | false | false |
dmonagle/vapor-graph | Sources/VaporGraph/Graph.swift | 1 | 9677 | import Vapor
import FluentProvider
import Foundation
/**
Implements callbacks for the Graph sync lifecycle
*/
public protocol GraphSyncDelegate {
func graphWillSync(forced: Bool) throws
func graphDidSync()
}
open class Graph : GraphSynchronizable {
/**
Determines how a model with an id that alre... | mit | dd63d61c0c208ef6b359e217ac8f3253 | 38.020161 | 171 | 0.619407 | 4.743627 | false | false | false | false |
imzyf/99-projects-of-swift | 018-flickr-search/018-flickr-search/FilckrModel/Flickr.swift | 1 | 5932 | /**
* Copyright (c) 2016 Razeware LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publi... | mit | 0519b95157a1ac3c1796da28999200e5 | 36.308176 | 167 | 0.62913 | 5.078767 | false | false | false | false |
Adlai-Holler/BondPlusCoreData | BondPlusCoreDataTests/BondPlusCoreDataTests.swift | 2 | 6862 |
import CoreData
import Nimble
import Quick
import BondPlusCoreData
import Bond
import AlecrimCoreData
class DataContext: Context {
var stores: Table<Store> { return Table<Store>(context: self) }
var items: Table<Item> { return Table<Item>(context: self) }
}
class NSFetchedResultsDynamicArraySpec: QuickS... | mit | f15369ea19d2db73a71652f44d985050 | 37.335196 | 231 | 0.644273 | 4.677573 | false | false | false | false |
OscarSwanros/swift | benchmark/single-source/UTF8Decode.swift | 6 | 2337 | //===--- UTF8Decode.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 | b467ab61af311e16745ff2c9f007c0c2 | 41.431373 | 591 | 0.665434 | 3.718213 | false | false | false | false |
iosdevelopershq/Camille | Sources/CamilleServices/Karma/KarmaService+User.swift | 1 | 1015 | import Chameleon
extension KarmaService {
func userCount(bot: SlackBot, message: MessageDecorator, match: PatternMatch) throws {
let user: ModelPointer<User> = try match.value(key: Keys.user)
let count = try storage.get(key: user.id, from: Keys.namespace, or: 0)
let response = try message... | mit | f22d4b36414b1fb1b57ebb6488f9468a | 31.741935 | 92 | 0.569458 | 4.027778 | false | false | false | false |
TurfDb/Turf | Turf/Observable/MiniRx/SubscribeOn.swift | 1 | 1453 | import Foundation
class SubscribeOnSink<Value, Observer: ObserverType>: Sink<Observer>, ObserverType where Observer.Value == Value {
typealias Parent = SubscribeOn<Value>
let parent: Parent
init(parent: Parent, observer: Observer) {
self.parent = parent
super.init(observer: observer)
... | mit | f70d3b8a4569e316d1cbed2fe4f7a1cb | 26.942308 | 114 | 0.644184 | 4.512422 | false | false | false | false |
romansorochak/ParallaxHeader | Exmple/FromCodeCollectionCell.swift | 1 | 1477 | //
// FromCodeCollectionCell.swift
// Exmple
//
// Created by Roman Sorochak on 31.01.2020.
// Copyright © 2020 MagicLab. All rights reserved.
//
import SnapKit
import Reusable
class FromCodeCollectionCell: UICollectionViewCell, Reusable {
private (set) lazy var imageView: UIImageView = {
let v ... | mit | bd5e8ce7d9b0750077589a2e0d8e3c22 | 24.448276 | 65 | 0.583333 | 4.626959 | false | false | false | false |
Snowgan/XLRefreshSwift | Pod/Classes/XLRefreshConst.swift | 1 | 604 | //
// XLRefreshConst.swift
// Pods
//
// Created by Jennifer on 14/4/2016.
//
//
enum XLRefreshStatus: Int {
case Normal
case WillRefresh
case Refreshing
case EndRefresh
}
let XLStateMap = ["\(XLRefreshStatus.Normal)": "Pull down",
"\(XLRefreshStatus.WillRefresh)": "Release",
... | mit | 4658e1e46fa272f02011ff79a1f317a4 | 23.16 | 63 | 0.655629 | 4.165517 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.