blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 6 116 | path stringlengths 5 872 | src_encoding stringclasses 7
values | length_bytes int64 10 4.68M | score float64 2.52 5.63 | int_score int64 3 5 | detected_licenses listlengths 0 47 | license_type stringclasses 2
values | text stringlengths 7 4.81M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
22ccaf41ecee9d35f27583b7f25b25efcc9be350 | Swift | dimohamdy/SRC_Xcode8 | /Demo/TestPermissionLeaks/TestPermissionLeaks/TestViewController.swift | UTF-8 | 1,617 | 2.546875 | 3 | [] | no_license | //
// TestViewController.swift
// TestPermissionLeaks
//
// Created by binaryboy on 7/18/16.
// Copyright © 2016 Ahmed Hamdy. All rights reserved.
//
import UIKit
import Permission
class TestViewController: UIViewController {
let permission: Permission? = .Microphone
var txt = "HI"
override func viewDidLoa... | true |
b940f3e0a8468310d837a104895724cf45b760a7 | Swift | momarques-devios/TesteiOSv2 | /TesteiOSv2/TesteiOSv2/Home/HomeTableViewCell.swift | UTF-8 | 1,604 | 2.609375 | 3 | [] | no_license | //
// HomeTableViewCell.swift
// TesteiOSv2
//
// Created by Mônica Marques on 12/03/20.
// Copyright © 2020 Mônica Marques. All rights reserved.
//
import UIKit
class HomeTableViewCell: UITableViewCell {
@IBOutlet weak var containerView: UIView!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak... | true |
7474cf76ed0a7e786a03bd5af3c61d3bca508431 | Swift | JustinLycklama/ClassicClientiOS | /Example/ClassicClient-Example/ViewModels/LocationViewModel.swift | UTF-8 | 1,567 | 2.9375 | 3 | [
"MIT"
] | permissive | //
// LocationViewModel.swift
// ClassicClient
//
// Created by Justin Lycklama on 2020-03-20.
// Copyright © 2020 Justin Lycklama. All rights reserved.
//
import UIKit
import ClassicClient
class LocationViewModel {
public static let sharedInstance = LocationViewModel()
private let locationService: L... | true |
0a410ea79e16a4061ba7c818b9dd080464d77ed0 | Swift | vschau/FriendsOnTheMap | /FriendsOnTheMap/Controller/MapViewController.swift | UTF-8 | 2,954 | 2.5625 | 3 | [] | no_license | //
// MapViewController.swift
// FriendsOnTheMap
//
// Created by Vanessa on 5/24/20.
// Copyright © 2020 Vanessa. All rights reserved.
//
import Foundation
import UIKit
import MapKit
class MapViewController: UIViewController, MKMapViewDelegate {
@IBOutlet weak var mapView: MKMapView!
override func v... | true |
a499e836b91c33ebecb45ac37e8a41dfa216f020 | Swift | diaz-iranian/MovieDB | /MovieSwiftUI/Views/Home.swift | UTF-8 | 744 | 2.578125 | 3 | [
"MIT"
] | permissive | //
// Home.swift
// MovieSwiftUI
//
// Created by Alfian Losari on 05/06/19.
// Copyright © 2019 Alfian Losari. All rights reserved.
//
import SwiftUI
struct Home: View {
var body: some View {
TabView {
Featured()
.tag(0)
Search()
.tag(1)
... | true |
24a639e1976448aa84cec1c3ae40bca93c4d263b | Swift | wagnerassis/demo04 | /Demo4all/Home/HomePresenter.swift | UTF-8 | 766 | 3 | 3 | [
"Apache-2.0"
] | permissive | import Foundation
import UIKit
protocol HomeDelegate: class {
func tapToDetail(placeID: String, viewController: UIViewController)
}
protocol HomeDataSource: class {
func fetchTasks(list: [String])
}
class HomePresenter {
let delegate: HomeDelegate
weak var dataSource: HomeDataSource?
init(de... | true |
e54c643a4181e7bdcb9339252def47645c179a7a | Swift | a7medtaha/task | /Task/Interactor/Interactor.swift | UTF-8 | 726 | 2.75 | 3 | [] | no_license |
//
// InterActor.swift
// Task
//
// Created by a7med on 10/2/19.
// Copyright © 2019 a7med. All rights reserved.
//
import Foundation
class Interactor{
enum DecodingError: Error {
case missing_file
}
private let decoder = JSONDecoder()
private let file_name = "brands"
func read_file... | true |
1590cca612dc791356ebbe74739b5ef9555b9e8b | Swift | WuYuanFang/InstantForiOS | /Instant/Common/Swift/UIViewExtension.swift | UTF-8 | 6,445 | 2.765625 | 3 | [] | no_license | //
// UIView+Extension.swift
// RegionHealthForUser
//
// Created by 吴远房 on 2018/11/14.
// Copyright © 2018 吴远房. All rights reserved.
//
import UIKit
/// MARK - UIView
extension UIView {
// MARK: - 常用位置属性
public var left:CGFloat {
get {
return self.frame.origin.x
}
... | true |
4e5c7114e511c79a19b5097c6a6c9948bf07a9af | Swift | inamiy/ShapeLayerView | /ShapeLayerView/ViewController.swift | UTF-8 | 1,713 | 2.671875 | 3 | [
"MIT"
] | permissive | //
// ViewController.swift
// ShapeLayerView
//
// Created by Yasuhiro Inami on 2017-11-12.
// Copyright © 2017 Yasuhiro Inami. All rights reserved.
//
import UIKit
class ViewController: UIViewController
{
@IBOutlet weak var shapeLayerView: ShapeLayerView!
@IBOutlet weak var shapeMaskedView: ShapeMaskedVi... | true |
5c6315abb3a089df7205559d227a468b33c74a8c | Swift | twocentstudios/tinykittenstv | /tinykittenstv/Styles.swift | UTF-8 | 1,357 | 2.859375 | 3 | [
"MIT"
] | permissive | //
// Styles.swift
// tinykittenstv
//
// Created by Christopher Trott on 4/14/17.
// Copyright © 2017 twocentstudios. All rights reserved.
//
import UIKit
extension UIColor {
convenience init(r: Int, g: Int, b: Int, a: Float = 1.0) {
let red = max(min(CGFloat(r)/255.0, 1.0), 0.0)
let green = ... | true |
2e250201a4d6277cda8f7e9932a7f8060ee3d574 | Swift | cforlando/street-art-orlando-ios | /StreetArt/SuccessResponse.swift | UTF-8 | 364 | 2.578125 | 3 | [
"MIT"
] | permissive | //
// SuccessResponse.swift
// StreetArt
//
// Created by Axel Rivera on 5/13/18.
// Copyright © 2018 Axel Rivera. All rights reserved.
//
import Foundation
import SwiftyJSON
struct SuccessResponse {
var success = false
var message: String?
init(json: JSON) {
success = json["success"].boolVal... | true |
fe0f8c36e83c6c1029d0a20b34d892aaf0ed216c | Swift | ReactiveX/RxSwift | /Tests/RxSwiftTests/BagTest.swift | UTF-8 | 7,809 | 2.859375 | 3 | [
"MIT"
] | permissive | //
// BagTest.swift
// Tests
//
// Created by Krunoslav Zaher on 8/23/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
// testable import doesn't work well in Linux
#if !os(Linux)
import XCTest
@testable import RxSwift
final class BagTest : RxTest {
override var accumulateStatistics: Bool {
... | true |
e03362e741a1a061603153040823b3d0106646e5 | Swift | Gekkot/Demetra | /ios-app/DemetraProjectIOS/Views and Cells/SideMenuTableCell.swift | UTF-8 | 1,851 | 2.5625 | 3 | [] | no_license | //
// MenuTableCell.swift
// DemetraProjectIOS
//
// Created by Хафизов Руслан on 27/09/2019.
// Copyright © 2019 Хафизов Руслан. All rights reserved.
//
import UIKit
class SideMenuTableCell: UITableViewCell {
static let reuseId = "MenuTableCell"
let iconImageView: UIImageView = {
let iv = U... | true |
a8e53b205ca73880d607e87d3cf83513a64df111 | Swift | JavteshGBC/parking-app | /ParkingApp/Extensions/StringExtensions.swift | UTF-8 | 637 | 2.953125 | 3 | [] | no_license | // Group: Project Groups 12
// Name: Mohit Sharma
// Student ID: 101342267
// Group Member: Javtesh Singh Bhullar
// Member ID: 101348129
//
// StringExtensions.swift
// ParkingApp
//
// Created by Mohit Sharma on 20/05/21.
//
import Foundation
extension String {
var isValidEmail: Bool {
let regul... | true |
a7b2345b21d17c8af3a82c4054e4b609300850d9 | Swift | carlynorama/Masquerade | /Masquerade/CameraFeed.swift | UTF-8 | 9,587 | 2.734375 | 3 | [] | no_license | //
// CameraFeed.swift
// Masquerade
//
// Created by Labtanza on 10/7/20.
//
import SwiftUI
import AVFoundation
struct CameraFeed:UIViewControllerRepresentable {
//@Environment(\.presentationMode) var presentationMode
public enum CameraError: Error {
case badInput, badOutput
}
cl... | true |
3240965e1430ee4e85bef89a859a6829396706bf | Swift | marklin2012/O2PlayingCard | /Sources/O2PlayingCard.swift | UTF-8 | 709 | 3.421875 | 3 | [] | no_license | public struct O2PlayingCard {
let rank: O2Rank
let suit: O2Suit
public init(rank: O2Rank, suit: O2Suit) {
self.rank = rank
self.suit = suit
}
}
// MARK: - Equatable
extension O2PlayingCard: Equatable {}
public func ==(lhs:O2PlayingCard, rhs: O2PlayingCard) -> Bool {
return lhs.rank == rhs.rank ... | true |
6230c264494a03af357d44143bfe8ff4ada2b288 | Swift | VolodymyrBereziuk/DUA | /DostupnoUA/Code/Utility/APILayer/Core/Connection.swift | UTF-8 | 1,514 | 2.796875 | 3 | [] | no_license | //
// Connection.swift
// OpenWeatherMap
//
// Created by admin on 6/16/19.
// Copyright © 2019 Viktor Drykin. All rights reserved.
//
import Alamofire
import Foundation
public typealias Parameters = [String: Any]
protocol Connection {
associatedtype ReturnType: Decodable
var method: HTTPMethod { get }
... | true |
07b34fc1690f28ae2e53bda17fce1e71d4f96f81 | Swift | qyz777/swift-lexical-analyzer | /swift-lexical-analyzer/main.swift | UTF-8 | 591 | 2.75 | 3 | [] | no_license | //
// main.swift
// swift-lexical-analyzer
//
// Created by 戚译中 on 2019/3/21.
// Copyright © 2019 戚译中. All rights reserved.
//
import Foundation
func readFile(with name: String) -> String {
let path = Bundle.main.path(forResource: name, ofType: "txt")
let url = URL(fileURLWithPath: path ?? "")
do {
... | true |
e3c5f8fa376004ddbcdf3d7fcc8a845621e365dc | Swift | nickarthur/ExamplesV2 | /Ch24/Ch24 24.6 Comparable Protocol Operator.playground/Contents.swift | UTF-8 | 750 | 3.34375 | 3 | [] | no_license | struct Answer: Comparable {
var text: String
var score: Int
var accepted: Bool
}
func == (lhs: Answer, rhs: Answer) -> Bool {
return (lhs.accepted == rhs.accepted) && (lhs.score == rhs.score)
}
func < (lhs: Answer, rhs: Answer) -> Bool {
if lhs.accepted {
return false
} else if rhs.acc... | true |
9c8b696bc8f5b8a0f1146633e2bce453fb770c22 | Swift | TrendingTechnology/swift-web-page | /Sources/Css/Values/Number.swift | UTF-8 | 2,841 | 2.78125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | public protocol HasValueOfIntegerLiteral {}
public protocol HasValueOfInteger: HasValueOfIntegerLiteral {}
public protocol HasValueOfUnsignedInteger: HasValueOfIntegerLiteral {}
public protocol HasValueOfFloatLiteral {}
public protocol HasValueOfNumber: HasValueOfFloatLiteral, HasValueOfInteger {}
public protocol... | true |
6a1ca16ad75d13412ffd29ba613356cbc4fbfecc | Swift | preachermys/NetworkingWorkshop | /NetworkingWorkshop/UILabel.swift | UTF-8 | 5,770 | 2.734375 | 3 | [] | no_license | //
// UILabel.swift
// NetworkingWorkshop
//
// Created by Admin on 05.04.2021.
//
import Foundation
import UIKit
extension UILabel {
func labelLines(maxWidth: CGFloat = UIScreen.main.bounds.width - 100.0) -> Int {
let maxSize = CGSize(width: maxWidth, height: CGFloat(Float.infinity))
let char... | true |
abf13ab79563747fb9eed25e2b628641c573c18f | Swift | justvcreative/ARTE | /Arte/ImageController.swift | UTF-8 | 2,535 | 2.71875 | 3 | [] | no_license | //
// ImageController.swift
// Arte
//
// Created by Veronica on 3/22/16.
// Copyright © 2016 JustVCreative. All rights reserved.
//
import UIKit
class ImageController: UIViewController, UIPageViewControllerDataSource, UIPageViewControllerDelegate {
var pageViewController: UIPageViewController!
let imag... | true |
75dff3d091a0e3b5bf09fea23eceddf600633214 | Swift | vvarshad/Plan-Your-Travel | /Plan-Your-Travel/MapViewController.swift | UTF-8 | 6,369 | 2.578125 | 3 | [] | no_license |
import UIKit
import CoreLocation
import SwiftyJSON
class MapViewController: UIViewController{
@IBOutlet weak var mapView: GMSMapView!
var source:String!
var destination: String!
var reachingTime: Int!
let locationManager = CLLocationManager()
lazy var data = NSMutableData()
var ... | true |
ae5c631e18d1f7c4e4ffd1f0512997441d566732 | Swift | ihusnainalii/my-swift-journey | /_macOS-Projects/macOS-ImageFilterSwiftUIMac/ImageFilterMac/Bindings/ImageFilterObervable.swift | UTF-8 | 582 | 2.703125 | 3 | [
"MIT"
] | permissive | //
// ImageFilterObervable.swift
// ImageFilterMac
//
// Created by Alfian Losari on 25/02/20.
// Copyright © 2020 Alfian Losari. All rights reserved.
//
import Combine
import Cocoa
class ImageFilterObservable: ObservableObject {
@Published var filteredImage: NSImage? = nil
let image: NSImage
le... | true |
92fda8b953ca2444437829235a1123caf05068d7 | Swift | jifengchao/swift-base | /闭包1.playground/Contents.swift | UTF-8 | 632 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | ////: Playground - noun: a place where people can play
//
import UIKit
import XCPlayground
let showView = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
let rectangle = UIView(frame: CGRect(x: 0, y: 0, width: 50, height: 50))
showView.addSubview(rectangle)
rectangle.center = showView.center
rectangle.back... | true |
bfc4cdec32eef6da5ee148d5934fb97002148d9d | Swift | stephtelolahy/ParsableCommandDemo | /ParsableCommandDemo/Impl/DeckToStore.swift | UTF-8 | 364 | 3 | 3 | [] | no_license | //
// DeckToStore.swift
// ParsableCommandDemo
//
// Created by Hugues Stéphano TELOLAHY on 07/05/2021.
//
class DeckToStore: Command {
@Argument(name: "count", defaultValue: 1)
var numberOfCards: Int
@Argument(name: "hidden")
var hidden: Bool
override func run() -> String {
... | true |
96354b604172a4c72b180d522f34edbac7567883 | Swift | ljmutawa/ios-cw-2 | /ios-cw2-p3.playground/Contents.swift | UTF-8 | 477 | 3.3125 | 3 | [] | no_license |
var grades = [90.3, 83.92, 90.04]
let average = (grades[0] + grades [1] + grades[2]) / 3
if average > 90
{ print ("ممتاز") }
else if average > 80
{ print ("جيد جدا")}
else if average > 70
{ print ("جيد") }
else
{ print ("راسب")}
grades.remove(at: 1)
let average2 = (grades[0] + grades [1]) / 2
if average2 > 90
{ pri... | true |
03c6de485058ea76c1bde3234bba2017ac81ebc6 | Swift | bond00729/simple-calc-iOS-part-2 | /SimpleCalciOSPart2/SimpleCalciOSPart2/CalcViewController.swift | UTF-8 | 5,766 | 3.078125 | 3 | [] | no_license | //
// ViewController.swift
// SimpleCalciOSPart2
//
// Created by Matt Bond on 10/27/16.
// Copyright © 2016 Matt Bond. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
private var numbers: [Int] = []
private var allNumbers: [Int] = []
private var left: Int = 0
pr... | true |
ece5f3e9eb2bb098680e1f3b1503da5934636acc | Swift | luckycontrol/SwiftUI-Tutorial | /MartView/MartView/Neuromorphic/Neuromorphic.swift | UTF-8 | 704 | 3.0625 | 3 | [] | no_license | //
// Neuromorpic.swift
// MartView
//
// Created by 조종운 on 2020/07/01.
// Copyright © 2020 조종운. All rights reserved.
//
import SwiftUI
struct Neuromorphic: View {
var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
}
}
struct FoodDetailModifier: ViewModifier {
... | true |
2d380defb818ed2421a76e0ab44dba1be0ffe195 | Swift | adamnemecek/3DCharts | /3DCharts/ViewController.swift | UTF-8 | 4,660 | 2.796875 | 3 | [] | no_license | //
// ViewController.swift
// 3DCharts
//
// Created by Vivek Nagar on 8/23/14.
// Copyright (c) 2014 Vivek Nagar. All rights reserved.
//
import UIKit
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
var tableView: UITableView!
var cylinderChartSceneController:SceneVie... | true |
6f3b1b8d0ec0ae462d3af45057e6897f681ae6e7 | Swift | fabioacri81/SwiftUIExample | /NewXcodeProject/FirstScreen/models/TrailerViewModel.swift | UTF-8 | 2,907 | 2.953125 | 3 | [] | no_license | //
// TrailerViewModel.swift
// NewXcodeProject
//
// Created by Fabio Acri on 22/08/2019.
// Copyright © 2019 Fabio Acri. All rights reserved.
//
import Foundation
import UIKit.UIImage
import Combine
enum ModelState: String, CaseIterable {
case initialised
case retrieveImages
case ready
case redi... | true |
975987695231cc3b31b08b00b3f8c558ffe3293a | Swift | muter-mutation-testing/muter | /Repositories/ProjectWithConcurrency/ProjectWithConcurrency/main.swift | UTF-8 | 887 | 3.296875 | 3 | [
"MIT"
] | permissive | import Foundation
private let semaphore = DispatchSemaphore(value: 1)
private let conditionLock = NSConditionLock(condition: 0)
private let lock = NSRecursiveLock()
private let condition = NSCondition()
private func semaphoreLock(block: () -> Void) {
defer{ semaphore.signal() }
semaphore.wait()
block()
}
... | true |
44ebf35b1b74d8fb09474d21a98e937eea539c8c | Swift | Pyozer/Swift-Snake-Game | /Snake/GameManager.swift | UTF-8 | 5,811 | 3.078125 | 3 | [
"MIT"
] | permissive | //
// GameManager.swift
// Snake
//
// Created by Jean-Charles Moussé on 14/02/2019.
// Copyright © 2019 Jean-Charles Moussé. All rights reserved.
//
import SpriteKit
enum PlayerDirection {
case LEFT
case RIGHT
case UP
case DOWN
case DIED
}
class GameManager {
private var scene: Game... | true |
55c37d919acb0f31a77ff0d57ea39dfdb20e2c98 | Swift | NiteshSrivastav/CurrencyConverter | /CountryCapitalApp/CountryCapitalApp/ViewController.swift | UTF-8 | 2,650 | 2.96875 | 3 | [] | no_license | //
// ViewController.swift
// CountryCapitalApp
//
// Created by Nitesh Srivastva on 08/02/18.
// Copyright © 2018 Nitesh Srivastva. All rights reserved.
//
import UIKit
struct Country : Decodable{
var name : String
var capital : String
var region : String
var flag : String
}
class ViewContr... | true |
904c36c543e8c2a96bc718f1b9002cc7351c7796 | Swift | CostardRouge/DaveoIdeaBox | /DaveoIdeaBox/DaveoIdeaBox/EntriesCollectionViewController.swift | UTF-8 | 4,658 | 2.65625 | 3 | [
"MIT"
] | permissive | //
// EntriesCollectionViewController.swift
// DaveoIdeaBox
//
// Created by Steeve is working on 20/10/15.
// Copyright © 2015 Daveo. All rights reserved.
//
import UIKit
import Foundation
private let reuseIdentifier = "EntryCell"
private let sectionInsets = UIEdgeInsets(top: -40.0, left: 10.0, bottom: 30.0, rig... | true |
c653d421c3a5a9a6a0c3f971941a29d69ef48481 | Swift | ShamylZakariya/Squizit | /Squizit/Models/Drawing.swift | UTF-8 | 10,379 | 2.796875 | 3 | [
"MIT"
] | permissive | //
// Drawing.swift
// FreehandSwift
//
// Created by Shamyl Zakariya on 8/5/14.
// Copyright (c) 2014 Shamyl Zakariya. All rights reserved.
//
import Foundation
import UIKit
let DrawingSerializationCookie:[UInt8] = [73, 71, 64, 72]
let DrawingSerializationVersion_V0:Int32 = 0
class Drawing {
private var _deb... | true |
59e123871a18d2fdda8303bc73d873aa82b3d2c6 | Swift | MohammedEbrahimSaleh/DailyDiary | /DailyDiary/DailyDiary/controller/initializer/registrationViewController.swift | UTF-8 | 5,792 | 2.65625 | 3 | [] | no_license | import UIKit
import Firebase
import SVProgressHUD
class registrationViewController: UIViewController {
//variables
var userName = ""
var email = ""
var password = ""
var repeatPass = ""
var ProfilePhoto = ""
// outlets
@IBOutlet weak var userNameTextField: Desi... | true |
bb59210d24655381758a3a214dbf515b7e48e7a8 | Swift | Lukaalimbarashvili/TBC-AcademyProjects | /Homework 30/Homework 30/ViewController.swift | UTF-8 | 1,561 | 2.953125 | 3 | [] | no_license | //
// ViewController.swift
// Homework 30
//
// Created by Luka Alimbarashvili on 6/1/20.
// Copyright © 2020 lucas. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
var sandro: Person?
var developer: J... | true |
9191ce8bab2f0d1da11214608a6efad2e26ce8a9 | Swift | thobio/Swift-Animation | /NewAnimation Test/ViewController.swift | UTF-8 | 3,683 | 2.671875 | 3 | [] | no_license | //
// ViewController.swift
// NewAnimation Test
//
// Created by Thobio Joseph on 29/09/20.
//
import UIKit
class ViewController: UIViewController {
var submitButton = SubmitButton()
var typeDuration: TimeInterval = 0.0325
let labelName : UILabel = {
let lbl = UILabel()
lbl.font = ... | true |
8cbe969dd57ea2f80770765a13ddcbdafab01832 | Swift | jamesiggulden/iOS-Olingo | /iOS-Olingo/ClientLibrary/api/edm/geo/SRID.swift | UTF-8 | 5,004 | 2.8125 | 3 | [] | no_license | /*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License") you may not... | true |
65c0f37ba3d334bb4fedf9f22fc53d1213cfaba7 | Swift | y-okudera/SwiftUINibbles | /SwiftUINibbles/Sources/DesignSystem/Components/Neumorphic/LinearGradient/LinearGradient+.swift | UTF-8 | 273 | 2.515625 | 3 | [
"MIT"
] | permissive | //
// LinearGradient+.swift
//
//
// Created by Yuki Okudera on 2021/10/21.
//
import SwiftUI
extension LinearGradient {
public init(_ colors: Color...) {
self.init(gradient: Gradient(colors: colors), startPoint: .topLeading, endPoint: .bottomTrailing)
}
}
| true |
e3dde47f37e9ca5d20cc0d5d68e68a57e11deb74 | Swift | DoskhanaRiza/seafood | /Seafood/Model/Profile Model/ChangePasswordVCModel.swift | UTF-8 | 2,829 | 2.765625 | 3 | [] | no_license | //
// ChangePasswordVCModel.swift
// Seafood
//
// Created by Riza on 3/23/21.
//
import UIKit
class ChangePasswordVCModel {
func handleOldPasswordAlert(vc: UIViewController) {
let alert = UIAlertController(title: "Ошибка",
message: "Вы ввели неправил... | true |
d94c085b49acce8d8d684191ecaa8567cb86e9f9 | Swift | Tashreque/Elementary-music-player-app | /Custom Music Player/Model/SongDataModel.swift | UTF-8 | 509 | 3.046875 | 3 | [] | no_license | import Foundation
import UIKit
/* Model class for a song.*/
class SongDataModel {
let songUrl: URL
let songName: String
let songExtension: String
let songArtist: String
let songAlbum: String
init(songUrl: URL, songName: String, songExtension: String, songArtist: String, songAlbum: String) ... | true |
72d360e5d0c349955f9748bbd96d309cc0834a64 | Swift | SynchronicSolutions/CorePersistence | /Example/User+CoreDataProperties.swift | UTF-8 | 1,011 | 2.625 | 3 | [
"MIT"
] | permissive | //
// User+CoreDataProperties.swift
// CorePersistence_Example
//
// Created by Milos Babic on 12/12/19.
// Copyright © 2019 CocoaPods. All rights reserved.
//
//
import Foundation
import CoreData
import CorePersistence
extension User {
public enum UserType: Int, Transformable {
case user
... | true |
66fcb38d2109a00efff16d014d40fba3242c16e4 | Swift | tutsplus/iOSFromScratch-ShoppingList-2 | /Shopping List/AppDelegate.swift | UTF-8 | 3,826 | 2.75 | 3 | [
"BSD-2-Clause"
] | permissive | //
// AppDelegate.swift
// Shopping List
//
// Created by Bart Jacobs on 12/12/15.
// Copyright © 2015 Envato Tuts+. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFini... | true |
a695d96eee0bf4872c5229e92c2657c6520b5d50 | Swift | franky4p/SwiftUI_repo | /TestTask/TestTask/Model/AnswerData.swift | UTF-8 | 613 | 2.515625 | 3 | [] | no_license | //
// AnswerData.swift
// TestTask
//
// Created by macbook on 14.05.2021.
//
import Foundation
struct Response<T: Decodable> : Decodable {
private enum CodingKeys : String, CodingKey {
case items = "rates"
case rid = "rid"
case code = "code"
case downloadDate = "downloadDate"
... | true |
e0e9f37247e6bf5c238af8831216f8bc7942d0c5 | Swift | smvzhgt/Covid19App | /Covid19App/Scenes/Global/Business Logic/GlobalInteractor.swift | UTF-8 | 1,082 | 2.609375 | 3 | [] | no_license | //
// GlobalInteractor.swift
// Covid19App
//
// Created by oleg on 16.09.2020.
// Copyright © 2020 covid19app. All rights reserved.
//
import Foundation
final class GlobalInteractor {
// MARK: - Public Properties
let presenter: GlobalPresenterProtocol!
// MARK: - Private Properties
... | true |
3c01a8309a8e27208efb3bf8240c26195963c638 | Swift | frenetic-be/picontrol-swift | /PiControl/DashboardAnyCommandTableViewCell.swift | UTF-8 | 1,172 | 2.75 | 3 | [] | no_license | //
// DashboardAnyCommandTableViewCell.swift
// PiControl
//
// Created by Julien Spronck on 15/02/2017.
// Copyright © 2017 Julien Spronck. All rights reserved.
//
import UIKit
class DashboardAnyCommandTableViewCell: UITableViewCell, UITextFieldDelegate {
// MARK: Properties
@IBOutlet weak var comm... | true |
4ecd82f173bcf7dce6d1d1e982549fc689f2fc0e | Swift | NaingAungLuu/Movie-Booking-App | /Movie Booking App/ui/cells/tableview/MovieTimeGrid/MovieTimeGridTableViewCell.swift | UTF-8 | 4,774 | 2.625 | 3 | [] | no_license | //
// MovieTimeGridTableViewCell.swift
// Movie Booking App
//
// Created by Harry Jason on 06/08/2021.
//
import UIKit
class MovieTimeGridTableViewCell: UITableViewCell {
@IBOutlet weak var collectionViewMovieTime: UICollectionView!
@IBOutlet weak var lblCinemaName: UILabel!
@IBOutlet weak var c... | true |
49fb265507a828782bc5042b6667506e203338ca | Swift | Arvindcs/RowAnimator | /RowAnimator/Details/DetailsViewController.swift | UTF-8 | 3,308 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive |
import UIKit
class DetailsViewController: UIViewController {
lazy var customView = view as! DetailsView
let viewModel: ViewModel
override func loadView() {
view = DetailsView(frame: UIScreen.main.bounds)
}
init(viewModel: ViewModel) {
self.viewModel = viewModel
s... | true |
692c14b18f20ef1685e2ef1affee9f85992a245f | Swift | wolox-training/nm-swift | /WBooks/Bootstrappers/NetworkingBootstrapper.swift | UTF-8 | 2,179 | 2.515625 | 3 | [] | no_license | //
// NetworkingBootstrapper.swift
// WBooks
//
// Created by Argentino Ducret on 05/08/2018.
// Copyright © 2018 Wolox. All rights reserved.
//
import Foundation
import Networking
import ReactiveSwift
import AlamofireNetworkActivityIndicator
import AlamofireNetworkActivityLogger
import UIKit
class NetworkingBoot... | true |
8e084f2f2c675ead2c78f6cd5bd29e6effef801c | Swift | juliand665/Iconizer | /Iconizer/Back End/Drawable.swift | UTF-8 | 1,190 | 2.75 | 3 | [
"MIT"
] | permissive | import Foundation
import CGeometry
import Bitmap
protocol Drawable {
var previewImage: CGImage { get }
func draw(in context: CGContext, within rect: CGRect)
}
struct PNG: Drawable {
let image: CGImage
var previewImage: CGImage { image }
init?(at url: URL) {
guard let image = CGImage.loadFromPNG(at: url) ... | true |
67bbaa27079dbce61c53d921cb448b04f46c5271 | Swift | Doko27/MovieApp | /movie-app/movie-app/Helper/UITextField+Extension.swift | UTF-8 | 627 | 2.578125 | 3 | [] | no_license | //
// UITextField+Extension.swift
// movie-app
//
// Created by IRFAN TRIHANDOKO on 04/12/19.
// Copyright © 2019 IRFAN TRIHANDOKO. All rights reserved.
//
import UIKit
public extension UITextField {
func configFieldPadding(left: CGFloat, right: CGFloat) {
let paddingLeftView = UIView(frame: CGRe... | true |
ea9afa4dd6a13d8232bb8cd32080af8b4dcd847b | Swift | luistejadaa/PokeApp | /PokeApp/PokeApp/Services/PokemonService.swift | UTF-8 | 884 | 3.03125 | 3 | [] | no_license | //
// PokemonService.swift
// PokeApp
//
// Created by Intellisys on 25/2/21.
//
final class PokemonService: PokemonServiceProtocol {
static let shared: PokemonService = {
let instance = PokemonService()
return instance
}()
let directlyPokemon = "https://pokeapi.co/api/v2/pokem... | true |
3518a4599b0ff0397e3734f4a8b0629f85e16a71 | Swift | nmore-ios/kxkg | /kxkg/Entity/UserEntity.swift | UTF-8 | 1,117 | 2.59375 | 3 | [] | no_license | //
// File.swift
// moreEntity
//
// Created by nevermore on 15/12/22.
// Copyright © 2015年 hzw. All rights reserved.
//
import Foundation
/// 会员实体
class UserEntity:Mappable {
///会员Id
var userID:Int?
///会员名
var userName:String?
///会员帐号
var userAccount:String?
///会员密码
var userPosswo... | true |
5d5a5e98581d7591e4e29ac5fa3519230ae6447c | Swift | iPhoneNoobDeveloper/HerokuApp | /HerokuApp/Service/Reachability.swift | UTF-8 | 2,007 | 3 | 3 | [] | no_license | //
// Reachability.swift
//
import Foundation
import Reachability
class NetworkReachability: NSObject {
var reachability: Reachability!
static let sharedInstance: NetworkReachability = { return NetworkReachability() }()
override init() {
super.init()
reachability = Reachability()!
... | true |
53a661b636e3bed990368e188ed1b79b7938bc59 | Swift | hgp691/pruebaHero | /pruebaHero/Selector/CategorySelectorCellViewModel.swift | UTF-8 | 534 | 2.59375 | 3 | [] | no_license | //
// CategorySelectorCellViewModel.swift
// pruebaHero
//
// Created by Horacio Guzman on 10/25/18.
// Copyright © 2018 hero. All rights reserved.
//
import Foundation
import UIKit
class CategorySelectorCellViewModel{
var category: Category
var name: String
var image: UIImage?
var id: String... | true |
370c4849ef1ccd05401cd902baa00b3c2ead2687 | Swift | dongliang3571/TOTP-Generator | /TOTPGenerator/Controller/StatusItemController.swift | UTF-8 | 1,397 | 2.546875 | 3 | [] | no_license | //
// File.swift
// totp_generator
//
// Created by Dong Liang on 2/26/21.
//
import Foundation
import Cocoa
class StatusItemController {
let statusItem: NSStatusItem!
var popover: NSPopover!
var title: String {
get {
return statusItem.button?.title ?? ""
}
... | true |
3a6790067ff71481edeace28f65b7f5bbe0ed163 | Swift | slo-addy/NewPass | /NewPassTests/UnitTests/PasswordBuilderUnitTests.swift | UTF-8 | 5,764 | 2.828125 | 3 | [
"MIT"
] | permissive | //
// PasswordBuilderUnitTests.swift
// NewPassTests
//
// Created by Addison Francisco on 11/4/18.
// Copyright © 2018 Addison Francisco. All rights reserved.
//
import XCTest
@testable import NewPass
class PasswordBuilderUnitTests: XCTestCase {
let sut = PasswordBuilder()
func testBuildWithEmp... | true |
c2b6fb34de13d3c86e5c9fd5ca4ac981b0a7a239 | Swift | dung-kimnguyen/contactsapp | /Contacts/UI/View Controllers/ContactFormTableViewController.swift | UTF-8 | 6,680 | 2.8125 | 3 | [] | no_license |
// contactsapp
// Created by Dung Kim Nguyen. on 05/05/21.
import UIKit
// Indicates the state of the ContactForm which uses this information to update the UI accordingly
enum ContactFormState {
case undefined
case new
case edit(contact: Contact)
}
/// A tableview controller used to get information a... | true |
ab0488ce6151c829b2f0480c2288e2cc589f668d | Swift | janosova5/wedrapp | /wedrapp/app/ViewModel/LocationViewModel.swift | UTF-8 | 1,203 | 2.75 | 3 | [] | no_license | //
// LocationViewModel.swift
// weatherAppJunior
//
// Created by ljanosova on 4.2.19.
// Copyright © 2019 ljanosova. All rights reserved.
//
import Foundation
import CoreLocation
import ReactiveCocoa
import ReactiveSwift
final class LocationViewModel: NSObject {
var userLocationCoordinates = MutablePro... | true |
8888b39c9a66bfaecb5246ec7f9ea737590e9449 | Swift | roundware/roundware-ios-framework-v2 | /RWFramework/RWFramework/Playlist/Speaker.swift | UTF-8 | 4,447 | 2.84375 | 3 | [
"MIT"
] | permissive |
import Foundation
import CoreLocation
import GEOSwift
import AVFoundation
import Repeat
/**
A polygonal geographic zone within which an ambient audio stream broadcasts continuously to listeners. Speakers can overlap, causing their audio to be mixed together accordingly.
Volume attenuation happens linearly over a sp... | true |
c159387241a110652168a9a43dc81f7771da48a9 | Swift | Tuluobo/LintTe | /LintTe/Classes/Models/Status.swift | UTF-8 | 3,184 | 2.640625 | 3 | [] | no_license | //
// Status.swift
// LintTe
//
// Created by WangHao on 16/6/6.
// Copyright © 2016年 Tuluobo. All rights reserved.
//
import Foundation
class Status: NSObject {
// 微博创建时间
var created_at: String!
// 字符型微博ID
var idstr: String!
// 微博MID
var mid: Int64 = 0
// 微博信息内容
var text: String?
... | true |
8a03ba059130e552dae17f043c69334f79778b18 | Swift | 2kk-istina/TaskManager | /TaskManager/UI/Task/TaskCell.swift | UTF-8 | 720 | 2.75 | 3 | [] | no_license | //
// Taskcell.swift
// TaskManager
//
// Created by Истина on 06/06/2019.
// Copyright © 2019 Истина. All rights reserved.
//
import UIKit
protocol ChangeButton: class {
func changeButton(checked: EntityTask)
}
class Taskcell: UITableViewCell {
@IBOutlet weak var catName: UILabel!
@IBOutlet weak var... | true |
2178c0cecf3273417155c1bfa901f2fc6eae3301 | Swift | pattessm/DeathStar | /DeathStar/DeathStar/UI/DetailsView/GradientView.swift | UTF-8 | 628 | 2.6875 | 3 | [] | no_license | //
// GradientView.swift
// PhunApp
//
// Created by Sam Patteson on 7/26/18.
// Copyright © 2018 Sam Patteson. All rights reserved.
//
import UIKit
class GradientView: UIView {
override open class var layerClass: AnyClass {
return CAGradientLayer.classForCoder()
}
required init?(coder aD... | true |
e461699d62cbb7f154592da30d328a42dd22c965 | Swift | waitwalker/iOS_demos | /TreeNode/TreeNode/ViewController.swift | UTF-8 | 1,694 | 3.390625 | 3 | [
"MIT"
] | permissive | //
// ViewController.swift
// TreeNode
//
// Created by etiantian on 2020/4/29.
// Copyright © 2020 etiantian. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let root = TreeNode(value: 1)
let node1 = Tree... | true |
913a3c374f344d139f6c2626fa9b2de7d111c2fa | Swift | alex-paczeika/ShopnLeave | /ShopLeave/MenuViewController.swift | UTF-8 | 1,268 | 2.515625 | 3 | [] | no_license | //
// MenuViewController.swift
// ShopLeave
//
// Created by Paczeika Dan on 23/10/2018.
// Copyright © 2018 Paczeika Dan. All rights reserved.
//
import UIKit
import Firebase
import AVFoundation
class MenuViewController: UIViewController {
@IBOutlet weak var letsGoShoppingLabel: UIButton!
@IBOutlet weak v... | true |
d0967ed4657fe5639b514f6178fc416e5399be3d | Swift | pierce412/Capstone | /EP/View Controller/View/AircraftCell.swift | UTF-8 | 2,971 | 2.59375 | 3 | [] | no_license | // AircraftCell.swift
import UIKit
class AircraftCell: UITableViewCell {
var ac: Aircraft?
var acLabel: UILabel = {
let view = UILabel()
view.translatesAutoresizingMaskIntoConstraints = false
view.contentMode = .scaleToFill
view.numberOfLines = 0
view.lineBreakMode... | true |
fb3d1a048a338a2fa97f637d2d02792bea312798 | Swift | ptescher/EventSourceKit-iOS | /EventSourceKit/JSONMessageParser.swift | UTF-8 | 1,433 | 2.984375 | 3 | [] | no_license | //
// JSONMessageParser.swift
// EventSourceKit
//
// Created by Patrick Tescher on 8/19/15.
// Copyright © 2015 Ticketfly. All rights reserved.
//
import Foundation
import PromiseKit
public struct JSONMessageParser: MessageParser {
let topicRegex: NSRegularExpression
public func matchesMessage(mess... | true |
92dd4242250e27f33485c69c5d445ab0011f34a2 | Swift | canhth/NetworkLayer | /NetworkLayerExample/NetworkLayer/BaseNetworking/APIEndpoint.swift | UTF-8 | 2,277 | 3.21875 | 3 | [] | no_license | //
// APIEndpoint.swift
// CTNetworking
//
// Created by Canh Tran Wizeline on 5/5/19.
// Copyright © 2019 Canh Tran. All rights reserved.
//
import Foundation
typealias JSON = [String: Any]
typealias HTTPHeaders = [String: String]
enum HTTPMethod: String {
case get = "GET"
case post = "POST"
case p... | true |
9394f290e3a3fe84c1eb91714550fc451b3c8f3c | Swift | cyberTechA/EsameSAD.20-21 | /AppEsame/ViewModel/RegistrazioneLogin/RegistrazioneViewModel.swift | UTF-8 | 4,703 | 2.71875 | 3 | [] | no_license | //
// RegistrazioneViewModel.swift
// AppEsame
//
// Created by Carlo D'Avino on 11/05/21.
//
import Foundation
import UIKit
import FirebaseAuth
class RegistrazioneViewModel{
//variabili collegamento al model
var pazienteModel = Paziente()
var medicoModel = Medico()
init(){
... | true |
93a9409d3fd411d11996f3fabb745fa084268ed7 | Swift | cpimhoff/AntlerKit | /Framework/AntlerKitTests/PhysicsTests.swift | UTF-8 | 2,607 | 2.796875 | 3 | [
"MIT"
] | permissive | //
// PhysicsTests.swift
// AntlerKitTests
//
// Created by Charlie Imhoff on 5/4/18.
// Copyright © 2018 Charlie Imhoff. All rights reserved.
//
import XCTest
import SpriteKit
@testable import AntlerKit
class PhysicsTests: XCTestCase {
var category1 : PhysicsBodyCategory!
var category2 : PhysicsBodyCategory!... | true |
54c59dfecb80ddb22309c81543e3914d7b8c1b9c | Swift | blkbrds/rd-combine | /Examinations and projects/Test 2/TemplateProject/CombineExam/Utils/SignInError.swift | UTF-8 | 761 | 2.921875 | 3 | [
"MIT"
] | permissive | //
// LoginError.swift
// CombineExam
//
// Created by Van Le H. on 4/11/21.
// Copyright © 2021 ___ORGANIZATIONNAME___ All rights reserved.
//
import Foundation
enum SignInError: Error {
case invalidUsernameLength
case invalidUsername
case invalidPasswordLength
case unknown
var message: Str... | true |
36387d626ac47742a2882bbc64d15261365f9791 | Swift | boscoybarra/100DaysOfSwiftUI | /Project 12 - CoreDataProject/CoreDataProject/CoreDataProject/ContentView.swift | UTF-8 | 1,901 | 3.234375 | 3 | [] | no_license | //
// ContentView.swift
// CoreDataProject
//
// Created by Bosco on 27/01/2020.
// Copyright © 2020 Bosco Ybarra. All rights reserved.
//
import SwiftUI
enum FilterType: String, CaseIterable {
case equals = "=="
case lessThan = "<"
case beginsWith = "BEGINSWITH"
case not = "NOT"
}
struct Conten... | true |
af74702d357bec7be85604fc0bbd280c5eb84df4 | Swift | svanimpe/around-the-table | /Sources/AroundTheTable/Models/Game.swift | UTF-8 | 8,894 | 3.09375 | 3 | [
"BSD-2-Clause"
] | permissive | import BSON
import Foundation
import LoggerAPI
/**
A game.
This data is gathered from BoardGameGeek.
*/
final class Game {
/// The game's ID on BGG.
let id: Int
/// The date and time at which this data was fetched from BGG.
/// This is used for cache management.
let creationDate: Dat... | true |
7717039f65e5e8809e8206051b0e55a4b0cb7271 | Swift | SFSU-YDiOS/YouDescribe-iOS | /YDiOSViewer/YouTubeApi.swift | UTF-8 | 3,858 | 2.921875 | 3 | [] | no_license | //
// YouTubeApi.swift
// YouDescribe-iOS
//
// Created by Rupal Khilari on 3/2/17.
// Copyright © 2017 SFSU. All rights reserved.
//
import Foundation
import SwiftyJSON
class YouTubeApi {
func getInfo(mediaId: String, finished: @escaping (_ item: [String:String]) ->Void) {
let newUrl = URL(stri... | true |
412cb3a62b327f95c14a2c05d7e8331f499aac1a | Swift | KitsuneNoctus/Womens-History-Final-iOS | /WomenInCode/WomenInCode/Views/WomenOfCodeFlow/profileImage.swift | UTF-8 | 508 | 2.78125 | 3 | [] | no_license | //
// profileImage.swift
// WomenInCode
//
// Created by Henry Calderon on 12/4/20.
//
import SwiftUI
struct profileImage: View {
var image: String?
var body: some View {
Image(image!)
.resizable()
.aspectRatio(contentMode: .fit)
.clipShape(Circle())
.overlay(Cir... | true |
ddb022eab255b1c3c60d2fa16c7f9c89f2d5638e | Swift | labmain/MySnippets | /Swift/d-控制流语句/06-switch 语句-case-区间匹配.swift | UTF-8 | 1,185 | 4.21875 | 4 | [] | no_license | var a: Int8 = 10
// 声明一个CountableRange<Int8>类型的对象
let range = Int8(1) ..< Int8(100)
switch a {
// 这里直接使用范围表达式进行匹配
case -5 ... 0:
print("zero and below!")
// 我们甚至可以直接用CountableRange<Int8>对象作为匹配表达式
case range:
print("one to ninety-nine!")
// 这里使用了复合case匹配,
// 由三个表达式构成。
// 前后两个都是范围表达式,
// 而中间... | true |
8b861ed2fd83c39f480e9a58c4df3d95f6c2b0fd | Swift | BaHui/BHSwifter | /WillSetAndDidSet/WillSetAndDidSet/ViewController.swift | UTF-8 | 1,466 | 3.75 | 4 | [] | no_license | //
// ViewController.swift
// WillSetAndDidSet
//
// Created by QiaoBaHui on 2018/11/2.
// Copyright © 2018 QiaoBaHui. All rights reserved.
//
import UIKit
// 定义一个Person类
class BHPerson: NSObject {
var name: String? {
willSet {
print("willSet: 新值 -> \(String(describing: newValue))")
}
didSe... | true |
f349d7fd53b65e3d37abfc6bb1bc4ca58ee64d7d | Swift | labtempo/mNetMon-iOS | /SignalStrength/AppColors.swift | UTF-8 | 1,019 | 2.578125 | 3 | [] | no_license | //
// AppColors.swift
// SignalStrength
//
// Created by Henrique do Prado Linhares on 18/12/15.
// Copyright © 2015 Henrique do Prado Linhares. All rights reserved.
//
import Foundation
import UIKit
/*
Class that stores the UIColors used in this application
*/
class AppColors{
static let viewGreenColor ... | true |
77b82044abc5931ee3aad9bd252cc0b3fae37100 | Swift | icylydia/PlayWithLeetCode | /172. Factorial Trailing Zeroes/solution.swift | UTF-8 | 238 | 2.9375 | 3 | [
"MIT"
] | permissive | class Solution {
func trailingZeroes(n: Int) -> Int {
var idx = 5
var ans = 0
var p = n / idx
while p != 0 {
ans += p
idx *= 5
p = n / idx
}
return ans
}
} | true |
cf29a9adbbd13bf40e3cc3ffa43e49ae559ba156 | Swift | Mavryc-Technologies/mavryc-ios | /mavryc/mavryc/ViewController+Keyboard.swift | UTF-8 | 3,467 | 2.640625 | 3 | [] | no_license | //
// ViewController+Keyboard.swift
// mavryc
//
// Created by Todd Hopkinson on 9/12/17.
// Copyright © 2017 Mavryc Technologies, Inc. All rights reserved.
//
import UIKit
extension UIViewController {
// get first repsonder
func getFirstResponder()->UIView?{
var firstResponder : UIView?
... | true |
ed3841a8900c53ae104e73a5cf876d9f630ab8f2 | Swift | Shinkai123/TYHTool | /TYHBaseTool/Classes/Target/Target_Button.swift | UTF-8 | 2,248 | 2.609375 | 3 | [] | no_license | //
// Target_Button.swift
// TYHTool
//
// Created by YaoHua Tan on 2019/10/28.
// Copyright © 2019 YaoHua Tan. All rights reserved.
//
import UIKit
@objc class Target_Button: NSObject {
@objc func Action_toolCreatImgButton(_ params: Dictionary<String, Any>) -> UIBarButtonItem {
let target = params["t... | true |
6e2b3c6bc44a3add4cdfb4551026311c61e342c9 | Swift | mattsrobot/ChessKit | /Chess/ChessKit/Pieces/Pawn.swift | UTF-8 | 2,540 | 3.6875 | 4 | [] | no_license | //
// Pawn.swift
// Chess
//
// Created by Matthew Wilkinson on 25/03/2017.
// Copyright © 2017 Some Robots. All rights reserved.
//
import Foundation
public final class Pawn: Piece {
public var color: Color
public var moved: Bool
required public init(color: Color, moved: Bool) {
sel... | true |
42a77ed299f2dd07805c6308f0521b18a067d999 | Swift | kyosyun/swiftSample | /PaintSample/PaintSample/PaintImageView.swift | UTF-8 | 3,992 | 2.734375 | 3 | [] | no_license | //
// PaintImageView.swift
// PaintSample
//
// Created by 許 駿 on 2018/04/30.
// Copyright © 2018年 kyo_s. All rights reserved.
//
import UIKit
class PaintImageView: UIImageView {
/*
// Only override draw() if you perform custom drawing.
// An empty implementation adversely affects performance durin... | true |
ee1b423e5e3c5c6485f4350d5d55b64839bd4d95 | Swift | ccjiancui/SwiftStudyDemo | /Swift Study Demo/SwiftProgramming.playground/Pages/Switch.xcplaygroundpage/Contents.swift | UTF-8 | 2,814 | 4.59375 | 5 | [] | no_license | //: [Previous](@previous)
import Foundation
// 每个 case 可以不写 break
// 1. switch 分支可以有多个匹配值,以逗号“,”隔开
// 2. switch 分支可以匹配区间 case:500…505
// 3. switch 分支可以使用值绑定获取临时变量,添加 where 子句做条件判断
// 4. switch 分支可以结合元祖,进行模式匹配
// 5. switch 可以使用 if case 来进行单一模式匹配,而不用使用 switch 方法,从而避免写无用的 default 分支
var statusCode = 200
var errorString... | true |
8d3ccdfb5b89094979ff1670e664edcf9e0e6770 | Swift | chanoktrue/PieChart | /PieChart/PieChart/PieChart.swift | UTF-8 | 2,797 | 2.734375 | 3 | [] | no_license | //
// PieChartView.swift
// PieChart
//
// Created by Thongchai Subsaidee on 9/4/2564 BE.
//
import Charts
import SwiftUI
struct PieChart: UIViewRepresentable {
let pieChart = PieChartView()
var entries: [PieChartDataEntry]
@Binding var category: Wine.Category
func makeUIView(context: Con... | true |
82a79cb050d89108f4d226189ff741fae6304747 | Swift | janhendry/JSONCoderIO | /Sources/JSONCoderIO/Decoder/SVDC.swift | UTF-8 | 3,539 | 2.578125 | 3 | [] | no_license | //
// ContainerAny.swift
//
// Created by Jan Anstipp on 13.10.20.
//
extension JSONDecoderIO{
struct SVDC: SingleValueDecodingContainer {
let isDebug = false
var codingPath: [CodingKey]
let element: Any
init(_ element: Any,_ codingPath: [CodingKey]) {
... | true |
2d4d89bdec7b42767a08ab4c908d77eb574bbed5 | Swift | etnclp/ERDNetwork | /Sources/Base/NetworkService/HTTPError.swift | UTF-8 | 4,071 | 3 | 3 | [
"MIT"
] | permissive | //
// HTTPError.swift
// ERDNetwork
//
// Created by Erdi Tunçalp on 13.04.2021.
//
import Foundation
public enum HTTPError: Error {
case undefined(data: Data?)
case authentication(data: Data?)
case badRequest(data: Data?)
case notFound(data: Data?)
case internalError(data: Data?)
case noDa... | true |
dbcb497b9353a606f5a9d23f40404736957b54ef | Swift | bairdweng/BWMonitor | /BWMonitor/Classes/BWExceptionHandler.swift | UTF-8 | 2,297 | 2.71875 | 3 | [
"MIT"
] | permissive | //
// BWExceptionHandler.swift
// BWMonitor
//
// Created by bairdweng on 2020/9/16.
//
import UIKit
open class BWExceptionHandler: NSObject {
@objc public static let manage = BWExceptionHandler()
public func exceptionLogWithData() {
setDefaultHandler()
let path = getdataPath()
// ... | true |
5bcf4b1f991d40dc85f707fcb3990717ea801c7d | Swift | LearnDaily/TaskTrace | /Lingdai/View/Task/SubscribedUserTableViewCell.swift | UTF-8 | 3,492 | 2.515625 | 3 | [] | no_license | //
// SubscribedUserTableViewCell.swift
// Lingdai
//
// Created by 钟其鸿 on 16/5/5.
//
//
import UIKit
class SubscribedUserTableViewCell: UITableViewCell {
var scrollView: LDHorizontalScrollView!
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: styl... | true |
ba0157a3c373022286135dac04c0bdcf7677cee1 | Swift | dgcoffman/Stopwatch | /Stopwatch/Prototypes.playground/Contents.swift | UTF-8 | 1,530 | 3.046875 | 3 | [] | no_license | //: A UIKit based Playground for presenting user interface
import PlaygroundSupport
import UIKit
let blue = #colorLiteral(red: 0.0862745098, green: 0.3215686275, blue: 0.9411764706, alpha: 1)
let white = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)
let shadowColor = UIColor(
red: CGFloat(10 / 255.0... | true |
58648091f66cccfd557405069e7dde02ef8da410 | Swift | dag5267/MemeMe | /MemeMe/DetailViewController.swift | UTF-8 | 2,163 | 2.734375 | 3 | [] | no_license | //
// DetailViewController.swift
// MemeMe
//
// Created by Dwayne George on 5/9/15.
// Copyright (c) 2015 Dwayne George. All rights reserved.
//
import UIKit
class DetailViewController: UIViewController {
@IBOutlet weak var detailMemeImage: UIImageView!
var tableViewCalled: Bool? = nil //true if c... | true |
d824d5c1562e324717a82302d4ca72754c2a1cae | Swift | bmcurutan/PaperOranges | /PaperOranges/Utilities/UIColor+Ext.swift | UTF-8 | 1,420 | 2.828125 | 3 | [] | no_license | //
// UIColorExt.swift
// PaperOranges
//
// Created by Bianca Curutan on 1/9/21.
//
import UIKit
extension UIColor {
static var backgroundColor: UIColor {
return UIColor(red: 250/255, green: 250/255, blue: 250/255, alpha: 1.0) // FAFAFA Very light gray
}
static var borderColor: UIColor {
return UICo... | true |
e26632d57c34da89f6f9d6d724150c6953077bee | Swift | GraceToa/MyPlacesFirebase | /MyPlaces/Controller/ProfileViewController.swift | UTF-8 | 2,332 | 2.609375 | 3 | [] | no_license | //
// ProfileViewController.swift
// MyPlaces
//
// Created by GraceToa on 24/03/2019.
// Copyright © 2019 Grace Toa. All rights reserved.
//
import UIKit
import FirebaseAuth
import FirebaseStorage
import FirebaseDatabase
import MapKit
import CoreLocation
class ProfileViewController: UIViewController {
@... | true |
a3be9662ef718386313722bdc2662c79aec6f7f1 | Swift | FalakSarai/website | /Sources/App/Models/Website/SignupData.swift | UTF-8 | 1,320 | 3.109375 | 3 | [
"BSD-2-Clause"
] | permissive | //
// SignupData.swift
// App
//
// Created by Guilherme Rambo on 10/10/18.
//
import Foundation
import Vapor
struct SignupData: Codable {
let name: String
let username: String
let url: String
let password: String
let password2: String
let invite: String
}
extension SignupData: Content { }... | true |
515ee76f0facbb7200662269c991b3b6485b78bd | Swift | binhdugithub/MOBILE | /IOS/PicturePuzzle/PicturePuzzle/NetworkModel.swift | UTF-8 | 3,976 | 2.53125 | 3 | [
"MIT"
] | permissive | //
// FSCore.swift
// Funny Stories
//
// Created by Nguyễn Thế Bình on 12/22/15.
// Copyright © 2015 Nguyễn Thế Bình. All rights reserved.
//
import UIKit
import AVFoundation
//import Alamofire
let SERVER_URL = "http://cusiki.com:8888/api/funnystories"
class NetWorkModel
{
var m_IsLoading: Bool = false... | true |
3682fc0baf3c56bb728df3d7478c5f71665089a5 | Swift | abhay0905/Structs | /Log.swift | UTF-8 | 779 | 2.953125 | 3 | [
"MIT"
] | permissive | //
// Log.swift
// Abhay Shankar
//
// Created by Abhay Shankar on 22/08/18.
// Copyright © 2018 Abhay Shankar. All rights reserved.
//
import Foundation
/// Logging responses in a text file.
/// - Important:
/// To be used in Development only
struct Log: TextOutputStream {
func write(_ string: String) ... | true |
7ca7b0485989133c8c2ce200bbd2635b37cec7cb | Swift | dabrahams/SwiftFormat | /libsyntax.swift | UTF-8 | 640,162 | 3.109375 | 3 | [
"Apache-2.0"
] | permissive | import Darwin
import Foundation
/// Concatenates two collections of `Trivia` into one collection.
public func + (lhs: SwiftSyntax.Trivia, rhs: SwiftSyntax.Trivia) -> SwiftSyntax.Trivia
/// Determines if two nodes are equal to each other.
public func == (lhs: Syntax, rhs: Syntax) -> Bool
public struct AccessLevelModi... | true |
58b1c682821fb45e1f028d999b0bb6367a0986bb | Swift | quantacake/Pocket-List | /Pocket List/Controllers/CategoryViewController.swift | UTF-8 | 5,173 | 2.953125 | 3 | [] | no_license | //
// CategoryViewController.swift
// Pocket List
//
// Created by ted diepenbrock on 8/19/19.
// Copyright © 2019 ted diepenbrock. All rights reserved.
//
import UIKit
import RealmSwift
import ChameleonFramework
class CategoryViewController: SwipeTableViewController {
// Initialize new realm database
... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.