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 |
|---|---|---|---|---|---|
hasanlsn/HAActionSheet | Example/HAActionSheet/AppDelegate.swift | 1 | 2173 | //
// AppDelegate.swift
// HAActionSheet
//
// Created by hasanlsn on 08/05/2017.
// Copyright (c) 2017 hasanlsn. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinis... | mit |
Polidea/RxBluetoothKit | Source/CentralManagerRestoredState.swift | 1 | 2942 | import Foundation
import CoreBluetooth
/// It should be deleted when `RestoredState` will be deleted
protocol CentralManagerRestoredStateType {
var restoredStateData: [String: Any] { get }
var centralManager: CentralManager { get }
var peripherals: [Peripheral] { get }
var scanOptions: [String: AnyObje... | apache-2.0 |
austinzheng/swift-compiler-crashes | crashes-duplicates/03810-swift-typebase-getanyoptionalobjecttype.swift | 11 | 299 | // 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 g<T) {
class A : a {
deinit {
deinit {
}
class A {
var f1: String = a<b where I.h> {
func a<h == F>("""""""""
func a
proto
| mit |
austinzheng/swift-compiler-crashes | fixed/00477-no-stacktrace.swift | 11 | 240 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
extension NSSet{{}protocol A{}{{}}init(array c){{{}}}}import Foundation | mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/13680-swift-sourcemanager-getmessage.swift | 11 | 231 | // 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 P {
class d {
func a {
struct A {
class
case ,
| mit |
ericwastaken/Xcode_Playgrounds | Playgrounds/Binary Tree Search Implementation.playground/Contents.swift | 1 | 2173 | // Binary Search Tree
// A node can contain at most 2 children
// The tree is always in order
public class BinarySearchTree<T>: CustomStringConvertible {
var value: T
var leftTree: BinarySearchTree<T>?
var rightTree: BinarySearchTree<T>?
init(_ value: T) {
self.value = value
}
... | unlicense |
ThomasCle/Loggage | Loggage/LoggageTests/LogLevelTests.swift | 1 | 1608 | //
// LogLevelTests.swift
// Loggage
//
// Created by Thomas Kalhøj Clemensen on 24/08/2017.
// Copyright © 2017 ThomasCle. All rights reserved.
//
import XCTest
@testable import Loggage
class LogLevelTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This m... | mit |
albinekcom/BitBay-Ticker-iOS | Codebase/Data Repository/Remote/RemoteDataRepository.swift | 1 | 4303 | import Foundation
private enum Endpoint: String {
case currencies = "https://raw.githubusercontent.com/albinekcom/Zonda-API-Tools/main/v1/currencies.json"
case ticker = "https://api.zonda.exchange/rest/trading/ticker"
case stats = "https://api.zonda.exchange/rest/trading/stats"
var url: URL? ... | mit |
nanthi1990/SwiftCharts | SwiftCharts/ChartPoint/ChartPoint.swift | 7 | 565 | //
// ChartPoint.swift
// swift_charts
//
// Created by ischuetz on 01/03/15.
// Copyright (c) 2015 ivanschuetz. All rights reserved.
//
import UIKit
public class ChartPoint: Equatable {
public let x: ChartAxisValue
public let y: ChartAxisValue
public init(x: ChartAxisValue, y: ChartAxisValu... | apache-2.0 |
Syject/MyLessPass-iOS | LessPass/Model/Generator/LesspassData.swift | 1 | 446 | //
// LesspassData.swift
// LessPass
//
// Created by Dan Slupskiy on 11.01.17.
// Copyright © 2017 Syject. All rights reserved.
//
import Foundation
class LesspassData{
var site:String
var login:String
var masterPassword:String
init(withSite site:String, login:String, andMasterPassword maste... | gpl-3.0 |
wbaumann/SmartReceiptsiOS | SmartReceipts/Common/Exchange/ExchangeRateCalculator.swift | 2 | 1052 | //
// ExchangeRateCalculator.swift
// SmartReceipts
//
// Created by Bogdan Evsenev on 19/07/2019.
// Copyright © 2019 Will Baumann. All rights reserved.
//
import Foundation
import RxSwift
class ExchangeRateCalculator {
let exchangeRateUpdate = PublishSubject<Double>()
let baseCurrencyPriceUpdate = Publi... | agpl-3.0 |
rnystrom/GitHawk | Classes/Issues/Comments/Markdown/ViewMarkdownViewController.swift | 1 | 1548 | //
// ViewMarkdownViewController.swift
// Freetime
//
// Created by Ryan Nystrom on 5/19/18.
// Copyright © 2018 Ryan Nystrom. All rights reserved.
//
import UIKit
final class ViewMarkdownViewController: UIViewController {
private let markdown: String
private let textView = UITextView()
init(markdow... | mit |
terflogag/OpenSourceController | Exemple/OpenSourceControllerDemo/AppDelegate.swift | 1 | 2201 | //
// AppDelegate.swift
// OpenSourceControllerDemo
//
// Created by Florian Gabach on 04/04/2017.
// Copyright © 2017 OpenSourceController. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ applicatio... | mit |
cnoon/swift-compiler-crashes | crashes-duplicates/19620-swift-constraints-constraintsystem-lookupmember.swift | 10 | 228 | // 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 S{
let a=b.h == a
func b{
class b<T where f:a{
var:a | mit |
yaobanglin/viossvc | viossvc/Scenes/Share/Tour/TourShareListViewController.swift | 2 | 2791 | //
// ShareListViewController.swift
// viossvc
//
// Created by yaowang on 2016/10/28.
// Copyright © 2016年 ywwlcom.yundian. All rights reserved.
//
import UIKit
class TourShareListViewController: BasePageListTableViewController , OEZTableViewDelegate {
// var listType:Int = 0;
// var typeName: String
v... | apache-2.0 |
SuPair/firefox-ios | AccountTests/LiveAccountTest.swift | 4 | 7178 | /* 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 Shared
import Deferred
import SwiftyJSON
import XCTe... | mpl-2.0 |
SteveBarnegren/TweenKit | TweenKit/TweenKitTests/Action+Testable.swift | 1 | 386 | //
// Action+Testable.swift
// TweenKit
//
// Created by Steven Barnegren on 24/03/2017.
// Copyright © 2017 Steve Barnegren. All rights reserved.
//
import Foundation
import TweenKit
extension SchedulableAction {
func simulateFullLifeCycle() {
self.willBecomeActive()
self.willBegin()
... | mit |
nakajijapan/PhotoSlider | Sources/PhotoSlider/Classes/UIImage+PhotoSlider.swift | 1 | 553 | //
// UIImage+PhotoSlider.swift
// PhotoSlider
//
// Created by nakajijapan on 2016/09/29.
// Copyright © 2016 nakajijapan. All rights reserved.
//
import UIKit
extension UIView {
func toImage() -> UIImage? {
UIGraphicsBeginImageContextWithOptions(frame.size, false, 0.0)
let context = UIGraph... | mit |
luoziyong/firefox-ios | Client/Frontend/Browser/TabManager.swift | 1 | 34585 | /* 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 WebKit
import Storage
import Shared
private let log = Logger.browserLogger
protocol Tab... | mpl-2.0 |
APUtils/APExtensions | APExtensions/Classes/Core/_Extensions/_Foundation/NotificationCenter+Utils.swift | 1 | 3658 | //
// NotificationCenter+Utils.swift
// APExtensions
//
// Created by Anton Plebanovich on 8/15/17.
// Copyright © 2019 Anton Plebanovich. All rights reserved.
//
import Foundation
// ******************************* MARK: - Day Start Notifications
public extension Notification.Name {
/// Post on 0:00:00 ever... | mit |
samantharachelb/todolist | todolist/Extensions/AddBordersToUIView.swift | 1 | 994 | //
// AddBordersToUIView.swift
// todolist
//
// Created by Samantha Emily-Rachel Belnavis on 2017-10-16.
// Copyright © 2017 Samantha Emily-Rachel Belnavis. All rights reserved.
//
import Foundation
import UIKit
extension UIView {
enum ViewSide {
case Left, Right, Top, Bottom
}
func addBorder(toSide... | mit |
edx/edx-app-ios | Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Swift/LoginManager.swift | 1 | 7534 | // Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
//
// You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
// copy, modify, and distribute this software in source code or binary form for use
// in connection with the web services and APIs provided by Facebook.
//
// As with... | apache-2.0 |
damicreabox/Git2Swift | Sources/Git2Swift/tree/Tree.swift | 1 | 2214 | //
// Tree.swift
// Git2Swift
//
// Created by Damien Giron on 01/08/2016.
//
//
import Foundation
import CLibgit2
/// Tree Definition
public class Tree {
let repository : Repository
/// Internal libgit2 tree
internal let tree : UnsafeMutablePointer<OpaquePointer?>
/// Init with libg... | apache-2.0 |
ReSwift/ReSwift | ReSwift/CoreTypes/StoreSubscriber.swift | 3 | 670 | //
// StoreSubscriber.swift
// ReSwift
//
// Created by Benjamin Encz on 12/14/15.
// Copyright © 2015 ReSwift Community. All rights reserved.
//
public protocol AnyStoreSubscriber: AnyObject {
// swiftlint:disable:next identifier_name
func _newState(state: Any)
}
public protocol StoreSubscriber: AnyStore... | mit |
SwiftKitz/Appz | Appz/Appz/Apps/Podcasts.swift | 1 | 1009 | //
// Podcasts.swift
// Appz
//
// Created by MARYAM ALJAME on 2/20/18.
// Copyright © 2018 kitz. All rights reserved.
//
public extension Applications {
struct Podcasts: ExternalApplication {
public typealias ActionType = Applications.Podcasts.Action
public let scheme = ... | mit |
swift-server/http | Sources/HTTP/PoCSocket/PoCSocket.swift | 1 | 12565 | // This source file is part of the Swift.org Server APIs open source project
//
// Copyright (c) 2017 Swift Server API project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
//
import Foundation
import Dispatch
import ServerSe... | apache-2.0 |
Headmast/openfights | MoneyHelper/Library/BaseClasses/Network/ServerPart/ServerRequests/ServerRequest.swift | 1 | 9321 | //
// Serverrequest.swift
// MoneyHelper
//
// Created by Kirill Klebanov on 16/09/2017.
// Copyright © 2017 Surf. All rights reserved.
//
import Foundation
import Alamofire
@objc
class ServerRequest: NSObject {
typealias PerformedRequest = (DataRequest) -> Void
typealias Completion = (ServerResponse) ->... | apache-2.0 |
shorlander/firefox-ios | UITests/NavigationDelegateTests.swift | 6 | 1447 | /* 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 EarlGrey
@testable import Client
// WKWebView's WKNavigationDelegate is used for custom ... | mpl-2.0 |
3lvis/Fragments | Source/Tailor.swift | 2 | 1242 | import UIKit
class Tailor : UIViewController {
init() {
super.init(nibName: nil, bundle: nil)
}
required init(coder aDecoder: NSCoder) {
fatalError("Tailor doesn't support Storyboards or Interface Builder")
}
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .w... | mit |
christiankm/FinanceKit | Sources/FinanceKit/ExchangeRate.swift | 1 | 496 | //
// FinanceKit
// Copyright © 2022 Christian Mitteldorf. All rights reserved.
// MIT license, see LICENSE file for details.
//
import Foundation
/// Exchange rate is used to specify the relationship between the price of one currency to another, or other forms of trades.
///
/// The exchange rate of Danish Kroner... | mit |
sotownsend/flok-apple | Pod/Classes/Drivers/Ping.swift | 1 | 467 | @objc class FlokPingModule : FlokModule {
override var exports: [String] {
return ["ping:", "ping1:", "ping2:"]
}
func ping(args: [AnyObject]) {
engine.intDispatch("pong", args: nil)
}
func ping1(args: [AnyObject]) {
engine.intDispatch("pong1", args: args)
}
... | mit |
jtbandes/swift-compiler-crashes | crashes-fuzzing/27166-swift-typebase-isspecialized.swift | 4 | 271 | // 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 A{
protocol a
protocol a{{}}struct B<T{func A{
class B{
struct d{
enum B<T:a
{
}}
class d<f:T.a
| mit |
digdoritos/RestfulAPI-Example | RestfulAPI-Example/MemberViewController.swift | 1 | 2502 | //
// MemberViewController.swift
// RestfulAPI-Example
//
// Created by Chun-Tang Wang on 27/03/2017.
// Copyright © 2017 Chun-Tang Wang. All rights reserved.
//
import UIKit
import Alamofire
import SwiftyJSON
import KeychainAccess
class MemberViewController: UIViewController {
@IBOutlet weak var tableVi... | mit |
mrdepth/Neocom | Legacy/Neocom/Neocom/WalletJournalPagePresenter.swift | 2 | 2414 | //
// WalletJournalPagePresenter.swift
// Neocom
//
// Created by Artem Shimanski on 11/12/18.
// Copyright © 2018 Artem Shimanski. All rights reserved.
//
import Foundation
import Futures
import CloudData
import TreeController
import EVEAPI
class WalletJournalPagePresenter: TreePresenter {
typealias View = Wall... | lgpl-2.1 |
epaga/PenguinMath | PenguinRaceTests/PenguinRaceTests.swift | 1 | 966 | //
// PenguinRaceTests.swift
// PenguinRaceTests
//
// Created by John Goering on 21/06/15.
// Copyright © 2015 John Goering. All rights reserved.
//
import XCTest
class PenguinRaceTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called befo... | apache-2.0 |
wyszo/TWCommonLib | TWCommonLib/TWCommonLib/StringExtensions.swift | 1 | 491 | import Foundation
public extension String {
/**
Replaces multiple whitespaces in string with just one
*/
var condensedWhitespace: String {
let components = self.components(separatedBy: CharacterSet.whitespacesAndNewlines)
return components.filter { !$0.isEmpty }.joined(separator: " ")... | mit |
LeLuckyVint/MessageKit | Sources/Views/MessageInputBar.swift | 1 | 18102 | /*
MIT License
Copyright (c) 2017 MessageKit
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, publ... | mit |
MoZhouqi/KMNavigationBarTransition | Example/SettingsViewController.swift | 1 | 2086 | //
// SettingsViewController.swift
// KMNavigationBarTransition
//
// Created by Zhouqi Mo on 1/1/16.
// Copyright © 2017 Zhouqi Mo. All rights reserved.
//
import UIKit
class SettingsViewController: UITableViewController {
// MARK: Constants
struct Constants {
struct TableViewCell {
... | mit |
Ezfen/iOS.Apprentice.1-4 | MyLocations/MyLocations/LocationsViewController.swift | 1 | 7656 | //
// LocationsViewController.swift
// MyLocations
//
// Created by ezfen on 16/8/22.
// Copyright © 2016年 Ezfen Inc. All rights reserved.
//
import UIKit
import CoreData
import CoreLocation
class LocationsViewController: UITableViewController {
var managedObjectContext: NSManagedObjectContext!
var l... | mit |
chenchangqing/learniosRAC | FRP-Swift/FRP-Swift/ViewModels/FRPPhotoViewModel.swift | 1 | 2601 | //
// FRPPhotoViewModel.swift
// FRP-Swift
//
// Created by green on 15/9/4.
// Copyright (c) 2015年 green. All rights reserved.
//
import UIKit
import ReactiveViewModel
import ReactiveCocoa
class FRPPhotoViewModel: ImageViewModel {
let photoModelDataSourceProtocol = FRPPhotoModelDataSource.shareInstance(... | gpl-2.0 |
buddies2705/eddystone | tools/ios-eddystone-scanner-sample/EddystoneScannerSampleSwift/ViewController.swift | 13 | 1297 | // Copyright 2015 Google Inc. 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 License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable ... | apache-2.0 |
br1sk/brisk-ios | Brisk iOS/App/StatusDisplay.swift | 1 | 1102 | import UIKit
import SVProgressHUD
protocol StatusDisplay {
func showLoading()
func showSuccess(message: String, autoDismissAfter delay: TimeInterval)
func showError(title: String?, message: String, dismissButtonTitle: String?, completion: (() -> Void)?)
func hideLoading()
}
extension StatusDisplay where Self: UIV... | mit |
luckymore0520/leetcode | Multiply Strings.playground/Contents.swift | 1 | 2895 | //: Playground - noun: a place where people can play
import UIKit
//Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2.
//
//Note:
//
//The length of both num1 and num2 is < 110.
//Both num1 and num2 contains only digits 0-9.
//Both num1 and num2 does not contain... | mit |
AdaptiveMe/adaptive-arp-api-lib-darwin | Pod/Classes/Sources.Api/SecurityResultCallbackImpl.swift | 1 | 4638 | /**
--| ADAPTIVE RUNTIME PLATFORM |----------------------------------------------------------------------------------------
(C) Copyright 2013-2015 Carlos Lozano Diez t/a Adaptive.me <http://adaptive.me>.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance wi... | apache-2.0 |
huangboju/Moots | Examples/UITextField_Demo/TextField/ViewController.swift | 1 | 4146 | //
// ViewController.swift
// TextField
//
// Created by 伯驹 黄 on 2016/10/12.
// Copyright © 2016年 伯驹 黄. All rights reserved.
//
import UIKit
class ViewController: UIViewController, UITextFieldDelegate {
fileprivate lazy var textField: UITextField = {
let textField = UITextField(frame: CGRect(x: 100, ... | mit |
charmaex/photo-table | PhotoTable/Pics.swift | 1 | 1175 | //
// Pics.swift
// PhotoTable
//
// Created by Jan Dammshäuser on 14.02.16.
// Copyright © 2016 Jan Dammshäuser. All rights reserved.
//
import Foundation
import UIKit
class Pics: NSObject, NSCoding {
private var _img: String!
private var _title: String!
private var _desc: String!
var img: S... | gpl-3.0 |
huangboju/Moots | Examples/UIScrollViewDemo/UIScrollViewDemo/Controllers/DiffableDatasource/TableDiffableVC.swift | 1 | 4423 | //
// TableDiffable.swift
// UIScrollViewDemo
//
// Created by 黄伯驹 on 2022/6/19.
// Copyright © 2022 伯驹 黄. All rights reserved.
//
import Foundation
enum ContactSection: CaseIterable {
case favourite
case all
}
// MARK:- Item model
struct Contact: Hashable {
var id: Int?
var firstName: String?
... | mit |
Valbrand/tibei | Sources/Tibei/client/TibeiServiceBrowser.swift | 1 | 1802 | //
// GameControllerClient.swift
// connectivityTest
//
// Created by Daniel de Jesus Oliveira on 15/11/2016.
// Copyright © 2016 Daniel de Jesus Oliveira. All rights reserved.
//
import UIKit
class TibeiServiceBrowser: NSObject {
let serviceBrowser: NetServiceBrowser = NetServiceBrowser()
var inputS... | mit |
AvdLee/ALReactiveCocoaExtension | Pod/Classes/SignalProducer+Helper.swift | 1 | 2691 | //
// SignalProducer+Helper.swift
// Pods
//
// Created by Antoine van der Lee on 15/01/16.
//
//
import Foundation
import ReactiveSwift
import enum Result.NoError
public enum ALCastError : Error {
case couldNotCastToType
}
private extension SignalProducerProtocol {
func mapToType<U>() -> SignalProducer<... | mit |
mightydeveloper/swift | validation-test/compiler_crashers/26226-swift-constraints-constraintsystem-assignfixedtype.swift | 9 | 281 | // RUN: not --crash %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
struct B{let n=[]struct Q<T where g:a{struct c{{}func a{(a
| apache-2.0 |
mmrmmlrr/ExamMaster | ExamMaster/Exam Creation Flow/Options Picker/ExamOptionsPickerViewController.swift | 1 | 1712 | //
// ExamOptionsPickerViewController.swift
// ExamMaster
//
// Created by aleksey on 28.02.16.
// Copyright © 2016 aleksey chernish. All rights reserved.
//
import Foundation
import ModelsTreeKit
class ExamOptionsPickerViewController: UIViewController, ModelApplicable {
@IBOutlet
private weak var question... | mit |
niunaruto/DeDaoAppSwift | testSwift/Pods/RxCocoa/RxCocoa/iOS/UIDatePicker+Rx.swift | 33 | 1095 | //
// UIDatePicker+Rx.swift
// RxCocoa
//
// Created by Daniel Tartaglia on 5/31/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
#if os(iOS)
import RxSwift
import UIKit
extension Reactive where Base: UIDatePicker {
/// Reactive wrapper for `date` property.
public var date: ControlPropert... | mit |
u10int/Kinetic | Pod/Classes/Easing.swift | 1 | 10208 | //
// Easing.swift
// Kinetic
//
// Created by Nicholas Shipes on 12/18/15.
// Copyright © 2015 Urban10 Interactive, LLC. All rights reserved.
//
import UIKit
public protocol FloatingPointMath: FloatingPoint {
var sine: Self { get }
var cosine: Self { get }
var powerOfTwo: Self { get }
}
extension Float: Floa... | mit |
wistia/WistiaKit | Example/Tests/WistiaAPIUploadTests.swift | 1 | 1692 | //
// WistiaAPIUploadTests.swift
// WistiaKit
//
// Created by Daniel Spinosa on 11/18/16.
// Copyright © 2016 CocoaPods. All rights reserved.
//
import XCTest
import WistiaKitCore
import WistiaKit
class WistiaAPIUploadTests: XCTestCase {
let unlimitedAPI = WistiaAPI(apiToken:"1511ac67c0213610d9370ef12349c6a... | mit |
optimizely/objective-c-sdk | Pods/Mixpanel-swift/Mixpanel/Flush.swift | 1 | 6864 | //
// Flush.swift
// Mixpanel
//
// Created by Yarden Eitan on 6/3/16.
// Copyright © 2016 Mixpanel. All rights reserved.
//
import Foundation
protocol FlushDelegate {
func flush(completion: (() -> Void)?)
func updateQueue(_ queue: Queue, type: FlushType)
#if os(iOS)
func updateNetworkActivityIndi... | apache-2.0 |
hdoria/HDNTextField | Example/HDNTextField/ViewController.swift | 1 | 510 | //
// ViewController.swift
// HDNTextField
//
// Created by Hugo Doria on 07/08/2016.
// Copyright (c) 2016 Hugo Doria. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the ... | mit |
sstanic/Shopfred | Shopfred/Shopfred/Model/ShoppingSpace+CoreDataClass.swift | 1 | 684 | //
// ShoppingSpace+CoreDataClass.swift
// Shopfred
//
// Created by Sascha Stanic on 6/24/17.
// Copyright © 2017 Sascha Stanic. All rights reserved.
//
import Foundation
import CoreData
@objc(ShoppingSpace)
public class ShoppingSpace: NSManagedObject {
convenience init(name: String, context: NSManagedObjec... | mit |
brentdax/swift | test/decl/var/behaviors.swift | 10 | 8683 | // RUN: %target-typecheck-verify-swift -enable-experimental-property-behaviors -module-name Main
// REQUIRES: property_behavior_value_substitution
protocol behavior {
associatedtype Value
}
extension behavior {
var value: Value { fatalError("") }
}
struct NotABehavior {}
var test1: Int __behavior behavior
var te... | apache-2.0 |
onebytegone/actionable | ActionableTests/ActionableTests.swift | 1 | 1134 | //
// ActionableTests.swift
// ActionableTests
//
// Created by Ethan Smith on 5/18/15.
// Copyright (c) 2015 Ethan Smith. All rights reserved.
//
import Foundation
import XCTest
class ActionableTests: XCTestCase {
func testLifecycle() {
var calledCount = 0;
let actionable = Actionable()
le... | mit |
tardieu/swift | validation-test/compiler_crashers_fixed/27693-swift-constraints-constraintsystem-opengeneric.swift | 65 | 492 | // 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 |
apple/swift-package-manager | Fixtures/Miscellaneous/Plugins/PluginUsingLocalAndRemoteTool/MyPlugin/Plugins/MyPlugin/plugin.swift | 2 | 623 | import PackagePlugin
import Foundation
@main
struct MyPlugin: CommandPlugin {
func performCommand(context: PluginContext, arguments: [String]) async throws {
for name in ["RemoteTool", "LocalTool", "ImpliedLocalTool"] {
let tool = try context.tool(named: name)
print("tool path is \(... | apache-2.0 |
NordicSemiconductor/IOS-Pods-DFU-Library | iOSDFULibrary/Classes/Utilities/Streams/DFUStreamBin.swift | 1 | 3353 | /*
* Copyright (c) 2019, Nordic Semiconductor
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of condit... | bsd-3-clause |
ingresse/ios-sdk | IngresseSDK/Services/UserTickets/Responses/UserWalletTicket.swift | 1 | 1738 | //
// Copyright © 2020 Ingresse. All rights reserved.
//
public struct UserWalletTicket: Decodable {
public let id: Int
public let guestTypeId: Int?
public let ticketTypeId: Int?
public let itemType: String?
public let price: Double?
public let tax: Double?
public let sessions: Self.Sessio... | mit |
fitpay/fitpay-ios-sdk | FitpaySDK/PaymentDevice/EventListeners/FitpayBlockEventListener.swift | 1 | 762 | import Foundation
open class FitpayBlockEventListener {
public typealias BlockCompletion = (_ event: FitpayEvent) -> Void
var blockCompletion: BlockCompletion
var completionQueue: DispatchQueue
private var isValid = true
public init(completion: @escaping BlockCompletion, queue: Disp... | mit |
cubixlabs/GIST-Framework | GISTFramework/Classes/GISTCore/GISTUtility.swift | 1 | 12524 | //
// GISTUtility.swift
// GISTFramework
//
// Created by Shoaib Abdul on 07/09/2016.
// Copyright © 2016 Social Cubix. All rights reserved.
//
import UIKit
import PhoneNumberKit
/// Class for Utility methods.
public class GISTUtility: NSObject {
//MARK: - Properties
@nonobjc static var bundle:B... | agpl-3.0 |
jindulys/HackerRankSolutions | Sources/ZenefitsContest.swift | 1 | 14383 | //
// ZenefitsContest.swift
// HRSwift
//
// Created by yansong li on 2015-11-20.
// Copyright © 2015 yansong li. All rights reserved.
//
import Foundation
// This one scored 65.0, due to time out
// Need to optimize this solution
// Question 1
class bobCandyShop {
let cashes = [1, 2, 5, 10, 20, 50, 100]
... | mit |
Incipia/Goalie | PaintCode/GoalieSpeechBubbleKit.swift | 1 | 5420 | //
// File.swift
// Goalie
//
// Created by Gregory Klein on 1/7/16.
// Copyright © 2016 Incipia. All rights reserved.
//
import Foundation
struct GoalieSpeechBubbleKit
{
static func drawBubbleWithColor(_ color: UIColor, tailDirection: BubbleTailDirection, inFrame frame: CGRect)
{
switch tailDirection... | apache-2.0 |
dehesa/Metal | books/05 - Lighting/Sources/iOS/MasterController.swift | 1 | 384 | import UIKit
import MetalKit
final class MasterController: UIViewController {
private var _renderer: TeapotRenderer!
override var prefersStatusBarHidden: Bool {
true
}
override func viewDidLoad() {
super.viewDidLoad()
let metalView = self.view as! MTKView
self._renderer = try! TeapotRenderer... | mit |
uasys/swift | validation-test/compiler_crashers_2_fixed/0002-rdar19792768.swift | 38 | 411 | // RUN: %target-swift-frontend %s -emit-silgen
// rdar://problem/19792768
public func foo<
Expected : Sequence,
Actual : Sequence,
T : Comparable
where
Expected.Iterator.Element == Actual.Iterator.Element,
Expected.Iterator.Element == (T, T)
>(_ expected: Expected, _ actual: Actual) {}
func f() {
foo(
... | apache-2.0 |
CoderLala/DouYZBTest | DouYZB/DouYZB/Classes/Tools/Extension/NSDate-Extension.swift | 1 | 369 | //
// NSDate-Extension.swift
// DouYZB
//
// Created by 黄金英 on 17/2/7.
// Copyright © 2017年 黄金英. All rights reserved.
//
import Foundation
extension Date{
static func getCurrentTime() -> String {
let nowDate = Date()
let timeInteval = Int(nowDate.timeIntervalSince1970)
... | mit |
apple/swift | validation-test/compiler_crashers_fixed/26028-swift-parser-skipsingle.swift | 65 | 573 | // 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 |
apple/swift | test/SourceKit/CodeFormat/indent-trailing/trailing-func.swift | 22 | 148 | func foo() -> Int {
// RUN: %sourcekitd-test -req=format -line=2 -length=1 %s | %FileCheck --strict-whitespace %s
// CHECK: key.sourcetext: " "
| apache-2.0 |
hooman/swift | test/Distributed/Runtime/distributed_actor_identity.swift | 1 | 1463 | // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -Xfrontend -enable-experimental-distributed -parse-as-library)
// REQUIRES: executable_test
// REQUIRES: concurrency
// REQUIRES: distributed
// rdar://76038845
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime
import Std... | apache-2.0 |
dietcoke27/TableVector | Example/TableVector/ViewController.swift | 1 | 11983 | //
// ViewController.swift
// TableVector
//
// Created by Cole Kurkowski on 2/3/16.
// Copyright © 2016 Cole Kurkowski. All rights reserved.
//
import UIKit
import TableVector
final class ViewController: UITableViewController, TableVectorDelegate {
typealias VectorType = TableVector<Container>
var tableV... | mit |
krzysztofzablocki/Sourcery | Sourcery/Utils/FolderWatcher.swift | 1 | 4706 | //
// FolderWatcher.swift
// Sourcery
//
// Created by Krzysztof Zabłocki on 24/12/2016.
// Copyright © 2016 Pixle. All rights reserved.
//
import Foundation
public enum FolderWatcher {
struct Event {
let path: String
let flags: Flag
struct Flag: OptionSet {
let rawValue:... | mit |
powerytg/Accented | Accented/UI/Gallery/UserGalleryListViewController.swift | 1 | 4531 | //
// UserGalleryListViewController.swift
// Accented
//
// User gallery list page
//
// Created by You, Tiangong on 9/1/17.
// Copyright © 2017 Tiangong You. All rights reserved.
//
import UIKit
class UserGalleryListViewController: UIViewController, InfiniteLoadingViewControllerDelegate, MenuDelegate {
... | mit |
shuoli84/RxSwift | RxExample/RxExample/Examples/PartialUpdates/PartialUpdatesViewController.swift | 2 | 7831 | //
// PartialUpdatesViewController.swift
// RxExample
//
// Created by Krunoslav Zaher on 6/8/15.
// Copyright (c) 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
import UIKit
import RxSwift
import RxCocoa
import CoreData
let generateCustomSize = true
let runAutomatically = false
let useAnimatedUp... | mit |
AceWangLei/BYWeiBo | BYWeiBo/UILabel+Extension.swift | 1 | 359 | //
// UILabel+Extension.swift
// BYWeiBo
//
// Created by wanglei on 16/1/26.
// Copyright © 2016年 lit. All rights reserved.
//
import UIKit
extension UILabel {
convenience init(textColor: UIColor, fontSize: CGFloat) {
self.init()
self.textColor = textColor
self.font = UIFont.syst... | apache-2.0 |
edopelawi/CascadingTableDelegate | Example/CascadingTableDelegate/RowTableDelegates/DestinationReviewUserRowDelegate.swift | 1 | 2072 | //
// DestinationReviewUserRowDelegate.swift
// CascadingTableDelegate
//
// Created by Ricardo Pramana Suranta on 11/2/16.
// Copyright © 2016 Ricardo Pramana Suranta. All rights reserved.
//
import Foundation
import CascadingTableDelegate
struct DestinationReviewUserRowViewModel {
let userName: String
let use... | mit |
aryaxt/SwiftInjection | SwiftInjectionExample/SwiftInjectionExample/AppDelegate.swift | 1 | 2242 | //
// AppDelegate.swift
// SwiftInjectionExample
//
// Created by Aryan Ghassemi on 4/23/16.
// Copyright © 2016 Aryan Ghassemi. All rights reserved.
//
import UIKit
import SwiftInjection
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
override init() {
super... | mit |
WhisperSystems/Signal-iOS | SignalServiceKit/src/Util/SwiftSingletons.swift | 1 | 958 | //
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
import Foundation
public class SwiftSingletons: NSObject {
public static let shared = SwiftSingletons()
private var classSet = Set<String>()
private override init() {
super.init()
}
public func register(_ singleton:... | gpl-3.0 |
djwbrown/swift | stdlib/public/SDK/Foundation/Codable.swift | 2 | 2897 | //===----------------------------------------------------------------------===//
//
// 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 |
MillmanY/MMPlayerView | MMPlayerView/Classes/Item/SRTInfo.swift | 1 | 555 | //
// SRTInfo.swift
// MMPlayerView
//
// Created by Millman on 2019/12/13.
//
import Foundation
public struct SRTInfo: Equatable {
public let index: Int
public let timeRange: ClosedRange<TimeInterval>
public let text: String
static func emptyInfo() -> Self {
return SRTInfo(index: -1, t... | mit |
nathawes/swift | test/SymbolGraph/Symbols/Mixins/Availability/Inherited/MessageFilled.swift | 20 | 1314 | // RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -module-name MessageFilled -emit-module -emit-module-path %t/
// RUN: %target-swift-symbolgraph-extract -module-name MessageFilled -I %t -pretty-print -output-dir %t
// RUN: %FileCheck %s --input-file %t/MessageFilled.symbols.json
// RUN: %FileCheck %s --input... | apache-2.0 |
roambotics/swift | test/Interop/SwiftToCxx/expose-attr/expose-swift-decls-to-cxx.swift | 2 | 4318 | // RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %s -typecheck -module-name Expose -enable-experimental-cxx-interop -clang-header-expose-decls=has-expose-attr -emit-clang-header-path %t/expose.h
// RUN: %FileCheck %s < %t/expose.h
// RUN: %check-interop-cxx-header-in-clang(%t/expose.h -Wno-error=unused-func... | apache-2.0 |
stephencelis/SQLite.swift | Sources/SQLite/Typed/CustomFunctions.swift | 1 | 8237 | //
// SQLite.swift
// https://github.com/stephencelis/SQLite.swift
// Copyright © 2014-2015 Stephen Celis.
//
// 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... | mit |
wavecos/curso_ios_3 | Playgrounds/Condicionales.playground/section-1.swift | 1 | 537 | // Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
var saludo = "Hola Mundo"
let edadJuan = 21
let edadAna = 34
let edadMaria = 1
if edadJuan > 20 {
println("Juan es Mayor de edad")
} else {
println("Debe ir a dormir")
}
if edadMaria > edadAna {
println("Mari... | apache-2.0 |
motoom/ios-apps | TraceMaze/TraceMaze/Maze.swift | 1 | 3779 |
import Foundation
/*
struct PhysicsCategory {
static let None : UInt32 = 0
static let All : UInt32 = UInt32.max
static let Monster : UInt32 = 0b1 // 1
static let Projectile: UInt32 = 0b10 // 2
}
*/
let WALLNORTH = 1 // Walls
let WALLEAST = 2
let WALLSOUTH = 4
let WALLWEST = 8
let VIS... | mit |
godlift/XWSwiftRefresh | XWSwiftRefresh/Helper/UIViewExtension-XW.swift | 2 | 1703 | //
// UIViewExtension-XW.swift
// 01-drawingBoard
//
// Created by Xiong Wei on 15/8/8.
// Copyright © 2015年 Xiong Wei. All rights reserved.
// 增加frame 快速访问计算属性
import UIKit
extension UIView {
var xw_x:CGFloat {
get{
//写下面这句不会进入 死循环
// let a = self.xw_x
return s... | mit |
richardpiazza/XCServerCoreData | Sources/IntegrationIssues.swift | 1 | 8246 | import Foundation
import CoreData
import CodeQuickKit
import XCServerAPI
public class IntegrationIssues: NSManagedObject {
public convenience init?(managedObjectContext: NSManagedObjectContext, integration: Integration) {
self.init(managedObjectContext: managedObjectContext)
self.integration =... | mit |
CoderYLiu/30DaysOfSwift | Project 07 - PullToRefresh/PullToRefresh/ViewController.swift | 1 | 3070 | //
// ViewController.swift
// PullToRefresh <https://github.com/DeveloperLY/30DaysOfSwift>
//
// Created by Liu Y on 16/4/13.
// Copyright © 2016年 DeveloperLY. All rights reserved.
//
// This source code is licensed under the MIT-style license found in the
// LICENSE file in the root directory of this source tree... | mit |
kstaring/swift | validation-test/compiler_crashers_fixed/01832-swift-lexer-leximpl.swift | 11 | 563 | // 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 |
kstaring/swift | stdlib/public/SDK/AppKit/NSError.swift | 3 | 10044 | //===----------------------------------------------------------------------===//
//
// 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 |
mleiv/MEGameTracker | MEGameTracker/Views/Shepard Tab/Shepard Split View/ShepardSplitViewController.swift | 1 | 762 | //
// ShepardSplitViewController.swift
// MEGameTracker
//
// Created by Emily Ivie on 2/22/16.
// Copyright © 2016 Emily Ivie. All rights reserved.
//
import UIKit
public final class ShepardSplitViewController: UIViewController, MESplitViewController {
@IBOutlet weak public var mainPlaceholder: IBIncludedSubTh... | mit |
uber/RIBs | ios/RIBs/Classes/PresentableInteractor.swift | 1 | 1283 | //
// Copyright (c) 2017. Uber Technologies
//
// 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 |
jengelsma/cis657-summer2016-class-demos | Lecture04-StopWatch-Demo/Lecture04-StopWatch-DemoTests/Lecture04_StopWatch_DemoTests.swift | 1 | 1054 | //
// Lecture04_StopWatch_DemoTests.swift
// Lecture04-StopWatch-DemoTests
//
// Created by Jonathan Engelsma on 5/19/16.
// Copyright © 2016 Jonathan Engelsma. All rights reserved.
//
import XCTest
@testable import Lecture04_StopWatch_Demo
class Lecture04_StopWatch_DemoTests: XCTestCase {
override func ... | mit |
headione/criticalmaps-ios | CriticalMapsKit/Tests/SettingsFeatureTests/SettingsViewSnapshotTests.swift | 1 | 576 | import SettingsFeature
import TestHelper
import XCTest
class SettingsViewSnapshotTests: XCTestCase {
func test_settingsView_light() {
let settingsView = SettingsView(
store: .init(
initialState: .init(),
reducer: settingsReducer,
environment: SettingsEnvironment(
uiApplica... | mit |
pluralsight/PSOperations | PSOperationsAppForTestsTests/PSOperationsAppForTestsTests.swift | 1 | 1493 | import PSOperations
import XCTest
class PSOperationsAppForTestsTests: XCTestCase {
/*
This test only exhibits the problem when run in an app container, thus, it is part of a test suite that is
part of an application. When you have many (less than the tested amount) operations that have dependencies
... | apache-2.0 |
MaddTheSane/WWDC | WWDC/DownloadListProgressCellView.swift | 10 | 915 | //
// DownloadListProgressCellView.swift
// WWDC
//
// Created by Ruslan Alikhamov on 26/04/15.
// Copyright (c) 2015 Guilherme Rambo. All rights reserved.
//
import Cocoa
class DownloadListCellView: NSTableCellView {
weak var item: AnyObject?
var cancelBlock: ((AnyObject?, DownloadListCellView) -> Void)?
va... | bsd-2-clause |
Fidetro/SwiftFFDB | Sources/FMDBConnection.swift | 1 | 5593 | //
// FMDBConnection.swift
// Swift-FFDB
//
// Created by Fidetro on 2017/10/14.
// Copyright © 2017年 Fidetro. All rights reserved.
//
import FMDB
public struct FMDBConnection:FFDBConnection {
public typealias T = FMDatabase
public static let share = FMDBConnection()
public static v... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.