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
Antondomashnev/Sourcery
SourceryTests/Stub/Performance-Code/Kiosk/Admin/PasswordAlertViewController.swift
2
1210
import UIKit class PasswordAlertViewController: UIAlertController { class func alertView(completion: @escaping () -> ()) -> PasswordAlertViewController { let alertController = PasswordAlertViewController(title: "Exit Kiosk", message: nil, preferredStyle: .alert) let exitAction = UIAlertAction(titl...
mit
AlexSeverinov/Bond
BondTests/DisposableTests.swift
1
2740
// // DisposableTests.swift // Bond // // Created by Srđan Rašić on 16/08/15. // Copyright © 2015 Bond. All rights reserved. // import XCTest @testable import Bond private class CountingDisposable: DisposableType { var isDisposed: Bool = false var disposeCallCount = 0 func dispose() { disposeCallCoun...
mit
smartmobilefactory/SMF-iOS-CommonProjectSetupFiles
Plist2swift/Sources/Plist2.swift
1
19626
#!/usr/bin/env xcrun --sdk macosx swift // // main.swift // plist2swift // // Created by Bartosz Swiatek on 12.09.18. // Copyright © 2018 Bartosz Swiatek. All rights reserved. // // Note: Currently Date is not supported import Foundation // MARK: Defaults let configurationKeyName: String = "configurationName" v...
mit
silence0201/Swift-Study
Learn/05.控制语句/guard语句.playground/Contents.swift
1
1964
//定义一个Blog(博客)结构体 struct Blog { let name: String? let URL: String? let Author: String? } func ifStyleBlog(blog: Blog) { if let blogName = blog.name { print("博客名:\(blogName)") } else { print("这篇博客没有名字!") } } func guardStyleBlog(blog: Blog) { guard let blogName = blog.name e...
mit
edmw/Volumio_ios
Pods/Eureka/Source/Rows/TextAreaRow.swift
4
12326
// AlertRow.swift // Eureka ( https://github.com/xmartlabs/Eureka ) // // Copyright (c) 2016 Xmartlabs SRL ( 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 deal // in the Software...
gpl-3.0
stripe/stripe-ios
Tests/Tests/STPPaymentMethodUSBankAccountParamsStubbedTest.swift
1
11814
// // STPPaymentMethodUSBankAccountParamsStubbedTest.swift // StripeiOS Tests // // Created by John Woo on 3/24/22. // Copyright © 2022 Stripe, Inc. All rights reserved. // import OHHTTPStubs import OHHTTPStubsSwift import StripeCoreTestUtils import XCTest @testable@_spi(STP) import Stripe @testable@_spi(STP) imp...
mit
OatmealCode/Oatmeal
Example/Pods/PiedPiper/PiedPiper/Result+Map.swift
1
1809
/// Errors that can arise when mapping Results public enum ResultMappingError: ErrorType { /// When the boxed value can't be mapped case CantMapValue } extension Result { func _map<U>(handler: (T, Promise<U>) -> Void) -> Future<U> { let mapped = Promise<U>() switch self { case .Success(let value...
mit
ntwf/TheTaleClient
TheTale/Stores/RequestAuthorisation/RequestAuthorisation.swift
1
454
// // RequestAuthorisation.swift // TheTaleClient // // Created by Mikhail Vospennikov on 20/08/2017. // Copyright © 2017 Mikhail Vospennikov. All rights reserved. // import Foundation struct RequestAuthorisation { var urlPath: String } extension RequestAuthorisation { init?(jsonObject: JSON) { guar...
mit
hetefe/EmotionalKeyBoard
EmotionalKeyBoard/EmotionalKeyBoard/Extension/UIView+ViewController.swift
1
733
// // UIView+ViewController.swift // sina_htf // // Created by 赫腾飞 on 15/12/23. // Copyright © 2015年 hetefe. All rights reserved. // import UIKit //通过响应者链条 将视图的导航视图控制 找到 extension UIView { func navController() -> UINavigationController? { //获取 当前控制器的下一个响应者 var next = nextResponder() ...
mit
austinzheng/swift-compiler-crashes
crashes-duplicates/11446-swift-sourcemanager-getmessage.swift
11
204
// Distributed under the terms of the MIT license // Test case submitted to project by https://github.com/practicalswift (practicalswift) // Test case found by fuzzing for in a { case let { class case ,
mit
tbaranes/SwiftyUtils
Tests/Extensions/UIKit/UIViewController/UIViewControllerExtensionTests.swift
1
2842
// // UIViewControllerTests.swift // SwiftyUtils // // Created by Tom Baranes on 11/04/2017. // Copyright © 2017 Tom Baranes. All rights reserved. // import XCTest // MARK: Life cycle final class UIViewControllerExtensionTests: XCTestCase { override func setUp() { super.setUp() } override f...
mit
oscarfuentes/Architecture
Pods/Bond/Bond/Extensions/Shared/NSLock+Bond.swift
26
1426
// // The MIT License (MIT) // // Copyright (c) 2015 Srdan Rasic (@srdanrasic) // // 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...
mit
debugsquad/metalic
metalic/Model/Filters/Basic/MFiltersItemBasicRembrandt.swift
1
461
import Foundation class MFiltersItemBasicRembrandt:MFiltersItem { private let kImageName:String = "assetFilterRembrandt" private let kCommitable:Bool = true required init() { let name:String = NSLocalizedString("MFiltersItemBasicRembrandt_name", comment:"") let filter:MetalFilter.T...
mit
creisterer-db/SwiftCharts
SwiftCharts/AxisValues/ChartAxisValue.swift
2
1461
// // ChartAxisValue.swift // swift_charts // // Created by ischuetz on 01/03/15. // Copyright (c) 2015 ivanschuetz. All rights reserved. // import UIKit /** An axis value, which is represented internally by a double and provides the label which is displayed in the chart (or labels, in the case of working wit...
apache-2.0
austinzheng/swift-compiler-crashes
crashes-duplicates/12180-swift-sourcemanager-getmessage.swift
11
237
// 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 { var T = [ I : var { { let : { class A { { } class case ,
mit
open-telemetry/opentelemetry-swift
Sources/OpenTelemetryApi/Trace/Tracer.swift
1
609
/* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ import Foundation /// Tracer is a simple, protocol for Span creation and in-process context interaction. /// Users may choose to use manual or automatic Context propagation. Because of that this class /// offers APIs to facilitate bo...
apache-2.0
byu-oit-appdev/ios-byuSuite
byuSuite/Apps/Parking/view/VehicleTextFieldTableViewCell.swift
2
557
// // VehicleTextFieldTableViewCell.swift // byuSuite // // Created by Erik Brady on 11/21/17. // Copyright © 2017 Brigham Young University. All rights reserved. // class VehicleTextFieldTableViewCell: UITableViewCell { //MARK: IBOutlets @IBOutlet private weak var label: UILabel! @IBOutlet private (set) wea...
apache-2.0
maail/MMImageLoader
MMImageLoader/Model.swift
1
409
// // Model.swift // MMImageLoader // // Created by Mohamed Maail on 5/29/16. // Copyright © 2016 Mohamed Maail. All rights reserved. // import Foundation struct UnsplashModel{ let Format : String let Width : Int let Height : Int let FileName : String let ID : Int ...
mit
CodePath2017Group4/travel-app
RoadTripPlanner/PendingInvitationTableViewCell.swift
1
2325
// // PendingInvitationTableViewCell.swift // RoadTripPlanner // // Created by Nanxi Kang on 10/28/17. // Copyright © 2017 RoadTripPlanner. All rights reserved. // import UIKit class PendingInvitationTableViewCell: UITableViewCell { @IBOutlet weak var tripLabel: UILabel! @IBOutlet weak var dateLabel: UIL...
mit
AxziplinLib/TabNavigations
TabNavigations/Classes/Generals/Cells/TableViewCell.swift
1
585
// // TableViewCell.swift // AxReminder // // Created by devedbox on 2017/6/28. // Copyright © 2017年 devedbox. All rights reserved. // import UIKit class TableViewCell: UITableViewCell { @objc dynamic public class var reusedIdentifier: String { return "_TableViewCell" } override func awakeFr...
apache-2.0
bitcrowd/tickety-tick
safari/tickety-tick/ViewController.swift
1
1480
// // ViewController.swift // import Cocoa import SafariServices.SFSafariApplication import SafariServices.SFSafariExtensionManager let appName = "tickety-tick" let extensionBundleIdentifier = "net.bitcrowd.tickety-tick.Extension" class ViewController: NSViewController { @IBOutlet var appNameLabel: NSTextField! ...
mit
cnoon/swift-compiler-crashes
crashes-duplicates/05129-swift-sourcemanager-getmessage.swift
11
274
// Distributed under the terms of the MIT license // Test case submitted to project by https://github.com/practicalswift (practicalswift) // Test case found by fuzzing if true { extension NSData { } case c, { class B<T where g: P { func b { protocol c { class case c, case
mit
qianqian2/ocStudy1
weibotext/weibotext/Class/Tools/Category/UIButton+Extension.swift
1
1462
// // UIButton+Extension.swift // weiboText // // Created by arang on 16/12/2. // Copyright © 2016年 arang. All rights reserved. // import UIKit extension UIButton { // class func creatButton(imageName:String, bgImageName: String) -> UIButton { // // let btn = UIButton() // btn.setImage(UIImag...
apache-2.0
iCodesign/ICSTable
Carthage/Checkouts/Snap/Source/ConstraintRelation.swift
1
1745
// // Snap // // Copyright (c) 2011-2014 Masonry Team - https://github.com/Masonry // // 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
twostraws/HackingWithSwift
SwiftUI/project14/Bucketlist/ContentView.swift
1
2513
// // ContentView.swift // Bucketlist // // Created by Paul Hudson on 08/12/2021. // import MapKit import SwiftUI struct ContentView: View { @StateObject private var viewModel = ViewModel() var body: some View { if viewModel.isUnlocked { ZStack { Map(coordinateRegion: $...
unlicense
qutheory/vapor
Sources/Vapor/Error/ErrorSource.swift
2
1274
/// A source-code location. public struct ErrorSource { /// File in which this location exists. public var file: String /// Function in which this location exists. public var function: String /// Line number this location belongs to. public var line: UInt /// Number of characters into the...
mit
igorkos/BRTV
appleBRTVTests/BRTVAPITests.swift
1
3806
// // BRTVAPITests.swift // appleBRTV // // Created by Aleksandr Kelbas on 10/10/2015. // Copyright © 2015 Aleksandr Kelbas. All rights reserved. // import XCTest @testable import appleBRTV class BRTVAPITests: XCTestCase { var sessionID: String? = nil override func setUp() { super.setUp(...
gpl-2.0
KosyanMedia/Aviasales-iOS-SDK
AviasalesSDKTemplate/Source/HotelsSource/BadgesDescription/HLDistanceBadge.swift
1
405
import UIKit @objc enum DistancePointType: Int { case customLocation case userLocation } class HLDistanceBadge: HLPopularHotelBadge { let distance: Double let pointType: DistancePointType init(distance: Double, pointType: DistancePointType) { self.pointType = pointType self.distan...
mit
auth0/Lock.swift
LockTests/AuthCollectionViewSpec.swift
1
6088
// AuthCollectionViewSpec.swift // // Copyright (c) 2016 Auth0 (http://auth0.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 r...
mit
s0mmer/TodaysReactiveMenu
TodaysReactiveMenuTests/TodaysReactiveMenuTests.swift
1
612
// // TodaysReactiveMenuTests.swift // TodaysReactiveMenuTests // // Created by Steffen Damtoft Sommer on 24/05/15. // Copyright (c) 2015 steffendsommer. All rights reserved. // import UIKit import XCTest class TodaysReactiveMenuTests: XCTestCase { override func setUp() { super.setUp() //...
mit
bencallis/PMKVObserver
PMKVObserverTests/KVOHelper.swift
1
1296
// // KVOHelper.swift // PMKVObserver // // Created by Kevin Ballard on 11/19/15. // Copyright © 2015 Postmates. All rights reserved. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/...
apache-2.0
cheebow/PlaceholderTextView
Example/PlaceholderTextViewTests/PlaceholderTextViewTests.swift
1
929
// // PlaceholderTextViewTests.swift // PlaceholderTextViewTests // // Created by CHEEBOW on 2015/07/24. // Copyright (c) 2015年 CHEEBOW. All rights reserved. // import UIKit import XCTest class PlaceholderTextViewTests: XCTestCase { override func setUp() { super.setUp() // Put setup code ...
mit
delba/Sorry
Source/Supporting Files/Utilities.swift
2
4472
// // Utilities.swift // // Copyright (c) 2015-2019 Damien (http://delba.io) // // 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
zqqf16/SYM
SYM/Convertor.swift
1
10857
// The MIT License (MIT) // // Copyright (c) 2022 zqqf16 // // 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, mo...
mit
Viddi/ios-process-button
ProcessButton/ProcessButton/ProcessButton.swift
1
1112
// // ProcessButton.swift // ProcessButton // // Created by Vidar Ottosson on 2/7/15. // Copyright (c) 2015 Vidar Ottosson. All rights reserved. // import UIKit class ProcessButton: FlatButton, FlatButtonDelegate { let LineHeight: CGFloat = 4.0 var processView: ProcessView! override init(frame: CGRect)...
mit
HongliYu/firefox-ios
ClientTests/ActivityStreamTests.swift
1
1740
/* 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 XCTest @testable import Client import Shared import Storage import Deferred import SyncTelemet...
mpl-2.0
miguelgutierrez/Curso-iOS-Swift-Programming-Netmind
MiprimeraApp 1.3/MiprimeraApp/AppDelegate.swift
4
2152
// // AppDelegate.swift // MiprimeraApp // // Created by Miguel Gutiérrez Moreno on 9/1/15. // Copyright (c) 2015 MGM. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFi...
mit
tomburns/ios
FiveCalls/FiveCalls/ReportOutcomeOperation.swift
1
1572
// // ReportOutcomeOperation.swift // FiveCalls // // Created by Ben Scheirman on 2/4/17. // Copyright © 2017 5calls. All rights reserved. // import Foundation class ReportOutcomeOperation : BaseOperation { //Input properties var log: ContactLog //Output properties var httpResponse: HTTP...
mit
lorentey/swift
test/Migrator/fixit_flatMap.swift
19
693
// RUN: %target-swift-frontend -typecheck %s -swift-version 4 // RUN: %target-swift-frontend -typecheck -update-code -primary-file %s -emit-migrated-file-path %t.result -swift-version 4 // RUN: diff -u %s.expected %t.result // REQUIRES: OS=macosx || OS=ios || OS=tvos || OS=watchos func migrate<T, U: Sequence, V: Coll...
apache-2.0
narner/AudioKit
Examples/macOS/AudioUnitManager/AudioUnitManager/AudioUnitGenericView.swift
1
2322
// // GenericAudioUnitView.swift // // Created by Ryan Francesconi on 6/27/17. // Copyright © 2017 AudioKit. All rights reserved. // import Cocoa import AVFoundation /// Creates a simple list of parameters linked to sliders class AudioUnitGenericView: NSView { open var name: String = "" open var preferredW...
mit
hole19/media-viewer
H19MediaViewerTests/TapGestureRecognizerMock.swift
1
589
import UIKit class TapGestureRecogniserMock: UITapGestureRecognizer { // settable properties var locationInViewToReturn = CGPoint.zero override func location(in view: UIView?) -> CGPoint { return locationInViewToReturn } var requireGestureRecognizerToFailCallCount = 0 var requireGes...
mit
alblue/swift
test/SILOptimizer/exclusivity_static_diagnostics_inlined.swift
2
1330
// RUN: %empty-directory(%t) // RUN: %target-swift-frontend -enforce-exclusivity=none -emit-sil -Onone %s -o %t/Onone.sil // RUN: %target-sil-opt %t/Onone.sil -inline -assume-parsing-unqualified-ownership-sil -o %t/inlined.sil // RUN: %FileCheck %s --check-prefix=INLINE < %t/inlined.sil // RUN: %target-sil-opt -enable-...
apache-2.0
wireapp/wire-ios
Wire-iOS/Sources/UserInterface/Settings/ChangingDetails/Views/AccessoryTextFieldCell.swift
1
1839
// // Wire // Copyright (C) 2019 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
benlangmuir/swift
test/multifile/default-arguments/two-modules/Inputs/library2.swift
41
46
public func hasDefaultArgument(x: Int = 0) {}
apache-2.0
benlangmuir/swift
test/SILOptimizer/zeroInitializer.swift
21
1116
// RUN: %target-swift-frontend -O -parse-stdlib -emit-ir -module-name ZeroInit -verify %s | %FileCheck %s import Swift @frozen public struct TestInt { @usableFromInline var _value : Builtin.Int32 @_transparent public init() { _value = Builtin.zeroInitializer() } } @frozen public struct TestFloat { @u...
apache-2.0
benlangmuir/swift
test/IRGen/async/unreachable.swift
12
418
// RUN: %target-swift-frontend -primary-file %s -g -emit-ir -disable-availability-checking -disable-llvm-optzns -disable-swift-specific-llvm-optzns | %FileCheck %s // REQUIRES: concurrency // CHECK: call i1 (i8*, i1, ...) @llvm.coro.end.async func foo() async -> Never { await bar() fatalError() } // CHECK: call ...
apache-2.0
PureSwift/Cacao
Sources/Cacao/UIControl.swift
1
8251
// // UIControl.swift // Cacao // // Created by Alsey Coleman Miller on 6/7/17. // import class Foundation.NSNull /// The base class for controls, which are visual elements that convey /// a specific action or intention in response to user interactions. open class UIControl: UIView { // MARK: - Configurin...
mit
phakphumi/Chula-Expo-iOS-Application
Chula Expo 2017/UserData+CoreDataProperties.swift
1
950
// // UserData+CoreDataProperties.swift // Chula Expo 2017 // // Created by NOT on 1/11/2560 BE. // Copyright © 2560 Chula Computer Engineering Batch#41. All rights reserved. // This file was automatically generated and should not be edited. // import Foundation import CoreData extension UserData { @nonobj...
mit
primetimer/PrimeFactors
Example/PrimeFactors/AppDelegate.swift
1
2399
// // AppDelegate.swift // PFactors // // Created by primetimer on 10/17/2017. // Copyright (c) 2017 primetimer. All rights reserved. // import UIKit import BigInt import PrimeFactors @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ app...
mit
parkera/swift-corelibs-foundation
TestFoundation/TestProcess.swift
1
23230
// This source file is part of the Swift.org open source project // // Copyright (c) 2015 - 2016, 2018 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...
apache-2.0
Mindera/Alicerce
Tests/AlicerceTests/Extensions/UIKit/UIViewControllerTestCase.swift
1
1717
import XCTest import UIKit @testable import Alicerce final class UIViewControllerTestCase: XCTestCase { func testEmbedIn_UsingAUIViewController_ItShouldReturnAUINavigationControllerWithSelfAsRoot() { let rootViewController = UIViewController() let navigationController = rootViewController.embedI...
mit
Ehrippura/firefox-ios
Storage/ThirdParty/SwiftData.swift
1
61859
/* 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/. */ /* * This is a heavily modified version of SwiftData.swift by Ryan Fowler * This has been enhanced to support cu...
mpl-2.0
sol/aeson
tests/JSONTestSuite/parsers/test_PMJSON_1_2_0/Parser.swift
7
28248
// // Decoder.swift // PMJSON // // Created by Kevin Ballard on 10/8/15. // Copyright © 2016 Postmates. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // opt...
bsd-3-clause
slavapestov/swift
validation-test/compiler_crashers_fixed/28011-swift-typebase-getcanonicaltype.swift
4
290
// 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 class B<T where g:a{func f{ {enum e{struct c{ class B<a{ let t:T.C let:T.E
apache-2.0
borglab/SwiftFusion
Sources/SwiftFusion/Probability/ProbabilityModel.swift
1
1025
// Copyright 2019 The SwiftFusion Authors. 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 ...
apache-2.0
anirudh24seven/wikipedia-ios
Wikipedia/Code/PageHistorySection.swift
1
300
import Foundation public class PageHistorySection: NSObject { public let sectionTitle: String public let items: [WMFPageHistoryRevision] public init(sectionTitle: String, items: [WMFPageHistoryRevision]) { self.sectionTitle = sectionTitle self.items = items } }
mit
sebcode/SwiftHelperKit
Source/File-Temp.swift
1
457
// // File-Temp.swift // SwiftHelperKit // // Copyright © 2015 Sebastian Volland. All rights reserved. // // File Extension to create temp files import Foundation extension FilePath { public static func createTemp(_ prefix: String = "tmp") throws -> Self { let tmpFile = Directory.tempDirectory().file...
mit
kstaring/swift
validation-test/compiler_crashers/28450-underlyingty-gettype-isnull-getting-invalid-underlying-type-failed.swift
2
479
// 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
test/Parse/ConditionalCompilation/armAndroidTarget.swift
7
455
// RUN: %swift -parse %s -verify -D FOO -D BAR -target armv7-none-linux-androideabi -disable-objc-interop -D FOO -parse-stdlib // RUN: %swift-ide-test -test-input-complete -source-filename=%s -target armv7-none-linux-androideabi #if os(Linux) // This block should not parse. // os(Android) does not imply os(Linux). let...
apache-2.0
kstaring/swift
validation-test/compiler_crashers_fixed/00372-swift-declcontext-lookupqualified.swift
11
429
// 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
s-aska/Justaway-for-iOS
Justaway/HomeTimelineTableViewController.swift
1
1980
// // SearchStatusTableViewController.swift // Justaway // // Created by Shinichiro Aska on 1/25/15. // Copyright (c) 2015 Shinichiro Aska. All rights reserved. // import Foundation import KeyClip import Async class HomeTimelineTableViewController: StatusTableViewController { override func saveCache() { ...
mit
USAssignmentWarehouse/EnglishNow
EnglishNow/Model/Profile/Skill.swift
1
317
// // skill.swift // EnglishNow // // Created by Nha T.Tran on 6/12/17. // Copyright © 2017 IceTeaViet. All rights reserved. // import Foundation class Skill { var level = 0 //0 / 5 var name = "" var description = "" init(name: String) { self.name = name } }
apache-2.0
austinzheng/swift-compiler-crashes
crashes-duplicates/20970-swift-nominaltypedecl-preparelookuptable.swift
10
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 struct c{ { }class c{ class C{ struct B<T{ class d{protocol A:A init(){ class b{struct A{ let a= var b{
mit
huangboju/Moots
Examples/SwiftUI/SwiftUI-Apple/WorkingWithUIControls/StartingPoint/Landmarks/Landmarks/LandmarkDetail.swift
10
2088
/* See LICENSE folder for this sample’s licensing information. Abstract: A view showing the details for a landmark. */ import SwiftUI struct LandmarkDetail: View { @EnvironmentObject var userData: UserData var landmark: Landmark var landmarkIndex: Int { userData.landmarks.firstIndex(where: {...
mit
huangboju/Moots
Examples/SwiftUI/Mac/YouTube-Downloader-for-macOS-master/Youtube Downloader/NSImageView_ScaleAspectFill.swift
1
1327
import Cocoa @IBDesignable class NSImageView_ScaleAspectFill: NSImageView { @IBInspectable var scaleAspectFill : Bool = false override func awakeFromNib() { // Scaling : .scaleNone mandatory if scaleAspectFill { self.imageScaling = .scaleNone } } override func dr...
mit
huangboju/QMUI.swift
QMUI.swift/QMUIKit/UIComponents/QMUIToastContentView.swift
1
9489
// // QMUIToastContentView.swift // QMUI.swift // // Created by 黄伯驹 on 2017/7/10. // Copyright © 2017年 伯驹 黄. All rights reserved. // /** * `QMUIToastView`默认使用的contentView。其结构是:customView->textLabel->detailTextLabel等三个view依次往下排列。其中customView可以赋值任意的UIView或者自定义的view。 * * @TODO: 增加多种类型的progressView的支持。 */ class QM...
mit
mightydeveloper/swift
validation-test/compiler_crashers/27348-swift-constraints-constraintsystem-solve.swift
9
319
// 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 func a{ struct B<T where g:A{ struct B{struct a{ } class c{ struct B{ var d=f var f:a{ {var _=f
apache-2.0
felipecarreramo/R3LRackspace
Pod/Classes/CFContainer.swift
1
606
// // CFContainer.swift // Pods // // Created by Felipe Carrera on 30/12/15. // // import Foundation public struct CFContainer { public var name: String? public var uri: String? public var objects: [CFObject]? private let network: Network init() { network = Network(authURL: C...
mit
Malibris/TheLoneWalker
TheLoneWalkerTests/TheLoneWalkerTests.swift
1
1006
// // TheLoneWalkerTests.swift // TheLoneWalkerTests // // Created by Robert Abramczyk on 01/10/2017. // Copyright © 2017 Robert Abramczyk. All rights reserved. // import XCTest @testable import TheLoneWalker class TheLoneWalkerTests: XCTestCase { override func setUp() { super.setUp() // ...
gpl-3.0
huonw/swift
test/SILGen/default_arguments_generic.swift
1
3129
// RUN: %target-swift-emit-silgen -module-name default_arguments_generic -enable-sil-ownership -swift-version 3 %s | %FileCheck %s // RUN: %target-swift-emit-silgen -module-name default_arguments_generic -enable-sil-ownership -swift-version 4 %s | %FileCheck %s func foo<T: ExpressibleByIntegerLiteral>(_: T.Type, x: T...
apache-2.0
channelade/channelade-tvos
Channelade/Channelade/AppDelegate.swift
1
3708
/* Channelade starter app for Apple TV To get this app working for your channel, make sure to do the following: - Add your Channelade account key below - Change the bundle identifier - Add your own artwork (icons and shelf image) */ import UIKit import TVMLKit @UIApplicationMain class AppDelegate: UIResponder, UIA...
mit
WEIHOME/SearchBarDemo-Swift
SearchBarDemoTests/SearchBarDemoTests.swift
1
918
// // SearchBarDemoTests.swift // SearchBarDemoTests // // Created by Weihong Chen on 30/04/2015. // Copyright (c) 2015 Weihong. All rights reserved. // import UIKit import XCTest class SearchBarDemoTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This met...
mit
csnu17/My-Swift-learning
MVVMSwiftExample/MVVMSwiftExample/GameLibrary.swift
1
662
// // GameLibrary.swift // MVVMExample // // Created by Dino Bartosak on 18/09/16. // Copyright © 2016 Toptal. All rights reserved. // import Foundation enum GameLibraryNotifications { static let GameLibraryGameAdded = "GameLibraryGameAdded" static let GameLibraryGameRemoved = "GameLibraryGameRemoved" stati...
mit
ryet231ere/DouYuSwift
douyu/douyu/Classes/Main/Controller/BaseAnchorViewController.swift
1
4250
// // BaseAnchorViewController.swift // douyu // // Created by 练锦波 on 2017/3/9. // Copyright © 2017年 练锦波. All rights reserved. // import UIKit private let kItemMargin : CGFloat = 10 private let kHeaderViewH : CGFloat = 50 private let kNormalCellID = "kNormalCellID" private let kHeaderViewID = "kHeaderViewID" le...
mit
cfraz89/RxSwift
scripts/package-spm.swift
1
11618
#!/usr/bin/swift // // package-spm.swift // scripts // // Created by Krunoslav Zaher on 12/26/15. // Copyright © 2015 Krunoslav Zaher. All rights reserved. // import Foundation /** This script packages normal Rx* structure into `Sources` directory. * creates and updates links to normal project structure * bui...
mit
N26-OpenSource/bob
Sources/Bob/APIs/GitHub/GitHub.swift
1
7171
/* * Copyright (c) 2017 N26 GmbH. * * This file is part of Bob. * * Bob 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. * * B...
gpl-3.0
february29/Learning
swift/Fch_Contact/Fch_Contact/AppClasses/ViewModel/MainViewModel.swift
1
13341
// // MainViewModel.swift // Fch_Contact // // Created by bai on 2017/11/30. // Copyright © 2017年 北京仙指信息技术有限公司. All rights reserved. // import UIKit import RxSwift import RxDataSources import BAlertView import Alamofire class MainViewModel: NSObject { var loadData = PublishSubject<(Int,String)>(); p...
mit
fitpay/fitpay-ios-sdk
FitpaySDK/Crypto/JWT/JWS.swift
1
475
import Foundation struct JWS { let header: JOSEHeader let body: [String: Any] let signature: String? init(token: String) throws { let parts = token.components(separatedBy: ".") guard parts.count == 3 else { throw JWTError.invalidPartCount } ...
mit
itsaboutcode/WordPress-iOS
WordPress/Classes/Services/RecentSitesService.swift
2
2802
import Foundation /// Recent Sites Notifications /// extension NSNotification.Name { static let WPRecentSitesChanged = NSNotification.Name(rawValue: "RecentSitesChanged") } /// Keep track of recently used sites /// class RecentSitesService: NSObject { // We use the site's URL to identify a site typealia...
gpl-2.0
tianbinbin/DouYuShow
DouYuShow/DouYuShow/AppDelegate.swift
1
762
// // AppDelegate.swift // DouYuShow // // Created by 田彬彬 on 2017/5/30. // Copyright © 2017年 田彬彬. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOp...
mit
itsaboutcode/WordPress-iOS
WordPress/WordPressTest/SiteCreation/SiteCreationRotatingMessageViewTests.swift
2
2718
import XCTest @testable import WordPress class SiteCreationRotatingMessageViewTests: XCTestCase { private let testMessages = [ "Test Message 1", "Test Message 2", "Test Message 3" ] private var rotatingMessageView: SiteCreationRotatingMessageView? override func setUp() { ...
gpl-2.0
zmeyc/GRDB.swift
Tests/SPM/Sources/main.swift
1
302
import GRDB import CSQLite let CVersion = String(cString: sqlite3_libversion()) print("SQLite version from C API: \(CVersion)") let SQLVersion = try! DatabaseQueue().inDatabase { db in try String.fetchOne(db, "SELECT sqlite_version()")! } print("SQLite version from SQL function: \(SQLVersion)")
mit
lorentey/GlueKit
Tests/GlueKitTests/MockSetObserver.swift
1
1287
// // MockSetObserver.swift // GlueKit // // Created by Károly Lőrentey on 2016-10-06. // Copyright © 2015–2017 Károly Lőrentey. // import Foundation import XCTest import GlueKit func describe<Element: Comparable>(_ update: SetUpdate<Element>) -> String { switch update { case .beginTransaction: re...
mit
toineheuvelmans/Metron
Playground.playground/Sources/Playground.swift
1
852
import Metron // 🧨 If you get a build error on this line, try building for a Simulator device! import UIKit // MARK: Playgrounds public extension Metron.Drawable { public var customPlaygroundQuickLook: PlaygroundQuickLook { if let path = self.path { return .bezierPath(UIBezierPath(cgPath: pat...
mit
qianyu09/AppLove
App Love/Network/ReviewLoading/ReviewLoadManager.swift
1
5565
// // ReviewLoadManager.swift // App Love // // Created by Woodie Dovich on 2016-03-24. // Copyright © 2016 Snowpunch. All rights reserved. // // Mass Multi-threaded page loader that can be safely canceled. // import UIKit class ReviewLoadManager: NSObject, ProgressDelegate { static let sharedInst = Review...
mit
quillford/OctoControl-iOS
OctoControl/TerminalViewController.swift
1
1801
// // TerminalViewController.swift // OctoControl // // Created by quillford on 2/6/15. // Copyright (c) 2015 quillford. All rights reserved. // import UIKit import Starscream class TerminalViewController: UIViewController, WebSocketDelegate { var socket = WebSocket(url: NSURL(scheme: "ws", host: "prusa....
gpl-2.0
amnuaym/TiAppBuilder
Day2/BMICalculator2/BMICalculator/AppDelegate.swift
2
4595
// // AppDelegate.swift // BMICalculator // // Created by Amnuay M on 8/21/17. // Copyright © 2017 Amnuay M. All rights reserved. // import UIKit import CoreData @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplicatio...
gpl-3.0
tomburns/ios
FiveCalls/FiveCalls/EditLocationViewController.swift
2
4483
// // EditLocationViewController.swift // FiveCalls // // Created by Ben Scheirman on 1/31/17. // Copyright © 2017 5calls. All rights reserved. // import UIKit import CoreLocation import Crashlytics protocol EditLocationViewControllerDelegate : NSObjectProtocol { func editLocationViewController(_ vc: EditLoca...
mit
haddenkim/dew
Sources/App/Helpers/GeoJSONPoint.swift
1
1123
// // GeoJSONPoint.swift // dew // // Created by Hadden Kim on 4/26/17. // // import MongoKitten import GeoJSON extension Point { init?(_ value: Primitive?) { guard let document = Document(value), let type = String(document["type"]), type == "Point", ...
mit
jarimartens10/wwdc-2015
JMViewController.swift
1
4457
// // JMViewController.swift // // // Created by Jari Martens on 14-04-15. // // import UIKit import MessageUI class JMViewController: UIViewController, JMImageViewDelegate, MFMailComposeViewControllerDelegate { //MARK: - IBOutlets //########################################################### ...
apache-2.0
harryzjm/SMWaterFlowLayout
Source/SMWaterFlowLayout.swift
1
8414
// // SMWaterfallFlowLayout.swift // SuperMe // // Created by Magic on 10/10/2017. // Copyright © 2017 SuperMe. All rights reserved. // import Foundation import UIKit public protocol SMWaterFlowLayoutDelegate: class { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: SMWater...
mit
vector-im/vector-ios
Riot/Modules/Spaces/SpaceMenu/SpaceMenuViewAction.swift
1
824
// // Copyright 2021 New Vector Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to ...
apache-2.0
vector-im/vector-ios
Riot/Modules/DeepLink/CustomSchemeURLConstants.swift
1
800
// // Copyright 2020 New Vector Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to ...
apache-2.0
abertelrud/swift-package-manager
Tests/WorkspaceTests/ToolsVersionSpecificationGenerationTests.swift
2
2394
//===----------------------------------------------------------------------===// // // This source file is part of the Swift open source project // // Copyright (c) 2014-2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See http://swift.org/LICENSE....
apache-2.0
kickstarter/ios-oss
KsApi/models/graphql/adapters/UserEnvelope+GraphUserEnvelopeTemplates.swift
1
959
@testable import KsApi public struct GraphUserEnvelopeTemplates { static let userJSONDict: [String: Any?] = [ "me": [ "chosenCurrency": nil, "email": "nativesquad@ksr.com", "hasPassword": true, "id": "VXNlci0xNDcwOTUyNTQ1", "imageUrl": "https://ksr-qa-ugc.imgix.net/m...
apache-2.0
shopgun/shopgun-ios-sdk
Sources/TjekAPI/Utils/UIColor+Hex.swift
1
1947
/// /// Copyright (c) 2018 Tjek. All rights reserved. /// #if canImport(UIKit) import UIKit extension UIColor { convenience init?(hex: String) { var hexSanitized = hex.trimmingCharacters(in: .whitespacesAndNewlines) hexSanitized = hexSanitized.replacingOccurrences(of: "#", with: "") ...
mit
PerfectlySoft/Perfect-TensorFlow
Sources/PerfectTensorFlow/pb.model_flags.swift
1
29604
// DO NOT EDIT. // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: tensorflow/contrib/lite/toco/model_flags.proto // // For information on using the generated types, please see the documenation: // https://github.com/apple/swift-protobuf/ /// Copyright 2017 The TensorFlow Auth...
apache-2.0
superbderrick/SummerSlider
SummerSliderDemo/HorizontalViewController.swift
1
2840
// // HorizontalViewController.swift // SummerSlider // // Created by Kang Jinyeoung on 24/09/2017. // Copyright © 2017 CocoaPods. All rights reserved. // import UIKit import SummerSlider class HorizontalViewController: UIViewController { var testSlider1:SummerSlider! var testSlider2:SummerSlider! ...
mit
fishermenlabs/Treasure
Example/Tests/Tests.swift
1
7657
import UIKit import XCTest import Treasure fileprivate func == <K, V>(left: [K:V], right: [K:V]) -> Bool { return NSDictionary(dictionary: left).isEqual(to: right) } class Tests: XCTestCase { override func setUp() { Treasure.strictValidationOnInitialization = true super....
mit
ostatnicky/kancional-ios
Pods/BonMot/Sources/UIKit/Tracking+Adaptive.swift
2
1579
// // Tracking+Adaptive.swift // BonMot // // Created by Brian King on 10/2/16. // Copyright © 2016 Raizlabs. All rights reserved. // #if os(OSX) import AppKit #else import UIKit #endif extension Tracking: AdaptiveStyleTransformation { func adapt(attributes theAttributes: StyleAttributes, to traitCol...
mit