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 |
|---|---|---|---|---|---|
mcgraw/dojo-custom-camera | dojo-custom-camera/XMCCameraViewController.swift | 3 | 3787 | //
// XMCCameraViewController.swift
// dojo-custom-camera
//
// Created by David McGraw on 11/13/14.
// Copyright (c) 2014 David McGraw. All rights reserved.
//
import UIKit
import AVFoundation
enum Status: Int {
case Preview, Still, Error
}
class XMCCameraViewController: UIViewController, XMCCameraDelegate ... | mit |
GabrielGhe/SwiftProjects | App13CardTilt/CardTilt/TipInCellAnimator.swift | 1 | 1464 | //
// TipInCellAnimator.swift
// CardTilt
//
// Created by Gabriel Gheorghian on 2014-09-08.
// Copyright (c) 2014 RayWenderlich.com. All rights reserved.
//
import UIKit
import QuartzCore
let TipInCellAnimatorStartTransform:CATransform3D = {
// Variables
let rotationDegrees: CGFloat = -15.0
let rotat... | mit |
ihomway/RayWenderlichCourses | Intermediate Swift 3/Intermediate Swift 3.playground/Pages/Classes Challenge.xcplaygroundpage/Contents.swift | 1 | 892 | //: [Previous](@previous)
import UIKit
/*:
#### Intermediate Swift Video Tutorial Series - raywenderlich.com
#### Video 5: Classes
**Note:** If you're seeing this text as comments rather than nicely-rendered text, select Editor\Show Rendered Markup in the Xcode menu.
Make the following objects and determine whether... | mit |
sadawi/PrimarySource | Pod/iOS/ValueFieldCell.swift | 1 | 776 | //
// ValueFieldCell.swift
// Pods
//
// Created by Sam Williams on 3/14/17.
//
//
import UIKit
/**
Any cell that presents its value as a string that is not directly editable.
*/
open class ValueFieldCell<Value:Equatable>: FieldCell<Value> {
open var options:[Value] = [] {
didSet {
s... | mit |
wordpress-mobile/WordPress-iOS | WordPress/Classes/Utility/Media/MediaThumbnailExporter.swift | 2 | 11255 | import Foundation
import MobileCoreServices
/// Media export handling of thumbnail images from videos or images.
///
class MediaThumbnailExporter: MediaExporter {
/// Directory type for the ThumbnailExporter, defaults to the .cache directory.
///
var mediaDirectoryType: MediaDirectory = .cache
// MAR... | gpl-2.0 |
Roommate-App/roomy | roomy/Pods/Starscream/Sources/WebSocket.swift | 2 | 54234 | //////////////////////////////////////////////////////////////////////////////////////////////////
//
// Websocket.swift
//
// Created by Dalton Cherry on 7/16/14.
// Copyright (c) 2014-2017 Dalton Cherry.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in ... | mit |
Cleverlance/Pyramid | Example/Tests/Scope Management/Application/InstanceProviderImplTests.swift | 1 | 1303 | //
// Copyright © 2016 Cleverlance. All rights reserved.
//
import XCTest
import Nimble
import Pyramid
class InstanceProviderImplTests: XCTestCase {
func test_ItConformsToInstanceProvider() {
let _: InstanceProvider<Int>? = (nil as InstanceProviderImpl<Int>?)
}
func test_ItDependsOnScopeControl... | mit |
narner/AudioKit | Examples/iOS/Drums/Drums/AppDelegate.swift | 1 | 2170 | //
// AppDelegate.swift
// Drums
//
// Created by Aurelius Prochazka on 8/13/17.
// Copyright © 2017 AudioKit. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLau... | mit |
GermanCentralLibraryForTheBlind/LargePrintMusicNotes | LargePrintMusicNotesViewer/PdfViewerController.swift | 1 | 2561 | // Created by Lars Voigt.
//
//The MIT License (MIT)
//Copyright (c) 2016 German Central Library for the Blind (DZB)
//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, inclu... | mit |
lenssss/whereAmI | Whereami/Controller/Personal/PublishTourPhotoCollectionTableViewCell.swift | 1 | 4600 | //
// PublishTourPhotoCollectionTableViewCell.swift
// Whereami
//
// Created by A on 16/4/28.
// Copyright © 2016年 WuQifei. All rights reserved.
//
import UIKit
//import TZImagePickerController
class PublishTourPhotoCollectionTableViewCell: UITableViewCell,UICollectionViewDataSource,UICollectionViewDelegate,UICo... | mit |
GermanCentralLibraryForTheBlind/LargePrintMusicNotes | LargePrintMusicNotesViewer/RESTConnector.swift | 1 | 5168 | // Created by Lars Voigt.
//
//The MIT License (MIT)
//Copyright (c) 2016 German Central Library for the Blind (DZB)
//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, inclu... | mit |
apple/swift-experimental-string-processing | Sources/_StringProcessing/Engine/Consume.swift | 1 | 1521 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2021-2022 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LIC... | apache-2.0 |
bsmith11/ScoreReporter | ScoreReporterCore/ScoreReporterCore/View Models/GameViewModel.swift | 1 | 2366 | //
// GameViewModel.swift
// ScoreReporter
//
// Created by Bradley Smith on 9/25/16.
// Copyright © 2016 Brad Smith. All rights reserved.
//
import Foundation
import UIKit
public enum GameViewState {
case full
case normal
case minimal
}
public struct GameViewModel {
public let game: Game?
pu... | mit |
kenshin03/Cherry | Cherry/Shared/Utils/KTActivityManager.swift | 5 | 8784 | //
// KTActivityManager.swift
// Cherry
//
// Created by Kenny Tang on 2/22/15.
//
//
import UIKit
protocol KTActivityManagerDelegate {
func activityManager(manager:KTActivityManager?, activityDidUpdate model:KTPomodoroActivityModel?)
func activityManager(manager:KTActivityManager?, activityDidPauseForBrea... | mit |
czechboy0/swift-package-crawler | Sources/DataUpdater/main.swift | 1 | 361 |
import Utils
import Foundation
import Tasks
//in Cache folder, git add everything, commit with the timestamp, push to remote
do {
print("DataUpdater starting")
defer { print("DataUpdater finished") }
let cacheRoot = try cacheRootPath()
try ifChangesCommitAndPush(repoPath: try cacheRootPath())
... | mit |
apple/swift-package-manager | Sources/PackageModel/Snippets/Model/Snippet.swift | 2 | 1197 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2014-2021 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 |
balthild/Mathemalpha | Mathemalpha/SchemesView.swift | 1 | 1120 | //
// TypesView.swift
// Mathemalpha
//
// Created by Balthild Ires on 18/09/2017.
// Copyright © 2017 Balthild Ires. All rights reserved.
//
import Cocoa
class SchemesView: NSView {
var selected = 0
override func draw(_ dirtyRect: NSRect) {
super.draw(dirtyRect)
var y: CGFloat = 0
... | gpl-3.0 |
apple/swift-async-algorithms | Sources/AsyncAlgorithms/AsyncChannel.swift | 1 | 8882 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Async Algorithms open source project
//
// Copyright (c) 2022 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift... | apache-2.0 |
kbelter/SnazzyList | SnazzyList/Classes/src/TableView/Protocols/GenericTableCellSelfSizingProtocol.swift | 1 | 311 | //
// TableView.swift
// Noteworth2
//
// Created by Kevin on 12/20/18.
// Copyright © 2018 Noteworth. All rights reserved.
//
import UIKit
public protocol GenericTableCellSelfSizingProtocol {
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath, with item: Any) -> CGFloat
}
| apache-2.0 |
eduardoeof/Gollum | Gollum/dao/VersionDAOProtocol.swift | 1 | 388 | //
// VersionDAOProtocol.swift
// Gollum
//
// Created by eduardo.ferreira on 6/1/16.
// Copyright © 2016 eduardoeof. All rights reserved.
//
import Foundation
protocol VersionDAOProtocol {
func saveSelectedVersion(_ version: Version, testName name: String)
func didSelectVersionForTest(_ name: String) -> ... | mit |
coderMONSTER/ioscelebrity | YStar/YStar/Scenes/Controller/SetPayPwdVC.swift | 1 | 7655 | //
// SetPayPwdVC.swift
// YStar
//
// Created by MONSTER on 2017/7/18.
// Copyright © 2017年 com.yundian. All rights reserved.
//
import UIKit
import SVProgressHUD
fileprivate func < <T : Comparable>(lhs: T?, rhs: T?) -> Bool {
switch (lhs, rhs) {
case let (l?, r?):
return l < r
case (nil, _?)... | mit |
kz56cd/ios_sandbox_animate | IosSandboxAnimate/CustomParts/BottomShadowButton.swift | 1 | 776 | //
// BottomShadowButton.swift
// e-park
//
// Created by KaiKeima on 2015/12/22.
// Copyright © 2015年 OHAKO,inc. All rights reserved.
//
import UIKit
@IBDesignable class BottomShadowButton: UIButton {
override func drawRect(rect: CGRect) {
self.layer.backgroundColor = self.backgroundCol... | mit |
ashikahmad/SugarAnchor | Example/Tests/ActiveLessEqualConstraintsTests.swift | 1 | 3814 | //
// ActiveLessEqualConstraintsTests.swift
// SugarAnchor
//
// Created by Ashik uddin Ahmad on 5/14/17.
// Copyright © 2017 CocoaPods. All rights reserved.
//
import UIKit
import XCTest
import SugarAnchor
class ActiveLessEqualConstraintsTests: XCTestCase {
var containerView: UIView!
var view1: UIView!
... | mit |
tad-iizuka/swift-sdk | Source/RetrieveAndRankV1/Models/SearchResponse.swift | 3 | 3712 | /**
* Copyright IBM Corporation 2016
*
* 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 |
imitationgame/pokemonpassport | pokepass/View/Create/VCreateFinder.swift | 1 | 5961 | import UIKit
class VCreateFinder:UIView, UITextFieldDelegate
{
weak var controller:CCreate!
weak var field:UITextField!
convenience init(controller:CCreate)
{
self.init()
self.controller = controller
clipsToBounds = true
backgroundColor = UIColor.white
trans... | mit |
FuckBoilerplate/RxCache | iOS/Pods/Nimble/Sources/Nimble/Adapters/NMBObjCMatcher.swift | 140 | 3116 | import Foundation
#if _runtime(_ObjC)
public typealias MatcherBlock = (_ actualExpression: Expression<NSObject>, _ failureMessage: FailureMessage) -> Bool
public typealias FullMatcherBlock = (_ actualExpression: Expression<NSObject>, _ failureMessage: FailureMessage, _ shouldNotMatch: Bool) -> Bool
public class NMBO... | mit |
practicalswift/swift | validation-test/Reflection/existentials_objc.swift | 2 | 759 | // RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/existentials_objc
// RUN: %target-codesign %t/existentials_objc
// RUN: %target-run %target-swift-reflection-test %t/existentials_objc | %FileCheck %s
// REQUIRES: objc_interop
// REQUIRES: executable_test
import Foundation
... | apache-2.0 |
victor-pavlychko/Encoder | Encoder/EncodableAsIdentity.swift | 1 | 1110 | //
// EncodableAsIdentity.swift
// Encoder
//
// Created by Victor Pavlychko on 12/8/16.
// Copyright © 2016 address.wtf. All rights reserved.
//
import Foundation
public protocol EncodableAsIdentity: Encodable { }
public extension EncodableAsIdentity {
public func encode() -> Encoder {
return Encod... | mit |
blockchain/My-Wallet-V3-iOS | Modules/FeatureCardIssuing/Sources/FeatureCardIssuingDomain/Services/TransactionService.swift | 1 | 626 | // Copyright © Blockchain Luxembourg S.A. All rights reserved.
import Combine
import Errors
import Foundation
final class TransactionService: TransactionServiceAPI {
private let repository: TransactionRepositoryAPI
init(
repository: TransactionRepositoryAPI
) {
self.repository = reposito... | lgpl-3.0 |
keygx/ButtonStyleKit | ButtonStyleKitSample/ButtonStyleKit/ButtonStyleStandardBase.swift | 1 | 798 | //
// ButtonStyleStandardBase.swift
// ButtonStyleKit
//
// Created by keygx on 2016/08/04.
// Copyright © 2016年 keygx. All rights reserved.
//
import UIKit
open class ButtonStyleStandardBase: ButtonStyleKit {
override public final var isEnabled: Bool {
set {
if newValue {
... | mit |
Groupr-Purdue/Groupr-Backend | Sources/Library/Models/Course.swift | 1 | 2373 | import Vapor
import Fluent
import HTTP
public final class Course: Model {
public var id: Node?
public var exists: Bool = false
/// The course's name (i.e. 'CS 408').
public var name: String
/// The course's title (i.e. 'Software Testing').
public var title: String
/// The course's curren... | mit |
urbn/URBNValidator | URBNValidator.playground/Pages/Object Validation.xcplaygroundpage/Contents.swift | 1 | 1040 | //: [Block Rules](@previous)
/*:
# Object Validation
This is what it's all about. Here we're
giving a map of keys to rules, and validating against them
*/
import Foundation
import URBNValidator
class Tester: Validateable {
typealias V = AnyObject
var requiredString: String?
var children = [String]()
... | mit |
googlearchive/science-journal-ios | ScienceJournalTests/WrappedModels/ExperimentLibraryTest.swift | 1 | 8488 | /*
* Copyright 2019 Google LLC. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | apache-2.0 |
mrchenhao/American-TV-Series-Calendar | American-tv-series-calendar/SettingTableViewController.swift | 1 | 6565 | //
// SettingTableViewController.swift
// American-tv-series-calendar
//
// Created by ChenHao on 10/27/15.
// Copyright © 2015 HarriesChen. All rights reserved.
//
import UIKit
import EventKitUI
class SettingTableViewController: UITableViewController {
var showStart: Bool = false
var showEnd: Bool =... | mit |
mleiv/IBStyler | Initial Code Files/IBStyles/IBStylable.swift | 2 | 812 | //
// IBStylable.swift
//
// Created by Emily Ivie on 3/4/15.
//
// Licensed under The MIT License
// For full copyright and license information, please see http://opensource.org/licenses/MIT
// Redistributions of files must retain the above copyright notice.
import UIKit
/// Protocol for stylable UIKit elements... | mit |
rringham/ios-motion-machinelearning | src/MotionMachineLearning/MotionMachineLearning/AppDelegate.swift | 1 | 2151 | //
// AppDelegate.swift
// MotionMachineLearning
//
// Created by Rob Ringham on 1/4/16.
// Copyright © 2016 Ringham. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFin... | mit |
mro/ShaarliOS | swift4/ShaarliOS/3rd/Disposable.swift | 1 | 1516 | // https://github.com/ReactiveX/RxSwift/blob/master/RxSwift/Disposable.swift
// Disposable.swift
// RxSwift
//
// Created by Krunoslav Zaher on 2/8/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
/*
import Foundation
/// Represents a disposable resource.
public protocol Disposable {
/// Dispo... | gpl-3.0 |
airspeedswift/swift | test/SourceKit/CodeComplete/complete_checkdeps_avoid_check.swift | 4 | 2606 | import ClangFW
import SwiftFW
func foo() {
/*HERE*/
}
// Checks that, due to default check delay, a modification will be ignored and fast completion will still activate.
// REQUIRES: shell
// RUN: %empty-directory(%t/Frameworks)
// RUN: %empty-directory(%t/MyProject)
// RUN: COMPILER_ARGS=( \
// RUN: -target %t... | apache-2.0 |
JuanjoArreola/AllCache | Sources/ImageCache/ImageResizer.swift | 1 | 3133 | //
// ImageResizer.swift
// ImageCache
//
// Created by JuanJo on 31/08/20.
//
import Foundation
import AllCache
#if os(OSX)
import AppKit
#elseif os(iOS) || os(tvOS) || os(watchOS)
import UIKit
#endif
public enum ImageProcessError: Error {
case resizeError
}
private let resizeFunctions: [DefaultImageRes... | mit |
tache/SwifterSwift | Tests/SwiftStdlibTests/StringExtensionsTests.swift | 1 | 18711 | //
// StringExtensionsTests.swift
// SwifterSwift
//
// Created by Omar Albeik on 8/27/16.
// Copyright © 2016 SwifterSwift
//
import XCTest
@testable import SwifterSwift
final class StringExtensionsTests: XCTestCase {
override func setUp() {
super.setUp()
NSTimeZone.default = NSTimeZone.system
}
func ... | mit |
ykws/yomblr | yomblr/CroppedViewController.swift | 1 | 1425 | //
// CroppedViewController.swift
// yomblr
//
// Created by Yoshiyuki Kawashima on 2017/06/22.
// Copyright © 2017 ykws. All rights reserved.
//
import UIKit
import TMTumblrSDK
import MBProgressHUD
import Firebase
class CroppedViewController: UIViewController {
// MARK: - Properties
var blogName: Strin... | mit |
trujillo138/MyExpenses | MyExpenses/MyExpenses/Services/ModelController.swift | 1 | 1168 | //
// ModelController.swift
// MyExpenses
//
// Created by Tomas Trujillo on 5/22/17.
// Copyright © 2017 TOMApps. All rights reserved.
//
import Foundation
class ModelController {
//MARK: Properties
var user: User
private let documentsDirectoryURL = FileManager.default.urls(for: .docum... | apache-2.0 |
tbaranes/SwiftyUtils | Sources/Protocols/Swift/Occupiable.swift | 1 | 733 | //
// Created by Tom Baranes on 24/04/16.
// Copyright © 2016 Tom Baranes. All rights reserved.
//
import Foundation
public protocol Occupiable {
var isEmpty: Bool { get }
var isNotEmpty: Bool { get }
}
extension Occupiable {
public var isNotEmpty: Bool {
!isEmpty
}
}
extension String: Occ... | mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/11776-swift-sourcemanager-getmessage.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
func a(
= {
var b = {
class A {
class
case ,
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/14435-swift-sourcemanager-getmessage.swift | 11 | 224 | // 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 h = == {
} ( [ {
case
let {
init( ) {
class
case ,
| mit |
aofan/ZKSwift | ZKSwift/ZKBaseTableViewController.swift | 1 | 5707 | //
// ZKBaseTableViewController.swift
// ZKSwift
//
// Created by lizhikai on 16/7/4.
// Copyright © 2016年 ZK. All rights reserved.
//
import UIKit
public class ZKBaseTableViewController: UITableViewController {
/// 数据源
public var dataArray : Array<AnyObject>?;
/// 是否分组
public var isGroup:Boo... | mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/03669-swift-sourcemanager-getmessage.swift | 11 | 286 | // 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: AnyObject) {
struct B<j : b { func a<f : a<T : b { func b
C([Void{
class
case c,
protocol c {
str
| mit |
ello/ello-ios | Sources/Controllers/Stream/Cells/StreamSeeMoreCommentsCell.swift | 1 | 506 | ////
/// StreamSeeMoreCommentsCell.swift
//
class StreamSeeMoreCommentsCell: CollectionViewCell {
static let reuseIdentifier = "StreamSeeMoreCommentsCell"
@IBOutlet weak var buttonContainer: UIView!
@IBOutlet weak var seeMoreButton: UIButton!
override func style() {
buttonContainer.backgroun... | mit |
yichizhang/YZLibrary | YZLibraryDemo/Pods/Nimble/Sources/Nimble/Matchers/BeEmpty.swift | 55 | 4255 | import Foundation
/// A Nimble matcher that succeeds when a value is "empty". For collections, this
/// means the are no items in that collection. For strings, it is an empty string.
public func beEmpty<S: SequenceType>() -> NonNilMatcherFunc<S> {
return NonNilMatcherFunc { actualExpression, failureMessage in
... | mit |
AliSoftware/Dip | Sources/AutoWiring.swift | 2 | 3528 | //
// Dip
//
// Copyright (c) 2015 Olivier Halligon <olivier@halligon.net>
//
// 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 |
scotlandyard/expocity | expocity/Test/Firebase/Database/Models/TFDatabaseModelUser.swift | 1 | 2362 | import XCTest
@testable import expocity
class TFDatabaseModelUser:XCTestCase
{
private let kSnapshot:[String:Any] = [
"created":1475541121.581116,
"name":"John Test",
"rooms":[
"12345",
"67890",
"34567"
]
]
//MARK: -
func tes... | mit |
EstefaniaGilVaquero/ciceIOS | App_CustomCell_Dictionary_PracticaOK/App_CustomCell_Dictionary_PracticaOK/AppDelegate.swift | 1 | 2157 | //
// AppDelegate.swift
// App_CustomCell_Dictionary_PracticaOK
//
// Created by cice on 13/6/16.
// Copyright © 2016 cice. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, ... | apache-2.0 |
Kawoou/KWDrawerController | DrawerController/Animator/DrawerCubicEaseAnimator.swift | 1 | 2213 | /*
The MIT License (MIT)
Copyright (c) 2017 Kawoou (Jungwon An)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, ... | mit |
apple/swift | benchmark/single-source/DictionarySubscriptDefault.swift | 10 | 3376 | //===--- DictionarySubscriptDefault.swift ---------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2021 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 |
rnystrom/GitHawk | Classes/Systems/LabelLayoutManager.swift | 1 | 1261 | //
// LabelLayoutManager.swift
// Freetime
//
// Created by Ryan Nystrom on 5/21/18.
// Copyright © 2018 Ryan Nystrom. All rights reserved.
//
import Foundation
final class LabelLayoutManager: NSLayoutManager {
override func fillBackgroundRectArray(_ rectArray: UnsafePointer<CGRect>, count rectCount: Int, fo... | mit |
cloudinary/cloudinary_ios | Cloudinary/Classes/Core/Features/Uploader/Requests/CLDUploadRequestWrapper.swift | 1 | 8224 | //
// CLDUploadRequestWrapper.swift
//
// Copyright (c) 2017 Cloudinary (http://cloudinary.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 witho... | mit |
cnoon/swift-compiler-crashes | crashes-duplicates/23080-swift-tupletype-get.swift | 11 | 324 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
println(1)
struct A{
let a{
deinit{
{
}
{
protocol a{
class A{
func e
{
{
protocol a{
protocol p{
let a=[{
class B{
class A{
deinit{
class
case c,
clas... | mit |
cnoon/swift-compiler-crashes | crashes-duplicates/14130-resolvetypedecl.swift | 11 | 245 | // 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( ) {
struct B<T where g: AnyObject
let a = 1 )
enum b {
var f = B? {
| mit |
cnoon/swift-compiler-crashes | crashes-duplicates/21769-no-stacktrace.swift | 11 | 217 | // 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 {
let h, f {
class
case ,
let a = == == h [
| mit |
hanhailong/practice-swift | Autolayout/BasicAutolayout/BasicAutolayoutTests/BasicAutolayoutTests.swift | 2 | 927 | //
// BasicAutolayoutTests.swift
// BasicAutolayoutTests
//
// Created by Domenico on 17.04.15.
// Copyright (c) 2015 Domenico Solazzo. All rights reserved.
//
import UIKit
import XCTest
class BasicAutolayoutTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here.... | mit |
masters3d/xswift | exercises/dominoes/Package.swift | 1 | 73 | import PackageDescription
let package = Package(
name: "Dominoes"
)
| mit |
thehung111/ViSearchSwiftSDK | Example/Example/Lib/ImageLoader/Disk.swift | 3 | 3338 | //
// Disk.swift
// ImageLoader
//
// Created by Hirohisa Kawasaki on 12/21/14.
// Copyright © 2014 Hirohisa Kawasaki. All rights reserved.
//
import Foundation
import UIKit
extension String {
public func escape() -> String? {
return addingPercentEncoding(withAllowedCharacters: .alphanumerics)
}
... | mit |
leizh007/HiPDA | HiPDA/HiPDA/Sections/Message/Converstaion/ChatViewModel.swift | 1 | 6784 | //
// ChatViewModel.swift
// HiPDA
//
// Created by leizh007 on 2017/7/3.
// Copyright © 2017年 HiPDA. All rights reserved.
//
import Foundation
import JSQMessagesViewController
import RxSwift
import SDWebImage
enum ChatMessageType {
case incoming
case outgoing
}
class ChatViewModel {
let user: User
... | mit |
rc2server/appserverSwift | Sources/Rc2AppServer/InfoHandler.swift | 1 | 1029 | //
// InfoHandler.swift
//
// Copyright ©2017 Mark Lilback. This file is licensed under the ISC license.
//
import Foundation
import PerfectHTTP
import PerfectLib
import Rc2Model
class InfoHandler: BaseHandler {
func routes() -> [Route] {
var routes = [Route]()
routes.append(Route(method: .get, uri: settings.c... | isc |
galv/reddift | reddiftSample/BaseSubredditsViewController.swift | 2 | 744 | //
// BaseSubredditsViewController.swift
// reddift
//
// Created by sonson on 2015/05/04.
// Copyright (c) 2015年 sonson. All rights reserved.
//
import Foundation
import reddift
class BaseSubredditsViewController: UITableViewController, UISearchBarDelegate {
var session:Session? = nil
var paginator:Pagin... | mit |
crewshin/GasLog | Pods/Material/Sources/MaterialRadius.swift | 2 | 2168 | /*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above... | mit |
plutoless/fgo-pluto | FgoPluto/FgoPluto/model/BaseObject.swift | 1 | 316 | //
// BaseObject.swift
// FgoPluto
//
// Created by Zhang, Qianze on 17/09/2017.
// Copyright © 2017 Plutoless Studio. All rights reserved.
//
import Foundation
import RealmSwift
import Realm
class BaseObject : Object{
internal func fillvalues(realm:Realm, data:[String:AnyObject]){
}
}
| apache-2.0 |
DingSoung/CCExtension | Sources/Swift/String+regex.swift | 2 | 1573 | // Created by Songwen Ding on 2017/8/3.
// Copyright © 2017年 DingSoung. All rights reserved.
#if canImport(Foundation)
import Foundation.NSRegularExpression
infix operator =~: AdditionPrecedence
private struct RegexHelper {
let regex: NSRegularExpression
init(_ pattern: String) throws {
try regex =... | mit |
mrdepth/EVEUniverse | Legacy/Neocom/Neocom/NCAccountTableViewCell.swift | 2 | 19492 | //
// NCAccountTableViewCell.swift
// Neocom
//
// Created by Artem Shimanski on 13.12.16.
// Copyright © 2016 Artem Shimanski. All rights reserved.
//
import UIKit
import EVEAPI
import CoreData
import Futures
class NCAccountTableViewCell: NCTableViewCell {
@IBOutlet weak var characterNameLabel: UILabel?
@IBOut... | lgpl-2.1 |
almazrafi/Metatron | Sources/ID3v2/FrameStuffs/ID3v2Comments.swift | 1 | 2024 | //
// ID3v2Comments.swift
// Metatron
//
// Copyright (c) 2016 Almaz Ibragimov
//
// 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 th... | mit |
RedRoma/Lexis | Code/Lexis/URLs+.swift | 1 | 1153 | //
// URLs+.swift
// Lexis
//
// Created by Wellington Moreno on 9/25/16.
// Copyright © 2016 RedRoma, Inc. All rights reserved.
//
import Foundation
import Archeota
extension URL
{
var string: String? { return downloadToString() }
var data: Data? { return downloadToData() }
func downloadToStrin... | apache-2.0 |
stephentyrone/swift | test/AutoDiff/Serialization/transpose_attr.swift | 3 | 2276 | // RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %s -emit-module -parse-as-library -o %t
// RUN: llvm-bcanalyzer %t/transpose_attr.swiftmodule | %FileCheck %s -check-prefix=BCANALYZER
// RUN: %target-sil-opt -disable-sil-linking -enable-sil-verify-all %t/transpose_attr.swiftmodule -o - | %FileCheck %s
// BC... | apache-2.0 |
dvxiaofan/Pro-Swift-Learning | Part-02/01-RepeatingValues.playground/Contents.swift | 1 | 339 | //: Playground - noun: a place where people can play
import UIKit
let headeing = "This is a heading"
let underline = String(repeating: "=", count: headeing.characters.count)
let equalsArray = [String](repeating: "=", count: headeing.characters.count)
var board = [[String]](repeating: [String](repeating: "", count: ... | mit |
Spriter/SwiftyHue | Sources/Base/BridgeResourceModels/Sensors/TemperatureSensor/TemperatureSensor.swift | 1 | 1890 | //
// TemperatureSensor.swift
// Pods
//
// Created by Jerome Schmitz on 01.05.16.
//
//
import Foundation
import Gloss
public class TemperatureSensor: PartialSensor {
let config: TemperatureSensorConfig
let state: TemperatureSensorState
required public init?(sensor: Sensor) {
... | mit |
mrchenhao/Queue | Queue/QueueTask.swift | 1 | 7830 | //
// QueueTask.swift
// Queue
//
// Created by ChenHao on 12/10/15.
// Copyright © 2015 HarriesChen. All rights reserved.
//
import Foundation
public typealias TaskCallBack = (QueueTask) -> Void
public typealias TaskCompleteCallback = (QueueTask, Error?) -> Void
public typealias JSONDictionary = [String: Any]
/... | mit |
Spriter/SwiftyHue | Sources/Base/BridgeResourceModels/Sensors/PresenceSensor/PresenceSensor.swift | 1 | 1808 | //
// PresenceSensor.swift
// Pods
//
// Created by Jerome Schmitz on 01.05.16.
//
//
import Foundation
import Gloss
public class PresenceSensor: PartialSensor {
let config: PresenceSensorConfig
let state: PresenceSensorState
required public init?(sensor: Sensor) {
guard let ... | mit |
sarahlee517/Mr-Ride-iOS | Mr Ride/Mr Ride/Models/RideManager.swift | 1 | 2608 | //
// RunDataModel.swift
// Mr Ride
//
// Created by Sarah on 6/6/16.
// Copyright © 2016 AppWorks School Sarah Lee. All rights reserved.
//
import Foundation
import MapKit
import CoreData
class MyLocation: CLLocation{
let longtitude: Double = 0.0
let latitude: Double = 0.0
}
struct RideData{
var to... | mit |
alexzatsepin/omim | iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RouteManager/RouteManagerTableView.swift | 12 | 868 | final class RouteManagerTableView: UITableView {
@IBOutlet private weak var tableViewHeight: NSLayoutConstraint!
enum HeightUpdateStyle {
case animated
case deferred
case off
}
var heightUpdateStyle = HeightUpdateStyle.deferred
private var scheduledUpdate: DispatchWorkItem?
override var cont... | apache-2.0 |
klundberg/swift-corelibs-foundation | Foundation/NSURLSession.swift | 1 | 40609 | // 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 l... | apache-2.0 |
benlangmuir/swift | test/SILOptimizer/Inputs/pre_specialized_module2.swift | 10 | 274 | import pre_specialized_module
@frozen
public struct SomeOtherData {
public init() {}
}
@_specialize(exported: true, target: publicPrespecialized2(_:), availability: macOS 10.50, *; where T == SomeOtherData)
public func pre_specialize_publicPrespecialized<T>(_ t: T) {
}
| apache-2.0 |
eugenepavlyuk/swift-algorithm-club | GCD/GCD.playground/Contents.swift | 8 | 577 | //: Playground - noun: a place where people can play
// Recursive version
func gcd(_ a: Int, _ b: Int) -> Int {
let r = a % b
if r != 0 {
return gcd(b, r)
} else {
return b
}
}
/*
// Iterative version
func gcd(m: Int, _ n: Int) -> Int {
var a = 0
var b = max(m, n)
var r = min(m, n)
while r !=... | mit |
rabbitinspace/Sweetend | Sources/App/Server/Endpoint.swift | 1 | 229 | import Vapor
enum Endpoint: String {
case auth
}
extension Droplet {
func resource<Resource: ResourceRepresentable>(_ endpoint: Endpoint, resource: Resource) {
self.resource(endpoint.rawValue, resource)
}
}
| mit |
phakphumi/Chula-Expo-iOS-Application | Chula Expo 2017/Chula Expo 2017/FacultyDescCell.swift | 1 | 1390 | //
// FacultyDescCell.swift
// Chula Expo 2017
//
// Created by NOT on 2/26/2560 BE.
// Copyright © 2560 Chula Computer Engineering Batch#41. All rights reserved.
//
import UIKit
class FacultyDescCell: UITableViewCell {
var facityTitle: String? {
didSet{
updateUI()
}
... | mit |
tottakai/RxSwift | RxCocoa/macOS/NSTextField+Rx.swift | 8 | 3223 | //
// NSTextField+Rx.swift
// RxCocoa
//
// Created by Krunoslav Zaher on 5/17/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
#if os(macOS)
import Foundation
import Cocoa
#if !RX_NO_MODULE
import RxSwift
#endif
/// Delegate proxy for `NSTextField`.
///
/// For more information take a look at `D... | mit |
wordpress-mobile/WordPress-iOS | WordPress/Classes/ViewRelated/Gutenberg/Collapsable Header/CollapsableHeaderView.swift | 2 | 420 | import UIKit
class CollapsableHeaderView: UIView {
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
guard let result = super.hitTest(point, with: event),
result.isUserInteractionEnabled,
result != self // Ignore touches for self but accept them for the ... | gpl-2.0 |
royhsu/tiny-core | Sources/Core/Auth/Basic+HTTPHeaderRepresentable.swift | 1 | 522 | //
// Basic+HTTPHeaderRepresentable.swift
// TinyCore
//
// Created by Roy Hsu on 2019/3/16.
// Copyright © 2019 TinyWorld. All rights reserved.
//
// MARK: - HTTPHeaderRepresentable
extension Basic: HTTPHeaderRepresentable {
public func httpHeader() throws -> (field: HTTPHeader, value: String) {
le... | mit |
thewisecity/declarehome-ios | CookedApp/TableViewControllers/GroupsCheckboxTableViewController.swift | 1 | 3960 | //
// GroupsCheckboxTableViewController.swift
// CookedApp
//
// Created by Dexter Lohnes on 11/2/15.
// Copyright © 2015 The Wise City. All rights reserved.
//
import UIKit
import Parse
import ParseUI
class GroupsCheckboxTableViewController: PFQueryTableViewController, GroupCheckboxDelegate {
var dele... | gpl-3.0 |
andreamazz/Tropos | Sources/Tropos/ViewControllers/TextViewController.swift | 3 | 764 | import UIKit
class TextViewController: UIViewController {
@IBOutlet var textView: UITextView!
@objc var text: String?
override func viewDidLoad() {
super.viewDidLoad()
textView.contentInset = UIEdgeInsets.zero
textView.textContainerInset = UIEdgeInsets(
top: 20.0,
... | mit |
nsagora/validation-toolkit | Sources/Predicates/Standard/BlockPredicate.swift | 1 | 1971 | import Foundation
/**
The `BlockPredicate` struct defines a closure based condition used to evaluate generic inputs.
```swift
let predicate = BlockPredicate<Int> {
$0 % 2 == 0
}
let isEven = even.evaluate(with: 2)
```
*/
public struct BlockPredicate<T>: Predicate {
public typealias InputType = ... | mit |
Mindera/Alicerce | Tests/AlicerceTests/View/CollectionViewCellTestCase.swift | 1 | 1506 | import XCTest
@testable import Alicerce
final class MockCollectionViewCell: CollectionViewCell {
private(set) var setUpSubviewsCallCount = 0
private(set) var setUpConstraintsCallCount = 0
override func setUpSubviews() {
super.setUpSubviews()
setUpSubviewsCallCount += 1
}
override... | mit |
otanistudio/NaiveHTTP | NaiveHTTPTests/UtilityTests.swift | 1 | 1331 | //
// NormalizedURLTests.swift
// NaiveHTTP
//
// Created by Robert Otani on 9/6/15.
// Copyright © 2015 otanistudio.com. All rights reserved.
//
import XCTest
import NaiveHTTP
class UtilityTests: XCTestCase {
func testNormalizedURLInit() {
let testQueryParams = ["a":"123","b":"456"]
let ... | mit |
PiXeL16/BudgetShare | BudgetShareTests/Modules/Login/View/MockLoginView.swift | 1 | 787 | //
// MockLoginView.swift
// BudgetShareTests
//
// Created by Chris Jimenez on 9/17/17.
// Copyright © 2017 Chris Jimenez. All rights reserved.
//
@testable import BudgetShare
import Foundation
import UIKit
class MockLoginView: LoginView {
var controller: UIViewController?
var presenter: LoginMo... | mit |
GitTennis/SuccessFramework | Templates/_BusinessAppSwift_/_BusinessAppSwift_/Factories/ViewControllerFactory.swift | 2 | 18650 | //
// ViewControllerFactory.swift
// _BusinessAppSwift_
//
// Created by Gytenis Mikulenas on 06/09/16.
// Copyright © 2016 Gytenis Mikulėnas
// https://github.com/GitTennis/SuccessFramework
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated doc... | mit |
practicalswift/swift | validation-test/compiler_crashers_fixed/01283-swift-modulefile-getdecl.swift | 65 | 619 | // This source file is part of the Swift.org open source project
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the li... | apache-2.0 |
tbaranes/SwiftyUtils | Sources/Extensions/UIKit/UIStoryboard/UIStoryboardExtension.swift | 1 | 518 | //
// Created by Tom Baranes on 23/06/16.
// Copyright © 2016 Tom Baranes. All rights reserved.
//
#if os(iOS) || os(tvOS)
import UIKit
extension UIStoryboard {
/// Get the main application storyboard.
public class var main: UIStoryboard? {
let bundle = Bundle.main
guard let storyboardName... | mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/14021-swift-sourcemanager-getmessage.swift | 11 | 251 | // 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 b let {
enum S {
let a {
class
b {
struct g { func i( ) -> ( ) {
class
case ,
| mit |
zhuozhuo/ZHChat | SwiftExample/ZHChatSwift/ZHRootTableViewController.swift | 1 | 2367 | //
// ZHRootTableViewController.swift
// ZHChatSwift
//
// Created by aimoke on 16/12/15.
// Copyright © 2016年 zhuo. All rights reserved.
//
import UIKit
class ZHRootTableViewController: UITableViewController {
var dataArray: [String] = ["Push","Present"];
override func viewDidLoad() {
super.viewD... | mit |
smoope/swift-client-conversation | Framework/Source/LoadingSupplementaryView.swift | 1 | 1385 | //
// Copyright 2017 smoope GmbH
//
// 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 |
toco/IPDC-14 | IPDC/AppDelegate.swift | 1 | 2238 | //
// AppDelegate.swift
// IPDC
//
// Created by Tobias Conradi on 03.11.14.
// Copyright (c) 2014 Tobias Conradi. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate {
var window: UIWindow?
func application(application:... | mit |
mightydeveloper/swift | stdlib/public/core/Policy.swift | 9 | 15662 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LI... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.