blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
625
content_id
stringlengths
40
40
detected_licenses
listlengths
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
listlengths
1
9.02k
b58a100ce4b11a2b85fffc66ab20694d0a804723
1147708dea1d53e41ecb7d16441a090c94116381
/internals/SqliteManager.swift
121bf583ca4ada9b497d80b753dc5cae7a1e1b55
[]
no_license
cinlk/JobHunterIOS
b8ecb27bf2263276aebb1f7c700aeca2b92e6620
4d03f453ed23eca32e744006c58303bb67860346
refs/heads/master
2022-02-12T00:32:53.709967
2019-05-29T02:10:20
2019-05-29T02:10:20
165,507,781
0
0
null
null
null
null
UTF-8
Swift
false
false
6,407
swift
// // SqliteManager.swift // internals // // Created by ke.liang on 2018/3/16. // Copyright © 2018年 lk. All rights reserved. // import Foundation import SQLite fileprivate let dbName = GlobalConfig.DBName fileprivate let startDate = Date(timeIntervalSince1970: 0) // singleton model class SqliteManager{ static let shared:SqliteManager = SqliteManager() var db:Connection? private init() { do{ try initialDBFile() }catch{ // 创建数据库失败 exit(1) } } // create sqliteDB file in sandbox private func initialDBFile() throws{ //SingletoneClass.fileManager.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true) let url = try SingletoneClass.fileManager.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true) let dbPath = url.appendingPathComponent(dbName) print("dataBase--->\(String.init(describing: dbPath)) \(String.init(describing: dbPath))") let exist = SingletoneClass.fileManager.fileExists(atPath: dbPath.path) if !exist{ SingletoneClass.fileManager.createFile(atPath: dbPath.path, contents: nil, attributes: nil) } try initialTables(dbPath: dbPath.path) } // create tables in sqliteDB private func initialTables(dbPath:String) throws{ do{ db = try Connection(dbPath) // 设置timeout db?.busyTimeout = 30 db?.busyHandler({ (tries) -> Bool in if tries >= 3{ return false } return true }) //try db?.execute("PRAGMA foreign_keys = ON;") // 跟踪 sql 语句 db?.trace{ print($0)} // 开启外键约束 (sqlite 默认没开启) try db?.execute("PRAGMA foreign_keys = ON;") //try db?.execute("PRAGMA foreign_keys;") try createSearchTable() try createMessageTable() try createConversationTable() addNewColumn() } catch { throw error } } } // 搜索历史 表 extension SqliteManager{ private func createSearchTable() throws{ do{ try db?.run(SearchHistory.search.create(temporary: false, ifNotExists: true, withoutRowid: false, block: { (t) in t.column(SearchHistory.id, primaryKey: PrimaryKey.autoincrement) t.column(SearchHistory.type) t.column(SearchHistory.name, unique: true) // 不是空字符串 //t.check(SearchHistory.name.trim().length > 0) t.column(SearchHistory.ctime, defaultValue: startDate) })) }catch{ throw error } } } // IM message 表 extension SqliteManager{ private func addNewColumn(){ do{ try db?.run(MessageTable.message.addColumn(MessageTable.sended, defaultValue: false)) }catch{ print(error) } } private func createMessageTable() throws{ do{ try db?.run(MessageTable.message.create(temporary: false, ifNotExists: true, withoutRowid: false, block: { (t) in t.column(MessageTable.id, primaryKey: PrimaryKey.autoincrement) t.column(MessageTable.conversationId) // t.co t.column(MessageTable.type) t.column(MessageTable.content) t.column(MessageTable.senderID) t.column(MessageTable.receiverID) t.column(MessageTable.isRead) t.column(MessageTable.create_time) t.column(MessageTable.sended, defaultValue: false) // 外键关联 t.foreignKey(MessageTable.conversationId, references: SingleConversationTable.conversation, SingleConversationTable.conversationId, update: TableBuilder.Dependency.setNull, delete: TableBuilder.Dependency.setNull) })) // conversationId 作为索引 //try db?.run(MessageTable.message.dropIndex(MessageTable.conversationId, ifExists: true)) try db?.run(MessageTable.message.createIndex(MessageTable.conversationId, unique: false, ifNotExists: true)) // 外键 TODO //try db?.run(MessageTable.message.for) // 创建外键索引 // try db?.run(MessageTable.message.createIndex(MessageTable.senderID, unique: false, ifNotExists: true)) // try db?.run(MessageTable.message.createIndex(MessageTable.receiverID, unique: false, ifNotExists: true)) }catch{ throw error } } } // 会话表 extension SqliteManager{ private func createConversationTable() throws{ do{ try db?.run(SingleConversationTable.conversation.create(temporary: false, ifNotExists: true, withoutRowid: false, block: { (t) in t.column(SingleConversationTable.conversationId, primaryKey: true) t.column(SingleConversationTable.createdTime, defaultValue: Date.init()) t.column(SingleConversationTable.jobId) t.column(SingleConversationTable.myid) t.column(SingleConversationTable.recruiterId) t.column(SingleConversationTable.recruiterName, defaultValue: "") t.column(SingleConversationTable.recruiterIconURL, defaultValue: "") t.column(SingleConversationTable.isUP, defaultValue: false) t.column(SingleConversationTable.upTime, defaultValue: Date.init(timeIntervalSince1970: 0)) t.column(SingleConversationTable.unreadCount, defaultValue: 0) })) // userID索引 try db?.run(SingleConversationTable.conversation.createIndex(SingleConversationTable.conversationId, unique: true, ifNotExists: true)) }catch{ throw error } } }
[ -1 ]
e62ade831ada575df7981fd658d427ea0b9f2139
821dfc83fada552b3c6c65aa04769eb6e0329399
/Riseup-Workshop/Riseup-WorkshopTests/Riseup_WorkshopTests.swift
1bf5a5330788106d6e9c9cdff6bd9e97d4c8dd9c
[]
no_license
BrightCreations/iBeaconPosotion-iOS
40762b2fcbe39130dfeb6c11cb723d7aa7f76a36
4ec555e96b4989666b13ea416e8b6d716aa6b1c8
refs/heads/master
2016-09-01T05:06:36.229805
2015-12-10T17:01:59
2015-12-10T17:01:59
47,492,698
0
0
null
null
null
null
UTF-8
Swift
false
false
1,001
swift
// // Riseup_WorkshopTests.swift // Riseup-WorkshopTests // // Created by Ehab Amer on 12/6/15. // Copyright © 2015 EhabAmer. All rights reserved. // import XCTest @testable import Riseup_Workshop class Riseup_WorkshopTests: 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. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock { // Put the code you want to measure the time of here. } } }
[ 313357, 305179, 98333, 278558, 307231, 313375, 102437, 292902, 354345, 227370, 360491, 282672, 276534, 180280, 159807, 288834, 286788, 280649, 311372, 223316, 315476, 223318, 307289, 288857, 227417, 237663, 194656, 309345, 227428, 276582, 276589, 278638, 227439, 131189, 223350, 131191, 131198, 292992, 141450, 215178, 311435, 311438, 276627, 276632, 284826, 196773, 299174, 153776, 129203, 299187, 131256, 184505, 227513, 295098, 280762, 223419, 299198, 309444, 276682, 301279, 311519, 280802, 286958, 233715, 157944, 211193, 227578, 184570, 168188, 184575, 309529, 278810, 282909, 299293, 237857, 282913, 233762, 282919, 262450, 280887, 315706, 287041, 287043, 139589, 227654, 311621, 280902, 227658, 276813, 6481, 6482, 168281, 6489, 323935, 276835, 321894, 416104, 280939, 276847, 285040, 199029, 291192, 280961, 227725, 240016, 178578, 190871, 293274, 61857, 285090, 61859, 289189, 278961, 278965, 293303, 276920, 278970, 293306, 33211, 276925, 278978, 291267, 278989, 281037, 278993, 285150, 287198, 279008, 227809, 358882, 279013, 227813, 279022, 291311, 309744, 281072, 279029, 233978, 279039, 291333, 276998, 287241, 279050, 186893, 303631, 283153, 303636, 223767, 223769, 291358, 180771, 293419, 244269, 283184, 234036, 289332, 277048, 115270, 293448, 377418, 281166, 295519, 66150, 277094, 277101, 295536, 287346, 277111, 287352, 279164, 291454, 189057, 184962, 303746, 152203, 277133, 133774, 117397, 230040, 289434, 221852, 279206, 285353, 295599, 205487, 303793, 285361, 299699, 293556, 342706, 166582, 289462, 287417, 285371, 285372, 285373, 285374, 287422, 303803, 66242, 199366, 287433, 225995, 225997, 226004, 203477, 279252, 226007, 289502, 226019, 285415, 234217, 342762, 277227, 230125, 289518, 230134, 228088, 234234, 279294, 205568, 242433, 299776, 234241, 285444, 209670, 322313, 226058, 234250, 234253, 166676, 234263, 234268, 281377, 234277, 262951, 279336, 289576, 234283, 312108, 234286, 285487, 295729, 262962, 234289, 234294, 230199, 293693, 162621, 234301, 289598, 281408, 295746, 162626, 277316, 234311, 234312, 299849, 234317, 277325, 293711, 234323, 234326, 281433, 230234, 234331, 301918, 279392, 349026, 303972, 234340, 234343, 234346, 234355, 295798, 277366, 234360, 279417, 209785, 177019, 234361, 277370, 234366, 234367, 291712, 158593, 234372, 226181, 113542, 213894, 226184, 277381, 228234, 308107, 56208, 308112, 295824, 234386, 234387, 234392, 324507, 234400, 279456, 234404, 283558, 310182, 289703, 234409, 275371, 236461, 234419, 234425, 234427, 287677, 234430, 289727, 234436, 234438, 213960, 279498, 52172, 234444, 234445, 183248, 234451, 234454, 234457, 234463, 234466, 277479, 234472, 234473, 326635, 203757, 304110, 234477, 234482, 287731, 277492, 314355, 295927, 312314, 234498, 234500, 277509, 277510, 230410, 234506, 277523, 277524, 293910, 230423, 197657, 281626, 281625, 175132, 234531, 300068, 234534, 310317, 234542, 238639, 234548, 238651, 234555, 277563, 230463, 234560, 207938, 234565, 234569, 300111, 234577, 296019, 234583, 234584, 277597, 230499, 281700, 300135, 322663, 207979, 275565, 156785, 312434, 275571, 300151, 234616, 398457, 285820, 234622, 300158, 285828, 279685, 285830, 302213, 253063, 234632, 275591, 228491, 234642, 308372, 296086, 238743, 187544, 119963, 296092, 234656, 330913, 306338, 234659, 234663, 275625, 300202, 300201, 279728, 238769, 226481, 294074, 208058, 277690, 230588, 228542, 283840, 302274, 279747, 283847, 283852, 279760, 290000, 189652, 363744, 310497, 195811, 298212, 304356, 290022, 234733, 298221, 279792, 298228, 204022, 234742, 228600, 208124, 292107, 277792, 130338, 339234, 199971, 304421, 130343, 277800, 113966, 226608, 298291, 300343, 226624, 286018, 113987, 15686, 226632, 230729, 294218, 177484, 222541, 296270, 296273, 314709, 357719, 283991, 218462, 224606, 142689, 230756, 281957, 163175, 281962, 230765, 306542, 296303, 284014, 181625, 306559, 148867, 294275, 298374, 281992, 142729, 296335, 230799, 112017, 306579, 318875, 310692, 282022, 279974, 282024, 310701, 279989, 296375, 296387, 292292, 415171, 163269, 306631, 296392, 300489, 296391, 300487, 310732, 280013, 312782, 222675, 284116, 228827, 226781, 280032, 310757, 316902, 280041, 296425, 296433, 306677, 280055, 300536, 290300, 290301, 300542, 296448, 230913, 306692, 306693, 192010, 296461, 149007, 65041, 282136, 204313, 282141, 278060, 286254, 288309, 290358, 194110, 280130, 288326, 282183, 288327, 276040, 366154, 276045, 286288, 280147, 290390, 128599, 235095, 300630, 306776, 147036, 243292, 300644, 282213, 317032, 222832, 276085, 314998, 188031, 294529, 192131, 288392, 229001, 290443, 310923, 323217, 282259, 276120, 276126, 282271, 282273, 302754, 282276, 229029, 282280, 278191, 198324, 286388, 296628, 286391, 306874, 280251, 282303, 286399, 276173, 302797, 212688, 302802, 282327, 286423, 278233, 278234, 216795, 67292, 294622, 278240, 276195, 153319, 313065, 288491, 280300, 239341, 284401, 419569, 276210, 323316, 229113, 313081, 286459, 276219, 194303, 288512, 311042, 288516, 216839, 282378, 276238, 321295, 294678, 284442, 278299, 276253, 284459, 159533, 282417, 200498, 296755, 276282, 276283, 345919, 276287, 282438, 276294, 276298, 216918, 307031, 280410, 300894, 237408, 296806, 282474, 288619, 288620, 280430, 313203, 300918, 276344, 194429, 67463, 110480, 40853, 282518, 282519, 44952, 298909, 311199, 247712, 294823, 298920, 292782, 276408, 290746, 294843, 280514, 276421, 344013, 276430, 231375, 301008, 153554, 276444, 280541, 294886, 276454, 276459, 296941, 311282, 292858 ]
7dd7dfd37118724840ac94e16f223d6c5df7a50f
b1333237eb41057b7c430342a71d0dd337c547c3
/test/Distributed/Inputs/BadDistributedActorSystems.swift
d40693b3838be43261a9d55ce4b67f98139427e4
[ "Apache-2.0", "Swift-exception" ]
permissive
saagarjha/swift
edc7ab55d96c52e0ce6ab7b3b3b63dccc557bb98
bb499b2dcf4e4361e22bf4fbd32429e6e71e1f51
refs/heads/master
2022-03-26T04:59:26.591126
2022-02-19T08:59:47
2022-02-19T08:59:47
47,385,543
1
0
null
2015-12-04T06:20:22
2015-12-04T06:20:22
null
UTF-8
Swift
false
false
11,558
swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift open source project // // Copyright (c) 2021 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information // See CONTRIBUTORS.txt for the list of Swift project authors // // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// import _Distributed // ==== Fake Address ----------------------------------------------------------- public struct ActorAddress: Hashable, Sendable, Codable { public let address: String public init(parse address: String) { self.address = address } public init(from decoder: Decoder) throws { let container = try decoder.singleValueContainer() self.address = try container.decode(String.self) } public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() try container.encode(self.address) } } // ==== Fake Systems ----------------------------------------------------------- public struct MissingRemoteCallVoidActorSystem: DistributedActorSystem { public typealias ActorID = ActorAddress public typealias InvocationDecoder = FakeInvocationDecoder public typealias InvocationEncoder = FakeInvocationEncoder public typealias SerializationRequirement = Codable // just so that the struct does not become "trivial" let someValue: String = "" let someValue2: String = "" let someValue3: String = "" let someValue4: String = "" init() { print("Initialized new FakeActorSystem") } public func resolve<Act>(id: ActorID, as actorType: Act.Type) throws -> Act? where Act: DistributedActor, Act.ID == ActorID { nil } public func assignID<Act>(_ actorType: Act.Type) -> ActorID where Act: DistributedActor, Act.ID == ActorID { ActorAddress(parse: "xxx") } public func actorReady<Act>(_ actor: Act) where Act: DistributedActor, Act.ID == ActorID { } public func resignID(_ id: ActorID) { } public func makeInvocationEncoder() -> InvocationEncoder { .init() } public func remoteCall<Act, Err, Res>( on actor: Act, target: RemoteCallTarget, invocation invocationEncoder: inout InvocationEncoder, throwing: Err.Type, returning: Res.Type ) async throws -> Res where Act: DistributedActor, Act.ID == ActorID, Err: Error, Res: SerializationRequirement { throw ExecuteDistributedTargetError(message: "Not implemented.") } // func remoteCallVoid<Act, Err>( // on actor: Act, // target: RemoteCallTarget, // invocation invocationEncoder: inout InvocationEncoder, // throwing: Err.Type // ) async throws // where Act: DistributedActor, // Act.ID == ActorID, // Err: Error { // throw ExecuteDistributedTargetError(message: "Not implemented.") // } } // ==== Fake Roundtrip Transport ----------------------------------------------- // TODO(distributed): not thread safe... public final class FakeRoundtripActorSystem: DistributedActorSystem, @unchecked Sendable { public typealias ActorID = ActorAddress public typealias InvocationEncoder = FakeInvocationEncoder public typealias InvocationDecoder = FakeInvocationDecoder public typealias SerializationRequirement = Codable var activeActors: [ActorID: any DistributedActor] = [:] public init() {} public func resolve<Act>(id: ActorID, as actorType: Act.Type) throws -> Act? where Act: DistributedActor { print("| resolve \(id) as remote // this system always resolves as remote") return nil } public func assignID<Act>(_ actorType: Act.Type) -> ActorID where Act: DistributedActor { let id = ActorAddress(parse: "<unique-id>") print("| assign id: \(id) for \(actorType)") return id } public func actorReady<Act>(_ actor: Act) where Act: DistributedActor, Act.ID == ActorID { print("| actor ready: \(actor)") self.activeActors[actor.id] = actor } public func resignID(_ id: ActorID) { print("X resign id: \(id)") } public func makeInvocationEncoder() -> InvocationEncoder { .init() } private var remoteCallResult: Any? = nil private var remoteCallError: Error? = nil public func remoteCall<Act, Err, Res>( on actor: Act, target: RemoteCallTarget, invocation: inout InvocationEncoder, throwing errorType: Err.Type, returning returnType: Res.Type ) async throws -> Res where Act: DistributedActor, Act.ID == ActorID, Err: Error, Res: SerializationRequirement { print(" >> remoteCall: on:\(actor), target:\(target), invocation:\(invocation), throwing:\(String(reflecting: errorType)), returning:\(String(reflecting: returnType))") guard let targetActor = activeActors[actor.id] else { fatalError("Attempted to call mock 'roundtrip' on: \(actor.id) without active actor") } func doIt<A: DistributedActor>(active: A) async throws -> Res { guard (actor.id) == active.id as! ActorID else { fatalError("Attempted to call mock 'roundtrip' on unknown actor: \(actor.id), known: \(active.id)") } let resultHandler = FakeRoundtripResultHandler { value in self.remoteCallResult = value self.remoteCallError = nil } onError: { error in self.remoteCallResult = nil self.remoteCallError = error } try await executeDistributedTarget( on: active, mangledTargetName: target.mangledName, invocationDecoder: invocation.makeDecoder(), handler: resultHandler ) switch (remoteCallResult, remoteCallError) { case (.some(let value), nil): print(" << remoteCall return: \(value)") return remoteCallResult! as! Res case (nil, .some(let error)): print(" << remoteCall throw: \(error)") throw error default: fatalError("No reply!") } } return try await _openExistential(targetActor, do: doIt) } public func remoteCallVoid<Act, Err>( on actor: Act, target: RemoteCallTarget, invocation: inout InvocationEncoder, throwing errorType: Err.Type ) async throws where Act: DistributedActor, Act.ID == ActorID, Err: Error { print(" >> remoteCallVoid: on:\(actor), target:\(target), invocation:\(invocation), throwing:\(String(reflecting: errorType))") guard let targetActor = activeActors[actor.id] else { fatalError("Attempted to call mock 'roundtrip' on: \(actor.id) without active actor") } func doIt<A: DistributedActor>(active: A) async throws { guard (actor.id) == active.id as! ActorID else { fatalError("Attempted to call mock 'roundtrip' on unknown actor: \(actor.id), known: \(active.id)") } let resultHandler = FakeRoundtripResultHandler { value in self.remoteCallResult = value self.remoteCallError = nil } onError: { error in self.remoteCallResult = nil self.remoteCallError = error } try await executeDistributedTarget( on: active, mangledTargetName: target.mangledName, invocationDecoder: invocation.makeDecoder(), handler: resultHandler ) switch (remoteCallResult, remoteCallError) { case (.some, nil): return case (nil, .some(let error)): print(" << remoteCall throw: \(error)") throw error default: fatalError("No reply!") } } try await _openExistential(targetActor, do: doIt) } } public struct FakeInvocationEncoder : DistributedTargetInvocationEncoder { public typealias SerializationRequirement = Codable var genericSubs: [Any.Type] = [] var arguments: [Any] = [] var returnType: Any.Type? = nil var errorType: Any.Type? = nil public mutating func recordGenericSubstitution<T>(_ type: T.Type) throws { print(" > encode generic sub: \(String(reflecting: type))") genericSubs.append(type) } public mutating func recordArgument<Argument: SerializationRequirement>(_ argument: Argument) throws { print(" > encode argument: \(argument)") arguments.append(argument) } public mutating func recordErrorType<E: Error>(_ type: E.Type) throws { print(" > encode error type: \(String(reflecting: type))") self.errorType = type } public mutating func recordReturnType<R: SerializationRequirement>(_ type: R.Type) throws { print(" > encode return type: \(String(reflecting: type))") self.returnType = type } public mutating func doneRecording() throws { print(" > done recording") } public func makeDecoder() -> FakeInvocationDecoder { return .init( args: arguments, substitutions: genericSubs, returnType: returnType, errorType: errorType ) } } // === decoding -------------------------------------------------------------- public class FakeInvocationDecoder : DistributedTargetInvocationDecoder { public typealias SerializationRequirement = Codable var genericSubs: [Any.Type] = [] var arguments: [Any] = [] var returnType: Any.Type? = nil var errorType: Any.Type? = nil var argumentIndex: Int = 0 fileprivate init( args: [Any], substitutions: [Any.Type] = [], returnType: Any.Type? = nil, errorType: Any.Type? = nil ) { self.arguments = args self.genericSubs = substitutions self.returnType = returnType self.errorType = errorType } public func decodeGenericSubstitutions() throws -> [Any.Type] { print(" > decode generic subs: \(genericSubs)") return genericSubs } public func decodeNextArgument<Argument: SerializationRequirement>() throws -> Argument { guard argumentIndex < arguments.count else { fatalError("Attempted to decode more arguments than stored! Index: \(argumentIndex), args: \(arguments)") } let anyArgument = arguments[argumentIndex] guard let argument = anyArgument as? Argument else { fatalError("Cannot cast argument\(anyArgument) to expected \(Argument.self)") } print(" > decode argument: \(argument)") argumentIndex += 1 return argument } public func decodeErrorType() throws -> Any.Type? { print(" > decode return type: \(errorType.map { String(describing: $0) } ?? "nil")") return self.errorType } public func decodeReturnType() throws -> Any.Type? { print(" > decode return type: \(returnType.map { String(describing: $0) } ?? "nil")") return self.returnType } } @available(SwiftStdlib 5.5, *) public struct FakeRoundtripResultHandler: DistributedTargetInvocationResultHandler { public typealias SerializationRequirement = Codable let storeReturn: (any Any) -> Void let storeError: (any Error) -> Void init(_ storeReturn: @escaping (Any) -> Void, onError storeError: @escaping (Error) -> Void) { self.storeReturn = storeReturn self.storeError = storeError } // FIXME(distributed): can we return void here? public func onReturn<Res>(value: Res) async throws { print(" << onReturn: \(value)") storeReturn(value) } public func onThrow<Err: Error>(error: Err) async throws { print(" << onThrow: \(error)") storeError(error) } } // ==== Helpers ---------------------------------------------------------------- @_silgen_name("swift_distributed_actor_is_remote") func __isRemoteActor(_ actor: AnyObject) -> Bool
[ -1 ]
1666924fe99ccaf08b59e646d58f236bf42b44b3
c1f6f9db5a5acaaac40a51a5b3f50027179b66ff
/EasyBus/Library/Controller/BottomCardViewController.swift
2f3c6fecc68baa331e17f18368e02bf6b3609429
[ "MIT" ]
permissive
chengkeith/EasyBus-iOS
f054f0328086fffb7dc5493f1eefd73ee4b2f7cf
f23e82f1eb1eeeb0276cd1d5661b3aa4a792075a
refs/heads/master
2020-04-19T17:04:55.234798
2019-01-17T13:18:03
2019-01-17T13:18:03
null
0
0
null
null
null
null
UTF-8
Swift
false
false
6,072
swift
// // BottomCardViewController.swift // iOS Practice // // Created by KL on 6/9/2018. // Copyright © 2018 KL. All rights reserved. // import UIKit class BottomCardViewController: UIViewController, UIViewControllerTransitioningDelegate, UIViewControllerAnimatedTransitioning { var duration: TimeInterval = 0.3 let contentView: UIView = { let view = UIView() view.clipsToBounds = true view.layer.cornerRadius = 13 view.backgroundColor = .white return view }() private let dimView: UIView = { let view = UIView() view.backgroundColor = UIColor(white: 0, alpha: 0.4) return view }() private var contentViewStartConstraint: NSLayoutConstraint! private var contentViewEndConstraint: NSLayoutConstraint! private var contentViewEndViewBottomConstraint: NSLayoutConstraint! private var presenting = true override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) modalPresentationStyle = .overCurrentContext transitioningDelegate = self } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = UIColor.clear view.add(dimView) dimView.al_fillSuperview() dimView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(didTapDimView))) view.add(contentView) let views = ["contentView": contentView] NSLayoutConstraint.activate(NSLayoutConstraint.constraints(withVisualFormat: "|-8-[contentView]-8-|", options: [], metrics: nil, views: views)) if #available(iOS 11.0, *) { contentView.topAnchor.constraint(greaterThanOrEqualTo: view.safeAreaLayoutGuide.topAnchor).isActive = true contentViewEndConstraint = contentView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: 2) contentViewEndConstraint.priority = .defaultHigh contentViewEndViewBottomConstraint = contentView.bottomAnchor.constraint(lessThanOrEqualTo: view.bottomAnchor, constant: -8) contentViewEndViewBottomConstraint.priority = .required contentViewEndViewBottomConstraint.isActive = true } else { contentView.topAnchor.constraint(greaterThanOrEqualTo: topLayoutGuide.bottomAnchor).isActive = true contentViewEndConstraint = NSLayoutConstraint(item: contentView, attribute: .bottom, relatedBy: .equal, toItem: view, attribute: .bottom, multiplier: 1, constant: -8) } contentViewStartConstraint = NSLayoutConstraint(item: contentView, attribute: .top, relatedBy: .equal, toItem: view, attribute: .bottom, multiplier: 1, constant: 0) contentViewEndConstraint.isActive = true } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) presentingViewController?.view.tintAdjustmentMode = .dimmed } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) presentingViewController?.view.tintAdjustmentMode = .normal } override var preferredStatusBarStyle : UIStatusBarStyle { return presentingViewController?.preferredStatusBarStyle ?? .lightContent } // MARK: - UIViewControllerTransitioningDelegate func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { self.presenting = true return self } func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { presenting = false return self } // MARK: - UIViewControllerAnimatedTransitioning func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { return duration } func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { if presenting { let containerView = transitionContext.containerView let toView = transitionContext.view(forKey: UITransitionContextViewKey.to)! containerView.addSubview(toView) dimView.alpha = 0 contentViewEndConstraint.isActive = false contentViewEndViewBottomConstraint?.isActive = false contentViewStartConstraint.isActive = true view.layoutIfNeeded() let animator = UIViewPropertyAnimator(duration: duration, dampingRatio: 1, animations: { self.dimView.alpha = 1 self.contentViewStartConstraint.isActive = false self.contentViewEndConstraint.isActive = true self.contentViewEndViewBottomConstraint?.isActive = true self.view.layoutIfNeeded() }) animator.addCompletion({ (_) in transitionContext.completeTransition(true) }) animator.startAnimation() }else{ let animator = UIViewPropertyAnimator(duration: duration, dampingRatio: 1, animations: { self.dimView.alpha = 0 self.contentViewEndConstraint.isActive = false self.contentViewEndViewBottomConstraint?.isActive = false self.contentViewStartConstraint.isActive = true self.view.layoutIfNeeded() }) animator.addCompletion({ (_) in transitionContext.completeTransition(true) }) animator.startAnimation() } } // MARK: - @objc func didTapDimView() { dismiss(animated: true, completion: nil) } }
[ -1 ]
a3f6cf81dfb6e0ec79026a0edb4d73499b23d868
6106e438f85bca9535614be46580531ba8f3113c
/UTILITIES/LayoutableButton.swift
a9eb528e20650fba2bf0a8beeac37e7718a2f9ca
[]
no_license
sadariyavivek/musicworldcup
bc6cee69fc9773eea1f82392846e9d06dfb0a298
736c1fa54bb8cbb5369a86572d0d24466c3b8ea0
refs/heads/master
2022-05-29T03:14:41.587252
2020-01-21T05:42:03
2020-01-21T05:42:03
235,263,356
0
0
null
null
null
null
UTF-8
Swift
false
false
8,017
swift
// // CIRoundedImageView.swift // MusicAppWorld // // Created by Webcreaters on 11/11/19. // Copyright © 2019 webcreaters. All rights reserved. // @IBDesignable class LayoutableButton: UIButton { enum VerticalAlignment : String { case center, top, bottom, unset } enum HorizontalAlignment : String { case center, left, right, unset } @IBInspectable var imageToTitleSpacing: CGFloat = 8.0 { didSet { setNeedsLayout() } } var imageVerticalAlignment: VerticalAlignment = .unset { didSet { setNeedsLayout() } } var imageHorizontalAlignment: HorizontalAlignment = .unset { didSet { setNeedsLayout() } } @available(*, unavailable, message: "This property is reserved for Interface Builder. Use 'imageVerticalAlignment' instead.") @IBInspectable var imageVerticalAlignmentName: String { get { return imageVerticalAlignment.rawValue } set { if let value = VerticalAlignment(rawValue: newValue) { imageVerticalAlignment = value } else { imageVerticalAlignment = .unset } } } @available(*, unavailable, message: "This property is reserved for Interface Builder. Use 'imageHorizontalAlignment' instead.") @IBInspectable var imageHorizontalAlignmentName: String { get { return imageHorizontalAlignment.rawValue } set { if let value = HorizontalAlignment(rawValue: newValue) { imageHorizontalAlignment = value } else { imageHorizontalAlignment = .unset } } } var extraContentEdgeInsets:UIEdgeInsets = UIEdgeInsets.zero override var contentEdgeInsets: UIEdgeInsets { get { return super.contentEdgeInsets } set { super.contentEdgeInsets = newValue self.extraContentEdgeInsets = newValue } } var extraImageEdgeInsets:UIEdgeInsets = UIEdgeInsets.zero override var imageEdgeInsets: UIEdgeInsets { get { return super.imageEdgeInsets } set { super.imageEdgeInsets = newValue self.extraImageEdgeInsets = newValue } } var extraTitleEdgeInsets:UIEdgeInsets = UIEdgeInsets.zero override var titleEdgeInsets: UIEdgeInsets { get { return super.titleEdgeInsets } set { super.titleEdgeInsets = newValue self.extraTitleEdgeInsets = newValue } } //Needed to avoid IB crash during autolayout override init(frame: CGRect) { super.init(frame: frame) } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) self.imageEdgeInsets = super.imageEdgeInsets self.titleEdgeInsets = super.titleEdgeInsets self.contentEdgeInsets = super.contentEdgeInsets } override func layoutSubviews() { if let imageSize = self.imageView?.image?.size, let font = self.titleLabel?.font, let textSize = self.titleLabel?.attributedText?.size() ?? self.titleLabel?.text?.size(attributes: [NSFontAttributeName: font]) { var _imageEdgeInsets = UIEdgeInsets.zero var _titleEdgeInsets = UIEdgeInsets.zero var _contentEdgeInsets = UIEdgeInsets.zero let halfImageToTitleSpacing = imageToTitleSpacing / 2.0 switch imageVerticalAlignment { case .bottom: _imageEdgeInsets.top = (textSize.height + imageToTitleSpacing) / 2.0 _imageEdgeInsets.bottom = (-textSize.height - imageToTitleSpacing) / 2.0 _titleEdgeInsets.top = (-imageSize.height - imageToTitleSpacing) / 2.0 _titleEdgeInsets.bottom = (imageSize.height + imageToTitleSpacing) / 2.0 _contentEdgeInsets.top = (min (imageSize.height, textSize.height) + imageToTitleSpacing) / 2.0 _contentEdgeInsets.bottom = (min (imageSize.height, textSize.height) + imageToTitleSpacing) / 2.0 //only works with contentVerticalAlignment = .center contentVerticalAlignment = .center case .top: _imageEdgeInsets.top = (-textSize.height - imageToTitleSpacing) / 2.0 _imageEdgeInsets.bottom = (textSize.height + imageToTitleSpacing) / 2.0 _titleEdgeInsets.top = (imageSize.height + imageToTitleSpacing) / 2.0 _titleEdgeInsets.bottom = (-imageSize.height - imageToTitleSpacing) / 2.0 _contentEdgeInsets.top = (min (imageSize.height, textSize.height) + imageToTitleSpacing) / 2.0 _contentEdgeInsets.bottom = (min (imageSize.height, textSize.height) + imageToTitleSpacing) / 2.0 //only works with contentVerticalAlignment = .center contentVerticalAlignment = .center case .center: //only works with contentVerticalAlignment = .center contentVerticalAlignment = .center break case .unset: break } switch imageHorizontalAlignment { case .left: _imageEdgeInsets.left = -halfImageToTitleSpacing _imageEdgeInsets.right = halfImageToTitleSpacing _titleEdgeInsets.left = halfImageToTitleSpacing _titleEdgeInsets.right = -halfImageToTitleSpacing _contentEdgeInsets.left = halfImageToTitleSpacing _contentEdgeInsets.right = halfImageToTitleSpacing case .right: _imageEdgeInsets.left = textSize.width + halfImageToTitleSpacing _imageEdgeInsets.right = -textSize.width - halfImageToTitleSpacing _titleEdgeInsets.left = -imageSize.width - halfImageToTitleSpacing _titleEdgeInsets.right = imageSize.width + halfImageToTitleSpacing _contentEdgeInsets.left = halfImageToTitleSpacing _contentEdgeInsets.right = halfImageToTitleSpacing case .center: _imageEdgeInsets.left = textSize.width / 2.0 _imageEdgeInsets.right = -textSize.width / 2.0 _titleEdgeInsets.left = -imageSize.width / 2.0 _titleEdgeInsets.right = imageSize.width / 2.0 _contentEdgeInsets.left = -((imageSize.width + textSize.width) - max (imageSize.width, textSize.width)) / 2.0 _contentEdgeInsets.right = -((imageSize.width + textSize.width) - max (imageSize.width, textSize.width)) / 2.0 case .unset: break } _contentEdgeInsets.top += extraContentEdgeInsets.top _contentEdgeInsets.bottom += extraContentEdgeInsets.bottom _contentEdgeInsets.left += extraContentEdgeInsets.left _contentEdgeInsets.right += extraContentEdgeInsets.right _imageEdgeInsets.top += extraImageEdgeInsets.top _imageEdgeInsets.bottom += extraImageEdgeInsets.bottom _imageEdgeInsets.left += extraImageEdgeInsets.left _imageEdgeInsets.right += extraImageEdgeInsets.right _titleEdgeInsets.top += extraTitleEdgeInsets.top _titleEdgeInsets.bottom += extraTitleEdgeInsets.bottom _titleEdgeInsets.left += extraTitleEdgeInsets.left _titleEdgeInsets.right += extraTitleEdgeInsets.right super.imageEdgeInsets = _imageEdgeInsets super.titleEdgeInsets = _titleEdgeInsets super.contentEdgeInsets = _contentEdgeInsets } else { super.imageEdgeInsets = extraImageEdgeInsets super.titleEdgeInsets = extraTitleEdgeInsets super.contentEdgeInsets = extraContentEdgeInsets } super.layoutSubviews() } }
[ -1 ]
d978b7af1ea56de988e47764bd4406b6565abfe1
c7a4097b542806a74ccfcefdc05cee6949a9f47c
/SeChi/SeChi/Views/Controllers/Contact/HMContactVC.swift
8b81f92af309f6ffefb3f59785a2b2b023573ae5
[]
no_license
namnh92/SeChi
e0c2d7e8188da2f44e4a84c7d6d0563cee177efb
1af9b47a48e9c4a9a827527988d67d181a1b0a61
refs/heads/master
2022-07-30T03:17:49.478009
2020-05-19T16:22:23
2020-05-19T16:22:23
258,379,399
0
0
null
null
null
null
UTF-8
Swift
false
false
5,387
swift
// // HMContactVC.swift // SeChi // // Created by Nguyễn Nam on 4/25/20. // Copyright © 2020 Hypertech Mobile. All rights reserved. // import UIKit class HMContactVC: HMBaseVC { // MARK: - Outlets @IBOutlet weak var tableView: UITableView! @IBOutlet var tableHeaderView: UIView! // MARK: - Consants private let contactNames = ["Chồng Béo", "Chị Ti <3", "Người phụ nữ vĩ đại", "Bố ơi giúp con với"] // MARK: - Variables var isFromPush: Bool = false var taskId: Int = 0 private var collapseSection: [Int] = [] private var listContact: [HMContactModel] = [] { didSet { for contact in listContact { reminderList[contact.name] = getData(by: contact) } } } private var reminderList: [String:[TaskReminder]] = [:] { didSet { tableView.reloadData() } } // MARK: - Life cycles override func viewDidLoad() { super.viewDidLoad() for i in 0..<contactNames.count { HMRealmService.instance.write { (realm) in let contact = HMContactModel() contact.id = i contact.name = contactNames[i] realm.add(contact, update: .all) } } } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) getContact() } override func setupView() { super.setupView() setupTableView() } private func setupTableView() { tableView.set(delegateAndDataSource: self) tableView.tableHeaderView = tableHeaderView tableView.registerNibCellFor(type: HMContactHeaderCell.self) tableView.registerNibCellFor(type: HMContactContentCell.self) tableView.separatorStyle = .none view.backgroundColor = UIColor(hex: "F0F4F8") tableView.backgroundColor = .clear tableView.contentInset = UIEdgeInsets(top: 20, left: 0, bottom: 120, right: 0) } private func getContact() { listContact = HMRealmService.instance.load(listOf: HMContactModel.self).sorted(by: { $0.id < $1.id }) } private func getData(by contact: HMContactModel) -> [TaskReminder] { return HMRealmService.instance.load(listOf: TaskReminder.self).filter({ $0.supporter != nil && $0.supporter!.id == contact.id }) } } extension HMContactVC: UITableViewDataSource, UITableViewDelegate { func numberOfSections(in tableView: UITableView) -> Int { return reminderList.keys.count } func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { return 20.0 } func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 20.0)) view.backgroundColor = .clear return view } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { let numberOfRow = 1 if collapseSection.contains(section) { let key = Array(reminderList.keys)[section] return numberOfRow + (reminderList[key]?.count ?? 0) } else { return numberOfRow } } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 48.0 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { if indexPath.row == 0 { guard let cell = tableView.reusableCell(type: HMContactHeaderCell.self) else { return UITableViewCell() } cell.contactName = contactNames[indexPath.section] return cell } else { guard let cell = tableView.reusableCell(type: HMContactContentCell.self) else { return UITableViewCell() } let key = Array(reminderList.keys)[indexPath.section] if let reminderListByDate = reminderList[key] { cell.model = reminderListByDate[indexPath.row - 1] return cell } else { return UITableViewCell() } } } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if isFromPush { isFromPush = false if let task = HMRealmService.instance.load(listOf: TaskReminder.self).filter({ $0.id == taskId }).first { HMOneSignalNotificationService.shared.sendHelpPush(objTask: task.taskName) HMRealmService.instance.write { (realm) in let updatedTask = task updatedTask.supporter = listContact[indexPath.section] realm.add(updatedTask, update: .all) } return } } if indexPath.row == 0 { if collapseSection.contains(indexPath.section) { if let index = collapseSection.firstIndex(of: indexPath.section) { collapseSection.remove(at: index) tableView.reloadSectionAt(index: indexPath.section) } } else { collapseSection.append(indexPath.section) tableView.reloadSectionAt(index: indexPath.section) } } } }
[ -1 ]
44a8b9f250515bbc2c776c97fe1c7076f01c7732
8a8b1b29d192e05e72a63930c6645206be92dec8
/validation-test/compiler_crashers_fixed/27119-void.swift
6673ee82c0a4fa1584d27941d47738ab9742f6b5
[ "Apache-2.0", "Swift-exception" ]
permissive
ibejere/swift
c08fc8476c0f7fa829ba16429ac81403e81bb070
0794ecf5d9a23b7535270a61cea0a1eed1982134
refs/heads/master
2020-06-19T17:16:16.395895
2016-11-26T19:08:41
2016-11-26T19:08:41
74,845,952
0
1
null
2016-11-26T19:25:51
2016-11-26T19:25:50
null
UTF-8
Swift
false
false
444
swift
// This source file is part of the Swift.org open source project // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // RUN: not %target-swift-frontend %s -parse let g{{{c{}{let:{let d{{}func a{f=b}}}}protocol d
[ 74170, 74206, 74943, 74947, 74949, 74951, 74952, 74953, 74954, 74956, 74958, 74959, 74962, 74964, 74969, 74970, 74974, 74975, 74976, 74977, 74978, 74979, 74981, 74982, 74983, 74984, 74985, 74987, 74988, 74990, 74991, 74992, 74993, 74995, 74997, 75000, 75003, 75004, 75008, 75010, 75011, 75012, 75014, 75016, 75017, 75020, 75021, 75023, 75025, 75026, 75029, 75030, 75034, 75035, 75037, 75039, 75040, 75042, 75043, 75045, 75046, 75047, 75049, 75050, 75051, 75052, 75054, 75055, 75056, 75058, 75062, 75063, 75064, 75066, 75067, 75068, 75069, 75070, 75071, 75072, 75075, 75076, 75077, 75079, 75081, 75082, 75092, 75093, 75095, 75096, 75097, 75098, 75102, 75103, 75105, 75108, 75109, 75110, 75111, 75112, 75116, 75117, 75118, 75119, 75120, 75122, 75123, 75125, 75128, 75130, 75131, 75132, 75133, 75134, 75135, 75139, 75140, 75142, 75144, 75145, 75147, 75148, 75149, 75150, 75152, 75153, 75154, 75155, 75158, 75162, 75163, 75164, 75166, 75167, 75168, 75170, 75172, 75173, 75174, 75176, 75178, 75179, 75180, 75182, 75185, 75186, 75187, 75189, 75190, 75191, 75192, 75193, 75194, 75195, 75196, 75200, 75201, 75203, 75204, 75205, 75206, 75207, 75208, 75209, 75210, 75212, 75214, 75215, 75217, 75218, 75219, 75220, 75221, 75222, 75223, 75224, 75225, 75226, 75229, 75230, 75235, 75236, 75237, 75239, 75240, 75241, 75242, 75245, 75250, 75251, 75253, 75257, 75258, 75260, 75261, 75265, 75266, 75268, 75270, 75272, 75273, 75274, 75275, 75276, 75277, 75279, 75285, 75286, 75289, 75293, 75294, 75295, 75296, 75299, 75301, 75303, 75304, 75306, 75307, 75310, 75312, 75313, 75315, 75316, 75320, 75321, 75322, 75325, 75327, 75329, 75333, 75334, 75335, 75337, 75340, 75341, 75342, 75343, 75346, 75347, 75348, 75349, 75350, 75351, 75352, 75353, 75356, 75357, 75358, 75359, 75360, 75362, 75364, 75365, 75366, 75368, 75369, 75370, 75372, 75373, 75375, 75377, 75378, 75383, 75384, 75385, 75386, 75387, 75388, 75389, 75391, 75392, 75394, 75395, 75396, 75400, 75401, 75402, 75403, 75404, 75405, 75407, 75410, 75411, 75413, 75414, 75415, 75416, 75417, 75418, 75422, 75424, 75425, 75426, 75428, 75430, 75431, 75435, 75439, 75440, 75441, 75444, 75445, 75446, 75447, 75448, 75449, 75453, 75454, 75455, 75456, 75457, 75458, 75459, 75461, 75462, 75463, 75464, 75465, 75469, 75470, 75472, 75473, 75474, 75476, 75477, 75478, 75481, 75486, 75487, 75489, 75491, 75494, 75495, 75497, 75498, 75500, 75503, 75504, 75505, 75506, 75507, 75508, 75509, 75513, 75514, 75515, 75516, 75518, 75519, 75520, 75521, 75523, 75524, 75525, 75527, 75528, 75529, 75530, 75531, 75533, 75534, 75535, 75536, 75537, 75540, 75543, 75544, 75545, 75546, 75547, 75550, 75551, 75553, 75554, 75555, 75556, 75557, 75558, 75559, 75560, 75561, 75562, 75564, 75565, 75566, 75568, 75569, 75570, 75571, 75572, 75575, 75579, 75581, 75584, 75585, 75586, 75587, 75589, 75590, 75592, 75594, 75595, 75596, 75598, 75599, 75600, 75601, 75602, 75603, 75604, 75605, 75606, 75607, 75608, 75610, 75612, 75613, 75614, 75616, 75619, 75620, 75623, 75625, 75628, 75633, 75635, 75636, 75638, 75639, 75640, 75641, 75642, 75643, 75645, 75646, 75648, 75649, 75650, 75652, 75653, 75655, 75656, 75657, 75659, 75660, 75661, 75662, 75663, 75666, 75669, 75670, 75671, 75672, 75674, 75677, 75678, 75679, 75681, 75682, 75683, 75684, 75686, 75688, 75689, 75690, 75694, 75697, 75699, 75700, 75704, 75708, 75714, 75715, 75716, 75717, 75719, 75721, 75722, 75726, 75728, 75729, 75731, 75732, 75733, 75734, 75735, 75736, 75737, 75738, 75739, 75740, 75741, 75744, 75745, 75746, 75747, 75748, 75750, 75753, 75754, 75755, 75756, 75758, 75759, 75760, 75761, 75762, 75763, 75764, 75766, 75768, 75772, 75773, 75775, 75776, 75778, 75779, 75781, 75785, 75786, 75787, 75792, 75793, 75794, 75795, 75797, 75800, 75801, 75802, 75803, 75806, 75810, 75811, 75812, 75813, 75814, 75815, 75816, 75817, 75820, 75821, 75822, 75823, 75825, 75826, 75827, 75829, 75830, 75831, 75832, 75835, 75836, 75838, 75839, 75840, 75842, 75843, 75844, 75845, 75846, 75848, 75849, 75851, 75852, 75853, 75854, 75855, 75856, 75857, 75858, 75859, 75863, 75865, 75867, 75868, 75869, 75872, 75873, 75874, 75878, 75879, 75880, 75882, 75884, 75885, 75886, 75887, 75888, 75890, 75891, 75892, 75893, 75895, 75896, 75897, 75898, 75901, 75903, 75905, 75906, 75907, 75908, 75909, 75910, 75911, 75912, 75913, 75914, 75915, 75916, 75917, 75918, 75922, 75924, 75925, 75926, 75927, 75928, 75929, 75930, 75932, 75933, 75934, 75937, 75938, 75939, 75941, 75943, 75944, 75945, 75946, 75947, 75948, 75949, 75950, 75951, 75952, 75953, 75954, 75955, 75957, 75958, 75960, 75961, 75962, 75963, 75964, 75965, 75967, 75968, 75969, 75970, 75971, 75972, 75975, 75976, 75977, 75979, 75981, 75982, 75983, 75985, 75987, 75988, 75989, 75991, 75994, 75995, 75997, 75999, 76001, 76002, 76003, 76007, 76008, 76010, 76012, 76013, 76015, 76018, 76019, 76021, 76022, 76024, 76026, 76027, 76029, 76030, 76031, 76035, 76036, 76038, 76039, 76040, 76041, 76042, 76043, 76044, 76045, 76046, 76047, 76048, 76049, 76051, 76052, 76053, 76054, 76056, 76058, 76060, 76061, 76062, 76064, 76065, 76067, 76069, 76071, 76073, 76075, 76076, 76077, 76078, 76079, 76080, 76082, 76083, 76086, 76089, 76091, 76092, 76094, 76095, 76096, 76097, 76098, 76099, 76101, 76102, 76104, 76108, 76109, 76110, 76113, 76115, 76117, 76120, 76121, 76122, 76123, 76124, 76125, 76127, 76129, 76130, 76131, 76133, 76134, 76135, 76136, 76137, 76138, 76139, 76140, 76141, 76142, 76144, 76145, 76146, 76147, 76149, 76150, 76158, 76159, 76163, 76164, 76165, 76169, 76170, 76171, 76174, 76175, 76176, 76179, 76180, 76181, 76182, 76184, 76185, 76186, 76187, 76192, 76193, 76194, 76195, 76196, 76197, 76199, 76200, 76201, 76202, 76203, 76205, 76208, 76210, 76213, 76215, 76216, 76220, 76221, 76222, 76223, 76226, 76227, 76228, 76229, 76234, 76235, 76237, 76238, 76239, 76240, 76241, 76242, 76243, 76244, 76247, 76250, 76252, 76253, 76254, 76255, 76256, 76257, 76261, 76262, 76263, 76264, 76266, 76267, 76268, 76270, 76272, 76274, 76275, 76278, 76279, 76281, 76284, 76286, 76287, 76288, 76290, 76295, 76296, 76297, 76301, 76303, 76304, 76305, 76306, 76307, 76308, 76309, 76310, 76311, 76313, 76316, 76318, 76319, 76323, 76326, 76328, 76329, 76330, 76331, 76332, 76333, 76334, 76335, 76337, 76339, 76341, 76342, 76344, 76347, 76351, 76352, 76354, 76356, 76358, 76359, 76362, 76365, 76368, 76371, 76375, 76376, 76380, 76381, 76382, 76383, 76384, 76385, 76386, 76392, 76393, 76395, 76396, 76398, 76399, 76401, 76402, 76403, 76404, 76405, 76408, 76409, 76410, 76411, 76412, 76413, 76414, 76415, 76418, 76420, 76422, 76424, 76425, 76426, 76427, 76428, 76429, 76433, 76434, 76438, 76439, 76441, 76442, 76445, 76446, 76447, 76449, 76451, 76452, 76453, 76457, 76459, 76460, 76462, 76463, 76464, 76466, 76468, 76470, 76471, 76473, 76475, 76477, 76480, 76481, 76482, 76483, 76485, 76489, 76490, 76491, 76492, 76494, 76497, 76498, 76499, 76500, 76503, 76504, 76506, 76507, 76508, 76509, 76510, 76511, 76512, 76513, 76514, 76516, 76519, 76522, 76524, 76525, 76527, 76529, 76530, 76531, 76532, 76534, 76536, 76537, 76539, 76540, 76544, 76546, 76547, 76548, 76549, 76552, 76554, 76555, 76557, 76558, 76559, 76560, 76561, 76564, 76566, 76567, 76568, 76569, 76572, 76573, 76575, 76577, 76578, 76579, 76582, 76584, 76585, 76587, 76590, 76591, 76592, 76594, 76595, 76596, 76597, 76598, 76599, 76600, 76601, 76604, 76605, 76607, 76609, 76611, 76612, 76613, 76614, 76615, 76616, 76620, 76621, 76623, 76624, 76625, 76628, 76630, 76631, 76633, 76634, 76637, 76638, 76640, 76641, 76642, 76643, 76644, 76645, 76647, 76649, 76651, 76657, 76659, 76660, 76663, 76667, 76668, 76669, 76670, 76672, 76674, 76675, 76682, 76683, 76685, 76687, 76688, 76690, 76691, 76692, 76694, 76695, 76696, 76697, 76698, 76699, 76702, 76704, 76705, 76706, 76707, 76708, 76710, 76711, 76713, 76714, 76715, 76716, 76718, 76719, 76723, 76725, 76727, 76728, 76729, 76731, 76733, 76734, 76735, 76736, 76737, 76739, 76740, 76742, 76743, 76744, 76745, 76746, 76748, 76749, 76751, 76752, 76753, 76755, 76758, 76759, 76760, 76761, 76764, 76765, 76768, 76770, 76772, 76773, 76774, 76776, 76777, 76778, 76780, 76781, 76783, 76785, 76786, 76787, 76788, 76789, 76790, 76791, 76794, 76795, 76797, 76801, 76802, 76804, 76805, 76806, 76809, 76811, 76812, 76813, 76815, 76816, 76817, 76819, 76820, 76821, 76822, 76823, 76824, 76825, 76827, 76828, 76829, 76831, 76832, 76833, 76835, 76836, 76838, 76841, 76842, 76843, 76844, 76847, 76849, 76851, 76853, 76856, 76858, 76859, 76860, 76862, 76863, 76865, 76866, 76871, 76872, 76873, 76874, 76875, 76876, 76877, 76878, 76882, 76884, 76885, 76887, 76888, 76889, 76891, 76895, 76897, 76898, 76900, 76903, 76904, 76905, 76906, 76907, 76909, 76910, 76911, 76914, 76915, 76916, 76918, 76919, 76920, 76921, 76922, 76923, 76925, 76927, 76928, 76930, 76931, 76932, 76934, 76937, 76938, 76940, 76941, 76943, 76944, 76945, 76947, 76948, 76949, 76952, 76953, 76954, 76955, 76956, 76957, 76959, 76960, 76962, 76964, 76966, 76968, 76969, 76970, 76971, 76972, 76973, 76976, 76978, 76981, 76983, 76984, 76987, 76991, 76992, 76993, 76994, 76995, 76997, 76999, 77000, 77001, 77002, 77003, 77006, 77008, 77009, 77010, 77011, 77012, 77013, 77014, 77019, 77021, 77022, 77023, 77025, 77026, 77029, 77030, 77032, 77033, 77034, 77035, 77036, 77038, 77039, 77041, 77042, 77043, 77044, 77047, 77048, 77049, 77050, 77051, 77054, 77055, 77056, 77057, 77058, 77059, 77060, 77061, 77062, 77063, 77064, 77065, 77066, 77067, 77068, 77069, 77071, 77076, 77079, 77082, 77084, 77087, 77090, 77092, 77093, 77094, 77097, 77098, 77100, 77103, 77106, 77110, 77111, 77112, 77115, 77116, 77117, 77118, 77121, 77124, 77131, 77132, 77135, 77136, 77138, 77141, 77143, 77144, 77145, 77147, 77148, 77150, 77151, 77154, 77155, 77158, 77159, 77160, 77161, 77162, 77163, 77164, 77165, 77169, 77170, 77172, 77173, 77174, 77175, 77176, 77177, 77179, 77180, 77182, 77183, 77184, 77186, 77187, 77189, 77190, 77191, 77192, 77194, 77196, 77198, 77200, 77201, 77202, 77203, 77209, 77210, 77211, 77212, 77213, 77214, 77216, 77220, 77221, 77223, 77224, 77225, 77226, 77227, 77229, 77231, 77232, 77233, 77235, 77238, 77239, 77240, 77241, 77242, 77244, 77245, 77248, 77249, 77255, 77256, 77257, 77258, 77259, 77260, 77266, 77267, 77268, 77269, 77270, 77272, 77273, 77274, 77275, 77276, 77277, 77278, 77281, 77282, 77285, 77287, 77290, 77293, 77294, 77295, 77297, 77298, 77299, 77300, 77302, 77303, 77305, 77306, 77311, 77316, 77317, 77318, 77320, 77321, 77322, 77323, 77325, 77327, 77328, 77329, 77330, 77331, 77332, 77333, 77334, 77335, 77337, 77338, 77339, 77340, 77341, 77342, 77344, 77345, 77347, 77351, 77352, 77355, 77358, 77359, 77360, 77361, 77362, 77363, 77364, 77365, 77366, 77368, 77369, 77370, 77374, 77375, 77380, 77381, 77382, 77384, 77385, 77386, 77387, 77389, 77391, 77393, 77395, 77396, 77397, 77398, 77400, 77402, 77405, 77406, 77408, 77409, 77411, 77413, 77414, 77416, 77417, 77419, 77420, 77422, 77424, 77425, 77427, 77428, 77430, 77432, 77433, 77434, 77435, 77436, 77439, 77440, 77441, 77442, 77443, 77444, 77445, 77446, 77447, 77449, 77451, 77452, 77453, 77455, 77457, 77459, 77460, 77461, 77462, 77464, 77465, 77466, 77467, 77469, 77471, 77472, 77473, 77476, 77478, 77479, 77480, 77483, 77484, 77486, 77488, 77489, 77490, 77491, 77492, 77493, 77494, 77495, 77498, 77499, 77501, 77505, 77506, 77508, 77509, 77511, 77512, 77514, 77515, 77517, 77518, 77520, 77522, 77523, 77524, 77527, 77530, 77533, 77534, 77535, 77536, 77538, 77540, 77543, 77544, 77546, 77547, 77549, 77550, 77553, 77554, 77556, 77557, 77558, 77559, 77560, 77562, 77563, 77564, 77566, 77567, 77568, 77569, 77571, 77572, 77575, 77577, 77578, 77579, 77580, 77581, 77582, 77584, 77585, 77586, 77588, 77591, 77592, 77593, 77597, 77599, 77601, 77606, 77608, 77609, 77610, 77611, 77612, 77615, 77617, 77618, 77619, 77621, 77622, 77623, 77624, 77626, 77627, 77628, 77632, 77633, 77634, 77635, 77636, 77638, 77639, 77640, 77642, 77643, 77645, 77646, 77648, 77650, 77651, 77655, 77657, 77659, 77662, 77663, 77664, 77666, 77667, 77670, 77672, 77673, 77676, 77678, 77679, 77681, 77684, 77688, 77690, 77692, 77693, 77694, 77695, 77696, 77698, 77700, 77701, 77702, 77704, 77706, 77708, 77710, 77713, 77714, 77716, 77717, 77719, 77720, 77721, 77722, 77725, 77727, 77728, 77731, 77732, 77733, 77734, 77735, 77736, 77737, 77738, 77741, 77743, 77747, 77749, 77750, 77751, 77752, 77753, 77755, 77757, 77758, 77761, 77763, 77764, 77766, 77767, 77768, 77769, 77770, 77772, 77773, 77774, 77775, 77777, 77778, 77779, 77782, 77783, 77785, 77786, 77787, 77789, 77791, 77792, 77794, 77795, 77796, 77797, 77799, 77805, 77806, 77807, 77808, 77810, 77814, 77815, 77817, 77818, 77819, 77826, 77828, 77829, 77831, 77832, 77834, 77835, 77836, 77837, 77838, 77839, 77840, 77843, 77848, 77849, 77850, 77852, 77854, 77857, 77858, 77860, 77861, 77863, 77864, 77868, 77869, 77870, 77871, 77872, 77874, 77875, 77876, 77877, 77878, 77880, 77882, 77883, 77884, 77885, 77886, 77888, 77890, 77891, 77892, 77894, 77895, 77896, 77897, 77899, 77900, 77903, 77904, 77909, 77910, 77912, 77913, 77915, 77916, 77917, 77918, 77920, 77921, 77922, 77923, 77925, 77926, 77929, 77931, 77932, 77934, 77936, 77937, 77938, 77939, 77941, 77942, 77943, 77944, 77945, 77948, 77949, 77950, 77951, 77952, 77954, 77955, 77956, 77957, 77958, 77959, 77960, 77961, 77962, 77964, 77965, 77966, 77969, 77971, 77973, 77974, 77975, 77976, 77977, 77978, 77979, 77980, 77981, 77982, 77983, 77984, 77987, 77988, 77989, 77990, 77991, 77993, 77995, 77997, 77999, 78001, 78002, 78003, 78005, 78006, 78007, 78008, 78011, 78013, 78014, 78015, 78016, 78019, 78021, 78022, 78023, 78024, 78025, 78026, 78027, 78028, 78031, 78033, 78034, 78035, 78037, 78038, 78040, 78041, 78042, 78045, 78048, 78053, 78054, 78055, 78058, 78060, 78061, 78065, 78066, 78067, 78068, 78070, 78074, 78076, 78077, 78078, 78079, 78080, 78082, 78083, 78084, 78085, 78086, 78087, 78091, 78092, 78093, 78095, 78096, 78098, 78099, 78104, 78106, 78109, 78112, 78114, 78115, 78116, 78117, 78118, 78119, 78122, 78124, 78126, 78127, 78129, 78132, 78133, 78134, 78136, 78137, 78138, 78139, 78140, 78141, 78143, 78144, 78145, 78146, 78147, 78148, 78149, 78150, 78152, 78154, 78155, 78156, 78157, 78158, 78160, 78161, 78162, 78163, 78164, 78168, 78170, 78171, 78172, 78173, 78174, 78176, 78177, 78179, 78181, 78183, 78184, 78185, 78186, 78187, 78188, 78190, 78191, 78192, 78194, 78195, 78196, 78198, 78199, 78200, 78202, 78204, 78205, 78206, 78208, 78212, 78213, 78214, 78215, 78218, 78219, 78220, 78221, 78222, 78223, 78225, 78226, 78228, 78229, 78230, 78232, 78234, 78236, 78237, 78238, 78239, 78240, 78243, 78244, 78247, 78249, 78250, 78251, 78252, 78253, 78254, 78255, 78256, 78257, 78258, 78259, 78262, 78263, 78264, 78265, 78266, 78267, 78268, 78276, 78277, 78278, 78279, 78280, 78281, 78282, 78285, 78286, 78287, 78288, 78289, 78291, 78292, 78294, 78295, 78297, 78298, 78299, 78300, 78304, 78305, 78307, 78310, 78311, 78312, 78315, 78318, 78319, 78320, 78321, 78322, 78326, 78327, 78333, 78334, 78335, 78336, 78337, 78338, 78339, 78341, 78342, 78343, 78346, 78347, 78351, 78352, 78355, 78356, 78357, 78358, 78359, 78360, 78361, 78362, 78364, 78365, 78366, 78367, 78368, 78369, 78370, 78372, 78375, 78376, 78377, 78378, 78380, 78381, 78383, 78384, 78385, 78386, 78387, 78389, 78390, 78394, 78397, 78402, 78404, 78405, 78407, 78410, 78412, 78413, 78414, 78415, 78418, 78419, 78420, 78422, 78423, 78424, 78425, 78426, 78429, 78432, 78435, 78436, 78437, 78438, 78440, 78441, 78443, 78446, 78447, 78448, 78450, 78451, 78456, 78457, 78458, 78459, 78460, 78462, 78463, 78464, 78465, 78468, 78471, 78472, 78473, 78474, 78476, 78478, 78480, 78482, 78483, 78484, 78485, 78486, 78490, 78491, 78493, 78494, 78498, 78499, 78501, 78503, 78504, 78508, 78510, 78511, 78512, 78513, 78514, 78515, 78516, 78517, 78518, 78519, 78521, 78523, 78524, 78526, 78527, 78528, 78529, 78530, 78531, 78533, 78534, 78539, 78541, 78545, 78547, 78548, 78549, 78550, 78551, 78553, 78554, 78556, 78557, 78561, 78562, 78563, 78564, 78565, 78566, 78568, 78569, 78570, 78573, 78575, 78579, 78580, 78581, 78582, 78584, 78587, 78589, 78591, 78592, 78593, 78594, 78598, 78600, 78602, 78603, 78606, 78607, 78608, 78610, 78612, 78613, 78616, 78617, 78618, 78619, 78620, 78623, 78624, 78625, 78627, 78628, 78629, 78630, 78632, 78634, 78637, 78638, 78639, 78640, 78641, 78642, 78644, 78645, 78646, 78647, 78650, 78652, 78654, 78655, 78656, 78657, 78658, 78661, 78662, 78663, 78665, 78667, 78668, 78670, 78671, 78673, 78675, 78678, 78679, 78681, 78682, 78683, 78684, 78686, 78691, 78694, 78697, 78699, 78700, 78701, 78702, 78703, 78704, 78706, 78709, 78710, 78711, 78713, 78714, 78715, 78716, 78719, 78720, 78721, 78723, 78724, 78727, 78728, 78729, 78730, 78733, 78734, 78736, 78738, 78740, 78742, 78743, 78744, 78746, 78749, 78750, 78752, 78755, 78756, 78757, 78758, 78759, 78760, 78761, 78762, 78763, 78764, 78767, 78768, 78769, 78770, 78774, 78778, 78780, 78783, 78786, 78787, 78788, 78789, 78790, 78792, 78793, 78794, 78795, 78796, 78797, 78798, 78800, 78801, 78803, 78806, 78807, 78810, 78811, 78812, 78813, 78815, 78817, 78818, 78819, 78820, 78824, 78828, 78832, 78834, 78836, 78838, 78840, 78841, 78842, 78844, 78846, 78847, 78848, 78851, 78852, 78856, 78857, 78858, 78859, 78860, 78861, 78862, 78863, 78865, 78866, 78868, 78870, 78872, 78873, 78875, 78877, 78878, 78879, 78880, 78883, 78884, 78886, 78888, 78889, 78890, 78892, 78893, 78894, 78895, 78897, 78900, 78901, 78904, 78905, 78906, 78907, 78908, 78909, 78910, 78912, 78913, 78918, 78922, 78924, 78925, 78926, 78927, 78928, 78930, 78931, 78932, 78933, 78935, 78936, 78937, 78939, 78941, 78942, 78943, 78944, 78945, 78946, 78947, 78948, 78953, 78954, 78955, 78961, 78962, 78963, 78965, 78966, 78968, 78971, 78972, 78974, 78975, 78976, 78977, 78978, 78979, 78981, 78982, 78983, 78985, 78987, 78989, 78990, 78991, 78992, 78994, 78995, 78996, 78997, 78999, 79001, 79003, 79006, 79007, 79009, 79010, 79011, 79013, 79014, 79015, 79016, 79017, 79018, 79021, 79025, 79026, 79027, 79028, 79030, 79031, 79033, 79034, 79035, 79036, 79037, 79038, 79040, 79041, 79042, 79043, 79044, 79045, 79047, 79048, 79050, 79051, 79054, 79055, 79057, 79059, 79060, 79061, 79063, 79064, 79065, 79067, 79069, 79070, 79071, 79074, 79075, 79077, 79078, 79080, 79081, 79082, 79083, 79084, 79085, 79086, 79089, 79090, 79091, 79093, 79094, 79097, 79099, 79100, 79102, 79103, 79105, 79106, 79107, 79110, 79112, 79114, 79117, 79119, 79121, 79122, 79123, 79125, 79127, 79128, 79130, 79133, 79134, 79137, 79138, 79139, 79142, 79145, 79146, 79152, 79153, 79154, 79155, 79156, 79157, 79158, 79159, 79160, 79161, 79162, 79163, 79164, 79170, 79171, 79172, 79173, 79175, 79177, 79178, 79179, 79180, 79181, 79183, 79184, 79185, 79186, 79187, 79188, 79189, 79191, 79192, 79193, 79196, 79197, 79198, 79201, 79202, 79203, 79204, 79207, 79208, 79210, 79212, 79214, 79216, 79217, 79219, 79220, 79222, 79223, 79225, 79228, 79229, 79231, 79232, 79233, 79234, 79236, 79237, 79238, 79239, 79240, 79241, 79244, 79245, 79247, 79248, 79249, 79250, 79252, 79253, 79255, 79256, 79258, 79259, 79260, 79262, 79263, 79264, 79266, 79268, 79269, 79271, 79272, 79275, 79276, 79277, 79278, 79279, 79281, 79283, 79285, 79287, 79288, 79289, 79290, 79291, 79293, 79294, 79295, 79296, 79299, 79300, 79301, 79304, 79305, 79306, 79308, 79310, 79311, 79312, 79313, 79314, 79315, 79316, 79318, 79319, 79322, 79324, 79327, 79328, 79330, 79331, 79332, 79334, 79338, 79339, 79340, 79342, 79344, 79345, 79346, 79347, 79348, 79353, 79354, 79356, 79357, 79358, 79359, 79360, 79361, 79362, 79369, 79370, 79371, 79372, 79373, 79374, 79375, 79377, 79381, 79383, 79385, 79387, 79388, 79389, 79390, 79391, 79394, 79395, 79398, 79399, 79401, 79402, 79403, 79404, 79406, 79407, 79408, 79409, 79410, 79413, 79416, 79417, 79418, 79419, 79420, 79421, 79422, 79423, 79425, 79426, 79429, 79430, 79431, 79432, 79433, 79436, 79438, 79439, 79440, 79442, 79444, 79447, 79451, 79454, 79457, 79459, 79460, 79461, 79462, 79464, 79465, 79466, 79467, 79469, 79472, 79474, 79477, 79478, 79479, 79481, 79482, 79483, 79484, 79485, 79492, 79493, 79494, 79496, 79498, 79499, 79500, 79502, 79505, 79506, 79508, 79509, 79513, 79514, 79517, 79518, 79519, 79520, 79521, 79522, 79523, 79524, 79525, 79526, 79527, 79529, 79532, 79533, 79534, 79535, 79537, 79538, 79540, 79541, 79542, 79543, 79544, 79547, 79548, 79549, 79550, 79551, 79552, 79553, 79555, 79556, 79557, 79558, 79561, 79562, 79563, 79564, 79566, 79567, 79569, 79570, 79572, 79573, 79574, 79577, 79578, 79582, 79583, 79585, 79588, 79591, 79592, 79594, 79595, 79596, 79598, 79599, 79600, 79602, 79605, 79606, 79610, 79611, 79613, 79615, 79616, 79617, 79618, 79619, 79620, 79621, 79622, 79623, 79624, 79626, 79628, 79629, 79631, 79632, 79633, 79634, 79636, 79637, 79638, 79639, 79640, 79641, 79642, 79644, 79645, 79649, 79651, 79655, 79656, 79657, 79660, 79661, 79662, 79663, 79665, 79666, 79668, 79669, 79670, 79672, 79674, 79675, 79676, 79677, 79678, 79680, 79681, 79683, 79685, 79686, 79687, 79688, 79689, 79692, 79693, 79694, 79695, 79698, 79700, 79701, 79702, 79704, 79705, 79706, 79707, 79708, 79709, 79710, 79712, 79713, 79716, 79717, 79718, 79719, 79720, 79722, 79723, 79724, 79725, 79726, 79727, 79728, 79729, 79732, 79733, 79735, 79736, 79739, 79740, 79741, 79742, 79743, 79746, 79749, 79750, 79751, 79753, 79757, 79759, 79760, 79761, 79762, 79763, 79764, 79765, 79766, 79767, 79768, 79769, 79770, 79772, 79774, 79775, 79777, 79778, 79779, 79780, 79781, 79783, 79784, 79785, 79787, 79790, 79793, 79795, 79798, 79799, 79801, 79804, 79808, 79811, 79812, 79814, 79815, 79818, 79819, 79820, 79821, 79822, 79824, 79826, 79827, 79828, 79829, 79833, 79835, 79836, 79838, 79839, 79840, 79842, 79843, 79845, 79846, 79847, 79851, 79855, 79856, 79857, 79858, 79861, 79863, 79864, 79865, 79867, 79868, 79870, 79871, 79872, 79873, 79874, 79875, 79878, 79879, 79880, 79881, 79882, 79884, 79885, 79888, 79891, 79892, 79893, 79894, 79895, 79896, 79897, 79898, 79899, 79900, 79901, 79904, 79905, 79907, 79909, 79910, 79911, 79912, 79913, 79914, 79915, 79919, 79922, 79923, 79924, 79926, 79928, 79929, 79930, 79931, 79934, 79935, 79936, 79937, 79938, 79939, 79941, 79943, 79944, 79947, 79949, 79950, 79951, 79952, 79957, 79958, 79960, 79962, 79963, 79966, 79967, 79968, 79969, 79971, 79972, 79973, 79974, 79975, 79976, 79981, 79982, 79983, 79984, 79986, 79987, 79988, 79989, 79990, 79991, 79997, 79998, 79999, 80000, 80002, 80003, 80005, 80007, 80009, 80011, 80013, 80015, 80016, 80017, 80019, 80020, 80021, 80022, 80024, 80026, 80028, 80029, 80030, 80031, 80033, 80034, 80042, 80043, 80044, 80045, 80047, 80048, 80050, 80051, 80052, 80054, 80055, 80056, 80057, 80058, 80060, 80061, 80062, 80063, 80065, 80066, 80067, 80070, 80072, 80073, 80074, 80077, 80078, 80080, 80081, 80082, 80083, 80085, 80086, 80087, 80093, 80095, 80096, 80099, 80100, 80103, 80106, 80108, 80109, 80110, 80111, 80114, 80115, 80116, 80118, 80119, 80120, 80121, 80122, 80124, 80125, 80126, 80127, 80128, 80129, 80130, 80131, 80134, 80137, 80138, 80139, 80140, 80141, 80142, 80144, 80145, 80147, 80149, 80152, 80153, 80154, 80156, 80157, 80158, 80159, 80160, 80162, 80163, 80164, 80165, 80166, 80167, 80170, 80173, 80174, 80175, 80178, 80179, 80180, 80181, 80182, 80183, 80186, 80189, 80191, 80192, 80193, 80194, 80195, 80197, 80199, 80200, 80201, 80202, 80203, 80205, 80206, 80208, 80210, 80211, 80212, 80213, 80214, 80215, 80216, 80218, 80219, 80220, 80222, 80223, 80225, 80226, 80227, 80228, 80230, 80231, 80233, 80234, 80235, 80237, 80239, 80242, 80243, 80244, 80246, 80248, 80249, 80253, 80255, 80259, 80263, 80266, 80267, 80268, 80270, 80272, 80275, 80276, 80280, 80281, 80282, 80284, 80285, 80286, 80290, 80291, 80292, 80294, 80295, 80296, 80297, 80299, 80300, 80301, 80303, 80306, 80308, 80309, 80311, 80312, 80313, 80314, 80315, 80317, 80318, 80319, 80320, 80324, 80325, 80327, 80329, 80330, 80332, 80333, 80335, 80337, 80338, 80339, 80340, 80341, 80342, 145878, 80343, 80345, 80346, 80347, 80348, 80349, 80350, 80351, 80354, 80355, 80356, 80358, 80362, 80363, 80364, 80366, 80367, 80368, 80369, 80370, 80372, 80373, 80374, 80375, 80376, 80377, 80380, 80382, 80383, 80384, 80389, 80390, 80394, 80395, 80397, 80398, 80399, 80401, 80404, 80407, 80408, 80409, 80412, 80414, 80415, 80417, 80420, 80421, 80422, 80423, 80425, 80426, 80427, 80429, 80430, 80431, 80432, 80433, 80434, 80437, 80438, 80439, 80441, 80443, 80444, 80445, 80449, 80450, 80451, 80452, 80455, 80456, 80457, 80458, 80460, 80462, 80464, 80466, 80467, 80471, 80472, 80474, 80477, 80478, 80479, 80480, 80481, 80483, 80485, 80487, 80490, 80491, 80492, 80493, 80495, 80497, 80498, 80499, 80500, 80501, 80502, 80503, 80504, 80505, 80507, 80508, 80509, 80510, 80511, 80512, 80516, 80517, 80519, 80520, 80521, 80522, 80523, 80524, 80525, 80526, 80527, 80528, 80529, 80531, 80532, 80533, 80536, 80539, 80541, 80548, 80549, 80550, 80553, 80554, 80555, 80556, 80558, 80559, 80560, 80561, 80563, 80565, 80568, 80570, 80571, 80572, 80573, 80575, 80576, 80577, 80579, 80582, 80583, 80585, 80586, 80588, 80589, 80591, 80592, 80594, 80595, 80597, 80598, 80599, 80600, 80602, 80606, 80607, 87746, 88094, 88115, 88256, 88631, 88664, 88766, 88776, 88778, 88856, 88857, 88858, 88859, 88860, 88863, 88864, 88868, 88869, 88870, 88871, 88873, 88874, 88875, 88876, 88877, 88878, 88880, 88881, 88882, 88883, 88884, 88886, 88887, 88888, 88890, 88891, 88892, 88893, 88894, 88895, 88897, 88898, 88901, 88902, 88903, 88904, 88905, 88906, 88907, 88908, 88909, 88911, 88912, 88913, 88914, 88915, 88917, 88918, 88919, 88921, 88922, 88923, 88924, 88925, 91280, 91314, 91316, 91317, 91351, 91362, 91645, 91647, 91648, 91650, 91651, 91656, 91658, 91659, 91660, 91661, 91662, 91665, 91674, 91675, 91679, 91681, 91682, 91683, 91684, 91686, 91688, 91691, 91694, 91695, 91699, 91701, 91702, 91703, 91705, 91707, 91708, 91711, 91712, 91714, 91716, 91717, 91720, 91721, 91726, 91728, 91729, 91730, 91731, 91733, 91734, 91736, 91738, 91740, 91741, 91742, 91743, 91745, 91746, 91747, 91749, 91753, 91754, 91755, 91756, 91757, 91758, 91759, 91760, 91761, 91762, 91764, 91765, 91766, 91767, 91769, 91770, 91771, 91772, 91776, 91779, 91780, 91782, 91783, 91784, 91785, 91790, 91792, 91794, 91795, 91796, 91799, 91800, 91801, 91803, 91804, 91805, 91806, 91808, 91811, 91813, 91814, 91815, 91816, 91817, 91818, 91821, 91822, 91825, 91827, 91828, 91829, 91830, 91831, 91832, 91833, 91834, 91835, 91837, 91840, 91842, 91843, 91844, 91846, 91847, 91848, 91850, 91852, 91853, 91854, 91856, 91858, 91860, 91862, 91865, 91866, 91867, 91868, 91869, 91870, 91871, 91872, 91873, 91874, 91875, 91876, 91880, 91881, 91883, 91884, 91885, 91886, 91887, 91888, 91889, 91891, 91893, 91894, 91897, 91898, 91899, 91900, 91901, 91902, 91903, 91904, 91905, 91906, 91907, 91908, 91909, 91914, 91915, 91916, 91917, 91918, 91919, 91922, 91927, 91928, 91930, 91932, 91934, 91935, 91936, 91937, 91939, 91940, 91941, 91943, 91946, 91947, 91948, 91949, 91950, 91953, 91956, 91957, 91960, 91962, 91964, 91965, 91966, 91970, 91974, 91975, 91976, 91978, 91980, 91981, 91982, 91983, 91987, 91988, 91989, 91993, 91995, 91996, 91997, 91999, 92002, 92003, 92004, 92005, 92008, 92009, 92010, 92011, 92012, 92013, 92014, 92017, 92018, 92019, 92020, 92021, 92023, 92025, 92026, 92028, 92029, 92030, 92032, 92033, 92036, 92037, 92042, 92043, 92044, 92045, 92046, 92047, 92048, 92050, 92051, 92053, 92054, 92055, 92059, 92060, 92061, 92062, 92063, 92066, 92069, 92071, 92072, 92073, 92074, 92075, 92079, 92081, 92082, 92083, 92085, 92087, 92091, 92095, 92096, 92099, 92100, 92101, 92102, 92103, 92107, 92108, 92109, 92110, 92111, 92112, 92114, 92115, 92116, 92120, 92121, 92123, 92124, 92125, 92126, 92127, 92128, 92131, 92133, 92136, 92141, 92142, 92144, 92145, 92147, 92149, 92150, 92151, 92152, 92154, 92158, 92159, 92160, 92161, 92164, 92165, 92166, 92167, 92168, 92170, 92171, 92172, 92173, 92174, 92176, 92177, 92178, 92179, 92180, 92183, 92186, 92187, 92188, 92189, 92190, 92193, 92194, 92196, 92197, 92198, 92199, 92201, 92202, 92203, 92204, 92205, 92207, 92208, 92210, 92212, 92213, 92214, 92215, 92217, 92221, 92222, 92223, 92226, 92227, 92228, 92229, 92231, 92232, 92234, 92236, 92237, 92238, 92240, 92241, 92242, 92243, 92244, 92245, 92246, 92247, 92248, 92250, 92252, 92253, 92254, 92256, 92259, 92262, 92264, 92265, 92267, 92268, 92272, 92273, 92274, 92275, 92278, 92279, 92280, 92281, 92283, 92285, 92286, 92287, 92289, 92290, 92292, 92293, 92294, 92296, 92297, 92298, 92299, 92300, 92303, 92306, 92308, 92309, 92311, 92314, 92315, 92316, 92318, 92319, 92320, 92321, 92323, 92325, 92326, 92330, 92333, 92335, 92339, 92340, 92342, 92344, 92347, 92348, 92349, 92350, 92351, 92352, 92354, 92355, 92359, 92361, 92362, 92364, 92365, 92366, 92367, 92368, 92369, 92370, 92371, 92372, 92373, 92376, 92377, 92378, 92379, 92380, 92382, 92385, 92386, 92387, 92388, 92389, 92390, 92391, 92392, 92393, 92394, 92395, 92397, 92401, 92403, 92404, 92406, 92407, 92408, 92409, 92413, 92414, 92415, 92420, 92421, 92422, 92423, 92425, 92428, 92429, 92430, 92431, 92437, 92438, 92439, 92440, 92441, 92442, 92443, 92444, 92446, 92447, 92448, 92450, 92451, 92452, 92454, 92455, 92456, 92457, 92460, 92461, 92463, 92464, 92465, 92467, 92468, 92469, 92470, 92471, 92473, 92474, 92475, 92476, 92477, 92478, 92479, 92480, 92481, 92482, 92483, 92484, 92487, 92488, 92490, 92492, 92493, 92494, 92497, 92498, 92499, 92503, 92504, 92505, 92508, 92509, 92510, 92511, 92513, 92514, 92515, 92517, 92518, 92519, 92522, 92524, 92526, 92528, 92529, 92530, 92531, 92532, 92533, 92534, 92535, 92536, 92537, 92539, 92542, 92543, 92545, 92546, 92547, 92548, 92549, 92550, 92551, 92552, 92553, 92554, 92557, 92558, 92560, 92562, 92563, 92564, 92565, 92566, 92567, 92568, 92569, 92570, 92571, 92572, 92573, 92574, 92575, 92576, 92577, 92578, 92580, 92581, 92582, 92583, 92584, 92587, 92588, 92589, 92592, 92593, 92594, 92596, 92598, 92599, 92600, 92603, 92604, 92606, 92608, 92610, 92611, 92615, 92616, 92617, 92618, 92619, 92620, 92621, 92623, 92624, 92626, 92628, 92629, 92630, 92633, 92634, 92635, 92636, 92637, 92641, 92642, 92644, 92645, 92646, 92647, 92648, 92649, 92650, 92651, 92652, 92653, 92654, 92655, 92656, 92657, 92658, 92659, 92660, 92663, 92664, 92667, 92668, 92669, 92670, 92673, 92675, 92676, 92677, 92678, 92679, 92681, 92682, 92688, 92689, 92690, 92692, 92693, 92694, 92695, 92696, 92698, 92701, 92703, 92704, 92706, 92707, 92709, 92710, 92712, 92715, 92716, 92717, 92718, 92719, 92721, 92723, 92724, 92726, 92727, 92728, 92729, 92730, 92731, 92732, 92733, 92734, 92735, 92736, 92737, 92739, 92740, 92748, 92749, 92750, 92753, 92754, 92755, 92759, 92760, 92761, 92762, 92763, 92764, 92765, 92766, 92767, 92770, 92771, 92773, 92774, 92775, 92776, 92781, 92782, 92783, 92784, 92786, 92787, 92788, 92789, 92790, 92792, 92795, 92797, 92798, 92800, 92803, 92806, 92807, 92808, 92809, 92812, 92813, 92814, 92815, 92820, 92821, 92822, 92823, 92824, 92825, 92827, 92828, 92831, 92835, 92836, 92837, 92838, 92839, 92841, 92843, 92844, 92846, 92847, 92848, 92850, 92852, 92853, 92854, 92855, 92857, 92858, 92860, 92863, 92865, 92866, 92868, 92869, 92871, 92873, 92874, 92877, 92879, 92880, 92882, 92883, 92884, 92885, 92886, 92888, 92892, 92893, 92897, 92900, 92902, 92903, 92904, 92905, 92906, 92907, 92908, 92911, 92913, 92915, 92917, 92918, 92922, 92923, 92925, 92927, 92929, 92932, 92935, 92938, 92941, 92943, 92945, 92946, 92950, 92951, 92952, 92953, 92954, 92955, 92956, 92962, 92963, 92965, 92966, 92967, 92968, 92969, 92971, 92972, 92973, 92974, 92975, 92978, 92979, 92981, 92982, 92983, 92984, 92987, 92991, 92993, 92994, 92995, 92996, 92997, 92998, 93002, 93003, 93007, 93009, 93010, 93013, 93014, 93015, 93016, 93017, 93019, 93020, 93021, 93023, 93024, 93025, 93027, 93028, 93030, 93031, 93032, 93034, 93036, 93038, 93039, 93041, 93043, 93045, 93047, 93048, 93049, 93050, 93052, 93053, 93055, 93056, 93057, 93059, 93061, 93064, 93065, 93066, 93069, 93070, 93072, 93073, 93074, 93075, 93076, 93077, 93078, 93079, 93082, 93085, 93087, 93088, 93091, 93092, 93093, 93094, 93096, 93097, 93098, 93099, 93100, 93101, 93102, 93105, 93106, 93107, 93108, 93109, 93110, 93112, 93114, 93115, 93116, 93117, 93118, 93119, 93122, 93124, 93125, 93126, 93129, 93130, 93132, 93134, 93137, 93139, 93140, 93142, 93145, 93146, 93147, 93149, 93150, 93152, 93153, 93154, 93155, 93158, 93160, 93164, 93165, 93166, 93167, 93168, 93172, 93173, 93175, 93176, 93177, 93180, 93182, 93183, 93185, 93186, 93189, 93190, 93192, 93193, 93194, 93195, 93197, 93198, 93199, 93200, 93205, 93207, 93208, 93211, 93215, 93216, 93217, 93219, 93221, 93222, 93223, 93227, 93228, 93230, 93232, 93234, 93235, 93237, 93238, 93239, 93240, 93243, 93245, 93246, 93247, 93248, 93249, 93251, 93252, 93254, 93255, 93256, 93258, 93259, 93263, 93265, 93266, 93267, 93268, 93269, 93270, 93271, 93273, 93274, 93275, 93276, 93278, 93280, 93281, 93282, 93283, 93284, 93286, 93287, 93289, 93290, 93291, 93292, 93293, 93294, 93296, 93297, 93298, 93301, 93302, 93303, 93305, 93307, 93309, 93310, 93311, 93313, 93314, 93317, 93318, 93319, 93320, 93321, 93322, 93325, 93326, 93328, 93332, 93333, 93335, 93336, 93337, 93339, 93340, 93341, 93342, 93343, 93344, 93345, 93346, 93347, 93348, 93350, 93351, 93352, 93353, 93354, 93355, 93356, 93358, 93359, 93360, 93362, 93363, 93365, 93366, 93368, 93371, 93372, 93373, 93376, 93378, 93382, 93385, 93387, 93388, 93389, 93391, 93393, 93394, 93395, 93399, 93400, 93401, 93402, 93403, 93404, 93405, 93407, 93409, 93411, 93412, 93413, 93415, 93419, 93420, 93421, 93422, 93424, 93427, 93428, 93429, 93430, 93431, 93432, 93433, 93434, 93435, 93437, 93438, 93439, 93441, 93442, 93443, 93444, 93445, 93446, 93448, 93449, 93450, 93452, 93453, 93454, 93455, 93456, 93459, 93460, 93462, 93464, 93465, 93466, 93468, 93469, 93470, 93472, 93473, 93474, 93475, 93476, 93478, 93479, 93481, 93483, 93484, 93485, 93487, 93488, 93489, 93490, 93491, 93492, 93493, 93495, 93497, 93500, 93502, 93503, 93505, 93506, 93510, 93511, 93512, 93513, 93514, 93518, 93519, 93520, 93521, 93522, 93524, 93525, 93526, 93527, 93528, 93529, 93530, 93534, 93537, 93538, 93539, 93542, 93545, 93546, 93547, 93548, 93549, 93550, 93551, 93552, 93554, 93555, 93556, 93557, 93558, 93559, 93560, 93561, 93563, 93564, 93565, 93566, 93567, 93569, 93570, 93571, 93572, 93573, 93574, 93575, 93576, 93577, 93578, 93579, 93580, 93581, 93582, 93583, 93585, 93592, 93596, 93599, 93602, 93604, 93605, 93606, 93609, 93610, 93612, 93613, 93615, 93618, 93619, 93622, 93623, 93624, 93627, 93628, 93629, 93630, 93632, 93633, 93635, 93636, 93642, 93643, 93646, 93647, 93649, 93652, 93654, 93655, 93656, 93658, 93660, 93661, 93664, 93665, 93666, 93667, 93668, 93669, 93670, 93671, 93672, 93673, 93674, 93678, 93679, 93681, 93682, 93683, 93684, 93685, 93686, 93688, 93689, 93692, 93693, 93697, 93698, 93699, 93700, 93702, 93705, 93707, 93708, 93709, 93715, 93716, 93717, 93718, 93719, 93720, 93724, 93725, 93727, 93728, 93729, 93731, 93733, 93735, 93736, 93737, 93739, 93741, 93742, 93743, 93744, 93745, 93747, 93750, 93751, 93754, 93757, 93758, 93759, 93762, 93765, 93766, 93767, 93768, 93770, 93771, 93772, 93773, 93774, 93775, 93778, 93779, 93782, 93785, 93786, 93787, 93788, 93789, 93791, 93792, 93793, 93794, 93796, 93797, 93799, 93800, 93802, 93806, 93810, 93811, 93813, 93814, 93815, 93816, 93818, 93820, 93821, 93822, 93823, 93824, 93825, 93827, 93828, 93831, 93832, 93835, 93836, 93841, 93844, 93846, 93847, 93848, 93849, 93851, 93852, 93854, 93855, 93856, 93860, 93861, 93866, 93867, 93868, 93870, 93871, 93872, 93873, 93875, 93877, 93878, 93881, 93882, 93883, 93885, 93887, 93888, 93890, 93891, 93892, 93894, 93895, 93896, 93897, 93898, 93899, 93900, 93902, 93905, 93906, 93908, 93909, 93911, 93913, 93914, 93915, 93916, 93919, 93920, 93921, 93922, 93923, 93924, 93925, 93926, 93928, 93930, 93931, 93932, 93934, 93935, 93936, 93937, 93938, 93940, 93941, 93942, 93945, 93947, 93948, 93951, 93953, 93954, 93957, 93958, 93960, 93961, 93962, 93963, 93964, 93965, 93966, 93967, 93969, 93970, 93971, 93972, 93973, 93974, 93977, 93979, 93980, 93982, 93985, 93986, 93987, 93988, 93991, 93992, 93993, 93994, 93995, 93997, 93998, 94001, 94004, 94005, 94006, 94010, 94013, 94015, 94016, 94017, 94019, 94021, 94022, 94024, 94025, 94026, 94027, 94028, 94029, 94030, 94031, 94033, 94034, 94035, 94036, 94038, 94039, 94042, 94044, 94045, 94046, 94047, 94048, 94049, 94051, 94052, 94053, 94056, 94057, 94059, 94060, 94061, 94063, 94068, 94069, 94070, 94071, 94072, 94073, 94074, 94079, 94081, 94082, 94083, 94084, 94085, 94086, 94088, 94089, 94090, 94094, 94095, 94096, 94097, 94099, 94100, 94101, 94103, 94106, 94107, 94109, 94110, 94111, 94112, 94114, 94116, 94119, 94122, 94123, 94124, 94126, 94127, 94130, 94132, 94133, 94135, 94136, 94138, 94139, 94142, 94147, 94149, 94150, 94151, 94152, 94156, 94157, 94158, 94160, 94162, 94164, 94167, 94168, 94170, 94171, 94172, 94173, 94174, 94176, 94178, 94179, 94182, 94183, 94184, 94185, 94186, 94187, 94190, 94192, 94193, 94195, 94197, 94198, 94199, 94200, 94201, 94203, 94205, 94206, 94209, 94211, 94212, 94214, 94216, 94217, 94218, 94220, 94221, 94222, 94224, 94225, 94228, 94229, 94231, 94232, 94234, 94235, 94236, 94237, 94239, 94240, 94241, 94242, 94244, 94246, 94249, 94250, 94251, 94252, 94253, 94255, 94259, 94260, 94262, 94263, 94264, 94265, 94267, 94269, 94271, 94272, 94274, 94275, 94277, 94278, 94279, 94280, 94281, 94282, 94283, 94286, 94291, 94292, 94295, 94298, 94299, 94300, 94301, 94303, 94304, 94308, 94309, 94310, 94311, 94312, 94314, 94315, 94316, 94317, 94318, 94320, 94321, 94322, 94323, 94324, 94325, 94326, 94328, 94330, 94331, 94332, 94334, 94335, 94336, 94337, 94338, 94339, 94340, 94343, 94344, 94349, 94352, 94354, 94356, 94357, 94358, 94359, 94360, 94362, 94363, 94366, 94368, 94369, 94372, 94373, 94374, 94375, 94377, 94378, 94379, 94380, 94383, 94385, 94386, 94387, 94389, 94390, 94391, 94392, 94393, 94394, 94395, 94396, 94397, 94399, 94400, 94401, 94404, 94406, 94408, 94409, 94410, 94411, 94412, 94413, 94414, 94415, 94416, 94417, 94420, 94421, 94422, 94424, 94426, 94428, 94430, 94432, 94433, 94435, 94436, 94437, 94438, 94439, 94441, 94443, 94444, 94445, 94448, 94450, 94451, 94452, 94453, 94454, 94455, 94458, 94460, 94461, 94462, 94464, 94466, 94467, 94468, 94471, 94472, 94473, 94474, 94475, 94478, 94479, 94480, 94481, 94485, 94486, 94487, 94488, 94491, 94496, 94497, 94498, 94499, 94500, 94501, 94502, 94504, 94505, 94506, 94507, 94511, 94512, 94513, 94515, 94516, 94517, 94518, 94519, 94524, 94526, 94530, 94531, 94533, 94534, 94535, 94536, 94537, 94539, 94540, 94543, 94544, 94546, 94548, 94549, 94551, 94552, 94553, 94554, 94555, 94556, 94558, 94559, 94560, 94561, 94562, 94563, 94565, 94567, 94568, 94569, 94570, 94572, 94573, 94574, 94575, 94580, 94582, 94583, 94584, 94585, 94586, 94588, 94589, 94591, 94595, 94596, 94597, 94598, 94599, 94600, 94601, 94602, 94603, 94604, 94606, 94607, 94608, 94609, 94610, 94611, 94613, 94615, 94616, 94617, 94618, 94622, 94623, 94624, 94625, 94628, 94629, 94630, 94631, 94632, 94633, 94635, 94636, 94638, 94639, 94640, 94642, 94644, 94646, 94647, 94648, 94649, 94650, 94653, 94656, 94657, 94658, 94659, 94660, 94661, 94662, 94663, 94664, 94665, 94666, 94668, 94669, 94670, 94671, 94672, 94673, 94674, 94676, 94680, 94682, 94683, 94684, 94685, 94686, 94687, 94688, 94691, 94692, 94693, 94694, 94696, 94697, 94700, 94702, 94703, 94704, 94705, 94708, 94709, 94711, 94712, 94714, 94715, 94716, 94719, 94722, 94723, 94724, 94725, 94729, 94730, 94731, 94736, 94738, 94739, 94740, 94741, 94742, 94744, 94745, 94748, 94749, 94750, 94752, 94753, 94754, 94756, 94757, 94758, 94759, 94760, 94761, 94762, 94763, 94764, 94766, 94767, 94768, 94769, 94770, 94771, 94772, 94773, 94774, 94777, 94778, 94779, 94781, 94783, 94785, 94787, 94788, 94789, 94792, 94795, 94799, 94800, 94802, 94803, 94806, 94807, 94808, 94810, 94811, 94813, 94814, 94815, 94816, 94818, 94819, 94820, 94821, 94822, 94825, 94826, 94828, 94831, 94832, 94833, 94835, 94836, 94838, 94839, 94842, 94843, 94845, 94846, 94848, 94851, 94852, 94853, 94854, 94855, 94857, 94858, 94859, 94860, 94862, 94863, 94864, 94865, 94866, 94867, 94868, 94870, 94873, 94875, 94876, 94877, 94878, 94879, 94883, 94884, 94886, 94887, 94890, 94892, 94894, 94898, 94900, 94901, 94902, 94903, 94904, 94905, 94906, 94908, 94909, 94910, 94911, 94912, 94913, 94914, 94916, 94917, 94918, 94919, 94920, 94921, 94923, 94927, 94929, 94931, 94933, 94935, 94936, 94937, 94938, 94939, 94941, 94942, 94943, 94944, 94945, 94949, 94950, 94951, 94952, 94953, 94955, 94956, 94957, 94960, 94962, 94966, 94967, 94968, 94969, 94971, 94974, 94976, 94978, 94979, 94980, 94984, 94986, 94989, 94990, 94992, 94994, 94995, 94998, 94999, 95000, 95001, 95002, 95005, 95006, 95007, 95009, 95010, 95011, 95013, 95015, 95016, 95018, 95019, 95020, 95021, 95022, 95023, 95024, 95025, 95028, 95030, 95032, 95033, 95034, 95035, 95036, 95039, 95040, 95042, 95044, 95045, 95047, 95048, 95050, 95052, 95055, 95056, 95058, 95059, 95060, 95062, 95069, 95071, 95072, 95073, 95074, 95075, 95076, 95077, 95079, 95080, 95082, 95083, 95084, 95086, 95087, 95088, 95089, 95091, 95092, 95093, 95095, 95096, 95099, 95100, 95101, 95102, 95105, 95106, 95108, 95110, 95111, 95112, 95114, 95115, 95116, 95117, 95118, 95120, 95121, 95123, 95124, 95126, 95127, 95128, 95129, 95130, 95131, 95132, 95133, 95134, 95135, 95136, 95138, 95139, 95142, 95143, 95145, 95147, 95151, 95153, 95154, 95155, 95156, 95157, 95158, 95159, 95160, 95161, 95162, 95163, 95164, 95165, 95166, 95167, 95170, 95171, 95172, 95173, 95174, 95175, 95176, 95177, 95179, 95181, 95182, 95184, 95188, 95192, 95195, 95196, 95197, 95198, 95199, 95201, 95203, 95204, 95205, 95207, 95209, 95210, 95211, 95214, 95215, 95219, 95220, 95221, 95223, 95224, 95225, 95226, 95228, 95229, 95231, 95232, 95233, 95235, 95236, 95237, 95238, 95240, 95241, 95242, 95245, 95246, 95248, 95250, 95251, 95252, 95254, 95255, 95256, 95258, 95261, 95262, 95265, 95266, 95267, 95268, 95269, 95270, 95271, 95273, 95278, 95280, 95282, 95284, 95285, 95286, 95287, 95289, 95290, 95291, 95292, 95294, 95295, 95297, 95299, 95300, 95301, 95302, 95303, 95304, 95308, 95309, 95310, 95311, 95314, 95315, 95317, 95318, 95320, 95321, 95323, 95326, 95327, 95329, 95330, 95331, 95332, 95333, 95334, 95335, 95336, 95337, 95338, 95340, 95341, 95342, 95343, 95344, 95345, 95347, 95348, 95349, 95350, 95352, 95354, 95356, 95357, 95359, 95360, 95361, 95362, 95363, 95364, 95366, 95367, 95368, 95369, 95370, 95371, 95372, 95374, 95375, 95378, 95379, 95380, 95381, 95383, 95384, 95386, 95388, 95389, 95390, 95392, 95393, 95394, 95395, 95396, 95397, 95399, 95400, 95402, 95405, 95406, 95408, 95410, 95411, 95412, 95414, 95415, 95417, 95419, 95420, 95421, 95424, 95425, 95427, 95428, 95430, 95432, 95433, 95434, 95435, 95436, 95438, 95439, 95440, 95442, 95444, 95446, 95448, 95449, 95451, 95452, 95454, 95455, 95456, 95459, 95462, 95464, 95465, 95467, 95469, 95470, 95471, 95473, 95474, 95475, 95476, 95478, 95481, 95482, 95485, 95486, 95487, 95490, 95494, 95500, 95501, 95502, 95503, 95504, 95505, 95506, 95507, 95508, 95509, 95510, 95511, 95512, 95517, 95518, 95519, 95520, 95523, 95524, 95525, 95526, 95528, 95529, 95530, 95531, 95532, 95533, 95535, 95536, 95539, 95540, 95543, 95544, 95547, 95548, 95549, 95550, 95552, 95553, 95555, 95556, 95558, 95559, 95560, 95561, 95563, 95566, 95567, 95569, 95570, 95571, 95572, 95574, 95575, 95576, 95577, 95578, 95579, 95582, 95583, 95585, 95586, 95587, 95588, 95590, 95592, 95593, 95595, 95597, 95598, 95601, 95602, 95604, 95605, 95608, 95609, 95610, 95611, 95612, 95614, 95616, 95620, 95621, 95622, 95623, 95624, 95625, 95626, 95627, 95629, 95630, 95631, 95632, 95635, 95636, 95637, 95639, 95641, 95642, 95643, 95644, 95645, 95646, 95647, 95649, 95651, 95653, 95656, 95657, 95658, 95659, 95660, 95662, 95665, 95666, 95667, 95669, 95671, 95672, 95673, 95674, 95678, 95679, 95681, 95682, 95683, 95684, 95685, 95686, 95690, 95693, 95694, 95695, 95696, 95697, 95698, 95700, 95704, 95706, 95707, 95709, 95710, 95711, 95713, 95714, 95715, 95716, 95717, 95718, 95719, 95720, 95722, 95723, 95724, 95725, 95726, 95729, 95733, 95734, 95735, 95736, 95737, 95738, 95739, 95741, 95744, 95745, 95746, 95747, 95750, 95752, 95753, 95755, 95757, 95758, 95760, 95761, 95762, 95764, 95765, 95767, 95768, 95770, 95772, 95773, 95774, 95775, 95777, 95778, 95779, 95780, 95782, 95785, 95789, 95790, 95791, 95793, 95794, 95795, 95796, 95797, 95801, 95803, 95804, 95805, 95806, 95808, 95810, 95811, 95813, 95816, 95817, 95819, 95823, 95824, 95827, 95828, 95829, 95830, 95831, 95832, 95833, 95834, 95835, 95836, 95837, 95839, 95842, 95843, 95844, 95845, 95847, 95848, 95849, 95850, 95851, 95852, 95853, 95854, 95857, 95858, 95859, 95860, 95861, 95862, 95864, 95865, 95866, 95867, 95870, 95871, 95872, 95874, 95875, 95877, 95878, 95879, 95880, 95881, 95884, 95885, 95888, 95889, 95893, 95896, 95897, 95899, 95900, 95902, 95903, 95906, 95907, 95909, 95910, 95912, 95913, 95914, 95915, 95917, 95919, 95920, 95921, 95922, 95923, 95924, 95925, 95926, 95927, 95929, 95931, 95932, 95934, 95935, 95936, 95938, 95939, 95940, 95941, 95942, 95944, 95945, 95949, 95951, 95955, 95956, 95957, 95960, 95961, 95962, 95963, 95965, 95968, 95969, 95970, 95972, 95973, 95975, 95976, 95977, 95979, 95981, 95983, 95984, 95985, 95986, 95987, 95990, 95991, 95992, 95993, 95995, 95996, 95997, 95998, 95999, 96001, 96002, 96003, 96004, 96005, 96006, 96008, 96009, 96012, 96013, 96014, 96015, 96017, 96018, 96019, 96020, 96021, 96022, 96023, 96024, 96027, 96028, 96029, 96030, 96031, 96034, 96035, 96036, 96038, 96041, 96043, 96044, 96045, 96046, 96048, 96054, 96056, 96057, 96058, 96059, 96060, 96061, 96062, 96064, 96066, 96067, 96069, 96070, 96071, 96072, 96073, 96074, 96075, 96076, 96078, 96081, 96084, 96085, 96088, 96089, 96091, 96093, 96097, 96100, 96103, 96106, 96107, 96109, 96111, 96113, 96114, 96115, 96116, 96117, 96121, 96122, 96124, 96125, 96126, 96128, 96129, 96131, 96132, 96133, 96137, 96141, 96142, 96143, 96144, 96147, 96150, 96151, 96152, 96154, 96155, 96156, 96157, 96158, 96159, 96161, 96162, 96163, 96164, 96165, 96166, 96167, 96168, 96173, 96174, 96175, 96176, 96177, 96178, 96179, 96180, 96183, 96184, 96185, 96187, 96189, 96190, 96191, 96192, 96193, 96194, 96195, 96198, 96199, 96201, 96202, 96203, 96204, 96205, 96207, 96208, 96209, 96212, 96213, 96214, 96216, 96218, 96220, 96221, 96224, 96225, 96226, 96227, 96228, 96229, 96233, 96234, 96238, 96239, 96241, 96242, 96243, 96244, 96246, 96247, 96248, 96249, 96250, 96251, 96255, 96256, 96257, 96258, 96260, 96261, 96263, 96264, 96266, 96267, 96268, 96269, 96270, 96271, 96273, 96274, 96276, 96277, 96278, 96279, 96280, 96282, 96284, 96285, 96286, 96287, 96288, 96289, 96290, 96292, 96294, 96296, 96297, 96298, 96300, 96301, 96308, 96309, 96310, 96312, 96313, 96314, 96315, 96317, 96318, 96319, 96321, 96322, 96323, 96325, 96326, 96327, 96329, 96330, 96332, 96333, 96334, 96337, 96338, 96340, 96341, 96342, 96344, 96345, 96346, 96352, 96354, 96355, 96357, 96358, 96359, 96362, 96365, 96368, 96369, 96372, 96373, 96374, 96376, 96377, 96378, 96380, 96381, 96382, 96383, 96384, 96385, 96386, 96387, 96389, 96390, 96393, 96394, 96395, 96396, 96397, 96398, 96400, 96401, 96403, 96405, 96407, 96408, 96409, 96410, 96411, 96412, 96413, 96414, 96416, 96417, 96418, 96419, 96420, 96421, 96424, 96425, 96427, 96428, 96429, 96432, 96433, 96434, 96436, 96437, 96440, 96443, 96445, 96446, 96447, 96448, 96449, 96450, 96452, 96453, 96454, 96456, 96457, 96458, 96459, 96461, 96462, 96463, 96464, 96465, 96467, 96468, 96470, 96471, 96473, 96474, 96475, 96477, 96479, 96480, 96481, 96483, 96485, 96488, 96489, 96490, 96491, 96492, 96494, 96495, 96499, 96501, 96504, 96506, 96508, 96510, 96512, 96514, 96516, 96519, 96520, 96524, 96525, 96527, 96528, 96529, 96533, 96534, 96535, 96537, 96538, 96539, 96540, 96543, 96544, 96546, 96549, 96551, 96552, 96554, 96555, 96556, 96557, 96559, 96560, 96561, 96562, 96563, 96566, 96568, 96570, 96571, 96573, 96574, 96576, 96578, 96579, 96580, 96581, 96582, 96583, 96584, 96586, 96587, 96588, 96590, 96591, 96592, 96596, 96597, 96601, 96602, 96603, 96605, 96606, 96607, 96608, 96609, 96611, 96612, 96613, 96614, 96615, 96617, 96618, 96620, 96621, 96622, 96627, 96628, 96630, 96632, 96633, 96635, 96636, 96637, 96639, 96642, 96645, 96648, 96650, 96651, 96653, 96656, 96657, 96658, 96660, 96661, 96662, 96664, 96665, 96666, 96667, 96668, 96669, 96672, 96673, 96674, 96676, 96679, 96680, 96684, 96685, 96686, 96687, 96690, 96691, 96692, 96693, 96694, 96695, 96696, 96699, 96700, 96701, 96702, 96704, 96705, 96707, 96710, 96711, 96712, 96714, 96716, 96718, 96720, 96723, 96724, 96725, 96726, 96729, 96730, 96731, 96732, 96733, 96734, 96735, 96736, 96737, 96738, 96739, 96740, 96741, 96742, 96746, 96749, 96750, 96751, 96752, 96753, 96754, 96755, 96756, 96757, 96758, 96759, 96761, 96762, 96763, 96765, 96766, 96767, 96768, 96770, 96772, 96774, 96777, 96779, 96782, 96783, 96784, 96785, 96787, 96788, 96791, 96793, 96794, 96796, 96798, 96799, 96800, 96801, 96802, 96803, 96804, 96805, 96807, 96809, 96810, 96812, 96813, 96815, 96816, 96818, 96819, 96821, 96822, 96824, 96825, 96826, 96828, 96831 ]
1b11a7fe0df96f42adfb151bdbd67db70c30ab83
a4c88298506d9e433e45fcd241d183d697ee813f
/FlixDemo/MovieApiManager.swift
985b5d170fb8e96a167f0e4ce543ee44c5e94482
[ "Apache-2.0" ]
permissive
tkmak712/FlixDemo
8eff3af2201c98b5becc7d70cc4b4d7c48526ddb
0e7a63de831c8bf5a6d8faac35a576bcb7e22491
refs/heads/master
2021-09-02T08:36:25.218289
2018-01-01T02:56:36
2018-01-01T02:56:36
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,438
swift
// // MovieApiManager.swift // FlixDemo // // Created by Timothy Mak on 12/9/17. // Copyright © 2017 Timothy Mak. All rights reserved. // import Foundation class MovieApiManager { static let MOVIE_URL = "https://api.themoviedb.org/3/movie/now_playing?api_key=" static let BASE_URL = "https://image.tmdb.org/t/p/w500" static let API_KEY = "a07e22bc18f5cb106bfe4cc1f83ad8ed" var session: URLSession init() { session = URLSession(configuration: .default, delegate: nil, delegateQueue: OperationQueue.main) } func nowPlayingMovies(completion: @escaping ([Movie]?, Error?) -> ()) { let url = URL(string: MovieApiManager.MOVIE_URL + MovieApiManager.API_KEY)! let request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData, timeoutInterval: 10) let task = session.dataTask(with: request) { (data, response, error) in // This will run when the network request returns if let data = data { let dataDictionary = try! JSONSerialization.jsonObject(with: data, options: []) as! [String: Any] let movieDictionaries = dataDictionary["results"] as! [[String: Any]] let movies = Movie.movies(dictionaries: movieDictionaries) completion(movies, nil) } else { completion(nil, error) } } task.resume() } }
[ -1 ]
66ea809633cab2883666d209384617a23aef73ba
461c9a09ac14e64585469bb826a9a4c1654e4a84
/WeatherAppMVVM/Application/AppDelegate.swift
ea84ddb7938963fd27d1bb2bc8877272d780bc77
[]
no_license
RamChandraNagalapelli/Swift_MVVM
c3b42cfcef018d21789bf70139e98c6a24604b79
46d9b239e03ab4b556a22cce6d2eda8e32767f7d
refs/heads/master
2021-04-29T13:16:30.744060
2018-02-19T04:31:27
2018-02-19T04:31:27
121,747,961
0
0
null
null
null
null
UTF-8
Swift
false
false
435
swift
// // AppDelegate.swift // WeatherAppMVC // // Created by ramchandra on 16/02/18. // Copyright © 2018 ramchandra. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { return true } }
[ 40928, 230114, 286252 ]
cfbcd338acac18984700dff65b79f6c6f2801865
35fc1b76badd6b42145db137c3e82689b904a2f0
/CollectionAdapter/Feed/FeedDataManager.swift
abc09276cf70bda5741d232c3ce7527cdae2d8c1
[]
no_license
siengnonta/CollectionAdapter
b87923ef3012e1d5fc28cc56c0ab9ed979e2cdec
ffa8d5766740c9014306fd6b37f8e8f48a415103
refs/heads/master
2022-11-12T22:52:13.693583
2020-06-29T04:25:48
2020-06-29T04:25:48
274,381,145
0
0
null
null
null
null
UTF-8
Swift
false
false
1,043
swift
// // FeedDataManager.swift // CollectionAdapter // // Created by Nontapat Siengsanor on 23/6/2563 BE. // Copyright © 2563 Nontapat Siengsanor. All rights reserved. // import Foundation //class FeedDataManager: DataManager<FeedModel> { // override init() { // super.init() // items = [ // FeedModel(username: "AAAA", userId: "123", title: "Lorem Ipsum is simply dummy text of the printing and typesetting industry"), // FeedModel(username: "BBBB", userId: "123", title: "Lorem Ipsum is simply dummy text of the printing and typesetting industry"), // FeedModel(username: "CCCC", userId: "123", title: "Lorem Ipsum is simply dummy text of the printing and typesetting industry"), // FeedModel(username: "DDDD", userId: "123", title: "Lorem Ipsum is simply dummy text of the printing and typesetting industry"), // FeedModel(username: "EEEE", userId: "123", title: "Lorem Ipsum is simply dummy text of the printing and typesetting industry") // ] // } //}
[ -1 ]
45fe091f45595025e60ff400f536e974ce405d9b
203bc34b8cf16c4ec1d355cd54f61b4990b98f58
/ZSCarouselView/Classes/SphereView/ZSSphereCarouselView+Layout.swift
a871efd848dc33f3088cb216d6ebbd3c9da7a9e2
[ "MIT" ]
permissive
zhangle520/ZSCarouselView
891c0056e3fd3297cd6e85900edda1550d67595e
a36946dc0a2c3a66078b4761c8dd3e03edd5b762
refs/heads/master
2023-08-21T21:19:24.892545
2021-09-27T08:53:00
2021-09-27T08:53:00
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,745
swift
// // ZSSphereCarouselView+Layout.swift // Pods-ZSViewUtil_Example // // Created by 张森 on 2020/3/13. // import Foundation extension ZSSphereCarouselView { /// 球体转动的布局 /// - Parameters: /// - angle: 转动的角度 /// - fromPoint: 从什么位置转动 /// - toPoint: 转动到什么位置 func rotateSphere(by angle: CGFloat, fromPoint: CGPoint, toPoint: CGPoint) { for (index, subView) in property.items.enumerated() { var itemPoint = property.itemPoints[index] let aroundpoint = PFPointMake(0, 0, 0) let coordinate = PFMatrixTransform3DMakeFromPFPoint(itemPoint) var transform = PFMatrixMakeIdentity(4, 4) let xAxisDirection = PFDirectionMakeXAxis(fromPoint, toPoint) let yAxisDirection = PFDirectionMakeYAxis(fromPoint, toPoint) if xAxisDirection != PFAxisDirectionNone { transform = PFMatrixMultiply(transform, PFMatrixTransform3DMakeYRotationOnPoint(aroundpoint, CGFloat(xAxisDirection.rawValue) * -angle)) } if yAxisDirection != PFAxisDirectionNone { transform = PFMatrixMultiply(transform, PFMatrixTransform3DMakeXRotationOnPoint(aroundpoint, CGFloat(yAxisDirection.rawValue) * angle)) } itemPoint = PFPointMakeFromMatrix(PFMatrixMultiply(coordinate, transform)) property.itemPoints[index] = itemPoint layout(subView, with: itemPoint) } } /// 对球体内部的item进行布局 /// - Parameters: /// - subView: item /// - point: 更新的位置 func layout(_ subView: UIView, with point: PFPoint) { let width = frame.width - subView.frame.width * 2 let height = frame.height - subView.frame.height * 2 let x = coordinate(for: point.x, withinRange: width) let y = coordinate(for: point.y, withinRange: height) let z = coordinate(for: point.z, withinRange: 1) subView.center = CGPoint(x: x + subView.frame.width, y: y + subView.frame.height) subView.transform = CGAffineTransform.identity.scaledBy(x: z, y: z) subView.layer.zPosition = z } /// 坐标转换 /// - Parameters: /// - normalizedValue: PFPointz的值 /// - offset: 范围的偏移量 func coordinate(for normalizedValue: CGFloat, withinRange offset: CGFloat) -> CGFloat { let half = offset * 0.5 let coordinate = abs(normalizedValue) * half return normalizedValue > 0 ? coordinate + half : half - coordinate } }
[ -1 ]
d18abc4501ae5c410454819ccbbfbe53d6cf8afb
a9c0edac10fb4516d012f7099e98ff344c3044c2
/Pods/SwiftNIO/Sources/NIO/IntegerTypes.swift
210f8946f38aa3d3937ccbce240b677cb6b22c07
[ "MIT", "Apache-2.0" ]
permissive
mbpolan/rapid-irc-client
271110086ab8ab158742fcb08b34a3d06089fc4a
fd4e2df4f3d206fb03106fb454c6334b3b62ef43
refs/heads/master
2023-03-16T15:01:31.279017
2021-03-11T03:01:18
2021-03-11T03:01:18
307,189,604
6
1
MIT
2021-02-15T23:15:52
2020-10-25T20:48:21
Swift
UTF-8
Swift
false
false
3,932
swift
//===----------------------------------------------------------------------===// // // This source file is part of the SwiftNIO open source project // // Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information // See CONTRIBUTORS.txt for the list of SwiftNIO project authors // // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// // MARK: _UInt24 /// A 24-bit unsigned integer value type. @usableFromInline struct _UInt24 { @usableFromInline typealias IntegerLiteralType = UInt16 @usableFromInline var b12: UInt16 @usableFromInline var b3: UInt8 @inlinable init(_b12 b12: UInt16, b3: UInt8) { self.b12 = b12 self.b3 = b3 } @inlinable init(integerLiteral value: UInt16) { self.init(_b12: value, b3: 0) } static let bitWidth: Int = 24 @inlinable static var max: _UInt24 { return .init(_b12: .max, b3: .max) } static let min: _UInt24 = .init(integerLiteral: 0) } extension UInt32 { @inlinable init(_ value: _UInt24) { var newValue: UInt32 = 0 newValue = UInt32(value.b12) newValue |= UInt32(value.b3) << 16 self = newValue } } extension Int { @inlinable init(_ value: _UInt24) { var newValue: Int = 0 newValue = Int(value.b12) newValue |= Int(value.b3) << 16 self = newValue } } extension _UInt24 { @inlinable init(_ value: UInt32) { assert(value & 0xff_00_00_00 == 0, "value \(value) too large for _UInt24") self.b12 = UInt16(truncatingIfNeeded: value & 0xff_ff) self.b3 = UInt8(value >> 16) } } extension _UInt24: Equatable { @inlinable public static func ==(lhs: _UInt24, rhs: _UInt24) -> Bool { return lhs.b3 == rhs.b3 && lhs.b12 == rhs.b12 } } extension _UInt24: CustomStringConvertible { @usableFromInline var description: String { return Int(self).description } } // MARK: _UInt56 /// A 56-bit unsigned integer value type. struct _UInt56 { typealias IntegerLiteralType = UInt32 @usableFromInline var b1234: UInt32 @usableFromInline var b56: UInt16 @usableFromInline var b7: UInt8 @inlinable init(_b1234: UInt32, b56: UInt16, b7: UInt8) { self.b1234 = _b1234 self.b56 = b56 self.b7 = b7 } @inlinable init(integerLiteral value: UInt32) { self.init(_b1234: value, b56: 0, b7: 0) } static let bitWidth: Int = 56 static var max: _UInt56 { return .init(_b1234: .max, b56: .max, b7: .max) } static let min: _UInt56 = .init(integerLiteral: 0) } extension _UInt56 { init(_ value: UInt64) { assert(value & 0xff_00_00_00_00_00_00_00 == 0, "value \(value) too large for _UInt56") self.init(_b1234: UInt32(truncatingIfNeeded: (value & 0xff_ff_ff_ff) >> 0 ), b56: UInt16(truncatingIfNeeded: (value & 0xff_ff_00_00_00_00) >> 32), b7: UInt8( value >> 48)) } init(_ value: Int) { self.init(UInt64(value)) } } extension UInt64 { init(_ value: _UInt56) { var newValue: UInt64 = 0 newValue = UInt64(value.b1234) newValue |= UInt64(value.b56 ) << 32 newValue |= UInt64(value.b7 ) << 48 self = newValue } } extension Int { init(_ value: _UInt56) { self = Int(UInt64(value)) } } extension _UInt56: Equatable { @inlinable public static func ==(lhs: _UInt56, rhs: _UInt56) -> Bool { return lhs.b1234 == rhs.b1234 && lhs.b56 == rhs.b56 && lhs.b7 == rhs.b7 } } extension _UInt56: CustomStringConvertible { var description: String { return UInt64(self).description } }
[ 314108, 347583 ]
9ac9a90121d444ba0fb7718d66683e34105bbe22
9db73d69e077293f41a43e1e9bf47c69e9f28855
/SwiftStudy0604/小视频/King_Welfare_View_Model.swift
cc59be6cb51f0f0c8ee4a33489dd29bf579ba5d8
[]
no_license
FlyingFishTwo/SwiftStudy0604
7afcabb3ad1525a8971bba717a135d9a44a35d68
73fe91a69124cfa002707c84e46db463690bf1a8
refs/heads/master
2022-02-12T08:01:32.841667
2019-08-17T13:38:46
2019-08-17T13:38:46
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,904
swift
// // King_Welfare_Model.swift // SwiftStudy0604 // // Created by wanglishuai on 2019/8/1. // Copyright © 2019 King. All rights reserved. // import Foundation import RxSwift import RxCocoa let disposeBag = DisposeBag() // distinctUntilChanged() 去掉重复的Event class King_Welfare_View_Model { ///存放解析完成的模型数组 let models = BehaviorRelay<[KingWelfare_Model]>(value: []) ///记录当前的索引值 var index:Int = 1 } extension King_Welfare_View_Model : KingViewModelType { typealias Input = king_Intput typealias Output = King_Output struct king_Intput { ///网络请求类型 let category : MyAPI.LXFNetworkCategory init(category:MyAPI.LXFNetworkCategory) { self.category = category } } struct King_Output { ///tableView 的sections数据类型 let sections : Driver<[KingSection]> ///外界通过该属性告诉viewModel加载数据(传入的值是为了标志是否重新加载) let requestCommond = PublishSubject<Bool>() /// 告诉外界的tableView当前的刷新状态 let refreshStatus = BehaviorRelay<KingRefreshStatus>(value: .none) init(sections:Driver<[KingSection]>) { self.sections = sections } } func transform(input: King_Welfare_View_Model.king_Intput) -> King_Welfare_View_Model.King_Output { let sections = models.asObservable().map { models -> [KingSection] in ///当models的值被改变时调用 return [KingSection(items: models)] }.asDriver(onErrorJustReturn: []) ///定义输出 let output = King_Output(sections: sections) /// 输出时订阅相关事件 刷新加载 output.requestCommond.subscribe(onNext: { [unowned self] isReloadData in self.index = isReloadData ? 1 : self.index + 1 ///请求数据 size 一次请求的个数 NetworkProvider.rx.request(.data(type: input.category, size: 20, index: self.index)) .asObservable() .mapArray(KingWelfare_Model.self) .subscribe({ [weak self] (event) in switch event { case let .next(modelArr): self?.models.accept(isReloadData ? modelArr : (self?.models.value ?? []) + modelArr) KingProgressHUD.showSuccess("加载成功") case let .error(error): KingProgressHUD.showError(error.localizedDescription) case .completed: output.refreshStatus.accept(isReloadData ? .endHeaderRefresh : .endFooterRefresh) } }).disposed(by: disposeBag) }).disposed(by: disposeBag) return output } }
[ -1 ]
827fdefaf573299f1ab515ad239dcd56af05373c
245f1b448b22716d7db8339ac9cc7c29e912b120
/Color FlashLight/SceneDelegate.swift
2b48a6095bb7d230d6b2ea6841dace93a7e701b9
[]
no_license
borzunovsm/ColorFlashLight
d3aa96b90867d04511376a04d60fd08ae6b94ed3
e38537344c43970b34d7cc93ff113133d992d419
refs/heads/main
2023-01-06T13:58:14.754728
2020-11-03T16:30:35
2020-11-03T16:30:35
299,946,603
0
0
null
null
null
null
UTF-8
Swift
false
false
2,295
swift
// // SceneDelegate.swift // Color FlashLight // // Created by Serega on 30.09.2020. // 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 necessarily 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, 393277, 376906, 327757, 254032, 368728, 180314, 254045, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 377047, 418008, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 385281, 336129, 262405, 180491, 336140, 164107, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 393613, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 164362, 328207, 410129, 393748, 262679, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 385610, 270922, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 336513, 377473, 385671, 148106, 213642, 377485, 352919, 98969, 344745, 361130, 336556, 385714, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 344777, 418508, 385743, 385749, 139998, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 328523, 336715, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 361361, 222129, 345036, 386004, 345046, 386012, 386019, 386023, 328690, 435188, 328703, 328710, 418822, 377867, 328715, 361490, 386070, 336922, 345119, 377888, 214060, 345134, 345139, 361525, 386102, 361537, 377931, 345172, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 386168, 361594, 410746, 214150, 345224, 386187, 345247, 361645, 345268, 402615, 361657, 337093, 402636, 328925, 165086, 66783, 165092, 328933, 222438, 328942, 386286, 386292, 206084, 328967, 345377, 345380, 353572, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337224, 337230, 337235, 263509, 353634, 337252, 402792, 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, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 337601, 403139, 337607, 419528, 419531, 272083, 394967, 419543, 419545, 345819, 419548, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 362274, 378664, 354107, 345916, 354112, 370504, 329545, 345932, 370510, 354132, 247639, 337751, 370520, 313181, 354143, 354157, 345965, 345968, 345971, 345975, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 346059, 247760, 346064, 346069, 419810, 329699, 354275, 190440, 354314, 346140, 436290, 395340, 378956, 436307, 338005, 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, 387314, 436474, 321787, 379135, 411905, 411917, 379154, 395539, 387350, 387353, 338201, 182559, 338212, 395567, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 321911, 420237, 379279, 272787, 354728, 338353, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 330225, 248309, 248332, 330254, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 191085, 338544, 346736, 191093, 346743, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 355029, 264919, 338661, 264942, 363252, 338680, 264965, 338701, 256787, 363294, 199455, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 355151, 330581, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 355185, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 265215, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 248915, 183384, 339037, 412765, 257121, 322660, 265321, 248952, 420985, 330886, 330890, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 322763, 330959, 330966, 265433, 265438, 388320, 363757, 388348, 339199, 396552, 175376, 175397, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 126279, 437576, 437584, 331089, 437588, 331094, 396634, 175451, 437596, 429408, 175458, 175461, 175464, 265581, 331124, 175478, 249210, 175484, 175487, 249215, 175491, 249219, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 380364, 339406, 372177, 339414, 249303, 413143, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 208399, 175637, 405017, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 224885, 224888, 224891, 224895, 372354, 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, 339664, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 397089, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 257869, 257872, 225105, 397140, 225109, 225113, 257881, 257884, 257887, 225120, 257891, 413539, 225128, 257897, 339818, 225138, 339827, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 372698, 372704, 372707, 356336, 380919, 393215, 372739, 405534, 266295, 266298, 217158, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 192640, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 225439, 135328, 192674, 225442, 438434, 225445, 438438, 225448, 438441, 356521, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 430275, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 356580, 225511, 217319, 225515, 225519, 381177, 397572, 389381, 381212, 356638, 356641, 356644, 356647, 266537, 389417, 356650, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 201030, 348489, 332107, 151884, 430422, 348503, 332118, 250201, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 332162, 389507, 348548, 356741, 250239, 332175, 160152, 373146, 340380, 373149, 70048, 356783, 373169, 266688, 324032, 201158, 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, 389724, 332381, 373344, 340580, 381546, 119432, 340628, 184983, 373399, 258723, 332455, 332460, 389806, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 348926, 389927, 348979, 152371, 348983, 340792, 398141, 357202, 389971, 357208, 389979, 430940, 357212, 357215, 439138, 201580, 201583, 349041, 340850, 381815, 430967, 324473, 398202, 119675, 340859, 324476, 430973, 324479, 340863, 324482, 373635, 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, 357411, 250915, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 431180, 209996, 341072, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 349313, 160896, 210053, 210056, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 210132, 333016, 210139, 210144, 218355, 218361, 275709, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 210261, 365912, 259423, 374113, 251236, 374118, 333164, 234867, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 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, 349762, 333396, 374359, 333400, 366173, 423529, 423533, 210547, 415354, 333440, 267910, 267929, 333512, 259789, 366301, 333535, 153311, 366308, 169703, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333595, 210720, 366384, 358192, 210740, 366388, 358201, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 268144, 358256, 358260, 341877, 399222, 325494, 333690, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 382898, 350153, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 219144, 268299, 333838, 350225, 186388, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 342113, 252021, 342134, 374904, 268435, 333998, 334012, 260299, 350411, 350417, 350423, 211161, 350426, 350449, 375027, 358645, 350459, 350462, 350465, 350469, 268553, 350477, 268560, 350481, 432406, 350487, 325915, 350491, 325918, 350494, 325920, 350500, 194854, 350505, 358701, 391469, 350510, 358705, 358714, 358717, 383307, 358738, 334162, 383331, 383334, 391531, 383342, 334204, 268669, 194942, 391564, 366991, 334224, 268702, 342431, 375209, 375220, 334263, 326087, 358857, 195041, 334312, 104940, 375279, 416255, 350724, 186898, 342546, 350740, 342551, 334359, 342555, 334364, 416294, 350762, 252463, 358962, 334386, 334397, 358973, 252483, 219719, 399957, 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, 326417, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 326463, 375616, 326468, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 433001, 400238, 326511, 211826, 211832, 392061, 351102, 359296, 252801, 260993, 351105, 400260, 211846, 342921, 342931, 252823, 400279, 392092, 400286, 252838, 359335, 211885, 252846, 400307, 351169, 359362, 351172, 170950, 187335, 326599, 359367, 359383, 359389, 383968, 343018, 359411, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 359471, 375868, 343132, 384099, 384102, 384108, 367724, 187503, 343155, 384115, 212095, 351366, 384136, 384140, 384144, 351382, 384152, 384158, 384161, 351399, 384169, 367795, 384182, 367801, 384189, 384192, 351424, 343232, 367817, 244938, 384202, 253132, 326858, 384209, 146644, 351450, 384225, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 359695, 261391, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 376111, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 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, 359887, 359891, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 253445, 359948, 359951, 245295, 359984, 343610, 400977, 400982, 179803, 245358, 155255, 155274, 368289, 245410, 425639, 425652, 425663, 155328, 245463, 155352, 155356, 212700, 155364, 245477, 155372, 245487, 212723, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 384831, 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, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 155647 ]
f4137ef7afed86c1a59739856f1de22649d21eed
114d22b6ac9775435c9f3a024a775adce61ef94d
/Meme/CustomMemeCell.swift
f1a2432a108c2808ce415d94cf51c9efd66ad201
[]
no_license
noahfaust/MemeMe
3f48695f7d382263df3f6bd9104f587621891ae5
8f6437c56fd51a3d09d0e13af4a42cbb6412e418
refs/heads/master
2021-01-10T06:23:36.460890
2015-11-12T07:22:35
2015-11-12T07:22:35
45,956,678
0
0
null
null
null
null
UTF-8
Swift
false
false
317
swift
// // CustomMemeCell.swift // Meme // // Created by Alexandre Gonzalo on 10/11/2015. // Copyright © 2015 Agito Cloud. All rights reserved. // import Foundation import UIKit class CustomMemeCell: UICollectionViewCell { @IBOutlet weak var topText: UILabel! @IBOutlet weak var bottomText: UILabel! }
[ -1 ]
e6e974a7eab88e9a7bc60ea3a5c2801462001552
ff4808bc6042e36577681ba7a3c78e8002bfa22b
/bucketlist3/AppDelegate.swift
916c7a24550e9a770508f91f1d10a5e25cc4ca64
[]
no_license
kayotea/swift-bucketListBackend
56e20d3aa8737a7e4c7266f9f00f723b841324ac
74db87c0e8a85fa389a390bc3f14813f63dc634c
refs/heads/master
2021-06-19T03:41:52.679910
2017-07-19T01:04:17
2017-07-19T01:04:17
null
0
0
null
null
null
null
UTF-8
Swift
false
false
4,498
swift
// // AppDelegate.swift // bucketlist3 // // Created by Placoderm on 7/10/17. // Copyright © 2017 Placoderm. 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 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:. self.saveContext() // ADD THIS LINE } //added: // MARK: - Core Data stack 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: "BucketList") 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)") } } } }
[ 243717, 294405, 163848, 313353, 320008, 320014, 313360, 288275, 289300, 322580, 290326, 329747, 139803, 322080, 306721, 296483, 229411, 322083, 306726, 309287, 308266, 292907, 322092, 217132, 40495, 316465, 288306, 322102, 324663, 164408, 308281, 322109, 286783, 313409, 315457, 313413, 320582, 349765, 309832, 288329, 215117, 196177, 241746, 344661, 231000, 212571, 300124, 287323, 309342, 325220, 306790, 311914, 296043, 322666, 307310, 334446, 292466, 314995, 307315, 314487, 291450, 314491, 318599, 312970, 311444, 294038, 311449, 300194, 233638, 298662, 233644, 313005, 286896, 300208, 286389, 294070, 125111, 234677, 309439, 284352, 296641, 235200, 242371, 302787, 284360, 321228, 319181, 298709, 189654, 284374, 182486, 320730, 241371, 311516, 357083, 179420, 317665, 298210, 311525, 288489, 229098, 290025, 307436, 304365, 323310, 125167, 286455, 306424, 322299, 319228, 302332, 319231, 184576, 309505, 241410, 311043, 366339, 309509, 318728, 254217, 125194, 234763, 321806, 125201, 296218, 313116, 326434, 237858, 295716, 313125, 300836, 289577, 125226, 133421, 317233, 241971, 316726, 318264, 201530, 313660, 159549, 287038, 218943, 182079, 292159, 288578, 301893, 234828, 292172, 300882, 321364, 243032, 201051, 230748, 298844, 294238, 258397, 199020, 293741, 319342, 316788, 313205, 244598, 292212, 124796, 196988, 317821, 313215, 305022, 314241, 303999, 242050, 325509, 293767, 316300, 306576, 322448, 308114, 319900, 298910, 313250, 308132, 316327, 306605, 316334, 324015, 324017, 316339, 300979, 296888, 67000, 316345, 300987, 319932, 310718, 292288, 317888, 312772, 298950, 306632, 310733, 289744, 310740, 235994, 286174, 315359, 240098, 323555, 236008, 319465, 248299, 311789, 326640, 203761, 320498, 314357, 288246, 309243, 300540, 310782 ]
73035e8690c7e0a148703d179b19f20b5e562cfc
272dab9705288f8f2388af166a9d2978ee81893a
/Tests/BitterTests/BitterTests.swift
09c67a64fff7435f8c66e0df5130998c596fb62c
[ "MIT" ]
permissive
ekscrypto/Bitter
0919348bca5251af280596aa994ca9e82110ab3e
a603b667b045b3ce926a7c2f03726d48a4a6cea4
refs/heads/master
2021-01-21T21:06:38.823714
2017-06-19T13:33:40
2017-06-19T13:33:40
94,758,286
0
0
null
2017-06-19T09:12:38
2017-06-19T09:12:38
null
UTF-8
Swift
false
false
19,482
swift
// // BitterTests.swift // BitterTests // // Created by Umberto Raimondi on 31/01/16. // Copyright © 2016 Umberto Raimondi. All rights reserved. // import XCTest @testable import Bitter class BitterTests: 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() } // MARK: UInt64 Tests let iUInt64:UInt64 = (UInt.size==8) ? 0xFFAAFFAAFFAAFFAA : 0xFFAAFFAA func testUInt64Conversion() { XCTAssert(iUInt64.toUInt == UInt(truncatingBitPattern:iUInt64)) XCTAssert(iUInt64.toInt.toUInt == UInt(truncatingBitPattern:iUInt64)) XCTAssert(iUInt64.toU64 == iUInt64) XCTAssert(iUInt64.to64.toU64 == iUInt64) XCTAssert(iUInt64.toU32==0xFFAAFFAA) XCTAssert(iUInt64.to32.toU32==0xFFAAFFAA) XCTAssert(iUInt64.toU16==0xFFAA) XCTAssert(iUInt64.to16.toU16==0xFFAA) XCTAssert(iUInt64.toU8==0xAA) XCTAssert(iUInt64.to8.toU8==0xAA) } let aUInt64:UInt64=0x1122334455667788 func testUInt64SubscriptGet(){ XCTAssertEqual(aUInt64[0], 0x88) XCTAssertEqual(aUInt64[1], 0x77) XCTAssertEqual(aUInt64[2], 0x66) XCTAssertEqual(aUInt64[3], 0x55) XCTAssertEqual(aUInt64[4], 0x44) XCTAssertEqual(aUInt64[5], 0x33) XCTAssertEqual(aUInt64[6], 0x22) XCTAssertEqual(aUInt64[7], 0x11) } var asUInt64:UInt64=0x1122334455667788 func testUInt64SubscriptSet(){ asUInt64[0]=0xAA;asUInt64[1]=0xAA;asUInt64[2]=0xAA; asUInt64[3]=0xAA;asUInt64[4]=0xAA;asUInt64[5]=0xAA; asUInt64[6]=0xAA;asUInt64[7]=0xAA; XCTAssertEqual(asUInt64[0], 0xAA) XCTAssertEqual(asUInt64[1], 0xAA) XCTAssertEqual(asUInt64[2], 0xAA) XCTAssertEqual(asUInt64[3], 0xAA) XCTAssertEqual(asUInt64[4], 0xAA) XCTAssertEqual(asUInt64[5], 0xAA) XCTAssertEqual(asUInt64[6], 0xAA) XCTAssertEqual(asUInt64[7], 0xAA) } var bsUInt64:UInt64=0x1122334455660088 func testUInt64BitSetGet(){ XCTAssertEqual(bsUInt64[1], 0x00) bsUInt64[1] = bsUInt64[1].setb0(1) XCTAssertEqual(bsUInt64[1].b0, 1) XCTAssertEqual(bsUInt64[1], 0x01) bsUInt64[1] = bsUInt64[1].setb1(1) XCTAssertEqual(bsUInt64[1].b1, 1) XCTAssertEqual(bsUInt64[1], 0x03) bsUInt64[1] = bsUInt64[1].setb2(1) XCTAssertEqual(bsUInt64[1].b2, 1) XCTAssertEqual(bsUInt64[1], 0x07) bsUInt64[1] = bsUInt64[1].setb3(1) XCTAssertEqual(bsUInt64[1].b3, 1) XCTAssertEqual(bsUInt64[1], 0x0F) bsUInt64[1] = bsUInt64[1].setb4(1) XCTAssertEqual(bsUInt64[1].b4, 1) XCTAssertEqual(bsUInt64[1], 0x1F) bsUInt64[1] = bsUInt64[1].setb5(1) XCTAssertEqual(bsUInt64[1].b5, 1) XCTAssertEqual(bsUInt64[1], 0x3F) bsUInt64[1] = bsUInt64[1].setb6(1) XCTAssertEqual(bsUInt64[1].b6, 1) XCTAssertEqual(bsUInt64[1], 0x7F) bsUInt64[1] = bsUInt64[1].setb7(1) XCTAssertEqual(bsUInt64[1].b7, 1) XCTAssertEqual(bsUInt64[1], 0xFF) XCTAssertEqual(bsUInt64, 0x112233445566FF88) bsUInt64[1] = bsUInt64[1].setb7(0).setb6(0).setb5(0).setb4(0).setb3(0).setb2(0).setb1(0).setb0(0) XCTAssertEqual(bsUInt64, 0x1122334455660088) } // MARK: Int64 Tests let iInt64:Int64 = (Int.size==8) ? 0x6FAAFFAAFFAAFFAA : 0xFFAAFFAA func testInt64Conversion() { XCTAssert(iInt64.toUInt==UInt(truncatingBitPattern:iInt64)) XCTAssert(iInt64.toInt.toUInt==UInt(truncatingBitPattern:iInt64)) XCTAssert(iInt64.toU64==UInt64(bitPattern:iInt64)) XCTAssert(iInt64.to64.toU64==UInt64(bitPattern:iInt64)) XCTAssert(iInt64.toU32==0xFFAAFFAA) XCTAssert(iInt64.to32.toU32==0xFFAAFFAA) XCTAssert(iInt64.toU16==0xFFAA) XCTAssert(iInt64.to16.toU16==0xFFAA) XCTAssert(iInt64.toU8==0xAA) XCTAssert(iInt64.to8.toU8==0xAA) } let aInt64:Int64=0x1122334455667788 func testInt64SubscriptGet(){ XCTAssertEqual(aInt64[0], 0x88) XCTAssertEqual(aInt64[1], 0x77) XCTAssertEqual(aInt64[2], 0x66) XCTAssertEqual(aInt64[3], 0x55) XCTAssertEqual(aInt64[4], 0x44) XCTAssertEqual(aInt64[5], 0x33) XCTAssertEqual(aInt64[6], 0x22) XCTAssertEqual(aInt64[7], 0x11) } var asInt64:Int64=0x1122334455667788 func testInt64SubscriptSet(){ asInt64[0]=0xAA;asInt64[1]=0xAA;asInt64[2]=0xAA; asInt64[3]=0xAA;asInt64[4]=0xAA;asInt64[5]=0xAA; asInt64[6]=0xAA;asInt64[7]=0xAA; XCTAssertEqual(asInt64[0], 0xAA) XCTAssertEqual(asInt64[1], 0xAA) XCTAssertEqual(asInt64[2], 0xAA) XCTAssertEqual(asInt64[3], 0xAA) XCTAssertEqual(asInt64[4], 0xAA) XCTAssertEqual(asInt64[5], 0xAA) XCTAssertEqual(asInt64[6], 0xAA) XCTAssertEqual(asInt64[7], 0xAA) } var bsInt64:Int64=0x1122334455660088 func testInt64BitSetGet(){ XCTAssertEqual(bsInt64[1], 0x00) bsInt64[1] = bsInt64[1].setb0(1) XCTAssertEqual(bsInt64[1].b0, 1) XCTAssertEqual(bsInt64[1], 0x01) bsInt64[1] = bsInt64[1].setb1(1) XCTAssertEqual(bsInt64[1].b1, 1) XCTAssertEqual(bsInt64[1], 0x03) bsInt64[1] = bsInt64[1].setb2(1) XCTAssertEqual(bsInt64[1].b2, 1) XCTAssertEqual(bsInt64[1], 0x07) bsInt64[1] = bsInt64[1].setb3(1) XCTAssertEqual(bsInt64[1].b3, 1) XCTAssertEqual(bsInt64[1], 0x0F) bsInt64[1] = bsInt64[1].setb4(1) XCTAssertEqual(bsInt64[1].b4, 1) XCTAssertEqual(bsInt64[1], 0x1F) bsInt64[1] = bsInt64[1].setb5(1) XCTAssertEqual(bsInt64[1].b5, 1) XCTAssertEqual(bsInt64[1], 0x3F) bsInt64[1] = bsInt64[1].setb6(1) XCTAssertEqual(bsInt64[1].b6, 1) XCTAssertEqual(bsInt64[1], 0x7F) bsInt64[1] = bsInt64[1].setb7(1) XCTAssertEqual(bsInt64[1].b7, 1) XCTAssertEqual(bsInt64[1], 0xFF) XCTAssertEqual(bsInt64, 0x112233445566FF88) bsInt64[1] = bsInt64[1].setb7(0).setb6(0).setb5(0).setb4(0).setb3(0).setb2(0).setb1(0).setb0(0) XCTAssertEqual(bsInt64, 0x1122334455660088) } // MARK: UInt32 Tests let iUInt32:UInt32=0xFFAAFFAA func testUInt32Conversion() { XCTAssert(iUInt32.toUInt==0xFFAAFFAA) XCTAssert(iUInt32.toInt.toUInt==0xFFAAFFAA) XCTAssert(iUInt32.toU64==0xFFAAFFAA) XCTAssert(iUInt32.to64.toU64==0xFFAAFFAA) XCTAssert(iUInt32.toU32==0xFFAAFFAA) XCTAssert(iUInt32.to32.toU32==0xFFAAFFAA) XCTAssert(iUInt32.toU16==0xFFAA) XCTAssert(iUInt32.to16.toU16==0xFFAA) XCTAssert(iUInt32.toU8==0xAA) XCTAssert(iUInt32.to8.toU8==0xAA) } let aUInt32:UInt32=0x11667788 func testUInt32SubscriptGet(){ XCTAssertEqual(aUInt32[0], 0x88) XCTAssertEqual(aUInt32[1], 0x77) XCTAssertEqual(aUInt32[2], 0x66) XCTAssertEqual(aUInt32[3], 0x11) } var asUInt32:UInt32=0x11667788 func testUInt32SubscriptSet(){ asUInt32[0]=0xAA;asUInt32[1]=0xAA;asUInt32[2]=0xAA; asUInt32[3]=0xAA XCTAssertEqual(asUInt32[0], 0xAA) XCTAssertEqual(asUInt32[1], 0xAA) XCTAssertEqual(asUInt32[2], 0xAA) XCTAssertEqual(asUInt32[3], 0xAA) } var bsUInt32:UInt32=0x11220044 func testUInt32BitSetGet(){ XCTAssertEqual(bsUInt32[1], 0x00) bsUInt32[1] = bsUInt32[1].setb0(1) XCTAssertEqual(bsUInt32[1].b0, 1) XCTAssertEqual(bsUInt32[1], 0x01) bsUInt32[1] = bsUInt32[1].setb1(1) XCTAssertEqual(bsUInt32[1].b1, 1) XCTAssertEqual(bsUInt32[1], 0x03) bsUInt32[1] = bsUInt32[1].setb2(1) XCTAssertEqual(bsUInt32[1].b2, 1) XCTAssertEqual(bsUInt32[1], 0x07) bsUInt32[1] = bsUInt32[1].setb3(1) XCTAssertEqual(bsUInt32[1].b3, 1) XCTAssertEqual(bsUInt32[1], 0x0F) bsUInt32[1] = bsUInt32[1].setb4(1) XCTAssertEqual(bsUInt32[1].b4, 1) XCTAssertEqual(bsUInt32[1], 0x1F) bsUInt32[1] = bsUInt32[1].setb5(1) XCTAssertEqual(bsUInt32[1].b5, 1) XCTAssertEqual(bsUInt32[1], 0x3F) bsUInt32[1] = bsUInt32[1].setb6(1) XCTAssertEqual(bsUInt32[1].b6, 1) XCTAssertEqual(bsUInt32[1], 0x7F) bsUInt32[1] = bsUInt32[1].setb7(1) XCTAssertEqual(bsUInt32[1].b7, 1) XCTAssertEqual(bsUInt32[1], 0xFF) XCTAssertEqual(bsUInt32, 0x1122FF44) bsUInt32[1] = bsUInt32[1].setb7(0).setb6(0).setb5(0).setb4(0).setb3(0).setb2(0).setb1(0).setb0(0) XCTAssertEqual(bsUInt32, 0x11220044) } // MARK: Int32 Tests let iInt32:Int32=0x6FAAFFAA func testInt32Conversion() { XCTAssert(iInt32.toUInt==0x6FAAFFAA) XCTAssert(iInt32.toInt.toUInt==0x6FAAFFAA) XCTAssert(iInt32.toU64==0x6FAAFFAA) XCTAssert(iInt32.to64.toU64==0x6FAAFFAA) XCTAssert(iInt32.toU32==0x6FAAFFAA) XCTAssert(iInt32.to32.toU32==0x6FAAFFAA) XCTAssert(iInt32.toU16==0xFFAA) XCTAssert(iInt32.to16.toU16==0xFFAA) XCTAssert(iInt32.toU8==0xAA) XCTAssert(iInt32.to8.toU8==0xAA) } let aInt32:Int32=0x11667788 func testInt32SubscriptGet(){ XCTAssertEqual(aInt32[0], 0x88) XCTAssertEqual(aInt32[1], 0x77) XCTAssertEqual(aInt32[2], 0x66) XCTAssertEqual(aInt32[3], 0x11) } var asInt32:Int32=0x11667788 func testInt32SubscriptSet(){ asInt32[0]=0xAA;asInt32[1]=0xAA;asInt32[2]=0xAA; asInt32[3]=0xAA XCTAssertEqual(asInt32[0], 0xAA) XCTAssertEqual(asInt32[1], 0xAA) XCTAssertEqual(asInt32[2], 0xAA) XCTAssertEqual(asInt32[3], 0xAA) } var bsInt32:UInt32=0x11220044 func testInt32BitSetGet(){ XCTAssertEqual(bsInt32[1], 0x00) bsInt32[1] = bsInt32[1].setb0(1) XCTAssertEqual(bsInt32[1].b0, 1) XCTAssertEqual(bsInt32[1], 0x01) bsInt32[1] = bsInt32[1].setb1(1) XCTAssertEqual(bsInt32[1].b1, 1) XCTAssertEqual(bsInt32[1], 0x03) bsInt32[1] = bsInt32[1].setb2(1) XCTAssertEqual(bsInt32[1].b2, 1) XCTAssertEqual(bsInt32[1], 0x07) bsInt32[1] = bsInt32[1].setb3(1) XCTAssertEqual(bsInt32[1].b3, 1) XCTAssertEqual(bsInt32[1], 0x0F) bsInt32[1] = bsInt32[1].setb4(1) XCTAssertEqual(bsInt32[1].b4, 1) XCTAssertEqual(bsInt32[1], 0x1F) bsInt32[1] = bsInt32[1].setb5(1) XCTAssertEqual(bsInt32[1].b5, 1) XCTAssertEqual(bsInt32[1], 0x3F) bsInt32[1] = bsInt32[1].setb6(1) XCTAssertEqual(bsInt32[1].b6, 1) XCTAssertEqual(bsInt32[1], 0x7F) bsInt32[1] = bsInt32[1].setb7(1) XCTAssertEqual(bsInt32[1].b7, 1) XCTAssertEqual(bsInt32[1], 0xFF) XCTAssertEqual(bsInt32, 0x1122FF44) bsInt32[1] = bsInt32[1].setb7(0).setb6(0).setb5(0).setb4(0).setb3(0).setb2(0).setb1(0).setb0(0) XCTAssertEqual(bsInt32, 0x11220044) } // MARK: UInt16 Tests let iUInt16:UInt16=0x6FAA func testUInt16Conversion() { XCTAssert(iUInt16.toUInt==0x6FAA) XCTAssert(iUInt16.toInt.toUInt==0x6FAA) XCTAssert(iUInt16.toU64==0x6FAA) XCTAssert(iUInt16.to64.toU64==0x6FAA) XCTAssert(iUInt16.toU32==0x6FAA) XCTAssert(iUInt16.to32.toU32==0x6FAA) XCTAssert(iUInt16.toU16==0x6FAA) XCTAssert(iUInt16.to16.toU16==0x6FAA) XCTAssert(iUInt16.toU8==0xAA) XCTAssert(iUInt16.to8.toU8==0xAA) } let aUInt16:UInt16=0x1188 func testUInt16SubscriptGet(){ XCTAssertEqual(aUInt16[0], 0x88) XCTAssertEqual(aUInt16[1], 0x11) } var asUInt16:UInt16=0x1188 func testUInt16SubscriptSet(){ asUInt16[0]=0xAA;asUInt16[1]=0xAA XCTAssertEqual(asUInt16[0], 0xAA) XCTAssertEqual(asUInt16[1], 0xAA) } var bsUInt16:UInt16=0x0022 func testUInt16BitSetGet(){ XCTAssertEqual(bsUInt16[1], 0x00) bsUInt16[1] = bsUInt16[1].setb0(1) XCTAssertEqual(bsUInt16[1].b0, 1) XCTAssertEqual(bsUInt16[1], 0x01) bsUInt16[1] = bsUInt16[1].setb1(1) XCTAssertEqual(bsUInt16[1].b1, 1) XCTAssertEqual(bsUInt16[1], 0x03) bsUInt16[1] = bsUInt16[1].setb2(1) XCTAssertEqual(bsUInt16[1].b2, 1) XCTAssertEqual(bsUInt16[1], 0x07) bsUInt16[1] = bsUInt16[1].setb3(1) XCTAssertEqual(bsUInt16[1].b3, 1) XCTAssertEqual(bsUInt16[1], 0x0F) bsUInt16[1] = bsUInt16[1].setb4(1) XCTAssertEqual(bsUInt16[1].b4, 1) XCTAssertEqual(bsUInt16[1], 0x1F) bsUInt16[1] = bsUInt16[1].setb5(1) XCTAssertEqual(bsUInt16[1].b5, 1) XCTAssertEqual(bsUInt16[1], 0x3F) bsUInt16[1] = bsUInt16[1].setb6(1) XCTAssertEqual(bsUInt16[1].b6, 1) XCTAssertEqual(bsUInt16[1], 0x7F) bsUInt16[1] = bsUInt16[1].setb7(1) XCTAssertEqual(bsUInt16[1].b7, 1) XCTAssertEqual(bsUInt16[1], 0xFF) XCTAssertEqual(bsUInt16, 0xFF22) bsUInt16[1] = bsUInt16[1].setb7(0).setb6(0).setb5(0).setb4(0).setb3(0).setb2(0).setb1(0).setb0(0) XCTAssertEqual(bsUInt16, 0x0022) } // MARK: Int16 Tests let iInt16:Int16=0x6FAA func testInt16Conversion() { XCTAssert(iInt16.toUInt==0x6FAA) XCTAssert(iInt16.toInt.toUInt==0x6FAA) XCTAssert(iInt16.toU64==0x6FAA) XCTAssert(iInt16.to64.toU64==0x6FAA) XCTAssert(iInt16.toU32==0x6FAA) XCTAssert(iInt16.to32.toU32==0x6FAA) XCTAssert(iInt16.toU16==0x6FAA) XCTAssert(iInt16.to16.toU16==0x6FAA) XCTAssert(iInt16.toU8==0xAA) XCTAssert(iInt16.to8.toU8==0xAA) } let aInt16:Int16=0x1188 func testInt16SubscriptGet(){ XCTAssertEqual(aInt16[0], 0x88) XCTAssertEqual(aInt16[1], 0x11) } var asInt16:Int16=0x1188 func testInt16SubscriptSet(){ asInt16[0]=0xAA;asInt16[1]=0xAA XCTAssertEqual(asInt16[0], 0xAA) XCTAssertEqual(asInt16[1], 0xAA) } var bsInt16:Int16=0x0022 func testInt16BitSetGet(){ XCTAssertEqual(bsInt16[1], 0x00) bsInt16[1] = bsInt16[1].setb0(1) XCTAssertEqual(bsInt16[1].b0, 1) XCTAssertEqual(bsInt16[1], 0x01) bsInt16[1] = bsInt16[1].setb1(1) XCTAssertEqual(bsInt16[1].b1, 1) XCTAssertEqual(bsInt16[1], 0x03) bsInt16[1] = bsInt16[1].setb2(1) XCTAssertEqual(bsInt16[1].b2, 1) XCTAssertEqual(bsInt16[1], 0x07) bsInt16[1] = bsInt16[1].setb3(1) XCTAssertEqual(bsInt16[1].b3, 1) XCTAssertEqual(bsInt16[1], 0x0F) bsInt16[1] = bsInt16[1].setb4(1) XCTAssertEqual(bsInt16[1].b4, 1) XCTAssertEqual(bsInt16[1], 0x1F) bsInt16[1] = bsInt16[1].setb5(1) XCTAssertEqual(bsInt16[1].b5, 1) XCTAssertEqual(bsInt16[1], 0x3F) bsInt16[1] = bsInt16[1].setb6(1) XCTAssertEqual(bsInt16[1].b6, 1) XCTAssertEqual(bsInt16[1], 0x7F) bsInt16[1] = bsInt16[1].setb7(1) XCTAssertEqual(bsInt16[1].b7, 1) XCTAssertEqual(bsInt16[1], 0xFF) XCTAssertEqual(bsInt16, -222) bsInt16[1] = bsInt16[1].setb7(0).setb6(0).setb5(0).setb4(0).setb3(0).setb2(0).setb1(0).setb0(0) XCTAssertEqual(bsInt16, 0x0022) } // MARK: UInt8 Tests let iUInt8:UInt8=0x66 func testUInt8Conversion() { XCTAssert(iUInt8.toUInt==0x66) XCTAssert(iUInt8.toInt.toUInt==0x66) XCTAssert(iUInt8.toU64==0x66) XCTAssert(iUInt8.to64.toU64==0x66) XCTAssert(iUInt8.toU32==0x66) XCTAssert(iUInt8.to32.toU32==0x66) XCTAssert(iUInt8.toU16==0x66) XCTAssert(iUInt8.to16.toU16==0x66) XCTAssert(iUInt8.toU8==0x66) XCTAssert(iUInt8.to8.toU8==0x66) } let aUInt8:UInt8=0x66 func testUInt8SubscriptGet(){ XCTAssertEqual(aUInt8[0], 0x66) } var asUInt8:UInt8=0x66 func testUInt8SubscriptSet(){ asUInt8[0]=0xAA XCTAssertEqual(asUInt8[0], 0xAA) } var bsUInt8:UInt8=0x00 func testUInt8BitSetGet(){ XCTAssertEqual(bsUInt8[0], 0x00) bsUInt8 = bsUInt8.setb0(1) XCTAssertEqual(bsUInt8.b0, 1) XCTAssertEqual(bsUInt8[0], 0x01) bsUInt8 = bsUInt8.setb1(1) XCTAssertEqual(bsUInt8.b1, 1) XCTAssertEqual(bsUInt8[0], 0x03) bsUInt8 = bsUInt8.setb2(1) XCTAssertEqual(bsUInt8.b2, 1) XCTAssertEqual(bsUInt8[0], 0x07) bsUInt8 = bsUInt8.setb3(1) XCTAssertEqual(bsUInt8.b3, 1) XCTAssertEqual(bsUInt8[0], 0x0F) bsUInt8 = bsUInt8.setb4(1) XCTAssertEqual(bsUInt8.b4, 1) XCTAssertEqual(bsUInt8[0], 0x1F) bsUInt8 = bsUInt8.setb5(1) XCTAssertEqual(bsUInt8.b5, 1) XCTAssertEqual(bsUInt8[0], 0x3F) bsUInt8 = bsUInt8.setb6(1) XCTAssertEqual(bsUInt8.b6, 1) XCTAssertEqual(bsUInt8[0], 0x7F) bsUInt8 = bsUInt8.setb7(1) XCTAssertEqual(bsUInt8.b7, 1) XCTAssertEqual(bsUInt8[0], 0xFF) XCTAssertEqual(bsUInt8, 0xFF) bsUInt8 = bsUInt8.setb7(0).setb6(0).setb5(0).setb4(0).setb3(0).setb2(0).setb1(0).setb0(0) XCTAssertEqual(bsUInt8, 0x00) } // MARK: Int8 Tests let iInt8:Int8=0x66 func testInt8Conversion() { XCTAssert(iInt8.toUInt==0x66) XCTAssert(iInt8.toInt.toUInt==0x66) XCTAssert(iInt8.toU64==0x66) XCTAssert(iInt8.to64.toU64==0x66) XCTAssert(iInt8.toU32==0x66) XCTAssert(iInt8.to32.toU32==0x66) XCTAssert(iInt8.toU16==0x66) XCTAssert(iInt8.to16.toU16==0x66) XCTAssert(iInt8.toU8==0x66) XCTAssert(iInt8.to8.toU8==0x66) } let aInt8:Int8=0x66 func testInt8SubscriptGet(){ XCTAssertEqual(aInt8[0], 0x66) } var asInt8:Int8=0x66 func testInt8SubscriptSet(){ asInt8[0]=0x1A XCTAssertEqual(asInt8[0], 0x1A) } var bsInt8:Int8=0x00 func testInt8BitSetGet(){ XCTAssertEqual(bsInt8[0], 0x00) bsInt8 = bsInt8.setb0(1) XCTAssertEqual(bsInt8.b0, 1) XCTAssertEqual(bsInt8[0], 0x01) bsInt8 = bsInt8.setb1(1) XCTAssertEqual(bsInt8.b1, 1) XCTAssertEqual(bsInt8[0], 0x03) bsInt8 = bsInt8.setb2(1) XCTAssertEqual(bsInt8.b2, 1) XCTAssertEqual(bsInt8[0], 0x07) bsInt8 = bsInt8.setb3(1) XCTAssertEqual(bsInt8.b3, 1) XCTAssertEqual(bsInt8[0], 0x0F) bsInt8 = bsInt8.setb4(1) XCTAssertEqual(bsInt8.b4, 1) XCTAssertEqual(bsInt8[0], 0x1F) bsInt8 = bsInt8.setb5(1) XCTAssertEqual(bsInt8.b5, 1) XCTAssertEqual(bsInt8[0], 0x3F) bsInt8 = bsInt8.setb6(1) XCTAssertEqual(bsInt8.b6, 1) XCTAssertEqual(bsInt8[0], 0x7F) bsInt8 = bsInt8.setb7(1) XCTAssertEqual(bsInt8.b7, 1) XCTAssertEqual(bsInt8[0], -0x1) XCTAssertEqual(bsInt8, -0x1) bsInt8 = bsInt8.setb7(0).setb6(0).setb5(0).setb4(0).setb3(0).setb2(0).setb1(0).setb0(0) XCTAssertEqual(bsInt8, 0x00) } }
[ -1 ]
9aa93f2f9272feb414993b68ea405ef6e1ac2f59
186fc83d1c93d5826556e9e35a8d0676ece3cb87
/RCG-RCCL/Additional View Controllers/PrizesTableViewController.swift
81787120d71e3afc778baabcde0cc55c531b29f8
[]
no_license
dovrosenberg62/rcg-rccl
658c6ec239033fd127692b046ef0c8abb6fc7b67
3a7098c91c3fbe80b7317c9c82b975ce5074a704
refs/heads/master
2021-01-22T07:52:21.228666
2017-09-29T13:30:02
2017-09-29T13:30:02
102,317,188
0
0
null
null
null
null
UTF-8
Swift
false
false
3,540
swift
// // PrizesTableViewController.swift // RCG-RCCL // // Created by Dov Rosenberg on 9/27/17. // Copyright © 2017 Apple. All rights reserved. // import UIKit // MARK: - PrizesTableViewControllerDelegate /*protocol PrizesTableViewControllerDelegate: class { func prizesTableViewController(_: PrizesTableViewController, didSelectObjectAt index: Int) func prizesTableViewController(_: PrizesTableViewController, didDeselectObjectAt index: Int) } */ class PrizesTableViewController: UITableViewController { var prizes = [PrizeDefinition]() // weak var delegate: PrizesTableViewControllerDelegate? override func viewDidLoad() { super.viewDidLoad() // Uncomment the following line to preserve selection between presentations // self.clearsSelectionOnViewWillAppear = false // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // MARK: - Table view data source override func numberOfSections(in tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections return 0 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return 0 } /* override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath) // Configure the cell... return cell } */ /* // Override to support conditional editing of the table view. override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { // Return false if you do not want the specified item to be editable. return true } */ /* // Override to support editing the table view. override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == .delete { // Delete the row from the data source tableView.deleteRows(at: [indexPath], with: .fade) } else if editingStyle == .insert { // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view } } */ /* // Override to support rearranging the table view. override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { } */ /* // Override to support conditional rearranging of the table view. override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { // Return false if you do not want the item to be re-orderable. return true } */ /* // 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. } */ }
[ 294401, 295784, 302924, 292141, 312591, 249775, 290159, 180690, 290163, 290162, 290164, 303542, 290165, 290168, 336157, 294525, 290167 ]
619f6d1bd2e903464c966dcb42afb7291d47ba3d
621a6bb4d4ef0afdca7a66fdeab6986d32d8f713
/ThingsToDo/View/HomeTableViewCell.swift
03c886acb0b543e763a7d2580d54abff88d912c0
[]
no_license
Gurungboi/ThingsToDo
8ef8793b1ee12b1d3cf686b94f1ff1b234f014b0
09d57aa20fdfb4dc551ef67e5dabb36405f4384b
refs/heads/master
2020-06-13T19:22:43.936075
2019-07-02T01:27:14
2019-07-02T01:27:14
194,765,040
1
0
null
null
null
null
UTF-8
Swift
false
false
580
swift
// // HomeTableViewCell.swift // ThingsToDo // // Created by Sunil Gurung on 23/6/19. // Copyright © 2019 Sunil Gurung. All rights reserved. // import UIKit class HomeTableViewCell: UITableViewCell { @IBOutlet weak var lblName: UILabel! @IBOutlet weak var lblAddress: 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 } }
[ 382280, 358876, 358868 ]
e6167fafab3655bd1e5efb58e127328fd3c12c98
d8e6308f3ab6e5ff4e463a56e6867433a684d3c0
/Desktop/DiplomProject/DiplomProject/FilterMainPage/View/BottomFilterView.swift
ea104fc7eedc142a240309bc0aa18afa3d45192a
[]
no_license
malafa0101/DiplomaProject
33decccade48f6dc7d5f37affc2bc7421483a066
3bad0ae9533a0115fe2fcdf1982e201bc2fcdbca
refs/heads/master
2022-11-05T03:29:32.345194
2020-06-19T13:41:01
2020-06-19T13:41:01
273,503,186
0
0
null
null
null
null
UTF-8
Swift
false
false
6,472
swift
// // BottomFilterView.swift // DiplomProject // // Created by Zhanibek Santay on 4/16/20. // Copyright © 2020 Zhanibek Santay. All rights reserved. // import UIKit class BottomFilterView: UIView { let priceTitle: UILabel = { let label = UILabel() label.font = .getProximaNovaMediumFont(on: 18) label.textAlignment = .center label.textColor = #colorLiteral(red: 0.007843137255, green: 0.09803921569, blue: 0.1254901961, alpha: 0.3951460041) label.text = "Диапозон цены" return label }() private lazy var pickerview: UIPickerView = { let pickerview = UIPickerView() pickerview.delegate = self return pickerview }() lazy var fromLocationInputView: TitleInputView = { let view = TitleInputView(title: "Отправка от", inputType: .plainText, placeholder: "Алматинская область, Алматы", icon: #imageLiteral(resourceName: "Icon Color-6")) view.titleLabel.textColor = #colorLiteral(red: 0.007843137255, green: 0.09803921569, blue: 0.1254901961, alpha: 0.3951460041) return view }() lazy var toLocationInputView: TitleInputView = { let view = TitleInputView(title: "Доставить до", inputType: .plainText, placeholder: "Алматинская область, Алматы", icon: #imageLiteral(resourceName: "Icon Color-6")) view.titleLabel.textColor = #colorLiteral(red: 0.007843137255, green: 0.09803921569, blue: 0.1254901961, alpha: 0.3951460041) return view }() let toolbar: UIToolbar = { let toolbar = UIToolbar() toolbar.sizeToFit() return toolbar }() let city = ["Almaty","Astana","Aktau","Nur-Sultan"] lazy var massSlider: RangeSlider = { let slider = RangeSlider() let circleImage = ViewMaker.shared.makeCircleWith(size: CGSize(width: 14, height: 14), backgroundColor: #colorLiteral(red: 0.9176470588, green: 0.9568627451, blue: 0.9882352941, alpha: 1)) slider.maximumValue = 15000 slider.upperValue = 12000 slider.lowerValue = 600 slider.trackHighlightTintColor = .mainColor slider.addTarget(self, action: #selector(sliderAction(slider:)), for: .valueChanged) return slider }() let sliderText: UILabel = { let label = UILabel() label.font = .getProximaNovaMediumFont(on: 18) label.textAlignment = .center label.textColor = #colorLiteral(red: 0.007843137255, green: 0.09803921569, blue: 0.1254901961, alpha: 1) label.text = "600тг - 12000тг" return label }() override init(frame: CGRect) { super.init(frame: frame) setupViews() showDatePicker() } @objc func sliderAction(slider: RangeSlider){ sliderText.text = "\(Int(slider.lowerValue))тг - \(Int(slider.upperValue))тг" } func showDatePicker(){ //Formate Date //ToolBar let doneButton = UIBarButtonItem(title: "Готово", style: .plain, target: self, action: #selector(donePickerAction)) let spaceButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.flexibleSpace, target: nil, action: nil) let cancelButton = UIBarButtonItem(title: "Отмена", style: .plain, target: self, action: #selector(cancelPickerAction)) toolbar.setItems([doneButton,spaceButton,cancelButton], animated: true) fromLocationInputView.textField.textField.inputAccessoryView = toolbar fromLocationInputView.textField.textField.inputView = pickerview toLocationInputView.textField.textField.inputAccessoryView = toolbar toLocationInputView.textField.textField.inputView = pickerview pickerview.delegate = self } @objc func donePickerAction(){ print("f") } @objc func cancelPickerAction(){ print("s") } func setupViews() -> Void{ addSubview(fromLocationInputView) fromLocationInputView.snp.makeConstraints { (make) in make.top.left.equalToSuperview().offset(16) make.right.equalTo(-16) } addSubview(toLocationInputView) toLocationInputView.snp.makeConstraints { (make) in make.top.equalTo(fromLocationInputView.snp.bottom).offset(32) make.left.equalTo(16) make.right.equalTo(-16) } addSubview(priceTitle) priceTitle.snp.makeConstraints { (make) in make.top.equalTo(toLocationInputView.snp.bottom).offset(32) make.left.equalTo(16) } addSubview(massSlider) massSlider.snp.makeConstraints { (make) in make.top.equalTo(priceTitle.snp.bottom).offset(16) make.left.equalTo(16) make.right.equalTo(-16) make.height.equalTo(35) } addSubview(sliderText) sliderText.snp.makeConstraints { (make) in make.top.equalTo(massSlider.snp.bottom).offset(16) make.centerX.equalToSuperview() make.bottom.equalTo(-16) } } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } } extension BottomFilterView:UIPickerViewDelegate,UIPickerViewDataSource { func numberOfComponents(in pickerView: UIPickerView) -> Int { return 1 } func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { return 4 } func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { return city[row] } func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { } } extension UITextField { func setLeftView(image: UIImage) { let iconView = UIImageView(frame: CGRect(x: 10, y: 20, width: 14, height: 8)) // set your Own size iconView.image = image let iconContainerView: UIView = UIView(frame: CGRect(x: 0, y: 0, width: 35, height: 45)) iconContainerView.addSubview(iconView) rightView = iconContainerView rightViewMode = .always self.tintColor = .lightGray } }
[ -1 ]
ae58456d106875d77663d1f562fed33663303b71
f344daddf9a6d090d8e394657ac8ad8ad8d2bf78
/VGVideoEditor/Tool/LHVideoCompositionPlayer.swift
47e6f1d840064c639300f41a5606b25e9e7429ec
[]
no_license
VVege/VGVideoEditor
89311429ef18fe45d452590576b5500da0f465ba
c57728eb9277d175bf48adda7737f7814895aeca
refs/heads/master
2022-12-28T21:34:28.463587
2020-10-14T10:04:27
2020-10-14T10:04:27
292,250,216
0
0
null
null
null
null
UTF-8
Swift
false
false
10,560
swift
// // LHVideoEditPlayer.swift // VGVideoEditor // // Created by 周智伟 on 2020/9/1. // Copyright © 2020 vege. All rights reserved. // import UIKit import AVFoundation protocol LHVideoEditPlayerDelegate:class { func playerRefreshFinish(isReset:Bool, errorMessage: String?) func playerIsPlaying(at time: Double) func playerDidPlayToEndTime() } class LHVideoCompositionPlayerLayer: CALayer { private var videoLayer: CALayer? override var frame: CGRect { didSet { super.frame = frame videoLayer?.frame = bounds } } fileprivate func addVideoLayer(layer: CALayer) { videoLayer = layer videoLayer?.frame = bounds insertSublayer(layer, at: 0) } fileprivate func setVideoLayerHidden(isHidden: Bool, isAnimate: Bool) { CATransaction.begin() CATransaction.setDisableActions(!isAnimate) videoLayer?.isHidden = isHidden CATransaction.commit() } } private typealias PlayableLoadClosure = (_ flag:Bool)->() class LHVideoCompositionPlayer: NSObject { public let layer = LHVideoCompositionPlayerLayer() public weak var delegate: LHVideoEditPlayerDelegate? private var player: AVPlayer! private let playerLayer = AVPlayerLayer() private var composition = LHVideoComposition() private var currentProcessor: LHVideoCompositionProcessor! private var imageGenerator: AVAssetImageGenerator! private var timeObserve:Any? private var seekToTime: Double = 0 private var isRefreshing = false override init() { super.init() player = AVPlayer.init() playerLayer.player = player layer.addVideoLayer(layer: playerLayer) } deinit { NotificationCenter.default.removeObserver(self) removePlayProgressObserve() removeItemObserve() } } //MARK:- Public extension LHVideoCompositionPlayer { public func refresh(composition: LHVideoComposition){ if isRefreshing { print("error: 播放器正在刷新") return } isRefreshing = true let oldComposition = self.composition self.composition = composition.copyComposition() if needUpdateItem(old: oldComposition, new: composition) { currentProcessor = LHVideoCompositionProcessor(composition: self.composition) if let errorMessage = currentProcessor.error() { finishRefresh(isReset: false, errorMessage: errorMessage) }else{ if needTempHiddenVideoLayer(old: oldComposition, new: composition){ layer.setVideoLayerHidden(isHidden: true, isAnimate: false) } loadAssetToPlayable(asset: currentProcessor.settingPackage.composition) {[weak self] (success) in guard let weakSelf = self else { return } if success { weakSelf.replaceItem(asset: weakSelf.currentProcessor.settingPackage.composition, videoComposition: weakSelf.currentProcessor.settingPackage.videoComposition, audioMix: weakSelf.currentProcessor.settingPackage.audioMix) }else{ weakSelf.finishRefresh(isReset: false, errorMessage: "加载资源失败") } } } }else{ /// 检测音视频音量更新 let needUpdateAudios = needUpdateAudioVolume(old: oldComposition, new: composition) if needUpdateAudios.count > 0 { for audio in needUpdateAudios { currentProcessor.updateVolume(audio: audio) } player.currentItem?.audioMix = currentProcessor.settingPackage.audioMix } finishRefresh(isReset: false, errorMessage: nil) } } public func setCurrentTime(time: Double){ let cmTime = CMTime.init(value: CMTimeValue(time * 600), timescale: 600) player.currentItem?.seek(to: cmTime, toleranceBefore: CMTime.zero, toleranceAfter: CMTime.zero) seekToTime = time } public func play() { ///TODO:精度存在问题 let tolerace = duration() - player.currentTime().seconds if fabs(tolerace) < 0.002 { setCurrentTime(time: 0) } player.play() addPlayProgressObserve() } public func pause() { player.pause() removePlayProgressObserve() } public func duration() ->Double { return currentProcessor.settingPackage.totalDuration.seconds } public func origanlSize() -> CGSize { return currentProcessor.settingPackage.videoSize } public func isPlaying() -> Bool { return player.rate > 0 } public func setVolume(volume: Float) { player.volume = volume } public func playerIsRefreshing() -> Bool { return isRefreshing } } //MARK:- Private extension LHVideoCompositionPlayer { private func needUpdateItem(old: LHVideoComposition, new: LHVideoComposition) -> Bool { if !old.videos.elementsEqual(new.videos) { return true } if !old.audios.elementsEqual(new.audios) { return true } if old.speed != new.speed { return true } if old.cutRange != new.cutRange { return true } if old.cutMode != new.cutMode { return true } if old.fillMode != new.fillMode { return true } if old.renderRatio != new.renderRatio { return true } if old.bgColor != new.bgColor { return true } return false } /// 是否隐藏videoLayer /// 一些时候需要判断是否隐藏videoLayer,例如修改背景比例时如果修改frame,则会有闪动。 /// 暂时的隐藏,在加载好的时候会显示 private func needTempHiddenVideoLayer(old: LHVideoComposition, new: LHVideoComposition) -> Bool { return old.renderRatio != new.renderRatio } private func needUpdateAudioVolume(old: LHVideoComposition, new: LHVideoComposition) -> [LHAudioSource]{ var needUpdateVolumeSources:[LHAudioSource] = [] guard old.audios.elementsEqual(new.audios) else { return [] } for (index, newAudio) in new.audios.enumerated() { let oldAudio = old.audios[index] if oldAudio.volume != newAudio.volume { needUpdateVolumeSources.append(newAudio) } } return needUpdateVolumeSources } private func finishRefresh(isReset: Bool, errorMessage: String?) { isRefreshing = false layer.setVideoLayerHidden(isHidden: false, isAnimate: true) delegate?.playerRefreshFinish(isReset: isReset, errorMessage: errorMessage) } } //MARK:- Private init Player extension LHVideoCompositionPlayer { override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { if keyPath == "status", let status = player.currentItem?.status { if status == .readyToPlay { self.finishRefresh(isReset: true, errorMessage: nil) }else if status == .failed{ self.finishRefresh(isReset: false, errorMessage: player.currentItem?.error?.localizedDescription) } } } } //MARK:- Set Player extension LHVideoCompositionPlayer { private func addItemObserve() { player.currentItem?.addObserver(self, forKeyPath: "status", options: NSKeyValueObservingOptions.new.union(.old), context: nil) NotificationCenter.default.addObserver(self, selector: #selector(playerItemDidPlayToEndTime), name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: player.currentItem) } private func removeItemObserve() { player.currentItem?.removeObserver(self, forKeyPath: "status") NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: player.currentItem) } private func replaceItem(asset: AVAsset, videoComposition: AVVideoComposition?, audioMix: AVAudioMix?) { seekToTime = 0 removeItemObserve() let item = AVPlayerItem.init(asset: asset,automaticallyLoadedAssetKeys: nil) item.videoComposition = videoComposition item.audioMix = audioMix player.replaceCurrentItem(with: item) addItemObserve() } private func loadAssetToPlayable(asset: AVAsset, finish: @escaping PlayableLoadClosure) { let key = "playable" asset.loadValuesAsynchronously(forKeys: [key]) { var error: NSError? let status = asset.statusOfValue(forKey: key, error: &error) switch status { case .loaded: DispatchQueue.main.async { finish(true) } case .failed: DispatchQueue.main.async { finish(false) } case .loading:break case .unknown:break case .cancelled: DispatchQueue.main.async { finish(false) } @unknown default: break } } } private func addPlayProgressObserve() { if timeObserve != nil { return } timeObserve = player.addPeriodicTimeObserver(forInterval: CMTime.init(value: 20, timescale: 600), queue: nil) {[weak self] (time) in let seconds = time.seconds let seekToTime = self?.seekToTime ?? 0 /// 由于回调精度问题,seekToTime后,这里依然会返回seekTime之前的时间 /// 这里过滤 if seconds > seekToTime { self?.delegate?.playerIsPlaying(at: seconds) } } } private func removePlayProgressObserve() { if let observe = timeObserve { player.removeTimeObserver(observe) timeObserve = nil } } } //MARK:- Notification Event extension LHVideoCompositionPlayer { @objc private func playerItemDidPlayToEndTime() { delegate?.playerDidPlayToEndTime() } }
[ -1 ]
7fa8a1844f471af08f16fcff446696e5044e7640
2720d8002ba81cc7bd58cf7c4e93fea3264b1f73
/Tolocam/Explore/View/ExploreCollectionViewCell.swift
f47449b40cb679253b0b5590e3ee22c7b90bc6e0
[]
no_license
leo4life2/MiaoGouShuo
699644792bf0106b6feb2dc972db7df67c416e5e
812ebfa26c9d709c07a78b04e3c61ecc074813db
refs/heads/master
2020-12-03T11:37:50.020478
2020-01-02T03:28:25
2020-01-02T03:28:25
231,300,300
0
0
null
null
null
null
UTF-8
Swift
false
false
266
swift
// // ExploreCollectionViewCell.swift // Tolocam // // Created by wyx on 2019/2/26. // Copyright © 2019年 leo. All rights reserved. // import UIKit class ExploreCollectionViewCell: UICollectionViewCell { @IBOutlet weak var imageView: UIImageView! }
[ 315243 ]
e1ddb188beeb21574b7ae769ae2a838cdeed0b5a
5cb550ef201adfc40cce18827527408bd212e3f8
/Pokedex_by_JVinCi/AppDelegate.swift
13a0419bb3e854e13473515de88dda649561063e
[]
no_license
nhantrivinh/Pokedex
8973531e7f434723a44ed383b0f8863cf5f9a781
671b044953c0902972b352615a011e0e40be4870
refs/heads/master
2021-01-01T03:55:01.982450
2016-04-28T16:53:21
2016-04-28T16:53:21
56,567,344
0
0
null
null
null
null
UTF-8
Swift
false
false
2,156
swift
// // AppDelegate.swift // Pokedex_by_JVinCi // // Created by AndAnotherOne on 4/19/16. // Copyright © 2016 AndAnotherOne. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> 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:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 352284, 278559, 278564, 229415, 229417, 327722, 237613, 360496, 229426, 237618, 229428, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 286797, 311375, 163920, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 278648, 131192, 237693, 327814, 131209, 417930, 303241, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 286916, 286922, 286924, 286926, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 278760, 237807, 303345, 286962, 229622, 327930, 278781, 278783, 278785, 237826, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 155966, 278849, 319809, 319810, 319814, 311623, 319818, 311628, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 278983, 319945, 278986, 278990, 278994, 311767, 279003, 279006, 188895, 279010, 287202, 279015, 172520, 279020, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 287238, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 303773, 295583, 172702, 230045, 287394, 287390, 303780, 172705, 287398, 172707, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 328381, 279231, 287423, 328384, 287427, 107208, 172748, 287436, 287440, 295633, 172755, 303827, 279255, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 230175, 303914, 279340, 279353, 230202, 312124, 222018, 295755, 377676, 148302, 287569, 303959, 279383, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 213895, 320391, 304007, 304009, 304011, 304013, 213902, 279438, 295822, 189329, 295825, 304019, 279445, 58262, 279452, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 304063, 238528, 304065, 189378, 213954, 156612, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 295945, 197645, 295949, 230413, 320528, 140312, 295961, 238620, 304164, 189479, 304170, 238641, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 279661, 205934, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 350308, 230592, 279750, 312518, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 279788, 320748, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 296259, 378181, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 304506, 304505, 181626, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 337306, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 280014, 312783, 288208, 230865, 370130, 288210, 288212, 280021, 288214, 222676, 239064, 288217, 288218, 280027, 329177, 288220, 239070, 288224, 370146, 280034, 280036, 288226, 280038, 288229, 288230, 288232, 288234, 288236, 288238, 288240, 291754, 288242, 296435, 288244, 288246, 296439, 288250, 402942, 148990, 296446, 206336, 296450, 230916, 230919, 370187, 304651, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 288408, 280218, 280222, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 206536, 280264, 206539, 206541, 206543, 280276, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 288576, 345921, 280388, 304968, 280393, 280402, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280458, 280464, 124817, 280468, 239510, 280473, 124827, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 10170, 296890, 288700, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 223303, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 223327, 280671, 149599, 321634, 149601, 149603, 313451, 223341, 280687, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141455, 141459, 313498, 288936, 100520, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 280819, 157940, 125171, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 280835, 125187, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 280919, 354653, 313700, 280937, 313705, 280940, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 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, 281084, 240124, 305662, 305664, 240129, 305666, 305668, 240132, 223749, 281095, 338440, 150025, 223752, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 199262, 338532, 281190, 199273, 281196, 158317, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 314029, 314033, 240309, 133817, 314047, 314051, 199364, 297671, 199367, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 281401, 289593, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207737, 183172, 240519, 322440, 338823, 314249, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 281581, 183277, 322550, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 281708, 281711, 289912, 248995, 306341, 306347, 306354, 142531, 199877, 289991, 306377, 289997, 363742, 363745, 298216, 330988, 216303, 322801, 388350, 363802, 199976, 199978, 314671, 298292, 298294, 216376, 298306, 380226, 281923, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 298377, 314763, 224657, 306581, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 282127, 290321, 282130, 282133, 290325, 241175, 290328, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 257658, 315016, 282249, 290445, 324757, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 282410, 241450, 306988, 306991, 315184, 315190, 241464, 282425, 159545, 298811, 307009, 413506, 307012, 315211, 307027, 315221, 282454, 315223, 241496, 241498, 307035, 307040, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 241581, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 282645, 241693, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 307287, 315482, 315483, 217179, 192605, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 184486, 307370, 307372, 307374, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 307394, 307396, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 282881, 282893, 291089, 282906, 291104, 233766, 282931, 307508, 315701, 307510, 332086, 307512, 151864, 307515, 282942, 307518, 151874, 282947, 282957, 323917, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127431, 283080, 176592, 315856, 315860, 176597, 127447, 283095, 299481, 176605, 242143, 291299, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 127497, 233994, 135689, 233998, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 291378, 234038, 152118, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 135839, 299680, 225954, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 201444, 299750, 283368, 234219, 283372, 381677, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 201603, 234373, 226182, 234375, 226185, 308105, 234379, 234384, 234388, 234390, 226200, 324504, 234393, 209818, 308123, 324508, 234398, 234396, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 234414, 324527, 291760, 234417, 201650, 324531, 226230, 234422, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 226245, 234437, 234439, 234434, 234443, 275406, 234446, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 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, 316483, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 275545, 242777, 234585, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 234607, 160879, 275569, 234610, 300148, 234614, 398455, 144506, 275579, 234618, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 275594, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 234648, 308379, 283805, 234653, 324766, 119967, 234657, 300189, 324768, 242852, 283813, 234661, 300197, 234664, 275626, 234667, 316596, 308414, 234687, 300226, 308418, 226500, 234692, 300229, 308420, 283844, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 283904, 300289, 292097, 300292, 300294, 275719, 300299, 177419, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 283963, 243003, 226628, 283973, 300357, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 284010, 136562, 324978, 275834, 275836, 275840, 316803, 316806, 316811, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 284076, 144812, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 284099, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 226802, 316917, 308727, 292343, 300537, 316947, 308757, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 284215, 194103, 284218, 226877, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 276052, 276053, 284245, 284247, 317015, 284249, 243290, 284251, 300628, 284253, 235097, 284255, 300638, 284258, 292452, 292454, 284263, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 276098, 284290, 325250, 284292, 292479, 292485, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 317158, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 358135, 276216, 358140, 284413, 358142, 284418, 358146, 317187, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 186139, 300828, 300830, 276255, 325408, 284449, 300834, 300832, 227109, 317221, 358183, 276268, 300845, 194351, 243504, 300850, 284469, 276280, 325436, 276291, 366406, 276295, 153417, 276308, 284502, 317271, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 292729, 317306, 284540, 292734, 325512, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 227314, 276466, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 276539, 235579, 235581, 325692, 178238, 276544, 284739, 292934, 276553, 243785, 350293, 350295, 194649, 227418, 309337, 350302, 227423, 194654, 194657, 178273, 276579, 227426, 194660, 227430, 276583, 309346, 309348, 276586, 309350, 309352, 309354, 276590, 350313, 350316, 350321, 284786, 276595, 227440, 301167, 350325, 350328, 292985, 301178, 292989, 292993, 301185, 350339, 317570, 317573, 350342, 227463, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 227540, 309462, 301272, 309468, 309471, 301283, 317672, 276713, 317674, 325867, 227571, 309491, 276725, 309494, 243960, 276735, 227583, 227587, 276739, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 325937, 276789, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 285051, 211324, 227709, 285061, 317833, 178572, 285070, 178575, 285077, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 236043, 342541, 113167, 277011, 317971, 309781, 309779, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 277054, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 277106, 121458, 170618, 170619, 309885, 309888, 277122, 277128, 285320, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 318132, 285368, 277177, 277181, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 228069, 277223, 342760, 285417, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 301884, 310080, 293696, 277317, 277322, 277329, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 310134, 277368, 15224, 236408, 416639, 416640, 113538, 416648, 277385, 39817, 187274, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293820, 203715, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 121850, 302075, 244731, 293882, 293887, 277504, 277507, 277511, 277519, 293908, 277526, 293917, 293939, 277561, 277564, 310336, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 277608, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 253064, 302218, 285835, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 277671, 302248, 64682, 277678, 228526, 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, 204023, 228601, 228606, 64768, 310531, 285958, 138505, 228617, 318742, 277798, 130345, 113964, 285997, 285999, 113969, 277811, 318773, 318776, 277816, 286010, 417086, 277822, 286016, 294211, 302403, 384328, 277832, 277836, 294221, 326991, 294223, 277839, 277850, 179547, 277853, 146784, 277857, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 277888, 310657, 351619, 294276, 310659, 277892, 327046, 253320, 310665, 318858, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 277923, 130468, 228776, 277932, 310703, 277937, 310710, 130486, 310712, 310715, 302526, 228799, 277953, 64966, 245191, 163272, 302534, 310727, 277959, 292968, 302541, 277966, 302543, 310737, 277975, 228825, 163290, 310749, 277981, 310755, 277989, 187880, 286188, 310764, 278003, 310772, 40440, 278009, 212472, 40443, 286203, 228864, 40448, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 146977, 187939, 294435, 286246, 294439, 286248, 278057, 294440, 294443, 40486, 294445, 40488, 310831, 40499, 40502, 212538, 40507, 40511, 228933, 40521, 286283, 40525, 40527, 228944, 212560, 400976, 147032, 40537, 40539, 278109, 40541, 40550, 286312, 286313, 40554, 40552, 310892, 40557, 294521, 343679, 278150, 310925, 286354, 278163, 122517, 278168, 327333, 229030, 278188, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 278227, 229076, 286420, 319187, 286425, 319194, 278235, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 171774, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 237409, 294776, 294785, 327554, 40851, 294811, 319390, 294817, 319394, 40865, 311209, 180142, 294831, 188340, 40886, 294844, 294847, 393177, 294876, 294879, 294883, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
b19940077de949a7e1fed122a2f31d54e6c877ee
e75ad105932d206728c387db95793d99d45991c7
/Shared/Views/MasterData/MDBatteriesView.swift
aced3185fbcb99dca30a41e11bbe9cd573f2ab8e
[]
no_license
ShoaibPathan/Grocy-SwiftUI
728ab2424a5d1012df3c932bf2322a4d13fe89ec
b053fdbab3045c9fde9157cedb648b1f40375dd4
refs/heads/main
2023-01-29T17:30:32.892408
2020-12-08T12:07:51
2020-12-08T12:07:51
320,194,069
1
0
null
2020-12-10T07:30:46
2020-12-10T07:30:45
null
UTF-8
Swift
false
false
343
swift
// // MDBatteriesView.swift // Grocy-SwiftUI // // Created by Georg Meissner on 17.11.20. // import SwiftUI struct MDBatteriesView: View { var body: some View { Text("Batteries not implemented") } } struct MDBatteriesView_Previews: PreviewProvider { static var previews: some View { MDBatteriesView() } }
[ 40734 ]
8e64a94efe9e737eeea052349b4a76cda981324a
62fe9f426bb3a2dfd84f39f3ae11f1df8653c122
/EXTBP/profileVC.swift
ec950ebc08bd7948de6a151ea062e88d9290fe5c
[]
no_license
DAW226/EXTBP
f4951c4f6165c7142c142b0cc6800aad64ab2529
256fb53c99b49c786fc60400355d41452fa30b18
refs/heads/master
2020-06-11T15:13:38.210691
2016-12-05T15:54:52
2016-12-05T15:54:52
75,642,028
0
0
null
null
null
null
UTF-8
Swift
false
false
2,483
swift
// // profileVC.swift // EXTBP // // Created by Darin Wilson on 11/3/16. // Copyright © 2016 Darin Wilson. All rights reserved. // import UIKit import MessageUI class profileVC: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { // @IBOutlet weak var profileSubSegmentedControl: UISegmentedControl! // @IBOutlet weak var subHistoryTextView: UITextView! @IBOutlet weak var profileTextView: UITextView! @IBOutlet weak var profileImageView: UIImageView! @IBOutlet weak var logout: UIButton! @IBOutlet weak var imageEdit: UIButton! override func viewDidLoad() { super.viewDidLoad() } @IBAction func imageEditPicker(_ sender: AnyObject) { if UIImagePickerController.isSourceTypeAvailable(.camera) { let imagePicker = UIImagePickerController() imagePicker.delegate = self imagePicker.sourceType = UIImagePickerControllerSourceType.camera imagePicker.allowsEditing = false self.present(imagePicker, animated: true, completion: nil) } func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage!, editingInfo: [NSObject : AnyObject]!) { profileImageView.image = image self.dismiss(animated: true, completion: nil); } } // @IBAction func profileSementedControl(_ sender: AnyObject) { // // switch profileSubSegmentedControl.selectedSegmentIndex { // // case 0: // subHistoryTextView.isHidden = true // profileTextView.isHidden = false // profileImageView.isHidden = false // imageEdit.isHidden = false // case 1: // subHistoryTextView.isHidden = false // profileTextView.isHidden = true // profileImageView.isHidden = true // imageEdit.isHidden = true // default: // break // } // // } @IBAction func makeSubBtnPressed(_ sender: Any) { performSegue(withIdentifier: "photoVC", sender: self) } @IBAction func logoutBtnPressed(_ sender: AnyObject) { dismiss(animated: true, completion: nil) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ -1 ]
504c55df444efe20163a1a9ecef1e1f2dc11089e
cdfe7ed51e692c1bed53118e867f6dad26949e5e
/RayTracerB5/Group.swift
c7344adf48b7702a36303c7c2befa7475ac8fadd
[]
no_license
stein-a/RayTracer
9c6d34acccf3715d93b23c45aa8b3b2804efe20e
5462609111dba240bb24eb08c8f802ca465623eb
refs/heads/master
2023-03-31T23:46:41.346503
2023-03-30T17:36:22
2023-03-30T17:36:22
162,738,680
0
0
null
null
null
null
UTF-8
Swift
false
false
1,303
swift
// // Group.swift // RayTracerB5 // // Created by Stein Alver on 14/12/2018. // Copyright © 2018 Stein Alver. All rights reserved. // import Foundation class Group: Shape { var name: String var shapes: [Shape] override init() { self.shapes = [Shape]() self.name = "DefaultGroup" super.init() } init(name: String) { self.name = name self.shapes = [Shape]() super.init() } func addChild(shape: Shape) { self.shapes.append(shape) shape.parent = self } func isEmpty() -> Bool { return self.shapes.isEmpty } func includes(shape: Shape) -> Bool { return self.shapes.contains(shape) } override func local_intersect(ray: Ray) -> Intersections { let xsOut = Intersections([]) for shape in self.shapes { let xs = shape.intersect(ray: ray) xsOut.list.append(contentsOf: xs.list) xsOut.count = xsOut.count + xs.count } xsOut.list = xsOut.list.sorted() return xsOut } override func local_normal_at(p: Point, hit: Intersection) -> Vector { print("ERROR : You have called local_normal_at on a Group") return Vector(x: 57, y: 57, z: 57) } }
[ -1 ]
49b2df8a625cf5544b1350b4531ce3d4141a06e1
6e088c567c56aaba4be5e2ef1db5e642af62e241
/UverBus/UverBusUITests/UverBusUITests.swift
76ac2bd37dae0f72e58953b3bc0bf97d75cfdd47
[]
no_license
JamieScottC/UverBus
274679111966d91e3a8001fdc3f28e6d47cb4fc6
32ce50aabb5918b94210c1d095653e092559b679
refs/heads/master
2020-04-18T04:06:31.496409
2019-03-22T17:23:16
2019-03-22T17:23:16
167,225,759
0
0
null
null
null
null
UTF-8
Swift
false
false
1,240
swift
// // UverBusUITests.swift // UverBusUITests // // Created by Jamie Scott on 1/23/19. // Copyright © 2019 UverBus. All rights reserved. // import XCTest class UverBusUITests: XCTestCase { override func setUp() { super.setUp() // 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 // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. XCUIApplication().launch() // 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 tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } }
[ 155665, 237599, 229414, 278571, 229425, 180279, 229431, 319543, 213051, 286787, 237638, 311373, 196687, 278607, 311377, 368732, 180317, 278637, 319599, 278642, 131190, 131199, 278669, 278676, 311447, 327834, 278684, 278690, 311459, 278698, 278703, 278707, 180409, 278713, 295099, 139459, 131270, 229591, 147679, 311520, 147680, 319719, 286957, 319764, 278805, 311582, 278817, 311596, 336177, 98611, 278843, 287040, 319812, 311622, 319816, 229716, 278895, 287089, 139641, 311679, 311692, 106893, 156069, 311723, 377265, 311739, 319931, 278974, 336319, 311744, 278979, 336323, 278988, 278992, 279000, 369121, 279009, 188899, 279014, 319976, 279017, 311787, 319986, 279030, 311800, 279033, 279042, 287237, 377352, 279053, 303634, 303635, 279060, 279061, 188954, 279066, 279092, 377419, 303693, 115287, 189016, 295518, 287327, 279143, 279150, 287345, 287348, 189054, 287359, 303743, 164487, 279176, 311944, 344714, 311950, 311953, 336531, 287379, 295575, 303772, 221853, 205469, 279207, 295591, 295598, 279215, 279218, 287412, 164532, 287418, 303802, 66243, 287434, 287438, 279249, 303826, 279253, 369365, 369366, 230105, 295653, 230120, 279278, 312046, 230133, 279293, 205566, 295688, 312076, 295698, 221980, 336678, 262952, 262953, 279337, 262957, 164655, 328495, 303921, 230198, 222017, 295745, 279379, 295769, 230238, 230239, 279393, 303973, 279398, 295797, 295799, 279418, 336765, 287623, 279434, 320394, 189327, 189349, 279465, 304050, 189373, 213956, 345030, 213961, 279499, 304086, 304104, 123880, 320492, 320495, 287730, 320504, 214009, 312313, 312315, 312317, 328701, 328705, 418819, 320520, 230411, 320526, 238611, 140311, 238617, 197658, 336930, 132140, 189487, 312372, 238646, 238650, 320571, 336962, 238663, 205911, 296023, 156763, 230500, 214116, 279659, 238706, 279666, 312435, 230514, 279686, 222344, 337037, 296091, 238764, 279729, 148674, 312519, 279752, 148687, 189651, 279766, 189656, 279775, 304352, 304353, 279780, 279789, 279803, 320769, 312588, 320795, 320802, 304422, 312628, 345398, 222523, 181568, 279872, 279874, 304457, 345418, 230730, 337228, 296269, 222542, 238928, 296274, 230757, 296304, 312688, 230772, 337280, 296328, 296330, 304523, 9618, 279955, 148899, 279979, 279980, 173492, 279988, 280003, 370122, 280011, 337359, 329168, 312785, 222674, 329170, 280020, 280025, 239069, 320997, 280042, 280043, 329198, 337391, 296434, 288248, 288252, 312830, 230922, 329231, 304655, 230933, 222754, 312879, 230960, 288305, 239159, 157246, 288319, 288322, 280131, 124486, 288328, 239192, 99937, 345697, 312937, 312941, 206447, 288377, 337533, 280193, 239238, 288391, 239251, 280217, 198304, 337590, 280252, 280253, 296636, 321217, 280259, 321220, 296649, 239305, 280266, 9935, 313042, 280279, 18139, 280285, 321250, 337638, 181992, 288492, 34547, 67316, 313082, 288508, 288515, 280326, 116491, 280333, 124691, 116502, 321308, 321309, 280367, 280373, 280377, 321338, 280381, 345918, 280386, 280391, 280396, 337746, 18263, 370526, 296807, 296815, 313200, 313204, 124795, 182145, 280451, 67464, 305032, 124816, 214936, 337816, 329627, 239515, 214943, 313257, 288698, 214978, 280517, 280518, 214983, 231382, 329696, 190437, 313322, 329707, 174058, 296942, 124912, 313338, 239610, 182277, 313356, 305173, 223269, 354342, 354346, 313388, 124974, 321589, 215095, 288829, 288835, 313415, 239689, 354386, 329812, 223317, 354394, 321632, 280676, 313446, 215144, 288878, 288890, 215165, 329884, 215204, 125108, 280761, 223418, 280767, 338118, 280779, 321744, 280792, 280803, 182503, 338151, 125166, 125170, 395511, 313595, 125180, 125184, 125192, 125197, 125200, 125204, 338196, 125215, 125225, 338217, 321839, 125236, 280903, 289109, 379224, 239973, 313703, 280938, 321901, 354671, 354672, 199030, 223611, 248188, 313726, 158087, 313736, 240020, 190870, 190872, 289185, 305572, 289195, 338359, 289229, 281038, 281039, 281071, 322057, 182802, 322077, 289328, 338491, 322119, 281165, 281170, 281200, 313970, 297600, 289435, 314020, 248494, 166581, 314043, 363212, 158424, 322269, 338658, 289511, 330473, 330476, 289517, 215790, 125683, 199415, 322302, 289534, 35584, 322312, 346889, 264971, 322320, 166677, 207639, 281378, 289580, 281407, 289599, 281426, 281434, 322396, 281444, 207735, 314240, 158594, 330627, 240517, 289691, 240543, 289699, 289704, 289720, 289723, 281541, 19398, 191445, 183254, 183258, 207839, 314343, 183276, 289773, 248815, 240631, 330759, 322571, 330766, 330789, 248871, 281647, 322609, 314437, 207954, 339031, 314458, 281698, 281699, 322664, 314493, 150656, 347286, 330912, 339106, 306339, 249003, 208044, 322733, 3243, 339131, 290001, 339167, 298209, 290030, 208123, 322826, 126229, 298290, 208179, 159033, 216387, 372039, 224591, 331091, 314708, 150868, 314711, 314721, 281958, 314727, 134504, 306541, 314734, 314740, 314742, 314745, 290170, 224637, 306558, 290176, 306561, 314752, 314759, 298378, 314765, 314771, 306580, 224662, 282008, 314776, 282013, 290206, 314788, 314790, 282023, 298406, 241067, 314797, 306630, 306634, 339403, 191980, 282097, 306678, 191991, 290304, 323079, 323083, 323088, 282132, 282135, 175640, 282147, 306730, 290359, 323132, 282182, 224848, 224852, 290391, 306777, 323171, 282214, 224874, 314997, 290425, 339579, 282244, 323208, 282248, 323226, 282272, 282279, 298664, 298666, 306875, 282302, 323262, 323265, 282309, 306891, 241360, 282321, 241366, 282330, 282336, 12009, 282347, 282349, 323315, 200444, 282366, 249606, 282375, 323335, 282379, 216844, 118549, 282390, 282399, 241440, 282401, 339746, 315172, 216868, 241447, 282418, 282424, 282428, 413500, 241471, 315209, 159563, 307024, 307030, 241494, 307038, 282471, 282476, 339840, 315265, 282503, 315272, 315275, 184207, 282517, 298912, 118693, 298921, 126896, 200628, 282572, 282573, 323554, 298987, 282634, 241695, 315431, 315433, 102441, 102446, 282671, 241717, 307269, 233548, 315468, 315477, 200795, 323678, 315488, 315489, 45154, 217194, 233578, 307306, 249976, 241809, 323730, 299166, 233635, 299176, 323761, 184498, 258233, 299197, 299202, 176325, 299208, 233678, 282832, 356575, 307431, 184574, 217352, 315674, 282908, 299294, 282912, 233761, 282920, 315698, 332084, 307514, 282938, 127292, 168251, 323914, 201037, 282959, 250196, 168280, 323934, 381286, 242027, 242028, 250227, 315768, 315769, 291194, 291193, 291200, 242059, 315798, 291225, 242079, 283039, 299449, 291266, 373196, 283088, 283089, 242138, 176602, 160224, 291297, 242150, 283138, 233987, 324098, 340489, 283154, 291359, 283185, 234037, 340539, 332379, 111197, 242274, 291455, 316044, 184974, 316048, 316050, 340645, 176810, 299698, 291529, 225996, 135888, 242385, 299737, 234216, 234233, 242428, 291584, 299777, 291591, 291605, 283418, 234276, 283431, 242481, 234290, 201534, 283466, 201562, 234330, 275294, 349025, 357219, 177002, 308075, 242540, 242542, 201590, 177018, 308093, 291713, 340865, 299912, 316299, 234382, 308111, 308113, 209820, 283551, 177074, 127945, 340960, 234469, 340967, 324587, 234476, 201721, 234499, 234513, 316441, 300087, 21567, 308288, 160834, 349254, 300109, 234578, 250965, 250982, 234606, 300145, 300147, 234626, 234635, 177297, 308375, 324761, 119965, 234655, 300192, 234662, 300200, 324790, 300215, 283841, 283846, 283849, 316628, 251124, 316661, 283894, 234741, 292092, 234756, 242955, 177420, 292145, 300342, 333114, 333115, 193858, 300355, 300354, 234830, 283990, 357720, 300378, 300379, 316764, 292194, 284015, 234864, 316786, 243073, 292242, 112019, 234902, 333224, 284086, 259513, 284090, 54719, 415170, 292291, 300488, 300490, 144862, 300526, 308722, 300539, 210429, 292359, 218632, 316951, 374297, 235069, 349764, 194118, 292424, 292426, 333389, 349780, 128600, 235096, 300643, 300645, 243306, 325246, 333438, 235136, 317102, 300725, 300729, 333508, 333522, 325345, 153318, 333543, 284410, 284425, 300810, 300812, 284430, 161553, 284436, 325403, 341791, 325411, 186148, 186149, 333609, 284460, 300849, 325444, 153416, 325449, 317268, 325460, 341846, 284508, 300893, 284515, 276326, 292713, 292719, 325491, 333687, 317305, 317308, 325508, 333700, 243590, 243592, 325514, 350091, 350092, 350102, 333727, 219046, 333734, 284584, 292783, 300983, 153553, 292835, 6116, 292838, 317416, 325620, 333827, 243720, 292901, 325675, 243763, 325695, 333902, 227432, 194667, 284789, 284790, 292987, 227459, 194692, 235661, 333968, 153752, 284827, 333990, 284840, 284843, 227517, 309443, 227525, 301255, 227536, 301270, 301271, 325857, 334049, 317676, 309504, 194832, 227601, 325904, 334104, 211239, 334121, 317738, 325930, 227655, 383309, 391521, 285031, 416103, 227702, 211327, 227721, 285074, 227730, 285083, 293275, 317851, 227743, 285089, 293281, 301482, 375211, 334259, 293309, 317889, 326083, 129484, 326093, 285152, 195044, 334315, 236020, 293368, 317949, 342537, 309770, 334345, 342560, 227881, 293420, 236080, 23093, 244279, 244280, 301635, 309831, 55880, 301647, 326229, 309847, 244311, 244326, 301688, 244345, 301702, 334473, 326288, 227991, 285348, 318127, 293552, 285360, 285362, 342705, 154295, 342757, 285419, 170735, 342775, 375552, 228099, 285443, 285450, 326413, 285457, 285467, 326428, 318247, 293673, 318251, 301872, 285493, 285496, 301883, 342846, 293702, 318279, 244569, 301919, 293729, 351078, 310132, 228214, 269179, 228232, 416649, 236427, 252812, 293780, 310166, 277404, 310177, 293801, 326571, 326580, 326586, 359365, 211913, 326602, 56270, 203758, 277493, 293894, 293911, 326684, 113710, 318515, 203829, 277600, 285795, 228457, 318571, 187508, 302202, 285819, 285823, 285833, 318602, 285834, 228492, 162962, 187539, 326803, 285850, 302239, 302251, 294069, 294075, 64699, 228541, 343230, 310496, 228587, 302319, 228608, 318732, 245018, 318746, 130342, 130344, 130347, 286012, 294210, 286019, 294220, 318804, 294236, 327023, 327030, 310650, 179586, 294278, 368012, 318860, 318876, 343457, 245160, 286128, 286133, 310714, 302523, 228796, 302530, 228804, 310725, 310731, 302539, 310735, 327122, 310747, 286176, 187877, 310758, 40439, 286201, 359931, 286208, 245249, 228868, 302602, 294413, 359949, 302613, 302620, 245291, 310853, 286281, 196184, 212574, 204386, 204394, 138862, 310896, 294517, 286344, 179853, 286351, 188049, 229011, 179868, 229021, 302751, 245413, 212649, 286387, 286392, 302778, 286400, 212684, 302798, 286419, 294621, 294629, 286457, 286463, 319232, 278273, 278292, 278294, 294699, 286507, 319289, 237397, 188250, 237411, 327556, 188293, 311183, 294806, 294808, 319393, 294820, 294824, 343993, 98240, 294849, 294887, 278507, 311277, 327666, 278515 ]
d9b5902d9a09a26752b063b1b6c6a826a57e2c92
57c00e184b7578c7e76a474ac83b39893995f167
/catchup/views/TopViewController.swift
45be9da27f162a4093ba5cd3e12c3c806a881404
[]
no_license
NewNoetic/catchup-ios
eeb8f04a398b9d0536f7e81445dd455f814a3cca
8b61c30945d4b388039f22e513eb317990f3f6ac
refs/heads/master
2022-10-11T21:03:17.137516
2022-02-14T22:20:10
2022-02-14T22:20:10
237,494,696
2
0
null
2022-10-06T10:09:46
2020-01-31T18:47:16
Objective-C
UTF-8
Swift
false
false
2,054
swift
// // TopViewController.swift // catchup // // Created by SG on 1/6/21. // Copyright © 2021 newnoetic. All rights reserved. // import UIKit extension UIViewController { /// Top most view controller in view hierarchy var topMostViewController: UIViewController { // No presented view controller? Current controller is the most view controller guard let presentedViewController = self.presentedViewController else { return self } // Presenting a navigation controller? // Top most view controller is in visible view controller hierarchy if let navigation = presentedViewController as? UINavigationController { if let visibleController = navigation.visibleViewController { return visibleController.topMostViewController } else { return navigation.topMostViewController } } // Presenting a tab bar controller? // Top most view controller is in visible view controller hierarchy if let tabBar = presentedViewController as? UITabBarController { if let selectedTab = tabBar.selectedViewController { return selectedTab.topMostViewController } else { return tabBar.topMostViewController } } // Presenting another kind of view controller? // Top most view controller is in visible view controller hierarchy return presentedViewController.topMostViewController } } extension UIWindow { /// Top most view controller in view hierarchy /// - Note: Wrapper to UIViewController.topMostViewController var topMostViewController: UIViewController? { return self.rootViewController?.topMostViewController } } extension UIApplication { /// Top most view controller in view hierarchy /// - Note: Wrapper to UIWindow.topMostViewController var topMostViewController: UIViewController? { return self.windows.first?.topMostViewController } }
[ -1 ]
7dedbfce3493052a50dcfd334182abfacfe9a2bc
8aa5fcf80332fa2e801dcb6c3a22c790c2fcaf97
/FeaturePoints/ARViewControllerExtension.swift
e39b93f7b302520f1e4457d07f262c40d17ce379
[]
no_license
vooolkan/FeaturePoints
c4f565c248945652ae8134126788d45fa470ac94
2d050bdeca99b34b37db94027f6b59bca565ce74
refs/heads/master
2023-03-15T19:19:12.676360
2019-02-14T10:51:41
2019-02-14T10:51:41
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,567
swift
// // ARControllerExtension.swift // FeaturePoints // // Created by Harikrishna Keerthipati on 02/06/18. // Copyright © 2018 Avantari Technologies. All rights reserved. // import Foundation import ARKit enum ARState { case showingFeaturePoints case planeDetected } extension ARViewController: ARSCNViewDelegate, ARSessionDelegate { func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) { if !(anchor is ARPlaneAnchor) { return } DispatchQueue.main.async { self.featurePointsNode?.removeFromParentNode() self.sceneView.session.delegate = nil let plane = OverlayPlane(anchor: anchor as! ARPlaneAnchor) self.planes.append(plane) node.addChildNode(plane) self.arState = .planeDetected } } func renderer(_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor) { let plane = self.planes.filter { plane in return plane.anchor.identifier == anchor.identifier }.first if plane == nil { return } plane?.update(anchor: anchor as! ARPlaneAnchor) } func session(_ session: ARSession, didUpdate frame: ARFrame) { if arState == .showingFeaturePoints { featurePointsNode?.addCustomeFeaturePoints(frame) } else if arState == .planeDetected { bouncingCircle?.updatePosition() } } }
[ -1 ]
653b316aea51d66a9e3cef2c7f5034529903f221
9d3d7a75286a0b2822216301bb5eb5512f90115e
/PestControl/Characters/Bug.swift
95f3f5114431d946c98a55aa27694d4a9fa5173e
[]
no_license
GriffinHealy15/BugBomber_SpriteKit-iOS-
79a365780950dc35f376d40a89b0736b081b94a7
31e08b130f85f15b98eb13e3cf04e26756564737
refs/heads/master
2020-05-04T17:17:53.436148
2019-04-03T14:19:23
2019-04-03T14:19:23
179,305,810
1
0
null
null
null
null
UTF-8
Swift
false
false
2,083
swift
// // Bug.swift // PestControl // // Created by Griffin Healy on 8/1/18. // Copyright © 2018 Griffin Healy. All rights reserved. // import SpriteKit enum BugSettings { static let bugDistance: CGFloat = 16 } class Bug: SKSpriteNode { var animations: [SKAction] = [] required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) animations = aDecoder.decodeObject(forKey: "Bug.animations") as! [SKAction] } init() { let texture = SKTexture(pixelImageNamed: "bug_ft1") super.init(texture: texture, color: .white, size: texture.size()) name = "Bug" zPosition = 50 physicsBody = SKPhysicsBody(circleOfRadius: size.width/2) physicsBody?.categoryBitMask = PhysicsCategory.Bug physicsBody?.restitution = 0.5 physicsBody?.allowsRotation = false createAnimations(character: "bug") } override func encode(with aCoder: NSCoder) { aCoder.encode(animations, forKey: "Bug.animations") super.encode(with: aCoder) } @objc func moveBug() { // 1 let randomX = CGFloat(Int.random(min: -1, max: 1)) let randomY = CGFloat(Int.random(min: -1, max: 1)) let vector = CGVector(dx: randomX * BugSettings.bugDistance, // 2 dy: randomY * BugSettings.bugDistance) let moveBy = SKAction.move(by: vector, duration: 1) let moveAgain = SKAction.perform(#selector(moveBug), onTarget: self) // 1 let direction = animationDirection(for: vector) // 2 if direction == .left { xScale = abs(xScale) } else if direction == .right { xScale = -abs(xScale) } // 3 run(animations[direction.rawValue], withKey: "animation") run(SKAction.sequence([moveBy, moveAgain])) } func die() { // 1 removeAllActions() texture = SKTexture(pixelImageNamed: "bug_lt1") yScale = -1 // 2 physicsBody = nil // 3 run(SKAction.sequence([SKAction.fadeOut(withDuration: 3), SKAction.removeFromParent()])) } } extension Bug : Animatable {}
[ -1 ]
ba419c5919b51b9eb2229b0fdce59a4c9761427a
4d9b97a15521e489b99ce2a8b6607735c2e0e357
/实战项目/TestQiushi/TestQiushi/Main/AppDelegate.swift
2a2e19133f95af873289d32c9b3599879762c591
[]
no_license
housenkui/swift5
2cd3d92ad4cccd6b350b6af81be9cc0e60eb42e0
f2e5556c93627480b49e0bea253941c8a6bd6b9b
refs/heads/master
2021-05-18T07:16:32.303907
2020-05-12T02:44:32
2020-05-12T02:44:32
251,175,236
0
0
null
null
null
null
UTF-8
Swift
false
false
1,414
swift
// // AppDelegate.swift // TestQiushi // // Created by 侯森魁 on 2020/4/2. // Copyright © 2020 侯森魁. 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, 418043, 336123, 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, 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, 336659, 418580, 418585, 434970, 369435, 418589, 262942, 418593, 336675, 328484, 418598, 418605, 336696, 361273, 328515, 336708, 328519, 336711, 361288, 328522, 336714, 426841, 254812, 361309, 197468, 361315, 361322, 328573, 377729, 369542, 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, 328941, 386285, 386291, 345376, 353570, 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, 116210, 337398, 337415, 329226, 419339, 419343, 419349, 345625, 419355, 370205, 419359, 394786, 419362, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 214610, 419410, 345701, 394853, 222830, 370297, 353919, 403075, 345736, 198280, 403091, 345749, 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, 321299, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 370509, 354130, 247637, 337750, 370519, 313180, 354142, 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, 321879, 379233, 354673, 321910, 248186, 420236, 379278, 272786, 354727, 338352, 330189, 338381, 338386, 256472, 338403, 338409, 248308, 199164, 330252, 199186, 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, 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, 199728, 396336, 330800, 396339, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 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, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 249308, 339420, 339424, 249312, 339428, 339434, 249328, 69113, 372228, 208398, 380432, 175635, 339503, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 224897, 372353, 216707, 126596, 339588, 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, 339721, 257801, 257804, 225038, 257807, 225043, 372499, 167700, 225048, 257819, 225053, 184094, 225058, 339747, 339749, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 225079, 397112, 225082, 397115, 225087, 225092, 225096, 323402, 257868, 225103, 257871, 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, 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, 250199, 250202, 332125, 250210, 348522, 348525, 348527, 332152, 389502, 250238, 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, 389892, 373510, 389926, 152370, 348978, 340789, 348982, 398139, 127814, 357201, 357206, 389978, 430939, 357211, 357214, 201579, 201582, 349040, 340849, 201588, 430965, 324472, 398201, 119674, 340858, 324475, 430972, 340861, 324478, 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, 349180, 439294, 209943, 250914, 357410, 185380, 357418, 209965, 209968, 209971, 209975, 209979, 209987, 209990, 341071, 349267, 250967, 210010, 341091, 210025, 210027, 210030, 210036, 210039, 341113, 349308, 210044, 349311, 152703, 160895, 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, 210260, 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, 210631, 333511, 259788, 358099, 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, 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, 260298, 350410, 350416, 350422, 350425, 268507, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 325891, 350467, 350475, 375053, 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, 342430, 268701, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 195039, 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, 203506, 342776, 391937, 391948, 375568, 326416, 375571, 162591, 326441, 326451, 326454, 326460, 244540, 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, 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, 384114, 343154, 212094, 351364, 384135, 384139, 384143, 351381, 384151, 384160, 384168, 367794, 244916, 384181, 367800, 384188, 384191, 351423, 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, 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, 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, 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 ]
29b074470721eb51c4a25088eafa0584cc536f37
e94954c453a3092dc05bee592df70d1ce2ef5b9d
/Sources/Imperial/Services/Facebook/FacebookRouter.swift
590f9e36d3f177a21851e38ff9ff1b68f1db81d0
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
rafiki270/Imperial
acc314ed7f44342086838afff5fe806e89a04ddb
b92badeb1f60d7e40a8eb6d8306854503a6750f6
refs/heads/master
2020-05-04T09:08:02.602919
2019-03-29T12:12:33
2019-03-29T12:12:33
179,061,742
0
0
null
2019-04-02T11:18:36
2019-04-02T11:18:35
null
UTF-8
Swift
false
false
2,567
swift
import Vapor import Foundation public class FacebookRouter: FederatedServiceRouter { public let tokens: FederatedServiceTokens public let callbackCompletion: (Request, String) throws -> (Future<ResponseEncodable>) public var scope: [String] = [] public let callbackURL: String public var accessTokenURL: String = "https://graph.facebook.com/v3.2/oauth/access_token" public var authURL: String { return "https://www.facebook.com/v3.2/dialog/oauth?" + "client_id=\(self.tokens.clientID)" + "&redirect_uri=\(self.callbackURL)" } public required init(callback: String, completion: @escaping (Request, String) throws -> (Future<ResponseEncodable>)) throws { self.tokens = try FacebookAuth() self.callbackURL = callback self.callbackCompletion = completion } public func fetchToken(from request: Request)throws -> Future<String> { let code: String if let queryCode: String = try request.query.get(at: "code") { code = queryCode } else if let error: String = try request.query.get(at: "error") { throw Abort(.badRequest, reason: error) } else { throw Abort(.badRequest, reason: "Missing 'code' key in URL query") } let body = FacebookCallbackBody(code: code, clientId: self.tokens.clientID, clientSecret: self.tokens.clientSecret, redirectURI: self.callbackURL) return try body.encode(using: request).flatMap(to: Response.self) { request in guard let url = URL(string: self.accessTokenURL) else { throw Abort(.internalServerError, reason: "Unable to convert String '\(self.accessTokenURL)' to URL") } request.http.method = .POST request.http.url = url return try request.make(Client.self).send(request) }.flatMap(to: String.self) { response in return response.content.get(String.self, at: ["access_token"]) } } public func callback(_ request: Request)throws -> Future<Response> { return try self.fetchToken(from: request).flatMap(to: ResponseEncodable.self) { accessToken in let session = try request.session() session["access_token"] = accessToken try session.set("access_token_service", to: OAuthService.facebook) return try self.callbackCompletion(request, accessToken) }.flatMap(to: Response.self) { response in return try response.encode(for: request) } } }
[ -1 ]
f019dce23065489347b6c4ec22c27c28c60eaafb
725b85f68fa44b9194b7eaba1ddc09315ab4bf06
/dropbox/SignInPhotosViewController.swift
0a952a8d5134e52f103d5d3939596120974d8622
[]
no_license
lizthebiz/dropbox-demo
fc29859b9e1462864700a05c482d4e54f908d23e
a298f0a99e6480907a7ddf8c4bb9f61e82f71872
refs/heads/master
2016-08-09T22:59:31.605270
2015-10-13T06:43:57
2015-10-13T06:43:57
43,799,955
0
0
null
null
null
null
UTF-8
Swift
false
false
1,104
swift
// // SignInPhotosViewController.swift // dropbox // // Created by Liz Dalay on 10/11/15. // Copyright © 2015 Liz Dalay. All rights reserved. // import UIKit class SignInPhotosViewController: UIViewController { @IBOutlet weak var signinPhotosScrollView: UIScrollView! @IBOutlet weak var signinPhotosImageView: UIImageView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. signinPhotosScrollView.contentSize = signinPhotosImageView.image!.size } 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 prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ 277052, 277221 ]
1709eb1bb98654046d6f5ca0a327575c92556f6a
5208175e0d0807daee39c611102148d305823aaf
/backjoon/Swift/backjoon_2490.swift
7e937ce0a9fb57ca14b6b4021452c6ea93b825f5
[]
no_license
Jae-eun/Algorithm
3b66d8a6193acecd9bf0142c4971320ff7975313
a907bf4ec22cea4d694777811af19461f229bb98
refs/heads/master
2021-11-01T18:15:01.254555
2021-09-27T09:06:23
2021-09-27T09:06:23
163,092,373
6
1
null
null
null
null
UTF-8
Swift
false
false
1,327
swift
// // backjoon_2490.swift // algo // // Created by 이재은 on 03/09/2019. // Copyright © 2019 이재은. All rights reserved. // import Foundation // backjoon 윷놀이 2490 // 우리나라 고유의 윷놀이는 네 개의 윷짝을 던져서 배(0)와 등(1)이 나오는 숫자를 세어 도, 개, 걸, 윷, 모를 결정한다. 네 개 윷짝을 던져서 나온 각 윷짝의 배 혹은 등 정보가 주어질 때 도(배 한 개, 등 세 개), 개(배 두 개, 등 두 개), 걸(배 세 개, 등 한 개), 윷(배 네 개), 모(등 네 개) 중 어떤 것인지를 결정하는 프로그램을 작성하라. // // 입력 // 첫째 줄부터 셋째 줄까지 각 줄에 각각 한 번 던진 윷짝들의 상태를 나타내는 네 개의 정수(0 또는 1)가 빈칸을 사이에 두고 주어진다. // // 출력 // 첫째 줄부터 셋째 줄까지 한 줄에 하나씩 결과를 도는 A, 개는 B, 걸은 C, 윷은 D, 모는 E로 출력한다. for _ in 0..<3 { let input = readLine()! let countZero = input.filter{ $0 == "0" }.count switch countZero { case 0: print("E") case 1: print("A") case 2: print("B") case 3: print("C") case 4: print("D") default: continue } } //0 1 0 1 //1 1 1 0 //0 0 1 1 // B // A // B
[ -1 ]
68ecd7afd069831bfd0b1813f990fd96e17caf8e
cf413f904e12a9fdad9cd8643492669976352fb2
/ios/yn/yn/Question.swift
5ef986170144207d43a8cba24395c9d0d2a36f5a
[]
no_license
clint42/yn
f7cc74a43b2320f7ef70d57208aa2a239a3c9c47
43d9fa6f1a7405745482e9344d2ce4b23ad284f2
refs/heads/master
2020-12-31T03:42:49.008256
2016-05-19T21:41:29
2016-05-19T21:41:29
55,818,267
0
0
null
null
null
null
UTF-8
Swift
false
false
1,047
swift
// // Question.swift // yn // // Created by Grégoire Lafitte on 5/17/16. // Copyright © 2016 Aurelien Prieur. All rights reserved. // import Foundation import UIKit class Question { var id: Int var title: String var description: String? var imageUrl: String? var ownerId: Int init(id: Int, title: String, description: String? = nil, image: String? = nil, ownerId: Int) { self.id = id self.title = title self.description = description self.imageUrl = image self.ownerId = ownerId } convenience init(json: Dictionary<String, AnyObject>) throws { guard let id = json["id"] as? Int else { throw ApiError.ResponseInvalidData } guard let title = json["title"] as? String else { throw ApiError.ResponseInvalidData } self.init(id: id, title: title, description: json["question"] as? String, image: json["imageUrl"] as? String, ownerId: json["OwnerId"] as! Int); } }
[ -1 ]
f6e0d794b6a28a2090d2d1f1cc4c003c5723d5fc
e686c511742b5a670de7af8102791dc654718878
/HTNCLI/Sources/HTNCLI/HTNCLI.swift
bdef30572803c658e01865a9dbaf1e7a563a8ac9
[ "Apache-2.0" ]
permissive
DevGuan/HTN
888d52a447f93a15809491b8be3d91439097f762
40179dc3e576cc5773930c4bc1304420a48d37c0
refs/heads/master
2020-03-30T18:44:43.855432
2018-07-13T09:29:07
2018-07-13T09:29:07
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,426
swift
// // HTNCLI.swift // HTNCLI // // Created by 陈爱彬 on 2018/4/17. Maintain by 陈爱彬 // Description // import Foundation import HTN import PathKit import Dispatch public class HTNCLI { public static let version = "0.1.0" let sema = DispatchSemaphore(value: 0) public init() {} //build h5editor urls and export to outputPath public func buildH5Editor(urls: [String], outputPath: String) { let path = Path(outputPath) for url in urls { print("Request url:\(url)") SMNetWorking<H5Editor>().requestJSON(url) { (jsonModel) in guard let model = jsonModel else { self.sema.signal() return } let converter = H5EditorToFrame<H5EditorObjc>(H5EditorObjc()) let reStr = converter.convert(model) // print(reStr) // print(converter.m.pageId) let hPath = path + Path(converter.m.pageId + ".h") let mPath = path + Path(converter.m.pageId + ".m") self.writeFileToPath(hPath, content: reStr.0) self.writeFileToPath(mPath, content: reStr.1) self.sema.signal() } sema.wait() } } //write response to path func writeFileToPath(_ path: Path, content: String) { try? path.write(content) } }
[ -1 ]
3089161aa8894758377d7b3bdd22d76340d59763
3d9a97049afdae2d1d20ee7028814bddac27531b
/Meus Filmes/Filme.swift
1bcae8f7e421f3009c6848c457cbebf8d1323bc3
[]
no_license
rafaelg202/My-Movies
a7a0ceeb996185e1fa2969908416ec7a9358450f
fa4b3e165261de1d85140c2db0dd7190939e4aef
refs/heads/master
2020-03-18T16:52:34.518450
2018-05-26T19:55:41
2018-05-26T19:55:41
134,990,986
0
0
null
null
null
null
UTF-8
Swift
false
false
425
swift
// // Filme.swift // Meus Filmes // // Created by Rafael Goncalves on 19/05/2018. // Copyright © 2018 BlessCode. All rights reserved. // import UIKit class Filme{ var titulo: String! var descricao: String! var imagem: UIImage! init(titulo: String, descricao: String, imagem: UIImage) { self.titulo = titulo self.descricao = descricao self.imagem = imagem } }
[ -1 ]
3ab1490ba2105c26300a11f3e2399d7721b8273a
73b5ee9e7ddf3f2281b4436ab4851e3d27956b20
/DereGuide/Toolbox/Gacha/Detail/View/GachaDetailBannerCell.swift
02fb2f5bb17f028a6c6081f7b8841f684dd1cbbc
[ "MIT" ]
permissive
ricksimon/DereGuide
ebacc7f747a4d58994ac883f478f05f16fa6e84b
b2e870ad0f1f8d9c26dd19e8194ff3292efbc4e6
refs/heads/master
2020-03-06T20:32:11.880901
2018-03-26T16:18:21
2018-03-26T16:18:21
127,055,269
1
0
null
2018-03-27T22:58:38
2018-03-27T22:58:38
null
UTF-8
Swift
false
false
950
swift
// // GachaDetailBannerCell.swift // DereGuide // // Created by zzk on 18/01/2018. // Copyright © 2018 zzk. All rights reserved. // import UIKit class GachaDetailBannerCell: ReadableWidthTableViewCell { let banner = BannerView() override var maxReadableWidth: CGFloat { return 824 } override init(style: UITableViewCellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) readableContentView.addSubview(banner) banner.snp.makeConstraints { (make) in make.edges.equalToSuperview() make.width.equalTo(banner.snp.height).multipliedBy(824.0 / 212.0) } selectionStyle = .none } func setup(bannerURL: URL) { banner.sd_setImage(with: bannerURL) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } }
[ -1 ]
28d9d26cdb64cb254e9ad9f3437bfd3e0115e7d5
858ed32663d4b62181eaf2b1d0278d41e9ae02a5
/Source/Simulation/View/SimulationViewContentCellProjectStartDate.swift
33dc884ad824ed62decf003d72638e500f5891e5
[ "MIT" ]
permissive
velvetroom/entropy
3fb0b9a1fefab755828ccf73bfc1d07db1d7b28a
1efcc29068a3d152437bf773b1ad746693f4baa4
refs/heads/master
2021-01-24T04:19:11.888398
2018-03-17T10:54:16
2018-03-17T10:54:16
122,928,365
0
0
null
null
null
null
UTF-8
Swift
false
false
274
swift
import UIKit class SimulationViewContentCellProjectStartDate:SimulationViewContentCell { override init(frame:CGRect) { super.init(frame:frame) self.backgroundColor = UIColor.blue } required init?(coder:NSCoder) { return nil } }
[ -1 ]
0c2598359c804277e6fcb7d16c5c8e41beb26196
7df53c794508a99f599dac185f51d36f057eef63
/Structs.xcplaygroundpage/Contents.swift
31dfa2300c2787a6b3779a572315ec38356c0673
[]
no_license
fatpat314/MOB-lab-day-4
f5c67e77dd58a10216ba19fe97504dfe1fe8d59f
452749932a0df9f7af43da95d1b0083600c5728c
refs/heads/main
2023-02-28T08:38:30.877819
2021-02-03T21:24:23
2021-02-03T21:24:23
335,758,914
0
0
null
null
null
null
UTF-8
Swift
false
false
1,772
swift
import Foundation /*: ## Exercise - Structs, Instances, and Default Values Imagine you are creating an app that will monitor location. Create a `GPS` struct with two variable properties, `latitude` and `longitude`, both with default values of 0.0. */ struct GPS { var latitude: Double = 0.0 var longitude: Double = 0.0 } /*: Create a variable instance of `GPS` called `somePlace`. It should be initialized without supplying any arguments. Print out the latitude and longitude of `somePlace`, which should be 0.0 for both. */ var somePlace = GPS(latitude: 0.0, longitude: 0.0) print(somePlace) /*: Change `somePlace`'s latitude to 51.514004, and the longitude to c, then print the updated values. */ somePlace.latitude = 51.514004 somePlace.longitude = 51.514004 /*: Now imagine you are making a social app for sharing your favorite books. Create a `Book` struct with four variable properties: `title`, `author`, `pages`, and `price`. The default values for both `title` and `author` should be an empty string. `pages` should default to 0, and `price` should default to 0.0. */ struct Book { var title: String = "" var author: String = "" var pages: Int = 0 var price: Double = 0.0 } /*: Create a variable instance of `Book` called `favoriteBook` without supplying any arguments. Print out the title of `favoriteBook`. Does it currently reflect the title of your favorite book? Probably not. Change all four properties of `favoriteBook` to reflect your favorite book. Then, using the properties of `favoriteBook`, print out facts about the book. */ var favoriteBook = Book() favoriteBook.title = "Dune" favoriteBook.author = "Jones" favoriteBook.pages = 60 favoriteBook.price = 1.50 print(favoriteBook) //: [Next](@next)
[ -1 ]
b2d1596d39e6e0c1f643ed130fe6994f2fa5af0e
477d201d4bb0ba75e815385c75821c5f678b952d
/GeoData/Main/SceneDelegate.swift
0c7386516f357309ef247ee8a5a6a605479c8a09
[]
no_license
iammxrn/geodata
fdd8409fbea65fb58d67e2d43c0a26a64c4a2038
efbc74f51c96e78a4032f42532213ad46dcef7ba
refs/heads/main
2023-02-03T13:30:27.938269
2020-12-21T20:53:48
2020-12-21T20:53:48
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,294
swift
// // SceneDelegate.swift // GeoData // // Created by Roman Mogutnov on 21.12.2020. // 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 necessarily 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, 393277, 376906, 327757, 254032, 368728, 180314, 254045, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 377047, 418008, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 385281, 336129, 262405, 180491, 336140, 164107, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 164362, 328207, 410129, 393748, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 385610, 270922, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 336513, 377473, 385671, 148106, 377485, 352919, 98969, 344745, 361130, 336556, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 418508, 385743, 385749, 139998, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 328523, 336715, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 361361, 222129, 345036, 386004, 345046, 386012, 386019, 386023, 328690, 435188, 328703, 328710, 418822, 377867, 328715, 361490, 386070, 336922, 345119, 377888, 214060, 345134, 345139, 361525, 386102, 361537, 377931, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 386168, 361594, 410746, 214150, 345224, 386187, 345247, 361645, 345268, 402615, 361657, 337093, 402636, 328925, 165086, 165092, 328933, 222438, 328942, 386286, 386292, 206084, 328967, 345377, 345380, 353572, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337224, 337230, 337235, 263509, 353634, 337252, 402792, 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, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 337601, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 419543, 419545, 345819, 419548, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 362274, 378664, 354107, 354112, 370504, 329545, 345932, 370510, 354132, 247639, 337751, 370520, 313181, 354143, 354157, 345965, 345968, 345971, 345975, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 346059, 247760, 346064, 346069, 419810, 329699, 354275, 190440, 354314, 346140, 436290, 395340, 378956, 436307, 338005, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 387250, 379067, 387261, 256193, 395467, 346317, 411862, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 436474, 321787, 379135, 411905, 411917, 379154, 395539, 387350, 387353, 338201, 182559, 338212, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 321911, 420237, 379279, 272787, 354728, 338353, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 330225, 248309, 330254, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 191085, 338544, 191093, 346743, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 355029, 264919, 338661, 264942, 363252, 338680, 264965, 338701, 256787, 363294, 199455, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 355151, 330581, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 355185, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 265215, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 248915, 183384, 339037, 412765, 257121, 322660, 265321, 248952, 420985, 330886, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 322763, 330959, 330966, 265433, 265438, 388320, 363757, 388348, 339199, 175376, 175397, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 126279, 437576, 437584, 331089, 331094, 396634, 175451, 437596, 429408, 175458, 175461, 175464, 265581, 331124, 175478, 249210, 175484, 175487, 249215, 175491, 249219, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 380364, 339406, 372177, 339414, 249303, 413143, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 208399, 175637, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 224885, 224888, 224891, 224895, 372354, 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, 339664, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 397089, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 257869, 257872, 225105, 397140, 225109, 225113, 257881, 257884, 257887, 225120, 257891, 413539, 225128, 257897, 339818, 225138, 339827, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 372698, 372704, 372707, 356336, 380919, 393215, 372739, 405534, 266295, 266298, 217158, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 192640, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 225439, 135328, 192674, 225442, 438434, 225445, 438438, 225448, 438441, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 430275, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 356580, 225511, 217319, 225515, 225519, 381177, 397572, 389381, 356638, 356641, 356644, 356647, 266537, 389417, 356650, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 201030, 348489, 332107, 151884, 430422, 348503, 250201, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 250239, 389507, 348548, 356741, 332175, 160152, 373146, 340380, 373149, 70048, 356783, 373169, 266688, 324032, 201158, 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, 389724, 332381, 373344, 340580, 348777, 381546, 119432, 340628, 184983, 373399, 258723, 332455, 332460, 389806, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 348926, 389927, 348979, 152371, 340792, 398141, 357202, 389971, 357208, 389979, 430940, 357212, 357215, 439138, 201580, 201583, 349041, 340850, 381815, 430967, 324473, 398202, 119675, 340859, 324476, 430973, 324479, 340863, 324482, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 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, 341072, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 349313, 160896, 210053, 210056, 349320, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 210132, 333016, 210139, 210144, 218355, 218361, 275709, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 210261, 365912, 259423, 374113, 251236, 374118, 333164, 234867, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 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, 333396, 333400, 366173, 423529, 423533, 210547, 415354, 333440, 267910, 267929, 333512, 259789, 366301, 333535, 153311, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333595, 210720, 366384, 358192, 210740, 366388, 358201, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 268144, 358256, 358260, 341877, 399222, 325494, 333690, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 382898, 350153, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 333838, 350225, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 342113, 252021, 342134, 374904, 268435, 333998, 334012, 260299, 350411, 350417, 350423, 350426, 350449, 375027, 358645, 350459, 350462, 350465, 350469, 268553, 350477, 268560, 350481, 432406, 350487, 325915, 350491, 325918, 350494, 325920, 350500, 350505, 358701, 391469, 350510, 358705, 358714, 358717, 383307, 358738, 334162, 383331, 383334, 391531, 383342, 334204, 268669, 194942, 391564, 366991, 334224, 268702, 342431, 375209, 375220, 334263, 326087, 358857, 195041, 334312, 104940, 375279, 350724, 186898, 342546, 350740, 342551, 334359, 342555, 334364, 416294, 350762, 252463, 358962, 334386, 334397, 358973, 252483, 219719, 399957, 334425, 326240, 375401, 334466, 334469, 391813, 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, 326417, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 326463, 375616, 326468, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 433001, 400238, 326511, 211826, 211832, 392061, 351102, 359296, 252801, 260993, 351105, 400260, 211846, 342921, 342931, 252823, 400279, 392092, 400286, 252838, 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, 359471, 375868, 343132, 384099, 384102, 384108, 367724, 187503, 343155, 384115, 212095, 384136, 384140, 384144, 384152, 384158, 384161, 351399, 384169, 367795, 384182, 367801, 384189, 384192, 351424, 343232, 367817, 244938, 384202, 253132, 326858, 384209, 146644, 351450, 384225, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 359695, 261391, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 376111, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 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, 359887, 359891, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 359948, 359951, 245295, 359984, 400977, 400982, 179803, 245358, 155255, 155274, 368289, 245410, 425639, 425652, 425663, 155328, 245463, 155352, 155356, 212700, 155364, 245477, 155372, 245487, 212723, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 384831, 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, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 155647 ]
37ac87ac75c50796545a496e6ee50074609b6457
b58e3b6dcde5baa2e22afac6123d0c487b1c61f2
/iOS/greener/greener/Flow/Account/AccountDependency.swift
c2faf763d2f28b16181e059ee37b6274ef3ed098
[ "Apache-2.0" ]
permissive
rkhanna-olx/Greener
95df691b28d001a9bbbe9923426389440944252d
23a2a80ed40729a29129fb1eba0e9650cb6f9e71
refs/heads/master
2023-06-01T11:05:32.446743
2021-06-23T04:25:56
2021-06-23T04:25:56
378,047,173
0
0
null
null
null
null
UTF-8
Swift
false
false
209
swift
// // AccountDependency.swift // greener // // Created by Rahul on 17/06/21. // import Foundation protocol AccountDependencyProtocol { } final class AccountDependency: AccountDependencyProtocol { }
[ -1 ]
cb067fed6e59a0dc8429fda88d8b1331f93e92c2
37871eecc5c959c4a88fa831786718f0f22fc524
/TCSCodingTest/MovieDetailScreen/MovieDetailViewModel.swift
c583c0bf2b8572e3ec1e3b5d903dc3bbf096e674
[]
no_license
omerjanjua/TCSCodingTest
9500db6aee28fe4c1352acf25e3832a40ca6fff4
c712bac0d2299e8accc67d9d8a2e58dba397d51e
refs/heads/master
2021-04-06T10:58:58.681914
2018-03-12T13:02:47
2018-03-12T13:02:47
124,364,982
0
0
null
null
null
null
UTF-8
Swift
false
false
651
swift
// // MovieDetailViewModel.swift // TCSCodingTest // // Created by Omer Janjua on 08/03/2018. // Copyright © 2018 Omer Janjua. All rights reserved. // import SDWebImage class MovieDetailViewModel { var movie: Movie? init(selectedMovie: Movie) { movie = selectedMovie } func getMovieDetails() -> Movie { let imageView = UIImageView() if let image = self.movie?.imagePath { imageView.sd_setImage(with: URL(string: imageBaseURL + image), placeholderImage: #imageLiteral(resourceName: "placeholder_icon")) } movie?.image = imageView.image return movie! } }
[ -1 ]
958fc609f5562f026b92d42baa6ed67e9ba5b731
abfb919fe5bdb34e08038a1dbd5c359109c8b30b
/TwoFAuth/UI/Main/Models/OneTimePassword.swift
2d72e14881b1d48c10d8165f164a4747b1f13270
[ "MIT" ]
permissive
2FAuth/2FAuth-iOS
c2b149b553707bc13f9d293b92e5e2ec9553b242
dcd9a3fb3855e690de59d2ecc235b64157ab0fc4
refs/heads/master
2022-06-18T17:01:52.744298
2022-06-08T07:07:59
2022-06-08T07:07:59
251,301,793
38
6
MIT
2022-06-08T07:08:00
2020-03-30T12:45:27
Swift
UTF-8
Swift
false
false
2,186
swift
// // Created by Andrew Podkovyrin // Copyright © 2020 Andrew Podkovyrin. All rights reserved. // // Licensed under the MIT License (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://opensource.org/licenses/MIT // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // import Foundation final class OneTimePassword { let persistentToken: PersistentToken let searchQuery: String var issuer: String { persistentToken.token.issuer } var account: String { persistentToken.token.name } let code: String let canManualRefresh: Bool private var _formattedTitle: NSAttributedString? init(persistentToken: PersistentToken, searchQuery: String, date: Date, groupSize: Int) { self.persistentToken = persistentToken self.searchQuery = searchQuery let token = persistentToken.token let password = (try? token.generator.password(at: date)) ?? "" code = password.split(by: groupSize) if case .counter = token.generator.factor { canManualRefresh = true } else { canManualRefresh = false } } } // MARK: Equatable extension OneTimePassword: Equatable { static func == (lhs: OneTimePassword, rhs: OneTimePassword) -> Bool { lhs === rhs } } // MARK: Hashable extension OneTimePassword: Hashable { func hash(into hasher: inout Hasher) { hasher.combine(persistentToken) } } // MARK: Getting Value extension OneTimePassword { func plainCode() -> String { code.removeWhitespaces() } } // MARK: Internal extension OneTimePassword { func formattedTitleValue() -> NSAttributedString? { _formattedTitle } func updateFormattedTitleValue(_ formattedTitle: NSAttributedString?) { _formattedTitle = formattedTitle } }
[ -1 ]
305a58587d641b25804420bd9152efd4ce1b7c92
5894f72deebb9099c27e5ea49369a4673731c9a1
/Meow/PostTypePickerViewController.swift
1ffc0b19830d8b8852cdc0a8f1d300327dfc2732
[ "Apache-2.0" ]
permissive
sjtu-meow/iOS
6df2d7abdde250864550f6d33611917eea565257
d002b85a6463ec92a3fdcfc8fa4bae2e5ea08e8b
refs/heads/master
2021-01-17T12:52:27.819223
2017-09-14T08:45:12
2017-09-14T08:49:35
95,404,614
1
0
null
null
null
null
UTF-8
Swift
false
false
1,028
swift
// // PostTypePickerViewController.swift // Meow // // Created by 林武威 on 2017/7/4. // Copyright © 2017年 喵喵喵的伙伴. All rights reserved. // import UIKit class PostTypeViewController: UIViewController { class func show(from viewController: UIViewController) { let vc = R.storyboard.main.postTypePickerViewController()! viewController.navigationController?.pushViewController(vc, animated: true) } @IBAction func postMoment(_ sender: Any) { let vc = R.storyboard.postPages.postMomentController()! navigationController!.pushViewController(vc, animated: true) } @IBAction func postArticle(_ sender: Any) { let vc = R.storyboard.postPages.postArticleController()! navigationController!.pushViewController(vc, animated: true) } @IBAction func postQuestion(_ sender: Any) { let vc = R.storyboard.postPages.postQuestionController()! navigationController!.pushViewController(vc, animated: true) } }
[ -1 ]
f508dad8ca089d51685f4386e8200026711a68e0
12ce83c6da2a001edf57edd767919437fa4bcf0b
/Library/ViewModels/DashboardProjectsDrawerViewModelTests.swift
cd6f72521335486d315d48eb891930dcf4eb7719
[ "Apache-2.0", "MIT", "BSD-3-Clause", "LicenseRef-scancode-facebook-software-license" ]
permissive
ggf005/ios-oss
cd4ac773c22e4f4fbac5ed0585e61cc121bda116
67f7b3f657b988592a0c2b6e2916b61c97a32482
refs/heads/master
2021-07-19T03:17:10.970584
2019-05-13T23:01:35
2019-05-13T23:01:35
186,586,489
0
0
Apache-2.0
2019-05-14T09:09:48
2019-05-14T09:09:47
null
UTF-8
Swift
false
false
3,404
swift
import XCTest import Result import ReactiveSwift import Prelude @testable import KsApi @testable import Library @testable import ReactiveExtensions_TestHelpers internal final class DashboardProjectsDrawerViewModelTests: TestCase { internal let vm: DashboardProjectsDrawerViewModelType = DashboardProjectsDrawerViewModel() let projectsDrawerData = TestObserver<[ProjectsDrawerData], NoError>() let notifyDelegateToCloseDrawer = TestObserver<(), NoError>() let notifyDelegateDidAnimateOut = TestObserver<(), NoError>() let notifyDelegateProjectCellTapped = TestObserver<Project, NoError>() let focusScreenReaderOnFirstProject = TestObserver<(), NoError>() let project1 = .template |> Project.lens.id .~ 4 let project2 = .template |> Project.lens.id .~ 6 let data1 = [ProjectsDrawerData(project: .template |> Project.lens.id .~ 4, indexNum: 0, isChecked: true)] let data2 = [ ProjectsDrawerData( project: .template |> Project.lens.id .~ 4, indexNum: 0, isChecked: true), ProjectsDrawerData( project: .template |> Project.lens.id .~ 6, indexNum: 1, isChecked: false) ] internal override func setUp() { super.setUp() self.vm.outputs.projectsDrawerData.observe(self.projectsDrawerData.observer) self.vm.outputs.notifyDelegateToCloseDrawer.observe(self.notifyDelegateToCloseDrawer.observer) self.vm.outputs.notifyDelegateDidAnimateOut.observe(self.notifyDelegateDidAnimateOut.observer) self.vm.outputs.notifyDelegateProjectCellTapped.observe(self.notifyDelegateProjectCellTapped.observer) self.vm.outputs.focusScreenReaderOnFirstProject.observe(self.focusScreenReaderOnFirstProject.observer) } func testConfigureWith() { self.vm.inputs.configureWith(data: data1) self.projectsDrawerData.assertValueCount(0) self.vm.inputs.viewDidLoad() self.projectsDrawerData.assertValues([data1]) self.vm.inputs.configureWith(data: data2) self.projectsDrawerData.assertValueCount(1) self.vm.inputs.viewDidLoad() self.projectsDrawerData.assertValues([data1, data2]) } func testProjectTapped() { self.vm.inputs.configureWith(data: data1) self.vm.inputs.viewDidLoad() self.notifyDelegateProjectCellTapped.assertValueCount(0) self.vm.inputs.projectCellTapped(project1) self.notifyDelegateProjectCellTapped.assertValues([project1]) } func testAnimateOut_OnBackgroundTapped() { self.vm.inputs.configureWith(data: data1) self.vm.inputs.viewDidLoad() self.vm.inputs.animateInCompleted() self.notifyDelegateToCloseDrawer.assertValueCount(0) self.vm.inputs.backgroundTapped() self.notifyDelegateToCloseDrawer.assertValueCount(1) self.notifyDelegateDidAnimateOut.assertValueCount(0) self.vm.inputs.animateOutCompleted() self.notifyDelegateToCloseDrawer.assertValueCount(1, "Drawer close does not emit") self.notifyDelegateDidAnimateOut.assertValueCount(1, "Notify delegate animate out complete emits") } func testAnimateIn_FocusOnFirstProject() { let isVoiceOverRunning = { true } withEnvironment(isVoiceOverRunning: isVoiceOverRunning) { self.vm.inputs.configureWith(data: data1) self.vm.inputs.viewDidLoad() self.focusScreenReaderOnFirstProject.assertValueCount(0) self.vm.inputs.animateInCompleted() self.focusScreenReaderOnFirstProject.assertValueCount(1) } } }
[ -1 ]
6963ebca5d540182e7f6e4f8f7d853c7e69c419e
9581b78ed7308913691a83bb29d0f9a19e3d8075
/RemindersApp/AppDelegate.swift
7d6761c378c7b3eceb94aff98136eada22a8dade
[]
no_license
Lumkooo/RemindersApp
7e0db32d0c6f26be7d8fb051620fee7c7cc4caa5
c6f9cbba9be32e09f06b65b8ae21c92b7d5c28d4
refs/heads/main
2023-03-19T11:22:34.377640
2021-01-21T05:05:17
2021-01-21T05:05:17
331,519,474
0
0
null
null
null
null
UTF-8
Swift
false
false
3,654
swift
// // AppDelegate.swift // RemindersApp // // Created by Андрей Шамин on 1/21/21. // import UIKit import CoreData @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. } // 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: "RemindersApp") 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, 249351, 328199, 377866, 372747, 379914, 199180, 326668, 329233, 349202, 350738, 186387, 262677, 330774, 324121, 245274, 377371, 345630, 340511, 384032, 362529, 349738, 394795, 404523, 262701, 349744, 361524, 337975, 343609, 375867, 333373, 418366, 339009, 413250, 214087, 352840, 377930, 337994, 370253, 173647, 200784, 330319, 436306, 333395, 244308, 374358, 329815, 254042, 402522, 326239, 322658, 340579, 333422, 349295, 204400, 173169, 339571, 330868, 344693, 268921, 343167, 192639, 344707, 330884, 336516, 266374, 385670, 346768, 268434, 409236, 336548, 333988, 356520, 379048, 377001, 361644, 402614, 361655, 325308, 339132, 343231, 403138, 244933, 337606, 322758, 367816, 257738, 342736, 257751, 385242, 366300, 350433, 345826, 395495, 363755, 343276, 346348, 338158, 325358, 251122, 212722, 350453, 338679, 393465, 351482, 264961, 115972, 268552, 346890, 362251, 328460, 333074, 257814, 333592, 397084, 342813, 257824, 362272, 377120, 334631, 336680, 389416, 384298, 254252, 271150, 366383, 328497, 257842, 339768, 326969, 257852, 384828, 386365, 375615, 204606, 339792, 358737, 389970, 361299, 155476, 257880, 361305, 330584, 362843, 429406, 374112, 439137, 353633, 355184, 361333, 332156, 337277, 245120, 260992, 380802, 389506, 337290, 155020, 337813, 348565, 250262, 333221, 373671, 333736, 356781, 252845, 268210, 370610, 210356, 342452, 370102, 338362, 327612, 358335, 380352, 201157, 393670, 187334, 349128, 347081, 333766, 336325, 339400, 358347, 272848, 379856, 399317, 249302, 379863, 372697, 155102, 182754, 360429, 338927, 330224, 379895, 257020, 254461 ]
6bb8aff2dfe0a0172684cf50e303c994619eded9
d7c85a6ad46e85f150a0fe2167052da84fd7a49a
/PhotoAppWalkAlong/SignUp/ViewController/ViewController.swift
07a66566068edbe7300d4983871c463f90de379d
[]
no_license
Betzer09/UnitTests
96c1606bdf6a699f868f6bda943abdae8a80ee1a
3834015458138a9f02241a42699ef288322c0fa5
refs/heads/main
2023-07-11T13:57:52.110870
2021-08-13T20:55:41
2021-08-13T20:55:41
395,766,115
0
0
null
null
null
null
UTF-8
Swift
false
false
286
swift
// // ViewController.swift // PhotoAppWalkAlong // // Created by Austin Betzer on 8/13/21. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } }
[ 385282, 275714, 420381, 351170, 351481, 350187, 257900, 352876, 209998, 330960, 396725, 345751, 360440, 357209, 257882, 361595, 362845, 384830 ]
11da7151c79481ac96f48769025111b3e75733e7
bcf9c50d78b044955b4b12c90f61aee8ff611a0c
/Person.swift
095e92af6cdc6e14ecb0d71388f3db4c7bfd1bfd
[]
no_license
natebirkholz/Code-Fellows-C19-Class-Roster-Part-1
f5859654bcbe48bf4f21c1a8290f7229ee6e5b71
8efa5f41345601f337aabefef9b9bc94bebc6527
refs/heads/master
2020-07-09T23:00:37.706448
2014-08-05T23:22:20
2014-08-05T23:22:22
null
0
0
null
null
null
null
UTF-8
Swift
false
false
496
swift
// // Person.swift // C19_a2_Class_Roster_P1 // // Created by David Fry on 8/5/14. // Copyright (c) 2014 David Fry. All rights reserved. // import UIKit class Person: NSObject { var firstName = "" var lastName = "" var image: UIImage? init(firstName: String, lastName: String) { self.firstName = firstName self.lastName = lastName } func fullName () -> String { return "\(self.firstName) \(self.lastName)" } }
[ -1 ]
2eb769dc58aee52438f40f42a9496911e7b75a5f
b18ac515bbbc1b9c65ce31d7c5dfd1b461bf6925
/mMsgr/Controllers/ChatController/Manager/ActivityObserver/ActivityObserver.swift
bcfeae8936c8adc89ff8ffa0eb54a909e9065681
[]
no_license
jonahaung/mMsgr
d7665e2c035839b6bf601f1e050f825aa8f55390
ab807f4a9df2c1bc3b2eaa6f13af7a94856816b8
refs/heads/master
2020-09-04T05:37:03.020363
2020-07-11T14:09:36
2020-07-11T14:09:36
219,668,511
1
0
null
null
null
null
UTF-8
Swift
false
false
6,905
swift
// // ActivityObserver.swift // mMsgr // // Created by jonahaung on 10/7/18. // Copyright © 2018 Aung Ko Min. All rights reserved. // import Foundation import FirebaseFirestore import FirebaseDatabase import FirebaseAuth struct UserActivity { var isOnline: Bool var isFocused: Bool var lastSeenDate: Date var isTyping: Bool init(dic: NSDictionary) { let uid = GlobalVar.currentUser?.uid let onlineValue = dic["online"] let isOnline = onlineValue is String let isFocused = (dic[MyApp.Focused.rawValue] as? String) == uid self.isOnline = isOnline self.isFocused = isFocused if let number = onlineValue as? Int64 { self.lastSeenDate = Date.date(timestamp: number) } else { self.lastSeenDate = Date() } if isOnline && isFocused { self.isTyping = (dic[MyApp.typing.rawValue] as? String) == uid } else { self.isTyping = false } } } protocol ActivityObserverDelegate: class { func activityObserver(_ observer: ActivityObserver, didGetLastReadDate date: NSDate) func activityObserver(_ observer: ActivityObserver, updateFriendwith firestoreFriend: FriendModel) func activityObserver_didChangeActivity(activity: UserActivity?) } final class ActivityObserver { weak var delegate: ActivityObserverDelegate? private var hasReadListener: ListenerRegistration? private var incomingHasRefColRef: DocumentReference? private var outgoingHasRefColRef: DocumentReference? private var incomingUserDocRef: DocumentReference? private var myRef: DatabaseReference? private var hisRef: DatabaseReference? private var onlineStatusTag: UInt? private let friendId: String private var canShowOnlineStatus: Bool = false private var isOutgoingIsTyping = false private var isFocusing = false private var isObserving = false var activity: UserActivity? { didSet { delegate?.activityObserver_didChangeActivity(activity: activity) } } var lastReadDateTime: NSDate? { didSet { if oldValue != lastReadDateTime { if let date = lastReadDateTime { incomingHasRefColRef?.updateData([MyApp.HasRead.rawValue: NSNull()]) delegate?.activityObserver(self, didGetLastReadDate: date) } } } } init?(room: Room?) { guard let user = Auth.auth().currentUser, let friend = room?.member else { return nil } canShowOnlineStatus = userDefaults.currentBoolObjectState(for: userDefaults.showOnlineStatus) self.friendId = friend.uid let userCollectionRef = Firestore.firestore().collection(MyApp.Users.rawValue) let userDatabaseRef = Database.database().reference().child("UserActivity") incomingUserDocRef = userCollectionRef.document(friendId) incomingHasRefColRef = incomingUserDocRef?.collection(MyApp.friends.rawValue).document(user.uid) outgoingHasRefColRef = userCollectionRef.document(user.uid).collection(MyApp.friends.rawValue).document(friendId) myRef = userDatabaseRef.child(user.uid) hisRef = userDatabaseRef.child(friendId) } deinit { stop() print("DEINIT: ActivityObsercer") } } // Outgoing extension ActivityObserver { func setHasReadToLastMsg() { let data = [MyApp.HasRead.rawValue: FieldValue.serverTimestamp()] outgoingHasRefColRef?.setData(data, merge: false) } func setTyping(isTyping: Bool) { guard self.canShowOnlineStatus && activity?.isOnline == true && activity?.isFocused == true && isOutgoingIsTyping != isTyping else { return } let typingRef = myRef?.child(MyApp.typing.rawValue) isTyping ? typingRef?.setValue(friendId) : typingRef?.removeValue() isOutgoingIsTyping = isTyping print("set typing") } } // Incoming extension ActivityObserver { private func setFocus(isFocused: Bool) { guard self.canShowOnlineStatus && activity?.isOnline == true && isFocused != self.isFocusing else { return } let focusedRef = myRef?.child(MyApp.Focused.rawValue) isFocused ? focusedRef?.setValue(friendId) : focusedRef?.removeValue() self.isFocusing = isFocused print("setFocus") } private func getFriendData() { incomingUserDocRef?.getModel(FriendModel.self, completion: { [weak self] (storeFriend, error) in guard let `self` = self else { return } if let error = error { print(error.localizedDescription) return } if let storeFriend = storeFriend { self.delegate?.activityObserver(self, updateFriendwith: storeFriend) } }) } private func observeOnlineStatus() { onlineStatusTag = hisRef?.observe(.value, with: { [weak self] (snapshot) in guard let `self` = self, snapshot.exists() else { return } if let dic = snapshot.value as? NSDictionary { self.activity = UserActivity(dic: dic) if self.activity?.isOnline == true { self.setFocus(isFocused: true) }else { self.setFocus(isFocused: false) } } else { self.activity = nil } }) } private func observeHasRead() { hasReadListener = incomingHasRefColRef?.addSnapshotListener({ [weak self] (snap, err) in guard let `self` = self else { return } if let err = err { print(err.localizedDescription) return } guard snap?.exists == true, let data = snap?.data() else { return} if let timeStamp = data[MyApp.HasRead.rawValue] as? Timestamp { self.lastReadDateTime = timeStamp.dateValue() as NSDate self.incomingUserDocRef?.collection(MyApp.HasRead.rawValue).document().delete() } }) } private func stop() { guard isObserving else { return } isObserving = false setTyping(isTyping: false) setFocus(isFocused: false) hasReadListener?.remove() if let tag = onlineStatusTag { myRef?.removeObserver(withHandle: tag) } } func start() { if !isObserving && canShowOnlineStatus { isObserving = true observeOnlineStatus() observeHasRead() getFriendData() setHasReadToLastMsg() } } }
[ -1 ]
74b415acf5dcef6ac3165fc69c359bfc394d960e
c729faa17b1ab8afb770555c44552e1a9bf7aae2
/RitaPaySDK/Models/Encryption/Encryption.swift
246bdc63bc951b7bde5234162fec90027796e978
[ "MIT" ]
permissive
Rittalsd/SDK_IOS_PLUGIN
b6f9d1585ebf5a12ec7b3e2f77c098eb53037656
6b73fe078c25f863d3601e1b5a3b378a66b68cd4
refs/heads/main
2023-04-04T17:52:21.213869
2021-04-21T10:46:08
2021-04-21T10:46:08
354,686,106
0
0
null
null
null
null
UTF-8
Swift
false
false
4,363
swift
// // Encryption.swift // RitaPaySDK // // Created by Jihad Mahmoud on 29/03/2021. // import Foundation import CommonCrypto /// Encryption model to encrypt user data class Encryption { /// Singleton to Access Encryption information static let shared = Encryption() /** Main function to encrypt the password clear text - returns: Encoded password string */ func getEncryptedPassword(from string: String) -> String { guard let data = string.data(using: .utf8), let shaData = sha256(data) else { return "" } return hexEncodedString(with: shaData) } /** Helper function to encrypt password data with SHA256 encryption - returns: SHA256 encrypted password data (optional) - parameters: - data: the password data */ private func sha256(_ data: Data) -> Data? { guard let res = NSMutableData(length: Int(CC_SHA256_DIGEST_LENGTH)) else { return nil } CC_SHA256((data as NSData).bytes, CC_LONG(data.count), res.mutableBytes.assumingMemoryBound(to: UInt8.self)) return res as Data } /** Helper function to convert password encrypted data to hex string - returns: Encrypted password SHA256 hex string - parameters: - data: the SHA256 encrypted password data - uppercase: boolean to get data in uppercase with default `false` value indicate returned data will be in lowercase */ private func hexEncodedString(with data: Data, uppercase: Bool = false) -> String { return data.map { if $0 < 16 { return "0" + String($0, radix: 16, uppercase: uppercase) } else { return String($0, radix: 16, uppercase: uppercase) } }.joined() } /** Function to Encrypt user data using server public key and RSA - returns: Encrypted base64 RSA encrypted string (optional) - parameters: - key: the key string received from server - userDataString: the user data string need to be encrypted - uuid: the uuid that will be used in data encryption */ func encryptUserDataString(with key: String, uuid: String, userDataString: String) -> String? { let clearMessage = uuid + userDataString return encrypt(string: clearMessage, publicKey: key) } /** Helper function to create secure key from key string - returns: encrypted string using key string and RSA encryption (optional) - parameters: - string: the string to be encrypted - publicKey: the public key string to be used in encryption */ private func encrypt(string: String, publicKey: String?) -> String? { guard let publicKey = publicKey else { return nil } let keyString = publicKey.replacingOccurrences(of: "-----BEGIN RSA PUBLIC KEY-----\n", with: "").replacingOccurrences(of: "\n-----END RSA PUBLIC KEY-----", with: "") guard let data = Data(base64Encoded: keyString) else { return nil } var attributes: CFDictionary { return [kSecAttrKeyType : kSecAttrKeyTypeRSA, kSecAttrKeyClass : kSecAttrKeyClassPublic, kSecAttrKeySizeInBits : 2048, kSecReturnPersistentRef : true] as CFDictionary } var error: Unmanaged<CFError>? = nil guard let secKey = SecKeyCreateWithData(data as CFData, attributes, &error) else { print(error.debugDescription) return nil } return encrypt(string: string, publicKey: secKey) } /** Helper function to encrypt string with RSA and secure key - returns: encrypted string with secure key (optional) - parameters: - string: the string to be encrypted - publicKey: the secure key that will be used in encryption */ private func encrypt(string: String, publicKey: SecKey) -> String? { let buffer = [UInt8](string.utf8) var keySize = SecKeyGetBlockSize(publicKey) var keyBuffer = [UInt8](repeating: 0, count: keySize) guard SecKeyEncrypt(publicKey, SecPadding.PKCS1, buffer, buffer.count, &keyBuffer, &keySize) == errSecSuccess else { return nil } return Data(bytes: keyBuffer, count: keySize).base64EncodedString() } }
[ -1 ]
3362cea13bb35bb54bc1847b4a55e1259caffa07
d1325adc8267640e421818e18d2e36707b91d6b4
/Sources/ASNetworking/ASNetworking.swift
a3d2683cb302233c9ceaf62bb2f0f1491bd8d1d2
[ "MIT" ]
permissive
Appspia/ASNetworking
271d22922ddfe6fa11cb68a1e88cad6bb8b7e146
68f85a89761206e55767ff3dff159a12c682405e
refs/heads/master
2022-11-20T10:57:38.822837
2022-11-10T09:56:40
2022-11-10T09:56:40
154,241,983
1
0
null
null
null
null
UTF-8
Swift
false
false
5,386
swift
// // ASNetworking.swift // // Copyright (c) 2016-2018 Appspia Studio. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // 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 public enum ASLoggingMode { case none case error case all } public protocol ASNetworking: ASHttpRequestable, ASCacheRequestable {} // MARK: - Common extension ASNetworking { public func setBackgroundSessionCompletionHandler(backgroundSessionCompletionHandler: (() -> Swift.Void)?) { ASNetworkManager.shared.backgroundSessionCompletionHandler = backgroundSessionCompletionHandler } public func reachability() -> ASReachabilityStatus { return ASNetworkManager.shared.reachability.reachabilityStatus() } public func setReachabilityListener(listener: @escaping (ASReachabilityStatus) -> Void) { ASNetworkManager.shared.reachability.listener = listener } public func setGlobalLoggingMode(_ loggingMode: ASLoggingMode) { ASNetworkManager.shared.globalLoggingMode = loggingMode } } // MARK: - Http extension ASNetworking { public var httpURLSession: URLSession { get { ASNetworkManager.shared.httpURLSession } nonmutating set { ASNetworkManager.shared.httpURLSession = newValue } } public func httpRequest<T: Codable>(_ request: URLRequest) -> ASHttpResponse<T> { let response: ASHttpResponse<T> = httpRequest(session: httpURLSession, request: request) response.sessionTask?.resume() return response } public func httpRequest<T: Decodable>(requestData: ASRequestData) -> ASHttpResponse<T> { let request = URLRequest(requestData: requestData) return httpRequest(request) } } // MARK: - Cache extension ASNetworking { public var cacheURLSession: URLSession { get { ASNetworkManager.shared.cacheURLSession } nonmutating set { ASNetworkManager.shared.cacheURLSession = newValue } } public func cacheRequest(_ request: URLRequest) -> ASCacheResponse { let response = cacheRequest(session: cacheURLSession, request: request) response.sessionTask?.resume() return response } public func cacheRequest(requestData: ASRequestData) -> ASCacheResponse { let request = URLRequest(requestData: requestData) return cacheRequest(request) } public func setCacheCapacity(memory: Int, disk: Int) { URLCache.shared = URLCache(memoryCapacity: memory, diskCapacity: disk, diskPath: nil) } } // MARK: - Download extension ASNetworking { public var downloadURLSession: URLSession { get { ASNetworkManager.shared.downloadURLSession } nonmutating set { ASNetworkManager.shared.downloadURLSession = newValue } } public func downloadRequest(_ request: URLRequest, filePath: String) -> ASDownloadResult { let downloadRequest = ASDownloadRequest(session: downloadURLSession, request: request, filePath: filePath) if let sessionTask = downloadRequest.result.sessionTask { ASNetworkManager.shared.downloadRequests[sessionTask] = downloadRequest sessionTask.resume() } return downloadRequest.result } public func downloadRequest(requestData: ASRequestData, filePath: String) -> ASDownloadResult { let request = URLRequest(requestData: requestData) return downloadRequest(request, filePath: filePath) } } // MARK: - Upload extension ASNetworking { public var uploadURLSession: URLSession { get { ASNetworkManager.shared.uploadURLSession } nonmutating set { ASNetworkManager.shared.uploadURLSession = newValue } } public func uploadRequest(_ request: URLRequest, filePath: String) -> ASUploadResult { let uploadRequest = ASUploadRequest(session: uploadURLSession, request: request, filePath: filePath) if let sessionTask = uploadRequest.result.sessionTask { ASNetworkManager.shared.uploadRequests[sessionTask] = uploadRequest sessionTask.resume() } return uploadRequest.result } public func uploadRequest(requestData: ASRequestData, filePath: String) -> ASUploadResult { let request = URLRequest(requestData: requestData) return uploadRequest(request, filePath: filePath) } }
[ 241906 ]
66fda16c2b693e2b0b9b18e3b548f95ed577ccd6
37fc3ef97b60c566c8c4fda6b4c4f34e235ae518
/Tests/TOPUIKitTests/TOPUIKitTests.swift
39cf11f6748b344d1205fc7002eada893e73a253
[]
no_license
TOP-HiWallet/TOPUIKit
93aacc1012adf638114f5e53f3b08ab771da4143
0ca438e4d0d14125f7fd665acc19a7c9cbd349dd
refs/heads/master
2021-05-16T20:39:47.805473
2020-03-27T08:53:08
2020-03-27T08:53:08
250,460,940
0
0
null
null
null
null
UTF-8
Swift
false
false
409
swift
import XCTest @testable import TOPUIKit final class TOPUIKitTests: XCTestCase { func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct // results. XCTAssertEqual(TOPUIKit().text, "Hello, World!") } static var allTests = [ ("testExample", testExample), ] }
[ 45059, 415749, 411142, 340486, 265739, 144396, 415759, 154139, 369692, 399393, 342564, 372780, 343600, 321587, 399411, 168503, 321592, 162363, 48188, 54337, 162370, 392263, 389706, 399435, 415818, 421458, 385622, 160865, 374374, 139368, 163441, 333427, 431732, 273526, 253047, 339576, 346748, 396930, 160900, 323213, 391821, 201362, 326293, 258712, 311963, 380059, 162461, 260267, 352944, 336561, 176818, 114353, 187579, 225982, 373950, 384705, 315587, 225987, 187587, 256196, 187594, 374476, 187598, 1745, 339669, 164054, 265444, 317669, 177386, 378097, 10485, 353019, 315142, 153350, 208139, 315152, 338194, 153362, 362263, 374552, 347420, 150814, 385311, 336673, 259361, 134435, 393521, 391473, 398131, 328502, 354104, 374591, 244557, 325454, 134483, 253783, 339802, 253787, 253791, 111457, 253796, 431974, 244583, 253800, 253803, 396651, 253808, 386418, 253812, 110965, 359289, 374650, 164735, 43401, 106890, 293770, 106892, 144268, 66446, 349586, 355225, 144283, 200604, 321438, 355234, 369577, 178090, 298410, 355244, 219049, 222126, 141737, 235959, 150972, 326594, 344517, 201162, 324043, 139729, 338391, 416229, 393706, 350704, 200184 ]
10e8a8d520e1912f676cb4715dfb248c65224592
be50e01fbed3e34ead88d7ccdae55ef49da2b3f8
/Sources/Swifternetes/Models/V1APIVersions.swift
d2ca31c4575772ddfbc40b50a39566a0fda13167
[]
no_license
spprichard/Swifternetes
ade279997f5590f47ba778be39571fe37adae981
69a8596457180705b0c5cd3d60e09dec8c979480
refs/heads/master
2020-09-15T15:02:53.564191
2019-11-30T16:58:53
2019-11-30T16:58:53
223,483,693
3
0
null
2019-11-30T16:58:55
2019-11-22T20:46:02
null
UTF-8
Swift
false
false
2,084
swift
// // V1APIVersions.swift // // Generated by openapi-generator // https://openapi-generator.tech // import Foundation /** APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API. */ public struct V1APIVersions: Codable { /** APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ public var apiVersion: String? /** Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ public var kind: String? /** a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP. */ public var serverAddressByClientCIDRs: [V1ServerAddressByClientCIDR] /** versions are the api versions that are available. */ public var versions: [String] public init(apiVersion: String?, kind: String?, serverAddressByClientCIDRs: [V1ServerAddressByClientCIDR], versions: [String]) { self.apiVersion = apiVersion self.kind = kind self.serverAddressByClientCIDRs = serverAddressByClientCIDRs self.versions = versions } }
[ -1 ]
09b6b3c2352d7921620f42cee1778057f73774f6
c74437b9b6a48f7e496622b41f532bfb283ecc57
/robobo-framework-ios-pod/Classes/RoboboManagerState.swift
1a97954ce00fac66935a717fcdbfdb9b9d7f1aa4
[ "Apache-2.0" ]
permissive
mintforpeople/robobo-framework-ios-pod
5ded68333628c7e2d83192232343cff79c1422cb
ea2328905b9ac18a015a1964ba17041ef5a2dba0
refs/heads/master
2020-05-26T01:48:04.562346
2019-07-31T07:47:43
2019-07-31T07:47:43
188,065,208
1
1
null
null
null
null
UTF-8
Swift
false
false
1,155
swift
/******************************************************************************* * * Copyright 2019, Manufactura de Ingenios Tecnológicos S.L. * <http://www.mintforpeople.com> * * Redistribution, modification and use of this software are permitted under * terms of the Apache 2.0 License. * * This software is distributed in the hope that it will be useful, * but WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * Apache 2.0 License for more details. * * You should have received a copy of the Apache 2.0 License along with * this software. If not, see <http://www.apache.org/licenses/>. * ******************************************************************************/ // // RoboboManagerState.swift // robobo-framework-ios // // Created by Luis Felipe Llamas Luaces on 01/03/2019. // Copyright © 2019 mintforpeople. All rights reserved. // public enum RoboboManagerState{ case CREATED case STARTING case ALL_MODULES_LOADED case RUNNING case STOPPING case STOPPED case ERROR }
[ -1 ]
313738b274087dd00ce67688a6f52966109c7d76
f67de4018b8f534f70261708d670574993b7fae8
/LightweightCharts/Classes/Protocols/SeriesApi.swift
1c9d421005f2bdf3d63d99bd0cafd002a4b07596
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
sapunov-st/LightweightChartsIOS
84a77b28b3593b9d38d1b40800f7662e08e68ada
8aaf009a74fa1fafef530e8dd7881a4d6c1e893c
refs/heads/master
2023-07-10T06:25:24.370784
2021-08-09T20:41:05
2021-08-09T20:41:05
null
0
0
null
null
null
null
UTF-8
Swift
false
false
4,911
swift
import Foundation public protocol SeriesApi: AnyObject { associatedtype Options: SeriesOptionsCommon associatedtype TickValue: SeriesData /** * Returns current price formatter * - Returns: interface to the price formatter object that can be used to format prices in the same way as the chart does */ func priceFormatter() -> PriceFormatterApi /** * Converts specified series price to pixel coordinate according to the chart price scale * - Parameter price: input price to be converted * - Parameter completion: pixel coordinate of the price level on the chart */ func priceToCoordinate(price: Double, completion: @escaping (Coordinate?) -> Void) /** * Converts specified coordinate to price value according to the series price scale * - Parameter coordinate: input coordinate to be converted * - Parameter completion: price value of the coordinate on the chart */ func coordinateToPrice(coordinate: Double, completion: @escaping (BarPrice?) -> Void) /** * Retrieves information about the series' data within a given logical range. * * - Parameter range: - the logical range to retrieve info for * - Parameter completion: the bars info for the given logical range: fields `from` and `to` are * `Logical` values for the first and last bar within the range, and `barsBefore` and * `barsAfter` count the the available bars outside the given index range. If these * values are negative, it means that the given range us not fully filled with bars * on the given side, but bars are missing instead (would show up as a margin if the * the given index range falls into the viewport). */ func barsInLogicalRange(range: FromToRange<Double>, completion: @escaping (BarsInfo?) -> Void) /** * Applies new options to the existing series * - Parameter options: any subset of options */ func applyOptions(options: Options) /** * Returns currently applied options * - Parameter completion: full set of currently applied options, including defaults */ func options(completion: @escaping (Options?) -> Void) /** * Returns interface of the price scale the series is currently attached * - Returns: object to control the price scale */ func priceScale() -> PriceScaleApi /** * Sets or replaces series data * - Parameter data: ordered (earlier time point goes first) array of data items. * Old data is fully replaced with the new one. */ func setData(data: [TickValue]) /** * Adds or replaces a new bar * - Parameter bar: a single data item to be added. * Time of the new item must be greater or equal to the latest existing time point. * If the new item's time is equal to the last existing item's time, then the existing item is replaced with the new one. */ func update(bar: TickValue) /** * Sets or replaces series data * - Parameter data: ordered (earlier time point goes first) array of data items. * Old data is fully replaced with the new one. */ func setData(data: [WhitespaceData]) /** * Adds or replaces a new bar * - Parameter bar: a single data item to be added. * Time of the new item must be greater or equal to the latest existing time point. * If the new item's time is equal to the last existing item's time, then the existing item is replaced with the new one. */ func update(bar: WhitespaceData) /** * Sets or replaces series data * - Parameter data: ordered (earlier time point goes first) array of data items. * Old data is fully replaced with the new one. */ func setData(data: [SeriesDataType<TickValue>]) /** * Adds or replaces a new bar * - Parameter bar: a single data item to be added. * Time of the new item must be greater or equal to the latest existing time point. * If the new item's time is equal to the last existing item's time, then the existing item is replaced with the new one. */ func update(bar: SeriesDataType<TickValue>) /** * Sets markers for the series * - Parameter data: array of series markers. * This array should be sorted by time. * Several markers with same time are allowed. */ func setMarkers(data: [SeriesMarker]) /** * Creates a new price line * - Parameter options: any subset of options */ func createPriceLine(options: PriceLineOptions?) -> PriceLine /** * Removes an existing price line * - Parameter line: line to remove */ func removePriceLine(line: PriceLine) /** * Returns the type of this series * - Parameter completion: this SeriesType */ func seriesType(completion: @escaping (SeriesType?) -> Void) }
[ -1 ]
21cbd99d3bf441597ad45a6780f5ac4c073bd0d7
df24e29d89918fd124d9f82b554a56adb649b3f9
/5minShower/5minShower/WaterController.swift
b30dffffcf408f599cbc42854782199dbc2b646c
[]
no_license
SaagarGodithi/5minShower
b2025ae3713a3bae7c65a4a326a340c689cfbab1
76cd6902ddb94c03fa7f15c413ec764ce7876987
refs/heads/master
2020-04-05T23:30:11.593711
2019-06-25T16:42:42
2019-06-25T16:42:42
39,309,665
0
0
null
null
null
null
UTF-8
Swift
false
false
4,836
swift
// // WaterController.swift // Physics // // Created by Kiran Kunigiri on 7/18/15. // Copyright (c) 2015 Kiran Kunigiri. All rights reserved. // import Foundation import UIKit class WaterController: NSObject { var view: UIView = UIView() var animator = UIDynamicAnimator() var drops: [UIView] = [] //create var for start pos of rain (startX,startY), and distances between drops w/ meaningless values var startX = CGFloat(100) var startY = CGFloat(175) var distanceBetweenEachDrop = CGFloat(18) var distanceBetweenSameRow = CGFloat(50) //create light blue color for rain drops var dropColor = UIColor(red:0.56, green:0.76, blue:0.85, alpha:1.0) //initialize the gravity object and UIView var gravityBehavior = UIGravityBehavior() var showerView = UIView() //creat vars for timers for the 2 rows of rain drops var timer1 = NSTimer() var timer2 = NSTimer() func start() { // Setup the class //var for screen width var width = self.view.frame.width // Initialize Values for Position of raindrops and space between them startX = CGFloat(width * 0.425) startY = CGFloat(width * 0.23) distanceBetweenEachDrop = width * 0.048 distanceBetweenSameRow = distanceBetweenEachDrop * 2 // Initialize animator self.animator = UIDynamicAnimator(referenceView: self.view) gravityBehavior.gravityDirection.dy = 1 self.animator.addBehavior(gravityBehavior) //timer that calls spawnFirst method every 0.2 second. Produces rain drops every .2 second in 1st and 2rd row timer1 = NSTimer.scheduledTimerWithTimeInterval(0.2, target: self, selector: "spawnFirst", userInfo: nil, repeats: true) //timer that calls startSecond method then waits .1 seconds. Creates a slight delay for 2nd and 4th rows var tempTimer = NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, selector: "startSecond", userInfo: nil, repeats: false) } func startSecond() { //calls spawnSecond method every .2 seconds. Produces rain drops every .2 seconds timer2 = NSTimer.scheduledTimerWithTimeInterval(0.2, target: self, selector: "spawnSecond", userInfo: nil, repeats: true) } func addGravity(array: [UIView]) { //adds gravity to every drop in array for drop in array { gravityBehavior.addItem(drop) } //Checks if each drop is below the bottom of screen. Then removes its gravity, hides it, and removes from array for var i = 0; i < drops.count; i++ { if drops[i].frame.origin.y > self.view.frame.height { gravityBehavior.removeItem(drops[i]) drops[i].removeFromSuperview() drops.removeAtIndex(i) } } } //produces the 1st and 3rd columns of drops func spawnFirst() { //creates array of UIViews (drops) var thisArray: [UIView]? = [] //number of col of drops var numberOfDrops = 2 //for each drop in a row for (var i = 0; i < numberOfDrops; i++) { //create a UIView (a drop). Then set the size, color, and remove border of drop var drop = UIView() drop.frame = CGRectMake(startX + CGFloat(i) * distanceBetweenSameRow, startY, 1.0, 50.0) drop.backgroundColor = dropColor drop.layer.borderWidth = 0.0 //add the drop to main view self.view.insertSubview(drop, belowSubview: showerView) //add the drop to the drops array self.drops.append(drop) //add the drop to thisArray thisArray!.append(drop) } //adds gravity to the drops that were just created addGravity(thisArray!) } //produces the 2nd and 4th columns of drops. Same code as spawnFirst. Runs .1 after spawnFirst. func spawnSecond() { var thisArray: [UIView] = [] var numberOfDrops = 2 for (var i = 0; i < numberOfDrops; i++) { var location = CGFloat(150) var drop = UIView() drop.frame = CGRectMake(startX + distanceBetweenEachDrop + CGFloat(i) * distanceBetweenSameRow, startY, 1.0, 50.0) drop.backgroundColor = dropColor drop.layer.borderWidth = 0.0 self.view.insertSubview(drop, belowSubview: showerView) self.drops.append(drop) thisArray.append(drop) } addGravity(thisArray) } func stop() { //removes all objects from drops array drops = [] //stops the 2 timers from spawning drops. timer1.invalidate() timer2.invalidate() } }
[ -1 ]
4dfb6a96a4e3b93a70597da62efbfeca17d2398e
693d6d27ecc5b5ae64b248769ffeb356704634c2
/LeadLinkApp/DataLayer/Repositories/Persistence/CampaignsRepository/CampaignsRepository.swift
249d59cc18788fffd2899d5f72a1d3fbe33257c6
[]
no_license
markodimitrije/LeadLinkApp
82f4be52997fe451d3fafc635c1a275c932da669
fca60d969fdf36a9f465c28d3b89177e0883ebfc
refs/heads/master
2021-06-28T03:06:51.764722
2020-02-20T15:17:27
2020-02-20T15:17:27
164,099,716
0
0
null
null
null
null
UTF-8
Swift
false
false
3,779
swift
// // File.swift // signInApp // // Created by Marko Dimitrijevic on 04/01/2019. // Copyright © 2019 Marko Dimitrijevic. All rights reserved. // import PromiseKit import RxSwift import RealmSwift protocol CampaignsRepositoryProtocol { func getCampaignsAndQuestions(userSession: UserSession) -> Promise<Bool> // TODO: MOVE!! ... func updateImg(data: Data?, campaignId id: Int) func fetchCampaign(_ campaignId: Int) -> Observable<CampaignProtocol> } extension CampaignsRepository: CampaignsRepositoryProtocol { func getCampaignsAndQuestions(userSession: UserSession) -> Promise<Bool> { let update = when(fulfilled: [remoteAPI.getCampaignsWithQuestions(userSession: userSession)]) .then { results -> Promise<(Bool, CampaignResults)> in let promise = self.campaignsVersionChecker.needsUpdate(newJson: (results.first!).jsonString) return promise.map({ shouldUpdate -> (Bool, CampaignResults) in return (shouldUpdate, results.first!) }) }.map { (shouldUpdate, results) -> (Bool, CampaignResults) in if !shouldUpdate { // ako ne treba da update, samo izadji..... return (shouldUpdate, results) } return (self.dataStore.saveCampaignsJsonString(requestName: WebRequestName.campaignsWithQuestions, json: results.jsonString).isFulfilled, results) } return update.map { (jsonUpdated, results) -> Bool in if jsonUpdated { let campaignsWithQuestions = results.campaignsWithQuestions self.dataStore.deleteAllCampaignRelatedDataExceptJson() let allCampaignsSaved = self.dataStore.save(campaigns: campaignsWithQuestions.map {$0.0}).isFulfilled return allCampaignsSaved } else { print("CapmaignsRepository.getCampaignsAndQuestions. ne trebam update, isti json") return false } } } func updateImg(data: Data?, campaignId id: Int) { let realm = RealmFactory.make() guard let record = realm.objects(RealmCampaign.self).first(where: {$0.id == id}) else {return} //print("RealmCampaign/updateImg. image data treba da su saved... ") try? realm.write { record.imgData = data } } func fetchCampaign(_ campaignId: Int) -> Observable<CampaignProtocol> { let realm = try! Realm() guard let realmCampaign = realm.object(ofType: RealmCampaign.self, forPrimaryKey: campaignId) else { fatalError("someone asked for selected campaign, before it was saved ?!?") } return Observable.from(object: realmCampaign).map(Campaign.init) } } public class CampaignsRepository { // MARK: - Properties let dataStore: CampaignsDataStore let userSessionRepository: UserSessionRepository let remoteAPI: CampaignsRemoteAPI let questionsDataStore: QuestionsDataStoreProtocol let campaignsVersionChecker: CampaignsVersionChecker // MARK: - Methods init(userSessionRepository: UserSessionRepository, dataStore: CampaignsDataStore, questionsDataStore: QuestionsDataStoreProtocol, remoteAPI: CampaignsRemoteAPI, campaignsVersionChecker: CampaignsVersionChecker) { self.userSessionRepository = userSessionRepository self.dataStore = dataStore self.remoteAPI = remoteAPI self.questionsDataStore = questionsDataStore self.campaignsVersionChecker = campaignsVersionChecker } }
[ -1 ]
ab6c2297d48be7a7c9926fac42a177129a869cf8
0700c20d2bb2f1ed3b307dcdfbb15c5cddf8ddaa
/03-Strings-and-Characters.playground/Contents.swift
924dbacd2d80fa40dce618d024e767e82470b9e4
[]
no_license
solvery/The-Swift-2.0-Programming-Language-playground
b02e7278ce28bbb707f2ece91e1e9e2e8ffd8359
acf22d7d54561b90ef6b1a4cae7adcafbdff8ac6
refs/heads/master
2021-01-21T15:44:01.870685
2015-09-29T14:22:45
2015-09-29T14:22:45
43,370,666
0
0
null
2015-09-29T13:56:09
2015-09-29T13:56:09
null
UTF-8
Swift
false
false
5,954
swift
//:### 03-Strings and Characters //: //:孟祥月 [http://blog.csdn.net/mengxiangyue](http://blog.csdn.net/mengxiangyue) //: //: ---- //: //:本人菜鸟一个,如果哪里有错误,欢迎指出 import UIKit //:字符串字面量 使用""包裹起来 let someString = "Some string literal value" //:初始化一个空字符串 var emptyString = "" var anotherEmptyString = String() emptyString == anotherEmptyString // 判断空字符串 if emptyString.isEmpty { print("Nothing to see here") } // 字符串的可变性 不同于Objective-C Swift使用var、let对应可变、不可变; Objective-C NSString/NSMutableString var variableString = "Horse" variableString += " and carriage" let constantString = "Highlander" //constantString += " and another Highlander" // 常量不能改变 error //:Swift 的String类型是值类型。 如果您创建了一个新的字符串,那么当其进行常量、变量赋值操作或在函数/方法中传递时,会进行值拷贝。 任何情况下,都会对已有字符串值创建新副本,并对该新副本进行传递或赋值操作。在实际编译时,Swift 编译器会优化字符串的使用,使实际的复制只发生在绝对必要的情况下,这意味着您将字符串作为值类型的同时可以获得极高的性能。 //:使用字符(Working with Characters) for character in "Dog!🐶".characters { print(character) } // 使用Character类型声明一个字符 let exclamationMark: Character = "!" // 通过字符构造字符串 let catCharacters: [Character] = ["C", "a", "t", "!","🐱"] let catString = String(catCharacters) // 连接字符串和字符 let string1 = "hello" let string2 = " there" var welcome = string1 + string2 var instruction = "look over" instruction += string2 // 使用append方法添加字符 //welcome + exclamationMark welcome.append(exclamationMark) //:字符串插值 (String Interpolation)。插值字符串中写在括号中的表达式不能包含非转义双引号 (") 和反斜杠 (\),并且不能包含回车或换行符。 let multiplier = 3 let message = "\(multiplier) times 2.5 is \(Double(multiplier) * 2.5)" //:Unicode 标量 (Unicode Scalars) 介绍了一些Unicode编码的知识 自己百度吧 // String字面值中的一些特殊字符 \0 \\ \n \r \" \' 标量使用u{n}表示 let wiseWords = "\"Imagination is more important than knowledge\" - Einstein" let dollarSign = "\u{24}" let blackHeart = "\u{2665}" let sparklingHeart = "\u{1F496}" // Extended Grapheme(字母) Clusters(群集) 将一个或者多个Unicode标量组合成一个易读的字符 let eAcute: Character = "\u{E9}" let combinedEAcute: Character = "\u{65}\u{301}" eAcute == combinedEAcute // 韩语中一个音节 可以拆分 let precomposed: Character = "\u{D55C}" let decomposed: Character = "\u{1112}\u{1161}\u{11AB}" // 被标记包围 let enclosedEAcute: Character = "\u{E9}\u{20DD}" let regionalIndicatorForUS: Character = "\u{1F1FA}\u{1F1F8}" //:计算字符数量(Counting Characters) 如果需要计算占用的内存 还需要迭代计算 let unusualMenagerie = "Koala 🐨, Snail 🐌, Penguin 🐧, Dromedary 🐪" unusualMenagerie.lengthOfBytesUsingEncoding(NSUTF8StringEncoding) print("unusualMenagerie has \(unusualMenagerie.characters.count) characters") var word = "cafe" word.lengthOfBytesUsingEncoding(NSUTF8StringEncoding) print("the number of characters in \(word) is \(word.characters.count)") word += "\u{301}" word.lengthOfBytesUsingEncoding(NSUTF8StringEncoding) print("the number of characters in \(word) is \(word.characters.count)") //:访问、修改字符串 // String Indexes String.Index 字符串中对应位置的Character,由于不同字符占用的存储空间不同,所以为了获取每个字符正确的位置,必须从开始位置迭代Unicode标量获取位置 let greeting = "Guten Tag" greeting.characters.count greeting[greeting.startIndex] greeting[greeting.endIndex.predecessor()] greeting[greeting.startIndex.successor()] let index = greeting.startIndex.advancedBy(7) greeting.startIndex greeting.endIndex // 字符数+1 //greeting[greeting.endIndex] // error // Return the range of valid index values. for index in greeting.characters.indices { print("\(greeting[index]) ", terminator: "") } print("", terminator: "\n") // prints "G u t e n T a g !" // 插入、删除 welcome = "hello" welcome.insert("!", atIndex: welcome.endIndex) welcome.insertContentsOf(" there".characters, at: welcome.endIndex.predecessor()) welcome.removeAtIndex(welcome.endIndex.predecessor()) welcome // range let range = welcome.endIndex.advancedBy(-6)..<welcome.endIndex welcome.removeRange(range) //:字符串比较 // String and Character Equality == != let quotation = "We're a lot alike, you and I." let sameQuotation = "We're a lot alike, you and I." if quotation == sameQuotation { print("These two strings are considered equal") } let eAcuteQuestion = "Voulez-vous un caf\u{E9}?" let combinedEAcuteQustion = "Voulez-vous un caf\u{65}\u{301}?" if eAcuteQuestion == combinedEAcuteQustion { print("These two strings are considered equal") } let latinCapitalLetterA: Character = "\u{41}" // 英语 let cyrillicCapitalLetterA: Character = "\u{0410}" // 俄语 if latinCapitalLetterA != cyrillicCapitalLetterA { print("These two strings are not equal") } // 前缀/后缀相等 (Prefix and Suffix Equality) quotation.hasPrefix("We") quotation.hasSuffix(".") //:Unicode Representations of Strings let dogString = "Dog‼🐶" var image = UIImage(named: "String.utf8") for codeUnit in dogString.utf8 { print("\(codeUnit) ", terminator: "") } print("") image = UIImage(named: "String.utf16") for codeUnit in dogString.utf16 { print("\(codeUnit) ", terminator: "") } print("") // Unicode Scalar Representation image = UIImage(named: "String.utf32") for scalar in dogString.unicodeScalars { print("\(scalar.value) ", terminator: "") }
[ -1 ]
14959d3435c66017f367257561d2d3a5c880dd06
7850b60fe31ba9e697d52d98e23c2781cf1266ed
/AudioKit/Common/Nodes/Effects/Filters/Korg Low Pass Filter/AKKorgLowPassFilter.swift
a6d35915256cd292c1ea46ba3d333e9e74c9a891
[ "MIT" ]
permissive
colinhallett/AudioKit
b626667ad8518e51ecbc04c08f04e6df6cd776a7
10600731f5a0a3ea1cd980d4c3a991c57aa473de
refs/heads/master
2020-07-15T11:49:11.963575
2020-05-25T09:25:16
2020-05-25T09:25:16
205,553,637
0
0
MIT
2019-08-31T14:18:43
2019-08-31T14:18:43
null
UTF-8
Swift
false
false
3,692
swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ /// Analogue model of the Korg 35 Lowpass Filter /// open class AKKorgLowPassFilter: AKNode, AKToggleable, AKComponent, AKInput { public typealias AKAudioUnitType = AKKorgLowPassFilterAudioUnit /// Four letter unique description of the node public static let ComponentDescription = AudioComponentDescription(effect: "klpf") // MARK: - Properties public private(set) var internalAU: AKAudioUnitType? /// Lower and upper bounds for Cutoff Frequency public static let cutoffFrequencyRange: ClosedRange<Double> = 0.0 ... 22_050.0 /// Lower and upper bounds for Resonance public static let resonanceRange: ClosedRange<Double> = 0.0 ... 2.0 /// Lower and upper bounds for Saturation public static let saturationRange: ClosedRange<Double> = 0.0 ... 10.0 /// Initial value for Cutoff Frequency public static let defaultCutoffFrequency: Double = 1_000.0 /// Initial value for Resonance public static let defaultResonance: Double = 1.0 /// Initial value for Saturation public static let defaultSaturation: Double = 0.0 /// Filter cutoff @objc open var cutoffFrequency: Double = defaultCutoffFrequency { willSet { let clampedValue = AKKorgLowPassFilter.cutoffFrequencyRange.clamp(newValue) guard cutoffFrequency != clampedValue else { return } internalAU?.cutoffFrequency.value = AUValue(clampedValue) } } /// Filter resonance (should be between 0-2) @objc open var resonance: Double = defaultResonance { willSet { let clampedValue = AKKorgLowPassFilter.resonanceRange.clamp(newValue) guard resonance != clampedValue else { return } internalAU?.resonance.value = AUValue(clampedValue) } } /// Filter saturation. @objc open var saturation: Double = defaultSaturation { willSet { let clampedValue = AKKorgLowPassFilter.saturationRange.clamp(newValue) guard saturation != clampedValue else { return } internalAU?.saturation.value = AUValue(clampedValue) } } /// Tells whether the node is processing (ie. started, playing, or active) @objc open var isStarted: Bool { return internalAU?.isStarted ?? false } // MARK: - Initialization /// Initialize this filter node /// /// - Parameters: /// - input: Input node to process /// - cutoffFrequency: Filter cutoff /// - resonance: Filter resonance (should be between 0-2) /// - saturation: Filter saturation. /// public init( _ input: AKNode? = nil, cutoffFrequency: Double = defaultCutoffFrequency, resonance: Double = defaultResonance, saturation: Double = defaultSaturation ) { super.init(avAudioNode: AVAudioNode()) _Self.register() AVAudioUnit._instantiate(with: _Self.ComponentDescription) { avAudioUnit in self.avAudioUnit = avAudioUnit self.avAudioNode = avAudioUnit self.internalAU = avAudioUnit.auAudioUnit as? AKAudioUnitType input?.connect(to: self) self.cutoffFrequency = cutoffFrequency self.resonance = resonance self.saturation = saturation } } // MARK: - Control /// Function to start, play, or activate the node, all do the same thing @objc open func start() { internalAU?.start() } /// Function to stop or bypass the node, both are equivalent @objc open func stop() { internalAU?.stop() } }
[ -1 ]
b29c84ff48fe93ca5f09e499aa0a22bf746b31d7
7d4868b46088d0dbc2ba1f57f285c02c3f74efa1
/MoviesILike/MoviesILike/addMovieViewController.swift
5b22e694039c2713acace597bbac89b1da0f87e2
[]
no_license
ntarora/IOS
448ed91d3b858551a6623a105eba432fb2b6cb7f
fbc5d82d077a06ce3b81b5973add91b223e3fa07
refs/heads/master
2021-01-16T21:21:58.309228
2016-08-11T23:09:06
2016-08-11T23:09:06
65,379,161
0
0
null
null
null
null
UTF-8
Swift
false
false
1,158
swift
// // addMovieViewController.swift // MoviesILike // // Created by Neel A on 11/16/15. // Copyright © 2015 Neel Arora. All rights reserved. // import UIKit class addMovieViewController: UIViewController, UITextFieldDelegate { @IBOutlet var movieNameTextField: UITextField! @IBOutlet var topStarsTextField: UITextField! @IBOutlet var movieGenreTextField: UITextField! @IBOutlet var movieTrailerTextField: UITextField! @IBOutlet var rating: UISegmentedControl! 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. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
eaafb99236c8590864da27cb460775a80dd69c2c
de8904288477dafe943499c1bdf651ffb953581e
/tomato-do/NotificationCenter + Extensions.swift
4bae92389dbf1eecd211dce09c03bb74babacd3a
[]
no_license
ivkis/tomato-do
3432c165ba11f27c9307c9067699a4540a2f5d41
d5d22cd4187640ce0af2459c21d4d76b6fd33503
refs/heads/master
2021-01-20T02:12:19.138825
2017-08-04T13:31:04
2017-08-04T13:31:04
89,374,899
0
0
null
null
null
null
UTF-8
Swift
false
false
312
swift
// // NotificationCenter + Extensions.swift // tomato-do // // Created by IvanLazarev on 18/07/2017. // Copyright © 2017 Иван Лазарев. All rights reserved. // import Foundation extension Notification.Name { static let pomodoroPeriodFinished = Notification.Name("pomodoroPeriodFinished") }
[ -1 ]
7bad8e5299a501200ae5f3cfd91ba1fb50738346
a9b83733e71368fe5e3c85dea0b2a78ce7828708
/PikaTest/AppBuilder.swift
965eb5ab610df048209b5114229d6f924afb3826
[]
no_license
SanCHEESE/PikaTest
3982f684977db747cc605f4747646d5f2ff62328
58c4d079f49c64a9bfbab72e41c7a1d534701cda
refs/heads/master
2020-09-30T19:40:37.514348
2020-05-16T10:27:16
2020-05-16T10:27:16
227,358,906
0
0
null
null
null
null
UTF-8
Swift
false
false
1,208
swift
// // AppBuilder.swift // PikaTest // // Created by Alexander Bochkarev on 13.01.2020. // Copyright © 2020 Александр Бочкарев. All rights reserved. // import UIKit /// Concrete app builder final class AppBuilder { // TODO: think about generalization func buildInitialNavigationStack() -> UINavigationController { let feedViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "FeedViewController") as! FeedViewController let navigationViewController = UINavigationController(rootViewController: feedViewController) let feedCoordinator = FeedCoordinator(navigationController: navigationViewController) guard let codingUserInfoKeyManagedObjectContext = CodingUserInfoKey.managedObjectContext else { fatalError("Failed to retrieve context") } let decoder = JSONDecoder() let coreDataService = CoreDataService() decoder.userInfo[codingUserInfoKeyManagedObjectContext] = coreDataService.managedContext let apiService = APIService(decoder: decoder) feedViewController.viewModel = FeedViewModel(coordinator: feedCoordinator, apiService: apiService, cacheService: coreDataService) return navigationViewController } }
[ -1 ]
a11b5a52a0a03a8e1a1fe89757701bb9f0574281
fe5089bdf5b9ee349a039ad2ce7fa218bb8303d8
/Sources/CryptoCompareKit/Models/Display.swift
fe98e48d82675ed958d5a8291fcd0fe3cfdd75c4
[]
permissive
sger/CryptoCompareKit
00aededb75380d437ab58cb574a7dd7817ea19dc
533fecb5bcd893a5686bdc1615006caed071e5ae
refs/heads/main
2021-06-25T04:48:12.013143
2020-12-08T06:26:13
2020-12-08T06:26:13
156,070,289
2
3
MIT
2019-07-31T04:33:01
2018-11-04T10:21:11
Swift
UTF-8
Swift
false
false
2,177
swift
// // File.swift // // // Created by Spiros Gerokostas on 23/8/20. // import Foundation public struct Display: Decodable { public let fromSymbol: String? public let toSymbol: String? public let market: String? public let price: String? public let lastUpdate: String? public let lastVolume: String? public let lastVolumeTo: String? public let lastTradeId: String? public let volumeDay: String? public let volumeDayTo: String? public let volume24Hour: String? public let volume24HourTo: String? public let openDay: String? public let highDay: String? public let lowDay: String? public let open24Hour: String? public let high24Hour: String? public let low24Hour: String? public let lastMarket: String? public let change24Hour: String? public let changePct24Hour: String? public let changeDay: String? public let changePctDay: String? public let supply: String? public let mktcap: String? public let totalVolume24h: String? public let totalVolume24Hto: String? enum CodingKeys: String, CodingKey { case fromSymbol = "FROMSYMBOL" case toSymbol = "TOSYMBOL" case market = "MARKET" case price = "PRICE" case lastUpdate = "LASTUPDATE" case lastVolume = "LASTVOLUME" case lastVolumeTo = "LASTVOLUMETO" case lastTradeId = "LASTTRADEID" case volumeDay = "VOLUMEDAY" case volumeDayTo = "VOLUMEDAYTO" case volume24Hour = "VOLUME24HOUR" case volume24HourTo = "VOLUME24HOURTO" case openDay = "OPENDAY" case highDay = "HIGHDAY" case lowDay = "LOWDAY" case open24Hour = "OPEN24HOUR" case high24Hour = "HIGH24HOUR" case low24Hour = "LOW24HOUR" case lastMarket = "LASTMARKET" case change24Hour = "CHANGE24HOUR" case changePct24Hour = "CHANGEPCT24HOUR" case changeDay = "CHANGEDAY" case changePctDay = "CHANGEPCTDAY" case supply = "SUPPLY" case mktcap = "MKTCAP" case totalVolume24h = "TOTALVOLUME24H" case totalVolume24Hto = "TOTALVOLUME24HTO" } }
[ -1 ]
79c3b1a161053a462031a8ffe8c2aa3b725286bd
5fdce011fe3b7bc5e2a3d577e0a72c9cb42102e0
/DGSW-Petition_iOS/Source/Scenes/Register/RegisterPresenter.swift
40dc7fca979822bed75d06b4832815026f013f09
[]
no_license
Monsteel/DGSW-Petition_iOS
4b13145489273729c62b6110422621923d427581
11fb5c456794493b38543b9f413fcdcaa2776741
refs/heads/master
2023-05-10T06:02:55.527970
2021-06-09T00:20:51
2021-06-09T00:20:51
347,842,807
2
1
null
2021-06-09T00:20:52
2021-03-15T05:02:59
Swift
UTF-8
Swift
false
false
1,688
swift
// // RegisterPresenter.swift // DGSW-Petition_iOS // // Created by 이영은 on 2021/04/22. // import UIKit import Moya protocol RegisterPresentationLogic { func presentRegister(response: Register.Register.Response) } class RegisterPresenter: RegisterPresentationLogic { weak var viewController: RegisterDisplayLogic? // MARK: Parse and calc respnse from RegisterInteractor and send simple view model to RegisterViewController to be displayed func presentRegister(response: Register.Register.Response) { guard let error = response.error else { return displayRegister() } switch error { case .FailRegister: displayRegisterErrorMessage(error.localizedDescription) case .UnAuthorized: displayRegisterErrorMessage(error.localizedDescription) case .InternalServerError: displayRegisterErrorMessage(error.localizedDescription) case .UnhandledError: displayRegisterErrorMessage(error.localizedDescription) case .NetworkError: displayRegisterErrorMessage(error.localizedDescription) case .TokenExpiration: displayRegisterErrorMessage(error.localizedDescription) } } } extension RegisterPresenter { func displayRegister(){ let viewModel = Register.Register.ViewModel() viewController?.displayRegister(viewModel: viewModel) } func displayRegisterErrorMessage(_ errorMessage: String){ let viewModel = Register.Register.ViewModel(errorMessage: errorMessage) viewController?.displayRegister(viewModel: viewModel) } }
[ -1 ]
2cc6be402abe89c0412cfac0e40d7b4fb87936b8
7608050d16a6b3e2d17fdbab1530511e4735db7f
/BrewDoggie/Views/Recipes/RecipeRow.swift
ec81cead6a96f24303b51a196f294d1318fe45cb
[]
no_license
MarekRepinski/BrewDoggie
cef94e333ba97671a3382db901b0ac1ad7d77e43
bd361f35f90d570b2c02f0150af348b1e7130835
refs/heads/main
2023-03-01T12:54:29.476843
2021-02-07T08:42:20
2021-02-07T08:42:20
332,401,117
0
0
null
null
null
null
UTF-8
Swift
false
false
899
swift
// // RecipeRow.swift // BrewDoggie // // Created by Marek Repinski on 2021-01-25. // import SwiftUI struct RecipeRow: View { var recipe: Recipe var body: some View { HStack { recipe.image .resizable() .frame(width: 50, height: 50) Text("\(recipe.recipeType.rawValue) - \(recipe.name)") Spacer() if recipe.isFavorite { Image(systemName: "star.fill") .foregroundColor(.yellow) } } } } struct RecipeRow_Previews: PreviewProvider { static var recipies = ModelData().recipies static var previews: some View { Group { RecipeRow(recipe: recipies[0]) RecipeRow(recipe: recipies[1]) } .previewLayout(.fixed(width: 300, height: 70)) } }
[ -1 ]
0127d386502f6c295a4764da55538f4a3eef0567
f88787369d3a1c777be587bf84c209341c23929d
/superpay.vip/Model/Card.swift
36808a8d40d09b5be3fe52d6c2217d34772d3856
[]
no_license
que2018/superpay
ad8e8f7ac5dfaa8bb1bcee087b3144c8cef0f685
fb70bdf7e6cc3d6ae2c4554ccdfd4812176176b8
refs/heads/master
2020-04-13T09:09:54.980019
2018-12-25T18:30:42
2018-12-25T18:30:42
149,180,570
0
0
null
null
null
null
UTF-8
Swift
false
false
305
swift
import Foundation class Card { var localId : Int64 = 0 var balance : Double = 0 var expDateMonth : Int = 0 var expDateYear : Int = 0 var cardNumber : String = "" var hashedNumber : String = "" var id : String = "" var publisherId : Int = 0 var type : Int = 0 }
[ -1 ]
5ffa34732d2336f78bc9346f66ae837595435c73
28b9f757a391cdbc329ca24294081835e18297d3
/test-app/protocol/Protocols.swift
035b0165f3069a18d8f53dd1ca2ffa0b18bf7e8e
[]
no_license
miromax21/test-app
d9c6d17fa29adc74ad904660e04ce6666a0b3cc9
0ac44553add2bb4079986551348456939ff9cb7e
refs/heads/master
2020-06-19T12:11:58.616530
2019-11-28T05:16:27
2019-11-28T05:16:27
196,574,863
0
0
null
null
null
null
UTF-8
Swift
false
false
580
swift
// // protocols.swift // test-app // // Created by maxim mironov on 14/05/2019. // Copyright © 2019 maxim mironov. All rights reserved. // import Foundation protocol GetQuestionsProtocol{ // func getQuestions(tag:String, completion: @escaping ([ItemModel]?, String?) -> ()) func next(completion: @escaping (_ responce:Questionanswer<ItemModel>) -> ()) func getQuestions(tag:String, completion: @escaping (_ responce:Questionanswer<ItemModel>) -> ()) } enum Questionanswer<T>{ case error(items:[T]?, errorMessage:[String]) case success(items:[T]?) }
[ -1 ]
5331bc64c9f99164d634330319e3b3af35502152
2b3c8398d4d9e7b4bc2ff4a541cfc97cf3ca528f
/MuscleDiary/MuscleDiary/Config/IndicatorView.swift
d924a7542f97f48659eadf8cfd6152dbd9c55f96
[]
no_license
Dev-RubinJo/MuscleDiary-iOS
84ef5e9fe5cab3d7a00fb9fc8555b236945cc18d
ed8bc2db1aec7c91cd39b9922690f533ccc58108
refs/heads/master
2022-11-17T23:02:06.619801
2020-07-02T06:00:54
2020-07-02T06:00:54
257,638,030
0
0
null
null
null
null
UTF-8
Swift
false
false
1,564
swift
// // IndicatorView.swift // MuscleDiary // // Created by YooBin Jo on 2020/04/27. // Copyright © 2020 YooBin Jo. All rights reserved. // import UIKit open class IndicatorView { static let shared = IndicatorView() private init() {} let containerView = UIView() let activityIndicator = UIActivityIndicatorView() open func show() { let window = UIWindow(frame: UIScreen.main.bounds) self.containerView.frame = window.frame self.containerView.center = window.center self.containerView.backgroundColor = UIColor(hex: 0x000000, alpha: 0.4) self.activityIndicator.frame = CGRect(x: 0, y: 0, width: 40, height: 40) if #available(iOS 13.0, *) { self.activityIndicator.style = UIActivityIndicatorView.Style.large } else { self.activityIndicator.style = .whiteLarge } self.activityIndicator.color = UIColor.darkGray self.activityIndicator.center = self.containerView.center self.containerView.addSubview(self.activityIndicator) if #available(iOS 13.0, *) { UIApplication.shared.windows.filter { $0.isKeyWindow }.first?.addSubview(self.containerView) } else { UIApplication.shared.keyWindow?.addSubview(self.containerView) } self.activityIndicator.startAnimating() } open func dismiss() { self.activityIndicator.stopAnimating() self.containerView.removeFromSuperview() } }
[ -1 ]
dcbd75e64362b00c1ebdccef37b03aa1839f04ea
37f21a08dfcc561e9cd4fe036f6de7b4b720dd30
/MWStoryboardScenesDemo/MWStoryboardScenesDemoTests/MWStoryboardScenesDemoTests.swift
7d5f079ac1b2469637c537e46a77c89de4de407a
[ "MIT" ]
permissive
mariusw/MWStoryboardScenes
ca1e88fd42dc9f5fee76d44af8e36501592fa892
69565f67352cc3a8a3f01864bad60b54a21b301c
refs/heads/master
2020-04-15T04:58:08.440907
2016-06-20T14:17:26
2016-06-20T14:17:26
61,199,397
2
0
null
null
null
null
UTF-8
Swift
false
false
1,041
swift
// // MWStoryboardScenesDemoTests.swift // MWStoryboardScenesDemoTests // // Created by Waldal, Marius on 16/06/16. // Copyright © 2016 Lonely Penguin. All rights reserved. // import XCTest @testable import MWStoryboardScenesDemo class MWStoryboardScenesDemoTests: 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. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock { // Put the code you want to measure the time of here. } } }
[ 282633, 305179, 278558, 307231, 313375, 102437, 229413, 354343, 354345, 227370, 278570, 360491, 233517, 309295, 229424, 282672, 124975, 243759, 237620, 276534, 229430, 159807, 288833, 288834, 286788, 280649, 311372, 223316, 315476, 223318, 278615, 280661, 288857, 227417, 354393, 315487, 194656, 309345, 237663, 45153, 227428, 280675, 276582, 313447, 280677, 131178, 278634, 276589, 278638, 227439, 284788, 131189, 280694, 223350, 131191, 278655, 292992, 280712, 141450, 215178, 311435, 278670, 311438, 276627, 276632, 284825, 284826, 278685, 311458, 196773, 284841, 284842, 278704, 239793, 129203, 299187, 125109, 131256, 227513, 278714, 280762, 223419, 299198, 280768, 227524, 309444, 276682, 280778, 280795, 227548, 311519, 280802, 176362, 286958, 233715, 157944, 211193, 168188, 125188, 278797, 125198, 125199, 125203, 125208, 309529, 278810, 299293, 282909, 278816, 237857, 211235, 217380, 211238, 282919, 262450, 125235, 280887, 125240, 278842, 282939, 315706, 260418, 311621, 227654, 280902, 227658, 276813, 6481, 6482, 278869, 6489, 379225, 323935, 276835, 321894, 416104, 280939, 276847, 285040, 242033, 280961, 311681, 227725, 178578, 190871, 293274, 285084, 61857, 285090, 61859, 278961, 278965, 293303, 283064, 276920, 33211, 276925, 278978, 283075, 127427, 291267, 278989, 281040, 278993, 326100, 328152, 176601, 285150, 287198, 279008, 227809, 358882, 227813, 279013, 279018, 279022, 291311, 281072, 309744, 279029, 279032, 279039, 276998, 287241, 279050, 186893, 303631, 279057, 283153, 279062, 223767, 279065, 223769, 291358, 182817, 293419, 283182, 283184, 23092, 279094, 277048, 70209, 309830, 55881, 281166, 281171, 287318, 309846, 295519, 242277, 66150, 277094, 279144, 111208, 279146, 277101, 313966, 281199, 287346, 277111, 301689, 279164, 291454, 184962, 303746, 152203, 277133, 133774, 287374, 227990, 295576, 230040, 314009, 303771, 221852, 205471, 285353, 279210, 287404, 205487, 279217, 285361, 299699, 342706, 303793, 293556, 314040, 287417, 285371, 303803, 285373, 287422, 199366, 287433, 225995, 225997, 279252, 226004, 203477, 226007, 287452, 289502, 226019, 279269, 285415, 342762, 277227, 293612, 312047, 279280, 199414, 230134, 154359, 234234, 299770, 221948, 279294, 299776, 234241, 285444, 209670, 322313, 226058, 234250, 234253, 234263, 285466, 283419, 234268, 293664, 234277, 283430, 279336, 289576, 234283, 312108, 234286, 234289, 234294, 230199, 285497, 162621, 234301, 289598, 281408, 293693, 162626, 160575, 277316, 279362, 318278, 234311, 234312, 299849, 234317, 277325, 293711, 201551, 234323, 281427, 234326, 281433, 234331, 301918, 279392, 295776, 293730, 349026, 234340, 303972, 234343, 234346, 234355, 174963, 207732, 277366, 228215, 234360, 279417, 209785, 177019, 234361, 277370, 234366, 234367, 308092, 158593, 234372, 226181, 113542, 213894, 226184, 277381, 228234, 308107, 295824, 56208, 234386, 234387, 293781, 234392, 324506, 277403, 324507, 234400, 279456, 234404, 289703, 279464, 234409, 275371, 236461, 234419, 234425, 234427, 287677, 189374, 234430, 330689, 234436, 234438, 213960, 279498, 52172, 234444, 234445, 316364, 183248, 234451, 234454, 234457, 234463, 50143, 234466, 314342, 277479, 234472, 234473, 234477, 234482, 287731, 277492, 314355, 234498, 234500, 277509, 277510, 230410, 234506, 234514, 277523, 277524, 230423, 197657, 281625, 281626, 175132, 189474, 234531, 234534, 310317, 234542, 234548, 312373, 234555, 238651, 277563, 230463, 234560, 308287, 207938, 234565, 238664, 234569, 300111, 234577, 296019, 234583, 234584, 234587, 277597, 304222, 281697, 302177, 230499, 281700, 285798, 300135, 228458, 207979, 279660, 275565, 15471, 144496, 156785, 312434, 275571, 234609, 285814, 300151, 234616, 398457, 279672, 160891, 285820, 234622, 300158, 187521, 150657, 234625, 285828, 279685, 285830, 302213, 253063, 234632, 275591, 228491, 302216, 234638, 234642, 308372, 185493, 238743, 283802, 119963, 285851, 300187, 234656, 330913, 306338, 234659, 234663, 275625, 300201, 281771, 249002, 238765, 279728, 238769, 226481, 208058, 277690, 64700, 230588, 228540, 228542, 283840, 302274, 279747, 283847, 353482, 283852, 279760, 290000, 189652, 279765, 279774, 304351, 363744, 195811, 298212, 298213, 304356, 279792, 298228, 302325, 204022, 234742, 228600, 216315, 208124, 228609, 292107, 312587, 277792, 339234, 199971, 304421, 277800, 279854, 113966, 226608, 300343, 222524, 286013, 226624, 286018, 279875, 15686, 226632, 294218, 224586, 177484, 222541, 238927, 296273, 314709, 283991, 357719, 218462, 224606, 142689, 230756, 281957, 163175, 281962, 284014, 279920, 314741, 181625, 224640, 314758, 281992, 142729, 368011, 230799, 112017, 306579, 282007, 318875, 310692, 279974, 282022, 282024, 173491, 304564, 279989, 296375, 228795, 292283, 296387, 415171, 163269, 296391, 296392, 300487, 302540, 280013, 312782, 64975, 306639, 310736, 284116, 212442, 228827, 239068, 226781, 280032, 310757, 187878, 316902, 280041, 296425, 308723, 306677, 280055, 286202, 286205, 300542, 306692, 306693, 192010, 149007, 65041, 282129, 308756, 282136, 204313, 302623, 278060, 286254, 288309, 194110, 280130, 124485, 282183, 276040, 218696, 366154, 288327, 292425, 276045, 286288, 280147, 300630, 306776, 147036, 243292, 286306, 282213, 317032, 222832, 276085, 288378, 188031, 192131, 282245, 282246, 288392, 229001, 310923, 290443, 323217, 282259, 276120, 229020, 298654, 282271, 276126, 282273, 302754, 282276, 40613, 40614, 40615, 229029, 300714, 298667, 278191, 198324, 286388, 296628, 286391, 282303, 218819, 282312, 306890, 280267, 276173, 302797, 212688, 241361, 302802, 280278, 286423, 282327, 298712, 278233, 216795, 278234, 276195, 282339, 153319, 313065, 12010, 280300, 282348, 419569, 276210, 282355, 282358, 229113, 300794, 276219, 124669, 194303, 278272, 288512, 311042, 288516, 216839, 280327, 300811, 276238, 284431, 278291, 278293, 294678, 116505, 284442, 278299, 310131, 276253, 282400, 313120, 315171, 284459, 159533, 280366, 282417, 200498, 280372, 276282, 276283, 282427, 276287, 345919, 325439, 282434, 276294, 282438, 280392, 280390, 276298, 216918, 307031, 18262, 241495, 280410, 284507, 188251, 284512, 237408, 284514, 276327, 292712, 282474, 288619, 280430, 282480, 276344, 194429, 305026, 67463, 282504, 243597, 110480, 184208, 40853, 282518, 282519, 44952, 294809, 214937, 239514, 294814, 247712, 294823, 284587, 282549, 276408, 288697, 290746, 294850, 276421, 280519, 284619, 276430, 231375, 153554, 276444, 280541, 276454, 294886, 276459, 296941, 124911, 278512, 329712, 282612 ]
634302f6731c39e1d6f147a0b0692a2085434aac
df7459fc134f62fb845d0e886fc3f77ee2cec55a
/Mutelcore/View Controllers/Activity/ActivityPlanVC.swift
cd65572a425e648983d2e653e12af8ee5f43e7eb
[]
no_license
saroar/Medical
19166225815d851b0b0b2d4ac10f4ed0b3c05062
c4fdf50ad0f010c851589087f6bd92aa50d879dd
refs/heads/master
2020-08-14T06:07:40.955230
2018-06-07T16:27:01
2018-06-07T16:27:01
null
0
0
null
null
null
null
UTF-8
Swift
false
false
38,562
swift
// // ActivityPlanVC.swift // Mutelcore // // Created by Appinventiv on 15/06/17. // Copyright © 2017 Appinventiv. All rights reserved. // import UIKit import SwiftyJSON class ActivityPlanVC: BaseViewController { // MARK:- Proporties // ================= var previousActivityData = [PreviousActivityPlan]() var currentActivityData = [CurrentActivityPlan]() var currentDosArray = [JSON]() var currentDontsArray = [JSON]() var previousDoArray = [JSON]() var previousDontsArray = [JSON]() var totalCurrentDuration = 0.0 var totalCurrentDistance = 0.0 var totalCurrentCalories = 0 var totalPreviousDuration = 0.0 var totalPreviousDistance = 0.0 var totalPreviousCalories = 0 var previousPlanTableHeight: CGFloat = 0 var currentPlanTableHeight: CGFloat = 0 // MARK:- IBOutlets // ================ @IBOutlet weak var doctorDetailView: UIView! @IBOutlet weak var doctorNameLabel: UILabel! @IBOutlet weak var doctorSpecialityLabel: UILabel! @IBOutlet weak var activityPlanTableView: UITableView! // MARK:- ViewController Life Cycle // ================================ override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. self.setupUI() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.sideMenuBtnActn = .BackBtn self.previousActivityPlan() self.currentActivityPlan() } override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() self.setNavigationBar("Activity Plan", 2, 3) self.navigationControllerOn = .dashboard } 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. } */ } //MARK:- UITableViewDataSource Methods //==================================== extension ActivityPlanVC : UITableViewDataSource{ func numberOfSections(in tableView: UITableView) -> Int{ if tableView === self.activityPlanTableView{ return 2 }else{ return 1 } } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if tableView === self.activityPlanTableView{ return 1 }else{ if tableView is DietAutoResizingTableView{ return self.previousActivityData.count }else{ return self.currentActivityData.count } } } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell{ if tableView === self.activityPlanTableView { switch indexPath.section { case 0: guard let currentPlanViewCell = tableView.dequeueReusableCell(withIdentifier: "currentPlanViewCellID", for: indexPath) as? CurrentPlanViewCell else{ fatalError("Current Plan Activity Cell not Found!") } currentPlanViewCell.shareBtnOutlet.addTarget(self, action: #selector(self.shareBtntapped(_:)), for: UIControlEvents.touchUpInside) currentPlanViewCell.dosBtnOutlt.addTarget(self, action: #selector(self.dosBtntapped(_:)), for: UIControlEvents.touchUpInside) currentPlanViewCell.dontsBtnOutlt.addTarget(self, action: #selector(self.dontsBtntapped(_:)), for: UIControlEvents.touchUpInside) currentPlanViewCell.viewAttachmentBtnOutlt.addTarget(self, action: #selector(self.currentViewAttachmentBtntapped(_:)), for: .touchUpInside) currentPlanViewCell.currentPlanTableView.delegate = self currentPlanViewCell.currentPlanTableView.dataSource = self currentPlanViewCell.currentPlanTableView.heightDelegate = self currentPlanViewCell.currentPlanTableView.reloadData() currentPlanViewCell.populateData(self.totalCurrentDuration, self.totalCurrentDistance, self.totalCurrentCalories) if !self.currentActivityData.isEmpty{ currentPlanViewCell.populateCurrentData(self.currentActivityData) } return currentPlanViewCell case 1: guard let previousActivityCell = tableView.dequeueReusableCell(withIdentifier: "pastActivityPlanTableViewCellID", for: indexPath) as? PastActivityPlanTableViewCell else{ fatalError("Cell Not Found!") } previousActivityCell.doBtnOutlt.addTarget(self, action: #selector(self.dosBtntapped(_:)), for: UIControlEvents.touchUpInside) previousActivityCell.dontsBtnOutlt.addTarget(self, action: #selector(self.dontsBtntapped(_:)), for: UIControlEvents.touchUpInside) previousActivityCell.viewAttachmentBtnOult.addTarget(self, action: #selector(self.previousViewAttachmentBtntapped(_:)), for: .touchUpInside) previousActivityCell.pastActivityPlanTableView.delegate = self previousActivityCell.pastActivityPlanTableView.dataSource = self previousActivityCell.pastActivityPlanTableView.heightDelegate = self previousActivityCell.previousActivityCollectionView.delegate = self previousActivityCell.previousActivityCollectionView.dataSource = self previousActivityCell.pastActivityPlanTableView.reloadData() if !self.previousActivityData.isEmpty{ previousActivityCell.populateData(self.previousActivityData) } return previousActivityCell // case 1: guard let previousActivityDurationDateCell = tableView.dequeueReusableCell(withIdentifier: "previousActivityDurationDateCellID", for: indexPath) as? PreviousActivityDurationDateCell else{ // // fatalError("Current Plan Activity Cell not Found!") // } // // if !self.currentActivityData.isEmpty { // // previousActivityDurationDateCell.populateCurrentData(self.currentActivityData, index: indexPath) // previousActivityDurationDateCell.noDataAvailiableLabel.isHidden = true // previousActivityDurationDateCell.activityDurationDatelabel.isHidden = false // previousActivityDurationDateCell.imageBeforeDurationDate.isHidden = false // previousActivityDurationDateCell.imageAfterDurationDate.isHidden = false // previousActivityDurationDateCell.shareBtnOult.isHidden = false // // }else{ // // previousActivityDurationDateCell.noDataAvailiableLabel.isHidden = false // previousActivityDurationDateCell.activityDurationDatelabel.isHidden = true // previousActivityDurationDateCell.imageBeforeDurationDate.isHidden = true // previousActivityDurationDateCell.imageAfterDurationDate.isHidden = true // previousActivityDurationDateCell.shareBtnOult.isHidden = true // previousActivityDurationDateCell.noDataAvailiableLabel.text = "No Current Plans." // // } // // return previousActivityDurationDateCell // // case 2: guard let currentActivityplantableViewCell = tableView.dequeueReusableCell(withIdentifier: "pastActivityPlanTableViewCellID", for: indexPath) as? PastActivityPlanTableViewCell else{ // // fatalError("Past Plan Activity Cell not Found!") // } // // currentActivityplantableViewCell.delegate = self // // if !self.currentActivityData.isEmpty{ // // currentActivityplantableViewCell.currentActivityPlanData = self.currentActivityData // currentActivityplantableViewCell.cellCountOnCurrentActivity = .currentActivity // currentActivityplantableViewCell.pastActivityPlanTableView.reloadData() // } // // return currentActivityplantableViewCell // // case 3: guard let dosAndDontsCell = tableView.dequeueReusableCell(withIdentifier: "dosAndDontsCellID", for: indexPath) as? DosAndDontsCell else{ // // fatalError("Dos And Donts Cell not Found!") // } // // dosAndDontsCell.dosBtnOult.addTarget(self, action: #selector(self.dosBtntapped(_:)), for: UIControlEvents.touchUpInside) // dosAndDontsCell.dontsBtnOutlt.addTarget(self, action: #selector(self.dontsBtntapped(_:)), for: UIControlEvents.touchUpInside) // // return dosAndDontsCell // // default : fatalError("Cell not Found!") // // } // // case 1: switch indexPath.row { // // case 0: guard let activityCollectionCell = tableView.dequeueReusableCell(withIdentifier: "measurementListCollectionCellID", for: indexPath) as? MeasurementListCollectionCell else{ // // fatalError("activityCollectionCell Cell not Found!") // } // // activityCollectionCell.contentView.backgroundColor = #colorLiteral(red: 0.937254902, green: 0.937254902, blue: 0.937254902, alpha: 1) //// activityCollectionCell.measurementMentCollectionViewLeadingConstraint.constant = 2 //// activityCollectionCell.measurementMentCollectionViewTrailingConstraint.constant = 2 // activityCollectionCell.measurementListCollectionView.dataSource = self // activityCollectionCell.measurementListCollectionView.delegate = self // // if !self.previousActivityData.isEmpty{ // // activityCollectionCell.measurementListCollectionView.reloadData() // // } // // return activityCollectionCell // // case 1: guard let previousActivityDurationDateCell = tableView.dequeueReusableCell(withIdentifier: "previousActivityDurationDateCellID", for: indexPath) as? PreviousActivityDurationDateCell else{ // // fatalError("Current Plan Activity Cell not Found!") // } // // if !self.previousActivityData.isEmpty{ // // previousActivityDurationDateCell.populateData(self.previousActivityData, indexPath) // previousActivityDurationDateCell.activityDurationDatelabel.isHidden = false // previousActivityDurationDateCell.imageBeforeDurationDate.isHidden = false // previousActivityDurationDateCell.imageAfterDurationDate.isHidden = false // previousActivityDurationDateCell.noDataAvailiableLabel.isHidden = true // previousActivityDurationDateCell.shareBtnOult.isHidden = false // // }else{ // // previousActivityDurationDateCell.activityDurationDatelabel.isHidden = true // previousActivityDurationDateCell.imageBeforeDurationDate.isHidden = true // previousActivityDurationDateCell.imageAfterDurationDate.isHidden = true // previousActivityDurationDateCell.activityDurationDatelabel.isHidden = true // previousActivityDurationDateCell.noDataAvailiableLabel.isHidden = false // previousActivityDurationDateCell.noDataAvailiableLabel.text = "No Previous Plans." // previousActivityDurationDateCell.shareBtnOult.isHidden = true // } // // previousActivityDurationDateCell.shareBtnOult.addTarget(self, action: #selector(self.shareBtntapped(_:)), for: UIControlEvents.touchUpInside) // // return previousActivityDurationDateCell // // case 2: guard let previousActivityplanTableViewCell = tableView.dequeueReusableCell(withIdentifier: "pastActivityPlanTableViewCellID", for: indexPath) as? PastActivityPlanTableViewCell else{ // // fatalError("Past Plan Activity Cell not Found!") // } // // previousActivityplanTableViewCell.delegate = self // // if !self.previousActivityData.isEmpty { // // previousActivityplanTableViewCell.previousActivityPlanData = self.previousActivityData // previousActivityplanTableViewCell.cellCountOnCurrentActivity = .previousActivity // previousActivityplanTableViewCell.pastActivityPlanTableView.reloadData() // // } // // return previousActivityplanTableViewCell // // case 3: guard let dosAndDontsCell = tableView.dequeueReusableCell(withIdentifier: "dosAndDontsCellID", for: indexPath) as? DosAndDontsCell else{ // // fatalError("Dos And Donts Cell not Found!") // } // // dosAndDontsCell.dosBtnOult.addTarget(self, action: #selector(self.dosBtntapped(_:)), for: UIControlEvents.touchUpInside) // dosAndDontsCell.dontsBtnOutlt.addTarget(self, action: #selector(self.dontsBtntapped(_:)), for: UIControlEvents.touchUpInside) // // return dosAndDontsCell // // default : fatalError("Cell Not Found!") // // } default : fatalError("Sections Not Found!") } }else{ guard let viewAttachmentCell = tableView.dequeueReusableCell(withIdentifier: "viewAttachmentCellID") as? ViewAttachmentCell else{ fatalError("viewAttachmentCell not found!") } if tableView is DietAutoResizingTableView { if !previousActivityData.isEmpty { viewAttachmentCell.populatePreviousActivityData(self.previousActivityData, indexPath) } }else{ if !currentActivityData.isEmpty{ viewAttachmentCell.populateCurrentActivityData(self.currentActivityData, indexPath) } } return viewAttachmentCell } } } //MARK:- AutoResizingTableViewDelegate Methods //============================================ extension ActivityPlanVC : AutoResizingTableViewDelegate { func didUpdateTableHeight(_ tableView: UITableView, height: CGFloat) { if tableView is DietAutoResizingTableView, currentPlanTableHeight < height { currentPlanTableHeight = height NSObject.cancelPreviousPerformRequests(withTarget: self) perform(#selector(reloadTable), with: self, afterDelay: 0.05) } else if tableView !== self.activityPlanTableView, previousPlanTableHeight < height { previousPlanTableHeight = height NSObject.cancelPreviousPerformRequests(withTarget: self) perform(#selector(reloadTable), with: self, afterDelay: 0.05) } } func reloadTable() { self.activityPlanTableView.beginUpdates() self.activityPlanTableView.endUpdates() } } //MARK:- UITableViewDelegate Methods //=================================== extension ActivityPlanVC : UITableViewDelegate { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat{ if indexPath.section == 0, tableView === self.activityPlanTableView { return 360+currentPlanTableHeight } else if indexPath.section == 1, tableView === self.activityPlanTableView { return 287+previousPlanTableHeight } return UITableViewAutomaticDimension } func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat { if tableView === self.activityPlanTableView { return 400 }else{ return 30 } } func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat{ if tableView === self.activityPlanTableView { return 35 }else{ return 0 } } func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat{ return CGFloat(0) } func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { if tableView === self.activityPlanTableView { guard let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "activityPlanDateCellID") as? ActivityPlanDateCell else { fatalError("HeaderView Not Found!") } if section == 0{ headerView.activityStatusLabel.text = "CURRENT" headerView.activityDateLabel.text = Date().stringFormDate(DateFormat.ddMMMYYYY.rawValue) }else{ headerView.activityStatusLabel.text = "PREVIOUS" if !self.previousActivityData.isEmpty{ if let planStartDate = previousActivityData[0].planStartDate{ headerView.activityDateLabel.text = planStartDate.dateFString(DateFormat.utcTime.rawValue, DateFormat.ddMMMYYYY.rawValue) } } } return headerView } else{ return nil } } } //MARK:- UICollectionViewDataSource //================================= extension ActivityPlanVC : UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int{ return 3 } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell{ guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "activityPlanCollectionCellID", for: indexPath) as? ActivityPlanCollectionCell else{ fatalError("ActivityPlanCollectionCell Not Found!") } cell.averageLabel.isHidden = true if indexPath.item == 0 { cell.cellImageView.image = #imageLiteral(resourceName: "icActivityplanClock") cell.activityValueLabel.text = String(self.totalPreviousDuration) cell.activityValueLabel.textColor = #colorLiteral(red: 0.05098039216, green: 0.3215686275, blue: 0.5647058824, alpha: 1) cell.activityUnitLabel.text = "mins" }else if indexPath.item == 1{ cell.cellImageView.image = #imageLiteral(resourceName: "icActivityplanDistance") cell.activityValueLabel.text = String(self.totalPreviousDistance) cell.activityValueLabel.textColor = #colorLiteral(red: 1, green: 0.5450980392, blue: 0.05882352941, alpha: 1) cell.activityUnitLabel.text = "kms" }else{ cell.cellImageView.image = #imageLiteral(resourceName: "icActivityplanCal") cell.activityValueLabel.text = String(self.totalPreviousCalories) cell.activityValueLabel.textColor = #colorLiteral(red: 0.5921568627, green: 0.03921568627, blue: 0.05098039216, alpha: 1) cell.activityUnitLabel.text = "kcal" } return cell } } //MARK:- UICollectionViewDelegateFlowLayout //========================================= extension ActivityPlanVC : UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { return CGSize(width: (collectionView.frame.width / 3) - 4, height: collectionView.frame.height - 4) } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets{ return UIEdgeInsets(top: 2, left: 0, bottom: 2, right: 0) } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat{ return CGFloat(2) } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat{ return CGFloat(2) } } //MARK:- Methods //============== extension ActivityPlanVC { // MARK: SetupUI // ============= fileprivate func setupUI(){ self.doctorDetailView.backgroundColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) self.doctorNameLabel.font = AppFonts.sanProSemiBold.withSize(16) self.doctorSpecialityLabel.font = AppFonts.sansProRegular.withSize(11.3) self.doctorSpecialityLabel.textColor = #colorLiteral(red: 0.003921568627, green: 0, blue: 0, alpha: 1) self.activityPlanTableView.backgroundColor = #colorLiteral(red: 0.952861011, green: 0.9529944062, blue: 0.9528189301, alpha: 1) self.activityPlanTableView.dataSource = self self.activityPlanTableView.delegate = self self.registerNibs() } // MARk: Register Nibs // =================== fileprivate func registerNibs(){ let currentPlanViewNib = UINib(nibName: "CurrentPlanViewCell", bundle: nil) let dosAndDontsCellNib = UINib(nibName: "DosAndDontsCell", bundle: nil) let measurementListCollectionCellNib = UINib(nibName: "MeasurementListCollectionCell", bundle: nil) let previousActivityDurationDateCellNib = UINib(nibName: "PreviousActivityDurationDateCell", bundle: nil) let pastActivityPlanTableViewCellNib = UINib(nibName: "PastActivityPlanTableViewCell", bundle: nil) let activityPlanDateCellNib = UINib(nibName: "ActivityPlanDateCell", bundle: nil) let previousActivityPlanNib = UINib(nibName: "TargetCalorieTableCell", bundle: nil) self.activityPlanTableView.register(previousActivityPlanNib, forCellReuseIdentifier: "targetCalorieTableCellID") self.activityPlanTableView.register(currentPlanViewNib, forCellReuseIdentifier: "currentPlanViewCellID") self.activityPlanTableView.register(dosAndDontsCellNib, forCellReuseIdentifier: "dosAndDontsCellID") self.activityPlanTableView.register(measurementListCollectionCellNib, forCellReuseIdentifier: "measurementListCollectionCellID") self.activityPlanTableView.register(previousActivityDurationDateCellNib, forCellReuseIdentifier: "previousActivityDurationDateCellID") self.activityPlanTableView.register(pastActivityPlanTableViewCellNib, forCellReuseIdentifier: "pastActivityPlanTableViewCellID") self.activityPlanTableView.register(activityPlanDateCellNib, forHeaderFooterViewReuseIdentifier: "activityPlanDateCellID") } // MARK: Share Button Tapped // ========================= @objc fileprivate func shareBtntapped(_ sender : UIButton){ let shareText = "Check My Activity" let ActivityController = UIActivityViewController(activityItems: [shareText], applicationActivities: nil) self.present(ActivityController, animated: true, completion: nil) } @objc fileprivate func dosBtntapped(_ sender : UIButton){ guard let index = sender.tableViewIndexPathIn(self.activityPlanTableView) else{ return } switch index.section { case 0 : self.openDosDontsAddSubView(self.currentDosArray, dosBtnTapped: true) case 1: self.openDosDontsAddSubView(self.previousDoArray, dosBtnTapped: true) default : return } } @objc fileprivate func dontsBtntapped(_ sender : UIButton){ guard let index = sender.tableViewIndexPathIn(self.activityPlanTableView) else{ return } switch index.section { case 0 : self.openDosDontsAddSubView(self.currentDontsArray, dosBtnTapped: false) case 1: self.openDosDontsAddSubView(self.previousDontsArray, dosBtnTapped: false) default : return } } fileprivate func openDosDontsAddSubView(_ dosDontsArray : [JSON], dosBtnTapped : Bool){ let dosAndDontsScene = DosDontsVC.instantiate(fromAppStoryboard: .Activity) dosAndDontsScene.dosDontsValues = dosDontsArray if dosBtnTapped == true{ dosAndDontsScene.buttonTapped = .dos }else{ dosAndDontsScene.buttonTapped = .donts } dosAndDontsScene.view.frame = CGRect(x: 0, y: UIDevice.getScreenHeight, width: UIDevice.getScreenWidth, height: UIDevice.getScreenHeight) UIView.animate(withDuration: 0.3) { dosAndDontsScene.view.frame = CGRect(x: 0, y: 0 , width: UIDevice.getScreenWidth, height: UIDevice.getScreenHeight) } sharedAppDelegate.window?.addSubview(dosAndDontsScene.view) self.addChildViewController(dosAndDontsScene) } // MARK:- CurrentViewAttachment // =========================== @objc fileprivate func currentViewAttachmentBtntapped(_ sender : UIButton){ if !self.currentActivityData.isEmpty{ var attachmentUrl = [String]() var attachmentName = [String]() if self.currentActivityData[0].attachments!.count > 1{ if let attachUrl = self.currentActivityData[0].attachments, !attachUrl.isEmpty { attachmentUrl = attachUrl.components(separatedBy: ",") } if let attachName = self.currentActivityData[0].attachemntsName, !attachName.isEmpty { attachmentName = attachName.components(separatedBy: ",") } self.attachmentView(attachmentUrl, attachmentName) }else{ var attachmentUrl = "" var attachmentName = "" if !self.currentActivityData[0].attachments!.isEmpty{ attachmentUrl = self.currentActivityData[0].attachments! } if self.currentActivityData[0].attachemntsName!.isEmpty{ attachmentName = self.currentActivityData[0].attachemntsName! } self.openWebView(attachmentUrl, attachmentName) } } } @objc fileprivate func previousViewAttachmentBtntapped(_ sender : UIButton){ if !self.previousActivityData.isEmpty{ var attachmentUrl = [String]() var attachmentName = [String]() if self.previousActivityData[0].attachments!.count > 1{ if let attachUrl = self.previousActivityData[0].attachments, !attachUrl.isEmpty { attachmentUrl = attachUrl.components(separatedBy: ",") } if let attachName = self.previousActivityData[0].attachemntsName, !attachName.isEmpty { attachmentName = attachName.components(separatedBy: ",") } self.attachmentView(attachmentUrl, attachmentName) }else if self.previousActivityData[0].attachments!.count > 0 && self.previousActivityData[0].attachments!.count <= 1 { var attachmentUrl = "" var attachmentName = "" if !self.previousActivityData[0].attachments!.isEmpty{ attachmentUrl = self.previousActivityData[0].attachments! } if self.previousActivityData[0].attachemntsName!.isEmpty{ attachmentName = self.previousActivityData[0].attachemntsName! } self.openWebView(attachmentUrl, attachmentName) } } } fileprivate func attachmentView(_ attachmentUrl : [String], _ attachmentName : [String]){ let dosAndDontsScene = DosDontsVC.instantiate(fromAppStoryboard: .Activity) dosAndDontsScene.attachmentURl = attachmentUrl dosAndDontsScene.attachmentName = attachmentName dosAndDontsScene.buttonTapped = .attachment dosAndDontsScene.view.frame = CGRect(x: 0, y: UIDevice.getScreenHeight, width: UIDevice.getScreenWidth, height: UIDevice.getScreenHeight) UIView.animate(withDuration: 0.3) { dosAndDontsScene.view.frame = CGRect(x: 0, y: 0 , width: UIDevice.getScreenWidth, height: UIDevice.getScreenHeight) } sharedAppDelegate.window?.addSubview(dosAndDontsScene.view) self.addChildViewController(dosAndDontsScene) } fileprivate func openWebView(_ attachmentUrl : String, _ attachmentName : String){ let webViewScene = WebViewVC.instantiate(fromAppStoryboard: .Measurement) webViewScene.webViewUrl = attachmentUrl webViewScene.screenName = attachmentName self.navigationController?.pushViewController(webViewScene, animated: true) } } //MARK :- WebServices //=================== extension ActivityPlanVC { func previousActivityPlan(){ let params = [String : Any]() WebServices.getPreviousActivity(parameters: params, success: { (_ previousActivityData : [PreviousActivityPlan], _ dos : [JSON], _ donts : [JSON]) in if !previousActivityData.isEmpty { self.previousActivityData = previousActivityData for i in 0...previousActivityData.count - 1 { if let caloriesBurn = previousActivityData[i].caloriesBurn{ self.totalPreviousCalories = self.totalPreviousCalories + caloriesBurn } if let totalDuration = previousActivityData[i].activityDuration{ self.totalPreviousDuration = self.totalPreviousDuration + totalDuration } if let totalDistance = previousActivityData[i].totalDistance{ self.totalPreviousDistance = self.totalPreviousDistance + totalDistance } } }else{ } if !dos.isEmpty{ self.previousDoArray = dos } if !donts.isEmpty{ self.previousDontsArray = donts } self.activityPlanTableView.reloadData() }) { (error) in showToastMessage(error.localizedDescription) } } func currentActivityPlan(){ let params = [String : Any]() WebServices.getCurrentActivity(parameters: params, success: { (_ currentActivityPlan : [CurrentActivityPlan], _ dos :[JSON], _ donts : [JSON]) in if !currentActivityPlan.isEmpty { self.currentActivityData = currentActivityPlan if let doctorName = currentActivityPlan[0].doctorname{ self.doctorNameLabel.text = doctorName }else{ self.doctorNameLabel.text = AppUserDefaults.value(forKey: AppUserDefaults.Key.doctorName).stringValue } if let doctorSpeciality = currentActivityPlan[0].doctorSpeciality{ self.doctorSpecialityLabel.text = doctorSpeciality }else{ self.doctorSpecialityLabel.text = AppUserDefaults.value(forKey: AppUserDefaults.Key.doctorSpecialization).stringValue } for i in 0...currentActivityPlan.count - 1{ if let caloriesBurn = currentActivityPlan[i].caloriesBurn{ self.totalCurrentCalories = self.totalCurrentCalories + caloriesBurn } if let totalDuration = currentActivityPlan[i].activityDuration{ self.totalCurrentDuration = self.totalCurrentDuration + totalDuration } if let totalDistance = currentActivityPlan[i].totalDistance{ self.totalCurrentDistance = self.totalCurrentDistance + totalDistance } } }else{ } if !dos.isEmpty{ self.currentDosArray = dos } if !donts.isEmpty{ self.currentDontsArray = donts } self.activityPlanTableView.reloadData() }) { (error) in showToastMessage(error.localizedDescription) } } }
[ -1 ]
180bdb5146c7df252fb69a620665995b0e0b075b
388dbe6fd20e60ec2a88bf109f56ae2e4b8eb903
/ComprasUSA/ComprasUSA/UIViewController+TaxesCalculator.swift
263f876f5e5734e128dd7e9cb7aa15f19c8fcbf0
[]
no_license
EVitelli/IOs-Projects
d0dcb79b1e8db6ec7559d7f10e240d5cf8a9f0f6
8000d484fb44092285ad0fb2d9eb97f8169399bb
refs/heads/main
2023-02-13T22:01:29.673640
2021-01-06T18:45:27
2021-01-06T18:45:27
327,397,036
0
0
null
null
null
null
UTF-8
Swift
false
false
287
swift
// // UIViewController+TaxesCalculator.swift // ComprasUSA // // Created by Erik Vitelli on 09/05/19. // Copyright © 2019 IOS. All rights reserved. // import UIKit extension UIViewController{ var taxesCalculator: TaxesCalculator{ return TaxesCalculator.shared } }
[ -1 ]
85b73d422553f1a72c4ae5af49b0557f690dc00e
5bafb9de356c3e79ed46ee9b77fceedfaddcff07
/VisitorBook/AppDelegate.swift
9bc634a0d0fb72ab0423dfec572d76146218c111
[]
no_license
matsui-kento/VisitorBook
bedb71da03b4747ef411ac4726d59dc6c960557f
9f1e1b462d219e95db23cdaa48f27cadefba14e3
refs/heads/master
2023-08-24T23:02:58.910522
2021-10-24T12:16:55
2021-10-24T12:16:55
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,401
swift
// // AppDelegate.swift // VisitorBook // // Created by matsui kento on 2021/10/22. // import UIKit import Firebase @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. FirebaseApp.configure() 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, 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, 262507, 246123, 262510, 213372, 385419, 393612, 262550, 262552, 385440, 385443, 262566, 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, 336512, 377472, 148105, 377484, 352918, 98968, 344744, 361129, 336555, 385713, 434867, 164534, 336567, 164538, 328378, 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, 328519, 336711, 328522, 426841, 197468, 254812, 361309, 361315, 361322, 328573, 377729, 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, 263462, 345382, 345399, 378169, 369978, 337222, 337229, 337234, 263508, 402791, 345448, 271730, 378227, 271745, 181638, 353673, 181643, 181649, 181654, 230809, 181670, 181673, 181678, 181681, 337329, 181684, 181690, 361917, 181696, 337349, 181703, 337365, 271839, 329191, 361960, 329194, 116210, 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, 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, 337659, 141051, 337668, 362247, 395021, 362255, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 370509, 354130, 247637, 337750, 370519, 313180, 354142, 345967, 345970, 345974, 403320, 354172, 247691, 337808, 247700, 329623, 436126, 436132, 337833, 362413, 337844, 346057, 346063, 247759, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329832, 329855, 329885, 411805, 346272, 362660, 100524, 387249, 379066, 387260, 256191, 395466, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 338152, 387306, 387312, 346355, 436473, 321786, 379134, 411903, 411916, 379152, 395538, 387349, 338199, 387352, 182558, 338211, 395566, 248111, 362822, 436555, 379233, 354673, 321910, 248186, 420236, 379278, 272786, 354727, 338352, 338381, 330189, 338386, 256472, 338403, 338409, 248308, 199164, 330252, 199186, 330267, 354855, 10828, 199249, 346721, 174695, 248425, 191084, 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, 339036, 412764, 257120, 265320, 248951, 420984, 330889, 347287, 339097, 248985, 44197, 380070, 339112, 249014, 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, 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, 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, 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, 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, 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, 324164, 356934, 348743, 381512, 324170, 324173, 324176, 389723, 332380, 373343, 381545, 340627, 373398, 184982, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 373449, 357069, 332493, 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, 324472, 398201, 119674, 324475, 430972, 340861, 324478, 340858, 324481, 373634, 324484, 324487, 381833, 324492, 324495, 430995, 324501, 324510, 422816, 324513, 398245, 201637, 324524, 340909, 324533, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 209895, 201711, 349172, 349180, 439294, 431106, 250914, 357410, 185380, 357418, 209965, 209968, 209975, 209979, 209987, 341071, 349267, 250967, 210010, 341091, 210025, 210027, 210030, 210039, 349308, 160895, 152703, 349311, 210052, 210055, 349319, 210067, 210071, 210077, 210080, 251044, 210084, 185511, 210088, 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, 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, 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, 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, 268143, 358255, 399215, 358259, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 333774, 358371, 350189, 350193, 333818, 350202, 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, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 350467, 325891, 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, 391563, 366990, 268701, 416157, 342430, 375208, 326058, 375216, 334262, 358856, 195039, 334304, 334311, 375277, 334321, 350723, 186897, 342545, 334358, 342550, 342554, 334363, 358941, 350761, 252461, 383536, 358961, 334384, 334394, 252482, 219718, 334407, 334420, 350822, 375400, 334465, 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, 162591, 326441, 326451, 326454, 244540, 326460, 375612, 260924, 326467, 244551, 326473, 326477, 326485, 416597, 342874, 326490, 326502, 375656, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 342915, 400259, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 359366, 359382, 359388, 383967, 343015, 359407, 261108, 261111, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 367723, 384107, 187502, 384114, 343154, 212094, 351364, 384135, 384139, 384143, 351381, 384160, 351397, 384168, 367794, 384181, 367800, 351423, 384191, 384198, 326855, 253130, 343244, 146642, 359649, 343270, 351466, 351479, 384249, 343306, 384269, 261389, 359694, 253200, 261393, 384275, 245020, 245029, 171302, 376110, 351534, 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, 155351, 155354, 212699, 155363, 245483, 155371, 409335, 155393, 155403, 245525, 155422, 360223, 155438, 155442, 155447, 155461, 360261, 376663, 155482, 261981, 425822, 376671, 155487, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 425845, 147317, 262005, 262008, 262011, 155516, 155521, 155525, 360326, 155531, 262027, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 384977, 393169, 155611, 155619, 253923, 155621, 253926, 327654, 204784, 393203, 360438, 253943, 393206, 393212, 155646 ]
48ec147d0264ccad6d94059f1aac602466ff550f
2e59d29a7750a8dece2f621bd4ba91001357a9c1
/SmartRoadMobile/Model/Road.swift
8b9ed185533056c654633d0c434bdfdeaad7ceb9
[]
no_license
khrpnv/SmartRoadMobile
c8892c8fc85016d7e8e4e7633b2c5379dead840f
7e1a663da65ae4ff130158ed428be41a0eba5ec8
refs/heads/master
2022-04-01T15:34:25.831251
2020-01-13T13:42:26
2020-01-13T13:42:26
228,728,805
0
0
null
null
null
null
UTF-8
Swift
false
false
774
swift
// // Road.swift // SmartRoadMobile // // Created by Illia Khrypunov on 12/18/19. // Copyright © 2019 Illia Khrypunov. All rights reserved. // import Foundation import SwiftyJSON struct Road { let id: String let address: String let length: Double let description: String let maxAllowedSpeed: Int let amountOfLines: Int let bandwidth: Int var state: String? init(object: JSON) { self.id = object["id"].stringValue self.address = object["address"].stringValue self.description = object["description"].stringValue self.maxAllowedSpeed = object["maxAllowedSpeed"].intValue self.amountOfLines = object["amountOfLines"].intValue self.length = object["length"].doubleValue self.bandwidth = object["bandwidth"].intValue } }
[ -1 ]
ae1ef3c573a568d063e4f728526090ba6571de72
b284637a24626b1fe5c4bf46db6ca0a8b20b587a
/Sources/WWLayout/Layout+Activate.swift
c9be0659219cb9ca6ff05305f2f8851f658223d4
[ "Apache-2.0" ]
permissive
ww-tech/wwlayout
3a7988c9b9f4e29bdb9566b937bf2878e39645ac
c8e74ae42ff24311b445032f19f50895d6e295ae
refs/heads/develop
2023-06-09T04:06:57.093304
2023-06-01T11:01:49
2023-06-01T11:01:49
160,233,441
57
15
Apache-2.0
2023-06-01T11:01:50
2018-12-03T18:09:11
Swift
UTF-8
Swift
false
false
3,969
swift
// // ===----------------------------------------------------------------------===// // // Layout+Activate.swift // // Created by Steven Grosmark on 5/4/18. // Copyright © 2018 WW International, Inc. // // // This source file is part of the WWLayout open source project // // https://github.com/ww-tech/wwlayout // // Copyright © 2017-2021 WW International, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // ===----------------------------------------------------------------------===// // import UIKit extension Layout { /// Find all the constraints matching `tag` in the view hierarchy that contains `view` /// - Parameters: /// - view: one of the views in the target view hierarchy /// - tag: the tag to search for public static func findConstraints(in view: UIView, tag: Int) -> [NSLayoutConstraint] { guard tag != 0 && tag != Int.min else { return [] } let layoutView = LayoutView.layoutView(for: view) return layoutView.getConstraints(with: tag) } /// Activate all constraints matching `tag` in the view hierarchy that contains `view` /// - Parameters: /// - view: one of the views in the target view hierarchy /// - tag: the tag to search for public static func activateConstraints(in view: UIView, tag: Int) { guard tag != 0 && tag != Int.min else { return } switchActiveConstraints(in: view, activeTag: tag) } /// Deactivate all constraints matching `tag` in the view hierarchy that contains `view` /// - Parameters: /// - view: one of the views in the target view hierarchy /// - tag: the tag to search for public static func deactivateConstraints(in view: UIView, tag: Int) { guard tag != 0 && tag != Int.min else { return } switchActiveConstraints(in: view, deactiveTag: tag) } /// Activate and/or deactivate all constraints matching the specified tags in the view hierarchy that contains `view` /// - Parameters: /// - view: one of the views in the target view hierarchy /// - activeTag: constraints with this tag will be activated (default is nil) /// - deactiveTag: constraints with this tag will be deactivated (default is nil) public static func switchActiveConstraints(in view: UIView, activeTag: Int? = nil, deactiveTag: Int? = nil) { guard activeTag != deactiveTag else { return } let layoutView = LayoutView.layoutView(for: view) if let deactiveTag = deactiveTag { layoutView.setActive(false, tag: deactiveTag) } if let activeTag = activeTag { layoutView.setActive(true, tag: activeTag) } } internal static func describeConstraints(in view: UIView) { var rootView = view while let superview = rootView.superview { rootView = superview } describeConstraints(in: rootView, indent: 0) } internal static func describeConstraints(in view: UIView, indent: Int) { let space = String(repeating: " ", count: indent) print("\(space)\(view)") view.constraints.lazy .compactMap { $0 as? LayoutConstraint } .forEach { constraint in print("\(space) tag=\(constraint.tag) \(constraint)") } view.subviews.forEach { describeConstraints(in: $0, indent: indent + 1) } } }
[ -1 ]
9ab6dc2089ec447e4c92cf3e7ecda8bbeecd2fc3
a25a0261c6952090b1551ba9637a334fa2cea91d
/Pokedex-SwiftUI/Pokedex-SwiftUI/Sections/PokeList/PokeListView.swift
3c984fc382654ebb4b9a038f0fb109a2f994a97c
[]
no_license
Gioevi90/Pokedex-SwiftUI
ef8cd663fa89339efcbcdd74e113d987e06e7b2d
01517be9d4da1b756c0925d7a97044e7b853018f
refs/heads/master
2023-01-28T15:54:10.076650
2020-12-08T19:10:31
2020-12-08T19:10:31
319,022,483
2
0
null
null
null
null
UTF-8
Swift
false
false
1,929
swift
import SwiftUI import Combine struct PokeListView: View { @ObservedObject var viewModel: PokeListViewModel @State var cellViewModels: [PokeListCellViewModel] = [] @State var isLoading: Bool = false var body: some View { NavigationView { ZStack { Color.background ScrollView { LazyVGrid(columns: [GridItem(spacing: 8, alignment: .center), GridItem(spacing: 8, alignment: .center)]) { ForEach(viewModel.viewModels, id: \.self) { model in NavigationLink(destination: viewModel.showDetail(model)) { PokeListCellView(viewModel: model) .onAppear(perform: { viewModel.loadNext(model: model) }) } } }.padding(.all, 8) ProgressView() .progressViewStyle(CircularProgressViewStyle(tint: .white)) .hide(if: !isLoading) } } .accentColor(Color.black) .navigationBarTitleDisplayMode(.inline) .navigationBarTitle(Text(viewModel.pageTitle)) } .onReceive(viewModel.statePublisher, perform: stateUpdate(_:)) .onAppear(perform: { viewModel.load() }) } private func stateUpdate(_ newState: PokeListViewModel.State) { switch newState { case .loading: loading() case let .update(paths): update(paths) case let .error(error): onError(error) } } private func loading() { isLoading = true } private func update(_ paths: [IndexPath]) { isLoading = false } private func onError(_ error: Error) { isLoading = false } }
[ -1 ]
a68887d3cc359cb145ae7cbce6afd80ab70a0c31
42df66d2d380438b3a5164d4d0e00bb270a94a9d
/StripeUICore/StripeUICore/Source/Validators/BSBNumber.swift
5b003a09e7e4660027d30d1125b63c17e035872c
[ "MIT" ]
permissive
stripe/stripe-ios
2472a3a693a144d934e165058c07593630439c9e
dd9e4b4c4bf7cceffc8ba661cbe2ec2430b3ce4a
refs/heads/master
2023-08-31T20:29:56.708961
2023-08-31T17:53:57
2023-08-31T17:53:57
6,656,911
1,824
1,005
MIT
2023-09-14T21:39:48
2012-11-12T16:55:08
Swift
UTF-8
Swift
false
false
1,048
swift
// // BSBNumber.swift // StripeUICore // // Copyright © 2022 Stripe, Inc. All rights reserved. // import Foundation @_spi(STP) import StripeCore @_spi(STP) public struct BSBNumber { private let number: String private let pattern: String public init(number: String) { self.number = number self.pattern = "###-###" } public var isComplete: Bool { return formattedNumber().count >= pattern.count } public func formattedNumber() -> String { guard let formatter = TextFieldFormatter(format: pattern) else { return number } let allowedCharacterSet = CharacterSet.stp_asciiDigit let result = formatter.applyFormat( to: number.stp_stringByRemovingCharacters(from: allowedCharacterSet.inverted), shouldAppendRemaining: true ) guard !result.isEmpty else { return "" } return result } public func bsbNumberText() -> String { return number.filter { $0 != "-" } } }
[ -1 ]
cd8c11ee3868b09ceeb7b191a5a8cc96022ed157
9715e318fe3f6c1c1da8454245228a3a489ec95a
/collectionviewcontroller/GameViewController.swift
fd356b30f9a128ae27c99b9ffe8879327b153ca9
[]
no_license
DenysPashkov/Just-Eat-Copy-Cat
911cdd70e216d69070bf3c691e64646303c43fc8
c60eef098f07af63e0b6d0ed4577a9526085ee6a
refs/heads/master
2022-10-05T23:57:54.484726
2020-06-08T21:25:27
2020-06-08T21:25:27
null
0
0
null
null
null
null
UTF-8
Swift
false
false
8,060
swift
// // GameViewController.swift // collectionviewcontroller // // Created by denys pashkov on 05/12/2019. // Copyright © 2019 denys pashkov. All rights reserved. // import UIKit import MapKit import CoreLocation // MARK: -ViewController class GameViewController: UIViewController { // variable for cells managment @IBOutlet weak var resturantsCollection: UICollectionView! @IBOutlet weak var ViewToHide2: UICollectionView! // variable for location managment var locationManager = CLLocationManager() var currentPosition : CLLocation? var matchingItems: [MKMapItem] = [] var setImages : [UIImage] = [] var setIcons : [UIImage] = [] // variable for second collection managment @IBOutlet weak var viewToHide: UIView! let maxDistance: CGFloat = 141 var startDragPosition: CGFloat = 0 var distanceMoved: CGFloat = 0 var lastPosition: CGFloat = 0 let iconNames : [String] = ["Pizza","Japanese","Hamburger","Sandwitch","Chicken","Desserts","Italian","Ice Cream"] override func viewDidLoad() { overrideUserInterfaceStyle = .light ViewToHide2.delegate = self ViewToHide2.dataSource = self ViewToHide2.reloadData() super.viewDidLoad() cellSetting() locationSetting() } // cell sizes func cellSetting(){ let layer = resturantsCollection.collectionViewLayout as! UICollectionViewFlowLayout let width = ( resturantsCollection.frame.width ) viewToHide.frame.size.height = CGFloat(maxDistance) layer.itemSize = CGSize(width: width , height: width) } // request for my location func locationSetting(){ self.locationManager.requestWhenInUseAuthorization() if CLLocationManager.locationServicesEnabled() { locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters locationManager.requestLocation() } } // Search for resturants func findResturant() { let request = MKLocalSearch.Request() request.naturalLanguageQuery = "Ristoranti" request.region = MKCoordinateRegion(center: currentPosition!.coordinate, latitudinalMeters: 0, longitudinalMeters: 0) let search = MKLocalSearch(request: request) search.start { response, _ in guard let response = response else { return } self.matchingItems = response.mapItems self.resturantsCollection.delegate = self self.resturantsCollection.dataSource = self } } } // MARK: -Collection View Delegate & DataSource extension GameViewController : UICollectionViewDelegate,UICollectionViewDataSource{ func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { // create the number of cells based on found resturant if collectionView == resturantsCollection{ return matchingItems.count } else { return iconNames.count } } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { if collectionView == resturantsCollection{ let cell = resturantsCollection.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) as! ResturantCellManager cell.resturantPreview.frame.size.height = (cell.frame.width / 8) * 6 // Set the resturant Name cell.resturantName.text = matchingItems[indexPath.row].name // Setting Photo and icon if setImages.count != matchingItems.count { cell.resturantPreview.image = UIImage(named: "Foto\(Int.random(in: 1...37))") setImages.append(cell.resturantPreview.image!) cell.resturantIcon.image = UIImage(named: "Icon\(Int.random(in: 1...33))") setIcons.append(cell.resturantIcon.image!) } else { cell.resturantPreview.image = setImages[indexPath.row] cell.resturantIcon.image = setIcons[indexPath.row] } // Set The Resturant Category cell.type.text = matchingItems[indexPath.row].pointOfInterestCategory?.rawValue.replacingOccurrences(of: "MKPOICategory", with: "") return cell } else { let cell = ViewToHide2.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) as! ResturantTypeCellManager cell.typeImage.image = UIImage(named: "Type\(indexPath.row).jpg") cell.typeName.text = iconNames[indexPath.row] return cell } } } // MARK: - ScrollView Delegate extension GameViewController : UIScrollViewDelegate{ func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { startDragPosition = scrollView.contentOffset.y } func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { if viewToHide.frame.height > 70{ self.viewToHide.frame = CGRect(x: 0, y: 0, width: self.view.bounds.size.width, height: maxDistance) } else if viewToHide.frame.height <= 40 { self.viewToHide.frame = CGRect(x: 0, y: 0, width: self.view.bounds.size.width, height: 0) } } func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) { if distanceMoved < maxDistance && distanceMoved > 40 { distanceMoved = maxDistance } lastPosition = distanceMoved self.viewToHide.frame = CGRect(x: 0, y: 0, width: self.view.bounds.size.width, height: distanceMoved) } func scrollViewDidScroll(_ scrollView: UIScrollView) { let offSet = scrollView.contentOffset.y distanceMoved = lastPosition + startDragPosition - offSet if offSet < maxDistance { distanceMoved = maxDistance - (offSet == -88.0 ? 0 : offSet) } else if distanceMoved > maxDistance{ distanceMoved = maxDistance } else if distanceMoved < 0 { distanceMoved = 0 } lastPosition = distanceMoved var finalPosition : CGFloat = 0 UIView.animate(withDuration: 0.2) { finalPosition = self.distanceMoved / self.maxDistance self.viewToHide.frame.size.height = self.maxDistance * finalPosition } } } // MARK: - Location Manager Delegate extension GameViewController : CLLocationManagerDelegate { func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { if status == .authorizedWhenInUse || status == .authorizedAlways { locationManager.requestLocation() } } func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { if let location = locations.first { currentPosition = location findResturant() } } func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) { print("error happened: \(error)") } }
[ -1 ]
f046addcbd0438c5544709e60bf44aac55af9fea
aa0ae334e16de2bca147ddedad7024e54d94bf76
/25-building-complete-rxswift-app/projects/starter/QuickTodo/QuickTodo/Model/TaskItem.swift
8ec23fb20a02ba6aa14b9ebcc637a1702e1be499
[]
no_license
CassianeIT/RxSwift
e8992c720b39bf77b1cc6279bcf7aee37d56d716
2f355ed0385cb438ed1b9b186660383236d050e6
refs/heads/main
2023-04-17T01:48:00.136543
2021-04-22T17:45:18
2021-04-22T17:45:18
360,631,086
0
0
null
null
null
null
UTF-8
Swift
false
false
2,286
swift
/// Copyright (c) 2020 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. /// /// Notwithstanding the foregoing, you may not use, copy, modify, merge, publish, /// distribute, sublicense, create a derivative work, and/or sell copies of the /// Software in any work that is designed, intended, or marketed for pedagogical or /// instructional purposes related to programming, coding, application development, /// or information technology. Permission for such use, copying, modification, /// merger, publication, distribution, sublicensing, creation of derivative works, /// or sale is expressly withheld. /// /// This project and source code may use libraries or frameworks that are /// released under various Open-Source licenses. Use of those libraries and /// frameworks are governed by their own individual licenses. /// /// 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 RealmSwift import RxDataSources class TaskItem: Object { @objc dynamic var uid: Int = 0 @objc dynamic var title: String = "" @objc dynamic var added: Date = Date() @objc dynamic var checked: Date? = nil override class func primaryKey() -> String? { return "uid" } } extension TaskItem: IdentifiableType { var identity: Int { return self.isInvalidated ? 0 : uid } }
[ 379393, 379394, 415242, 379404, 379405, 415244, 379407, 415248, 379409, 415250, 379411, 415245, 415253, 415254, 379415, 415249, 379422, 379423, 379424, 379425, 379426, 379427, 379431, 379436, 379437, 379438, 379439, 379444, 379449, 379451, 379453, 379454, 379456, 379459, 411715, 379461, 379462, 411719, 379466, 379470, 379472, 379473, 379474, 379475, 379476, 379477, 379482, 379483, 379485, 379487, 379490, 379492, 379495, 379497, 379504, 379509, 379511, 379512, 379513, 379514, 379515, 379520, 379525, 379526, 339591, 379528, 379527, 379531, 379532, 379535, 379536, 379538, 379546, 373403, 379547, 379551, 339617, 379554, 339619, 379557, 379558, 379560, 379561, 379562, 225963, 225965, 379565, 379566, 225968, 225966, 225970, 379570, 379572, 379573, 379574, 379575, 225976, 379577, 379578, 225972, 379579, 225983, 225984, 307403, 307404, 307405, 307406, 307408, 226011, 226012, 309981, 309983, 309984, 309985, 309986, 379616, 379617, 379618, 379620, 379625, 379631, 379634, 379635, 379638, 379640, 367870, 379649, 367874, 379650, 379652, 379653, 379654, 379655, 367879, 367881, 367882, 367883, 379660, 379661, 379662, 379663, 367884, 367887, 379664, 379665, 379667, 379669, 379670, 379668, 379672, 270631, 270635, 270636, 379691, 379694, 379695, 379698, 379699, 379700, 270645, 379703, 379704, 333629, 333631, 379715, 379718, 379720, 379721, 379722, 379725, 333648, 379735, 379737, 379738, 329563, 319324, 329568, 319329, 319330, 309605, 309606, 309607, 309608, 309611, 309612, 309615, 379250, 319349, 379253, 379263, 319360, 319362, 379270, 379271, 319370, 319377, 319379, 379284, 319381, 379285, 319383, 319384, 379289, 379290, 319385, 379287, 379291, 379298, 379306, 379307, 379308, 379309, 379310, 379311, 379312, 379314, 379315, 379316, 379318, 379324, 379328, 379332, 379333, 379336, 353737, 353738, 353740, 353743, 353744, 353745, 353746, 353748, 353749, 379351, 379354, 379369, 379370, 379372, 379373, 379375, 379376, 379386, 379387, 379388 ]
8e1bcd62aee9115a889e73c2672631ab79558db3
729b41732c0276aeed1f700a551301836b0df607
/Sources/SUV/aliases/UVTypes/UVBuffer.swift
6552cb0746ead473fe8c6d3d58ea6cda353de116
[ "MIT" ]
permissive
vi4m/SUV
d5b31364086c9f2b38dcbf39ad0050187e674703
effa7673d213cbe71c3c7b0336b7f9e71094b335
refs/heads/master
2021-01-20T05:05:12.874035
2015-12-18T19:35:37
2015-12-18T19:37:55
null
0
0
null
null
null
null
UTF-8
Swift
false
false
50
swift
import libUV public typealias UVBuffer = uv_buf_t
[ -1 ]
170cf29c267e4cbfef9184554fc8bacad7d34921
5b27f582094d43ed25c9c3d924a4919327a19f5b
/youtube-onedaybuild/Models/Video.swift
9004acc90a60e08cf246bea482958b588b4206ca
[]
no_license
cesarramos19/youtube-onedaybuild
7c966ba16a32b1b557d305dc319a24f9b440d43e
1e90326ddffb1d17917d4b23df0f1c4565de3fe9
refs/heads/master
2022-12-09T19:13:06.878469
2020-09-12T20:06:53
2020-09-12T20:06:53
293,883,292
0
0
null
null
null
null
UTF-8
Swift
false
false
1,839
swift
// // Video.swift // youtube-onedaybuild // // Created by Cesar E Ramos on 9/8/20. // Copyright © 2020 A4A, LLC. All rights reserved. // import Foundation struct Video: Decodable { var videoId = "" var title = "" var description = "" var thumbnail = "" var published = Date() enum CodingKeys: String, CodingKey { case snippet case thumbnails case high case resourceId case videoId case title case description case thumbnail = "url" case published = "publishedAt" } init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) let snippetContainer = try container.nestedContainer(keyedBy: CodingKeys.self, forKey: .snippet) // Parse title self.title = try snippetContainer.decode(String.self, forKey: .title) // Parse description self.description = try snippetContainer.decode(String.self, forKey: .description) // Parse the publish date self.published = try snippetContainer.decode(Date.self, forKey: .published) // Parse thumbnails let thumbnailContainer = try snippetContainer.nestedContainer(keyedBy: CodingKeys.self, forKey: .thumbnails) let highContainer = try thumbnailContainer.nestedContainer(keyedBy: CodingKeys.self, forKey: .high) self.thumbnail = try highContainer.decode(String.self, forKey: .thumbnail) // Parse Video ID let resourceIdContainer = try snippetContainer.nestedContainer(keyedBy: CodingKeys.self, forKey: .resourceId) self.videoId = try resourceIdContainer.decode(String.self, forKey: .videoId) } }
[ 340634 ]
805a6d983d319decb0d7dfb0171093e79b627adc
0e718e75ac6a78ea21f8bed6a6418b79b51287ac
/FavoritesTableViewController.swift
7d740d9ca98f100de9881d2433589a77825da717
[]
no_license
simomario22/FoHo
3e5c25670d28ff87a9953425f371dbb47a1ead9d
2a1baefbe4ba535630635d90f27d7d9fe327f3a4
refs/heads/master
2020-03-22T06:07:21.324578
2017-05-09T19:09:55
2017-05-09T19:09:55
null
0
0
null
null
null
null
UTF-8
Swift
false
false
4,175
swift
// // FavoritesTableViewController.swift // FoHo // // Created by Brittney Ryn on 5/5/17. // Copyright © 2017 FohoDuo. All rights reserved. // import UIKit import CoreData //View controller for displaying a lists of the users favorite recipes class FavoritesTableViewController: UITableViewController { var Favorited: [NSManagedObject] = [] var mealType: [String] = ["Main Dishes", "Desserts", "Side Dishes", "Lunch and Snacks", "Appetizers", "Salads", "Breads", "Breakfast and Brunch", "Soups", "Beverages", "Condiments and Sauces", "Cocktails"] var colors = [#colorLiteral(red: 0.2871333339, green: 0.6674844371, blue: 0.7044274964, alpha: 1), #colorLiteral(red: 0.2219267856, green: 0.5662676973, blue: 0.6493632515, alpha: 1)] override func viewDidLoad() { super.viewDidLoad() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) //1 guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { return } let managedContext = appDelegate.persistentContainer.viewContext //2 let fetchRequest = NSFetchRequest<NSManagedObject>(entityName: "Favorite") //3 do { Favorited = try managedContext.fetch(fetchRequest) } catch let error as NSError { print("Could not fetch. \(error), \(error.userInfo)") } } override func viewDidAppear(_ animated: Bool) { self.tableView.reloadData() } // MARK: - Table view data source override func numberOfSections(in tableView: UITableView) -> Int { return 1 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return Favorited.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "FavoritesCell", for: indexPath) as! FavoritesTableViewCell let item = Favorited[indexPath.row] cell.setCell(object: item) //Alternate the background color if indexPath.row % 2 == 0{ cell.backgroundColor = colors[0] } else{ cell.backgroundColor = colors[1] } return cell } //code to delete favorite from the table view override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == .delete { let appDelegate = UIApplication.shared.delegate as? AppDelegate let managedContext = appDelegate?.persistentContainer.viewContext managedContext?.delete(Favorited[indexPath.row] as NSManagedObject) do { try managedContext?.save() } catch let error as NSError { print("Could not save \(error), \(error.userInfo)") } tableView.beginUpdates() Favorited.remove(at: indexPath.row) tableView.deleteRows(at: [indexPath], with: .fade) tableView.endUpdates() } } func tableView(tableView: UITableView!, canEditRowAtIndexPath indexPath: NSIndexPath!) -> Bool { return true } // 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. if segue.identifier == "favToRecipeData"{ let cell = sender as! FavoritesTableViewCell if let indexPath = tableView.indexPath(for: cell){ let recipeData = segue.destination as! RecipeDataViewController recipeData.setFavorited(recipe: Favorited[indexPath.row]) } } } }
[ -1 ]
4667836311afe3bf2d42ff9b0e9ae47e6f9bc984
5660a7ece4bed6f52729bf1961ed5c614418de43
/Tiki/Tiki/Features/Common/TableViews/TitleTableViewCell.swift
ac26d2a625505a2596054e2e14a8583c068a4419
[]
no_license
dangtrunghieu1999/Tiki
870ae6b83461fd77743f5314ef5ebd423042d0e3
dea29e7d7f2cbfc84abc25ef5c8f443d474fd480
refs/heads/main
2023-06-02T00:31:24.147856
2021-06-18T09:35:07
2021-06-18T09:35:07
343,054,322
1
1
null
2021-05-20T02:42:27
2021-02-28T08:19:24
Swift
UTF-8
Swift
false
false
3,204
swift
// // TitleTableViewCell.swift // Tiki // // Created by Dang Trung Hieu on 4/18/21. // import UIKit class TitleTableViewCell: BaseTableViewCell { // MARK: - Variables // MARK: - UI Elements public lazy var keyCoverView: UIView = { let view = UIView() view.backgroundColor = UIColor.white return view }() lazy var nameKeyTitleLabel: UILabel = { let label = UILabel() label.textAlignment = .left label.numberOfLines = 0 label.textColor = UIColor.black label.font = UIFont.systemFont(ofSize: FontSize.h2.rawValue) return label }() public lazy var valueCoverView: UIView = { let view = UIView() view.backgroundColor = UIColor.white return view }() lazy var nameValueTitleLabel: UILabel = { let label = UILabel() label.textAlignment = .left label.numberOfLines = 0 label.textColor = UIColor.black label.font = UIFont.systemFont(ofSize: FontSize.h2.rawValue) return label }() // MARK: - View LifeCycles override func initialize() { super.initialize() layoutKeyCoverView() layoutValueCoverView() layoutNameKeyTitleLabel() layoutNameValueTitleLabel() } // MARK: - Helper Method func configTitle(keyTitle: String?, valueTitle: String?) { self.nameKeyTitleLabel.text = keyTitle self.nameValueTitleLabel.text = valueTitle } // MARK: - GET API // MARK: - Layout private func layoutKeyCoverView() { addSubview(keyCoverView) keyCoverView.snp.makeConstraints { (make) in make.width.equalTo(self.snp.width).multipliedBy(0.4) make.top.bottom.equalToSuperview() make.left.equalToSuperview() } } private func layoutNameKeyTitleLabel() { keyCoverView.addSubview(nameKeyTitleLabel) nameKeyTitleLabel.snp.makeConstraints { (make) in make.left.equalToSuperview().offset(Dimension.shared.normalMargin) make.top.equalToSuperview().offset(Dimension.shared.mediumMargin) make.right.equalToSuperview().offset(-Dimension.shared.normalMargin) make.bottom.equalToSuperview().offset(-Dimension.shared.mediumMargin) } } private func layoutValueCoverView() { addSubview(valueCoverView) valueCoverView.snp.makeConstraints { (make) in make.width.equalTo(self.snp.width).multipliedBy(0.6) make.top.bottom.equalToSuperview() make.right.equalToSuperview() } } private func layoutNameValueTitleLabel() { valueCoverView.addSubview(nameValueTitleLabel) nameValueTitleLabel.snp.makeConstraints { (make) in make.left.equalToSuperview().offset(Dimension.shared.normalMargin) make.top.equalToSuperview().offset(Dimension.shared.mediumMargin) make.right.equalToSuperview().offset(-Dimension.shared.normalMargin) make.bottom.equalToSuperview().offset(-Dimension.shared.mediumMargin) } } }
[ -1 ]
24f70617d760a50912d7fbcebd720e88aac0cedb
748c51818c867ebfbe0b47d0532705b7cda9dca3
/jira-work-log/Modules/ListSprints/View/SprintTableViewCell.swift
1962bc1121f7747fa05f20905d1ad575499e0460
[]
no_license
F3r-n4nd0/jira-work-log
0007a2f8b217e27d22d86297d5fb22d58d24298f
8478259a8280f7f5e1788e6075238e338816595f
refs/heads/master
2020-04-19T21:43:28.860772
2019-02-02T07:37:57
2019-02-02T07:37:57
168,449,967
0
0
null
null
null
null
UTF-8
Swift
false
false
508
swift
// // SprintTableViewCell.swift // jira-work-log // // Created by Fernando Luna on 1/27/19. // Copyright © 2019 Fernando Luna. All rights reserved. // import UIKit class SprintTableViewCell: UITableViewCell { 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 } }
[ 328221, 283145, 418826, 337321, 311754, 179567, 332882, 177014, 292919, 289245 ]
c5131d83762bd2b9af2e173c2c774595bccf0ebf
c7ebcc988ef9be753e733876f489df28a0b16d90
/DungeonsDragonsCC/CreateCharacter/CreateCharacterNameViewController.swift
0d3dfe68c7e2123e7114010a75fb98a979de4129
[ "MIT" ]
permissive
achappell/dungeonsanddragonscharactersheet
1261f997b5b42a8b75ff7b79c9b33fc55ef5df8f
e6e2f8af23efec32c43c2e9bbd0dc2ed715f3cb4
refs/heads/develop
2020-04-06T07:02:26.890046
2016-10-16T04:42:29
2016-10-16T04:42:29
54,393,246
0
0
null
2016-09-02T23:39:05
2016-03-21T13:57:48
Swift
UTF-8
Swift
false
false
2,833
swift
// // CreateCharacterNameViewController.swift // DungeonsDragonsCC // // Created by Amanda Chappell on 3/3/16. // Copyright © 2016 AmplifiedProjects. All rights reserved. // import UIKit import MagicalRecord class CreateCharacterNameViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource, UITextFieldDelegate { var character: Character? var selectedAlignment: String = Constants.Alignment.LawfulGood var alignments: [String] { return [Constants.Alignment.LawfulGood, Constants.Alignment.NeutralGood, Constants.Alignment.ChaoticGood, Constants.Alignment.LawfulNeutral, Constants.Alignment.Neutral, Constants.Alignment.ChaoticNeutral, Constants.Alignment.LawfulEvil, Constants.Alignment.NeutralEvil, Constants.Alignment.ChaoticEvil] } @IBOutlet var nameTextField: UITextField! @IBOutlet var genderSegmentedControl: UISegmentedControl! @IBOutlet var alignmentButton: UIButton! @IBOutlet var ageTextField: UITextField! @IBOutlet var alignmentPickerView: UIPickerView! @IBAction func save(_ sender: AnyObject) { if let character = character { if let name = self.nameTextField.text { character.name = name } if let age = ageTextField.text, let ageInt = Int16(age) { character.age = ageInt } if genderSegmentedControl.selectedSegmentIndex == 0 { character.gender = Constants.Gender.Male } else { character.gender = Constants.Gender.Female } character.alignment = selectedAlignment Character.setSelectedCharacter(character) character.managedObjectContext?.mr_saveToPersistentStore(completion: { (success, error) in self.dismiss(animated: true, completion: nil) }) } } func textFieldShouldReturn(_ textField: UITextField) -> Bool { textField.resignFirstResponder() return true } func numberOfComponents(in pickerView: UIPickerView) -> Int { return 1 } func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { return alignments.count } func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { if alignments.count > row && row >= 0 { return alignments[row] } return Constants.Alignment.LawfulGood } func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { if alignments.count > row { selectedAlignment = alignments[row] alignmentButton.setTitle(selectedAlignment, for: UIControlState()) } } }
[ -1 ]
cd19c138dfcc0953424c26d2cd9918544c7d9f4f
4877fe804d698d5d5bdff3c9994e031b8a59d286
/SiliconLabsApp/ViewControllers/IOP Test App/TestScenario/Test_4/TestHelpers/SILIOPLengthVariableTestHelper.swift
de349a4fece826646542d893ab21cdfdd3b9befd
[ "Apache-2.0" ]
permissive
j10l/Bluegecko-ios
9b40520a20403fcaba5f08c4d12193ee6de978b7
6bf9f117ea06e14b8c5cd861a3785059776c5ef4
refs/heads/master
2022-10-05T19:48:46.756584
2022-08-08T09:32:02
2022-08-08T09:32:02
124,736,501
0
0
null
null
null
null
UTF-8
Swift
false
false
7,198
swift
// // SILIOPLengthVariableTestHelper.swift // BlueGecko // // Created by Kamil Czajka on 28.4.2021. // Copyright © 2021 SiliconLabs. All rights reserved. // import Foundation class SILIOPLengthVariableTestHelper { struct TestResult { var passed: Bool var description: String? } private var testCase: SILTestCase private var peripheral: CBPeripheral! private var peripheralDelegate: SILPeripheralDelegate! private var iopCentralManager: SILIOPTesterCentralManager! private var gattOperationsTestHelper: SILIOPGATTOperationsTestHelper private var observableTokens = [SILObservableToken]() private var disposeBag = SILObservableTokenBag() private var testedCharacteristicUUID: CBUUID private var iopTestCharacteristicTypes = SILIOPPeripheral.SILIOPTestCharacteristicTypes.cbUUID private let exceptedValue_Subtest1: String private let expectedValue_Subtest2: String private var isFirstSubtest = true var testResult: SILObservable<TestResult?> = SILObservable(initialValue: nil) init(testCase: SILTestCase, testedCharacteristicUUID: CBUUID, exceptedValue_Subtest1: String, exceptedValue_Subtest2: String) { self.testCase = testCase self.testedCharacteristicUUID = testedCharacteristicUUID self.exceptedValue_Subtest1 = exceptedValue_Subtest1 self.expectedValue_Subtest2 = exceptedValue_Subtest2 gattOperationsTestHelper = SILIOPGATTOperationsTestHelper() } func injectParameters(parameters: Dictionary<String, Any>) { self.peripheral = parameters["peripheral"] as? CBPeripheral self.peripheralDelegate = parameters["peripheralDelegate"] as? SILPeripheralDelegate self.iopCentralManager = parameters["iopCentralManager"] as? SILIOPTesterCentralManager } func performTestCase() { let result = gattOperationsTestHelper.checkInjectedParameters(iopCentralManager: iopCentralManager, peripheral: peripheral, peripheralDelegate: peripheralDelegate) guard result.areValid else { self.testResult.value = TestResult(passed: false, description: result.reason) return } subscribeToPeripheralDelegate() subscribeToCentralManager() guard let iopTestCharacteristicTypes = peripheralDelegate.findService(with: iopTestCharacteristicTypes, in: peripheral) else { self.testResult.value = TestResult(passed: false, description: "Service IOP Characteristic Types not found.") return } peripheralDelegate.discoverCharacteristics(characteristics: [testedCharacteristicUUID], for: iopTestCharacteristicTypes) } private func subscribeToCentralManager() { let centralManagerSubscription = gattOperationsTestHelper.getCentralManagerSubscription(iopCentralManager: iopCentralManager, testCase: testCase) disposeBag.add(token: centralManagerSubscription) observableTokens.append(centralManagerSubscription) } private func subscribeToPeripheralDelegate() { weak var weakSelf = self let peripheralDelegateSubscription = peripheralDelegate.newStatus().observe( { status in guard let weakSelf = weakSelf else { return } switch status { case let .successForCharacteristics(characteristics): guard weakSelf.isFirstSubtest else { weakSelf.testResult.value = TestResult(passed: false, description: "Wrong invocation.") return } guard let iopTestCharacteristicTypesRWVariableLen4 = weakSelf.peripheralDelegate.findCharacteristic(with: weakSelf.testedCharacteristicUUID, in: characteristics) else { weakSelf.testResult.value = TestResult(passed: false, description: "Characteristic Types Variable Len wasn't discovered.") return } guard let dataToWrite = weakSelf.exceptedValue_Subtest1.data(withCount: 1) else { weakSelf.testResult.value = TestResult(passed: false, description: "Invalid data to write.") return } weakSelf.peripheralDelegate.writeToCharacteristic(data: dataToWrite, characteristic: iopTestCharacteristicTypesRWVariableLen4, writeType: .withResponse) case let .successWrite(characteristic: characteristic): if characteristic.uuid == weakSelf.testedCharacteristicUUID { debugPrint("DATA \(String(describing: characteristic.value?.hexa()))") weakSelf.peripheralDelegate.readCharacteristic(characteristic: characteristic) return } weakSelf.testResult.value = TestResult(passed: false, description: "Characteristic not found.") case let .successGetValue(value: data, characteristic: characteristic): if characteristic.uuid == weakSelf.testedCharacteristicUUID { debugPrint("DATA \(String(describing: data?.hexa()))") if weakSelf.isFirstSubtest, data?.hexa() == weakSelf.exceptedValue_Subtest1 { weakSelf.isFirstSubtest = false if let dataToWrite = weakSelf.expectedValue_Subtest2.data(withCount: 4) { weakSelf.peripheralDelegate.writeToCharacteristic(data: dataToWrite, characteristic: characteristic, writeType: .withResponse) } else { weakSelf.testResult.value = TestResult(passed: false, description: "Wrong data to write to characteristic.") } } else if !weakSelf.isFirstSubtest, data?.hexa() == weakSelf.expectedValue_Subtest2 { weakSelf.testResult.value = TestResult(passed: true) } else { weakSelf.testResult.value = TestResult(passed: false, description: "Wrong value in a characteristic.") } return } weakSelf.testResult.value = TestResult(passed: false, description: "Characteristic not found.") case .unknown: break default: weakSelf.testResult.value = TestResult(passed: false, description: "Unknown failure from peripheral delegate.") } }) disposeBag.add(token: peripheralDelegateSubscription) observableTokens.append(peripheralDelegateSubscription) } func invalidateObservableTokens() { for token in observableTokens { token.invalidate() } observableTokens = [] } func stopTesting() { invalidateObservableTokens() } }
[ -1 ]
71fcc201764b8de992f74880453c5d01f9a4cd96
cdf27d8d310f882f0840e06b9e0343f9072df6c8
/FarmdropTest/FarmdropTest/AppDelegate.swift
1ecd0adc3ce9b0352e6ccec380f9b6d1b452e3ce
[]
no_license
henryeverett/ios-code-test
90d35d8d7506256ced6cb22dd9fbe374080bcecb
44b2d3ba9957717fe5c6e1a22197ced10cddb84d
refs/heads/master
2021-01-13T05:17:47.582525
2017-02-20T17:08:26
2017-02-20T17:08:26
81,321,860
0
0
null
2017-02-08T11:16:25
2017-02-08T11:16:25
null
UTF-8
Swift
false
false
2,828
swift
// // AppDelegate.swift // FarmdropTest // // Created by Henry Everett on 08/02/2017. // Copyright © 2017 Henry Everett. All rights reserved. // import UIKit import CoreData @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? var managedObjectContext:NSManagedObjectContext? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { //print(FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).last) // Initialize core data store createCoreDataStack() // Set up initial view controller and pass into containing navigation controller. let producerListViewController = ProducerListViewController() let mainNavigationController = UINavigationController(rootViewController: producerListViewController) mainNavigationController.navigationBar.isTranslucent = false // Set up window self.window = UIWindow(frame: UIScreen.main.bounds) self.window?.rootViewController = mainNavigationController self.window?.makeKeyAndVisible() return true } /** Set up the core data stack and its persistent store. */ private func createCoreDataStack() { // Find URL for data model in bundle guard let modelURL = Bundle.main.url(forResource: "FarmdropModel", withExtension: "momd") else { fatalError("Error loading model from bundle") } // Create NSManagedObjectModel guard let model = NSManagedObjectModel(contentsOf: modelURL) else { fatalError("Error initializing model") } // Prepare context and give it a coordinator with model let coordinator = NSPersistentStoreCoordinator(managedObjectModel: model) let context = NSManagedObjectContext(concurrencyType: .mainQueueConcurrencyType) context.persistentStoreCoordinator = coordinator DispatchQueue.global(qos: .userInitiated).async { // Get user documents directory URL let urls = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) let docURL = urls[urls.endIndex-1] // Create persistent store let storeURL = docURL.appendingPathComponent("FarmdropModel.sqlite") do { try coordinator.addPersistentStore(ofType: NSSQLiteStoreType, configurationName: nil, at: storeURL, options: nil) } catch { fatalError("Error creating SQLite store") } } // Store context for later use managedObjectContext = context } }
[ -1 ]
2944700dd1ab1d31cf356e94807fe0371830c413
85c285ef6043916a42f5236ec3dff8052d9037f4
/Pods/sdl-rkx/sdl-rkx/Classes/utils/UIColor+String.swift
3847006cabb7d779b42acfad3e6915930a489095
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
smalldatalab/RKitBase
4f5b2259437789b1318e183ba687c59ae7158782
0f9a665765bc4a65fa9e954c28ff7a86823f8ea1
refs/heads/master
2020-09-27T09:48:54.482190
2016-08-18T23:17:06
2016-08-18T23:17:06
66,015,674
1
1
null
null
null
null
UTF-8
Swift
false
false
663
swift
// // UIColor+String.swift // sdl-rkx // // Created by James Kizer on 4/5/16. // Copyright © 2016 Cornell Tech Foundry. All rights reserved. // import UIKit extension UIColor { // Assumes input like "#00FF00" (#RRGGBB). convenience init(hexString: String) { let scanner = NSScanner(string: hexString) scanner.scanLocation = 1 var x: UInt32 = 0 scanner.scanHexInt(&x) let red: CGFloat = CGFloat((x & 0xFF0000) >> 16)/255.0 let green: CGFloat = CGFloat((x & 0xFF00) >> 8)/255.0 let blue: CGFloat = CGFloat(x & 0xFF)/255.0 self.init(red: red, green: green, blue: blue, alpha:1.0) } }
[ -1 ]
c1ddf1ea930db5465f783c4fa3588a8a52c49667
e887d893b75b64fa8b08848af0493d2fd508715b
/SwiftHub/Models/Notification.swift
54d415ee9ae67d69e3c02b370aa92865bb08eafb
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
khoren93/SwiftHub
d4aebbb13c55a20c561c7cede77b136d349a4d99
b2d7a45409e46e0e1a8ef5ee7d7d46ba35c41aeb
refs/heads/master
2023-07-02T11:40:49.197246
2023-05-03T06:33:18
2023-05-03T06:33:18
78,011,995
3,219
578
MIT
2021-01-04T11:28:57
2017-01-04T12:02:59
Swift
UTF-8
Swift
false
false
1,489
swift
// // Notification.swift // SwiftHub // // Created by Khoren Markosyan on 9/19/18. // Copyright © 2018 Khoren Markosyan. All rights reserved. // // Model file Generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport import Foundation import ObjectMapper struct Notification: Mappable { var id: String? var lastReadAt: Date? var reason: String? var repository: Repository? var subject: Subject? var subscriptionUrl: String? var unread: Bool? var updatedAt: Date? var url: String? init?(map: Map) {} init() {} mutating func mapping(map: Map) { id <- map["id"] lastReadAt <- (map["last_read_at"], ISO8601DateTransform()) reason <- map["reason"] repository <- map["repository"] subject <- map["subject"] subscriptionUrl <- map["subscription_url"] unread <- map["unread"] updatedAt <- (map["updated_at"], ISO8601DateTransform()) url <- map["url"] } } extension Notification: Equatable { static func == (lhs: Notification, rhs: Notification) -> Bool { return lhs.id == rhs.id } } struct Subject: Mappable { var latestCommentUrl: String? var title: String? var type: String? var url: String? init?(map: Map) {} init() {} mutating func mapping(map: Map) { latestCommentUrl <- map["latest_comment_url"] title <- map["title"] type <- map["type"] url <- map["url"] } }
[ -1 ]
107547fd894ad4f23c10214acd10b86937be4c51
1d2bbeda56f8fede69cd9ebde6f5f2b8a50d4a41
/medium/swift/c0277_556_next-greater-element-iii/00_leetcode_0277.swift
60ae19ea77186db9f8d79d8b8614aec3f61c6b75
[]
no_license
drunkwater/leetcode
38b8e477eade68250d0bc8b2317542aa62431e03
8cc4a07763e71efbaedb523015f0c1eff2927f60
refs/heads/master
2020-04-06T07:09:43.798498
2018-06-20T02:06:40
2018-06-20T02:06:40
127,843,545
0
2
null
null
null
null
UTF-8
Swift
false
false
622
swift
// DRUNKWATER TEMPLATE(add description and prototypes) // Question Title and Description on leetcode.com // Function Declaration and Function Prototypes on leetcode.com //556. Next Greater Element III //Given a positive 32-bit integer n, you need to find the smallest 32-bit integer which has exactly the same digits existing in the integer n and is greater in value than n. If no such positive 32-bit integer exists, you need to return -1. //Example 1: //Input: 12 //Output: 21 // Example 2: //Input: 21 //Output: -1 // //class Solution { // func nextGreaterElement(_ n: Int) -> Int { // } //} // Time Is Money
[ -1 ]
65290d4dc3538eceb46e7604eff9cc9a1bc7713f
3445ea3db7a0d4c5617228ee26e3da99924e14b6
/MySlideMenu/ViewController.swift
d8cb8a17141b501541764228c7adfccff62f5314
[ "MIT" ]
permissive
copysolo/MySlideMenu
31646d8bb6d57ac5c4e300f99436911e7d427466
65e1167f4f9b690d0efa013a5f15d4366cb7b18b
refs/heads/master
2022-07-15T15:08:35.493314
2020-05-15T18:28:39
2020-05-15T18:28:39
264,268,177
0
0
null
2020-05-15T18:28:40
2020-05-15T18:22:41
Swift
UTF-8
Swift
false
false
328
swift
// // ViewController.swift // MySlideMenu // // Created by Solo on 18/04/2020. // Copyright © 2020 CopySolo_. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } }
[ -1 ]
2e4292629b27affa4b8667a3cd1f35b6d94ec0b4
57fbb671f172d7d39ba317729f67403cc80c90a8
/StockExchange/NetworkHelper.swift
e06206cf7cab37d749c90d028a7e3f48a80aade1
[]
no_license
architabansal6/StockExchange
12cc761221e8cae108a41c0132e0bb1ec58352d4
ba4413662292a413b0963b673e956c14c5e7ade2
refs/heads/master
2021-01-01T05:29:23.959337
2016-04-20T19:36:25
2016-04-20T19:36:25
56,619,950
0
0
null
null
null
null
UTF-8
Swift
false
false
1,298
swift
// // NetworkHelper.swift // StockExchange // // Created by Archita Bansal on 20/04/16. // Copyright © 2016 Archita Bansal. All rights reserved. // import UIKit protocol GraphDataDelegate{ func getStringData(data:NSString) } class NetworkHelper: NSObject,NSURLSessionDataDelegate,NSURLSessionDelegate { static var sharedInstance = NetworkHelper() var delegate : GraphDataDelegate? func sendGetRequest(url:NSURL){ let request = NSMutableURLRequest(URL:url) request.HTTPMethod = "GET" let config = NSURLSessionConfiguration.defaultSessionConfiguration() let session = NSURLSession(configuration: config, delegate: self, delegateQueue: nil) let task = session.dataTaskWithRequest(request) task.resume() } func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) { let stringData = NSString(data: data, encoding: NSUTF8StringEncoding) print(stringData) if let data = stringData{ if delegate?.getStringData(data) != nil{ delegate?.getStringData(data) } } } }
[ -1 ]
9cc84c4b8afdd5d4f8911181acf2e75b1841d9a6
843744d9eb9b090cd8355a11ad5f5e88f0f9b95d
/UXaccelerometer-2/Socket/SocketIOManager.swift
1540cad5e1b43c0fed822d1a0b6a2dd2d3a747c2
[]
no_license
dashared/UXaccelerometer-2
6ec876427cb8dd9ddd313d347332dff076444bb5
786374c4f5509c87934add0a948eec201a7271c3
refs/heads/master
2022-04-14T09:25:42.483919
2020-04-07T12:11:57
2020-04-07T12:11:57
250,508,977
0
0
null
null
null
null
UTF-8
Swift
false
false
775
swift
// // SocketIOManager.swift // UXaccelerometer-2 // // Created by cstore on 03/04/2020. // Copyright © 2020 dasharedd. All rights reserved. // import Foundation import SocketIO class SocketIOManager { // MARK: - Porperties static let shared = SocketIOManager() // Modify this url to connect to local host private let manager = SocketManager(socketURL: URL(string: "http://cstore-af518b0d.localhost.run")!, config: [.log(true), .compress]) var socket: SocketIOClient // MARK: - Init private init() { socket = manager.defaultSocket } // MARK: - Connection func establichConnection() { socket.connect() } func closeConnection() { socket.disconnect() } }
[ -1 ]
d122d190e0825ddf3430d5637aff6e522f4cd6cf
0682e1af46fba2310f9dcdf3dabb869eec374297
/LoginNavigationDemo/LoginNavigationDemo/AppDelegate.swift
f7e79051a5b54d89ca3dd33ba72c67caa73cf9f1
[]
no_license
ihla/vma-ios-2017
be77067516e640c6bfff870571e7f9f48895de77
16b002fbf488419dcc75b52f4d1c30ed2989c8be
refs/heads/master
2021-08-30T19:40:54.270465
2017-12-19T07:05:31
2017-12-19T07:05:31
104,450,962
2
0
null
null
null
null
UTF-8
Swift
false
false
2,183
swift
// // AppDelegate.swift // LoginNavigationDemo // // Created by Lubos Ilcik on 05/11/2017. // Copyright © 2017 Touch4It. 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, 294924, 229388, 278542, 327695, 229391, 229394, 278548, 229397, 229399, 229402, 352284, 278556, 229405, 278559, 229408, 294950, 229415, 229417, 327722, 237613, 229422, 229426, 237618, 229428, 286774, 286776, 319544, 286778, 229432, 204856, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 311601, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 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, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 320007, 287238, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 311850, 279082, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 189040, 172660, 287349, 189044, 189039, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 279178, 287371, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 303773, 164509, 172705, 287394, 172707, 303780, 287390, 287398, 205479, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312005, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 189169, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 304007, 213895, 304009, 304011, 230284, 304013, 295822, 213902, 279438, 189329, 295825, 304019, 189331, 58262, 304023, 304027, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 230413, 197645, 295949, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 312432, 279669, 337018, 189562, 279679, 66690, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 337067, 165035, 238766, 165038, 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, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 230763, 410987, 230768, 296305, 312692, 230773, 304505, 304506, 279929, 181626, 181631, 312711, 296331, 288140, 288144, 230800, 304533, 288154, 337306, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 279991, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 148946, 370130, 222676, 288210, 288212, 288214, 280021, 288217, 288218, 280027, 288220, 329177, 239070, 239064, 288224, 370146, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 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, 198310, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 288499, 419570, 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, 337732, 280388, 304968, 280393, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 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, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 275606, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 280819, 157940, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 354653, 354656, 313700, 280937, 313705, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 281045, 281047, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 330244, 223752, 150025, 338440, 281095, 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, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 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, 207661, 281401, 289593, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 240519, 183184, 142226, 289687, 240535, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 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, 290008, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 380226, 298306, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 298365, 224641, 281987, 298372, 314756, 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, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 290325, 282133, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 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, 118593, 307009, 413506, 307012, 241475, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 282481, 110450, 315251, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 282514, 298898, 241556, 298901, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 290739, 241588, 282547, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 184503, 299191, 176311, 307385, 258235, 307388, 176316, 307390, 307386, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 282957, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 291254, 283062, 127417, 291260, 127421, 127424, 299457, 291269, 127429, 127431, 127434, 315856, 127440, 176592, 315860, 176597, 127447, 283095, 299481, 127449, 176605, 160221, 242143, 127455, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 127494, 283142, 127497, 233994, 135689, 127500, 291341, 233998, 127506, 234003, 127509, 234006, 127511, 152087, 283161, 234010, 135707, 242202, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 299655, 373383, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 299740, 242396, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 234246, 226056, 291593, 234248, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 291711, 234368, 291714, 234370, 291716, 234373, 226182, 234375, 308105, 226185, 234379, 234384, 234388, 234390, 226200, 234393, 209818, 308123, 234396, 324508, 291742, 324504, 234398, 234401, 291747, 291748, 234405, 291750, 324518, 324520, 234407, 324522, 291754, 291756, 234410, 226220, 324527, 291760, 234414, 201650, 324531, 234417, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 226239, 234434, 324546, 324548, 234431, 226245, 234437, 234439, 234443, 291788, 193486, 234446, 193488, 275406, 316370, 234449, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 308226, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 234585, 275545, 242777, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 234648, 275608, 234650, 308379, 324757, 300189, 324766, 119967, 324768, 234653, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 177318, 275626, 234667, 308401, 316596, 308414, 234687, 300226, 308418, 234692, 300229, 308420, 308422, 316610, 283844, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 275725, 177424, 283917, 349451, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 136562, 324978, 333178, 275834, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 235047, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 284223, 284226, 284228, 292421, 243268, 284231, 226886, 128584, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 276052, 276053, 235097, 243290, 284249, 300638, 284251, 284253, 284255, 284258, 243293, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 325251, 276095, 276098, 284297, 317066, 284299, 317068, 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, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 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, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 292681, 153417, 358224, 284499, 276308, 178006, 317271, 284502, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 317332, 358292, 284564, 284566, 399252, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 317361, 276402, 358326, 161718, 358330, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 292839, 276455, 292843, 276460, 292845, 178161, 227314, 276466, 325624, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 350218, 292876, 350222, 317456, 276496, 317458, 178195, 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, 227418, 194649, 194654, 227423, 350304, 178273, 309346, 350302, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 227426, 227430, 276583, 350313, 301167, 350316, 350321, 276590, 284786, 276595, 350325, 252022, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 153765, 284837, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 227571, 309491, 309494, 243960, 227583, 276735, 227587, 276739, 211204, 276742, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 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, 293346, 227810, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 301636, 318020, 301639, 301643, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 342707, 154292, 277173, 318132, 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, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 293696, 310080, 277317, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 277368, 15224, 416639, 416640, 113538, 310147, 416648, 277385, 39817, 187274, 301972, 424853, 277405, 310179, 277411, 293798, 293802, 236460, 277426, 293811, 276579, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 244731, 285690, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 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, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 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, 294223, 326991, 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, 351619, 294276, 310659, 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, 310727, 245191, 64966, 277959, 277963, 302541, 277966, 302543, 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, 40448, 228864, 286214, 228871, 302603, 302614, 302617, 286233, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 196133, 310831, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 212560, 400976, 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, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 301163, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 237409, 229233, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 24528, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
021a6b52bc422aa19212d5f8d308d6fccc11a350
d750af4239119db770b7a7774b05fe08b5fc47f0
/New Year Chaos/newyearchaos.swift
ff6fbe1133beccdea9c2153c734ec5356a37642e
[]
no_license
dandreikiv/HackerRankSolutions
f1ca811d9b08b358415e0f567c9c61c1afcdef79
876473d44b7adafa4f8f3e8119231fa93fd9aded
refs/heads/master
2020-03-25T19:58:52.233995
2018-08-19T16:34:15
2018-08-19T16:34:31
144,109,746
0
0
null
null
null
null
UTF-8
Swift
false
false
612
swift
import Foundation func minimumBribes(q: [Int]) -> Void { var count: Int = 0 var a = q var swapCount: [Int] = Array(repeating: 0, count: q.count) var i = 0 while i < a.count - 1 { if a[i] < a[i + 1] { i = i + 1 } else { let t = a[i] a[i] = a[i + 1] a[i + 1] = t swapCount[t - 1] += 1 if swapCount[t - 1] > 2 { print("Too chaotic") return } count += 1 while (a[i] != (i + 1) && i > 0) { i = i - 1 } } } print(count) }
[ -1 ]
3e97bb7a48d4c908abd461cec5f481632a8c757b
be9598206573faca38b98372bd57bf6b97831f36
/Persona-macOSTests/Persona_macOSTests.swift
c5a4b4310c8ab5d51ec1f1a665211713f9aceeb3
[]
no_license
harryzhang1005/AvailabilityDemo
274ea11397eb3aa0d4feb00d777892534fe9a057
e3e41cf4caae3d7cca91ae7786060ce95ccb892d
refs/heads/master
2021-07-09T01:39:13.522416
2017-10-07T03:54:30
2017-10-07T03:54:30
null
0
0
null
null
null
null
UTF-8
Swift
false
false
993
swift
// // Persona_macOSTests.swift // Persona-macOSTests // // Created by Hongfei Zhang on 10/6/17. // Copyright © 2017 Happy Guy. All rights reserved. // import XCTest @testable import Persona_macOS class Persona_macOSTests: 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. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 333828, 282633, 317467, 241692, 102437, 229413, 229424, 288828, 288833, 288834, 254027, 311374, 315476, 180311, 180312, 237663, 307299, 227428, 329829, 313447, 319598, 288879, 233589, 288889, 215164, 215178, 235662, 317587, 278677, 278704, 323762, 299187, 131256, 280762, 227524, 282831, 317664, 356576, 280802, 321772, 286958, 184570, 184584, 319763, 309529, 299293, 227616, 278816, 233762, 211238, 282919, 98610, 278842, 282939, 319813, 6481, 289110, 106847, 391520, 178582, 190871, 291224, 293274, 61857, 246178, 381347, 61859, 289194, 108972, 377264, 299441, 319930, 299456, 291267, 127428, 324039, 317901, 373197, 281040, 369116, 227809, 293367, 324097, 287241, 342548, 291358, 293419, 23092, 234036, 338490, 293448, 55881, 281166, 281171, 295519, 111208, 279146, 295536, 287346, 330387, 330388, 117397, 295576, 289434, 221852, 205487, 295599, 303793, 299700, 158394, 287422, 242386, 287452, 330474, 289518, 299759, 199414, 221948, 205568, 291585, 295682, 242433, 285444, 299776, 291592, 295697, 285458, 291604, 326433, 289576, 285487, 295729, 230199, 285497, 293693, 295746, 281433, 230234, 301918, 242529, 230248, 201577, 246641, 209783, 246648, 269178, 177019, 291712, 287622, 236428, 295824, 56208, 293781, 326553, 289698, 289703, 189374, 289727, 353216, 279498, 338899, 340961, 52200, 324586, 203757, 359406, 183279, 316405, 293886, 230410, 330763, 324625, 316437, 140310, 320536, 271388, 189474, 330788, 318514, 296019, 353367, 300135, 300136, 207979, 144496, 291959, 160891, 279685, 330888, 162961, 185493, 296086, 339102, 300201, 279728, 294074, 208058, 230588, 322749, 228542, 283847, 353479, 228563, 189652, 279765, 316627, 279774, 298212, 298213, 290022, 234733, 279792, 234742, 316669, 388349, 234755, 322824, 328971, 298291, 300343, 333117, 113987, 193859, 304456, 230729, 294218, 372043, 234831, 120148, 318805, 222559, 234850, 134506, 230765, 296303, 243056, 327024, 296307, 111993, 148867, 179587, 142729, 296335, 234898, 9619, 357786, 318875, 290207, 333220, 316842, 310701, 284089, 296392, 329173, 286172, 187878, 316902, 333300, 191990, 300535, 300536, 333303, 286202, 290300, 290301, 230913, 329225, 296461, 308756, 230943, 333343, 286244, 230959, 280130, 349763, 243274, 333388, 280147, 290390, 306776, 333408, 286306, 282213, 325245, 294529, 286343, 298654, 282273, 323236, 229029, 296632, 280257, 280267, 333517, 282318, 212688, 333521, 245457, 241361, 241365, 286423, 18138, 282339, 282348, 284401, 282358, 278272, 288512, 323331, 323332, 284431, 294678, 284442, 282400, 333610, 294700, 282417, 296755, 321337, 282434, 307011, 282438, 323406, 307031, 280410, 296806, 276327, 282474, 280430, 296814, 282480, 300918, 317304, 241540, 247686, 247687, 325515, 110480, 294807, 294809, 300963, 292771, 284587, 282549, 288697, 290746, 214977, 163781, 284619, 344013, 24532, 280541, 329695, 298980, 294886, 247785 ]
a49c45ab192ce5aab0549def0d9dfa86a14e5ea2
27a5095c52bcd5b1662a364effefbec1b691d34e
/flixster/MoviesViewController.swift
8715d5681e9790c6ab127b10886d895c6314ab39
[]
no_license
swu3025/flixster
1b00cd7f9941bb1eb011b505beab3c50eb501149
6e690b21b61d2b8516af6987f6cc8cc830c02a34
refs/heads/main
2023-07-30T19:51:24.651656
2021-09-26T00:43:39
2021-09-26T00:43:39
408,012,682
0
0
null
null
null
null
UTF-8
Swift
false
false
3,302
swift
// // MoviesViewController.swift // flixster // // Created by Samuel Wu on 9/16/21. // import UIKit import AlamofireImage class MoviesViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { @IBOutlet var tableView: UITableView! var movies = [[String:Any]]() override func viewDidLoad() { super.viewDidLoad() tableView.dataSource = self tableView.delegate = self // Do any additional setup after loading the view. let url = URL(string: "https://api.themoviedb.org/3/movie/now_playing?api_key=a07e22bc18f5cb106bfe4cc1f83ad8ed")! let request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData, timeoutInterval: 10) let session = URLSession(configuration: .default, delegate: nil, delegateQueue: OperationQueue.main) let task = session.dataTask(with: request) { (data, response, error) in // This will run when the network request returns if let error = error { print(error.localizedDescription) } else if let data = data { let dataDictionary = try! JSONSerialization.jsonObject(with: data, options: []) as! [String: Any] self.movies = dataDictionary["results"] as! [[String:Any]] self.tableView.reloadData() // TODO: Get the array of movies // TODO: Store the movies in a property to use elsewhere // TODO: Reload your table view data } } task.resume() } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return movies.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "MovieCell") as! MovieCell let movie = movies[indexPath.row] let title = movie["title"] as! String let synopsis = movie["overview"] as! String cell.titleLabel.text = title cell.synopsisLabel.text = synopsis let baseUrl = "https://image.tmdb.org/t/p/w185" let posterPath = movie["poster_path"] as! String let posterUrl = URL(string: baseUrl + posterPath)! cell.posterView.af.setImage(withURL: posterUrl) return cell } //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. //Find the selected movie let cell = sender as! UITableViewCell let indexPath = tableView.indexPath(for:cell)! let movie = movies[indexPath.row] //Pass the selected movie to the details view controller let detailsViewController = segue.destination as! MoviesDetailsViewController detailsViewController.movie = movie tableView.deselectRow(at: indexPath, animated: true) } }
[ -1 ]
ce262e3288743ec319ec3200eac47ead0d92daf6
b67ee970080c4a3550bd996853f362c60675026d
/ProfileCreator/ProfileCreator/Profile Settings/ProfileSettingsType.swift
1521e9a9adc56f3a2cdc954824b55f09760ce56b
[ "MIT" ]
permissive
ProfileCreator/ProfileCreator
94f1a11690eb9395782878c554cfa0f4a6b631d3
4a073a82f84d3da1da56b390a98a508e87bb2929
refs/heads/master
2023-09-05T20:05:15.870425
2023-01-05T22:02:14
2023-01-05T22:02:14
41,657,454
854
81
MIT
2023-08-11T19:54:41
2015-08-31T05:28:24
Swift
UTF-8
Swift
false
false
1,548
swift
// // ProfileSettingsType.swift // ProfileCreator // // Created by Erik Berglund. // Copyright © 2018 Erik Berglund. All rights reserved. // import Foundation import ProfilePayloads extension ProfileSettings { class func payloadType(forPayloadSettings payloadSettings: [String: Any]) -> PayloadType { guard var domain = payloadSettings[PayloadKey.payloadType] as? String else { Log.shared.error(message: "Payload with content: \(payloadSettings) is missing required key: \"PayloadType\".", category: String(describing: self)) return .custom } if domain == kManifestDomainConfiguration { domain = kManifestDomainConfiguration } return self.payloadType(forDomain: domain) } class func payloadType(forDomain domain: String) -> PayloadType { guard let types = ProfilePayloads.shared.payloadTypes(forDomain: domain) else { Log.shared.error(message: "Unknown PayloadType: \(domain), this content will be ignored.", category: String(describing: self)) return .custom } if types.count == 1, let type = types.first { return type } else { // FIXME: Need to compare the actual keys to see which one it most likely is... //let domainKeys = Set(payloadSettings.keys) //let keys = Array(domainKeys.subtracting(kPayloadSubkeys)) // FIXME: Just return manifestApple until this is implemented. return .manifestsApple } } }
[ -1 ]
0acb86bca538178284decf9c7e5f108f66c54d1b
a61f19ad5bd3c50cab381886c0e983efd27e615e
/CalculatorTests/CalculatorTests.swift
1879fb9f9dfbfb97a5a4e22159d8b52f601ec33c
[ "Apache-2.0" ]
permissive
Jeevan986/Calculator
3e755473f744009afe722460e091fa52788eb47a
032d7473ec6d3515a098948495fb400b16ab6254
refs/heads/main
2023-03-25T14:05:41.576364
2021-03-13T04:58:52
2021-03-13T04:58:52
324,453,853
0
0
null
null
null
null
UTF-8
Swift
false
false
909
swift
// // CalculatorTests.swift // CalculatorTests // // Created by Jeevan Bastola on 12/21/20. // import XCTest @testable import Calculator class CalculatorTests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. } 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 { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() throws { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 360462, 16419, 229413, 204840, 344107, 155694, 253999, 229430, 163896, 180280, 352315, 376894, 352326, 196691, 385116, 237663, 254048, 319591, 221290, 278638, 352368, 204916, 131191, 196760, 426138, 49316, 32941, 377009, 295098, 139479, 254170, 229597, 311519, 205035, 336120, 327929, 344313, 147717, 368905, 254226, 368916, 262421, 377114, 237856, 237857, 254251, 311597, 98610, 180535, 336183, 254286, 344401, 377169, 368981, 155990, 368984, 98657, 270701, 270706, 139640, 106874, 311685, 106888, 385417, 385422, 213403, 385454, 311727, 377264, 311738, 33211, 336317, 336320, 311745, 254406, 188871, 328152, 287198, 319981, 254456, 377338, 377343, 254465, 139792, 303636, 393751, 254488, 377376, 377386, 197167, 385588, 352829, 115270, 385615, 426576, 369235, 139872, 139892, 287352, 344696, 311941, 336518, 311945, 369289, 344715, 311949, 287374, 377489, 311954, 352917, 230040, 271000, 377497, 303771, 377500, 205471, 344738, 139939, 352937, 336558, 205487, 303793, 336564, 287417, 287422, 377539, 164560, 385747, 361176, 418520, 287452, 369385, 312052, 172792, 344827, 221948, 344828, 205568, 295682, 197386, 434957, 426774, 197399, 426775, 344865, 197411, 295724, 189228, 197422, 353070, 164656, 295729, 353078, 197431, 336702, 353109, 377686, 230234, 189275, 435039, 295776, 303972, 385893, 246643, 295798, 361337, 254850, 369538, 295824, 140204, 377772, 304051, 230332, 377790, 353215, 213957, 345033, 386006, 418776, 50143, 123881, 320493, 271350, 295927, 328700, 328706, 410627, 320516, 295942, 386056, 353290, 377869, 238610, 418837, 140310, 336929, 369701, 238639, 312373, 238651, 132158, 361535, 336960, 377926, 361543, 304222, 173166, 377972, 377983, 402565, 386189, 337039, 238743, 238765, 238769, 402613, 353479, 402634, 189653, 419029, 148696, 296153, 304351, 222440, 328940, 386294, 386301, 320770, 386306, 369930, 328971, 353551, 320796, 222494, 66862, 353584, 345396, 386359, 116026, 378172, 312648, 337225, 304456, 337227, 230729, 238927, 353616, 378209, 386412, 296307, 116084, 337281, 148867, 378244, 296329, 296335, 9619, 370071, 173491, 304564, 353719, 361927, 353750, 271843, 361963, 296433, 329225, 296461, 304656, 329232, 370197, 402985, 394794, 288309, 312889, 288327, 239198, 99938, 312940, 222832, 370296, 288378, 337534, 337535, 263809, 288392, 239250, 419478, 345752, 255649, 337591, 403148, 9936, 9937, 370388, 272085, 345814, 345821, 321247, 321249, 345833, 345834, 67315, 173814, 288512, 288516, 321302, 345879, 321310, 255776, 362283, 378668, 296755, 345919, 436031, 403267, 345929, 255829, 18262, 362327, 345951, 362337, 345955, 296806, 214895, 313199, 362352, 182144, 305026, 329622, 337815, 436131, 354212, 436137, 362417, 362431, 214984, 362443, 346067, 354269, 329695, 436191, 354272, 354274, 337895, 313319, 354280, 174057, 436205, 247791, 362480, 43014, 354316, 313357, 182296, 223268, 354343, 346162, 288828, 436285, 288833, 288834, 436292, 403525, 436301, 338001, 338003, 280661, 329814, 338007, 280675, 280677, 43110, 321637, 436329, 215164, 215166, 280712, 346271, 436383, 362659, 239793, 182456, 379071, 280768, 149703, 338119, 346314, 321745, 387296, 280802, 379106, 338150, 346346, 321772, 338164, 436470, 149760, 411906, 272658, 272660, 338218, 321840, 379186, 321860, 289110, 215385, 272729, 354676, 354677, 436608, 362881, 240002, 436611, 108944, 190871, 149916, 420253, 141728, 289189, 108972, 272813, 338356, 436661, 289232, 256477, 174593, 420369, 207393, 289332, 174648, 338489, 338490, 297560, 354911, 436832, 436834, 191082, 420463, 346737, 313971, 346740, 420471, 330379, 117396, 346772, 264856, 289434, 363163, 346779, 314040, 363211, 363230, 264928, 346858, 330474, 289518, 363263, 35583, 117517, 322319, 166676, 207640, 289576, 355121, 191283, 273207, 355130, 289598, 355137, 355139, 420677, 355146, 355152, 355165, 355178, 207727, 330609, 207732, 158593, 224145, 355217, 256922, 289690, 420773, 256935, 289703, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 248796, 248797, 207838, 347103, 347123, 240630, 257024, 330754, 330763, 248872, 248901, 257094, 314448, 339030, 257125, 273515, 404593, 363641, 363644, 150657, 248961, 330888, 347283, 363669, 339100, 380061, 429214, 199839, 265379, 249002, 306346, 44203, 3246, 421048, 265412, 290000, 134366, 298208, 298212, 298213, 330984, 298221, 298228, 363771, 437505, 322824, 257305, 339234, 109861, 372009, 412971, 306494, 216386, 224586, 331090, 314710, 372054, 159066, 314720, 380271, 208244, 249204, 290173, 306559, 314751, 298374, 314758, 314760, 142729, 388487, 314766, 290207, 314783, 314789, 208293, 314791, 396711, 396712, 380337, 380338, 150965, 380357, 339398, 306639, 413137, 429542, 372227, 323080, 175639, 388632, 396827, 134686, 355876, 347694, 265798, 265804, 396882, 44635, 396895, 323172, 224883, 314998, 323196, 339584, 339585, 224901, 298661, 364207, 224946, 110268, 224958, 274115, 306890, 241361, 224984, 298720, 372460, 175873, 339715, 339720, 372496, 323346, 249626, 339745, 257830, 421672, 216918, 241495, 241528, 339841, 315273, 315274, 372626, 380821, 118685, 298909, 323507, 290745, 274371, 151497, 372701, 298980, 380908, 315432, 102445, 233517, 176175, 241716, 225351, 315465, 307289, 315487, 356447, 438377, 233589, 266357, 422019, 241808, 381073, 299174, 258214, 405687, 258239, 389313, 299203, 299209, 372941, 266449, 307435, 438511, 381172, 356602, 184575, 381208, 315673, 151839, 233762, 217380, 332083, 127284, 332085, 332089, 438596, 332101, 323913, 348492, 323920, 250192, 348500, 168281, 332123, 332127, 242023, 160110, 242033, 291192, 340357, 225670, 242058, 373134, 242078, 315810, 315811, 381347, 340398, 127427, 324039, 373197, 160225, 340453, 291311, 291333, 340490, 258581, 234036, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 381517, 340558, 332378, 201308, 111208, 184940, 373358, 389745, 209530, 356989, 373375, 152195, 348806, 316049, 111253, 316053, 111258, 111259, 176808, 299699, 422596, 422599, 291530, 225995, 242386, 422617, 422626, 234217, 299759, 348920, 291585, 430849, 291592, 62220, 422673, 430865, 291604, 422680, 152365, 422703, 422709, 152374, 160571, 430910, 160575, 160580, 348998, 381773, 201551, 242529, 349026, 357218, 127841, 308076, 242541, 177019, 185211, 308092, 398206, 291712, 381829, 316298, 349067, 349072, 390045, 185250, 185254, 373687, 349121, 381897, 373706, 316364, 340955, 340974, 349171, 349175, 201720, 127992, 357379, 308243, 201755, 357414, 357423, 300084, 308287, 218186, 250954, 250956, 341073, 439384, 300135, 316520, 357486, 144496, 300150, 291959, 300151, 160891, 341115, 300158, 349316, 349318, 373903, 169104, 177296, 119962, 300187, 300188, 300201, 300202, 373945, 259268, 283852, 259280, 316627, 333011, 357595, 234742, 128251, 439562, 292107, 414990, 251153, 177428, 349462, 382258, 300343, 382269, 177484, 251213, 259406, 234831, 406861, 374109, 333160, 316787, 382330, 357762, 112017, 234898, 259475, 275859, 357786, 251298, 333220, 374191, 210358, 300489, 366037, 210390, 210391, 210392, 210393, 144867, 251378, 308723, 300536, 210433, 366083, 259599, 308756, 398869, 374296, 374299, 308764, 423453, 349726, 431649, 349741, 169518, 431663, 194110, 349763, 218696, 292425, 128587, 333388, 349781, 128599, 333408, 300644, 415338, 243307, 120427, 54893, 325231, 366203, 325245, 194180, 415375, 153251, 300714, 210603, 415420, 333503, 259781, 333517, 333520, 325346, 333542, 153319, 325352, 325371, 243472, 366360, 169754, 325404, 341796, 399147, 431916, 366381, 300848, 259899, 325439, 153415, 341836, 415567, 325457, 317269, 341847, 350044, 128862, 292712, 423789, 325492, 276341, 341879, 317304, 333688, 112509, 325503, 55167, 333701, 243591, 350093, 325518, 333722, 350109, 292771, 415655, 317360, 243637, 301008, 153554, 219101, 292836, 292837, 317415, 325619, 432116, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 325674, 129076, 243767, 358456, 194666, 260207, 432240, 415881, 104587, 235662, 284826, 333991, 333992, 194782, 301279, 317664, 243962, 375039, 375051, 325905, 325912, 211235, 432421, 211238, 358703, 358709, 383311, 366930, 383332, 383336, 211326, 317831, 252308, 39324, 121245, 342450, 293303, 293310, 342466, 416197, 129483, 342476, 342498, 358882, 334309, 391655, 432618, 375276, 416286, 375333, 358954, 244269, 375343, 23092, 375351, 244281, 301638, 309830, 293448, 55881, 416341, 309846, 416351, 268899, 39530, 244347, 326287, 375440, 334481, 318106, 318107, 342682, 318130, 383667, 293556, 342713, 39614, 375526, 342762, 342763, 293612, 154359, 432893, 162561, 383754, 310036, 326429, 293664, 326433, 342820, 400166, 293672, 375609, 252741, 293711, 244568, 244570, 342887, 211836, 400252, 359298, 359299, 260996, 113542, 392074, 318364, 310176, 310178, 293800, 359338, 236461, 252847, 326581, 326587, 359364, 326601, 211914, 359381, 433115, 359387, 343005, 130016, 64485, 326635, 187374, 383983, 359406, 318461, 293886, 293893, 433165, 384016, 146448, 433174, 252958, 252980, 359478, 203830, 359495, 392290, 253029, 351344, 187506, 285814, 392318, 384131, 302216, 326804, 351390, 343203, 253099, 253100, 318639, 367799, 113850, 294074, 302274, 367810, 351446, 359647, 195808, 310497, 253167, 351476, 302325, 351478, 261377, 253216, 130348, 261425, 351537, 286013, 146762, 294218, 294219, 318805, 425304, 163175, 327024, 318848, 253317, 384393, 368011, 318864, 318868, 310692, 245161, 286129, 286132, 343476, 228795, 425405, 302531, 163268, 425418, 286172, 286202, 359930, 302590, 253451, 253452, 359950, 146964, 253463, 286244, 245287, 245292, 196164, 179801, 343647, 310889, 204397, 138863, 188016, 294529, 229001, 188048, 425626, 302754, 40614, 384695, 327358, 212685, 384720, 302802, 212716, 212717, 360177, 319233, 360195, 286494, 409394, 319292, 360252, 360264, 376669, 245599, 425825, 425833, 417654, 188292, 253829, 294807, 376732, 311199, 319392, 253856, 294823, 327596, 294843, 188348, 237504, 294850, 384964, 344013, 212942, 212946, 24532, 212951, 360417, 253929, 311281, 311282 ]
cbafe2291f856b61f77d406ad4d863787c025e02
b0813103e439031329b4044215d0a98effaeef9e
/BookSearcher/Modules/Search/Interactor/SearchInteractor.swift
878675aed86a7a3aa3f1e94ab9fb4fcf8beed3e2
[]
no_license
korzun1993/BookSearcher
a0000fce692c2cdea1076f841367a8a35267a567
f008404c363ebde58c349571a71deb5d5fe840fc
refs/heads/master
2023-03-31T06:09:49.026093
2021-03-30T10:15:05
2021-03-30T10:15:05
352,462,348
0
0
null
null
null
null
UTF-8
Swift
false
false
1,025
swift
// // SearchInteractor.swift // BookSearcher // // Created by Vladyslav Korzun on 29.03.2021. // Copyright © 2021 VladyslavKorzun. All rights reserved. // import UIKit class SearchInteractor: SearchInteractorProtocol { let service: NetworkService var searchTask: DispatchWorkItem! var lastQuery: String? init(service: NetworkService) { self.service = service } func loadData(query: String, completion: @escaping BooksCallback) { searchTask?.cancel() searchTask = DispatchWorkItem { [weak self] in self?.performRequestForData(query: query, completion: completion) } DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.5, execute: searchTask) } func performRequestForData(query: String, completion: @escaping BooksCallback) { lastQuery = query service.getBooks(query: query, completion: { [weak self] data in if query == self?.lastQuery { completion(data) } }) } }
[ -1 ]