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
y0ke/actor-platform
actor-sdk/sdk-core-ios/ActorSDK/Sources/ElegantPresentationController.swift
2
6274
// // ElegantPresentation.swift // TwitterPresentationController // // Created by Kyle Bashour on 2/21/16. // Copyright © 2016 Kyle Bashour. All rights reserved. // import UIKit typealias CoordinatedAnimation = UIViewControllerTransitionCoordinatorContext? -> Void class ElegantPresentationController: UIPresentat...
agpl-3.0
milseman/swift
test/TypeCoercion/overload_noncall.swift
9
1937
// RUN: %target-typecheck-verify-swift struct X { } struct Y { } struct Z { } func f0(_ x1: X, x2: X) -> X {} // expected-note{{found this candidate}} func f0(_ y1: Y, y2: Y) -> Y {} // expected-note{{found this candidate}} var f0 : X // expected-note {{found this candidate}} expected-note {{'f0' previously declared ...
apache-2.0
beyerss/CalendarKit
CalendarKitTests/MonthTests.swift
1
8953
// // MonthTests.swift // CalendarKit // // Created by Steven Beyers on 6/17/16. // Copyright © 2016 Beyers Apps, LLC. All rights reserved. // import XCTest @testable import CalendarKit class MonthTests: XCTestCase { let initialDate = NSDate() override func setUp() { super.setUp() ...
mit
jboullianne/EndlessTunes
EndlessSoundFeed/ETEvent.swift
1
2133
// // ETEvent.swift // EndlessSoundFeed // // Created by Jean-Marc Boullianne on 6/18/17. // Copyright © 2017 Jean-Marc Boullianne. All rights reserved. // import Foundation class ETEvent { var type:ETEventType var author:String var authorUID:String var track:Track? var playlist:Playlist?...
gpl-3.0
36Kr-Mobile/StatusBarNotificationCenter
Pod/Configuration/NotificationCenterConfiguration.swift
1
2544
// // NotificationCenterConfiguration.swift // StatusBarNotification // // Created by Shannon Wu on 9/18/15. // Copyright © 2015 Shannon Wu. All rights reserved. // import Foundation /** * Customize the overall configuration information of the notification, most of the property's default value is OK for most c...
mit
P0ed/Fx
Sources/Fx/Reactive/Disposable.swift
1
3989
/// Represents something that can be “disposed,” usually associated with freeing /// resources or canceling work. public protocol Disposable: AnyObject { func dispose() } /// A disposable that will not dispose on deinit public final class ManualDisposable: Disposable { private let action: Atomic<(() -> Void)?> ///...
mit
Cosmo/TinyConsole
TinyConsole/Extensions/UIButtonExtensions.swift
1
338
// // UIButtonExtensions.swift // TinyConsole // // Created by Devran on 30.09.19. // import UIKit internal extension UIButton { func applyMiniStyle() { contentEdgeInsets = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8) backgroundColor = UIColor(white: 1.0, alpha: 0.1) layer.cornerR...
mit
mindbody/Conduit
Tests/ConduitTests/Networking/ResultTests.swift
1
3474
// // ResultTests.swift // ConduitTests // // Created by Eneko Alonso on 3/27/17. // Copyright © 2017 MINDBODY. All rights reserved. // import XCTest import Conduit class ResultTests: XCTestCase { func testResultShouldStoreAnInt() { let sut = Result.value(3) if case .value(let int) = sut { ...
apache-2.0
TheAppCookbook/MiseEnPlace
Source/KeyboardLayoutConstraint.swift
1
2497
// // KeyboardLayoutConstraint.swift // MiseEnPlace // // Inspired by James Tang's work with Spring. // // Created by PATRICK PERINI on 9/12/15. // Copyright © 2015 pcperini. All rights reserved. // import UIKit public class KeyboardLayoutConstraint: NSLayoutConstraint { // MARK: Properties private var o...
mit
jam891/BFKit-Swift
Source/BFKit/BFLog.swift
3
3269
// // BFLog.swift // BFKit // // The MIT License (MIT) // // Copyright (c) 2015 Fabrizio Brancati. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without re...
mit
bre7/FBAnnotationClusteringSwift
Source/FBAnnotationCluster.swift
1
508
// // FBAnnotationCluster.swift // FBAnnotationClusteringSwift // // Created by Robert Chen on 4/2/15. // Copyright (c) 2015 Robert Chen. All rights reserved. // import Foundation import MapKit public class FBAnnotationCluster : NSObject { public var coordinate = CLLocationCoordinate2D(latitude: 0.0, longitud...
mit
naoty/Playground
Repository/Repository/Repository.swift
1
1062
// // Repository.swift // Repository // // Created by Naoto Kaneko on 3/4/16. // Copyright © 2016 Naoto Kaneko. All rights reserved. // import SwiftTask import AnyQuery protocol Repository { typealias Domain func find(ID: UInt) -> Task<Float, Domain, ErrorType> func findAll() -> Task<Float, [Doma...
mit
michalkonturek/MKUnits
MKUnits/Classes/Unit.swift
1
6595
// // Unit.swift // MKUnits // // Copyright (c) 2016 Michal Konturek <michal.konturek@gmail.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 wit...
mit
nathawes/swift
test/decl/class/actor/noconcurrency.swift
1
153
// RUN: %target-typecheck-verify-swift actor class C { } // expected-error{{'actor' attribute is only valid when experimental concurrency is enabled}}
apache-2.0
nathawes/swift
test/SILGen/generic_closures.swift
8
15391
// RUN: %target-swift-emit-silgen -module-name generic_closures -parse-stdlib %s | %FileCheck %s import Swift var zero: Int // CHECK-LABEL: sil hidden [ossa] @$s16generic_closures0A21_nondependent_context{{[_0-9a-zA-Z]*}}F func generic_nondependent_context<T>(_ x: T, y: Int) -> Int { func foo() -> Int { return y...
apache-2.0
Brightify/ReactantUI
Sources/Live/UIWindow+TopViewController.swift
1
820
// // UIWindow+TopViewController.swift // ReactantUI // // Created by Tadeas Kriz. // Copyright © 2017 Brightify. All rights reserved. // import UIKit extension UIWindow { public func topViewController() -> UIViewController? { return rootViewController.map(topViewController) } private func to...
mit
bizz84/SwiftyStoreKit
Sources/SwiftyStoreKit/SwiftyStoreKit.swift
1
18464
// // SwiftyStoreKit.swift // SwiftyStoreKit // // Copyright (c) 2015 Andrea Bizzotto (bizz84@gmail.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 w...
mit
sschiau/swift
test/SourceKit/Sema/injected_vfs_after_edit.swift
3
617
func foo(_ structDefinedInSameTarget: StructDefinedInSameTarget) { let _: Double = structDefinedInSameTarget.methodDefinedInSameTarget() // CHECK: cannot convert value of type '()' to specified type 'Double' // CHECK: cannot convert value of type '()' to specified type 'Int' } // RUN: %sourcekitd-test -req=open -v...
apache-2.0
AblePear/Peary
PearyTests/sockaddr_inTests.swift
1
4721
import XCTest @testable import Peary class sockaddr_inTests: XCTestCase { func testInit() { let address = sockaddr_in() XCTAssertEqual(address.sin_len, UInt8(0)) XCTAssertEqual(address.sin_family, sa_family_t(AF_UNSPEC)) XCTAssertEqual(address.sin_addr.s_addr, in_addr_t(0)...
bsd-2-clause
rdhiggins/PythonMacros
PythonMacros/BaseTextStorage.swift
1
1196
// // BaseTextStorage.swift // PythonTest.Swift // // Created by Rodger Higgins on 6/23/16. // Copyright © 2016 Rodger Higgins. All rights reserved. // import UIKit /// A class used as a base class for declaring custom NSTextStorage classes. /// This class contains generic implementations of methods required in ...
mit
practicalswift/swift
test/Sema/fixed_ambiguities/rdar27198177.swift
34
299
// RUN: %target-swift-frontend -emit-sil -verify %s -swift-version 4 | %FileCheck %s let arr = ["A", "B", "C"] let lazy: LazyMapCollection = arr.lazy.map { $0 } // CHECK: function_ref @$ss20LazySequenceProtocolPsE6filterys0a6FilterB0Vy8ElementsQzGSb7ElementQzcF _ = lazy.filter { $0 > "A" }.count
apache-2.0
blockchain/My-Wallet-V3-iOS
Modules/Platform/Sources/PlatformUIKit/Views/Cells/Badge/BadgeAsset/DefaultBadgeAssetPresenter.swift
1
786
// Copyright © Blockchain Luxembourg S.A. All rights reserved. import RxRelay import RxSwift public final class DefaultBadgeAssetPresenter: BadgeAssetPresenting { public typealias PresentationState = BadgeAsset.State.BadgeItem.Presentation public var state: Observable<PresentationState> { stateRelay....
lgpl-3.0
nathantannar4/Parse-Dashboard-for-iOS-Pro
Parse Dashboard for iOS/Extensions/Enum+Extensions.swift
1
421
// // Enum+Extensions.swift // Flashh // // Created by Nathan Tannar on 3/11/18. // Copyright © 2018 Nathan Tannar. All rights reserved. // import Foundation func iterateEnum<T: Hashable>(_: T.Type) -> AnyIterator<T> { var i = 0 return AnyIterator { let next = withUnsafeBytes(of: &i) { $0.load(as:...
mit
blockchain/My-Wallet-V3-iOS
Modules/FeatureTour/UI/PriceList/LivePricesHeader.swift
1
1510
// Copyright © Blockchain Luxembourg S.A. All rights reserved. import BlockchainComponentLibrary import Localization import SwiftUI struct LivePricesHeader: View { @State private var circleIsVisible = true @Binding var offset: CGFloat private let titleHeight: CGFloat = 64 private var clippedTitleHe...
lgpl-3.0
huonw/swift
test/SILGen/metatypes.swift
1
4296
// RUN: %target-swift-emit-silgen -parse-stdlib -enable-sil-ownership %s | %FileCheck %s import Swift protocol SomeProtocol { func method() func static_method() } protocol A {} struct SomeStruct : A {} class SomeClass : SomeProtocol { func method() {} func static_method() {} } class SomeSubclass : SomeCl...
apache-2.0
maxim-pervushin/HyperHabit
HyperHabit/HyperHabit/Views/MXCalendarView/Cells/MXAccessoryView.swift
1
1962
// // Created by Maxim Pervushin on 19/01/16. // Copyright (c) 2016 Maxim Pervushin. All rights reserved. // import UIKit @IBDesignable class MXAccessoryView: UIView { @IBInspectable var value: Int = 0 { didSet { setNeedsDisplay() } } @IBInspectable var maxValue: Int = 0 { ...
mit
faimin/ZDOpenSourceDemo
ZDOpenSourceSwiftDemo/Pods/lottie-ios/lottie-swift/src/Public/AnimationCache/LRUAnimationCache.swift
1
1238
// // LRUAnimationCache.swift // lottie-swift // // Created by Brandon Withrow on 2/5/19. // import Foundation /** An Animation Cache that will store animations up to `cacheSize`. Once `cacheSize` is reached, the least recently used animation will be ejected. The default size of the cache is 100. */ public c...
mit
networkextension/SFSocket
SFSocket/udp/NWUDPSocket.swift
1
2997
import Foundation import NetworkExtension import AxLogger /// The delegate protocol of `NWUDPSocket`. public protocol NWUDPSocketDelegate: class { /** Socket did receive data from remote. - parameter data: The data. - parameter from: The socket the data is read from. */ func didReceive...
bsd-3-clause
faimin/ZDOpenSourceDemo
ZDOpenSourceSwiftDemo/Pods/Cartography/Cartography/AutoresizingMaskLayoutProxy.swift
6
317
// // AutoresizingMaskLayoutProxy.swift // Cartography-iOS // // Created by Vitor Travain on 24/10/17. // Copyright © 2017 Robert Böhnke. All rights reserved. // import Foundation public protocol AutoresizingMaskLayoutProxy: LayoutProxy { var translatesAutoresizingMaskIntoConstraints: Bool { get set } }
mit
AndreyPanov/ApplicationCoordinator
ApplicationCoordinator/Flows/Items flow/ItemDetailController.swift
1
231
final class ItemDetailController: UIViewController, ItemDetailView { //controller handler var itemList: ItemList? override func viewDidLoad() { super.viewDidLoad() title = itemList?.title ?? "Detail" } }
mit
3DprintFIT/octoprint-ios-client
OctoPhone/View Related/Print Profile/PrintProfileViewController.swift
1
5556
// // PrintProfileViewController.swift // OctoPhone // // Created by Josef Dolezal on 03/04/2017. // Copyright © 2017 Josef Dolezal. All rights reserved. // import UIKit import ReactiveSwift import ReactiveCocoa import Result /// Print profile detail flow controller protocol PrintProfileViewControllerDelegate: cl...
mit
ustwo/US2MapperKit
US2MapperKit/Shared Test Cases/Classes/TestObjectSeven.swift
1
64
import Foundation class TestObjectSeven : _TestObjectSeven { }
mit
jovito-royeca/Decktracker
ios/old/Decktracker/View/Decks/StartingHandViewController.swift
1
20716
// // StartingHandViewController.swift // Decktracker // // Created by Jovit Royeca on 12/30/14. // Copyright (c) 2014 Jovito Royeca. All rights reserved. // import UIKit enum StartingHandShowMode: CustomStringConvertible { case ByHand case ByGraveyard case ByLibrary var description : String...
apache-2.0
carabina/Static
Static/Value1Cell.swift
5
322
import UIKit public class Value1Cell: UITableViewCell, CellType { public override init(style: UITableViewCellStyle, reuseIdentifier: String?) { super.init(style: .Value1, reuseIdentifier: reuseIdentifier) } public required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } ...
mit
dyshero/Pictorial-OC
原始/Pictorial-OC/Pods/ReactiveSwift/Sources/Optional.swift
26
906
// // Optional.swift // ReactiveSwift // // Created by Neil Pankey on 6/24/15. // Copyright (c) 2015 GitHub. All rights reserved. // /// An optional protocol for use in type constraints. public protocol OptionalProtocol { /// The type contained in the otpional. associatedtype Wrapped init(reconstructing value:...
mit
JohnSundell/SwiftKit
Source/Shared/Require.swift
1
1053
import Foundation /// Require that an optional is not nil, or throw an NSError (with an optional explicit message) public func Require<T>(optional: Optional<T>, errorMessage: String? = nil) throws -> T { guard let value = optional else { throw NSError(name: errorMessage ?? "Required value was nil") } ...
mit
readium/r2-streamer-swift
r2-streamer-swift/Parser/Readium/ReadiumWebPubParser.swift
1
5149
// // ReadiumWebPubParser.swift // r2-streamer-swift // // Created by Mickaël Menu on 25.06.19. // // Copyright 2019 Readium Foundation. All rights reserved. // Use of this source code is governed by a BSD-style license which is detailed // in the LICENSE file present in the project repository where this source c...
bsd-3-clause
StevenDXC/DxRefreshView
DxRefreshView/DxRefreshUIScrollViewExtension.swift
1
1091
// // RefreshUIScrollViewExtension.swift // DxRefreshView // // Created by Miutrip on 2016/9/12. // Copyright © 2016年 dxc. All rights reserved. // import UIKit public extension UIScrollView { private struct dx_associatedKeys { static var refreshHeader = "refreshHeader" } internal var...
apache-2.0
reesemclean/MaterialKit
Example/MaterialKitTests/MaterialKitTests.swift
26
914
// // MaterialKitTests.swift // MaterialKitTests // // Created by LeVan Nghia on 11/14/14. // Copyright (c) 2014 Le Van Nghia. All rights reserved. // import UIKit import XCTest class MaterialKitTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method ...
mit
fxm90/GradientProgressBar
Example/Pods/SnapshotTesting/Sources/SnapshotTesting/Snapshotting/UIView.swift
1
2380
#if os(iOS) || os(tvOS) import UIKit extension Snapshotting where Value == UIView, Format == UIImage { /// A snapshot strategy for comparing views based on pixel equality. public static var image: Snapshotting { return .image() } /// A snapshot strategy for comparing views based on pixel equality. /// ...
mit
ello/ello-ios
Sources/Controllers/Join/JoinProtocols.swift
1
1240
//// /// JoinProtocols.swift // protocol JoinScreenDelegate: class { func backAction() func validate(email: String, username: String, password: String) func onePasswordAction(_ sender: UIView) func submit(email: String, username: String, password: String) func urlAction(title: String, url: URL) } ...
mit
ello/ello-ios
Specs/Controllers/WebBrowser/ElloWebBrowserViewControllerSpec.swift
1
1863
//// /// ElloWebBrowserViewControllerSpec.swift // @testable import Ello import Quick import Nimble class ElloWebBrowserViewControllerSpec: QuickSpec { override func spec() { describe("ElloWebBrowserViewController") { it("is easy to create a navigation controller w/ browser") { ...
mit
leo150/Pelican
Sources/Pelican/API/Types/Markup/InlineKey.swift
1
4536
// // InlineKey.swift // Pelican // // Created by Takanu Kyriako on 31/08/2017. // import Foundation import Vapor import FluentProvider /** Defines a single keyboard key on a `MarkupInline` keyboard. Each key supports one of 4 different modes: _ _ _ _ _ **Callback Data** This sends a small String back to the bo...
mit
austinzheng/swift-compiler-crashes
crashes-duplicates/14648-swift-parser-skipsingle.swift
11
269
// 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 { for { struct A { class case , let { { { { { { { { ( { ( [ { [ { { { { { { { { { { { { a {
mit
ello/ello-ios
Sources/Controllers/LoggedOut/LoggedOutViewController.swift
1
2964
//// /// LoggedOutViewController.swift // import SnapKit protocol BottomBarController: class { var navigationBarsVisible: Bool? { get } var bottomBarVisible: Bool { get } var bottomBarHeight: CGFloat { get } var bottomBarView: UIView { get } func setNavigationBarsVisible(_ visible: Bool, animate...
mit
emilstahl/swift
test/BuildConfigurations/pound-if-top-level.swift
12
215
// RUN: %target-parse-verify-swift -D BLAH // Check that if config statement has range properly nested in its parent // EOF. #if BLAH // expected-error@+1{{expected #else or #endif at end of configuration block}}
apache-2.0
ssathy2/SwiftCollectionViewTest
SwiftCollectionViewTestTests/SwiftCollectionViewTestTests.swift
1
933
// // SwiftCollectionViewTestTests.swift // SwiftCollectionViewTestTests // // Created by Sidd Sathyam on 6/3/14. // Copyright (c) 2014 dotdotdot. All rights reserved. // import XCTest class SwiftCollectionViewTestTests: XCTestCase { override func setUp() { super.setUp() // Put setup code...
mit
mshafer/stock-portfolio-ios
Portfolio/HoldingTableViewCell.swift
1
3162
// // HoldingTableViewCell.swift // Portfolio // // Created by Michael Shafer on 22/09/15. // Copyright © 2015 mshafer. All rights reserved. // import Foundation import UIKit class HoldingTableViewCell: UITableViewCell { @IBOutlet var symbol: UILabel! @IBOutlet var name: UILabel! @IBOutlet var current...
gpl-3.0
ayong6/iOSNote
swift语言/swift语言/2. 字符串.playground/Contents.swift
1
1369
//: Playground - noun: a place where people can play import UIKit // 字符串的介绍 // 字符串在任何的开发中使用都是非常频繁的 // OC和Swift中字符串的区别 // 在OC中字符串类型时NSString,在Swift中字符串类型是String // OC中字符串@"",Swift中字符串"" // 使用 String 的原因 // String 是一个结构体,性能更高 // NSString 是一个 OC 对象,性能略差 // String 支持直接遍历 // Swift 提供了 String 和 NSString 之间的无缝转换 // 字符串遍历...
apache-2.0
ayong6/iOSNote
swift语言/swift语言/3. 数组和字典.playground/Contents.swift
1
3584
//: Playground - noun: a place where people can play import UIKit /********************* 数组 ********************/ // 数组 // 数组使用有序列表存储同一个类型的多个值。 // 1. 数组中的元素可以相同 // 2. 数组中的元素类型必须一致 var array = [1, 2, 3, 1, 2, 3] // 数组的定义 // swift数组应遵循 Array<Element>这样的形式,可以简写[Element] // swift开发中,可以使用AnyObject代替NSObject var array1...
apache-2.0
kylef/RxHyperdrive
Pods/RxSwift/RxSwift/Observables/Implementations/Sink.swift
1
599
// // Sink.swift // Rx // // Created by Krunoslav Zaher on 2/19/15. // Copyright (c) 2015 Krunoslav Zaher. All rights reserved. // import Foundation class Sink<O : ObserverType> : SingleAssignmentDisposable { private let _observer: O final func forwardOn(event: Event<O.E>) { if disposed { ...
mit
jsslai/Action
Carthage/Checkouts/RxSwift/RxCocoa/OSX/NSImageView+Rx.swift
3
2394
// // NSImageView+Rx.swift // RxCocoa // // Created by Krunoslav Zaher on 5/17/15. // Copyright © 2015 Krunoslav Zaher. All rights reserved. // import Foundation #if !RX_NO_MODULE import RxSwift #endif import Cocoa extension Reactive where Base: NSImageView { /** Bindable sink for `image` property. ...
mit
SwifterSwift/SwifterSwift
Tests/UIKitTests/UIScrollViewExtensionsTests.swift
1
5705
// UIScrollViewExtensionsTests.swift - Copyright 2020 SwifterSwift @testable import SwifterSwift import XCTest #if canImport(UIKit) && !os(watchOS) import UIKit final class UIScrollViewExtensionsTest: XCTestCase { let scroll = UIScrollView(frame: CGRect(origin: .zero, size: CGSize(width: 100, height: 100))) ...
mit
material-components/material-components-ios
components/AppBar/examples/AppBarTypicalUseExample.swift
2
4067
// Copyright 2016-present the Material Components for iOS 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 //...
apache-2.0
cdtschange/SwiftMKit
SwiftMKit/Extension/NSTimeInterval+Extension.swift
1
562
// // NSTimeInterval+Extension.swift // SwiftMKitDemo // // Created by Mao on 4/27/16. // Copyright © 2016 cdts. All rights reserved. // import Foundation public extension TimeInterval { func secondsToHHmmss () -> (Int, Int, Int) { let seconds : Int = Int(self) return (seconds / 3600, (se...
mit
edekhayser/Kontact
Kontact/Kontact/KontactURLAddress.swift
1
411
// // KontactURLAddress.swift // Kontact // // Created by Evan Dekhayser on 8/26/15. // Copyright © 2015 Xappox, LLC. All rights reserved. // import Contacts import AddressBook @objc public class KontactURLAddress: NSObject{ public let label: String public let urlAddress: String public init(label: String, ur...
mit
cnoon/swift-compiler-crashes
crashes-duplicates/11681-swift-sourcemanager-getmessage.swift
11
282
// 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 { { { { { { } enum S { var b = { class A { protocol C { struct S { var d = a( { } let { { { class case ,
mit
codefellows/sea-b19-ios
Projects/Week5 Region Monitoring Demo/mapkitdemo/AppDelegate.swift
1
2564
// // AppDelegate.swift // mapkitdemo // // Created by Bradley Johnson on 8/18/14. // Copyright (c) 2014 learnswift. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(applica...
gpl-2.0
cnoon/swift-compiler-crashes
crashes-fuzzing/26794-firsttarget.swift
7
212
// 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 C{init(){class A{let en=a:func a<h:A
mit
oisdk/SwiftDataStructures
SwiftDataStructuresTests/RangeReplaceableCollectionType.swift
1
1531
import XCTest import Foundation extension RangeReplaceableCollectionType where Self : SameOrder, Self : MutableCollectionType, Generator.Element == Int, SubSequence.Generator.Element == Int, SubSequence : FlexibleInitable { static func test() { testMultiPass() testCount() testSeqInit() test...
mit
brentdax/swift
test/IRGen/struct_resilience.swift
2
13112
// RUN: %empty-directory(%t) // RUN: %target-swift-frontend -emit-module -enable-resilience -emit-module-path=%t/resilient_struct.swiftmodule -module-name=resilient_struct %S/../Inputs/resilient_struct.swift // RUN: %target-swift-frontend -emit-module -enable-resilience -emit-module-path=%t/resilient_enum.swiftmodule ...
apache-2.0
kousun12/RxSwift
RxCocoa/iOS/UIGestureRecognizer+Rx.swift
4
2054
// // UIGestureRecognizer+Rx.swift // Touches // // Created by Carlos García on 10/6/15. // Copyright (c) 2015 Krunoslav Zaher. All rights reserved. // #if os(iOS) || os(tvOS) import UIKit #if !RX_NO_MODULE import RxSwift #endif // This should be only used from `MainScheduler` class GestureTarget: RxTarget { ...
mit
tkremenek/swift
test/stdlib/StringTraps.swift
22
4640
// RUN: %empty-directory(%t) // RUN: %target-build-swift %s -o %t/a.out_Debug -Onone // RUN: %target-build-swift %s -o %t/a.out_Release -O // // RUN: %target-codesign %t/a.out_Debug // RUN: %target-codesign %t/a.out_Release // RUN: %target-run %t/a.out_Debug // RUN: %target-run %t/a.out_Release // REQUIRES: executable_...
apache-2.0
Mazy-ma/DemoBySwift
LoopProgressDemo/LoopProgressDemo/ViewController.swift
1
1132
// // ViewController.swift // LoopProgressDemo // // Created by Mazy on 2017/5/22. // Copyright © 2017年 Mazy. All rights reserved. // import UIKit class ViewController: UIViewController { var loopView: LoopView? override func viewDidLoad() { super.viewDidLoad() // 设置环形视图并添加到...
apache-2.0
antonio081014/LeetCode-CodeBase
Swift/find-k-th-smallest-pair-distance.swift
2
2660
/** * https://leetcode.com/problems/find-k-th-smallest-pair-distance/ * * */ // Date: Fri May 1 10:21:02 PDT 2020 class Solution { /// - Complexity: /// - Time: O(nlogn + n + w + nlogw) func smallestDistancePair(_ nums: [Int], _ k: Int) -> Int { // O(nlogn) let nums = nums.sorted...
mit
boluomeng/Charts
ChartsRealm/Classes/Data/RealmBubbleData.swift
1
759
// // RealmBubbleData.swift // Charts // // Created by Daniel Cohen Gindi on 23/2/15. // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda // A port of MPAndroidChart for iOS // Licensed under Apache License 2.0 // // https://github.com/danielgindi/Charts // import Foundation import Charts import Realm im...
apache-2.0
twtstudio/WePeiYang-iOS
WePeiYang/YellowPage/SearchView.swift
1
2706
// // SearchView.swift // YellowPage // // Created by Halcao on 2017/2/23. // Copyright © 2017年 Halcao. All rights reserved. // import UIKit import SnapKit class SearchView: UIView { let backBtn = UIButton(type: .custom) let textField = UITextField() /* // Only override draw() if you perform cust...
mit
mateuszmackowiak/MMLogger
MMLogger/Classes/Logstash/MMAsyncSocketManager.swift
1
3372
// // Created by Mateusz Mackowiak on 04/03/2017. // Copyright (c) 2016 Mateusz Mackowiak. All rights reserved. // import Foundation import CocoaAsyncSocket protocol MMAsyncSocketManagerDelegate: class { func socketDidConnect(_ socket: MMAsyncSocketManager) func socket(_ socket: MMAsyncSocketManager, didWri...
mit
temoki/TortoiseGraphics
PlaygroundBook/Sources/Playground/PlaygroundCanvasLiveView.swift
1
1307
#if os (iOS) import UIKit public class PlaygroundCanvasLiveView: UIViewController { public init() { super.init(nibName: nil, bundle: nil) } public init(size: CGSize) { super.init(nibName: nil, bundle: nil) self.preferredContentSize = size } required init?(coder: NSCoder) ...
mit
atl009/WordPress-iOS
WordPress/Classes/ViewRelated/Aztec/ViewControllers/AztecPostViewController.swift
1
143201
import Foundation import UIKit import Aztec import CocoaLumberjack import Gridicons import WordPressShared import AFNetworking import WPMediaPicker import SVProgressHUD import AVKit // MARK: - Aztec's Native Editor! // class AztecPostViewController: UIViewController, PostEditor { /// Closure to be executed when ...
gpl-2.0
xilosada/BitcoinFinder
BitcoinFinder/DateHelper.swift
1
1220
// // Copyright 2015 X.I. Losada. // // 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 agr...
apache-2.0
realm/SwiftLint
Source/SwiftLintFramework/Rules/Idiomatic/ToggleBoolRule.swift
1
3635
import SwiftSyntax import SwiftSyntaxBuilder struct ToggleBoolRule: SwiftSyntaxCorrectableRule, ConfigurationProviderRule, OptInRule { var configuration = SeverityConfiguration(.warning) init() {} static var description = RuleDescription( identifier: "toggle_bool", name: "Toggle Bool", ...
mit
sgr-ksmt/SUSwiftSugar
SUSwiftSugar/Extensions/Foundation/NSFileManagerExtensions.swift
1
1821
// // NSFileManagerExtensions.swift import Foundation private func getNSDirectory(searchPath: NSSearchPathDirectory) -> String { return NSSearchPathForDirectoriesInDomains(searchPath, .UserDomainMask, true).first! } public func NSDocumentDirectory() -> String { return getNSDirectory(.DocumentDirectory) } ...
mit
CodeDrunkard/ARViewer
ARViewer/Core/ARView.swift
1
5304
// // ARView.swift // ARViewer // // Created by JT Ma on 11/04/2017. // Copyright © 2017 JT Ma. All rights reserved. // import UIKit import SceneKit import CoreMotion import AVFoundation import SpriteKit public enum ARControlMode: Int { case motion case touch } public class ARView: SCNView { pub...
mit
dreamsxin/swift
validation-test/compiler_crashers_fixed/26824-swift-modulefile-getimportedmodules.swift
11
475
// 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
dreamsxin/swift
validation-test/Evolution/Inputs/class_remove_property.swift
45
545
#if BEFORE public final class RemoveStoredProperty { public init(first: String, middle: String, last: String) { self.first = first self.middle = middle self.last = last } public var first: String public var middle: String public var last: String public var name: String { return "\(first)...
apache-2.0
LYM-mg/MGOFO
MGOFO/MGOFO/Class/Extesion/UIViewController+Extension.swift
1
10619
// // UIViewController+Extension.swift // chart2 // // Created by i-Techsys.com on 16/11/30. // Copyright © 2016年 i-Techsys. All rights reserved. // import UIKit import MBProgressHUD import SnapKit private let mainScreenW = UIScreen.main.bounds.size.width private let mainScreenH = UIScreen.main.bounds.size.height...
mit
CodeEagle/SSImageBrowser
Source/SSCaptionView.swift
1
4067
// // SSCaptionView.swift // Pods // // Created by LawLincoln on 15/7/10. // // import UIKit public final class SSCaptionView: UIView { var photo: SSPhoto? private var labelPadding: CGFloat { return 10 } private lazy var label: UILabel = { let label = UILabel(frame: CGRect(x: self.labelPadding, y: 0,...
mit
BellAppLab/BLLogger
Package.swift
1
309
// swift-tools-version:4.1 import PackageDescription let package = Package( name: "BLLogger", products: [ .library(name: "BLLogger", targets: ["BLLogger"]), ], targets: [ .target(name: "BLLogger"), ], swiftLanguageVersions: [3.3, 4.1, 4.2] )
mit
Mindera/Alicerce
Tests/AlicerceTests/StackOrchestrator/StackOrchestratorPerformanceMetricsTrackerTestCase.swift
1
2630
import XCTest @testable import Alicerce class StackOrchestratorPerformanceMetricsTrackerTestCase: XCTestCase { private var tracker: MockStackOrchestratorPerformanceMetricsTracker! override func setUp() { super.setUp() tracker = MockStackOrchestratorPerformanceMetricsTracker() } ...
mit
Sephiroth87/C-swifty4
C-swifty4 tvOS/ContextBackedView.swift
1
3274
// // ContextBackedView.swift // C-swifty4 iOS // // Created by Fabio Ritrovato on 10/01/2015. // Copyright (c) 2015 orange in a day. All rights reserved. // import UIKit private class ContextBackedLayer: CALayer { private var size: CGSize = .zero private var safeArea: UIEdgeInsets = .zero privat...
mit
MichaelJordanYang/JDYangDouYuZB
JDYDouYuZb/JDYDouYuZb/Application/Classes/Home/Controller/HomeViewController.swift
1
4973
// // HomeViewController.swift // JDYDouYuZb // // Created by xiaoyang on 2016/12/24. // Copyright © 2016年 JDYang. All rights reserved. // import UIKit fileprivate let kTitleViewHeight : CGFloat = 40 class HomeViewController: UIViewController { // MARK:- 懒加载属性 fileprivate lazy var pageTitleView : PageTi...
mit
davefoxy/SwiftBomb
SwiftBomb/Classes/Requests/AuthenticationRequests.swift
1
1356
// // AuthenticationRequests.swift // SwiftBomb // // Created by David Fox on 17/04/2016. // Copyright © 2016 David Fox. All rights reserved. // import Foundation extension SwiftBomb { static func createAuthenticationSession() -> AuthenticationSession { let instance = SwiftBomb.framework...
mit
simonnarang/Fandom-IOS
Fandomm/ChangePWTableViewController.swift
1
2844
// // ChangePWTableViewController.swift // Fandomm // // Created by Simon Narang on 3/30/16. // Copyright © 2016 Simon Narang. All rights reserved. // import UIKit class ChangePWTableViewController: UITableViewController { var usernameFourTextOne = String() override func viewDidLoad() { supe...
unlicense
cuappdev/podcast-ios
old/Podcast/OnboardingButton.swift
1
867
// // OnboardingButton.swift // Podcast // // Created by Natasha Armbrust on 3/2/18. // Copyright © 2018 Cornell App Development. All rights reserved. // import UIKit /// semi-transparent buttons used in onboarding view class OnboardingButton: UIButton { convenience init(title: String) { self.init(f...
mit
odigeoteam/TableViewKit
Examples/Viper/TableViewKit+VIPER/AboutModule/MoreAboutItem.swift
1
1575
import Foundation import TableViewKit enum MoreAboutItemType { case faq, contact, terms, feedback, share, rate func title() -> String { switch self { case .faq: return "FAQ" case .contact: return "Contact Us" case .terms: return "Terms and C...
mit
ahoppen/swift
validation-test/stdlib/FixedPointConversion/FixedPointConversion_Release32_ToUInt32.swift
9
16797
//===----------------------------------------------------------------------===// // // Automatically Generated From ./Inputs/FixedPointConversion.swift.gyb // Do Not Edit Directly! // //===----------------------------------------------------------------------===// // // REQUIRES: executable_test // REQUIRES: PTRSIZE=32...
apache-2.0
Harley-xk/Chrysan
Chrysan/Sources/Responders/HUDBarProgressView.swift
1
2190
// // HUDBarProgressView.swift // Chrysan // // Created by Harley-xk on 2020/9/28. // Copyright © 2020 Harley. All rights reserved. // import Foundation import UIKit import SnapKit public class HUDBarProgressView: UIView, StatusIndicatorView { public struct Options { public init() {} publ...
mit
wangrui460/WRNavigationBar_swift
WRNavigationBar_swift/Pods/Kingfisher/Sources/CacheSerializer.swift
5
3729
// // CacheSerializer.swift // Kingfisher // // Created by Wei Wang on 2016/09/02. // // Copyright (c) 2017 Wei Wang <onevcat@gmail.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 So...
mit
dasdom/Swiftandpainless
SwiftAndPainless_3.playground/Pages/Generics III.xcplaygroundpage/Contents.swift
1
532
import Foundation /*: [⬅️](@previous) [➡️](@next) # Generics III */ struct ExclusiveStack<Element where Element: Equatable>: CustomStringConvertible { var items = [Element]() mutating func push(item: Element) { if !items.contains(item) { items.append(item) } } mutating func pop() -> Element { ...
mit
tuzaiz/UniformString
UniformString/UniformString/AppDelegate.swift
1
2151
// // AppDelegate.swift // UniformString // // Created by Henry Tseng on 2015/2/12. // Copyright (c) 2015年 Cloudbay. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFini...
mit
practicalswift/swift
test/decl/ext/extensions.swift
11
3642
// RUN: %target-typecheck-verify-swift extension extension_for_invalid_type_1 { // expected-error {{use of undeclared type 'extension_for_invalid_type_1'}} func f() { } } extension extension_for_invalid_type_2 { // expected-error {{use of undeclared type 'extension_for_invalid_type_2'}} static func f() { } } exten...
apache-2.0
zwaldowski/Lustre
Lustre/Optional.swift
1
566
// // Optional.swift // Lustre // // Created by Zachary Waldowski on 6/11/15. // Copyright © 2014-2015. Some rights reserved. // extension Optional: EitherType { public init(left: Void) { self = .None } public init(right: Wrapped) { self = .Some(right) } public fu...
mit
Zerofinancial/relay
Relay/URLSessionProtocol.swift
1
478
// // URLSessionProtocol.swift // Relay // // Created by Evan Kimia on 5/2/17. // Copyright © 2017 zero. All rights reserved. // import Foundation public protocol URLSessionProtocol { var delegate: URLSessionDelegate? { get } func uploadTask(with request: URLRequest, fromFile fileURL: URL) -> U...
apache-2.0
kemalenver/SwiftHackerRank
Algorithms/Implementation.playground/Pages/Implementation - SockMerchant.xcplaygroundpage/Contents.swift
1
505
// number of elements var n = 9 // read array and map the elements to integer var readLine = "10 20 20 10 10 30 50 10 20" var arr = readLine.split(separator: " ").map { Int(String($0))! } var matches = [Int:Int]() for x in arr { if var count = matches[x] { count += 1 matches[x] = c...
mit
mingsai/ColorWheel
ColorWheelTests/ColorWheelTests.swift
1
927
// // ColorWheelTests.swift // ColorWheelTests // // Created by Tommie N. Carter, Jr., MBA on 4/9/15. // Copyright (c) 2015 MING Technology. All rights reserved. // import UIKit import XCTest class ColorWheelTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here....
gpl-3.0
jsmerola/Caffeinator
CaffeinatorTests/CaffeinatorTests.swift
1
912
// // CaffeinatorTests.swift // CaffeinatorTests // // Created by Jeff Merola on 3/21/15. // Copyright (c) 2015 Jeff Merola. All rights reserved. // import Cocoa import XCTest class CaffeinatorTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is...
mit
cnoon/swift-compiler-crashes
crashes-duplicates/05627-swift-sourcemanager-getmessage.swift
11
227
// Distributed under the terms of the MIT license // Test case submitted to project by https://github.com/practicalswift (practicalswift) // Test case found by fuzzing struct d<f : P { let t: a { case c, ([Void{ class case c,
mit
ZwxWhite/V2EX
V2EX/Pods/PagingMenuController/Pod/Classes/MenuItemView.swift
2
4795
// // MenuItemView.swift // PagingMenuController // // Created by Yusuke Kita on 5/9/15. // Copyright (c) 2015 kitasuke. All rights reserved. // import UIKit public class MenuItemView: UIView { public private(set) var titleLabel: UILabel! private var options: PagingMenuOptions! private var title:...
mit
cnoon/swift-compiler-crashes
crashes-duplicates/19195-swift-typechecker-typecheckexpression.swift
11
229
// 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 end = (object : A.b struct A { let b = Void{
mit