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 |
|---|---|---|---|---|---|
tkremenek/swift | validation-test/compiler_crashers_2_fixed/0151-rdar-39040593.swift | 39 | 457 | // RUN: %target-typecheck-verify-swift
class A {
func foo() {
class B {
let question: String = "ultimate question"
let answer: Int? = 42
lazy var bar: () -> String = { [weak self] in
guard let self = self else {
return "Unknown"
}
if let answer = self.answer ... | apache-2.0 |
tkremenek/swift | validation-test/compiler_crashers_fixed/25444-swift-archetypebuilder-finalize.swift | 65 | 467 | // 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 |
joerocca/GitHawk | Classes/Bookmark v2/BookmarkHeaderSectionController.swift | 1 | 1434 | //
// BookmarkHeaderSectionController.swift
// Freetime
//
// Created by Hesham Salman on 11/5/17.
// Copyright © 2017 Ryan Nystrom. All rights reserved.
//
import IGListKit
protocol BookmarkHeaderSectionControllerDelegate: class {
func didTapClear(sectionController: BookmarkHeaderSectionController)
}
final ... | mit |
mrr1vfe/FBLA | customCellTableViewCell.swift | 1 | 2010 | //
// customCellTableViewCell.swift
// FBLA
//
// Created by Yi Chen on 15/11/8.
// Copyright © 2015年 Yi Chen. All rights reserved.
//
import UIKit
import Parse
import ParseUI
class customCellTableViewCell: UITableViewCell {
@IBOutlet weak var userAvatar: PFImageView!
@IBOutlet weak var username: UI... | mit |
radex/swift-compiler-crashes | crashes-fuzzing/22090-swift-constraints-constraintgraph-addconstraint.swift | 11 | 270 | // 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 d {
class a
{
{
}
}
class a<T where B : C {
}
var d = 0 as a
struct D {
class A {
protocol c : a
| mit |
radex/swift-compiler-crashes | crashes-fuzzing/21328-swift-removeshadoweddecls.swift | 1 | 263 | // 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 {
var _ = a
k {
{
}
{
}
}
var a
var b {
struct A {
class A<d where B : A {
let : A.g
| mit |
radex/swift-compiler-crashes | crashes-fuzzing/22604-swift-constraints-constraintsystem-simplifyfixconstraint.swift | 11 | 216 | // 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 d<T where g : a
func < {
d
}
assert( ) {
| mit |
ProjectDent/ARKit-CoreLocation | Sources/ARKit-CoreLocation/Location Manager/SceneLocationEstimate.swift | 1 | 458 | //
// SceneLocationEstimate.swift
// ARKit+CoreLocation
//
// Created by Andrew Hart on 03/07/2017.
// Copyright © 2017 Project Dent. All rights reserved.
//
import Foundation
import CoreLocation
import SceneKit
public class SceneLocationEstimate {
public let location: CLLocation
public let position: SCNV... | mit |
acort3255/Emby.ApiClient.Swift | Emby.ApiClient/model/registration/RegistrationInfo.swift | 1 | 1269 | //
// RegistrationInfo.swift
// Emby.ApiClient
//
// Created by Vedran Ozir on 09/10/15.
// Copyright © 2015 Vedran Ozir. All rights reserved.
//
import Foundation
public struct RegistrationInfo: Codable
{
let name: String
let expirationDate: Date
let trial: Bool
let registered: Bool
// ... | mit |
mariopavlovic/advent-of-code | 2015/advent-of-codeTests/Day7Specs.swift | 1 | 6420 | import Quick
import Nimble
@testable import advent_of_code
class Day7Specs: QuickSpec {
override func spec() {
var sut: Day7!
beforeEach {
sut = Day7()
}
describe("Given Day7 task") {
describe("when transfering input to instructions (doma... | mit |
937447974/YJCocoa | YJCocoa/Classes/AppFrameworks/UIKit/TableView/YJUITableViewHeaderFooterView.swift | 1 | 1775 | //
// YJUITableViewHeaderFooterView.swift
// YJCocoa
//
// HomePage:https://github.com/937447974/YJCocoa
// YJ技术支持群:557445088
//
// Created by 阳君 on 2019/5/23.
// Copyright © 2016-现在 YJCocoa. All rights reserved.
//
import UIKit
@objc
extension UITableViewHeaderFooterView {
/// 获取 YJUITableCellObject
... | mit |
Sharelink/Bahamut | Bahamut/UserGuideAddFriendsController.swift | 1 | 737 | //
// UserGuideAddFriendsController.swift
// Sharelink
//
// Created by AlexChow on 16/1/29.
// Copyright © 2016年 GStudio. All rights reserved.
//
import Foundation
import UIKit
class UserGuideAddFriendsController: UIViewController
{
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(an... | mit |
GYLibrary/A_Y_T | GYVideo/GYVideo/VideoPlayer/MediaManager.swift | 1 | 2456 | //
// MediaManager.swift
// EZPlayerExample
//
// Created by yangjun zhu on 2016/12/28.
// Copyright © 2016年 yangjun zhu. All rights reserved.
//
import UIKit
import EZPlayer
class MediaManager {
var player: EZPlayer?
var mediaItem: MediaItem?
var embeddedContentView: UIView?
static let sharedI... | mit |
wesj/Project105 | FirefoxPasswords/ActionRequestHandler.swift | 1 | 4079 | //
// ActionRequestHandler.swift
// FirefoxPasswords
//
// Created by Wes Johnston on 10/17/14.
// Copyright (c) 2014 Wes Johnston. All rights reserved.
//
import UIKit
import MobileCoreServices
class ActionRequestHandler: NSObject, NSExtensionRequestHandling {
var extensionContext: NSExtensionContext?
... | mpl-2.0 |
LOTUM/EventHub | EventHubTests/EventHubTests.swift | 1 | 6877 | import XCTest
@testable import LotumEventHub
class EventHubTest: XCTestCase {
func testEmitEvent() {
let e = expectation(description: "hub")
let hub = EventHub<String, Void>()
hub.once("test") {
e.fulfill()
}
hub.emit("test")
waitF... | apache-2.0 |
wenghengcong/Coderpursue | BeeFun/BeeFun/ToolKit/JSToolKit/JSFoundation/JSUtilis.swift | 1 | 153 | //
// JSUtilis.swift
// BeeFun
//
// Created by WengHengcong on 05/09/2017.
// Copyright © 2017 JungleSong. All rights reserved.
//
import UIKit
| mit |
bignerdranch/DeferredTCPSocket | Examples/ChatServer/ChatServerTests/ChatServerTests.swift | 1 | 915 | //
// ChatServerTests.swift
// ChatServerTests
//
// Created by John Gallagher on 9/12/14.
// Copyright (c) 2014 Big Nerd Ranch. All rights reserved.
//
import Cocoa
import XCTest
class ChatServerTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method... | mit |
Asura19/My30DaysOfSwift | BasicAnimation/BasicAnimation/ScaleViewController.swift | 1 | 760 | //
// ScaleViewController.swift
// BasicAnimation
//
// Created by Phoenix on 2017/4/24.
// Copyright © 2017年 Phoenix. All rights reserved.
//
import UIKit
class ScaleViewController: UIViewController {
@IBOutlet weak var imageView: UIImageView!
override func viewDidLoad() {
super.viewDidLoad... | mit |
moltin/ios-sdk | Tests/moltin iOS Tests/CartTests.swift | 1 | 9568 | //
// CartTests.swift
// moltin iOS
//
// Created by Craig Tweedy on 26/02/2018.
//
import XCTest
@testable
import moltin
class CartTests: XCTestCase {
func testGettingANewCart() {
let (_, request) = MockFactory.mockedCartRequest(withJSON: MockCartDataFactory.cartData)
let expectationToFulfi... | mit |
zhxnlai/wwdc | Zhixuan Lai/Zhixuan Lai/ZLSectionHeaderView.swift | 1 | 1654 | //
// ZLCollectionViewHeaderView.swift
// Zhixuan Lai
//
// Created by Zhixuan Lai on 4/25/15.
// Copyright (c) 2015 Zhixuan Lai. All rights reserved.
//
import UIKit
import TTTAttributedLabel
class ZLSectionHeaderView: UICollectionReusableView {
static let labelInset = UIEdgeInsets(top: 0, left: 10, bot... | mit |
inket/stts | stts/Services/Super/CachetService.swift | 1 | 2381 | //
// CachetService.swift
// stts
//
import Foundation
typealias CachetService = BaseCachetService & RequiredServiceProperties
class BaseCachetService: BaseService {
private enum ComponentStatus: Int, ComparableStatus {
// https://docs.cachethq.io/docs/component-statuses
case operational = 1
... | mit |
j-pk/grub-api | Sources/App/Models/User.swift | 1 | 5524 | //
// User.swift
// GrubAPI
//
// Created by Jameson Kirby on 2/8/17.
//
//
import Vapor
import Auth
import Turnstile
import VaporJWT
import Foundation
final class User: Model {
var id: Node?
var exists: Bool = false
var username: String
var password: String
var token: String?
in... | mit |
wordpress-mobile/WordPress-iOS | WordPress/Classes/Services/ReaderTopicService+FollowedInterests.swift | 1 | 4906 | import Foundation
// MARK: - ReaderFollowedInterestsService
/// Protocol representing a service that retrieves the users followed interests/tags
protocol ReaderFollowedInterestsService: AnyObject {
/// Fetches the users locally followed interests
/// - Parameter completion: Called after a fetch, will return n... | gpl-2.0 |
petester42/PMCoreDataStack | Example/Tests/ExampleTests.swift | 1 | 916 | //
// ExampleTests.swift
// ExampleTests
//
// Created by Pierre-Marc Airoldi on 2014-12-30.
// Copyright (c) 2014 Pete App Designs. All rights reserved.
//
import UIKit
import XCTest
class ExampleTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This metho... | mit |
bmichotte/HSTracker | HSTracker/UIs/Preferences/OpponentTrackersPreferences.swift | 1 | 4967 | //
// TrackersPreferences.swift
// HSTracker
//
// Created by Benjamin Michotte on 29/02/16.
// Copyright © 2016 Benjamin Michotte. All rights reserved.
//
import Foundation
import MASPreferences
class OpponentTrackersPreferences: NSViewController {
@IBOutlet weak var showOpponentTracker: NSButton!
@IBOu... | mit |
daisysomus/swift-algorithm-club | Radix Sort/radixSort.swift | 1 | 1049 | /*
Sorting Algorithm that sorts an input array of integers digit by digit.
*/
// NOTE: This implementation does not handle negative numbers
func radixSort(_ array: inout [Int] ) {
let radix = 10 //Here we define our radix to be 10
var done = false
var index: Int
var digit = 1 //Which digit are we on?
... | mit |
finder39/Swimgur | Swimgur/Controllers/ImgurLoginController.swift | 1 | 5567 | //
// ImgurLoginController.swift
// Swimgur
//
// Created by Joseph Neuman on 8/5/14.
// Copyright (c) 2014 Joseph Neuman. All rights reserved.
//
import UIKit
import SWNetworking
// Type of authentication
public enum ImgurLoginAuthType:String {
case ImgurLoginAuthTypeToken = "token"
case ImgurLoginAuthTypePi... | mit |
OneBestWay/EasyCode | Swift/C4iOS/C4iOS/MenuRings.swift | 1 | 244 | //
// MenuRings.swift
// C4iOS
//
// Created by GK on 2017/2/7.
// Copyright © 2017年 GK. All rights reserved.
//
import Foundation
import UIKit
class MenuRings {
var thickRingFrames: [CGRect]!
var thickRing: Circle
}
| mit |
alessandro-martin/SimpleSideController | SimpleSideController/Source/SimpleSideController.swift | 1 | 22594 | //
// SimpleSideController.swift
// SimpleSideController
//
// Created by Alessandro Martin on 21/08/16.
// Copyright © 2016 Alessandro Martin. All rights reserved.
//
import UIKit
public protocol SimpleSideControllerDelegate: class {
func sideController(_ sideController: SimpleSideController, willChangeTo st... | mit |
qiuncheng/for-graduation | SpeechRecognition/Vendor/RxGesture/iOS/UIScreenEdgePanGestureRecognizer+RxGesture.swift | 2 | 3706 | // Copyright (c) RxSwiftCommunity
// 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, publish, dis... | apache-2.0 |
rnine/AMCoreAudio | Tests/SimplyCoreAudioTests/SimplyCoreAudioTests.swift | 1 | 312 | //
// SimplyCoreAudioTests.swift
// SimplyCoreAudio
//
// Created by Ruben Nine on 20/3/21.
// Copyright © 2021 9Labs. All rights reserved.
//
import XCTest
@testable import SimplyCoreAudio
class SimplyCoreAudioTests: XCTestCase {
func testInitializer() throws {
_ = SimplyCoreAudio()
}
}
| mit |
orta/apous | samples/cocoapods/main.swift | 2 | 63 | import Argo
import Runes
print("dependencies import properly") | mit |
kirakik/EZSwiftExtensions | EZSwiftExtensionsTests/UIAlertControllerTests.swift | 4 | 232 | //
// UIAlertControllerTests.swift
// EZSwiftExtensions
//
// Created by Goktug Yilmaz on 8/25/16.
// Copyright © 2016 Goktug Yilmaz. All rights reserved.
//
import XCTest
class UIAlertControllerTests: XCTestCase {
}
| mit |
kcome/SwiftIB | HistoryDataDump/main.swift | 1 | 7884 | //
// main.swift
// HistoryDataDump
//
// Created by Harry Li on 10/01/2015.
// Copyright (c) 2014-2019 Hanfei Li. 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 Softwa... | mit |
fluidsonic/JetPack | Sources/UI/TextInputView.swift | 1 | 6134 | import UIKit
open class TextInputView: View {
public typealias Delegate = _TextInputViewDelegate
private var lastLayoutedSize = CGSize.zero
private var lastMeasuredNativeHeight = CGFloat(0)
private let nativeView = NativeView()
private var placeholderView: Label?
public weak var delegate: Delegate?
public... | mit |
lkzhao/Hero | LegacyExamples/LegacyExampleViewController.swift | 1 | 2211 | // The MIT License (MIT)
//
// Copyright (c) 2016 Luke Zhao <me@lkzhao.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 limitation the rights
... | mit |
satorun/designPattern | Singleton/Singleton/ViewController.swift | 1 | 843 | //
// ViewController.swift
// Singleton
//
// Created by satorun on 2016/01/30.
// Copyright © 2016年 satorun. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typi... | mit |
pyngit/SegueAnimationSample | SegueAnimationSample/AppDelegate.swift | 1 | 2100 | //
// AppDelegate.swift
// SegueAnimationSample
//
// Created by pyngit on 2015/11/30.
//
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: ... | mit |
mogol/centrifugo-ios | CentrifugeiOS/Classes/Centrifuge.swift | 2 | 1210 | //
// Centrifugal.swift
// Pods
//
// Created by German Saprykin on 18/04/16.
//
//
import Foundation
import CentrifugeiOS.CommonCryptoBridge
public let CentrifugeErrorDomain = "com.Centrifuge.error.domain"
public let CentrifugeWebSocketErrorDomain = "com.Centrifuge.error.domain.websocket"
public let CentrifugeErr... | mit |
mohamede1945/quran-ios | Quran/SearchViewController.swift | 1 | 1039 | //
// SearchViewController.swift
// Quran
//
// Created by Mohamed Afifi on 4/19/16.
//
// Quran for iOS is a Quran reading application for iOS.
// Copyright (C) 2017 Quran.com
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as p... | gpl-3.0 |
steve-holmes/music-app-2 | MusicApp/Modules/Playlist/PlaylistDetailItem.swift | 1 | 219 | //
// PlaylistDetailItem.swift
// MusicApp
//
// Created by Hưng Đỗ on 6/19/17.
// Copyright © 2017 HungDo. All rights reserved.
//
enum PlaylistDetailItem {
case song(Song)
case playlist(Playlist)
}
| mit |
doronkatz/firefox-ios | Client/Frontend/Home/ReaderPanel.swift | 2 | 22492 | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import UIKit
import SnapKit
import Storage
import ReadingList
import Shared
import XCGLogger
private let log = Lo... | mpl-2.0 |
shajrawi/swift | test/Constraints/operator.swift | 2 | 4960 | // RUN: %target-typecheck-verify-swift
// Test constraint simplification of chains of binary operators.
// <https://bugs.swift.org/browse/SR-1122>
do {
let a: String? = "a"
let b: String? = "b"
let c: String? = "c"
let _: String? = a! + b! + c!
let x: Double = 1
_ = x + x + x
let sr3483: Double? = 1
... | apache-2.0 |
xedin/swift | test/Driver/Dependencies/fail-new.swift | 6 | 3223 | /// bad ==> main | bad --> other
// RUN: %empty-directory(%t)
// RUN: cp -r %S/Inputs/fail-simple/* %t
// RUN: touch -t 201401240005 %t/*
// RUN: cd %t && not %swiftc_driver -c -driver-use-frontend-path "%{python};%S/Inputs/update-dependencies-bad.py" -output-file-map %t/output.json -incremental -driver-always-rebuil... | apache-2.0 |
domenicosolazzo/practice-swift | AR/ARKitByExample/ARKitByExample/AppDelegate.swift | 1 | 2188 | //
// AppDelegate.swift
// ARKitByExample
//
// Created by Domenico Solazzo on 8/18/17.
// Copyright © 2017 Domenico Solazzo. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplicati... | mit |
advaita13/YouTubeFloatingPlayer | Example/YouTubeFloatingPlayer/AppDelegate.swift | 1 | 2396 | //
// AppDelegate.swift
// YouTubeFloatingPlayer
//
// Created by adipandya@gmail.com on 03/02/2017.
// Copyright (c) 2017 adipandya@gmail.com. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ applica... | gpl-3.0 |
HabitRPG/habitrpg-ios | Habitica Models/Habitica Models/Notifications/NotificationNewChatProtocol.swift | 1 | 375 | //
// HabiticaNotificationNewChatProtocol.swift
// Habitica Models
//
// Created by Phillip Thelen on 23.04.19.
// Copyright © 2019 HabitRPG Inc. All rights reserved.
//
import Foundation
public protocol NotificationNewChatProtocol: NotificationProtocol {
var groupID: String? { get set }
var groupName: St... | gpl-3.0 |
jmgc/swift | test/Interop/Cxx/implementation-only-imports/check-constructor-visibility.swift | 1 | 582 | // RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s -enable-cxx-interop
// Swift should consider all sources for a decl and recognize that the
// decl is not hidden behind @_implementationOnly in all modules.
// This test, as well as `check-constructor-v... | apache-2.0 |
apple/swift-syntax | lit_tests/print_verify_tree.swift | 1 | 398 | // RUN: %empty-directory(%t)
// RUN: %lit-test-helper -print-tree -source-file %s > %t.result
// RUN: diff -u %t.result %S/output/print_verify_tree.swift.withkind
func foo() {
#if swift(>=3.2)
components.append("-b \"\(string[..<string.index(before: string.endIndex)])\"")
#else
components.append("-b \"\(string... | apache-2.0 |
segmentio/analytics-swift | Sources/Segment/Plugins/Context.swift | 1 | 4006 | //
// Context.swift
// Segment
//
// Created by Brandon Sneed on 2/23/21.
//
import Foundation
public class Context: PlatformPlugin {
public let type: PluginType = .before
public weak var analytics: Analytics?
internal var staticContext = staticContextData()
internal static var device = Vendor... | mit |
ifLab/WeCenterMobile-iOS | WeCenterMobile/View/Comment/CommentCell.swift | 3 | 2432 | //
// CommentCell.swift
// WeCenterMobile
//
// Created by Darren Liu on 15/2/3.
// Copyright (c) 2015年 Beijing Information Science and Technology University. All rights reserved.
//
import UIKit
class CommentCell: UITableViewCell {
@IBOutlet weak var userAvatarView: MSRRoundedImageView!
@IBOutlet we... | gpl-2.0 |
coodly/ios-gambrinus | Packages/Sources/KioskCore/Persistence/SyncStatus.swift | 1 | 669 | /*
* Copyright 2016 Coodly LLC
*
* 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 wr... | apache-2.0 |
Prattmi/BecauseWater | AppDelegate.swift | 1 | 2156 | //
// AppDelegate.swift
// iOSBecauseWater
//
// Created by Michael Pratt on 10/27/14.
// Copyright (c) 2014 Michael Pratt. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, ... | mit |
scsonic/cosremote | ios/CosRemote/DeviceScanCell.swift | 1 | 310 | //
// DeviceScanCell.swift
// CosRemote
//
// Created by 郭 又鋼 on 2016/3/3.
// Copyright © 2016年 郭 又鋼. All rights reserved.
//
import Foundation
import UIKit
class DeviceScanCell: UITableViewCell {
@IBOutlet var lbDeviceName: UILabel!
@IBOutlet var lbIsConnect: UILabel!
} | mit |
VirgilSecurity/virgil-sdk-keys-x | Source/JsonWebToken/AccessProviders/CachingJwtProvider.swift | 2 | 5220 | //
// Copyright (C) 2015-2021 Virgil Security Inc.
//
// 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
// not... | bsd-3-clause |
Matzo/Edamame | Example/Tests/Tests.swift | 1 | 757 | import UIKit
import XCTest
import Edamame
class Tests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This meth... | mit |
sschiau/swift | stdlib/public/Darwin/Accelerate/vDSP_Arithmetic.swift | 8 | 128736 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2019 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 |
necrowman/CRLAlamofireFuture | Examples/SimpleTvOSCarthage/Carthage/Checkouts/Future/Future/Promise.swift | 111 | 1271 | //===--- Promise.swift ------------------------------------------------------===//
//Copyright (c) 2016 Daniel Leping (dileping)
//
//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://w... | mit |
zapdroid/RXWeather | Pods/RxCocoa/RxCocoa/iOS/UIViewController+Rx.swift | 1 | 563 | //
// UIViewController+Rx.swift
// RxCocoa
//
// Created by Kyle Fuller on 27/05/2016.
// Copyright © 2016 Krunoslav Zaher. All rights reserved.
//
#if os(iOS)
import UIKit
#if !RX_NO_MODULE
import RxSwift
#endif
extension Reactive where Base: UIViewController {
/// Bindable sink... | mit |
BlurredSoftware/BSWInterfaceKit | Sources/BSWInterfaceKit/Extensions/UIColor+SimpleInit.swift | 1 | 2877 | //
// Created by Pierluigi Cifani.
// Copyright © 2018 TheLeftBit SL. All rights reserved.
//
#if canImport(UIKit)
import UIKit
public extension UIColor {
/**
Initializes and returns a color given the current trait environment, but if,
iOS 13 is not available it'll return the light color.
... | mit |
vbudhram/firefox-ios | Client/Frontend/Settings/LoginDetailViewController.swift | 2 | 15344 | /* 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 Storage
import Shared
import SwiftKeychainWrapper
enum InfoItem: Int {
case websiteI... | mpl-2.0 |
klaaspieter/Letters | Sources/Recorder/Extensions/FileManager.swift | 1 | 353 | import Foundation
extension FileManager {
func uniqueTemporaryFile(pathExtension: String? = .none) -> URL {
var url = temporaryDirectory.appendingPathComponent(
ProcessInfo.processInfo.globallyUniqueString
)
if let pathExtension = pathExtension {
url = url.appendingPathExtension(pathExtensio... | mit |
jopamer/swift | test/multifile/multiconformanceimpls/main.swift | 2 | 1064 | // RUN: %empty-directory(%t)
// RUN: %target-build-swift-dylib(%t/libA.%target-dylib-extension) %S/Inputs/A.swift -emit-module -emit-module-path %t/A.swiftmodule -module-name A
// RUN: %target-codesign %t/libA.%target-dylib-extension
// RUN: %target-build-swift-dylib(%t/libB.%target-dylib-extension) %S/Inputs/B.swift -... | apache-2.0 |
blockchain/My-Wallet-V3-iOS | Modules/FeatureTransaction/Modules/Checkout/Sources/FeatureCheckoutUI/CountdownView.swift | 1 | 2010 | // Copyright © Blockchain Luxembourg S.A. All rights reserved.
import BlockchainUI
import SwiftUI
import SwiftUIExtensions
@MainActor
struct CountdownView: View {
private var deadline: Date
private let formatter: DateComponentsFormatter = .shortCountdownFormatter
@Environment(\.scheduler) private var sc... | lgpl-3.0 |
hibento/MessagePack.swift | MessagePackTests/ConvenienceInitializersTests.swift | 1 | 2638 | @testable import MessagePack
import XCTest
class ConvenienceInitializersTests: XCTestCase {
func testNil() {
XCTAssertEqual(MessagePackValue(), MessagePackValue.nothing)
}
func testBool() {
XCTAssertEqual(MessagePackValue(true), MessagePackValue.bool(true))
XCTAssertEqual(MessagePa... | mit |
huonw/swift | test/IRGen/type_layout.swift | 1 | 4590 | // RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-ir %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize -DINT=i%target-ptrsize
class C {}
struct SSing { var x: Int64 }
struct SMult { var x, y: Int64 }
struct SMult2 { var x, y: C }
struct SMult3 { var x, y: C }
s... | apache-2.0 |
ddgold/Cathedral | Cathedral/Model/Building.swift | 1 | 9356 | //
// Building.swift
// Cathedral
//
// Created by Doug Goldstein on 1/29/19.
// Copyright © 2019 Doug Goldstein. All rights reserved.
//
import Foundation
/// A building type.
enum Building: UInt8
{
//MARK: - Values
case tavern
case stable
case inn
case bridge
case square
case abbey
... | apache-2.0 |
Jnosh/swift | test/SILOptimizer/devirt_materializeForSet.swift | 6 | 1352 | // RUN: %target-swift-frontend -O -emit-sil %s | %FileCheck %s
// Check that compiler does not crash on the devirtualization of materializeForSet methods
// and produces a correct code.
// CHECK-LABEL: sil shared [transparent] [serialized] [thunk] @_T024devirt_materializeForSet7BaseFooCAA0F0A2aDP3barSSfmTW
// CHECK: ... | apache-2.0 |
martinomamic/CarBooking | CarBooking/Helpers/Extensions/UIExtensions.swift | 1 | 9177 | //
// UIExtensions.swift
// CarBooking
//
// Created by Martino Mamic on 29/07/2017.
// Copyright © 2017 Martino Mamic. All rights reserved.
//
import UIKit
//MARK: CarBooking colors
extension UIColor {
class var primaryColor: UIColor {
return UIColor(red: 172.0, green: 207.0 / 255.0, blue: 204.0 / 255... | mit |
MarioIannotta/SplitViewDragAndDrop | SplitViewDragAndDrop/SplitViewDragAndDrop+Dragger.swift | 1 | 8151 | //
// SplitViewDragAndDrop+Dragger.swift
// DragAndDropDemo
//
// Created by Mario on 26/05/2017.
// Copyright © 2017 Mario. All rights reserved.
//
import UIKit
extension SplitViewDragAndDrop {
internal class Dragger: NSObject {
private struct StoreKeys {
static... | mit |
samodom/FoundationSwagger | FoundationSwagger/Object/AssociatingObject.swift | 1 | 1984 | //
// AssociatingObject.swift
// FoundationSwagger
//
// Created by Sam Odom on 2/7/15.
// Copyright (c) 2015 Swagger Soft. All rights reserved.
//
/// Common protocol for object association with pure Swift classes or `NSObject`
/// (and its subclasses).
public protocol AssociatingObject: class {}
/// Type alias... | mit |
IBM-MIL/IBM-Ready-App-for-Venue | iOS/Venue/Views/FilterSliderViewModel.swift | 1 | 1979 | /*
Licensed Materials - Property of IBM
© Copyright IBM Corporation 2015. All Rights Reserved.
*/
import UIKit
/// This class represents the view model for a slider filter view
class FilterSliderViewModel: NSObject {
var filterTitle: String!
private var unitLabel: String!
var minimumValue: Int!
v... | epl-1.0 |
apple/swift-nio-extras | Tests/NIOExtrasTests/DebugOutboundEventsHandlerTest.swift | 1 | 3454 | //===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-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 |
trujillo138/MyExpenses | MyExpenses/MyExpenses/Scenes/ExpensePeriod/ExpensesDataSource.swift | 1 | 2119 | //
// ExpensesDataSource.swift
// MyExpenses
//
// Created by Tomas Trujillo on 6/27/17.
// Copyright © 2017 TOMApps. All rights reserved.
//
import UIKit
class ExpensesDataSource: NSObject, UITableViewDataSource {
//MARK: Properties
var expensePeriod: ExpensePeriod
var cellIdentifier: ... | apache-2.0 |
austinzheng/swift-compiler-crashes | crashes-duplicates/09427-swift-archetypetype-setnestedtypes.swift | 11 | 272 | // 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 {
struct B {
{
}
protocol P {
extension A {
extension A {
B
protocol A {
class
case c,
var f
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/10092-swift-sourcemanager-getmessage.swift | 11 | 218 | // 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 B {
class a {
func g {
( {
class
case ,
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/04863-swift-sourcemanager-getmessage.swift | 11 | 219 | // 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 {
let end = compose([Void{
class
case c,
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/09956-swift-archetypetype-setnestedtypes.swift | 11 | 287 | // 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 {
if true {
class b {
struct S {
protocol A {
protocol b {
{
{
}
}
}
func e<I : e
func b<I : A
protocol A : e
| mit |
austinzheng/swift-compiler-crashes | fixed/26990-swift-importdecl-findbestimportkind.swift | 4 | 221 | // 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{{{for{}{{}{{}var{let a{f=a{let:{let a{class B
| mit |
kuler90/OrangeFramework | Source/Extensions/Core/Array/Array+OFExtension.swift | 1 | 361 |
public extension Array {
public func of_safeElement(index: Int) -> Element? {
return index < count ? self[index] : nil
}
}
public extension Array where Element: Equatable {
public mutating func of_remove(element: Element) {
for index in (0..<count).reverse() where self[index] == element {
... | mit |
devcarlos/RappiApp | RappiApp/Classes/Managers/API/AppRouter.swift | 1 | 1093 | //
// PlaceRouter.swift
// RappiApp
//
// Created by Carlos Alcala on 7/1/16.
// Copyright © 2016 Carlos Alcala. All rights reserved.
//
import Foundation
import Alamofire
enum AppEndpoint {
case GetApps(limit: Int)
}
class AppRouter : BaseRouter {
var endpoint: AppEndpoint
init(endpoin... | mit |
brave/browser-ios | Client/Frontend/Browser/URLBarView.swift | 1 | 24956 | /* 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 UIKit
import Shared
import SnapKit
import XCGLogger
private let log = Logger.browserLogg... | mpl-2.0 |
brave/browser-ios | brave/src/frontend/PicklistSetting.swift | 1 | 5359 | /* 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 Shared
protocol PicklistSettingOptionsViewDelegate {
func picklistSetting(_ setting: PicklistSettingOptionsV... | mpl-2.0 |
squarefrog/dailydesktop | DailyDesktop/Extensions/DateFormatter+bing.swift | 1 | 322 | // Copyright © 2019 Paul Williamson. All rights reserved.
import Foundation
/// A date formatter for the dates returned by the Bing API
extension DateFormatter {
static let bing: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "yyyyMMdd"
return formatter
}()
}... | mit |
gvzq/iOS-Twitter | Twitter/ComposeViewController.swift | 1 | 4048 | //
// ComposeViewController.swift
// Twitter
//
// Created by Gerardo Vazquez on 2/23/16.
// Copyright © 2016 Gerardo Vazquez. All rights reserved.
//
import UIKit
class ComposeViewController: UIViewController, UITextViewDelegate {
@IBOutlet weak var textView: UITextView!
@IBOutlet weak var charsLeftLabe... | apache-2.0 |
welbesw/BigcommerceApi | Example/BigcommerceApi/EditInvetoryViewController.swift | 1 | 2518 | //
// EditInvetoryViewController.swift
// BigcommerceApi
//
// Created by William Welbes on 10/1/15.
// Copyright © 2015 CocoaPods. All rights reserved.
//
import UIKit
import BigcommerceApi
class EditInvetoryViewController: UIViewController {
@IBOutlet weak var textField:UITextField!
var product:Bi... | mit |
rsmoz/swift-corelibs-foundation | Foundation/NSDecimalNumber.swift | 1 | 6641 | // 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 |
ben-ng/swift | validation-test/compiler_crashers_fixed/01073-swift-constraints-constraintgraphnode-addconstraint.swift | 1 | 525 | // 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 |
appsembler/edx-app-ios | Test/SnapshotTestCase.swift | 1 | 5243 | //
// SnapshotTestCase
// edX
//
// Created by Akiva Leffert on 5/14/15.
// Copyright (c) 2015 edX. All rights reserved.
//
import Foundation
private let StandardTolerance : CGFloat = 0.005
protocol SnapshotTestable {
func snapshotTestWithCase(testCase : FBSnapshotTestCase, referenceImagesDirectory: String, ... | apache-2.0 |
maximveksler/Developing-iOS-8-Apps-with-Swift | lesson-014/Trax MapKit/Trax/ImageViewController.swift | 5 | 3985 | //
// ImageViewController.swift
// Trax
//
// Created by CS193p Instructor.
// Copyright (c) 2015 Stanford University. All rights reserved.
//
import UIKit
class ImageViewController: UIViewController, UIScrollViewDelegate
{
// our Model
// publicly settable
// when it changes (but only if we are on sc... | apache-2.0 |
cnoon/swift-compiler-crashes | crashes-duplicates/20626-no-stacktrace.swift | 11 | 260 | // 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 {
let P {
init {
extension g {
struct c {
func g {
case
{
( [ ]
var {
class
case ,
| mit |
heitara/swift-3 | playgrounds/Lecture7.playground/Contents.swift | 1 | 8168 | //: Playground - noun: a place where people can play
import UIKit
/*
Какво е playground?
Това вид проект, който се изпозлва от xCode. Интерактивно показва какво е състоянието на паметта на компютъра във всеки един ред на изпълнение на код-а. Позволява лесно онагледяване на примерния код. Много по-лесно може да се... | mit |
airbnb/lottie-ios | Example/iOS/Views/AnimatedSwitchRow.swift | 2 | 3379 | // Created by Cal Stephens on 1/4/22.
// Copyright © 2022 Airbnb Inc. All rights reserved.
import Epoxy
import Lottie
import UIKit
// MARK: - AnimatedSwitchRow
final class AnimatedSwitchRow: UIView, EpoxyableView {
// MARK: Lifecycle
init() {
super.init(frame: .zero)
translatesAutoresizingMaskIntoConst... | apache-2.0 |
andreacremaschi/GEOSwift | GEOSwift/GEOS/GeometryConvertible+GEOS.swift | 1 | 15571 | import geos
public extension GeometryConvertible {
// MARK: - Misc Functions
func length() throws -> Double {
let context = try GEOSContext()
let geosObject = try geometry.geosObject(with: context)
var length: Double = 0
// returns 0 on exception
guard GEOSLength_r(con... | mit |
rebeloper/SwiftyPlistManager | SwiftyPlistManager/ViewController.swift | 1 | 22312 | /**
MIT License
Copyright (c) 2017 Alex Nagy
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 |
relayrides/objective-c-sdk | Pods/Mixpanel-swift/Mixpanel/Tweak.swift | 1 | 5729 | //
// Tweak.swift
// KATweak
//
// Created by Bryan Clark on 11/4/15.
// Copyright © 2015 Khan Academy. All rights reserved.
//
import Foundation
import CoreGraphics
import UIKit
/// Tweaks let you adjust things on the fly.
/// Because each T needs a UI component, we have to restrict what T can be - hence T: Twea... | apache-2.0 |
prot3ct/Ventio | Ventio/Ventio/Controllers/CreateEventViewController.swift | 1 | 1976 | import UIKit
import RxSwift
class CreateEventViewController: UIViewController {
@IBOutlet weak var titleTextField: UITextField!
@IBOutlet weak var descriptionTextField: UITextField!
@IBOutlet weak var timeTextField: UITextField!
@IBOutlet weak var dateTextField: UITextField!
@IBOutlet weak var isPu... | apache-2.0 |
openHPI/xikolo-ios | WidgetExtension/ContinueLearningWidget.swift | 1 | 1013 | //
// Created for xikolo-ios under GPL-3.0 license.
// Copyright © HPI. All rights reserved.
//
import SwiftUI
import WidgetKit
struct ContinueLearningWidgetEntryView: View {
var entry: ContinueLearningWidgetProvider.Entry
var body: some View {
if !entry.userIsLoggedIn {
EmptyStateView.... | gpl-3.0 |
felix91gr/swift | test/stdlib/StringDiagnostics_without_Foundation.swift | 1 | 1558 | // RUN: %target-typecheck-verify-swift
// Positive and negative tests for String index types
func acceptsCollection<I: Collection>(_: I) {}
func acceptsBidirectionalCollection<I: BidirectionalCollection>(_: I) {}
func acceptsRandomAccessCollection<I: RandomAccessCollection>(_: I) {}
func testStringCollectionTypes(s: ... | apache-2.0 |
CocoaheadsSaar/Treffen | Treffen1/UI_Erstellung_ohne_Storyboard/AutolayoutTests/AutolayoutTests/AppDelegate.swift | 1 | 1703 | //
// AppDelegate.swift
// AutolayoutTests
//
// Created by Markus Schmitt on 11.01.16.
// Copyright © 2016 Insecom - Markus Schmitt. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? = UIWindow(frame: UIScreen.mainScreen().b... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.