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 |
|---|---|---|---|---|---|
sarvex/SwiftRecepies | Notification/Sending Notifications/Sending Notifications/ViewController.swift | 1 | 1374 | //
// ViewController.swift
// Sending Notifications
//
// Created by Vandad Nahavandipoor on 7/11/14.
// Copyright (c) 2014 Pixolity Ltd. All rights reserved.
//
// These example codes are written for O'Reilly's iOS 8 Swift Programming Cookbook
// If you use these solutions in your apps, you can give attribution ... | isc |
yangboz/SwiftSteeringBehavior | SwiftSteeringBehavors3/SwiftSteeringBehavors3Tests/SwiftSteeringBehavors3Tests.swift | 1 | 1036 | //
// SwiftSteeringBehavors3Tests.swift
// SwiftSteeringBehavors3Tests
//
// Created by yangboz on 12/04/2017.
// Copyright © 2017 ___SMARTKIT.INFO___. All rights reserved.
//
import XCTest
@testable import SwiftSteeringBehavors3
class SwiftSteeringBehavors3Tests: XCTestCase {
override func setUp() {
... | mit |
alessiobrozzi/firefox-ios | UITests/ClearPrivateDataTests.swift | 1 | 12587 | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import Foundation
import Shared
import WebKit
import UIKit
import EarlGrey
import GCDWebServers
class ClearPrivat... | mpl-2.0 |
jestinson/weather | weatherTests/CacheTests.swift | 1 | 2834 | //
// CacheTests.swift
// weatherTests
//
// Created by Stinson, Justin on 8/9/15.
// Copyright © 2015 Justin Stinson. All rights reserved.
//
import XCTest
@testable import weather
class CacheTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is... | mit |
GocePetrovski/ListCollectionViewKit | Demo/ListCollectionViewKitDemo/ListCollectionViewController.swift | 1 | 5545 | //
// ListCollectionViewController.swift
// ListCollectionViewDemo
//
// Created by Goce Petrovski on 11/02/2015.
// Copyright (c) 2015 Pomarium. All rights reserved.
//
import UIKit
import ListCollectionViewKit
class ListCollectionViewController: UICollectionViewController, ListCollectionViewDataSource {
... | mit |
ebaker355/IBOutletScanner | src/Options.swift | 1 | 2516 | /*
MIT License
Copyright (c) 2017 DuneParkSoftware, LLC
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, me... | mit |
eugenepavlyuk/swift-algorithm-club | Trie/Trie/Trie/ViewController.swift | 4 | 455 | //
// ViewController.swift
// Trie
//
// Created by Rick Zaccone on 2016-12-12.
// Copyright © 2016 Rick Zaccone. All rights reserved.
//
import Cocoa
class ViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.... | mit |
fakerabbit/LucasBot | LucasBot/NavController.swift | 2 | 972 | //
// NavController.swift
// LucasBot
//
// Created by Mirko Justiniano on 1/16/17.
// Copyright © 2017 LB. All rights reserved.
//
import Foundation
import UIKit
class NavController: UINavigationController {
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.ini... | gpl-3.0 |
wireapp/wire-ios | Wire-iOS/Sources/UserInterface/Calling/CallInfoViewController/CallInfoViewController.swift | 1 | 8162 | //
// Wire
// Copyright (C) 2018 Wire Swiss GmbH
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This progr... | gpl-3.0 |
amieka/FlickStream | FlickStream/NSObject+Extensions.swift | 1 | 596 | //
// NSObject+Extensions.swift
// FlickStream
//
// Created by Arunoday Sarkar on 6/19/16.
// Copyright © 2016 Sark Software LLC. All rights reserved.
//
import Foundation
extension NSObject {
public func safe_setValuesForKeysWithDictionary(keyedValues: [String : AnyObject]) {
let properties = Mirror(reflect... | mit |
jiayuquan/ShopCycle | ShopCycle/ShopCycle/Purchase/View/PurchaseCell.swift | 1 | 2176 | //
// PurchaseCell.swift
// shop
//
// Created by mac on 16/5/6.
// Copyright © 2016年 JiaYQ. All rights reserved.
//
import UIKit
protocol PurchaseCellDelegate: NSObjectProtocol {
func shoppingCartCell(cell: PurchaseCell, button: UIButton, countLabel: UILabel)
func reCalculateTotalPrice()
}
class Pur... | apache-2.0 |
toggl/superday | teferi/UI/Modules/Settings/SettingsPresenter.swift | 1 | 1076 | import Foundation
import UIKit
import StoreKit
class SettingsPresenter
{
private weak var viewController : SettingsViewController!
private let viewModelLocator : ViewModelLocator
private init(viewModelLocator: ViewModelLocator)
{
self.viewModelLocator = viewModelLocator
}
stat... | bsd-3-clause |
lennet/proNotes | app/proNotes/Extenstions/UIStoryboardExtension.swift | 1 | 594 | //
// UIStoryboardExtension.swift
// proNotes
//
// Created by Leo Thomas on 09/12/15.
// Copyright © 2015 leonardthomas. All rights reserved.
//
import UIKit
extension UIStoryboard {
static func documentStoryboard() -> UIStoryboard {
let documentStoryboardName = "Document"
return UIStoryboar... | mit |
ArshAulakh59/TWGSampleApp | TWGSampleApp/CustomManagement/Utilities/Configuration.swift | 1 | 2999 | //
// Configuration.swift
// TWGSampleApp
//
// Created by Arsh Aulakh BHouse on 16/07/16.
// Copyright © 2016 BHouse. All rights reserved.
//
import UIKit
import Foundation
//MARK: Configuration
struct Configuration {
var mainThemeColor: UIColor
var secondaryThemeColor: UIColor
var onboardingConfiguration: On... | mit |
neeemo/MobileComputingLab | ButterIt/ButterKnife.swift | 1 | 1244 | //
// Butter.swift
// Toast
//
// Created by James Wellence on 04/12/14.
// Copyright (c) 2014 James Wellence. All rights reserved.
//
import UIKit
class ButterKnife {
var butterAmount_: Double = 0
let maxButterAmount: Double = 1000
let minButterAmount: Double = 0
func setButter(butterA... | apache-2.0 |
Awalz/ark-ios-monitor | ArkMonitor/Account Selection/AccountTransitionDelegate.swift | 1 | 3951 | // Copyright (c) 2016 Ark
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, ... | mit |
grandiere/box | box/Model/Help/Energy/MHelpEnergy.swift | 1 | 494 | import Foundation
class MHelpEnergy:MHelp
{
init()
{
let itemIntro:MHelpEnergyIntro = MHelpEnergyIntro()
let itemTime:MHelpEnergyTime = MHelpEnergyTime()
let itemAids:MHelpEnergyAids = MHelpEnergyAids()
let itemPurchase:MHelpEnergyPurchase = MHelpEnergyPurchase()
... | mit |
zsheikh-systango/WordPower | Skeleton/Word Share/Network/APIManagers/RequestManager.swift | 1 | 915 | //
// RequestManager.swift
// WordPower
//
// Created by BestPeers on 05/06/17.
// Copyright © 2017 BestPeers. All rights reserved.
//
import UIKit
class RequestManager: NSObject {
// MARK: - Word API
func getWordInformation(word:String, completion:@escaping CompletionHandler){
WordInterface()... | mit |
a2/Kitty | Kitty/ViewController.swift | 1 | 472 | //
// ViewController.swift
// Kitty
//
// Created by Alexsander Akers on 11/9/15.
// Copyright © 2015 Rocket Apps Limited. All rights reserved.
//
import Cocoa
class ViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading ... | mit |
krzyzanowskim/Natalie | Sources/natalie/Helpers.swift | 1 | 1655 | //
// Helpers.swift
// Natalie
//
// Created by Marcin Krzyzanowski on 07/08/16.
// Copyright © 2016 Marcin Krzyzanowski. All rights reserved.
//
import Foundation
func findStoryboards(rootPath: String, suffix: String) -> [String]? {
var result = [String]()
let fm = FileManager.default
if let paths = ... | mit |
renzifeng/ZFZhiHuDaily | ZFZhiHuDaily/Other/Lib/CyclePictureView/CyclePictureCell.swift | 1 | 3259 | //
// CyclePictureCell.swift
// CyclePictureView
//
// Created by wl on 15/11/7.
// Copyright © 2015年 wl. All rights reserved.
//
import UIKit
import Kingfisher
class CyclePictureCell: UICollectionViewCell {
var imageSource: ImageSource = ImageSource.Local(name: ""){
didSet {
switch image... | apache-2.0 |
mmrmmlrr/ModelsTreeKit | JetPack/Subscription.swift | 1 | 1943 | //
// Disposable.swift
// SessionSwift
//
// Created by aleksey on 25.10.15.
// Copyright © 2015 aleksey chernish. All rights reserved.
//
import Foundation
protocol Invocable: class {
func invoke(_ data: Any) -> Void
func invokeState(_ data: Bool) -> Void
}
class Subscription<U> : Invocable, Disposabl... | mit |
tripleCC/GanHuoCode | GanHuo/Views/Base/TPCPageScrollView.swift | 1 | 10565 | //
// TPCPageScrollView.swift
// TPCPageScrollView
//
// Created by tripleCC on 15/11/23.
// Copyright © 2015年 tripleCC. All rights reserved.
//
import UIKit
class TPCPageScrollView: UIView {
let padding: CGFloat = 40
var viewDisappearAction: (() -> ())?
var imageMode: UIViewContentMode = UIViewConten... | mit |
ahoppen/swift | validation-test/Driver/Dependencies/rdar25405605.swift | 14 | 3185 | // RUN: %empty-directory(%t)
// RUN: cp %s %t/main.swift
// RUN: cp %S/Inputs/rdar25405605/helper-1.swift %t/helper.swift
// RUN: touch -t 201401240005 %t/*.swift
// RUN: cd %t && %target-build-swift -c -incremental -output-file-map %S/Inputs/rdar25405605/output.json -parse-as-library ./main.swift ./helper.swift -par... | apache-2.0 |
megavolt605/CNLDataProvider | CNLDataProvider/CNLModelDictionary.swift | 1 | 4075 | //
// CNLModelDictionary.swift
// CNLDataProvider
//
// Created by Igor Smirnov on 23/12/2016.
// Copyright © 2016 Complex Numbers. All rights reserved.
//
import Foundation
import CNLFoundationTools
/// Base dictionary model
public protocol CNLModelDictionary {
/// Default initializer
init()
... | mit |
nathanlea/CS4153MobileAppDev | WIA/WIA11_Lea_Nathan/WIA11_Lea_Nathan/TableViewController.swift | 1 | 5935 | //
// TableViewController.swift
// WIA11_Lea_Nathan
//
// Created by Nathan on 10/30/15.
// Copyright © 2015 Okstate. All rights reserved.
//
import UIKit
class TableViewController: UITableViewController {
var elements: [Dictionary<String, String>] = []
override func viewDidLoad() {
super.viewDi... | mit |
tache/swiftkick | SwiftKickPlayground.playground/section-1.swift | 1 | 600 |
import SwiftKick
//-----------------------------------------------------------------------------------------------
// Logger
//-----------------------------------------------------------------------------------------------
// Set a log level to restrict output, and a verbosity of the output
let log = SwiftKick.Logger... | mit |
KlubJagiellonski/pola-ios | BuyPolish/Pola/Utilities/Categories/Bundle+Additions.swift | 1 | 231 | import Foundation
extension Bundle {
var version: String! {
infoDictionary?["CFBundleVersion"] as? String
}
var shortVersion: String! {
infoDictionary?["CFBundleShortVersionString"] as? String
}
}
| gpl-2.0 |
liufan321/SwiftLearning | 基础语法/Swift基础语法.playground/Pages/002-可选项.xcplaygroundpage/Contents.swift | 1 | 1951 | import Foundation
/*:
## 概念
* `Optional` 是 Swift 的一大特色,也是 Swift 初学者最容易困惑的问题
* 定义变量时,在类型后面添加一个 `?`,表示该变量是可选的
* 定义变量时,如果指定是可选的,表示该变量:
* 可以有一个指定类型的值
* 也可以是 `nil`
## 定义
* 格式1(自动推导):`var 变量名: Optional = 值`
* 格式2(泛型):`var 变量名:Optional<类型> = 值`
* 格式3(简化格式):`var 变量名: 类型? = 值`
*/
// 格式1
let x: Optional = 2... | apache-2.0 |
mominul/swiftup | Sources/swiftup/main.swift | 1 | 1476 | /*
swiftup
The Swift toolchain installer
Copyright (C) 2016-present swiftup Authors
Authors:
Muhammad Mominul Huque
*/
import libNix
import Commander
import Environment
import SwiftupFramework
let ver = "0.0.7"
Group {
$0.command("install",
Argument<String>("version"),
description: "Install s... | apache-2.0 |
PhillipEnglish/TIY-Assignments | TheGrailDiary/HistoricalSitesTableViewController.swift | 1 | 4704 | //
// HistoricalSitesTableViewController.swift
// TheGrailDiary
//
// Created by Phillip English on 10/19/15.
// Copyright © 2015 The Iron Yard. All rights reserved.
//
import UIKit
class HistoricalSitesTableViewController: UITableViewController {
var temples = Array<Temple>()
override func viewDidL... | cc0-1.0 |
memexapp/memex-swift-sdk | Sources/RequestInvoker.swift | 1 | 8066 |
import Foundation
import ObjectMapper
class RequestInvoker {
// MARK: Lifecycle
weak var spaces: Spaces?
var session: URLSession
// MARK: Lifecycle
init(spaces: Spaces) {
self.spaces = spaces
self.session = URLSession(configuration: URLSessionConfiguration.default)
}
// MARK: Gene... | mit |
lucaslt89/simpsonizados | simpsonizados/Pods/Alamofire/Source/Request.swift | 49 | 19439 | // Request.swift
//
// Copyright (c) 2014–2016 Alamofire Software Foundation (http://alamofire.org/)
//
// 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 |
adrfer/swift | test/TypeCoercion/constructor_return.swift | 24 | 298 | // RUN: %target-parse-verify-swift
func foo() {}
func bar() {}
struct S {
init(b:Bool) {
foo()
if b { return }
bar()
}
}
class C {
var b:Bool
init(b:Bool) {
self.b = b
foo()
if b { return }
bar()
}
deinit {
foo()
if b { return }
bar()
}
}
| apache-2.0 |
adrfer/swift | validation-test/compiler_crashers_fixed/26007-swift-constraints-solution-computesubstitutions.swift | 13 | 277 | // 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
protocol A{
let:A{}func b
class d<e{struct d:A{var g=b{}func b
| apache-2.0 |
mmsaddam/TheMovie | TheMovie/ViewController.swift | 1 | 10965 | //
// ViewController.swift
// TheMovie
//
// Created by Md. Muzahidul Islam on 7/16/16.
// Copyright © 2016 iMuzahid. All rights reserved.
//
import UIKit
import Alamofire
import AlamofireImage
private let reuseIdentifier = "FlickrCell"
private let sectionInsets = UIEdgeInsets(top: 5, left: 5, bottom: 5, right:... | mit |
GaborWnuk/image-preview-ios-demo | ImagePreviewExample/Article.swift | 1 | 1286 | //
// Article.swift
// ImagePreviewExample
//
// MIT License
//
// Copyright (c) 2016 Gabor Wnuk
//
// 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 wi... | mit |
1aurabrown/eidolon | Kiosk/Admin/AdminPanelViewController.swift | 1 | 2105 | import UIKit
class AdminPanelViewController: UIViewController {
@IBOutlet weak var auctionIDLabel: UILabel!
@IBAction func backTapped(sender: AnyObject) {
self.presentingViewController?.dismissViewControllerAnimated(true, completion: nil)
}
@IBAction func closeAppTapped(sender: AnyObjec... | mit |
fizx/jane | ruby/lib/vendor/grpc-swift/Tests/SwiftGRPCTests/ChannelArgumentTests.swift | 3 | 3570 | /*
* Copyright 2018, gRPC Authors All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | mit |
iAugux/Augus | Settings/TodayViewController+Apps.swift | 1 | 3873 | //
// TodayViewController+Apps.swift
// Augus
//
// Created by Augus on 2/24/16.
// Copyright © 2016 iAugus. All rights reserved.
//
import UIKit
// MARK: - MacID
extension TodayViewController {
internal func configureMacIDPanel() {
macIDClipboardButton.setImageForMacIDButton(UIColor.yellowColor... | mit |
noppoMan/aws-sdk-swift | Sources/Soto/Services/Athena/Athena_Error.swift | 1 | 2951 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2020 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for t... | apache-2.0 |
banxi1988/BXWebAppViewController | Example/Tests/Tests.swift | 1 | 777 | import UIKit
import XCTest
import BXWebAppViewController
class Tests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code ... | mit |
radex/swift-compiler-crashes | crashes-fuzzing/00917-swift-lexer-leximpl.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
init(){->{
func g{{
}
func b({
{
{{
{
{
(((
(
[{
{
{
"""
}
}
}
protocol A{
typealias B:b
typealias b | mit |
radex/swift-compiler-crashes | crashes-fuzzing/02098-llvm-smallvectorimpl-swift-diagnosticargument-operator.swift | 11 | 216 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
let b=B()?->
class A<T where h:H{
typealias e=e | mit |
apple/swift-algorithms | Tests/SwiftAlgorithmsTests/AdjacentPairsTests.swift | 1 | 2580 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Algorithms open source project
//
// Copyright (c) 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 |
rokuz/omim | iphone/Maps/Core/Ads/Mopub/MopubBanner.swift | 1 | 5041 | final class MopubBanner: NSObject, Banner {
private enum Limits {
static let minTimeOnScreen: TimeInterval = 3
static let minTimeSinceLastRequest: TimeInterval = 5
}
fileprivate var success: Banner.Success!
fileprivate var failure: Banner.Failure!
fileprivate var click: Banner.Click!
private var re... | apache-2.0 |
lvogelzang/Blocky | Blocky/Levels/Level43.swift | 1 | 877 | //
// Level43.swift
// Blocky
//
// Created by Lodewijck Vogelzang on 07-12-18
// Copyright (c) 2018 Lodewijck Vogelzang. All rights reserved.
//
import UIKit
final class Level43: Level {
let levelNumber = 43
var tiles = [[0, 1, 0, 1, 0], [1, 1, 1, 1, 1], [0, 1, 0, 1, 0], [0, 1, 0, 1, 0]]
let cameraFollowsBlo... | mit |
sayheyrickjames/codepath-dev | week5/week4-class-tinder/week4-class-tinderTests/week4_class_tinderTests.swift | 2 | 935 | //
// week4_class_tinderTests.swift
// week4-class-tinderTests
//
// Created by Rick James! Chatas on 5/24/15.
// Copyright (c) 2015 SayHey. All rights reserved.
//
import UIKit
import XCTest
class week4_class_tinderTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup co... | gpl-2.0 |
safx/TypetalkKit | IDL/IDLProtocols.swift | 1 | 405 | //
// Protocols.swift
// Swift-idl
//
// Created by Safx Developer on 2015/05/12.
// Copyright (c) 2015年 Safx Developers. All rights reserved.
//
protocol ClassInit {}
protocol EnumStaticInit {}
protocol Printable {}
protocol Encodable {}
protocol Decodable {}
protocol JSON {}
protocol URLRequestHelper {}
proto... | mit |
mentalfaculty/impeller | Sources/LocalRepository.swift | 1 | 1334 | //
// Repository.swift
// Impeller
//
// Created by Drew McCormack on 08/12/2016.
// Copyright © 2016 Drew McCormack. All rights reserved.
//
public protocol LocalRepository {
func fetchValue<T:Repositable>(identifiedBy uniqueIdentifier:UniqueIdentifier) -> T?
func commit<T:Repositable>(_ value: inout T, r... | mit |
Speicher210/wingu-sdk-ios-demoapp | Example/Pods/SKPhotoBrowser/SKPhotoBrowser/SKPagingScrollView.swift | 1 | 7810 | //
// SKPagingScrollView.swift
// SKPhotoBrowser
//
// Created by 鈴木 啓司 on 2016/08/18.
// Copyright © 2016年 suzuki_keishi. All rights reserved.
//
import Foundation
class SKPagingScrollView: UIScrollView {
let pageIndexTagOffset: Int = 1000
let sideMargin: CGFloat = 10
fileprivate var visiblePages = [... | apache-2.0 |
saagarjha/iina | iina/MPVPlaylistItem.swift | 3 | 802 | //
// MPVPlaylistItem.swift
// iina
//
// Created by lhc on 23/8/16.
// Copyright © 2016 lhc. All rights reserved.
//
import Cocoa
class MPVPlaylistItem: NSObject {
/** Actually this is the path. Use `filename` to conform mpv API's naming. */
var filename: String
/** Title or the real filename */
var fi... | gpl-3.0 |
radvansky-tomas/NutriFacts | nutri-facts/nutri-facts/Libraries/iOSCharts/Classes/Renderers/ChartRendererBase.swift | 6 | 1808 | //
// ChartRendererBase.swift
// Charts
//
// Created by Daniel Cohen Gindi on 3/3/15.
//
// Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
// A port of MPAndroidChart for iOS
// Licensed under Apache License 2.0
//
// https://github.com/danielgindi/ios-charts
//
import Foundation
import CoreGraphics.CGBase... | gpl-2.0 |
lsonlee/Swift_MVVM | Swift_Project/Pods/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallZigZag.swift | 2 | 3537 | //
// NVActivityIndicatorAnimationBallZigZag.swift
// NVActivityIndicatorViewDemo
//
// The MIT License (MIT)
// Copyright (c) 2016 Vinh Nguyen
// 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 S... | mit |
nodes-vapor/admin-panel | Sources/AdminPanel/Controllers/DashboardController.swift | 1 | 528 | import Vapor
import Leaf
public protocol DashboardControllerType {
func renderDashboard(_ req: Request) throws -> Future<Response>
}
public final class DashboardController<U: AdminPanelUserType>: DashboardControllerType {
public init() {}
public func renderDashboard(_ req: Request) throws -> Future<Respo... | mit |
cho15255/PaintWithMetal | PaintWithMetal/JHViewController+Renderer.swift | 1 | 3259 | //
// JHViewController+Renderer.swift
// PaintWithMetal
//
// Created by Jae Hee Cho on 2015-11-29.
// Copyright © 2015 Jae Hee Cho. All rights reserved.
//
import Foundation
import UIKit
import Metal
extension JHViewController {
func render() {
if let drawable = self.metalLayer.nextDrawable() {
... | mit |
DigitalRogues/SwiftNotes | SwiftNotes/LeftMenuViewController.swift | 1 | 3781 | //
// LeftMenuViewController.swift
// SSASideMenuExample
//
// Created by Sebastian Andersen on 20/10/14.
// Copyright (c) 2014 Sebastian Andersen. All rights reserved.
//
import Foundation
import UIKit
////I think we'll have to use the app delegate as a central point so the viewcontrollers arent reinited each ti... | mit |
36Kr-Mobile/StatusBarNotificationCenter | Example/StatusBarNotificationCenter/Main View Controller/ViewController.swift | 1 | 4706 | //
// ViewController.swift
// StatusBarNotification
//
// Created by Shannon Wu on 9/16/15.
// Copyright © 2015 Shannon Wu. All rights reserved.
//
import UIKit
import StatusBarNotificationCenter
class ViewController: UIViewController {
@IBOutlet weak var durationLabel: UILabel!
@IBOutlet weak var no... | mit |
kharrison/CodeExamples | Encode/encode/ViewController.swift | 1 | 2453 | //
// ViewController.swift
// encode
//
// Created by Keith Harrison https://useyourloaf.com
// Copyright (c) 2016-2020 Keith Harrison. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//... | bsd-3-clause |
skedgo/tripkit-ios | Sources/TripKit/vendor/ASPolygonKit/CLLocationCoordinate2D+EncodePolylineString.swift | 1 | 2444 | //
// CLLocationCoordinate2D+EncodePolylineString.swift
//
//
// Created by Adrian Schönig on 5/11/21.
//
import Foundation
extension Polygon {
/// This function encodes an `Polygon` to a `String`
///
/// - parameter precision: The precision used to encode coordinates (default: `1e5`)
///
/// - returns: A... | apache-2.0 |
mengxiangyue/Swift-Design-Pattern-In-Chinese | Design_Pattern.playground/Pages/Iterator.xcplaygroundpage/Contents.swift | 1 | 3536 | /*:
### **Iterator**
---
[回到列表](Index)
1. 定义:迭代器模式(Iterator Pattern):提供一种方法来访问聚合对象,而不用暴露这个对象的内部表示,其别名为游标(Cursor)。迭代器模式是一种对象行为型模式。迭代器内部关联着需要访问的对象。
1. Iterator(抽象迭代器):它定义了访问和遍历元素的接口,声明了用于遍历数据元素的方法,例如:用于获取第一个元素的first()方法,用于访问下一个元素的next()方法,用于判断是否还有下一个元素的hasNext()方法,用于获取当前元素的currentItem()方法等,在具体迭代器中将实现这些方法。
... | mit |
ethanneff/organize | Organize/IntroNavigationController.swift | 1 | 1103 | import UIKit
import Firebase
class IntroNavigationController: UINavigationController {
override func loadView() {
super.loadView()
navigationBar.hidden = true
pushViewController(IntroViewController(), animated: true)
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)... | mit |
RxSwiftCommunity/RxSwiftExt | Playground/RxSwiftExtPlayground.playground/Pages/UIScrollView.reachedBottom.xcplaygroundpage/Contents.swift | 2 | 1781 | /*:
> # IMPORTANT: To use `RxSwiftExtPlayground.playground`, please:
1. Make sure you have [Carthage](https://github.com/Carthage/Carthage) installed
1. Fetch Carthage dependencies from shell: `carthage bootstrap --platform ios`
1. Build scheme `RxSwiftExtPlayground` scheme for a simulator target
1. Choose `View ... | mit |
mono0926/LicensePlist | Sources/LicensePlistCore/Extension/Extensions.swift | 1 | 587 | import Foundation
public struct LicensePlistExtension<Base> {
let base: Base
init (_ base: Base) {
self.base = base
}
}
public protocol LicensePlistCompatible {
associatedtype Compatible
static var lp: LicensePlistExtension<Compatible>.Type { get }
var lp: LicensePlistExtension<Compati... | mit |
edragoev1/pdfjet | Sources/PDFjet/Paragraph.swift | 1 | 1226 | /**
* Paragraph.swift
*
Copyright 2020 Innovatics Inc.
*/
import Foundation
///
/// Used to create paragraph objects.
/// See the TextColumn class for more information.
///
public class Paragraph {
var list: [TextLine]?
var alignment: UInt32 = Align.LEFT
///
/// Constructor for creating paragrap... | mit |
HabitRPG/habitrpg-ios | HabitRPG/Utilities/NotificationManager.swift | 1 | 6613 | //
// NotificationManager.swift
// Habitica
//
// Created by Phillip Thelen on 24.06.20.
// Copyright © 2020 HabitRPG Inc. All rights reserved.
//
import Foundation
import Habitica_Models
import FirebaseAnalytics
class NotificationManager {
private static var seenNotifications = Set<String>()
private stat... | gpl-3.0 |
ZeeQL/ZeeQL3 | Sources/ZeeQL/Access/AdaptorChannelPool.swift | 1 | 7414 | //
// AdaptorChannelPool.swift
// ZeeQL3
//
// Copyright © 2018-2020 ZeeZide GmbH. All rights reserved.
//
import Foundation
public protocol AdaptorChannelPool {
func grab() -> AdaptorChannel?
func add(_ channel: AdaptorChannel)
}
// Those are not great, but OKayish.
// The expiration queue probably forks a... | apache-2.0 |
kenwilcox/AdaptiveWeather | AdaptiveWeatherTests/AdaptiveWeatherTests.swift | 1 | 931 | //
// AdaptiveWeatherTests.swift
// AdaptiveWeatherTests
//
// Created by Kenneth Wilcox on 12/29/14.
// Copyright (c) 2014 Kenneth Wilcox. All rights reserved.
//
import UIKit
import XCTest
class AdaptiveWeatherTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code h... | mit |
fwagner/WPJsonAPI | Source/WPJOAuth2Manager.swift | 1 | 2540 | //
// WPJOAuth2Manager.swift
// WordpressJSONApi
//
// Created by Flo on 08.09.15.
// Copyright (c) 2015 Florian Wagner. All rights reserved.
//
import Foundation
public class WPJOAuth2Manager {
public var configuration : WPJOAuth2Configuration;
public var tokenStore : WPJOAuth2TokenStore;
public... | mit |
groue/GRDB.swift | Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerEditionView.swift | 1 | 1278 | import SwiftUI
/// The view that edits an existing player.
struct PlayerEditionView: View {
/// Write access to the database
@Environment(\.appDatabase) private var appDatabase
@Environment(\.isPresented) private var isPresented
private let player: Player
@State private var form: PlayerForm
... | mit |
Sajjon/ViewComposer | Source/Classes/ViewStyle/UIView+ViewStyle/UIStackView+ViewStyle.swift | 1 | 1214 | //
// UIStackView+ViewStyle.swift
// ViewComposer
//
// Created by Alexander Cyon on 2017-06-15.
//
//
import Foundation
internal extension UIStackView {
func apply(_ style: ViewStyle) {
style.attributes.forEach {
switch $0 {
case .alignment(let alignment):
self.... | mit |
hgani/ganilib-ios | glib/Classes/View/GBarButtonItem.swift | 1 | 735 | import SwiftIconFont
import UIKit
open class GBarButtonItem: UIBarButtonItem {
private var onClick: (() -> Void)?
public func onClick(_ command: @escaping () -> Void) -> Self {
onClick = command
target = self
action = #selector(performClick)
return self
}
@objc private... | mit |
IdeasOnCanvas/Ashton | Sources/Ashton/CrossPlatformCompatibility.swift | 1 | 2078 | //
// CrossPlatformCompatibility.swift
// Ashton
//
// Created by Michael Schwarz on 11.12.17.
// Copyright © 2017 Michael Schwarz. All rights reserved.
//
#if os(iOS)
import UIKit
typealias Font = UIFont
typealias FontDescriptor = UIFontDescriptor
typealias FontDescriptorSymbolicTraits = UIFontDescriptor.Symbolic... | mit |
nathawes/swift | test/stdlib/NSStringAPI.swift | 17 | 61870 | // RUN: %target-run-simple-swift
// REQUIRES: executable_test
// REQUIRES: objc_interop
// FIXME: rdar://problem/31311598
// UNSUPPORTED: OS=ios
// UNSUPPORTED: OS=tvos
// UNSUPPORTED: OS=watchos
//
// Tests for the NSString APIs as exposed by String
//
import StdlibUnittest
import Foundation
import StdlibUnittes... | apache-2.0 |
markedwardmurray/Starlight | Starlight/Starlight/Controllers/LeftMenuTableViewController.swift | 1 | 1744 | //
// LeftMenuTableViewController.swift
// Starlight
//
// Created by Mark Murray on 12/2/16.
// Copyright © 2016 Mark Murray. All rights reserved.
//
import UIKit
class LeftMenuTableViewController: UITableViewController {
var mainRevealController: MainRevealViewController {
return self.revealViewCont... | mit |
apple/swift-corelibs-foundation | Sources/Foundation/Port.swift | 1 | 45670 | // 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 |
practicalswift/swift | test/Generics/requirement_inference.swift | 2 | 14502 | // RUN: %target-typecheck-verify-swift -typecheck -verify
// RUN: %target-typecheck-verify-swift -typecheck -debug-generic-signatures > %t.dump 2>&1
// RUN: %FileCheck %s < %t.dump
protocol P1 {
func p1()
}
protocol P2 : P1 { }
struct X1<T : P1> {
func getT() -> T { }
}
class X2<T : P1> {
func getT() -> T ... | apache-2.0 |
sajeel/AutoScout | AutoScout/Models & View Models/Protocols/ViewModelOutput.swift | 1 | 283 | //
// CarsViewModelOutput.swift
// AutoScout
//
// Created by Sajjeel Khilji on 5/21/17.
// Copyright © 2017 Saj. All rights reserved.
//
import Foundation
public protocol ViewModelOutput: class
{
func viewModelDidUpdate()
func viewModelLoadingDidFail(error: Error)
}
| gpl-3.0 |
blockchain/My-Wallet-V3-iOS | Modules/Network/Sources/NetworkKit/Extensions/URLRequestExtensions.swift | 1 | 221 | // Copyright © Blockchain Luxembourg S.A. All rights reserved.
import Foundation
extension URLRequest {
init(url: URL, method: HTTPMethod) {
self.init(url: url)
httpMethod = method.rawValue
}
}
| lgpl-3.0 |
ashfurrow/eidolon | Kiosk/App/Models/GenericError.swift | 2 | 767 | import Foundation
import SwiftyJSON
final class GenericError: NSObject, JSONAbleType {
let detail: [String:AnyObject]
let message: String
let type: String
init(type: String, message: String, detail: [String:AnyObject]) {
self.detail = detail
self.message = message
self.type... | mit |
JaSpa/swift | test/SourceKit/Indexing/index.swift | 7 | 2590 | // RUN: %sourcekitd-test -req=index %s -- -serialize-diagnostics-path %t.dia %s | %sed_clean > %t.response
// RUN: diff -u %s.response %t.response
var globV: Int
class CC {
init() {}
var instV: CC
func meth() {}
func instanceFunc0(_ a: Int, b: Float) -> Int {
return 0
}
func instanceFunc1(a x: Int, b ... | apache-2.0 |
peteratseneca/dps923winter2015 | Week_12/ShapesV1/NewShapes/Shape.swift | 1 | 2286 | //
// Shape.swift
// NewShapes
//
// Created by Peter McIntyre on 2015-04-05.
// Copyright (c) 2015 Seneca College. All rights reserved.
//
import UIKit
class Shape: UIView {
// MARK: - Class members
var shapeType: NSString!
var shapeColor: CGColorRef!
// MARK: - Initialization
... | mit |
faimin/ZDOpenSourceDemo | ZDOpenSourceSwiftDemo/Pods/Gemini/Gemini/GeminiCell.swift | 2 | 281 | import UIKit
open class GeminiCell: UICollectionViewCell {
override open func prepareForReuse() {
super.prepareForReuse()
adjustAnchorPoint()
layer.transform = CATransform3DIdentity
}
open var shadowView: UIView? {
return nil
}
}
| mit |
googlearchive/science-journal-ios | ScienceJournal/Extensions/UICollectionView+PerformChanges.swift | 1 | 2248 | /*
* 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 |
czak/triangulator | Triangulator/MainWindowController.swift | 1 | 2376 | //
// MainWindowController.swift
// Triangulator
//
// Created by Łukasz Adamczak on 19.06.2015.
// Copyright (c) 2015 Łukasz Adamczak.
//
// Triangulator is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundatio... | gpl-3.0 |
gitgitcode/LearnSwift | Calculator/Caiculator/Caiculator/AppDelegate.swift | 1 | 2139 | //
// AppDelegate.swift
// Caiculator
//
// Created by xuthus on 15/6/14.
// Copyright (c) 2015年 xuthus. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingW... | apache-2.0 |
chrisjmendez/swift-exercises | Video/MediaPlayer/MediaPlayer/AppDelegate.swift | 1 | 2148 | //
// AppDelegate.swift
// MediaPlayer
//
// Created by Tommy Trojan on 10/2/15.
// Copyright © 2015 Chris Mendez. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinish... | mit |
JerrySir/YCOA | YCOA/Main/Contacts/Controller/ContactsStructTableViewController.swift | 1 | 16401 | //
// ContactsStructTableViewController.swift
// YCOA
//
// Created by Jerry on 2017/2/5.
// Copyright © 2017年 com.baochunsteel. All rights reserved.
//
import UIKit
import Alamofire
import MJRefresh
class ContactsStructTableViewController: UITableViewController {
var dataSource : [groupNode]? //数据源
var ... | mit |
sseitov/v-Chess-Swift | v-Chess/MemberCell.swift | 1 | 1049 | //
// MemberCell.swift
// v-Chess
//
// Created by Сергей Сейтов on 13.03.17.
// Copyright © 2017 V-Channel. All rights reserved.
//
import UIKit
import SDWebImage
class MemberCell: UITableViewCell {
@IBOutlet weak var memberView: UIImageView!
@IBOutlet weak var memberName: UILabel!
override fun... | gpl-3.0 |
GianniCarlo/Audiobook-Player | BookPlayer/Library/Protocols/ItemListActions.swift | 1 | 1168 | //
// ItemListActions.swift
// BookPlayer
//
// Created by Gianni Carlo on 12/11/18.
// Copyright © 2018 Tortuga Power. All rights reserved.
//
import BookPlayerKit
import UIKit
protocol ItemListActions: ItemList {
func sort(by sortType: PlayListSortOrder)
func delete(_ items: [LibraryItem], mode: DeleteM... | gpl-3.0 |
volendavidov/NagBar | NagBar/FilterTableViewDatasource.swift | 1 | 360 | //
// FilterTableViewDatasource.swift
// NagBar
//
// Created by Volen Davidov on 15.01.16.
// Copyright © 2016 Volen Davidov. All rights reserved.
//
import Foundation
import Cocoa
class FilterTableViewDatasource : NSObject, NSTableViewDataSource {
func numberOfRows(in tableView: NSTableView) -> Int {
... | apache-2.0 |
robbdimitrov/pixelgram-ios | PixelGram/Classes/Shared/Extensions/ImageNetworking.swift | 1 | 460 | //
// ImageNetworking.swift
// PixelGram
//
// Created by Robert Dimitrov on 10/29/17.
// Copyright © 2017 Robert Dimitrov. All rights reserved.
//
import UIKit
import SDWebImage
extension UIImageView {
func setImage(with url: URL) {
if let manager = SDWebImageManager.shared().imageDownloader {
... | mit |
simonbengtsson/realmfire-swift | RealmFire/TypeHandler.swift | 1 | 2506 | import Foundation
import RealmSwift
class TypeHandler {
static var syncTypes = [String: SyncObject.Type]()
static var dataTypes = [String: DataObject.Type]()
static func getSyncType(className: String) -> SyncObject.Type {
if let type = syncTypes[className] {
return type
} e... | mit |
apple/swift-llbuild | examples/swift-bindings/core/basic.swift | 1 | 2449 | import llbuild
typealias Compute = ([Int]) -> Int
class SimpleTask: Task {
let inputs: [Key]
var values: [Int]
let compute: Compute
init(_ inputs: [Key], compute: @escaping Compute) {
self.inputs = inputs
values = [Int](repeating: 0, count: inputs.count)
self.compute = compute
}
func start... | apache-2.0 |
ZhiQiang-Yang/pppt | v2exProject 2/Pods/Alamofire/Source/Alamofire.swift | 271 | 12335 | // Alamofire.swift
//
// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/)
//
// 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... | apache-2.0 |
hacktoolkit/hacktoolkit-ios_lib | Hacktoolkit/dataStructures/DataStructures.swift | 1 | 635 | //
// DataStructures.swift
//
// Created by Hacktoolkit (@hacktoolkit) and Jonathan Tsai (@jontsai)
// Copyright (c) 2014 Hacktoolkit. All rights reserved.
//
import Foundation
struct Stack<T> {
var items = [T]()
mutating func push(item: T) {
items.append(item)
}
mutating func pop... | mit |
mathmatrix828/WeatherIcons_swift | WeatherIcons_swift/Classes/WeatherIconsEnum.swift | 1 | 8157 | //
// WeatherIconsEnum.swift
// WeatherIconsEnum
// Pods
//
// Created by Mason Phillips on 4May16.
//
//
public enum WeatherIcons: String {
case day_sunny = "\u{00d}"
case day_cloudy = "\u{002}"
case day_cloudy_gusts = "\u{000}"
case day_cloudy_windy = "\u{001}"
case day_fog = "\u{003}"
cas... | mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/15893-swift-sourcemanager-getmessage.swift | 11 | 228 | // 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 g {
n(
let {
struct A {
let a {
enum A {
class
case ,
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/16538-no-stacktrace.swift | 11 | 228 | // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
struct c
{
var b = [ {
func a {
let a {
for {
class
case ,
| mit |
austinzheng/swift-compiler-crashes | crashes-duplicates/11927-swift-inflightdiagnostic.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 < {
{
case
{
class A {
class
case ,
let start ( ) {
{
( {
{
{
{
{
: A"
| mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.