repo_name stringlengths 6 91 | path stringlengths 6 999 | copies stringclasses 283
values | size stringlengths 1 7 | content stringlengths 3 1.05M | license stringclasses 15
values |
|---|---|---|---|---|---|
OatmealCode/Oatmeal | Example/Pods/Carlos/Carlos/ExpensiveObject.swift | 2 | 1175 | import Foundation
/// Abstracts objects that have a cost (useful for the MemoryCacheLevel)
public protocol ExpensiveObject {
/// The cost of the object
var cost: Int { get }
}
extension NSData: ExpensiveObject {
/// The number of bytes of the data block
public var cost: Int {
return self.length
}
}
ext... | mit |
MA806P/SwiftDemo | SwiftTips/SwiftTips/OCToSwift/main.swift | 1 | 54586 | //
// main.swift
// OCToSwift
//
// Created by MA806P on 2018/12/1.
// Copyright © 2018 myz. All rights reserved.
//
import Foundation
print("Hello, World!")
// -----------------------------
// Toll-Free Bridging 和 Unmanaged
/*
在 Swift 中对于 Core Foundation 在内存管理进行了一系列简化,大大降低了与这些 CF api 打交道的复杂程度。
对于 Cocoa 中 ... | apache-2.0 |
NoryCao/zhuishushenqi | zhuishushenqi/Root/ViewModel/ZSMyViewModel.swift | 1 | 5116 | //
// ZSMyViewModel.swift
// zhuishushenqi
//
// Created by yung on 2018/10/20.
// Copyright © 2018年 QS. All rights reserved.
//
import UIKit
import AdSupport
import ZSAPI
import RxSwift
class ZSMyViewModel: NSObject, ZSRefreshProtocol {
var refreshStatus: Variable<ZSRefreshStatus> = Variable(.none)
... | mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/18984-getselftypeforcontainer.swift | 11 | 274 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
struct A {
struct A {
class a {
class A {
typealias f = F
deinit {
protocol B : f.c {
typealias f
func f
| mit |
kiliankoe/catchmybus | catchmybus/NotificationController.swift | 1 | 1724 | //
// NotificationController.swift
// catchmybus
//
// Created by Kilian Költzsch on 11/05/15.
// Copyright (c) 2015 Kilian Koeltzsch. All rights reserved.
//
import Foundation
private let _NotificationControllerSharedInstance = NotificationController()
class NotificationController {
// NotificationController ... | mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/03537-swift-sourcemanager-getmessage.swift | 11 | 283 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
(([Void{
case c,
([Void{
if true {
func b
{
struct B<j : c,
{
enum B : a<f : e)
{
let t: a {
class
case c,
(_ = [
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/23777-llvm-foldingset-swift-classtype-nodeequals.swift | 10 | 225 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
import Foundation
class b{var _=[B}
class B<T where H:a
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/06004-swift-nominaltypedecl-getdeclaredtypeincontext.swift | 11 | 291 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
class B<T: C {
func f: d where H.e where g: d: String = T]()
class d<h : d where H.e where f: d: d where T>: a {
func a
l
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/19878-getselftypeforcontainer.swift | 11 | 233 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
func < {
func c<T> (a )
protocol a {
typealias B : B
var a: Any
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/03953-swift-sourcemanager-getmessage.swift | 11 | 296 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
struct d<T {
class c : j { func a
var e: NSObject {
if true {
func a(Any) {
var e(v: A? {
protocol A : S<b: A? {
class
case c,
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/12480-no-stacktrace.swift | 11 | 283 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
{
{
{
{
}
{
}
protocol a {
enum A {
{
}
{
{
}
}
{
}
var b {
{
{
}
{
deinit {
{
}
{
{
{
return m( [ {
class
case ,
| mit |
sebastianvarela/iOS-Swift-Helpers | Helpers/Helpers/OptionalExtensions.swift | 2 | 111 | import Foundation
public extension Optional {
public var isNil: Bool {
return self == nil
}
}
| mit |
clayellis/StringScanner | Sources/StringScanner/CharacterSet.swift | 1 | 2417 | //
// CharactersSet.swift
// StringScanner
//
// Created by Omar Abdelhafith on 26/10/2016.
//
//
/// Range Set
public enum CharactersSet: Containable {
/// All english letters set
case allLetters
/// Small english letters set
case smallLetters
/// Capital english letters set
case capitalLetter... | mit |
carabina/SwiftStore | Example/SwiftStoreExample/SwiftStoreExample/DB.swift | 2 | 354 | //
// DB.swift
// SwiftStoreExample
//
// Created by Hemanta Sapkota on 12/05/2015.
// Copyright (c) 2015 Hemanta Sapkota. All rights reserved.
//
import Foundation
import SwiftStore
class DB : SwiftStore {
class var store:DB {
struct Singleton {
static let instance = DB(storeName: "db")
}
... | mit |
bcattle/AudioLogger-iOS | AudioLogger-iOS/FileListViewController.swift | 1 | 7865 | //
// FileListViewController.swift
// AudioLogger-iOS
//
// Created by Bryan on 1/8/17.
// Copyright © 2017 bcattle. All rights reserved.
//
import UIKit
import AVFoundation
//import EZAudioiOS
class FileListViewController: UIViewController {
@IBOutlet weak var tableView:UITableView!
@IBOutlet weak var de... | mit |
paulz/PerspectiveTransform | Example/PerspectiveTransform/AppDelegate.swift | 1 | 275 | //
// AppDelegate.swift
// PerspectiveTransform
//
// Created by Paul Zabelin on 02/18/2016.
// Copyright (c) 2016 Paul Zabelin. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
}
| mit |
rsmoz/swift-corelibs-foundation | TestFoundation/TestNSBundle.swift | 1 | 5495 | // 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 |
modnovolyk/MAVLinkSwift | Sources/MAVDataStreamCommonEnum.swift | 1 | 2483 | //
// MAVDataStreamCommonEnum.swift
// MAVLink Protocol Swift Library
//
// Generated from ardupilotmega.xml, common.xml, uAvionix.xml on Tue Jan 17 2017 by mavgen_swift.py
// https://github.com/modnovolyk/MAVLinkSwift
//
/// THIS INTERFACE IS DEPRECATED AS OF JULY 2015. Please use MESSAGE_INTERVAL instead. A dat... | mit |
ben-ng/swift | validation-test/compiler_crashers_fixed/25803-swift-constructordecl-setbodyparams.swift | 1 | 458 | // This source file is part of the Swift.org open source project
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the li... | apache-2.0 |
ben-ng/swift | validation-test/compiler_crashers_fixed/27073-swift-constraints-constraint-create.swift | 1 | 439 | // This source file is part of the Swift.org open source project
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the li... | apache-2.0 |
cnoon/swift-compiler-crashes | crashes-duplicates/15901-swift-typechecker-checksubstitutions.swift | 11 | 223 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
if true {
class A : a
protocol a {
struct S<b: S<Int>
| mit |
cnoon/swift-compiler-crashes | crashes-duplicates/04006-swift-sourcemanager-getmessage.swift | 11 | 232 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
enum A {
protocol A {
deinit {
typealias e : A {
class
case c,
| mit |
githubxiangdong/DouYuZB | DouYuZB/DouYuZB/Classes/Home/View/AdsCollectionViewCell.swift | 1 | 786 | //
// AdsCollectionViewCell.swift
// DouYuZB
//
// Created by new on 2017/5/8.
// Copyright © 2017年 9-kylins. All rights reserved.
//
import UIKit
class AdsCollectionViewCell: UICollectionViewCell {
//MARK:- 控件属性
@IBOutlet var iconImageView: UIImageView!
@IBOutlet var titleLabel: UILabel!
... | mit |
googlearchive/cannonball-ios | Cannonball/ThemeCell.swift | 1 | 1659 | //
// Copyright (C) 2018 Google, Inc. and other contributors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless require... | apache-2.0 |
glock45/swifter | Sources/Swifter/App.swift | 1 | 1555 | //
// App.swift
// Swifter
//
// Copyright (c) 2014-2016 Damian Kołakowski. All rights reserved.
//
import Foundation
public class App {
private let server = HttpServer()
public init() { }
@available(OSX 10.10, *)
public func run(_ port: in_port_t = 9080, _ databasePath: String) throws -... | bsd-3-clause |
poolmyride/DataStoreKit | Pod/Classes/FileDeserializer.swift | 1 | 1708 | //
// FileDeserializer.swift
//
//
// Created by Rohit Talwar on 11/06/15.
// Copyright (c) 2015 Rajat Talwar. All rights reserved.
//
import Foundation
open class FileDeserializer<T> where T:AnyObject,T:ObjectCoder {
fileprivate func isPList(_ fileName:String) -> Bool{
return fileName.h... | mit |
mansoor92/MaksabComponents | Example/Pods/StylingBoilerPlate/StylingBoilerPlate/Classes/Helper/MaksabTheme.swift | 1 | 923 | //
// MaksabTheme.swift
// ActionCableClient
//
// Created by Mansoor Ali on 30/03/2018.
//
import UIKit
public enum MaksabThemeType{
case lightContent
case darkContent
}
public struct MaksabTheme {
static public func set(navigationBar: UINavigationBar, theme: MaksabThemeType){
switch theme {
case .light... | mit |
wibosco/CoalescingOperations-Example | CoalescingOperations-Example/Coalescing/CoalescingExampleManager.swift | 1 | 1605 | //
// CoalescingExampleManager.swift
// CoalescingOperations-Example
//
// Created by Boles on 28/02/2016.
// Copyright © 2016 Boles. All rights reserved.
//
import UIKit
/**
An example manager that handles queuing operations.
It exists as we don't really want our VCs to know anything about coalescing or the ... | mit |
damonthecricket/my-json | MYJSON/JSON+Extensions.swift | 1 | 3976 | //
// ModelTypes.swift
// InstaCollage
//
// Created by Optimus Prime on 11.02.17.
// Copyright © 2017 Tren Lab. All rights reserved.
//
import Foundation
// MARK: - JSON Extensions
public extension Dictionary where Key: ExpressibleByStringLiteral, Value: Any {
// MARK: - Is
/**
Returns `t... | mit |
kzaher/RxSwift | RxCocoa/Traits/SharedSequence/SharedSequence+Operators.swift | 1 | 25518 | //
// SharedSequence+Operators.swift
// RxCocoa
//
// Created by Krunoslav Zaher on 9/19/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import RxSwift
// MARK: map
extension SharedSequenceConvertibleType {
/**
Projects each element of an observable sequence into a new form.
... | mit |
chaoyang805/DoubanMovie | DoubanMovie/HomeViewController.swift | 1 | 10185 | /*
* Copyright 2016 chaoyang805 zhangchaoyang805@gmail.com
*
* 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 appli... | apache-2.0 |
CoderGuoJiGang/DouYuZB | DYZB/DYZB/Classes/Main/ViewController/MainViewController.swift | 1 | 1218 | //
// MainViewController.swift
// DYZB
//
// Created by 郭吉刚 on 16/9/21.
// Copyright © 2016年 郭吉刚. All rights reserved.
//
import UIKit
class MainViewController: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
addChildVc("Home")
addChildVc("Live")
addChi... | mit |
LeoMobileDeveloper/MDTable | MDTableExample/DynamicHeightRow.swift | 1 | 1245 | //
// DynamicHeightRow.swift
// MDTableExample
//
// Created by Leo on 2017/6/16.
// Copyright © 2017年 Leo Huang. All rights reserved.
//
import Foundation
import MDTable
class DynamicHeightRow: RowConvertable{
//Protocol
var rowHeight: CGFloat{
get{
let attributes = [NSFontAttributeNa... | mit |
svedm/SweetyViperDemo | SweetyViperDemo/SweetyViperDemo/Classes/PresentationLayer/Common/ModuleTransitionHandler.swift | 1 | 334 | //
// ModuleTransitionHandler.swift
// SweetyViperDemo
//
// Created by Svetoslav on 13.02.17.
// Copyright © 2017 Svedm. All rights reserved.
//
import Foundation
protocol ModuleTransitionHandler: class {
func openModule(segueIdentifier: String, configurationClosure: ModuleConfigurationClosure?)
func clo... | mit |
robrix/Hammer.swift | Hammer/Generator.swift | 1 | 347 | // Copyright (c) 2014 Rob Rix. All rights reserved.
/// Concatenation of Generators.
func ++ <A : Generator, B : Generator, Element where Element == A.Element, Element == B.Element>(var a: A, var b: B) -> GeneratorOf<Element> {
return GeneratorOf {
switch a.next() {
case .None:
return b.next()
case let .Som... | mit |
ndleon09/SwiftSample500px | pictures/Modules/Detail/DetailInteractor.swift | 1 | 1375 | //
// DetailInteractor.swift
// pictures
//
// Created by Nelson on 05/11/15.
// Copyright © 2015 Nelson Dominguez. All rights reserved.
//
import Foundation
class DetailInteractor: DetailInteractorInputProtocol {
var output : DetailInteractorOutputProtocol?
var dataManager : DetailDataManagerProtocol?
... | mit |
botherbox/JSONtoModel | JSONtoModel/EasyNetwork/EasyNetwork.swift | 2 | 3594 | //
// EasyNetwork.swift
// EasyNetwork
//
// Created by BotherBox on 15/3/3.
// Copyright (c) 2015年 sz. All rights reserved.
//
import Foundation
public enum HTTPMethod: String {
case GET = "GET"
case POST = "POST"
}
public class EasyNetwork {
public typealias Completion = (data: AnyObject?, err... | mit |
vermont42/Conjugar | Conjugar/TestGameCenter.swift | 1 | 699 | //
// TestGameCenter.swift
// Conjugar
//
// Created by Joshua Adams on 11/27/18.
// Copyright © 2018 Josh Adams. All rights reserved.
//
import UIKit
class TestGameCenter: GameCenterable {
var isAuthenticated: Bool
init(isAuthenticated: Bool = false) {
self.isAuthenticated = isAuthenticated
}
func ... | agpl-3.0 |
jonnyleeharris/ento | Ento/ento/core/Entity.swift | 1 | 3164 | //
// Created by Jonathan Harris on 29/06/2015.
// Copyright © 2015 Jonathan Harris. All rights reserved.
//
import Foundation
struct EntityComponentAddedOrRemoved {
var componentClass:Any.Type;
var entity:Entity;
}
struct EntityNameChanged {
var name:String;
var entity:Entity;
}
public class Entity : Hashabl... | mit |
lojals/QRGen | Pods/QRCodeReader.swift/QRCodeReader/QRCodeReaderResult.swift | 2 | 1508 | /*
* QRCodeReader.swift
*
* Copyright 2014-present Yannick Loriot.
* http://yannickloriot.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without ... | mit |
rplankenhorn/BowieUtilityKnife | Pods/BrightFutures/BrightFutures/NSOperationQueue+BrightFutures.swift | 3 | 383 | //
// NSOperationQueue+BrightFutures.swift
// BrightFutures
//
// Created by Thomas Visser on 18/09/15.
// Copyright © 2015 Thomas Visser. All rights reserved.
//
import Foundation
public extension NSOperationQueue {
public var context: ExecutionContext {
return { [weak self] task in
self?... | mit |
christiankm/FinanceKit | Tests/FinanceKitTests/CurrencyPairTests.swift | 1 | 997 | //
// FinanceKit
// Copyright © 2022 Christian Mitteldorf. All rights reserved.
// MIT license, see LICENSE file for details.
//
import FinanceKit
import XCTest
class CurrencyPairTests: XCTestCase {
func testInit() {
let pair = CurrencyPair(
baseCurrency: .usDollars,
secondaryC... | mit |
larrynatalicio/15DaysofAnimationsinSwift | Animation 10 - SecretTextAnimation/SecretTextAnimation/CharacterLabel.swift | 1 | 6461 | //
// CharacterLabel.swift
// SecretTextAnimation
//
// Created by Larry Natalicio on 4/27/16.
// Copyright © 2016 Larry Natalicio. All rights reserved.
//
import UIKit
import QuartzCore
import CoreText
class CharacterLabel: UILabel, NSLayoutManagerDelegate {
// MARK: - Properties
let textStorag... | mit |
AxziplinNet/AxziplinNet | Package.swift | 1 | 1334 | //
// Package.swift
// AxziplinNet
//
// Created by devedbox on 2017/4/19.
// Copyright © 2017年 devedbox. 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 wit... | mit |
onmyway133/Github.swift | Carthage/Checkouts/Sugar/Tests/Shared/TestTruncate.swift | 1 | 475 | import Foundation
import XCTest
@testable import Sugar
class StringTruncateTests: XCTestCase {
let testString = "John Hyperseed"
func testTruncate() {
XCTAssertEqual(testString.truncate(4), "John...")
XCTAssertNotEqual(testString.truncate(5), "John...")
}
func testTruncateSuffix() {
XCTAssertEqu... | mit |
ArnavChawla/InteliChat | Carthage/Checkouts/swift-sdk/Source/SpeechToTextV1/Models/SpeechRecognitionAlternative.swift | 1 | 1967 | /**
* Copyright IBM Corporation 2018
*
* 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... | mit |
karstengresch/rw_studies | CoreData/HitList/HitList/ViewController.swift | 1 | 2802 | //
// ViewController.swift
// HitList
//
// Created by Karsten Gresch on 31.05.17.
// Copyright © 2017 Closure One. All rights reserved.
//
import UIKit
import CoreData
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
title = "The List"
tableView.register(U... | unlicense |
andrebocchini/SwiftChattyOSX | Pods/SwiftChatty/SwiftChatty/Common Models/Errors.swift | 1 | 1342 | //
// Errors.swift
// SwiftChatty
//
// Created by Andre Bocchini on 1/26/16.
// Copyright © 2016 Andre Bocchini. All rights reserved.
//
/// Represents the different types of error returned by this Framework
public enum Error: ErrorType {
/// This is an error existing on ther server side. It will most likel... | mit |
Ellusioists/TimingRemind | TimingRemind/Utils/SQliteRepository.swift | 1 | 4671 | //
// SQliteRepository.swift
// PasswordKeeper-swift
//
// Created by Channing on 2017/1/3.
// Copyright © 2017年 Channing Kuo. All rights reserved.
//
import Foundation
// SQlite数据库操作类
class SQliteRepository {
public static let PASSWORDINFOTABLE: String = "dataInfoTable"
private static var db: S... | mit |
LYM-mg/DemoTest | indexView/Extesion/Category(扩展)/NSObject+Extension.swift | 1 | 7382 | //
// NSObject+Extension.swift
// chart2
//
// Created by i-Techsys.com on 16/12/3.
// Copyright © 2016年 i-Techsys. All rights reserved.
//
import UIKit
// MARK: - 弹框
extension NSObject {
/// 只有是控制器和继承UIView的控件才会弹框
/**
* - 弹框提示
* - @param info 要提醒的内容
*/
func showInfo(info: String) {
... | mit |
airbnb/lottie-ios | Tests/SnapshotTests.swift | 2 | 10745 | // Created by Cal Stephens on 12/8/21.
// Copyright © 2021 Airbnb Inc. All rights reserved.
import SnapshotTesting
import XCTest
#if canImport(UIKit)
import UIKit
#endif
@testable import Lottie
// MARK: - SnapshotTests
@MainActor
class SnapshotTests: XCTestCase {
// MARK: Internal
/// Snapshots all of the sa... | apache-2.0 |
ziligy/SnapLocation | SnapLocation/BlurredBackgroundView.swift | 1 | 1339 | //
// BlurredBackgroundView.swift
//
// Created by Jeff on 12/4/15.
// Copyright © 2015 Jeff Greenberg. All rights reserved.
//
import UIKit
/// UIView that's a blurred image for background display
public class BlurredBackgroundView: UIView {
private var imageView: UIImageView!
private var effectView: UIV... | mit |
jiecao-fm/SwiftTheme | PlistDemo/SwitchNightCell.swift | 1 | 950 | //
// SwitchNightCell.swift
// PlistDemo
//
// Created by Gesen on 16/3/2.
// Copyright © 2016年 Gesen. All rights reserved.
//
import UIKit
import SwiftTheme
class SwitchNightCell: BaseCell {
@IBOutlet weak var title: UILabel!
@IBOutlet weak var nightIcon: UIImageView!
@IBOutlet weak var nightSwi... | mit |
techmehra/AJCountryPicker | AJCountryPicker/Source/NibOwnerLoadable.swift | 1 | 1592 |
import UIKit
// MARK: Protocol Definition
/// Make your UIView subclasses conform to this protocol when:
/// * they *are* NIB-based, and
/// * this class is used as the XIB's File's Owner
///
/// to be able to instantiate them from the NIB in a type-safe manner
public protocol NibOwnerLoadable: class {
/// The n... | mit |
overtake/TelegramSwift | packages/TGUIKit/Sources/GridNode.swift | 1 | 61950 | import Cocoa
import AVFoundation
public struct GridNodeInsertItem {
public let index: Int
public let item: GridItem
public let previousIndex: Int?
public init(index: Int, item: GridItem, previousIndex: Int?) {
self.index = index
self.item = item
self.previousIndex = previou... | gpl-2.0 |
ton252/EasyDAO | Example/EasyDAO/AppDelegate.swift | 1 | 2178 | //
// AppDelegate.swift
// EasyDAO
//
// Created by ton252 on 02/14/2017.
// Copyright (c) 2017 ton252. All rights reserved.
//
import UIKit
import EasyDAO
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, did... | mit |
practicalswift/swift | validation-test/compiler_crashers_fixed/27923-swift-modulefile-gettype.swift | 65 | 447 | // 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 |
debugsquad/metalic | metalic/Metal/Basic/MetalFilterBasicTest.swift | 1 | 306 | import MetalPerformanceShaders
class MetalFilterBasicTest:MetalFilter
{
required init(device:MTLDevice)
{
super.init(device:device, functionName:nil)
}
override func encode(commandBuffer:MTLCommandBuffer, sourceTexture:MTLTexture, destinationTexture:MTLTexture)
{
}
}
| mit |
huangboju/Moots | 算法学习/LeetCode/LeetCode/Rotate.swift | 1 | 334 | //
// Rotate.swift
// LeetCode
//
// Created by 黄伯驹 on 2019/4/27.
// Copyright © 2019 伯驹 黄. All rights reserved.
//
import Foundation
func rotate(_ nums: inout [Int], _ k: Int) {
for _ in 0 ..< k {
guard let n = nums.popLast() else {
continue
}
nums.insert(n, at: 0)
}
}... | mit |
jxxcarlson/exploring_swift | IOSGraphicsApp/IOSGraphicsApp/ViewController.swift | 1 | 1560 | //
// ViewController.swift
// IOSGraphicsApp
//
// Created by James Carlson on 6/21/15.
// Copyright © 2015 James Carlson. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
let graphicsView = GraphicsView()
let backgroundLabel = UILabel()
let statusLabel = UILabel()
... | mit |
PrateekVarshney/AppTour | AppTourDemo/ViewController.swift | 1 | 2208 | //
// ViewController.swift
// AppTourDemo
//
// Created by Prateek Varshney on 20/04/17.
// Copyright © 2017 PrateekVarshney. All rights reserved.
//
import UIKit
import AppTour
class ViewController: UIViewController, AppTourDelegate {
@IBOutlet var titleLabel : UILabel!
@IBOutlet var nextButton : UI... | mit |
mightydeveloper/swift | validation-test/compiler_crashers_fixed/1917-getselftypeforcontainer.swift | 13 | 320 | // RUN: not %target-swift-frontend %s -parse
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
var b: a {
struct D : P> String {
}
class A = e? {
}
protocol P {
return {
}
protocol B : a {
func a"[T:
| apache-2.0 |
karstengresch/rw_studies | PaintCode/PaintCode/PaintCode/Stopwatch.swift | 1 | 226 | //
// Stopwatch.swift
// PaintCode
//
// Created by Karsten Gresch on 02.10.15.
//
import UIKit
@IBDesignable
class Stopwatch: UIView {
override func drawRect(rect: CGRect) {
PaintCodeTutorial.drawStopwatch()
}
}
| unlicense |
optimizely/objective-c-sdk | Pods/Mixpanel-swift/Mixpanel/WebSocket.swift | 2 | 34263 | //////////////////////////////////////////////////////////////////////////////////////////////////
//
// Websocket.swift
//
// Created by Dalton Cherry on 7/16/14.
// Copyright (c) 2014-2015 Dalton Cherry.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in ... | apache-2.0 |
linhaosunny/yeehaiyake | 椰海雅客微博/椰海雅客微博/Classes/Tools/UIButton+Extension.swift | 1 | 618 | //
// UIButton+Extension.swift
// 椰海雅客微博
//
// Created by 李莎鑫 on 2017/4/2.
// Copyright © 2017年 李莎鑫. All rights reserved.
//
import UIKit
extension UIButton {
convenience init(imageName:String,backgroundName:String) {
self.init()
setImage(UIImage(named: imageName), for: .normal)
... | mit |
austinzheng/swift | validation-test/compiler_crashers_fixed/00453-resolvetypedecl.swift | 65 | 504 | // 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 |
sharath-cliqz/browser-ios | AccountTests/TokenServerClientTests.swift | 2 | 4982 | /* 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/. */
@testable import Account
import Foundation
import FxA
import UIKit
import XCTest
// Testing client state is so d... | mpl-2.0 |
avito-tech/Marshroute | Example/NavigationDemo/VIPER/SearchResults/Assembly/SearchResultsAssemblyImpl.swift | 1 | 1697 | import UIKit
import Marshroute
final class SearchResultsAssemblyImpl: BaseAssembly, SearchResultsAssembly {
// MARK: - SearchResultsAssembly
func module(categoryId: CategoryId, routerSeed: RouterSeed)
-> UIViewController
{
let router = SearchResultsRouterIphone(
assemblyFactory:... | mit |
NikKovIos/NKVPhonePicker | Sources/Models/Country.swift | 1 | 7459 | //
// Be happy and free :)
//
// Nik Kov
// nik-kov.com
//
#if os(iOS)
import Foundation
import UIKit
open class Country: NSObject {
// MARK: - Properties
/// Ex: "RU"
@objc public var countryCode: String
/// Ex: "7"
@objc public var phoneExtension: String
/// Ex: "Russia"
@objc ... | mit |
svanimpe/around-the-table | Tests/AroundTheTableTests/Models/GameTests.swift | 1 | 15108 | import BSON
import Foundation
import XCTest
@testable import AroundTheTable
class GameTests: XCTestCase {
static var allTests: [(String, (GameTests) -> () throws -> Void)] {
return [
("testParseXML", testParseXML),
("testParseXMLNoID", testParseXMLNoID),
("testParse... | bsd-2-clause |
amarcu5/PiPer | src/safari/App/LocalizedTextField.swift | 1 | 661 | //
// LocalizedTextField.swift
// PiPer
//
// Created by Adam Marcus on 13/10/2018.
// Copyright © 2018 Adam Marcus. All rights reserved.
//
import Cocoa
@IBDesignable
class LocalizedTextField: NSTextField {
override init(frame frameRect: NSRect) {
super.init(frame: frameRect)
localizeValue()
}
... | gpl-3.0 |
adamnemecek/AudioKit | Playgrounds/Hello World.playground/Contents.swift | 1 | 391 | //: Run this playground to test that AudioKit is working
import AudioKit
import AudioKitEX
import Foundation
var greeting = "Hello, playground"
let osc = PlaygroundOscillator()
let engine = AudioEngine()
engine.output = osc
try! engine.start()
osc.play()
while true {
osc.frequency = Float.random(in: 200...800)... | mit |
doushiDev/ds_ios | TouTiao/Video.swift | 1 | 349 | //
// Video.swift
// TouTiao
//
// Created by Songlijun on 2017/2/25.
// Copyright © 2017年 Songlijun. All rights reserved.
//
import Foundation
import HandyJSON
struct Video: HandyJSON {
var vid:String?
var title:String?
var pic:String?
var shareUrl:String = ""
var videoUrl:String =... | mit |
yarshure/Surf | Surf/RuleResultsViewController.swift | 1 | 10821 | //
// RuleResultsViewController.swift
// Surf
//
// Created by yarshure on 16/2/14.
// Copyright © 2016年 yarshure. All rights reserved.
//
import UIKit
import NetworkExtension
import SwiftyJSON
import SFSocket
class RuleResultsViewController: SFTableViewController {
var results:[SFRuleResult] = []
overrid... | bsd-3-clause |
XiongJoJo/OFO | App/OFO/OFO/MyPinAnnotation.swift | 1 | 197 | //
// MyPintAnnotion.swift
// OFO
//
// Created by iMac on 2017/6/5.
// Copyright © 2017年 JoJo. All rights reserved.
//
import Foundation
class MyPinAnnotation: MAPointAnnotation {
}
| apache-2.0 |
itsaboutcode/WordPress-iOS | WordPress/WordPressTest/I18n.swift | 1 | 165 | import Foundation
// Helper function that returns a localized string
func i18n(_ content: String) -> String {
return NSLocalizedString(content, comment: "_")
}
| gpl-2.0 |
palle-k/SocketKit | Sources/Socket.swift | 2 | 11913 | //
// Socket.swift
// SocketKit
//
// Created by Palle Klewitz on 10.04.16.
// Copyright © 2016 Palle Klewitz.
//
// 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... | mit |
qiuncheng/study-for-swift | learn-rx-swift/Chocotastic-starter/Pods/RxSwift/RxSwift/Observables/Implementations/Debunce.swift | 5 | 2629 | //
// Debunce.swift
// Rx
//
// Created by Krunoslav Zaher on 9/11/16.
// Copyright © 2016 Krunoslav Zaher. All rights reserved.
//
import Foundation
class DebounceSink<O: ObserverType>
: Sink<O>
, ObserverType
, LockOwnerType
, SynchronizedOnType {
typealias Element = O.E
typealias Parent... | mit |
mlibai/XZKit | Projects/XZKit/XZKitTests/XZURLTests.swift | 1 | 6150 | //
// XZURLTests.swift
// XZKitTests
//
// Created by 徐臻 on 2020/5/16.
// Copyright © 2020 Xezun Inc. All rights reserved.
//
import XCTest
import XZKit
class XZURLTests: XCTestCase {
override func setUpWithError() throws {
print("XZKit Debug Mode: \(XZKit.isDebugMode)")
}
override func tear... | mit |
cocoascientist/Jetstream | JetstreamCore/Model/Conditions.swift | 1 | 3509 | //
// Conditions+JSON.swift
// Jetstream
//
// Created by Andrew Shepard on 11/20/16.
// Copyright © 2016 Andrew Shepard. All rights reserved.
//
import Foundation
import CoreData
public class Conditions: NSManagedObject, Decodable {
@NSManaged public var icon: String
@NSManaged public var details: String... | mit |
nitrado/NitrAPI-Swift | Pod/Classes/services/gameservers/minecraft/McMyAdmin.swift | 1 | 651 | import ObjectMapper
open class McMyAdmin: Mappable {
// MARK: - Attributes
open fileprivate(set) var enabled: Bool?
open fileprivate(set) var url: String?
open fileprivate(set) var username: String?
open fileprivate(set) var password: String?
open fileprivate(set) var language: String?
... | mit |
bogosmer/UnitKit | UnitKit/Source/Units/VolumeUnit.swift | 1 | 10074 | //
// VolumeType.swift
// UnitKit
//
// Created by Bo Gosmer on 09/02/2016.
// Copyright © 2016 Deadlock Baby. All rights reserved.
//
import Foundation
public struct VolumeUnit: _Unit {
// MARK: - Public properties
public static var sharedDecimalNumberHandler: NSDecimalNumberHandler?
public... | mit |
jgrantr/GRNetworkKit | Example/Pods/PromiseKit/Sources/Catchable.swift | 1 | 7986 | import Dispatch
/// Provides `catch` and `recover` to your object that conforms to `Thenable`
public protocol CatchMixin: Thenable
{}
public extension CatchMixin {
/**
The provided closure executes when this promise rejects.
Rejecting a promise cascades: rejecting all subsequent promises (unl... | mit |
byu-oit/ios-byuSuite | byuSuite/Apps/YTime/controller/YTimeRootViewController.swift | 1 | 8754 | //
// YTimeRootViewController.swift
// byuSuite
//
// Created by Eric Romrell on 5/18/17.
// Copyright © 2017 Brigham Young University. All rights reserved.
//
import CoreLocation
private let TIMESHEETS_SEGUE_ID = "showTimesheets"
private let CALENDAR_SEGUE_ID = "showCalendar"
class YTimeRootViewController: ByuV... | apache-2.0 |
indragiek/MarkdownTextView | MarkdownTextView/MarkdownLinkHighlighter.swift | 2 | 1027 | //
// MarkdownLinkHighlighter.swift
// MarkdownTextView
//
// Created by Indragie on 4/29/15.
// Copyright (c) 2015 Indragie Karunaratne. All rights reserved.
//
import UIKit
/**
* Highlights Markdown links (not including link references)
*/
public final class MarkdownLinkHighlighter: HighlighterType {
// Fr... | mit |
Hout/Period | Pod/Classes/PeriodOperators.swift | 1 | 2350 | //
// PeriodOperators.swift
// Pods
//
// Created by Jeroen Houtzager on 09/11/15.
//
//
extension NSDate {
/// Returns `true` when the receiver date is within the period.
///
/// - Parameters:
/// - period: the period to evaluate the date against
///
/// - Returns: `true` if the date i... | mit |
TheAppCookbook/templates | templates/ACBInfoPanel/NSURL+ACBUrls.swift | 1 | 658 | //
// NSURL+ACBUrls.swift
// ACBInfoPanel
//
// Created by PATRICK PERINI on 8/9/15.
// Copyright (c) 2015 AppCookbook. All rights reserved.
//
import Foundation
public extension NSURL {
// MARK: Constants
public static var cookbookInfoURL: NSURL! { return NSURL(string: "http://the.appcookbook.in") }
... | mit |
dhardiman/Fetch | Tests/FetchTests/FetchTests.swift | 1 | 13635 | //
// FetchTests.swift
// FetchTests
//
// Created by David Hardiman on 13/02/2016.
// Copyright © 2016 David Hardiman. All rights reserved.
//
@testable import Fetch
import Nimble
import OHHTTPStubs
import XCTest
let testString = "{ \"name\": \"test name\", \"desc\": \"test desc\" }"
let testURL = URL(string: "h... | mit |
MidnightPulse/Tabman | Sources/Tabman/TabmanBar/Utilities/ImageUtils.swift | 4 | 785 | //
// ImageUtils.swift
// Tabman
//
// Created by Merrick Sapsford on 14/03/2017.
// Copyright © 2017 Merrick Sapsford. All rights reserved.
//
import UIKit
extension UIImage {
func resize(toSize size: CGSize) -> UIImage {
let scale = size.width / self.size.width
let newHeight = self.siz... | mit |
coinbase/coinbase-ios-sdk | Tests/Integration/UserResourceSpec.swift | 1 | 2816 | //
// UserSpec.swift
// Coinbase
//
// Copyright © 2018 Coinbase, Inc. All rights reserved.
//
@testable import CoinbaseSDK
import Quick
import Nimble
import OHHTTPStubs
class UserResourceSpec: QuickSpec, IntegrationSpecProtocol {
override func spec() {
describe("UserResource") {
... | apache-2.0 |
emalyak/CMAltimeterDemo | CMAltimeterDemoTests/CMAltimeterDemoTests.swift | 1 | 919 | //
// CMAltimeterDemoTests.swift
// CMAltimeterDemoTests
//
// Created by Erik Malyak on 9/21/14.
// Copyright (c) 2014 Erik Malyak. All rights reserved.
//
import UIKit
import XCTest
class CMAltimeterDemoTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. Th... | mit |
uasys/swift | test/IRGen/protocol_metadata.swift | 4 | 6760 | // RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -primary-file %s -emit-ir -disable-objc-attr-requires-foundation-module | %FileCheck %s
// REQUIRES: CPU=x86_64
// REQUIRES: objc_interop
protocol A { func a() }
protocol B { func b() }
protocol C : class { func c() }
@objc protocol O { func o()... | apache-2.0 |
mutualmobile/VIPER-SWIFT | VIPER-SWIFT/Classes/Modules/List/User Interface/Presenter/ListPresenter.swift | 1 | 1587 | //
// ListPresenter.swift
// VIPER-SWIFT
//
// Created by Conrad Stoll on 6/5/14.
// Copyright (c) 2014 Mutual Mobile. All rights reserved.
//
import Foundation
import UIKit
class ListPresenter : NSObject, ListInteractorOutput, ListModuleInterface, AddModuleDelegate {
var listInteractor : ListInteractorInput?... | mit |
nghiaphunguyen/NReact | NReact/Source/Protocols/NKActionable.swift | 1 | 251 | //
// NKActionable.swift
// NKit
//
// Created by Nghia Nguyen on 12/18/16.
// Copyright © 2016 Nghia Nguyen. All rights reserved.
//
import Foundation
public protocol NKActionable {
associatedtype NKAction
var action: NKAction {get}
}
| mit |
Aaron-zheng/SwiftTips | swifttips/swifttips/ControllerStatusBar.swift | 1 | 446 | //
// ControllerStatusBar.swift
// swifttips
//
// Created by Aaron on 5/8/2016.
// Copyright © 2016 sightcorner. All rights reserved.
//
import Foundation
import UIKit
/**
更改 status bar (运营商,时间,电池) 为白色
需要先修改 info.plist 里的 View controller-based status bar appearance 为 NO
*/
public func changeStatusBarToLight()... | apache-2.0 |
swift-lang/swift-k | tests/functions/system_commandnotfound.swift | 1 | 128 | // THIS-SCRIPT-SHOULD-FAIL
type file;
string results[] = system("fdjskflsdk");
foreach r in results {
tracef("%s\n", r);
}
| apache-2.0 |
esttorhe/YOChartImageKit | Example/YOGraphImageKit Demo App (watchOS) Extension/BarChartInterfaceController.swift | 3 | 411 | import WatchKit
class BarChartInterfaceController: BaseInterfaceController {
override func willActivate() {
super.willActivate()
let chart = YOChart.BarChart
let frame = CGRectMake(0, 0, contentFrame.width, contentFrame.height / 1.5)
let image = chart.drawImage(frame, scale: WKIn... | mit |
ibm-cloud-security/appid-clientsdk-swift | Source/IBMCloudAppID/internal/SecurityUtils.swift | 1 | 10424 | /* * Copyright 2016, 2017 IBM Corp.
* 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... | apache-2.0 |
midmirror/MetaBrowser | MetaBrowser/MetaBrowser/Class/View/BottomToolbar.swift | 1 | 3095 | //
// BottomBar.swift
// MetaBrowser
//
// Created by midmirror on 17/6/22.
// Copyright © 2017年 midmirror. All rights reserved.
//
import UIKit
class BottomToolbar: UIToolbar {
typealias BackClosure = () -> Void
typealias ForwardClosure = () -> Void
typealias FunctionClosure = () -> Void
typ... | gpl-3.0 |
shvets/WebAPI | Sources/WebAPI/Files-extension.swift | 1 | 161 | import Foundation
import Files
extension File {
class func exists(atPath path: String) -> Bool {
return FileManager.default.fileExists(atPath: path)
}
} | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.