blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
625
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
47
license_type
stringclasses
2 values
repo_name
stringlengths
5
116
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
643 values
visit_date
timestamp[ns]
revision_date
timestamp[ns]
committer_date
timestamp[ns]
github_id
int64
80.4k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
16 values
gha_event_created_at
timestamp[ns]
gha_created_at
timestamp[ns]
gha_language
stringclasses
85 values
src_encoding
stringclasses
7 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
1 class
length_bytes
int64
4
6.44M
extension
stringclasses
17 values
content
stringlengths
4
6.44M
duplicates
sequencelengths
1
9.02k
6a5be4db30d349e9116ba49d42735fd68a3e4019
4306a8cc8a3f5b68ba6ae6e7f0146b3dbb5e9534
/MMapKV/Classes/MMKV.swift
7a82dabbc28801e172f41ed370ff87e59dcef8d9
[ "MIT" ]
permissive
pozi119/MMapKV
be44e8553a98f28c99549476a356e8c02b234bdb
3e229223b966ac8e769eb52a0307f1a3d999e3b1
refs/heads/master
2022-11-09T08:27:19.398712
2022-10-12T07:59:28
2022-10-12T07:59:28
194,797,571
3
0
null
null
null
null
UTF-8
Swift
false
false
9,701
swift
// // MMKV.swift // MMapKV // // Created by Valo on 2019/6/26. // import AnyCoder import Foundation import zlib private var pool: [String: MMKV] = [:] public extension MMKV { class func create(_ id: String = "com.valo.mmkv", base: String = "", crc: Bool = true, didUpdate: DidUpdate? = nil) -> MMKV { let dir = MMKV.directory(with: base) let path = (dir as NSString).appendingPathComponent(id) if let mmkv = pool[path] { return mmkv } let mmkv = MMKV(id, base: base, crc: crc, didUpdate: didUpdate) pool[path] = mmkv return mmkv } } public class MMKV { public private(set) var dictionary: [String: Primitive] = [:] public typealias DidUpdate = ((key: String, value: Primitive?)) -> Void public var didUpdate: DidUpdate? private var file: File private var dataSize: Int = 0 private var crc: Bool private var crcfile: File? private var crcdigest: uLong = 0 private(set) var id: String public init(_ id: String = "com.valo.mmkv", base: String = "", crc: Bool = true, didUpdate: DidUpdate? = nil) { // dir let dir = MMKV.directory(with: base) // mmap file let path = (dir as NSString).appendingPathComponent(id) file = File(path: path) let bytes = [UInt8](Data(bytes: file.memory, count: file.size)) (dictionary, dataSize) = MMKV.decode(bytes) self.id = id self.crc = crc self.didUpdate = didUpdate // crc guard crc else { return } let crcName = (id as NSString).appendingPathExtension("crc") ?? (id + ".crc") let crcPath = (dir as NSString).appendingPathComponent(crcName) crcfile = File(path: crcPath) let buf = file.memory.assumingMemoryBound(to: Bytef.self) var calculated_crc: uLong = 0 calculated_crc = crc32(calculated_crc, buf, uInt(dataSize)) let stored_crc = crcfile!.memory.load(as: uLong.self) if calculated_crc != stored_crc { updateCRC() assert(false, "check crc [\(id)] fail, claculated:\(calculated_crc), stored:\(stored_crc)\n") } crcdigest = calculated_crc } private class func directory(with base: String = "") -> String { var _base = base if _base.count == 0 { _base = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first! } let dir = (_base as NSString).appendingPathComponent("mmapkv") let fm = FileManager.default var isdir: ObjCBool = false let exist = fm.fileExists(atPath: dir, isDirectory: &isdir) if !exist || !isdir.boolValue { try? fm.createDirectory(atPath: dir, withIntermediateDirectories: true, attributes: nil) } return dir } private func updateCRC() { guard crc && crcfile != nil else { return } // calculate let buf = file.memory.assumingMemoryBound(to: Bytef.self) var crc: uLong = 0 crc = crc32(crc, buf, uInt(dataSize)) crcdigest = crc // store let size = MemoryLayout<uLong>.size let pointer = withUnsafePointer(to: &crc) { $0 } let rbuf = UnsafeRawPointer(pointer) crcfile!.write(at: 0 ..< size, from: rbuf) } private func append(_ bytes: [UInt8]) { let len = bytes.count let end = dataSize + len if end > file.size { file.size = end resize() } let range: Range<Int> = Range(uncheckedBounds: (dataSize, end)) file.write(at: range, from: bytes) dataSize = end updateCRC() } public func resize() { file.clear() dataSize = 0 for (key, val) in dictionary { self[key] = val } } } extension MMKV { static let KeyFlag: [UInt8] = [0x4B, 0x45, 0x59] static let ValFlag: [UInt8] = [0x56, 0x41, 0x4C] static let Supported: [Any.Type] = [ Any.self, Bool.self, Int.self, Int8.self, Int16.self, Int32.self, Int64.self, UInt.self, UInt8.self, UInt16.self, UInt32.self, UInt64.self, Float.self, Double.self, String.self, Data.self, NSNumber.self, NSString.self, NSData.self, CGFloat.self, ] class func valueType(of flag: Int) -> Any.Type { return Supported[flag] } class func typeBytes(of value: Any?) -> [UInt8] { guard let value = value else { return [0] } var t = type(of: value) if let idx = Supported.firstIndex(where: { t == $0 }) { return [UInt8(idx)] } switch value { case _ as NSNumber: t = NSNumber.self case _ as NSString: t = NSString.self case _ as NSData: t = NSData.self default: break } if let idx = Supported.firstIndex(where: { t == $0 }) { return [UInt8(idx)] } return [0] } class func toData(_ any: Any?) -> Data? { guard let any = any else { return nil } var data: Data? switch any { case let obj as Bool: data = Data(numeric: obj ? 1 : 0) case let obj as any Numeric: data = Data(numeric: obj) case let obj as String: data = Data(obj.bytes) case let obj as Data: data = obj case let obj as NSNumber: data = Data(numeric: obj.doubleValue) case let obj as NSString: data = Data((obj as String).bytes) case let obj as NSData: data = obj as Data default: assert(false, "unsupported value: \(any)") } return data } } extension MMKV { class func encode(_ element: (key: String, value: Primitive?)) -> [UInt8] { guard let keyData = toData(element.key) else { return [] } let keyBytes = [UInt8](keyData) var valBytes = [UInt8]() if let valData = toData(element.value) { valBytes = [UInt8](valData) } func sizeBytes(of bytes: [UInt8]) -> [UInt8] { let size = bytes.count var sizeBytes = [UInt8]() for i in 0 ..< 4 { sizeBytes.append(UInt8(size >> (i * 8))) } return sizeBytes } let keySizeBytes = sizeBytes(of: keyBytes) let valSizeBytes = sizeBytes(of: valBytes) let valTypeBytes = typeBytes(of: element.value) var bytes = KeyFlag + keySizeBytes + keyBytes bytes += ValFlag + valSizeBytes + valTypeBytes + valBytes return bytes } class func decode(_ bytes: [UInt8]) -> ([String: Primitive], Int) { var offset: Int = 0 var results: [String: Primitive] = [:] let total = bytes.count enum FLAG { case key, val } func parse(_ flag: FLAG) -> (Primitive?, Int) { let flagBuf = flag == .key ? KeyFlag : ValFlag // flag bytes var start = offset var end = start + 3 guard end <= total else { return (nil, offset) } var buf = [UInt8](bytes[start ..< end]) if buf != flagBuf { return (nil, offset) } // size bytes start = end end = start + 4 guard end <= total else { return (nil, offset) } buf = [UInt8](bytes[start ..< end]) var size = 0 for i in 0 ..< 4 { size |= Int(buf[i]) << (i * 8) } var type: Any.Type = String.self if flag == .val { // type byte start = end end = start + 1 guard end <= total else { return (nil, offset) } let typeByte = bytes[start] type = valueType(of: Int(typeByte)) } // value bytes start = end end = start + size guard end <= total else { return (nil, offset) } buf = [UInt8](bytes[start ..< end]) let data = Data(buf) // to value var any: Any? switch type { case is Bool.Type: any = Int(data: data) > 0 ? true : false case let u as any BinaryInteger.Type: any = u.init(data: data) as any BinaryInteger case let u as any BinaryFloatingPoint.Type: any = u.init(data: data) as any BinaryFloatingPoint case is String.Type: any = String(bytes: buf) case is Data.Type: any = data case is NSNumber.Type: any = NSNumber(floatLiteral: Double(data: data)) case is NSString.Type: any = String(bytes: buf) as NSString case is NSData.Type: any = data as NSData default: break } guard let primitive = any as? Primitive else { return (nil, end) } return (primitive, end) } while offset < total { let (key, key_end) = parse(.key) if key == nil { break } offset = key_end let (val, val_end) = parse(.val) if offset == val_end { break } if let key = key as? String { results[key] = val } offset = val_end } return (results, offset) } } extension MMKV { public subscript(key: String) -> Primitive? { get { return dictionary[key] } set(newValue) { dictionary[key] = newValue let mmaped = MMKV.encode((key, newValue)) append(mmaped) didUpdate?((key, newValue)) } } }
[ -1 ]
488ab09d51bdf801b111bca9a31371d1a19b5119
58a2995dd249b73813a4be2c16c552d7f5620bfe
/devtestlab/resource-manager/Sources/devtestlab/protocols/OperationErrorProtocol.swift
97920823d5e4fe5ca309a0920896ae175ec359b8
[ "MIT" ]
permissive
Azure/azure-libraries-for-swift
e577d83d504f872cf192c31d97d11edafc79b8be
b7321f3c719c381894e3ee96c5808dbcc97629d7
refs/heads/master
2023-05-30T20:22:09.906482
2021-02-01T09:29:10
2021-02-01T09:29:10
106,317,605
9
5
MIT
2021-02-01T09:29:11
2017-10-09T18:02:45
Swift
UTF-8
Swift
false
false
457
swift
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. import Foundation // OperationErrorProtocol is error details for the operation in case of a failure. public protocol OperationErrorProtocol : Codable { var code: String? { get set } var message: String? { get set } }
[ -1 ]
745eac286603304c5ea23de44bac9e7b6a0482ee
0adaaf06a5070693edeb1b570bbc2cc64c059138
/Reverse Words in a String.swift
666fa8008cae1acdf16c71c51f1afbf1db173c74
[]
no_license
TejeshwarGill/leetcodeswift
4eb5c99508a86fb434adb5711926ae1ac32f00fd
7059e95cf86fb8d2145c2d0123d1cfb11e032e1c
refs/heads/main
2023-06-12T18:30:58.647750
2021-04-18T07:49:27
2021-04-18T07:49:27
384,334,511
0
0
null
null
null
null
UTF-8
Swift
false
false
638
swift
// // Reverse Words in a String.swift // Leetcode // // Created by Nishant on 21/01/21. // Copyright © 2021 Personal. All rights reserved. // import Foundation /* Given an input string s, reverse the order of the words. Reference: https://leetcode.com/problems/reverse-words-in-a-string/ */ func reverseWords(_ s: String) -> String { let components = s.components(separatedBy: " ") var res = "" for i in stride(from: components.count-1, to: -1, by: -1){ if components[i].isEmpty { continue } res += components[i] + " " } return res.trimmingCharacters(in: .whitespaces) }
[ -1 ]
20575669bbeb436f59b89c9c422e788198953861
ce18fd879655fb2d1a82394de57c7beb35f089ac
/Book App/Book_AppApp.swift
5524b2a23e289e5808ae852320e1ea90eacba098
[]
no_license
Alex-dev8/BookApp-SwiftUI
f3d858c33a004cd90002a98c3c8b85761f977128
acb28d64ac191681c7657aff8a52b4e38563c9c9
refs/heads/main
2023-08-11T15:00:51.864451
2021-09-29T10:02:28
2021-09-29T10:02:28
411,618,525
1
1
null
null
null
null
UTF-8
Swift
false
false
279
swift
// // Book_AppApp.swift // Book App // // Created by Alex Cannizzo on 27/09/2021. // import SwiftUI @main struct Book_AppApp: App { var body: some Scene { WindowGroup { BookListView() .environmentObject(BookModel()) } } }
[ -1 ]
d561f109207ca07c35d40e61b2d895d27a568262
bc92451ee4e2950a46b4d59c124f3c19ee34397f
/TipCalculator/ViewController.swift
a538c91231bf353e43dcd8305fe7bc5fd2593b13
[]
no_license
surbhihajela/TipCalculator
802ad7e2dbae75ed741a51fce2847a79cf28623a
1b4f92e574b901b74fb8a319e8b83090bb54a3a7
refs/heads/master
2022-11-26T00:35:09.707171
2020-08-02T05:31:49
2020-08-02T05:31:49
284,373,862
0
0
null
null
null
null
UTF-8
Swift
false
false
1,034
swift
// // ViewController.swift // TipCalculator // // Created by Surbhi Hajela on 01/08/20. // Copyright © 2020 Surbhi Hajela. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var billAmountText: UITextField! @IBOutlet weak var tipAmountLabel: UILabel! @IBOutlet weak var totalAmountLabel: UILabel! @IBOutlet weak var tipSegment: UISegmentedControl! @IBOutlet var mainView: UIView! override func viewDidLoad() { super.viewDidLoad() } @IBAction func calculateTip(_ sender: Any) { let bill = Double(billAmountText.text!) ?? 0 let tipPercentages = [0.15,0.18,0.2] let tip = bill * tipPercentages[tipSegment.selectedSegmentIndex] let total = bill + tip tipAmountLabel.text = String(format: "$%.2f", tip) totalAmountLabel.text = String(format: "$%.2f", total) } @IBAction func onTap(_ sender: Any) { view.endEditing(true) } }
[ -1 ]
f439a461b081662ce834e9544c819cde6b57620e
32c048afcc9b761fa1bc25747854e8365207d5fa
/PayU_TestUITests/PayU_TestUITests.swift
9c3621552d3d564b41676724e57b74f97ddbec9d
[]
no_license
manasmishra77/payu_test
3813d4e35a9a5d6e4cdb3417336662829048b0c4
d7f18137883f64c84ee213559b1046d3d9f74327
refs/heads/master
2023-02-04T01:20:17.373237
2020-12-19T17:11:08
2020-12-19T17:11:08
322,817,509
0
0
null
null
null
null
UTF-8
Swift
false
false
1,421
swift
// // PayU_TestUITests.swift // PayU_TestUITests // // Created by Manas1 Mishra on 19/12/20. // import XCTest class PayU_TestUITests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // UI tests must launch the application that they test. let app = XCUIApplication() app.launch() // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testLaunchPerformance() throws { if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { // This measures how long it takes to launch your application. measure(metrics: [XCTApplicationLaunchMetric()]) { XCUIApplication().launch() } } } }
[ 360463, 155665, 376853, 344106, 253996, 385078, 163894, 180279, 352314, 213051, 376892, 32829, 286787, 352324, 237638, 352327, 385095, 393291, 163916, 368717, 311373, 196687, 278607, 311377, 254039, 426074, 368732, 180317, 32871, 352359, 221292, 278637, 385135, 319599, 376945, 131190, 385147, 131199, 426124, 196758, 49308, 65698, 311459, 49317, 377008, 377010, 180409, 295099, 377025, 377033, 164043, 417996, 254157, 368849, 368850, 139478, 229591, 385240, 254171, 147679, 147680, 311520, 205034, 254189, 286957, 254193, 344312, 336121, 262403, 147716, 368908, 180494, 262419, 368915, 254228, 319764, 278805, 377116, 254250, 311596, 131374, 418095, 336177, 180534, 155968, 287040, 311622, 270663, 368969, 254285, 180559, 377168, 344402, 229716, 368982, 270703, 139641, 385407, 385409, 270733, 106893, 385423, 385433, 213402, 385437, 254373, 156069, 385448, 385449, 115116, 385463, 319931, 278974, 336319, 336323, 188870, 278988, 278992, 262619, 377309, 377310, 369121, 369124, 279014, 270823, 279017, 311787, 213486, 360945, 139766, 393719, 279030, 377337, 279033, 254459, 410108, 410109, 262657, 377346, 279042, 279053, 410126, 262673, 385554, 393745, 303635, 279060, 279061, 254487, 410138, 279066, 188957, 377374, 385569, 385578, 377388, 197166, 393775, 418352, 33339, 352831, 33344, 385603, 377419, 385612, 303693, 426575, 385620, 369236, 115287, 189016, 270938, 287327, 279143, 279150, 287345, 352885, 352886, 344697, 189054, 287359, 385669, 369285, 311944, 344714, 311950, 377487, 311953, 287379, 336531, 180886, 426646, 352921, 377499, 221853, 344737, 295591, 352938, 295598, 279215, 418479, 279218, 164532, 336565, 287418, 377531, 303802, 377534, 377536, 66243, 385737, 287434, 385745, 279249, 303826, 369365, 369366, 385751, 230105, 361178, 352989, 352990, 418529, 295649, 385763, 295653, 369383, 230120, 361194, 312046, 418550, 344829, 279293, 205566, 197377, 434956, 312076, 295698, 418579, 426772, 197398, 426777, 221980, 344864, 197412, 336678, 262952, 189229, 262957, 164655, 197424, 328495, 197428, 336693, 230198, 377656, 426809, 197433, 222017, 295745, 377669, 197451, 369488, 279379, 385878, 385880, 295769, 197467, 435038, 230238, 279393, 303973, 279398, 385895, 197479, 385901, 197489, 295799, 164730, 336765, 254851, 369541, 172936, 320394, 426894, 377754, 172971, 140203, 377778, 304050, 189362, 189365, 377789, 189373, 345030, 345034, 279499, 418774, 386007, 386009, 418781, 386016, 123880, 418793, 320495, 222193, 435185, 271351, 214009, 312313, 435195, 328701, 312317, 386049, 328705, 418819, 410629, 377863, 189448, 230411, 361487, 435216, 386068, 254997, 336928, 336930, 410665, 345137, 361522, 312372, 238646, 238650, 320571, 386108, 410687, 336962, 238663, 377927, 361547, 205911, 156763, 361570, 214116, 230500, 214119, 402538, 279659, 173168, 230514, 238706, 279666, 312435, 377974, 66684, 279686, 402568, 222344, 140426, 337037, 386191, 410772, 222364, 418975, 124073, 402618, 148674, 402632, 148687, 402641, 189651, 419028, 279766, 189656, 304353, 279780, 222441, 279789, 386288, 66802, 271607, 369912, 386296, 369913, 419066, 386300, 279803, 386304, 369929, 419097, 320795, 115997, 222496, 320802, 304422, 369964, 353581, 116014, 66863, 312628, 345397, 345398, 386363, 222523, 345418, 353611, 337228, 337226, 353612, 230730, 296269, 353617, 222542, 238928, 296274, 378201, 230757, 296304, 312688, 337280, 353672, 263561, 296328, 296330, 370066, 9618, 411028, 279955, 370072, 148899, 148900, 361928, 337359, 329168, 312785, 329170, 222674, 353751, 280025, 239069, 361958, 271850, 280042, 280043, 271853, 329198, 411119, 337391, 116209, 296434, 386551, 288252, 271880, 198155, 329231, 304655, 370200, 222754, 157219, 157220, 394793, 312879, 288305, 288319, 288322, 280131, 288328, 353875, 312937, 271980, 206447, 403057, 42616, 337533, 280193, 370307, 419462, 149127, 149128, 288391, 419464, 411275, 214667, 239251, 345753, 198304, 255651, 337590, 370359, 280252, 280253, 321217, 239305, 296649, 403149, 313042, 345813, 370390, 272087, 345817, 337638, 181992, 345832, 345835, 288492, 141037, 313082, 288508, 288515, 173828, 395018, 395019, 116491, 395026, 116502, 435993, 345882, 411417, 255781, 362281, 378666, 403248, 378673, 182070, 182071, 345910, 436029, 345918, 337734, 280396, 272207, 272208, 337746, 395092, 362326, 345942, 370526, 345950, 362336, 255844, 296807, 214894, 362351, 313200, 214896, 313204, 182145, 280451, 67464, 305032, 337816, 329627, 239515, 354210, 436130, 436135, 10153, 313257, 362411, 370604, 362418, 411587, 280517, 362442, 346066, 231382, 354268, 436189, 403421, 329696, 354273, 403425, 354279, 436199, 174058, 337899, 354283, 247787, 329707, 296942, 436209, 239610, 182277, 346117, 354310, 43016, 354312, 354311, 403463, 313356, 436235, 419857, 305173, 436248, 223269, 346153, 354346, 313388, 272432, 403507, 378933, 378934, 436283, 288835, 403524, 436293, 313415, 239689, 436304, 329812, 223317, 411738, 272477, 280676, 313446, 395373, 288878, 346237, 215165, 436372, 329884, 378186, 362658, 436388, 215204, 133313, 395458, 338118, 436429, 346319, 379102, 387299, 18661, 379110, 338151, 149743, 379120, 436466, 411892, 436471, 395511, 313595, 436480, 272644, 338187, 338188, 395536, 338196, 272661, 379157, 157973, 338217, 321839, 362809, 379193, 395591, 289109, 272730, 436570, 215395, 239973, 280938, 321901, 354671, 362864, 272755, 354678, 199030, 223611, 436609, 436613, 395653, 395660, 264591, 272784, 420241, 240020, 190870, 43416, 190872, 289185, 436644, 289195, 272815, 436659, 338359, 436677, 289229, 281038, 281039, 256476, 420326, 166403, 420374, 322077, 289328, 330291, 322119, 191065, 436831, 420461, 346739, 346741, 420473, 297600, 166533, 363155, 346771, 264855, 363161, 289435, 436897, 248494, 166581, 355006, 363212, 363228, 436957, 322269, 436960, 264929, 338658, 289511, 330473, 346859, 330476, 289517, 215790, 199415, 289534, 322302, 35584, 133889, 322312, 346889, 166677, 207639, 363295, 355117, 191285, 273209, 355129, 273211, 355136, 355138, 420680, 355147, 355148, 355153, 281426, 387927, 363353, 363354, 281434, 420702, 363361, 363362, 412516, 355173, 355174, 281444, 207724, 355182, 207728, 420722, 314240, 158594, 330627, 240517, 265094, 387977, 396171, 355216, 224146, 224149, 256918, 256919, 256920, 240543, 256934, 273336, 289720, 289723, 273341, 330688, 379845, 363462, 19398, 273353, 191445, 207839, 347104, 314343, 134124, 412653, 248815, 257007, 347122, 437245, 257023, 125953, 396292, 330759, 347150, 330766, 412692, 330789, 248871, 281647, 412725, 257093, 404550, 207954, 339031, 404582, 257126, 265318, 322664, 265323, 396395, 404589, 273523, 363643, 248960, 363658, 404622, 224400, 265366, 347286, 429209, 339101, 429216, 380069, 265381, 3243, 208044, 322733, 421050, 339131, 265410, 183492, 273616, 421081, 339167, 298209, 421102, 363769, 52473, 208123, 52476, 412926, 437504, 322826, 388369, 380178, 429332, 126229, 412963, 257323, 437550, 273713, 298290, 208179, 159033, 347451, 372039, 257353, 257354, 109899, 437585, 331091, 150868, 314708, 372064, 429410, 437602, 281958, 388458, 265579, 306541, 421240, 224637, 388488, 298378, 306580, 282008, 396697, 282013, 290206, 396709, 298406, 241067, 380331, 314797, 380335, 355761, 421302, 134586, 380348, 216510, 216511, 380350, 306630, 200136, 273865, 306634, 339403, 372172, 413138, 421338, 437726, 429540, 3557, 3559, 191980, 282097, 265720, 216575, 290304, 372226, 437766, 323083, 208397, 323088, 413202, 413206, 388630, 175640, 216610, 372261, 347693, 323120, 396850, 200245, 323126, 290359, 134715, 323132, 421437, 396865, 282182, 413255, 273992, 265800, 421452, 265809, 396885, 290391, 265816, 396889, 306777, 388699, 396896, 388712, 388713, 314997, 290425, 339579, 396927, 282248, 224907, 396942, 405140, 274071, 323226, 208547, 208548, 405157, 388775, 282279, 364202, 421556, 224951, 224952, 306875, 282302, 323262, 241366, 224985, 282330, 159462, 372458, 397040, 12017, 323315, 274170, 200444, 175874, 249606, 282379, 216844, 372497, 397076, 421657, 339746, 216868, 257831, 167720, 241447, 421680, 282418, 421686, 274234, 339782, 315209, 159563, 339799, 307038, 274276, 282471, 274288, 372592, 274296, 339840, 372625, 282517, 298912, 118693, 438186, 126896, 151492, 380874, 372699, 323554, 380910, 380922, 380923, 274432, 372736, 241695, 430120, 102441, 315433, 430127, 405552, 282671, 241717, 249912, 225347, 307269, 421958, 233548, 176209, 381013, 53334, 315477, 200795, 356446, 323678, 438374, 176231, 438378, 233578, 422000, 249976, 266361, 422020, 168069, 381061, 168070, 381071, 241809, 430231, 200856, 422044, 192670, 192671, 299166, 258213, 299176, 323761, 184498, 430263, 266427, 299208, 372943, 266447, 258263, 356575, 307431, 438512, 372979, 389364, 381173, 135416, 356603, 184574, 266504, 217352, 61720, 381210, 282908, 389406, 282912, 233761, 438575, 315698, 266547, 397620, 332084, 438583, 127292, 438592, 323914, 201037, 397650, 348499, 250196, 348501, 389465, 332128, 110955, 242027, 242028, 160111, 250227, 315768, 291193, 438653, 291200, 266628, 340356, 242059, 225684, 373141, 373144, 291225, 389534, 397732, 373196, 176602, 242138, 184799, 291297, 201195, 324098, 233987, 340489, 397841, 283154, 258584, 397855, 291359, 348709, 348710, 397872, 283185, 234037, 340539, 266812, 438850, 348741, 381515, 348748, 430681, 332379, 242274, 184938, 373357, 184942, 176751, 389744, 356983, 356984, 209529, 356990, 291455, 373377, 422529, 201348, 152196, 356998, 348807, 356999, 316044, 275102, 176805, 340645, 422567, 176810, 160441, 422591, 291529, 225996, 135888, 242385, 234216, 373485, 373486, 21239, 275193, 348921, 234233, 242428, 299777, 430853, 430860, 62222, 430880, 234276, 234290, 152372, 160569, 430909, 160576, 348999, 283466, 439118, 234330, 275294, 381791, 127840, 357219, 439145, 177002, 308075, 381811, 201590, 177018, 398205, 340865, 291713, 349066, 316299, 349068, 234382, 308111, 381840, 308113, 390034, 373653, 430999, 209820, 381856, 398244, 185252, 422825, 381872, 177074, 398268, 349122, 398275, 127945, 373705, 340960, 398305, 340967, 398313, 234476, 127990, 349176, 201721, 349179, 234499, 357380, 398370, 357413, 357420, 300087, 21567, 308288, 398405, 349254, 218187, 250955, 300109, 234578, 250965, 439391, 250982, 398444, 62574, 357487, 300147, 119925, 349304, 234626, 349315, 349317, 234635, 373902, 234655, 234662, 373937, 373939, 324790, 300215, 218301, 283841, 283846, 259275, 316628, 259285, 357594, 414956, 251124, 316661, 292092, 439550, 439563, 242955, 414989, 259346, 349458, 259347, 382243, 382246, 292145, 382257, 382264, 333115, 193853, 193858, 251212, 234830, 406862, 259408, 283990, 357720, 300378, 300379, 374110, 234864, 259449, 382329, 357758, 243073, 357763, 112019, 398740, 234902, 374189, 251314, 284086, 259513, 54719, 292291, 300490, 300526, 259569, 251379, 300539, 398844, 210429, 366081, 316951, 374297, 153115, 431646, 349727, 431662, 374327, 210489, 235069, 349764, 292424, 292426, 128589, 333389, 333394, 349780, 128600, 235096, 300643, 300645, 415334, 54895, 366198, 210558, 210559, 415360, 325246, 415369, 210569, 431754, 267916, 415376, 259741, 153252, 399014, 210601, 202413, 415419, 259780, 333508, 267978, 333522, 325345, 333543, 431861, 284410, 161539, 284425, 300812, 284430, 366358, 169751, 431901, 341791, 186148, 186149, 284460, 202541, 431918, 399148, 153392, 431935, 415555, 325444, 153416, 325449, 341837, 415566, 431955, 325460, 341846, 300893, 259937, 382820, 276326, 415592, 292713, 292719, 325491, 341878, 276343, 350072, 333687, 112510, 325508, 333700, 243590, 325514, 350091, 350092, 350102, 350108, 333727, 219046, 284584, 292783, 300983, 128955, 219102, 292835, 6116, 317416, 432114, 325620, 415740, 268286, 415744, 243720, 399372, 153618, 358418, 178215, 325675, 243763, 358455, 399433, 333902, 104534, 194667, 260206, 432241, 284789, 374913, 374914, 415883, 333968, 153752, 333990, 104633, 260285, 227517, 268479, 374984, 301270, 301271, 334049, 325857, 268515, 383208, 317676, 260337, 260338, 432373, 375040, 309504, 432387, 260355, 375052, 194832, 325904, 391448, 268570, 178459, 186660, 268581, 334121, 358698, 317738, 325930, 260396, 432435, 358707, 178485, 358710, 14654, 268609, 227655, 383309, 383327, 391521, 366948, 416101, 416103, 383338, 432503, 432511, 211327, 227721, 285074, 252309, 39323, 285083, 317851, 285089, 375211, 334259, 129461, 342454, 358844, 293309, 317889, 326083, 416201, 129484, 154061, 416206, 326093, 432608, 285152, 391654, 432616, 334315, 375281, 293368, 317949, 334345, 309770, 342537, 432650, 342549, 342560, 416288, 350758, 350759, 358951, 358952, 293420, 219694, 219695, 375345, 432694, 244279, 309831, 375369, 375373, 416334, 301647, 416340, 244311, 260705, 416353, 375396, 268901, 244345, 334473, 375438, 326288, 285348, 293552, 342705, 285362, 383668, 342714, 39616, 383708, 342757, 269036, 432883, 203511, 342775, 383740, 416509, 359166, 162559, 375552, 432894, 228099, 285443, 285450, 383755, 326413, 285467, 326428, 318247, 342827, 391980, 318251, 375610, 301883, 342846, 416577, 416591, 244569, 375644, 252766, 293729, 351078, 342888, 392057, 211835, 392065, 260995, 400262, 392071, 424842, 236427, 252812, 400271, 392080, 400282, 7070, 211871, 359332, 359333, 293801, 326571, 252848, 326580, 261045, 261046, 326586, 359365, 211913, 326602, 252878, 342990, 433104, 56270, 359380, 433112, 433116, 359391, 343020, 187372, 383980, 203758, 383994, 171009, 384004, 433166, 384015, 433173, 293911, 326684, 252959, 384031, 375848, 318515, 203829, 261191, 375902, 375903, 392288, 253028, 351343, 187505, 138354, 187508, 384120, 302202, 285819, 392317, 343166, 285823, 392320, 384127, 285833, 285834, 318602, 228492, 253074, 326803, 187539, 359574, 285850, 351389, 302239, 253098, 302251, 367791, 367792, 367798, 64699, 294075, 228541, 343230, 367809, 253124, 113863, 351445, 310496, 195809, 253168, 351475, 351489, 367897, 367898, 130342, 130344, 130347, 261426, 212282, 294210, 359747, 359748, 146760, 146763, 114022, 253288, 425327, 425331, 163190, 327030, 384379, 253316, 294278, 384391, 318860, 253339, 253340, 318876, 343457, 245160, 359860, 359861, 343480, 310714, 228796, 228804, 425417, 310731, 327122, 425434, 310747, 310758, 253431, 359931, 187900, 343552, 245249, 228868, 409095, 359949, 294413, 253456, 302613, 253462, 146976, 245290, 245291, 343606, 163385, 425534, 138817, 147011, 147020, 179800, 196184, 343646, 212574, 204386, 155238, 204394, 138862, 310896, 188021, 294517, 286351, 188049, 425624, 229021, 245413, 286387, 384693, 376502, 286392, 302778, 409277, 286400, 409289, 425682, 286419, 294621, 245471, 155360, 294629, 212721, 163575, 286457, 286463, 319232, 360194, 409355, 155408, 417556, 294699, 204600, 319289, 384826, 409404, 360253, 409416, 376661, 237397, 368471, 425820, 368486, 409446, 425832, 368489, 40809, 384871, 417648, 417658, 360315, 253828, 327556, 311183, 425875, 294806, 294808, 253851, 376733, 204702, 319393, 294820, 253868, 204722, 188349, 98240, 212947, 212953, 360416, 294887, 253930, 327666, 385011 ]
d35541fade6be6f1364330b58c1079b3aa308f75
3c9817f8399b501012ee0ed1966b91e4bda6a87a
/Library/Scenes/QRCodeScanner/QRCodeScannerView.swift
a05019d8c558f81d23a1694262d054d8c0fa7f6b
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
rockstardev/zap-iOS
8935afb0dfeea3f2cc1a59e063e9f59056cb5c92
a907e61c56562ca760ab04c3054c0ba7f70eb9a9
refs/heads/master
2020-05-30T03:45:35.318800
2019-05-23T11:52:25
2019-05-23T11:52:25
189,521,220
1
1
MIT
2019-05-31T03:26:46
2019-05-31T03:26:43
null
UTF-8
Swift
false
false
5,960
swift
// // Zap // // Created by Otto Suess on 09.02.18. // Copyright © 2018 Otto Suess. All rights reserved. // import AVFoundation import Lightning import Logger import SwiftBTC import UIKit final class QRCodeScannerView: UIView { private weak var overlayView: UIView? private weak var scanRectView: UIView? private weak var captureDevice: AVCaptureDevice? private var captureSession = AVCaptureSession() private var videoPreviewLayer: AVCaptureVideoPreviewLayer? private var oldCode: String? var handler: ((String) -> Void)? override init(frame: CGRect) { super.init(frame: frame) setupStaticLayout() DispatchQueue.main.async { self.setup() } } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) setupStaticLayout() DispatchQueue.main.async { self.setup() } } private func setupStaticLayout() { let scanRectView = ScanRectView(frame: frame) addSubview(scanRectView) self.scanRectView = scanRectView setupTopLabel() setupOverlay() } private func setup() { let deviceDiscoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInWideAngleCamera, .builtInTrueDepthCamera, .builtInTelephotoCamera, .builtInDualCamera], mediaType: AVMediaType.video, position: .back) guard let captureDevice = deviceDiscoverySession.devices.first, let input = try? AVCaptureDeviceInput(device: captureDevice) else { return } self.captureDevice = captureDevice captureSession.addInput(input) let captureMetadataOutput = AVCaptureMetadataOutput() captureSession.addOutput(captureMetadataOutput) captureMetadataOutput.setMetadataObjectsDelegate(self, queue: DispatchQueue.main) captureMetadataOutput.metadataObjectTypes = [AVMetadataObject.ObjectType.qr] let videoPreviewLayer = AVCaptureVideoPreviewLayer(session: captureSession) videoPreviewLayer.videoGravity = AVLayerVideoGravity.resizeAspectFill videoPreviewLayer.frame = layer.bounds layer.insertSublayer(videoPreviewLayer, at: 0) self.videoPreviewLayer = videoPreviewLayer self.start() } private func setupTopLabel() { guard let scanRectView = scanRectView else { fatalError("scanRectView not initialized") } let topLabelContainer = UIView() topLabelContainer.backgroundColor = UIColor.black.withAlphaComponent(0.6) topLabelContainer.layer.cornerRadius = 16 addAutolayoutSubview(topLabelContainer) NSLayoutConstraint.activate([ topLabelContainer.centerXAnchor.constraint(equalTo: centerXAnchor), scanRectView.topAnchor.constraint(equalTo: topLabelContainer.bottomAnchor, constant: 20) ]) let topLabel = UILabel() Style.Label.custom(color: UIColor.white.withAlphaComponent(0.6)).apply(to: topLabel) topLabel.text = L10n.Scene.QrcodeScanner.topLabel topLabelContainer.addAutolayoutSubview(topLabel) NSLayoutConstraint.activate([ topLabel.topAnchor.constraint(equalTo: topLabelContainer.topAnchor, constant: 5), topLabelContainer.bottomAnchor.constraint(equalTo: topLabel.bottomAnchor, constant: 5), topLabel.leadingAnchor.constraint(equalTo: topLabelContainer.leadingAnchor, constant: 10), topLabelContainer.trailingAnchor.constraint(equalTo: topLabel.trailingAnchor, constant: 10) ]) } private func setupOverlay() { let overlay = UIView() overlay.backgroundColor = .black overlay.alpha = 0.5 overlay.clipsToBounds = true addAutolayoutSubview(overlay) constrainEdges(to: overlay) self.overlayView = overlay updateOverlayMask() } private func updateOverlayMask() { let maskLayer = CAShapeLayer() let margin: CGFloat = 30 let rectSize = bounds.width - margin * 2 let yPosition = (bounds.height - rectSize) / 2 * 0.85 - 20 let framePath = UIBezierPath(rect: bounds) let frame = CGRect(x: margin, y: yPosition, width: rectSize, height: rectSize) let path = UIBezierPath(roundedRect: frame, cornerRadius: 35) framePath.append(path.reversing()) maskLayer.path = framePath.cgPath overlayView?.layer.mask = maskLayer scanRectView?.frame = frame } override func layoutSubviews() { super.layoutSubviews() videoPreviewLayer?.frame = layer.bounds updateOverlayMask() } func start() { captureSession.startRunning() } func stop() { UISelectionFeedbackGenerator().selectionChanged() captureSession.stopRunning() oldCode = nil } func toggleTorch() { setTorchOn(captureDevice?.torchMode == .off) UISelectionFeedbackGenerator().selectionChanged() } private func setTorchOn(_ isOn: Bool) { do { try captureDevice?.lockForConfiguration() if isOn { try captureDevice?.setTorchModeOn(level: AVCaptureDevice.maxAvailableTorchLevel) } else { captureDevice?.torchMode = .off } captureDevice?.unlockForConfiguration() } catch { Logger.error(error.localizedDescription) } } } extension QRCodeScannerView: AVCaptureMetadataOutputObjectsDelegate { func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) { guard let metadataObj = metadataObjects.first as? AVMetadataMachineReadableCodeObject, let code = metadataObj.stringValue, code != oldCode else { return } oldCode = code handler?(code) } }
[ -1 ]
528608634c06e88c5921aebae3299af6ae9c0831
b5ec32852439a95c6bfbd7cce83cf198caeff86f
/magic-the-gathering/AppDelegate.swift
501533d6eb9980e3de597c660d09a51cf6ddf6fb
[]
no_license
cs-leonel-lima/magic-the-gathering
293ac9a2b09c59a9ba4531838ae8526957c4f3da
de697742cf1c08d1ec644d03d9c27207287ec1c4
refs/heads/developer
2021-10-12T01:29:29.294224
2019-01-31T16:08:18
2019-01-31T16:08:18
166,280,158
0
0
null
2019-01-31T16:08:19
2019-01-17T19:02:35
Swift
UTF-8
Swift
false
false
611
swift
import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { setupWindow() return true } } extension AppDelegate { private func setupWindow() { self.window = UIWindow() self.window?.makeKeyAndVisible() let mainView = SetListsContainerPageViewController(nibName: nil, bundle: nil) self.window?.rootViewController = mainView } }
[ 405016 ]
ce27fe26a1814630b9ec7ca0a8c2432073d8c152
b7570a0b6382935ffd384eb9b29c197972ee086a
/Package.swift
1d0b9db1c9cf1ca3f442c99c30619271b06112c1
[ "MIT" ]
permissive
bagyaru/PopupController
88e724d5fabd365506be9a6f5edcd12300d0340a
568855dad8fe3e8bd6c36fb7699bd2a32cc07451
refs/heads/master
2022-12-06T01:40:35.669761
2020-08-25T07:59:19
2020-08-25T07:59:19
null
0
0
null
null
null
null
UTF-8
Swift
false
false
512
swift
// swift-tools-version:5.2 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "PopupController", platforms: [.iOS(.v10)], products: [ .library( name: "PopupController", targets: ["PopupController"]), ], targets: [ .target( name: "PopupController", path: "Sources", sources: ["PopupController"] ), ] )
[ 121570, 343458, 111302, 353735, 121608, 145960, 173643, 121613, 19636, 265049, 121595 ]
ea3d5b8428aabb6763c503a254c5c04cedc6a36b
0d11e8bfccf31692f192b7c76b6184ce1823d002
/BirdExtension.swift
8a0f66c745efc883b21038323796c98522647b2c
[]
no_license
HarMinas/BirdBust
8039b64690992fd8acf1135b2b822a3b770f19d1
4ae5463cd75052806c9fe34937dc0183934d75ce
refs/heads/master
2020-12-22T18:43:01.070420
2020-01-29T03:36:21
2020-01-29T03:36:21
236,894,264
0
0
null
null
null
null
UTF-8
Swift
false
false
340
swift
// // BirdExtension.swift // BirdBust // // Created by Harutyun Minasyan on 12/8/17. // Copyright © 2017 Harutyun Minasyan. All rights reserved. // import SpriteKit extension Birds { ///////////////////////////////////////////////// POSITIONS ///////////////////////////////////////////////////////////// }
[ -1 ]
d93476fd70a661798ca1c8c49165477e7c8d5aaa
1fb538fce1bec2cccf95537f57d2fabf7e424836
/Day 13/Day 13/InputData.swift
d6e09505da8346289ddc5c1779bc2207f37c6991
[]
no_license
gernb/AdventOfCode2017
e0c1cf1bce6f7021cb1966fb23dc1c41ea8cabc4
e0edc42c0de4fa259a9daf5bb122265df30401a5
refs/heads/master
2020-04-20T23:58:59.838275
2019-02-08T02:08:12
2019-02-08T02:08:12
169,182,889
0
0
null
null
null
null
UTF-8
Swift
false
false
531
swift
// // InputData.swift // Day 13 // // Created by Peter Bohac on 2/5/19. // Copyright © 2019 Peter Bohac. All rights reserved. // struct InputData { static let example = """ 0: 3 1: 2 4: 4 6: 4 """ static let challenge = """ 0: 3 1: 2 2: 4 4: 6 6: 5 8: 6 10: 6 12: 4 14: 8 16: 8 18: 9 20: 8 22: 6 24: 14 26: 12 28: 10 30: 12 32: 8 34: 10 36: 8 38: 8 40: 12 42: 12 44: 12 46: 12 48: 14 52: 14 54: 12 56: 12 58: 12 60: 12 62: 14 64: 14 66: 14 68: 14 70: 14 72: 14 80: 18 82: 14 84: 20 86: 14 90: 17 96: 20 98: 24 """ }
[ -1 ]
ee591e617727b6ee57cddee32047793bcc9084bf
761d0c67e0d30264925040a0af37cb0af99def3b
/ImageFilterEditor/ImageFilterEditor/AppDelegate.swift
31d83f2423b2241cade26946203319fff4180f43
[]
no_license
nonyeezekwo/ios-lambda-timeline
dde65bb762c65c53d5c447816f212cf8345c109f
fff2a6ca7341c8e561a6692fc6c0221f4eec185b
refs/heads/master
2022-11-12T21:39:25.218786
2020-07-07T22:08:50
2020-07-07T22:08:50
277,618,684
0
0
null
2020-07-06T18:27:07
2020-07-06T18:27:06
null
UTF-8
Swift
false
false
1,418
swift
// // AppDelegate.swift // ImageFilterEditor // // Created by Nonye on 7/6/20. // Copyright © 2020 Nonye Ezekwo. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393230, 393250, 344102, 393261, 213048, 385081, 376889, 376905, 327756, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 286831, 368752, 286844, 417924, 262283, 286879, 286888, 377012, 327871, 180416, 377036, 180431, 377046, 377060, 327914, 205036, 393456, 393460, 418043, 336123, 336128, 385280, 262404, 180490, 164106, 368911, 262416, 262422, 377117, 262436, 336180, 262454, 393538, 262472, 213332, 65880, 262496, 418144, 262499, 213352, 246123, 262507, 262510, 213372, 385419, 393612, 262550, 262552, 385440, 385443, 385451, 262573, 393647, 385458, 262586, 344511, 262592, 360916, 369118, 328177, 328179, 328182, 328189, 328192, 164361, 410128, 393747, 254490, 188958, 385570, 33316, 197159, 377383, 352821, 188987, 418363, 369223, 385609, 385616, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 336512, 148105, 377484, 352918, 98968, 344744, 361129, 336555, 434867, 164534, 336567, 328378, 328386, 352968, 344776, 418507, 352971, 352973, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 336643, 344835, 344841, 361230, 336659, 434970, 369435, 262942, 336675, 328484, 336696, 361273, 328515, 336708, 328519, 336711, 328522, 336714, 426841, 254812, 361309, 197468, 361315, 361322, 328573, 369542, 361360, 222128, 345035, 345043, 386003, 386011, 386018, 386022, 435187, 328714, 361489, 386069, 336921, 386073, 336925, 345118, 377887, 345133, 345138, 386101, 361536, 197707, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 361598, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 345267, 386258, 328924, 66782, 222437, 386285, 328941, 386291, 345376, 345379, 410917, 345382, 337205, 345399, 378169, 369978, 337222, 337229, 337234, 263508, 402791, 345448, 271730, 378227, 271745, 181638, 353673, 181643, 181654, 230809, 181670, 181673, 181678, 181681, 337329, 181684, 181690, 361917, 181696, 337349, 181703, 337365, 271839, 329191, 361960, 329194, 116210, 337398, 337415, 329226, 419339, 419343, 419349, 345625, 419355, 370205, 419359, 394786, 419362, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 419410, 345701, 394853, 222830, 370297, 403070, 353919, 403075, 345736, 198280, 403091, 345749, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 419512, 337592, 337599, 419527, 419530, 419535, 419542, 394966, 419544, 181977, 345818, 419547, 419550, 419559, 337642, 419563, 337645, 370415, 337659, 337668, 362247, 395021, 362255, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 329544, 345930, 370509, 354130, 247637, 337750, 370519, 313180, 345970, 345974, 403320, 354172, 247691, 337808, 247700, 329623, 436126, 436132, 337833, 337844, 346057, 247759, 346063, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329832, 329855, 329867, 329885, 346272, 362660, 100524, 387249, 379066, 387260, 256191, 395466, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 346343, 338152, 387306, 387312, 346355, 436473, 321786, 379134, 411903, 411916, 379152, 395538, 387349, 338199, 387352, 182558, 338211, 248111, 362822, 436555, 190796, 379233, 354673, 248186, 420236, 379278, 272786, 354727, 338352, 330189, 338381, 338386, 256472, 338403, 338409, 248308, 199164, 330252, 420376, 330267, 354855, 10828, 199249, 346721, 174695, 248425, 191084, 338543, 191092, 346742, 330383, 354974, 150183, 174774, 248504, 174777, 223934, 355024, 273108, 264918, 183005, 256734, 338660, 338664, 264941, 207619, 338700, 256786, 199452, 363293, 396066, 346916, 396069, 215853, 355122, 355131, 355140, 355143, 338763, 355150, 330580, 355166, 265055, 265058, 355175, 387944, 355179, 330610, 330642, 355218, 412599, 207808, 379848, 396245, 330710, 248792, 248798, 347105, 257008, 183282, 330748, 330760, 330768, 248862, 396328, 158761, 199728, 396336, 330800, 396339, 339001, 388154, 388161, 248904, 330826, 248914, 183383, 339036, 412764, 257120, 265320, 248951, 420984, 330889, 339097, 248985, 44197, 380070, 339112, 249014, 126144, 330965, 265436, 388319, 388347, 175375, 159005, 175396, 208166, 273708, 372015, 347441, 372018, 199988, 44342, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 175450, 437595, 175457, 208227, 175460, 175463, 437620, 175477, 249208, 175483, 175486, 249214, 175489, 249218, 249224, 249227, 249234, 175513, 175516, 396705, 175522, 355748, 380332, 396722, 208311, 388542, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 249308, 339420, 339424, 249312, 339428, 339434, 249328, 69113, 372228, 339461, 208398, 380432, 175635, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 224897, 372353, 216707, 126596, 224904, 11918, 159374, 224913, 126610, 339601, 224916, 224919, 126616, 224922, 208538, 224926, 224929, 224932, 224936, 257704, 224942, 257712, 224947, 257716, 257720, 257724, 257732, 339662, 257747, 224981, 224986, 257761, 224993, 257764, 224999, 339695, 225012, 225020, 339710, 257790, 225025, 257794, 339721, 257801, 257804, 225038, 225043, 372499, 167700, 225048, 257819, 225053, 184094, 225058, 339747, 339749, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 397112, 225082, 397115, 225087, 225092, 323402, 257868, 225103, 257871, 397139, 225108, 225112, 257883, 257886, 225119, 257896, 274280, 257901, 225137, 257908, 225141, 257912, 257916, 225148, 257920, 225155, 339844, 225165, 397200, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 405533, 430129, 266294, 266297, 421960, 356439, 421990, 266350, 356466, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 225444, 438436, 225447, 438440, 225450, 258222, 225455, 430256, 225458, 225461, 225466, 389307, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 266453, 225493, 225496, 225499, 225502, 225505, 356578, 225510, 217318, 225514, 225518, 372976, 381176, 397571, 389380, 61722, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 225597, 332097, 201028, 348488, 332106, 332117, 348502, 250199, 250202, 332125, 250210, 348522, 348525, 348527, 332152, 389502, 250238, 356740, 332172, 373145, 340379, 389550, 324030, 266687, 340451, 160234, 127471, 340472, 324094, 266754, 324099, 324102, 324111, 340500, 324117, 324131, 332324, 381481, 356907, 324139, 324142, 356916, 324149, 324155, 348733, 324160, 324164, 356934, 348743, 381512, 324170, 324173, 324176, 389723, 332380, 373343, 381545, 340627, 373398, 184982, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 373449, 332493, 357069, 357073, 332511, 332520, 340718, 332533, 348924, 389892, 373510, 389926, 152370, 340789, 348982, 398139, 127814, 357201, 357206, 389978, 430939, 357211, 357214, 201579, 201582, 349040, 340849, 201588, 430965, 381813, 324472, 398201, 119674, 340858, 324475, 430972, 340861, 324478, 324481, 373634, 324484, 324487, 381833, 324492, 324495, 324498, 430995, 324501, 324510, 422816, 324513, 398245, 201637, 324524, 340909, 324533, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 201711, 381946, 349180, 439294, 431106, 209943, 209946, 250914, 357410, 185380, 357418, 209965, 209968, 209971, 209975, 209979, 209987, 209990, 341071, 349267, 250967, 210010, 341091, 210025, 210027, 210030, 210039, 341113, 349308, 210044, 349311, 160895, 152703, 210052, 349319, 210055, 210067, 210071, 210077, 210080, 251044, 210084, 185511, 210088, 210095, 210098, 210107, 210115, 332997, 210127, 333009, 210131, 333014, 210138, 210143, 218354, 218360, 251128, 275706, 275712, 275715, 275721, 349459, 333078, 251160, 349484, 349491, 251189, 415033, 251210, 357708, 259421, 365921, 333154, 251235, 374117, 333162, 234866, 390516, 333175, 357755, 136590, 112020, 349590, 357792, 259515, 415166, 415185, 366034, 366038, 415191, 415193, 415196, 415199, 423392, 333284, 415207, 366056, 366061, 415216, 210420, 415224, 423423, 415257, 415263, 366117, 415270, 144939, 415278, 415281, 415285, 210487, 415290, 415293, 349761, 415300, 333386, 333399, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 267909, 153227, 333498, 210631, 333511, 259788, 358099, 153302, 333534, 366311, 431851, 366318, 210672, 366321, 366325, 210695, 268041, 210698, 366348, 210706, 399128, 333594, 210719, 358191, 366387, 210739, 399159, 358200, 325440, 366401, 341829, 325446, 46920, 341834, 341838, 341843, 415573, 358234, 341851, 350045, 399199, 399206, 268143, 358255, 399215, 358259, 341876, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 333774, 358371, 350189, 350193, 350202, 333818, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350240, 350244, 350248, 178218, 350251, 350256, 350259, 350271, 243781, 350285, 374864, 342111, 342133, 374902, 432271, 333997, 334011, 260289, 260298, 350410, 350416, 350422, 211160, 350425, 268507, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 325891, 350467, 350475, 268559, 350480, 432405, 350486, 325914, 350490, 325917, 350493, 350498, 350504, 358700, 350509, 391468, 358704, 358713, 358716, 383306, 334161, 383321, 383330, 383333, 391530, 383341, 334203, 268668, 194941, 366990, 416157, 342430, 268701, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 334304, 334311, 375277, 334321, 350723, 186897, 342545, 334358, 342550, 342554, 334363, 358941, 350761, 252461, 334384, 383536, 358961, 334394, 252482, 219718, 334407, 334420, 350822, 375400, 334465, 334468, 162445, 326290, 342679, 342683, 260766, 342710, 244409, 260797, 260801, 350917, 391894, 154328, 416473, 64230, 342766, 375535, 203506, 342776, 391937, 391948, 375568, 326416, 375571, 162591, 326441, 326451, 326454, 326460, 244540, 375612, 326467, 244551, 326473, 326477, 326485, 416597, 326490, 326502, 375656, 433000, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 342915, 400259, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 326598, 359366, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 383997, 261129, 359451, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 384107, 367723, 187502, 384114, 343154, 212094, 351364, 384135, 384139, 384143, 384160, 384168, 367794, 384181, 384191, 351423, 384198, 326855, 244937, 253130, 343244, 146642, 359649, 343270, 351466, 351479, 384249, 343306, 261389, 359694, 253200, 261393, 384275, 245020, 245029, 171302, 351534, 376110, 245040, 384314, 425276, 384323, 343365, 212303, 343393, 343398, 425328, 343409, 253303, 154999, 343417, 327034, 245127, 384397, 245136, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327110, 327115, 327117, 359886, 359890, 343507, 368092, 343534, 343539, 368119, 343544, 368122, 359947, 359955, 359983, 343630, 327275, 245357, 138864, 155254, 155273, 368288, 425638, 155322, 425662, 155327, 155351, 155354, 212699, 155363, 245475, 245483, 155371, 409335, 155393, 155403, 245525, 155422, 360223, 155438, 155442, 155447, 155461, 360261, 376663, 155482, 261981, 425822, 155487, 376671, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 262005, 147317, 425845, 262008, 262011, 155516, 155521, 155525, 360326, 376714, 155531, 262027, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 393169, 384977, 155611, 155619, 253923, 155621, 253926, 327654, 204784, 360438, 253943, 393212, 155646 ]
0c486dcaf99fefd619bbd1eddc5784a0ba6135c5
49c29e349732dae4daeacc8a463177b7995dc340
/Tests/SwiftLintFrameworkTests/AutomaticRuleTests.generated.swift
2eb03d92ba320077c73aea136abd586f907a84ec
[ "MIT" ]
permissive
polszacki-tooploox/SwiftLint
a90e60e4307a7bfb4b772e9bb2eade772dd89af2
b393ee2d687b0bcd6a1e3cac1b9252245478c962
refs/heads/master
2020-04-07T20:25:44.615248
2018-11-26T09:26:12
2018-11-26T09:26:12
158,687,471
0
2
MIT
2018-11-22T11:12:10
2018-11-22T11:12:10
null
UTF-8
Swift
false
false
17,525
swift
// Generated using Sourcery 0.15.0 — https://github.com/krzysztofzablocki/Sourcery // DO NOT EDIT import SwiftLintFramework import XCTest // swiftlint:disable file_length single_test_class type_name class AnyObjectProtocolRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(AnyObjectProtocolRule.description) } } class ArrayInitRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ArrayInitRule.description) } } class BlockBasedKVORuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(BlockBasedKVORule.description) } } class ClassDelegateProtocolRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ClassDelegateProtocolRule.description) } } class ClosingBraceRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ClosingBraceRule.description) } } class ClosureBodyLengthRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ClosureBodyLengthRule.description) } } class ClosureEndIndentationRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ClosureEndIndentationRule.description) } } class ClosureParameterPositionRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ClosureParameterPositionRule.description) } } class ClosureSpacingRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ClosureSpacingRule.description) } } class CommaRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(CommaRule.description) } } class ContainsOverFirstNotNilRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ContainsOverFirstNotNilRule.description) } } class ControlStatementRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ControlStatementRule.description) } } class ConvenienceTypeRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ConvenienceTypeRule.description) } } class DiscardedNotificationCenterObserverRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(DiscardedNotificationCenterObserverRule.description) } } class DiscouragedObjectLiteralRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(DiscouragedObjectLiteralRule.description) } } class DiscouragedOptionalBooleanRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(DiscouragedOptionalBooleanRule.description) } } class DiscouragedOptionalCollectionRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(DiscouragedOptionalCollectionRule.description) } } class DynamicInlineRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(DynamicInlineRule.description) } } class EmptyCountRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(EmptyCountRule.description) } } class EmptyEnumArgumentsRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(EmptyEnumArgumentsRule.description) } } class EmptyParametersRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(EmptyParametersRule.description) } } class EmptyParenthesesWithTrailingClosureRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(EmptyParenthesesWithTrailingClosureRule.description) } } class EmptyStringRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(EmptyStringRule.description) } } class EmptyXCTestMethodRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(EmptyXCTestMethodRule.description) } } class ExplicitACLRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ExplicitACLRule.description) } } class ExplicitEnumRawValueRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ExplicitEnumRawValueRule.description) } } class ExplicitInitRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ExplicitInitRule.description) } } class ExplicitSelfRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ExplicitSelfRule.description) } } class ExplicitTopLevelACLRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ExplicitTopLevelACLRule.description) } } class ExtensionAccessModifierRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ExtensionAccessModifierRule.description) } } class FallthroughRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(FallthroughRule.description) } } class FatalErrorMessageRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(FatalErrorMessageRule.description) } } class FirstWhereRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(FirstWhereRule.description) } } class ForWhereRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ForWhereRule.description) } } class ForceCastRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ForceCastRule.description) } } class ForceTryRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ForceTryRule.description) } } class ForceUnwrappingRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ForceUnwrappingRule.description) } } class FunctionDefaultParameterAtEndRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(FunctionDefaultParameterAtEndRule.description) } } class IdenticalOperandsRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(IdenticalOperandsRule.description) } } class ImplicitGetterRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ImplicitGetterRule.description) } } class ImplicitReturnRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ImplicitReturnRule.description) } } class InertDeferRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(InertDeferRule.description) } } class IsDisjointRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(IsDisjointRule.description) } } class JoinedDefaultParameterRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(JoinedDefaultParameterRule.description) } } class LargeTupleRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(LargeTupleRule.description) } } class LegacyCGGeometryFunctionsRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(LegacyCGGeometryFunctionsRule.description) } } class LegacyConstantRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(LegacyConstantRule.description) } } class LegacyConstructorRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(LegacyConstructorRule.description) } } class LegacyNSGeometryFunctionsRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(LegacyNSGeometryFunctionsRule.description) } } class LegacyRandomRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(LegacyRandomRule.description) } } class LetVarWhitespaceRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(LetVarWhitespaceRule.description) } } class LiteralExpressionEndIdentationRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(LiteralExpressionEndIdentationRule.description) } } class LowerACLThanParentRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(LowerACLThanParentRule.description) } } class MissingDocsRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(MissingDocsRule.description) } } class MultilineFunctionChainsRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(MultilineFunctionChainsRule.description) } } class MultilineParametersRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(MultilineParametersRule.description) } } class MultipleClosuresWithTrailingClosureRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(MultipleClosuresWithTrailingClosureRule.description) } } class NestingRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(NestingRule.description) } } class NimbleOperatorRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(NimbleOperatorRule.description) } } class NoExtensionAccessModifierRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(NoExtensionAccessModifierRule.description) } } class NoFallthroughOnlyRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(NoFallthroughOnlyRule.description) } } class NoGroupingExtensionRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(NoGroupingExtensionRule.description) } } class NotificationCenterDetachmentRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(NotificationCenterDetachmentRule.description) } } class OpeningBraceRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(OpeningBraceRule.description) } } class OperatorFunctionWhitespaceRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(OperatorFunctionWhitespaceRule.description) } } class OperatorUsageWhitespaceRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(OperatorUsageWhitespaceRule.description) } } class OverriddenSuperCallRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(OverriddenSuperCallRule.description) } } class OverrideInExtensionRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(OverrideInExtensionRule.description) } } class PatternMatchingKeywordsRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(PatternMatchingKeywordsRule.description) } } class PrivateActionRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(PrivateActionRule.description) } } class PrivateUnitTestRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(PrivateUnitTestRule.description) } } class ProhibitedInterfaceBuilderRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ProhibitedInterfaceBuilderRule.description) } } class ProhibitedSuperRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ProhibitedSuperRule.description) } } class ProtocolPropertyAccessorsOrderRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ProtocolPropertyAccessorsOrderRule.description) } } class QuickDiscouragedCallRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(QuickDiscouragedCallRule.description) } } class QuickDiscouragedFocusedTestRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(QuickDiscouragedFocusedTestRule.description) } } class QuickDiscouragedPendingTestRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(QuickDiscouragedPendingTestRule.description) } } class RedundantDiscardableLetRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(RedundantDiscardableLetRule.description) } } class RedundantNilCoalescingRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(RedundantNilCoalescingRule.description) } } class RedundantOptionalInitializationRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(RedundantOptionalInitializationRule.description) } } class RedundantSetAccessControlRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(RedundantSetAccessControlRule.description) } } class RedundantStringEnumValueRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(RedundantStringEnumValueRule.description) } } class RedundantTypeAnnotationRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(RedundantTypeAnnotationRule.description) } } class RedundantVoidReturnRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(RedundantVoidReturnRule.description) } } class ReturnArrowWhitespaceRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ReturnArrowWhitespaceRule.description) } } class ShorthandOperatorRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ShorthandOperatorRule.description) } } class SingleTestClassRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(SingleTestClassRule.description) } } class SortedFirstLastRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(SortedFirstLastRule.description) } } class SortedImportsRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(SortedImportsRule.description) } } class StaticOperatorRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(StaticOperatorRule.description) } } class StrictFilePrivateRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(StrictFilePrivateRule.description) } } class SwitchCaseOnNewlineRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(SwitchCaseOnNewlineRule.description) } } class SyntacticSugarRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(SyntacticSugarRule.description) } } class ToggleBoolRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ToggleBoolRule.description) } } class TrailingClosureRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(TrailingClosureRule.description) } } class TrailingSemicolonRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(TrailingSemicolonRule.description) } } class TypeBodyLengthRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(TypeBodyLengthRule.description) } } class UnavailableFunctionRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(UnavailableFunctionRule.description) } } class UnneededBreakInSwitchRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(UnneededBreakInSwitchRule.description) } } class UnneededParenthesesInClosureArgumentRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(UnneededParenthesesInClosureArgumentRule.description) } } class UntypedErrorInCatchRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(UntypedErrorInCatchRule.description) } } class UnusedClosureParameterRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(UnusedClosureParameterRule.description) } } class UnusedEnumeratedRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(UnusedEnumeratedRule.description) } } class UnusedImportRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(UnusedImportRule.description) } } class UnusedPrivateDeclarationRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(UnusedPrivateDeclarationRule.description) } } class ValidIBInspectableRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(ValidIBInspectableRule.description) } } class VerticalParameterAlignmentOnCallRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(VerticalParameterAlignmentOnCallRule.description) } } class VerticalParameterAlignmentRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(VerticalParameterAlignmentRule.description) } } class VoidReturnRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(VoidReturnRule.description) } } class WeakDelegateRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(WeakDelegateRule.description) } } class XCTFailMessageRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(XCTFailMessageRule.description) } } class YodaConditionRuleTests: XCTestCase { func testWithDefaultConfiguration() { verifyRule(YodaConditionRule.description) } }
[ 169952 ]
f3d5a5e74bfe18240ea8a0b24120232f68b63d91
df1f14737b4673172c3567a162e143caff305d97
/Sources/CombinedContacts/Contact.swift
7f4b4a1dd9c857e16a4a30c6e940f26dedecb2e9
[ "MIT" ]
permissive
devmaximilian/CombinedContacts
fb04a7b516173ef0d88f48f848a5ad43695c0d4f
9e88870d156e840922d3fa82cce348a8520a06b6
refs/heads/main
2023-03-16T21:11:10.858209
2021-03-02T20:07:02
2021-03-02T20:07:02
281,453,625
4
1
null
null
null
null
UTF-8
Swift
false
false
6,165
swift
// // Contact.swift // CombinedContacts // // Created by Maximilian Wendel on 2020-07-21. // // MIT License // // Copyright (c) 2020 Maximilian Wendel // // 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, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. import Foundation import Contacts extension CNMutableContact { public func contactType(_ value: CNContactType) -> CNMutableContact { self.contactType = value return self } public func namePrefix(_ value: String) -> CNMutableContact { self.namePrefix = value return self } public func givenName(_ value: String) -> CNMutableContact { self.givenName = value return self } public func middleName(_ value: String) -> CNMutableContact { self.middleName = value return self } public func familyName(_ value: String) -> CNMutableContact { self.familyName = value return self } public func previousFamilyName(_ value: String) -> CNMutableContact { self.previousFamilyName = value return self } public func nameSuffix(_ value: String) -> CNMutableContact { self.nameSuffix = value return self } public func nickname(_ value: String) -> CNMutableContact { self.nickname = value return self } public func organizationName(_ value: String) -> CNMutableContact { self.organizationName = value return self } public func departmentName(_ value: String) -> CNMutableContact { self.departmentName = value return self } public func jobTitle(_ value: String) -> CNMutableContact { self.jobTitle = value return self } public func phoneticGivenName(_ value: String) -> CNMutableContact { self.phoneticGivenName = value return self } public func phoneticMiddleName(_ value: String) -> CNMutableContact { self.phoneticMiddleName = value return self } public func phoneticFamilyName(_ value: String) -> CNMutableContact { self.phoneticFamilyName = value return self } public func phoneticOrganizationName(_ value: String) -> CNMutableContact { self.phoneticOrganizationName = value return self } public func note(_ value: String) -> CNMutableContact { self.note = value return self } public func phoneNumber(_ value: String, label: CNLabels.PhoneNumber? = nil) -> CNMutableContact { let phoneNumber = CNLabeledValue(label: label?.rawValue, value: CNPhoneNumber(stringValue: value)) self.phoneNumbers.append(phoneNumber) return self } public func emailAddress(_ value: String, label: CNLabels.Email? = nil) -> CNMutableContact { let emailAddress = CNLabeledValue(label: label?.rawValue, value: value as NSString) self.emailAddresses.append(emailAddress) return self } public func postalAddress(_ value: CNMutablePostalAddress, label: CNLabels.PostalAddress? = nil) -> CNMutableContact { let postalAddress = CNLabeledValue<CNPostalAddress>(label: label?.rawValue, value: value) self.postalAddresses.append(postalAddress) return self } public func urlAddress(_ value: String, label: CNLabels.URLAddress? = nil) -> CNMutableContact { let urlAddress = CNLabeledValue(label: label?.rawValue, value: value as NSString) self.urlAddresses.append(urlAddress) return self } public func contactRelation(_ value: String, relation: CNLabels.Relation) -> CNMutableContact { let contactRelation = CNLabeledValue(label: relation.rawValue, value: CNContactRelation(name: value)) self.contactRelations.append(contactRelation) return self } public func socialProfile(_ value: CNSocialProfile, service: CNServices.SocialProfile) -> CNMutableContact { let socialProfile = CNLabeledValue<CNSocialProfile>(label: service.rawValue, value: value) self.socialProfiles.append(socialProfile) return self } public func birthday(_ value: DateComponents) -> CNMutableContact { self.birthday = value return self } public func instantMessageAddress(_ value: CNInstantMessageAddress, service: CNServices.InstantMessage) -> CNMutableContact { let instantMessageAddress = CNLabeledValue<CNInstantMessageAddress>(label: service.rawValue, value: value) self.instantMessageAddresses.append(instantMessageAddress) return self } } // MARK: - Not implemented extension CNMutableContact { // // // public func imageData(_ value: Data?) -> CNMutableContact { // // } // // public func thumbnailImageData(_ value: Data?) -> CNMutableContact { // // } // // }
[ 60308, 141290, 54698, 229524 ]
12fe240d76daea696984e9cddc473a8f66183de3
b0215036018c3c916e1f22668aec12ab09b779a8
/UnionLeaf/MapsController.swift
87406391772a243d65621a3110c1e24416e88ece
[]
no_license
alissonpn/IOS_UnionLeaf
c87351da75a05c72c4249c575394436da69f86dd
d1e61bdb81b4a6009a93df843ec6f22c5cdb1b53
refs/heads/master
2016-09-12T20:22:03.123174
2016-04-28T20:52:11
2016-04-28T20:52:11
57,152,162
0
0
null
null
null
null
UTF-8
Swift
false
false
182
swift
// // ViewController.swift // UnionLeaf // // Created by Student on 4/26/16. // Copyright © 2016 HackaTruck. All rights reserved. // import UIKit class MapsController { }
[ -1 ]
71c5ccb53e2ece7ad8b3daafa167bf4d9d83d9f8
6f42af496ebdf7736f191b900cc432e673ecca54
/Package.swift
cd404038e41260ef1903ce294305a5470ed6c695
[ "MIT" ]
permissive
joaoalexandre5/Formula1API
95254e70759066a5e56bdbcadbc9d29f3b06b85d
608217073dcbdeb6ac8e15c529747d157a84b910
refs/heads/main
2023-06-19T01:43:00.213241
2021-07-01T04:27:22
2021-07-01T04:27:22
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,025
swift
// swift-tools-version:5.2 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "Formula1API", platforms: [ .macOS(.v10_15), .watchOS(.v6), .iOS(.v13) ], products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "Formula1API", targets: ["Formula1API"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "Formula1API", dependencies: []), ] )
[ 340484, 415748, 304657, 35346, 237593, 154138, 369691, 159263, 425505, 224295, 201769, 402986, 201771, 201775, 321584, 321590, 33336, 321598, 242239, 173122, 389700, 339016, 378952, 332367, 341075, 248917, 327255, 296024, 395359, 160864, 261220, 139366, 205930, 362606, 373359, 333424, 2161, 192626, 2164, 339573, 2173, 2174, 339072, 2177, 201858, 245376, 160898, 339075, 339078, 339081, 339084, 339087, 339090, 258708, 330389, 339093, 2199, 311962, 380058, 2204, 393379, 2212, 334503, 248488, 315563, 222381, 336559, 108215, 225979, 295100, 222400, 225985, 315584, 153283, 384704, 389316, 211655, 65737, 421067, 256720, 339667, 366292, 340697, 133337, 317666, 177384, 264939, 409324, 337650, 211186, 194808, 395512, 205050, 393979, 356604, 425724, 178430, 388863, 380152, 388865, 162564, 388868, 374022, 208137, 249101, 338189, 136461, 25364, 150811, 311584, 259360, 342306, 201507, 334115, 259368, 248106, 273707, 325932, 341807, 328500, 388921, 377150, 250175, 344393, 384329, 134482, 339800, 341853, 111456, 246116, 211813, 251240, 151919, 260978, 362866, 337271, 357752, 249211, 259455, 299394, 390023, 43400, 373131, 215442, 1945, 321435, 1948, 1952, 1955, 178087, 1959, 1960, 1963, 235957, 1975, 326591, 329151, 24517, 1996, 24525, 373198, 372174, 1998, 2006, 363478, 45015, 262620, 241122, 208354, 416228, 164333, 247797 ]
2c35c0685cb55b45d54a0c64b3dcf54b1a24ce4e
26ce9c41c8dd986cc401a32ce045cc5e38fd133e
/GitHub Repository SearchTests/MockClass/MockService.swift
01367ddd2589e92be84e6dc08db13ccf751be59a
[]
no_license
hareshghatala/GitHub-Repository-Search
e0559e423c9f0965598897b98226c48d4a60daa1
e89973d1cd8c5df40e6dc1353bda2dfb5cabc5ca
refs/heads/master
2023-07-25T02:18:02.522217
2021-09-02T10:28:49
2021-09-02T10:28:49
402,040,533
0
0
null
null
null
null
UTF-8
Swift
false
false
750
swift
// // MockService.swift // GitHub Repository SearchTests // // Created by Haresh Ghatala on 2021/09/02. // import XCTest @testable import GitHub_Repository_Search class MockService: Service { public static let mockShared = MockService() override init() { super.init() } var isfailur: Bool = false var mockServiceError: ServiceError? var mockResponse: RepoSearchData? override func fetchResources<T>(url: URL, queryParams: [String : String]? = nil, completion: @escaping (Result<T, ServiceError>) -> Void) where T : Decodable { if isfailur { completion(.failure(mockServiceError!)) } else { completion(.success(mockResponse as! T)) } } }
[ -1 ]
fa9eee97857343829281772401643175b4205099
9b41eeeb306ace0f18ee58cc6d71b7079cbe31e3
/ForecastDesign/WeatherVC.swift
b3cf05c518eba4ded061cd6a0e772d9db74044b2
[]
no_license
kapinos/WeatherForecast
58a20280096a887e5b9b4a4886e9a9f47c0eac01
a1d1f4c82505d34cd178f494f9dd119660fd8ecc
refs/heads/master
2021-07-06T09:36:53.891453
2017-10-01T19:58:37
2017-10-01T19:58:37
104,491,449
0
0
null
null
null
null
UTF-8
Swift
false
false
9,375
swift
// // WeatherVC.swift // ForecastDesign // // Created by Anastasia on 5/30/17. // Copyright © 2017 Anastasia. All rights reserved. // import UIKit import CoreLocation import Alamofire class WeatherVC: UIViewController, UITableViewDataSource, UITableViewDelegate, CLLocationManagerDelegate { //MARK: IBOutlets @IBOutlet weak var currentDateLabel: UILabel! @IBOutlet weak var currentTemperatureLabel: UILabel! @IBOutlet weak var currentLocationLabel: UILabel! @IBOutlet weak var currentIcon: UIImageView! @IBOutlet weak var currentBGImage: UIImageView! @IBOutlet weak var currentTypeWeatherLabel: UILabel! @IBOutlet weak var tableView: UITableView! @IBOutlet var swipeToCurrentDayDetails: UISwipeGestureRecognizer! //MARK: variables let locationManager = CLLocationManager() var currentLocation: CLLocation! var currentWeather: CurrentWeather! var forecastsDays = ForecastDaysInfo() var forecastsHours = ForecastHoursInfo() var timeBeingInBackground: Date! var detailsVC: DayDetailsVC? var downloadAgain = false override func viewDidLoad() { super.viewDidLoad() tableView.alpha = 0 tableView.dataSource = self tableView.delegate = self locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.requestWhenInUseAuthorization() locationManager.startMonitoringSignificantLocationChanges() swipeToCurrentDayDetails.addTarget(self, action: #selector(self.currentDayDetails)) currentWeather = CurrentWeather() navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default) navigationController?.navigationBar.shadowImage = UIImage() navigationController?.navigationBar.isTranslucent = true navigationController?.view.backgroundColor = .clear let notificationCenter = NotificationCenter.default notificationCenter.addObserver(self, selector: #selector(appMovedToBackground), name: Notification.Name.UIApplicationWillResignActive, object: nil) notificationCenter.addObserver(self, selector: #selector(appRestoredFromBackground), name: Notification.Name.UIApplicationWillEnterForeground, object: nil) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) if forecastsDays.isEmpty() { downloadForecastByUserLocation(){} // get the user's location } else { animateTable() } } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) } //MARK: UITableViewDelegate func numberOfSections(in tableView: UITableView) -> Int { return 1 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return forecastsDays.count() - 1 // get forecastsDays count without current day } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { if let cell = tableView.dequeueReusableCell(withIdentifier: "weatherByDayCell", for: indexPath) as? WeatherByDayCell { let forecast = forecastsDays.getForecast(byIndex: indexPath.row+1) cell.cofigureCell(forecast: forecast) return cell } else { return WeatherByDayCell() } } var dayMonthSelected = "" func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let day = forecastsDays.getForecast(byIndex: indexPath.row+1) dayMonthSelected = day.dayOfMonth let hoursForSelectedDay = getForecastByHoursFor(dayMonth: dayMonthSelected) if !hoursForSelectedDay.isEmpty() { performSegue(withIdentifier: "SegueToDayDetails", sender: hoursForSelectedDay) } } //MARK: CLLocationManagerDelegate func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { //print("downloadAgain: \(downloadAgain); status: \(status.rawValue)") if !downloadAgain { return } if status == .authorizedAlways || status == .authorizedWhenInUse { downloadForecastByUserLocation(){} } } func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { manager.stopUpdatingLocation() downloadForecastByUserLocation() {} //print("didUpdateLocation; newLocation: \(manager.location)") } //MARK: segue override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if let dayDetailsVC = segue.destination as? DayDetailsVC { self.detailsVC = dayDetailsVC if let arrayForecastsByHours = sender as? ForecastHoursInfo { dayDetailsVC.forecastHours = arrayForecastsByHours } } } func currentDayDetails() { let hoursForSelectedDay = getForecastByHoursFor(dayMonth: currentWeather.dayOfMonth) if !hoursForSelectedDay.isEmpty() { performSegue(withIdentifier: "SegueToDayDetails", sender: hoursForSelectedDay) } } //MARK: inner methods func updateMainUI() { currentDateLabel.text = currentWeather.date currentTemperatureLabel.text = "\(currentWeather.currentTemperature) ºC" currentLocationLabel.text = currentWeather.cityName currentTypeWeatherLabel.text = currentWeather.weatherType currentIcon.image = UIImage(named: currentWeather.weatherIcon) currentBGImage.image = UIImage(named: currentWeather.defineBGImage()) self.tableView.alpha = 1 animateTable() // currentBGImage.image = UIImage(named: "thunderstormd") // check image // print("image: \(currentWeather.defineBGImage())") // checkValue image } func downloadForecastByUserLocation(completed: @escaping () -> ()) { //print("Status: \(CLLocationManager.authorizationStatus().rawValue)") if CLLocationManager.authorizationStatus() != .authorizedWhenInUse { downloadAgain = true locationManager.requestWhenInUseAuthorization() return } downloadAgain = false //print("location: \(locationManager.location)") if locationManager.location == nil { locationManager.startUpdatingLocation() return } currentLocation = locationManager.location LocationService.sharedInstance.latitude = currentLocation.coordinate.latitude LocationService.sharedInstance.longitude = currentLocation.coordinate.longitude currentWeather.downloadWeatherDetails { self.forecastsDays.downloadForecastData { self.forecastsHours.downloadForecastData { self.updateMainUI() completed() } } } } func getForecastByHoursFor(dayMonth: String) -> ForecastHoursInfo { let arrayForecastsHours = ForecastHoursInfo() for forecast in forecastsHours { if forecast.dayOfMonth == dayMonth { arrayForecastsHours.append(forecast: forecast) } } return arrayForecastsHours } func animateTable() { tableView.reloadData() tableView.clipsToBounds = false let cells = tableView.visibleCells let tableHeight: CGFloat = tableView.bounds.size.height for i in cells { let cell: UITableViewCell = i as UITableViewCell cell.transform = CGAffineTransform(translationX: 0, y: tableHeight) } var index = 0 for a in cells { let cell: UITableViewCell = a as UITableViewCell UIView.animate(withDuration: 0.7, delay: 0.1 * Double(index), usingSpringWithDamping: 0.75, initialSpringVelocity: 0, options: UIViewAnimationOptions.curveEaseInOut, animations: { cell.transform = CGAffineTransform(translationX: 0, y: 0); }, completion:{ finished in self.tableView.clipsToBounds = true }) index += 1 } } // MARK: lifecycle APP func appMovedToBackground() { let date = Date() timeBeingInBackground = date } func appRestoredFromBackground() { let date = Date() let period = date.timeIntervalSince(timeBeingInBackground) print("period: \(period)") // update every 10 minutes if Int(period) >= UPDATE_APP_PERIOD_SECONDS { print("update the data WeatherVC") self.downloadForecastByUserLocation { if self.dayMonthSelected != "" { let hoursForSelectedDay = self.getForecastByHoursFor(dayMonth: self.dayMonthSelected) self.detailsVC?.updateForecast(forecast: hoursForSelectedDay) } } } } }
[ -1 ]
14a01da36acd10e9e6ae184222bad409596dcaf2
e4fc4cb55eddc399c9aedcdb54ca4e6b263d261b
/OnePoe/ViewController.swift
822496a6ff3d18465ae49ae0ed2041dd69128396
[]
no_license
wwq0327/OnePoe
034d7efa7ed95d9106aa641b6c1b40addbfc80c6
e85fdf355ac11435fd1e53311acd6f42ca185875
refs/heads/master
2021-01-10T01:53:19.384058
2015-12-30T12:51:37
2015-12-30T12:51:37
48,738,567
0
0
null
null
null
null
UTF-8
Swift
false
false
3,706
swift
// // ViewController.swift // OnePoe // // Created by wyatt on 15/12/29. // Copyright © 2015年 Wanqing Wang. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var scrollView: UIScrollView! var myLabel: PoeLabel! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. // create label let poeText = "面朝大海,春暖花开\n从明天起,做一个幸福的人\n劈柴,周游世界\n从明天起,关心粮食和蔬菜\n我有一所房子,面朝大海,春暖花开\n从明天起,和每一个亲人通信\n告诉他们我的幸福\n那幸福的闪电告诉我的\n我将告诉每一个人\n给每一条河每一座山取一个温暖的名字\n陌生人,我也为你祝福\n愿你有一个灿烂的前程\n愿你有情人终成眷属\n愿你在尘世获得幸福\n我只愿面朝大海,春暖花开\n面朝大海,春暖花开\n从明天起,做一个幸福的人\n劈柴,周游世界\n从明天起,关心粮食和蔬菜\n我有一所房子,面朝大海,春暖花开\n从明天起,和每一个亲人通信\n告诉他们我的幸福\n那幸福的闪电告诉我的\n我将告诉每一个人\n给每一条河每一座山取一个温暖的名字\n陌生人,我也为你祝福\n愿你有一个灿烂的前程\n愿你有情人终成眷属\n愿你在尘世获得幸福\n我只愿面朝大海,春暖花开" // let poeText = "单车欲问边,属国过居延。 \n征蓬出汉塞,归雁入胡天。 \n大漠孤烟直,长河落日圆。 \n萧关逢候骑,都护在燕然。" // let poeText = "从明天起,做一个幸福的人\n劈柴,周游世界\n从明天起,关心粮食和蔬菜\n我有一所房子,面朝大海,春暖花开\n从明天起,和每一个亲人通信\n告诉他们我的幸福\n那幸福的闪电告诉我的\n我将告诉每一个人\n给每一条河每一座山取一个温暖的名字\n陌生人,我也为你祝福\n愿你有一个灿烂的前程\n愿你有情人终成眷属\n愿你在尘世获得幸福\n我只愿面朝大海,春暖花开" myLabel = PoeLabel(fontname: "FZBYSK--GBK1-0", labelText: poeText, fontSize: 17, lineHeight: 14) myLabel.transform = CGAffineTransformMakeTranslation(0, self.scrollView.bounds.height * 2 / 3) self.scrollView.addSubview(myLabel) var labelSize = CGSizeZero if myLabel.bounds.height < UIScreen.mainScreen().bounds.height { labelSize = CGSizeMake(UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height - 100) } else { labelSize = CGSizeMake(myLabel.frame.size.width, myLabel.frame.size.height ) } self.scrollView.contentSize = labelSize } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) ScrollAnimation.contentLabelAnimationWithLabel(myLabel, view: self.view) } } //extension ViewController: UIScrollViewDelegate { // func scrollViewDidScroll(scrollView: UIScrollView) { // if myLabel.frame.height > UIScreen.mainScreen().bounds.height { // myLabel.transform = CGAffineTransformMakeTranslation(0, 10) // } else { // myLabel.transform = CGAffineTransformMakeTranslation(0, (UIScreen.mainScreen().bounds.height - myLabel.bounds.height) / 2 - 100) // } // // } // //}
[ -1 ]
8c194551d25bcb5d619afe0ed5193ad9bf15237b
f5172841885445b9648e699f554d017398a6db7c
/DACNPM/ViewController/SignInVC/SignInViewModel.swift
2981135e25f1912c036ff9d8f65539eb0b8eb914
[]
no_license
hung140120/DanafoodApp
5609702ab7fe4442cfea2d0c294004686d12ad14
701bd9cc87e7d9f3117577d81ff9ae5006f4ad51
refs/heads/master
2022-11-10T08:10:53.900276
2020-06-28T08:36:02
2020-06-28T08:36:02
275,541,917
0
0
null
null
null
null
UTF-8
Swift
false
false
3,808
swift
// // SignInViewModel.swift // DACNPM // // Created by Dinh Hung on 6/8/20. // Copyright © 2020 Dinh Hung. All rights reserved. // import Foundation import RxSwift import RxCocoa import ObjectMapper protocol SignInViewModelDelegate: MVVMViewDelegate { func goto() } class SignInViewModel: MVVMViewModel { var phoneNumber = BehaviorRelay<String>(value: "") var password = BehaviorRelay<String>(value: "") var isHidenPassword = BehaviorRelay<Bool>(value: true) var dynamicOfNetwork: Dynamic<NetworkResult<Any>> = Dynamic() var delegate: SignInViewModelDelegate? = nil init() { configBindding() } func phoneLogin(phone: String, password: String) { if let error = validate(phone: phone, password: password) { dynamicOfNetwork.value = NetworkResult(isLoading: false, data: nil, error: error) return } apiLoginWithPhone(phone: phone, password: password) } } extension SignInViewModel { fileprivate func configBindding() { dynamicOfNetwork.bind { [weak self] (value) in guard let this = self else { return } this.dynamicOfNetwork.value = value } } fileprivate func validate(phone: String, password: String) -> Error? { if (phone.isEmpty) { return NSError(message: "Vui lòng nhập số điện thoại!") } if !phone.isEmailValid { return NSError(message: "Số điện thoại không đúng định dạng. Vui lòng nhập lại!") } if password.isEmpty { return NSError(message: "Xin vui lòng nhập mật khẩu!") } if !password.isPasswordValid { return NSError(message: "Mật khẩu phải có ít nhất 6 ký tự.") } return nil } fileprivate func apiLoginWithPhone(phone: String, password: String) { Api.Auth.phoneLogin(phone: phone, password: password, completion: { (result) in result.isSuccess(completion: { (json) in self.dynamicOfNetwork.value = NetworkResult(isLoading: false, data: json, error: nil) guard let data = json as? [String: Any] else { return } if data.count != 2 { self.delegate?.goto() let object = Mapper<UserObject>().map(JSON: data) let token = object?.access_token let userName = object?.Username let email = object?.Email let fullName = object?.Fullname let address = object?.Address let birthday = object?.Birthday let phoneNumber = object?.PhoneNumber //UDKey.User.password.set(object?.Password) UDKey.User.token.set(token) UDKey.User.username.set(userName) UDKey.User.email.set(email) UDKey.User.fullname.set(fullName) UDKey.User.address.set(address) UDKey.User.birthday.set(birthday) UDKey.User.phonenumber.set(phoneNumber) } else { let msg = "Mật khẩu hoặc số điẹn thoại không đúng" let err = NSError(message: msg) self.dynamicOfNetwork.value = NetworkResult(isLoading: false, data: nil, error: err) } }).error(completion: { (error) in let msg = "Mật khẩu hoặc số điẹn thoại không đúng" let err = NSError(message: msg) self.dynamicOfNetwork.value = NetworkResult(isLoading: false, data: nil, error: err) }) }) } }
[ -1 ]
c3d6681ec253b0a75af88e843cb4a182936abf14
52876cb47e81064b821f16b316ee648f3ecb778d
/Library/ViewModels/LoadingBarButtonItemViewModel.swift
38c6534d824aa5e66d6b164be333796a0e405be3
[ "Apache-2.0", "MIT", "BSD-3-Clause", "LicenseRef-scancode-facebook-software-license" ]
permissive
stephencelis/ios-oss
8eb95323577582d5dcfe3368a7b5e8fe1a51f06f
7600284bbdc9decb9535f5627aeb19a74f8ed709
refs/heads/master
2021-10-03T10:28:57.471349
2018-11-29T21:23:31
2018-11-29T21:23:31
160,070,516
2
0
Apache-2.0
2018-12-02T17:10:03
2018-12-02T17:10:03
null
UTF-8
Swift
false
false
1,976
swift
import Foundation import ReactiveSwift import Result public protocol LoadingBarButtonItemViewModelOutputs { var activityIndicatorIsLoading: Signal<Bool, NoError> { get } var titleButtonIsEnabled: Signal<Bool, NoError> { get } var titleButtonIsHidden: Signal<Bool, NoError> { get } var titleButtonText: Signal<String, NoError> { get } } public protocol LoadingBarButtonItemViewModelInputs { func setIsEnabled(isEnabled: Bool) func setTitle(title: String) func setAnimating(isAnimating: Bool) } public protocol LoadingBarButtonItemViewModelType { var inputs: LoadingBarButtonItemViewModelInputs { get } var outputs: LoadingBarButtonItemViewModelOutputs { get } } public final class LoadingBarButtonItemViewModel: LoadingBarButtonItemViewModelType, LoadingBarButtonItemViewModelInputs, LoadingBarButtonItemViewModelOutputs { public init() { self.activityIndicatorIsLoading = self.isAnimatingProperty.signal self.titleButtonIsEnabled = self.isEnabledProperty.signal self.titleButtonIsHidden = self.isAnimatingProperty.signal self.titleButtonText = self.titleProperty.signal.skipNil() } private var isEnabledProperty = MutableProperty(false) public func setIsEnabled(isEnabled: Bool) { self.isEnabledProperty.value = isEnabled } private var titleProperty = MutableProperty<String?>(nil) public func setTitle(title: String) { self.titleProperty.value = title } private var isAnimatingProperty = MutableProperty(false) public func setAnimating(isAnimating: Bool) { self.isAnimatingProperty.value = isAnimating } public let activityIndicatorIsLoading: Signal<Bool, NoError> public let titleButtonIsEnabled: Signal<Bool, NoError> public let titleButtonIsHidden: Signal<Bool, NoError> public let titleButtonText: Signal<String, NoError> public var inputs: LoadingBarButtonItemViewModelInputs { return self } public var outputs: LoadingBarButtonItemViewModelOutputs { return self } }
[ -1 ]
af7ca6fcccbf9b8f941d250a35e0f034fad61468
fd7eaf7555052a8119a63210917ee9a40776a8a6
/SchoolMapper/View Controllers/MapViewController.swift
e482b4293c5a9c9e370c1cd8070bd2436ce7b78e
[]
no_license
mrlongitqn/SchoolMapper-iOS
2a20265988897fc25c9aa99b5d777a07b1d10c43
b0e0f90a5a250e96831cc59e2af1f81e88c5deb0
refs/heads/master
2022-01-24T02:47:45.482484
2019-08-01T19:34:19
2019-08-01T19:34:19
null
0
0
null
null
null
null
UTF-8
Swift
false
false
4,353
swift
// Copyright © 2018 Matthew Jortberg. All rights reserved. import UIKit import MapKit import CoreLocation class mapViewController: UIViewController { //these are the stacked views @IBOutlet weak var firstFloorView: UIView! @IBOutlet weak var secondFloorView: UIView! //var school = School(filename: "GBS") //vars from previous viewcontroller var firstFloorplanImage = UIImage() var secondFloorplanImage = UIImage() var routeName = String() var distance = Int() var imageCoordinateDictFirst = [String: CLLocationCoordinate2D]() var imageCoordinateDictSecond = [String: CLLocationCoordinate2D]() var firstFloorPoints = [String]() //working var secondFloorPoints = [String]() var movement = String() var destinationName = String() @IBOutlet weak var distanceButton: UIBarButtonItem! override func viewWillDisappear(_ animated: Bool) { distanceButton.isEnabled = false distanceButton.isEnabled = true } @IBAction func stepsButtonClicked(_ sender: UIBarButtonItem) { performSegue(withIdentifier: "segueSteps", sender: self) } @IBOutlet weak var blueLabel: UILabel! @IBOutlet weak var segmentedControl: UISegmentedControl! @IBAction func segmentSelected(_ sender: UISegmentedControl) { switch sender.selectedSegmentIndex { case 0: firstFloorView.isHidden = false secondFloorView.isHidden = true case 1: firstFloorView.isHidden = true secondFloorView.isHidden = false default: break; } } override func viewDidLoad() { navigationItem.title = routeName //self.navigationController.navigationBar.userInteractionEnabled = true if movement == "first" { firstFloorView.isHidden = false secondFloorView.isHidden = true segmentedControl.selectedSegmentIndex = 0 } else if movement == "second" { firstFloorView.isHidden = true secondFloorView.isHidden = false segmentedControl.selectedSegmentIndex = 1 } else if movement == "moving_upstairs" { firstFloorView.isHidden = false secondFloorView.isHidden = true segmentedControl.selectedSegmentIndex = 0 } else if movement == "moving_downstairs" { firstFloorView.isHidden = true secondFloorView.isHidden = false segmentedControl.selectedSegmentIndex = 1 } } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { //Pass information along if segue.identifier == "firstFloorContainerView" { let childViewControllerFirst = segue.destination as! firstFloorViewController childViewControllerFirst.firstFloorPoints = firstFloorPoints childViewControllerFirst.secondFloorPoints = secondFloorPoints childViewControllerFirst.distance = distance childViewControllerFirst.movement = movement childViewControllerFirst.destinationName = destinationName childViewControllerFirst.imageCoordinateDictFirst = imageCoordinateDictFirst childViewControllerFirst.firstFloorplanImage = firstFloorplanImage } else if segue.identifier == "secondFloorContainerView" { let childViewControllerSecond = segue.destination as! secondFloorViewController childViewControllerSecond.secondFloorPoints = secondFloorPoints childViewControllerSecond.firstFloorPoints = firstFloorPoints childViewControllerSecond.distance = distance childViewControllerSecond.movement = movement childViewControllerSecond.destinationName = destinationName childViewControllerSecond.imageCoordinateDictSecond = imageCoordinateDictSecond childViewControllerSecond.secondFloorplanImage = secondFloorplanImage } else if segue.identifier == "segueSteps" { let DestViewControllerSteps = segue.destination as! StepsViewController DestViewControllerSteps.distanceInFeet = distance } } }
[ -1 ]
e152b8afe9a1223e9d55ac641e3b7e51841cb460
196fb03fa9c37c68c8a88c7aa149cd7cc0999bda
/BeautyBell/Model/Users.swift
4a0e4a34ac3057fe17b95c04cec3d14f3725b574
[]
no_license
reyhanraz/BeautyBellPrototype
236b5d515947575ed9213640395e55a1e79cc98e
cae8c51ea6c0fd37017978ea0087268b6e9a360a
refs/heads/main
2023-08-18T05:07:13.617737
2021-09-22T04:58:38
2021-09-22T04:58:38
379,185,484
0
0
null
null
null
null
UTF-8
Swift
false
false
873
swift
// // Users.swift // BeautyBell // // Created by Reyhan Rifqi on 21/06/21. // import Foundation struct Users: Codable { var name: String var imageURL: String var dateOfBirth: String var email: String } struct UserProfileCache { static let key = "userProfileCache" static func save(_ value: Users!) { UserDefaults.standard.set(try? PropertyListEncoder().encode(value), forKey: key) } static func get() -> Users! { var userData: Users! if let data = UserDefaults.standard.value(forKey: key) as? Data { userData = try? PropertyListDecoder().decode(Users.self, from: data) return userData! } else { return Users(name: "", imageURL: "", dateOfBirth: "", email: "") } } static func remove() { UserDefaults.standard.removeObject(forKey: key) } }
[ -1 ]
bd2c023b7ef0ea9636854c34c6c570e8dace6de3
447fd8c68c6a54823a084ed96afd47cec25d9279
/icons/looks/src/looks.swift
5a7259d247323946fc335fac92c71dae6a439f99
[]
no_license
friends-of-cocoa/material-design-icons
cf853a45d5936b16d0fddc88e970331379721431
d66613cf64e521e32a4cbb64dadd9cb20ea6199e
refs/heads/master
2022-07-29T15:51:13.647551
2020-09-16T12:15:32
2020-09-16T12:15:32
295,662,032
0
0
null
null
null
null
UTF-8
Swift
false
false
386
swift
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen // swiftlint:disable superfluous_disable_command identifier_name line_length nesting type_body_length type_name public enum MDIIcons { public static let looks24pt = MDIIcon(name: "looks_24pt").image } // swiftlint:enable superfluous_disable_command identifier_name line_length nesting type_body_length type_name
[ -1 ]
a7e07fe4af765235cc02fc49be0a2e3afe880bf0
6ab14a944981110f6b225f05cc3a21f1492fb9ba
/firebase authentication/ProfileViewController.swift
9bff36719a9c7fab7a91f7e00d935b240e0f07e5
[ "MIT" ]
permissive
itopstack/Firebase-iOS-Authentication-Demo
f9fb1afd6a8a63bc8cc0c3da822225fc6c5e4560
6159d50dc134737f4b81134df11f951d3b7e9d41
refs/heads/master
2021-06-14T08:18:28.327923
2017-02-21T11:46:17
2017-02-21T11:46:17
null
0
0
null
null
null
null
UTF-8
Swift
false
false
12,914
swift
// // ProfileViewController.swift // firebase authentication // // Created by Kittisak Phetrungnapha on 9/27/2559 BE. // Copyright © 2559 Kittisak Phetrungnapha. All rights reserved. // import UIKit import FirebaseAuth import GoogleSignIn class ProfileViewController: UIViewController { // MARK: - Property @IBOutlet weak var providerIDValueLabel: UILabel! @IBOutlet weak var uidValueLabel: UILabel! @IBOutlet weak var emailValueLabel: UILabel! @IBOutlet weak var nameValueLabel: UILabel! @IBOutlet weak var photoUrlValueLabel: UILabel! // MARK: - View controller life cycle override func viewDidLoad() { super.viewDidLoad() let logoutBarButton = UIBarButtonItem(title: "Logout", style: .plain, target: self, action: #selector(logout)) let manageProfileBarButton = UIBarButtonItem(title: "Manage", style: .plain, target: self, action: #selector(manageProfile)) self.navigationItem.leftBarButtonItem = logoutBarButton self.navigationItem.rightBarButtonItem = manageProfileBarButton if let user = FIRAuth.auth()?.currentUser { setUserDataToView(withFIRUser: user) if user.isAnonymous { AppDelegate.showAlertMsg(withViewController: self, message: "You are an Anonymous. If you want to update the profile, you have to login first.") manageProfileBarButton.isEnabled = false } else if !user.isEmailVerified { AppDelegate.showAlertMsg(withViewController: self, message: "Your account is not verified. Please select manage to verify it.") } } else { let alert = UIAlertController(title: "Message", message: "No user is signed in", preferredStyle: .alert) let okAction = UIAlertAction(title: "OK", style: .default, handler: { (action: UIAlertAction) in self.logout() }) alert.addAction(okAction) self.present(alert, animated: true, completion: nil) } } // MARK: - Method private func setUserDataToView(withFIRUser user: FIRUser) { providerIDValueLabel.text = UserDefaults.standard.value(forKey: UserDefaultsKey.loginMethod.rawValue) as! String? uidValueLabel.text = user.uid emailValueLabel.text = user.email nameValueLabel.text = user.displayName photoUrlValueLabel.text = user.photoURL?.absoluteString } func logout() { switch providerIDValueLabel.text! { case LoginMethods.facebook.rawValue: FacebookSdkAdapter.shared.performLogout() case LoginMethods.google.rawValue: GIDSignIn.sharedInstance().signOut() case LoginMethods.twitter.rawValue: TwitterSdkAdapter.shared.performLogout() default: break } try! FIRAuth.auth()!.signOut() UserDefaults.standard.set(nil, forKey: UserDefaultsKey.loginMethod.rawValue) let appDelegate = UIApplication.shared.delegate as! AppDelegate appDelegate.setRootViewControllerWith(viewIdentifier: ViewIdentifiers.login.rawValue) } func manageProfile() { let manageActionSheet = UIAlertController(title: "Select menu", message: nil, preferredStyle: .actionSheet) let cancelAction = UIAlertAction(title: "Cancel", style: .destructive, handler: nil) let changeUserInfoAction = UIAlertAction(title: "Change name and image", style: .default) { (action: UIAlertAction) in self.changeUserInfo() } var emailAction: UIAlertAction! if providerIDValueLabel.text == LoginMethods.twitter.rawValue && emailValueLabel.text == nil { emailAction = UIAlertAction(title: "Sync with email", style: .default) { (action: UIAlertAction) in self.syncWithAccountEmail() } } else { emailAction = UIAlertAction(title: "Change Email", style: .default) { (action: UIAlertAction) in self.changeEmail() } } let changePasswordAction = UIAlertAction(title: "Change Password", style: .default) { (action: UIAlertAction) in self.changePassword() } let deleteAccountAction = UIAlertAction(title: "Delete Account", style: .default) { (action: UIAlertAction) in self.deleteAccount() } manageActionSheet.addAction(changeUserInfoAction) manageActionSheet.addAction(changePasswordAction) if let user = FIRAuth.auth()?.currentUser, !user.isEmailVerified { let verifyAccountAction = UIAlertAction(title: "Verify Account", style: .default) { (action: UIAlertAction) in self.sentVerifiedEmail() } manageActionSheet.addAction(verifyAccountAction) } manageActionSheet.addAction(emailAction) manageActionSheet.addAction(deleteAccountAction) manageActionSheet.addAction(cancelAction) self.present(manageActionSheet, animated: true, completion: nil) } private func changeUserInfo() { let alert = UIAlertController(title: "Change name and image", message: nil, preferredStyle: .alert) alert.addTextField { (textField: UITextField) in textField.placeholder = "Enter your name" textField.clearButtonMode = .whileEditing } alert.addTextField { (textField: UITextField) in textField.placeholder = "Enter your image url" textField.clearButtonMode = .whileEditing textField.text = "https://example.com/user/user-uid/profile.jpg" } let cancelAction = UIAlertAction(title: "Cancel", style: .destructive, handler: nil) let confirmAction = UIAlertAction(title: "Confirm", style: .default) { (action: UIAlertAction) in let nameTextField = alert.textFields![0] let imageTextField = alert.textFields![1] if let user = FIRAuth.auth()?.currentUser { let changeRequest = user.profileChangeRequest() changeRequest.displayName = nameTextField.text changeRequest.photoURL = NSURL(string: imageTextField.text!) as? URL changeRequest.commitChanges { error in if let error = error { AppDelegate.showAlertMsg(withViewController: self, message: error.localizedDescription) } else { AppDelegate.showAlertMsg(withViewController: self, message: "Your profile was updated") self.setUserDataToView(withFIRUser: user) } } } } alert.addAction(cancelAction) alert.addAction(confirmAction) self.present(alert, animated: true, completion: nil) } private func changePassword() { let alert = UIAlertController(title: "Change Password", message: nil, preferredStyle: .alert) alert.addTextField { (textField: UITextField) in textField.placeholder = "Enter your new password" textField.clearButtonMode = .whileEditing textField.isSecureTextEntry = true } let cancelAction = UIAlertAction(title: "Cancel", style: .destructive, handler: nil) let confirmAction = UIAlertAction(title: "Confirm", style: .default) { (action: UIAlertAction) in let textField = alert.textFields![0] let user = FIRAuth.auth()?.currentUser user?.updatePassword(textField.text!) { error in if let error = error { AppDelegate.showAlertMsg(withViewController: self, message: error.localizedDescription) } else { AppDelegate.showAlertMsg(withViewController: self, message: "Password was updated") } } } alert.addAction(cancelAction) alert.addAction(confirmAction) self.present(alert, animated: true, completion: nil) } private func changeEmail() { let alert = UIAlertController(title: "Change Email", message: nil, preferredStyle: .alert) alert.addTextField { (textField: UITextField) in textField.placeholder = "Enter your new email" textField.clearButtonMode = .whileEditing } let cancelAction = UIAlertAction(title: "Cancel", style: .destructive, handler: nil) let confirmAction = UIAlertAction(title: "Confirm", style: .default) { (action: UIAlertAction) in let textField = alert.textFields![0] let user = FIRAuth.auth()?.currentUser user?.updateEmail(textField.text!) { error in if let error = error { AppDelegate.showAlertMsg(withViewController: self, message: error.localizedDescription) } else { AppDelegate.showAlertMsg(withViewController: self, message: "Email was updated. You have to login again.") self.logout() } } } alert.addAction(cancelAction) alert.addAction(confirmAction) self.present(alert, animated: true, completion: nil) } private func syncWithAccountEmail() { let alert = UIAlertController(title: "Please enter the data", message: nil, preferredStyle: .alert) alert.addTextField { (textField: UITextField) in textField.placeholder = "Email" textField.clearButtonMode = .whileEditing } alert.addTextField { (textField: UITextField) in textField.placeholder = "Password" textField.clearButtonMode = .whileEditing textField.isSecureTextEntry = true } let cancelAction = UIAlertAction(title: "Cancel", style: .destructive, handler: nil) let confirmAction = UIAlertAction(title: "Confirm", style: .default) { (action: UIAlertAction) in let emailTextField = alert.textFields![0] let passwordTextField = alert.textFields![1] guard let currentUser = FIRAuth.auth()?.currentUser else { return } let credential = FIREmailPasswordAuthProvider.credential(withEmail: emailTextField.text!, password: passwordTextField.text!) currentUser.link(with: credential, completion: { (user, error) in if let error = error { AppDelegate.showAlertMsg(withViewController: self, message: error.localizedDescription) return } AppDelegate.showAlertMsg(withViewController: self, message: "Twitter's account has been synced with \(emailTextField.text!).") self.logout() }) } alert.addAction(cancelAction) alert.addAction(confirmAction) self.present(alert, animated: true, completion: nil) } private func deleteAccount() { if let user = FIRAuth.auth()?.currentUser { let alert = UIAlertController(title: "Delete Account", message: "[\(user.email!)] will be deleted. This operation can not undo. Are you sure?", preferredStyle: .alert) let cancelAction = UIAlertAction(title: "Cancel", style: .destructive, handler: nil) let confirmAction = UIAlertAction(title: "Confirm", style: .default) { (action: UIAlertAction) in user.delete { error in if let error = error { AppDelegate.showAlertMsg(withViewController: self, message: error.localizedDescription) } else { AppDelegate.showAlertMsg(withViewController: self, message: "[\(user.email!)] was deleted.") self.logout() } } } alert.addAction(cancelAction) alert.addAction(confirmAction) self.present(alert, animated: true, completion: nil) } } private func sentVerifiedEmail() { if let user = FIRAuth.auth()?.currentUser { user.sendEmailVerification() { error in if let error = error { AppDelegate.showAlertMsg(withViewController: self, message: error.localizedDescription) } else { AppDelegate.showAlertMsg(withViewController: self, message: "Email verification has been sent to [\(user.email!)]. Please check your email and verify it. Then login again.") self.logout() } } } } }
[ -1 ]
d3c80a535a12ab2b11235968162216ce3e55376a
853f4f2fc9e6a38a5dd710d42dd5f9fbacea2e52
/main/Porcelain/CoreData/Treatment+CoreDataClass.swift
631761b1ba5026d57cba80723edf193d5e10ec2d
[]
no_license
Deliverable-Services/ios-webview
9fe418258a53c28e4f22ea6068e4a8bf152d87b5
04525ce7eeadda1badec9ea84853587706a511a1
refs/heads/master
2023-06-07T01:53:35.533275
2021-07-05T19:00:40
2021-07-05T19:00:40
377,539,472
0
0
null
null
null
null
UTF-8
Swift
false
false
4,603
swift
// // Treatment+CoreDataClass.swift // Porcelain // // Created by Justine Angelo Rangel on 11/6/19. // Copyright © 2019 R4pid Inc. All rights reserved. // // import Foundation import CoreData import R4pidKit import SwiftyJSON @objc(Treatment) public class Treatment: NSManagedObject { /// get services not from branch or appointemnt public static func getTreatments(serviceIDs: [String]? = nil, inMOC: NSManagedObjectContext = .main) -> [Treatment] { var predicates: [CoreDataRecipe.Predicate] = [] if let serviceIDs = serviceIDs, !serviceIDs.isEmpty { if serviceIDs.count == 1, let serviceID = serviceIDs.first { predicates.append(.isEqual(key: "serviceID", value: serviceID)) } else { predicates.append(.isEqualIn(key: "serviceID", values: serviceIDs)) } } return CoreDataUtil.list(Treatment.self, predicate: .compoundAnd(predicates: predicates), sorts: [.custom(key: "name", isAscending: true)], inMOC: inMOC) } /// get service not from branch or appointment public static func getTreatment(id: String, inMOC: NSManagedObjectContext = .main) -> Treatment? { return getTreatments(serviceIDs: [id], inMOC: inMOC).first } /// generic update from json data public func updateFromData(_ data: JSON) { serviceID = data.serviceID.string name = data.name.string displayName = data.displayName.string price = data.price.string duration = data.duration.string categoryID = data.categoryID.string categoryName = data.category.name.string isVisible = data.visible.boolValue image = data.imageCustomerapp.string desc = data.description.string award = data.award.array?.compactMap({ $0.string }) afterCare = data.afterCare.array?.compactMap({ $0.string }) benefits = data.benefits.array?.compactMap({ $0.string }) procedure = data.procedure.array?.compactMap({ $0.string }) notSuitableFor = data.notSuitableFor.array?.compactMap({ $0.string }) suitableFor = data.suitableFor.array?.compactMap({ $0.string }) permalink = data.permalink.string } public static func parseTreatmentsFromData(_ data: JSON, inMOC: NSManagedObjectContext) { var treatmentCenters: [String: [String]] = [:] // [serviceID: [centerID]] var treatmentArray: [JSON] = [] var centerTreatments: [String: [Any]] = [:] data.array?.forEach { (data) in guard let serviceID = data.serviceID.string else { return } if let centerID = data.centerID.string { //parse treatment if var centerIDs = treatmentCenters[serviceID] { centerIDs.append(centerID) treatmentCenters[serviceID] = centerIDs } else { treatmentCenters[serviceID] = [centerID] } //parse service treatment if var services = centerTreatments[centerID] { services.append(data.rawValue) centerTreatments[centerID] = services } else { centerTreatments[centerID] = [data.rawValue] } } guard !treatmentArray.contains(where: { $0.serviceID.string == serviceID }) else { return } treatmentArray.append(data) } //parse treatment let serviceIDs = treatmentArray.compactMap({ $0.serviceID.string }) let deprecatedServices = CoreDataUtil.list(Treatment.self, predicate: .notEqualIn(key: "serviceID", values: serviceIDs), inMOC: inMOC) CoreDataUtil.deleteEntities(deprecatedServices, inMOC: inMOC) let treatments = CoreDataUtil.list(Treatment.self, predicate: .isEqualIn(key: "serviceID", values: serviceIDs), inMOC: inMOC) treatmentArray.forEach { (data) in guard let serviceID = data.serviceID.string else { return } guard let treatment = parseTreatmentFromData(data, treatments: treatments, inMOC: inMOC) else { return } treatment.centerIDs = treatmentCenters[serviceID] } //parse service treatment centerTreatments.keys.forEach { (centerID) in guard let services = centerTreatments[centerID] else { return } Service.parseCenterServicesFromData(JSON(services), centerID: centerID, type: .treatment, inMOC: inMOC) } } @discardableResult public static func parseTreatmentFromData(_ data: JSON, treatments: [Treatment], inMOC: NSManagedObjectContext) -> Treatment? { guard let serviceID = data.serviceID.string else { return nil } let currentTreatment = treatments.first(where: { $0.serviceID == serviceID }) let treatment = CoreDataUtil.createEntity(Treatment.self, fromEntity: currentTreatment, inMOC: inMOC) treatment.updateFromData(data) return treatment } }
[ -1 ]
23eb45b87062bc07684d70c130ec5d0574544ff4
2152847eca492c96f0dfc3b00030489e13fa3f1d
/ClientesCrud/AppDelegate.swift
65db112dc027acee08e1452d396daf7c511602ee
[]
no_license
zelucasr/CustomerCrud
3b5d05ba8471ecc7ae0cf98c961c09ded5d35416
ef0a9d0c24bd02032d054b818dd7d050668a4f36
refs/heads/master
2022-11-29T15:06:49.368092
2020-08-10T12:26:43
2020-08-10T12:26:43
286,460,765
0
0
null
null
null
null
UTF-8
Swift
false
false
3,710
swift
// // AppDelegate.swift // ClientesCrud // // Created by Jose Lucas on 09/08/20. // Copyright © 2020 Jose Lucas. All rights reserved. // import UIKit import CoreData @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } // MARK: - Core Data stack lazy var persistentContainer: NSPersistentContainer = { /* The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. */ let container = NSPersistentContainer(name: "ClientesCrud") container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. /* Typical reasons for an error here include: * The parent directory does not exist, cannot be created, or disallows writing. * The persistent store is not accessible, due to permissions or data protection when the device is locked. * The device is out of space. * The store could not be migrated to the current model version. Check the error message to determine what the actual problem was. */ fatalError("Unresolved error \(error), \(error.userInfo)") } }) return container }() // MARK: - Core Data Saving support func saveContext () { let context = persistentContainer.viewContext if context.hasChanges { do { try context.save() } catch { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. let nserror = error as NSError fatalError("Unresolved error \(nserror), \(nserror.userInfo)") } } } }
[ 199680, 379906, 253443, 418820, 328199, 384007, 249351, 377866, 372747, 326668, 379914, 199180, 329233, 349202, 186387, 350738, 262677, 330774, 324121, 245274, 377371, 345630, 340511, 384032, 362529, 349738, 394795, 404523, 262701, 245293, 349744, 361524, 337975, 343609, 375867, 333373, 418366, 152127, 339009, 413250, 214087, 352840, 337994, 377930, 370253, 330319, 200784, 173647, 436306, 333395, 244308, 374358, 329815, 254042, 402522, 326239, 322658, 340579, 244329, 333422, 349295, 204400, 173169, 339571, 330868, 344693, 268921, 343167, 192639, 344707, 330884, 336516, 266374, 385670, 346768, 268434, 409236, 333988, 336548, 379048, 377001, 356520, 361644, 402614, 361655, 339132, 325308, 343231, 403138, 337092, 244933, 322758, 337606, 367816, 257738, 342736, 245460, 257751, 385242, 366300, 165085, 350433, 345826, 328931, 395495, 363755, 343276, 346348, 338158, 325358, 212722, 251122, 350453, 338679, 393465, 351482, 264961, 115972, 268552, 346890, 336139, 328460, 362251, 333074, 356628, 257814, 333592, 397084, 342813, 257824, 362272, 377120, 334631, 336680, 389416, 384298, 254252, 204589, 271150, 366383, 328497, 257842, 339768, 326969, 257852, 384828, 204606, 386365, 375615, 339792, 358737, 389970, 361299, 155476, 366931, 257880, 330584, 361305, 362843, 429406, 374112, 353633, 439137, 355184, 361333, 332156, 337277, 260992, 245120, 380802, 389506, 264583, 337290, 155020, 337813, 250262, 348565, 155044, 333221, 373671, 333736, 252845, 356781, 288174, 268210, 370610, 342452, 210356, 370102, 338362, 327612, 358335, 380352, 201157, 187334, 333766, 336325, 339400, 349128, 358347, 393670, 347081, 272848, 379856, 155603, 219091, 399317, 249302, 379863, 372697, 155102, 329182, 182754, 360429, 338927, 330224, 379895, 201723, 257020, 254461 ]
438790770936d9de6ec513df3e67977fd110b519
4cdf5818d859f2c6f408f5041f310bedde332da1
/06-Swift初体验.playground/Contents.swift
9e872b79d0b422472f07c9aa9d77b423cd5b25bc
[]
no_license
codetiantian/SwiftLearn
cc5a98b85919f21c55674e33783f0699f57a7351
c7044d403270f767858471b7d93d07899ea530e3
refs/heads/master
2023-05-27T08:08:19.380413
2017-06-06T07:19:17
2017-06-06T07:19:17
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,076
swift
//: Playground - noun: a place where people can play import UIKit //------------类属性的监听------------ class Person { var name : String = "" { // 监听属性即将发生改变,还没有改变 willSet{ // print(newValue) print(name) } // 监听属性已经发生改变,已经改变 didSet{ // print(oldValue) print(name) } } } let p = Person() p.name = "CBB" //p.name = "YTT" // ---------类的构造函数--------- class Student { var name : String = "" var age : Int = 0 // 在Swift开发中,如果在对象函数中,用到成员属性,那么self.可以省略 // 注意:如果在函数中,有和成员属性重名的局部变量,那么self.不能省略 // 注意:如果有自定义构造函数,那么会将系统提供的构造函数覆盖掉 init(name : String, age : Int) { self.name = name; self.age = age; } init(dict : [String : Any]) { if let name = dict["name"] as? String { self.name = name } if let age = dict["age"] as? Int { self.age = age } } } let stu = Student.init(name: "cui", age: 18) let stu1 = Student.init(dict: ["name" : "yan", "age" : 18]) print(stu1.name, stu1.age) // --------KVC------- // 使用KVC的条件 /* 1>必须继承自NSObject 2>必须在构造函数中,先调用super.init() 3>调用setValuesForKeys方法 4>如果字典中某一个key没有对应的属性,则需要重写 setValue forUndefinedKey方法 */ class Person1 : NSObject { var name : String = "" var age : Int = 0 var height : Double = 0 init(dict : [String : Any]) { super.init() setValuesForKeys(dict) } override func setValue(_ value: Any?, forUndefinedKey key: String) { } } let p1 = Person1.init(dict: ["name" : "why", "age" : 18, "height" : 1.88]) print(p1.name, p1.age, p1.height)
[ -1 ]
edf7af58a6798022c7de1bc4872768aa7495df64
6e88b7d271e457088231f5236899f5d3d7b8c68f
/SwiftUIAnimationsMastery-V1/SwiftUIAnimationsMastery/Reusables/View Components/Loaders/ProgressRingView.swift
df461a4eb5170d6d357b654b89daba27ff63cd7d
[]
no_license
fengsiyu/book--swiftui-animations-mastery
b8056ed25cd886ce83f12fb795f3722c4c9b980d
2a65ee1a9693e15d97753ef6036ce117843ffff9
refs/heads/master
2023-06-02T19:17:08.082765
2021-06-06T06:47:49
2021-06-06T06:47:49
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,368
swift
// // ProgressRingView.swift // SwiftUIAnimationsMastery // // Created by Brian Sipple on 5/28/20. // Copyright © 2020 CypherPoet. All rights reserved. // import SwiftUI struct ProgressRingView { var progress: CGFloat var strokeWidth: CGFloat = 10 var trackColor: Color = Color(.systemGray5) var fillColor: Color = .accentColor } // MARK: - Computeds extension ProgressRingView { var strokeStyle: StrokeStyle { .init(lineWidth: strokeWidth, lineCap: .round) } } // MARK: - `View` Body extension ProgressRingView: View { var body: some View { ZStack { Circle() .stroke(trackColor, style: strokeStyle) Circle() .trim(from: 0, to: progress) .stroke(fillColor, style: strokeStyle) .rotationEffect(.radians(-.pi / 2)) } } } // MARK: - View Variables private extension ProgressRingView { } // MARK: - Private Helpers private extension ProgressRingView { } // MARK: - Preview struct ProgressRingView_Previews: PreviewProvider { static var previews: some View { VStack { ProgressRingView(progress: 0.0) ProgressRingView(progress: 0.333) ProgressRingView(progress: 0.5) ProgressRingView(progress: 0.667) ProgressRingView(progress: 1.0) } } }
[ -1 ]
cf248d875788fed7c11f4f1cdc8cfd659e8df1e9
6f64a27fbb9acfae5ecabfeda673073181d74652
/Sources/RandomKit/Types/RandomWithinClosedRange.swift
e4d750cbbd2f37412c20105895a4d83e966da8de
[ "MIT" ]
permissive
phimage/RandomKit
b94882d138b19379aaff7766a680cb5800fa28f2
ce76f33c634531436d95c3c799e1225913079b11
refs/heads/master
2020-04-05T12:32:23.987447
2016-10-25T21:17:42
2016-10-25T21:17:42
68,220,813
0
1
null
2016-09-14T15:59:14
2016-09-14T15:59:14
null
UTF-8
Swift
false
false
4,077
swift
// // RandomWithinClosedRange.swift // RandomKit // // The MIT License (MIT) // // Copyright (c) 2015-2016 Nikolai Vazquez // // 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, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // /// A type that can generate an random value from within a closed range. public protocol RandomWithinClosedRange: Random, Comparable { /// Returns a random value of `Self` inside of the closed range using `randomGenerator`. static func random(within closedRange: ClosedRange<Self>, using randomGenerator: RandomGenerator) -> Self } extension RandomWithinClosedRange { /// Returns a random value of `Self` inside of the closed range using the default generator. public static func random(within closedRange: ClosedRange<Self>) -> Self { return random(within: closedRange, using: .default) } /// Returns an iterator for infinite random values of `Self` within the closed range. public static func randomIterator(within closedRange: ClosedRange<Self>, using randomGenerator: RandomGenerator = .default) -> AnyIterator<Self> { return AnyIterator { random(within: closedRange, using: randomGenerator) } } /// Returns an iterator for random values of `Self` within the closed range within `maxCount`. public static func randomIterator(within closedRange: ClosedRange<Self>, maxCount: Int, using randomGenerator: RandomGenerator = .default) -> AnyIterator<Self> { var n = 0 return AnyIterator { guard n != maxCount else { return nil } let value = random(within: closedRange, using: randomGenerator) n += 1 return value } } /// Returns a sequence of infinite random values of `Self` within the closed range. public static func randomSequence(within closedRange: ClosedRange<Self>, using randomGenerator: RandomGenerator = .default) -> AnySequence<Self> { return AnySequence(randomIterator(within: closedRange, using: randomGenerator)) } /// Returns a sequence of random values of `Self` within the closed range within `maxCount`. public static func randomSequence(within closedRange: ClosedRange<Self>, maxCount: Int, using randomGenerator: RandomGenerator = .default) -> AnySequence<Self> { return AnySequence(randomIterator(within: closedRange, maxCount: maxCount, using: randomGenerator)) } } extension RandomWithinClosedRange where Self: _Strideable & Comparable, Self.Stride : SignedInteger { /// Returns a random value of `Self` inside of the closed range. public static func random(within closedRange: CountableClosedRange<Self>, using randomGenerator: RandomGenerator = .default) -> Self { return random(within: ClosedRange(closedRange), using: randomGenerator) } }
[ 290128, 290129, 290115, 290131 ]
a97ddf8e39e81357f9b20c0025c9c26190850303
3e402f535e368eaf73f9b3c448fb7723fbf9da6d
/SmarcHome/Core/View/SmarcSwitch/SmarcSwitch.swift
c8a0cd1e57e264c5f9f326d5a7a13bf302df2a96
[ "MIT" ]
permissive
ibrahim-sakr/smarc_app_swift
63785007b0d187b2f3342d674152ebecb6ec5c33
36bc8f2af564637d150128435a07e6a70644ec92
refs/heads/master
2020-03-08T21:55:30.357426
2018-05-28T06:10:48
2018-05-28T06:10:48
null
0
0
null
null
null
null
UTF-8
Swift
false
false
11,070
swift
// // SmarcSwitch.swift // SmarcHome // // Created by Ibrahim Saqr on 5/3/18. // Copyright © 2018 Ibrahim Saqr. All rights reserved. // import UIKit @IBDesignable final class SmarcSwitch: UIControl { // Public properties @IBInspectable public var animationDuration: Double = 0.3 @IBInspectable public var isOn:Bool = true @IBInspectable public var padding: CGFloat = 1 { didSet { self.layoutSubviews() } } @IBInspectable public var onTintColor: UIColor = UIColor(red: 144/255, green: 202/255, blue: 119/255, alpha: 1) { didSet { self.setupUI() } } @IBInspectable public var offTintColor: UIColor = UIColor.black { didSet { self.setupUI() } } @IBInspectable public var cornerRadius: CGFloat { get { return self.privateCornerRadius } set { if newValue > 0.5 || newValue < 0.0 { privateCornerRadius = 0.5 } else { privateCornerRadius = newValue } } } private var privateCornerRadius: CGFloat = 0.5 { didSet { self.layoutSubviews() } } // thumb properties @IBInspectable public var thumbTintColor: UIColor = UIColor.white { didSet { self.thumbView.backgroundColor = self.thumbTintColor } } @IBInspectable public var thumbCornerRadius: CGFloat { get { return self.privateThumbCornerRadius } set { if newValue > 0.5 || newValue < 0.0 { privateThumbCornerRadius = 0.5 } else { privateThumbCornerRadius = newValue } } } private var privateThumbCornerRadius: CGFloat = 0.5 { didSet { self.layoutSubviews() } } @IBInspectable public var thumbSize: CGSize = CGSize.zero { didSet { self.layoutSubviews() } } @IBInspectable public var thumbImage:UIImage? = nil { didSet { guard let image = thumbImage else { return } thumbView.thumbImageView.image = image } } public var onImage:UIImage? { didSet { self.onImageView.image = onImage self.layoutSubviews() } } public var offImage:UIImage? { didSet { self.offImageView.image = offImage self.layoutSubviews() } } // dodati kasnije @IBInspectable public var thumbShadowColor: UIColor = UIColor.black { didSet { self.thumbView.layer.shadowColor = self.thumbShadowColor.cgColor } } @IBInspectable public var thumbShadowOffset: CGSize = CGSize(width: 0.75, height: 2) { didSet { self.thumbView.layer.shadowOffset = self.thumbShadowOffset } } @IBInspectable public var thumbShaddowRadius: CGFloat = 1.5 { didSet { self.thumbView.layer.shadowRadius = self.thumbShaddowRadius } } @IBInspectable public var thumbShaddowOppacity: Float = 0.4 { didSet { self.thumbView.layer.shadowOpacity = self.thumbShaddowOppacity } } // labels private var labelOnOrigin: UILabel = UILabel() private var labelOffOrigin: UILabel = UILabel() @IBInspectable public var labelOff: String = "Off" { didSet { self.setupUI() } } @IBInspectable public var labelOn: String = "On" { didSet { self.setupUI() } } @IBInspectable public var areLabelsShown: Bool = true { didSet { self.setupUI() } } // Private properties fileprivate var thumbView = SmarcThumbView(frame: CGRect.zero) fileprivate var onImageView = UIImageView(frame: CGRect.zero) fileprivate var offImageView = UIImageView(frame: CGRect.zero) fileprivate var onPoint = CGPoint.zero fileprivate var offPoint = CGPoint.zero fileprivate var isAnimating = false required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) self.setupUI() } override init(frame: CGRect) { super.init(frame: frame) self.setupUI() } } // Private methods extension SmarcSwitch { fileprivate func setupUI() { // clear self before configuration self.clear() self.clipsToBounds = false // configure thumb view self.thumbView.backgroundColor = self.thumbTintColor self.thumbView.isUserInteractionEnabled = false // dodati kasnije self.thumbView.layer.shadowColor = self.thumbShadowColor.cgColor self.thumbView.layer.shadowRadius = self.thumbShaddowRadius self.thumbView.layer.shadowOpacity = self.thumbShaddowOppacity self.thumbView.layer.shadowOffset = self.thumbShadowOffset self.backgroundColor = self.isOn ? self.onTintColor : self.offTintColor self.addSubview(self.thumbView) self.addSubview(self.onImageView) self.addSubview(self.offImageView) self.setupLabels() } private func clear() { for view in self.subviews { view.removeFromSuperview() } } override func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { super.beginTracking(touch, with: event) self.animate() return true } func setOn(on:Bool, animated:Bool) { switch animated { case true: self.animate(on: on) case false: self.isOn = on self.setupViewsOnAction() self.completeAction() } } fileprivate func animate(on:Bool? = nil) { self.isOn = on ?? !self.isOn self.isAnimating = true UIView.animate(withDuration: self.animationDuration, delay: 0, usingSpringWithDamping: 0.7, initialSpringVelocity: 0.5, options: [UIViewAnimationOptions.curveEaseOut, UIViewAnimationOptions.beginFromCurrentState, UIViewAnimationOptions.allowUserInteraction], animations: { self.setupViewsOnAction() }, completion: { _ in self.completeAction() }) } private func setupViewsOnAction() { self.thumbView.frame.origin.x = self.isOn ? self.onPoint.x : self.offPoint.x self.backgroundColor = self.isOn ? self.onTintColor : self.offTintColor self.setOnOffImageFrame() } private func completeAction() { self.isAnimating = false self.sendActions(for: UIControlEvents.valueChanged) } } // Public methods extension SmarcSwitch { public override func layoutSubviews() { super.layoutSubviews() if !self.isAnimating { self.layer.cornerRadius = self.bounds.size.height * self.cornerRadius self.backgroundColor = self.isOn ? self.onTintColor : self.offTintColor // thumb managment // get thumb size, if none set, use one from bounds let thumbSize = self.thumbSize != CGSize.zero ? self.thumbSize : CGSize(width: self.bounds.size.height - 2, height: self.bounds.height - 2) let yPostition = (self.bounds.size.height - thumbSize.height) / 2 self.onPoint = CGPoint(x: self.bounds.size.width - thumbSize.width - self.padding, y: yPostition) self.offPoint = CGPoint(x: self.padding, y: yPostition) self.thumbView.frame = CGRect(origin: self.isOn ? self.onPoint : self.offPoint, size: thumbSize) self.thumbView.layer.cornerRadius = thumbSize.height * self.thumbCornerRadius //label frame if self.areLabelsShown { let labelWidth = self.bounds.width / 2 - self.padding * 2 self.labelOnOrigin.frame = CGRect(x: 0, y: 0, width: labelWidth, height: self.frame.height) self.labelOffOrigin.frame = CGRect(x: self.frame.width - labelWidth, y: 0, width: labelWidth, height: self.frame.height) } // on/off images //set to preserve aspect ratio of image in thumbView guard onImage != nil && offImage != nil else { return } let frameSize = thumbSize.width > thumbSize.height ? thumbSize.height * 0.7 : thumbSize.width * 0.7 let onOffImageSize = CGSize(width: frameSize, height: frameSize) self.onImageView.frame.size = onOffImageSize self.offImageView.frame.size = onOffImageSize self.onImageView.center = CGPoint(x: self.onPoint.x + self.thumbView.frame.size.width / 2, y: self.thumbView.center.y) self.offImageView.center = CGPoint(x: self.offPoint.x + self.thumbView.frame.size.width / 2, y: self.thumbView.center.y) self.onImageView.alpha = self.isOn ? 1.0 : 0.0 self.offImageView.alpha = self.isOn ? 0.0 : 1.0 } } } // Labels frame extension SmarcSwitch { fileprivate func setupLabels() { guard self.areLabelsShown else { self.labelOffOrigin.alpha = 0 self.labelOnOrigin.alpha = 0 return } self.labelOffOrigin.alpha = 1 self.labelOnOrigin.alpha = 1 let labelWidth = self.bounds.width / 2 - self.padding * 2 self.labelOnOrigin.frame = CGRect(x: 0, y: 0, width: labelWidth, height: self.frame.height) self.labelOffOrigin.frame = CGRect(x: self.frame.width - labelWidth, y: 0, width: labelWidth, height: self.frame.height) self.labelOnOrigin.font = UIFont.boldSystemFont(ofSize: 12) self.labelOffOrigin.font = UIFont.boldSystemFont(ofSize: 12) self.labelOnOrigin.textColor = UIColor.white self.labelOffOrigin.textColor = UIColor.white self.labelOffOrigin.sizeToFit() self.labelOffOrigin.text = self.labelOff self.labelOnOrigin.text = self.labelOn self.labelOffOrigin.textAlignment = .center self.labelOnOrigin.textAlignment = .center self.insertSubview(self.labelOffOrigin, belowSubview: self.thumbView) self.insertSubview(self.labelOnOrigin, belowSubview: self.thumbView) } } // Animating on/off images extension SmarcSwitch { fileprivate func setOnOffImageFrame() { guard onImage != nil && offImage != nil else { return } self.onImageView.center.x = self.isOn ? self.onPoint.x + self.thumbView.frame.size.width / 2 : self.frame.width self.offImageView.center.x = !self.isOn ? self.offPoint.x + self.thumbView.frame.size.width / 2 : 0 self.onImageView.alpha = self.isOn ? 1.0 : 0.0 self.offImageView.alpha = self.isOn ? 0.0 : 1.0 } }
[ -1 ]
6f0b86f42b5cebf73aa7ac2aba687424347c3987
0ef20fa7da445402e9deca9e91743ab1d0ebbf56
/KumiTests/Shadow/ShadowStyleTests.swift
1fbfda238472a7ba52dbc92a07425d470566c79a
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
HafsakhanTD/Kumi-iOS
c4c8faceccf10504fa0eff156429670a94fb5c1e
8d83081dc39244d285cc74b6efbb5495451ea74e
refs/heads/master
2023-03-16T18:33:48.027548
2020-06-05T23:19:57
2020-06-05T23:19:57
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,036
swift
// // TextStyleTests.swift // Kumi // // Created by Thibault Klein on 4/28/17. // Copyright © 2017 Prolific Interactive. All rights reserved. // import XCTest import Marker @testable import Kumi class ShadowStyleTests: XCTestCase { var shadowStyle: ShadowStyle! override func setUp() { super.setUp() do { let shadowStyleJSON = try JSONHelper.getJSON("ShadowStyle") shadowStyle = ShadowStyle(json: shadowStyleJSON) } catch let error { XCTFail(error.localizedDescription) } } override func tearDown() { shadowStyle = nil super.tearDown() } func testShadowStyleJSONCreation() { XCTAssertEqual(shadowStyle.shadowOpacity, 1.0) XCTAssertEqual(shadowStyle.shadowRadius, 14) XCTAssertEqual(shadowStyle.shadowOffset.width, 0.0) XCTAssertEqual(shadowStyle.shadowOffset.height, 7.0) XCTAssertEqual(shadowStyle.shadowColor, UIColor(red: 1, green: 0, blue: 0, alpha: 1).cgColor) } }
[ -1 ]
33eec4cde2970be0933e80858d320dd4adcc6d72
24031be294469f2d7090080dfb61411fc53d79fe
/BFSMeeting.playground/Contents.swift
e41773f0d7a9964aefad42923a6f1fbb89fa7cf4
[]
no_license
xiangyu-sun/algrithm-playgrounds
024a08ed98dd1a0b95e8677b2c4e3f1ff0b8a596
a903dd57809f0d1e7619974862f2758e03c7c0d8
refs/heads/master
2020-07-03T23:17:11.477677
2020-02-12T11:51:32
2020-02-12T11:51:32
202,083,409
0
0
null
null
null
null
UTF-8
Swift
false
false
2,999
swift
import Foundation struct Point: CustomDebugStringConvertible { let row: Int let column: Int let distance: Int var debugDescription: String { return "\(row) - \(column)" } } func shortestDistance(_ grid: [[Int]]) -> Int { var distance = [Int.max] let totalBuildings = numberOfBuildings(grid: grid) for row in 0..<grid.count { for column in 0..<grid[0].count { let current = distanceOf(grid: grid, startRow: row, startColumn: column) guard totalBuildings == current.count else { continue } let sum = current.reduce(0, +) if sum != 0, sum < distance.reduce(0, +) { distance = current } } } let minDist = distance.reduce(0, +) guard totalBuildings == distance.count else { return -1 } guard minDist != 0 else { return -1 } guard minDist != Int.max else { return -1 } return minDist } func numberOfBuildings(grid: [[Int]]) -> Int { var totalBuildings = 0 for row in 0..<grid.count { for column in 0..<grid[0].count { if grid[row][column] == 1 { totalBuildings += 1 } } } return totalBuildings } func distanceOf(grid: [[Int]], startRow: Int, startColumn: Int) -> [Int] { guard grid[startRow][startColumn] < 1 else { return [Int.max] } var visitTable = [[Bool]](repeating: [Bool](repeating: false, count: grid[0].count), count: grid.count) var q: [Point] = [] let startingPoint = Point(row: startRow, column: startColumn, distance: 0) q.append(startingPoint) var totalDistance = [Int]() while !q.isEmpty { let currentPoint = q.removeFirst() guard currentPoint.column < grid[0].count && currentPoint.row < grid.count, currentPoint.row >= 0, currentPoint.column >= 0 else { continue } guard grid[currentPoint.row][currentPoint.column] != 2 else { continue } guard !visitTable[currentPoint.row][currentPoint.column] else { continue } visitTable[currentPoint.row][currentPoint.column] = true if grid[currentPoint.row][currentPoint.column] == 1 { totalDistance.append(currentPoint.distance) } else { q.append(contentsOf: [ Point(row: currentPoint.row + 1, column: currentPoint.column, distance: currentPoint.distance + 1), Point(row: currentPoint.row - 1, column: currentPoint.column, distance: currentPoint.distance + 1), Point(row: currentPoint.row, column: currentPoint.column + 1, distance: currentPoint.distance + 1), Point(row: currentPoint.row, column: currentPoint.column - 1, distance: currentPoint.distance + 1) ]) } } return totalDistance } shortestDistance([[1,1,1,1,1,0],[0,0,0,0,0,1],[0,1,1,0,0,1],[1,0,0,1,0,1],[1,0,1,0,0,1],[1,0,0,0,0,1],[0,1,1,1,1,0]])
[ -1 ]
88f712a7561dee475558d4b48268ea4bd74bc888
99fcc51d021deed2d72a54ed821652e93b00961d
/Gaming Network StatusTests/Gaming_Network_StatusTests.swift
bed45b7f465e60857c0adc65586ce69e88818d8a
[]
no_license
eriksantana-io/Gaming-Network-Status
df7e1bca6d588d273c9800d19726f41b244afaf1
f0278ffc7c1aa756d52c7e82e33f993551281d4b
refs/heads/master
2023-08-05T05:22:19.787739
2015-02-03T21:46:19
2015-02-03T21:46:19
null
0
0
null
null
null
null
UTF-8
Swift
false
false
944
swift
// // Gaming_Network_StatusTests.swift // Gaming Network StatusTests // // Created by Erik Santana on 1/29/15. // Copyright (c) 2015 Erik Santana. All rights reserved. // import Cocoa import XCTest class Gaming_Network_StatusTests: 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 here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. XCTAssert(true, "Pass") } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock() { // Put the code you want to measure the time of here. } } }
[ 276492, 159807, 276543, 280649, 223318, 227417, 288857, 194652, 276577, 43109, 276582, 276585, 223340, 276589, 227439, 276592, 276603, 276606, 141450, 311435, 276627, 184475, 196773, 129203, 176314, 227528, 278742, 278746, 276709, 276710, 276715, 157944, 227576, 276753, 276760, 278810, 262450, 278846, 164162, 278863, 276821, 276835, 276847, 278898, 178571, 278954, 278965, 276920, 278969, 278985, 227813, 279022, 186893, 223767, 223769, 277017, 277029, 301634, 369220, 277066, 166507, 277101, 277118, 184962, 225933, 225936, 277138, 277142, 164512, 225956, 225962, 209581, 154291, 154294, 199366, 225997, 164563, 277204, 119513, 201442, 209660, 234241, 226051, 209670, 277254, 234256, 234268, 105246, 228129, 234280, 234283, 234286, 234301, 234304, 162626, 234311, 234312, 234317, 277327, 234323, 234326, 277339, 234335, 234340, 234343, 234346, 234349, 277360, 213876, 277366, 234361, 234367, 234372, 234377, 234381, 226194, 234387, 234392, 279456, 277410, 234404, 234409, 234412, 234419, 234430, 275397, 234438, 226249, 234450, 234451, 234454, 234457, 275418, 234463, 234466, 179176, 234482, 234492, 277505, 234498, 277510, 234503, 234506, 234509, 277517, 197647, 277518, 295953, 234517, 281625, 234530, 234534, 275495, 234539, 275500, 310317, 277550, 275505, 234548, 277563, 7229, 7230, 7231, 156733, 234560, 277566, 234565, 234569, 207953, 277585, 296018, 234583, 234584, 275547, 277596, 234594, 234603, 281707, 234612, 398457, 234622, 275590, 234631, 253063, 277640, 302217, 226451, 275607, 119963, 234652, 275625, 208043, 226479, 195811, 285929, 204041, 199971, 277800, 277803, 113966, 277806, 226608, 226609, 277821, 277824, 277825, 277831, 226632, 277838, 277841, 222548, 277844, 277845, 224605, 224606, 142689, 277862, 173420, 277868, 277871, 279919, 277882, 142716, 275838, 275839, 277890, 277891, 275847, 277896, 277897, 230799, 296338, 277907, 206228, 226711, 226712, 277927, 277936, 277939, 296375, 277946, 277949, 296387, 277962, 282060, 277965, 277974, 228823, 228824, 277977, 277980, 277983, 277988, 277993, 277994, 296425, 277997, 278002, 153095, 192010, 65041, 204313, 278060, 276046, 243292, 276088, 278140, 276097, 276100, 276101, 278160, 276116, 276117, 276120, 278170, 280220, 276126, 278191, 278195, 276148, 296628, 278201, 276156, 278214, 323276, 276179, 276180, 216795, 216796, 276195, 313065, 276210, 276219, 227091, 184086, 278299, 276257, 278307, 288547, 276279, 276282, 276283, 276287, 276311, 276332, 110452, 44952, 247712, 276394, 276401, 276408, 161722, 276413, 153552, 278518 ]
d6739f5c0ee04f771e69e6aa3e016467486fd0fa
42f310f5cd4312c6e4b29aed537d2f35e8ef5b89
/Carthage/Checkouts/APIKit/Sources/SessionAdapterType/SessionAdapterType.swift
46f4cde23a10af824e09760ceb38f616ca008f76
[ "MIT" ]
permissive
simorgh3196/GitHubSearchApp
ebcab83f7d80004fbb69b4d0eb895d021ebe1646
086e95f0fe857062784dba77ac9532a94094cb00
refs/heads/master
2022-12-14T00:01:20.567551
2016-06-15T07:02:15
2016-06-15T07:02:15
60,826,163
0
0
MIT
2022-12-08T02:29:45
2016-06-10T05:32:25
Swift
UTF-8
Swift
false
false
852
swift
import Foundation /// `SessionTaskType` protocol represents a task for a request. public protocol SessionTaskType: class { func resume() func cancel() } /// `SessionAdapterType` protocol provides interface to connect lower level networking backend with `Session`. /// APIKit provides `NSURLSessionAdapter`, which conforms to `SessionAdapterType`, to connect `NSURLSession` /// with `Session`. public protocol SessionAdapterType { /// Returns instance that conforms to `SessionTaskType`. `handler` must be called after success or failure. func createTaskWithURLRequest(URLRequest: NSURLRequest, handler: (NSData?, NSURLResponse?, ErrorType?) -> Void) -> SessionTaskType /// Collects tasks from backend networking stack. `handler` must be called after collecting. func getTasksWithHandler(handler: [SessionTaskType] -> Void) }
[ -1 ]
0c76a922990c27a743f0c6a32831a4615a2078a6
3ad10d845cc567b486dde6f5f8ee2f2aea2db759
/peliculas/ViewController.swift
4cfaa679886657ad58e0151ec098754c7995bf3f
[]
no_license
guitarrkurt/peliTableViewHourOfCode
592765ffc4e86d5b77a5c0050302b41cae9a5492
5357d6480b56b43f2b40899b178fc29a2a745047
refs/heads/master
2021-01-10T11:00:14.463409
2015-12-07T18:57:15
2015-12-07T18:57:15
47,571,258
0
0
null
null
null
null
UTF-8
Swift
false
false
1,531
swift
// // ViewController.swift // peliculas // // Created by guitarrkurt on 07/12/15. // Copyright © 2015 guitarrkurt. All rights reserved. // import UIKit class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { var array = ["avatar.jpg","batman.jpg","civilwar.jpg","dory.jpg","intensamente.jpg","leon.jpg","sinsajo.jpg","starwars.jpg","toystory.jpg","xmen.jpg"] override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } internal func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int{ return array.count } internal func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{ let cell = tableView.dequeueReusableCellWithIdentifier("CellPeli", forIndexPath: indexPath) as! PeliculaTableViewCell cell.imagen.image = UIImage(named: array[indexPath.row]) cell.etiqueta.text = array[indexPath.row] return cell } internal func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath){ let alert = UIAlertView() alert.title = "😎 Selecciono:" alert.message = array[indexPath.row] alert.addButtonWithTitle("Ok 😀") alert.show() } }
[ -1 ]
dfdbf7c9ef7efd10123060f4394d6a8d6f5883fa
45584d0d96f10c76ce5a83bdd373db9ae0ecd50d
/SleepBusters/ViewControllers/TabBarController.swift
bb233caf8bc222aea83418789906df3c0f919d91
[]
no_license
chelhuang/SleepBusters
878a942ff94ef0debaeb840e59ee83134bba285c
fed491576964208fba59a9b0fc11d08d7feabaf0
refs/heads/master
2021-01-18T03:00:17.710356
2015-11-06T01:12:57
2015-11-06T01:12:57
44,421,327
0
0
null
2015-10-17T02:46:11
2015-10-17T02:46:11
null
UTF-8
Swift
false
false
585
swift
// // TabBarController.swift // SleepBusters // // Created by Klein on 2015-10-06. // Copyright © 2015 PillowSoft. All rights reserved. // import UIKit class TabBarController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } override func viewDidAppear(animated: Bool) { } }
[ 284336, 279442 ]
b5f7fc604d5751ec7807afab154918e47034fce6
6a476f79b1a313992cfb8325164b0986d4dfa015
/SampleExecutable/AppDelegate.swift
fce1ca5b0e2b01f4a486a6e4a563d90505e60ff7
[]
no_license
smalljd/SampleFramework
a50a5681d23eef4c27ea031184a565009ca3d5b5
cfdd9e88b927b44086f827b2b6c65a62997baf8b
refs/heads/master
2020-03-07T16:17:16.541754
2018-04-01T00:20:15
2018-04-01T00:20:15
127,578,203
0
0
null
null
null
null
UTF-8
Swift
false
false
2,172
swift
// // AppDelegate.swift // SampleExecutable // // Created by Jeff on 3/31/18. // Copyright © 2018 Jeff Small. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 319544, 204856, 229432, 286776, 286778, 352318, 286791, 237640, 278605, 286797, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 131209, 303241, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 320007, 287238, 172552, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 287309, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 189039, 295538, 172660, 189040, 189044, 287349, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 279178, 287371, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 287390, 303773, 164509, 172705, 287394, 172702, 303780, 172707, 287398, 295583, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 279231, 287427, 312005, 312006, 107208, 107212, 172748, 287436, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 279267, 312035, 295654, 279272, 312048, 230128, 312050, 230131, 189169, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303981, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 304007, 320391, 213895, 304009, 304011, 230284, 304013, 279438, 295822, 213902, 189329, 295825, 189331, 304019, 58262, 304023, 279452, 410526, 279461, 279462, 304042, 213931, 304055, 230327, 287675, 197564, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 295949, 230413, 197645, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 296004, 132165, 336964, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 361576, 296040, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 66690, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 165038, 238766, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 291714, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 296264, 238919, 320840, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 181626, 304506, 279929, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 148946, 222676, 288214, 239064, 329177, 288217, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 148990, 321022, 206336, 402942, 296446, 296450, 230916, 230919, 214535, 304651, 370187, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 280276, 313044, 321239, 280283, 18140, 313052, 288478, 313055, 419555, 321252, 313066, 280302, 288494, 280304, 313073, 419570, 288499, 321266, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 304968, 280393, 280402, 173907, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 313340, 239612, 288764, 239617, 313347, 288773, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 215154, 313458, 280691, 149618, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 321740, 313548, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 289111, 248153, 354653, 354656, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 240011, 199051, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 281095, 223752, 338440, 150025, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 297594, 281210, 158347, 264845, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 256716, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 338823, 322440, 314249, 240519, 183184, 240535, 289687, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 306555, 314747, 298365, 290171, 290174, 224641, 281987, 314756, 298372, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282261, 175770, 298651, 323229, 282269, 298655, 323231, 61092, 282277, 306856, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 306904, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 307009, 413506, 241475, 307012, 298822, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 44948, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 217179, 315483, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 307307, 45163, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 241821, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 176311, 299191, 307385, 307386, 258235, 307388, 176316, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 323854, 291089, 282906, 291104, 233766, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 276052, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 127407, 291247, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 315856, 176592, 127440, 315860, 176597, 127447, 283095, 299481, 127449, 176605, 242143, 127455, 291299, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 127480, 233979, 291323, 127485, 291330, 283142, 127494, 135689, 233994, 127497, 127500, 291341, 233998, 127506, 234003, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 135844, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 242450, 234258, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 201557, 185173, 234329, 234333, 308063, 234336, 234338, 349027, 242530, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 201603, 291716, 234373, 316294, 226182, 234375, 308105, 226185, 234379, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 226200, 291742, 234396, 234398, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 234410, 291754, 291756, 324522, 226220, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 324536, 275384, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 234437, 226245, 234439, 234434, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 308291, 316483, 160835, 234563, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 300148, 234614, 398455, 144506, 234618, 275579, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 275606, 275608, 234650, 308379, 234648, 234653, 300189, 119967, 324766, 324768, 283805, 234657, 242852, 234661, 283813, 300197, 234664, 177318, 275626, 234667, 316596, 308414, 300223, 234687, 300226, 308418, 283844, 300229, 308420, 308422, 226500, 234692, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 300289, 292097, 161027, 300292, 300294, 275719, 234760, 300299, 177419, 242957, 283917, 300301, 177424, 275725, 349451, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 284010, 324978, 136562, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 226802, 292338, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 308790, 284215, 316983, 194103, 284218, 194101, 226877, 284223, 284226, 284228, 292421, 226886, 284231, 128584, 243268, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 292433, 284243, 300628, 284245, 194130, 284247, 317015, 235097, 243290, 276053, 284249, 284251, 300638, 284253, 284255, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 325251, 276095, 276098, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 276166, 284358, 358089, 284362, 276170, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 325408, 300832, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 292681, 358224, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 317279, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 358292, 284564, 317332, 284566, 399252, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 292843, 276460, 276464, 178161, 227314, 276466, 325624, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 350218, 292876, 350222, 317456, 276496, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 284739, 325700, 243779, 292934, 243785, 276553, 350293, 350295, 309337, 194649, 227418, 350299, 350302, 227423, 194654, 178273, 309346, 194657, 309348, 350308, 309350, 227426, 309352, 350313, 309354, 301163, 350316, 194660, 227430, 276583, 276590, 350321, 284786, 276595, 301167, 350325, 227440, 350328, 292985, 301178, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 309455, 276689, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 309491, 227571, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 342707, 318132, 154292, 293555, 277173, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 277322, 293706, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 15224, 236408, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 276579, 293811, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 285690, 293882, 244731, 121850, 302075, 293887, 277504, 277507, 277511, 277519, 293908, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 302205, 285821, 392326, 285831, 253064, 302218, 285835, 294026, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 326991, 294223, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 310659, 351619, 294276, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 245191, 310727, 64966, 163272, 277959, 292968, 302541, 277963, 302543, 277966, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 302617, 286233, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 40488, 278057, 294439, 40491, 294440, 294443, 294445, 310831, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 400976, 212560, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 302793, 294601, 343757, 212690, 278227, 286420, 319187, 229076, 286425, 319194, 278235, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 311048, 294664, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 280021, 188252, 237409, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 319390, 237470, 40865, 319394, 294817, 294821, 311209, 180142, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
2f347c2fbc4b7dcee9cb413e6ce85f3650f35a83
82dad5c6901151086987c08486d9ad127f2f2d65
/AZCustomCallout/AppDelegate.swift
64ccd1cad74638300a88196d8fe28f6731a693f1
[ "MIT" ]
permissive
alex4Zero/AZCustomCallout
66291a5e2e6169210ba99e9d118994e1773f8a8d
00e539307c39e2d8aa18a2f4660ed01de37d25e1
refs/heads/master
2020-04-06T07:02:33.890110
2016-09-14T08:24:31
2016-09-14T08:24:31
61,803,778
1
2
null
null
null
null
UTF-8
Swift
false
false
6,160
swift
// // AppDelegate.swift // AZCustomCallout // // Created by Alexander Andronov on 23/06/16. // Copyright © 2016 Alexander Andronov. All rights reserved. // import UIKit import CoreData @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. // Saves changes in the application's managed object context before the application terminates. self.saveContext() } // MARK: - Core Data stack lazy var applicationDocumentsDirectory: URL = { // The directory the application uses to store the Core Data store file. This code uses a directory named "com.alex4Zero.AZCustomCallout.AZCustomCallout" in the application's documents Application Support directory. let urls = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) return urls[urls.count-1] }() lazy var managedObjectModel: NSManagedObjectModel = { // The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model. let modelURL = Bundle.main.url(forResource: "AZCustomCallout", withExtension: "momd")! return NSManagedObjectModel(contentsOf: modelURL)! }() lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator = { // The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. // Create the coordinator and store let coordinator = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel) let url = self.applicationDocumentsDirectory.appendingPathComponent("SingleViewCoreData.sqlite") var failureReason = "There was an error creating or loading the application's saved data." do { try coordinator.addPersistentStore(ofType: NSSQLiteStoreType, configurationName: nil, at: url, options: nil) } catch { // Report any error we got. var dict = [String: AnyObject]() dict[NSLocalizedDescriptionKey] = "Failed to initialize the application's saved data" as AnyObject? dict[NSLocalizedFailureReasonErrorKey] = failureReason as AnyObject? dict[NSUnderlyingErrorKey] = error as NSError let wrappedError = NSError(domain: "YOUR_ERROR_DOMAIN", code: 9999, userInfo: dict) // Replace this with code to handle the error appropriately. // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. NSLog("Unresolved error \(wrappedError), \(wrappedError.userInfo)") abort() } return coordinator }() lazy var managedObjectContext: NSManagedObjectContext = { // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) This property is optional since there are legitimate error conditions that could cause the creation of the context to fail. let coordinator = self.persistentStoreCoordinator var managedObjectContext = NSManagedObjectContext(concurrencyType: .mainQueueConcurrencyType) managedObjectContext.persistentStoreCoordinator = coordinator return managedObjectContext }() // MARK: - Core Data Saving support func saveContext () { if managedObjectContext.hasChanges { do { try managedObjectContext.save() } catch { // Replace this implementation with code to handle the error appropriately. // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. let nserror = error as NSError NSLog("Unresolved error \(nserror), \(nserror.userInfo)") abort() } } } }
[ 283144, 277514, 277003, 280085, 278551, 278042, 276510, 281635, 194085, 277030, 228396, 277038, 223280, 278577, 280132, 162394, 282203, 189025, 292450, 285796, 279148, 285296, 227455, 278656, 228481, 276611, 278665, 280205, 225934, 188050, 278674, 276629, 283803, 278687, 282274, 277154, 278692, 228009, 287402, 227499, 278700, 278705, 276149, 278711, 279223, 278718, 283838, 228544, 279753, 229068, 227533, 280273, 278751, 201439, 226031, 159477, 280312, 279304, 203532, 181516, 277262, 276751, 321296, 278289, 278801, 278287, 284432, 276755, 146709, 280335, 278808, 278297, 284434, 282910, 282915, 281379, 280370, 277306, 278844, 280382, 282433, 164166, 237382, 226634, 276313, 280415, 277344, 276321, 227687, 334185, 279405, 278896, 277363, 275828, 281972, 278902, 280439, 276347, 228220, 279422, 278916, 293773, 191374, 284557, 288147, 277395, 283028, 214934, 278943, 282016, 230320, 230322, 281011, 286130, 283058, 278971, 276923, 282558, 299970, 280007, 288200, 287689, 284617, 286157, 326096, 281041, 283091, 294390, 282616, 214010 ]
a742511aaf1f0c9ab0bd5b87ae77a1b2a77b4c37
5f9be10f87a99de1d492f4bf5d52aa55255886b2
/Project07Refresh/Project07Refresh/Const.swift
d68442ebfac6d33069c2683bd53742409d51383d
[]
no_license
LeAustinHan/HHSwiftTest
6bd90b8185761269b82d7c557ab5beb3db2453e4
c72382cd65e7992aaa0303b106909a07e02296c3
refs/heads/master
2022-07-06T07:54:16.535362
2020-05-19T05:43:59
2020-05-19T05:43:59
255,558,034
0
0
null
null
null
null
UTF-8
Swift
false
false
211
swift
// // Const.swift // Project07Refresh // // Created by Han Jize on 2020/5/18. // Copyright © 2020 Han Jize. All rights reserved. // import Foundation import UIKit let kScreen = UIScreen.main.nativeBounds
[ -1 ]
9eaedb45d6c070daa12a44b44d8792958e5b835b
cb8d114a20eb87d70577c56d5e42417386acf4f0
/quick-split/quick-split/DemoFriends.swift
0cb3bc9fb5db52d082524d34ff1fe30e490bf98a
[ "MIT" ]
permissive
egnwd/ic-bill-hack
633078a1c8e4f4e699c25352c52a6927e89c8532
e8d666bf177812096b7c5df3d0cc1fa15146608e
refs/heads/master
2020-04-15T15:40:26.350551
2016-02-22T16:45:36
2016-02-22T16:45:36
52,151,122
1
0
null
null
null
null
UTF-8
Swift
false
false
1,395
swift
// // DemoFriends.swift // quick-split // // Created by Elliot Greenwood on 02.20.2016. // Copyright © 2016 stealth-phoenix. All rights reserved. // import Foundation import UIKit class DemoFriends { var friends: [Friend] static let sharedInstance = DemoFriends() init() { let alice = Friend(name: "Alice", pictureName: "alice.jpg", mondoId: "acc_1") let bob = Friend(name: "Bob", pictureName: "bob.jpg", mondoId: "acc_2") let clare = Friend(name: "Clare", pictureName: "clare.jpg", mondoId: "acc_3") let david = Friend(name: "David", pictureName: "david.jpg", mondoId: "acc_4") let elliot = Friend(name: "Elliot", pictureName: "elliot.jpg", mondoId: "acc_000094cjbHqqTaBqC8CQMb") let fred = Friend(name: "Fred", pictureName: "fred.jpg", mondoId: "acc_6") let george = Friend(name: "George", pictureName: "george.jpg", mondoId: "acc_7") let harry = Friend(name: "Harry", pictureName: "harry.jpg", mondoId: "acc_8") let isaac = Friend(name: "Isaac", pictureName: "isaac.jpg", mondoId: "acc_9") let jonathan = Friend(name: "Jonathan", pictureName: "jonathan.jpg", mondoId: "acc_10") friends = [alice, bob, clare, david, elliot, fred, george, harry, isaac, jonathan] } static func getFriends() -> [Friend] { return sharedInstance.friends } static func demoFriends() -> DemoFriends { return sharedInstance } }
[ -1 ]
3f9d84e31bc69b9c07e9f49105b4ae0eb02e8700
432fb0b0dae7605ecf79bbe45bd763b8d929b80d
/SimpleWeather/Constants.swift
e0606de3a18e84bcfa58d014d164e9d19e9830bc
[]
no_license
AndiRX/SimpleWeather
d2c8c0f775d90083e9e1d5871c7ae3994612686f
bea1ba0e54ba4d0061d66a8510a0d59b2e22357b
refs/heads/master
2021-05-07T13:39:53.275469
2017-11-06T22:20:20
2017-11-06T22:20:20
109,629,472
0
0
null
null
null
null
UTF-8
Swift
false
false
385
swift
// // Constants.swift // SimpleWeather // // Created by Petr on 06.11.17. // Copyright © 2017 Andi. All rights reserved. // import Foundation typealias DownloadComplete = () -> () let CURRENT_WEATHER_URL = "http://api.openweathermap.org/data/2.5/weather?lat=\(Location.sharedInstance.latitude!)&lon=\(Location.sharedInstance.longitude!)&appid=04a84ebb0e1570e2ec22265963d6a62c"
[ -1 ]
339ca321fc90e1d4cf0af1f4c857de3ffe04583e
1db120764f94b6a989d0d9c0a88995979db0ab37
/StoriesNavigationController/BathRoomViewController.swift
ffac8880644e013e26c8f060e61d57f61025b901
[]
no_license
YukiT1990/UINavigationController
47708c56f6e9d2e2fc51dab5d883d6d00721a0e0
199bf99ab926a8e1d9a366ea1c7c78efeb90f7f4
refs/heads/main
2023-02-02T02:06:39.411621
2020-12-15T12:22:55
2020-12-15T12:22:55
null
0
0
null
null
null
null
UTF-8
Swift
false
false
530
swift
// // BathRoomViewController.swift // StoriesNavigationController // // Created by Yuki Tsukada on 2020/12/15. // import UIKit class BathRoomViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Entrance", style: .done, target: self, action: #selector(returnDoorway)) } @objc func returnDoorway(sender: UIButton) { navigationController?.popToRootViewController(animated: true) } }
[ -1 ]
b78733999ded13e1a8a48ded34d3f09be8cc3a08
f205c5cc09d55a6a6d004c1ed40bae40f720ca76
/toDoList/toDo.swift
91e417ad714ab73c19427ed6a993a18ae33036e9
[]
no_license
athenasal/toDoList
eb58fa7e8a3b77bfad237e8aab3f5695c0577434
7080836b92690ffc26f7780b2dd66cf4c7e16ea7
refs/heads/master
2020-06-08T02:06:01.835007
2019-06-24T14:30:28
2019-06-24T14:30:28
193,138,630
0
0
null
null
null
null
UTF-8
Swift
false
false
199
swift
// // toDo.swift // toDoList // // Created by Apple on 6/21/19. // Copyright © 2019 Apple. All rights reserved. // import UIKit class toDo { var name = "" var important = false }
[ -1 ]
c347a6192d4544ccc9e80a9e5a1318a12d13707e
ca301d9335a724f0113f62eeb5a8fafe986f5a7f
/Classes/Models/Attendance.swift
9d54eec3e706add4b9854125cb33eb40125ba755
[]
no_license
ibratanov/backflip
30dbc0aca5c6864781f55582ff57eb9d57d7a7a8
4701f6de82c8c29fae26fb65d4f6160eac6eb042
refs/heads/master
2021-05-03T14:11:43.251035
2015-12-08T05:45:52
2015-12-08T05:45:52
35,573,233
0
0
null
null
null
null
UTF-8
Swift
false
false
308
swift
// // Attendance.swift // Backflip for iOS // // Created by Jack Perry on 2015-08-31. // Copyright © 2015 Backflip. All rights reserved. // import Foundation import CoreData @objc(Attendance) class Attendance: ParseObject { // Insert code here to add functionality to your managed object subclass }
[ -1 ]
4f22842db0cef7abba52ad68465cc176940d43d8
8fa86a79dbf803c4c7dee37515518f4336ecaa3a
/MatchCard/SidePanelViewController.swift
a8fad059db4d16c9c536df88886f7eadb433d09c
[]
no_license
edgardowardo/MatchCard
cd2a6ba07b039a16e029fe24f79f25226c007378
f20b5aeba1cac36dbab988b4aa6ca68c0b131c67
HEAD
2016-09-06T20:09:23.482432
2015-06-29T23:05:56
2015-06-29T23:05:56
38,275,882
0
0
null
null
null
null
UTF-8
Swift
false
false
1,811
swift
// // LeftViewController.swift // SlideOutNavigation // // Created by James Frost on 03/08/2014. // Copyright (c) 2014 James Frost. All rights reserved. // import UIKit @objc protocol SidePanelViewControllerDelegate { func itemSelected(item: MenuItem) } class SidePanelViewController: UIViewController { @IBOutlet weak var tableView: UITableView! var delegate: SidePanelViewControllerDelegate? var items: Array<MenuItem>! struct TableView { struct CellIdentifiers { static let MenuItemCell = "MenuItemCell" } } override func viewDidLoad() { super.viewDidLoad() tableView.reloadData() } } // MARK: Table View Data Source extension SidePanelViewController: UITableViewDataSource { func numberOfSectionsInTableView(tableView: UITableView) -> Int { return 1 } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return items.count } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier(TableView.CellIdentifiers.MenuItemCell, forIndexPath: indexPath) as! MenuItemCell cell.configureForItem(items[indexPath.row]) return cell } } // Mark: Table View Delegate extension SidePanelViewController: UITableViewDelegate { func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { let selectedItem = items[indexPath.row] delegate?.itemSelected(selectedItem) } } class MenuItemCell: UITableViewCell { @IBOutlet weak var itemImageView: UIImageView! @IBOutlet weak var imageNameLabel: UILabel! func configureForItem(item: MenuItem) { itemImageView.image = item.image imageNameLabel.text = item.title } }
[ -1 ]
4edbd4cc08b0d1130b4660599c1f183d881dde72
999527b490d61275de67e4e83f852ebde9876a6f
/Parse Chat/chatCell.swift
f13e6c1f87e7aaaec668fe211c29ac8500852b71
[]
no_license
jungy24/Parse-Chat
2c54df323e43798d80a30dce8150fd3675c08666
2819874b31570fce340d178819d19459070ae699
refs/heads/master
2021-01-17T04:32:30.730751
2017-02-24T08:16:45
2017-02-24T08:16:45
82,979,843
0
0
null
null
null
null
UTF-8
Swift
false
false
509
swift
// // chatCell.swift // Parse Chat // // Created by Arthur on 2017/2/23. // Copyright © 2017年 Jungyoon Yu. All rights reserved. // import UIKit class chatCell: UITableViewCell { @IBOutlet var label: UILabel! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } }
[ 300672, 317952, 337412, 328709, 379140, 49916, 179594, 227852, 100495, 298255, 373908, 410749, 373910, 155289, 181529, 305183, 403068, 155555, 337317, 356391, 245035, 311211, 313522, 313525, 354742, 313527, 155576, 313529, 313530, 380220, 349123, 317381, 317382, 327241, 333643, 430412, 254029, 215122, 295127, 388317, 265569, 131814, 213095, 330602, 348778, 179568, 356476, 179571, 167413, 167670, 179580, 337917, 179582 ]
d8bcb0e0f691121be469c4b963427d67227035cd
8cf33d1a918ff4d530aa566930e30646023a3486
/RxWrapper/Package.swift
8bc1886016b017bb2340d37a3dbecf33311d471b
[]
no_license
eironeia/Adichallenge
fee4a2706d084ea064f81df5900e060180218628
25dfd3b47f0bae18219e7fca54fcdf3d40643c10
refs/heads/main
2023-05-08T06:15:46.157715
2021-05-30T09:15:32
2021-05-30T09:15:32
371,180,838
0
0
null
null
null
null
UTF-8
Swift
false
false
472
swift
// swift-tools-version:5.1 import PackageDescription let package = Package( name: "RxWrapper", products: [ .library(name: "RxWrapper", targets: ["RxWrapper"]), ], dependencies: [ .package( url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "6.0.0") ) ], targets: [ .target( name: "RxWrapper", dependencies: ["RxSwift", "RxCocoa"] ) ] )
[ -1 ]
b44b97b7ebd706cf0be36f2b693dfee5d158f42e
d5e2047f4b009b9a3ab94b7eb2380830543edbca
/TwitterAPICaller.swift
c247289ed24915517bd81b48494c91e39d501853
[]
no_license
SubomiPopoola/twitter2
1cf3085b58e6cda61e0d6af42c1ab885df83fa57
4f5c6283a2b124f0d1eeaa8a26d4e7326dd5abe7
refs/heads/master
2021-01-14T15:13:12.409154
2020-02-24T06:01:15
2020-02-24T06:01:15
242,657,928
0
0
null
null
null
null
UTF-8
Swift
false
false
4,857
swift
// // APIManager.swift // Twitter // // Created by Dan on 1/3/19. // Copyright © 2019 Dan. All rights reserved. // import UIKit import BDBOAuth1Manager class TwitterAPICaller: BDBOAuth1SessionManager { static let client = TwitterAPICaller(baseURL: URL(string: "https://api.twitter.com"), consumerKey: "uFTmFW66AAMEUwx3rZlZDMSCf", consumerSecret: "LtlxIoQpBvHcqjpSMIA9Gs2E9wCJbr7xkx9EpSdBYoNedaZUgh") var loginSuccess: (() -> ())? var loginFailure: ((Error) -> ())? func handleOpenUrl(url: URL){ let requestToken = BDBOAuth1Credential(queryString: url.query) TwitterAPICaller.client?.fetchAccessToken(withPath: "oauth/access_token", method: "POST", requestToken: requestToken, success: { (accessToken: BDBOAuth1Credential!) in self.loginSuccess?() }, failure: { (error: Error!) in self.loginFailure?(error) }) } func login(url: String, success: @escaping () -> (), failure: @escaping (Error) -> ()){ loginSuccess = success loginFailure = failure TwitterAPICaller.client?.deauthorize() TwitterAPICaller.client?.fetchRequestToken(withPath: url, method: "GET", callbackURL: URL(string: "alamoTwitter://oauth"), scope: nil, success: { (requestToken: BDBOAuth1Credential!) -> Void in let url = URL(string: "https://api.twitter.com/oauth/authorize?oauth_token=\(requestToken.token!)")! UIApplication.shared.open(url) }, failure: { (error: Error!) -> Void in print("Error: \(error.localizedDescription)") self.loginFailure?(error) }) } func logout (){ deauthorize() } func getDictionaryRequest(url: String, parameters: [String:Any], success: @escaping (NSDictionary) -> (), failure: @escaping (Error) -> ()){ TwitterAPICaller.client?.get(url, parameters: parameters, progress: nil, success: { (task: URLSessionDataTask, response: Any?) in success(response as! NSDictionary) }, failure: { (task: URLSessionDataTask?, error: Error) in failure(error) }) } func getDictionariesRequest(url: String, parameters: [String:Any], success: @escaping ([NSDictionary]) -> (), failure: @escaping (Error) -> ()){ print(parameters) TwitterAPICaller.client?.get(url, parameters: parameters, progress: nil, success: { (task: URLSessionDataTask, response: Any?) in success(response as! [NSDictionary]) }, failure: { (task: URLSessionDataTask?, error: Error) in failure(error) }) } func postRequest(url: String, parameters: [Any], success: @escaping () -> (), failure: @escaping (Error) -> ()){ TwitterAPICaller.client?.post(url, parameters: parameters, progress: nil, success: { (task: URLSessionDataTask, response: Any?) in success() }, failure: { (task: URLSessionDataTask?, error: Error) in failure(error) }) } func postTweet(tweetString: String, success: @escaping () -> (), failure: @escaping (Error) -> () ){ let url = "https://api.twitter.com/1.1/statuses/update.json" TwitterAPICaller.client?.post(url, parameters: ["status":tweetString], progress: nil, success: { (task: URLSessionDataTask, response: Any?) in success() }, failure: { (task: URLSessionDataTask?, error: Error) in failure(error) }) } func favoriteTweet(tweetId: Int, success: @escaping () -> (), failure: @escaping (Error) -> () ){ let url = "https://api.twitter.com/1.1/favorites/create.json" TwitterAPICaller.client?.post(url, parameters: ["id":tweetId], progress: nil, success: { (task: URLSessionDataTask, response: Any?) in success() }, failure: { (task: URLSessionDataTask?, error: Error) in print("error yahhh") failure(error) }) } func unfavoriteTweet(tweetId: Int, success: @escaping () -> (), failure: @escaping (Error) -> () ){ let url = "https://api.twitter.com/1.1/favorites/destroy.json" TwitterAPICaller.client?.post(url, parameters: ["id":tweetId], progress: nil, success: { (task: URLSessionDataTask, response: Any?) in success() }, failure: { (task: URLSessionDataTask?, error: Error) in failure(error) }) } func retweet(tweetId: Int, success: @escaping () -> (), failure: @escaping (Error) -> () ){ let url = "https://api.twitter.com/1.1/statuses/retweet/\(tweetId).json" TwitterAPICaller.client?.post(url, parameters: ["id":tweetId], progress: nil, success: { (task: URLSessionDataTask, response: Any?) in success() }, failure: { (task: URLSessionDataTask?, error: Error) in failure(error) }) } }
[ 360321, 399196 ]
ac4b7c12a4f2ab437a8c0691fcc81732f4de67d6
0492952f1bdeae9a46fc89316c1f6b9521f0d05b
/Stepic/CodeLimit+CoreDataProperties.swift
eeac1eec57c37e789b6ea5bc4712df26a0118c2e
[ "MIT" ]
permissive
moonbogi/stepik-ios
a66f2e1409efa7b5c7846ca7bbf62c5806b71ed8
d26614bf739596778896f0dd444c2260002240ff
refs/heads/master
2021-06-20T14:12:14.646097
2017-07-27T16:20:27
2017-07-27T16:20:27
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,243
swift
// // CodeLimit+CoreDataProperties.swift // Stepic // // Created by Ostrenkiy on 30.05.17. // Copyright © 2017 Alex Karpov. All rights reserved. // import Foundation import CoreData extension CodeLimit { @NSManaged var managedLanguage: String? @NSManaged var managedMemory: NSNumber? @NSManaged var managedTime: NSNumber? @NSManaged var managedOptions: StepOptions? class var oldEntity : NSEntityDescription { return NSEntityDescription.entity(forEntityName: "CodeLimit", in: CoreDataHelper.instance.context)! } convenience init() { self.init(entity: CodeLimit.oldEntity, insertInto: CoreDataHelper.instance.context) } var languageString: String { get { return managedLanguage ?? "" } set(value) { managedLanguage = value } } var memory: Double { get { return managedMemory?.doubleValue ?? 0.0 } set(value) { managedMemory = value as NSNumber? } } var time: Double { get { return managedTime?.doubleValue ?? 0.0 } set(value) { managedTime = value as NSNumber? } } }
[ -1 ]
4ced95e27402aa01776bb4427093703fcf80b2fd
8110a7a8f4338d03e813c3f2ec7c06d08383ba1d
/Street/General/Controller/STBaseViewController.swift
4515ad4f3f8e3998c3f6a864bc7a05c0a2add630
[]
no_license
chenyufeng520/Street
0ca036c3ccecad433385e16c957277fd7a5b302d
059ddaba5c32c67edb2b5fb5a6159977361e9831
refs/heads/master
2020-05-22T15:31:48.892280
2019-08-12T07:14:08
2019-08-12T07:14:08
186,409,277
0
0
null
null
null
null
UTF-8
Swift
false
false
957
swift
// // STBaseViewController.swift // Street // // Created by 陈宇峰 on 2019/5/14. // Copyright © 2019 inmyshow. All rights reserved. // import UIKit class STBaseViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = UIColor.colorFromHex(rgbValue: 0xF1F1F1) // Do any additional setup after loading the view. } override var preferredStatusBarStyle: UIStatusBarStyle { return UIStatusBarStyle.lightContent } deinit { print("\(self)页面释放了") } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }
[ -1 ]
0cf9cc7cf4d876f74d7402f24cd2cae92dcdfa3b
77ecf8e7d7c2278d2c0c1bd5d5cb8a1eb52c1afc
/Games/Scenes/FavoritesScene/FavoritesBuilder.swift
87900f17913d56eddf91c08a70f9d56e72e4a5a2
[]
no_license
gungorbasa/Games
58d5d819028b0c4bab17211b4d30087fe36ea6fd
6ee9c47212c29526c97512c7c3fee648fb69e74a
refs/heads/master
2022-12-04T07:45:04.612901
2020-08-24T10:59:03
2020-08-24T10:59:03
289,903,378
0
0
null
null
null
null
UTF-8
Swift
false
false
730
swift
// // FavoritesBuilder.swift // Games // // Created Gungor Basa on 1/10/20. // Copyright © 2020 Gungor Basa. All rights reserved. // import UIKit final class FavoritesBuilder { static func make() -> FavoritesViewController { let storyboard = UIStoryboard(name: "Favorites", bundle: nil) let view = storyboard.instantiateViewController(withIdentifier: "FavoritesViewController") as! FavoritesViewController // TODO: Injections let router = FavoritesRouter(view) let database = UserDefaultsDatabase() let interactor = FavoritesInteractor(database: database) let presenter = FavoritesPresenter(view, interactor: interactor, router: router) view.presenter = presenter return view } }
[ -1 ]
4a4149157f8028fab391c2ed3231eae3f4722faf
2589fe566c3d9e21bc519d2e5b6744870ef987c9
/FoodViewer/ReferenceDailyIntakeList.swift
722663aa980663bb8bbbc7b222e114071fb1c51c
[ "Apache-2.0" ]
permissive
informatimago/FoodViewer
e98436dc8996e5a29e7db248c88798053769628f
13e285b67279b40afad5b57a23881e9aca06705c
refs/heads/master
2020-05-14T22:57:18.916514
2019-03-24T17:10:59
2019-03-24T17:10:59
null
0
0
null
null
null
null
UTF-8
Swift
false
false
4,015
swift
// // DailyValues.swift // FoodViewer // // Created by arnaud on 22/05/16. // Copyright © 2016 Hovering Above. All rights reserved. // // This class stores the Daily Advised Values // // It reads a property list file, which consists of an array of value items, // with each item a dictionary (key, value, unit) // The key is written without the language prefix (en:) and in lowercase // The data is taken from (Reference Daily Intake): // http://www.fda.gov/Food/GuidanceRegulation/GuidanceDocumentsRegulatoryInformation/LabelingNutrition/ucm064928.htm // https://en.m.wikipedia.org/wiki/Reference_Daily_Intake // https://nl.wikipedia.org/wiki/Aanbevolen_dagelijkse_hoeveelheid // Suiker : http://www.nu.nl/gezondheid/3719575/who-halveert-aanbevolen-hoeveelheid-suiker.html import Foundation class ReferenceDailyIntakeList { // This class is implemented as a singleton // It is only needed by OpenFoodFactRequests. // An instance could be loaded for each request // A singleton limits however the number of file loads static let manager = ReferenceDailyIntakeList() private struct Constants { static let PlistExtension = "plist" static let DailyValuesFileName = "ReferenceDailyIntakeValues" static let ValueKey = "value" static let UnitKey = "unit" static let KeyKey = "key" } private struct TextConstants { static let FileNotAvailable = "Error: file %@ not available" } private var list: [DailyValue] = [] private struct DailyValue { var key: String var value: Double var unit: String init(key:String, value:Double, unit:String) { self.key = key self.value = value self.unit = unit } func normalized() -> Double { if unit == "mg" { return value / 1000.0 } else if unit == "µg" { return value / 1000000.0 } else { return value } } } init() { // read all necessary plists in the background list = readPlist(fileName: Constants.DailyValuesFileName) } private func readPlist(fileName: String) -> [DailyValue] { // Copy the file from the Bundle and write it to the Device: if let path = Bundle.main.path(forResource: fileName, ofType: Constants.PlistExtension) { let resultArray = NSArray(contentsOfFile: path) // print("Saved plist file is --> \(resultDictionary?.description)") if let validResultArray = resultArray { list = [] for arrayEntry in validResultArray { if let dailyValueDict = arrayEntry as? [String:Any] { let key = dailyValueDict[Constants.KeyKey] as? String let value = dailyValueDict[Constants.ValueKey] as? Double let unit = dailyValueDict[Constants.UnitKey] as? String let newDailyValue = DailyValue(key:key!, value:value!, unit:unit!) list.append(newDailyValue) } } return list } } return [] } private func findKey(key:String) -> DailyValue? { for item in list { if item.key == key { return item } } return nil } private func valueForKey(key: String) -> Double? { if let dv = findKey(key: key) { return dv.normalized() } else { return nil } } // returns the daily recommended value as fraction for a specific key func dailyValue(value: Double, forKey: String) -> Double? { if let dv = valueForKey(key: forKey) { return value / dv } else { return nil } } }
[ -1 ]
00fe8b332baac77af410c6fdde8fac8d583dd3ab
d375276c0e0a7fd2cec00e2ee0ed195ab38bbda4
/TrendyolFake/Screen/MainScreen/MainScreen.swift
3def5f35ceb5d9fe4e7c820130b968f80401255b
[]
no_license
omerfiraat/FakeTrendyol
88dd117b6531cb59cdd5c63f64e8a2f82cd7d045
3aa21bc4e854629cf2660fa1c37f4baa14f9bf2e
refs/heads/main
2023-02-09T06:55:14.608016
2021-01-02T10:47:58
2021-01-02T10:47:58
326,155,641
0
0
null
2021-01-02T10:47:59
2021-01-02T10:10:41
Swift
UTF-8
Swift
false
false
2,918
swift
// // MainScreen.swift // TrendyolFake // // Created by Bekir on 19.12.2020. // import UIKit class MainScreen: BaseScreen { @IBOutlet weak var tbvBrandList: UITableView! var brandList:[Brand]? var selectedBrand:Brand? override func viewDidLoad() { super.viewDidLoad() let nc = NotificationCenter.default nc.addObserver(self, selector: #selector(favoriteListChange), name: Notification.Name("ChangeFavoriteProduct"), object: nil) Network.getHomePageData {[weak self] (brandList) in self?.brandList = brandList self?.tbvBrandList.reloadData() } // Do any additional setup after loading the view. } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if let destVc = segue.destination as? BrandDetailScreen{ destVc.brand = selectedBrand } } @objc func favoriteListChange() { tbvBrandList.reloadData() } } extension MainScreen: UITableViewDelegate, UITableViewDataSource{ func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if(BaseData.sharedInstance.getFavoriteList().count > 0){ return brandList!.count+1 } return brandList!.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { if(indexPath.row == 0 && BaseData.sharedInstance.getFavoriteList().count > 0){ let cell:FavoriteCell = tableView.dequeueReusableCell(withIdentifier: "FavoriteCell", for: indexPath) as! FavoriteCell return cell }else { let cell:BrandCell = tableView.dequeueReusableCell(withIdentifier: CellIdentify.BrandCell, for: indexPath) as! BrandCell if(BaseData.sharedInstance.getFavoriteList().count > 0){ cell.imgBrand.image = UIImage.init(named: (brandList![indexPath.row-1].imageName) ?? "") }else{ cell.imgBrand.image = UIImage.init(named: (brandList![indexPath.row].imageName) ?? "") } return cell } } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { if(indexPath.row == 0 && BaseData.sharedInstance.getFavoriteList().count > 0){ return 310.0 } return 200.0 } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if(BaseData.sharedInstance.getFavoriteList().count > 0){ self.selectedBrand = brandList![indexPath.row-1] performSegue(withIdentifier: "showBrandDetailScreen", sender: nil) }else{ self.selectedBrand = brandList![indexPath.row] performSegue(withIdentifier: "showBrandDetailScreen", sender: nil) } } }
[ -1 ]
00adf3a6e3b0c1d9fd3e135b434fa270d5a31ee2
ed9183ff0aa7a27cbf37cfd5c5908774e249db00
/test/Interop/Cxx/operators/member-inline-module-interface.swift
1b9e71f436f5fa95166c7e8cc38b968c95ef7cb4
[ "Apache-2.0", "Swift-exception" ]
permissive
JeaSungLEE/swift
f60cafa1dda247ea56c9d665bf6adab5e1984fd1
08aaee5e9c7495d468d7fd59d2d0cb4abff08db5
refs/heads/main
2023-03-17T18:29:27.947724
2021-03-12T04:24:25
2021-03-12T04:29:29
346,929,407
1
1
Apache-2.0
2021-03-12T03:52:22
2021-03-12T03:52:22
null
UTF-8
Swift
false
false
780
swift
// RUN: %target-swift-ide-test -print-module -module-to-print=MemberInline -I %S/Inputs -source-filename=x -enable-cxx-interop | %FileCheck %s // CHECK: struct LoadableIntWrapper { // CHECK: static func - (lhs: inout LoadableIntWrapper, rhs: LoadableIntWrapper) -> LoadableIntWrapper // CHECK: mutating func callAsFunction() -> Int32 // CHECK: mutating func callAsFunction(_ x: Int32) -> Int32 // CHECK: mutating func callAsFunction(_ x: Int32, _ y: Int32) -> Int32 // CHECK: } // CHECK: struct AddressOnlyIntWrapper { // CHECK: mutating func callAsFunction() -> Int32 // CHECK: mutating func callAsFunction(_ x: Int32) -> Int32 // CHECK: mutating func callAsFunction(_ x: Int32, _ y: Int32) -> Int32 // CHECK: } // CHECK: struct HasDeletedOperator { // CHECK: }
[ -1 ]
f5d2d6ba6d725c0a9a614ca7ed9dc71805408826
f09ae093a28bb015a0da61ee21f29cd07e76fbe8
/MoNo/AppDelegate.swift
754016e457adc99492209879189ec9b8bb05ac68
[]
no_license
BasThomas/MoNo
3931a533e5d4448fae68f89294b712f0d73fc98c
dddc3122a300bf4c2bc136968290bd614e453af5
refs/heads/master
2020-12-24T16:14:50.284622
2014-07-22T10:41:31
2014-07-22T10:41:31
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,492
swift
// // AppDelegate.swift // MoNo // // Created by Bas Thomas Broek on 05/07/14. // Copyright (c) 2014 Bas Thomas Broek. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool { self.window = UIWindow(frame: UIScreen.mainScreen().bounds) // Override point for customization after application launch. var mvc: MenuViewController = MenuViewController(nibName:"MenuViewController",bundle:nil) self.window!.rootViewController = mvc self.window!.backgroundColor = UIColor.whiteColor() self.window!.makeKeyAndVisible() return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229385, 278539, 229388, 278542, 229391, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 278559, 237613, 286774, 319544, 204856, 286776, 286791, 237640, 278605, 237646, 286797, 311375, 196692, 319573, 278623, 319590, 278635, 303212, 278639, 131192, 237693, 327814, 131209, 417930, 303241, 303244, 319633, 286873, 286876, 311469, 32944, 286906, 327866, 286910, 286916, 286922, 286924, 286926, 286928, 131281, 278747, 295133, 319716, 278760, 237807, 303345, 286962, 229622, 327930, 278781, 278783, 278785, 286987, 311569, 286999, 319770, 287003, 287006, 287012, 287014, 287016, 311598, 287023, 311601, 155966, 278849, 319809, 319814, 319818, 311628, 287054, 319822, 278865, 196969, 139638, 213367, 106872, 319872, 311683, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 278967, 180668, 278975, 278980, 278983, 319945, 278986, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 279020, 172526, 279023, 311791, 172529, 279027, 319989, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 287238, 172552, 303623, 320007, 279051, 172558, 279055, 279058, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 279084, 172591, 172598, 172607, 172609, 172612, 377413, 213575, 172618, 303690, 33357, 279124, 311911, 189034, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 295557, 303751, 311942, 352905, 279178, 287371, 311946, 311951, 287377, 287381, 311957, 221850, 164509, 230045, 295583, 287390, 303773, 287394, 303780, 287398, 279208, 287400, 279212, 172721, 287409, 66227, 303797, 328381, 279231, 287423, 328384, 287427, 107208, 287436, 287440, 295633, 172755, 303827, 279255, 279258, 303835, 213724, 189149, 303838, 279267, 312035, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 295685, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 279340, 279353, 230202, 312124, 222018, 295755, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 303987, 328563, 303991, 303997, 295808, 304005, 320391, 213895, 304007, 304009, 304011, 304013, 213902, 279438, 295822, 295825, 304019, 279445, 58262, 279452, 279461, 279462, 304042, 213931, 230327, 287675, 304063, 238528, 304065, 189378, 213954, 156612, 312272, 304084, 304090, 320481, 320490, 312302, 320496, 304114, 295928, 320505, 295945, 197645, 230413, 320528, 140312, 238620, 304164, 238641, 238652, 238655, 230465, 238658, 296004, 336964, 205895, 320584, 238666, 296021, 402518, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 312432, 279669, 189562, 337018, 279679, 279683, 205968, 296084, 304285, 238756, 205991, 222377, 165038, 230576, 304311, 230592, 279750, 148690, 279769, 304348, 304354, 296163, 279781, 304360, 279788, 320748, 279790, 304370, 320771, 312585, 296202, 296205, 320786, 296213, 214294, 296215, 320792, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296255, 312639, 296259, 230727, 238919, 320840, 222545, 222556, 337244, 230752, 230760, 173418, 230763, 410987, 230768, 296305, 230773, 279929, 181626, 304506, 296331, 288140, 230800, 288144, 304533, 337306, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 279985, 312755, 296373, 279991, 312759, 288185, 222652, 173507, 296389, 222665, 230860, 312783, 230865, 370130, 288210, 222676, 280021, 288212, 288214, 239064, 288217, 288218, 280027, 288220, 329177, 239070, 288224, 370146, 288226, 280036, 288229, 280038, 288230, 288232, 288234, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 402942, 206336, 296450, 230916, 230919, 370187, 304651, 304653, 230940, 222752, 108066, 296488, 230961, 288320, 288325, 124489, 280145, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 280218, 280222, 321195, 296622, 337585, 296626, 296634, 296637, 280260, 206536, 280264, 206539, 206541, 280276, 321239, 280283, 288478, 313055, 321252, 313066, 280302, 288494, 419570, 288499, 288502, 124671, 280324, 313093, 280331, 198416, 116503, 321304, 329498, 296731, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 288576, 345921, 280388, 280402, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 124817, 280468, 239510, 280473, 124827, 247709, 313258, 296883, 124853, 10170, 296890, 288700, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 288764, 239617, 313347, 288773, 313358, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 124980, 288824, 288826, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 223327, 149599, 280671, 321634, 149603, 313451, 223341, 280687, 280691, 313464, 288895, 321670, 215175, 141455, 313498, 288936, 100520, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 280804, 280807, 280811, 280817, 280819, 157940, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 280835, 125187, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 280919, 313700, 280937, 313705, 280940, 190832, 280946, 313720, 280956, 280959, 313731, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 281047, 215526, 166378, 281075, 174580, 281084, 240124, 305662, 305664, 240129, 305666, 240132, 223749, 305668, 281095, 223752, 338440, 223757, 281102, 223763, 281113, 322074, 281121, 182819, 281127, 281135, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 199262, 338532, 199273, 281196, 158317, 313973, 281210, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 314047, 314051, 199364, 297671, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 322310, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 281401, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207737, 158596, 183172, 338823, 322440, 314249, 183184, 240535, 289694, 289700, 289712, 281529, 289724, 289762, 322534, 281581, 183277, 134142, 314372, 322610, 314421, 281654, 314433, 207937, 207949, 322642, 281691, 314461, 281702, 281704, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 142531, 199877, 289991, 306377, 290008, 363742, 363745, 298216, 216303, 388350, 363802, 314671, 298292, 298294, 216376, 380226, 224587, 306517, 314714, 224603, 159068, 314718, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 306549, 314743, 306552, 290171, 306555, 314747, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 298377, 314763, 298381, 224657, 306581, 314779, 314785, 282025, 282027, 241068, 241070, 241072, 282034, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 282089, 191985, 282098, 282101, 241142, 290298, 151036, 290302, 290305, 192008, 323084, 282127, 290321, 282133, 290325, 241175, 290328, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290356, 282186, 282195, 282201, 306778, 159324, 159330, 314979, 298598, 224875, 241260, 257658, 315016, 282249, 290445, 282261, 298651, 282269, 323229, 298655, 282277, 282295, 282300, 323266, 282310, 282319, 306897, 241362, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 282376, 216842, 323345, 282388, 282392, 184090, 315167, 315169, 282402, 241448, 315176, 282410, 241450, 306988, 315190, 282425, 159545, 298811, 307009, 413506, 307012, 298822, 315211, 307027, 315221, 282454, 241496, 241498, 307035, 282465, 241509, 110438, 298860, 110445, 282478, 110450, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 282514, 241556, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 241581, 241583, 323504, 241586, 282547, 241588, 241590, 241592, 241598, 290751, 241600, 241605, 241610, 298975, 241632, 298984, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299006, 282623, 241669, 282632, 282639, 282645, 241693, 102438, 217127, 282669, 282681, 282687, 159811, 315463, 315466, 192589, 307278, 307287, 315482, 217179, 315483, 192605, 200801, 217188, 299109, 315495, 45163, 307307, 315502, 192624, 307314, 307338, 233613, 241813, 299164, 184479, 299167, 184481, 315557, 307370, 307372, 307374, 307376, 323763, 176311, 184503, 307385, 258235, 176316, 307388, 299200, 307394, 307396, 184518, 323784, 307409, 307411, 233701, 307432, 282881, 282893, 291089, 282906, 233766, 307508, 307510, 332086, 151864, 307515, 282942, 307518, 151874, 282947, 282957, 233808, 315733, 323926, 233815, 315739, 299357, 242018, 299373, 315757, 242043, 315771, 299391, 291202, 299398, 242057, 291222, 291226, 242075, 291231, 283042, 291238, 291241, 127403, 127405, 127407, 291247, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 127431, 176592, 315856, 176597, 127447, 176605, 242143, 291299, 242152, 291305, 127466, 176620, 291314, 291317, 135672, 291323, 233979, 291330, 283142, 127497, 135689, 233994, 234003, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 242206, 242208, 291378, 152118, 234038, 111193, 242275, 299620, 242279, 184952, 135805, 291456, 135808, 135820, 316051, 225941, 316054, 135834, 373404, 299677, 135839, 299680, 225954, 242343, 209576, 242345, 373421, 135873, 135876, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 201444, 283368, 283372, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 242436, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 234309, 234313, 316233, 316235, 234316, 283468, 234319, 234321, 234324, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 152435, 234356, 234362, 234368, 234370, 234373, 226182, 234375, 226185, 234379, 234384, 234388, 234390, 226200, 234393, 209818, 308123, 234396, 324504, 234398, 291742, 324508, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 291754, 324522, 226220, 234414, 324527, 291760, 234417, 324531, 226230, 234422, 324536, 234428, 291773, 234431, 242623, 324544, 234434, 324546, 226245, 234437, 234439, 234443, 275406, 234446, 234449, 234452, 234455, 234459, 234461, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 234519, 234520, 316439, 234528, 234532, 300069, 234535, 234537, 234540, 234543, 234546, 275508, 234549, 300085, 300088, 234556, 234558, 316479, 234561, 234563, 308291, 316483, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 275545, 234585, 234590, 234593, 234595, 234597, 234601, 300139, 234605, 234607, 275569, 234610, 300148, 234614, 398455, 144506, 275579, 234618, 234620, 234623, 226433, 234627, 275588, 275594, 234634, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 234648, 234650, 308379, 324757, 283805, 234653, 119967, 300189, 234657, 324768, 242852, 283813, 234661, 300197, 234664, 275626, 234667, 308414, 234687, 308418, 316610, 300226, 283844, 300229, 308420, 283850, 300234, 283854, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 300292, 300294, 275719, 177419, 300299, 242957, 275725, 283917, 177424, 300301, 349464, 283939, 259367, 283951, 292143, 300344, 283963, 243003, 226628, 300357, 357722, 316766, 218464, 316768, 292197, 243046, 316774, 136562, 324978, 275834, 275840, 316803, 316814, 226703, 234899, 226709, 357783, 316824, 316826, 300448, 144807, 144810, 284076, 144812, 144814, 284087, 292279, 144826, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144847, 144852, 144855, 103899, 300507, 333280, 218597, 300523, 259565, 259567, 300527, 308720, 226802, 316917, 308727, 300537, 316947, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284211, 284213, 308790, 194103, 284215, 284218, 226877, 284226, 243268, 284228, 226886, 284231, 128584, 292421, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 292433, 300628, 276053, 284245, 284247, 235097, 243290, 284251, 284249, 284253, 300638, 284255, 284258, 292452, 292454, 284263, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292479, 276098, 284290, 284292, 292481, 292485, 325250, 284297, 317066, 284299, 284301, 284303, 276114, 284306, 284308, 284312, 276122, 284314, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 276144, 284337, 284339, 284343, 284346, 284350, 276160, 358080, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 317158, 284392, 325353, 284394, 284397, 276206, 284399, 358128, 358135, 276216, 358140, 284413, 358142, 284418, 317187, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 300832, 284449, 325408, 227109, 317221, 358183, 276268, 300845, 243504, 284469, 276280, 325436, 366406, 276295, 153417, 276308, 284502, 317271, 276315, 227175, 300912, 284529, 292721, 300915, 284533, 292729, 284540, 292734, 325512, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292784, 161718, 358326, 276410, 358330, 276411, 276418, 301009, 358360, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 227314, 276466, 276472, 317435, 276476, 276479, 276482, 276485, 276490, 276496, 317456, 317458, 243733, 243740, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 276539, 235579, 235581, 178238, 325692, 276544, 284739, 292934, 276553, 243785, 350293, 350295, 194649, 227418, 309337, 194654, 227423, 350302, 194657, 178273, 276579, 227426, 194660, 309346, 276583, 309348, 309350, 276586, 350308, 309354, 350313, 276590, 350316, 301167, 227440, 284786, 350321, 276595, 350325, 350328, 292985, 292989, 317570, 350339, 317573, 350342, 350345, 350349, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 227522, 350402, 301252, 350406, 227529, 301258, 309450, 276685, 276689, 309462, 309468, 309471, 317672, 325867, 227571, 309491, 309494, 276735, 227583, 227587, 276739, 276742, 227596, 325910, 342298, 276762, 276766, 211232, 317729, 276775, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 235858, 276829, 276833, 391523, 276836, 276843, 276848, 293232, 186744, 211324, 227709, 317833, 178572, 285070, 178575, 285077, 227738, 317853, 276896, 317858, 342434, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 317910, 293336, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 301562, 317951, 301575, 121352, 236043, 342541, 113167, 277011, 309779, 309781, 317971, 227877, 227879, 293417, 293421, 277054, 129603, 318020, 301639, 301643, 285265, 399955, 277080, 285282, 318055, 277100, 277106, 121458, 170619, 309885, 309888, 277122, 277128, 301706, 318092, 326285, 318094, 277136, 277139, 227992, 285340, 227998, 318110, 137889, 383658, 318128, 277170, 342707, 154292, 277173, 293555, 318132, 277177, 277181, 277187, 277194, 277196, 277201, 137946, 113378, 228069, 277223, 342760, 285417, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 301884, 293696, 277317, 277322, 301911, 277337, 301913, 236397, 326514, 310134, 277368, 236408, 113538, 416648, 277385, 39817, 187274, 301972, 424853, 277405, 310179, 293798, 236460, 277426, 293811, 293817, 293820, 326603, 293849, 293861, 228327, 228328, 228330, 318442, 277486, 326638, 293877, 285686, 302073, 285690, 244731, 293882, 302075, 293887, 277504, 277507, 277511, 277519, 293917, 293939, 277561, 277564, 293956, 277573, 228422, 293960, 277577, 310344, 277583, 203857, 293971, 236632, 277594, 277598, 285792, 277601, 310374, 277608, 318573, 203886, 187509, 285815, 285817, 285821, 302205, 285824, 285831, 253064, 302218, 285835, 162964, 384148, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 277671, 302248, 64682, 277678, 294063, 294065, 277687, 294072, 318651, 294076, 277695, 244930, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 228592, 294132, 138485, 228601, 228606, 204031, 310531, 285958, 138505, 228617, 318742, 277798, 130345, 113964, 285997, 113969, 318773, 318776, 286010, 417086, 286016, 294211, 302403, 384328, 326991, 179547, 146784, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 310657, 310659, 294276, 327046, 310672, 130468, 228776, 277932, 310703, 130486, 310710, 310712, 310715, 302526, 228799, 64966, 302534, 310727, 302541, 302543, 310737, 228825, 163290, 310749, 187880, 286188, 310764, 327156, 310772, 212472, 286203, 228864, 286214, 228871, 302614, 286233, 302617, 187939, 294435, 286246, 294439, 286248, 294440, 294443, 294445, 212538, 228933, 286283, 228944, 40529, 212560, 400976, 147032, 278109, 286312, 286313, 40560, 294521, 343679, 310925, 286354, 278163, 122517, 278168, 327333, 229030, 278188, 278192, 278196, 319171, 302789, 294599, 278216, 294601, 302793, 278227, 229076, 286420, 319187, 286425, 319194, 278235, 229086, 278238, 286432, 294625, 294634, 319226, 278274, 302852, 278277, 302854, 311048, 352008, 311053, 302862, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 237409, 294776, 294785, 327554, 40851, 294811, 319390, 40865, 294817, 319394, 294831, 188340, 294844, 294847, 294876, 294879, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
0e1383750c67f0aca6c5efd1551a55966ebd9a15
b08b7e3160ae9947b6046123acad8f59152375c3
/Programming Language Detection/Experiment-2/Dataset/Train/Swift/execute-brain----.swift
a651576a46958a047a4ba4cb95a61c89286cfc4a
[]
no_license
dlaststark/machine-learning-projects
efb0a28c664419275e87eb612c89054164fe1eb0
eaa0c96d4d1c15934d63035b837636a6d11736e3
refs/heads/master
2022-12-06T08:36:09.867677
2022-11-20T13:17:25
2022-11-20T13:17:25
246,379,103
9
5
null
null
null
null
UTF-8
Swift
false
false
2,610
swift
import Foundation let valids = [">", "<", "+", "-", ".", ",", "[", "]"] as Set<Character> var ip = 0 var dp = 0 var data = [UInt8](count: 30_000, repeatedValue: 0) let input = Process.arguments if input.count != 2 { fatalError("Need one input file") } let infile: String! do { infile = try String(contentsOfFile: input[1], encoding: NSUTF8StringEncoding) ?? "" } catch let err { infile = "" } var program = "" // remove invalid chars for c in infile.characters { if valids.contains(c) { program += String(c) } } let numChars = program.characters.count if numChars == 0 { fatalError("Error reading file") } func increaseInstructionPointer() { ip += 1 } func executeInstruction(ins: Character) { switch ins { case ">": dp += 1 increaseInstructionPointer() case "<": dp -= 1 increaseInstructionPointer() case "+": data[dp] = data[dp] &+ 1 increaseInstructionPointer() case "-": data[dp] = data[dp] &- 1 increaseInstructionPointer() case ".": print(Character(UnicodeScalar(data[dp])), terminator: "") increaseInstructionPointer() case ",": handleIn() increaseInstructionPointer() case "[": handleOpenBracket() case "]": handleClosedBracket() default: fatalError("What") } } func handleIn() { let input = NSFileHandle.fileHandleWithStandardInput() let bytes = input.availableData.bytes let buf = unsafeBitCast(UnsafeBufferPointer(start: bytes, count: 1), UnsafeBufferPointer<UInt8>.self) data[dp] = buf[0] } func handleOpenBracket() { if data[dp] == 0 { var i = 1 while i > 0 { ip += 1 let ins = program[program.startIndex.advancedBy(ip)] if ins == "[" { i += 1 } else if ins == "]" { i -= 1 } } } else { increaseInstructionPointer() } } func handleClosedBracket() { if data[dp] != 0 { var i = 1 while i > 0 { ip -= 1 let ins = program[program.startIndex.advancedBy(ip)] if ins == "[" { i -= 1 } else if ins == "]" { i += 1 } } } else { increaseInstructionPointer() } } func tick() { let ins = program[program.startIndex.advancedBy(ip)] if valids.contains(ins) { executeInstruction(ins) } else { increaseInstructionPointer() } } while ip != numChars { tick() }
[ -1 ]
3c8914e95f31ea74b6f0ee49c4286d1b257b46c3
329b1b53b65bb17a04b988265dafc721a2df244a
/hxytest/committeehouseViewController.swift
73aad45da3e89075e59b891b10fb8722cef60b2a
[]
no_license
XiyanHu/Congress-Information-Search
1a31920f2ebe9e53f0a8466f320c52a799480cea
07bb489b22558200eb84c3155dd7ec86d27cba04
refs/heads/master
2021-01-11T12:01:58.001573
2016-12-16T01:23:04
2016-12-16T01:23:04
76,609,332
1
0
null
null
null
null
UTF-8
Swift
false
false
8,035
swift
// // committeehouseViewController.swift // hxytest // // Created by apple apple on 16/11/24. // Copyright © 2016年 xiyanhu. All rights reserved. // import UIKit import Alamofire import SwiftyJSON import SDWebImage import SwiftSpinner var allDataForComHouseDetail = [[String : AnyObject]]() var allDataForCom = [[String : AnyObject]]() class committeehouseViewController: UIViewController,UITableViewDelegate, UITableViewDataSource, UISearchResultsUpdating, UISearchBarDelegate { var arrRes = [[String:AnyObject]]() //Array of dictionary var arrResAll = [[String:AnyObject]]() @IBOutlet var comHouseTable: UITableView! let searchController = UISearchController(searchResultsController:nil) var filterMembers = [[String : AnyObject]]() var searchIcon = "search" let btnNameh = UIButton() override func viewDidLoad() { super.viewDidLoad() comHouseTable.dataSource = self comHouseTable.delegate = self btnNameh.setImage(UIImage(named: searchIcon), for: .normal) btnNameh.frame = CGRect(x: 0, y: 0, width: 20, height: 20) btnNameh.addTarget(self, action: Selector("operateSearchBar"), for: .touchUpInside) //.... Set Right/Left Bar Button item let searchButton = UIBarButtonItem() searchButton.customView = btnNameh // navigationController?.navigationItem. self.tabBarController?.navigationItem.rightBarButtonItem = searchButton searchController.searchResultsUpdater = self searchController.dimsBackgroundDuringPresentation = false self.navigationController?.extendedLayoutIncludesOpaqueBars = true self.navigationController?.navigationBar.isTranslucent = false self.navigationController?.definesPresentationContext = true self.searchController.hidesNavigationBarDuringPresentation = false self.tabBarController?.navigationItem.title = "Committees" Alamofire.request("http://104.198.0.197:8080/committees?&chamber=house&apikey=a7f9b14e379e4735bcec3569f9fa73b8&per_page=all").responseJSON { (responseData) -> Void in if((responseData.result.value) != nil) { let swiftyJsonVar = JSON(responseData.result.value!) let resultsPart = swiftyJsonVar["results"] if var resData = resultsPart.arrayObject { self.arrRes = resData as! [[String:AnyObject]] let dataDiscriptor = NSSortDescriptor(key: "name", ascending: true, selector: #selector(NSString.caseInsensitiveCompare(_:))) resData = (self.arrRes as NSArray).sortedArray(using: [dataDiscriptor]) self.arrRes = resData as! [[String:AnyObject]] allDataForComHouseDetail = self.arrRes } if self.arrRes.count > 0 { self.comHouseTable.reloadData() } } } Alamofire.request("http://104.198.0.197:8080/committees?apikey=a7f9b14e379e4735bcec3569f9fa73b8&per_page=all").responseJSON { (responseData) -> Void in if((responseData.result.value) != nil) { let swiftyJsonVar = JSON(responseData.result.value!) let resultsPart = swiftyJsonVar["results"] if let resData = resultsPart.arrayObject { self.arrResAll = resData as! [[String:AnyObject]] allDataForCom = self.arrResAll } } } } func filterContextForSearch(searchText:String){ filterMembers = arrRes.filter{ member in let titleMatch = (member["name"] as? String)?.lowercased().range(of: searchText.lowercased()) != nil return titleMatch } self.comHouseTable.reloadData() } func updateSearchResults(for searchController: UISearchController){ filterContextForSearch(searchText: searchController.searchBar.text!) } func operateSearchBar(){ print("yes!") if (searchIcon == "search"){ searchIcon = "cancel" btnNameh.setImage(UIImage(named: searchIcon), for: .normal) btnNameh.frame = CGRect(x: 0, y: 0, width: 20, height: 20) let searchButton = UIBarButtonItem() searchButton.customView = btnNameh self.tabBarController?.navigationItem.rightBarButtonItem = searchButton searchController.searchBar.isHidden = false searchController.searchBar.showsCancelButton = false self.tabBarController?.navigationItem.titleView = searchController.searchBar } else if (searchIcon == "cancel"){ searchIcon = "search" btnNameh.setImage(UIImage(named: searchIcon), for: .normal) btnNameh.frame = CGRect(x: 0, y: 0, width: 20, height: 20) let searchButton = UIBarButtonItem() searchButton.customView = btnNameh self.tabBarController?.navigationItem.rightBarButtonItem = searchButton searchController.searchBar.isHidden = true self.tabBarController?.navigationItem.titleView = nil self.tabBarController?.navigationItem.title = "Committees" } } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.setNavigationBarItem() SwiftSpinner.show(duration:0.5, title:"Fetching data...") self.tabBarController?.navigationItem.titleView = nil self.tabBarController?.navigationItem.title = "Committees" btnNameh.setImage(UIImage(named: "search"), for: .normal) btnNameh.frame = CGRect(x: 0, y: 0, width: 20, height: 20) let searchButtonS = UIBarButtonItem() searchButtonS.customView = btnNameh self.tabBarController?.navigationItem.rightBarButtonItem = searchButtonS searchController.searchBar.showsCancelButton = false searchController.searchBar.text! = "" } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let comHouseCell : UITableViewCell = tableView.dequeueReusableCell(withIdentifier: "comHouseCell")! var dict = arrRes[(indexPath as NSIndexPath).row] if searchController.searchBar.text != ""{ dict = filterMembers[(indexPath as NSIndexPath).row] } comHouseCell.textLabel?.text = dict["name"] as? String comHouseCell.detailTextLabel?.text = dict["committee_id"] as? String return comHouseCell } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if searchController.searchBar.text != ""{ return filterMembers.count } return self.arrRes.count } func tableView(_ tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath!) { // SwiftSpinner.show("Fetching data...") _ = tableView.indexPathForSelectedRow! if let _ = tableView.cellForRow(at: indexPath as IndexPath){ self.performSegue(withIdentifier: "commHouseToDetail", sender: self) } } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if (segue.identifier == "commHouseToDetail") { if let destination = segue.destination as? CommitteesDetailViewController{ let path = comHouseTable.indexPathForSelectedRow! let cell = comHouseTable.cellForRow(at: path as IndexPath) destination.passedCommId = (cell?.detailTextLabel?.text)! destination.passedData = allDataForCom // print(allDataForDetail) } } } }
[ -1 ]
f70ea36aaa3c972bdc9f098622496c94bc2f0741
c705510a7708016afdf1b8409d16d62c81cad1c6
/twitter_alamofire_demo/DetailViewController.swift
0db8933051def274d489e32314114a8ca232527f
[ "Apache-2.0" ]
permissive
I-RodX/TwitterCST495
372f40d4fa867b6c3e69c7d94e213a135c87b1dd
9bd3ffdb70e74f223a2e9cb142e795d9908eb0fc
refs/heads/master
2020-03-31T15:23:30.132085
2018-10-17T05:30:20
2018-10-17T05:30:20
152,335,053
0
0
null
null
null
null
UTF-8
Swift
false
false
4,631
swift
// // DetailViewController.swift // twitter_alamofire_demo // // Created by Isaac on 10/13/18. // Copyright © 2018 Charles Hieger. All rights reserved. // import UIKit class DetailViewController: UIViewController { @IBOutlet weak var detailImage: UIImageView! @IBOutlet weak var detailName: UILabel! @IBOutlet weak var detailHandle: UILabel! @IBOutlet weak var detailText: UILabel! @IBOutlet weak var detailCreatedAt: UILabel! @IBOutlet weak var detailRetweet: UIButton! @IBOutlet weak var detailRetweetCount: UILabel! @IBOutlet weak var detailFavorite: UIButton! @IBOutlet weak var detailFavoriteCount: UILabel! var tweet: Tweet! override func viewDidLoad() { super.viewDidLoad() refreshData() // Do any additional setup after loading the view. } @IBAction func didTapRetweet(_ sender: Any) { if(tweet.retweeted == false){ tweet.retweeted = true tweet.retweetCount += 1 refreshData() APIManager.shared.retweet(with: tweet) { (tweet: Tweet?, error: Error?) in if let error = error { print("Error Retweeting tweet: \(error.localizedDescription)") } else if let tweet = tweet { print("Successfully Retweeted the following Tweet: \n\(tweet.text)") } } } else{ tweet.retweeted = false tweet.retweetCount -= 1 refreshData() APIManager.shared.unretweet(with: tweet) { (tweet: Tweet?, error: Error?) in if let error = error { print("Error Unretweeting tweet: \(error.localizedDescription)") } else if let tweet = tweet { print("Successfully Unretweeted the following Tweet: \n\(tweet.text)") } } } } @IBAction func didTapFavorite(_ sender: Any) { if(tweet.favorited == false){ tweet.favorited = true tweet.favoriteCount += 1 refreshData() APIManager.shared.favorite(tweet) { (tweet: Tweet?, error: Error?) in if let error = error { print("Error favoriting tweet: \(error.localizedDescription)") } else if let tweet = tweet { print("Successfully favorited the following Tweet: \n\(tweet.text)") } } } else{ tweet.favorited = false tweet.favoriteCount -= 1 refreshData() APIManager.shared.unfavorite(tweet) { (tweet: Tweet?, error: Error?) in if let error = error { print("Error unfavoriting tweet: \(error.localizedDescription)") } else if let tweet = tweet { print("Successfully unfavorited the following Tweet: \n\(tweet.text)") } } } } func refreshData(){ detailName.text = tweet.user?.name detailHandle.text = "@" + (tweet.user?.screenName)! detailText.text = tweet.text detailCreatedAt.text = tweet.createdAtString detailRetweetCount.text = String(tweet.retweetCount) detailFavoriteCount.text = String(tweet.favoriteCount) if(tweet.favorited)!{ detailFavorite.setImage(#imageLiteral(resourceName: "favor-icon-red"), for: .normal) } if(tweet.favorited == false){ detailFavorite.setImage(#imageLiteral(resourceName: "favor-icon"), for: .normal) } if(tweet.retweeted){ detailRetweet.setImage(#imageLiteral(resourceName: "retweet-icon-green"), for: .normal) } if(tweet.retweeted==false){ detailRetweet.setImage(#imageLiteral(resourceName: "retweet-icon"), for: .normal) } let profileImage = NSURL(string: tweet.user!.profilePhoto!) detailImage.setImageWith(profileImage! as URL) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
e5eebb02a19cbd686cf00fcf67c7b0e12fd6ebb4
76eb059ac0ed68a89583fefb3b35db6216b4eabd
/Source/SwiftLintFramework/Rules/IdentifierNameRule.swift
65c86e207c07177b098da2d760b54cb325b6bc3a
[ "MIT" ]
permissive
masters3d/SwiftLint
71fb48b8229a271da13e31b1d88ce7f656ee6424
4f4894ca12457f553bb496ffa26b7927d4496ced
refs/heads/master
2020-07-14T19:00:26.539633
2017-03-24T04:17:57
2017-03-24T04:17:57
62,965,662
0
0
MIT
2018-05-08T07:28:32
2016-07-09T19:26:24
Swift
UTF-8
Swift
false
false
5,556
swift
// // IdentifierNameRule.swift // SwiftLint // // Created by JP Simard on 5/16/15. // Copyright © 2015 Realm. All rights reserved. // import Foundation import SourceKittenFramework public struct IdentifierNameRule: ASTRule, ConfigurationProviderRule { public var configuration = NameConfiguration(minLengthWarning: 3, minLengthError: 2, maxLengthWarning: 40, maxLengthError: 60) public init() {} public static let description = RuleDescription( identifier: "identifier_name", name: "Identifier Name", description: "Identifier names should only contain alphanumeric characters and " + "start with a lowercase character or should only contain capital letters. " + "In an exception to the above, variable names may start with a capital letter " + "when they are declared static and immutable. Variable names should not be too " + "long or too short.", nonTriggeringExamples: IdentifierNameRuleExamples.swift3NonTriggeringExamples, triggeringExamples: IdentifierNameRuleExamples.swift3TriggeringExamples, deprecatedAliases: ["variable_name"] ) public func validate(file: File, kind: SwiftDeclarationKind, dictionary: [String: SourceKitRepresentable]) -> [StyleViolation] { guard !dictionary.enclosedSwiftAttributes.contains("source.decl.attribute.override") else { return [] } return validateName(dictionary: dictionary, kind: kind).map { name, offset in guard !configuration.excluded.contains(name) else { return [] } let isFunction = SwiftDeclarationKind.functionKinds().contains(kind) let description = type(of: self).description let type = self.type(for: kind) if !isFunction { if !CharacterSet.alphanumerics.isSuperset(ofCharactersIn: name) { return [ StyleViolation(ruleDescription: description, severity: .error, location: Location(file: file, byteOffset: offset), reason: "\(type) name should only contain alphanumeric " + "characters: '\(name)'") ] } if let severity = severity(forLength: name.characters.count) { let reason = "\(type) name should be between " + "\(configuration.minLengthThreshold) and " + "\(configuration.maxLengthThreshold) characters long: '\(name)'" return [ StyleViolation(ruleDescription: type(of: self).description, severity: severity, location: Location(file: file, byteOffset: offset), reason: reason) ] } } if kind != .varStatic && name.isViolatingCase && !name.isOperator { let reason = "\(type) name should start with a lowercase character: '\(name)'" return [ StyleViolation(ruleDescription: description, severity: .error, location: Location(file: file, byteOffset: offset), reason: reason) ] } return [] } ?? [] } private func validateName(dictionary: [String: SourceKitRepresentable], kind: SwiftDeclarationKind) -> (name: String, offset: Int)? { guard let name = dictionary.name, let offset = dictionary.offset, kinds(for: .current).contains(kind), !name.hasPrefix("$") else { return nil } return (name.nameStrippingLeadingUnderscoreIfPrivate(dictionary), offset) } private func kinds(for version: SwiftVersion) -> [SwiftDeclarationKind] { let common = SwiftDeclarationKind.variableKinds() + SwiftDeclarationKind.functionKinds() switch version { case .two, .twoPointThree: return common case .three: return common + [.enumelement] } } private func type(for kind: SwiftDeclarationKind) -> String { if SwiftDeclarationKind.functionKinds().contains(kind) { return "Function" } else if kind == .enumelement { return "Enum element" } else { return "Variable" } } } fileprivate extension String { var isViolatingCase: Bool { let secondIndex = characters.index(after: startIndex) let firstCharacter = substring(to: secondIndex) guard firstCharacter.isUppercase() else { return false } guard characters.count > 1 else { return true } let range = secondIndex..<characters.index(after: secondIndex) let secondCharacter = substring(with: range) return secondCharacter.isLowercase() } var isOperator: Bool { let operators = ["/", "=", "-", "+", "!", "*", "|", "^", "~", "?", ".", "%", "<", ">", "&"] return !operators.filter(hasPrefix).isEmpty } }
[ -1 ]
74eb16f549905207021c07a98bcc1622ad529ab7
274738b9c0959c6cd7b66e817ccf7a05c412b573
/HW7/PhakamadS-MockRemote3/PhakamadS-MockRemote3/SceneDelegate.swift
b7d20f7d8632c832b5d9246346b06b7cd86f85c3
[]
no_license
brightpk/CSC-471-Mobile-Application-Development-iOS
89b03c18911e8b34dd62239677e05f0e001c7ef6
76b0b5e666678fe12f788089e3392b595ea398e8
refs/heads/master
2021-05-18T22:41:11.459112
2020-03-31T00:47:07
2020-03-31T00:47:07
251,460,135
0
0
null
null
null
null
UTF-8
Swift
false
false
2,369
swift
// // SceneDelegate.swift // PhakamadS-MockRemote3 // // Created by Bright Phakamad on 2/24/20. // Copyright © 2020 DePaul University. All rights reserved. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 352294, 344103, 393260, 393269, 213049, 376890, 385082, 16444, 393277, 376906, 327757, 254032, 286804, 368728, 254045, 368736, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 286889, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 180432, 377047, 418008, 385243, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 336124, 385281, 336129, 262405, 180491, 336140, 164107, 262417, 368913, 262423, 377118, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 270687, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 262551, 262553, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 336326, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 98819, 164362, 328207, 410129, 393748, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 270922, 385610, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 336513, 377473, 336517, 344710, 385671, 148106, 377485, 352919, 98969, 336549, 344745, 361130, 336556, 385714, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 418508, 385743, 385749, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 271154, 328498, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 328523, 336715, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 222129, 345036, 115661, 386004, 345046, 386012, 386019, 386023, 328690, 435188, 328703, 328710, 418822, 377867, 328715, 386070, 271382, 336922, 345119, 377888, 328747, 214060, 345134, 345139, 361525, 361537, 377931, 197708, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 386168, 361594, 410746, 214150, 345224, 386187, 337048, 345247, 361645, 337072, 345268, 337076, 402615, 361657, 402636, 328925, 165086, 165092, 328933, 222438, 328942, 386286, 386292, 206084, 115973, 328967, 345377, 345380, 353572, 345383, 337207, 345400, 378170, 369979, 386366, 337224, 337230, 337235, 263509, 353634, 337252, 402792, 345449, 99692, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 337330, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 419360, 370208, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 206397, 214594, 419401, 353868, 419404, 173648, 419408, 214611, 419412, 403040, 345702, 222831, 370298, 353920, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 403139, 337607, 419528, 419531, 272083, 394967, 419543, 419545, 345819, 419548, 181982, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 141052, 337661, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 116512, 378664, 354107, 345916, 354112, 247618, 370504, 329545, 345932, 354124, 370510, 247639, 337751, 370520, 313181, 182110, 354143, 354157, 345965, 345968, 345971, 345975, 182136, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 247760, 346064, 346069, 329699, 354275, 190440, 247790, 354314, 346140, 337980, 436290, 395340, 378956, 436307, 338005, 329816, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 387250, 379067, 387261, 256193, 395467, 346317, 411862, 256214, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 436474, 321787, 379135, 411905, 411917, 43279, 379154, 395539, 387350, 387353, 338201, 182559, 338212, 395567, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 182642, 321911, 420237, 379279, 272787, 354728, 338353, 338363, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 248309, 199165, 248332, 330254, 199182, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 191085, 338544, 191093, 346743, 330384, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 264919, 256735, 338661, 338665, 264942, 330479, 363252, 338680, 207620, 264965, 191240, 338701, 256787, 363294, 199455, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 330581, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 355185, 330612, 330643, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 437219, 257009, 265208, 330750, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 330830, 248915, 183384, 339037, 412765, 257121, 322660, 265321, 330869, 248952, 420985, 330886, 330890, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 322763, 330959, 330966, 265433, 265438, 388320, 363757, 388348, 339199, 396552, 175376, 175397, 208167, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 437576, 437584, 331089, 437588, 396634, 175451, 437596, 429408, 175458, 208228, 175461, 175464, 265581, 331124, 175478, 249210, 175484, 175487, 249215, 175491, 249219, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 339401, 380364, 339406, 372177, 339414, 249303, 413143, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 339464, 249355, 208399, 380433, 175637, 405017, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 339572, 224885, 224888, 224891, 224895, 126597, 421509, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 339696, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 397089, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 323404, 257869, 257872, 225105, 339795, 397140, 225109, 225113, 257884, 257887, 225120, 257891, 413539, 225128, 257897, 225138, 339827, 225142, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 184245, 372698, 372704, 372707, 356336, 380919, 393215, 372739, 405534, 266295, 266298, 217158, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 250012, 225439, 135328, 192674, 225442, 438434, 225445, 225448, 438441, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 356580, 225511, 225515, 225519, 381177, 397572, 389381, 356631, 356638, 356641, 356644, 356647, 266537, 389417, 356650, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 332098, 201030, 348489, 332107, 151884, 430422, 348503, 332118, 250203, 332130, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 332162, 389507, 348548, 356741, 250239, 332175, 160152, 373146, 373149, 70048, 356783, 266688, 324032, 201158, 340452, 127473, 217590, 340473, 324095, 324100, 324103, 324112, 340501, 324118, 324122, 340512, 332325, 324134, 381483, 356908, 324141, 324143, 356917, 324150, 324156, 168509, 348734, 324161, 324165, 356935, 348745, 381513, 324171, 324174, 324177, 332381, 373344, 340580, 348777, 381546, 119432, 340628, 184983, 373399, 340639, 258723, 332455, 332460, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 373499, 348926, 389927, 348979, 152371, 398141, 127815, 357202, 389971, 357208, 136024, 389979, 430940, 357212, 357215, 201580, 201583, 349041, 340850, 201589, 381815, 430967, 324473, 398202, 340859, 324476, 430973, 119675, 324479, 340863, 324482, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 398246, 373672, 324525, 5040, 111539, 324534, 5047, 324539, 324542, 398280, 349129, 340940, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 349173, 381947, 201724, 349181, 431100, 431107, 349203, 209944, 209948, 250915, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 431180, 209996, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 160896, 349313, 152704, 210053, 210056, 349320, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 333010, 210132, 333016, 210139, 210144, 218355, 251123, 218361, 275709, 128254, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 251211, 210261, 365912, 259423, 374113, 251236, 374118, 234867, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 210357, 259516, 415168, 366035, 415187, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 415271, 382503, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 333387, 333396, 333400, 366173, 333415, 423529, 423533, 333423, 210547, 415354, 333440, 267910, 267929, 333472, 333512, 259789, 358100, 366301, 333535, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333593, 333595, 210720, 366384, 358192, 210740, 366388, 358201, 399166, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 268144, 358256, 358260, 399222, 325494, 186233, 333690, 243584, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 382898, 333767, 358348, 333777, 219094, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 268299, 333838, 350225, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 252021, 342134, 374904, 268435, 333989, 333998, 334012, 260299, 350411, 350417, 350423, 211161, 350426, 334047, 350449, 375027, 358645, 350454, 350459, 350462, 350465, 350469, 325895, 268553, 194829, 350477, 268560, 350481, 432406, 350487, 350491, 350494, 325920, 350500, 350505, 358701, 391469, 350510, 358705, 358714, 358717, 383307, 358738, 334162, 383331, 383334, 391531, 383342, 334204, 268669, 194942, 391564, 366991, 334224, 342431, 375209, 326059, 375220, 342453, 334263, 326087, 358857, 195041, 334306, 334312, 104940, 375279, 162289, 350724, 186898, 342546, 350740, 342551, 334359, 342555, 334364, 416294, 350762, 252463, 358962, 334386, 334397, 358973, 252483, 219719, 399957, 244309, 334425, 326240, 375401, 334466, 334469, 162446, 326291, 342680, 342685, 260767, 342711, 244410, 260798, 334530, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 342769, 203508, 375541, 342777, 391938, 391949, 375569, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 260925, 375616, 326468, 244552, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 326503, 433001, 326508, 400238, 326511, 211826, 211832, 392061, 351102, 252801, 260993, 400260, 211846, 342921, 342931, 252823, 400279, 392092, 400286, 359335, 211885, 400307, 351169, 359362, 351172, 170950, 187335, 326599, 359367, 359383, 359389, 383968, 343018, 359411, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 261166, 359471, 375868, 384099, 384102, 384108, 367724, 326764, 187503, 343155, 384115, 212095, 384136, 384140, 384144, 351382, 384152, 384158, 384161, 351399, 384169, 367795, 244917, 384182, 384189, 384192, 351424, 343232, 244934, 367817, 244938, 384202, 253132, 326858, 343246, 384209, 146644, 351450, 384225, 359650, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 359695, 261391, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 343399, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 343453, 245152, 245155, 155045, 245158, 40358, 245163, 114093, 327090, 343478, 359867, 384444, 146878, 327108, 327112, 384457, 327118, 359887, 359891, 343509, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 359948, 359951, 245295, 359984, 400977, 400982, 179803, 155241, 138865, 155255, 155274, 368289, 245410, 425639, 245415, 425652, 425663, 155328, 245463, 155352, 155356, 212700, 155364, 245477, 155372, 245487, 212723, 245495, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 155488, 376672, 155492, 327532, 261997, 376686, 262000, 262003, 425846, 262006, 147319, 262009, 327542, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 311244, 212945, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 155647 ]
6f2b46a3df5dbd3863f74b8c6f9d952649d4d993
808ebc3e4c524593f159d957423a1a555ace288d
/Voy/Classes/Controllers/Alert/VOYAlertViewController.swift
38d12e694584e56ad9a88f782bf411b54c29f704
[]
no_license
Ilhasoft/voy-ios
de88d67f7fd46e1187977f9856c56472df57e6c4
f1f180a7687d90943fd9907b99ee3300b486c687
refs/heads/master
2022-11-23T13:26:45.018955
2018-02-06T21:02:07
2018-02-06T21:02:07
276,160,970
0
1
null
null
null
null
UTF-8
Swift
false
false
2,683
swift
// // VOYAlertViewController.swift // Voy // // Created by Daniel Amaral on 30/01/18. // Copyright © 2018 Ilhasoft. All rights reserved. // import UIKit protocol VOYAlertViewControllerDelegate { func buttonDidTap(alertController:VOYAlertViewController, button:UIButton, index:Int) } class VOYAlertViewController: ISModalViewController { @IBOutlet private var lbTitle:UILabel! @IBOutlet private var lbMessage:UILabel! @IBOutlet private var stackView:UIStackView! @IBOutlet weak var heightStackView: NSLayoutConstraint! private var buttonHeight = 49 private var buttonNames = [String]() private var messageTitle = "title" private var message = "message" var delegate:VOYAlertViewControllerDelegate? init(title:String,message:String,buttonNames:[String]? = ["Ok"]) { self.messageTitle = title self.message = message self.buttonNames = buttonNames! super.init(nibName: "VOYAlertViewController", bundle: nil) } override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { super.init(nibName: "VOYAlertViewController", bundle: nibBundleOrNil) } required public init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = self.view.backgroundColor?.withAlphaComponent(0) setupLayout() } private func setupLayout() { self.lbTitle.text = messageTitle self.lbMessage.text = message self.heightStackView.constant = CGFloat(buttonHeight * buttonNames.count) self.view.layoutIfNeeded() for (index,buttonName) in buttonNames.enumerated() { let button = UIButton() button.titleLabel!.font = UIFont.systemFont(ofSize: 16) button.layer.borderWidth = 1 button.layer.borderColor = VOYConstant.Color.gray.cgColor button.setTitleColor(UIColor(hex: "4a90e2"), for: .normal) button.setTitle(buttonName, for: .normal) button.backgroundColor = UIColor.white button.tag = index let tapGesture = UITapGestureRecognizer(target: self, action: #selector(buttonTapped)) button.addGestureRecognizer(tapGesture) self.stackView.addArrangedSubview(button) } } @objc private func buttonTapped(gesture:UIGestureRecognizer) { let button = gesture.view as! UIButton self.delegate?.buttonDidTap(alertController:self, button: button, index: button.tag) } }
[ -1 ]
8bdbb0bdf5a0bac9fb61a7075c4a6f5024c0f3d0
828d311950ee1ca6be44331de366e173bf4eefc7
/PresentationModels/source/PresentationModels/LogIn/LoginWithEmailPresentationModelActionEvent.swift
fbbcb0660bf1ea046632d5f121bbd3144984c767
[]
no_license
artemch/CocoaHeads_Workshop_2019
d31f32cbdfb8844b082cefd095d36beaeb3d31e4
a98f2f59a922a0b671608971aa7ba3fc95be5b37
refs/heads/master
2020-06-25T05:20:03.998848
2019-07-27T20:58:56
2019-07-27T20:58:56
199,212,733
11
4
null
null
null
null
UTF-8
Swift
false
false
442
swift
import Foundation import Models import ReactiveSwift import Result public enum EventActionLoginWithEmail: EventActionType { case back case loggedIn case resetPassword case doNotHaveAccount } public protocol LoginWithEmailPresentationModelActionEvent { typealias EventAction = EventActionLoginWithEmail typealias EventSignalType = Signal<EventAction, NoError> var actionEvent: EventSignalType { get } }
[ -1 ]
5a9ecb0c5d654c4456c5e83a3a6e6c5c68f1b0e8
167c9c06e1951dedfba396320810becf9a312865
/CleanArchitectureSampleCode/Presentation/Common/Rx/Rx+Observable.swift
152bee19282fd40739c39eef4e79229acff0577f
[ "MIT" ]
permissive
minyingwu/MVVMC-RxSwift-SampleCode
fffd54f46f5b1cf10ede9547c69ace594f47b72f
be296cb1161f2f396895e45c97dd7c2fcb224f68
refs/heads/main
2023-04-23T15:32:47.153444
2021-05-12T09:12:15
2021-05-12T09:12:15
363,992,120
0
0
null
null
null
null
UTF-8
Swift
false
false
308
swift
// // Rx+Observable.swift // CleanArchitectureSampleCode // // Created by Victor on 2021/5/1. // import RxSwift import RxCocoa extension Observable { public func unwrap<Result>() -> Observable<Result> where Element == Result? { return self.filter { $0 != nil }.map { $0! } } }
[ -1 ]
4adb515ec9305660711fa9b91202c1350df99c5d
9d0b6a1f631d946d477b42059e27b0f0e21470f8
/AppSchool/New Group/WebCellView.swift
fe05d1b3659e048dc9cb542dc5e03514f07dd8ae
[]
no_license
Ahmaddar18/AppSchool
ca3954bec8d043bcc21afd1fc9395801fe59ec63
5cd770c4b3e6f79baec5169029a2574fcb893a09
refs/heads/master
2021-05-11T05:57:55.849963
2018-05-07T19:44:22
2018-05-07T19:44:22
117,897,533
0
0
null
null
null
null
UTF-8
Swift
false
false
1,310
swift
// // WebCellView.swift // AppSchool // // Created by Fasih on 1/30/18. // Copyright © 2018 Ahmad. All rights reserved. // import UIKit class WebCellView: UITableViewCell { @IBOutlet weak var viewInner: UIView! @IBOutlet weak var btnWeb: UIButton! @IBOutlet weak var lblTopLine: UILabel! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } func dropShadow() { viewInner.layer.shadowColor = UIColor.lightGray.cgColor viewInner.layer.shadowOpacity = 1 viewInner.layer.shadowOffset = CGSize(width: 0.0, height: 0.0) viewInner.layer.shadowRadius = 3 } func underline() { guard let text = btnWeb.titleLabel?.text else { return } let attributedString = NSMutableAttributedString(string: text) attributedString.addAttribute(NSAttributedStringKey.underlineStyle, value: NSUnderlineStyle.styleSingle.rawValue, range: NSRange(location: 0, length: text.count)) btnWeb.setAttributedTitle(attributedString, for: .normal) } }
[ -1 ]
e0ae394e6c58d2642ed5c83a2442cfcbd34bf5eb
38435951da1b70d42616f07a039cccd848824e5c
/Annex/Realm/Form.swift
8a19ec7942cd10f56eef6d07c7e88373e8fdd843
[]
no_license
ThePowerOfSwift/Annex
b0ee50f107a9a43d180dc4cfc21d744db87bdaa1
a1723acf789c318061f113132b47884f80d01f7f
refs/heads/master
2022-02-26T21:09:08.281997
2019-10-18T20:10:33
2019-10-18T20:10:33
null
0
0
null
null
null
null
UTF-8
Swift
false
false
903
swift
// // Form.swift // Annex // // Created by Wesley Espinoza on 1/10/19. // Copyright © 2019 ErespiStudios. All rights reserved. // import Foundation import UIKit import RealmSwift class Form: Object{ @objc dynamic var lender: String = "" @objc dynamic var lenderAddress: String = "" @objc dynamic var lendee: String = "" @objc dynamic var lendeeAddress: String = "" @objc dynamic var amount: String = "" @objc dynamic var lenderSignatureData: Data? @objc dynamic var lendeeSignatureData: Data? @objc dynamic var creationDate: String = "" @objc dynamic var dueDate: String = "" @objc dynamic var day: String = "" @objc dynamic var month: String = "" @objc dynamic var year: String = "" @objc dynamic var state: String = "" @objc dynamic var city: String = "" @objc dynamic var dateObj: Date! @objc dynamic var uniqueId: String = "" }
[ -1 ]
561ecebdeda2e77a8f9aad20d189d0aa61cbff7f
c5e758efbcc60b7d7a2e122638910dfd2d56e76b
/Showcase-iOS/Helpers/UIVIewUtilities/LoadingView.swift
34dfaf00a58d0376a3fb1517b3eb0a5b13b041c9
[]
no_license
DVT/ShowcaseiOS
8dd4d085da86210c2e9407fd61a8a6b462be2e30
a824b1cca535fd751d387f687bf9bc4a387a09dd
refs/heads/develop
2021-06-08T06:28:01.705633
2019-11-04T10:19:00
2019-11-04T10:19:00
129,877,320
4
2
null
2019-11-04T10:19:02
2018-04-17T09:08:14
Swift
UTF-8
Swift
false
false
665
swift
import UIKit class LoadingView: UIView { // MARK: @IBOutlet(s) @IBOutlet var contentView: UIView! // MARK: Operation(s) override init(frame: CGRect) { super.init(frame: frame) commonInit() } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) commonInit() } func commonInit() { guard let view = Bundle.main.loadNibNamed("LoadingView", owner: self, options: nil)?.first as? UIView else { return } view.frame = self.bounds self.addSubview(view) } }
[ -1 ]
6297932b04a62cee1c7dd11c1a264cf5bd37fdc7
59d16115c8b8a93d500a8064de751bd03553ecf1
/BitcoinTicker/Model/PriceModel.swift
baf26f0c8cd0350a3fc4df011adc7575fc10e570
[]
no_license
hardt-rmt/Bitcoin-Price-Tracker
9eb5fdb92e61fac213a9eb0aba88748efa8bf771
716aa0720abd5dc2b431b6a91b1daecc0faa8aa5
refs/heads/master
2023-01-24T16:09:57.477319
2020-12-05T07:48:23
2020-12-05T07:48:23
152,734,478
0
0
null
null
null
null
UTF-8
Swift
false
false
269
swift
// // File.swift // BitcoinTicker // // Created by Bernhardt Ramat on 8/28/18. // import UIKit class PriceDataModel { var currentPrice : Double = 0.00 var lastPrice : Double = 0.00 var highestPrice : Double = 0.00 var lowestPrice : Double = 0.00 }
[ -1 ]
7f96943e5f73383532fd6a69e44db65fca64de3f
662746b9144abfe4667fcd4f121d82a54f16d75d
/Sources/piction-ios/Extension/UILabel+Extension.swift
b1f5659fcfdea91369b70077f420bd7c5adca9f0
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
piction-protocol/piction-ios
801108fb31e808dfb0e63de4c6de45e5bfaa2b56
29889ab82aef2511fe716bc90b613dfa54e1d8ed
refs/heads/master
2020-07-31T19:21:35.766615
2020-06-05T03:00:22
2020-06-05T03:00:22
210,724,265
2
1
Apache-2.0
2020-06-05T02:24:36
2019-09-25T00:49:48
Swift
UTF-8
Swift
false
false
3,031
swift
// // UILabel+Extension.swift // piction-ios // // Created by jhseo on 18/10/2019. // Copyright © 2017년 thewhalegames. All rights reserved. // import UIKit @IBDesignable class UILabelExtension: UILabel, BorderLineConfigurable { // MARK: - Initializations override init(frame: CGRect) { super.init(frame: frame) configure() } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) configure() } // MARK: - BorderLineConfigurable @IBInspectable var borderColor: UIColor = UIColor.clear { didSet { layer.borderColor = borderColor.cgColor } } @IBInspectable var borderWidth: CGFloat = 1.0 { didSet { layer.borderWidth = borderWidth } } @IBInspectable var cornerRadius: CGFloat = 0.0 { didSet { configureRadius() } } @IBInspectable var topLeftRadius: Bool = false { didSet { configureRadius() } } @IBInspectable var topRightRadius: Bool = false { didSet { configureRadius() } } @IBInspectable var bottomLeftRadius: Bool = false { didSet { configureRadius() } } @IBInspectable var bottomRightRadius: Bool = false { didSet { configureRadius() } } @IBInspectable var letterSpacing: CGFloat = 1.0 { didSet { let attributedStr = self.attributedText?.mutableCopy() as! NSMutableAttributedString attributedStr.addAttribute(NSAttributedString.Key.kern, value: letterSpacing, range: NSRange(location: 0, length: attributedStr.length)) self.attributedText = attributedStr } } override func layoutSubviews() { super.layoutSubviews() configureRadius() } // MARK: - private method private func configure() { layer.borderColor = borderColor.cgColor layer.borderWidth = borderWidth configureRadius() } private func configureRadius() { guard cornerRadius > 0 else { return } guard topLeftRadius || topRightRadius || bottomLeftRadius || bottomRightRadius else { layer.cornerRadius = cornerRadius layer.masksToBounds = cornerRadius > 0 return } var corners = UIRectCorner() if topLeftRadius { corners.insert(.topLeft) } if topRightRadius { corners.insert(.topRight) } if bottomLeftRadius { corners.insert(.bottomLeft) } if bottomRightRadius { corners.insert(.bottomRight) } let path = UIBezierPath(roundedRect: self.bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: cornerRadius, height: cornerRadius)) let mask = CAShapeLayer() mask.path = path.cgPath layer.mask = mask layer.masksToBounds = cornerRadius > 0 } }
[ -1 ]
23735f399bd9fd4b1ae08757f299086a3c67ee0c
f68180971024234b755b190d457323d49f444ec7
/A Decade of Movies/A Decade of Movies/Models/FlickrPhotos.swift
ed0f9a1e5939ee5ef5235541acddfb3a568ea1c4
[]
no_license
nesreenM/A-Decade-of-Movies-Task
ede298c023adab4cc67ab6411946da18732cd125
f9ff4d57434867f1614aeee7e0d6bcfd77df3833
refs/heads/master
2020-05-24T18:29:02.356997
2019-05-19T12:22:12
2019-05-19T12:22:12
187,411,150
0
0
null
null
null
null
UTF-8
Swift
false
false
511
swift
// // FlickrPhotos.swift // A Decade of Movies // // Created by Nesreen Mamdouh on 5/19/19. // Copyright © 2019 swvl. All rights reserved. // import Foundation struct FlickrPhotos: Codable { let photos: Photos? let stat: String? } struct Photos: Codable { let page, pages, perpage: Int? let total: String? let photo: [Photo]? } struct Photo: Codable { let id, owner, secret, server: String? let farm: Int? let title: String? let ispublic, isfriend, isfamily: Int? }
[ -1 ]
851c7e23b2cf9758b17eb771b63328de218da458
89454eac126d3a7c56b5ab823e444a2015b9ce77
/swifty-demo/Controller/ViewController.swift
fd2a7a86cb5387389733887630c01dbcd7538163
[]
no_license
Nha-16/ios-panha-hw004
08cc23450818b003a71af24c3c8922bda1519916
62840cffc1865e5a5c17f0207129ec55cf411830
refs/heads/main
2023-08-30T04:15:55.453792
2021-11-12T13:08:54
2021-11-12T13:08:54
427,220,282
0
0
null
null
null
null
UTF-8
Swift
false
false
3,083
swift
// // ViewController.swift // swifty-demo // // Created by Mavin on 10/11/21. // import UIKit import ProgressHUD class ViewController: UIViewController { @IBOutlet weak var tableVIew: UITableView! var articles: [Article] = [] override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. // initializing the refreshControl tableVIew.refreshControl = UIRefreshControl() // add target to UIRefreshControl tableVIew.refreshControl?.addTarget(self, action: #selector(refresh), for: .valueChanged) fetch() } @objc func refresh(){ fetch() } func fetch(){ ProgressHUD.show() Network.shared.fetchArticles { result in switch result{ case .success(let articles): self.articles = articles self.tableVIew.reloadData() ProgressHUD.showSucceed("Get data successfully") self.tableVIew.refreshControl?.endRefreshing() case .failure(let error): ProgressHUD.showError(error.localizedDescription) self.tableVIew.refreshControl?.endRefreshing() } } } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "detailArticle" { if let desVC = segue.destination as? DetailtViewController, let indexPath = sender as? IndexPath{ let article = self.articles[indexPath.row] desVC.article = article } } } } extension ViewController: UITableViewDataSource, UITableViewDelegate{ func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { self.articles.count } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { performSegue(withIdentifier: "detailArticle", sender: indexPath) } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cellArticle", for: indexPath) as! ArticleTableViewCell cell.config(article: self.articles[indexPath.row]) return cell } func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { let deleteAction = UIContextualAction(style: .destructive, title: "delete") { _, _, _ in let deleteID = self.articles[indexPath.row].id Network.shared.removeArticles(id: deleteID) self.articles.remove(at: indexPath.row) self.tableVIew.deleteRows(at: [indexPath], with: .fade) } return UISwipeActionsConfiguration(actions: [deleteAction]) } }
[ -1 ]
299c163638a258080bcb8cd298688e341fe95425
2052ed0e11fd454666f66a3487381b84d266e0e1
/Sources/App/Models/Skill.swift
4f63ea5a167672c9bffffe13258b49e9fde558e6
[ "MIT" ]
permissive
imdanielsp/DResume
e2be6b2c1586c19b32ee9ba6cef47a30e00e5f61
74ea1126f811e05870b5f95b32d22274003124ad
refs/heads/master
2021-07-14T14:57:42.662085
2017-10-18T21:04:42
2017-10-18T21:04:42
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,006
swift
// // Skill.swift // App // // Created by Daniel Santos on 10/2/17. // import Vapor import FluentProvider import HTTP final class Skill: Model { public enum Level: Int { case none = 0 case beginner = 1 case average = 2 case intermidate = 3 case advance = 4 case expert = 5 case invalid = 0xff init(level: Int) { switch level { case 0: self = .none case 1: self = .beginner case 2: self = .average case 3: self = .intermidate case 4: self = .advance case 5: self = .expert default: self = .invalid } } } let storage = Storage() var name: String private var mLevel: Int var level: Level { get { return Level(level: self.mLevel) } set { self.mLevel = newValue.rawValue } } var userID: Identifier? static let nameKey = "name" static let levelKey = "level" static let userIDKey = "user_id" init(name: String, level: Int, user: User) { self.name = name self.mLevel = level self.userID = user.id self.level = Level(level: level) } required init(row: Row) throws { self.name = try row.get(Skill.nameKey) self.mLevel = try row.get(Skill.levelKey) self.level = Level(level: self.mLevel) self.userID = try row.get(User.foreignIdKey) } func makeRow() throws -> Row { var row = Row() try row.set(Skill.nameKey, self.name) try row.set(Skill.levelKey, self.mLevel) try row.set(User.foreignIdKey, self.userID) return row } func update(with json: JSON) throws { self.name = try json.get(Skill.nameKey) self.level = Level(level: try json.get(Skill.levelKey)) try self.save() } } // MARK: Relation extension Skill { var owner: Parent<Skill, User> { return parent(id: self.userID) } } // MARK: JSON extension Skill: JSONConvertible { convenience init(json: JSON) throws { let userID: Identifier = try json.get(Skill.userIDKey) guard let user = try User.find(userID) else { throw Abort.badRequest } try self.init( name: json.get(Skill.nameKey), level: json.get(Skill.levelKey), user: user ) } func makeJSON() throws -> JSON { var json = JSON() try json.set(Skill.idKey, self.id) try json.set(Skill.nameKey, self.name) try json.set(Skill.levelKey, self.level.rawValue) try json.set(Skill.userIDKey, self.userID) return json } } // MARK: HTTP extension Skill: ResponseRepresentable { } // MARK: Preparation extension Skill: Preparation { static func prepare(_ database: Database) throws { try database.create(self) { builder in builder.id() builder.string(Skill.nameKey) builder.int(Skill.levelKey) builder.parent(User.self) } } static func revert(_ database: Database) throws { try database.delete(self) } }
[ -1 ]
ddb5adee360c46e545422a0b9ddcfa01666dc86c
e350652896a5cfff6456d19b0234dd964c694748
/GeofencingTest/Model/Geofence.swift
b4e33d89668074c63bdf734ba7d60aa392a63fbd
[ "MIT" ]
permissive
zs40x/GeofencingTest
5db58ea7336051d3c971d0cddf9da7f95d1153f5
8e3b365a7e64ce5030dd5e8dbf25864595f99e14
refs/heads/master
2021-01-12T04:43:34.820956
2017-03-20T15:31:18
2017-03-20T15:31:18
77,778,166
0
0
null
null
null
null
UTF-8
Swift
false
false
2,856
swift
// // Geofence.swift // GeofencingTest // // Created by Stefan Mehnert on 05/01/2017. // Copyright © 2017 Stefan Mehnert. All rights reserved. // import Foundation import CoreLocation public enum GeofenceMonitoringMode: Int { case Entering = 0 case Exiting } public struct Geofence { let identifier: String let coordinate: CLLocationCoordinate2D let radius: Int let monitoringMode: GeofenceMonitoringMode init(identifier: String, coordinate: CLLocationCoordinate2D, radius: Int, monitoringMode: GeofenceMonitoringMode) { self.identifier = identifier self.coordinate = coordinate self.radius = radius self.monitoringMode = monitoringMode } init?(json : String) { guard let data = json.data(using: .utf8), let jsonDict = try? JSONSerialization.jsonObject(with: data, options: []) as? [String:String], let identifier = jsonDict?["identifier"], let longiture = jsonDict?["longitude"], let latitude = jsonDict?["latitude"], let radius = jsonDict?["radius"], let monitoringMode = jsonDict?["monitoringMode"] else { return nil } self.init( identifier: identifier, coordinate: CLLocationCoordinate2D(latitude: Double(latitude) ?? 0, longitude: Double(longiture) ?? 0), radius: Int(radius) ?? 0, monitoringMode: monitoringMode == "0" ? .Entering : .Exiting ) } var jsonRepresentation : String { let jsonDict = [ "identifier": identifier, "latitude" : String(coordinate.latitude), "longitude" : String(coordinate.longitude), "radius" : String(radius), "monitoringMode" : String(monitoringMode.rawValue) ] if let data = try? JSONSerialization.data(withJSONObject: jsonDict, options: []), let jsonString = String(data:data, encoding:.utf8) { return jsonString } else { return "" } } } extension Geofence: Equatable { } public func ==(rhs: Geofence, lhs: Geofence) -> Bool { guard rhs.identifier == rhs.identifier && rhs.coordinate.latitude == lhs.coordinate.latitude && rhs.coordinate.longitude == lhs.coordinate.longitude && rhs.radius == lhs.radius && rhs.monitoringMode == lhs.monitoringMode else { return false } return true } extension Geofence: Hashable { public var hashValue: Int { return identifier.hashValue ^ coordinate.latitude.hashValue ^ coordinate.longitude.hashValue ^ radius.hashValue ^ monitoringMode.hashValue } }
[ -1 ]
cdc096ddfa7c5f014465a2a6475962172670a7cb
b43c6c03eea348d68d6582c3594760bbe0ecaa08
/swift/SelfRequirement.swift
d8c0a2697715e706eab5ddab889f5ead6c61c1a8
[ "MIT" ]
permissive
imsardine/learning
1b41a13a4c71c8d9cdd8bd4ba264a3407f8e05f5
925841ddd93d60c740a62e12d9f57ef15b6e0a20
refs/heads/master
2022-12-22T18:23:24.764273
2020-02-21T01:35:40
2020-02-21T01:35:40
24,145,674
0
0
MIT
2022-12-14T20:43:28
2014-09-17T13:24:37
Python
UTF-8
Swift
false
false
773
swift
protocol Bootable { func boot() -> Self } extension Bootable { func boot() -> Self { print("Booting System? ...") return self } } final class SystemA: Bootable { let propertySpecificToA = "Blah blah ... A" func boot() -> SystemA { print("Booting SystemA ...") return self } } final class SystemB: Bootable { let propertySpecificToB = "Blha blah ... B" func boot() -> SystemB { print("Booting SystemB ...") return self } } final class SystemC: Bootable { let propertySpecificToC = "Blha blah ... C" } let a = SystemA() let b = SystemB() let c = SystemC() print(a.boot().propertySpecificToA) print(b.boot().propertySpecificToB) print(c.boot().propertySpecificToC)
[ -1 ]
83df651a358b56e5fddc8c703e12ab290b4cdeb2
18d6c7dcf6796bedbb17c21afc339b6319cf09b5
/PryntTrimmerView/Classes/Trimmer/PryntTrimmerView.swift
1755ddac072df0e00abd2dabcc88dff2a8163d1d
[ "MIT" ]
permissive
anhlahieupro/pod-PryntTrimmerView
9837c0186902a3e6bb105ec82d10f4c7dc3677a1
1019a27fc4297d69c9db40cf32ae557774afc92d
refs/heads/master
2022-10-22T22:29:59.088134
2020-04-19T14:02:46
2020-04-19T14:02:46
null
0
0
null
null
null
null
UTF-8
Swift
false
false
14,469
swift
// // PryntTrimmerView.swift // PryntTrimmerView // // Created by HHK on 27/03/2017. // Copyright © 2017 Prynt. All rights reserved. // import AVFoundation import UIKit public protocol TrimmerViewDelegate: class { func didChangePositionBar(_ playerTime: CMTime) func positionBarStoppedMoving(_ playerTime: CMTime) } /// A view to select a specific time range of a video. It consists of an asset preview with thumbnails inside a scroll view, two /// handles on the side to select the beginning and the end of the range, and a position bar to synchronize the control with a /// video preview, typically with an `AVPlayer`. /// Load the video by setting the `asset` property. Access the `startTime` and `endTime` of the view to get the selected time // range @IBDesignable public class TrimmerView: AVAssetTimeSelector { // MARK: - Properties // MARK: Color Customization @IBInspectable public var handleBackgroundColor: UIColor = .orange { didSet { updateColor() } } @IBInspectable public var maskBackgroundColor: UIColor = .white { didSet { updateColor() } } @IBInspectable public var maskAlpha: CGFloat = 0.7 { didSet { updateColor() } } /// The color of the main border of the view @IBInspectable public var mainColor: UIColor = UIColor.orange { didSet { updateColor() } } /// The color of the handles on the side of the view @IBInspectable public var handleColor: UIColor = UIColor.gray { didSet { updateColor() } } /// The color of the position indicator @IBInspectable public var positionBarColor: UIColor = UIColor.white { didSet { positionBar.backgroundColor = positionBarColor } } // MARK: Interface public weak var delegate: TrimmerViewDelegate? // MARK: Subviews private let trimView = UIView() public let leftHandleView = HandlerView() public let rightHandleView = HandlerView() private let positionBar = UIView() private let leftHandleKnob = UIView() private let rightHandleKnob = UIView() private let leftMaskView = UIView() private let rightMaskView = UIView() // MARK: Constraints private var currentLeftConstraint: CGFloat = 0 private var currentRightConstraint: CGFloat = 0 private var leftConstraint: NSLayoutConstraint? private var rightConstraint: NSLayoutConstraint? private var positionConstraint: NSLayoutConstraint? private let handleWidth: CGFloat = 15 /// The maximum duration allowed for the trimming. Change it before setting the asset, as the asset preview public var maxDuration: Double = 15 { didSet { assetPreview.maxDuration = maxDuration } } /// The minimum duration allowed for the trimming. The handles won't pan further if the minimum duration is attained. public var minDuration: Double = 3 // MARK: - View & constraints configurations override func setupSubviews() { super.setupSubviews() backgroundColor = UIColor.clear layer.zPosition = 1 setupTrimmerView() setupHandleView() setupMaskView() setupPositionBar() setupGestures() updateColor() } override func constrainAssetPreview() { assetPreview.leftAnchor.constraint(equalTo: leftAnchor, constant: handleWidth).isActive = true assetPreview.rightAnchor.constraint(equalTo: rightAnchor, constant: -handleWidth).isActive = true assetPreview.topAnchor.constraint(equalTo: topAnchor).isActive = true assetPreview.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true } private func setupTrimmerView() { trimView.layer.borderWidth = 2.0 trimView.layer.cornerRadius = 2.0 trimView.translatesAutoresizingMaskIntoConstraints = false trimView.isUserInteractionEnabled = false addSubview(trimView) trimView.topAnchor.constraint(equalTo: topAnchor).isActive = true trimView.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true leftConstraint = trimView.leftAnchor.constraint(equalTo: leftAnchor) rightConstraint = trimView.rightAnchor.constraint(equalTo: rightAnchor) leftConstraint?.isActive = true rightConstraint?.isActive = true } private func setupHandleView() { leftHandleView.isUserInteractionEnabled = true leftHandleView.layer.cornerRadius = 2.0 leftHandleView.translatesAutoresizingMaskIntoConstraints = false addSubview(leftHandleView) leftHandleView.heightAnchor.constraint(equalTo: heightAnchor).isActive = true leftHandleView.widthAnchor.constraint(equalToConstant: handleWidth).isActive = true leftHandleView.leftAnchor.constraint(equalTo: trimView.leftAnchor).isActive = true leftHandleView.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true leftHandleKnob.translatesAutoresizingMaskIntoConstraints = false leftHandleView.addSubview(leftHandleKnob) leftHandleKnob.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 0.5).isActive = true leftHandleKnob.widthAnchor.constraint(equalToConstant: 2).isActive = true leftHandleKnob.centerYAnchor.constraint(equalTo: leftHandleView.centerYAnchor).isActive = true leftHandleKnob.centerXAnchor.constraint(equalTo: leftHandleView.centerXAnchor).isActive = true rightHandleView.isUserInteractionEnabled = true rightHandleView.layer.cornerRadius = 2.0 rightHandleView.translatesAutoresizingMaskIntoConstraints = false addSubview(rightHandleView) rightHandleView.heightAnchor.constraint(equalTo: heightAnchor).isActive = true rightHandleView.widthAnchor.constraint(equalToConstant: handleWidth).isActive = true rightHandleView.rightAnchor.constraint(equalTo: trimView.rightAnchor).isActive = true rightHandleView.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true rightHandleKnob.translatesAutoresizingMaskIntoConstraints = false rightHandleView.addSubview(rightHandleKnob) rightHandleKnob.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 0.5).isActive = true rightHandleKnob.widthAnchor.constraint(equalToConstant: 2).isActive = true rightHandleKnob.centerYAnchor.constraint(equalTo: rightHandleView.centerYAnchor).isActive = true rightHandleKnob.centerXAnchor.constraint(equalTo: rightHandleView.centerXAnchor).isActive = true } private func setupMaskView() { leftMaskView.isUserInteractionEnabled = false leftMaskView.backgroundColor = maskBackgroundColor leftMaskView.alpha = maskAlpha leftMaskView.translatesAutoresizingMaskIntoConstraints = false insertSubview(leftMaskView, belowSubview: leftHandleView) leftMaskView.leftAnchor.constraint(equalTo: leftAnchor).isActive = true leftMaskView.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true leftMaskView.topAnchor.constraint(equalTo: topAnchor).isActive = true leftMaskView.rightAnchor.constraint(equalTo: leftHandleView.centerXAnchor).isActive = true rightMaskView.isUserInteractionEnabled = false rightMaskView.backgroundColor = maskBackgroundColor rightMaskView.alpha = maskAlpha rightMaskView.translatesAutoresizingMaskIntoConstraints = false insertSubview(rightMaskView, belowSubview: rightHandleView) rightMaskView.rightAnchor.constraint(equalTo: rightAnchor).isActive = true rightMaskView.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true rightMaskView.topAnchor.constraint(equalTo: topAnchor).isActive = true rightMaskView.leftAnchor.constraint(equalTo: rightHandleView.centerXAnchor).isActive = true } private func setupPositionBar() { positionBar.frame = CGRect(x: 0, y: 0, width: 3, height: frame.height) positionBar.backgroundColor = positionBarColor positionBar.center = CGPoint(x: leftHandleView.frame.maxX, y: center.y) positionBar.layer.cornerRadius = 1 positionBar.translatesAutoresizingMaskIntoConstraints = false positionBar.isUserInteractionEnabled = false addSubview(positionBar) positionBar.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true positionBar.widthAnchor.constraint(equalToConstant: 3).isActive = true positionBar.heightAnchor.constraint(equalTo: heightAnchor).isActive = true positionConstraint = positionBar.leftAnchor.constraint(equalTo: leftHandleView.rightAnchor, constant: 0) positionConstraint?.isActive = true } private func setupGestures() { let leftPanGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(TrimmerView.handlePanGesture)) leftHandleView.addGestureRecognizer(leftPanGestureRecognizer) let rightPanGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(TrimmerView.handlePanGesture)) rightHandleView.addGestureRecognizer(rightPanGestureRecognizer) } private func updateColor() { trimView.layer.borderColor = mainColor.cgColor leftHandleView.backgroundColor = handleBackgroundColor rightHandleView.backgroundColor = handleBackgroundColor leftHandleKnob.backgroundColor = handleColor rightHandleKnob.backgroundColor = handleColor leftMaskView.backgroundColor = maskBackgroundColor leftMaskView.alpha = maskAlpha rightMaskView.backgroundColor = maskBackgroundColor rightMaskView.alpha = maskAlpha } // MARK: - Trim Gestures @objc func handlePanGesture(_ gestureRecognizer: UIPanGestureRecognizer) { guard let view = gestureRecognizer.view, let superView = gestureRecognizer.view?.superview else { return } let isLeftGesture = view == leftHandleView switch gestureRecognizer.state { case .began: if isLeftGesture { currentLeftConstraint = leftConstraint!.constant } else { currentRightConstraint = rightConstraint!.constant } updateSelectedTime(stoppedMoving: false) case .changed: let translation = gestureRecognizer.translation(in: superView) if isLeftGesture { updateLeftConstraint(with: translation) } else { updateRightConstraint(with: translation) } layoutIfNeeded() if let startTime = startTime, isLeftGesture { seek(to: startTime) } else if let endTime = endTime { seek(to: endTime) } updateSelectedTime(stoppedMoving: false) case .cancelled, .ended, .failed: updateSelectedTime(stoppedMoving: true) default: break } } private func updateLeftConstraint(with translation: CGPoint) { let maxConstraint = max(rightHandleView.frame.origin.x - handleWidth - minimumDistanceBetweenHandle, 0) let newConstraint = min(max(0, currentLeftConstraint + translation.x), maxConstraint) leftConstraint?.constant = newConstraint } private func updateRightConstraint(with translation: CGPoint) { let maxConstraint = min(2 * handleWidth - frame.width + leftHandleView.frame.origin.x + minimumDistanceBetweenHandle, 0) let newConstraint = max(min(0, currentRightConstraint + translation.x), maxConstraint) rightConstraint?.constant = newConstraint } // MARK: - Asset loading override func assetDidChange(newAsset: AVAsset?) { super.assetDidChange(newAsset: newAsset) resetHandleViewPosition() } private func resetHandleViewPosition() { leftConstraint?.constant = 0 rightConstraint?.constant = 0 layoutIfNeeded() } // MARK: - Time Equivalence /// Move the position bar to the given time. public func seek(to time: CMTime) { if let newPosition = getPosition(from: time) { let offsetPosition = newPosition - assetPreview.contentOffset.x - leftHandleView.frame.origin.x let maxPosition = rightHandleView.frame.origin.x - (leftHandleView.frame.origin.x + handleWidth) - positionBar.frame.width let normalizedPosition = min(max(0, offsetPosition), maxPosition) positionConstraint?.constant = normalizedPosition layoutIfNeeded() } } /// The selected start time for the current asset. public var startTime: CMTime? { let startPosition = leftHandleView.frame.origin.x + assetPreview.contentOffset.x return getTime(from: startPosition) } /// The selected end time for the current asset. public var endTime: CMTime? { let endPosition = rightHandleView.frame.origin.x + assetPreview.contentOffset.x - handleWidth return getTime(from: endPosition) } private func updateSelectedTime(stoppedMoving: Bool) { guard let playerTime = positionBarTime else { return } if stoppedMoving { delegate?.positionBarStoppedMoving(playerTime) } else { delegate?.didChangePositionBar(playerTime) } } private var positionBarTime: CMTime? { let barPosition = positionBar.frame.origin.x + assetPreview.contentOffset.x - handleWidth return getTime(from: barPosition) } private var minimumDistanceBetweenHandle: CGFloat { guard let asset = asset else { return 0 } return CGFloat(minDuration) * assetPreview.contentView.frame.width / CGFloat(asset.duration.seconds) } // MARK: - Scroll View Delegate public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { updateSelectedTime(stoppedMoving: true) } public func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) { if !decelerate { updateSelectedTime(stoppedMoving: true) } } public func scrollViewDidScroll(_ scrollView: UIScrollView) { updateSelectedTime(stoppedMoving: false) } }
[ 218930, 190235, 158236 ]
8f5b2e3c29111f310e52f57bde19f89f49fcf9e3
fdf6894579f49f276b4b334f9f61cefde4e83099
/Talki/Talki/Controllers/HomeViewControllers/IZBaseHomeViewController.swift
b215c164d60bde2648815717472a36a13c455e72
[]
no_license
gnik7/Talki_Dev
97e51ff351779dada1a694cf30f1d891d8448905
a6c6b4b006c58f32d89ec1620d4c272dd596f74f
refs/heads/master
2020-12-30T15:42:38.458005
2017-05-13T11:37:25
2017-05-13T11:37:25
91,170,015
0
0
null
null
null
null
UTF-8
Swift
false
false
5,599
swift
// // IZBaseHomeViewController.swift // Talki // // Created by Nikita Gil on 30.06.16. // Copyright © 2016 Inteza. All rights reserved. // import UIKit import TextFieldEffects /** - IZBaseHomeViewController is base for next ViewControllers | | | V V V IZHomeViewController | IZProfileViewController | IZMatchedHistoryViewController | IZSavedChatsViewController */ class IZBaseHomeViewController: UIViewController { @IBOutlet weak var topFunctionalPanelView : UIView! @IBOutlet weak var bottomNavigationPanelView : UIView! //var lazy var router :IZRouter = IZRouter(navigationController: self.navigationController!) lazy var tapGesture : UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(IZBaseHomeViewController.gestureTap)) var topFunctionalView :IZTopFunctionalPanel? var bottomNavigationView :IZBottomNavigationPanel? var alertView : IZAlertCustom? //***************************************************************** // MARK: - Init //***************************************************************** override func viewDidLoad() { super.viewDidLoad() // load top navigation self.topFunctionalView = IZTopFunctionalPanel.loadFromXib() self.topFunctionalView?.frame = CGRect(x: 0, y: 0, width: self.topFunctionalPanelView.frame.size.width, height: self.topFunctionalPanelView.frame.size.height) self.topFunctionalPanelView!.addSubview(self.topFunctionalView!) // load bottom navigation self.bottomNavigationView = IZBottomNavigationPanel.loadFromXib() self.bottomNavigationView?.frame = CGRect(x: 0, y: 0, width: self.bottomNavigationPanelView.frame.size.width, height: self.bottomNavigationPanelView.frame.size.height) self.bottomNavigationView?.delegate = self self.bottomNavigationPanelView.addSubview(self.bottomNavigationView!) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.navigationController?.navigationBar.isHidden = true self.navigationItem.hidesBackButton = true self.navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } final func gestureTap() { self.view.endEditing(true) } //***************************************************************** // MARK: - Notification //***************************************************************** func keyboardWasShown(_ aNotification:Notification) { self.view.addGestureRecognizer(tapGesture) } func keyboardWillBeHidden(_ aNotification:Notification) { self.view.removeGestureRecognizer(tapGesture) } //***************************************************************** // MARK: - Check TextFiels //***************************************************************** func checkForEmptyTextField(_ textField :HoshiTextField) -> Bool { if textField.text!.characters.isEmpty || (textField.text!.trimmingCharacters(in: CharacterSet.whitespaces)).characters.count == 0 { return false } return true } //***************************************************************** // MARK: - Load Alert //***************************************************************** func loadAlert(_ text1: String, text2: String) { IZAlertCustomManager.sharedInstance.showView(text1, text2: text2) } func loadAlertOk(_ text1: String, text2: String) { self.alertView = IZAlertCustom.loadFromXib() self.alertView?.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height) self.alertView?.updateData(text1, text2: text2) self.alertView?.showView() } } extension IZBaseHomeViewController : IZBottomNavigationPanelDelegate { //***************************************************************** // MARK: - IZBottomNavigationPanelDelegate //***************************************************************** func homeButtonWasPressed() { let root = self.navigationController?.viewControllers[0] if root!.isKind(of: IZMatchViewController.self) || root!.isKind(of: IZMatchStartChatViewController.self) || root!.isKind(of: IZLoginViewController.self) { self.router.setupHomeRootViewController() return } if IZRouter.switchToRootViewController() { self.router.popToRootViewController() } else { self.router.setupHomeRootViewController() } } func profileButtonWasPressed() { let visibleVC = self.router.visibleViewController() if visibleVC.isKind(of: IZProfileViewController.self) { return } self.router.showProfileViewController(nil) } func matchHistoryButtonWasPressed() { self.router.showMatchHistoryViewController() } func chatButtonWasPressed() { self.router.showSavedChatsViewController() } func settingButtonWasPressed() { self.router.showSettingsViewController() } }
[ -1 ]
919618f29fc289ec5e4cc4288887965633ca2517
7f59ba409ed1c4a89f93e496fa653e6ee6bc2a13
/test/stmt/foreach.swift
8b7b8d0cea18ded5b78d7466541a4b754db2d956
[ "Apache-2.0", "Swift-exception" ]
permissive
weihas/swift
4780410b75b2f5a8d686eb7855abf68ab1fdce24
9c8be746b9d5b25511f2cf6df9427cdfa37d93b2
refs/heads/master
2022-06-12T16:02:52.227441
2020-05-07T02:26:34
2020-05-07T02:26:34
261,951,101
2
0
Apache-2.0
2020-05-07T04:41:41
2020-05-07T04:41:41
null
UTF-8
Swift
false
false
6,823
swift
// RUN: %target-typecheck-verify-swift // Bad containers and ranges struct BadContainer1 { } func bad_containers_1(bc: BadContainer1) { for e in bc { } // expected-error{{for-in loop requires 'BadContainer1' to conform to 'Sequence'}} } struct BadContainer2 : Sequence { // expected-error{{type 'BadContainer2' does not conform to protocol 'Sequence'}} var generate : Int } func bad_containers_2(bc: BadContainer2) { for e in bc { } } struct BadContainer3 : Sequence { // expected-error{{type 'BadContainer3' does not conform to protocol 'Sequence'}} func makeIterator() { } // expected-note{{candidate can not infer 'Iterator' = '()' because '()' is not a nominal type and so can't conform to 'IteratorProtocol'}} } func bad_containers_3(bc: BadContainer3) { for e in bc { } } struct BadIterator1 {} struct BadContainer4 : Sequence { // expected-error{{type 'BadContainer4' does not conform to protocol 'Sequence'}} typealias Iterator = BadIterator1 // expected-note{{possibly intended match 'BadContainer4.Iterator' (aka 'BadIterator1') does not conform to 'IteratorProtocol'}} func makeIterator() -> BadIterator1 { } } func bad_containers_4(bc: BadContainer4) { for e in bc { } } // Pattern type-checking struct GoodRange<Int> : Sequence, IteratorProtocol { typealias Element = Int func next() -> Int? {} typealias Iterator = GoodRange<Int> func makeIterator() -> GoodRange<Int> { return self } } struct GoodTupleIterator: Sequence, IteratorProtocol { typealias Element = (Int, Float) func next() -> (Int, Float)? {} typealias Iterator = GoodTupleIterator func makeIterator() -> GoodTupleIterator {} } protocol ElementProtocol {} func patterns(gir: GoodRange<Int>, gtr: GoodTupleIterator) { var sum : Int var sumf : Float for i : Int in gir { sum = sum + i } for i in gir { sum = sum + i } for f : Float in gir { sum = sum + f } // expected-error{{cannot convert sequence element type 'GoodRange<Int>.Element' (aka 'Int') to expected type 'Float'}} for f : ElementProtocol in gir { } // expected-error {{sequence element type 'GoodRange<Int>.Element' (aka 'Int') does not conform to expected protocol 'ElementProtocol'}} for (i, f) : (Int, Float) in gtr { sum = sum + i } for (i, f) in gtr { sum = sum + i sumf = sumf + f sum = sum + f // expected-error {{cannot convert value of type 'Float' to expected argument type 'Int'}} } for (i, _) : (Int, Float) in gtr { sum = sum + i } for (i, _) : (Int, Int) in gtr { sum = sum + i } // expected-error{{cannot convert sequence element type 'GoodTupleIterator.Element' (aka '(Int, Float)') to expected type '(Int, Int)'}} for (i, f) in gtr {} } func slices(i_s: [Int], ias: [[Int]]) { var sum = 0 for i in i_s { sum = sum + i } for ia in ias { for i in ia { sum = sum + i } } } func discard_binding() { for _ in [0] {} } struct X<T> { var value: T } struct Gen<T> : IteratorProtocol { func next() -> T? { return nil } } struct Seq<T> : Sequence { func makeIterator() -> Gen<T> { return Gen() } } func getIntSeq() -> Seq<Int> { return Seq() } func getOvlSeq() -> Seq<Int> { return Seq() } // expected-note{{found this candidate}} func getOvlSeq() -> Seq<Double> { return Seq() } // expected-note{{found this candidate}} func getOvlSeq() -> Seq<X<Int>> { return Seq() } // expected-note{{found this candidate}} func getGenericSeq<T>() -> Seq<T> { return Seq() } func getXIntSeq() -> Seq<X<Int>> { return Seq() } func getXIntSeqIUO() -> Seq<X<Int>>! { return nil } func testForEachInference() { for i in getIntSeq() { } // Overloaded sequence resolved contextually for i: Int in getOvlSeq() { } for d: Double in getOvlSeq() { } // Overloaded sequence not resolved contextually for v in getOvlSeq() { } // expected-error{{ambiguous use of 'getOvlSeq()'}} // Generic sequence resolved contextually for i: Int in getGenericSeq() { } for d: Double in getGenericSeq() { } // Inference of generic arguments in the element type from the // sequence. for x: X in getXIntSeq() { let z = x.value + 1 } for x: X in getOvlSeq() { let z = x.value + 1 } // Inference with implicitly unwrapped optional for x: X in getXIntSeqIUO() { let z = x.value + 1 } // Range overloading. for i: Int8 in 0..<10 { } for i: UInt in 0...10 { } } func testMatchingPatterns() { // <rdar://problem/21428712> for case parse failure let myArray : [Int?] = [] for case .some(let x) in myArray { _ = x } // <rdar://problem/21392677> for/case/in patterns aren't parsed properly class A {} class B : A {} class C : A {} let array : [A] = [A(), B(), C()] for case (let x as B) in array { _ = x } } // <rdar://problem/21662365> QoI: diagnostic for for-each over an optional sequence isn't great func testOptionalSequence() { let array : [Int]? for x in array { // expected-error {{for-in loop requires '[Int]?' to conform to 'Sequence'; did you mean to unwrap optional?}} } } // Crash with (invalid) for each over an existential func testExistentialSequence(s: Sequence) { // expected-error {{protocol 'Sequence' can only be used as a generic constraint because it has Self or associated type requirements}} for x in s { // expected-error {{value of protocol type 'Sequence' cannot conform to 'Sequence'; only struct/enum/class types can conform to protocols}} _ = x } } // Conditional conformance to Sequence and IteratorProtocol. protocol P { } struct RepeatedSequence<T> { var value: T var count: Int } struct RepeatedIterator<T> { var value: T var count: Int } extension RepeatedIterator: IteratorProtocol where T: P { typealias Element = T mutating func next() -> T? { if count == 0 { return nil } count = count - 1 return value } } extension RepeatedSequence: Sequence where T: P { typealias Element = T typealias Iterator = RepeatedIterator<T> typealias SubSequence = AnySequence<T> func makeIterator() -> RepeatedIterator<T> { return Iterator(value: value, count: count) } } extension Int : P { } func testRepeated(ri: RepeatedSequence<Int>) { for x in ri { _ = x } } // SR-12398: Poor pattern matching diagnostic: "for-in loop requires '[Int]' to conform to 'Sequence'" func sr_12398(arr1: [Int], arr2: [(a: Int, b: String)]) { for (x, y) in arr1 {} // expected-error@-1 {{tuple pattern cannot match values of non-tuple type 'Int'}} for (x, y, _) in arr2 {} // expected-error@-1 {{pattern cannot match values of type '(a: Int, b: String)'}} } // rdar://62339835 func testForEachWhereWithClosure(_ x: [Int]) { func foo<T>(_ fn: () -> T) -> Bool { true } for i in x where foo({ i }) {} for i in x where foo({ i.byteSwapped == 5 }) {} for i in x where x.contains(where: { $0.byteSwapped == i }) {} }
[ 82320 ]
41974bf6d59e2ac65ee15cf997bda4daebc4dfb2
675e4facf7af38a1b3609a864a02b3dc306103c0
/ClapBeat_iino/ClapBeat_iino/AppDelegate.swift
30813498a469fbfa05afb4bb3e3b295018b1a41a
[]
no_license
Iino-Hinako/ios_study
3343c8dc990e81065db01b2751f7daddb77479d9
3bc49ccf5d4dbd36e008d515bb3a537a18b7f788
refs/heads/master
2022-11-08T15:17:22.816592
2020-06-23T01:25:07
2020-06-23T01:25:07
269,283,381
0
0
null
null
null
null
UTF-8
Swift
false
false
1,434
swift
// // AppDelegate.swift // ClapBeat_iino // // Created by 飯野日向子 on 2020/06/09. // Copyright © 2020 ALJ飯野日向子. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 163891, 213048, 385081, 376889, 393275, 376905, 327756, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 286831, 368752, 286844, 417924, 262283, 286879, 286888, 377012, 327871, 180416, 377036, 180431, 377046, 377060, 327914, 205036, 393456, 393460, 336123, 418043, 336128, 385280, 262404, 180490, 368911, 262416, 262422, 377117, 262436, 336180, 262454, 393538, 262472, 344403, 213332, 65880, 262496, 418144, 262499, 213352, 246123, 262507, 262510, 213372, 385419, 393612, 262550, 262552, 385440, 385443, 385451, 262573, 393647, 385458, 262586, 344511, 262592, 360916, 369118, 328177, 328179, 328182, 328189, 328192, 164361, 328206, 410128, 393747, 254490, 188958, 385570, 33316, 197159, 377383, 352821, 188987, 418363, 369223, 385609, 385616, 352856, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 336512, 148105, 377484, 352918, 98968, 344744, 361129, 336555, 385713, 434867, 164534, 336567, 328378, 164538, 328386, 352968, 344776, 418507, 352971, 352973, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 336643, 344835, 344841, 361230, 336659, 418580, 418585, 434970, 369435, 418589, 262942, 418593, 336675, 328484, 418598, 418605, 336696, 361273, 328515, 336708, 328519, 336711, 328522, 336714, 426841, 197468, 254812, 361309, 361315, 361322, 328573, 377729, 369542, 361360, 222128, 345035, 345043, 386003, 386011, 386018, 386022, 435187, 328702, 328714, 361489, 386069, 336921, 386073, 336925, 345118, 377887, 345133, 345138, 386101, 361536, 197707, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 361598, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 345267, 386258, 328924, 66782, 222437, 386285, 328941, 386291, 345376, 353570, 345379, 410917, 345382, 337205, 345399, 378169, 369978, 337222, 337229, 337234, 263508, 402791, 345448, 271730, 378227, 271745, 181638, 353673, 181643, 181649, 181654, 230809, 181670, 181673, 181678, 337329, 181681, 181684, 181690, 361917, 181696, 337349, 181703, 337365, 271839, 329191, 361960, 329194, 116210, 337398, 337415, 329226, 419339, 419343, 419349, 345625, 419355, 370205, 419359, 419362, 394786, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 419410, 345701, 394853, 222830, 370297, 403070, 353919, 403075, 345736, 198280, 403091, 345749, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 337592, 419512, 337599, 419527, 419530, 419535, 272081, 394966, 419542, 419544, 181977, 345818, 419547, 419550, 419559, 337642, 419563, 337645, 370415, 141051, 337659, 337668, 362247, 395021, 362255, 321299, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 345930, 370509, 354130, 247637, 337750, 370519, 313180, 354142, 345967, 345970, 345974, 403320, 354172, 247691, 337808, 247700, 329623, 436126, 436132, 337833, 362413, 337844, 346057, 247759, 346063, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329832, 329855, 329867, 329885, 411805, 346272, 362660, 100524, 387249, 379066, 387260, 256191, 395466, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 346343, 338152, 387306, 387312, 346355, 436473, 321786, 379134, 411903, 411916, 379152, 395538, 387349, 338199, 387352, 182558, 338211, 395566, 248111, 362822, 436555, 190796, 321879, 379233, 354673, 321910, 248186, 420236, 379278, 272786, 354727, 338352, 330189, 338381, 338386, 256472, 338403, 338409, 248308, 199164, 330252, 199186, 420376, 330267, 354855, 10828, 199249, 346721, 174695, 248425, 191084, 338543, 191092, 346742, 330383, 354974, 150183, 174774, 248504, 174777, 223934, 355024, 273108, 355028, 264918, 183005, 256734, 338660, 338664, 264941, 363251, 207619, 264964, 338700, 256786, 199452, 363293, 396066, 346916, 396069, 215853, 355122, 355131, 355140, 355143, 338763, 355150, 330580, 355166, 265055, 265058, 355175, 387944, 355179, 330610, 330642, 355218, 412599, 207808, 379848, 396245, 330710, 248792, 248798, 347105, 257008, 183282, 265207, 330748, 330760, 330768, 248862, 396328, 158761, 396336, 199728, 330800, 396339, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 183383, 339036, 412764, 257120, 265320, 248951, 420984, 330889, 347287, 248985, 339097, 44197, 380070, 339112, 249014, 126144, 330958, 330965, 265432, 265436, 388319, 388347, 175375, 159005, 175396, 208166, 273708, 372015, 347441, 372018, 199988, 44342, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 175450, 437595, 175457, 208227, 175460, 175463, 265580, 437620, 175477, 249208, 175483, 175486, 249214, 175489, 249218, 249224, 249227, 249234, 175513, 175516, 396705, 175522, 355748, 380332, 396722, 208311, 388542, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 249308, 339420, 249312, 339424, 339428, 339434, 249328, 69113, 372228, 339461, 208398, 380432, 175635, 339503, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 224897, 372353, 216707, 339588, 126596, 421508, 224904, 224909, 159374, 11918, 339601, 224913, 126610, 224916, 224919, 126616, 208538, 224922, 224926, 224929, 224932, 224936, 257704, 224942, 257712, 224947, 257716, 257720, 224953, 257724, 224959, 257732, 224965, 224969, 339662, 224975, 257747, 224981, 224986, 224993, 257761, 257764, 224999, 339695, 225012, 257787, 225020, 339710, 257790, 225025, 257794, 339721, 257801, 257804, 225038, 257807, 372499, 167700, 225043, 225048, 257819, 225053, 184094, 225058, 339747, 339749, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 225079, 397112, 225082, 397115, 225087, 225092, 225096, 323402, 257868, 257871, 225103, 397139, 225108, 225112, 257883, 257886, 225119, 257890, 339814, 225127, 257896, 274280, 257901, 225137, 339826, 257908, 225141, 257912, 257916, 225148, 257920, 225155, 339844, 225165, 397200, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 405533, 430129, 266294, 266297, 217157, 421960, 356439, 430180, 421990, 266350, 356466, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 225444, 438436, 225447, 438440, 225450, 258222, 225455, 430256, 225458, 225461, 225466, 389307, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 266453, 225493, 225496, 225499, 225502, 225505, 356578, 225510, 217318, 225514, 225518, 372976, 381176, 397571, 389380, 61722, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 225597, 332097, 201028, 348488, 332106, 332117, 348502, 250199, 250202, 332125, 250210, 348522, 348525, 348527, 332152, 250238, 389502, 332161, 356740, 332172, 373145, 340379, 389550, 324030, 266687, 340451, 160234, 127471, 340472, 324094, 266754, 324099, 324102, 324111, 340500, 324117, 324131, 332324, 381481, 324139, 356907, 324142, 356916, 324149, 324155, 348733, 324160, 324164, 356934, 348743, 381512, 324170, 324173, 324176, 389723, 332380, 373343, 381545, 340627, 184982, 373398, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 373449, 332493, 357069, 357073, 332511, 332520, 340718, 332533, 348924, 373510, 389926, 152370, 348978, 340789, 348982, 398139, 127814, 357201, 357206, 389978, 357211, 430939, 357214, 201579, 201582, 349040, 340849, 201588, 430965, 381813, 324472, 398201, 119674, 324475, 430972, 340861, 324478, 340858, 324481, 373634, 398211, 324484, 324487, 381833, 324492, 324495, 324498, 430995, 324501, 324510, 422816, 324513, 398245, 201637, 324524, 340909, 324533, 5046, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 209895, 201711, 349172, 381946, 349180, 439294, 431106, 209943, 209946, 250914, 357410, 185380, 357418, 209965, 209968, 209971, 209975, 209979, 209987, 209990, 341071, 349267, 250967, 210010, 341091, 210025, 210027, 210030, 210039, 341113, 210044, 349308, 152703, 160895, 349311, 210052, 210055, 349319, 210067, 210071, 210077, 210080, 210084, 251044, 185511, 210088, 210095, 210098, 210107, 210115, 332997, 210127, 333009, 210131, 333014, 210138, 210143, 218354, 251128, 218360, 275706, 275712, 275715, 275721, 349459, 333078, 251160, 349484, 349491, 251189, 415033, 251210, 357708, 210260, 365911, 259421, 365921, 333154, 251235, 374117, 333162, 234866, 390516, 333175, 357755, 251271, 136590, 112020, 349590, 357792, 259515, 415166, 415185, 366034, 366038, 415191, 415193, 415196, 415199, 423392, 333284, 415207, 366056, 366061, 415216, 210420, 415224, 423423, 415257, 415263, 366117, 415270, 144939, 415278, 415281, 415285, 210487, 415290, 415293, 349761, 415300, 333386, 333399, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 267909, 153227, 333498, 333511, 210631, 259788, 358099, 153302, 333534, 366307, 366311, 431851, 366318, 210672, 366321, 366325, 210695, 268041, 210698, 366348, 210706, 399128, 333594, 210719, 358191, 210739, 366387, 399159, 358200, 325440, 366401, 341829, 325446, 46920, 341834, 341838, 341843, 415573, 358234, 341851, 350045, 399199, 259938, 399206, 358255, 399215, 268143, 358259, 341876, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 358339, 333774, 358371, 350189, 350193, 350202, 333818, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350240, 350244, 350248, 178218, 350251, 350256, 350259, 350271, 243781, 350285, 374864, 342111, 342133, 374902, 432271, 333997, 334011, 260289, 350410, 260298, 350416, 350422, 211160, 350425, 268507, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 325891, 350467, 350475, 268559, 350480, 432405, 350486, 350490, 325914, 325917, 350493, 350498, 350504, 358700, 350509, 391468, 358704, 358713, 358716, 383306, 334161, 383321, 383330, 383333, 391530, 383341, 334203, 268668, 194941, 391563, 366990, 416157, 268701, 342430, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 334304, 334311, 375277, 334321, 350723, 186897, 342545, 334358, 342550, 342554, 334363, 358941, 350761, 252461, 334384, 383536, 358961, 334394, 252482, 219718, 334407, 334420, 350822, 375400, 334465, 334468, 162445, 326290, 342679, 342683, 260766, 342710, 244409, 260797, 334528, 260801, 350917, 154317, 391894, 154328, 416473, 64230, 113388, 342766, 375535, 203506, 342776, 391937, 391948, 326416, 375568, 375571, 375574, 162591, 326441, 326451, 326454, 244540, 326460, 375612, 260924, 326467, 244551, 326473, 326477, 326485, 416597, 326490, 342874, 326502, 375656, 433000, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 342915, 400259, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 359366, 326598, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 367723, 384107, 187502, 384114, 343154, 212094, 351364, 384135, 384139, 384143, 351381, 384151, 384160, 384168, 367794, 244916, 384181, 384188, 351423, 384191, 384198, 326855, 244937, 384201, 253130, 343244, 384208, 146642, 384224, 359649, 343270, 351466, 384246, 351479, 384249, 343306, 261389, 359694, 253200, 261393, 384275, 384283, 245020, 384288, 245029, 171302, 351534, 376110, 245040, 384314, 425276, 384323, 212291, 343365, 212303, 367965, 343393, 343398, 367980, 425328, 343409, 154999, 253303, 343417, 327034, 245127, 384397, 245136, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327110, 327115, 327117, 359886, 359890, 343507, 368092, 343534, 343539, 368119, 343544, 368122, 409091, 359947, 359955, 359983, 343630, 327275, 245357, 138864, 155254, 155273, 368288, 245409, 425638, 425649, 155322, 425662, 155327, 245460, 155351, 155354, 212699, 245475, 155363, 245483, 155371, 409335, 155393, 155403, 245525, 155422, 360223, 155438, 155442, 155447, 155461, 360261, 376663, 155482, 261981, 425822, 155487, 376671, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 262005, 147317, 425845, 262008, 262011, 155516, 155521, 155525, 360326, 376714, 155531, 262027, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 393169, 384977, 155611, 155619, 253923, 155621, 327654, 253926, 204784, 393203, 360438, 253943, 393206, 393212, 155646 ]
684b486911380c6c995c62d7325d07adaf2126fc
5ec06dab1409d790496ce082dacb321392b32fe9
/clients/swift4/generated/OpenAPIClient/Classes/OpenAPIs/Models/ComAdobeCqSocialScfCoreOperationsImplSocialOperationsServletProperties.swift
97be77fe989ba6e18b337e95d7a3a3074f6199e3
[ "Apache-2.0" ]
permissive
shinesolutions/swagger-aem-osgi
e9d2385f44bee70e5bbdc0d577e99a9f2525266f
c2f6e076971d2592c1cbd3f70695c679e807396b
refs/heads/master
2022-10-29T13:07:40.422092
2021-04-09T07:46:03
2021-04-09T07:46:03
190,217,155
3
3
Apache-2.0
2022-10-05T03:26:20
2019-06-04T14:23:28
null
UTF-8
Swift
false
false
840
swift
// // ComAdobeCqSocialScfCoreOperationsImplSocialOperationsServletProperties.swift // // Generated by openapi-generator // https://openapi-generator.tech // import Foundation public struct ComAdobeCqSocialScfCoreOperationsImplSocialOperationsServletProperties: Codable { public var slingServletSelectors: ConfigNodePropertyString? public var slingServletExtensions: ConfigNodePropertyString? public init(slingServletSelectors: ConfigNodePropertyString?, slingServletExtensions: ConfigNodePropertyString?) { self.slingServletSelectors = slingServletSelectors self.slingServletExtensions = slingServletExtensions } public enum CodingKeys: String, CodingKey { case slingServletSelectors = "sling.servlet.selectors" case slingServletExtensions = "sling.servlet.extensions" } }
[ -1 ]
e29ea9b7d059362cd683f0af96d89841056a6eb9
2490bfdf5f21072b0aa9e917aa720652f6e46c67
/DiscogsStreamer/Browser/BrowserViewController.swift
279791de3ec661155f9915b2e155a679c187ca8f
[]
no_license
spencermiles/DiscogsStreamer
4823d91883bc2d1452208582ca3e77f26873ac03
5563c32525df02d749522a7439d5d0fe6ae49807
refs/heads/master
2022-11-15T08:44:49.620699
2020-07-08T02:18:44
2020-07-08T02:18:44
277,376,522
0
0
null
null
null
null
UTF-8
Swift
false
false
8,028
swift
// // BrowserViewController.swift // DiscogsStreamer // // Created by Spencer on 7/4/20. // Copyright © 2020 Spencer Miles. All rights reserved. // import UIKit protocol _BrowserViewControllerDelegate: AnyObject { func itemsRequested(sender _: BrowserViewController) func refreshRequested(sender _: BrowserViewController) func itemSelected(itemID: Browseable.ID, sender _: BrowserViewController) } protocol BrowseableCell { typealias ID = Int var id: ID { get } var model: BrowseableItemTableViewCell.Model { get } } //private enum BrowseableItem { // typealias ID = Int // // case release(Release) //} // //extension BrowseableItem { // var displayName: String { // switch self { // case .release(let release): // return release.displayName // } // } // // var id: BrowseableItem.ID { // switch self { // case .release(let release): // return release.id // } // } //} class BrowserViewController: BaseViewController { typealias Delegate = _BrowserViewControllerDelegate struct Model { var cells: [BrowseableCell] = [] var refreshControlRefreshing = false var loadingCell = false var errorCell = false struct BrowseableFolderCell: BrowseableCell { var id: Int var model: BrowseableItemTableViewCell.Model } struct BrowseableReleaseCell: BrowseableCell { var id: Int var model: BrowseableItemTableViewCell.Model } init() { } init(data: BrowserDataSource.Data) { self.cells = data.items.compactMap { // TODO: Clean this up, override init methods // TODO: Extend this to support Folder types BrowseableReleaseCell( id: $0.id, model: .init(title: $0.displayName, subtitle: $0.secondaryDisplayName)) } self.loadingCell = data.canLoadMore || data.isLoading || data.isReloading } } private enum Section: Int, Hashable { case items case error case loading } private enum Row: Hashable { case item(BrowseableCell.ID) case loading case error } private typealias TableViewDataSource = UITableViewDiffableDataSource<Section, Row> private var tableViewDataSource: TableViewDataSource? var model: Model { didSet { applyModel() } } weak var delegate: Delegate? private var tableView: UITableView { view as! UITableView } init(model: Model = Model()) { self.model = model super.init(nibName: nil, bundle: nil) } override func loadView() { self.title = "Releases" let view = UITableView() view.autoresizingMask = [.flexibleWidth, .flexibleHeight] view.translatesAutoresizingMaskIntoConstraints = true view.tableFooterView = UIView() view.estimatedRowHeight = 60 view.register(BrowseableItemTableViewCell.self, forCellReuseIdentifier: BrowseableItemTableViewCell.reuseIdentifier) view.register(BrowseableLoadingTableViewCell.self, forCellReuseIdentifier: BrowseableLoadingTableViewCell.reuseIdentifier) self.view = view } override func viewDidLoad() { super.viewDidLoad() tableViewDataSource = .init(tableView: tableView) { [weak self] in self?.dequeueCell(forRow: $2, at: $1) } tableView.dataSource = tableViewDataSource tableView.delegate = self let refreshControl = UIRefreshControl() refreshControl.addTarget(self, action: #selector(pulledToRefresh), for: .valueChanged) tableView.refreshControl = refreshControl // Load the items requestItems() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) applyModel(animated: false) } private func dequeueCell(forRow row: Row, at indexPath: IndexPath) -> UITableViewCell? { switch row { case .item(let id): guard let cellModel = model.cells.first(where: { $0.id == id })?.model else { return nil } let cell: BrowseableItemTableViewCell = tableView.dequeueReusableCell( withIdentifier: BrowseableItemTableViewCell.reuseIdentifier, for: indexPath) as! BrowseableItemTableViewCell cell.model = cellModel return cell case .error: return nil case .loading: guard model.loadingCell else { return nil } let cell: BrowseableLoadingTableViewCell = tableView.dequeueReusableCell( withIdentifier: BrowseableLoadingTableViewCell.reuseIdentifier, for: indexPath) as! BrowseableLoadingTableViewCell return cell } } private func refreshCell(forRow row: Row, at indexPath: IndexPath) { switch row { case .item: let cell = tableView.cellForRow(at: indexPath) as! BrowseableItemTableViewCell cell.model = model.cells[indexPath.row].model case .loading: let cell = tableView.cellForRow(at: indexPath) as! BrowseableLoadingTableViewCell case .error: break } } private func applyModel(animated: Bool = true) { guard viewIfLoaded?.window != nil, let tableViewDataSource = tableViewDataSource else { return } // if model.refreshControlRefreshing { // tableView.refreshControl?.beginRefreshing() // } else { // tableView.refreshControl?.endRefreshing() // } var snapshot = NSDiffableDataSourceSnapshot<Section, Row>() snapshot.appendSections([.items]) let items = model.cells.map({ Row.item($0.id) }) snapshot.appendItems(items, toSection: .items) if model.loadingCell { snapshot.appendSections([.loading]) snapshot.appendItems([.loading], toSection: .loading) } if model.errorCell { snapshot.appendSections([.error]) snapshot.appendItems([.error], toSection: .error) } tableViewDataSource.apply(snapshot, animatingDifferences: animated) { // After applying changes, there might still be a loading cell visible. // If there is, we need to request more items. // if self.tableView.visibleCells.contains(where: { $0 is BrowseableLoadingTableViewCell }) { // self.requestItems() // } // The data source handles inserts/removes but we still need to refresh the visible cells' models. self.tableView.indexPathsForVisibleRows?.forEach { self.refreshCell(forRow: snapshot.itemIdentifier(at: $0), at: $0) } } } @objc private func pulledToRefresh() { } private func requestItems() { self.delegate?.itemsRequested(sender: self) } } extension BrowserViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { if cell is BrowseableLoadingTableViewCell { requestItems() } } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: true) guard case .items? = Section(rawValue: indexPath.section), model.cells.indices ~= indexPath.row else { return } // delegate?.itemSelected(itemID: model.itemCells[indexPath.row].id, sender: self) } }
[ -1 ]
e334b52b4c860a825e7a3bae578483fd7f275b6f
c1a9393bea50ffb980765d3a29b6f4c0601d3cd0
/QiitaVIPER/ViewController.swift
cbfd0203d89a0fe5902b1cdc340ed11e2c2f02ea
[]
no_license
kimiaki704/qiita-viper-ios
2953d02848f94e6bddc2bbb4fd6951635d69c2e3
b68740d80f549fd2da56dd09e18db982322ed674
refs/heads/master
2022-06-08T20:43:23.034713
2020-05-02T05:38:33
2020-05-02T05:38:33
260,620,738
0
0
null
null
null
null
UTF-8
Swift
false
false
342
swift
// // ViewController.swift // QiitaVIPER // // Created by Suzuki Kimiaki on 2020/05/02. // Copyright © 2020 Suzuki Kimiaki. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } }
[ 325510, 324104, 329869, 329235, 342552, 245530, 210075, 318109, 324512, 316331, 159025, 324018, 338617, 316346, 244411, 326971, 294845, 149306, 323268, 323016, 326600, 325448, 324172, 316626, 146645, 313182, 354654, 326241, 241633, 321253, 175462, 336364, 320506, 210043, 340988, 334205 ]
eb89673e7af446b1ca0de6138660e039161d816e
62b2d22bb88e7d54a0a95190d1f3d3b0769c5e12
/Example/Source/Shared/PBR/Renderer.swift
5193158ab5285fd4e4422d3b522016b7a3e03203
[ "MIT" ]
permissive
dal-kas/Satin
eaac4b0065e8d6478e550d69ccf6c9a60060260d
740506eb91d25c9776638ac7e12e1c2311832159
refs/heads/master
2022-10-23T19:40:16.108029
2020-06-13T01:07:22
2020-06-13T01:07:22
null
0
0
null
null
null
null
UTF-8
Swift
false
false
12,088
swift
// // Renderer.swift // Cubemap // // Created by Reza Ali on 6/7/20. // Copyright © 2020 Hi-Rez. All rights reserved. // // PBR Code from: https://learnopengl.com/PBR/ // Cube Map Texture from: https://hdrihaven.com/hdri/ // import Metal import MetalKit import Forge import Satin class CustomMaterial: LiveMaterial {} class Renderer: Forge.Renderer { var metalFileCompiler = MetalFileCompiler() var assetsURL: URL { let resourcesURL = Bundle.main.resourceURL! return resourcesURL.appendingPathComponent("Assets") } var texturesURL: URL { return assetsURL.appendingPathComponent("Textures") } var modelsURL: URL { return assetsURL.appendingPathComponent("Models") } var pipelinesURL: URL { return assetsURL.appendingPathComponent("Pipelines") } lazy var scene: Object = { let scene = Object() scene.add(mesh) scene.add(debugMesh) return scene }() lazy var context: Context = { Context(device, sampleCount, colorPixelFormat, depthPixelFormat, stencilPixelFormat) }() lazy var camera: ArcballPerspectiveCamera = { let camera = ArcballPerspectiveCamera() camera.position = simd_make_float3(0.0, 0.0, 40.0) camera.near = 0.001 camera.far = 1000.0 return camera }() lazy var cameraController: ArcballCameraController = { ArcballCameraController(camera: camera, view: mtkView, defaultPosition: camera.position, defaultOrientation: camera.orientation) }() lazy var renderer: Satin.Renderer = { Satin.Renderer(context: context, scene: scene, camera: camera) }() lazy var mesh: Mesh = { let mesh = Mesh(geometry: IcoSphereGeometry(radius: 1.0, res: 3), material: customMaterial) mesh.label = "Sphere" mesh.instanceCount = 49 mesh.preDraw = { [unowned self] (renderEncoder: MTLRenderCommandEncoder) in renderEncoder.setFragmentTexture(self.diffuseCubeTexture, index: FragmentTextureIndex.Custom0.rawValue) renderEncoder.setFragmentTexture(self.specularCubeTexture, index: FragmentTextureIndex.Custom1.rawValue) renderEncoder.setFragmentTexture(self.integrationTextureCompute.texture, index: FragmentTextureIndex.Custom2.rawValue) } return mesh }() lazy var customMaterial: CustomMaterial = { CustomMaterial(pipelineURL: pipelinesURL.appendingPathComponent("Shaders.metal")) }() lazy var skybox: Mesh = { let mesh = Mesh(geometry: SkyboxGeometry(), material: SkyboxMaterial()) mesh.label = "Skybox" mesh.scale = [150, 150, 150] scene.add(mesh) return mesh }() lazy var debugMesh: Mesh = { let mesh = Mesh(geometry: PlaneGeometry(size: 10), material: BasicTextureMaterial(texture: integrationTextureCompute.texture)) mesh.label = "Debug" mesh.position = [0, 0, -5] mesh.visible = false return mesh }() lazy var integrationTextureCompute: TextureComputeSystem = { let compute = TextureComputeSystem( context: context, textureDescriptor: MTLTextureDescriptor.texture2DDescriptor(pixelFormat: .rg16Float, width: 512, height: 512, mipmapped: false) ) return compute }() // Diffuse (Irradiance) Computation lazy var diffuseTextureComputeParameters: ParameterGroup = { let params = ParameterGroup("DiffuseParameters") params.append(faceParameter) return params }() lazy var diffuseTextureComputeUniforms: Buffer = { Buffer(context: context, parameters: diffuseTextureComputeParameters) }() lazy var diffuseTextureCompute: TextureComputeSystem = { let compute = TextureComputeSystem( context: context, textureDescriptor: MTLTextureDescriptor.texture2DDescriptor(pixelFormat: .rgba32Float, width: 64, height: 64, mipmapped: false) ) compute.preCompute = { [unowned self] (computeEncoder: MTLComputeCommandEncoder, offset: Int) in computeEncoder.setTexture(self.hdrCubemapTexture, index: offset) computeEncoder.setBuffer(self.diffuseTextureComputeUniforms.buffer, offset: 0, index: 0) } return compute }() // HDRI to Cubemap Computation lazy var cubemapTextureComputeParameters: ParameterGroup = { let params = ParameterGroup("CubemapParameters") params.append(faceParameter) return params }() lazy var cubemapTextureComputeUniforms: Buffer = { Buffer(context: context, parameters: cubemapTextureComputeParameters) }() lazy var cubemapTextureCompute: TextureComputeSystem = { let compute = TextureComputeSystem( context: context, textureDescriptor: MTLTextureDescriptor.texture2DDescriptor(pixelFormat: .rgba32Float, width: 512, height: 512, mipmapped: false) ) compute.preCompute = { [unowned self] (computeEncoder: MTLComputeCommandEncoder, offset: Int) in computeEncoder.setTexture(self.hdriTexture, index: offset) computeEncoder.setBuffer(self.cubemapTextureComputeUniforms.buffer, offset: 0, index: 0) } return compute }() // Specular Computation var roughnessParameter = FloatParameter("roughness", 0) var faceParameter = IntParameter("face", 0) lazy var specularTextureComputeParameters: ParameterGroup = { let params = ParameterGroup("SpecularParameters") params.append(roughnessParameter) params.append(faceParameter) return params }() lazy var specularTextureComputeUniforms: Buffer = { let buffer = Buffer(context: context, parameters: specularTextureComputeParameters) return buffer }() lazy var specularTextureCompute: TextureComputeSystem = { let compute = TextureComputeSystem( context: context, textureDescriptor: MTLTextureDescriptor.texture2DDescriptor(pixelFormat: .rgba32Float, width: 512, height: 512, mipmapped: false) ) compute.preCompute = { [unowned self] (computeEncoder: MTLComputeCommandEncoder, offset: Int) in computeEncoder.setTexture(self.hdrCubemapTexture, index: offset) computeEncoder.setBuffer(self.specularTextureComputeUniforms.buffer, offset: 0, index: 0) } return compute }() // HDRI to Skybox Texture lazy var skyboxTextureComputeParameters: ParameterGroup = { let params = ParameterGroup("SkyboxParameters") params.append(faceParameter) return params }() lazy var skyboxTextureComputeUniforms: Buffer = { Buffer(context: context, parameters: skyboxTextureComputeParameters) }() lazy var skyboxTextureCompute: TextureComputeSystem = { let compute = TextureComputeSystem( context: context, textureDescriptor: MTLTextureDescriptor.texture2DDescriptor(pixelFormat: .rgba32Float, width: 512, height: 512, mipmapped: false) ) compute.preCompute = { [unowned self] (computeEncoder: MTLComputeCommandEncoder, offset: Int) in computeEncoder.setTexture(self.hdriTexture, index: offset) computeEncoder.setBuffer(self.skyboxTextureComputeUniforms.buffer, offset: 0, index: 0) } return compute }() // Textures var hdriTexture: MTLTexture? lazy var hdrCubemapTexture: MTLTexture? = { let cubeDesc = MTLTextureDescriptor.textureCubeDescriptor(pixelFormat: .rgba32Float, size: 512, mipmapped: true) let texture = device.makeTexture(descriptor: cubeDesc) texture?.label = "Cubemap" return texture }() lazy var diffuseCubeTexture: MTLTexture? = { let cubeDesc = MTLTextureDescriptor.textureCubeDescriptor(pixelFormat: .rgba32Float, size: 64, mipmapped: true) let texture = device.makeTexture(descriptor: cubeDesc) texture?.label = "Diffuse" return texture }() lazy var specularCubeTexture: MTLTexture? = { let cubeDesc = MTLTextureDescriptor.textureCubeDescriptor(pixelFormat: .rgba32Float, size: 512, mipmapped: true) let texture = device.makeTexture(descriptor: cubeDesc) texture?.label = "Specular" return texture }() lazy var skyboxCubeTexture: MTLTexture? = { let cubeDesc = MTLTextureDescriptor.textureCubeDescriptor(pixelFormat: .bgra8Unorm, size: 512, mipmapped: true) let texture = device.makeTexture(descriptor: cubeDesc) texture?.label = "Skybox" return texture }() required init?(metalKitView: MTKView) { super.init(metalKitView: metalKitView) } override func setupMtkView(_ metalKitView: MTKView) { metalKitView.sampleCount = 8 metalKitView.depthStencilPixelFormat = .depth32Float metalKitView.preferredFramesPerSecond = 60 metalKitView.colorPixelFormat = .bgra8Unorm } override func setup() { loadHdri() setupMetalCompiler() setupLibrary() #if os(macOS) // openEditor() #endif } func loadHdri() { do { let filename = "stone_alley_03_2k.exr" if let image = loadImage(url: texturesURL.appendingPathComponent(filename)) { let w = image.width let h = image.height print("Width: \(w)") print("Height: \(h)") print("bitsPerPixel: \(image.bitsPerPixel)") print("bitsPerComponent: \(image.bitsPerComponent)") let loader = MTKTextureLoader(device: device) do { hdriTexture = try loader.newTexture(cgImage: image, options: nil) } } } catch { print(error) } } override func update() { if let material = skybox.material as? SkyboxMaterial { material.texture = skyboxCubeTexture } cameraController.update() renderer.update() } override func draw(_ view: MTKView, _ commandBuffer: MTLCommandBuffer) { guard let renderPassDescriptor = view.currentRenderPassDescriptor else { return } renderer.draw(renderPassDescriptor: renderPassDescriptor, commandBuffer: commandBuffer) } override func resize(_ size: (width: Float, height: Float)) { let aspect = size.width / size.height camera.aspect = aspect renderer.resize(size) } #if os(macOS) func openEditor() { if let editorPath = UserDefaults.standard.string(forKey: "Editor") { NSWorkspace.shared.openFile(assetsURL.path, withApplication: editorPath) } else { let openPanel = NSOpenPanel() openPanel.canChooseFiles = true openPanel.allowsMultipleSelection = false openPanel.canCreateDirectories = false openPanel.begin(completionHandler: { [unowned self] (result: NSApplication.ModalResponse) in if result == .OK { if let editorUrl = openPanel.url { let editorPath = editorUrl.path UserDefaults.standard.set(editorPath, forKey: "Editor") NSWorkspace.shared.openFile(self.assetsURL.path, withApplication: editorPath) } } openPanel.close() }) } } override func keyDown(with event: NSEvent) { if event.characters == "e" { openEditor() } else if event.characters == "d" { debugMesh.visible = !debugMesh.visible } } #endif }
[ -1 ]
340d5bd7971100b5b07570957d3502abdf573e91
f68b11f3706e66e7b3183a15e3006adbe1913301
/StoryTreeiOS/Presentation/Utils/ifIsSafe.swift
d696504d4500b93507f476412f54fa5eb774babf
[]
no_license
EliasPaulinoAndrade/StoryTree
aba89ff9899641de161a6b9c2b54977edf136b93
11ea5b33547c00873e401440209d1dc8f2367ad4
refs/heads/master
2023-01-29T08:49:17.065094
2020-12-03T23:21:15
2020-12-03T23:21:15
236,108,347
2
0
null
null
null
null
UTF-8
Swift
false
false
934
swift
// // ifIsSafe.swift // StoryTreeiOS // // Created by Elias Paulino on 25/01/20. // Copyright © 2020 Elias Paulino. All rights reserved. // import Foundation protocol DefaultConvertible { associatedtype DefaultType static var defaultValue: DefaultType { get } } func ifIsSafe<T>(_ unsafeVar: T?, _ completion: (T) -> Void) { if let safeVar = unsafeVar { completion(safeVar) } } func ifIsSafe<I, O>(_ usafeVar: I?, default defaultValue: O, _ completion: (I) -> O) -> O { if let safeVar = usafeVar { return completion(safeVar) } return defaultValue } func ifIsSafe<I, O: DefaultConvertible>(_ usafeVar: I?, _ completion: (I) -> O) -> O where O.DefaultType == O { return ifIsSafe(usafeVar, default: O.defaultValue, completion) } extension Array: DefaultConvertible { typealias DefaultType = Array static var defaultValue: Array<Element> { return [] } }
[ -1 ]
03d5c9a26494dfa2f6e4c8b94970e60b83e372cd
da29296abff7b3abd216fac0887708d9afcc2b30
/BookMadi/Enum/Enums.swift
b2b689d0d73e28125de271785a2db2aaf3eef9ba
[ "MIT" ]
permissive
Krishnamurtyp/FlightBookingApp-iOS
5d5ad3ebc77c3a98c5f5f6968d14f4e49a51ac2a
c523196bfdedc2cd69a53abbe876f635b4e9c8da
refs/heads/main
2023-07-24T08:09:45.702601
2021-03-03T20:12:55
2021-03-03T20:12:55
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,279
swift
// // Enum.swift // BookMadi // // Created by Siddhant Mishra on 06/02/21. // import Foundation import UIKit enum FlightClassType:String,CaseIterable{ case Economy case Business case Elite var icon:UIImage{ switch self { case .Economy: return UIImage(named: "Economy")! case .Business: return UIImage(named: "Business")! case .Elite: return UIImage(named: "Elite")! } } var seats:Int{ switch self { case .Economy: return 36 case .Business: return 24 case .Elite: return 16 } } // static let allValues = ["Economy", "Business", "Elite"] } enum ProjectFont{ case regular(CGFloat) case medium(CGFloat) case bold(CGFloat) var customFont:UIFont{ switch self { case .regular(let size): return UIFont(name: "HelveticaNeue", size: size)! case .medium(let size): return UIFont(name: "HelveticaNeue-medium", size: size)! case .bold(let size): return UIFont(name: "HelveticaNeue-bold", size: size)! } } }
[ -1 ]
e4f80f02c036388930bf70e6a69c0fb332619f97
505733d15075138065b8bd5b86c91b959734a663
/News App/TableView/FavoriteNews/FavoriteNewsTableCoordinator.swift
9db8b04c3f89541c81fb505b8bcd16177ef7d99b
[]
no_license
myCRObaM/NewsApp
8c316606547c2e8b4e6b8c10110b70b2d94c48ec
42a9f9fcae27d4c30fa4d16a318c1170441b2535
refs/heads/master
2020-06-24T13:22:46.894654
2019-08-02T12:01:35
2019-08-02T12:01:35
198,973,156
0
0
null
null
null
null
UTF-8
Swift
false
false
1,543
swift
// // FavoriteNewsTableCoordinator.swift // News App // // Created by Matej Hetzel on 01/08/2019. // Copyright © 2019 Matej Hetzel. All rights reserved. // import Foundation import UIKit class FavoriteNewsTableCoordinator: Coordinator { var childCoordinators: [Coordinator] = [] var parent: UINavigationController var changeFavoriteStateDelegate: FavoriteDelegate? init (navController: UINavigationController, root: TabBarCoordinator){ self.parent = navController let favoriteNewsTableViewController = FavoriteNewsViewController() favoriteNewsTableViewController.changeFavoriteStateDelegate = root favoriteNewsTableViewController.selectedDetailsDelegate = self root.favoriteNewsViewController = favoriteNewsTableViewController } func start() { } } extension FavoriteNewsTableCoordinator: DetailsNavigationDelegate, ChildHasFinishedDelegate, WorkIsDoneDelegate{ func openDetailsView(news: Article) { let details = DetailsViewCoordinator(navController: parent, news: news, root: self) self.addCoordinator(coordinator: details) details.childFinishedDelegate = self self.addCoordinator(coordinator: details) details.start() } func childIsDone(coordinator: Coordinator) { self.removeCoordinator(coordinator: coordinator) print(coordinator) } func done(cooridinator: Coordinator) { childCoordinators.removeAll() childIsDone(coordinator: cooridinator) } }
[ -1 ]
b2af65c9ff0c02e32a56384bb1c85a242bf26c3b
66a21f3e70bff0fbfe34928523a891e7b8a778a1
/FlickrSearch/FlickrPhoto.swift
2b5943e9804716b7b4939eedfbdf98357929673a
[ "MIT" ]
permissive
hungMighty/FlickrSearch
1ef47c3bbd4b08215b0a2a8490c826e2f4965d6b
b9a4b78e58054abb41511d73d8226a5fbf348a78
refs/heads/master
2021-05-06T23:11:52.970250
2017-12-12T12:57:31
2017-12-12T12:57:31
112,955,162
0
0
null
null
null
null
UTF-8
Swift
false
false
3,476
swift
/** * Copyright (c) 2016 Razeware 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, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ import UIKit class FlickrPhoto : Equatable { var thumbnail : UIImage? var largeImage : UIImage? let photoID : String let farm : Int let server : String let secret : String init (photoID:String, farm:Int, server:String, secret:String) { self.photoID = photoID self.farm = farm self.server = server self.secret = secret } func flickrImageURL(_ size:String = "m") -> URL? { if let url = URL(string: "https://farm\(farm).staticflickr.com/\(server)/\(photoID)_\(secret)_\(size).jpg") { return url } return nil } func loadLargeImage(_ completion: @escaping (_ flickrPhoto:FlickrPhoto, _ error: NSError?) -> Void) { guard let loadURL = flickrImageURL("b") else { DispatchQueue.main.async { completion(self, nil) } return } let loadRequest = URLRequest(url:loadURL) URLSession.shared.dataTask(with: loadRequest, completionHandler: { (data, response, error) in if let error = error { DispatchQueue.main.async { completion(self, error as NSError?) } return } guard let data = data else { DispatchQueue.main.async { completion(self, nil) } return } let returnedImage = UIImage(data: data) self.largeImage = returnedImage DispatchQueue.main.async { completion(self, nil) } }).resume() } func sizeToFillWidthOfSize(_ size:CGSize) -> CGSize { guard let thumbnail = thumbnail else { return size } let imageSize = thumbnail.size var returnSize = size let aspectRatio = imageSize.width / imageSize.height returnSize.height = returnSize.width / aspectRatio if returnSize.height > size.height { returnSize.height = size.height returnSize.width = size.height * aspectRatio } return returnSize } } func == (lhs: FlickrPhoto, rhs: FlickrPhoto) -> Bool { return lhs.photoID == rhs.photoID }
[ -1 ]
4412c538a6f721d8a3777bfb41fa9d3aafe5000f
596fb56fb87a506e54e665536553ecc28388c29a
/TouristSites/Helper/NetworkMonitor.swift
b9a63a5f0fc15d39d63391ced3ab4b031b7656f4
[]
no_license
littlema0404/TouristSites
e68d51601b40e3e48aa539576bc52f2338680240
5ca363838ada450b66b1020ca2d099f45cf24d69
refs/heads/master
2020-08-30T14:07:57.313336
2019-12-17T06:29:03
2019-12-17T06:29:03
218,404,186
0
0
null
null
null
null
UTF-8
Swift
false
false
1,633
swift
// // NetworkMonitor.swift // TouristSites // // Created by littlema on 2019/10/30. // Copyright © 2019 littema. All rights reserved. // import Network enum Reachable { case yes, no } enum Connection { case cellular, loopback, wifi, wiredEthernet, other } class NetworkMonitor { private let monitor: NWPathMonitor = NWPathMonitor() var path: NWPath { return monitor.currentPath } init() { let queue = DispatchQueue.global(qos: .background) monitor.start(queue: queue) } } extension NetworkMonitor { func startMonitoring( callBack: @escaping (_ connection: Connection, _ rechable: Reachable) -> Void ) -> Void { monitor.pathUpdateHandler = { path in let reachable = (path.status == .unsatisfied || path.status == .requiresConnection) ? Reachable.no : Reachable.yes if path.availableInterfaces.count == 0 { return callBack(.other, .no) } else if path.usesInterfaceType(.wifi) { return callBack(.wifi, reachable) } else if path.usesInterfaceType(.cellular) { return callBack(.cellular, reachable) } else if path.usesInterfaceType(.loopback) { return callBack(.loopback, reachable) } else if path.usesInterfaceType(.wiredEthernet) { return callBack(.wiredEthernet, reachable) } else if path.usesInterfaceType(.other) { return callBack(.other, reachable) } } } } extension NetworkMonitor { func cancel() { monitor.cancel() } }
[ -1 ]
e6696c07e7799f94fcb384b8943cd4f228fd05ad
8849cfcc6fd118951252f21da57206e77b2164cd
/SharedCode/application/CMPermissionsManager.swift
556113137b8351b4aa9d0b2d5069c22416be49c0
[]
no_license
ldt25290/capturelive-secret
14bf3d83225505472df3b7ebf33c45c5139a5133
6de0d028af3819dce9406eedb9b2834d57a52663
refs/heads/master
2021-06-04T21:27:11.534079
2016-07-19T20:04:19
2016-07-19T20:04:19
null
0
0
null
null
null
null
UTF-8
Swift
false
false
6,992
swift
// // CMPermissionsManager.swift // Capture-Live // // Created by hatebyte on 6/29/15. // Copyright (c) 2015 CaptureMedia. All rights reserved. // import UIKit import CoreLocation enum Permissions : Int { case NONE = 0 case LocationTracking = 1 case PushNotifications = 2 case ALL = 3 } enum PermissionAlerts : String { case LocationTracking = "LocationTracking" case PushNotifications = "PushNotifications" } public typealias Accepted = ()->() public typealias Denied = ()->() public class CMPermissionsManager: NSObject { static let DEVICE_TOKEN = "com.capturemedia.user.device.token" var accepted:Accepted! var denied:Denied! let persistanceLayer:ApplicationRememberable! public init(persistanceLayer:ApplicationRememberable) { self.persistanceLayer = persistanceLayer super.init() } func hasAcceptedSettings()->Bool { return (hasLocationSettingsTurnedOn() == true && hasNotificationsTurnedOn() == true) } public func hasLocationSettingsTurnedOn()->Bool { if CLLocationManager.authorizationStatus() == CLAuthorizationStatus.Denied { return false } if CLLocationManager.authorizationStatus() == CLAuthorizationStatus.Restricted { return false } if CLLocationManager.authorizationStatus() == CLAuthorizationStatus.NotDetermined { return false } return true } public func hasNotificationsTurnedOn()->Bool { // let application = UIApplication.sharedApplication() var enabled = false // if #available(iOS 8.0, *) { let notifSettings = UIApplication.sharedApplication().currentUserNotificationSettings()! enabled = (notifSettings.types != UIUserNotificationType.None) // } else { // let types = application.enabledRemoteNotificationTypes() // enabled = !(types == UIRemoteNotificationType.None) // } return enabled } func areThereNotificationSettings()->Bool { // if #available(iOS 8.0, *) { if let _ = UIApplication.sharedApplication().currentUserNotificationSettings() { return true } // } return false } func askForLocationPermission() { CMUserMovementManager.shared.startSemiPreciseLocation { (location, transportation) -> () in } } func askForPushPermission() { if hasNotificationsTurnedOn() == true && hasDeviceToken() { return } // if #available(iOS 8.0, *) { let settings = UIUserNotificationSettings(forTypes:([UIUserNotificationType.Sound, UIUserNotificationType.Alert, UIUserNotificationType.Badge]), categories: nil) print(UIApplication.sharedApplication()) UIApplication.sharedApplication().registerUserNotificationSettings(settings) UIApplication.sharedApplication().registerForRemoteNotifications() // } else { // let types: UIRemoteNotificationType = [UIRemoteNotificationType.Badge, UIRemoteNotificationType.Sound, UIRemoteNotificationType.Alert] // UIApplication.sharedApplication().registerForRemoteNotificationTypes(types) // } } func permissions()->Permissions { var p = Permissions.NONE if hasLocationSettingsTurnedOn() == true { p = Permissions.LocationTracking } if hasNotificationsTurnedOn() == true { p = (p == Permissions.LocationTracking) ? Permissions.ALL : Permissions.PushNotifications } return p } func navigateToSettings() { // if #available(iOS 8.0, *) { UIApplication.sharedApplication().openURL(NSURL(string: UIApplicationOpenSettingsURLString)!) // } else { // print("Can't open Settings URL. Not available in this SDK") // } } // func checkSettingStatus(viewController:UIViewController) { // // check permissions // let hasBothPermissions = self.hasAcceptedSettings() // // let controllerName = NSStringFromClass(viewController.dynamicType) // if controllerName == self.modalName && hasBothPermissions == true { // // remove controller // viewController.dismissViewControllerAnimated(true, completion: nil) // } // // if controllerName != self.modalName && hasBothPermissions == false { // // add controller // let vc = CMPermissionsBlockModalViewController(nibName:"CMPermissionsBlockModalViewController", bundle:nil) // viewController.navigationController?.presentViewController(vc, animated: true, completion: nil) // } // } // func saveDeviceToken(data:NSData) { // let tokenChars = UnsafePointer<CChar>(data.bytes) // var deviceToken = "" // // for var i = 0; i < data.length; i++ { // deviceToken += String(format: "%02.2hhx", arguments: [tokenChars[i]]) // } // persistanceLayer.setDevicePushToken(deviceToken) // } func hasDeviceToken()->Bool { return persistanceLayer.pushToken != nil } //MARK: Alert func attemptToNavigateUserToSettings() { print("TODO : Add navigate to setttings!!!!!!!! CMPermissionsManager - line 157") // let title = NSLocalizedString("PERMISSIONS ALERT", comment: "PermissionsScreen : promptToUserSettingsAlert : title") // let message = NSLocalizedString("You must enable all permissions in order to get jobs.", comment: "PermissionsScreen : promptToUserSettingsAlert : title") // let okButton = NSLocalizedString("GO TO SETTINGS", comment: "PermissionsScreen : promptToUserSettingsAlert : okButtonTitle") // let cancelButton = NSLocalizedString("NO THANKS", comment: "PermissionsScreen : promptToUserSettingsAlert : cancelButtonTitle") // // let alertView = CMAlertController(title:title, message: message) // let settingsAction = CMAlertAction(title:okButton, style: .Primary) { () -> () in // CMPermissionsManager.shared.navigateToSettings() // } // // let cancelAction = CMAlertAction(title:cancelButton, style: .Secondary, handler:nil) // // alertView.addAction(cancelAction) // alertView.addAction(settingsAction) // // CMAlert.presentViewController(alertView) } }
[ -1 ]
841867fce4bc2ba7ff58debaba548226d9dcdd2a
74ce7b39996c82f5f41c80f10e2495417cf47148
/HW2/Notes/Notes/ViewController.swift
9a993869b3e87e2efc1a3e4e52c2cbde7e85f7a9
[]
no_license
H4wking/iOS_Homeworks
bc396e730c1950b594325d2ce1db8ed9f7112ca9
6b7b71667e1c4d700d3fcd7a6419252e125708e2
refs/heads/master
2023-01-22T03:14:22.656136
2020-12-06T21:17:24
2020-12-06T21:17:24
302,447,079
0
0
null
null
null
null
UTF-8
Swift
false
false
337
swift
// // ViewController.swift // Notes // // Created by Danylo Nazaruk on 06.11.2020. // Copyright © 2020 Danylo Nazaruk. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } }
[ 322394, 358261 ]
b4e29ef8d71d2672de25bba95647c396be4c2037
dc4481802e3da7167ef3ab98fafcd0e723d647c0
/ios/ios/DashViewController.swift
39e0eaf12997f79b18117923ce6f3c354b9772d7
[]
no_license
JackMc/StepItUp
46edcc60552ea7a9e3bf79b9f95ba524d81406f3
68b55b48ea1fbb89e25a7612757479d70ebbddcc
refs/heads/master
2021-01-21T02:35:34.091673
2016-09-18T02:43:06
2016-09-18T02:43:06
68,431,214
0
0
null
null
null
null
UTF-8
Swift
false
false
550
swift
// // DashViewController.swift // ios // // Created by Elisa Kazan on 2016-09-17. // Copyright © 2016 HackTheNorth. All rights reserved. // import UIKit class DashViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. print("finally it begins...") } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ 279041, 279046, 277512, 215562, 275466, 278543, 281107, 279064, 281118, 284197, 289318, 296487, 296489, 304174, 309807, 300086, 234551, 279096, 286775, 300089, 234043, 288827, 238653, 226878, 288321, 129604, 301637, 226887, 293961, 286796, 158285, 226896, 212561, 284242, 292435, 300629, 276054, 237655, 307288, 40545, 200802, 284261, 281703, 306791, 286314, 296042, 164974, 307311, 281202, 284275, 277108, 300149, 314996, 276087, 234619, 284287, 284289, 276612, 280710, 284298, 303242, 278157, 311437, 226447, 234641, 349332, 117399, 280219, 282270, 285855, 228000, 282275, 278693, 287399, 100521, 313007, 277171, 307379, 284341, 286390, 300727, 282301, 277696, 285377, 280770, 227523, 302788, 228551, 279751, 280775, 279754, 282311, 230604, 284361, 276686, 298189, 282320, 229585, 302286, 307410, 189655, 302295, 226009, 282329, 363743, 282338, 228585, 282346, 358127, 312049, 286963, 280821, 120054, 226038, 234232, 282357, 280826, 286965, 358139, 282365, 286462, 280832, 282368, 358147, 226055, 282377, 299786, 312586, 300817, 282389, 282393, 329499, 228127, 315170, 282403, 281380, 233767, 283433, 130346, 282411, 293682, 159541, 282426, 289596, 283453, 307516, 279360, 289088, 293700, 234829, 307029, 241499, 308064, 227688, 313706, 290303, 306540, 299374, 162672, 199024, 276849, 292730, 333179, 303998, 290175, 275842, 224643, 304008, 324491, 304012, 304015, 300432, 226705, 310673, 277406, 285087, 234402, 289187, 284580, 276396, 286126, 277935, 324528, 282035, 292277, 296374, 130487, 234423, 277432, 278968, 293308, 278973, 295874, 299973, 165832, 306633, 286158, 280015, 310734, 301016, 163289, 286175, 234465, 168936, 294889, 231405, 183278, 282095, 227315, 296436, 281078, 290299, 233980, 287231 ]
0ddd9a0b560f89dfba839f69f8a48a0de116766d
82653675e71ced6a71c6df5cbec0532023d1b52b
/Source/Core/ErrorResponse.swift
3c65f8701ad1742076d304757c5c7b66d69e8e83
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
MediaMonksMobile/frames-ios
c42eb1a0ed134676dce902a4f9dbdc4474e3ae7c
5321348afa3e3dc9abe25cc43a36769b21b10ce2
refs/heads/master
2023-08-14T10:52:37.278844
2021-10-06T16:23:06
2021-10-06T16:23:12
null
0
0
null
null
null
null
UTF-8
Swift
false
false
528
swift
import Foundation @available(*, deprecated, message: """ This will be removed in a future release. Please use the `Result` based API in `CheckoutAPIClient`. """) public struct ErrorResponse: Codable, Equatable { /// The error request ID used by Checkout.com to trace what went wrong in the transaction public let requestId: String /// The general code associated with the error public let errorType: String /// The general code associated with the error public let errorCodes: [String] }
[ -1 ]
3ac8c96479a3105f32788022e4f81ce793ede8d6
a1eeab70af2426a6fef42b54a0ec7dabe6a4391f
/codepathinsta/Post.swift
cfe987587d821a961dc69ba8c2b80658fa60e192
[ "Apache-2.0" ]
permissive
tpham44/InstaParse
8471cd1b76f95b3a3be794bb75bd5087af764a99
2a37f95e4447ea9dfbb5b17cd52779eed7adf8d2
refs/heads/master
2021-01-10T03:01:05.598803
2016-03-10T23:37:19
2016-03-10T23:37:19
53,292,730
0
0
null
null
null
null
UTF-8
Swift
false
false
2,746
swift
// // Post.swift // codepathinsta // // Created by JP on 3/6/16. // Copyright © 2016 tpham44. All rights reserved. // import UIKit import Parse class Post: NSObject { /** Method to add a user post to Parse (uploading image file) - parameter image: Image that the user wants upload to parse - parameter caption: Caption text input by the user - parameter completion: Block to be executed after save operation is complete */ class func postUserImage(image: UIImage?, withCaption caption: String?, withCompletion completion: PFBooleanResultBlock?) { // Create Parse object PFObject let post = PFObject(className: "Post") // Add relevant fields to the object post["media"] = getPFFileFromImage(image) // PFFile column type post["author"] = PFUser.currentUser() // Pointer column type that points to PFUser post["caption"] = caption post["likesCount"] = 0 post["commentsCount"] = 0 // Save object (following function will save the object in Parse asynchronously) post.saveInBackgroundWithBlock(completion) } class func resize(image: UIImage, newSize: CGSize) -> UIImage { let resizeImageView = UIImageView(frame: CGRectMake(0, 0, newSize.width, newSize.height)) resizeImageView.contentMode = UIViewContentMode.ScaleAspectFill resizeImageView.image = image UIGraphicsBeginImageContext(resizeImageView.frame.size) resizeImageView.layer.renderInContext(UIGraphicsGetCurrentContext()!) let newImage = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return newImage } class func postUserProfile(image: UIImage?, withCompletion completion: PFBooleanResultBlock?) { let post = PFObject(className: "Profile") post["UserName"] = PFUser.currentUser()?.username! resize(image!, newSize: CGSize(width: 100, height: 100)) post["profilePicture"] = getPFFileFromImage(image) post.saveInBackgroundWithBlock(completion) } /** Method to convert UIImage to PFFile - parameter image: Image that the user wants to upload to parse - returns: PFFile for the the data in the image */ class func getPFFileFromImage(image: UIImage?) -> PFFile? { // check if image is not nil if let image = image { // get image data and check if that is not nil if let imageData = UIImagePNGRepresentation(image) { return PFFile(name: "image.png", data: imageData) } } return nil } }
[ -1 ]
7e0c8da3eb556ba81dfa227e6fd7edec4e445673
194375a2de7a70fb059c003205003f528b4d9829
/E89iosSocial/AbstractSocialAuth.swift
98e3d73135fdfe3b51d74fe6bf16d3a279bce491
[]
no_license
estudio89/ios-social
f7ac4719f1d58ed7559edd58699510caca13e23f
d2e0df9abc5e0791e5c574db5ff0d903800c4ae4
refs/heads/master
2016-08-11T07:08:06.100391
2016-04-18T19:19:35
2016-04-18T19:19:35
54,220,877
0
0
null
null
null
null
UTF-8
Swift
false
false
3,798
swift
// // AbstractSocialAuth.swift // E89iosSocial // // Created by Rodrigo Suhr on 3/17/16. // Copyright © 2016 Rodrigo Suhr. All rights reserved. // import Foundation class AbstractSocialAuth: NSObject, SocialAuth { static var LOGGED_IN_KEY = "logged_in" static var NAME_KEY = "name" static var EMAIL_KEY = "email" static var TOKEN_KEY = "token" static var USER_ID_KEY = "user_id" internal var listener: SocialAuthListener? init(listener: SocialAuthListener) { self.listener = listener } func setupLogin(loginBtn: UIView) { } func getSocialAuthIdentifier() -> String { return "" } func initializeSDK() { } /** * This method should be called whenever login is finished successfully, marking the user as logged in. * @param loggedIn Bool */ func setLoginStatus(loggedIn: Bool) { let defaults = NSUserDefaults.standardUserDefaults() defaults.setBool(loggedIn, forKey: getSocialAuthIdentifier() + "." + AbstractSocialAuth.LOGGED_IN_KEY) } /** * Stores the authentication data. This method must be called by child classes right after * authentication was successful. * @param name String * @param email String * @param token String * @param userId String */ func storeAuthData(name: String, email: String, token: String, userId: String) { let defaults = NSUserDefaults.standardUserDefaults() defaults.setValue(name, forKey: getSocialAuthIdentifier() + "." + AbstractSocialAuth.NAME_KEY) defaults.setValue(email, forKey: getSocialAuthIdentifier() + "." + AbstractSocialAuth.EMAIL_KEY) defaults.setValue(token, forKey: getSocialAuthIdentifier() + "." + AbstractSocialAuth.TOKEN_KEY) defaults.setValue(userId, forKey: getSocialAuthIdentifier() + "." + AbstractSocialAuth.USER_ID_KEY) } /** * Returns an array with the social authentication data. * * @return social authentication data where data[0] is the user's name, data[1] is the user's * email address, data[2] is the token and data[3] is the user's id. */ func getAuthData() -> [String] { var authData: [String] = [] let defaults = NSUserDefaults.standardUserDefaults() let name : String? = defaults.stringForKey(getSocialAuthIdentifier() + "." + AbstractSocialAuth.NAME_KEY) let email : String? = defaults.stringForKey(getSocialAuthIdentifier() + "." + AbstractSocialAuth.EMAIL_KEY) let token : String? = defaults.stringForKey(getSocialAuthIdentifier() + "." + AbstractSocialAuth.TOKEN_KEY) let userId : String? = defaults.stringForKey(getSocialAuthIdentifier() + "." + AbstractSocialAuth.USER_ID_KEY) if (name != nil && email != nil && token != nil ) { authData.append(name!) authData.append(email!) authData.append(token!) authData.append(userId!) } return authData } func clearAuthData() { let defaults = NSUserDefaults.standardUserDefaults() defaults.removeObjectForKey(getSocialAuthIdentifier() + "." + AbstractSocialAuth.NAME_KEY) defaults.removeObjectForKey(getSocialAuthIdentifier() + "." + AbstractSocialAuth.EMAIL_KEY) defaults.removeObjectForKey(getSocialAuthIdentifier() + "." + AbstractSocialAuth.TOKEN_KEY) } func logout() { setLoginStatus(false) clearAuthData() self.listener?.onSocialLogout?(getSocialAuthIdentifier()) } func isLoggedIn() -> Bool { let defaults = NSUserDefaults.standardUserDefaults() return defaults.boolForKey(getSocialAuthIdentifier() + "." + AbstractSocialAuth.LOGGED_IN_KEY) } }
[ -1 ]
72a15dda1a5db50774ab716db8da75a2b67a550f
baf071e5a9ed55b4ed97d0f67badde048aea88d4
/iOS/APIExample/Examples/Advanced/StreamEncryption/StreamEncryption.swift
439c5705fd71fa9ca4f23ecf8d575a4bdc10a735
[ "MIT" ]
permissive
JioaXiake/API-Examples
537f8fdc38698fbf51f340d57c9a6199db93b80c
16de7eb3446d9111bf51afc5260b91f47ab32392
refs/heads/master
2023-01-28T03:46:46.652479
2020-12-08T06:45:59
2020-12-08T06:45:59
null
0
0
null
null
null
null
UTF-8
Swift
false
false
10,984
swift
// // JoinChannelVC.swift // APIExample // // Created by 张乾泽 on 2020/4/17. // Copyright © 2020 Agora Corp. All rights reserved. // import UIKit import AGEVideoLayout import AgoraRtcKit class StreamEncryptionEntry : UIViewController { @IBOutlet weak var joinButton: UIButton! @IBOutlet weak var channelTextField: UITextField! @IBOutlet weak var encryptSecretField: UITextField! @IBOutlet weak var encryptModeBtn: UIButton! var mode:AgoraEncryptionMode = .AES128XTS var useCustom:Bool = false let identifier = "StreamEncryption" override func viewDidLoad() { super.viewDidLoad() encryptModeBtn.setTitle("\(mode.description())", for: .normal) } @IBAction func doJoinPressed(sender: UIButton) { guard let channelName = channelTextField.text, let secret = encryptSecretField.text else {return} //resign channel text field channelTextField.resignFirstResponder() encryptSecretField.resignFirstResponder() let storyBoard: UIStoryboard = UIStoryboard(name: identifier, bundle: nil) // create new view controller every time to ensure we get a clean vc guard let newViewController = storyBoard.instantiateViewController(withIdentifier: identifier) as? BaseViewController else {return} newViewController.title = channelName newViewController.configs = ["channelName":channelName, "mode":mode, "secret":secret, "useCustom": useCustom] self.navigationController?.pushViewController(newViewController, animated: true) } func getEncryptionModeAction(_ mode:AgoraEncryptionMode) -> UIAlertAction{ return UIAlertAction(title: "\(mode.description())", style: .default, handler: {[unowned self] action in self.mode = mode self.useCustom = false self.encryptModeBtn.setTitle("\(mode.description())", for: .normal) }) } @IBAction func setEncryptionMode(){ let alert = UIAlertController(title: "Set Encryption Mode".localized, message: nil, preferredStyle: .actionSheet) for profile in AgoraEncryptionMode.allValues(){ alert.addAction(getEncryptionModeAction(profile)) } // add custom option alert.addAction(UIAlertAction(title: "Custom", style: .default, handler: { (action:UIAlertAction) in self.useCustom = true self.encryptModeBtn.setTitle("Custom", for: .normal) })) alert.addCancelAction() present(alert, animated: true, completion: nil) } } class StreamEncryptionMain: BaseViewController { var localVideo = Bundle.loadView(fromNib: "VideoView", withType: VideoView.self) var remoteVideo = Bundle.loadView(fromNib: "VideoView", withType: VideoView.self) @IBOutlet weak var container: AGEVideoContainer! var agoraKit: AgoraRtcEngineKit! // indicate if current instance has joined channel var isJoined: Bool = false override func viewDidLoad() { super.viewDidLoad() // layout render view localVideo.setPlaceholder(text: "Local Host".localized) remoteVideo.setPlaceholder(text: "Remote Host".localized) container.layoutStream(views: [localVideo, remoteVideo]) // set up agora instance when view loadedlet config = AgoraRtcEngineConfig() let config = AgoraRtcEngineConfig() config.appId = KeyCenter.AppId config.areaCode = GlobalSettings.shared.area.rawValue agoraKit = AgoraRtcEngineKit.sharedEngine(with: config, delegate: self) agoraKit.setLogFile(LogUtils.sdkLogPath()) // get channel name from configs guard let channelName = configs["channelName"] as? String, let secret = configs["secret"] as? String, let mode = configs["mode"] as? AgoraEncryptionMode, let useCustom = configs["useCustom"] as? Bool else {return} // make myself a broadcaster agoraKit.setChannelProfile(.liveBroadcasting) agoraKit.setClientRole(.broadcaster) // enable encryption if(!useCustom) { // sdk encryption let config = AgoraEncryptionConfig() config.encryptionMode = mode config.encryptionKey = secret let ret = agoraKit.enableEncryption(true, encryptionConfig: config) if ret != 0 { // for errors please take a look at: // CN https://docs.agora.io/cn/Video/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/enableEncryption:encryptionConfig: // EN https://docs.agora.io/en/Video/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/enableEncryption:encryptionConfig: self.showAlert(title: "Error", message: "enableEncryption call failed: \(ret), please check your params") } } else { // your own custom algorithm encryption AgoraCustomEncryption.registerPacketProcessing(agoraKit) } // enable video module and set up video encoding configs agoraKit.enableVideo() agoraKit.setVideoEncoderConfiguration(AgoraVideoEncoderConfiguration(size: AgoraVideoDimension640x360, frameRate: .fps15, bitrate: AgoraVideoBitrateStandard, orientationMode: .adaptative)) // set up local video to render your local camera preview let videoCanvas = AgoraRtcVideoCanvas() videoCanvas.uid = 0 // the view to be binded videoCanvas.view = localVideo.videoView videoCanvas.renderMode = .hidden agoraKit.setupLocalVideo(videoCanvas) // Set audio route to speaker agoraKit.setDefaultAudioRouteToSpeakerphone(true) // start joining channel // 1. Users can only see each other after they join the // same channel successfully using the same app id. // 2. If app certificate is turned on at dashboard, token is needed // when joining channel. The channel name and uid used to calculate // the token has to match the ones used for channel join let result = agoraKit.joinChannel(byToken: KeyCenter.Token, channelId: channelName, info: nil, uid: 0) {[unowned self] (channel, uid, elapsed) -> Void in self.isJoined = true LogUtils.log(message: "Join \(channel) with uid \(uid) elapsed \(elapsed)ms", level: .info) } if result != 0 { // Usually happens with invalid parameters // Error code description can be found at: // en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html // cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html self.showAlert(title: "Error", message: "joinChannel call failed: \(result), please check your params") } } override func willMove(toParent parent: UIViewController?) { if parent == nil { // leave channel when exiting the view // deregister packet processing AgoraCustomEncryption.deregisterPacketProcessing(agoraKit) if isJoined { agoraKit.leaveChannel { (stats) -> Void in LogUtils.log(message: "left channel, duration: \(stats.duration)", level: .info) } } } } } /// agora rtc engine delegate events extension StreamEncryptionMain: AgoraRtcEngineDelegate { /// callback when warning occured for agora sdk, warning can usually be ignored, still it's nice to check out /// what is happening /// Warning code description can be found at: /// en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html /// @param warningCode warning code of the problem func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurWarning warningCode: AgoraWarningCode) { LogUtils.log(message: "warning: \(warningCode.description)", level: .warning) } /// callback when error occured for agora sdk, you are recommended to display the error descriptions on demand /// to let user know something wrong is happening /// Error code description can be found at: /// en: https://docs.agora.io/en/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html /// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraErrorCode.html /// @param errorCode error code of the problem func rtcEngine(_ engine: AgoraRtcEngineKit, didOccurError errorCode: AgoraErrorCode) { LogUtils.log(message: "error: \(errorCode)", level: .error) self.showAlert(title: "Error", message: "Error \(errorCode.description) occur") } /// callback when a remote user is joinning the channel, note audience in live broadcast mode will NOT trigger this event /// @param uid uid of remote joined user /// @param elapsed time elapse since current sdk instance join the channel in ms func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinedOfUid uid: UInt, elapsed: Int) { LogUtils.log(message: "remote user join: \(uid) \(elapsed)ms", level: .info) // Only one remote video view is available for this // tutorial. Here we check if there exists a surface // view tagged as this uid. let videoCanvas = AgoraRtcVideoCanvas() videoCanvas.uid = uid // the view to be binded videoCanvas.view = remoteVideo.videoView videoCanvas.renderMode = .hidden agoraKit.setupRemoteVideo(videoCanvas) } /// callback when a remote user is leaving the channel, note audience in live broadcast mode will NOT trigger this event /// @param uid uid of remote joined user /// @param reason reason why this user left, note this event may be triggered when the remote user /// become an audience in live broadcasting profile func rtcEngine(_ engine: AgoraRtcEngineKit, didOfflineOfUid uid: UInt, reason: AgoraUserOfflineReason) { LogUtils.log(message: "remote user left: \(uid) reason \(reason)", level: .info) // to unlink your view from sdk, so that your view reference will be released // note the video will stay at its last frame, to completely remove it // you will need to remove the EAGL sublayer from your binded view let videoCanvas = AgoraRtcVideoCanvas() videoCanvas.uid = uid // the view to be binded videoCanvas.view = nil videoCanvas.renderMode = .hidden agoraKit.setupRemoteVideo(videoCanvas) } }
[ -1 ]
9143af953fa805dc842de0e68f6fa17138f46d9e
43ff0c7eabf591b3deaf4fe9e0aaaf02a78cbc41
/Jahez/Jahez/Data.swift
3d3744b7f23756ec9d1fc083df18daf6bbdd4d95
[]
no_license
fawazmm79/week2-project1-jahez
5d6923b4d12d0c6f49112f27594bf14de233721d
0b157bf56c0e1a6643163675fd8ef5135910c8c0
refs/heads/main
2023-08-22T23:19:50.673001
2021-10-11T08:59:40
2021-10-11T08:59:40
414,678,429
0
0
null
null
null
null
UTF-8
Swift
false
false
2,177
swift
// // Data.swift // Jahez // // Created by Fawaz on 04/03/1443 AH. // import UIKit struct Rest{ let name: String let type: String let state: String let rating: Double let logo: String let foods: Array <Food> } struct Food { let name: String let image: String let price: Double } let restList = [ Rest( name: "مقهى ايت اوز", type: "قهوه، مشروبات، حلويات", state: "مفتوح", rating: 4.3, logo: "oz", foods: [ Food(name: "فلايت وايت مع كوكيز", image: "oz1", price: 20), Food(name: "كعكه الحليب بالزعفران", image: "oz2", price: 15) ] ), Rest( name: "دانكن دونت", type: "مشروبات، حلويات، قهوه", state: "مفتوح", rating: 4.5, logo: "dun", foods: [ Food(name: "عرض الجمعه", image: "dun1", price: 20), Food(name: "كرك شاي", image: "dun2", price: 10) ] ), Rest( name: "باسكن روبنز", type: "حلويات، ايس كريم", state: "مغلق", rating: 4.0, logo: "bas", foods: [ Food(name: "مغرفه التوفير", image: "bas1", price: 15), Food(name: "ايس كريم", image: "bas2", price: 8) ] ), Rest( name: "دومينوز بيتزا", type: "بيتزا، ماكولات سريعه", state: "مفتوح", rating: 4.2, logo: "dom", foods: [ Food(name: "داينمايت بيتزا", image: "dom1", price: 33), Food(name: "عرض بدون شروط", image: "dom2", price: 29) ] ), Rest( name: "شاورمر", type: "شاورما، ساندويشات", state: "مفتوح", rating: 3.5, logo: "sha", foods: [ Food(name: "طلبك بطلبين", image: "sha1", price: 29), Food(name: "شاورما عربي", image: "sha2", price: 30) ] ), Rest( name: "البرجر الطازج", type: "ماكولات سريعه، ساندويشات", state: "مفتوح", rating: 3.3, logo: "bur", foods: [ Food(name: "برجر دجاج", image: "bur1", price: 26), Food(name: "برجر لحم", image: "bur2", price: 30) ] ) ]
[ -1 ]
9c8fa3415fb10e4fe139e8668b3a10fba83cefee
736888800424c9b17c88b0ee366c34e89df67c30
/RSSchool_T10/RSSchool_T10/ViewController.swift
4c306d5e68be52ff0adff967be73346e4e3e4f3b
[]
no_license
ochilov/rs.ios.stage-task10
d9bf5063b0039ac32e7abfcc854cf9159bd30374
1456c6f2fc11f3bdc5bc9cbffab8bcfee33cb41e
refs/heads/main
2023-07-20T08:42:47.996534
2021-08-25T13:52:46
2021-08-25T13:52:46
399,807,484
0
0
null
2021-08-25T12:19:09
2021-08-25T12:19:09
null
UTF-8
Swift
false
false
389
swift
// // ViewController.swift // RSSchool_T10 // // Created by u.ochilov on 25.08.2021. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = .white let label = UILabel.init(frame: .init(x: 20, y: 100, width: 200, height: 50)) label.text = "Hi lamer" self.view.addSubview(label) } }
[ -1 ]
503265d85e620a0ef10d3bedef528af471f823a8
c7b509e955afb119957b38b56e55d9fa734a9c10
/Hat POS/ProductInventory/InventoryLookup.swift
e91c396ece85a8f427796d026eabcb3cff61db7e
[]
no_license
Space-96/HatPOS
1bc1fa197b965ed46d760d0c91d8e9c4bc9db750
9ef27b5a13368e553475b126a439fb40485466d4
refs/heads/main
2023-04-11T16:20:44.414937
2021-05-11T04:20:09
2021-05-11T04:20:09
346,759,753
2
0
null
2021-05-10T14:26:17
2021-03-11T16:06:33
Swift
UTF-8
Swift
false
false
2,577
swift
// // InventoryLookup.swift // Hat POS // // Created by Brendan on 5/6/21. // import UIKit protocol InventoryLookupDelegate { func inventoryItemsDownloaded(inventoryLookupItems: [Inventory]) } class InventoryLookup: NSObject { var delegate:InventoryLookupDelegate? static let sharedInstance = InventoryLookup() var lookupText: String = "" func getItems() { // Hit web service url let serviceUrl = "http://student07web.mssu.edu/serviceForInventoryLookup.php?productDescription="+lookupText print(lookupText) // Download the json data let url = URL(string: serviceUrl) if let url = url { // Create URL session let session = URLSession(configuration: .default) let task = session.dataTask(with: url, completionHandler: { (data, response, error) in if error == nil { // Succeeded // Call the parse Json function on the data self.parseJson(data!) } else{ print(error!) return // Error } }) // Start task task.resume() } } //notify the view controller and pass the data back func parseJson(_ data:Data){ var invArray = [Inventory]() do { //Parse the data into location structs let jsonArray = try JSONSerialization.jsonObject(with: data, options: []) as! [Any] if jsonArray.isEmpty { print("Empty JsonArray") } // Loop through each result in the json array for jsonResult in jsonArray { // Cast json result as a dictionary let jsonDict = jsonResult as! [String:String] // Create new Inventory and set its properties let inv = Inventory(productID: jsonDict["productID"]!, productName: jsonDict["productName"]!, productDescription: jsonDict["productDescription"]!, unitPurchasePrice: jsonDict["unitPurchasePrice"]!, unitSalePrice: jsonDict["unitSalePrice"]!, quantity: jsonDict["quantity"]!, isActive: jsonDict["isActive"]!) invArray.append(inv) } delegate?.inventoryItemsDownloaded(inventoryLookupItems: invArray) } catch{ print("There was an error I guess") } } }
[ -1 ]
327457dcbaa5b1266154cc782eaed269253107e2
bf2083e4fad80242138b44b40607703d6aae2b16
/Final-Questor-App/VideoMessageTableViewCell.swift
ab037f6e6b89370ec27ef34e037c83ad64b14899
[]
no_license
aikhan/tinder-video-clone-ios
5781998fb569d69904f7870cca782f567d2c08ce
2ec44ef43e4bfb1e6fc8980bd97f12749742a049
refs/heads/master
2020-08-02T07:21:03.342988
2018-11-13T17:13:21
2018-11-13T17:13:21
211,274,232
0
0
null
null
null
null
UTF-8
Swift
false
false
778
swift
// // VideoMessageTableViewCell.swift // Final-Questor-App // // Created by Adrian Humphrey on 7/18/16. // Copyright © 2016 Adrian Humphrey. All rights reserved. // import UIKit class VideoMessageTableViewCell: UITableViewCell { //Image holding the status of the video @IBOutlet weak var statusImageView: UIImageView! //Time Stamp @IBOutlet weak var timeStampLabel: UILabel! //Status of the video label @IBOutlet weak var statusLabel: UILabel! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } }
[ 228230, 213094, 381943 ]
0828fa41650a9b8988e2677aaca3fc3ae5e65cbd
a41585b1ae49034385a9c4e290154d129f823e59
/CollectionView/CollectionView/ViewController.swift
01586cdba0ac09223faaa1b1f0e4cd7cbb4135d3
[]
no_license
jinsu3758/iOS_Project
0c0ef009d44b058c13c327c229f37903eb97a589
b0aab7b182cb7ef265e1efdff3602a0cd4f8e338
refs/heads/master
2021-06-14T04:52:45.690080
2021-03-31T14:50:47
2021-03-31T14:50:47
168,470,508
0
0
null
null
null
null
UTF-8
Swift
false
false
364
swift
// // ViewController.swift // CollectionView // // Created by 박진수 on 2018. 10. 23.. // Copyright © 2018년 박진수. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } }
[ 219715, 190120, 317673, 316810, 240520, 319888, 312273, 289234, 312051, 317972, 316949, 319990, 310742, 111292, 313341 ]
2416f943b26637e89be3a44aa82b73e67c4a07cd
f0d7a4ed84cc2064f3c9bd18bd01245101ddffd9
/testanimation/testanimation/AppDelegate.swift
1c456a8b3d6bdd358fe2cc9dd9992eb23f35c97f
[]
no_license
bbniedert/TwentyOne2020
1c863ae438e685d706bee9f6b86ee63b77051b53
d3c380e09ace89905b79b2418e299036b551faaf
refs/heads/main
2023-02-02T03:16:44.127831
2020-12-19T20:11:57
2020-12-19T20:11:57
312,611,202
1
2
null
2020-12-19T20:11:58
2020-11-13T15:21:12
Swift
UTF-8
Swift
false
false
1,356
swift
// // AppDelegate.swift // testanimation // // Created by Brandon Niedert on 11/19/20. // import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 213048, 385081, 376889, 393275, 376905, 327756, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 286831, 368752, 286844, 417924, 262283, 286879, 286888, 377012, 327871, 180416, 377036, 180431, 377046, 418010, 377060, 327914, 205036, 393456, 393460, 418043, 336123, 385280, 336128, 262404, 180490, 164106, 368911, 262416, 262422, 377117, 262436, 336180, 262454, 393538, 262472, 344403, 213332, 65880, 262496, 418144, 262499, 213352, 246123, 262507, 262510, 213372, 385419, 393612, 262550, 262552, 385440, 385443, 385451, 262573, 393647, 385458, 262586, 344511, 262592, 360916, 369118, 328177, 328179, 328182, 328189, 328192, 164361, 410128, 393747, 254490, 188958, 385570, 33316, 377383, 197159, 352821, 197177, 418363, 188987, 369223, 385609, 385616, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 148105, 377484, 352918, 98968, 344744, 361129, 336555, 385713, 434867, 164534, 336567, 164538, 328378, 328386, 352968, 344776, 352971, 418507, 352973, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 336643, 344835, 344841, 361230, 336659, 418580, 418585, 434970, 369435, 418589, 262942, 418593, 336675, 328484, 418598, 418605, 336696, 361273, 328515, 336708, 328519, 361288, 336711, 328522, 426841, 254812, 361309, 197468, 361315, 361322, 328573, 377729, 369542, 361360, 222128, 345035, 386003, 345043, 386011, 386018, 386022, 435187, 328714, 361489, 386069, 386073, 336921, 336925, 345118, 377887, 345133, 345138, 386101, 361536, 197707, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 361598, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 345267, 386258, 328924, 66782, 222437, 386285, 328941, 386291, 345376, 353570, 345379, 410917, 345382, 345399, 378169, 369978, 337222, 337229, 337234, 263508, 402791, 345448, 271730, 378227, 271745, 181638, 353673, 181643, 181654, 230809, 181670, 181673, 181678, 181681, 337329, 181684, 181690, 361917, 181696, 337349, 181703, 337365, 271839, 329191, 361960, 116210, 337398, 337415, 329226, 419339, 419343, 419349, 419355, 370205, 419359, 394786, 419362, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 419410, 394853, 345701, 222830, 370297, 403070, 353919, 403075, 345736, 198280, 403091, 345749, 419483, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 419512, 337592, 419517, 337599, 419527, 419530, 419535, 272081, 419542, 394966, 419544, 181977, 345818, 419547, 419550, 419559, 337642, 419563, 337645, 370415, 337659, 141051, 337668, 362247, 395021, 362255, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 345930, 370509, 354130, 247637, 337750, 370519, 313180, 354142, 354150, 354156, 345964, 345967, 345970, 345974, 403320, 354172, 247691, 337808, 247700, 329623, 436126, 436132, 337833, 362413, 337844, 346057, 247759, 346063, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329832, 329855, 329867, 329885, 411805, 346272, 362660, 100524, 387249, 379066, 387260, 256191, 395466, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 346343, 338152, 387306, 387312, 346355, 436473, 321786, 379134, 411903, 411916, 379152, 395538, 387349, 338199, 387352, 182558, 338211, 395566, 248111, 362822, 436555, 190796, 379233, 354673, 248186, 420236, 379278, 272786, 354727, 338352, 330189, 338381, 338386, 256472, 338403, 338409, 248308, 199164, 330252, 199186, 420376, 330267, 354855, 10828, 199249, 346721, 174695, 248425, 191084, 338543, 191092, 346742, 330383, 354974, 150183, 174774, 248504, 174777, 223934, 355024, 273108, 355028, 264918, 183005, 256734, 436962, 338660, 338664, 264941, 363251, 207619, 264964, 338700, 256786, 199452, 363293, 396066, 346916, 396069, 215853, 355122, 355131, 355140, 355143, 338763, 355150, 330580, 355166, 265055, 265058, 355175, 387944, 355179, 330610, 330642, 355218, 412599, 207808, 379848, 396245, 330710, 248792, 248798, 347105, 257008, 183282, 265207, 330748, 265214, 330760, 330768, 248862, 396328, 158761, 347176, 199728, 396336, 330800, 396339, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 412764, 339036, 257120, 265320, 248951, 420984, 330889, 347287, 339097, 248985, 44197, 380070, 339112, 249014, 126144, 330958, 330965, 265432, 265436, 388319, 388347, 175375, 159005, 175396, 208166, 273708, 347437, 372015, 347441, 372018, 199988, 44342, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 175450, 437595, 175457, 208227, 175460, 175463, 265580, 437620, 175477, 249208, 175483, 175486, 249214, 175489, 249218, 249224, 249227, 249234, 175513, 175516, 396705, 175522, 355748, 380332, 396722, 208311, 388542, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 339420, 249308, 339424, 249312, 339428, 339434, 249328, 69113, 372228, 208398, 380432, 175635, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 224897, 372353, 216707, 126596, 421508, 224904, 224909, 11918, 159374, 224913, 126610, 339601, 224916, 224919, 126616, 224922, 208538, 224926, 224929, 224932, 224936, 257704, 224942, 257712, 224947, 257716, 257720, 224953, 257724, 224959, 257732, 224965, 224969, 339662, 224975, 257747, 224981, 224986, 257761, 224993, 257764, 224999, 339695, 225012, 257787, 225020, 339710, 257790, 225025, 257794, 257801, 339721, 257804, 225038, 257807, 225043, 372499, 167700, 225048, 257819, 225053, 184094, 225058, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 225079, 397112, 225082, 397115, 225087, 225092, 225096, 257868, 225103, 257871, 397139, 225108, 225112, 257883, 257886, 225119, 257890, 339814, 225127, 274280, 257896, 257901, 225137, 339826, 257908, 225141, 257912, 225148, 257916, 257920, 225155, 339844, 225165, 397200, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 372738, 405533, 430129, 266294, 266297, 421960, 356439, 421990, 266350, 356466, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 225444, 438436, 225447, 438440, 225450, 258222, 225455, 430256, 225458, 225461, 225466, 389307, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 266453, 225493, 225496, 225499, 225502, 225505, 356578, 225510, 217318, 225514, 225518, 372976, 381176, 397571, 389380, 61722, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 225597, 332097, 201028, 348488, 332106, 332117, 348502, 250199, 250202, 332125, 250210, 348522, 348525, 348527, 332152, 389502, 250238, 332161, 356740, 332172, 373145, 340379, 389550, 324030, 266687, 160234, 127471, 340472, 324094, 266754, 324099, 324102, 324111, 340500, 324117, 324131, 332324, 381481, 356907, 324139, 324142, 356916, 324149, 324155, 348733, 324164, 356934, 348743, 381512, 324170, 324173, 324176, 389723, 332380, 373343, 381545, 340627, 184982, 373398, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 373449, 332493, 357069, 357073, 332511, 332520, 340718, 332533, 348924, 389892, 373510, 389926, 348978, 152370, 340789, 348982, 398139, 127814, 357201, 357206, 389978, 430939, 357211, 357214, 201579, 201582, 349040, 340849, 430965, 381813, 324472, 398201, 340858, 324475, 430972, 340861, 324478, 119674, 324481, 373634, 398211, 324484, 324487, 381833, 324492, 324495, 324498, 430995, 324501, 324510, 422816, 324513, 398245, 201637, 324524, 340909, 324533, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 209895, 201711, 349172, 381946, 349180, 439294, 431106, 209943, 357410, 250914, 185380, 357418, 209965, 209971, 209975, 209979, 209987, 209990, 209995, 341071, 349267, 250967, 210010, 341091, 210025, 210030, 210036, 210039, 349308, 210044, 349311, 160895, 152703, 210052, 349319, 210055, 218247, 210067, 210077, 210080, 251044, 210084, 185511, 210095, 210098, 210107, 210115, 332997, 210127, 333009, 210131, 333014, 210138, 210143, 218354, 218360, 251128, 275706, 275712, 275715, 275721, 349459, 333078, 251160, 349484, 349491, 251189, 415033, 357708, 210260, 365911, 259421, 365921, 333154, 251235, 374117, 333162, 234866, 390516, 333175, 357755, 251271, 136590, 374160, 112020, 349590, 357792, 259515, 415166, 415185, 366034, 366038, 415191, 415193, 415196, 415199, 423392, 333284, 415207, 366056, 366061, 415216, 210420, 415224, 423423, 415257, 415263, 366117, 415270, 144939, 415278, 415281, 415285, 210487, 415290, 415293, 349761, 415300, 333386, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 267909, 153227, 333498, 210631, 333511, 259788, 358099, 153302, 333534, 366307, 366311, 431851, 366318, 210672, 366321, 366325, 210695, 268041, 210698, 366348, 210706, 399128, 333594, 210719, 358191, 366387, 210739, 399159, 358200, 325440, 366401, 341829, 325446, 46920, 341834, 341838, 341843, 415573, 358234, 341851, 350045, 399199, 259938, 399206, 268143, 358255, 399215, 358259, 341876, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 358371, 350189, 350193, 350202, 333818, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350240, 350244, 350248, 178218, 350251, 350256, 350259, 350271, 243781, 350285, 374864, 342111, 342133, 374902, 432271, 333997, 334011, 260289, 260298, 350410, 350416, 350422, 211160, 350425, 268507, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 325891, 350467, 350475, 375053, 268559, 350480, 432405, 350486, 325914, 350490, 325917, 350493, 350498, 194852, 350504, 358700, 391468, 350509, 358704, 358713, 358716, 383306, 334161, 383321, 383330, 383333, 391530, 383341, 334203, 268668, 194941, 391563, 366990, 416157, 342430, 268701, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 195039, 334304, 334311, 375277, 334321, 350723, 391690, 186897, 342545, 334358, 342550, 342554, 334363, 358941, 350761, 252461, 334384, 383536, 358961, 334394, 252482, 219718, 334407, 334420, 350822, 375400, 334465, 334468, 162445, 326290, 342679, 342683, 260766, 342710, 244409, 260797, 260801, 350917, 154317, 391894, 154328, 416473, 64230, 113388, 342766, 375535, 203506, 342776, 391937, 391948, 375568, 326416, 375571, 375574, 162591, 326441, 326451, 326454, 326460, 260924, 375612, 244540, 326467, 244551, 326473, 326477, 326485, 416597, 326490, 342874, 326502, 375656, 433000, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 342915, 400259, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 326598, 359366, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 384107, 367723, 187502, 343154, 384114, 212094, 351364, 384135, 384139, 384143, 351381, 384160, 384168, 367794, 384181, 367800, 384191, 351423, 384198, 326855, 244937, 253130, 343244, 146642, 359649, 343270, 351466, 351479, 384249, 343306, 261389, 359694, 253200, 261393, 384275, 245020, 245029, 171302, 351534, 376110, 245040, 384314, 425276, 384323, 212291, 343365, 212303, 367965, 343393, 343398, 367980, 425328, 343409, 253303, 154999, 343417, 327034, 245127, 384397, 245136, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327110, 327115, 327117, 359886, 359890, 343507, 368092, 343534, 343539, 368119, 343544, 368122, 409091, 359947, 359955, 359983, 343630, 179802, 155239, 327275, 245357, 138864, 155254, 155273, 368288, 245409, 425638, 425649, 155322, 425662, 155327, 155351, 155354, 212699, 155363, 245475, 155371, 245483, 409335, 155393, 155403, 155422, 360223, 155438, 155442, 155447, 417595, 155461, 360261, 376663, 155482, 261981, 425822, 155487, 376671, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 262005, 147317, 425845, 262008, 262011, 155516, 155521, 155525, 360326, 376714, 155531, 262027, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 393169, 384977, 155611, 155619, 253923, 155621, 253926, 327654, 204784, 393203, 360438, 253943, 393206, 393212, 155646 ]