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 |
|---|---|---|---|---|---|
ducn/Slux | Example/Slux/Components/ViewController.swift | 1 | 502 | //
// ViewController.swift
// Slux
//
// Created by ducn on 01/29/2016.
// Copyright (c) 2016 ducn. All rights reserved.
//
import UIKit
import Slux
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, ty... | mit |
DanielAsher/VIPER-SWIFT | Carthage/Checkouts/RxSwift/Rx.playground/Pages/Mathematical_and_Aggregate_Operators.xcplaygroundpage/Contents.swift | 2 | 2041 | /*:
> # IMPORTANT: To use `Rx.playground`, please:
1. Open `Rx.xcworkspace`
2. Build `RxSwift-OSX` scheme
3. And then open `Rx` playground in `Rx.xcworkspace` tree view.
4. Choose `View > Show Debug Area`
*/
//: [<< Previous](@previous) - [Index](Index)
import RxSwift
/*:
## Mathematical and Aggregate Operators
Op... | mit |
moltin/ios-sdk | Examples/moltin WatchKit Example Extension/ExtensionDelegate.swift | 1 | 1706 | //
// ExtensionDelegate.swift
// moltin WatchKit Example Extension
//
// Created by Craig Tweedy on 21/02/2018.
//
import WatchKit
class ExtensionDelegate: NSObject, WKExtensionDelegate {
func handle(_ backgroundTasks: Set<WKRefreshBackgroundTask>) {
// Sent when the system needs to launch the applica... | mit |
gregomni/swift | validation-test/IDE/crashers_2_fixed/0026-completion-type-not-part-of-solution.swift | 9 | 458 | // RUN: %swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename=%s
struct Image {}
@resultBuilder struct ViewBuilder2 {
static func buildBlock<Content>(_ content: Content) -> Content { fatalError() }
}
struct NavigationLink<Destination> {
init(@ViewBuilder2 destination: () -> Destinat... | apache-2.0 |
mlavergn/swiftutil | Sources/datetime.swift | 1 | 2296 | /// Extensions to Date
/// DateTime struct with Date related helpers
///
/// - author: Marc Lavergne <mlavergn@gmail.com>
/// - copyright: 2017 Marc Lavergne. All rights reserved.
/// - license: MIT
import Foundation
// MARK: - Date extension
public extension Date {
/// Compare caller to date to caller and determin... | mit |
benlangmuir/swift | validation-test/compiler_crashers_fixed/28017-swift-protocoldecl-existentialtypesupportedslow.swift | 65 | 452 | // 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 |
benlangmuir/swift | test/Incremental/Fingerprints/member-moves-extensions.swift | 13 | 1311 | // Test per-type-body fingerprints using simple extensions
//
// If the parser is allowed to use a body fingerprint for an extension
// this test will fail because usesA.swift won't be recompiled for the
// last step.
// Establish status quo
// RUN: %empty-directory(%t)
// RUN: cp %S/Inputs/member-moves-extensions/* ... | apache-2.0 |
objecthub/swift-lispkit | Sources/LispKit/IO/BinaryInputSource.swift | 1 | 8272 | //
// BinaryInputSource.swift
// LispKit
//
// Created by Matthias Zenger on 01/11/2017.
// Copyright © 2017 ObjectHub. All rights reserved.
//
// 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 Li... | apache-2.0 |
GuiBayma/PasswordVault | PasswordVault/AppDelegate.swift | 1 | 4965 | //
// AppDelegate.swift
// PasswordVault
//
// Created by Guilherme Bayma on 7/26/17.
// Copyright © 2017 Bayma. All rights reserved.
//
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var backgroundView: BackgroundView?
va... | mit |
mortenjust/androidtool-mac | AndroidTool/ObbHandler.swift | 1 | 1195 | //
// ObbHandler.swift
// AndroidTool
//
// Created by Morten Just Petersen on 1/20/16.
// Copyright © 2016 Morten Just Petersen. All rights reserved.
//
import Cocoa
protocol ObbHandlerDelegate {
func obbHandlerDidStart(_ bytes:String)
func obbHandlerDidFinish()
}
class ObbHandler: NSObject {
var fi... | apache-2.0 |
adrfer/swift | validation-test/compiler_crashers_fixed/25154-swift-constraints-constraintsystem-opengeneric.swift | 4 | 287 | // RUN: not %target-swift-frontend %s -parse
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
let a{struct B<T where B:C{class B{class B{{}let b=true as S}struct S<T
| apache-2.0 |
ioscreator/ioscreator | IOSShakeGestureTutorial/IOSShakeGestureTutorial/ViewController.swift | 1 | 702 | //
// ViewController.swift
// IOSShakeGestureTutorial
//
// Created by Arthur Knopper on 18/02/2019.
// Copyright © 2019 Arthur Knopper. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var shakeLabel: UILabel!
override func viewDidLoad() {
super.vi... | mit |
ScottRobbins/SRBubbleProgressTracker | SRBubbleProgressTracker/SRBubbleProgressTrackerView.swift | 1 | 15019 | //
// SRBubbleProgressTrackerView.swift
// SRBubbleProgressTracker
//
// Created by Samuel Scott Robbins on 2/9/15.
// Copyright (c) 2015 Scott Robbins Software. All rights reserved.
//
import UIKit
public enum BubbleAllignment {
case Vertical
case Horizontal
}
public class SRBubbleProgressTrackerView : ... | mit |
kylelol/KKFloatingActionButton | ExampleTests/ExampleTests.swift | 1 | 904 | //
// ExampleTests.swift
// ExampleTests
//
// Created by Kyle Kirkland on 7/12/15.
// Copyright (c) 2015 Kyle Kirkland. All rights reserved.
//
import UIKit
import XCTest
class ExampleTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called ... | mit |
eofster/Telephone | UseCases/LazyDiscardingContactMatchingIndex.swift | 1 | 1589 | //
// LazyDiscardingContactMatchingIndex.swift
// Telephone
//
// Copyright © 2008-2016 Alexey Kuznetsov
// Copyright © 2016-2021 64 Characters
//
// Telephone 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 Foun... | gpl-3.0 |
aschwaighofer/swift | stdlib/public/core/SequenceAlgorithms.swift | 1 | 31714 | //===--- SequenceAlgorithms.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 |
joerocca/GitHawk | Classes/Issues/ReferencedCommit/IssueReferencedCommitCell.swift | 1 | 383 | //
// IssueReferencedCell.swift
// Freetime
//
// Created by Ryan Nystrom on 7/9/17.
// Copyright © 2017 Ryan Nystrom. All rights reserved.
//
import UIKit
import SnapKit
final class IssueReferencedCommitCell: AttributedStringCell {
// MARK: Public API
func configure(_ model: IssueReferencedCommitModel)... | mit |
allevato/SwiftCGI | Sources/SwiftCGI/CGIServer.swift | 1 | 2772 | // Copyright 2015 Tony Allevato
//
// 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 i... | apache-2.0 |
dasdom/Swiftandpainless | SwiftAndPainlessPlayground.playground/Pages/Functions - Basics III.xcplaygroundpage/Contents.swift | 1 | 525 | import Foundation
/*:
[⬅️](@previous) [➡️](@next)
# Functions: Basics III
## Returning Tuples
*/
func minMax(numbers: Int...) -> (min: Int, max: Int) {
precondition(numbers.count > 0)
var min = Int.max
var max = Int.min
for number in numbers {
if number <= min {
min = number
}
if number... | mit |
davecom/SwiftSimpleNeuralNetwork | Sources/Layer.swift | 1 | 3056 | //
// Layer.swift
// SwiftSimpleNeuralNetwork
//
// Copyright 2016-2019 David Kopec
//
// 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... | apache-2.0 |
austinzheng/swift-compiler-crashes | crashes-duplicates/12567-swift-sourcemanager-getmessage.swift | 11 | 238 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
init( ) {
{
protocol b {
class A {
func f( ) {
deinit {
class
case ,
| mit |
mightydeveloper/swift | test/SILPasses/linker.swift | 10 | 942 | // RUN: rm -rf %t
// RUN: mkdir %t
// RUN: %target-swift-frontend -emit-module %S/Inputs/linker_pass_input.swift -o %t/Swift.swiftmodule -parse-stdlib -parse-as-library -module-name Swift -sil-serialize-all -module-link-name swiftCore
// RUN: %target-swift-frontend %s -O -I %t -sil-debug-serialization -o - -emit-sil | ... | apache-2.0 |
mightydeveloper/swift | validation-test/compiler_crashers_fixed/0215-swift-optional-swift-infixoperatordecl.swift | 13 | 269 | // 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
>(f: B<{ }
})
}
func prefix(with: ng) -> <T>(() -> T)
| apache-2.0 |
mightydeveloper/swift | validation-test/compiler_crashers_fixed/2125-swift-completegenerictyperesolver-resolvedependentmembertype.swift | 13 | 382 | // 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
lass func g<T> () {
class A {
print() -> T) -> T -> Any {
}
enum b : C) {
}
case .a<U {
protocol P {
clas... | apache-2.0 |
Jnosh/swift | test/decl/protocol/req/unavailable.swift | 5 | 1054 | // RUN: %target-typecheck-verify-swift
// An @objc protocol can have 'unavailable'
// methods. They are treated as if they
// were marked optional
@objc protocol Proto {
@objc @available(*,unavailable) optional func bad()
func good()
}
class Foo : Proto {
@objc func good() {}
}
// Reject protocols with 'unava... | apache-2.0 |
jeffreybergier/Hipstapaper | Hipstapaper/Packages/V3Localize/Sources/V3Localize/PropertyWrappers/BrowserShareList.swift | 1 | 2568 | //
// Created by Jeffrey Bergier on 2022/08/03.
//
// MIT License
//
// Copyright (c) 2021 Jeffrey Bergier
//
// 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, inc... | mit |
radu-costea/ATests | ATests/ATests/UI/CustomViews/PickerViewController.swift | 1 | 1754 | //
// PickerViewController.swift
// ATests
//
// Created by Radu Costea on 19/06/16.
// Copyright © 2016 Radu Costea. All rights reserved.
//
import UIKit
class PickerViewControllerColumn {
var count: Int
var titleBuilder: (Int) -> String
var selected: Int
init(count: Int, selected: Int, titl... | mit |
Ryan-Vanderhoef/Antlers | AppIdeaTests/AppIdeaTests.swift | 1 | 908 | //
// AppIdeaTests.swift
// AppIdeaTests
//
// Created by Ryan Vanderhoef on 7/14/15.
// Copyright (c) 2015 Ryan Vanderhoef. All rights reserved.
//
import UIKit
import XCTest
class AppIdeaTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is cal... | mit |
atrick/swift | stdlib/public/core/UnicodeScalarProperties.swift | 1 | 61934 | //===----------------------------------------------------------------------===//
//
// 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 |
bay2/LetToDo | LetToDo/Home/Controller/HomeGroupViewController.swift | 1 | 3465 | //
// HomeGroupViewController.swift
// LetToDo
//
// Created by xuemincai on 2016/10/7.
// Copyright © 2016年 xuemincai. All rights reserved.
//
import UIKit
import EZSwiftExtensions
import IBAnimatable
import RxSwift
import SnapKit
import RxDataSources
fileprivate let reuseIdentifier = "HomeGroupCollectionViewCel... | mit |
austinzheng/swift | validation-test/compiler_crashers_fixed/01349-swift-typebase-operator.swift | 65 | 558 | // 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 |
netguru/inbbbox-ios | Unit Tests/ShotCollectionViewCellSpec.swift | 1 | 27321 | //
// Copyright (c) 2015 Netguru Sp. z o.o. All rights reserved.
//
import Quick
import Nimble
import Dobby
@testable import Inbbbox
class ShotCollectionViewCellSpec: QuickSpec {
override func spec() {
var sut: ShotCollectionViewCell!
beforeEach {
sut = ShotCollectio... | gpl-3.0 |
zhangjk4859/MyWeiBoProject | sinaWeibo/sinaWeibo/Classes/Message/JKMessageTableViewController.swift | 1 | 2951 | //
// JKMessageTableViewController.swift
// sinaWeibo
//
// Created by 张俊凯 on 16/6/5.
// Copyright © 2016年 张俊凯. All rights reserved.
//
import UIKit
class JKMessageTableViewController: JKBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
// 1.如果没有登录, 就设置未登录界面的信息
if... | mit |
hejunbinlan/Carlos | Sample/DataCacheSampleViewController.swift | 3 | 467 | import Foundation
import UIKit
import Carlos
class DataCacheSampleViewController: BaseCacheViewController {
private var cache: BasicCache<NSURL, NSData>!
override func fetchRequested() {
super.fetchRequested()
cache.get(NSURL(string: urlKeyField?.text ?? "")!)
}
override func titleForScreen(... | mit |
loudnate/Loop | LoopCore/Result.swift | 1 | 167 | //
// Result.swift
// Loop
//
// Copyright © 2017 LoopKit Authors. All rights reserved.
//
public enum Result<T> {
case success(T)
case failure(Error)
}
| apache-2.0 |
orta/RxSwift | RxSwift/RxSwift/Observables/Observable+Single.swift | 1 | 5128 | //
// Observable+Single.swift
// Rx
//
// Created by Krunoslav Zaher on 2/14/15.
// Copyright (c) 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
// as observable
public func asObservable<E>
(source: Observable<E>) -> Observable<E> {
if let asObservable = source as? AsObservable<E> {
... | mit |
bolivarbryan/Cappacitate2015-Cartagena | SwiftMenu/SwiftMenu/View/CellTableViewCell.swift | 1 | 684 | //
// CellTableViewCell.swift
// SwiftMenu
//
// Created by Bryan A Bolivar M on 5/9/15.
// Copyright (c) 2015 Bolivar. All rights reserved.
//
import UIKit
class CellTableViewCell: UITableViewCell {
@IBOutlet weak var cellImage: UIImageView!
@IBOutlet weak var spinner: UIActivityIndicatorView!
@IBOut... | mit |
jpedrosa/sua_nc | Sources/ascii.swift | 2 | 830 |
public class Ascii {
public static func toLowerCase(c: UInt8) -> UInt8 {
if c >= 65 && c <= 90 {
return c + 32
}
return c
}
public static func toLowerCase(bytes: [UInt8]) -> [UInt8] {
var a = bytes
let len = a.count
for i in 0..<len {
let c = a[i]
if c >= 65 && c <= 9... | apache-2.0 |
dalu93/SwiftHelpSet | Sources/Utilities/ConnectionStatus.swift | 1 | 1681 | //
// ConnectionStatus.swift
// SwiftHelpSet
//
// Created by Luca D'Alberti on 7/15/16.
// Copyright © 2016 dalu93. All rights reserved.
//
import Foundation
/**
The enum describes the connection status with backend.
- notStarted: The connection is not started yet
- inProgress: The connection is in progress... | mit |
alvesmarcel/ios-nanodegree-meme-me | MemeMe/AppDelegate.swift | 1 | 2135 | //
// AppDelegate.swift
// MemeMe
//
// Created by Marcel Oliveira Alves on 5/23/15.
// Copyright (c) 2015 Marcel Oliveira Alves. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
// TODO: Remove this array from here
var me... | mit |
blockchain/My-Wallet-V3-iOS | Modules/FeatureWithdrawalLocks/Sources/FeatureWithdrawalLocksUI/Localization/LocalizationConstants+WithdrawalLock.swift | 1 | 2496 | // Copyright © Blockchain Luxembourg S.A. All rights reserved.
import Localization
extension LocalizationConstants {
enum WithdrawalLocks {
static let onHoldTitle = NSLocalizedString(
"On Hold",
comment: "Withdrawal Locks: On Hold Title"
)
static let onHoldAmountTi... | lgpl-3.0 |
blue42u/swift-t | stc/tests/560-file-1.swift | 4 | 450 | import assert;
main {
file infile = input_file("alice.txt");
file outfile <"bob.txt"> = infile;
assertEqual(filename(infile), "alice.txt", "filename infile");
assertEqual(filename(outfile), "bob.txt", "filename outfile");
}
file infile = input_file("alice.txt");
file outfile <"bob2.txt"> = infile... | apache-2.0 |
pepaslabs/TODOApp | TODOApp/Array+get.swift | 1 | 384 | //
// Array+get.swift
// TODOApp
//
// Created by Pepas Personal on 7/26/15.
// Copyright (c) 2015 Pepas Personal. All rights reserved.
//
import Foundation
extension Array
{
func get(index: Int) -> Element?
{
if index < 0 || index >= self.count
{
return nil
}
e... | mit |
xcbakery/xcbakery | Sources/CookingKit/Recipe/Util/RecipeParser.swift | 1 | 626 | //
// XCBRecipeParser.swift
// xcbakery
//
// Created by Nam Seok Hyeon on 5/19/17.
// Copyright © 2017 Nimbl3. All rights reserved.
//
import Foundation
import SwiftyJSON
public struct RecipeParser {
public func parse(_ templateURL: URL) throws -> Recipe {
let recipeURL = templateURL.appendingPathCo... | mit |
apple/swift-nio-http2 | Sources/NIOHTTP2PerformanceTester/main.swift | 1 | 5440 | //===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIB... | apache-2.0 |
HotCatLX/SwiftStudy | 17-BasicGesture/BasicGesture/ViewController.swift | 1 | 1863 | //
// ViewController.swift
// BasicGesture
//
// Created by suckerl on 2017/5/22.
// Copyright © 2017年 suckel. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
fileprivate lazy var image :UIImageView = {
let image = UIImageView()
image.image = UIImage(named: "one"... | mit |
Cloudage/XWebView | XWebViewTests/XWVScriptingTest.swift | 1 | 2947 | /*
Copyright 2015 XWebView
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | apache-2.0 |
uasys/swift | stdlib/public/core/Reverse.swift | 1 | 17839 | //===--- Reverse.swift - Sequence and collection reversal -----------------===//
//
// 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 |
austinzheng/swift | test/multifile/Inputs/external-protocol-conformance/A.swift | 67 | 331 | protocol PHelper {
}
protocol P {
associatedtype Assoc: PHelper // expected-note {{protocol requires nested type 'Assoc'}}
}
struct A : P { // expected-error {{type 'A' does not conform to protocol 'P'}}
typealias Assoc = Int // expected-note {{possibly intended match 'A.Assoc' (aka 'Int') does not conform to 'PH... | apache-2.0 |
apple/swift | validation-test/StdlibUnittest/ChildProcessShutdown/FailIfChildExitsDuringShutdown.swift | 19 | 887 | // RUN: %target-run-simple-swift 2>&1 | %FileCheck %s
// REQUIRES: executable_test
import StdlibUnittest
#if canImport(Darwin)
import Darwin
#elseif canImport(Glibc)
import Glibc
#elseif os(Windows)
import MSVCRT
#else
#error("Unsupported platform")
#endif
_setTestSuiteFailedCallback() { print("abort()") }
//
... | apache-2.0 |
5lucky2xiaobin0/PandaTV | PandaTV/PandaTV/Classes/Main/VIew/GameCell.swift | 1 | 2082 | //
// GameCell.swift
// PandaTV
//
// Created by 钟斌 on 2017/3/24.
// Copyright © 2017年 xiaobin. All rights reserved.
//
import UIKit
import Kingfisher
class GameCell: UICollectionViewCell {
@IBOutlet weak var nowImage: UIImageView!
@IBOutlet weak var gameTitle: UILabel!
@IBOutlet weak var u... | mit |
See-Ku/SK4Toolkit | SK4Toolkit/core/SK4Dispatch.swift | 1 | 1670 | //
// SK4Dispatch.swift
// SK4Toolkit
//
// Created by See.Ku on 2016/03/24.
// Copyright (c) 2016 AxeRoad. All rights reserved.
//
import Foundation
// /////////////////////////////////////////////////////////////
// MARK: - 同期/非同期関係の処理
/// グローバルキューで非同期処理
public func sk4AsyncGlobal(exec: (()->Void)) {
let glob... | mit |
manfengjun/KYMart | Section/Mine/Controller/KYPendToPointViewController.swift | 1 | 3497 | //
// KYBonusToMoneyViewController.swift
// KYMart
//
// Created by JUN on 2017/7/3.
// Copyright © 2017年 JUN. All rights reserved.
//
import UIKit
import IQKeyboardManagerSwift
class KYPendToPointViewController: BaseViewController {
@IBOutlet weak var codeBgView: UIView!
@IBOutlet weak var saveBtn: U... | mit |
Antondomashnev/FBSnapshotsViewer | FBSnapshotsViewerTests/TestLineNumberExtractorSpec.swift | 1 | 3666 | //
// TestLineNumberExtractorSpec.swift
// FBSnapshotsViewerTests
//
// Created by Anton Domashnev on 13.08.17.
// Copyright © 2017 Anton Domashnev. All rights reserved.
//
import Quick
import Nimble
@testable import FBSnapshotsViewer
class TestLineNumberExtractorSpec: QuickSpec {
override func spec() {
... | mit |
Ribeiro/PapersPlease | Classes/ValidationTypes/ValidatorType.swift | 1 | 947 | //
// ValidatorType.swift
// PapersPlease
//
// Created by Brett Walker on 7/2/14.
// Copyright (c) 2014 Poet & Mountain, LLC. All rights reserved.
//
import Foundation
class ValidationStatus {
let valid = "ValidationStatusValid"
let invalid = "ValidationStatusInvalid"
}
let ValidatorUpdateNotification:... | mit |
BellAppLab/SequencePlayer | Example/Example/ViewController.swift | 1 | 1800 | import UIKit
class ViewController: UIViewController, SequencePlayerDataSource, SequencePlayerDelegate {
var player: SequencePlayer!
lazy var urls: [URL] = {
var result = [URL]()
["http://media0.giphy.com/media/Wqhdoubttqizu/giphy.mp4",
"http://media0.giphy.com/media/3UvKSHiE... | mit |
TedMore/FoodTracker | FoodTracker/MealViewController.swift | 1 | 4614 | //
// MealViewController.swift
// FoodTracker
//
// Created by TedChen on 10/15/15.
// Copyright © 2015 LEON. All rights reserved.
//
import UIKit
class MealViewController: UIViewController, UITextFieldDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
// MARK: Properties
@IBOutl... | apache-2.0 |
teambition/RefreshView | Sources/UIScrollView+Extension.swift | 2 | 2202 | //
// UIScrollView+Extension.swift
// RefreshDemo
//
// Created by ZouLiangming on 16/1/25.
// Copyright © 2016年 ZouLiangming. All rights reserved.
//
import UIKit
extension UIScrollView {
var insetTop: CGFloat {
get {
return self.contentInset.top
}
set(newValue) {
... | mit |
SomeSimpleSolutions/MemorizeItForever | MemorizeItForeverCore/MemorizeItForeverCoreTests/ManagersTests/WordFlowsServiceTests.swift | 1 | 17913 | //
// WordFlowsTests.swift
// MemorizeItForeverCore
//
// Created by Hadi Zamani on 10/23/16.
// Copyright © 2016 SomeSimpleSolutions. All rights reserved.
//
import XCTest
import BaseLocalDataAccess
@testable import MemorizeItForeverCore
class WordFlowsTests: XCTestCase {
var wordFlowService: WordFlowService... | mit |
roambotics/swift | test/stdlib/Bundle.swift | 2 | 776 | // RUN: %target-run-simple-swift
// REQUIRES: executable_test
// REQUIRES: objc_interop
import Foundation
import StdlibUnittest
var BundleTests = TestSuite("BundleTests")
BundleTests.test("Bundle.bundleForNilClass") {
// Ensure that bundleForClass: tolerates a nil parameter. The
// Foundation implementation does... | apache-2.0 |
alexhillc/AXPhotoViewer | Source/Integrations/SimpleNetworkIntegration.swift | 1 | 7546 | //
// SimpleNetworkIntegration.swift
// AXPhotoViewer
//
// Created by Alex Hill on 6/11/17.
// Copyright © 2017 Alex Hill. All rights reserved.
//
open class SimpleNetworkIntegration: NSObject, AXNetworkIntegrationProtocol, SimpleNetworkIntegrationURLSessionWrapperDelegate {
fileprivate var urlSessionWra... | mit |
Nirma/UIFontComplete | Sources/UIFont+Extension.swift | 1 | 2115 | // UIFont+Extension.swift
// Copyright (c) 2016-2019 Nicholas Maccharoli
//
// 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 |
JBerkvens/SmartMobile-iOS-2016 | Practica/json_test/json_test/Pirate.swift | 1 | 535 | //
// Pirate.swift
// json_test
//
// Created by Jeroen Berkvens on 06/04/16.
// Copyright © 2016 Fontys Universities. All rights reserved.
//
import Foundation
class Pirate {
let name:String!;
var yearsActive:Int?;
var notes:String?;
init (name:String) {
self.name = name;
}
... | gpl-3.0 |
collegboi/MBaaSKit | MBaaSKit/Classes/Protocols/LabelLoad.swift | 1 | 3073 | //
// LabelLoad.swift
// Remote Config
//
// Created by Timothy Barnard on 23/10/2016.
// Copyright © 2016 Timothy Barnard. All rights reserved.
//
import UIKit
public protocol LabelLoad {}
public extension LabelLoad where Self: UILabel {
public func setupLabelView( className: UIViewController, name: St... | mit |
iOSDevLog/iOSDevLog | 228. NestedXib/228. NestedXib/ViewController.swift | 1 | 515 | //
// ViewController.swift
// 228. NestedXib
//
// Created by iOS Dev Log on 2017/12/19.
// Copyright © 2017年 iOSDevLog. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the... | mit |
softdevstory/yata | yata/Sources/ViewControllers/MainSplitViewController.swift | 1 | 2920 | //
// MainSplitViewController.swift
// yata
//
// Created by HS Song on 2017. 7. 14..
// Copyright © 2017년 HS Song. All rights reserved.
//
import AppKit
class MainSplitViewController: NSSplitViewController {
@IBOutlet weak var pageListSplitViewItem: NSSplitViewItem!
@IBOutlet weak var pageEditSplit... | mit |
michaelarmstrong/SuperRecord | SuperRecordDemo/SuperRecordDemo/Entity/Pokemon+CoreDataProperties.swift | 2 | 494 | //
// Pokemon+CoreDataProperties.swift
// SuperRecordDemo
//
// Created by Piergiuseppe Longo on 23/10/15.
// Copyright © 2015 SuperRecord. All rights reserved.
//
// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu
// to delete and recreate this implementation file for your updated model.... | mit |
neoreeps/rest-tester | REST Tester/AppDelegate.swift | 1 | 4615 | //
// AppDelegate.swift
// REST Tester
//
// Created by Kenny Speer on 10/3/16.
// Copyright © 2016 Kenny Speer. All rights reserved.
//
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplic... | apache-2.0 |
airspeedswift/swift | test/Constraints/optional.swift | 3 | 13739 | // RUN: %target-typecheck-verify-swift
// REQUIRES: objc_interop
func markUsed<T>(_ t: T) {}
class A {
@objc func do_a() {}
@objc(do_b_2:) func do_b(_ x: Int) {}
@objc func do_b(_ x: Float) {}
@objc func do_c(x: Int) {} // expected-note {{incorrect labels for candidate (have: '(_:)', expected: '(x:)')}}
... | apache-2.0 |
vhbit/MastodonKit | Tests/MastodonKitTests/Models/InstanceTests.swift | 1 | 586 | import XCTest
@testable import MastodonKit
class InstanceTests: XCTestCase {
func testInstanceFromJSON() {
let fixture = try? Fixture.load(fileName: "Fixtures/Instance.json")
let dictionary = fixture as! JSONDictionary
let instance = Instance(from: dictionary)
XCTAssertEqual(instan... | mit |
neoneye/SwiftyFORM | Source/FormItems/MetaFormItem.swift | 1 | 420 | // MIT license. Copyright (c) 2021 SwiftyFORM. All rights reserved.
import Foundation
/// This is an invisible field, that is submitted along with the json
public class MetaFormItem: FormItem {
override func accept(visitor: FormItemVisitor) {
visitor.visit(object: self)
}
public var value: AnyObject?
@discarda... | mit |
tyleryouk11/space-hero | Stick-Hero/GameViewController.swift | 1 | 2862 | //
// GameViewController.swift
// Stick-Hero
//
// Created by 顾枫 on 15/6/19.
// Copyright (c) 2015年 koofrank. All rights reserved.
//
import UIKit
import SpriteKit
import AVFoundation
import GoogleMobileAds
class GameViewController: UIViewController {
var musicPlayer:AVAudioPlayer!
var interstitial: GADIn... | mit |
c1moore/deckstravaganza | Deckstravaganza/Card.swift | 1 | 7803 | //
// Card.swift
// Deckstravaganza
//
// Created by Calvin Moore on 9/20/15.
// Copyright © 2015 University of Florida. All rights reserved.
//
import UIKit
class Card {
// Enumeration of legal card suits.
enum CardSuit : Int {
case Clubs = 1;
case Diamonds = 2;
case Hearts = ... | mit |
smizy/DemoWebviewApsalar_ios | DemoAppWebview/AppDelegate.swift | 1 | 6464 | //
// AppDelegate.swift
// DemoAppWebview
//
// Created by usr0300789 on 2014/11/14.
// Copyright (c) 2014年 smizy. All rights reserved.
//
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplic... | mit |
russelhampton05/MenMew | App Prototypes/Menu_Server_App_Prototype_001/Menu_Server_App_Prototype_001/Models.swift | 1 | 9263 | //
// Models.swift
// App_Prototype_Alpha_001
//
// Created by Jon Calanio on 10/3/16.
// Copyright © 2016 Jon Calanio. All rights reserved.
//
import Foundation
import Firebase
//User Class
class User {
var ID: String
var name: String?
var theme: String?
var email: String?
var ticket: T... | mit |
csmulhern/uranus | iOS Example/iOS Example/ViewController.swift | 1 | 4896 | import UIKit
import Uranus
class ViewController: UIViewController {
var componentsView: ComponentsScrollView!
var layout: View!
var alternateLayout: View!
var showingNormalLayout = true
var switchLayoutBarButtonItem: UIBarButtonItem!
var layoutDirectionBarButtonItem: UIBarButtonItem?
ove... | unlicense |
lsolniczek/SwiftLint | Source/SwiftLintFrameworkTests/ReporterTests.swift | 1 | 2164 | //
// ReporterTests.swift
// SwiftLint
//
// Created by JP Simard on 9/19/15.
// Copyright © 2015 Realm. All rights reserved.
//
import SwiftLintFramework
import XCTest
class ReporterTests: XCTestCase {
func generateViolations() -> [StyleViolation] {
return [
StyleViolation(type: .Length,
... | mit |
externl/ice | swift/test/Ice/inheritance/Client.swift | 4 | 383 | //
// Copyright (c) ZeroC, Inc. All rights reserved.
//
import Ice
import PromiseKit
import TestCommon
public class Client: TestHelperI {
public override func run(args: [String]) throws {
let communicator = try initialize(args)
defer {
communicator.destroy()
}
let initi... | gpl-2.0 |
UroborosStudios/UOHelpers | UOHelpers/MediaExtensions.swift | 1 | 1734 | //
// MediaExtensions.swift
// UOHelpers
//
// Created by Jonathan Silva on 04/05/17.
// Copyright © 2017 Uroboros Studios. All rights reserved.
//
import Foundation
import UIKit
public extension UIColor {
open convenience init(fromHex: String) {
let hexString:NSString = fromHex.trimmingCharacte... | mit |
fespinoza/linked-ideas-osx | Playground-iOS.playground/Pages/5. bezier paths.xcplaygroundpage/Contents.swift | 1 | 318 | //: [Previous](@previous)
import Foundation
import UIKit
var str = "Hello, playground"
let bezierPath = UIBezierPath()
bezierPath.move(to: CGPoint(x: 100, y: 0))
bezierPath.addLine(to: CGPoint(x: 100, y: 100))
bezierPath.addLine(to: CGPoint(x: 200, y: 0))
bezierPath.close()
bezierPath.stroke()
//: [Next](@next)
| mit |
rabbah/openwhisk | tests/dat/actions/hello.swift | 11 | 1063 | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | apache-2.0 |
peferron/algo | EPI/Stacks and Queues/Implement a queue using stacks/swift/main.swift | 1 | 841 | // Nerfed array to make sure we don't cheat by doing e.g. index-based access.
struct Stack<T> {
var array = [T]()
var count: Int {
return array.count
}
mutating func push(_ element: T) {
array.append(element)
}
mutating func pop() -> T {
return array.removeLast()
}... | mit |
rzrasel/iOS-Swift-2016-01 | SwiftTableHeaderOne/SwiftTableHeaderOne/AppDelegate.swift | 2 | 6113 | //
// AppDelegate.swift
// SwiftTableHeaderOne
//
// Created by NextDot on 2/11/16.
// Copyright © 2016 RzRasel. All rights reserved.
//
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplicat... | apache-2.0 |
wireapp/wire-ios-sync-engine | Tests/Source/UserSession/BuildTypeTests.swift | 1 | 2861 | //
// Wire
// Copyright (C) 2018 Wire Swiss GmbH
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This progr... | gpl-3.0 |
seandavidmcgee/HumanKontactBeta | src/Pods/Hokusai/Classes/Hokusai.swift | 1 | 15917 | //
// Hokusai.swift
// Hokusai
//
// Created by Yuta Akizuki on 2015/07/07.
// Copyright (c) 2015年 ytakzk. All rights reserved.
//
import UIKit
private struct HOKConsts {
let animationDuration:NSTimeInterval = 0.8
let hokusaiTag = 9999
}
// Action Types
public enum HOKAcitonType {
case None, Selector... | mit |
PodBuilder/XcodeKit | SwiftXcodeKit/Resources/CompileSourcesBuildPhase.swift | 1 | 2706 | /*
* The sources in the "XcodeKit" directory are based on the Ruby project Xcoder.
*
* Copyright (c) 2012 cisimple
*
* MIT License
*
* 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 w... | mit |
yonaskolb/XcodeGen | Tests/Fixtures/TestProject/ExtensionKit Extension/EntryPoint.swift | 1 | 68 | import AppIntents
@main
struct EntryPoint: AppIntentsExtension {
}
| mit |
shengguoqiang/FTDKit | FTDKitDemo/FTDKitDemo/AppDelegate.swift | 1 | 2180 | //
// AppDelegate.swift
// FTDKitDemo
//
// Created by shengguoqiang on 16/12/6.
// Copyright © 2016年 盛世集团. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunc... | mit |
JPIOS/JDanTang | JDanTang/JDanTang/Class/Tool(工具)/Common/NetworkTool.swift | 1 | 5398 | //
// NetworkTool.swift
// JDanTang
//
// Created by mac_KY on 2017/6/14.
// Copyright © 2017年 mac_KY. All rights reserved.
//
import UIKit
import Alamofire
import Foundation
import SwiftyJSON
import SVProgressHUD
class NetworkTool: NSObject {
/// 单利
static let shareNetworkTool = NetworkTool()
... | apache-2.0 |
sharkspeed/dororis | packages/swift/kitura/myFirstProject/Sources/main.swift | 1 | 215 | import Kitura
let router = Router()
let port = 8080
router.get("/") {
request, response, next in
response.send("Hello Kitura")
next()
}
Kitura.addHTTPServer(onPort: port, with: router)
Kitura.run() | bsd-2-clause |
fhchina/firefox-ios | Client/Frontend/Browser/LoginsHelper.swift | 1 | 13640 | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import Foundation
import Shared
import Storage
import XCGLogger
import WebKit
private let log = Logger.browserLog... | mpl-2.0 |
LongPF/FaceTube | FaceTube/Tool/Capture/FTPhotoFilters.swift | 1 | 1624 | //
// FTPhotoFilters.swift
// FaceTube
//
// Created by 龙鹏飞 on 2017/4/10.
// Copyright © 2017年 https://github.com/LongPF/FaceTube. All rights reserved.
//
import UIKit
/// 滤镜类
class FTPhotoFilters: NSObject {
var selectedFilter: CIFilter!
static let shared = FTPhotoFilters();
private overri... | mit |
exshin/PokePuzzler | PokePuzzler/Level.swift | 1 | 20391 | //
// Level.swift
// PokePuzzler
//
// Created by Eugene Chinveeraphan on 13/04/16.
// Copyright © 2016 Eugene Chinveeraphan. All rights reserved.
//
import Foundation
let NumColumns = 8
let NumRows = 8
let NumLevels = 1 // Excluding Level_0.json
class Level {
// MARK: Properties
// The 2D array that k... | apache-2.0 |
wendellantildes/SideMenu | SideMenuUITests/SideMenuUITests.swift | 1 | 1280 | //
// SideMenuUITests.swift
// SideMenuUITests
//
// Created by Wendell Antildes M Sampaio on 29/03/2016.
// Copyright © 2016 Wendell Antildes M Sampaio. All rights reserved.
//
import XCTest
class SideMenuUITests: XCTestCase {
override func setUp() {
super.setUp()
// Put set... | mit |
JohnEstropia/CoreStore | Sources/ObjectProxy.swift | 1 | 8333 | //
// ObjectProxy.swift
// CoreStore
//
// Copyright © 2020 John Rommel Estropia
//
// 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 ... | mit |
qmathe/Confetti | Viewpoint/App.swift | 1 | 620 | /**
Copyright (C) 2017 Quentin Mathe
Date: July 2017
License: MIT
*/
import Foundation
protocol App {
associatedtype
public init(value: T)
}
extension Viewpoint<T> {
// MARK: - Initialization
/// Initializes a new viewpoint to present the given value.
public init(value: T) {
self.value = value
... | mit |
Fenrikur/ef-app_ios | EurofurenceTests/Director/Module Interactions/WhenMessagesModuleRequestsUserResolution_DirectorShould.swift | 1 | 1250 | import XCTest
class WhenMessagesModuleRequestsUserResolution_DirectorShould: XCTestCase {
var context: ApplicationDirectorTestBuilder.Context!
var userResolved: Bool!
override func setUp() {
super.setUp()
context = ApplicationDirectorTestBuilder().build()
context.navigateToTabCon... | mit |
ryuichis/swift-lint | Sources/Lint/Rule/RedundantIfStatementRule.swift | 2 | 3305 | /*
Copyright 2017, 2019 Ryuichi Laboratories and the Yanagiba project 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
... | apache-2.0 |
rwbutler/TypographyKit | Example/TypographyKit/UIKitViewController.swift | 1 | 830 | //
// UIKitViewController.swift
// TypographyKit
//
// Created by Ross Butler on 05/09/2017.
// Copyright (c) 2017 Ross Butler. All rights reserved.
//
import Foundation
import UIKit
class UIKitViewController: UIViewController {
@IBOutlet weak var attributedStringButton: UIButton!
@IBOutlet weak var attr... | mit |
WeHUD/app | weHub-ios/Gzone_App/Pods/XLPagerTabStrip/Sources/PagerTabStripError.swift | 6 | 1350 | // PagerTabStripError.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.