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 |
|---|---|---|---|---|---|
ouyanghaiyong/Study_swift | DouYuZB/DouYuZBUITests/DouYuZBUITests.swift | 1 | 1239 | //
// DouYuZBUITests.swift
// DouYuZBUITests
//
// Created by ouyang on 2017/2/13.
// Copyright © 2017年 ouyang. All rights reserved.
//
import XCTest
class DouYuZBUITests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before ... | mit |
sheepy1/SelectionOfZhihu | SelectionOfZhihu/UserDetailModel.swift | 1 | 1144 | //
// UserDetail.swift
// SelectionOfZhihu
//
// Created by 杨洋 on 16/1/20.
// Copyright © 2016年 Sheepy. All rights reserved.
//
import Foundation
class UserDetailModel: NSObject {
var ask = 0 as Int64
var answer = 0 as Int64
var post = 0 as Int64
var agree = 0 as Int64
var agreei = 0 as Int64
... | mit |
k8mil/ContactCircularView | ContactCircularView/Classes/ContactCircularViewTextCreatorProtocol.swift | 1 | 466 | //
// Created by Kamil Wysocki on 14/10/16.
// Copyright (c) 2016 CocoaPods. All rights reserved.
//
import Foundation
/**
Protocol that you have to implement you want to create customTextFormatter and use it in ContactCircularView
*/
public protocol FormattedTextCreator {
/**
Implement this method to create f... | mit |
OpsLabJPL/MarsImagesIOS | Pods/SwiftMessages/SwiftMessages/MarginAdjustable+Animation.swift | 4 | 2149 | //
// MarginAdjustable+Animation.swift
// SwiftMessages
//
// Created by Timothy Moose on 11/5/17.
// Copyright © 2017 SwiftKick Mobile. All rights reserved.
//
import UIKit
extension MarginAdjustable where Self: UIView {
public func defaultMarginAdjustment(context: AnimationContext) -> UIEdgeInsets {
... | apache-2.0 |
apple/swift-tools-support-core | Tests/TSCUtilityTests/ProgressAnimationTests.swift | 1 | 4010 | /*
This source file is part of the Swift.org open source project
Copyright (c) 2014 - 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 Swift project au... | apache-2.0 |
hrscy/TodayNews | News/News/Classes/Home/Model/NewsModel.swift | 1 | 17332 |
//
// NewsModel.swift
// News
//
// Created by 杨蒙 on 2018/1/13.
// Copyright © 2018年 hrscy. All rights reserved.
//
import HandyJSON
/// 新闻数据模型(首页新闻数据,视频新闻数据,小视频,微头条)
struct NewsModel: HandyJSON {
var weitoutiaoHeight: CGFloat {
// 50 + contentH + 5 + middleViewH + 65
var height: CGFloat... | mit |
ubiregiinc/UbiregiExtensionClient | UbiregiExtensionClientTests/TestHelper.swift | 1 | 2018 | import Foundation
import Swifter
import XCTest
func withSwifter(port: UInt16 = 8081, k: (HttpServer) throws -> ()) {
let server = HttpServer()
try! server.start(port)
defer {
server.stop()
}
try! k(server)
}
func returnJSON(object: [String: AnyObject]) -> HttpRequest -> HttpRespo... | mit |
SwiftGen/SwiftGen | Sources/TestUtils/Fixtures/Generated/Colors/swift5/multiple.swift | 2 | 4076 | // swiftlint:disable all
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen
#if os(macOS)
import AppKit.NSColor
internal typealias Color = NSColor
#elseif os(iOS) || os(tvOS) || os(watchOS)
import UIKit.UIColor
internal typealias Color = UIColor
#endif
// swiftlint:disable superfluous_disable_... | mit |
ayo1103/Test-Youtube-ios-player-helper | TestYoutubeIosPlayerHelper/TestYoutubeIosPlayerHelperTests/TestYoutubeIosPlayerHelperTests.swift | 1 | 951 | //
// TestYoutubeIosPlayerHelperTests.swift
// TestYoutubeIosPlayerHelperTests
//
// Created by Bryan Lin on 6/23/15.
// Copyright (c) 2015 ayo1103. All rights reserved.
//
import UIKit
import XCTest
class TestYoutubeIosPlayerHelperTests: XCTestCase {
override func setUp() {
super.setUp()
... | mit |
sschiau/swift | test/Syntax/syntax_diagnostics.swift | 1 | 151 | // RUN: %target-swift-frontend -emit-syntax -primary-file %s -verify
typealias Inner: Foo // expected-error{{expected '=' in type alias declaration}}
| apache-2.0 |
frtlupsvn/Vietnam-To-Go | Pods/Former/Former/Controllers/FormViewController.swift | 1 | 1715 | //
// FomerViewController.swift
// Former-Demo
//
// Created by Ryo Aoyama on 7/23/15.
// Copyright © 2015 Ryo Aoyama. All rights reserved.
//
import UIKit
public class FormViewController: UIViewController {
// MARK: Public
public let tableView: UITableView = {
let tableView = UITableVie... | mit |
zapdroid/RXWeather | Pods/RxCocoa/RxCocoa/Traits/SharedSequence/Variable+SharedSequence.swift | 1 | 632 | //
// Variable+SharedSequence.swift
// RxCocoa
//
// Created by Krunoslav Zaher on 12/28/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
#if !RX_NO_MODULE
import RxSwift
#endif
extension Variable {
/// Converts `Variable` to `SharedSequence` unit.
///
/// - returns: Observable seq... | mit |
Acidburn0zzz/firefox-ios | SyncTests/MockSyncServerTests.swift | 11 | 9156 | /* 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
import Account
import Storage
@testable import Sync
import UIKit
import XCTest
class MockSyncServe... | mpl-2.0 |
mluisbrown/Memories | Core/Sources/Utilities/UIButton.swift | 1 | 657 | import UIKit
extension UIButton {
public static func circlePlayButton(diameter: CGFloat) -> UIButton {
let button = UIButton(type: .custom)
button.frame = CGRect(origin: .zero, size: CGSize(width: diameter, height: diameter))
let circleImageNormal = CAShapeLayer.circlePlayShape(fil... | mit |
practicalswift/swift | benchmark/single-source/ArraySetElement.swift | 2 | 1244 | //===--- ArraySetElement.swift ---------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/... | apache-2.0 |
legendecas/Rocket.Chat.iOS | Rocket.Chat.Shared/Models/Base/BaseModel.swift | 1 | 364 | //
// BaseModel.swift
// Rocket.Chat
//
// Created by Rafael K. Streit on 7/8/16.
// Copyright © 2016 Rocket.Chat. All rights reserved.
//
import Foundation
import RealmSwift
import SwiftyJSON
public class BaseModel: Object {
dynamic var identifier: String?
public override static func primaryKey() -> Str... | mit |
priyanka16/RPChatUI | RPChatUI/Classes/TimeSlotTableViewCell.swift | 1 | 3881 | //
// TimeSlotTableViewCell.swift
//
//
// Created by Priyanka
// Copyright © 2017 __MyCompanyName__. All rights reserved.
//
import UIKit
let timeTabletWidth: CGFloat = 150
let timeTabletHeight: CGFloat = 50
fileprivate let itemsPerRow: CGFloat = 3
protocol TimeSlotTableViewCellDelegate : class {
func didS... | mit |
lerigos/music-service | iOS_9/Pods/SwiftyVK/Source/SDK/Models/Error.swift | 2 | 2783 | import Foundation
public class _VKError : ErrorType, CustomStringConvertible {
public var domain : String
public var code: Int
public var desc : String
public var userInfo : [NSObject: AnyObject]?
///The reference to a request to the API, in which the error occurred
public var request : Request?
public... | apache-2.0 |
jpsachse/mensa-griebnitzsee | Mensa Griebnitzsee/ViewController.swift | 1 | 6479 | //
// ViewController.swift
// Mensa Griebnitzsee
//
// Copyright © 2017 Jan Philipp Sachse. All rights reserved.
//
import UIKit
import MensaKit
class ViewController: UICollectionViewController {
let menuLoader = MenuLoader()
var loadedMenu: Menu?
let dateFormatter = DateFormatter()
let refreshControl =... | mit |
adamnemecek/AudioKit | Sources/AudioKit/Internals/Hardware/Device.swift | 1 | 2809 | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
#if os(macOS)
/// DeviceID isan AudioDeviceID on macOS
public typealias DeviceID = AudioDeviceID
#else
/// DeviceID is a string on iOS
public typealias DeviceID = String
#endif
import AVFoundation
/// Wrapper for aud... | mit |
nathantannar4/Parse-Dashboard-for-iOS-Pro | Parse Dashboard for iOS/Models/DeepLink.swift | 1 | 3092 | //
// DeepLink.swift
// Parse Dashboard for iOS
//
// Copyright © 2017 Nathan Tannar.
//
// 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 limita... | mit |
spark/photon-tinker-ios | Photon-Tinker/Global/Extensions/ParticleDevice.swift | 1 | 6166 | //
// Created by Raimundas Sakalauskas on 2019-05-09.
// Copyright (c) 2019 Particle. All rights reserved.
//
import Foundation
extension ParticleDevice {
func isRunningTinker() -> Bool {
if (self.connected && self.functions.contains("digitalread") && self.functions.contains("digitalwrite") && self.functi... | apache-2.0 |
ObjectAlchemist/OOUIKit | Sources/Screen/ScreenOR.swift | 1 | 1717 | //
// ScreenOR.swift
// OOSwift
//
// Created by Karsten Litsche on 01.09.17.
//
//
import UIKit
import OOBase
/**
A screen container that displays primary OR secondary child content depending on condition.
The container listens for changes in the adapter and updates content automatically.
*/
public final clas... | mit |
sekouperry/bemyeyes-ios | BeMyEyes/Source/Other sources/KeychainAccess/Keychain.swift | 2 | 136516 | //
// Keychain.swift
// KeychainAccess
//
// Created by kishikawa katsumi on 2014/12/24.
// Copyright (c) 2014 kishikawa katsumi. All rights reserved.
//
import Foundation
import Security
public let KeychainAccessErrorDomain = "com.kishikawakatsumi.KeychainAccess.error"
public enum ItemClass {
case GenericPa... | mit |
M2Mobi/Marky-Mark | Package.swift | 1 | 445 | // swift-tools-version:5.0
import PackageDescription
let package = Package(
name: "Marky-Mark",
platforms: [
.iOS("8.0"),
],
products: [
.library(
name: "markymark",
targets: ["markymark"]),
],
dependencies: [],
targets: [
.target(
... | mit |
SeriousChoice/SCSwift | SCSwift/Form/SCAttachmentTableCell.swift | 1 | 3539 | //
// SCAttachmentTableCell.swift
// SCSwiftExample
//
// Created by Nicola Innocenti on 08/01/2022.
// Copyright © 2022 Nicola Innocenti. All rights reserved.
//
import UIKit
class SCAttachmentTableCell: UITableViewCell {
public var lblTitle: UILabel = {
let label = UILabel()
label.numbe... | mit |
Automattic/Automattic-Tracks-iOS | Tests/Tests/TracksEventPersistenceServiceTests.swift | 1 | 7342 | @testable import AutomatticTracks
import XCTest
import SwiftUI
class TracksEventPersistenceServiceTests: XCTestCase {
// MARK: - Helper methods
func createTestTracksEvent(_ uuid: UUID) -> TracksEvent {
let event = TracksEvent()
event.uuid = uuid
event.eventName = "test_event_name"
... | gpl-2.0 |
mattermost/mattermost-mobile | ios/MattermostShare/Views/ErrorViews/NoServersView.swift | 1 | 667 | //
// NoServersView.swift
// MattermostShare
//
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
//
import SwiftUI
struct NoServersView: View {
var body: some View {
VStack (spacing: 8) {
Text("Not connected to any servers")
.font(Fo... | apache-2.0 |
michaello/Aloha | AlohaGIF/ImagePicker/ImageGallery/ImageGalleryView.swift | 1 | 8360 | import UIKit
import Photos
fileprivate func < <T: Comparable>(lhs: T?, rhs: T?) -> Bool {
switch (lhs, rhs) {
case let (l?, r?):
return l < r
case (nil, _?):
return true
default:
return false
}
}
protocol ImageGalleryPanGestureDelegate: class {
func panGestureDidStart()
func panGestureDidCh... | mit |
eleks/rnd-nearables-wearables | iOS/BeaconMe/BeaconMe/Model/Favorites.swift | 1 | 1792 | //
// Favorites.swift
// BeaconMe
//
// Created by Bogdan Shubravyi on 7/27/15.
// Copyright (c) 2015 Eleks. All rights reserved.
//
import UIKit
class Favorites {
private let favoritesKey = "Favorites"
private var cache: Array<String> = []
private var queue = dispatch_queue_create("favoritesQueu... | mit |
wjk/SwiftXPC | SwiftXPC/Transport/Connection.swift | 1 | 3458 | //
// Connection.swift
// DOS Prompt
//
// Created by William Kent on 7/28/14.
// Copyright (c) 2014 William Kent. All rights reserved.
//
import Foundation
import dispatch
import XPC
public final class XPCConnection : XPCObject {
public class func createAnonymousConnection() -> XPCConnection {
return... | mit |
andrewgrant/Playgrounds | Variadic.playground/Contents.swift | 1 | 492 | //: Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
func arrayVarAgs(args :[CVarArgType])
{
let num = args.count
print(String(format: "Vags1 got %d objects", num))
}
func rawVarArgs(args : CVarArgType...)
{
let num = args.count
print(String(forma... | mit |
Vadimkomis/Myclok | Pods/Auth0/Auth0/ResponseType.swift | 2 | 2048 | // ResponseType.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 rights
// t... | mit |
fsproru/ScoutReport | ScoutReport/Presenter.swift | 1 | 552 | import UIKit
protocol PresenterType {
func present(underlyingViewController underlyingViewController: UIViewController, viewControllerToPresent: UIViewController, animated: Bool, completion: (() -> Void)?)
}
class Presenter: PresenterType {
func present(underlyingViewController underlyingViewController: UIVie... | mit |
debugsquad/metalic | metalic/Model/Filters/Basic/MFiltersItemBasicGothic.swift | 1 | 449 | import Foundation
class MFiltersItemBasicGothic:MFiltersItem
{
private let kImageName:String = "assetFilterGothic"
private let kCommitable:Bool = true
required init()
{
let name:String = NSLocalizedString("MFiltersItemBasicGothic_name", comment:"")
let filter:MetalFilter.Type = Met... | mit |
austinzheng/swift-compiler-crashes | fixed/25382-swift-typechecker-overapproximateosversionsatlocation.swift | 7 | 230 | // 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{var b{class A{var f=[0}}protocol A{}struct A{let a{A{
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/14222-swift-sourcemanager-getmessage.swift | 11 | 249 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
( {
extension NSSet {
{
}
protocol b {
class A {
struct B {
init {
class
case ,
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/17715-swift-sourcemanager-getmessage.swift | 11 | 253 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
enum b {
func c
( ) -> {
protocol a {
let start = [Void{
}
{
class A {
class
case ,
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/13190-swift-sourcemanager-getmessage.swift | 11 | 255 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
extension String {
var d = {
protocol b {
{
}
struct A {
{
}
{
}
let a {
class
case ,
| mit |
kiliankoe/catchmybus | catchmybus/ConnectionManager.swift | 1 | 3255 | //
// ConnectionManager.swift
// catchmybus
//
// Created by Kilian Koeltzsch on 13/01/15.
// Copyright (c) 2015 Kilian Koeltzsch. All rights reserved.
//
import Foundation
import SwiftyJSON
private let _ConnectionManagerSharedInstace = ConnectionManager()
class ConnectionManager {
// ConnectionManager is a si... | mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/23686-swift-parser-consumetoken.swift | 10 | 222 | // 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 a{class A{func a{
{
enum S
}
class
case c,{
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/20608-no-stacktrace.swift | 11 | 214 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
[ {
let a {
struct d {
deinit {
class
case ,
| mit |
emilstahl/swift | validation-test/compiler_crashers_fixed/0372-swift-declcontext-lookupqualified.swift | 13 | 252 | // 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
enum S<T where g: c() -> {
var d = F
| apache-2.0 |
hotpoor-for-Liwei/LiteOS_Hackathon | Hakcathon_170108_哆啦I梦_wifind/ios/hackhuawei/LoginViewController.swift | 2 | 6290 | //
// ViewController.swift
// hackhuawei
//
// Created by 曾兆阳 on 2017/1/2.
// Copyright © 2017年 曾兆阳. All rights reserved.
//
import UIKit
class LoginViewController: UIViewController, UITextFieldDelegate {
var backgroundView: UIImageView?
var whiteView: UIImageView?
var logoView: UIImageView?
... | bsd-3-clause |
ciiqr/contakt | contakt/contakt/Contact+photoOrDefault.swift | 1 | 390 | //
// Contact+photoOrDefault.swift
// contakt
//
// Created by William Villeneuve on 2016-01-22.
// Copyright © 2016 William Villeneuve. All rights reserved.
//
import UIKit
extension Contact
{
func photoOrDefault() -> UIImage {
if let photo = self.photo {
return photo
}
el... | unlicense |
pepibumur/Szimpla | Example/ServerTests/ServerSpec.swift | 1 | 2042 | import XCTest
import Quick
import Nimble
import Swifter
@testable import Szimpla
class ServerSpec: QuickSpec {
override func spec() {
var subject: Server!
var httpServer: MockServer!
beforeEach {
httpServer = MockServer()
subject = Server(server: h... | mit |
cnoon/swift-compiler-crashes | crashes-duplicates/09373-swift-sourcemanager-getmessage.swift | 11 | 206 | // 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 end = ( {
if true {
class
case ,
| mit |
terflogag/OpenSourceController | Sources/OpenSourceControllerConfig.swift | 1 | 1148 | //
// OpenSourceControllerConfig.swift
// Pods
//
// Created by Florian Gabach on 08/03/2017.
import UIKit
/// Simple struct to hold settings
public struct OpenSourceControllerConfig {
/// Sub-stuct holding configuration relevant to UI presentation !
public struct UIConfig {
/// Will be applied... | mit |
googlearchive/cannonball-ios | Cannonball/Theme.swift | 1 | 2404 | //
// Copyright (C) 2018 Google, Inc. and other contributors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless require... | apache-2.0 |
cnoon/swift-compiler-crashes | crashes-duplicates/05209-swift-sourcemanager-getmessage.swift | 11 | 373 | // 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 d = {
class a<T {
class func f: C {
struct Q<d where T : NSObject {
}
typealias e {
protocol A {
let f = [Void{
return "\() -> ("[Void{
... | mit |
danielsaidi/KeyboardKit | Sources/KeyboardKit/Extensions/String+Chars.swift | 1 | 246 | //
// String+Chars.swift
// KeyboardKit
//
// Created by Daniel Saidi on 2021-02-03.
// Copyright © 2021 Daniel Saidi. All rights reserved.
//
import Foundation
extension String {
var chars: [String] { self.map { String($0) } }
}
| mit |
Goro-Otsubo/SimpleTVApp | SimpleTVApp/AppDelegate.swift | 1 | 717 | //
// AppDelegate.swift
// SimpleTVApp
//
// Created by 大坪五郎 on 2015/12/14.
// Copyright © 2015年 Next Inc. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window:UIWindow?
func application(application: UIApplication, didFinishLa... | mit |
JasonCanCode/CRUDE-Futures | Pods/BrightFutures/BrightFutures/Future.swift | 9 | 6532 | // The MIT License (MIT)
//
// Copyright (c) 2014 Thomas Visser
//
// 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, c... | mit |
andreacremaschi/GEOSwift | Package.swift | 1 | 635 | // swift-tools-version:5.1
import PackageDescription
let package = Package(
name: "GEOSwift",
platforms: [.iOS(.v9), .macOS(.v10_10), .tvOS(.v9)],
products: [
.library(name: "GEOSwift", targets: ["GEOSwift"])
],
dependencies: [
.package(url: "https://github.com/GEOSwift/geos.git", .... | mit |
airbnb/lottie-ios | Sources/Private/CoreAnimation/Layers/BaseCompositionLayer.swift | 3 | 2527 | // Created by Cal Stephens on 12/20/21.
// Copyright © 2021 Airbnb Inc. All rights reserved.
import QuartzCore
// MARK: - BaseCompositionLayer
/// The base type of `AnimationLayer` that can contain other `AnimationLayer`s
class BaseCompositionLayer: BaseAnimationLayer {
// MARK: Lifecycle
init(layerModel: Laye... | apache-2.0 |
victorchee/Live | Live/RTMP/Amf0.swift | 1 | 12147 | //
// Amf0.swift
// RTMP
//
// Created by VictorChee on 2016/12/21.
// Copyright © 2016年 VictorChee. All rights reserved.
//
import Foundation
class Amf0Data {
enum Amf0DataType:UInt8 {
case Amf0_Number = 0x00
case Amf0_Bool = 0x01
case Amf0_String = ... | mit |
catalanjrj/BarMate | BarMate/BarMate/LoginViewController.swift | 1 | 2661 | //
// LoginViewController.swift
// BarMate
//
// Created by Jorge Catalan on 6/10/16.
// Copyright © 2016 Jorge Catalan. All rights reserved.
//
import UIKit
import Firebase
import FirebaseAuth
class LoginViewController: UIViewController {
@IBOutlet weak var emailTextField: UITextField!
@IBOutlet weak var... | cc0-1.0 |
DerikLu/SampleSwiftProject | SampleSwiftProject/AppDelegate.swift | 1 | 2349 | //
// AppDelegate.swift
// SampleSwiftProject
//
// Created by CGO on 2014/8/9.
// Copyright (c) 2014年 DerikLu. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application:... | mit |
ozpopolam/DoctorBeaver | DoctorBeaver/PetsRepository.swift | 1 | 8647 | //
// Repository.swift
// DoctorBeaver
//
// Created by Anastasia Stepanova-Kolupakhina on 11.05.16.
// Copyright © 2016 Anastasia Stepanova-Kolupakhina. All rights reserved.
//
import Foundation
import CoreData
protocol PetsRepositorySettable: class { // can get and set PetsRepository
var petsRepository: PetsR... | mit |
cdmx/MiniMancera | miniMancera/Model/Option/WhistlesVsZombies/Ground/MOptionWhistlesVsZombiesGround.swift | 1 | 611 | import Foundation
class MOptionWhistlesVsZombiesGround
{
private let lanes:[MOptionWhistlesVsZombiesGroundLane]
private let count:UInt32
init(area:MOptionWhistlesVsZombiesArea)
{
lanes = MOptionWhistlesVsZombiesGround.factoryLanes(area:area)
count = UInt32(lanes.count)
}
... | mit |
zyhndesign/SDX_DG | sdxdg/sdxdg/VipUserServerModel.swift | 1 | 612 | //
// VipUserServerModel.swift
// sdxdg
//
// Created by lotusprize on 17/4/25.
// Copyright © 2017年 geekTeam. All rights reserved.
//
import UIKit
import ObjectMapper
class VipUserServerModel: Mappable {
var resultCode:Int?
var success:Bool?
var error_code:Int?
var message:String?
var ob... | apache-2.0 |
scottrhoyt/Jolt | Tests/TestingObjects/Protocols/RandomDataTest.swift | 1 | 563 | //
// RandomDataTest.swift
// Jolt
//
// Created by Scott Hoyt on 9/24/15.
// Copyright © 2015 Scott Hoyt. All rights reserved.
//
protocol RandomDataTest {
typealias OperandType : GenRandom
func rands(count: Int, lowerBound: OperandType?, upperBound: OperandType?) -> [OperandType]
}
exte... | mit |
MBKwon/SwiftList | SwiftList/myList.swift | 1 | 3026 | //
// myList.swift
// SwiftList
//
// Created by Moonbeom KWON on 2017. 6. 15..
// Copyright © 2017년 mbkyle. All rights reserved.
//
import Foundation
indirect enum myList <A> {
case Nil
case Cons(A, myList<A>)
}
extension myList {
static func apply<T: NumericType>(values: T...) -> myList<T> {... | mit |
benlangmuir/swift | test/ScanDependencies/module_deps.swift | 4 | 7055 | // RUN: %empty-directory(%t)
// RUN: mkdir -p %t/clang-module-cache
// RUN: %target-swift-frontend -scan-dependencies -module-cache-path %t/clang-module-cache %s -o %t/deps.json -I %S/Inputs/CHeaders -I %S/Inputs/Swift -emit-dependencies -emit-dependencies-path %t/deps.d -import-objc-header %S/Inputs/CHeaders/Bridging... | apache-2.0 |
benlangmuir/swift | test/decl/circularity.swift | 4 | 3169 | // RUN: %target-typecheck-verify-swift
// N.B. Validating the pattern binding initializer for `pickMe` used to cause
// recursive validation of the VarDecl. Check that we don't regress now that
// this isn't the case.
public struct Cyclic {
static func pickMe(please: Bool) -> Int { return 42 }
public static let pi... | apache-2.0 |
insanoid/SwiftyJSONAccelerator | Core/Generator/Model-File-Components/PropertyComponent.swift | 1 | 1368 | //
// PropertyComponent.swift
// SwiftyJSONAccelerator
//
// Created by Karthik on 09/07/2016.
// Copyright © 2016 Karthikeya Udupa K M. All rights reserved.
//
import Foundation
/// A strucutre to store various attributes related to a single property.
struct PropertyComponent {
/// Name of the property.
v... | mit |
Kametrixom/Swift-SyncAsync | SyncAsync.playground/Pages/toAsync.xcplaygroundpage/Contents.swift | 1 | 3685 | //: [Previous](@previous)
import XCPlayground
//: The `toAsync` function is the reverse of the `toSync` function. It takes a synchronous function and returns its asynchronous variant
//: Let's create a synchronous function
func add(a: Int, b: Int) -> Int {
return a + b
}
//: To make it asynchronous, just call `toAsync... | mit |
adrfer/swift | validation-test/compiler_crashers_fixed/26313-llvm-densemapbase-llvm-densemap-swift-silbasicblock.swift | 13 | 275 | // RUN: not %target-swift-frontend %s -parse
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
let d{}struct Q{
protocol a:d {
{}protocol A:A {
}}struct da
| apache-2.0 |
slavapestov/swift | validation-test/compiler_crashers_fixed/28126-swift-getbuiltinvaluedecl.swift | 4 | 289 | // 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
func<{class a{enum S<T{class C{func f{{{}let a{struct S<f:f.c}}}{}var b:T
| apache-2.0 |
elpassion/el-space-ios | ELSpace/Network/ApiClient/RequestPerformer.swift | 1 | 1401 | import Alamofire
import RxSwift
protocol Requesting {
func request(_ url: URLConvertible, method: HTTPMethod, parameters: Parameters?, encoding: ParameterEncoding?, headers: HTTPHeaders?) -> Observable<Response>
}
class RequestPerformer: Requesting {
init(sessionManager: RequestWrapper) {
self.sessio... | gpl-3.0 |
joerocca/GitHawk | Classes/Settings/GithubClient+APIStatus.swift | 1 | 855 | //
// GithubClient+APIStatus.swift
// Freetime
//
// Created by Ryan Nystrom on 8/27/17.
// Copyright © 2017 Ryan Nystrom. All rights reserved.
//
import Foundation
extension GithubClient {
enum APIStatus: String {
case good, minor, major
}
func fetchAPIStatus(completion: @escaping (Result<A... | mit |
jisudong/study | Study/Study/Study_RxSwift/Platform/DataStructures/Queue.swift | 1 | 4061 | //
// Queue.swift
// Study
//
// Created by syswin on 2017/7/31.
// Copyright © 2017年 syswin. All rights reserved.
//
struct Queue<T>: Sequence {
typealias Generator = AnyIterator<T>
private let _resizeFactor = 2
private var _storage: ContiguousArray<T?>
private var _count = 0
pr... | mit |
ahoppen/swift | test/Interop/Cxx/class/inline-function-codegen/static-var-init-calls-function-irgen.swift | 4 | 417 | // RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -validate-tbd-against-ir=none | %FileCheck %s
// TODO: See why -validate-tbd-against-ir=none is needed here (SR-14069)
import StaticVarInitCallsFunction
public func getInitializedStaticVar() -> CInt {
return initializeStaticVar()
}
// ... | apache-2.0 |
kstaring/swift | validation-test/compiler_crashers_fixed/28000-swift-astcontext-getimplicitlyunwrappedoptionaldecl.swift | 11 | 440 | // 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 |
overtake/TelegramSwift | Telegram-Mac/ColdStartPasslockController.swift | 1 | 3591 | //
// ColdStartPasslockController.swift
// Telegram
//
// Created by Mikhail Filimonov on 03.11.2020.
// Copyright © 2020 Telegram. All rights reserved.
//
import Cocoa
import TGUIKit
import SwiftSignalKit
class ColdStartPasslockController: ModalViewController {
private let valueDisposable = MetaDisposable()... | gpl-2.0 |
popodidi/HTagView | HTagView/Classes/HTag.swift | 1 | 8793 | //
// HTag.swift
// Pods
//
// Created by Chang, Hao on 12/12/2016.
//
//
import UIKit
protocol HTagDelegate: class {
func tagClicked(_ sender: HTag)
func tagCancelled(_ sender: HTag)
}
public class HTag: UIView {
weak var delegate: HTagDelegate?
// MARK: - HTag Configuration
/**
Typ... | mit |
brentsimmons/Evergreen | Account/Sources/Account/FeedWrangler/FeedWranglerFeedItemId.swift | 1 | 277 | //
// File.swift
//
//
// Created by Jonathan Bennett on 2021-01-14.
//
import Foundation
struct FeedWranglerFeedItemId: Hashable, Codable {
let feedItemID: Int
enum CodingKeys: String, CodingKey {
case feedItemID = "feed_item_id"
}
}
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/11228-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
func b
{
case
( {
class A {
protocol P {
var d = [ {
{
class
case ,
| mit |
lfaoro/Cast | Cast/PreferenceManager.swift | 1 | 2386 | //
// Created by Leonardo on 10/16/15.
// Copyright © 2015 Leonardo Faoro. All rights reserved.
//
import Cocoa
// Keys in a variable to avoid mistakes
private let gistServiceKey = "gistService"
private let imageServiceKey = "imageService"
private let shortenServiceKey = "shortenService"
private let recentActionsKe... | mit |
goktugyil/EZSwiftExtensions | Sources/TimePassed.swift | 1 | 1117 | //
// TimePassed.swift
// EZSwiftExtensions
//
// Created by Jaja Yting on 24/08/2018.
// Copyright © 2018 Goktug Yilmaz. All rights reserved.
//
import Foundation
public enum TimePassed {
case year(Int)
case month(Int)
case day(Int)
case hour(Int)
case minute(Int)
case second(Int)
... | mit |
S1U/True-Random | True Random/True Random/RandomInteger.swift | 1 | 2010 | //
// RandomInteger.swift
// True Random
//
// Created by Stephen on 04/10/2017.
// Copyright © 2017 S1U. All rights reserved.
//
import Foundation
import SwiftyJSON
import Alamofire
class RandomInteger: NSObject {
private let apiURL = "https://api.random.org/json-rpc/1/invoke"
private let apiKey = "2296... | gpl-3.0 |
katsana/katsana-sdk-ios | KatsanaSDK/Manager/KatsanaAPI+Address.swift | 1 | 717 | //
// KatsanaAPI+Address.swift
// KatsanaSDK
//
// Created by Wan Ahmad Lutfi on 14/10/2016.
// Copyright © 2016 pixelated. All rights reserved.
//
import CoreLocation
extension KatsanaAPI {
public func requestAddress(for location:CLLocationCoordinate2D, completion: @escaping (KTAddress?) -> Void, failure: @es... | apache-2.0 |
huangboju/Moots | UICollectionViewLayout/Blueprints-master/Example-OSX/Common/Extensions/NSViewExtensions.swift | 1 | 1182 | import Cocoa
extension NSView {
static var defaultAnimationDuration: TimeInterval {
return 0.2
}
static var defaultAnimationTimingFunction: CAMediaTimingFunction {
return CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
}
static func animate(duration: TimeInte... | mit |
mightydeveloper/swift | validation-test/compiler_crashers_fixed/1176-swift-constraints-constraintsystem-matchtypes.swift | 13 | 392 | // 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
struct j<d : Sequencpe> {
func f<d>() -> [j<d>] {
func f<e>() -> (e, e -> e) -> e {
{
{
f
}
}
protocol f ... | apache-2.0 |
coolsamson7/inject | Inject/xml/Ancestor.swift | 1 | 387 | //
// Ancestor.swift
// Inject
//
// Created by Andreas Ernst on 18.07.16.
// Copyright © 2016 Andreas Ernst. All rights reserved.
//
// classes implementing this protocol will be informaed about constructed child nodes
public protocol Ancestor {
/// informs this instance about a new child
/// - Parameter ... | mit |
ilyapuchka/SwiftNetworking | SwiftNetworking/NSData+Multipart.swift | 1 | 7842 | //
// NSData+Multipart.swift
// SwiftNetworking
//
// Created by Ilya Puchka on 11.09.15.
// Copyright © 2015 Ilya Puchka. All rights reserved.
//
import Foundation
public struct MultipartBodyItem: APIRequestDataEncodable, Equatable {
let data: NSData
let contentType: MIMEType
let headers: [HTTPHeader... | mit |
lieonCX/Live | Live/Others/Lib/RITLImagePicker/Photofiles/Photo/RITLPhotoPreviewController.swift | 1 | 1725 | //
// RITLPhotoPreviewController.swift
// RITLImagePicker-Swift
//
// Created by YueWen on 2017/1/22.
// Copyright © 2017年 YueWen. All rights reserved.
//
import UIKit
import Photos
/// 响应3D Touch的视图
class RITLPhotoPreviewController: UIViewController
{
/// 当前显示的资源对象
var showAsset : PHAsset = PHAsset()
... | mit |
cnoon/swift-compiler-crashes | crashes-duplicates/24135-swift-parser-parsedeclimport.swift | 9 | 349 | // 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 A{func a
{
{
{
{
{ {
{
{ {
( (
{:a{
{
{
[{
{( { {A{
{
{
func{ {
{
{ (
{
{
{
{(
{
{
{
a{
{
{ {
{(( : ( (
{
protocol{
{{
(({
{{{
{
{
a{
{
{
{:
{... | mit |
AlphaJian/LarsonApp | LarsonApp/LarsonApp/Class/JobDetail/WorkOrderViews/WorkOrderScrollView.swift | 1 | 5466 | //
// WorkOrderScrollView.swift
// LarsonApp
//
// Created by Perry Z Chen on 11/10/16.
// Copyright © 2016 Jian Zhang. All rights reserved.
//
import UIKit
class WorkOrderScrollView: UIView {
/*
// Only override draw() if you perform custom drawing.
// An empty implementation adversely affects perfo... | apache-2.0 |
bluquar/emoji_keyboard | EmojiKeyboard/EmojiSelectKB/KBButton.swift | 1 | 4124 | //
// KBButton.swift
// EmojiKeyboard
//
// Created by Chris Barker on 10/2/14.
// Copyright (c) 2014 Chris Barker. All rights reserved.
//
import UIKit
class KBButton: NSObject {
var parentView: UIView
var layoutManager: ButtonLayoutManager
var button: UIButton
var image: UIImageView
var... | gpl-2.0 |
AnthonyMDev/AmazonS3RequestManager | Example/Tests/AmazonS3ACLTests.swift | 2 | 12214 | //
// AmazonS3ACLTests.swift
// AmazonS3RequestManager
//
// Created by Anthony Miller on 6/9/15.
// Copyright (c) 2015 Anthony Miller. All rights reserved.
//
import Quick
import Nimble
import AmazonS3RequestManager
class AmazonS3ACLSpec: QuickSpec {
override func spec() {
describe("Predefi... | mit |
linhaosunny/smallGifts | 小礼品/小礼品/Classes/Module/Me/Chat/DataModel/VideoMessage.swift | 1 | 512 | //
// VideoMessage.swift
// 小礼品
//
// Created by 李莎鑫 on 2017/4/28.
// Copyright © 2017年 李莎鑫. All rights reserved.
//
import UIKit
class VideoMessage: MessageModel {
//: 视频本地路径
var path:String?
//: 视频网络路径
var url:String?
//: 视频预览图本地路径
var imagePath:String?
//: 视频预览图网络路径
... | mit |
barteljan/VISPER | VISPER-Core/Classes/ControllerProvider.swift | 1 | 1160 | //
// ControllerProvider.swift
// VISPER-Wireframe
//
// Created by bartel on 18.11.17.
//
import Foundation
/// An instance providing a controller for an specific route pattern, routing option,
/// parameter combination if it is responsible for it
public protocol ControllerProvider {
/// Checks if a Con... | mit |
vimeo/VimeoNetworking | Sources/Shared/Requests/Request+Video.swift | 1 | 4223 | //
// Request+Video.swift
// VimeoNetworkingExample-iOS
//
// Created by Huebner, Rob on 4/5/16.
// Copyright © 2016 Vimeo. 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
// i... | mit |
austinzheng/swift | test/IRGen/dependent_reabstraction.swift | 12 | 627 | // RUN: %target-swift-frontend -emit-ir %s | %FileCheck %s
func markUsed<T>(_ t: T) {}
protocol A {
associatedtype B
func b(_: B)
}
struct X<Y> : A {
// CHECK-LABEL: define internal swiftcc void @"$s23dependent_reabstraction1XVyxGAA1AA2aEP1byy1BQzFTW"(%swift.type** noalias nocapture dereferenceable({{.*}}), %T... | apache-2.0 |
zisko/swift | stdlib/public/core/Filter.swift | 1 | 14053 | //===--- Filter.swift -----------------------------------------*- swift -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | apache-2.0 |
MartinLasek/vaporberlinBE | Sources/App/Backend/Helper.swift | 1 | 601 | final class Helper {
static func validateEmail(_ email: String) -> Bool {
/// email must at least have 6 characters e.g: a@b.cd
let minLength = 6
if
email.range(of: "@") == nil ||
email.range(of: ".") == nil ||
email.count < minLength
{
return false
}
return tru... | mit |
pyromobile/nubomedia-ouatclient-src | ios/LiveTales/uoat/RoomManagerDelegate.swift | 2 | 1429 | //
// RoomManagerDelegate.swift
// uoat
//
// Created by Pyro User on 18/7/16.
// Copyright © 2016 Zed. All rights reserved.
//
import Foundation
protocol RoomManagerDelegate:class
{
func roomManagerDidFinish(broker:RoomManager);
func roomManager(broker:RoomManager, didAddLocalStream localStream:RTCM... | apache-2.0 |
jmgc/swift | test/IRGen/builtins.swift | 1 | 36474 |
// RUN: %target-swift-frontend -module-name builtins -parse-stdlib -disable-access-control -primary-file %s -emit-ir -o - -disable-objc-attr-requires-foundation-module | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-runtime
// REQUIRES: CPU=x86_64
import Swift
// CHECK-DAG: [[REFCOUNT:%swift.refc... | apache-2.0 |
exyte/Macaw | Source/animation/layer_animation/FuncBounds.swift | 1 | 2753 | func solveEquation(a: Double, b: Double, c: Double) -> (s1: Double?, s2: Double?) {
let epsilon: Double = 0.000000001
if abs(a) < epsilon {
if abs(b) < epsilon {
return (.none, .none)
}
let s = -c / b
if 0.0 < s && s < 1.0 {
return (s, .none)
}
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.