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
5004a6e450164172eb86c7da1ab69b995bfcd2fc
6fe3d3e6d9777d806b6905238db8d5399fc7b54e
/ObservableHuman-RxSwiftTests/ObservableHuman_RxSwiftTests.swift
379b987e1c01e15ae46cb84f26afa0c9840c1533
[]
no_license
littleossa/ObservableHuman-RxSwift
c01ad3854bcf86f2310064ebad2030817f932840
3515f0678dd6950c41391c15a7312d2233288183
refs/heads/main
2023-03-27T03:45:32.512117
2021-03-31T12:46:33
2021-03-31T12:46:33
351,313,620
0
1
null
null
null
null
UTF-8
Swift
false
false
957
swift
// // ObservableHuman_RxSwiftTests.swift // ObservableHuman-RxSwiftTests // // Created by 平岡修 on 2021/03/25. // import XCTest @testable import ObservableHuman_RxSwift class ObservableHuman_RxSwiftTests: 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. } } }
[ 333828, 43014, 358410, 354316, 313357, 360462, 399373, 182296, 317467, 145435, 16419, 223268, 229413, 204840, 315432, 325674, 344107, 102445, 155694, 176175, 253999, 233517, 346162, 129076, 241716, 229430, 243767, 163896, 180280, 358456, 352315, 288828, 436285, 376894, 288833, 288834, 436292, 403525, 352326, 225351, 315465, 436301, 338001, 196691, 338003, 280661, 329814, 338007, 307289, 385116, 356447, 254048, 237663, 315487, 280675, 280677, 43110, 319591, 321637, 436329, 194666, 221290, 438377, 260207, 352368, 432240, 204916, 233589, 266357, 131191, 215164, 215166, 422019, 280712, 415881, 104587, 235662, 241808, 381073, 196760, 284826, 426138, 346271, 436383, 362659, 49316, 299174, 333991, 258214, 333992, 32941, 239793, 377009, 405687, 182456, 295098, 258239, 379071, 389313, 299203, 149703, 338119, 299209, 346314, 372941, 266449, 321745, 139479, 254170, 229597, 194782, 301279, 311519, 317664, 280802, 379106, 387296, 346346, 205035, 307435, 321772, 438511, 381172, 436470, 336120, 344313, 356602, 327929, 243962, 184575, 149760, 375039, 411906, 147717, 368905, 375051, 180493, 325905, 254226, 272658, 272660, 368916, 262421, 325912, 381208, 377114, 151839, 237856, 237857, 233762, 211235, 217380, 432421, 211238, 338218, 254251, 251213, 311597, 358703, 321840, 98610, 332083, 379186, 332085, 358709, 180535, 336183, 332089, 127284, 321860, 332101, 438596, 323913, 348492, 383311, 323920, 344401, 366930, 377169, 348500, 368981, 155990, 289110, 368984, 272729, 168281, 215385, 332123, 332127, 98657, 383332, 242023, 383336, 270701, 160110, 242033, 270706, 354676, 354677, 139640, 291192, 106874, 211326, 436608, 362881, 240002, 436611, 311685, 225670, 317831, 106888, 340357, 242058, 395659, 385417, 395661, 373134, 385422, 108944, 252308, 190871, 213403, 149916, 39324, 121245, 242078, 420253, 141728, 315810, 315811, 381347, 289189, 375207, 108972, 272813, 340398, 385454, 377264, 342450, 338356, 436661, 293303, 311738, 358843, 33211, 336317, 293310, 336320, 311745, 342466, 127427, 416197, 254406, 188871, 324039, 129483, 342476, 373197, 289232, 328152, 256477, 287198, 160225, 342498, 358882, 334309, 340453, 391655, 432618, 375276, 319981, 291311, 254456, 377338, 377343, 254465, 174593, 291333, 340490, 348682, 139792, 420369, 303636, 258581, 393751, 254488, 416286, 377376, 207393, 375333, 358954, 377386, 244269, 197167, 375343, 385588, 289332, 234036, 375351, 174648, 338489, 338490, 244281, 348732, 352829, 315960, 242237, 70209, 115270, 70215, 293448, 55881, 301638, 309830, 348742, 348749, 381517, 385615, 426576, 340558, 369235, 416341, 297560, 332378, 201308, 354911, 416351, 139872, 436832, 436834, 268899, 111208, 39530, 191082, 184940, 373358, 420463, 346737, 389745, 313971, 139892, 346740, 420471, 344696, 287352, 209530, 244347, 356989, 373375, 152195, 311941, 348806, 336518, 369289, 311945, 330379, 344715, 311949, 287374, 326287, 375440, 316049, 311954, 334481, 117396, 111253, 316053, 346772, 230040, 264856, 111258, 363163, 111259, 271000, 289434, 303771, 205471, 318106, 344738, 318107, 139939, 377500, 176808, 205487, 303793, 318130, 299699, 293556, 336564, 383667, 314040, 287417, 342713, 39614, 287422, 377539, 422596, 422599, 291530, 225995, 363211, 164560, 242386, 385747, 361176, 418520, 422617, 287452, 363230, 264928, 422626, 338662, 375526, 234217, 330474, 342762, 293612, 342763, 289518, 299759, 369385, 377489, 346858, 312052, 154359, 348920, 172792, 344827, 221948, 432893, 344828, 363263, 205568, 162561, 291585, 295682, 430849, 35583, 291592, 197386, 383754, 62220, 117517, 434957, 322319, 422673, 377497, 430865, 166676, 291604, 310036, 197399, 207640, 422680, 426774, 426775, 326429, 293664, 326433, 344865, 197411, 342820, 400166, 289576, 293672, 295724, 152365, 197422, 353070, 164656, 295729, 422703, 191283, 189228, 422709, 152374, 197431, 273207, 375609, 353078, 160571, 336702, 289598, 160575, 430910, 355137, 355139, 160580, 252741, 348998, 420677, 355146, 381773, 201551, 293711, 353109, 377686, 244568, 230234, 189275, 244570, 435039, 295776, 242529, 357218, 349026, 303972, 385893, 342887, 308076, 242541, 207727, 207729, 330609, 246643, 207732, 211829, 295798, 361337, 177019, 211836, 185211, 308092, 398206, 400252, 291712, 254850, 359299, 260996, 158593, 359298, 113542, 369538, 381829, 316298, 392074, 349067, 295824, 355217, 224145, 349072, 256922, 289690, 318364, 390045, 310176, 185250, 310178, 420773, 185254, 289703, 293800, 256935, 359338, 140204, 236461, 363438, 252847, 347055, 377772, 304051, 326581, 373687, 326587, 230332, 377790, 289727, 273344, 349121, 363458, 330689, 353215, 379844, 213957, 19399, 359364, 381897, 326601, 345033, 373706, 316364, 211914, 359381, 386006, 418776, 433115, 248796, 343005, 340955, 50143, 347103, 207838, 248797, 130016, 64485, 123881, 326635, 187374, 383983, 340974, 359406, 347123, 349171, 240630, 271350, 201720, 127992, 295927, 349175, 328700, 318461, 293886, 257024, 328706, 330754, 320516, 293893, 295942, 357379, 386056, 410627, 353290, 254987, 330763, 377869, 433165, 384016, 238610, 308243, 418837, 140310, 433174, 201755, 252958, 336929, 369701, 357414, 248872, 357423, 238639, 252980, 300084, 312373, 203830, 359478, 238651, 361535, 308287, 248901, 257094, 359495, 377926, 361543, 218186, 250954, 314448, 341073, 339030, 439384, 361566, 304222, 392290, 253029, 257125, 300135, 316520, 273515, 173166, 357486, 351344, 144496, 187506, 404593, 377972, 285814, 291959, 300150, 300151, 363641, 160891, 363644, 341115, 300158, 377983, 392318, 248961, 150657, 384131, 349316, 402565, 349318, 302216, 330888, 386189, 373903, 169104, 177296, 337039, 347283, 326804, 363669, 238743, 119962, 300187, 300188, 339100, 351390, 199839, 380061, 429214, 265379, 343203, 300201, 249002, 253099, 253100, 238765, 3246, 300202, 306346, 238769, 318639, 44203, 402613, 367799, 421048, 373945, 113850, 294074, 343234, 302274, 259268, 253125, 367810, 265412, 353479, 62665, 402634, 283852, 259280, 290000, 316627, 333011, 189653, 419029, 351446, 148696, 296153, 357595, 134366, 359647, 304351, 195808, 298208, 310497, 298212, 298213, 222440, 330984, 328940, 298221, 253167, 298228, 302325, 234742, 386294, 351478, 351476, 128251, 363771, 386301, 261377, 351490, 320770, 386306, 437505, 322824, 439562, 292107, 328971, 369930, 414990, 353551, 251153, 177428, 349462, 257305, 250192, 320796, 222494, 253216, 339234, 109861, 372009, 412971, 130348, 353584, 351537, 261425, 382258, 345396, 300343, 386359, 116026, 378172, 286013, 306494, 382269, 216386, 312648, 337225, 304456, 230729, 146762, 224586, 177484, 294218, 259406, 234831, 238927, 294219, 331090, 353616, 406861, 318805, 314710, 372054, 425304, 159066, 374109, 314720, 378209, 294243, 163175, 333160, 386412, 380271, 327024, 296307, 116084, 208244, 249204, 316787, 382330, 290173, 357759, 306559, 314751, 357762, 318848, 378244, 337281, 148867, 388487, 253317, 298374, 314758, 314760, 142729, 296329, 368011, 384393, 314766, 296335, 318864, 112017, 234898, 9619, 259475, 275859, 318868, 370071, 357786, 290207, 314783, 251298, 310692, 314789, 333220, 314791, 396711, 245161, 396712, 374191, 286129, 380337, 173491, 286132, 150965, 210358, 304564, 353719, 380338, 343476, 228795, 425405, 302531, 163268, 380357, 339398, 361927, 300489, 425418, 306639, 413137, 366037, 23092, 210390, 210391, 210393, 353750, 210392, 286172, 144867, 271843, 429542, 361963, 296433, 251378, 308723, 300536, 286202, 359930, 302590, 210433, 366083, 372227, 323080, 329225, 253451, 253452, 296461, 359950, 259599, 304656, 329232, 146964, 398869, 308756, 370197, 175639, 253463, 374296, 388632, 374299, 308764, 349726, 396827, 134686, 431649, 423453, 286244, 355876, 245287, 402985, 394794, 245292, 349741, 347694, 169518, 431663, 288309, 312889, 194110, 425535, 349763, 196164, 265798, 288327, 218696, 292425, 128587, 265804, 333388, 396882, 128599, 179801, 44635, 239198, 343647, 333408, 396895, 99938, 300644, 323172, 310889, 415338, 243307, 312940, 54893, 204397, 138863, 188016, 222832, 325231, 224883, 120427, 314998, 370296, 366203, 323196, 325245, 337534, 337535, 339584, 263809, 294529, 339585, 194180, 224901, 288392, 229001, 415375, 188048, 239250, 419478, 345752, 425626, 302754, 153251, 298661, 40614, 300714, 210603, 364207, 224946, 337591, 384695, 110268, 415420, 224958, 327358, 333503, 274115, 259781, 306890, 403148, 212685, 333517, 9936, 9937, 241361, 302802, 333520, 272085, 345814, 342682, 370388, 384720, 224984, 345821, 321247, 298720, 321249, 325346, 153319, 325352, 345833, 345834, 212716, 212717, 372460, 360177, 67315, 173814, 325371, 288512, 319233, 175873, 360195, 339715, 288516, 339720, 243472, 372496, 323346, 321302, 345879, 366360, 249626, 325404, 286494, 321310, 255776, 339745, 341796, 257830, 421672, 362283, 378668, 399147, 431916, 366381, 300848, 339762, 409394, 296755, 259899, 360252, 319292, 325439, 345919, 436031, 403267, 339783, 360264, 153415, 345929, 341836, 415567, 337745, 325457, 255829, 317269, 18262, 216918, 241495, 341847, 362327, 350044, 346779, 128862, 245599, 345951, 362337, 376669, 345955, 425825, 296806, 292712, 425833, 423789, 214895, 362352, 313199, 325492, 276341, 417654, 341879, 241528, 317304, 333688, 112509, 55167, 182144, 325503, 305026, 339841, 188292, 253829, 333701, 243591, 315273, 315274, 325518, 372626, 380821, 329622, 294807, 337815, 333722, 376732, 118685, 298909, 311199, 319392, 350109, 253856, 292771, 436131, 354212, 294823, 415655, 436137, 327596, 362417, 323507, 243637, 290745, 370619, 294843, 188348, 362431, 237504, 294850, 274371, 384964, 214984, 151497, 362443, 344013, 212942, 301008, 153554, 212946, 24532, 346067, 212951, 354269, 372701, 329695, 436191, 219101, 354272, 360417, 292836, 292837, 298980, 337895, 354280, 253929, 313319, 317415, 380908, 436205, 174057, 247791, 362480, 311281, 311282, 325619, 432116, 292858, 415741, 352917 ]
a145127613e330807158a9c7fae16201ca42c943
0428bf3045b9e85d726d64006036b8b04de59276
/PushPin/Vector.swift
133cdcb0a8fcf33ab2d771c31dc17bef86ac10d4
[]
no_license
Xydium/PushPin
f307a6a9e80f970441deaa8733063203549dd86c
ab7b1f2472da1c5d385423455336cdade5c55bfe
refs/heads/master
2021-01-12T16:02:09.015872
2017-01-18T17:49:03
2017-01-18T17:49:03
71,922,643
0
0
null
null
null
null
UTF-8
Swift
false
false
1,708
swift
// // Vector.swift // PushPin // // Created by Timothy Hornick on 11/28/16. // Copyright © 2016 Xydium. All rights reserved. // import UIKit import Foundation @objc class Vector : NSObject, NSCoding { let x1, y1, x2, y2: Double init(_ x1: Double, _ y1: Double, _ x2: Double, _ y2: Double) { self.x1 = x1 self.y1 = y1 self.x2 = x2 self.y2 = y2 } convenience init(_ s: CGPoint, _ e: CGPoint) { self.init(Double(s.x), Double(s.y), Double(e.x), Double(e.y)) } var xcomp: Double { return x2 - x1 } var ycomp: Double { return y2 - y1 } var mag: Double { return sqrt(xcomp * xcomp + ycomp * ycomp) } var angle: Double { return sinh(ycomp / mag) } var norm: Vector { return Vector(0, 0, xcomp / mag, ycomp / mag) } func dot(v: Vector) -> Double { return xcomp * v.xcomp + ycomp * v.ycomp } func lerped(amt: Double) -> (Double, Double) { return (x1 + (x2 - x1) * amt, y1 + (y2 - y1) * amt) } func encodeWithCoder(aCoder: NSCoder) { aCoder.encodeDouble(Double(self.x1), forKey: "x1") aCoder.encodeDouble(Double(self.y1), forKey: "y1") aCoder.encodeDouble(Double(self.x2), forKey: "x2") aCoder.encodeDouble(Double(self.y2), forKey: "y2") } required init?(coder aDecoder: NSCoder) { self.x1 = aDecoder.decodeDoubleForKey("x1") self.y1 = aDecoder.decodeDoubleForKey("y1") self.x2 = aDecoder.decodeDoubleForKey("x2") self.y2 = aDecoder.decodeDoubleForKey("y2") } } func + (left: Vector, right: Vector) -> Vector { return Vector(left.x1, left.x2 + right.xcomp, left.y1, left.y2 + right.ycomp) } func - (left: Vector, right: Vector) -> Vector { return Vector(left.x1, left.x2 - right.xcomp, left.y1, left.y2 - right.ycomp) }
[ -1 ]
3b9bcf2f06e51e7618637604b58ed23dc031cde1
1ef8a5c60fb61f0c07797459a6466def7c50514f
/Swift 4 Course/Apps/Destini/Destini/StoryTree.swift
ec692dc663b8db914d8fd822d3c50006ccc426e4
[]
no_license
rqroz/iOS-Studies
2fd831987896f842ae40d6c7a8bba936a3c3b020
3eea4a94a1d605243f274e0ca1f9732f3d4a6954
refs/heads/master
2020-03-18T15:29:03.769372
2018-06-07T19:40:15
2018-06-07T19:40:15
134,910,931
0
0
null
null
null
null
UTF-8
Swift
false
false
2,904
swift
// // StoryBank.swift // Destini // // Created by Rodolfo Queiroz on 2018-05-25. // Copyright © 2018 London App Brewery. All rights reserved. // import Foundation class StoryTree { static let tree: StoryTree = StoryTree() let rootStory: Story init(){ let storyText1 = "Your car has blown a tire on a winding road in the middle of nowhere with no cell phone reception. You decide to hitchhike. A rusty pickup truck rumbles to a stop next to you. A man with a wide brimmed hat with soulless eyes opens the passenger door for you and asks: \"Need a ride, boy?\"." let answer1a = "I\'ll hop in. Thanks for the help!" let answer1b = "Better ask him if he\'s a murderer first." let storyText2 = "He nods slowly, unphased by the question." let answer2a = "At least he\'s honest. I\'ll climb in." let answer2b = "Wait, I know how to change a tire." let storyText3 = "As you begin to drive, the stranger starts talking about his relationship with his mother. He gets angrier and angrier by the minute. He asks you to open the glovebox. Inside you find a bloody knife, two severed fingers, and a cassette tape of Elton John. He reaches for the glove box." let answer3a = "I love Elton John! Hand him the cassette tape." let answer3b = "It\'s him or me! You take the knife and stab him." let storyText4 = "What? Such a cop out! Did you know traffic accidents are the second leading cause of accidental death for most adult age groups?" let storyText5 = "As you smash through the guardrail and careen towards the jagged rocks below you reflect on the dubious wisdom of stabbing someone while they are driving a car you are in." let storyText6 = "You bond with the murderer while crooning verses of \"Can you feel the love tonight\". He drops you off at the next town. Before you go he asks you if you know any good places to dump bodies. You reply: \"Try the pier.\"" let story1 = Story(text: storyText1) let story2 = Story(text: storyText2) let story3 = Story(text: storyText3) let story4 = Story(text: storyText4) let story5 = Story(text: storyText5) let story6 = Story(text: storyText6) let choice1a = StoryChoice(text: answer1a, linksTo: story3) let choice1b = StoryChoice(text: answer1b, linksTo: story2) story1.choices = [choice1a, choice1b] let choice2a = StoryChoice(text: answer2a, linksTo: story3) let choice2b = StoryChoice(text: answer2b, linksTo: story4) story2.choices = [choice2a, choice2b] let choice3a = StoryChoice(text: answer3a, linksTo: story5) let choice3b = StoryChoice(text: answer3b, linksTo: story6) story3.choices = [choice3a, choice3b] self.rootStory = story1 } }
[ -1 ]
b145367da79d026852e6cece0e0f0da534b2d32c
e9f4e370053566c7dce71719b38e9dbb2e9fbd99
/Sources/Algebraic/Interfaces/Bounded.swift
9383b4cc76265f1da914e4cce62a53aa5b9a6a08
[ "MIT" ]
permissive
buscarini/Algebraic
86eb3f569f4d6cdcbdbc5ba660c7877a30b63874
9d5eb82d70e2dda3c173ada08475dfdeb2b33872
refs/heads/master
2021-07-03T11:08:26.578130
2021-06-16T09:23:34
2021-06-16T09:23:34
92,949,126
0
0
null
null
null
null
UTF-8
Swift
false
false
167
swift
// // Bounded.swift // Pods // // Created by José Manuel Sánchez Peñarroja on 24/7/17. // // import Foundation typealias Bounded = UpperBounded & LowerBounded
[ -1 ]
b78129140a3d3ac88605dd93e628393174d41e8a
bb6cf4df66cb539de1dc9c8fd3c703a9d6bf0d19
/Pods/SwiftTheme/Source/NSObject+Theme.swift
581e67ebbacb163a7efb8627ebbc135160f0ac53
[ "MIT" ]
permissive
KeenTeam1990/KTTodayNews
40adabafc551ef747389e12be3ffdaa11b01432d
6c07be374ad2d2488b9320999982fa6316d4a05c
refs/heads/master
2023-09-03T20:10:32.947751
2023-08-30T06:53:49
2023-08-30T06:53:49
103,876,013
35
10
null
null
null
null
UTF-8
Swift
false
false
4,766
swift
// // NSObject+Theme.swift // SwiftTheme // // Created by Gesen on 16/1/22. // Copyright © 2016年 Gesen. All rights reserved. // import UIKit extension NSObject { typealias ThemePickers = [String: ThemePicker] var themePickers: ThemePickers { get { if let themePickers = objc_getAssociatedObject(self, &themePickersKey) as? ThemePickers { return themePickers } let initValue = ThemePickers() objc_setAssociatedObject(self, &themePickersKey, initValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) return initValue } set { objc_setAssociatedObject(self, &themePickersKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) _removeThemeNotification() if newValue.isEmpty == false { _setupThemeNotification() } } } func performThemePicker(selector: String, picker: ThemePicker?) { let sel = Selector(selector) guard responds(to: sel) else { return } guard let value = picker?.value() else { return } if let statePicker = picker as? ThemeStatePicker { let setState = unsafeBitCast(method(for: sel), to: setValueForStateIMP.self) statePicker.values.forEach { setState(self, sel, $1.value()! as AnyObject, UIControlState(rawValue: $0)) } } else if let statusBarStylePicker = picker as? ThemeStatusBarStylePicker { let setStatusBarStyle = unsafeBitCast(method(for: sel), to: setStatusBarStyleValueIMP.self) setStatusBarStyle(self, sel, value as! UIStatusBarStyle, statusBarStylePicker.animated) } else if picker is ThemeBarStylePicker { let setBarStyle = unsafeBitCast(method(for: sel), to: setBarStyleValueIMP.self) setBarStyle(self, sel, value as! UIBarStyle) } else if picker is ThemeKeyboardAppearancePicker { let setKeyboard = unsafeBitCast(method(for: sel), to: setKeyboardValueIMP.self) setKeyboard(self, sel, value as! UIKeyboardAppearance) } else if picker is ThemeActivityIndicatorViewStylePicker { let setActivityStyle = unsafeBitCast(method(for: sel), to: setActivityStyleValueIMP.self) setActivityStyle(self, sel, value as! UIActivityIndicatorViewStyle) } else if picker is ThemeCGFloatPicker { let setCGFloat = unsafeBitCast(method(for: sel), to: setCGFloatValueIMP.self) setCGFloat(self, sel, value as! CGFloat) } else if picker is ThemeCGColorPicker { let setCGColor = unsafeBitCast(method(for: sel), to: setCGColorValueIMP.self) setCGColor(self, sel, value as! CGColor) } else { perform(sel, with: value) } } fileprivate typealias setCGColorValueIMP = @convention(c) (NSObject, Selector, CGColor) -> Void fileprivate typealias setCGFloatValueIMP = @convention(c) (NSObject, Selector, CGFloat) -> Void fileprivate typealias setValueForStateIMP = @convention(c) (NSObject, Selector, AnyObject, UIControlState) -> Void fileprivate typealias setKeyboardValueIMP = @convention(c) (NSObject, Selector, UIKeyboardAppearance) -> Void fileprivate typealias setActivityStyleValueIMP = @convention(c) (NSObject, Selector, UIActivityIndicatorViewStyle) -> Void fileprivate typealias setBarStyleValueIMP = @convention(c) (NSObject, Selector, UIBarStyle) -> Void fileprivate typealias setStatusBarStyleValueIMP = @convention(c) (NSObject, Selector, UIStatusBarStyle, Bool) -> Void } extension NSObject { fileprivate func _setupThemeNotification() { if #available(iOS 9.0, *) { NotificationCenter.default.addObserver(self, selector: #selector(_updateTheme), name: NSNotification.Name(rawValue: ThemeUpdateNotification), object: nil) } else { NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: ThemeUpdateNotification), object: nil, queue: nil, using: { [weak self] notification in self?._updateTheme() }) } } fileprivate func _removeThemeNotification() { NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: ThemeUpdateNotification), object: nil) } @objc private func _updateTheme() { themePickers.forEach { selector, picker in UIView.animate(withDuration: ThemeManager.animationDuration) { self.performThemePicker(selector: selector, picker: picker) } } } } private var themePickersKey = ""
[ 295912, 106476, 239347, 97370, 123166 ]
ba23386cab5771e0250718f7c27714fe204caa1b
48ee6966ebe23d44087a26341ea7e930f3a4b91c
/JSONConverter/Classes/Main/Controller/MainViewController.swift
f38991b9410c12dc6cd6b057a6430f1ea328142c
[]
no_license
PrinceMei/JSONConverter
27d39794625edd4902ba6cecfeb0dd789926e5d9
3d6cbbb715688bb843b92a0aee1eb8c36305396e
refs/heads/master
2020-06-23T15:04:14.391983
2019-07-24T07:59:40
2019-07-24T07:59:40
198,657,937
2
0
null
2019-07-24T15:02:17
2019-07-24T15:02:16
null
UTF-8
Swift
false
false
8,257
swift
// // MainViewController.swift // JSONConverter // // Created by 姚巍 on 2018/1/27. // Copyright © 2018年 姚巍. All rights reserved. // import Cocoa enum LangType: Int { case Swift = 0 case HandyJSON case SwiftyJSON case ObjectMapper case ObjC case Flutter } enum StructType: Int { case `struct` = 0 case `class` } struct LangStruct { var langType: LangType var structType: StructType init(langType: LangType, structType: StructType) { self.langType = langType self.structType = structType } } let FILE_CACHE_CONFIG_KEY = "FILE_CACHE_CONFIG_KEY" class MainViewController: NSViewController { lazy var transTypeTitleArr: [String] = { let titleArr = ["Swift", "HandyJSON", "SwiftyJSON", "ObjectMapper", "Objective-C", "Flutter"] return titleArr }() lazy var structTypeTitleArr: [String] = { let titleArr = ["struct", "class"] return titleArr }() /// 转换模式Box 选择 语言 @IBOutlet weak var converTypeBox: NSComboBox! // 选择 类 或 结构体 @IBOutlet weak var converStructBox: NSComboBox! @IBOutlet weak var prefixField: NSTextField! @IBOutlet weak var rootClassField: NSTextField! @IBOutlet weak var superClassField: NSTextField! @IBOutlet weak var jsonSrollView: NSScrollView! @IBOutlet var jsonTextView: NSTextView! @IBOutlet var classTextView: NSTextView! override func viewDidLoad() { super.viewDidLoad() setupUI() setupCacheConfigData() checkVerion() NotificationCenter.default.addObserver(self, selector: #selector(applicationWillTerminateNotiAction), name: NSNotification.Name.ApplicationWillTerminateNoti, object: nil) } private func checkVerion() { UpgradeUtils.newestVersion { (version) in guard let tagName = version?.tag_name, let bundleVer = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String, let newVer = Int(tagName.replacingOccurrences(of: ".", with: "")), let currentVer = Int(bundleVer.replacingOccurrences(of: ".", with: "")) else { return } if newVer > currentVer { let upgradeVc = UpgradeViewController() upgradeVc.versionInfo = version upgradeVc.currentVer = bundleVer self.presentViewControllerAsModalWindow(upgradeVc) } } } private func setupUI(){ converTypeBox.addItems(withObjectValues: transTypeTitleArr) converTypeBox.delegate = self converStructBox.addItems(withObjectValues: structTypeTitleArr) converStructBox.delegate = self classTextView.isEditable = false jsonTextView.isAutomaticQuoteSubstitutionEnabled = false let lineNumberView = NoodleLineNumberView(scrollView: jsonSrollView) jsonSrollView.hasVerticalRuler = true jsonSrollView.hasHorizontalRuler = false jsonSrollView.verticalRulerView = lineNumberView jsonSrollView.rulersVisible = true } private func setupCacheConfigData() { if let config = UserDefaults.standard.object(forKey: FILE_CACHE_CONFIG_KEY) as? [String: String] { let file = File.cacheFile(withDic: config) converTypeBox.selectItem(at: file.langStruct.langType.rawValue) converStructBox.selectItem(at: file.langStruct.structType.rawValue) prefixField.stringValue = file.prefix rootClassField.stringValue = file.rootName superClassField.stringValue = file.superName }else { converTypeBox.selectItem(at: 0) converStructBox.selectItem(at: 0) } } @IBAction func supportMeAction(_ sender: NSButton) { let rewardVc = RewardViewController() presentViewControllerAsModalWindow(rewardVc) } @IBAction func converBtnAction(_ sender: NSButton) { if let jsonStr = jsonTextView.textStorage?.string { guard let jsonData = jsonStr.data(using: .utf8), let json = try? JSONSerialization.jsonObject(with: jsonData, options: .mutableContainers)else{ alert(title: "转换内容Josn出错", desc: "未知数据格式无法解析,请提供正确的Json字符串") return } if let formatJosnData = try? JSONSerialization.data(withJSONObject: json as AnyObject, options: .prettyPrinted), let formatJsonStr = String(data: formatJosnData, encoding: .utf8){ setJsonContent(content: formatJsonStr) } guard let file = fileStructure() else { alert(title: "转换配置出错", desc: "解析Josn配置出错,请清空配置信息重新解析") return } let classStr = JSONParseManager.shared.handleEngine(frome: json, file:file) setClassContent(content: classStr) } } private func setJsonContent(content: String){ if content.count > 0{ let attrContent = NSMutableAttributedString(string: content) jsonTextView.textStorage?.setAttributedString(attrContent) jsonTextView.textStorage?.font = NSFont.systemFont(ofSize: 14) jsonTextView.textStorage?.foregroundColor = NSColor.labelColor } } private func setClassContent(content: String) { if content.count > 0{ let attrContent = NSMutableAttributedString(string: content) classTextView.textStorage?.setAttributedString(attrContent) classTextView.textStorage?.font = NSFont.systemFont(ofSize: 14) classTextView.textStorage?.foregroundColor = NSColor.labelColor } } private func fileStructure() -> File? { let rootName = rootClassField.stringValue.isEmpty ? "RootClass" : rootClassField.stringValue let prefix = prefixField.stringValue let superName = superClassField.stringValue guard let langTypeType = LangType(rawValue: converTypeBox.indexOfSelectedItem), let structType = StructType(rawValue: converStructBox.indexOfSelectedItem) else { assert(false, "语言和结构类型组合出错") return nil } let transStruct = LangStruct(langType: langTypeType, structType: structType) let file = File.file(withName: rootName, prefix: prefix, langStruct: transStruct, superName: superName) return file } private func alert(title: String, desc: String) { let alert = NSAlert() alert.messageText = title alert.informativeText = desc alert.runModal() } } extension MainViewController { @objc func applicationWillTerminateNotiAction() { // 保存 prefix rootclass superclass 结构类型 语言 配置,下次打开默认使用此配置 guard let file = fileStructure() else { return } let cacheDic = file.toCacheConfig() UserDefaults.standard.set(cacheDic, forKey: FILE_CACHE_CONFIG_KEY) UserDefaults.standard.synchronize() } } extension MainViewController: NSComboBoxDelegate { func comboBoxSelectionDidChange(_ notification: Notification) { let comBox = notification.object as! NSComboBox if comBox == converTypeBox { // 选择语言 let langType = LangType(rawValue: converTypeBox.indexOfSelectedItem) if langType == LangType.ObjC || langType == LangType.Flutter { // 如果是OC Flutter 就选择 class converStructBox.selectItem(at: 1) } }else if comBox == converStructBox { //选择类或结构体 let langType = LangType(rawValue: converTypeBox.indexOfSelectedItem) if langType == LangType.ObjC || langType == LangType.Flutter { // 如果是OC Flutter 无论怎么选 都是 类 converStructBox.selectItem(at: 1) } } } }
[ -1 ]
64512cdd5989c2cb3e7b64c4a9365ed0c805f153
ae973f3a2146b43db58cf41d15ab57405df80c59
/Sunlit/Source/ViewControllers/TimelineViewController.swift
4e6d45f8a9ac5f2740b313c9f0491c7771db931e
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
8secz-johndpope/sunlit
8fc52df6d42cd9d194edd02148eac60fb447f474
bcfa8385f8e4eb3f8f5e3a067991ff0a6faf5829
refs/heads/master
2023-01-08T17:07:43.835914
2020-11-13T00:12:06
2020-11-13T00:12:06
null
0
0
null
null
null
null
UTF-8
Swift
false
false
17,691
swift
// // TimelineViewController.swift // Sunlit // // Created by Jonathan Hays on 5/3/20. // Copyright © 2020 Micro.blog, LLC. All rights reserved. // import UIKit import SafariServices import Snippets class TimelineViewController: ContentViewController { @IBOutlet var tableView : UITableView! @IBOutlet var loggedOutView : UIView! @IBOutlet var spinner: UIActivityIndicatorView! var refreshControl = UIRefreshControl() var keyboardAccessoryView : UIView! var tableViewData : [SunlitPost] = [] var loadingData = false var noMoreToLoad = false override func viewDidLoad() { super.viewDidLoad() self.setupNavigation() self.setupTableView() self.loadTimeline() } override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { self.loadTimeline() } func setupTableView() { self.refreshControl.addTarget(self, action: #selector(loadTimeline), for: .valueChanged) self.tableView.addSubview(self.refreshControl) self.loadFrequentlyUsedEmoji() } override func navbarTitle() -> String { return "Timeline" } override func prepareToDisplay() { super.prepareToDisplay() self.updateLoggedInStatus() } override func setupNotifications() { super.setupNotifications() NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardShowNotification(_:)), name: .scrollTableViewNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShowNotification(_:)), name: UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHideNotification(_:)), name: UIResponder.keyboardWillHideNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardDidShowNotification(_:)), name: UIResponder.keyboardDidShowNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(handleViewConversationNotification(_:)), name: .viewConversationNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(handleCurrentUserUpdatedNotification), name: .currentUserUpdatedNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(handleImageLoadedNotification(_:)), name: .refreshCellNotification, object: nil) } @objc override func handleScrollToTopGesture() { if tableViewData.count > 0 { self.tableView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: true) } } func updateLoggedInStatus() { let token = Settings.snippetsToken() self.loggedOutView.isHidden = (token != nil) self.loggedOutView.superview?.bringSubviewToFront(self.loggedOutView) } @IBAction func onShowLogin() { NotificationCenter.default.post(name: .showLoginNotification, object: nil) } /* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// MARK: - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */ @objc func emojiSelected(_ button : UIButton) { if let emoji = button.title(for: .normal) { NotificationCenter.default.post(name: .emojiSelectedNotification, object: emoji) } } @objc func keyboardWillShowNotification(_ notification : Notification) { if let info : [AnyHashable : Any] = notification.userInfo { if let value : NSValue = info[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue { // run later outside of animation context DispatchQueue.main.async { // start at bottom of screen var start_r = self.view.bounds start_r.origin.y = start_r.size.height + self.keyboardAccessoryView.bounds.size.height start_r.size.height = self.keyboardAccessoryView.bounds.size.height self.keyboardAccessoryView.frame = start_r self.view.addSubview(self.keyboardAccessoryView) // show it self.keyboardAccessoryView.isHidden = false self.keyboardAccessoryView.alpha = 1.0 // animate into position let frame = value.cgRectValue let height = self.keyboardAccessoryView.frame.size.height let safeArea : CGFloat = self.view.safeAreaInsets.bottom var offset = frame.origin.y - height if UIDevice.current.userInterfaceIdiom == .phone { offset = offset + safeArea } if let duration = info[UIResponder.keyboardAnimationDurationUserInfoKey] as? Double { let curve_default = 7 let curve_value = (info[UIResponder.keyboardAnimationCurveUserInfoKey] as? NSNumber)?.intValue ?? curve_default let options = UIView.AnimationOptions(rawValue: UInt(curve_value << 16)) UIView.animate(withDuration: duration, delay: 0, options: options, animations: { self.keyboardAccessoryView.frame = CGRect(x: 0, y: offset, width: frame.size.width, height: height) }) } } } } } @objc func keyboardWillHideNotification(_ notification : Notification) { self.keyboardAccessoryView.removeFromSuperview() self.keyboardAccessoryView.alpha = 0.0 } @objc func keyboardDidShowNotification(_ notification : Notification) { UIView.animate(withDuration: 0.3) { self.keyboardAccessoryView.alpha = 1.0 } } @objc func handleKeyboardShowNotification(_ notification : Notification) { if let dictionary = notification.object as? [String : Any] { let keyboardRect = dictionary["keyboardOffset"] as! CGRect var tableViewLocation = dictionary["tableViewLocation"] as! CGFloat let keyboardTop = keyboardRect.origin.y - self.keyboardAccessoryView.frame.size.height tableViewLocation = tableViewLocation - self.keyboardAccessoryView.frame.size.height let screenOffset = self.tableView.frame.origin.y + (tableViewLocation - self.tableView.contentOffset.y) let visibleOffset = self.tableView.contentOffset.y + (screenOffset - keyboardTop) + 60.0 self.tableView.setContentOffset(CGPoint(x: 0, y: visibleOffset), animated: true) } } @objc func handleImageLoadedNotification(_ notification : Notification) { if let indexPath = notification.object as? IndexPath { if indexPath.row < self.tableViewData.count { if let visibleCells = self.tableView.indexPathsForVisibleRows { if visibleCells.contains(indexPath) { self.tableView.reloadRows(at: [ indexPath ], with: .none) } } } } } @objc func handleViewConversationNotification(_ notification : Notification) { if let post = notification.object as? SunlitPost { let storyBoard: UIStoryboard = UIStoryboard(name: "Conversation", bundle: nil) let conversationViewController = storyBoard.instantiateViewController(withIdentifier: "ConversationViewController") as! ConversationViewController conversationViewController.sourcePost = post self.navigationController?.pushViewController(conversationViewController, animated: true) } } @objc func handleCurrentUserUpdatedNotification() { self.loadTimeline() } /* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// MARK: - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */ func loadFrequentlyUsedEmoji() { let emoji = Tagmoji.shared.frequentlyUsedEmoji() let scrollView = UIScrollView() let contentView = UIView() scrollView.addSubview(contentView) scrollView.backgroundColor = UIColor(named: "color_emoji_selection")! var buttonOffset = CGPoint(x: 0, y: 0) for symbol in emoji { let button = UIButton(frame: CGRect(x: buttonOffset.x, y: buttonOffset.y, width: 44, height: 44)) button.setTitle(symbol, for: .normal) contentView.addSubview(button) buttonOffset.x += 44 button.addTarget(self, action: #selector(self.emojiSelected(_:)), for: .touchUpInside) if let backgroundImage = UIImage.uuSolidColorImage(color: UIColor(named: "color_emoji_selection")!) { button.setBackgroundImage(backgroundImage, for: .highlighted) } } contentView.frame = CGRect(x: 0, y: 0, width: buttonOffset.x, height: 44) scrollView.addSubview(contentView) scrollView.contentSize = CGSize(width: buttonOffset.x, height: buttonOffset.y) scrollView.frame = CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: 44) scrollView.showsHorizontalScrollIndicator = false self.keyboardAccessoryView = scrollView self.keyboardAccessoryView.alpha = 0.0 } @objc func loadTimeline() { self.noMoreToLoad = false let token = Settings.snippetsToken() self.loggedOutView.isHidden = (token != nil) self.loggedOutView.superview?.bringSubviewToFront(self.loggedOutView) // Safety check for double loads... if self.loadingData == true { return } self.loadingData = true Snippets.Microblog.fetchCurrentUserMediaTimeline { (error, postObjects : [SnippetsPost]) in DispatchQueue.main.async { if error == nil && postObjects.count > 0 { self.refreshTableView(postObjects) } else { self.handleTimelineError(error as NSError?) } self.loadingData = false self.spinner.stopAnimating() } } } @objc func loadMoreTimeline() { // Safety check for double loads... if self.loadingData == true { return } // Don't keep reloading the same stuff over and over again... if self.noMoreToLoad == true { return } if let last = self.tableViewData.last { self.loadingData = true var parameters : [String : String] = [:] parameters["count"] = "10" parameters["before_id"] = last.identifier Snippets.Microblog.fetchCurrentUserMediaTimeline(parameters: parameters, completion: { (error, entries : [SnippetsPost]) in DispatchQueue.main.async { if entries.count == 0 { self.noMoreToLoad = true let indexPath = IndexPath(row: self.tableViewData.count, section: 0) self.tableView.insertRows(at: [indexPath], with: .automatic) return } var row = self.tableViewData.count var indexPaths : [IndexPath] = [] for entry in entries { let post = SunlitPost.create(entry) if post.images.count > 0 { self.tableViewData.append(post) let indexPath = IndexPath(row: row, section: 0) indexPaths.append(indexPath) row = row + 1 } } self.tableView.insertRows(at: indexPaths, with: .automatic) self.loadingData = false } }) } } func prefetchImages(_ indexPath : IndexPath) { if indexPath.row >= self.tableViewData.count { return } let post = self.tableViewData[indexPath.row] for imageSource in post.images { if ImageCache.prefetch(imageSource) == nil { ImageCache.fetch(self, imageSource) { (image) in if let _ = image { DispatchQueue.main.async { NotificationCenter.default.post(name: .refreshCellNotification, object: indexPath) } } } } } let avatarSource = post.owner.avatarURL if ImageCache.prefetch(avatarSource) == nil { ImageCache.fetch(self, avatarSource) { (image) in if let _ = image { DispatchQueue.main.async { NotificationCenter.default.post(name: .refreshCellNotification, object: indexPath) } } } } } func handleTimelineError(_ error : NSError?) { if let err = error as NSError? { switch err.code { case 401, // Not authorized 402, // Payment required 451: // Unavailable for legal reasonse Dialog(self).information(err.localizedDescription) case 403: // Forbidden break case 404: // Not found break case 408: // Timeout // wait a few seconds before re-trying after an error self.loadingData = false DispatchQueue.main.asyncAfter(deadline: .now()) { self.loadTimeline() } case 405, // Method not allowed 406, // Not acceptable 407, // Proxy authentication required 409, // Conflict 410, // Gone 411, // Length required 412, // Precondition failed 413, // Payload too large 414, // URI too long 415, // Unsupported media type 416, // Range not satisfiable 417, // Expectation failed 418: // I'm a teapot // wait a few seconds before re-trying after an error self.loadingData = false DispatchQueue.main.asyncAfter(deadline: .now() + 5.0) { self.loadTimeline() } default: // wait a few seconds before re-trying after an error self.loadingData = false DispatchQueue.main.asyncAfter(deadline: .now() + 5.0) { self.loadTimeline() } } } } } /* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// MARK: - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */ extension TimelineViewController : UITableViewDataSource, UITableViewDelegate, UITableViewDataSourcePrefetching { func refreshTableView(_ entries : [SnippetsPost]) { var posts : [SunlitPost] = [] for entry in entries { let post = SunlitPost.create(entry) if post.images.count > 0 { posts.append(post) } } self.tableViewData = posts self.refreshControl.endRefreshing() self.tableView.reloadData() } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { var count = self.tableViewData.count if self.noMoreToLoad == true { count = count + 1 } return count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { if indexPath.row >= self.tableViewData.count { if self.tableViewData.count == 0 { return tableView.dequeueReusableCell(withIdentifier: "TimelineFirstTimeCell")! } else { return tableView.dequeueReusableCell(withIdentifier: "TimelineNoMoreCell")! } } let cell = tableView.dequeueReusableCell(withIdentifier: "SunlitPostTableViewCell", for: indexPath) as! SunlitPostTableViewCell let post = self.tableViewData[indexPath.row] cell.setup(indexPath.row, post, parentWidth: tableView.bounds.size.width) return cell } func tableView(_ tableView: UITableView, prefetchRowsAt indexPaths: [IndexPath]) { for indexPath in indexPaths { self.prefetchImages(indexPath) } } func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { self.prefetchImages(indexPath) if indexPath.row > (self.tableViewData.count - 3) { self.loadMoreTimeline() } } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if indexPath.row >= self.tableViewData.count { NotificationCenter.default.post(name: .showDiscoverNotification, object:nil) return } tableView.deselectRow(at: indexPath, animated: true) let post = self.tableViewData[indexPath.row] let imagePath = post.images[0] var dictionary : [String : Any] = [:] dictionary["imagePath"] = imagePath dictionary["post"] = post NotificationCenter.default.post(name: .viewPostNotification, object: dictionary) } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { if indexPath.row >= self.tableViewData.count { if self.tableViewData.count == 0 { return self.tableView.bounds.size.height - 60.0 } else { return 215.0 } } let post = self.tableViewData[indexPath.row] return SunlitPostTableViewCell.height(post, parentWidth: tableView.bounds.size.width) } } /* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// MARK: - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */ extension TimelineViewController : UITextViewDelegate { func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { UIView.setAnimationsEnabled(false) self.tableView.beginUpdates() self.tableView.endUpdates() UIView.setAnimationsEnabled(true) return true } func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool { let safariViewController = SFSafariViewController(url: URL) self.present(safariViewController, animated: true, completion: nil) return false } }
[ -1 ]
23cf17135824260564dfa3491b71a1648b512ddd
ae56da16c8573cc4615c9ec5cba4eec75caf3b08
/NewsReader/ViewModel/SingleArticleViewModel.swift
ece507c774c80b6e839a8360523886aea1d76b4e
[]
no_license
trifunovicd/NewsReader
c050fca013711122e766a4aeb67f03de3c907fbc
c5e1e80f07b4b5d5f1494877cf76763898824ff6
refs/heads/master
2021-01-16T02:11:24.575963
2020-04-06T08:41:27
2020-04-06T08:41:27
242,939,096
0
0
null
null
null
null
UTF-8
Swift
false
false
679
swift
// // SingleArticleViewModel.swift // NewsReader // // Created by Internship on 13/03/2020. // Copyright © 2020 Internship. All rights reserved. // import Foundation import RxSwift class SingleArticleViewModel { //MARK: Properties let articles: [News] let index: Int let scrollToItem = PublishSubject<IndexPath>() weak var coordinatorDelegate: (WebViewDelegate & ViewControllerDelegate)? init(articles: [News], index: Int) { self.articles = articles self.index = index } func scrollToPreselectedItem() { let indexPath = IndexPath(row: index, section: 0) scrollToItem.onNext(indexPath) } }
[ -1 ]
f948ce7c66151e76d4944553a7e14b19dec28bee
de1c250732e970f5a957453d544025fd3303a72e
/TresPuntos/CartaCelda.swift
c0a0f166010795d48d77b5595e355c0d60cfeca6
[]
no_license
xjsanchezf/tres-puntos
1ea9389fed727e6f4823ab02d53f18f65456c2ee
e5a5e831b1239b176d84d40045108e4095c402e7
refs/heads/master
2020-08-29T15:50:39.352175
2019-10-29T15:22:02
2019-10-29T15:22:02
218,080,790
0
0
null
null
null
null
UTF-8
Swift
false
false
419
swift
// // CartaCelda.swift // TresPuntos // // Created by user148984 on 10/29/19. // Copyright © 2019 Xiomara Sánchez. All rights reserved. // import UIKit class CartaCelda: UITableViewCell { @IBOutlet weak var CartaImagen: UIImageView! @IBOutlet weak var CartaNombre: UILabel! func setCarta(carta: Carta) { CartaImagen.image = carta.imagen CartaNombre.text = carta.nombre } }
[ -1 ]
14977a96a0aaa6c142ababf1dee1a838ce557e2c
957e90001320b3ea8ae395a641d552192d0c2f88
/CoreGraphicsPG/CoreGraphicsPG/AppDelegate.swift
ec681e2e818513ff5894889002969841e0d072d2
[]
no_license
eonsubae/storyboard-based-test
da6e23f0b3cbd7d298e6570c408dbe7a65442b2b
8337a679c310f227e9151c22b336f272a66cfe89
refs/heads/master
2023-03-02T17:00:18.263899
2021-02-02T12:14:54
2021-02-02T12:14:54
319,542,272
0
0
null
null
null
null
UTF-8
Swift
false
false
1,353
swift
// // AppDelegate.swift // CoreGraphicsPG // // Created by KRITSSEAN on 2021/01/25. // import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 213048, 385081, 376889, 393275, 376905, 327756, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 286831, 368752, 286844, 417924, 262283, 286879, 286888, 377012, 327871, 180416, 377036, 180431, 377046, 418010, 377060, 327914, 205036, 393456, 393460, 336123, 418043, 336128, 385280, 262404, 180490, 164106, 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, 385451, 262573, 393647, 385458, 262586, 344511, 262592, 360916, 369118, 328177, 328179, 328182, 328189, 328192, 164361, 410128, 393747, 254490, 188958, 385570, 33316, 197159, 377383, 352821, 197177, 188987, 418363, 369223, 385609, 385616, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 148105, 377484, 352918, 98968, 344744, 361129, 336555, 385713, 434867, 164534, 336567, 164538, 328378, 328386, 352968, 344776, 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, 328519, 361288, 336711, 328522, 426841, 197468, 254812, 361309, 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, 386285, 328941, 386291, 345376, 353570, 345379, 410917, 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, 419517, 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, 354150, 354156, 345964, 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, 190796, 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, 338543, 191092, 346742, 330383, 354974, 150183, 174774, 248504, 174777, 223934, 355024, 273108, 355028, 264918, 183005, 256734, 436962, 338660, 338664, 264941, 363251, 207619, 264964, 338700, 256786, 199452, 363293, 396066, 346916, 396069, 215853, 355122, 355131, 355140, 355143, 338763, 355150, 330580, 355166, 265055, 265058, 355175, 387944, 355179, 330610, 330642, 355218, 412599, 207808, 379848, 396245, 330710, 248792, 248798, 347105, 257008, 183282, 265207, 330748, 265214, 330760, 330768, 248862, 396328, 158761, 347176, 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, 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, 250199, 250202, 332125, 250210, 348522, 348525, 348527, 332152, 250238, 389502, 332161, 356740, 332172, 373145, 340379, 389550, 324030, 266687, 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, 381813, 324472, 398201, 119674, 324475, 430972, 340861, 324478, 340858, 324481, 373634, 398211, 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, 209943, 250914, 357410, 185380, 357418, 209965, 209968, 209971, 209975, 209979, 209987, 209990, 341071, 349267, 250967, 210010, 341091, 210025, 210027, 210030, 210036, 210039, 349308, 210044, 160895, 152703, 349311, 210052, 210055, 349319, 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, 365911, 259421, 365921, 333154, 251235, 374117, 333162, 234866, 390516, 333175, 357755, 251271, 136590, 374160, 112020, 349590, 357792, 259515, 415166, 415185, 366034, 366038, 415191, 415193, 415196, 415199, 423392, 333284, 415207, 366056, 366061, 415216, 210420, 415224, 423423, 415257, 415263, 366117, 415270, 144939, 415278, 415281, 415285, 210487, 415290, 415293, 349761, 415300, 333386, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 267909, 153227, 333498, 210631, 333511, 259788, 358099, 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, 333774, 358371, 350189, 350193, 350202, 333818, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350240, 350244, 350248, 178218, 350251, 350256, 350259, 350271, 243781, 350285, 374864, 342111, 342133, 374902, 432271, 333997, 334011, 260289, 260298, 350410, 350416, 350422, 211160, 350425, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 350467, 325891, 350475, 375053, 268559, 350480, 432405, 350486, 325914, 350490, 325917, 350493, 350498, 194852, 350504, 358700, 350509, 391468, 358704, 358713, 358716, 383306, 334161, 383321, 383330, 383333, 391530, 383341, 334203, 268668, 194941, 391563, 366990, 416157, 268701, 342430, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 195039, 334304, 334311, 375277, 334321, 350723, 391690, 186897, 342545, 334358, 342550, 342554, 334363, 358941, 350761, 252461, 383536, 358961, 334384, 334394, 252482, 219718, 334407, 334420, 350822, 375400, 334465, 334468, 162445, 326290, 342679, 342683, 260766, 342710, 244409, 260797, 260801, 350917, 154317, 391894, 154328, 416473, 64230, 113388, 342766, 375535, 203506, 342776, 391937, 391948, 375568, 326416, 375571, 375574, 162591, 326441, 383793, 326451, 326454, 244540, 326460, 375612, 260924, 326467, 244551, 326473, 326477, 326485, 416597, 342874, 326490, 326502, 433000, 375656, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 342915, 400259, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 359366, 326598, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 367723, 384107, 187502, 384114, 343154, 212094, 351364, 384135, 384139, 384143, 351381, 384160, 384168, 367794, 384181, 367800, 351423, 384191, 384198, 326855, 253130, 343244, 146642, 359649, 343270, 351466, 351479, 384249, 343306, 261389, 359694, 253200, 261393, 384275, 245020, 245029, 171302, 351534, 376110, 245040, 384314, 425276, 384323, 212291, 343365, 212303, 367965, 343393, 343398, 367980, 425328, 343409, 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, 179802, 327275, 245357, 138864, 155254, 155273, 368288, 245409, 425638, 425649, 155322, 425662, 155327, 155351, 155354, 212699, 155363, 245483, 155371, 409335, 155393, 155403, 155422, 360223, 155438, 155442, 155447, 417595, 155461, 360261, 376663, 155482, 261981, 425822, 376671, 155487, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 425845, 262005, 147317, 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 ]
fda8230c05c9b6b2f44e98f106072aa01c97fbd1
9beaa7cfc92a31d6c9c7cc9eac9026b9dceff7ea
/NewsFeed/ArticleViewController.swift
beaf9057c53d81c8dbc988142ad1e9dbc8ca8873
[]
no_license
jdee/NewsFeed
2203bdaf3feeb6fb674bc3febca5d22c70cc13d3
26f508f90e54d0f2e8a1c785d22b12c8e22bc801
refs/heads/master
2020-04-11T13:51:37.203429
2018-12-14T21:59:34
2018-12-14T21:59:34
161,832,574
0
0
null
null
null
null
UTF-8
Swift
false
false
1,652
swift
// // ArticleViewController.swift // NewsFeed // // Created by Jimmy Dee on 12/14/18. // Copyright © 2018 Dubsar Dictionary Project. All rights reserved. // import UIKit import WebKit class ArticleViewController: UIViewController, WKNavigationDelegate { static let identifier = "Article" @IBOutlet var titleLabel: UILabel! @IBOutlet var authorLabel: UILabel! @IBOutlet var dateLabel: UILabel! @IBOutlet var webView: WKWebView! var article: Article! { didSet { title = article.sourceName } } override func viewDidLoad() { super.viewDidLoad() titleLabel.text = article.title if let author = article.author { authorLabel.text = author authorLabel.isHidden = false } else { authorLabel.isHidden = true } if let date = article.publicationTime { let formatter = DateFormatter() formatter.locale = Locale(identifier: "en_US") formatter.dateStyle = .medium formatter.timeStyle = .medium dateLabel.text = formatter.string(from: date) dateLabel.isHidden = false } else { dateLabel.isHidden = true } view.setNeedsLayout() webView.navigationDelegate = self guard let url = URL(string: article.url ?? "") else { return } webView.load(URLRequest(url: url)) } func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) { print("Failed to load article \(article.url!): \(error.localizedDescription)") } }
[ -1 ]
029d714cca48326112bafdc165f9e3caddd09a87
0bbd5652a028a06a0275f8cceb6e41bedd66bb59
/swiftUIExample/MVVM/ManagementScreen/ViewModel/ManagementViewModel.swift
cfce572897f0f5c5020036f495846014255e7aad
[]
no_license
ahmedhafez-iws/swiftUIExample
80cdc8803c1432c1b1f6c04e681b2c53f39a464d
746bcf8ccbf654df0d7ec9b2dde3632258c797a0
refs/heads/master
2022-11-18T00:44:31.163538
2020-07-12T14:51:39
2020-07-12T14:51:39
278,422,810
0
0
null
null
null
null
UTF-8
Swift
false
false
530
swift
// // ManagementViewModel.swift // swiftUIExample // // Created by user174699 on 7/9/20. // Copyright © 2020 user174699. All rights reserved. // import Foundation class ManagementViewModel { private (set) var step: Int init() { self.step = 0 } func getViewModelForLoginView(step: Int) -> LoginViewModel { self.step = step return LoginViewModel() } func getViewModelForMainView() -> MainViewViewModel { return MainViewViewModel(step: step) } }
[ -1 ]
53c827c019c139c2379e74cc335e89372458a48c
1c06e9ece4a51463d83ed4478c31009a15d41e68
/BellmanTask/UI/Home/Model/HomeAPI.swift
2ea93288a2672c29b60da4e0ed18a6d7b9a7f5b0
[]
no_license
AmmarMagdy/BellmanTask
cf831abb8a7db231e77cbef87b9547ad72994696
2a063f253018045bc44e882a3afc9355b5c3c885
refs/heads/main
2023-03-28T23:34:16.438072
2021-03-20T20:22:37
2021-03-20T20:22:37
349,709,798
0
0
null
null
null
null
UTF-8
Swift
false
false
2,019
swift
// // HomeAPI.swift // BellmanTask // // Created by Ammar.M on 20/03/2021. // import Foundation struct HomeAPI { var data : APIData! var message : String! var statusCode : Int! /** * Instantiate the instance using the passed dictionary values to set the properties values */ init(fromDictionary dictionary: [String:Any]){ if let dataData = dictionary["data"] as? [String:Any]{ data = APIData(fromDictionary: dataData) } message = dictionary["message"] as? String statusCode = dictionary["status_code"] as? Int } } struct APIData { var attractions : [Data]! var events : [Data]! var hotSpots : [Data]! /** * Instantiate the instance using the passed dictionary values to set the properties values */ init(fromDictionary dictionary: [String:Any]){ attractions = [Data]() if let attractionsArray = dictionary["attractions"] as? [[String:Any]]{ for dic in attractionsArray{ let value = Data(fromDictionary: dic) attractions.append(value) } } events = [Data]() if let eventsArray = dictionary["events"] as? [[String:Any]]{ for dic in eventsArray{ let value = Data(fromDictionary: dic) events.append(value) } } hotSpots = [Data]() if let hotSpotsArray = dictionary["hot_spots"] as? [[String:Any]]{ for dic in hotSpotsArray{ let value = Data(fromDictionary: dic) hotSpots.append(value) } } } } struct Data: CellData { var descriptionField: String! var name: String! var photos : [String]! init(fromDictionary dictionary: [String:Any]){ descriptionField = dictionary["description"] as? String name = dictionary["name"] as? String photos = dictionary["photos"] as? [String] } }
[ -1 ]
0471634e1b061593aa375c47f519e3ad9cdf23db
0ad0f5193dea0e7c5f366ea1b4150aced5f84e58
/apiCall/apiCall/Controllers/HomeViewController.swift
404915a57be78ca012012119a69b4988c53cd57b
[]
no_license
mdrame/Hacking_With_Swift
a551e5095334e057ba8e55c1060f930841768959
d0acdd6ed9dbcd691e5565d3e45fb91383b61e60
refs/heads/master
2020-08-31T08:04:36.160296
2020-05-22T05:48:59
2020-05-22T05:48:59
218,643,439
0
0
null
null
null
null
UTF-8
Swift
false
false
13,784
swift
// // DetailViewController.swift // apiCall // // Created by Mohammed Drame on 1/13/20. // Copyright © 2020 Mo Drame. All rights reserved. // import UIKit class HomeViewController : UIViewController { override func viewDidLoad() { super.viewDidLoad() navigationController?.setNavigationBarHidden(true, animated: false) view.backgroundColor = #colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 1) print(buttonsHeight.text()) addSubViewsToView() // // UIView.animate(withDuration: <#T##TimeInterval#>, delay: <#T##TimeInterval#>, options: [.curveLinear, .repeat], animations: <#T##() -> Void#>, completion: <#T##((Bool) -> Void)?##((Bool) -> Void)?##(Bool) -> Void#>) } // MARK: INSTACE let buttonsHeight: ButtonsHeight = ButtonsHeight() func addSubViewsToView() { view.addSubview(appNameLabel) appNameLabelConstrain() view.addSubview(applogo) applogoConstrain() view.addSubview(buttonsView) buttonsViewConstrain() view.addSubview(easybutton_and_scorelabel_stackView) easybutton_and_scorelabel_stackView_constrain() easybutton_and_scorelabel_stackView.addArrangedSubview(easyButton) easyButtonConstrain() easybutton_and_scorelabel_stackView.addArrangedSubview(easyButtonScoreLabel) easyButtonScoreLabelConstrain() view.addSubview(mediumbutton_and_scorelabel_stackView) mediumbutton_and_scorelabel_stackView_constrain() mediumbutton_and_scorelabel_stackView.addArrangedSubview(mediumButton) mediumButtonConstrain() mediumbutton_and_scorelabel_stackView.addArrangedSubview(mediumButtonScoreLabel) mediumButtonScoreLabelConstrain() view.addSubview(hardbutton_and_scorelabel_stackView) hardbutton_and_scorelabel_stackView_constrain() hardbutton_and_scorelabel_stackView.addArrangedSubview(hardButton) hardButtonConstrain() hardbutton_and_scorelabel_stackView.addArrangedSubview(hardButtonScoreLabel) hardButtonScoreLabelConstrain() } // App Title let appNameLabel: UILabel = { let appNameLabel = AppNameLabel(title: "") appNameLabel.translatesAutoresizingMaskIntoConstraints = false return appNameLabel }() func appNameLabelConstrain() { NSLayoutConstraint.activate([ appNameLabel.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 10), appNameLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 0), appNameLabel.heightAnchor.constraint(equalToConstant: 60), appNameLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -0) ]) } // App Logo let applogo: UIImageView = { let applogo = LogoCustomClass(logoimage: #imageLiteral(resourceName: "brainFartLogo")) applogo.translatesAutoresizingMaskIntoConstraints = false return applogo }() func applogoConstrain() { NSLayoutConstraint.activate([ applogo.topAnchor.constraint(equalTo: appNameLabel.bottomAnchor, constant: 0), applogo.leadingAnchor.constraint(equalTo: appNameLabel.leadingAnchor), applogo.heightAnchor.constraint(equalToConstant: 150), applogo.trailingAnchor.constraint(equalTo: appNameLabel.trailingAnchor) ]) } let buttonsView: UIView = { let buttonsView = UIView(frame: .zero) buttonsView.backgroundColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1) buttonsView.layer.cornerRadius = 10 buttonsView.translatesAutoresizingMaskIntoConstraints = false buttonsView.layer.shadowColor = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1) buttonsView.layer.shadowOffset = CGSize(width: 0, height: 3) buttonsView.layer.shadowOpacity = 1.0 buttonsView.layer.shadowRadius = 10.0 buttonsView.layer.masksToBounds = false return buttonsView }() func buttonsViewConstrain() { NSLayoutConstraint.activate([ buttonsView.topAnchor.constraint(equalTo: applogo.bottomAnchor, constant: 75), buttonsView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 10), buttonsView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -50), buttonsView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -10) ]) } let easybutton_and_scorelabel_stackView: UIStackView = { let button_and_label_stackView = UIStackView(frame: .zero) button_and_label_stackView.distribution = .fillProportionally button_and_label_stackView.spacing = 1 button_and_label_stackView.axis = .vertical button_and_label_stackView.translatesAutoresizingMaskIntoConstraints = false return button_and_label_stackView }() func easybutton_and_scorelabel_stackView_constrain() { NSLayoutConstraint.activate([ easybutton_and_scorelabel_stackView.topAnchor.constraint(equalTo: buttonsView.topAnchor, constant: 20), easybutton_and_scorelabel_stackView.leadingAnchor.constraint(equalTo: buttonsView.leadingAnchor, constant: 10), easybutton_and_scorelabel_stackView.heightAnchor.constraint(equalToConstant: 150), easybutton_and_scorelabel_stackView.trailingAnchor.constraint(equalTo: buttonsView.trailingAnchor, constant: -10) ]) } let easyButton: UIButton = { let easyButton = DifficultyLevelsCustomButton(title: "E A S Y", bgColor: #colorLiteral(red: 0.3411764801, green: 0.6235294342, blue: 0.1686274558, alpha: 1)) easyButton.translatesAutoresizingMaskIntoConstraints = false easyButton.setTitleColor(#colorLiteral(red: 0, green: 0, blue: 0, alpha: 1), for: .normal) easyButton.addTarget(self, action: #selector(easyButtonPressed), for: .touchUpInside) return easyButton }() @objc func easyButtonPressed() { print("Easy Mode Activated") } func easyButtonConstrain() { NSLayoutConstraint.activate([ easyButton.topAnchor.constraint(equalTo: easybutton_and_scorelabel_stackView.topAnchor), easyButton.leadingAnchor.constraint(equalTo: easybutton_and_scorelabel_stackView.leadingAnchor), easyButton.bottomAnchor.constraint(equalTo: easybutton_and_scorelabel_stackView.bottomAnchor, constant: -40), easyButton.trailingAnchor.constraint(equalTo: easybutton_and_scorelabel_stackView.trailingAnchor) ]) } let easyButtonScoreLabel: UILabel = { let easyButtonScoreLabel = DashBoardScoreLabel(title: "Score: ") easyButtonScoreLabel.translatesAutoresizingMaskIntoConstraints = false return easyButtonScoreLabel }() func easyButtonScoreLabelConstrain() { NSLayoutConstraint.activate([ easyButtonScoreLabel.topAnchor.constraint(equalTo: easyButton.bottomAnchor), easyButtonScoreLabel.leadingAnchor.constraint(equalTo: easybutton_and_scorelabel_stackView.leadingAnchor), easyButtonScoreLabel.bottomAnchor.constraint(equalTo: easybutton_and_scorelabel_stackView.bottomAnchor), easyButtonScoreLabel.trailingAnchor.constraint(equalTo: easybutton_and_scorelabel_stackView.trailingAnchor) ]) } let mediumbutton_and_scorelabel_stackView: UIStackView = { let mediumbutton_and_scorelabel_stackView = UIStackView(frame: .zero) mediumbutton_and_scorelabel_stackView.distribution = .fillProportionally mediumbutton_and_scorelabel_stackView.spacing = 1 mediumbutton_and_scorelabel_stackView.axis = .vertical mediumbutton_and_scorelabel_stackView.translatesAutoresizingMaskIntoConstraints = false return mediumbutton_and_scorelabel_stackView }() func mediumbutton_and_scorelabel_stackView_constrain() { NSLayoutConstraint.activate([ mediumbutton_and_scorelabel_stackView.topAnchor.constraint(equalTo: easybutton_and_scorelabel_stackView.bottomAnchor, constant: 20), mediumbutton_and_scorelabel_stackView.leadingAnchor.constraint(equalTo: buttonsView.leadingAnchor, constant: 10), mediumbutton_and_scorelabel_stackView.heightAnchor.constraint(equalToConstant: 150), mediumbutton_and_scorelabel_stackView.trailingAnchor.constraint(equalTo: buttonsView.trailingAnchor, constant: -10) ]) } let mediumButton: UIButton = { let mediumButton = DifficultyLevelsCustomButton(title: "M E D I U M", bgColor: #colorLiteral(red: 0.9529411793, green: 0.6862745285, blue: 0.1333333403, alpha: 1)) mediumButton.translatesAutoresizingMaskIntoConstraints = false mediumButton.setTitleColor(#colorLiteral(red: 0, green: 0, blue: 0, alpha: 1), for: .normal) mediumButton.addTarget(self, action: #selector(mediumButtonPressed), for: .touchUpInside) return mediumButton }() @objc func mediumButtonPressed() { print("Medium Mode Activated") } func mediumButtonConstrain() { NSLayoutConstraint.activate([ mediumButton.topAnchor.constraint(equalTo: mediumbutton_and_scorelabel_stackView.topAnchor), mediumButton.leadingAnchor.constraint(equalTo: mediumbutton_and_scorelabel_stackView.leadingAnchor), mediumButton.bottomAnchor.constraint(equalTo: mediumbutton_and_scorelabel_stackView.bottomAnchor, constant: -40), mediumButton.trailingAnchor.constraint(equalTo: mediumbutton_and_scorelabel_stackView.trailingAnchor) ]) } let mediumButtonScoreLabel: UILabel = { let mediumButtonScoreLabel = DashBoardScoreLabel(title: "Score: ") mediumButtonScoreLabel.translatesAutoresizingMaskIntoConstraints = false return mediumButtonScoreLabel }() func mediumButtonScoreLabelConstrain() { NSLayoutConstraint.activate([ mediumButtonScoreLabel.topAnchor.constraint(equalTo: mediumButton.bottomAnchor), mediumButtonScoreLabel.leadingAnchor.constraint(equalTo: mediumbutton_and_scorelabel_stackView.leadingAnchor), mediumButtonScoreLabel.bottomAnchor.constraint(equalTo: mediumbutton_and_scorelabel_stackView.bottomAnchor), mediumButtonScoreLabel.trailingAnchor.constraint(equalTo: mediumbutton_and_scorelabel_stackView.trailingAnchor) ]) } let hardbutton_and_scorelabel_stackView: UIStackView = { let hardbutton_and_scorelabel_stackView = UIStackView(frame: .zero) hardbutton_and_scorelabel_stackView.distribution = .fillProportionally hardbutton_and_scorelabel_stackView.spacing = 1 hardbutton_and_scorelabel_stackView.axis = .vertical hardbutton_and_scorelabel_stackView.translatesAutoresizingMaskIntoConstraints = false return hardbutton_and_scorelabel_stackView }() func hardbutton_and_scorelabel_stackView_constrain() { NSLayoutConstraint.activate([ hardbutton_and_scorelabel_stackView.topAnchor.constraint(equalTo: mediumbutton_and_scorelabel_stackView.bottomAnchor, constant: 20), hardbutton_and_scorelabel_stackView.leadingAnchor.constraint(equalTo: buttonsView.leadingAnchor, constant: 10), hardbutton_and_scorelabel_stackView.heightAnchor.constraint(equalToConstant: 150 ), hardbutton_and_scorelabel_stackView.trailingAnchor.constraint(equalTo: buttonsView.trailingAnchor, constant: -10) ]) } let hardButton: UIButton = { let hardButton = DifficultyLevelsCustomButton(title: "H A R D", bgColor: #colorLiteral(red: 0.7291150689, green: 0.1028918102, blue: 0.08893487602, alpha: 1)) hardButton.translatesAutoresizingMaskIntoConstraints = false hardButton.setTitleColor(#colorLiteral(red: 1, green: 1, blue: 1, alpha: 1), for: .normal) hardButton.addTarget(self, action: #selector(hardButtonPressed), for: .touchUpInside) return hardButton }() @objc func hardButtonPressed() { print("Hard Mode Activated") } func hardButtonConstrain() { NSLayoutConstraint.activate([ hardButton.topAnchor.constraint(equalTo: hardbutton_and_scorelabel_stackView.topAnchor), hardButton.leadingAnchor.constraint(equalTo: hardbutton_and_scorelabel_stackView.leadingAnchor), hardButton.bottomAnchor.constraint(equalTo: hardbutton_and_scorelabel_stackView.bottomAnchor, constant: -40), hardButton.trailingAnchor.constraint(equalTo: hardbutton_and_scorelabel_stackView.trailingAnchor) ]) } let hardButtonScoreLabel: UILabel = { let hardButtonScoreLabel = DashBoardScoreLabel(title: "Score: ") hardButtonScoreLabel.translatesAutoresizingMaskIntoConstraints = false return hardButtonScoreLabel }() func hardButtonScoreLabelConstrain() { NSLayoutConstraint.activate([ hardButtonScoreLabel.topAnchor.constraint(equalTo: hardButton.bottomAnchor), hardButtonScoreLabel.leadingAnchor.constraint(equalTo: hardbutton_and_scorelabel_stackView.leadingAnchor), hardButtonScoreLabel.bottomAnchor.constraint(equalTo: hardbutton_and_scorelabel_stackView.bottomAnchor), hardButtonScoreLabel.trailingAnchor.constraint(equalTo: hardbutton_and_scorelabel_stackView.trailingAnchor) ]) } }
[ -1 ]
36760c7266a19f77725303a810dfb5f55a11a2e3
b10c3dff3f55b626e0190496af84c19071f4e288
/pzz9Tests/pzz9Tests.swift
cf77afa642599fbaac769ded040e022215520a71
[]
no_license
nyannsuke01/puzzle-Swift
8e45c4822cb654c570d8cf966df995eb7b96f7b1
717f2ab7976985e5482b833de1c3b2a297c481d7
refs/heads/master
2021-04-10T17:53:38.139656
2020-03-21T11:27:12
2020-03-21T11:27:12
248,951,742
0
0
null
null
null
null
UTF-8
Swift
false
false
879
swift
// // pzz9Tests.swift // pzz9Tests // // Created by user on 2020/03/10. // Copyright © 2020 user. All rights reserved. // import XCTest @testable import pzz9 class pzz9Tests: XCTestCase { override func 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. } 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. } } }
[ 98333, 16419, 229413, 204840, 278570, 344107, 253999, 229424, 319542, 229430, 352315, 352326, 254027, 311372, 311374, 196691, 278615, 180311, 180312, 237663, 254048, 319591, 278634, 131178, 319598, 352368, 204916, 131191, 237689, 131198, 278655, 319629, 311438, 278677, 278685, 311458, 278691, 49316, 32941, 278704, 278708, 180408, 131256, 295098, 254170, 385262, 286958, 327929, 180493, 278797, 254226, 319763, 237856, 278816, 98610, 278842, 287041, 139589, 319821, 254286, 344401, 155990, 106847, 246127, 139640, 246137, 106874, 246136, 311691, 246178, 311727, 377264, 278970, 319930, 311738, 336317, 311745, 278978, 254406, 188871, 278989, 278993, 278999, 328152, 369116, 287198, 279008, 279013, 279018, 311786, 319981, 319987, 279029, 254456, 279032, 279039, 287241, 279050, 279062, 254488, 279065, 377386, 197167, 352829, 115270, 377418, 295519, 66150, 344680, 279146, 295536, 287346, 279164, 189057, 311941, 279177, 369289, 344715, 311949, 352917, 230040, 271000, 295576, 221852, 344738, 279206, 295590, 287404, 295599, 205487, 303793, 164533, 287417, 287422, 66242, 279252, 287452, 295652, 246503, 418546, 344827, 221948, 279294, 205568, 295682, 312079, 295697, 336671, 344865, 279336, 295724, 312108, 353069, 328499, 353078, 230199, 353079, 336702, 295746, 353094, 353095, 353109, 230234, 303972, 230248, 246641, 246648, 361337, 279417, 254850, 287622, 426895, 295824, 189348, 353195, 140204, 353197, 230332, 189374, 353215, 353216, 213960, 279498, 50143, 123881, 304110, 320494, 287731, 295927, 304122, 320507, 328700, 312314, 328706, 320516, 230410, 320527, 238610, 418837, 320536, 197657, 336929, 189474, 345132, 238639, 238651, 214086, 361543, 238664, 296019, 353367, 156764, 156765, 230499, 312434, 353397, 337017, 279685, 222343, 296086, 296092, 238765, 279728, 230588, 353479, 353481, 353482, 189652, 189653, 279765, 148696, 296153, 279774, 304351, 304356, 222440, 328940, 279792, 353523, 320770, 279814, 328971, 312587, 320796, 115998, 369956, 279854, 345396, 116026, 222524, 279875, 345415, 312648, 230729, 238927, 296273, 222559, 230756, 230765, 296303, 279920, 312689, 116084, 181625, 378244, 304524, 296335, 9619, 279974, 173491, 279989, 280004, 361927, 296392, 370123, 148940, 280013, 312782, 222675, 329173, 353750, 280041, 361963, 329200, 321009, 280055, 288249, 230913, 329225, 230921, 304656, 329232, 230943, 230959, 288309, 312889, 288318, 280130, 124485, 288326, 288327, 280147, 157281, 345700, 312940, 222832, 247416, 337535, 312965, 288392, 239250, 345752, 255649, 321199, 337591, 321207, 296632, 280251, 280257, 321219, 280267, 9936, 9937, 280278, 181975, 280280, 18138, 321247, 321249, 345833, 280300, 313081, 124669, 288512, 280329, 321295, 321302, 116505, 321310, 255776, 313120, 247590, 296755, 321337, 280392, 345929, 337745, 337747, 18262, 362327, 370522, 280410, 345951, 362337, 345955, 296806, 288619, 296814, 280430, 362352, 313203, 124798, 182144, 305026, 67463, 329622, 124824, 214937, 354212, 313254, 124852, 288697, 214977, 280514, 321480, 214984, 247757, 231375, 280541, 329695, 313319, 337895, 247785, 296941, 124911, 362480, 223218, 313339, 354316, 313357, 182296, 239650, 329765, 354343, 354345, 223274, 321583, 124975, 346162, 124984, 288828, 288833, 288834, 354385, 280661, 329814, 338007, 354393, 280675, 329829, 280677, 313447, 43110, 321637, 288879, 280694, 223350, 288889, 215164, 313469, 215166, 280712, 215178, 346271, 239793, 125109, 182456, 280762, 379071, 280768, 338119, 346314, 321745, 280795, 338150, 346346, 321772, 125169, 338164, 125183, 125188, 313608, 125193, 321800, 125198, 125199, 125203, 338197, 125208, 305440, 125217, 338218, 125235, 280887, 125240, 182597, 182598, 280902, 289110, 215385, 272729, 379225, 354655, 321894, 280939, 313713, 354676, 313727, 362881, 248194, 395659, 395661, 240016, 108944, 141728, 289189, 289194, 108972, 281037, 281040, 289232, 256477, 330218, 281072, 109042, 240131, 289304, 322078, 207393, 182817, 338490, 322120, 281166, 281171, 354911, 436832, 191082, 313966, 281199, 313971, 330379, 330387, 346772, 330388, 117397, 363163, 338613, 289462, 314040, 109241, 158394, 248517, 363211, 289502, 363230, 338662, 330474, 346858, 289518, 199414, 35583, 363263, 191235, 264968, 322313, 322316, 322319, 166676, 207640, 281377, 355130, 355139, 420677, 355146, 355154, 281427, 281433, 322395, 355165, 109409, 355178, 330609, 174963, 109428, 207732, 240518, 109447, 355217, 289690, 289698, 256935, 289703, 240552, 289722, 330689, 363458, 338899, 330708, 248796, 248797, 207838, 314342, 52200, 289774, 240630, 314362, 134150, 330763, 330772, 281626, 175132, 248872, 322612, 314448, 339030, 281697, 314467, 281700, 322663, 281706, 207979, 363641, 363644, 150657, 248961, 330888, 339100, 339102, 306346, 339130, 208058, 322749, 290000, 298212, 290022, 330984, 298228, 216315, 208124, 363771, 388349, 322824, 126237, 109861, 298291, 306494, 216386, 224586, 372043, 331090, 314709, 314710, 134491, 314720, 314726, 134506, 306542, 314739, 249204, 314741, 249205, 290169, 314751, 306559, 224640, 306560, 298374, 388487, 314758, 314760, 142729, 314766, 306579, 224661, 282007, 314783, 290207, 314789, 314791, 282024, 241066, 314798, 380357, 306631, 191981, 282096, 191990, 290301, 282114, 323080, 323087, 323089, 282141, 282146, 306723, 347694, 290358, 282183, 224847, 118353, 290390, 306776, 44635, 323172, 282213, 323178, 224883, 314998, 175741, 224901, 282245, 323207, 282246, 290443, 323217, 282259, 282273, 257699, 323236, 298661, 282280, 61101, 364207, 224946, 224958, 282303, 323264, 306890, 282318, 241361, 241365, 298712, 298720, 282339, 12010, 282348, 282358, 175873, 323331, 323332, 216839, 323346, 249626, 282400, 241441, 339745, 315171, 257830, 282417, 200498, 282427, 315202, 307011, 282434, 282438, 339783, 323406, 413521, 241495, 282474, 282480, 241528, 315264, 241540, 315273, 315274, 110480, 282518, 282519, 118685, 298909, 323507, 282549, 290746, 298980, 282633, 241692, 102437, 315432, 315434, 233517, 176175, 282672, 241716, 241720, 315465, 315476, 307289, 200794, 356447, 307299, 315498, 299121, 233589, 233590, 241808, 323729, 233636, 323762, 299187, 184505, 299198, 258239, 299203, 282831, 356576, 176362, 356602, 184570, 315673, 299293, 233762, 217380, 151847, 282919, 332083, 332085, 332089, 315706, 282939, 241986, 332101, 323916, 348492, 250192, 323920, 282960, 348500, 168281, 332123, 323935, 332127, 242023, 242029, 160110, 242033, 291192, 315773, 291198, 225670, 332167, 242058, 291224, 283038, 242078, 61857, 315810, 61859, 315811, 381347, 340398, 61873, 299441, 61880, 283064, 291265, 127427, 127428, 283075, 291267, 324039, 373197, 176601, 242139, 160225, 242148, 127465, 233978, 348682, 340490, 291358, 283184, 234036, 315960, 348732, 348742, 348749, 242277, 111208, 291454, 348806, 184973, 316049, 316053, 111253, 111258, 299699, 299700, 242386, 299746, 299759, 299776, 242433, 291585, 291592, 291604, 291612, 152365, 242485, 299849, 283467, 201549, 242529, 275303, 177001, 201577, 242541, 209783, 209785, 177019, 291712, 316298, 349067, 308107, 308112, 209817, 324506, 324507, 127902, 324517, 316333, 316343, 349121, 316364, 340955, 340961, 324586, 340974, 316405, 349175, 201720, 357379, 324625, 308243, 316437, 201755, 300068, 357414, 300084, 324666, 324667, 21569, 300111, 341073, 250981, 300135, 300136, 316520, 316526, 357486, 144496, 300150, 300151, 291959, 160891, 341115, 300158, 349316, 349318, 169104, 177296, 308372, 185493, 119962, 300187, 300188, 283802, 300201, 300202, 259268, 283847, 62665, 283852, 283853, 333011, 316627, 357595, 333022, 234733, 292091, 316669, 234755, 242954, 292107, 251153, 177428, 349462, 333090, 300343, 333117, 193859, 300359, 177484, 251213, 120148, 283991, 357719, 316765, 234850, 292195, 333160, 243056, 316787, 111993, 112017, 112018, 234898, 357786, 333220, 316842, 210358, 284089, 292283, 415171, 300487, 300489, 284107, 366037, 210390, 210391, 210392, 210393, 144867, 103909, 316902, 54765, 251378, 333300, 333303, 300536, 300542, 210433, 366083, 292356, 316946, 308756, 398869, 308764, 349726, 333343, 349741, 169518, 235070, 194110, 349763, 292423, 292425, 243274, 128587, 333388, 333393, 300630, 235095, 128599, 333408, 374372, 54893, 333430, 366203, 325245, 218819, 333509, 333517, 333520, 333521, 333523, 325346, 333542, 153319, 284401, 325371, 194303, 194304, 284429, 284431, 243472, 161554, 366360, 284442, 325404, 325410, 341796, 333610, 284459, 317232, 259899, 325439, 325445, 153415, 341836, 325457, 317269, 284507, 300894, 284514, 276327, 292712, 325484, 292720, 325492, 300918, 317304, 194429, 55167, 325503, 333701, 243591, 325515, 243597, 325518, 292771, 300963, 333735, 284587, 292782, 317360, 243637, 284619, 219101, 292836, 317415, 325619, 333817, 292858, 333828, 317467, 145435, 292902, 325674, 243759, 243767, 358456, 325694, 309345, 333940, 284788, 292992, 333955, 235662, 325776, 317587, 284826, 333991, 333992, 284842, 333996, 227513, 301251, 309444, 227524, 194782, 317664, 243962, 309503, 194820, 375051, 325905, 334103, 325912, 309529, 227616, 211235, 211238, 325931, 260418, 325968, 6481, 366929, 366930, 6489, 334171, 391520, 317820, 211326, 227725, 178582, 293274, 39324, 317852, 285084, 285090, 375207, 293310, 342466, 317901, 6606, 334290, 326100, 285150, 342498, 195045, 301571, 342536, 342553, 375333, 293419, 244269, 23092, 301638, 55881, 244310, 244327, 301689, 244347, 227990, 342682, 318130, 342706, 342713, 285373, 154316, 334547, 318173, 285415, 342763, 129773, 154359, 162561, 285444, 326414, 285458, 326429, 293664, 326433, 318250, 318252, 285487, 301871, 285497, 293693, 342847, 252741, 318278, 293711, 301918, 293730, 351077, 342887, 326505, 400239, 310131, 269178, 359298, 359299, 113542, 416646, 228233, 228234, 236428, 56208, 293781, 318364, 310182, 236461, 293806, 252847, 326601, 130016, 64485, 203757, 383982, 277492, 293886, 293893, 146448, 326685, 252958, 252980, 359478, 302139, 359495, 253029, 228458, 318572, 15471, 187506, 285820, 187521, 302213, 228491, 228493, 285838, 162961, 326804, 285851, 302240, 343203, 253099, 367799, 64700, 228540, 228542, 343234, 367810, 244940, 228563, 359647, 228588, 253167, 228609, 245019, 130338, 130343, 130348, 351537, 171317, 318775, 286013, 286018, 294218, 318805, 294243, 163175, 327024, 327025, 327031, 294275, 179587, 368011, 212375, 318875, 212382, 310692, 286129, 228795, 302529, 302531, 163268, 310732, 302540, 64975, 310736, 327121, 228827, 286172, 310757, 187878, 245223, 343542, 343543, 286202, 286205, 228867, 253451, 253452, 359950, 146964, 187938, 286244, 245287, 245292, 286254, 425535, 56902, 228943, 196187, 343647, 286306, 204397, 138863, 294529, 286343, 229001, 310923, 188048, 302739, 229020, 245412, 40613, 40614, 40615, 229029, 319162, 327358, 286399, 319177, 212685, 245457, 302802, 286423, 278234, 294622, 278240, 229088, 212716, 212717, 294638, 360177, 286459, 278272, 319233, 278291, 294678, 294700, 319288, 360252, 319292, 188251, 245599, 237408, 302946, 188292, 327557, 253829, 294807, 294809, 311199, 253856, 319392, 294823, 294843, 188348, 163781, 344013, 212942, 212946, 24532, 212951, 360417, 294886, 253929, 327661, 278512, 311281, 311282 ]
3f563f0e37b19dd99efed4db4b1f1b4bbd3cfd2c
f85ada0f317b97454bc9e0a8a707f38ef901e297
/XTPullupController/XTPullupController/XTPullupController.swift
150bb904ebb090a80e822368833e3ca2673d2657
[]
no_license
XITRIX/XTPullupController
8aab7137a44871d95bdc9006a76b9dd5fe5d9988
8c578ce90a057f2c58c6d90c8180c17a6b6b4fe1
refs/heads/master
2023-04-12T22:19:12.848115
2021-04-19T14:06:07
2021-04-19T14:06:07
359,478,876
1
0
null
null
null
null
UTF-8
Swift
false
false
8,935
swift
// // XTPullupController.swift // XTPullupController // // Created by Даниил Виноградов on 12.04.2021. // import UIKit open class XTPullupController: UIViewController { public enum State { case uninstalled case hidden case collapsed case halfState case expanded } open var topOffset: CGFloat { 64 } open var collapsedHeight: CGFloat { 44 } open var middleState: CGFloat { 0.4 } open var cornerRadius: CGFloat { 16 } open var respectContentViewHeight: Bool { false } open var contentView: UIView? private(set) var currentState: State = .uninstalled private(set) var panGesture = UIPanGestureRecognizer() private var constraints: [NSLayoutConstraint] = [] private var embeddedScrollOffset: CGPoint = .zero private var bottomConstraint: NSLayoutConstraint! private var embaddedScrollView: UIScrollView? private var lastTranslation: CGPoint = .zero open override func viewDidLoad() { super.viewDidLoad() panGesture.addTarget(self, action: #selector(handlePanGesture)) view.addGestureRecognizer(panGesture) if let scroll = view.subviews.first as? UIScrollView { embaddedScrollView = scroll scroll.panGestureRecognizer.addTarget(self, action: #selector(handlePanGesture)) } } open override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) view.layer.addObserver(self, forKeyPath: "position", options: .new, context: nil) } open override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) view.layer.removeObserver(self, forKeyPath: "position") } open override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() view.layer.cornerRadius = cornerRadius view.layer.maskedCorners = [.layerMinXMinYCorner,.layerMaxXMinYCorner] // shadow view.layer.shadowColor = UIColor.black.cgColor view.layer.shadowOpacity = 0.3 view.layer.shadowRadius = 6.0 view.layer.shadowPath = UIBezierPath(roundedRect: view.bounds, cornerRadius: view.layer.cornerRadius).cgPath view.layer.shouldRasterize = true view.layer.rasterizationScale = UIScreen.main.scale setState(currentState, animated: false) } open override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { if keyPath == "position" { positionDidChange() } } open func positionDidChange() { guard let parent = parent else { return } let bottomOffset = parent.view.frame.height - view.frame.minY - parent.view.safeAreaInsets.bottom - collapsedHeight let alpha = min(1, max(0, bottomOffset / 44)) contentView?.alpha = alpha } open func setState(_ state: State, animated: Bool = true) { var target: CGFloat = 0 switch state { case .collapsed: target = clampOffset(CGFloat.greatestFiniteMagnitude) case .halfState: target = view.frame.height * (1 - middleState) case .expanded: target = 0 case .hidden: target = view.frame.height default: break } if state != .hidden { view.isHidden = false } currentState = state if animated { UIView.animate(withDuration: 0.3, delay: 0, options: [.curveEaseOut]) { self.bottomConstraint.constant = target self.parent?.view.layoutIfNeeded() } completion: { _ in self.view.isHidden = state == .hidden } } else { self.view.isHidden = state == .hidden self.bottomConstraint.constant = target self.parent?.view.layoutIfNeeded() } } open func applyTo(_ viewController: UIViewController, in state: State = .halfState, order: Int? = nil) { currentState = state viewController.addChild(self) if let order = order { viewController.view.insertSubview(view, at: order) } else { viewController.view.addSubview(view) } didMove(toParent: viewController) setupConstraints() setState(state, animated: false) } open func remove() { guard parent != nil else { return } constraints.forEach{ $0.isActive = false } constraints.removeAll() willMove(toParent: nil) view.removeFromSuperview() removeFromParent() currentState = .uninstalled } @objc private func handlePanGesture(panGesture: UIPanGestureRecognizer) { var translation = panGesture.translation(in: parent?.view) translation.x = 0 defer { lastTranslation = translation } if panGesture.state == .began { lastTranslation = translation } let delta = translation - lastTranslation if self.panGesture !== panGesture { if let embeddedScroll = embaddedScrollView { defer { embeddedScrollOffset = embeddedScroll.contentOffset } if panGesture.state == .began { lastTranslation = translation embeddedScrollOffset = embeddedScroll.contentOffset } if bottomConstraint.constant > 0 && (delta.y <= 0 || embeddedScrollOffset.y <= 0) { embeddedScrollOffset.y = max (0, embeddedScrollOffset.y) embeddedScroll.setContentOffset(embeddedScrollOffset, animated: false) } else { if embeddedScroll.contentOffset.y > 0 { return } } } } switch panGesture.state { case .began: break case .changed: bottomConstraint.constant = clampOffset(bottomConstraint.constant + delta.y) break case .ended: let velocity = panGesture.velocity(in: parent?.view) startDeceleration(with: velocity) break default: break } } private func startDeceleration(with velocity: CGPoint) { let decelerationRate: CGFloat = 0.991 let threshold = 0.5 / UIScreen.main.scale let parameters = DecelerationTimingParameters(initialValue: CGPoint(x: 0, y: bottomConstraint.constant), initialVelocity: velocity, decelerationRate: decelerationRate, threshold: threshold) let target = self.targetPosition(parameters.destination.y) currentState = target.state UIView.animate(withDuration: 0.3, delay: 0, options: [.curveEaseOut]) { self.bottomConstraint.constant = target.pos self.parent?.view.layoutIfNeeded() } } private func targetPosition(_ pos: CGFloat) -> (pos: CGFloat, state: State) { let available = [(0, State.expanded), ((view.frame.height * (1 - middleState)), State.halfState), (clampOffset(CGFloat.greatestFiniteMagnitude), State.collapsed)] return available.sorted(by: { abs(pos - $0.0) < abs(pos - $1.0) }).first! } private func clampOffset(_ offset: CGFloat) -> CGFloat { let safe = parent?.view.safeAreaInsets.bottom ?? 0 return max(0, min(self.view.frame.height - self.collapsedHeight - safe, offset)) } private func setupConstraints() { guard let parent = parent else { return } bottomConstraint = view.bottomAnchor.constraint(equalTo: parent.view.bottomAnchor) constraints.append(bottomConstraint) constraints.append(view.widthAnchor.constraint(equalTo: parent.view.widthAnchor)) if respectContentViewHeight { constraints.append(view.heightAnchor.constraint(lessThanOrEqualTo: parent.view.heightAnchor, constant: -topOffset)) constraints.append(view.topAnchor.constraint(greaterThanOrEqualTo: parent.view.topAnchor, constant: topOffset)) } else { constraints.append(view.heightAnchor.constraint(equalTo: parent.view.heightAnchor, constant: -topOffset)) } constraints.forEach { $0.isActive = true } } }
[ -1 ]
bc6e7ed1c2346738f97a70892ea7a17796c06d92
9c8ab2e6066590f45ab19767237b939153e91937
/mainScreen/mainScreen.swift
dea01f06e14a547282ae303a9855e1a8fb1f34fb
[]
no_license
jacenyang/BabyCare-Macro
90be437613fd73b89fcc1e4627cead813c329b45
aa1de974223ce6f135b57e88d39248774866783c
refs/heads/master
2023-01-16T02:46:59.353602
2020-11-25T02:43:34
2020-11-25T02:43:34
311,205,680
0
0
null
null
null
null
UTF-8
Swift
false
false
16,769
swift
// // mainScreen.swift // BabyCare-MC3 // // Created by Ivan Winata on 10/08/20. // Copyright © 2020 Ivan Winata. All rights reserved. // import UIKit import CoreData class mainScreen: UIViewController{ let appDelegate = UIApplication.shared.delegate as! AppDelegate var DataEstimasis = [DateEstimasi]() var dateData = [DataModel]() @IBOutlet weak var cSuhu: UILabel! @IBOutlet weak var cDetak: UILabel! @IBOutlet weak var lblKondisi: UILabel! @IBOutlet weak var lblUsiaKoreksi: UILabel! @IBOutlet weak var catatanLabel: UILabel! @IBOutlet weak var lblkondisidenyut: UILabel! @IBOutlet weak var lbldenyut: UILabel! @IBOutlet weak var lblDetak: UILabel! @IBOutlet weak var lblParameter: UILabel! @IBOutlet weak var lblSikon: UILabel! @IBOutlet weak var lblSuhu: UILabel! @IBOutlet weak var demam: UIImageView! @IBOutlet weak var gambar2: UIImageView! @IBOutlet weak var lblcoba2: UILabel! // @IBOutlet weak var lblcoba1: UILabel! var lblcoba1 = String() var dataAPI = [feeds2]() override func viewDidLoad() { super.viewDidLoad() self.TampilLabelUmur() //read data from core data //self.loadData() //print date //print(dateData.estimasiDate) //create data //dateData.estimasiDate = Date() //Save date //self.saveData() self.lblSikon.text = "Suhu Tubuh" self.lblDetak.text = "Denyut Jantung" fetchAPIthinkSpeak{ DispatchQueue.main.async { let myint = Double(self.lblcoba1) let myrouded = ((myint! * 100).rounded() / 100) self.lblSuhu.text = "\(myrouded)" if (myint! >= 37) { self.lblKondisi.text = "Suhu bayi anda sangat tinggi" self.lblSuhu.textColor = UIColor.red //self.cSuhu.textColor = UIColor.red } else if (myint! > 35 && myint! <= 36) { self.lblKondisi.text = "Suhu bayi anda normal" } else { self.lblKondisi.text = "Suhu bayi anda sangat rendah" self.lblSuhu.textColor = UIColor.red //self.cSuhu.textColor = UIColor.red } let mydenyut = Double(self.lblcoba2.text!) let myroude = mydenyut!.rounded() self.lbldenyut.text = "\(myroude)" if (mydenyut! > 160) { self.lblkondisidenyut.text = "Detak jantung bayi anda terlalu cepat" self.lbldenyut.textColor = UIColor.red //self.cDetak.textColor = UIColor.red } else if (mydenyut! >= 120 && mydenyut! < 160) { self.lblkondisidenyut.text = "Detak jantung bayi anda normal" } else { self.lblkondisidenyut.text = "Detak jantung bayi anda terlalu lemah" self.lbldenyut.textColor = UIColor.red //self.cDetak.textColor = UIColor.red } if (myint! > 37 && mydenyut! > 160) { self.catatanLabel.text = "Jantung berdetak cepat dan suhu sangat tinggi, segera periksa ke dokter!" //content.body = self.catatanLabel.text! self.getNotificationTinggi() } else if (myint! > 37 && (mydenyut! >= 120 && mydenyut! <= 160)) { self.catatanLabel.text = "Suhu bayi sangat tinggi, segera periksa ke dokter!" self.getNotificationSuhu() } else if (myint! > 37 && mydenyut! < 120){ self.catatanLabel.text = "Suhu bayi sangat tinggi dan detak jantung melemah, segera periksa ke dokter!" self.getNotificationSuhu() } else if ((myint! >= 35 && myint! <= 37) && mydenyut! > 160) { self.catatanLabel.text = "Detak jantung berdetak sangat cepat, segera periksa ke dokter!" //content.body = self.catatanLabel.text! self.getNotificationDetak() } else if ((myint! >= 35 && myint! <= 37) && (mydenyut! >= 120 && mydenyut! <= 160)) { self.catatanLabel.text = "Suhu dan detak jantung bayi normal. Selalu jaga kesehatan bayi ya!" //content.body = self.catatanLabel.text! } else if ((myint! >= 35 && myint! <= 37) && mydenyut! < 120) { self.catatanLabel.text = "Detak jantung melemah, Segera periksa ke dokter!" //content.body = self.catatanLabel.text! self.getNotificationDetak() } else if (myint! < 35 && mydenyut! > 160) { self.catatanLabel.text = "Suhu bayi rendah dan jantung berdetak cepat, segera periksa ke dokter!" //content.body = self.catatanLabel.text! self.getNotificationSuhu() } else if (myint! < 35 && (mydenyut! >= 120 && mydenyut! <= 160)) { self.catatanLabel.text = "Suhu bayi sangat rendah, segera periksa ke dokter!" //content.body = self.catatanLabel.text! self.getNotificationSuhu() } else if (myint! < 35 && mydenyut! < 160) { self.catatanLabel.text = "Suhu bayi sangat rendah dan jantung melemah, segera periksa ke dokter!" //content.body = self.catatanLabel.text! self.getNotificationSuhuRendahDetakRendah() } } } } func fetchAPIthinkSpeak( onSuccess : @escaping () -> Void){ guard let apiURL = URL(string: "https://api.thingspeak.com/channels/1116535/feeds.json?api_key=3W5C5093JVUEH036") else{return} URLSession.shared.dataTask(with: apiURL) {(data, response, error) in guard let data = data else {return} do { let decoder = JSONDecoder() let thinkSpeakData = try decoder.decode(ThinkSpeakAPI2.self, from: data) //print(thinkSpeakData.feeds) self.dataAPI = thinkSpeakData.feeds ?? [] //print(self.dataAPI) // print(thinkSpeakData.channel?.name) // print("ini data yang pertama", thinkSpeakData.feeds?.first) // print("ini data yang terakhir", thinkSpeakData.feeds?.last) DispatchQueue.main.async { self.lblcoba1 = (thinkSpeakData.feeds.last?.field1)! self.lblcoba2.text = thinkSpeakData.feeds.last?.field2 onSuccess() } } catch let err { print("error", err) } }.resume() } func TampilLabelUmur(){ retrieve() } func catatan(){ } // func saveData(){ // let context = appDelegate.persistentContainer.viewContext // let entity = NSEntityDescription.insertNewObject(forEntityName: "DateEstimasi", into: context) // // entity.setValue(dateData.estimasiDate, forKey: "estimasiDate") // } // // func loadData() { // let context = appDelegate.persistentContainer.viewContext // let request = NSFetchRequest<NSFetchRequestResult>(entityName: "DateEstimasi") // do{ // do{ // let result = try context.fetch(request) // // if result.isEmpty{ // print("KOSONG") // saveData() // }else{ // // let take = result [0] as! NSManagedObject // // guard let date = take.value(forKey: "estimasiDate") else{ // return // } // dateData.estimasiDate = date as? Date // } // } // catch{ // print(error) // } // } //} func retrieve(){ var tanggalCoDa = [DataModel]() // referensi ke AppDelegate let appDelegate = UIApplication.shared.delegate as! AppDelegate // managed context let managedContext = appDelegate.persistentContainer.viewContext // fetch data let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "DateEstimasi") do{ let result = try managedContext.fetch(fetchRequest) as! [NSManagedObject] result.forEach{ tanggalCoDain in tanggalCoDa.append( DataModel(estimasiDate: tanggalCoDain.value(forKey: "estimasiDate") as! Date) ) print("ini result Retrive \(tanggalCoDain.value(forKey: "estimasiDate") as! Date)") let TanggalEstimasiLahir = tanggalCoDain.value(forKey: "estimasiDate") as! Date print("ini data dari Coredata?") let hariini = Date() let calendar = Calendar.current let components = calendar.dateComponents([.year, .month, .day], from: TanggalEstimasiLahir , to: hariini) //let ageYears = components.year let ageMonths = components.month let ageDays = components.day self.lblUsiaKoreksi.text = " Usia koreksi \(ageMonths!) bulan, \(ageDays!) hari" } }catch let err{ print(err) } return } func getNotificationSuhu(){ UNUserNotificationCenter.current().delegate = self //content let content = UNMutableNotificationContent() content.title = "Hai, Ibu" content.body = "Suhu bayi anda \(self.lblSuhu.text!). Segera periksa bayi anda." content.sound = UNNotificationSound.default //triger let myDate = Date().addingTimeInterval(1) let dateComponent = Calendar.current.dateComponents([.year,.month,.day,.hour,.minute,.second], from: myDate) let triger = UNCalendarNotificationTrigger(dateMatching: dateComponent, repeats: false) //req let req = UNNotificationRequest(identifier: "cobaNotif", content: content, trigger: triger) //put it to center notif UNUserNotificationCenter.current().add(req) { (error) in if let error = error{ print("error ",error) } } } func getNotificationDetak(){ UNUserNotificationCenter.current().delegate = self //content let content = UNMutableNotificationContent() content.title = "Hai, Ibu" content.body = "Detak jantung bayi anda \(self.lbldenyut.text!). Segera periksa bayi anda." content.sound = UNNotificationSound.default //triger let myDate = Date().addingTimeInterval(1) let dateComponent = Calendar.current.dateComponents([.year,.month,.day,.hour,.minute,.second], from: myDate) let triger = UNCalendarNotificationTrigger(dateMatching: dateComponent, repeats: false) //req let req = UNNotificationRequest(identifier: "cobaNotif", content: content, trigger: triger) //put it to center notif UNUserNotificationCenter.current().add(req) { (error) in if let error = error{ print("error ",error) } } } func getNotificationTinggi(){ UNUserNotificationCenter.current().delegate = self //content let content = UNMutableNotificationContent() content.title = "Hai, Ibu!" content.body = "Suhu bayi tinggi dan jantung berdetak cepat. Segera periksa bayi anda." content.sound = UNNotificationSound.default //triger let myDate = Date().addingTimeInterval(1) let dateComponent = Calendar.current.dateComponents([.year,.month,.day,.hour,.minute,.second], from: myDate) let triger = UNCalendarNotificationTrigger(dateMatching: dateComponent, repeats: false) //req let req = UNNotificationRequest(identifier: "cobaNotif", content: content, trigger: triger) //put it to center notif UNUserNotificationCenter.current().add(req) { (error) in if let error = error{ print("error ",error) } } } func getNotificationRendah(){ UNUserNotificationCenter.current().delegate = self //content let content = UNMutableNotificationContent() content.title = "Hai, Ibu!" content.body = "Suhu bayi rendah dan jantung berdetak lemah. Segera periksa bayi anda." content.sound = UNNotificationSound.default //triger let myDate = Date().addingTimeInterval(1) let dateComponent = Calendar.current.dateComponents([.year,.month,.day,.hour,.minute,.second], from: myDate) let triger = UNCalendarNotificationTrigger(dateMatching: dateComponent, repeats: false) //req let req = UNNotificationRequest(identifier: "cobaNotif", content: content, trigger: triger) //put it to center notif UNUserNotificationCenter.current().add(req) { (error) in if let error = error{ print("error ",error) } } } func getNotificationSuhuRendahDetakCepat(){ UNUserNotificationCenter.current().delegate = self //content let content = UNMutableNotificationContent() content.title = "Hai, Ibu!" content.body = "Suhu bayi rendah dan jantung berdetak cepat. Segera periksa bayi anda." content.sound = UNNotificationSound.default //triger let myDate = Date().addingTimeInterval(1) let dateComponent = Calendar.current.dateComponents([.year,.month,.day,.hour,.minute,.second], from: myDate) let triger = UNCalendarNotificationTrigger(dateMatching: dateComponent, repeats: false) //req let req = UNNotificationRequest(identifier: "cobaNotif", content: content, trigger: triger) //put it to center notif UNUserNotificationCenter.current().add(req) { (error) in if let error = error{ print("error ",error) } } } func getNotificationSuhuRendahDetakRendah(){ UNUserNotificationCenter.current().delegate = self //content let content = UNMutableNotificationContent() content.title = "Hai, Ibu!" content.body = "Suhu bayi rendah dan jantung melemah. Segera periksa bayi anda." content.sound = UNNotificationSound.default //triger let myDate = Date().addingTimeInterval(1) let dateComponent = Calendar.current.dateComponents([.year,.month,.day,.hour,.minute,.second], from: myDate) let triger = UNCalendarNotificationTrigger(dateMatching: dateComponent, repeats: false) //req let req = UNNotificationRequest(identifier: "cobaNotif", content: content, trigger: triger) //put it to center notif UNUserNotificationCenter.current().add(req) { (error) in if let error = error{ print("error ",error) } } } } extension mainScreen : UNUserNotificationCenterDelegate{ func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { completionHandler([.sound,.alert]) } } extension Double { func rounded(digits: Int) -> Double { let multiplier = pow(10.0, Double(digits)) return (self * multiplier).rounded() / multiplier } }
[ -1 ]
8c8f2e0a8a8e7a3ee32ce22e6216c9cfa9bc7c5e
7c92de8ce2266b6cbdfe64b2fea3b4ce852c5476
/MVP/Model/InfoModel.swift
53eb689a995b217a178232fc78220b58cbc41269
[]
no_license
senthilsns/MVP
3e504ba74f359cb6f942b72e04bbfbacd4da3bd4
42a1b432d5aeac09b6ab2886d478233b1fdbc55d
refs/heads/master
2020-04-02T16:56:41.216144
2018-10-26T08:39:41
2018-10-26T08:39:41
154,636,207
0
0
null
null
null
null
UTF-8
Swift
false
false
211
swift
// // InfoModel.swift // MVP // // Created by SENTHIL on 25/10/18. // Copyright © 2018 Personal. All rights reserved. // import UIKit struct InfoModel { let firstName:String let lastName:String }
[ -1 ]
95095b090c8e62398922f64d0fb0e52133015620
7e12feb9d55b4c93594357dd018a8b85fe131e88
/sample/coroutines/app-ios/Shared/RootContent.swift
755dbc7c7ea31bd2604d1a365d4d3fe5169f7cb4
[ "Apache-2.0" ]
permissive
arkivanov/MVIKotlin
b0d984f4248e6dc55ea8f2a712279c9e746f3897
c72833a9d2e604cf8c9972744f1e600ea44ca4a6
refs/heads/master
2023-08-28T12:14:24.014175
2023-08-03T05:39:28
2023-08-03T05:39:28
437,014,963
619
28
Apache-2.0
2023-05-09T08:21:57
2021-12-10T14:53:46
Kotlin
UTF-8
Swift
false
false
2,011
swift
// // ContentView.swift // Shared // // Created by Arkadii Ivanov on 21/04/2022. // import SwiftUI import Combine import Todo struct RootContent: View { var storeFactory: StoreFactory var database: TodoDatabase var dispatchers: TodoDispatchers @StateObject private var mainInput = PassthroughSubject<MainInput, Never>() @State private var selectedItemId: String? = nil var body: some View { NavigationView { VStack { NavigationLink( destination: LazyView { DetailsContent( storeFactory: storeFactory, database: database, dispatchers: dispatchers, itemId: selectedItemId!, onItemChanged: { id, data in mainInput.send(.ItemChanged(id: id, data: data)) }, onItemDeleted: { id in mainInput.send(.ItemDeleted(id: id)) selectedItemId = nil } ) }, isActive: Binding( get: { selectedItemId != nil }, set: { if (!$0) { selectedItemId = nil } } ) ) { EmptyView() } MainContent( storeFactory: storeFactory, database: database, dispatchers: dispatchers, input: mainInput.eraseToAnyPublisher(), onItemSelected: { self.selectedItemId = $0 } ) } .navigationTitle("MVIKotlin") } .navigationViewStyle(StackNavigationViewStyle()) } } extension PassthroughSubject : ObservableObject { }
[ -1 ]
b94bfb8db1df689f5e1232669aa823be51ced320
8c5ba234508768dcf44b7f53fe05dfa9cf79d02e
/swift_code_is_so_fast/4-main.swift
30dbdd2adf9fcd49bedcb2ecbbb3d815f1e5a6ab
[]
no_license
tasneemfarag/holbertonschool-higher_level_programming
67fd6114a22459909cae79d83111214a34706d8a
0ae94878568166bf39f61c010af41889214c0a44
refs/heads/master
2021-01-21T04:48:20.060289
2018-05-04T02:40:46
2018-05-04T02:40:46
51,222,865
0
0
null
null
null
null
UTF-8
Swift
false
false
164
swift
var numbers = [4, 7, 1, 9, 6, 5, 6, 9] let max = numbers.reduce(numbers[0]) { if $0 > $1 { return $0 } else { return $1 } } print(max)
[ -1 ]
5126d3a280f954ed59e67b45a8c82b1529ac03ba
f7e22a073ed3f953e639b7fe1594fa2450c0d8ac
/Africa/Model/CoverImage.swift
304af3029b4a5bbe9fc8cfacfcb8ebda0fe70750
[]
no_license
pszerszen/Africa
460d87e3bde7342760cf5388c22c068d54c23117
162ba438de20e5953955027601a22103820720a2
refs/heads/master
2023-08-29T23:58:27.735796
2021-11-09T12:54:51
2021-11-09T12:54:51
424,889,236
0
0
null
null
null
null
UTF-8
Swift
false
false
187
swift
// // CoverImage.swift // Africa // // Created by Piotr Szerszeń on 05/11/2021. // import SwiftUI struct CoverImage: Codable, Identifiable { let id: Int let name: String }
[ -1 ]
040fa3d637130bbfb8a2da57433efc3820ecd047
2c7143366b6e4ab4ec86bcbf974a34232761cf66
/mvc-testTests/mvc_testTests.swift
09a82c2b580b9fac872efd3f61a947816f339260
[]
no_license
nguyenhungnq/MVC-TEST
f66c31313387455974d0a1fb11858c6cf5dc60b2
1c1efa4327632e80a31f2b3b0bf25da5ccaf1cf6
refs/heads/master
2021-01-12T01:27:31.020225
2017-01-09T04:20:59
2017-01-09T04:20:59
78,388,516
0
0
null
null
null
null
UTF-8
Swift
false
false
970
swift
// // mvc_testTests.swift // mvc-testTests // // Created by NguyenHung on 1/9/17. // Copyright © 2017 NguyenHung. All rights reserved. // import XCTest @testable import mvc_test class mvc_testTests: 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. } } }
[ 360462, 98333, 16419, 229413, 204840, 278570, 344107, 155694, 253999, 229430, 319542, 180280, 163896, 376894, 286788, 352326, 311372, 311374, 196691, 278615, 385116, 237663, 254048, 319591, 221290, 278634, 278638, 319598, 352368, 204916, 131191, 237689, 131198, 278655, 278677, 196760, 426138, 278685, 311458, 278691, 49316, 32941, 278704, 377009, 278708, 131256, 295098, 139479, 254170, 229597, 311519, 205035, 286958, 327929, 344313, 147717, 368905, 180493, 278797, 254226, 368916, 262421, 377114, 237856, 237857, 278816, 311597, 98610, 180535, 336183, 278842, 287041, 287043, 139589, 319821, 254286, 344401, 377169, 368981, 155990, 278869, 368984, 106847, 98657, 270701, 246127, 270706, 139640, 246136, 246137, 311685, 106888, 385417, 385422, 213403, 385454, 377264, 278970, 311738, 33211, 319930, 336317, 336320, 311745, 278978, 254406, 188871, 278989, 278993, 278999, 328152, 369116, 287198, 279008, 279013, 279018, 319981, 279029, 254456, 279032, 377338, 377343, 279039, 254465, 287241, 279050, 139792, 303636, 279062, 393751, 279065, 377376, 180771, 377386, 197167, 385588, 352829, 115270, 377418, 385615, 426576, 369235, 139872, 66150, 344680, 279146, 295536, 287346, 139892, 287352, 344696, 279164, 189057, 311941, 336518, 311945, 369289, 344715, 279177, 311949, 287374, 377489, 311954, 352917, 230040, 271000, 377497, 303771, 221852, 377500, 205471, 344738, 139939, 279206, 295590, 287404, 205487, 295599, 303793, 336564, 164533, 287417, 303803, 287422, 66242, 377539, 287433, 164560, 385747, 279252, 361176, 418520, 287452, 295652, 369385, 230125, 312047, 312052, 230134, 172792, 344827, 221948, 205568, 295682, 197386, 434957, 295697, 426774, 197399, 426775, 336671, 344865, 197411, 262951, 279336, 312108, 295724, 197422, 353070, 164656, 295729, 262962, 353069, 328499, 353078, 230199, 197431, 353079, 336702, 295744, 295746, 353094, 353095, 353109, 377686, 230234, 189275, 435039, 279392, 295776, 303972, 385893, 279397, 230248, 246641, 246643, 295798, 246648, 361337, 279417, 254850, 369538, 287622, 295824, 189348, 353195, 140204, 377772, 353197, 304051, 230332, 377790, 353215, 353216, 213957, 213960, 345033, 279498, 386006, 304087, 418776, 50143, 123881, 320493, 304110, 320494, 271350, 295927, 312314, 304122, 328700, 320507, 328706, 410627, 320516, 295942, 386056, 230410, 353290, 377869, 320527, 238610, 418837, 140310, 197657, 336929, 369701, 345132, 238639, 312373, 238651, 377926, 238664, 296019, 353367, 156764, 156765, 304222, 230499, 173166, 312434, 377972, 353397, 377983, 279685, 402565, 222343, 386189, 296086, 238743, 296092, 238765, 279728, 238769, 402613, 230588, 279747, 353479, 353481, 402634, 353482, 189652, 189653, 419029, 279765, 148696, 296153, 279774, 304351, 304356, 222440, 328940, 279792, 353523, 386294, 386301, 320770, 386306, 279814, 328971, 312587, 353551, 320796, 222494, 353584, 345396, 386359, 116026, 378172, 222524, 279875, 304456, 230729, 312648, 337225, 222541, 296270, 238927, 353616, 296273, 222559, 378209, 230756, 386412, 230765, 296303, 279920, 312689, 296307, 116084, 337281, 148867, 378244, 296329, 296335, 9619, 370071, 279974, 173491, 304564, 353719, 361927, 296392, 370123, 148940, 280013, 312782, 222675, 353750, 280032, 271843, 280041, 361963, 296433, 321009, 280055, 288249, 296448, 230913, 329225, 230921, 296461, 304656, 329232, 370197, 230943, 402985, 394794, 230959, 288309, 312889, 288318, 280130, 124485, 288326, 288327, 239198, 157281, 99938, 312940, 222832, 247416, 337534, 337535, 263809, 288392, 239250, 419478, 345752, 255649, 337591, 296632, 321207, 280251, 321219, 280267, 403148, 9936, 9937, 370388, 272085, 345814, 280278, 280280, 18138, 67292, 345821, 321247, 321249, 345833, 345834, 288491, 280300, 239341, 67315, 173814, 313081, 124669, 288512, 288516, 280327, 280329, 321295, 321302, 345879, 116505, 321310, 255776, 247590, 362283, 378668, 296755, 280372, 321337, 280380, 345919, 436031, 403267, 280392, 345929, 304977, 18262, 362327, 280410, 370522, 345951, 362337, 345955, 296806, 288619, 288620, 280430, 214895, 313199, 362352, 296814, 313203, 124798, 182144, 305026, 67463, 329622, 337815, 124824, 214937, 436131, 354212, 436137, 362417, 124852, 288697, 362431, 214977, 280514, 214984, 362443, 247757, 280541, 329695, 436191, 313319, 337895, 247785, 296941, 436205, 362480, 313339, 43014, 354316, 313357, 182296, 354343, 354345, 223274, 124975, 346162, 124984, 288828, 436285, 288833, 288834, 436292, 403525, 436301, 338001, 354385, 338003, 223316, 280661, 329814, 338007, 354393, 280675, 280677, 43110, 321637, 313447, 436329, 288879, 223350, 280694, 215164, 313469, 215166, 280712, 215178, 346271, 436383, 362659, 239793, 125109, 182456, 223419, 379071, 280768, 149703, 338119, 346314, 321745, 387296, 280802, 379106, 338150, 346346, 321772, 125169, 338164, 436470, 125183, 149760, 411906, 125188, 313608, 125193, 125198, 272658, 125203, 125208, 305440, 125217, 338218, 321840, 379186, 125235, 280887, 125240, 321860, 182598, 289110, 215385, 272729, 379225, 321894, 280939, 354676, 199029, 436608, 362881, 240002, 436611, 248194, 395659, 395661, 240016, 108944, 190871, 149916, 420253, 141728, 289189, 289194, 108972, 272813, 338356, 436661, 281037, 289232, 281040, 256477, 281072, 174593, 420369, 289304, 207393, 182817, 289332, 174648, 338489, 338490, 322120, 281166, 297560, 354911, 436832, 436834, 191082, 313966, 420463, 281199, 346737, 313971, 346740, 420471, 330379, 330387, 117396, 117397, 346772, 330388, 264856, 289434, 346779, 338613, 166582, 289462, 314040, 158394, 363211, 289502, 363230, 264928, 338662, 330474, 346858, 289518, 125684, 199414, 35583, 363263, 322313, 117517, 322319, 166676, 207640, 281377, 289576, 191283, 273207, 289598, 420677, 281427, 281433, 330609, 207732, 158593, 240518, 224145, 355217, 256922, 289690, 289698, 420773, 289703, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 338899, 248796, 248797, 207838, 347103, 314342, 289774, 183279, 347123, 240630, 314362, 257024, 330754, 330763, 281626, 248872, 322612, 314448, 339030, 314467, 281700, 257125, 322663, 207979, 273515, 404593, 363641, 363644, 150657, 248961, 330888, 363669, 339100, 380061, 429214, 199839, 339102, 330913, 306338, 265379, 249002, 306346, 3246, 421048, 339130, 265412, 290000, 298208, 298212, 298213, 290022, 330984, 298221, 298228, 216315, 208124, 363771, 388349, 437505, 322824, 257305, 126237, 339234, 372009, 412971, 298291, 306494, 216386, 224586, 372043, 331090, 314709, 314710, 372054, 159066, 314720, 281957, 306542, 380271, 314739, 208244, 249204, 290173, 306559, 314751, 298374, 314758, 314760, 142729, 388487, 314766, 306579, 224661, 282007, 290207, 314783, 314789, 282022, 314791, 396711, 396712, 282024, 241066, 380337, 380338, 150965, 380357, 339398, 306631, 306639, 413137, 429542, 191981, 290300, 290301, 282114, 372227, 306692, 323080, 323087, 175639, 388632, 282136, 396827, 282141, 134686, 282146, 306723, 347694, 290358, 265798, 282183, 265804, 396882, 290390, 306776, 44635, 396895, 323172, 282213, 323178, 224883, 314998, 323196, 175741, 339584, 224901, 282245, 282246, 290443, 323217, 282259, 298654, 282271, 282276, 298661, 323236, 290471, 282280, 224946, 306874, 110268, 224958, 282303, 274115, 282312, 306890, 282318, 241361, 282327, 298712, 298720, 12010, 282348, 282355, 323316, 282358, 175873, 339715, 323331, 323332, 216839, 339720, 282378, 372496, 323346, 282391, 249626, 282400, 339745, 241441, 257830, 421672, 282409, 282417, 200498, 282427, 315202, 307011, 282438, 216918, 241495, 282474, 241528, 339841, 282504, 315273, 315274, 110480, 372626, 380821, 282518, 282519, 298909, 118685, 298920, 323507, 290745, 290746, 274371, 151497, 372701, 298980, 380908, 282633, 241692, 102437, 315432, 102445, 233517, 176175, 282672, 241716, 225351, 315465, 315476, 307289, 200794, 315487, 356447, 438377, 315498, 299121, 233589, 266357, 422019, 241808, 381073, 323729, 233636, 184484, 299174, 405687, 184505, 299198, 258239, 389313, 299203, 299209, 372941, 282831, 266449, 356576, 176362, 307435, 438511, 381172, 184570, 184575, 184584, 381208, 282909, 299293, 151839, 282913, 233762, 217380, 151847, 282919, 332083, 332085, 332089, 315706, 282939, 241986, 438596, 332101, 323913, 348492, 323916, 323920, 250192, 348500, 168281, 332123, 332127, 323935, 242023, 242029, 160110, 242033, 291192, 291198, 340357, 225670, 242058, 373134, 291224, 242078, 283038, 61857, 315810, 381347, 61859, 315811, 340398, 299441, 61873, 61880, 283064, 299456, 291265, 291267, 127427, 127428, 283075, 324039, 373197, 176601, 242139, 160225, 242148, 291311, 233978, 291333, 340490, 283153, 258581, 291358, 283182, 283184, 234036, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 381517, 332378, 201308, 111208, 184940, 373358, 389745, 209530, 291454, 373375, 152195, 348806, 152203, 184973, 316049, 111253, 316053, 111258, 111259, 176808, 299699, 299700, 422596, 422599, 291530, 225995, 242386, 422617, 422626, 299746, 234217, 299759, 299776, 291585, 242433, 430849, 291592, 62220, 422673, 430865, 291604, 422680, 283430, 152365, 422703, 422709, 152374, 242485, 160571, 430910, 160575, 160580, 299849, 283467, 381773, 201551, 242529, 349026, 357218, 275303, 308076, 242541, 209785, 177019, 185211, 308092, 398206, 291712, 381829, 316298, 308107, 308112, 349072, 209817, 324506, 324507, 390045, 185250, 324517, 283558, 185254, 316333, 316343, 373687, 349121, 373706, 316364, 340955, 340961, 324586, 340974, 316405, 349175, 201720, 127992, 357379, 324625, 308243, 316437, 201755, 300068, 357414, 300084, 324666, 308287, 21569, 218186, 300111, 341073, 439384, 250981, 300135, 300136, 316520, 357486, 316526, 144496, 300150, 291959, 300151, 160891, 341115, 300158, 349316, 349318, 373903, 169104, 177296, 308372, 185493, 119962, 300187, 300188, 300201, 300202, 373945, 259268, 283847, 62665, 283852, 283853, 259280, 316627, 333011, 357595, 234733, 292085, 234742, 128251, 316669, 242954, 439562, 292107, 414990, 251153, 177428, 349462, 382258, 300343, 382269, 193859, 177484, 406861, 259406, 234831, 251213, 120148, 357719, 283991, 374109, 234850, 292195, 333160, 243056, 316787, 111993, 357762, 112017, 234898, 259475, 275859, 112018, 357786, 251298, 333220, 316842, 374191, 210358, 284089, 292283, 415171, 292292, 300487, 300489, 284107, 366037, 210390, 210391, 210393, 144867, 54765, 251378, 308723, 300535, 300536, 300542, 210433, 366083, 259599, 316946, 308756, 398869, 374296, 374299, 308764, 349726, 431649, 349741, 169518, 431663, 194110, 235070, 349763, 292423, 218696, 292425, 243274, 128587, 333388, 333393, 300630, 128599, 235095, 333408, 300644, 374372, 317032, 415338, 243307, 54893, 325231, 366203, 325245, 235135, 194180, 415375, 333470, 153251, 300714, 210603, 415420, 333503, 218819, 259781, 333517, 333520, 333521, 333523, 325346, 153319, 325352, 284401, 325371, 194303, 284429, 243472, 161554, 366360, 284442, 325404, 325410, 341796, 399147, 431916, 317232, 300848, 259899, 325439, 325445, 153415, 341836, 415567, 325457, 317269, 341847, 350044, 300894, 128862, 284512, 284514, 292712, 325484, 423789, 292720, 325492, 276341, 300918, 341879, 317304, 333688, 194429, 112509, 55167, 325503, 333701, 243591, 243597, 325518, 333722, 350109, 300963, 292771, 415655, 333735, 284587, 292782, 243637, 284619, 301008, 153554, 219101, 292836, 292837, 317415, 325619, 432116, 333817, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 292902, 325674, 227370, 129076, 243767, 358456, 309345, 227428, 194666, 260207, 432240, 284788, 333940, 292988, 292992, 333955, 194691, 227460, 415881, 104587, 235662, 325776, 317587, 284826, 333991, 333992, 284842, 153776, 227513, 301251, 309444, 194782, 301279, 317664, 227578, 243962, 375039, 309503, 375051, 325905, 325912, 309529, 227616, 211235, 432421, 211238, 358703, 358709, 260418, 227654, 6481, 366930, 366929, 6489, 391520, 383332, 416104, 383336, 211326, 317831, 227725, 252308, 178582, 293274, 317852, 121245, 285090, 375207, 342450, 293303, 293306, 293310, 416197, 129483, 342476, 317901, 326100, 285150, 227809, 342498, 358882, 334309, 195045, 391655, 432618, 375276, 309744, 293367, 301571, 342536, 342553, 416286, 375333, 293419, 244269, 375343, 23092, 375351, 244281, 301638, 309830, 293448, 55881, 416341, 244310, 416351, 268899, 39530, 244347, 326287, 375440, 334481, 227990, 318106, 318107, 342682, 318130, 383667, 293556, 342713, 285371, 285372, 285373, 285374, 39614, 154316, 318173, 375526, 285415, 342762, 342763, 293612, 154359, 228088, 432893, 162561, 285444, 383754, 310036, 326429, 293664, 326433, 400166, 293672, 318250, 318252, 285487, 375609, 285497, 293693, 252741, 293711, 244568, 244570, 293730, 351077, 342887, 269178, 400252, 359298, 359299, 260996, 113542, 416646, 228233, 392074, 228234, 56208, 318364, 310176, 310178, 310182, 293800, 236461, 326581, 326587, 326601, 359381, 433115, 343005, 130016, 64485, 326635, 203757, 187374, 383983, 318461, 293886, 277509, 293893, 433165, 384016, 146448, 277524, 293910, 433174, 252958, 252980, 203830, 359478, 302139, 359495, 277597, 113760, 392290, 253029, 228458, 351344, 187506, 285814, 285820, 392318, 187521, 384131, 285828, 302213, 285830, 302216, 228491, 228493, 285838, 162961, 326804, 187544, 351390, 302240, 343203, 253099, 253100, 318639, 367799, 294074, 113850, 64700, 228542, 302274, 367810, 343234, 244940, 228563, 195808, 310497, 228588, 253167, 302325, 228600, 261377, 228609, 245019, 253216, 130338, 130343, 261425, 351537, 286013, 286018, 113987, 294218, 146762, 294219, 318805, 425304, 294243, 163175, 327024, 327025, 327031, 318848, 179587, 294275, 253317, 384393, 368011, 318864, 318868, 318875, 310692, 245161, 310701, 286129, 286132, 228795, 425405, 302529, 302531, 163268, 425418, 310732, 64975, 327121, 228827, 286172, 310757, 187878, 343542, 343543, 286202, 359930, 286205, 302590, 228867, 253451, 253452, 359950, 146964, 253463, 286244, 245287, 245292, 286254, 196164, 56902, 179801, 196187, 343647, 310889, 204397, 138863, 188016, 294529, 229001, 310923, 188048, 425626, 229020, 302754, 245412, 229029, 40614, 40613, 40615, 286391, 384695, 319162, 327358, 286399, 212685, 384720, 212688, 302802, 245457, 286423, 278233, 278234, 294622, 278240, 212716, 212717, 360177, 229113, 286459, 278272, 319233, 311042, 360195, 278291, 294678, 286494, 294700, 409394, 319292, 360252, 360264, 188251, 376669, 245599, 237408, 425825, 302946, 425833, 417654, 188292, 253829, 294807, 294809, 376732, 294814, 311199, 319392, 294823, 327596, 294843, 188348, 237504, 294850, 384964, 163781, 344013, 212942, 212946, 24532, 294886, 253929, 327661, 311281, 311282 ]
f892e2c2cd50a243e31fdff8bb4466de9da92e09
6fe242aa6e5a783af177a62082530ec7ee919873
/Wilsonj-budgetcuts2/SceneDelegate.swift
2a23d0fc7f1c8d61160e86dd1a31c0fad467975b
[]
no_license
jacobwilson2/BudgetCuts
164126d0ad7458901a017b36c25f6973c3d07392
ba590aad2e07d9cb557cd03f279a23218f4dbc8b
refs/heads/master
2022-04-20T15:06:15.397282
2020-04-21T18:47:48
2020-04-21T18:47:48
257,683,414
0
0
null
null
null
null
UTF-8
Swift
false
false
2,359
swift
// // SceneDelegate.swift // Wilsonj-budgetcuts2 // // Created by Jacob Wilson on 3/11/20. // Copyright © 2020 Jacob Wilson. All rights reserved. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 344103, 393260, 393269, 213049, 376890, 385082, 393277, 376906, 327757, 254032, 368728, 254045, 180322, 376932, 286845, 286851, 417925, 262284, 360598, 377003, 377013, 327872, 180418, 377030, 377037, 377047, 418008, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 385281, 262405, 180491, 336140, 262417, 368913, 262423, 377118, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 270687, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 360917, 369119, 328180, 328183, 328190, 254463, 328193, 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, 385714, 434868, 164535, 328379, 164539, 328387, 352969, 385743, 385749, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 336715, 328523, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 222129, 345036, 386004, 345046, 386012, 386019, 328690, 435188, 328703, 328710, 418822, 328715, 377867, 386070, 336922, 345119, 377888, 345134, 345139, 361537, 377931, 189525, 402523, 361568, 148580, 345200, 361591, 386168, 410746, 361594, 214150, 345224, 386187, 345247, 361645, 345268, 402615, 361657, 402636, 328925, 165086, 165092, 222438, 386286, 328942, 386292, 206084, 328967, 345377, 353572, 345380, 345383, 337207, 345400, 378170, 369979, 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, 370208, 419360, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 214594, 419401, 419404, 353868, 419408, 214611, 419412, 403040, 345702, 370298, 353920, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 403139, 337607, 419528, 419531, 272083, 394967, 419545, 345819, 419548, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 378664, 354107, 345916, 354112, 370504, 329545, 345932, 370510, 337751, 247639, 370520, 313181, 182110, 354143, 354157, 345965, 345968, 345971, 345975, 403321, 1914, 354173, 247692, 395148, 337809, 247701, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 346064, 247760, 346069, 329699, 354275, 190440, 354314, 346140, 436290, 378956, 395340, 436307, 338005, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 387250, 379067, 387261, 256193, 395467, 256214, 411862, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 436474, 379135, 411905, 411917, 379154, 395539, 387350, 387353, 338201, 338212, 395567, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 321911, 420237, 379279, 354728, 338353, 338382, 272849, 248279, 256474, 182755, 338404, 248309, 248332, 330254, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 338544, 191093, 346743, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 264919, 264942, 363252, 338680, 264965, 338701, 256787, 363294, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 330581, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 412600, 207809, 379849, 396246, 330711, 248794, 248799, 437219, 257009, 265208, 199681, 338951, 330761, 330769, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 248905, 330827, 248915, 183384, 339037, 412765, 257121, 265321, 248952, 420985, 330890, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 330959, 330966, 265433, 265438, 388320, 363757, 388348, 339199, 396552, 175376, 175397, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 437576, 437584, 437588, 396634, 175451, 437596, 429408, 175458, 175461, 175464, 265581, 331124, 175478, 249215, 175487, 249219, 175491, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 380353, 380364, 339406, 372177, 339414, 413143, 249303, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 208399, 175637, 405017, 134689, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 224885, 224888, 224891, 224895, 421509, 126597, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 257869, 257872, 225105, 397140, 225109, 225113, 257884, 257887, 225120, 257891, 225128, 257897, 225138, 257909, 225142, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 372698, 372704, 372707, 356336, 380919, 372739, 405534, 266295, 266298, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 250012, 225439, 135328, 225442, 192674, 438434, 225445, 225448, 438441, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 225511, 217319, 225515, 225519, 381177, 397572, 356638, 356641, 356644, 356647, 266537, 356650, 389417, 356656, 332081, 340276, 356662, 397623, 332091, 225599, 348489, 332107, 151884, 430422, 348503, 332118, 340328, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 332162, 389507, 348548, 356741, 332175, 373146, 373149, 70048, 356783, 266688, 324032, 201158, 127473, 217590, 340473, 324095, 324100, 324103, 324112, 340501, 324118, 340512, 332325, 324134, 381483, 356908, 324141, 324143, 356917, 324150, 324156, 168509, 348734, 324161, 324165, 356935, 381513, 348745, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 348777, 381546, 340628, 184983, 373399, 258723, 332460, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 340724, 332534, 155647, 348926, 389927, 348979, 398141, 357202, 389971, 357208, 389979, 430940, 357212, 357215, 349041, 340850, 381815, 430967, 324473, 398202, 119675, 324476, 430973, 340859, 340863, 324479, 324482, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 398246, 373672, 324525, 111539, 324534, 5047, 324539, 324542, 349129, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 349173, 381947, 201724, 431100, 349181, 431107, 209944, 209948, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 209996, 431180, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 160896, 349313, 210053, 210056, 349320, 373905, 259217, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 210132, 333016, 210139, 210144, 218355, 218361, 275709, 128254, 275713, 242947, 275717, 275723, 349460, 349486, 349492, 415034, 210261, 365912, 259423, 374113, 251236, 374118, 390518, 357756, 374161, 112021, 349591, 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, 423529, 423533, 210547, 415354, 333440, 267910, 267929, 259789, 366301, 333535, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 210707, 399129, 333595, 210720, 358192, 366384, 366388, 210740, 358201, 325441, 366403, 325447, 341831, 341839, 341844, 415574, 358235, 350046, 399200, 399208, 358256, 268144, 358260, 399222, 325494, 333690, 325505, 399244, 333709, 333725, 333737, 382891, 382898, 358348, 333777, 219094, 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, 252021, 342134, 374904, 268435, 333998, 334012, 260299, 211161, 358645, 268560, 432406, 325920, 358701, 391469, 358705, 358714, 358717, 383307, 358738, 383331, 383334, 391531, 383342, 334204, 194942, 391564, 366991, 334224, 342431, 375209, 375220, 334263, 326087, 358857, 195041, 334312, 104940, 375279, 350724, 186898, 342546, 350740, 342551, 342555, 416294, 350762, 252463, 358962, 334397, 358973, 252483, 219719, 399957, 334425, 326240, 375401, 334466, 334469, 162446, 342680, 342685, 260767, 342711, 244410, 260798, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 203508, 375541, 342777, 391938, 391949, 375569, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 375613, 244542, 375616, 342857, 416599, 342875, 433001, 400238, 211826, 211832, 392061, 351102, 252801, 260993, 400260, 211846, 342931, 400279, 252823, 392092, 400286, 359335, 211885, 400307, 351169, 359362, 351172, 170950, 359367, 326599, 359383, 359389, 383968, 343018, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 261166, 359471, 384099, 384102, 384108, 367724, 187503, 343155, 384115, 212095, 384136, 384140, 384144, 351382, 384152, 384158, 384161, 351399, 384169, 367795, 384182, 384189, 351424, 384192, 343232, 367817, 244938, 384202, 253132, 384209, 146644, 351450, 384225, 359650, 343272, 351467, 384247, 351480, 384250, 351483, 351492, 384270, 261391, 359695, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 245042, 326970, 384324, 212296, 212304, 367966, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 245152, 245155, 155045, 245158, 114093, 327090, 343478, 359867, 384444, 327108, 327112, 384457, 359887, 359891, 368093, 155103, 343535, 343540, 368120, 409092, 359948, 359951, 245295, 359984, 400977, 400982, 179803, 155255, 155274, 368289, 245410, 425652, 425663, 155328, 245463, 155352, 155356, 155364, 245477, 155372, 245487, 212723, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 376672, 155488, 155492, 327532, 261997, 376686, 262000, 262003, 327542, 147319, 262006, 262009, 425846, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 393170, 155604, 155620, 253924, 155622, 327655, 253927, 360432, 393204, 360439, 253944, 393209, 393215 ]
2ccd906dfcbfd2f525f18330e3da64b46c8e73bd
ac133f22a38c9ad1d23a64f58eddc6dcf2d61e92
/filterer/Filterer/Grayscale.swift
e85bc5ad7747a1becd2b7166417523366e065703
[]
no_license
Smileeys/Swift
9187b652f1144158b43b2e5e1edf632f8798b2e6
7ca0091888068d9e7badc90fa2875aa07f7dc9b6
refs/heads/main
2022-12-08T19:53:44.422617
2020-09-09T02:20:43
2020-09-09T02:20:43
null
0
0
null
null
null
null
UTF-8
Swift
false
false
686
swift
import Foundation import UIKit public class Grayscale : Filter { public override init(){ } public override func apply() { for y in 0..<self.rgbaImage.height { for x in 0..<self.rgbaImage.width { let index = y * self.rgbaImage.width + x var pixel = self.rgbaImage.pixels[index] let avg = UInt8((Int(pixel.red) + Int(pixel.green) + Int(pixel.blue))/3) pixel.red = avg pixel.green = avg pixel.blue = avg self.rgbaImage.pixels[index] = pixel } } } }
[ -1 ]
796b4faafa26c4c6be11af1d9c4ad36a09f1d7a4
a0851503bf0a9c0eb501d9a9ae446403e7d4c4b4
/plistUITests/plistUITests.swift
825ff1abb87103a453f0e0e3f92b901f2f735b64
[]
no_license
Mandeep1421/PList
0b0c72a677e8147b3dfcb04a5bfbbc7ae58e7f08
09d78ced5a7e7f2b1e9e7c97675383640d90a7dc
refs/heads/master
2020-04-28T13:33:49.111120
2019-03-12T23:51:39
2019-03-12T23:51:39
175,309,627
0
0
null
null
null
null
UTF-8
Swift
false
false
1,156
swift
// // plistUITests.swift // plistUITests // // Created by MacStudent on 2019-03-12. // Copyright © 2019 MacStudent. All rights reserved. // import XCTest class plistUITests: XCTestCase { override func 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. } 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, 344106, 278571, 229425, 319543, 180279, 229431, 352314, 376892, 32829, 237638, 311373, 196687, 278607, 311377, 368732, 319599, 278642, 131190, 131199, 278669, 278676, 311447, 327834, 278684, 278690, 311459, 278698, 278703, 278707, 180409, 278713, 295099, 139459, 131270, 229591, 385240, 311520, 319719, 295147, 286957, 262403, 180494, 319764, 278805, 311582, 278817, 311596, 98611, 368949, 278843, 287040, 319812, 319816, 254285, 344402, 229716, 278895, 287089, 139641, 311679, 311692, 106893, 156069, 254373, 311723, 377265, 311739, 319931, 278974, 336319, 311744, 278979, 278988, 278992, 279000, 279009, 369121, 188899, 279014, 319976, 279017, 311787, 360945, 319986, 279030, 311800, 279033, 279042, 287237, 279053, 303635, 279061, 254487, 279066, 188954, 279092, 352831, 377419, 303693, 369236, 115287, 189016, 295518, 287327, 279143, 279150, 287345, 344697, 189054, 303743, 287359, 311944, 279176, 311948, 311950, 311953, 180886, 295575, 352921, 303772, 205469, 221853, 279207, 295591, 295598, 279215, 164532, 287412, 303802, 287418, 66243, 287434, 164561, 303826, 279249, 279253, 230105, 361178, 295653, 369383, 230120, 361194, 312046, 279278, 230133, 279293, 205566, 295688, 312076, 295698, 221980, 279337, 164655, 303921, 336693, 230198, 222017, 295745, 279379, 295769, 230238, 435038, 279393, 303973, 279398, 295797, 295799, 279418, 279434, 320394, 189327, 189349, 279465, 140203, 304050, 189373, 213956, 345030, 213961, 279499, 304086, 123880, 304104, 320492, 320495, 287730, 320504, 312313, 328701, 312317, 418819, 320520, 230411, 320526, 361487, 238611, 140311, 197658, 132140, 189487, 345137, 361522, 312372, 238646, 238650, 320571, 336962, 238663, 361547, 205911, 296023, 361570, 214116, 230500, 214119, 279659, 279666, 230514, 312435, 279686, 222344, 140426, 337037, 296091, 238764, 312519, 279752, 148687, 189651, 279766, 189656, 279775, 304352, 304353, 279780, 279789, 279803, 320769, 312588, 320795, 320802, 304422, 353581, 116014, 312628, 345397, 222523, 181568, 279872, 279874, 304457, 337226, 230730, 296269, 238928, 296274, 230757, 312688, 296304, 230772, 296328, 296330, 304523, 9618, 279955, 148899, 148900, 279979, 279980, 279988, 173492, 280003, 280011, 337359, 329168, 312785, 222674, 280020, 353751, 280025, 239069, 329181, 320997, 280042, 337391, 296434, 288252, 312830, 230922, 304655, 329231, 222754, 312879, 230960, 288305, 239159, 157246, 288319, 288322, 280131, 124486, 288328, 239192, 345697, 99937, 312937, 312941, 288377, 337533, 280193, 239238, 288391, 239251, 280217, 345753, 198304, 255651, 280252, 280253, 296636, 321217, 280259, 321220, 296649, 280266, 313042, 345813, 280279, 18139, 280285, 321250, 337638, 181992, 345832, 288492, 141037, 34547, 67316, 280326, 116491, 124691, 116502, 321308, 321309, 255781, 280367, 280373, 280377, 321338, 280381, 345918, 280386, 280391, 280396, 345942, 18263, 362326, 345950, 370526, 362336, 296807, 296815, 313200, 362351, 313204, 124795, 305032, 67464, 124816, 214936, 124826, 329627, 239515, 214943, 354210, 313257, 288698, 214978, 280517, 280518, 214983, 362442, 346066, 231382, 354268, 190437, 313322, 247786, 337899, 354283, 296942, 124912, 313338, 239610, 354312, 313356, 223269, 354342, 346153, 354346, 124974, 321589, 215095, 288829, 288835, 313415, 239689, 354386, 223317, 321632, 280676, 313446, 215144, 288878, 288890, 215165, 215204, 125108, 280761, 223418, 280767, 280779, 346319, 321744, 280792, 280803, 182503, 338151, 125166, 125170, 313595, 125180, 125184, 125192, 125197, 125200, 125204, 272661, 125215, 125216, 125225, 338217, 321839, 125236, 362809, 280903, 289109, 379224, 272730, 215395, 239973, 313703, 280938, 321901, 354671, 354672, 199030, 223611, 248188, 313726, 240003, 158087, 190870, 190872, 289185, 436644, 305572, 289195, 289229, 281038, 281039, 256476, 281071, 322057, 182802, 322077, 289328, 330291, 338491, 322119, 281165, 436831, 281200, 313970, 297600, 346771, 363155, 289435, 314020, 314043, 355006, 363212, 158424, 322269, 338658, 289511, 330473, 289517, 215790, 199415, 289534, 322302, 322312, 346889, 264971, 322320, 166677, 207639, 281378, 289580, 355129, 281407, 355136, 355138, 355147, 355148, 355153, 281426, 281434, 322396, 281444, 355173, 355174, 207735, 314240, 158594, 240517, 355216, 256920, 289691, 240543, 256934, 289704, 289720, 289723, 330688, 281541, 19398, 191445, 183254, 314343, 183276, 289773, 248815, 347122, 240631, 330759, 347150, 330789, 281647, 322609, 314437, 257093, 207954, 314458, 281699, 257126, 322664, 363643, 314493, 150656, 248960, 347286, 339101, 339106, 306339, 249003, 3243, 322733, 290001, 339167, 298209, 290030, 208123, 322826, 126229, 257323, 298290, 208179, 159033, 216387, 372039, 109899, 224591, 331091, 150868, 314708, 314711, 314721, 281958, 314727, 134504, 306541, 314734, 314740, 314742, 314745, 224637, 306558, 314752, 306561, 314759, 388488, 298378, 314765, 314771, 306580, 224662, 314776, 282008, 282013, 290206, 314788, 314790, 298406, 282023, 241067, 314797, 134586, 380350, 306630, 200136, 306634, 3559, 191980, 282097, 191991, 290304, 323079, 323083, 208397, 323088, 282132, 282135, 372261, 306730, 290359, 134715, 323132, 282182, 224848, 224852, 290391, 306777, 323171, 282214, 224874, 314997, 290425, 282244, 323208, 282248, 224907, 323226, 282272, 282279, 298664, 298666, 224951, 224952, 306875, 282302, 323262, 323265, 282309, 306891, 241360, 282321, 241366, 224985, 282330, 282336, 12009, 282347, 282349, 323315, 200444, 282366, 175874, 323335, 282375, 282379, 216844, 118549, 282390, 282399, 241440, 282401, 315172, 241447, 282418, 282424, 282428, 413500, 241471, 339782, 315209, 159563, 307024, 241494, 339799, 307030, 307038, 282471, 282476, 339840, 315265, 282503, 315272, 315275, 184207, 282517, 298912, 118693, 298921, 200628, 282572, 282573, 323554, 298987, 282634, 241695, 315431, 102441, 315433, 102446, 282671, 241717, 249912, 315468, 176209, 315477, 53334, 356446, 323678, 315488, 315489, 45154, 217194, 233578, 307306, 381071, 241809, 323730, 299166, 233635, 299176, 184489, 323761, 184498, 258233, 299197, 299202, 176325, 299208, 282832, 307431, 356603, 184574, 217352, 61720, 315674, 282908, 299294, 282912, 233761, 282920, 315698, 282938, 168251, 332100, 323914, 201037, 282959, 348499, 348501, 168280, 332128, 381286, 242027, 242028, 160111, 315768, 291193, 291194, 291200, 340356, 242059, 315798, 291225, 242079, 283039, 299449, 291266, 283088, 283089, 242138, 176602, 291297, 242150, 324098, 233987, 283154, 291359, 348709, 348710, 283185, 234037, 234044, 111197, 242274, 176751, 356990, 291455, 152196, 316044, 184974, 316048, 316050, 176810, 291529, 225996, 242385, 299737, 234216, 234233, 291584, 299777, 291591, 291605, 283418, 234276, 283431, 234290, 201534, 348999, 283466, 201562, 234330, 275294, 127840, 349025, 177002, 242540, 242542, 201590, 177018, 308093, 291713, 340865, 299912, 349066, 316299, 234382, 308111, 308113, 209820, 283551, 177074, 127945, 340960, 234469, 324587, 234476, 201721, 234499, 357380, 234513, 316441, 300087, 21567, 308288, 160834, 349254, 250955, 300109, 234578, 234606, 300145, 300147, 349317, 177297, 308375, 324761, 119965, 234655, 300192, 234662, 300200, 373937, 300215, 283846, 283849, 259275, 316628, 259285, 357594, 251124, 316661, 283894, 234741, 292092, 242955, 177420, 300342, 333115, 193858, 300354, 300355, 234830, 259408, 283990, 357720, 300378, 300379, 316764, 292194, 284015, 234864, 316786, 243073, 292242, 112019, 234902, 374189, 284086, 284090, 54719, 292291, 300488, 300490, 234957, 144862, 300526, 259569, 308722, 251379, 300539, 210429, 366081, 292359, 218632, 316951, 374297, 349727, 374327, 210489, 349764, 194118, 292426, 128589, 333394, 128600, 235096, 300645, 415334, 243306, 54895, 325246, 333438, 235136, 317102, 259780, 333508, 325345, 153318, 284410, 284425, 300810, 284430, 161553, 284436, 169751, 325403, 341791, 325411, 186148, 186149, 333609, 284460, 300849, 325444, 153416, 325449, 317268, 325460, 341846, 284508, 300893, 259937, 276326, 292713, 292719, 333687, 350072, 317305, 317308, 333700, 325508, 243590, 243592, 325514, 350102, 333734, 219046, 284584, 292783, 300983, 153553, 292835, 292838, 317416, 325620, 333827, 243720, 292901, 178215, 325675, 243763, 325695, 194667, 284789, 194692, 235661, 153752, 284827, 284840, 284843, 227517, 309443, 227525, 301255, 227536, 301270, 301271, 325857, 317676, 309504, 194832, 227601, 334104, 211239, 317738, 227655, 383309, 391521, 366948, 285031, 416103, 211327, 227721, 285074, 227730, 293275, 285083, 317851, 39323, 227743, 285089, 293281, 301482, 342454, 293309, 317889, 326093, 285152, 195044, 317949, 342537, 309770, 334345, 342560, 227881, 293420, 236080, 23093, 244279, 244280, 301635, 309831, 55880, 301647, 326229, 309847, 375396, 244326, 301688, 244345, 301702, 334473, 326288, 227991, 285348, 318127, 285360, 293552, 342705, 285362, 154295, 342714, 342757, 285419, 170735, 359166, 285443, 228099, 285450, 326413, 285457, 285467, 318247, 293673, 318251, 301872, 285493, 285496, 301883, 342846, 293702, 318279, 244569, 252766, 301919, 293729, 351078, 342888, 310132, 228214, 211835, 269179, 228232, 416649, 293780, 310166, 400282, 310177, 359332, 359333, 293801, 252848, 326586, 252878, 56270, 359380, 343020, 203758, 293894, 384015, 293911, 326684, 384031, 113710, 203829, 285795, 253028, 228457, 318571, 187508, 302202, 285819, 318602, 228492, 359574, 285850, 351389, 253098, 294069, 367798, 294075, 64699, 228541, 343230, 228587, 302319, 351475, 228608, 318732, 245018, 318746, 130342, 130344, 130347, 286012, 294210, 359747, 359748, 294220, 318804, 294236, 327023, 310650, 179586, 294278, 318860, 368012, 318876, 286128, 286133, 310714, 302523, 228796, 302530, 228804, 310725, 310731, 302539, 310735, 327122, 310747, 286176, 187877, 310758, 40439, 253431, 286201, 228868, 302602, 294413, 359949, 253456, 302613, 146976, 245291, 425534, 310853, 286281, 212574, 204386, 138862, 310896, 294517, 286344, 188049, 229011, 229021, 302751, 286387, 286392, 302778, 286400, 319176, 212684, 286419, 294621, 286463, 319232, 360194, 278292, 278294, 294699, 286507, 319289, 237397, 237411, 327556, 188293, 311183, 294806, 294808, 253851, 319393, 294820, 294824, 253868, 343993, 188349, 294849, 24531, 212953, 360416, 294887, 253930, 278507, 311277, 327666, 278515 ]
5811e3406aa69f6c4c36d0dc22ee735d3e6cce5a
b0849a27973f1947ea369cfc933c527363c125dd
/PushySquaresMapCreator/MapRegion.swift
6638ab3ef78a76c6056510ad9db768473aaec913
[]
no_license
Sweeper777/PushySquaresMapCreator
1e463fce3bd4ef87d9a68989c8f49ef62c06314c
d1ecb60dcb0159ff172062e44cb37a190f4d6126
refs/heads/master
2020-09-15T22:11:24.942542
2019-12-29T03:31:59
2019-12-29T03:31:59
223,567,414
0
0
null
null
null
null
UTF-8
Swift
false
false
226
swift
import Foundation enum MapRegion : Int { case leftHalf = 0 case rightHalf case topHalf case bottomHalf case topLeftQuarter case topRightQuarter case bottomLeftQuarter case bottomRightQuarter }
[ -1 ]
16a2193e81089957df464ad0e279bca93f2381c3
9c67dd9ab9030036003c23ea0520751b930dd070
/SportsOrganizer/ViewModel/RegViewModel.swift
d11468c9d52a1334e1bd90d4324f6808f7c98498
[]
no_license
bljubisic/SportsOrganizer
f60a96cd30fca3373cfac8029d3c9ba3b36ae17d
6811a3f767dc3248c7cc9ee56345d7aea0dcd750
refs/heads/master
2021-03-30T16:58:56.867473
2017-11-02T11:40:28
2017-11-02T11:40:28
86,626,465
0
0
null
null
null
null
UTF-8
Swift
false
false
1,113
swift
// // RegViewModel.swift // SportsOrganizer // // Created by Bratislav Ljubisic on 6/22/17. // Copyright © 2017 Bratislav Ljubisic. All rights reserved. // import Foundation import RxSwift final class RegViewModel: RegViewModelProtocol, RegViewModelInputs, RegViewModelOutputs { var appState: Observable<CommMessage> var outputs: RegViewModelOutputs { return self } var firstname: String = "" var lastname: String = "" var username: String = "" var phoneNumber: String = "" func createRegMessage() -> RegMessage { return RegMessage(firstname: self.firstname, lastname: self.lastname, username: self.username, phone: self.phoneNumber) } func sendRegistration(Message message: RegMessage) -> Bool { model.sendRegistration(message: message) return true } var model: SOModelProtocol var inputs: RegViewModelInputs { return self } init(withModel model: SOModelProtocol) { self.model = model self.appState = model.appStateAndMessage.asObservable() } }
[ -1 ]
6a9c316aec67580cd8fab2f68f7f4fadbdfa7cd8
9b868571cacc26acd40a8aa1b676804c6da7fa57
/BitAuthTests/BitAuthTests.swift
c11a66f8343fe720fa7fda53e48a025c7faab1b5
[]
no_license
dinodsaurus/BitAuth
601096020df0d52b76946914bf82a1333362eeb7
ae506d4df6fecc1b402c6c409f514018ea2fe9a5
refs/heads/master
2021-01-17T05:34:15.147032
2014-12-09T11:07:11
2014-12-09T11:07:11
null
0
0
null
null
null
null
UTF-8
Swift
false
false
901
swift
// // BitAuthTests.swift // BitAuthTests // // Created by Dino Trojak on 01/12/14. // Copyright (c) 2014 Dino Trojak. All rights reserved. // import UIKit import XCTest class BitAuthTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. XCTAssert(true, "Pass") } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock() { // Put the code you want to measure the time of here. } } }
[ 276481, 276484, 276489, 276492, 278541, 305179, 276509, 278558, 307231, 313375, 102437, 227370, 360491, 276534, 276543, 159807, 286788, 280649, 223316, 315476, 223318, 288857, 227417, 194652, 194653, 194656, 276577, 309345, 227428, 43109, 276582, 276581, 276585, 223340, 276589, 278638, 227439, 276592, 131189, 227446, 223350, 276606, 292992, 276613, 141450, 215178, 311435, 311438, 276627, 276631, 276632, 184475, 227492, 196773, 227495, 129203, 299187, 131256, 280762, 223419, 176314, 299198, 309444, 227528, 276682, 276684, 276687, 278742, 278746, 155867, 196834, 280802, 276709, 276710, 276715, 233715, 157944, 211193, 227576, 168188, 276737, 276744, 276753, 157970, 129301, 276760, 309529, 278810, 276764, 299293, 282919, 262450, 276787, 315706, 278846, 164162, 311621, 280902, 278856, 227658, 276813, 278862, 278863, 6481, 6482, 276821, 276822, 6489, 276831, 323935, 276835, 321894, 276839, 416104, 276847, 285040, 278898, 278908, 280961, 178571, 227725, 178578, 190871, 293274, 61857, 61859, 276900, 278951, 278961, 278965, 293303, 276920, 278969, 33211, 276925, 278978, 278985, 278993, 176594, 279002, 276958, 287198, 227809, 358882, 276962, 276963, 227813, 279013, 279019, 279022, 281072, 279039, 276998, 287241, 279050, 186893, 279054, 303631, 223767, 277017, 223769, 291358, 277029, 293419, 281138, 277048, 301634, 369220, 277066, 277083, 295519, 66150, 277094, 166507, 189036, 189037, 277101, 189042, 189043, 287346, 277111, 279164, 277118, 291454, 184962, 303746, 152203, 277133, 133774, 225933, 277138, 277142, 225943, 230040, 225944, 164512, 225956, 285353, 225962, 209581, 205487, 285361, 303793, 299699, 293556, 342706, 154294, 154291, 285371, 199366, 277193, 225997, 226001, 277204, 203477, 226004, 226007, 279252, 119513, 201442, 226019, 285415, 342762, 277227, 226033, 226035, 226036, 230134, 234234, 226043, 279294, 234238, 234241, 226051, 234245, 277254, 209670, 203529, 226058, 234250, 234253, 234256, 285463, 234263, 369432, 234268, 105246, 348959, 228129, 234277, 279336, 289576, 277289, 234283, 234280, 277294, 277295, 234286, 226097, 234289, 234294, 230199, 162621, 234301, 289598, 281408, 293693, 162626, 234304, 277316, 234305, 234311, 234312, 299849, 234317, 277325, 277327, 293711, 234323, 234326, 277339, 234331, 297822, 301918, 279392, 297826, 349026, 234340, 174949, 234343, 277354, 234346, 277360, 234355, 213876, 277366, 234360, 279417, 277370, 209785, 177019, 234361, 234366, 234367, 226170, 158593, 234372, 226181, 213894, 113542, 226184, 277381, 228234, 234377, 226189, 234381, 295824, 226194, 234386, 234387, 234392, 324507, 234395, 234400, 279456, 277410, 234404, 226214, 289703, 234409, 275371, 236461, 226223, 234419, 226227, 234425, 277435, 234427, 287677, 234430, 234436, 275397, 234438, 226249, 52172, 234444, 234445, 183248, 275410, 234451, 234450, 234454, 234457, 275418, 234463, 234466, 277479, 277480, 234472, 234473, 234477, 234482, 287731, 277492, 314355, 234492, 234495, 277505, 234498, 234500, 277509, 277510, 234503, 277513, 230410, 234506, 275468, 275469, 277517, 197647, 234509, 295953, 277523, 234517, 230423, 197657, 281625, 281626, 175132, 234530, 234531, 234534, 275495, 234539, 310317, 277550, 234542, 275505, 275506, 234548, 234555, 238651, 156733, 277566, 230463, 277563, 234560, 207938, 7229, 7230, 234565, 277574, 281666, 234569, 277579, 300111, 207953, 277585, 296018, 234577, 296019, 234583, 234584, 234594, 230499, 281700, 277603, 300135, 234603, 275565, 156785, 312434, 275571, 300151, 234616, 398457, 234622, 300158, 275585, 226435, 285828, 302213, 275590, 275591, 253063, 234632, 277640, 302217, 234642, 226451, 226452, 308372, 119963, 234652, 234656, 277665, 330913, 306338, 234659, 234663, 275625, 300201, 208043, 275628, 226476, 226481, 238769, 277686, 277690, 208058, 230588, 277694, 283840, 279747, 279760, 290000, 189652, 203989, 275671, 363744, 195811, 298212, 304356, 285929, 279792, 298228, 204022, 120055, 234742, 228600, 208124, 204041, 292107, 277792, 339234, 199971, 259363, 304421, 277800, 113962, 277803, 277806, 113966, 226608, 277809, 277814, 277815, 300343, 277821, 226624, 277824, 277825, 15686, 226632, 294218, 277834, 177484, 142669, 222541, 277838, 296273, 277841, 222548, 277845, 314709, 283991, 357719, 277844, 277852, 218462, 224606, 277856, 179552, 142689, 277859, 230756, 277862, 163175, 281962, 277866, 173420, 277868, 284014, 277871, 279919, 277878, 275831, 181625, 277882, 277883, 142716, 275838, 275839, 277890, 277891, 226694, 275847, 277896, 281992, 277897, 277900, 230799, 112017, 296338, 306579, 206228, 277907, 226711, 226712, 277911, 277916, 277919, 277920, 310692, 277925, 279974, 277927, 282024, 370091, 277936, 277939, 277940, 279989, 296375, 277943, 277946, 277949, 277952, 296387, 415171, 163269, 277957, 296391, 300487, 277962, 277965, 280013, 312782, 284116, 277974, 277977, 277980, 226781, 277983, 277988, 310757, 316902, 277993, 296425, 277994, 278002, 278005, 226805, 306677, 278008, 300542, 306693, 278023, 175625, 192010, 280077, 149007, 65041, 282136, 204313, 278056, 278060, 286254, 226875, 194110, 128583, 226888, 276040, 366154, 276045, 276046, 286288, 226897, 276050, 280147, 300630, 226906, 147036, 243292, 370271, 282213, 317032, 222832, 276084, 276085, 276088, 278140, 276092, 188031, 276097, 192131, 276100, 276101, 229001, 310923, 312972, 282259, 276116, 276120, 278170, 280220, 276126, 282273, 276129, 282276, 278191, 276146, 278195, 198324, 286388, 296628, 278201, 276156, 276165, 278214, 276172, 276173, 302797, 212688, 302802, 276180, 286423, 216795, 276195, 153319, 313065, 280300, 419569, 276210, 276219, 194303, 288512, 311042, 288516, 278285, 276238, 227091, 184086, 294678, 284442, 278299, 276253, 278307, 288547, 278316, 159533, 165677, 276279, 276282, 276283, 288574, 276287, 345919, 276294, 282438, 276298, 216918, 276311, 307031, 188246, 276318, 237408, 276325, 282474, 288619, 276332, 173936, 276344, 194429, 276350, 227199, 1923, 40850, 40853, 44952, 247712, 276385, 294823, 276394, 276400, 276408, 290746, 276421, 276430, 231375, 153554, 276443, 276444, 280541, 153566, 276450, 276451, 276454, 276459, 296941, 276462, 276463, 276468, 276469, 278518, 276475, 276478 ]
ac09247020b6c0c30be2db2fd06279249cd552a1
469dc2d029927e8023284095c9120baa246cb462
/Proyecto 2/Login v.5/Login/SecodViewController.swift
8c81f3cc43e61055f21555cb24dd848cd996b2b0
[]
no_license
FernandaNoemiAM/Proyectos-MPOO
1bcb7be9d5900bcc4648f95d765fe3502e938deb
d21ca4a1d206023bf8c9b332c1d7ff1c02fae3ca
refs/heads/master
2023-03-20T05:37:15.924463
2018-12-07T04:54:34
2018-12-07T04:54:34
null
0
0
null
null
null
null
UTF-8
Swift
false
false
867
swift
// // SecodViewController.swift // Login // // Created by Laboratorio UNAM-Apple09 on 19/10/18. // Copyright © 2018 1. All rights reserved. // import UIKit class SecodViewController: UIViewController { 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 prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ 279041, 279046, 281107, 217109, 277527, 300057, 317473, 296489, 286256, 286257, 281142, 300089, 238653, 286271, 286786, 129604, 228932, 159812, 288331, 288332, 292428, 292429, 292431, 292432, 228945, 203858, 280146, 212573, 277602, 309347, 309349, 309351, 309353, 286314, 296042, 277612, 311913, 164974, 284275, 277108, 284277, 294518, 284279, 276087, 292478, 40574, 284289, 284298, 303242, 226447, 278675, 349332, 284315, 284317, 282275, 284323, 313007, 284336, 276150, 280760, 296638, 277696, 280770, 280772, 280775, 276167, 284361, 230604, 239308, 239310, 298189, 239312, 239313, 239314, 302286, 230608, 317137, 290004, 284373, 290006, 189655, 298202, 302295, 278749, 298206, 298207, 280797, 363743, 291556, 290020, 301284, 277224, 280808, 199402, 280810, 166643, 289524, 120054, 226038, 286456, 280826, 276736, 280832, 312586, 302865, 278298, 329499, 287004, 281373, 228127, 281380, 277796, 233767, 283433, 278845, 279360, 296272, 279380, 289112, 279386, 188253, 292701, 311645, 227688, 293742, 277364, 207738, 290175, 275842, 183173, 313222, 234380, 233869, 304015, 226705, 226196, 188313, 284570, 284574, 285087, 284577, 289187, 289190, 289191, 305577, 291755, 289196, 370093, 279982, 286126, 297903, 305582, 276396, 277935, 282548, 234423, 293816, 127418, 293308, 278973, 291774, 286158, 280015, 301012, 163289, 280030, 188897, 279011, 289771, 282095, 281073, 234483, 302580, 236022, 288251, 287231 ]
f3e7c2d2ea4f8db03c6089a6093801216d80f7f9
2e8e690c0e7da5f5cb388febe94590132a4ef09a
/DKCamera/DKCamera.swift
9015c26f1b6b6e9ad32735f73508c31c737116cf
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
1dreamm/DKImagePickerController
e9aecefc8ecaa9520fafc57a1cc8be758a857ed4
2ecebbe87d47a001b0a356769d0eb0d8dfd66f94
refs/heads/master
2021-01-22T09:03:50.186299
2017-10-16T15:45:14
2017-10-16T15:45:14
81,927,180
0
0
null
2017-02-14T09:15:20
2017-02-14T09:15:20
null
UTF-8
Swift
false
false
29,416
swift
// // DKCamera.swift // DKCameraDemo // // Created by ZhangAo on 15/8/30. // Copyright (c) 2015年 ZhangAo. All rights reserved. // import UIKit import AVFoundation import CoreMotion import ImageIO open class DKCameraPassthroughView: UIView { open override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { let hitTestingView = super.hitTest(point, with: event) return hitTestingView == self ? nil : hitTestingView } } extension AVMetadataFaceObject { open func realBounds(inCamera camera: DKCamera) -> CGRect { var bounds = CGRect() let previewSize = camera.previewLayer.bounds.size let isFront = camera.currentDevice == camera.captureDeviceFront if isFront { bounds.origin = CGPoint(x: previewSize.width - previewSize.width * (1 - self.bounds.origin.y - self.bounds.size.height / 2), y: previewSize.height * (self.bounds.origin.x + self.bounds.size.width / 2)) } else { bounds.origin = CGPoint(x: previewSize.width * (1 - self.bounds.origin.y - self.bounds.size.height / 2), y: previewSize.height * (self.bounds.origin.x + self.bounds.size.width / 2)) } bounds.size = CGSize(width: self.bounds.width * previewSize.height, height: self.bounds.height * previewSize.width) return bounds } } @objc public enum DKCameraDeviceSourceType : Int { case front, rear } open class DKCamera: UIViewController, AVCaptureMetadataOutputObjectsDelegate { open class func checkCameraPermission(_ handler: @escaping (_ granted: Bool) -> Void) { func hasCameraPermission() -> Bool { return AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo) == .authorized } func needsToRequestCameraPermission() -> Bool { return AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo) == .notDetermined } hasCameraPermission() ? handler(true) : (needsToRequestCameraPermission() ? AVCaptureDevice.requestAccess(forMediaType: AVMediaTypeVideo, completionHandler: { granted in DispatchQueue.main.async(execute: { () -> Void in hasCameraPermission() ? handler(true) : handler(false) }) }) : handler(false)) } open var didCancel: (() -> Void)? open var didFinishCapturingImage: ((_ image: UIImage, _ metadata: [AnyHashable : Any]?) -> Void)? /// Notify the listener of the detected faces in the preview frame. open var onFaceDetection: ((_ faces: [AVMetadataFaceObject]) -> Void)? /// Be careful this may cause the view to load prematurely. open var cameraOverlayView: UIView? { didSet { if let cameraOverlayView = cameraOverlayView { self.view.addSubview(cameraOverlayView) } } } /// The flashModel will to be remembered to next use. open var flashMode:AVCaptureFlashMode! { didSet { self.updateFlashButton() self.updateFlashMode() self.updateFlashModeToUserDefautls(self.flashMode) } } open class func isAvailable() -> Bool { return UIImagePickerController.isSourceTypeAvailable(.camera) } /// Determines whether or not the rotation is enabled. open var allowsRotate = false /// set to NO to hide all standard camera UI. default is YES. open var showsCameraControls = true { didSet { self.contentView.isHidden = !self.showsCameraControls } } open let captureSession = AVCaptureSession() open var previewLayer: AVCaptureVideoPreviewLayer! fileprivate var beginZoomScale: CGFloat = 1.0 fileprivate var zoomScale: CGFloat = 1.0 open var defaultCaptureDevice = DKCameraDeviceSourceType.rear open var currentDevice: AVCaptureDevice? open var captureDeviceFront: AVCaptureDevice? open var captureDeviceRear: AVCaptureDevice? fileprivate weak var stillImageOutput: AVCaptureStillImageOutput? open var contentView = UIView() open var originalOrientation: UIDeviceOrientation! open var currentOrientation: UIDeviceOrientation! open let motionManager = CMMotionManager() open lazy var flashButton: UIButton = { let flashButton = UIButton() flashButton.addTarget(self, action: #selector(DKCamera.switchFlashMode), for: .touchUpInside) return flashButton }() open var cameraSwitchButton: UIButton! open var captureButton: UIButton! let cameraResource: DKCameraResource init(cameraResource: DKCameraResource = DKDefaultCameraResource()) { self.cameraResource = cameraResource super.init(nibName: nil, bundle: nil) } required public init?(coder aDecoder: NSCoder) { self.cameraResource = DKDefaultCameraResource() super.init(coder: aDecoder) } override open func viewDidLoad() { super.viewDidLoad() self.setupDevices() self.setupUI() self.setupSession() self.setupMotionManager() } open override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) if !self.captureSession.isRunning { self.captureSession.startRunning() } if !self.motionManager.isAccelerometerActive { self.motionManager.startAccelerometerUpdates(to: OperationQueue.current!, withHandler: { accelerometerData, error in if error == nil { let currentOrientation = accelerometerData!.acceleration.toDeviceOrientation() ?? self.currentOrientation if self.originalOrientation == nil { self.initialOriginalOrientationForOrientation() self.currentOrientation = self.originalOrientation } if let currentOrientation = currentOrientation , self.currentOrientation != currentOrientation { self.currentOrientation = currentOrientation self.updateContentLayoutForCurrentOrientation() } } else { print("error while update accelerometer: \(error!.localizedDescription)", terminator: "") } }) } self.updateSession(isEnable: true) } open override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() if self.originalOrientation == nil { self.contentView.frame = self.view.bounds self.previewLayer.frame = self.view.bounds } } open override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) self.updateSession(isEnable: false) self.motionManager.stopAccelerometerUpdates() } override open func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } open override var prefersStatusBarHidden : Bool { return true } // MARK: - Setup let bottomView = UIView() open func setupUI() { self.view.backgroundColor = UIColor.black self.view.addSubview(self.contentView) self.contentView.backgroundColor = UIColor.clear self.contentView.frame = self.view.bounds let bottomViewHeight: CGFloat = 70 bottomView.bounds.size = CGSize(width: contentView.bounds.width, height: bottomViewHeight) bottomView.frame.origin = CGPoint(x: 0, y: contentView.bounds.height - bottomViewHeight) bottomView.autoresizingMask = [.flexibleWidth, .flexibleTopMargin] bottomView.backgroundColor = UIColor(white: 0, alpha: 0.4) contentView.addSubview(bottomView) // switch button let cameraSwitchButton: UIButton = { let cameraSwitchButton = UIButton() cameraSwitchButton.addTarget(self, action: #selector(DKCamera.switchCamera), for: .touchUpInside) cameraSwitchButton.setImage(cameraResource.cameraSwitchImage(), for: .normal) cameraSwitchButton.sizeToFit() return cameraSwitchButton }() cameraSwitchButton.frame.origin = CGPoint(x: bottomView.bounds.width - cameraSwitchButton.bounds.width - 15, y: (bottomView.bounds.height - cameraSwitchButton.bounds.height) / 2) cameraSwitchButton.autoresizingMask = [.flexibleLeftMargin, .flexibleTopMargin, .flexibleBottomMargin] bottomView.addSubview(cameraSwitchButton) self.cameraSwitchButton = cameraSwitchButton // capture button let captureButton: UIButton = { class DKCaptureButton: UIButton { fileprivate override func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { self.backgroundColor = UIColor.white return true } fileprivate override func continueTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { self.backgroundColor = UIColor.white return true } fileprivate override func endTracking(_ touch: UITouch?, with event: UIEvent?) { self.backgroundColor = nil } fileprivate override func cancelTracking(with event: UIEvent?) { self.backgroundColor = nil } } let captureButton = DKCaptureButton() captureButton.addTarget(self, action: #selector(DKCamera.takePicture), for: .touchUpInside) captureButton.bounds.size = CGSize(width: bottomViewHeight, height: bottomViewHeight).applying(CGAffineTransform(scaleX: 0.9, y: 0.9)) captureButton.layer.cornerRadius = captureButton.bounds.height / 2 captureButton.layer.borderColor = UIColor.white.cgColor captureButton.layer.borderWidth = 2 captureButton.layer.masksToBounds = true return captureButton }() captureButton.center = CGPoint(x: bottomView.bounds.width / 2, y: bottomView.bounds.height / 2) captureButton.autoresizingMask = [.flexibleLeftMargin, .flexibleRightMargin] bottomView.addSubview(captureButton) self.captureButton = captureButton // cancel button let cancelButton: UIButton = { let cancelButton = UIButton() cancelButton.addTarget(self, action: #selector(dismiss as (Void) -> Void), for: .touchUpInside) cancelButton.setImage(cameraResource.cameraCancelImage(), for: .normal) cancelButton.sizeToFit() return cancelButton }() cancelButton.frame.origin = CGPoint(x: contentView.bounds.width - cancelButton.bounds.width - 15, y: 25) cancelButton.autoresizingMask = [.flexibleBottomMargin, .flexibleLeftMargin] contentView.addSubview(cancelButton) self.flashButton.frame.origin = CGPoint(x: 5, y: 15) contentView.addSubview(self.flashButton) contentView.addGestureRecognizer(UIPinchGestureRecognizer(target: self, action: #selector(DKCamera.handleZoom(_:)))) contentView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(DKCamera.handleFocus(_:)))) } open func setupSession() { self.captureSession.sessionPreset = AVCaptureSessionPresetPhoto self.setupCurrentDevice() let stillImageOutput = AVCaptureStillImageOutput() if self.captureSession.canAddOutput(stillImageOutput) { self.captureSession.addOutput(stillImageOutput) self.stillImageOutput = stillImageOutput } if self.onFaceDetection != nil { let metadataOutput = AVCaptureMetadataOutput() metadataOutput.setMetadataObjectsDelegate(self, queue: DispatchQueue(label: "MetadataOutputQueue")) if self.captureSession.canAddOutput(metadataOutput) { self.captureSession.addOutput(metadataOutput) metadataOutput.metadataObjectTypes = [AVMetadataObjectTypeFace] } } self.previewLayer = AVCaptureVideoPreviewLayer(session: self.captureSession) self.previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill self.previewLayer.frame = self.view.bounds let rootLayer = self.view.layer rootLayer.masksToBounds = true rootLayer.insertSublayer(self.previewLayer, at: 0) } open func setupCurrentDevice() { if let currentDevice = self.currentDevice { if currentDevice.isFlashAvailable { self.flashButton.isHidden = false self.flashMode = self.flashModeFromUserDefaults() } else { self.flashButton.isHidden = true } for oldInput in self.captureSession.inputs as! [AVCaptureInput] { self.captureSession.removeInput(oldInput) } let frontInput = try? AVCaptureDeviceInput(device: self.currentDevice) if self.captureSession.canAddInput(frontInput) { self.captureSession.addInput(frontInput) } try! currentDevice.lockForConfiguration() if currentDevice.isFocusModeSupported(.continuousAutoFocus) { currentDevice.focusMode = .continuousAutoFocus } if currentDevice.isExposureModeSupported(.continuousAutoExposure) { currentDevice.exposureMode = .continuousAutoExposure } currentDevice.unlockForConfiguration() } } open func setupDevices() { let devices = AVCaptureDevice.devices(withMediaType: AVMediaTypeVideo) as! [AVCaptureDevice] for device in devices { if device.position == .back { self.captureDeviceRear = device } if device.position == .front { self.captureDeviceFront = device } } switch self.defaultCaptureDevice { case .front: self.currentDevice = self.captureDeviceFront ?? self.captureDeviceRear case .rear: self.currentDevice = self.captureDeviceRear ?? self.captureDeviceFront } } // MARK: - Session fileprivate var isStopped = false open func startSession() { self.isStopped = false if !self.captureSession.isRunning { self.captureSession.startRunning() } } open func stopSession() { self.pauseSession() self.captureSession.stopRunning() } open func pauseSession() { self.isStopped = true self.updateSession(isEnable: false) } open func updateSession(isEnable: Bool) { if ((!self.isStopped) || (self.isStopped && !isEnable)), let connection = self.previewLayer.connection { connection.isEnabled = isEnable } } // MARK: - Callbacks internal func dismiss() { self.didCancel?() } open func takePicture() { let authStatus = AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo) if authStatus == .denied { return } if let stillImageOutput = self.stillImageOutput, !stillImageOutput.isCapturingStillImage { self.captureButton.isEnabled = false DispatchQueue.global().async(execute: { if let connection = stillImageOutput.connection(withMediaType: AVMediaTypeVideo) { connection.videoOrientation = self.currentOrientation.toAVCaptureVideoOrientation() connection.videoScaleAndCropFactor = self.zoomScale stillImageOutput.captureStillImageAsynchronously(from: connection, completionHandler: { (imageDataSampleBuffer, error) in if error == nil { let imageData = AVCaptureStillImageOutput.jpegStillImageNSDataRepresentation(imageDataSampleBuffer) if let didFinishCapturingImage = self.didFinishCapturingImage, let imageData = imageData, let takenImage = UIImage(data: imageData) { let outputRect = self.previewLayer.metadataOutputRectOfInterest(for: self.previewLayer.bounds) let takenCGImage = takenImage.cgImage! let width = CGFloat(takenCGImage.width) let height = CGFloat(takenCGImage.height) let cropRect = CGRect(x: outputRect.origin.x * width, y: outputRect.origin.y * height, width: outputRect.size.width * width, height: outputRect.size.height * height) let cropCGImage = takenCGImage.cropping(to: cropRect) let cropTakenImage = UIImage(cgImage: cropCGImage!, scale: 1, orientation: takenImage.imageOrientation) var metadata: Dictionary<AnyHashable, Any>? if let source = CGImageSourceCreateWithData(imageData as CFData, nil) { metadata = CGImageSourceCopyPropertiesAtIndex(source, 0, nil) as? Dictionary<AnyHashable, Any> } didFinishCapturingImage(cropTakenImage, metadata) self.captureButton.isEnabled = true } } else { print("error while capturing still image: \(error!.localizedDescription)", terminator: "") } }) } }) } } // MARK: - Handles Zoom open func handleZoom(_ gesture: UIPinchGestureRecognizer) { if gesture.state == .began { self.beginZoomScale = self.zoomScale } else if gesture.state == .changed { self.zoomScale = min(4.0, max(1.0, self.beginZoomScale * gesture.scale)) CATransaction.begin() CATransaction.setAnimationDuration(0.025) self.previewLayer.setAffineTransform(CGAffineTransform(scaleX: self.zoomScale, y: self.zoomScale)) CATransaction.commit() } } // MARK: - Handles Focus open func handleFocus(_ gesture: UITapGestureRecognizer) { if let currentDevice = self.currentDevice , currentDevice.isFocusPointOfInterestSupported { let touchPoint = gesture.location(in: self.view) self.focusAtTouchPoint(touchPoint) } } open func focusAtTouchPoint(_ touchPoint: CGPoint) { func showFocusViewAtPoint(_ touchPoint: CGPoint) { struct FocusView { static let focusView: UIView = { let focusView = UIView() let diameter: CGFloat = 100 focusView.bounds.size = CGSize(width: diameter, height: diameter) focusView.layer.borderWidth = 2 focusView.layer.cornerRadius = diameter / 2 focusView.layer.borderColor = UIColor.white.cgColor return focusView }() } FocusView.focusView.transform = CGAffineTransform.identity FocusView.focusView.center = touchPoint self.view.addSubview(FocusView.focusView) UIView.animate(withDuration: 0.7, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 1.1, options: UIViewAnimationOptions(), animations: { () -> Void in FocusView.focusView.transform = CGAffineTransform.identity.scaledBy(x: 0.6, y: 0.6) }) { (Bool) -> Void in FocusView.focusView.removeFromSuperview() } } if self.currentDevice == nil || self.currentDevice?.isFlashAvailable == false { return } let focusPoint = self.previewLayer.captureDevicePointOfInterest(for: touchPoint) showFocusViewAtPoint(touchPoint) if let currentDevice = self.currentDevice { try! currentDevice.lockForConfiguration() currentDevice.focusPointOfInterest = focusPoint currentDevice.exposurePointOfInterest = focusPoint currentDevice.focusMode = .continuousAutoFocus if currentDevice.isExposureModeSupported(.continuousAutoExposure) { currentDevice.exposureMode = .continuousAutoExposure } currentDevice.unlockForConfiguration() } } // MARK: - Handles Switch Camera internal func switchCamera() { self.currentDevice = self.currentDevice == self.captureDeviceRear ? self.captureDeviceFront : self.captureDeviceRear self.setupCurrentDevice() } // MARK: - Handles Flash internal func switchFlashMode() { switch self.flashMode! { case .auto: self.flashMode = .off case .on: self.flashMode = .auto case .off: self.flashMode = .on } } open func flashModeFromUserDefaults() -> AVCaptureFlashMode { let rawValue = UserDefaults.standard.integer(forKey: "DKCamera.flashMode") return AVCaptureFlashMode(rawValue: rawValue)! } open func updateFlashModeToUserDefautls(_ flashMode: AVCaptureFlashMode) { UserDefaults.standard.set(flashMode.rawValue, forKey: "DKCamera.flashMode") } open func updateFlashButton() { struct FlashImage { let images: [AVCaptureFlashMode: UIImage] init(cameraResource: DKCameraResource) { self.images = [ AVCaptureFlashMode.auto : cameraResource.cameraFlashAutoImage(), AVCaptureFlashMode.on : cameraResource.cameraFlashOnImage(), AVCaptureFlashMode.off : cameraResource.cameraFlashOffImage() ] } } let flashImage: UIImage = FlashImage(cameraResource:cameraResource).images[self.flashMode]! self.flashButton.setImage(flashImage, for: .normal) self.flashButton.sizeToFit() } open func updateFlashMode() { if let currentDevice = self.currentDevice , currentDevice.isFlashAvailable && currentDevice.isFlashModeSupported(self.flashMode) { try! currentDevice.lockForConfiguration() currentDevice.flashMode = self.flashMode currentDevice.unlockForConfiguration() } } // MARK: - AVCaptureMetadataOutputObjectsDelegate public func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputMetadataObjects metadataObjects: [Any]!, from connection: AVCaptureConnection!) { self.onFaceDetection?(metadataObjects as! [AVMetadataFaceObject]) } // MARK: - Handles Orientation open override var shouldAutorotate : Bool { return false } open func setupMotionManager() { self.motionManager.accelerometerUpdateInterval = 0.5 self.motionManager.gyroUpdateInterval = 0.5 } open func initialOriginalOrientationForOrientation() { self.originalOrientation = UIApplication.shared.statusBarOrientation.toDeviceOrientation() if let connection = self.previewLayer.connection { connection.videoOrientation = self.originalOrientation.toAVCaptureVideoOrientation() } } open func updateContentLayoutForCurrentOrientation() { let newAngle = self.currentOrientation.toAngleRelativeToPortrait() - self.originalOrientation.toAngleRelativeToPortrait() if self.allowsRotate { var contentViewNewSize: CGSize! let width = self.view.bounds.width let height = self.view.bounds.height if UIDeviceOrientationIsLandscape(self.currentOrientation) { contentViewNewSize = CGSize(width: max(width, height), height: min(width, height)) } else { contentViewNewSize = CGSize(width: min(width, height), height: max(width, height)) } UIView.animate(withDuration: 0.2, animations: { self.contentView.bounds.size = contentViewNewSize self.contentView.transform = CGAffineTransform(rotationAngle: newAngle) }) } else { let rotateAffineTransform = CGAffineTransform.identity.rotated(by: newAngle) UIView.animate(withDuration: 0.2, animations: { self.flashButton.transform = rotateAffineTransform self.cameraSwitchButton.transform = rotateAffineTransform }) } } } // MARK: - Utilities public extension UIInterfaceOrientation { func toDeviceOrientation() -> UIDeviceOrientation { switch self { case .portrait: return .portrait case .portraitUpsideDown: return .portraitUpsideDown case .landscapeRight: return .landscapeLeft case .landscapeLeft: return .landscapeRight default: return .portrait } } } public extension UIDeviceOrientation { func toAVCaptureVideoOrientation() -> AVCaptureVideoOrientation { switch self { case .portrait: return .portrait case .portraitUpsideDown: return .portraitUpsideDown case .landscapeRight: return .landscapeLeft case .landscapeLeft: return .landscapeRight default: return .portrait } } func toInterfaceOrientationMask() -> UIInterfaceOrientationMask { switch self { case .portrait: return .portrait case .portraitUpsideDown: return .portraitUpsideDown case .landscapeRight: return .landscapeLeft case .landscapeLeft: return .landscapeRight default: return .portrait } } func toAngleRelativeToPortrait() -> CGFloat { switch self { case .portrait: return 0 case .portraitUpsideDown: return CGFloat.pi case .landscapeRight: return -CGFloat.pi / 2.0 case .landscapeLeft: return CGFloat.pi / 2.0 default: return 0.0 } } } public extension CMAcceleration { func toDeviceOrientation() -> UIDeviceOrientation? { if self.x >= 0.75 { return .landscapeRight } else if self.x <= -0.75 { return .landscapeLeft } else if self.y <= -0.75 { return .portrait } else if self.y >= 0.75 { return .portraitUpsideDown } else { return nil } } } // MARK: - Rersources public extension Bundle { class func cameraBundle() -> Bundle { let assetPath = Bundle(for: DKDefaultCameraResource.self).resourcePath! return Bundle(path: (assetPath as NSString).appendingPathComponent("DKCameraResource.bundle"))! } } open class DKDefaultCameraResource: DKCameraResource { open func imageForResource(_ name: String) -> UIImage { let bundle = Bundle.cameraBundle() let imagePath = bundle.path(forResource: name, ofType: "png", inDirectory: "Images") let image = UIImage(contentsOfFile: imagePath!) return image! } public func cameraCancelImage() -> UIImage { return imageForResource("camera_cancel") } public func cameraFlashOnImage() -> UIImage { return imageForResource("camera_flash_on") } public func cameraFlashAutoImage() -> UIImage { return imageForResource("camera_flash_auto") } public func cameraFlashOffImage() -> UIImage { return imageForResource("camera_flash_off") } public func cameraSwitchImage() -> UIImage { return imageForResource("camera_switch") } }
[ 152915, 178067, 21639 ]
5f8a089d970ede52ad760688846e321cfc56bc3d
7c220c3303d7961fd379f3a7b6c69ab023365855
/Eventure/Organization Account/Ticketing/TicketRequests.swift
c3af938c094be894c4331f496b34b6d04a63680b
[]
no_license
TheMoon2000/Eventure-iOS
4d048e6efc8fac66487b5b1028135314376df356
755f1f17a9ca0a73c0c3a879b9352b9fc7c232fc
refs/heads/master
2021-06-27T20:38:56.360523
2020-11-24T09:49:29
2020-11-24T09:49:29
188,689,312
3
5
null
2019-10-27T02:18:13
2019-05-26T13:54:46
Swift
UTF-8
Swift
false
false
11,149
swift
// // TicketRequests.swift // Eventure // // Created by Jia Rui Shan on 2019/9/21. // Copyright © 2019 UC Berkeley. All rights reserved. // import UIKit import SwiftyJSON import XLPagerTabStrip class TicketRequests: UITableViewController, IndicatorInfoProvider { private var parentVC: TicketManagerMain! private var admissionType: AdmissionType { return parentVC.admissionType } private var currentRequests = [TicketRequest]() private var rc = UIRefreshControl() private var emptyLabel: UILabel! private var loadingBG: UIView! required init(parentVC: TicketManagerMain) { super.init(nibName: nil, bundle: nil) self.parentVC = parentVC } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) parentVC.navigationItem.backBarButtonItem = .init(title: "Requests", style: .plain, target: nil, action: nil) } override func viewDidLoad() { super.viewDidLoad() tableView.tableFooterView = UIView() tableView.separatorStyle = .none tableView.contentInset.top = 6 tableView.contentInset.bottom = 6 tableView.backgroundColor = AppColors.canvas emptyLabel = { let label = UILabel() label.textColor = .gray label.textAlignment = .center label.translatesAutoresizingMaskIntoConstraints = false view.addSubview(label) label.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor, constant: 30).isActive = true label.rightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.rightAnchor, constant: -30).isActive = true label.centerYAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerYAnchor).isActive = true return label }() loadingBG = view.addLoader() rc.addTarget(self, action: #selector(refresh), for: .valueChanged) rc.tintColor = AppColors.lightControl fetchRequests() NotificationCenter.default.addObserver(self, selector: #selector(backgroundUpdate), name: NEW_TICKET_REQUEST, object: nil) } deinit { NotificationCenter.default.removeObserver(self) } @objc private func backgroundUpdate() { fetchRequests(pulled: false, stealth: true) } @objc private func refresh() { fetchRequests(pulled: true) } private func fetchRequests(pulled: Bool = false, stealth: Bool = false) { if !pulled { loadingBG.isHidden = false } if !stealth { emptyLabel.text = "" } let url = URL.with(base: API_BASE_URL, API_Name: "events/ListTicketRequests", parameters: ["admissionId": admissionType.id])! var request = URLRequest(url: url) request.addAuthHeader() let task = CUSTOM_SESSION.dataTask(with: request) { data, response, error in DispatchQueue.main.async { if !pulled { self.loadingBG.isHidden = true self.tableView.refreshControl = self.rc } else { self.rc.endRefreshing() } } guard error == nil else { DispatchQueue.main.async { self.emptyLabel.text = CONNECTION_ERROR internetUnavailableError(vc: self) } return } if let json = try? JSON(data: data!), let requests = json.array { var tmp = [TicketRequest]() for r in requests { tmp.append(TicketRequest(json: r)) } self.currentRequests = tmp DispatchQueue.main.async { self.emptyLabel.text = tmp.isEmpty ? "No requests" : "" self.tableView.reloadData() } } else { DispatchQueue.main.async { self.emptyLabel.text = SERVER_ERROR serverMaintenanceError(vc: self) } } } task.resume() } // MARK: - Table view data source override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return currentRequests.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = RequestCell() let currentRequest = currentRequests[indexPath.row] cell.setup(requestInfo: currentRequest) cell.acceptHandler = { let alert = UIAlertController(title: "Approve ticket request?", message: "It is your responsibility to confirm that this user has already made any necessary payments to be eligible for their ticket(s). Once a ticket is given out it cannot be withdrawn.", preferredStyle: .alert) alert.addAction(.init(title: "Cancel", style: .cancel)) alert.addAction(.init(title: "Approve", style: .default, handler: { _ in self.approveRequest(self.tableView.indexPath(for: cell)!, cell: cell) })) self.present(alert, animated: true) } cell.declineHandler = { let alert = UIAlertController(title: "Decline ticket request?", message: "You are about to remove this ticket request. You cannot undo this action.", preferredStyle: .alert) alert.addAction(.init(title: "Cancel", style: .cancel)) alert.addAction(.init(title: "Decline", style: .default, handler: { _ in self.declineRequest(self.tableView.indexPath(for: cell)!, cell: cell) })) self.present(alert, animated: true) } return cell } func approveRequest(_ indexPath: IndexPath, cell: RequestCell) { let currentRequest = currentRequests[indexPath.row] loadingBG.isHidden = false tableView.refreshControl = nil let url = URL.with(base: API_BASE_URL, API_Name: "events/ApproveTicketRequest", parameters: [ "admissionId": currentRequest.admissionID, "userId": String(currentRequest.userID), "ticketId": UUID().uuidString.lowercased(), "requestDate": DATE_FORMATTER.string(from: currentRequest.requestDate ?? Date()) ])! var request = URLRequest(url: url) request.addAuthHeader() let task = CUSTOM_SESSION.dataTask(with: request) { data, response, error in DispatchQueue.main.async { self.loadingBG.isHidden = true self.tableView.refreshControl = self.rc } guard error == nil else { DispatchQueue.main.async { internetUnavailableError(vc: self) } return } let msg = String(data: data!, encoding: .utf8) switch msg { case INTERNAL_ERROR: DispatchQueue.main.async { serverMaintenanceError(vc: self) } case "success": DispatchQueue.main.async { cell.animateAccept { _ in self.parentVC.reloadPurchases() DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { self.currentRequests.remove(at: indexPath.row) self.tableView.deleteRows(at: [indexPath], with: .automatic) if self.currentRequests.isEmpty { self.emptyLabel.text = "No requests" } } } } default: let alert = UIAlertController(title: "Error", message: msg, preferredStyle: .alert) alert.addAction(.init(title: "Dismiss", style: .cancel, handler: nil)) DispatchQueue.main.async { self.present(alert, animated: true) } } } task.resume() } func declineRequest(_ indexPath: IndexPath, cell: RequestCell) { let currentRequest = currentRequests[indexPath.row] loadingBG.isHidden = false tableView.refreshControl = nil let url = URL.with(base: API_BASE_URL, API_Name: "events/DeclineTicketRequest", parameters: [ "admissionId": currentRequest.admissionID, "userId": String(currentRequest.userID), "requestDate": DATE_FORMATTER.string(from: currentRequest.requestDate ?? Date()) ])! var request = URLRequest(url: url) request.addAuthHeader() let task = CUSTOM_SESSION.dataTask(with: request) { data, response, error in DispatchQueue.main.async { self.loadingBG.isHidden = true self.tableView.refreshControl = self.rc } guard error == nil else { DispatchQueue.main.async { internetUnavailableError(vc: self) } return } let msg = String(data: data!, encoding: .utf8) switch msg { case INTERNAL_ERROR: DispatchQueue.main.async { serverMaintenanceError(vc: self) } case "success": DispatchQueue.main.async { cell.animateReject { _ in DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { self.currentRequests.remove(at: indexPath.row) self.tableView.deleteRows(at: [indexPath], with: .automatic) if self.currentRequests.isEmpty { self.emptyLabel.text = "No requests" } } } } default: let alert = UIAlertController(title: "Error", message: msg, preferredStyle: .alert) alert.addAction(.init(title: "Dismiss", style: .cancel, handler: nil)) DispatchQueue.main.async { self.present(alert, animated: true) } } } task.resume() } func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo { return IndicatorInfo(title: "Requests") } required init?(coder: NSCoder) { super.init(coder: coder) } }
[ -1 ]
48a25e5537e4d9395a3e8379341e1deceff49089
892bddcce726c7c52528c84df5bc3f0923f26d8a
/project-Jedi/project-Jedi/Characters.swift
1a60c5f80f4cbd16c1715a884345d9f29a85bea5
[]
no_license
kendallpoindexter/Project-Jedi
ab1ff9b7c8dc2688262e518841da5f085baefa24
c4058b690d2e87961336fecd03c943ab74892b2e
refs/heads/master
2020-04-02T18:04:20.189828
2019-02-26T22:15:28
2019-02-26T22:15:28
154,685,696
0
0
null
2018-10-29T18:20:32
2018-10-25T14:30:08
Swift
UTF-8
Swift
false
false
261
swift
// // Characters.swift // project-Jedi // // Created by Kendall Poindexter on 10/28/18. // Copyright © 2018 Kendall Poindexter. All rights reserved. // import Foundation class People { var peopleArray: [Person] = [] static var shared = People() }
[ -1 ]
dc35d90a3bc5019a1236e513293a1d988c8b219a
8412afe7a1ea5ae7daa982653f2f06a15c72ef42
/AlamofireBasic/AlamofireBasic/SceneDelegate.swift
8dc0d9622523f797a42fd86c5b3b96003017558f
[]
no_license
Baepeu/SWU-GURU-2021-SUMMER
8b891275666462ec43fc602505296a4f11248551
419f66169e86de4e4104fc9f2694f2669774594d
refs/heads/main
2023-06-16T01:56:36.497838
2021-07-10T16:20:29
2021-07-10T16:20:29
380,536,070
3
0
null
null
null
null
UTF-8
Swift
false
false
2,296
swift
// // SceneDelegate.swift // AlamofireBasic // // Created by 송종근 on 2021/01/10. // 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, 254045, 180322, 376932, 286845, 286851, 417925, 262284, 360598, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 377047, 418008, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 385281, 262405, 180491, 164107, 336140, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 262497, 418145, 262501, 213354, 262508, 246124, 262512, 213374, 385420, 393613, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 360917, 369119, 328180, 328183, 328190, 254463, 328193, 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, 434868, 164535, 164539, 328379, 328387, 352969, 344777, 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, 115661, 386004, 345046, 386012, 386019, 328690, 435188, 328703, 328710, 418822, 328715, 377867, 361490, 386070, 271382, 336922, 345119, 377888, 345134, 345139, 361525, 386102, 361537, 377931, 345172, 189525, 402523, 361568, 148580, 345200, 361591, 386168, 410746, 361594, 214150, 345224, 386187, 345247, 361645, 345268, 402615, 361657, 402636, 328925, 165086, 66783, 165092, 222438, 386286, 328942, 386292, 206084, 345377, 353572, 345380, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337230, 337235, 353634, 337252, 402792, 271731, 378232, 337278, 271746, 181639, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 181687, 370105, 181691, 181697, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 370208, 419360, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 214594, 419401, 419404, 353868, 419408, 214611, 419412, 403040, 345702, 370298, 353920, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 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, 337751, 370520, 247639, 313181, 354143, 354157, 345965, 345968, 345971, 345975, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 346064, 247760, 346069, 419810, 329699, 354275, 190440, 354314, 346140, 436290, 378956, 395340, 436307, 338005, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 379067, 387261, 256193, 395467, 411862, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 387314, 436474, 379135, 411905, 411917, 379154, 395539, 387350, 387353, 338201, 338212, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 321911, 420237, 379279, 354728, 338353, 338382, 272849, 248279, 256474, 182755, 338404, 330225, 248309, 330254, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 338544, 346736, 191093, 346743, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 355029, 264919, 256735, 264942, 363252, 338680, 264965, 338701, 256787, 363294, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 355151, 330581, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 199681, 338951, 330761, 330769, 330775, 248863, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 248905, 330827, 248915, 183384, 339037, 412765, 257121, 265321, 248952, 420985, 347288, 248986, 44199, 380071, 339118, 339133, 126148, 330959, 265433, 265438, 388320, 363757, 388348, 339199, 175376, 175397, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 437576, 437584, 437588, 396634, 175451, 437596, 429408, 175458, 175461, 175464, 265581, 331124, 175478, 175487, 249215, 249219, 175491, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 380364, 339406, 372177, 339414, 413143, 249303, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 208399, 380433, 175637, 405017, 134689, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 224885, 224888, 224891, 224895, 372354, 421509, 126597, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 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, 225128, 257897, 225138, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 372698, 372704, 372707, 356336, 380919, 372739, 405534, 266295, 266298, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 192640, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 225439, 135328, 225442, 438434, 192674, 225445, 225448, 438441, 356521, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 225511, 217319, 225515, 225519, 381177, 397572, 381212, 356638, 356641, 356644, 356647, 266537, 356650, 389417, 356656, 332081, 340276, 356662, 397623, 332091, 225599, 348489, 332107, 151884, 430422, 348503, 250203, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 389507, 348548, 356741, 332175, 160152, 373146, 340380, 373149, 70048, 356783, 324032, 201158, 340452, 127473, 217590, 340473, 324095, 324100, 324103, 324112, 340501, 324118, 324122, 340512, 332325, 324134, 381483, 356908, 324141, 324143, 356917, 324150, 324156, 168509, 348734, 324161, 324165, 356935, 381513, 348745, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 348777, 381546, 340628, 184983, 373399, 258723, 332460, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 340724, 332534, 155647, 373499, 348926, 389927, 348979, 348983, 398141, 357202, 389971, 357208, 389979, 430940, 357212, 357215, 439138, 349041, 340850, 430967, 324473, 398202, 119675, 324476, 430973, 340859, 324479, 340863, 324482, 373635, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 373672, 324525, 111539, 324534, 324539, 324542, 398280, 349129, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 381947, 201724, 431100, 349181, 431107, 349203, 209944, 209948, 357411, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 209996, 431180, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 160896, 349313, 210053, 210056, 349320, 373905, 259217, 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, 349486, 349492, 415034, 210261, 365912, 259423, 374113, 251236, 374118, 390518, 357756, 374161, 112021, 349591, 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, 259789, 366301, 333535, 153311, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333595, 210720, 358192, 366384, 366388, 210740, 358201, 325441, 366403, 325447, 341831, 341839, 341844, 415574, 358235, 350046, 399200, 399208, 358256, 268144, 358260, 325494, 399222, 333690, 325505, 399244, 333709, 333725, 333737, 382891, 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, 252021, 342134, 374904, 333998, 334012, 358645, 268553, 268560, 432406, 325920, 194854, 358701, 391469, 358705, 358714, 358717, 383307, 358738, 383331, 383334, 391531, 383342, 334204, 391564, 366991, 334224, 342431, 375209, 375220, 334263, 326087, 358857, 195041, 334312, 104940, 375279, 416255, 350724, 186898, 342546, 350740, 342551, 342555, 416294, 350762, 252463, 358962, 334397, 358973, 252483, 219719, 399957, 334425, 326240, 334466, 334469, 391813, 162446, 342680, 342685, 260767, 342711, 244410, 260798, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 203508, 375541, 342777, 391938, 391949, 375569, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 375613, 244542, 260925, 375616, 342857, 416599, 342875, 244572, 433001, 400238, 211826, 211832, 392061, 351102, 260993, 252801, 351105, 400260, 211846, 342931, 400279, 252823, 392092, 400286, 252838, 359335, 211885, 252846, 400307, 351169, 359362, 351172, 170950, 359367, 326599, 187335, 359383, 359389, 383968, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 359471, 375868, 343132, 384099, 384102, 367724, 384108, 343155, 384115, 212095, 351366, 384136, 384140, 384144, 384152, 384158, 384161, 351399, 384169, 367795, 244917, 384182, 367801, 384189, 351424, 384192, 343232, 367817, 244938, 384202, 253132, 384209, 146644, 351450, 384225, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 384270, 261391, 359695, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 245042, 326970, 384324, 212296, 212304, 367966, 343394, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 245152, 245155, 155045, 245158, 114093, 327090, 343478, 359867, 384444, 327108, 327112, 384457, 359887, 359891, 368093, 155103, 343535, 343540, 368120, 409092, 253445, 359948, 359951, 245295, 359984, 343610, 400977, 400982, 179803, 155241, 155255, 155274, 368289, 245410, 425652, 425663, 155328, 245463, 155352, 155356, 155364, 245477, 155372, 245487, 212723, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 376672, 155488, 155492, 327532, 261997, 376686, 262000, 262003, 262006, 147319, 425846, 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, 393170, 155604, 155620, 253924, 155622, 327655, 253927, 360432, 393204, 360439, 253944, 393209, 393215 ]
10a9a48a2ce6dca2b3914f1f22be2cc3b5f60e89
98e395cbdc8b75dd37959223f06768319d50dfc8
/ArgonWorx/Blocks/ClosureBlock.swift
5fb40ef452022b42062736645837503d2b37726b
[]
no_license
vincent-coetzee/ArgonWorx
def87b58f7fd1f55829f2f5ec962f41dcd8377d3
b740da72605acdad0e37ac4ca53a8c1df38eab59
refs/heads/main
2023-07-02T14:34:57.673747
2021-08-13T20:52:38
2021-08-13T20:52:38
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,329
swift
// // ClosureBlock.swift // ClosureBlock // // Created by Vincent Coetzee on 4/8/21. // import Foundation public class ClosureBlock: Block { public var parameters = Parameters() public var returnType:Class = VoidClass.voidClass public func addParameter(label:String,type: Class) { let parameter = Parameter(label: label,type: type) self.addLocalSlot(parameter) } public override func dump(depth: Int) { let padding = String(repeating: "\t", count: depth) print("\(padding)CLOSURE") for block in self.blocks { block.dump(depth: depth + 1) } } public override func emitCode(into: InstructionBuffer,using: CodeGenerator) throws { var stackOffset = MemoryLayout<Word>.size for parameter in self.parameters { parameter.stackOffset = stackOffset stackOffset += MemoryLayout<Word>.size } stackOffset = -8 for slot in self.localSlots { slot.stackOffset = stackOffset stackOffset -= MemoryLayout<Word>.size } for block in self.blocks { try block.emitCode(into: into,using: using) } } }
[ -1 ]
7bd76be01980ac9b23edf482e265eb133a05cb45
fb22e0e9b04b3cb98809b34aee5cb11753dad446
/InventoryAppBeta1/Controller/ViewController.swift
b2640944933b48092b8165649c893b2be8a69ff3
[]
no_license
HarshVerma98/InventoryManager
b2da931121903806caeab521bc5927f323be69fc
a1b9eaf05bede9e850c8c6023f24450daed54396
refs/heads/master
2023-01-08T09:12:08.841352
2020-11-02T06:35:52
2020-11-02T06:35:52
289,249,177
0
0
null
null
null
null
UTF-8
Swift
false
false
1,303
swift
// // ViewController.swift // InventoryAppBeta1 // // Created by Harsh Verma on 18/05/20. // Copyright © 2020 Harsh Verma. All rights reserved. // import UIKit import AVKit class ViewController: UIViewController { var videoPlayer: AVPlayer? var layer: AVPlayerLayer? @IBOutlet weak var signUpBtn: UIButton! @IBOutlet weak var loginBtn: UIButton! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } func setup() { } override func viewWillAppear(_ animated: Bool) { setupVideo() } func setupVideo() { let path = Bundle.main.path(forResource: "Dwell", ofType: "mp4") guard path != nil else { return } let url = URL(fileURLWithPath: path!) let i = AVPlayerItem(url: url) videoPlayer = AVPlayer(playerItem: i) layer = AVPlayerLayer(player: videoPlayer!) layer?.frame = CGRect(x: -self.view.frame.size.width*1.5, y: 0, width: self.view.frame.size.width*4, height: self.view.frame.size.height/2) view.layer.insertSublayer(layer!, at: 0) videoPlayer?.playImmediately(atRate: 1.0) } }
[ -1 ]
b7b54d090caa8d27b71ff08624077734f5f8d2c3
3bdf5d38460323c8a317c3fae2beeb3b04dd9297
/06-SpecialLayer/06-SpecialLayer/TransformViewController.swift
e3152ab20148b23d76a89b52cf999a149a069484
[]
no_license
bs-YuSong/iOS-Core-Animation
8c6dd8c4eccd8db509cdb5e6e85e07d0f901fced
8f9b1be100501d101778ba772ae1edf52e006e43
refs/heads/master
2021-05-31T08:22:50.647903
2016-05-17T08:29:58
2016-05-17T08:29:58
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,687
swift
// // TransformViewController.swift // 06-SpecialLayer // // Created by lz on 16/4/23. // Copyright © 2016年 SY. All rights reserved. // import UIKit class TransformViewController: UIViewController { var cube1: CALayer? var cube2: CALayer? override func viewDidLoad() { super.viewDidLoad() var pt = CATransform3DIdentity pt.m34 = -1 / 500 self.view.layer.sublayerTransform = pt var c1t = CATransform3DIdentity c1t = CATransform3DTranslate(c1t, -100, 0, 0) c1t = CATransform3DRotate(c1t, CGFloat(M_PI_4), 1, 1, 0) let cube1 = cubeWithTransform(c1t) self.cube1 = cube1 self.view.layer.addSublayer(cube1) var c2t = CATransform3DIdentity c2t = CATransform3DTranslate(c2t, 100, 100, 0) c2t = CATransform3DRotate(c2t, CGFloat(M_PI), 1, 0, 1) let cube2 = cubeWithTransform(c2t) self.cube2 = cube2 self.view.layer.addSublayer(cube2) } override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) { var c1t = self.cube1!.transform c1t = CATransform3DRotate(c1t, CGFloat(M_PI_4), 1, 1, 0) UIView.animateWithDuration(2.0) { () -> Void in self.cube1?.transform = c1t } var c2t = self.cube2!.transform c2t = CATransform3DRotate(c2t, CGFloat(-M_PI_2), 1, 1, 0) UIView.animateWithDuration(2.0) { () -> Void in self.cube2?.transform = c2t } } func faceWithTransform(transform: CATransform3D) -> CALayer { // 每一个面都是CALayer let face = CALayer.init() face.frame = CGRect(x: -50, y: -50, width: 100, height: 100) let red = CGFloat(rand()) % 255 / 255.0 let green = CGFloat(rand()) % 255 / 255.0 let blue = CGFloat(rand()) % 255 / 255.0 print(red,green,blue,INT_MAX) face.backgroundColor = UIColor.init(red: red, green: green, blue: blue, alpha: 1.0).CGColor face.transform = transform return face } func cubeWithTransform(transform: CATransform3D) -> CALayer { // 用来装“面”的载体是CATransformLayer,CATransformLayer本身并不显示,不过却可以通过控制CATransformLayer的transform来调整立方体的位置 let cube = CATransformLayer.init() var ct = CATransform3DMakeTranslation(0, 0, 50) cube.addSublayer(faceWithTransform(ct)) ct = CATransform3DMakeTranslation(50, 0, 0) ct = CATransform3DRotate(ct, CGFloat(M_PI_2), 0, 1, 0) cube.addSublayer(faceWithTransform(ct)) ct = CATransform3DMakeTranslation(0, -50, 0) ct = CATransform3DRotate(ct, CGFloat(M_PI_2), 1, 0, 0) cube.addSublayer(faceWithTransform(ct)) ct = CATransform3DMakeTranslation(0, 50, 0) ct = CATransform3DRotate(ct, CGFloat(-M_PI_2), 1, 0, 0) cube.addSublayer(faceWithTransform(ct)) ct = CATransform3DMakeTranslation(-50, 0, 0) ct = CATransform3DRotate(ct, CGFloat(-M_PI_2), 0, 1, 0) cube.addSublayer(faceWithTransform(ct)) ct = CATransform3DMakeTranslation(0, 0, -50) ct = CATransform3DRotate(ct, CGFloat(M_PI), 0, 1, 0) cube.addSublayer(faceWithTransform(ct)) let contentSize = self.view.bounds.size cube.position = CGPointMake(contentSize.width * 0.5, contentSize.height * 0.5) cube.transform = transform return cube } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } }
[ -1 ]
8950356fa12d1ed7bdd3bd76bf2cbcc8668af5e2
77d662c39ab4d9ca454cd82dfd43507d271f6cdf
/FaceoffUITests/FaceoffUITests.swift
e505d77cbadfdce0fbaafd2ce4bae34d51ff4ad1
[]
no_license
ray50102/Faceoff
1f12ccc832fb0ec543dcec187238f39463622711
daefeeb30807ba823cbf6419b7eb1c2b1b6cc37e
refs/heads/master
2021-01-24T23:51:56.920318
2015-10-31T07:30:06
2015-10-31T07:30:06
43,577,994
0
0
null
2015-10-31T07:30:06
2015-10-02T21:50:12
Swift
UTF-8
Swift
false
false
1,242
swift
// // BTtestUITests.swift // BTtestUITests // // Created by Shao-Hsuan Liang on 10/18/15. // Copyright © 2015 Liang. All rights reserved. // import XCTest class FaceoffUITests: 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. } }
[ 333827, 243720, 282634, 313356, 155665, 305173, 241695, 237599, 292901, 354342, 315431, 223269, 102441, 354346, 325675, 278571, 229414, 124974, 282671, 102446, 229425, 315433, 243763, 313388, 321589, 180279, 229431, 213051, 288829, 325695, 286787, 288835, 307269, 237638, 313415, 239689, 233548, 315468, 311373, 196687, 278607, 311377, 354386, 280660, 315477, 223317, 323678, 315488, 321632, 45154, 280674, 280676, 315489, 313446, 215144, 227432, 217194, 194667, 233578, 278637, 307306, 319599, 288878, 278642, 284789, 131190, 249976, 288890, 292987, 215165, 131199, 227459, 194692, 280708, 235661, 278669, 241809, 323730, 278676, 311447, 153752, 327834, 284827, 329884, 299166, 278690, 233635, 311459, 215204, 284840, 299176, 184489, 284843, 278698, 278703, 323761, 184498, 278707, 125108, 180409, 280761, 278713, 223418, 227517, 299197, 280767, 295099, 299202, 139459, 309443, 176325, 131270, 227525, 301255, 280779, 233678, 282832, 321744, 227536, 301270, 301271, 229591, 280792, 356575, 311520, 325857, 280803, 182503, 338151, 307431, 319719, 295147, 317676, 286957, 125166, 125170, 313595, 184574, 125184, 309504, 125192, 125200, 194832, 227601, 325904, 125204, 319764, 278805, 334104, 315674, 282908, 311582, 125215, 299294, 282912, 233761, 278817, 211239, 282920, 125225, 317738, 325930, 311596, 315698, 98611, 125236, 307514, 278843, 282938, 168251, 287040, 319812, 311622, 227655, 280903, 319816, 323914, 201037, 282959, 229716, 289109, 168280, 379224, 323934, 239973, 285031, 416103, 313703, 280938, 242027, 242028, 321901, 278895, 354672, 287089, 227702, 199030, 315769, 291193, 139641, 248188, 223611, 313726, 211327, 291200, 311679, 158087, 313736, 227721, 285074, 240020, 190870, 315798, 190872, 291225, 285083, 293275, 317851, 242079, 227743, 285089, 289185, 283039, 293281, 156069, 300490, 305572, 301482, 289195, 311723, 377265, 338359, 299449, 311739, 319931, 293309, 278974, 311744, 317889, 291266, 278979, 278988, 289229, 281038, 326093, 278992, 283089, 373196, 281039, 283088, 279000, 242138, 176602, 285152, 369121, 279009, 160224, 195044, 291297, 279014, 302539, 319976, 279017, 311787, 281071, 319986, 236020, 279030, 311800, 279033, 279042, 283138, 233987, 287237, 377352, 342537, 309770, 279053, 283154, 303635, 303634, 279061, 279060, 182802, 188954, 279066, 291359, 227881, 293420, 289328, 283185, 236080, 279092, 23093, 234037, 244279, 244280, 338491, 234044, 301635, 309831, 55880, 322119, 377419, 281165, 303693, 301647, 281170, 309847, 189016, 287319, 115287, 111197, 295518, 287327, 242274, 244326, 277095, 279143, 279150, 281200, 287345, 287348, 301688, 189054, 287359, 291455, 297600, 303743, 301702, 164487, 279176, 311944, 334473, 316044, 311948, 184974, 311950, 316048, 311953, 336531, 287379, 227991, 295575, 289435, 303772, 221853, 205469, 285348, 314020, 279207, 295591, 248494, 318127, 293552, 285360, 285362, 299698, 287412, 166581, 295598, 154295, 342705, 279218, 287418, 314043, 303802, 66243, 291529, 287434, 225996, 363212, 287438, 242385, 279249, 303826, 279253, 158424, 230105, 299737, 322269, 342757, 295653, 289511, 230120, 234216, 330473, 285419, 330476, 289517, 312046, 170735, 279278, 125683, 230133, 199415, 234233, 242428, 279293, 205566, 322302, 299777, 228099, 285443, 295688, 346889, 285450, 322312, 285457, 295698, 166677, 291605, 283418, 285467, 221980, 234276, 283431, 262952, 262953, 279337, 318247, 318251, 262957, 293673, 164655, 328495, 289580, 301872, 242481, 234290, 303921, 230198, 285493, 285496, 301883, 201534, 281407, 289599, 222017, 295745, 293702, 318279, 283466, 281426, 279379, 295769, 201562, 234330, 281434, 322396, 230238, 275294, 301919, 230239, 279393, 293729, 349025, 303973, 279398, 281444, 177002, 308075, 242542, 310132, 295797, 201590, 207735, 228214, 177018, 269179, 279418, 308093, 314240, 291713, 158594, 330627, 240517, 287623, 228232, 416649, 279434, 236427, 320394, 299912, 234382, 189327, 308111, 308113, 316299, 293780, 310166, 289691, 209820, 240543, 283551, 310177, 289699, 189349, 289704, 279465, 293801, 304050, 177074, 289720, 289723, 189373, 213956, 281541, 345030, 19398, 213961, 326602, 279499, 56270, 191445, 183254, 304086, 142309, 234469, 340967, 314343, 304104, 324587, 183276, 289773, 203758, 320492, 234476, 320495, 287730, 240631, 320504, 312313, 214009, 312317, 234499, 293894, 320520, 230411, 322571, 320526, 330766, 234513, 238611, 140311, 293911, 238617, 316441, 197658, 330789, 248871, 113710, 189487, 281647, 322609, 312372, 203829, 238646, 300087, 238650, 320571, 21567, 308288, 336962, 160834, 314437, 349254, 238663, 300109, 207954, 234578, 205911, 296023, 314458, 234588, 281698, 281699, 230500, 285795, 322664, 228457, 279659, 318571, 234606, 300145, 238706, 279666, 300147, 312435, 230514, 187508, 302202, 285819, 314493, 285823, 150656, 234626, 279686, 222344, 285833, 318602, 285834, 234635, 228492, 337037, 177297, 162962, 187539, 308375, 285850, 296091, 119965, 234655, 330912, 302239, 300192, 306339, 339106, 234662, 300200, 249003, 208044, 238764, 302251, 3243, 322733, 294069, 300215, 294075, 339131, 228541, 64699, 283841, 148674, 283846, 312519, 279752, 283849, 148687, 290001, 189651, 316628, 279766, 189656, 279775, 304352, 298209, 304353, 310496, 279780, 228587, 279789, 290030, 302319, 251124, 234741, 316661, 283894, 279803, 292092, 208123, 228608, 320769, 234756, 322826, 242955, 312588, 318732, 126229, 245018, 320795, 318746, 320802, 304422, 130342, 130344, 298290, 345398, 300342, 159033, 222523, 286012, 181568, 279872, 279874, 300355, 300354, 193858, 372039, 304457, 345418, 230730, 296269, 234830, 224591, 222542, 238928, 296274, 314708, 318804, 283990, 314711, 357720, 300378, 300379, 316764, 294236, 314721, 292194, 230757, 281958, 314727, 134504, 306541, 314734, 284015, 234864, 296304, 316786, 312688, 314740, 230772, 314742, 327030, 327023, 314745, 290170, 310650, 224637, 306558, 290176, 243073, 179586, 306561, 294278, 314759, 296328, 296330, 298378, 368012, 318860, 314765, 279955, 306580, 234902, 224662, 282008, 314776, 318876, 282013, 290206, 148899, 314788, 314790, 282023, 333224, 298406, 241067, 279980, 314797, 279979, 286128, 173492, 279988, 286133, 284090, 310714, 228796, 54719, 415170, 292291, 228804, 310725, 306630, 280003, 300488, 302530, 370122, 339403, 310731, 306634, 234957, 310735, 280011, 312785, 327122, 222674, 280020, 280025, 310747, 239069, 144862, 286176, 320997, 310758, 187877, 280042, 280043, 191980, 300526, 337391, 282097, 308722, 296434, 306678, 40439, 191991, 288248, 286201, 300539, 288252, 312830, 290304, 228868, 292359, 218632, 323079, 230922, 302602, 323083, 294413, 329231, 304655, 282132, 230933, 302613, 282135, 316951, 374297, 302620, 313338, 282147, 306730, 312879, 230960, 288305, 239159, 290359, 323132, 157246, 288319, 130622, 288322, 280131, 349764, 310853, 124486, 282182, 288328, 286281, 292426, 194118, 224848, 224852, 230999, 196184, 239192, 306777, 290391, 128600, 235096, 212574, 99937, 204386, 323171, 345697, 300643, 282214, 300645, 204394, 224874, 243306, 312941, 206447, 310896, 294517, 314997, 288377, 290425, 325246, 235136, 280193, 282244, 239238, 288391, 323208, 282248, 286344, 179853, 286351, 188049, 239251, 229011, 279215, 280217, 323226, 179868, 229021, 302751, 282272, 198304, 245413, 282279, 298664, 212649, 298666, 317102, 286387, 300725, 337590, 286392, 302778, 306875, 280252, 280253, 282302, 296636, 286400, 323265, 321217, 280259, 333508, 282309, 296649, 239305, 306891, 280266, 212684, 302798, 9935, 241360, 282321, 333522, 286419, 313042, 241366, 280279, 278232, 282330, 18139, 280285, 278237, 294621, 282336, 325345, 321250, 278241, 294629, 153318, 333543, 12009, 282347, 288492, 282349, 323315, 67316, 34547, 284410, 288508, 200444, 282366, 286463, 319232, 288515, 280326, 282375, 323335, 284425, 300810, 116491, 282379, 280333, 284430, 216844, 300812, 161553, 124691, 284436, 278292, 278294, 282390, 116502, 118549, 325403, 321308, 321309, 282399, 241440, 282401, 325411, 186148, 186149, 315172, 241447, 294699, 286507, 284460, 280367, 300849, 282418, 280373, 282424, 280377, 321338, 282428, 280381, 345918, 241471, 413500, 280386, 325444, 280391, 325449, 315209, 159563, 280396, 307024, 337746, 317268, 325460, 307030, 237397, 18263, 241494, 188250, 284508, 300893, 307038, 237411, 284515, 276326, 282471, 296807, 292713, 282476, 292719, 296815, 313204, 317305, 124795, 182145, 315265, 280451, 325508, 333700, 243590, 282503, 67464, 315272, 243592, 305032, 315275, 184207, 311183, 282517, 294806, 214936, 337816, 294808, 329627, 239515, 214943, 298912, 319393, 294820, 219046, 333734, 294824, 298921, 284584, 313257, 292783, 126896, 300983, 343993, 288698, 98240, 294849, 214978, 280517, 280518, 214983, 282572, 282573, 153553, 24531, 231382, 329696, 323554, 292835, 190437, 292838, 294887, 317416, 313322, 278507, 329707, 311277, 296942, 298987, 124912, 327666, 278515, 325620, 239610 ]
9082247ef97c27c9f124078baa9dc9addf08df04
20bf0f7a98b785415083dd0dddc10a46fe8873b6
/DoIt/task.swift
ad07fc5363bf42fb46c51cc2389eba9380dbe188
[]
no_license
yoyotueur/DoIt
885fa81827254865a8465d59bc2d430e9cc7bca3
c587c730b1fc3e23140d45306e35ee769f5ba508
refs/heads/master
2020-06-14T21:52:48.732231
2016-12-03T10:26:15
2016-12-03T10:26:15
75,405,975
0
0
null
null
null
null
UTF-8
Swift
false
false
204
swift
// // task.swift // DoIt // // Created by Johan Bertin on 02/12/2016. // Copyright © 2016 yoyo. All rights reserved. // import Foundation class Task { var name = "" var important = false }
[ 314356 ]
4e1e5697ce98d7d532701acaf2854413e410d31b
8bbfc77e07252dc95da1d7388fe82b2d9ad2f239
/CognizantTask/Cells/RowTableViewCell.swift
8bbc41af39932a91e73e372ae7fb49023b478c33
[]
no_license
barathkandra/CognizantTask
d006e6e999730e1ec00257aa5a72d357a0f43305
632a24b817d0bee782625485a94aa555be69ffe7
refs/heads/master
2022-11-11T16:30:16.891616
2020-06-20T13:06:29
2020-06-20T13:06:29
273,701,497
0
0
null
null
null
null
UTF-8
Swift
false
false
3,797
swift
// // RowTableViewCell.swift // CognizantTask // // Created by Barath on 20/06/20. // Copyright © 2020 Barath. All rights reserved. // import Foundation import UIKit import Kingfisher class RowTableViewCell: UITableViewCell{ private let placeholder = "placeholder" private let stackViewSpacing: CGFloat = 10.0 var item : Row? { didSet { rowTitleLabel.text = item?.title rowDescriptionLabel.text = item?.rowDescription if let imageUrl = URL(string: item?.imageHref ?? ""){ rowImageView.kf.indicatorType = .activity rowImageView.kf.setImage( with: imageUrl, placeholder: UIImage(named: placeholder), options: [ .scaleFactor(UIScreen.main.scale), .transition(.fade(1)), .cacheOriginalImage ]) }else{ rowImageView.image = UIImage(named: placeholder) } } } private let rowTitleLabel: UILabel = { let label = UILabel() label.textColor = .darkText label.font = UIFont(name: "HelveticaNeue", size: 19.0) label.textAlignment = .left return label }() private let rowDescriptionLabel: UILabel = { let label = UILabel() label.textColor = .darkText label.font = UIFont(name: "HelveticaNeue", size: 15.0) label.textAlignment = .left label.numberOfLines = 0 return label }() private let rowImageView: UIImageView = { let imageView = UIImageView() imageView.image = UIImage(named: "placeholder") imageView.contentMode = .scaleAspectFill imageView.clipsToBounds = true imageView.layer.masksToBounds = true imageView.layer.cornerRadius = 5.0 imageView.backgroundColor = UIColor.init(red: 200/255.0, green: 200/255.0, blue: 200/255.0, alpha: 1.0) return imageView }() override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) self.accessoryType = .disclosureIndicator self.selectionStyle = .none rowImageView.translatesAutoresizingMaskIntoConstraints = false rowImageView.widthAnchor.constraint(equalToConstant: 90).isActive = true rowImageView.heightAnchor.constraint(equalToConstant: 90).isActive = true let stackView = UIStackView(arrangedSubviews: [rowTitleLabel, rowDescriptionLabel]) stackView.distribution = .fill stackView.alignment = .top stackView.axis = .vertical stackView.spacing = 10 let horizantalStackView = UIStackView(arrangedSubviews: [rowImageView, stackView]) horizantalStackView.alignment = .top horizantalStackView.distribution = .fill horizantalStackView.axis = .horizontal horizantalStackView.spacing = 10 contentView.addSubview(horizantalStackView) horizantalStackView.translatesAutoresizingMaskIntoConstraints = false horizantalStackView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 10).isActive = true horizantalStackView.leftAnchor.constraint(equalTo: contentView.leftAnchor, constant: 10).isActive = true horizantalStackView.rightAnchor.constraint(equalTo: contentView.rightAnchor, constant: -10).isActive = true horizantalStackView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -10).isActive = true } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } }
[ -1 ]
c6847aade1881edc1c0d426f6b3422fed9ce7ee2
d1507014659cd802b90c9594107b0400a9b15077
/Anagrammar/GameScreenViewController.swift
8d25699db3a8d0c78f7b28b61576f75de750aee7
[]
no_license
vishvajit79/Anagrammar
d33ffe4d62e8d2e151ea996173c9c04077df6823
626e4dead9a4c107be8bd1321027b816f6c34e38
refs/heads/master
2020-03-15T08:53:47.091483
2018-05-03T23:58:21
2018-05-03T23:58:21
132,061,673
0
0
null
null
null
null
UTF-8
Swift
false
false
4,698
swift
// // GameScreenViewController.swift // Anagrammar // // Created by John Smith on 2018-02-24. // Copyright © 2018 VK. All rights reserved. // import UIKit class GameScreenViewController: UIViewController { @IBOutlet weak var scoreLbl: UILabel! @IBOutlet weak var questionLbl: UILabel! @IBOutlet weak var answerTxt: UITextField! @IBOutlet weak var resultLbl: UILabel! @IBOutlet weak var checkNextBtn: UIButton! @IBOutlet weak var revealAnswerBtn: UIButton! var anagram: [String: String] = [ "R I S F T": "FIRST", "D E S C O N": "SECOND", "H R I T D": "THIRD", "R O U F T H": "FOURTH", "R R A M M A G": "GRAMMAR" ] var counter: Int = 0 var answer: String = "" var score: Int = 0 var highScore: Int = UserDefaults.standard.integer(forKey: "highscore") @IBAction func checkNextBtn(_ sender: UIButton) { if resultLbl.text == "Penalty"{ if answerTxt.text == self.answer{ resultLbl.text = "Correct" resultLbl.textColor = UIColor.green sender.setTitle("Next", for: .normal) scoreLbl.text = "Score: \(self.score)" } changeHighScore() } if sender.titleLabel?.text == "Check Answer"{ if answerTxt.text == self.answer{ resultLbl.text = "Correct" resultLbl.textColor = UIColor.green self.score = self.score + 10 scoreLbl.text = "Score: \(self.score)" changeHighScore() if self.counter < self.anagram.count{ sender.setTitle("Next", for: .normal) } else{ resultLbl.text = "You're an expert" resultLbl.textColor = UIColor.gray sender.setTitle("Start Over", for: .normal) } } else{ resultLbl.text = "Incorrect" resultLbl.textColor = UIColor.red self.score = self.score - 5 scoreLbl.text = "Score: \(self.score)" changeHighScore() } } else if sender.titleLabel?.text == "Start Over"{ self.counter = 0 sender.setTitle("Check Answer", for: .normal) self.nextQuestion() } else{ sender.setTitle("Check Answer", for: .normal) resultLbl.text = "Result" resultLbl.textColor = UIColor.white answerTxt.text = "" self.nextQuestion() } } @IBAction func revealAnswerBtn(_ sender: UIButton) { reveal() } func changeHighScore(){ if self.highScore < self.score{ self.highScore = self.score UserDefaults.standard.set(self.highScore, forKey: "highscore") } } func reveal(){ answerTxt.text = self.answer self.score = self.score - 10 resultLbl.text = "Penalty" checkNextBtn.setTitle("Next", for: .normal) resultLbl.textColor = UIColor.red scoreLbl.text = "Score: \(self.score)" } func nextQuestion(){ changeHighScore() if self.counter < self.anagram.count{ answerTxt.text = "" questionLbl.text = Array(self.anagram.keys)[counter] self.answer = Array(self.anagram.values)[counter] self.counter = self.counter + 1 changeHighScore() } else{ answerTxt.text = "" checkNextBtn.setTitle("Start Over", for: .normal) changeHighScore() } } override func viewDidLoad() { super.viewDidLoad() self.nextQuestion() answerTxt.layer.borderWidth = 1 // 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 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 == "save"{ var DestViewController: SaveHighScoreViewController = segue.destination as! SaveHighScoreViewController DestViewController.userScore = self.score } } }
[ -1 ]
dded9d4a1a3f17756a509058d57a184c46d905d3
bee5596f47d577c11a0621ea8611bf3260e7c6ec
/Reddit Client/View/PostCell.swift
56d4c80d7e04e0166a251b729b6bf3eb50fce290
[]
no_license
ZheniaG04/Reddit-Client
25687e6f1a0feee9159ce09cfd41ad1d5f2d8737
406540ba63bf020d3171cbabee5e5889bb7a1ec6
refs/heads/main
2023-05-06T05:26:22.041451
2021-05-31T19:22:12
2021-05-31T19:22:12
372,093,030
0
0
null
null
null
null
UTF-8
Swift
false
false
1,804
swift
// // PostCellView.swift // Reddit Client // // Created by Женя on 25.05.2021. // import SwiftUI struct PostCell: View { let postVM: PostViewModel var body: some View { HStack { Image(uiImage: postVM.image) .resizable() .scaledToFit() .frame(width: 100, height: 100) .cornerRadius(15) VStack(alignment: .leading, spacing: 5) { Text(postVM.title) .font(.headline) .lineLimit(2) .minimumScaleFactor(0.5) Text(postVM.author) .font(.subheadline) .foregroundColor(.secondary) HStack(spacing: 5) { Text(postVM.comments) .font(.footnote) .foregroundColor(.secondary) Image("comments") .resizable() .scaledToFit() .frame(width: 10, height: 10) } Text(postVM.creationTime) .font(.footnote) .foregroundColor(.secondary) } } .onAppear { // showed posts are saved to local storage postVM.savePostLocally() } } } struct PostCell_Previews : PreviewProvider { static var previews: some View { PostCell(postVM: PostViewModel(post: Post(id: "", name: "", title: "new post new post ", author: "author name", url: "", thumbnail: "", postHint: "", comments: 100, createdUTC: 1622233742.0, image: UIImage(named: "no-image")))) .previewLayout(.sizeThatFits) } }
[ -1 ]
a8e2a735971e71848e934d0390d5904ab0aca210
605018f7954b94728333680a93bee813d426959d
/QuerosermbChallenge/QuerosermbChallenge/Application/ExchangesList/Cell/ExchangeTableViewCell.swift
74604af2b71c67e1eb36d27ae6e84af0ffa167a9
[]
no_license
lazaro10/criptomoedas
901f9b0f6b5c2cc560505f64fc47a566b205b327
8f8b3945eb8b951c9b4d980a5cb39f289fa44fc8
refs/heads/master
2022-11-25T06:49:57.070317
2020-07-25T21:45:43
2020-07-25T21:45:43
282,528,606
1
0
null
null
null
null
UTF-8
Swift
false
false
3,110
swift
// // ExchangeTableViewCell.swift // QuerosermbChallenge // // Created by Lazaro on 14/07/20. // Copyright © 2020 LimasCompany. All rights reserved. // import UIKit import Kingfisher final class ExchangeTableViewCell: UITableViewCell, Reusable { private let iconImageView = UIImageView() private let nameLabel: UILabel = { let label = UILabel() label.font = UIFont.boldSystemFont(ofSize: 22) return label }() private let identifierLabel: UILabel = { let label = UILabel() label.font = UIFont.systemFont(ofSize: 12) label.textColor = .orange label.textAlignment = .right return label }() private lazy var stackView: UIStackView = { let stackView = UIStackView(arrangedSubviews: [iconImageView, nameLabel, identifierLabel]) stackView.spacing = 16 return stackView }() private lazy var extrasStackView: UIStackView = { let stackView = UIStackView(arrangedSubviews: []) stackView.distribution = .fillEqually stackView.axis = .vertical stackView.spacing = 8 return stackView }() func bind(viewModel: ExchangeViewModel) { iconImageView.kf.setImage(with: viewModel.icon) nameLabel.text = viewModel.name identifierLabel.text = viewModel.exchangeId extrasStackView.removeAllArrangedSubviews() viewModel.extras.forEach { extrasStackView.addArrangedSubview(ExchangeExtraView(title: $0.0, date: $0.1)) } } // MARK: Initializer override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) setupView() setupLayout() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } // MARK: Private functions private func setupView() { accessibilityLabel = R.string.accessibilityLabels.exchangeCell() } private func setupLayout() { addSubview(iconImageView, constraints: [ iconImageView.heightAnchor.constraint(equalToConstant: 24), iconImageView.widthAnchor.constraint(equalToConstant: 24) ]) addSubview(stackView, constraints: [ stackView.topAnchor.constraint(equalTo: topAnchor, constant: 16), stackView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16), stackView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -16) ]) addSubview(extrasStackView, constraints: [ extrasStackView.topAnchor.constraint(equalTo: stackView.bottomAnchor, constant: 16), extrasStackView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16), extrasStackView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -16), extrasStackView.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -16) ]) } }
[ -1 ]
7bbdc7a482353805d3855646fd16107d688181fb
46ebeab72ce904c128820c86bdcb3b6f21b8a7eb
/rssNasa/ListRss/ListRssInterfaces.swift
31ed18601b3011d9c60e6396cb70ab1c00c89dc9
[]
no_license
DenisCev/rssNasa
8f3b50f23a6c58fdb911180b7a15ec8f4e64021c
34a972bf385af4dd9f689a0bd001fa35abec48a9
refs/heads/master
2020-04-08T12:45:55.643238
2018-11-29T17:53:57
2018-11-29T17:53:57
159,358,946
0
0
null
null
null
null
UTF-8
Swift
false
false
890
swift
// // ListRssInterfaces.swift // rssNasa // // Created by Pablo Vélez on 27/11/2018. // Copyright (c) 2018 Denis. All rights reserved. // // This file was generated by the 🐍 VIPER generator // import UIKit import Alamofire enum ListRssNavigationOption { } protocol ListRssWireframeInterface: WireframeInterface { func navigate(to option: ListRssNavigationOption) } protocol ListRssViewInterface: ViewInterface { func reloadData() } protocol ListRssPresenterInterface: PresenterInterface { func startFetchData() func numberOfSections() -> Int func numberOfItems(in section: Int) -> Int func item(at indexPath: IndexPath) -> Item func didSelectItem(at indexPath: IndexPath) } protocol ListRssInteractorInterface: InteractorInterface { @discardableResult func getListRSS(_ completion: @escaping ListRSSCompletionBlock) -> DataRequest }
[ -1 ]
6f4a87a09ddcab141e97f21216b205593b5bab6f
3ef132bf05ed773256f95b380b4b038832a4bd8d
/ViperApp/Modules/Root/RootRouter.swift
a78f9db382fa725c2bd23dfc402b806186177e36
[]
no_license
no4aTuk/ViperApp
c3ccad102004ea6cbb31f4217d1578e6f0aa5e10
26bdc9a13a332d51d672a7acd061de91861631eb
refs/heads/master
2020-03-21T01:08:26.538060
2018-06-22T13:53:31
2018-06-22T13:53:31
137,926,298
0
0
null
null
null
null
UTF-8
Swift
false
false
549
swift
// // RootRouter.swift // ViperApp // // Created by it's muffin time on 19/06/2018. // Copyright © 2018 it's muffin time. All rights reserved. // import Foundation import UIKit class RootRouter: RootRouterProtocol { func presentHomeTabBarViewController(in window: UIWindow) { window.makeKeyAndVisible() let routers: [HomeTabBarItemRouterProtocol] = [ProductsPagerRouter(), SettingsRouter(), ProfileRouter()] let homeRouter = HomeRouter(childRouters: routers) window.rootViewController = homeRouter.configureModule() } }
[ -1 ]
9a72763cf5b62c8ea160441e2dc9c967b237f762
ea593e22bdba121beffe52fc23aabe9f349e9811
/Restructure/Restructure/AppDelegate.swift
667a892d5f5f6bfe83ee549ac20f139544a0dd8e
[]
no_license
joshb7100/CDM290
aa7db1af08246fd1f15f7baffd7924aac1c936e3
96cf297dfe9ee82b83cf631dc04d0725910930cc
refs/heads/master
2021-01-11T19:46:52.191658
2017-05-08T06:20:30
2017-05-08T06:20:30
79,390,043
0
0
null
null
null
null
UTF-8
Swift
false
false
2,179
swift
// // AppDelegate.swift // Restructure // // Created by Robert Barrett on 2/13/17. // Copyright © 2017 Josh Barrett. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 229426, 237618, 229428, 311349, 286774, 229432, 286776, 286778, 319544, 204856, 352318, 286791, 237640, 278605, 286797, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 327814, 131209, 303241, 417930, 311436, 303244, 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, 262448, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 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, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 319978, 279020, 172526, 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, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 172655, 172656, 189039, 295538, 189040, 172660, 189044, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 303773, 230045, 172702, 287390, 287394, 172705, 303780, 172707, 287398, 205479, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 279231, 287427, 312005, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 312035, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 213895, 320391, 304007, 304009, 304011, 230284, 304013, 279438, 189325, 295822, 189329, 213902, 304019, 295825, 189331, 58262, 304023, 279452, 234648, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 295949, 230413, 197645, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 279750, 312518, 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, 230679, 320792, 230681, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 230718, 296259, 378181, 296262, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 148843, 230768, 296305, 312692, 230773, 279929, 304506, 181626, 304505, 181631, 148865, 312711, 312712, 296331, 288140, 230800, 288144, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 173488, 279985, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 222676, 148946, 288214, 239064, 288217, 329177, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 402942, 296446, 148990, 321022, 296450, 206336, 230916, 230919, 214535, 304651, 370187, 304653, 230923, 402969, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 370279, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 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, 280388, 337732, 304968, 280393, 280402, 173907, 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, 10170, 296890, 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, 321560, 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, 280671, 149599, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 313458, 280691, 215154, 149618, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 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, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 215387, 354653, 354656, 313700, 280937, 313705, 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, 436684, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 330244, 240132, 281095, 338440, 150025, 223752, 223749, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 281210, 297594, 158347, 264845, 182926, 133776, 182929, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 240519, 322440, 314249, 338823, 183184, 142226, 289687, 224151, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 420829, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 298365, 290174, 306555, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 314773, 306581, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282255, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 196133, 282295, 282300, 323260, 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, 307009, 413506, 241475, 307012, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 217179, 315483, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 307510, 332086, 307512, 168245, 307515, 282942, 307518, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 276052, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 176592, 315856, 127440, 315860, 176597, 127447, 283095, 299481, 127449, 176605, 242143, 127455, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 135672, 127480, 233979, 291323, 127485, 291330, 127490, 283142, 127494, 127497, 233994, 135689, 127500, 291341, 233998, 127506, 234003, 127509, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 135844, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 185074, 226037, 283382, 316151, 234231, 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, 291711, 234368, 234370, 201603, 291714, 234373, 226182, 234375, 291716, 226185, 308105, 234379, 324490, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 234396, 291742, 226200, 234398, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 291754, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 234434, 324548, 226245, 234437, 234439, 226239, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 234563, 308291, 160835, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 275579, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 324757, 308379, 234653, 324766, 119967, 300189, 324768, 283805, 234657, 242852, 234661, 283813, 300197, 234664, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 226500, 234692, 300229, 308420, 283844, 308422, 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, 300289, 292097, 161027, 300292, 300294, 275719, 177419, 300299, 283917, 300301, 349451, 177424, 242957, 275725, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 226802, 292338, 316917, 308727, 292343, 300537, 316933, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194101, 284215, 316983, 194103, 284218, 226877, 292414, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 276053, 284247, 317015, 284249, 243290, 284251, 235097, 284253, 300638, 284255, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 325251, 276095, 276098, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 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, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 325408, 300832, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 292681, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 284564, 358292, 399252, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 350186, 292843, 276460, 292845, 276464, 178161, 227314, 276466, 350200, 325624, 276472, 317435, 276476, 276479, 276482, 350210, 276485, 317446, 178181, 276490, 350218, 292876, 350222, 276496, 317456, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 178224, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 243779, 284739, 292934, 243785, 276553, 350293, 350295, 194649, 227418, 309337, 350299, 350302, 227423, 194654, 178273, 194657, 227426, 194660, 276579, 227430, 276583, 309346, 309348, 309350, 309352, 309354, 350308, 276590, 350313, 350316, 350321, 284786, 276595, 301167, 350325, 227440, 350328, 292985, 301178, 350332, 292989, 292993, 301185, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 227571, 309491, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 129486, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 293370, 301562, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 317971, 309779, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 334488, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 293555, 277173, 318132, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 56045, 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, 285499, 301884, 310080, 293696, 277317, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 15224, 236408, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 351217, 318450, 293876, 293877, 285686, 302073, 285690, 121850, 293882, 244731, 302075, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 392326, 285831, 253064, 302218, 285835, 294026, 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, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 384302, 285999, 277804, 113969, 277807, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 294211, 302403, 384328, 277832, 277836, 146765, 294221, 326991, 294223, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 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, 64966, 245191, 163272, 310727, 302534, 277959, 292968, 302541, 277963, 302543, 277966, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 187936, 146977, 286240, 187939, 40484, 294435, 286246, 40486, 245288, 278057, 40488, 294439, 294440, 40491, 294443, 310831, 294445, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 228944, 400976, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286313, 40554, 286312, 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, 278227, 286420, 319187, 229076, 286425, 319194, 278235, 301163, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 280021, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 319390, 294817, 319394, 40865, 294821, 311209, 180142, 294831, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
7dbe5f063d2010f2408c478dd229c1456f141b1e
8576a6a671db764d8bce463469153b835db07c0e
/DouYuAPP/DouYuAPP/Classes/Main/Controller/Yo_BaseViewController.swift
dc119a9a481bc4b5340eed139142afe610fc3a94
[ "Apache-2.0" ]
permissive
oleyang2017/DouYu
2d79039755c6a12209d512b5b258400fe9be4a6e
b4e65fb32d67b934984cdd94e352477f5f67901f
refs/heads/master
2021-06-16T14:56:07.217967
2017-05-04T07:35:15
2017-05-04T07:35:15
null
0
0
null
null
null
null
UTF-8
Swift
false
false
320
swift
// // Yo_BaseViewController.swift // DouYuAPP // // Created by shying li on 2017/3/28. // Copyright © 2017年 李世洋. All rights reserved. // import UIKit class Yo_BaseViewController: GenericViewController<Yo_BaseContentView> { override func viewDidLoad() { super.viewDidLoad() } }
[ -1 ]
f5cb2648311ad873b3e278fb05b6d2dc027e2577
097d1d5c982c54a788d5df39c39c6b23e5f13bf0
/ios/Classes/API/ALGAPI/Main/Interceptor/ALGAPIInterceptor.swift
df138d0dc647cf1ad5b0b98ee0afbd10790bd6bb
[ "Apache-2.0" ]
permissive
perawallet/pera-wallet
d12435020ded4705b4a7929ab2611b29dd85810e
115f85f2d897817276eca9090933f6b0c020f1ab
refs/heads/master
2023-08-16T21:27:27.885005
2023-08-15T21:38:03
2023-08-15T21:38:03
364,359,642
67
26
NOASSERTION
2023-06-02T16:51:55
2021-05-04T19:08:11
Swift
UTF-8
Swift
false
false
4,222
swift
// Copyright 2022 Pera Wallet, LDA // 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. // // ALGAPIInterceptor.swift import Foundation import MagpieCore import MacaroonUtils import MagpieHipo final class ALGAPIInterceptor: APIInterceptor { private let sharedHeaders: Headers = [AcceptJSONHeader(), AcceptGZIPEncodingHeader(), ContentTypeJSONHeader()] private lazy var apiBase = ALGAPIBase() private lazy var application = HIPApplication() private lazy var device = HIPDevice() func intercept(_ endpoint: EndpointOperatable) { setCommonHeaders(endpoint) setAdditionalHeaders(endpoint) } func intercept(_ response: Response, for endpoint: EndpointOperatable) -> Bool { return false } } extension ALGAPIInterceptor { private func setCommonHeaders(_ endpoint: EndpointOperatable) { endpoint.setAdditionalHeader(AcceptGZIPEncodingHeader()) let rawPath = endpoint.request.path.decoded() let apiPath = ALGAPIPath(rawValue: rawPath) switch apiPath { case .none: break case .exportTransactions: break default: endpoint.setAdditionalHeader(AcceptJSONHeader()) endpoint.setAdditionalHeader(ContentTypeJSONHeader()) } } private func setAdditionalHeaders(_ endpoint: EndpointOperatable) { guard let base = ALGAPIBase.Base(endpoint.request.base, network: apiBase.network) else { return } switch base { case .algod: setAlgodHeaders(endpoint) case .indexer: setIndexerHeaders(endpoint) case .mobileV1: setMobileHeaders(endpoint) case .mobileV2: setMobileHeaders(endpoint) case .algoExplorer: break } } private func setAlgodHeaders(_ endpoint: EndpointOperatable) { if let token = apiBase.algodToken { endpoint.setAdditionalHeader(CustomHeader(key: "X-Algo-API-Token", value: token), policy: .alwaysOverride) } } private func setIndexerHeaders(_ endpoint: EndpointOperatable) { if let token = apiBase.indexerToken { endpoint.setAdditionalHeader(CustomHeader(key: "X-Indexer-API-Token", value: token), policy: .alwaysOverride) } } private func setMobileHeaders(_ endpoint: EndpointOperatable) { endpoint.setAdditionalHeader(APIKeyHeader()) endpoint.setAdditionalHeader(AppNameHeader(application), policy: .alwaysOverride) endpoint.setAdditionalHeader(AppPackageNameHeader(application), policy: .alwaysOverride) endpoint.setAdditionalHeader(AppVersionHeader(application), policy: .alwaysOverride) endpoint.setAdditionalHeader(ClientTypeHeader(device), policy: .alwaysOverride) endpoint.setAdditionalHeader(DeviceOSVersionHeader(device), policy: .alwaysOverride) endpoint.setAdditionalHeader(DeviceModelHeader(device), policy: .alwaysOverride) } } extension ALGAPIInterceptor { /// <todo> /// NOP! var network: ALGAPI.Network { return apiBase.network } var isTestNet: Bool { return network == .testnet } func setupNetworkBase(_ network: ALGAPI.Network) -> String { return apiBase.setupNetworkBase(network) } } struct APIKeyHeader: Header { let key: String let value: String? init() { self.key = "X-API-Key" self.value = Environment.current.apiKey } } struct ModificationHeader: Header { let key: String let value: String? init( _ modificationKey: String ) { self.key = "X-Modification-Key" self.value = modificationKey } }
[ -1 ]
430367c559062c1e36b7ea8bcb6622c21e084072
3afdd55657aa49bd97b424e942df57f57a45ddd9
/Resource/Services/Network/Base/NetworkLayer.swift
3174821d08fac3c5ca7b77aa6b9b8e20438f00b0
[]
no_license
bluesky375/unibuzz-ios
1039709c4a9cd229d27137ccacfb6210b794002c
39802ea7c4a8e132ea4f7cc17de984fc2159fc9e
refs/heads/master
2020-09-08T12:25:03.104160
2019-11-12T05:03:09
2019-11-12T05:03:09
221,132,916
0
0
null
null
null
null
UTF-8
Swift
false
false
8,260
swift
// // NetworkLayer.swift // Grubs-up // // Created by Ahmed Durrani on 25/05/2019. // Copyright © 2019 CyberHost. All rights reserved. // import Foundation struct NetworkLayer { struct NetworkLayerError: LocalizedError { let message: String var errorDescription: String? { return message } var localizedDescription: String { return message } } static func fetch<D: Response>(_ endpoint: Endpoint, with: D.Type, handler: ((Result<D, NetworkLayerError>) -> ())? = nil) { var components = URLComponents(string: endpoint.fullUrl) var queryItems: [URLQueryItem] = [] // queryItems.append(URLQueryItem(name: "client_id", value: "2")) // queryItems.append(URLQueryItem(name: "client_secret", value: "pmGqX1ki5HnvamG3g9nPC91QVBCeP6v2uzcjdjhS")) // queryItems.append(URLQueryItem(name: "grant_type", value: "password")) // queryItems.append(URLQueryItem(name: "scope", value: " ")) // for item in endpoint.query { // queryItems.append(URLQueryItem(name: item.key, value: item.value)) // } components?.queryItems = queryItems guard let url = components?.url else { return } var request = URLRequest(url: url) request.httpMethod = endpoint.method.rawValue request.setValue("application/json" , forHTTPHeaderField: "Accept") if let session: Session = Persistence(with: .user).load(), let token = session.access_token { request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization") request.setValue("application/json", forHTTPHeaderField: "Content-Type") } switch endpoint.contentType { case .form: request.setValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type") var data = [String]() for (key, value) in endpoint.body { data.append("\(key)=\(value)") } let body = data.compactMap(({ String($0) })).joined(separator: "&") request.httpBody = body.data(using: .ascii) case .json: request.setValue("application/json", forHTTPHeaderField: "Content-Type") // case .multipart: // let boundary = generateBoundary() // request.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") // var parameters = endpoint.body // let body = createDataBody(withParameters: parameters, media: endpoint.multipart, boundary: boundary) // request.httpBody = body } func handle(_ result: Result<D,NetworkLayerError>, _ delay: TimeInterval = 0) { DispatchQueue.main.asyncAfter(wallDeadline: .now() + delay, execute: { handler?(result) }) } let dataTask = URLSession.shared.dataTask(with: request) { (data, response, error) in if let error = error { print(error) handle(.failure(.init(message: "Your Network appears to be offline")), 1) } guard let data = data else { handle(.failure(.init(message: "Something went wrong"))) return } let dataString = String(data: data, encoding: .utf8) print(dataString) guard let object = try? JSONDecoder().decode(with, from: data) else { handle(.failure(.init(message: "Could not parse data"))) return } object.process() handle(.success(object)) } dataTask.resume() } static func fetchPost<D: Response>(_ endpoint: Endpoint, url : String , with: D.Type, handler: ((Result<D, NetworkLayerError>) -> ())? = nil) { var components = URLComponents(string: url) var queryItems: [URLQueryItem] = [] // components?.queryItems = queryItems guard let url = components?.url else { return } var request = URLRequest(url: url) request.httpMethod = endpoint.method.rawValue request.setValue("application/json" , forHTTPHeaderField: "Accept") if let session: Session = Persistence(with: .user).load(), let token = session.access_token { request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization") request.setValue("application/json", forHTTPHeaderField: "Content-Type") } switch endpoint.contentType { case .form: request.setValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type") var data = [String]() for (key, value) in endpoint.body { data.append("\(key)=\(value)") } let body = data.compactMap(({ String($0) })).joined(separator: "&") request.httpBody = body.data(using: .ascii) case .json: request.setValue("application/json", forHTTPHeaderField: "Content-Type") // case .multipart: // let boundary = generateBoundary() // request.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") // var parameters = endpoint.body // let body = createDataBody(withParameters: parameters, media: endpoint.multipart, boundary: boundary) // request.httpBody = body } func handle(_ result: Result<D,NetworkLayerError>, _ delay: TimeInterval = 0) { DispatchQueue.main.asyncAfter(wallDeadline: .now() + delay, execute: { handler?(result) }) } let dataTask = URLSession.shared.dataTask(with: request) { (data, response, error) in if let error = error { print(error) handle(.failure(.init(message: "Your Network appears to be offline")), 1) } guard let data = data else { handle(.failure(.init(message: "Something went wrong"))) return } let dataString = String(data: data, encoding: .utf8) // print(dataString) guard let object = try? JSONDecoder().decode(with, from: data) else { handle(.failure(.init(message: "Could not parse data"))) return } object.process() handle(.success(object)) } dataTask.resume() } static func generateBoundary() -> String { return "Boundary-\(UUID().uuidString)" } // static func createDataBody(withParameters params: [String: String]?, media: [HTTPMultipart]?, boundary: String) -> Data { // let lineBreak = "\r\n" // var body = Data() // if let parameters = params { // for (key, value) in parameters { // body.append("--\(boundary + lineBreak)") // body.append("Content-Disposition: form-data; name=\"\(key)\"\(lineBreak + lineBreak)") // body.append("\(value + lineBreak)") // } // } // // if let media = media { // for photo in media { // body.append("--\(boundary + lineBreak)") // body.append("Content-Disposition: form-data; name=\"\(photo.key)\"; filename=\"\(photo.filename)\"\(lineBreak)") // body.append("Content-Type: \(photo.mimeType + lineBreak + lineBreak)") // body.append(photo.data) // body.append(lineBreak) // } // } // // body.append("--\(boundary)--\(lineBreak)") // // return body // } }
[ -1 ]
2a1b0a04611989aac36d5388044ace9c6e8dee68
7c19dbad01d67aad31dad35e1515164938cd029a
/MemoryGameScholarship/MemoryGameScholarship/GameModule/GameScreen/GameCollectionVC.swift
ea6becba543046206166e28123bb9862113c6de6
[]
no_license
bernardonunes97/WWDC_2020_Scholarship
1f9e24178c22912d00d34d8bbf3fbfa7de4d1661
8e253b6fc980cf1fd0f0e0910a4cd5492d4554d3
refs/heads/master
2022-04-14T09:11:51.434161
2020-04-07T16:26:47
2020-04-07T16:26:47
null
0
0
null
null
null
null
UTF-8
Swift
false
false
4,291
swift
// // ViewController.swift // MemoryGameProject // // Created by Bernardo Nunes on 26/03/20. // Copyright © 2020 Bernardo Nunes. All rights reserved. // import UIKit class GameCollectionVC: UICollectionViewController { //MARK: - Properties var gameState: GameState = Level1State() let gameCollectionViewCellID = "gameCellID" var transitionLabel = UILabel() let transitionView = RadialGradientView() let progressStackView = UIStackView(frame: CGRect(x: 299, y: 500, width: 170, height: 30)) var indicationLabel = UILabel() //MARK: - View Life Cycle override func viewDidLoad() { super.viewDidLoad() //CollectionView Settings self.collectionView.register(GameCollectionViewCell.self, forCellWithReuseIdentifier: self.gameCollectionViewCellID) self.collectionView.backgroundColor = .clear self.collectionView.isScrollEnabled = false self.collectionView.allowsMultipleSelection = true //GameState Settings self.gameState.updateState() self.view.backgroundColor = self.gameState.backgroundColor self.collectionView.reloadData() //Transition View Settings self.transitionView.frame = self.view.frame self.transitionView.layer.zPosition = 15 self.transitionView.colors = [UIColor(displayP3Red: 2/255, green: 2/255, blue: 2/255, alpha: 0.2), UIColor(displayP3Red: 2/255, green: 2/255, blue: 2/255, alpha: 1)] self.transitionView.alpha = 0 //Transition Label Settings let labelBuilder = LabelBuilder(textColor: UIColor(displayP3Red: 248/255, green: 240/255, blue: 240/255, alpha: 1), fontName: "") labelBuilder.setText(text: gameState.transitionSentence) labelBuilder.setFontSize(fontSize: 35) labelBuilder.setFrame(frame: CGRect(x: 195, y: 260, width: 500, height: 57)) self.transitionLabel = labelBuilder.returnLabel() self.transitionLabel.textAlignment = .center self.transitionView.addSubview(self.transitionLabel) self.view.addSubview(self.transitionView) //Progress Stack View Settings for _ in 0...2 { self.progressStackView.addArrangedSubview(self.setProgressView()) } self.progressStackView.arrangedSubviews[0].backgroundColor = .white self.progressStackView.spacing = 40 self.progressStackView.axis = .horizontal self.progressStackView.alignment = .center self.progressStackView.distribution = .equalSpacing self.view.addSubview(self.progressStackView) //Indication Label Settings labelBuilder.setText(text: "Hit!") labelBuilder.setFontSize(fontSize: 35) labelBuilder.setFrame(frame: CGRect(x: 282, y: 492, width: 204, height: 44)) self.indicationLabel = labelBuilder.returnLabel() self.indicationLabel.textAlignment = .center self.indicationLabel.alpha = 0 self.view.addSubview(self.indicationLabel) } /// Method that creates a view private func setProgressView() -> UIView { let progressView = UIView() progressView.backgroundColor = .clear progressView.frame.size = CGSize(width: 30, height: 30) progressView.layer.cornerRadius = progressView.frame.height/2 progressView.clipsToBounds = true progressView.layer.borderColor = CGColor(srgbRed: 70/255, green: 70/255, blue: 70/255, alpha: 1) progressView.layer.borderWidth = 4 progressView.heightAnchor.constraint(equalToConstant: 30).isActive = true progressView.widthAnchor.constraint(equalToConstant: 30).isActive = true return progressView } //MARK: - Game Methods func showIndication(text: String) { self.indicationLabel.text = text UIView.animate(withDuration: 0.5, animations: { self.progressStackView.alpha = 0 self.indicationLabel.alpha = 1.0 }) { (_) in UIView.animate(withDuration: 1) { self.progressStackView.alpha = 1.0 self.indicationLabel.alpha = 0 } } } }
[ -1 ]
b280bd17a59f980a73b42bc9a6b2dec37471ffe6
c1757acf6d43eba15a9bccdbfca89c48b52d0246
/Aerial/Source/Models/Prefs/PrefsInfo.swift
d24b949c97d116be641c6af445b1514b8074e3e3
[ "MIT" ]
permissive
odmir/Aerial
3164f66f61d61793b45cd0ed56960e5e452a2e82
156e177081592ac10de8da63cf9a489cc4b1cef7
refs/heads/master
2022-04-21T22:25:43.028781
2020-04-20T20:04:11
2020-04-20T20:04:11
257,375,965
0
0
MIT
2020-04-20T18:55:13
2020-04-20T18:55:12
null
UTF-8
Swift
false
false
17,388
swift
// // PrefsInfo.swift // Aerial // // Created by Guillaume Louel on 16/12/2019. // Copyright © 2019 Guillaume Louel. All rights reserved. // import Foundation import ScreenSaver protocol CommonInfo { var isEnabled: Bool { get set } var fontName: String { get set } var fontSize: Double { get set } var corner: InfoCorner { get set } var displays: InfoDisplays { get set } } // Helper Enums for the common infos enum InfoCorner: Int, Codable { case topLeft, topCenter, topRight, bottomLeft, bottomCenter, bottomRight, screenCenter, random, absTopRight } enum InfoDisplays: Int, Codable { case allDisplays, mainOnly, secondaryOnly } enum InfoTime: Int, Codable { case always, tenSeconds } enum InfoClockFormat: Int, Codable { case tdefault, t24hours, t12hours } enum InfoDate: Int, Codable { case textual, compact } enum InfoIconText: Int, Codable { case textOnly, iconAndText, iconOnly } enum InfoCountdownMode: Int, Codable { case preciseDate, timeOfDay } enum InfoLocationMode: Int, Codable { case useCurrent, manuallySpecify } enum InfoDegree: Int, Codable { case celsius, fahrenheit } // The various info types available enum InfoType: String, Codable { case location, message, clock, date, battery, updates, weather, countdown, timer } // swiftlint:disable:next type_body_length struct PrefsInfo { struct Location: CommonInfo, Codable { var isEnabled: Bool var fontName: String var fontSize: Double var corner: InfoCorner var displays: InfoDisplays var time: InfoTime } struct Message: CommonInfo, Codable { var isEnabled: Bool var fontName: String var fontSize: Double var corner: InfoCorner var displays: InfoDisplays var message: String } struct Clock: CommonInfo, Codable { var isEnabled: Bool var fontName: String var fontSize: Double var corner: InfoCorner var displays: InfoDisplays var showSeconds: Bool var hideAmPm: Bool var clockFormat: InfoClockFormat } struct IDate: CommonInfo, Codable { var isEnabled: Bool var fontName: String var fontSize: Double var corner: InfoCorner var displays: InfoDisplays var format: InfoDate var withYear: Bool } struct Weather: CommonInfo, Codable { var isEnabled: Bool var fontName: String var fontSize: Double var corner: InfoCorner var displays: InfoDisplays var locationMode: InfoLocationMode var locationString: String var degree: InfoDegree } struct Battery: CommonInfo, Codable { var isEnabled: Bool var fontName: String var fontSize: Double var corner: InfoCorner var displays: InfoDisplays var mode: InfoIconText } struct Updates: CommonInfo, Codable { var isEnabled: Bool var fontName: String var fontSize: Double var corner: InfoCorner var displays: InfoDisplays var betaReset: Bool // This is useless, just to reload default settings for users of 1.7.2 early betas } struct Countdown: CommonInfo, Codable { var isEnabled: Bool var fontName: String var fontSize: Double var corner: InfoCorner var displays: InfoDisplays var mode: InfoCountdownMode var targetDate: Date var enforceInterval: Bool var triggerDate: Date var showSeconds: Bool } struct Timer: CommonInfo, Codable { var isEnabled: Bool var fontName: String var fontSize: Double var corner: InfoCorner var displays: InfoDisplays var duration: Date var showSeconds: Bool var disableWhenElapsed: Bool var replaceWithMessage: Bool var customMessage: String } // Our array of Info layers. User can reorder the array, and we may periodically add new Info types @Storage(key: "layers", defaultValue: [ .message, .clock, .date, .location, .battery, .updates, .weather, .countdown, .timer]) static var layers: [InfoType] // Location information @Storage(key: "LayerLocation", defaultValue: Location(isEnabled: true, fontName: "Helvetica Neue Medium", fontSize: 28, corner: .random, displays: .allDisplays, time: .always)) static var location: Location // Custom string message @Storage(key: "LayerMessage", defaultValue: Message(isEnabled: false, fontName: "Helvetica Neue Medium", fontSize: 20, corner: .topCenter, displays: .allDisplays, message: "Hello there!")) static var message: Message // Clock @Storage(key: "LayerClock", defaultValue: Clock(isEnabled: true, fontName: "Helvetica Neue Medium", fontSize: 50, corner: .bottomLeft, displays: .allDisplays, showSeconds: true, hideAmPm: false, clockFormat: .tdefault)) static var clock: Clock // Date @Storage(key: "LayerDate", defaultValue: IDate(isEnabled: false, fontName: "Helvetica Neue Thin", fontSize: 25, corner: .bottomLeft, displays: .allDisplays, format: .textual, withYear: false)) static var date: IDate // Battery @Storage(key: "LayerBattery", defaultValue: Battery(isEnabled: false, fontName: "Helvetica Neue Medium", fontSize: 20, corner: .topRight, displays: .allDisplays, mode: .textOnly)) static var battery: Battery // Updates @Storage(key: "LayerUpdates", defaultValue: Updates(isEnabled: true, fontName: "Helvetica Neue Medium", fontSize: 20, corner: .topRight, displays: .allDisplays, betaReset: true)) static var updates: Updates // Weather @Storage(key: "LayerWeather", defaultValue: Weather(isEnabled: false, fontName: "Helvetica Neue Medium", fontSize: 40, corner: .topRight, displays: .allDisplays, locationMode: .manuallySpecify, locationString: "", degree: .celsius)) static var weather: Weather // Countdown @Storage(key: "LayerCountdown", defaultValue: Countdown(isEnabled: false, fontName: "Helvetica Neue Medium", fontSize: 100, corner: .screenCenter, displays: .allDisplays, mode: .timeOfDay, targetDate: Date(), enforceInterval: false, triggerDate: Date(), showSeconds: true)) static var countdown: Countdown // Timer @Storage(key: "LayerTimer", defaultValue: Timer(isEnabled: false, fontName: "Helvetica Neue Medium", fontSize: 100, corner: .screenCenter, displays: .allDisplays, duration: Date(timeIntervalSince1970: 300), showSeconds: true, disableWhenElapsed: true, replaceWithMessage: false, customMessage: "")) static var timer: Timer // MARK: - Advanced text settings // Text fade in/out mode @SimpleStorage(key: "fadeModeText", defaultValue: FadeMode.t1.rawValue) static var intFadeModeText: Int // We wrap in a separate value, as we can't store an enum as a Codable in // macOS < 10.15 static var fadeModeText: FadeMode { get { return FadeMode(rawValue: intFadeModeText)! } set(value) { intFadeModeText = value.rawValue } } // Override margins @SimpleStorage(key: "overrideMargins", defaultValue: false) static var overrideMargins: Bool @SimpleStorage(key: "marginX", defaultValue: 50) static var marginX: Int @SimpleStorage(key: "marginY", defaultValue: 50) static var marginY: Int // MARK: - Shadows // Shadow radius @SimpleStorage(key: "shadowRadius", defaultValue: 2) static var shadowRadius: Int @SimpleStorage(key: "shadowOpacity", defaultValue: 1.0) static var shadowOpacity: Float @SimpleStorage(key: "shadowOffsetX", defaultValue: 0.0) static var shadowOffsetX: CGFloat @SimpleStorage(key: "shadowOffsetY", defaultValue: -3.0) static var shadowOffsetY: CGFloat // MARK: - Helpers // Helper to quickly access a given struct (read-only as we return a copy of the struct) static func ofType(_ type: InfoType) -> CommonInfo { switch type { case .location: return location case .message: return message case .clock: return clock case .date: return date case .battery: return battery case .updates: return updates case .weather: return weather case .countdown: return countdown case .timer: return timer } } // Helpers to store the value for the common properties of all info layers static func setEnabled(_ type: InfoType, value: Bool) { switch type { case .location: location.isEnabled = value case .message: message.isEnabled = value case .clock: clock.isEnabled = value case .date: date.isEnabled = value case .battery: battery.isEnabled = value case .updates: updates.isEnabled = value case .weather: weather.isEnabled = value case .countdown: countdown.isEnabled = value case .timer: timer.isEnabled = value } } static func setFontName(_ type: InfoType, name: String) { switch type { case .location: location.fontName = name case .message: message.fontName = name case .clock: clock.fontName = name case .date: date.fontName = name case .battery: battery.fontName = name case .updates: updates.fontName = name case .weather: weather.fontName = name case .countdown: countdown.fontName = name case .timer: timer.fontName = name } } static func setFontSize(_ type: InfoType, size: Double) { switch type { case .location: location.fontSize = size case .message: message.fontSize = size case .clock: clock.fontSize = size case .date: date.fontSize = size case .battery: battery.fontSize = size case .updates: updates.fontSize = size case .weather: weather.fontSize = size case .countdown: countdown.fontSize = size case .timer: timer.fontSize = size } } static func setCorner(_ type: InfoType, corner: InfoCorner) { switch type { case .location: location.corner = corner case .message: message.corner = corner case .clock: clock.corner = corner case .date: date.corner = corner case .battery: battery.corner = corner case .updates: updates.corner = corner case .weather: weather.corner = corner case .countdown: countdown.corner = corner case .timer: timer.corner = corner } } static func setDisplayMode(_ type: InfoType, mode: InfoDisplays) { switch type { case .location: location.displays = mode case .message: message.displays = mode case .clock: clock.displays = mode case .date: date.displays = mode case .battery: battery.displays = mode case .updates: updates.displays = mode case .weather: weather.displays = mode case .countdown: countdown.displays = mode case .timer: timer.displays = mode } } } // This retrieves/store any type of property in our plist @propertyWrapper struct Storage<T: Codable> { private let key: String private let defaultValue: T private let module = "com.JohnCoates.Aerial" init(key: String, defaultValue: T) { self.key = key self.defaultValue = defaultValue } var wrappedValue: T { get { if let userDefaults = ScreenSaverDefaults(forModuleWithName: module) { // Read value from UserDefaults guard let data = userDefaults.object(forKey: key) as? Data else { // Return defaultValue when no data in UserDefaults return defaultValue } // Convert data to the desire data type let value = try? JSONDecoder().decode(T.self, from: data) return value ?? defaultValue } return defaultValue } set { // Convert newValue to data let data = try? JSONEncoder().encode(newValue) //let module = "com.JohnCoates.Aerial" if let userDefaults = ScreenSaverDefaults(forModuleWithName: module) { // Set value to UserDefaults userDefaults.set(data, forKey: key) // We force the sync so the settings are automatically saved // This is needed as the System Preferences instance of Aerial // is a separate instance from the screensaver ones userDefaults.synchronize() } else { errorLog("UserDefaults set failed for \(key)") } } } } // This retrieves store "simple" types that are natively storable on plists @propertyWrapper struct SimpleStorage<T> { private let key: String private let defaultValue: T private let module = "com.JohnCoates.Aerial" init(key: String, defaultValue: T) { self.key = key self.defaultValue = defaultValue } var wrappedValue: T { get { if let userDefaults = ScreenSaverDefaults(forModuleWithName: module) { return userDefaults.object(forKey: key) as? T ?? defaultValue } return defaultValue } set { if let userDefaults = ScreenSaverDefaults(forModuleWithName: module) { userDefaults.set(newValue, forKey: key) userDefaults.synchronize() } } } }
[ -1 ]
82f194bb0f6550b418d08ce6f7ff50c1215fa974
a3c5acc71b7bf1ca8a91eafd97deae09a847220e
/emoji app/emoji app/AppDelegate.swift
6220b2c288a2f41d6a9fcfb6cd058b0b4bd5c8ee
[]
no_license
syd2923/emojiapp
604705f2f218e3cfebe485513f5fb35d75a2355b
3360933e29072e4b1e49694b1801215d547e3c07
refs/heads/master
2020-07-01T22:12:41.485939
2019-08-09T15:48:56
2019-08-09T15:48:56
201,319,452
0
0
null
null
null
null
UTF-8
Swift
false
false
2,175
swift
// // AppDelegate.swift // emoji app // // Created by Sydney Brown on 8/8/19. // Copyright © 2019 Sydney Brown. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: 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, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 204856, 229432, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 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, 279082, 311850, 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, 189039, 172660, 287349, 189040, 189044, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 279178, 287371, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 287390, 303773, 172705, 287394, 172707, 303780, 164509, 287398, 205479, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312005, 312006, 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, 279438, 213902, 189329, 295825, 304019, 189331, 58262, 304023, 304027, 279452, 234648, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 230334, 304063, 304065, 213954, 189378, 156612, 295873, 213963, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 230413, 295949, 197645, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 132165, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 279661, 205934, 164973, 312432, 279669, 337018, 279679, 304258, 279683, 222340, 66690, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 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, 230679, 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, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 279929, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 148946, 222676, 288214, 239064, 329177, 288217, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 181854, 370272, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 304968, 280393, 280402, 173907, 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, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 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, 288909, 141455, 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, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 354653, 354656, 313700, 313705, 280937, 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, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 281095, 223752, 150025, 338440, 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, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 256716, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 240519, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 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, 298365, 290174, 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, 28219, 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, 298822, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 44948, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 282654, 241701, 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, 176311, 299191, 307386, 258235, 307388, 307385, 307390, 176316, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 276052, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 194654, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127434, 315856, 176592, 127440, 315860, 176597, 283095, 127447, 299481, 127449, 176605, 242143, 127455, 127457, 291299, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 283142, 127494, 135689, 233994, 127497, 127500, 291341, 233998, 127506, 234003, 127509, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 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, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 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, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 316294, 201603, 226182, 308105, 234375, 226185, 234379, 324490, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 226200, 291742, 234396, 234398, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 324522, 234410, 291756, 291754, 226220, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 234437, 226245, 234439, 226239, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 275606, 275608, 234650, 308379, 324757, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 177318, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 226500, 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, 283917, 177424, 275725, 349451, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 144814, 227426, 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, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 292414, 284223, 284226, 284228, 292421, 226886, 284231, 128584, 243268, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 276053, 284249, 284251, 300638, 284253, 284255, 243293, 284258, 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, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 186151, 276268, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 292681, 153417, 358224, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 317332, 358292, 284564, 284566, 399252, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 276402, 358326, 161718, 358330, 276410, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276452, 292839, 276455, 292843, 276460, 276464, 178161, 227314, 325624, 276472, 317435, 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, 194649, 227418, 350299, 350302, 227423, 350304, 178273, 309346, 194657, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 301163, 350313, 350316, 227430, 301167, 276583, 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, 284837, 153765, 350375, 350379, 350381, 350383, 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, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 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, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 301636, 318020, 301639, 301643, 277071, 285265, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 318132, 342707, 154292, 277173, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 276579, 293811, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 244731, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 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, 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, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 277804, 285997, 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, 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, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 245191, 64966, 163272, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 302617, 286233, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 278057, 310831, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 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, 319163, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 278238, 229086, 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, 280021, 188252, 237409, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
20484f25400032f1e5ccdef78909b0891cbc51bb
fffcf399054dc31a0f92ef658971e8aeabc6be1f
/Asgatech Task/News Details/NewsDetailsViewController.swift
eb4db9259e6f29e9bf8f34f6cede0ccd8cb0a8eb
[]
no_license
ShoroukElgazar/NewsApp
62d7ae3ee6123722e3e76a7b79c32e2c69368bab
f3982c80c5c22c797d4a300f2cc2f439eeda95bf
refs/heads/master
2023-06-26T15:09:48.454136
2021-07-31T21:06:12
2021-07-31T21:06:12
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,339
swift
// // NewsDetailsViewController.swift // Asgatech Task // // Created by Shorouk Mohamed on 7/29/21. // Copyright © 2021 Shorouk Mohamed. All rights reserved. // import UIKit import Kingfisher import WebKit class NewsDetailsViewController: UIViewController { var articleTitle = "" var articleDescription = "" var articleContent = "" var articleAuthor = "" var articleDate = "" var articleName = "" var articleURL = "" var articleImg = "" @IBOutlet weak var articleImage: UIImageView! @IBOutlet weak var titleLabel: UILabel! @IBOutlet weak var descriptionLabel: UILabel! @IBOutlet weak var contentLabel: UILabel! @IBOutlet weak var dateLabel: UILabel! @IBOutlet weak var authorLabel: UILabel! override func viewDidLoad() { super.viewDidLoad() setupData() } override func viewWillAppear(_ animated: Bool) { navigationController?.navigationBar.isHidden = false navigationItem.title = articleName navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.red] } @IBAction func goToArticleSourceBtn(_ sender: Any) { let webViewVC = WebViewVC() webViewVC.urlString = articleURL self.navigationController?.pushViewController(webViewVC, animated: true) } private func setupData(){ setupImage() setupContentString() setupLabels() } private func setupImage(){ let url = URL(string: articleImg) let placeholder = UIImage(named: "newsplaceholder") articleImage.kf.indicatorType = .activity articleImage.kf.setImage(with: url, placeholder: placeholder, options: [], progressBlock: nil) { _ in } } private func setupLabels(){ titleLabel.text = articleTitle descriptionLabel.text = articleDescription contentLabel.text = articleContent authorLabel.text = articleAuthor dateLabel.text = articleDate.handleDate() } private func setupContentString(){ guard let beginIndex = articleContent.firstIndex(of: "[") , let lastIndex = articleContent.firstIndex(of: "]") else {return} articleContent.removeSubrange(beginIndex...lastIndex) } }
[ -1 ]
a105494d6f4a66d39f07aa505acbb73ca384c820
2a150eedc646b45dc74a3d3e93c756e2de111501
/MDFlickerImages/MDFlickerImages/Controller/MDFlickerImagesViewController.swift
3d92b39d56945b95ae77fdc2e0361de7a6720d7a
[ "MIT" ]
permissive
MuthurajMuthulingam/MDFlickerImages
8df9f45ff070e6821c50a2be89e20a12c00d7598
b3cf9bef846edf11eb2ed8a284c7dc43ca6c3162
refs/heads/main
2023-04-22T08:27:59.354649
2021-05-11T22:11:06
2021-05-11T22:11:06
365,797,374
0
0
null
null
null
null
UTF-8
Swift
false
false
5,412
swift
// // ViewController.swift // MDFlickerImages // // Created by Muthuraj Muthulingam on 09/05/21. // import UIKit final class MDFlickerImagesViewController: UIViewController { // MARK - IBOutlets @IBOutlet weak var collectionView: UICollectionView! @IBOutlet weak var searchBar: UISearchBar! // MARK: - Private Helpers private lazy var networkService: MDNetworkService = MDNetworkService() private lazy var imageInfo: FlickerPhoto? = nil private lazy var currentPage: Double = 0 private lazy var currentSearchQuery: String = "" private lazy var isLoadingData: Bool = false private var photos: [ImageInfo] = [] { didSet { collectionView.reloadData() } } // MARK: - Life cycle Methods override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) performImageSearchIfNeeded() } } private typealias PrivateHelpers = MDFlickerImagesViewController private extension PrivateHelpers { func performImageSearchIfNeeded() { guard let searchText = searchBar.text, searchText.isNotEmpty else { resetView() return } let totalPages: Double = imageInfo?.photos?.total ?? 0 if currentSearchQuery == searchText && currentPage == totalPages { return } if currentSearchQuery == searchText { currentPage += 1 } else { currentPage = 1 // reset currentSearchQuery = searchText } fetchFlickerImages(for: searchText, of: currentPage) } func resetView() { imageInfo = nil photos = [] // this reload the view } func fetchFlickerImages(for query: String, of page: Double) { func handleSuccess(with flickerInfo: FlickerPhoto) { imageInfo = flickerInfo var photos: [ImageInfo] = self.photos if currentPage > 1 { // running on different page photos += flickerInfo.photos?.photo ?? [] } else { photos = flickerInfo.photos?.photo ?? [] } self.photos = photos } func handleFailure(using error: NetworkError) { } networkService.getFlickerImages(for: query, of: page) {[weak self] result in DispatchQueue.main.async { guard let self = self else { return } self.isLoadingData = false switch result { case let .success(flickerPhoto): guard let flickerPhoto = flickerPhoto else { return } handleSuccess(with: flickerPhoto) case let .failure(error): handleFailure(using: error) } } } } } private typealias SearchBarDelegate = MDFlickerImagesViewController extension SearchBarDelegate: UISearchBarDelegate { func searchBarSearchButtonClicked(_ searchBar: UISearchBar) { // perform search performImageSearchIfNeeded() } func searchBarCancelButtonClicked(_ searchBar: UISearchBar) { // clear the results } func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { // search text changes } } private typealias CollectionViewHelpers = MDFlickerImagesViewController extension CollectionViewHelpers: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout { // Cllection view datasource and Delegates func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { photos.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: String(describing: MDImageCollectionViewCell.self), for: indexPath) if let imageCell = cell as? MDImageCollectionViewCell { imageCell.updateViewWithData(photos[indexPath.item]) } return cell } // Flow Layout delegates func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let collectionViewItemHeight: CGFloat = collectionView.frame.size.width/3 - 10 return CGSize(width: collectionViewItemHeight, height: collectionViewItemHeight) } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { 5 } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { UIEdgeInsets(top: 5, left: 5, bottom: 5, right: 5) } // Scrollview Delegates func scrollViewDidScroll(_ scrollView: UIScrollView) { let offsetY = scrollView.contentOffset.y let contentHeight = scrollView.contentSize.height if offsetY > contentHeight - scrollView.frame.size.height { if !isLoadingData { isLoadingData = true performImageSearchIfNeeded() } } } }
[ -1 ]
ab43bf42d533e97ddca8205e9da1e44bff489019
3c5c7f18af7db0b8e4d3468991b909c5a85b403d
/Carthage/Checkouts/FunctionalKit/Sources/FunctionalKit/OptionalType.swift
de9a6c2372af710e4210a2554b6148ad31d2d6e1
[ "MIT" ]
permissive
upscalePOS/FunctionalSwiftArchitecture
60a50887518fc85e4622dd2980d884c535b781bb
5ea44bb1060209634421d4ed91f4d79e6bdc5b72
refs/heads/master
2020-04-26T18:51:50.944449
2018-02-16T22:00:50
2018-02-16T22:00:50
null
0
0
null
null
null
null
UTF-8
Swift
false
false
8,794
swift
#if SWIFT_PACKAGE import Operadics #endif import Abstract // MARK: - Definiton // sourcery: functor // sourcery: traversable // sourcery: monad // sourcery: concrete = "Optional" // sourcery: customMap = "fmap" // sourcery: customFlatMap = "bind" public protocol OptionalType: PureConstructible, CoproductType { static func from(concrete: Concrete<ParameterType>) -> Self func run() -> ParameterType? func fold <T> (onNone: () -> T, onSome: (ParameterType) -> T) -> T } extension OptionalType { public func fold<T>(onLeft: (()) -> T, onRight: (ParameterType) -> T) -> T { return fold(onNone: { onLeft(()) }, onSome: onRight) } } // MARK: - Data // sourcery: testFunctor // sourcery: testApplicative // sourcery: testMonad // sourcery: testConstruct = "init(x)" // sourcery: customMap = "fmap" // sourcery: customFlatMap = "bind" extension Optional: OptionalType { public typealias ParameterType = Wrapped public static func from(concrete: Optional<Wrapped>) -> Optional<Wrapped> { return concrete } public func run() -> Wrapped? { return self } public func fold<T>(onNone: () -> T, onSome: (Wrapped) -> T) -> T { switch self { case .none: return onNone() case .some(let value): return onSome(value) } } } // MARK: - Concrete extension OptionalType { public typealias Concrete<T> = Optional<T> } // MARK: - Equatable extension OptionalType where ParameterType: Equatable { public static func == (lhs: Self, rhs: Self) -> Bool { return lhs.fold( onNone: { rhs.fold( onNone: f.constant(true), onSome: f.constant(false)) }, onSome: { value in rhs.fold( onNone: f.constant(false), onSome: { value == $0 }) }) } } // MARK: - Functor extension OptionalType { public func fmap <T> (_ transform: (ParameterType) -> T) -> Optional<T> { return withoutActuallyEscaping(transform) { transform in fold( onNone: f.constant(Optional<T>.none), onSome: transform..Optional<T>.some) } } public static func lift<A>(_ function: @escaping (ParameterType) -> A) -> (Self) -> Optional<A> { return { $0.fmap(function) } } public static func lift<A,Applicative2>(_ function: @escaping (ParameterType, Applicative2.ParameterType) -> A) -> (Self, Applicative2) -> Optional<A> where Applicative2: OptionalType { return { (ap1, ap2) in Concrete.pure(f.curry(function)) <*> ap1 <*> ap2 } } public static func lift<A,Applicative2,Applicative3>(_ function: @escaping (ParameterType, Applicative2.ParameterType, Applicative3.ParameterType) -> A) -> (Self, Applicative2, Applicative3) -> Optional<A> where Applicative2: OptionalType, Applicative3: OptionalType { return { ap1, ap2, ap3 in Concrete.pure(f.curry(function)) <*> ap1 <*> ap2 <*> ap3 } } } // MARK: - Cartesian extension OptionalType { public typealias Zipped<O1,O2> = Optional<(O1.ParameterType,O2.ParameterType)> where O1: OptionalType, O2: OptionalType public static func zip <O1,O2> (_ first: O1, _ second: O2) -> Zipped<O1,O2> where O1: OptionalType, O2: OptionalType, ParameterType == (O1.ParameterType, O2.ParameterType) { return first.fold( onNone: f.constant(Zipped<O1,O2>.none), onSome: { value in second.fold( onNone: f.constant(Zipped<O1,O2>.none), onSome: { Zipped<O1,O2>.some((value,$0)) }) }) } } // MARK: - Applicative extension OptionalType { public static func pure(_ value: ParameterType) -> Optional<ParameterType> { return Optional<ParameterType>.init(value) } public func apply<O,T>(_ transform: O) -> Optional<T> where O: OptionalType, O.ParameterType == (ParameterType) -> T { return Optional.zip(self, transform).map { value, function in function(value) } } public static func <*> <O,T> (lhs: O, rhs: Self) -> Optional<T> where O: OptionalType, O.ParameterType == (ParameterType) -> T { return Optional.zip(lhs, rhs).map { function, value in function(value) } } } // MARK: - Traversable extension OptionalType { public typealias Traversed<Applicative> = Optional<Applicative.ParameterType> where Applicative: TypeConstructor public func traverse<Applicative>(_ transform: (ParameterType) -> Applicative) -> [Traversed<Applicative>] where Applicative: ArrayType { typealias Returned = [Traversed<Applicative>] return fold( onNone: { () -> Returned in Returned.pure(Traversed<Applicative>.none) }, onSome: { (value) -> Returned in Applicative.Concrete.pure(Traversed<Applicative>.some) <*> transform(value) }) } public func traverse<Applicative>(_ transform: (ParameterType) -> Applicative) -> Future<Traversed<Applicative>> where Applicative: FutureType { typealias Returned = Future<Traversed<Applicative>> return fold( onNone: { () -> Returned in Returned.pure(Traversed<Applicative>.none) }, onSome: { (value) -> Returned in Applicative.Concrete.pure(Traversed<Applicative>.some) <*> transform(value) }) } public func traverse<Applicative>(_ transform: (ParameterType) -> Applicative) -> Optional<Traversed<Applicative>> where Applicative: OptionalType { typealias Returned = Optional<Traversed<Applicative>> return fold( onNone: { () -> Returned in Returned.pure(Traversed<Applicative>.none) }, onSome: { (value) -> Returned in Applicative.Concrete.pure(Traversed<Applicative>.some) <*> transform(value) }) } public func traverse<Applicative>(_ transform: (ParameterType) -> Applicative) -> Reader<Applicative.EnvironmentType,Traversed<Applicative>> where Applicative: ReaderType { typealias Returned = Reader<Applicative.EnvironmentType,Traversed<Applicative>> return fold( onNone: { () -> Returned in Returned.pure(Traversed<Applicative>.none) }, onSome: { (value) -> Returned in Applicative.Concrete.pure(Traversed<Applicative>.some) <*> transform(value) }) } public func traverse<Applicative>(_ transform: (ParameterType) -> Applicative) -> Result<Applicative.ErrorType,Traversed<Applicative>> where Applicative: ResultType { typealias Returned = Result<Applicative.ErrorType,Traversed<Applicative>> return fold( onNone: { () -> Returned in Returned.pure(Traversed<Applicative>.none) }, onSome: { (value) -> Returned in Applicative.Concrete.pure(Traversed<Applicative>.some) <*> transform(value) }) } public func traverse<Applicative>(_ transform: (ParameterType) -> Applicative) -> State<Applicative.StateParameterType,Traversed<Applicative>> where Applicative: StateType { typealias Returned = State<Applicative.StateParameterType,Traversed<Applicative>> return fold( onNone: { () -> Returned in Returned.pure(Traversed<Applicative>.none) }, onSome: { (value) -> Returned in Applicative.Concrete.pure(Traversed<Applicative>.some) <*> transform(value) }) } public func traverse<Applicative>(_ transform: (ParameterType) -> Applicative) -> Writer<Applicative.LogType,Traversed<Applicative>> where Applicative: WriterType { typealias Returned = Writer<Applicative.LogType,Traversed<Applicative>> return fold( onNone: { () -> Returned in Returned.pure(Traversed<Applicative>.none) }, onSome: { (value) -> Returned in Applicative.Concrete.pure(Traversed<Applicative>.some) <*> transform(value) }) } } // MARK: - Monad extension OptionalType where ParameterType: OptionalType { public var joined: Optional<ParameterType.ParameterType> { return fold( onNone: f.constant(Optional<ParameterType.ParameterType>.none), onSome: { value in value.fold( onNone: f.constant(Optional<ParameterType.ParameterType>.none), onSome: Optional<ParameterType.ParameterType>.some) }) } } extension OptionalType { public func bind<O>(_ transform: (ParameterType) -> O) -> Optional<O.ParameterType> where O: OptionalType { return fmap(transform).joined } } // MARK: - Utility extension OptionalType { public func filter(_ predicate: (ParameterType) -> Bool) -> Optional<ParameterType> { return bind { (element) -> Optional<ParameterType> in if predicate(element) { return .some(element) } else { return .none } } } public func get(or getElseValue: @autoclosure () -> ParameterType) -> ParameterType { return fold( onNone: getElseValue, onSome: f.identity) } public func toResult<E>(getError: @autoclosure () -> E) -> Result<E,ParameterType> where E: Error { return fold( onNone: { Result.failure(getError()) }, onSome: Result.success) } public var isNil: Bool { return fold( onNone: f.constant(true), onSome: f.constant(false)) } public func ifNotNil(_ action: (ParameterType) -> ()) { _ = fold( onNone: f.ignore, onSome: action) } }
[ -1 ]
622c169cd6b41104068abce2bc7eea22f4019a3a
0aad2683ce7a024fcdd9d643df47d324efd86ac9
/Aural/RecorderViewController.swift
0874cd93fc5d2e51abd76bbc7b02d524460de3ec
[]
no_license
mike-seger/aural-player
d2695c3cb7bb5b5cb5e16b9cd0d6ef8458dad7b8
6f7a26fd53323d93572ce2b29d6132e392b899a0
refs/heads/master
2020-08-17T18:00:39.604862
2019-07-22T13:12:17
2019-07-22T13:12:17
null
0
0
null
null
null
null
UTF-8
Swift
false
false
6,803
swift
import Cocoa /* View controller for the Recorder unit */ class RecorderViewController: NSViewController, MessageSubscriber, ActionMessageSubscriber { // Recorder controls @IBOutlet weak var btnRecord: OnOffImageButton! @IBOutlet weak var lblRecorderDuration: NSTextField! @IBOutlet weak var lblRecorderFileSize: NSTextField! @IBOutlet weak var recordingInfoBox: NSBox! @IBOutlet weak var formatMenu: NSPopUpButton! // Labels @IBOutlet weak var lblCaption: NSTextField! // Delegate that relays requests to the recorder private let recorder: RecorderDelegateProtocol = ObjectGraph.recorderDelegate // Timer that periodically updates recording info - duration and filesize (only when recorder is active) private var recorderTimer: RepeatingTaskExecutor? // Cached recording info (used to determine recording format when saving a recording) private var recordingInfo: RecordingInfo? override var nibName: String? {return "Recorder"} override func viewDidLoad() { initControls() // Subscribe to message notifications SyncMessenger.subscribe(messageTypes: [.appExitRequest], subscriber: self) SyncMessenger.subscribe(actionTypes: [.changeEffectsTextSize, .changeColorScheme], subscriber: self) } private func initControls() { recorderTimer = RepeatingTaskExecutor(intervalMillis: UIConstants.recorderTimerIntervalMillis, task: {self.updateRecordingInfo()}, queue: DispatchQueue.main) btnRecord.off() } // Starts/stops recording @IBAction func recorderAction(_ sender: Any) { if (recorder.isRecording()) { stopRecording() } else { startRecording() } } // Starts a new recording private func startRecording() { formatMenu.disable() let format = RecordingFormat.formatForDescription((formatMenu.selectedItem?.title)!) recorder.startRecording(format) // Start the recording btnRecord.on() recorderTimer?.startOrResume() // Update the UI to display current recording information lblRecorderDuration.stringValue = Strings.zeroDurationString lblRecorderFileSize.stringValue = Size.ZERO.toString() recordingInfoBox.show() SyncMessenger.publishNotification(EffectsUnitStateChangedNotification.instance) } // Stops the current recording private func stopRecording() { formatMenu.enable() recorder.stopRecording() btnRecord.off() recorderTimer?.pause() saveRecording(recordingInfo!.format) recordingInfoBox.hide() SyncMessenger.publishNotification(EffectsUnitStateChangedNotification.instance) } // Prompts the user to save the new recording private func saveRecording(_ format: RecordingFormat) { let dialog = DialogsAndAlerts.saveRecordingPanel(format.fileExtension) let modalResponse = dialog.runModal() if (modalResponse == NSApplication.ModalResponse.OK) { recorder.saveRecording(dialog.url!) } else { // If user doesn't want to save the recording, discard it (delete the temp file) recorder.deleteRecording() } } // Updates current recording information private func updateRecordingInfo() { recordingInfo = recorder.getRecordingInfo() lblRecorderDuration.stringValue = StringUtils.formatSecondsToHMS(recordingInfo!.duration) lblRecorderFileSize.stringValue = recordingInfo!.fileSize.toString() } // This function is invoked when the user attempts to exit the app. It checks if there is an ongoing recording the user may have forgotten about, and prompts the user to save/discard the recording or to cancel the exit. private func onExit() -> AppExitResponse { if (recorder.isRecording()) { // Recording ongoing, prompt the user to save/discard it let response = UIUtils.showAlert(DialogsAndAlerts.saveRecordingAlert).rawValue switch response { case RecordingAlertResponse.dontExit.rawValue: return AppExitResponse.dontExit case RecordingAlertResponse.saveAndExit.rawValue: stopRecording() return AppExitResponse.okToExit case RecordingAlertResponse.discardAndExit.rawValue: recorder.deleteRecording() return AppExitResponse.okToExit // Impossible default: return AppExitResponse.okToExit } } // No ongoing recording, proceed with exit return AppExitResponse.okToExit } private func changeTextSize() { lblCaption.font = TextSizes.fxUnitCaptionFont let labels = findFunctionLabels(self.view) labels.forEach({$0.font = TextSizes.fxUnitFunctionFont}) formatMenu.redraw() formatMenu.font = TextSizes.fxUnitFunctionFont } private func findFunctionLabels(_ view: NSView) -> [NSTextField] { var labels: [NSTextField] = [] for subview in view.subviews { if let label = subview as? NSTextField, label != lblCaption { labels.append(label) } // Recursive call let subviewLabels = findFunctionLabels(subview) labels.append(contentsOf: subviewLabels) } return labels } func changeColorScheme() { lblCaption.textColor = Colors.fxUnitCaptionColor let labels = findFunctionLabels(self.view) labels.forEach({$0.textColor = Colors.fxUnitFunctionColor}) } // MARK: Message handling var subscriberId: String { return self.className } func processRequest(_ request: RequestMessage) -> ResponseMessage { if (request is AppExitRequest) { return onExit() } return EmptyResponse.instance } func consumeMessage(_ message: ActionMessage) { if message.actionType == .changeEffectsTextSize { changeTextSize() } if message.actionType == .changeColorScheme { changeColorScheme() } } }
[ -1 ]
be3dd517e709ad36b5354d7d60f39ffd0e281432
825da2e615f1cd5ec348dcd4c3a760761a6dcb1e
/CodingTest/24dfs_bfs/1260DFS와BFS.swift
914f4b7b123fd975f158a1d99f94f7044cdc9df9
[]
no_license
msi753/coding-test-swift
4974d2417faa4ba18352f5f4cb2392a2c40092f3
a1fb2ed3522bbe3ba27e3e992823c3dc7d6dd2db
refs/heads/main
2023-08-24T13:39:19.454683
2021-10-15T02:00:17
2021-10-15T02:00:17
362,531,253
1
0
null
null
null
null
UTF-8
Swift
false
false
1,442
swift
// // main.swift // CodingTest // // Created by 임명심 on 2021/06/21. // import Foundation let line = readLine()!.components(separatedBy: " ").map{ Int(String($0))! } let numberOfVertex = line[0] let numberOfEdge = line[1] let startVertex = line[2] var graph = [[Int]].init(repeating: [], count: numberOfVertex+1) // [[], [2, 3, 4], [1, 4], [1, 4], [1, 2, 3]] var isChecked: [Bool] = [Bool].init(repeating: false, count: numberOfVertex+1) for _ in 0..<numberOfEdge { let part = readLine()!.components(separatedBy: " ").map{ Int(String($0))! } graph[part[0]].append(part[1]) graph[part[1]].append(part[0]) } for i in 1...numberOfVertex { graph[i].sort() } func dfs(start: Int) { if isChecked[start] { return } isChecked[start] = true print(start, terminator: " ") for vertex in graph[start] { if !isChecked[vertex] { dfs(start: vertex) } } } func bfs(start: Int) { var queue = [Int]() isChecked[start] = true queue.append(start) while !queue.isEmpty { let first = queue.removeFirst() print(first, terminator: " ") for vertex in graph[first] { if !isChecked[vertex] { isChecked[vertex] = true queue.append(vertex) } } } } dfs(start: startVertex) print() isChecked = [Bool].init(repeating: false, count: numberOfVertex+1) bfs(start: startVertex)
[ -1 ]
93c0a00aa08c11b8990ccce2b38ec5199b256578
62de8afc25c738d79fb6584abea699dc1aa3b6fb
/EvoRadio/Views/CDCoverImageView.swift
97f62798cb6dd6f9a3d2c0cab9b4ddab44e8fcdc
[]
no_license
MobileIOS/EvoRadio
b291edcfbac9f2b391d2d12ca91536042b62c750
582ea76cb784c551761b5dede10123939bc1215a
refs/heads/master
2021-01-14T13:06:05.679154
2016-08-25T04:04:34
2016-08-25T04:04:34
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,572
swift
// // CDCoverImageView.swift // EvoRadio // // Created by Jarvis on 5/29/16. // Copyright © 2016 JQTech. All rights reserved. // import UIKit import pop class CDCoverImageView: UIImageView { var rotateAnimation:POPBasicAnimation var rotateTimer: CADisplayLink? override init(frame: CGRect) { self.rotateAnimation = POPBasicAnimation(propertyNamed: kPOPLayerRotation) super.init(frame: frame) prepareAnimation() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } deinit { if let _ = rotateTimer { rotateTimer?.invalidate() rotateTimer = nil } } func prepareAnimation() { rotateAnimation.toValue = M_PI * 2 rotateAnimation.duration = 16 rotateAnimation.repeatForever = true rotateAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear) rotateAnimation.beginTime = CACurrentMediaTime()+0.2 layer.pop_addAnimation(rotateAnimation, forKey: "rotateAnimation") pauseAnimate() } func resetAnimation() { rotateAnimation.toValue = 0 rotateAnimation.duration = 0.5 layer.pop_addAnimation(rotateAnimation, forKey: "rotateAnimation") } func pauseAnimate() { rotateAnimation.paused = true } func resumeAnimate() { rotateAnimation.paused = false } }
[ -1 ]
97cd8b7159919095713f5ca4e37a0ad5365bb21d
6a4830e8a974e70d522c1442b601f16ac816958a
/EnumerationsStructuresAndClasses/MonsterTown/MonsterTown/main.swift
4468856aee8f574414250a15c8934a59923c6cc5
[]
no_license
jdpaul123/swiftBNR
d7556882e1612d180bb2da6d818c8304ebdc3fef
a88546fd8515c14199bfe4e87ce50a6b8267567e
refs/heads/main
2023-05-31T13:34:38.701722
2021-07-01T23:49:54
2021-07-01T23:49:54
351,276,371
0
0
null
null
null
null
UTF-8
Swift
false
false
1,105
swift
// // main.swift // MonsterTown // // Created by Jonathan Paul on 3/25/21. // import Foundation var myTown = Town(population: 0, stopLights: 6) myTown?.printDescription() let myTownSize = myTown?.townSize print(String(describing: myTownSize)) myTown?.changePopulation(by: 100000000) print("Size: \(String(describing: myTown?.townSize)); population \(String(describing: myTown?.population))") print() var fredTheZombie: Zombie? = Zombie(limp: false, fallingApart: false, town: myTown, monsterName: "Fred") fredTheZombie?.terrorizeTown() fredTheZombie?.town?.printDescription() // using .town? is an example of optional chaining (unwrapping an optional) to make sure there is a vlaue there print() var convenientZombie = Zombie(limp: true, fallingApart: false) print() print("Victim pool: \(String(describing: fredTheZombie?.victimPool))") fredTheZombie?.victimPool = 500 print("Victim pool: \(String(describing: fredTheZombie?.victimPool));") print(Zombie.spookyNoise) if Zombie.isTerrifying { print("Run away!") } print() fredTheZombie = nil // this is where you de-init the zombie type
[ -1 ]
ec41c02bf988cfe0c4c0dfb6625953582ff16993
280f11c345679a7b5e061d20b95b27d2a6f8e895
/MyLocations/MyLocations/HudView.swift
07e23ab18f4a870eba5768f138250175edea3690
[]
no_license
fernandaaraujo/ios-capDev
034499f31a7b59f2a14e2634635b53c48ff3f7de
5501c0449debbe1f72ed10cb0a477b8a5c6d2302
refs/heads/master
2021-04-15T09:13:02.506527
2018-04-12T20:42:39
2018-04-12T20:42:39
126,844,772
0
0
null
null
null
null
UTF-8
Swift
false
false
2,512
swift
// // HudView.swift // MyLocations // // Created by Fernanda Araújo on 04/04/18. // Copyright © 2018 thoughtworks. All rights reserved. // import Foundation import UIKit class HudView: UIView { var text = "" class func hud(inView view: UIView, animated: Bool) -> HudView { let hudView = HudView(frame: view.bounds) hudView.isOpaque = false view.addSubview(hudView) view.isUserInteractionEnabled = false hudView.show(animated: animated) return hudView } override func draw(_ rect: CGRect) { let boxWidth: CGFloat = 96 let boxHeight: CGFloat = 96 let boxRect = CGRect( x: round((bounds.size.width - boxWidth) / 2), y: round((bounds.size.height - boxHeight) / 2), width: boxWidth, height: boxHeight) let roundedRect = UIBezierPath(roundedRect: boxRect, cornerRadius: 10) UIColor(white: 0.3, alpha: 0.8).setFill() roundedRect.fill() // Draw checkmark if let image = UIImage(named: "Checkmark") { let imagePoint = CGPoint( x: center.x - round(image.size.width / 2), y: center.y - round(image.size.height / 2) - boxHeight / 8) image.draw(at: imagePoint) } // Draw the text let attribs = [ NSAttributedStringKey.font: UIFont.systemFont(ofSize: 16), NSAttributedStringKey.foregroundColor: UIColor.white] let textSize = text.size(withAttributes: attribs) let textPoint = CGPoint( x: center.x - round(textSize.width / 2), y: center.y - round(textSize.height / 2) + boxHeight / 4) text.draw(at: textPoint, withAttributes: attribs) } // MARK:- Public methods func show(animated: Bool) { if animated { alpha = 0 transform = CGAffineTransform(scaleX: 1.3, y: 1.3) UIView.animate(withDuration: 0.3, delay: 0, usingSpringWithDamping: 0.7, initialSpringVelocity: 0.5, options: [], animations: { self.alpha = 1 self.transform = CGAffineTransform.identity }, completion: nil) } } func hide() { superview?.isUserInteractionEnabled = true removeFromSuperview() } }
[ 334366 ]
c94bf2b57ae6643c9f051957e50091b2f5f84fd9
ff2bd514b5078cc3ca83d18f0dfdf01cf3d3ff5e
/DASHBOARD/Network/Helper.swift
40e832c494f38b5831c494f97e26e0256072268f
[]
no_license
madhubalan/DASHBOARD
4174a6341747bd7383f1c87b3c4b804a85cccd20
fc096d77ba81568aa64c11a675b548cf86c8f9aa
refs/heads/master
2022-07-31T07:24:41.981208
2020-05-13T12:17:36
2020-05-13T12:17:36
263,592,322
0
0
null
null
null
null
UTF-8
Swift
false
false
943
swift
// // Helper.swift // WEINVEST // // Created by Madhu on 31/08/19. // Copyright © 2019 test. All rights reserved. // import UIKit class Helper { class func getJsonFrom(name : String, ext : String) -> NSDictionary? { if let path = Bundle.main.path(forResource: name, ofType: ext) { do { // get the file path let data = try Data(contentsOf: URL(fileURLWithPath: path), options: .mappedIfSafe) // serialize the json object to Dictionary (Foundation object) let jsonResult = try JSONSerialization.jsonObject(with: data, options: .mutableLeaves) // optional buinding if let jsonResult = jsonResult as? NSDictionary { return jsonResult } } catch { return nil } } return nil } }
[ -1 ]
e6d9c9231240ddc6199721105ca2770e78501507
db8ea44c4a4f79a723fd275453edc2ed6bc3a122
/TripPlanner/Controllers/SettingsViewController.swift
015da165108415816a33ff339d73bf91a8b253c8
[]
no_license
Rebootony/HangoutPlanner
64bdd074dff7c72ba01be0dcbf334ce8bcaa1996
ed1c29930497b3898f0357c11746bd90f24be16d
refs/heads/master
2021-04-09T00:53:17.454531
2020-02-26T08:34:09
2020-02-26T08:34:09
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,851
swift
// // SettingsViewController.swift // TripPlanner // // Created by Hamster on 1/29/20. // Copyright © 2020 Hamster. All rights reserved. // /* SettingsViewController A view controller that manages settings page This is the main VC of all VC associated with settings */ import UIKit import FirebaseAuth class SettingsViewController: UIViewController { // MARK: Properties let transition = MenuSlideInTransition() // MARK: Initializations override func viewDidLoad() { super.viewDidLoad() } // MARK: Handlers @IBAction func didTapMenu(_ sender: Any) { // Executes when side menu button icon is tapped // Instantiate menu view controller guard let menuViewController = storyboard?.instantiateViewController( withIdentifier: "MenuViewController") as? MenuViewController else { return } // Set the closure value of menu VC menuViewController.didTapMenuButton = { selectedMenu in self.showNewController(selectedMenu) } menuViewController.modalPresentationStyle = .overCurrentContext menuViewController.transitioningDelegate = self present(menuViewController, animated: true) } func showNewController(_ selectedMenu: MenuType) { // Takes selected menu as input and present corresponding VC var newViewController: UIViewController switch selectedMenu { case .events: newViewController = (storyboard?.instantiateViewController( withIdentifier: "EventsNavigationViewController"))! case .contacts: newViewController = (storyboard?.instantiateViewController( withIdentifier: "ContactsNavigationViewController"))! case .settings: newViewController = (storyboard?.instantiateViewController( withIdentifier: "SettingsNavigationViewController"))! } // Present VC in fullscreen newViewController.modalPresentationStyle = .fullScreen present(newViewController, animated: false) } } extension SettingsViewController: UIViewControllerTransitioningDelegate { func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { // Asks your delegate for the transition animator object to use // when presenting a view controller transition.isPresenting = true return transition } func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { transition.isPresenting = false return transition } }
[ -1 ]
b052bddd0bf91ed8f5c2e45f210545418c15291c
334150eeaf488a14a6fdadd07129f903417c0291
/YPSwipeableStackView/YPSwipeableStackView/Source/Additional/UIView+Additional.swift
3c83f7eedd289766c7904b4346bbe9159e85013b
[ "MIT" ]
permissive
peteliev/YPSwipeableStackView
0b84c2abffd65612f7a7ffa7388f4ef60216bc3d
cfc025eb123d4caa3a36b91b0779d4f54add0f63
refs/heads/master
2020-05-06T20:00:53.571521
2019-04-15T16:14:29
2019-04-15T16:14:29
180,217,005
13
2
null
null
null
null
UTF-8
Swift
false
false
881
swift
// // UIView+Additional.swift // YPSwipeableStackView // // Created by Zhenya Peteliev on 4/8/19. // Copyright © 2019 Yevhenii Peteliev. All rights reserved. // import UIKit public extension UIView { func embedView(_ viewToEmbed: UIView) { addSubview(viewToEmbed) addConstraints(for: viewToEmbed) } func addConstraints(for embeddedView: UIView) { guard embeddedView.superview == self else { return } embeddedView.translatesAutoresizingMaskIntoConstraints = false addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[view]|", options: .directionLeadingToTrailing, metrics: nil, views: ["view": embeddedView])) addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[view]|", options: .directionLeadingToTrailing, metrics: nil, views: ["view": embeddedView])) } }
[ -1 ]
c4c2014ad80cc7dca21fe2381e073f983d2a5ae1
015473dabd9eef0fa99123851fb3a76885e00e73
/BAAlert-Swift/BAAlert-Swift/BAActionSheetCell.swift
742b932dadc9e096d9a5dadf42fad226b3e7226e
[ "MIT" ]
permissive
BAHome/BAAlert-Swift
134a954f8be98037f7932ae3246eb63079c60757
1c140160632e810ef26b8231f7d0dc2e901c03b1
refs/heads/master
2021-01-20T14:59:11.349247
2018-01-04T09:23:13
2018-01-04T09:23:13
90,700,051
12
0
null
null
null
null
UTF-8
Swift
false
false
1,860
swift
// // BAActionSheetCell.swift // BAAlert-Swift // // Created by boai on 2017/5/15. // Copyright © 2017年 boai. All rights reserved. // import UIKit class BAActionSheetCell: UITableViewCell { var actionSheetType:BAActionSheetType? override func layoutSubviews() { super.layoutSubviews() var min_x : CGFloat = 0.0 var min_y : CGFloat = 0.0 var min_w : CGFloat = 0.0 var min_h : CGFloat = 0.0 min_x = 10 min_y = 7 min_w = 30 min_h = 30 if actionSheetType == .BAActionSheetTypeNormalLeft { if self.imageView?.frame.width == 0 { min_w = 0 } self.imageView?.frame = CGRect(x : min_x, y : min_y, width : min_w, height : min_h) } else if actionSheetType == .BAActionSheetTypeNormalCenter{ if self.imageView?.frame.width == 0 { min_w = 0 min_x = self.center.x - min_w/2.0 - (self.textLabel?.frame.width)!/2.0 - 10 } else { min_x = self.center.x - min_w * 2.0 } self.imageView?.frame = CGRect(x : min_x, y : min_y, width : min_w, height : min_h) } else if actionSheetType == .BAActionSheetTypeExpand{ } min_x = (self.imageView?.frame.maxX)! + 10 min_w = self.frame.width - min_x - 5 self.textLabel?.frame = CGRect(x: min_x , y: (self.textLabel?.frame.minY)!, width: min_w, height: (self.textLabel?.frame.height)!) self.detailTextLabel?.frame = CGRect(x: (self.textLabel?.frame.minX)!, y: (self.detailTextLabel?.frame.minY)!, width: min_w, height: (self.detailTextLabel?.frame.height)!) } }
[ -1 ]
b71cffa151e6b55f6e824b71e051df971b636384
5fc374fce91c983bf899d1f70982cf93e6d29e35
/Pods/thenPromise/Source/Promise.swift
7ba1ac8c4e797b1e1f98159c7fd94192464387cf
[ "MIT" ]
permissive
damianesteban/PromisesAndCaching
6ab5f84c20032cf48c0807ad2d8ed1dbd4e4866b
f66cc47e76172c802133799f8c5ffdbbda45900d
refs/heads/master
2021-01-17T04:25:39.044510
2017-02-23T16:20:49
2017-02-23T16:20:49
82,946,099
0
0
null
null
null
null
UTF-8
Swift
false
false
8,227
swift
// // Promise.swift // then // // Created by Sacha Durand Saint Omer on 06/02/16. // Copyright © 2016 s4cha. All rights reserved. // import Foundation public typealias EmptyPromise = Promise<Void> public class Promise<T> { public typealias ResolveCallBack = (T) -> Void public typealias ProgressCallBack = (Float) -> Void public typealias RejectCallBack = (Error) -> Void public typealias PromiseProgressCallBack = (_ resolve: @escaping ResolveCallBack, _ reject: @escaping RejectCallBack, _ progress: @escaping ProgressCallBack) -> Void fileprivate var promiseProgressCallBack: PromiseProgressCallBack? fileprivate var state: PromiseState<T> = .pending fileprivate var blocks = PromiseBlocks<T>() fileprivate var initialPromiseStart:(() -> Void)? fileprivate var initialPromiseStarted = false fileprivate var promiseStarted = false fileprivate var progress: Float = 0 internal convenience init() { self.init { _, _, _ in } } public convenience init(callback: @escaping (_ resolve: @escaping ResolveCallBack, _ reject: @escaping RejectCallBack) -> Void) { self.init { rs, rj, _ in callback(rs, rj) } } public init(callback: @escaping (_ resolve: @escaping ResolveCallBack, _ reject: @escaping RejectCallBack, _ progress: @escaping ProgressCallBack) -> Void) { promiseProgressCallBack = callback } public func start() { promiseStarted = true if let p = promiseProgressCallBack { p(resolvePromise, rejectPromise, progressPromise) } } fileprivate func passAlongFirstPromiseStartFunctionAndStateTo<X>(_ promise: Promise<X>) { // Pass along First promise start block if let startBlock = self.initialPromiseStart { promise.initialPromiseStart = startBlock } else { promise.initialPromiseStart = self.start } // Pass along initil promise start state. promise.initialPromiseStarted = self.initialPromiseStarted } fileprivate func tryStartInitialPromiseAndStartIfneeded() { if !initialPromiseStarted { initialPromiseStart?() initialPromiseStarted = true } if !promiseStarted { start() } } fileprivate func registerNextPromise<X>(_ block: (T) -> Promise<X>, result: T, resolve: @escaping (X) -> Void, reject: @escaping RejectCallBack) { let nextPromise: Promise<X> = block(result) nextPromise.then { x in resolve(x) }.onError(reject) } } // MARK: - Then public extension Promise { @discardableResult public func then<X>(_ block: @escaping (T) -> X) -> Promise<X> { tryStartInitialPromiseAndStartIfneeded() return registerThen(block) } @discardableResult public func registerThen<X>(_ block: @escaping (T) -> X) -> Promise<X> { let p = Promise<X>() switch state { case let .fulfilled(value): let x: X = block(value) p.resolvePromise(x) case let .rejected(error): p.rejectPromise(error) case .pending: blocks.success.append({ t in p.resolvePromise(block(t)) }) blocks.fail.append(p.rejectPromise) blocks.progress.append(p.progressPromise) } p.start() passAlongFirstPromiseStartFunctionAndStateTo(p) return p } @discardableResult public func then<X>(_ block: @escaping (T) -> Promise<X>) -> Promise<X> { tryStartInitialPromiseAndStartIfneeded() return registerThen(block) } @discardableResult public func registerThen<X>(_ block: @escaping (T) -> Promise<X>) -> Promise<X> { let p = Promise<X>() switch state { case let .fulfilled(value): registerNextPromise(block, result: value, resolve: p.resolvePromise, reject: p.rejectPromise) case let .rejected(error): p.rejectPromise(error) case .pending: blocks.success.append({ t in self.registerNextPromise(block, result: t, resolve: p.resolvePromise, reject: p.rejectPromise) }) blocks.fail.append(p.rejectPromise) } p.start() passAlongFirstPromiseStartFunctionAndStateTo(p) return p } @discardableResult public func then<X>(_ promise: Promise<X>) -> Promise<X> { return then { _ in promise } } @discardableResult public func registerThen<X>(_ promise: Promise<X>) -> Promise<X> { return registerThen { _ in promise } } internal func resolvePromise(_ result: T) { state = .fulfilled(value:result) for sb in blocks.success { sb(result) } blocks.finally() initialPromiseStart = nil } } // MARK: - Error public extension Promise { @discardableResult public func onError(_ block: @escaping (Error) -> Void) -> Promise<Void> { tryStartInitialPromiseAndStartIfneeded() let p = Promise<Void>() switch state { case .fulfilled: p.rejectPromise(NSError(domain: "", code: 123, userInfo: nil)) // No error so do nothing. case let .rejected(error): // Already failed so call error block block(error) p.resolvePromise() case .pending: // if promise fails, resolve error promise blocks.fail.append({ e in block(e) p.resolvePromise() }) blocks.success.append({ _ in p.resolvePromise() }) } blocks.progress.append(p.progressPromise) p.start() passAlongFirstPromiseStartFunctionAndStateTo(p) return p } internal func rejectPromise(_ anError: Error) { state = .rejected(error:anError) for fb in blocks.fail { fb(anError) } blocks.finally() initialPromiseStart = nil } } // MARK: - Progress public extension Promise { @discardableResult public func progress(block: @escaping (Float) -> Void) -> Promise<Void> { tryStartInitialPromiseAndStartIfneeded() let p = Promise<Void>() switch state { case .fulfilled: p.resolvePromise() case let .rejected(error): p.rejectPromise(error) case .pending:() blocks.fail.append(p.rejectPromise) blocks.success.append({ _ in p.resolvePromise() }) } blocks.progress.append({ v in block(v) p.progressPromise(v) }) p.start() passAlongFirstPromiseStartFunctionAndStateTo(p) return p } fileprivate func progressPromise(_ value: Float) { progress = value for pb in blocks.progress { pb(progress) } } } // MARK: - Finally public extension Promise { @discardableResult public func finally<X>(_ block: @escaping () -> X) -> Promise<X> { tryStartInitialPromiseAndStartIfneeded() let p = Promise<X>() switch state { case .fulfilled: p.resolvePromise(block()) case .rejected: p.resolvePromise(block()) case .pending: blocks.fail.append({ _ in p.resolvePromise(block()) }) blocks.success.append({ _ in p.resolvePromise(block()) }) } blocks.progress.append(p.progressPromise) p.start() passAlongFirstPromiseStartFunctionAndStateTo(p) return p } } public extension Promise { public class func reject(error: Error) -> Promise<T> { return Promise { _, reject in reject(error) } } }
[ -1 ]
11dd8319c94dbfccf2f02c3999339979c266c4ed
86cc64fe75cfd56da5438a39670b11e58acea02b
/Checklist/ChecklistViewController.swift
c484aa412d4f53bd7aadfb714d9f25392a18a948
[]
no_license
howtwizer/ios-checklist
043519170123cece38afba088b72996940e45b91
51d08bfd67c42ac5760c14687415b395339f8631
refs/heads/master
2020-04-16T15:06:53.733400
2019-01-14T16:12:42
2019-01-14T16:12:42
165,691,574
0
0
null
null
null
null
UTF-8
Swift
false
false
8,386
swift
// // ViewController.swift // Checklist // // Created by Oleksii Baidan on 12/27/18. // Copyright © 2018 Oleksii Baidan. All rights reserved. // import UIKit class ChecklistViewController: UITableViewController { var todoList: TodoList private func priorityForSectionIndex(_ index: Int) -> TodoList.Priority? { return TodoList.Priority(rawValue: index) } @IBAction func addItem(_ sender: Any) { let newRowIndex = todoList.todoList(for: .medium).count _ = todoList.newTodo() let indexPath = IndexPath(row: newRowIndex, section: 0) let indexPaths = [indexPath] tableView.insertRows(at: indexPaths, with: .automatic) } @IBAction func deleteItems(_ sender: Any) { if let selectedRows = tableView.indexPathsForSelectedRows { for indexPath in selectedRows { if let priority = priorityForSectionIndex(indexPath.section) { let todos = todoList.todoList(for: priority) let rowToDelete = indexPath.row > todos.count - 1 ? todos.count - 1 : indexPath.row let item = todos[rowToDelete] todoList.remove(item, from: priority, at: rowToDelete) } } tableView.beginUpdates() tableView.deleteRows(at: selectedRows, with: .automatic) tableView.endUpdates() } } required init?(coder aDecoder: NSCoder) { todoList = TodoList() super.init(coder: aDecoder) } override func viewDidLoad() { super.viewDidLoad() navigationController?.navigationBar.prefersLargeTitles = true navigationItem.leftBarButtonItem = editButtonItem tableView.allowsMultipleSelectionDuringEditing = true } override func setEditing(_ editing: Bool, animated: Bool) { super.setEditing(editing, animated: true) tableView.setEditing(tableView.isEditing, animated: true) } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if let priority = priorityForSectionIndex(section) { return todoList.todoList(for: priority).count } return 0 } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "ChecklistItem", for: indexPath) // let item = todoList.todos[indexPath.row] if let priority = priorityForSectionIndex(indexPath.section) { let items = todoList.todoList(for: priority) let item = items[indexPath.row] configureText(for: cell, with: item) configureCheckmark(for: cell, with: item) } return cell } override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if tableView.isEditing { return } if let cell = tableView.cellForRow(at: indexPath) { if let priority = priorityForSectionIndex(indexPath.section) { let items = todoList.todoList(for: priority) let item = items[indexPath.row] item.toggleChecked() configureCheckmark(for: cell, with: item) tableView.deselectRow(at: indexPath, animated: true) } } } override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { if let priority = priorityForSectionIndex(indexPath.section) { let item = todoList.todoList(for: priority)[indexPath.row] todoList.remove(item, from: priority, at: indexPath.row) let indexPaths = [indexPath] tableView.deleteRows(at: indexPaths, with: .automatic) } } override func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) { if let sourcePriority = priorityForSectionIndex(sourceIndexPath.section), let destinationPriority = priorityForSectionIndex(destinationIndexPath.section) { let item = todoList.todoList(for: sourcePriority)[sourceIndexPath.row] todoList.move(item: item, from: sourcePriority, at: sourceIndexPath.row, to: destinationPriority, at: destinationIndexPath.row) } tableView.reloadData() } func configureText(for cell: UITableViewCell, with item: ChecklistItem) { if let checkmarkCell = cell as? ChecklistTableViewCell { checkmarkCell.todoTextLabel.text = item.text } } func configureCheckmark(for cell: UITableViewCell, with item: ChecklistItem) { guard let checkmarkCell = cell as? ChecklistTableViewCell else { return } if item.checked { checkmarkCell.checkmarkLabel.text = "√" } else { checkmarkCell.checkmarkLabel.text = "" } } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "AddItemSegue" { if let itemDetailViewControllerDidCancel = segue.destination as? ItemDetailViewController { itemDetailViewControllerDidCancel.delegate = self itemDetailViewControllerDidCancel.todoList = todoList } } else if segue.identifier == "EditItemSegue" { if let itemDetailViewControllerDidCancel = segue.destination as? ItemDetailViewController { if let cell = sender as? UITableViewCell, let indexPath = tableView.indexPath(for: cell), let priority = priorityForSectionIndex(indexPath.section) { let item = todoList.todoList(for: priority)[indexPath.row] itemDetailViewControllerDidCancel.itemToEdit = item itemDetailViewControllerDidCancel.delegate = self } } } } override func numberOfSections(in tableView: UITableView) -> Int { return TodoList.Priority.allCases.count } override func sectionIndexTitles(for tableView: UITableView) -> [String]? { return UILocalizedIndexedCollation.current().sectionTitles } override func tableView(_ tableView: UITableView, sectionForSectionIndexTitle title: String, at index: Int) -> Int { return UILocalizedIndexedCollation.current().section(forSectionIndexTitle: index) } override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { var title: String? = nil if let priority = priorityForSectionIndex(section) { switch priority { case .high: title = "High Priority Todos" case .medium: title = "Medium Priority Todos" case .low: title = "Low Priority Todos" case .no: title = "Someday" } } return title } } extension ChecklistViewController: ItemDetailViewControllerDelegate { func itemDetailViewControllerDidCancelDidCancel(_ controller: ItemDetailViewController) { navigationController?.popViewController(animated: true) } func itemDetailViewControllerDidCancel(_ controller: ItemDetailViewController, didFinishAdding item: ChecklistItem) { navigationController?.popViewController(animated: true) let rowIndex = todoList.todoList(for: .medium).count - 1 let indexPath = IndexPath(row: rowIndex, section: TodoList.Priority.medium.rawValue) let indexPaths = [indexPath] tableView.insertRows(at: indexPaths, with: .automatic) } func itemDetailViewControllerDidCancel(_ controller: ItemDetailViewController, didFinishEditing item: ChecklistItem) { for priority in TodoList.Priority.allCases { let currentList = todoList.todoList(for: priority) if let index = currentList.index(of: item) { let indexPath = IndexPath(row: index, section: priority.rawValue) if let cell = tableView.cellForRow(at: indexPath) { configureText(for: cell, with: item) } } } navigationController?.popViewController(animated: true) } }
[ -1 ]
1a810bc59cdfabd2a2d53be10892a967605879f8
6674291be958b01b22b67a8ef2491db6b944230a
/GMCalendar/Classes/GMCalendar.swift
37f48e6c91ea0604f999a0ef4816ee060cc061c5
[ "MIT" ]
permissive
mohsinalimat/GMCalendar
ab3dde653642ca32d7ebe1a139c52baef7f42093
2b06c5f77356780254298d369611a4f45fe856e4
refs/heads/master
2021-02-11T23:40:37.406305
2020-03-02T21:59:19
2020-03-02T21:59:19
244,539,758
1
0
MIT
2020-03-03T04:16:32
2020-03-03T04:16:31
null
UTF-8
Swift
false
false
29,630
swift
// // CalendarViewPod.swift // CalendarView // // Created by Gianpiero Mode on 20/02/2020. // Copyright © 2020 Gianpiero Mode. All rights reserved. // import UIKit protocol GMCalendarDelegate{ func didSelectedDay(view: UIView, day: Int, isAvailable: Bool) func didUpdateMonth(view: UIView, month: Int, year: Int) } class GMCalendar: UIView { //MARK: - IBOutlets @IBOutlet weak private var content: UIView! //MARK: - Modifiable properties @IBInspectable var monthNameVisible: Bool = true @IBInspectable var borderColor: UIColor = .clear @IBInspectable var borderWidth: CGFloat = 0 @IBInspectable var cornerRadius: CGFloat = 0 @IBInspectable var task1Color: UIColor = .blue @IBInspectable var task2Color: UIColor = .red @IBInspectable var arrowsAvailable: Bool = true @IBInspectable var rightArrowImage: UIImage? = UIImage(named: "right_arrow") @IBInspectable var leftArrowImage: UIImage? = UIImage(named: "left_arrow") @IBInspectable var verticalSwipe: Bool = true @IBInspectable var horizontalSwipe: Bool = true @IBInspectable var animation: Bool = true @IBInspectable var animationDuration: TimeInterval = 0.5 @IBInspectable var colorForDaySelected: UIColor = .red @IBInspectable var widthForView: CGFloat = 360//260 @IBInspectable var heightForView: CGFloat = 360//300 //AnimationType var animationForMonthUpdate: AnimationType = .other var notAvailableDays: [DayModel] = [ DayModel(day: 1, month: 2, year: 2020, task1: true, task1Description: "Prueba", task2: true, task2Description: "Prueba 2"), DayModel(day: 2, month: 3, year: 2020, task1: true, task1Description: "Prueba", task2: true, task2Description: "Prueba 2"), DayModel(day: 3, month: 3, year: 2020, task1: true, task1Description: "Prueba", task2: true, task2Description: "Prueba 2")] var daysWithTasks: [DayModel] = [ DayModel(day: 1, month: 2, year: 2020, task1: true, task1Description: "Prueba", task2: true, task2Description: "Prueba 2"), DayModel(day: 5, month: 2, year: 2020, task1: true, task1Description: "Prueba", task2: true, task2Description: "Prueba 2"), DayModel(day: 7, month: 2, year: 2020, task1: true, task1Description: "Prueba", task2: true, task2Description: "Prueba 2"), DayModel(day: 12, month: 2, year: 2020, task1: true, task1Description: "Prueba", task2: true, task2Description: "Prueba 2"), DayModel(day: 13, month: 2, year: 2020, task1: true, task1Description: "Prueba", task2: true, task2Description: "Prueba 2"), DayModel(day: 20, month: 2, year: 2020, task1: true, task1Description: "Prueba", task2: true, task2Description: "Prueba 2"), DayModel(day: 23, month: 2, year: 2020, task1: true, task1Description: "Prueba", task2: false, task2Description: "Prueba 2")] //MARK: - Not modifiable properties //1 sunday, 2 monday private let firstDay = Calendar.current.firstWeekday private var originalMonth: Int = 2 private var originalYear: Int = 2020 private var currentMonth: Int = 2 private var currentYear: Int = 2020 private var numberOfDaysInMonth: Int = 30 private var currentDate: Date = Date() private var viewForDaySelected: UIView? private var weeksInMonth: Int = 0 private var spaceBetweenMarginAndHeader: CGFloat = 10 private var monthHeader: CGFloat = 25 private var spaceBetweenMonthAndHeader: CGFloat = 20 private var spaceBetweenDays: CGFloat = 5 private var headerHeight: CGFloat = 25 private var spaceBetweenHeaderAndDays: CGFloat = 25 private var verticalSpaceBetweenDays: CGFloat = 20 private var dayHeight: CGFloat = 25 private let cal = Calendar(identifier: .gregorian) private var dayNames: [String] = [] var delegate: GMCalendarDelegate? //MARK: - Life cycle override init(frame: CGRect) { super.init(frame: frame) commonInit() } required init?(coder: NSCoder) { super.init(coder: coder) commonInit() } override func awakeFromNib() { self.initView() } //MARK: - Custom functions func commonInit(){ // let view = UINib(nibName: "\(GMCalendar.self)", bundle: nil).instantiate(withOwner: self, options: nil)[0] as! UIView // view.frame = CGRect(x: 0, y: 0, width: self.widthForView, height: self.heightForView) // view.widthAnchor.constraint(equalToConstant: self.widthForView).isActive = true // view.heightAnchor.constraint(equalToConstant: self.heightForView).isActive = true // self.addSubview(view) let view = UIView(frame: CGRect(x: 0, y: 0, width: self.widthForView, height: self.widthForView)) view.widthAnchor.constraint(equalToConstant: self.widthForView).isActive = true view.heightAnchor.constraint(equalToConstant: self.heightForView).isActive = true let contentview = UIView(frame: CGRect(x: CGFloat(5), y: CGFloat(5), width: (self.widthForView - 10), height: (self.widthForView - 10))) contentview.widthAnchor.constraint(equalToConstant: (self.widthForView - 10)).isActive = true contentview.heightAnchor.constraint(equalToConstant: self.heightForView - 10).isActive = true view.addSubview(contentview) self.content = contentview self.addSubview(view) self.initView() } func initView(){ self.setUpView() self.originalYear = self.currentYear self.originalMonth = self.currentMonth self.dayNames = cal.weekdaySymbols } func setupHeights(){ let viewHeight = self.heightForView self.monthHeader = viewHeight * 0.05 self.spaceBetweenMonthAndHeader = viewHeight * 0.05 self.headerHeight = viewHeight * 0.1 self.spaceBetweenHeaderAndDays = viewHeight * 0.05 let heightForDays = ((viewHeight * 0.65) / CGFloat(self.weeksInMonth)) self.dayHeight = heightForDays * 0.9 self.verticalSpaceBetweenDays = (heightForDays * 0.1) / CGFloat(self.weeksInMonth) } func setUpView(){ self.setUpInitialCalendar() self.setupHeights() if monthNameVisible{ addMonthName() }else{ monthHeader = 0 } addHeaders() addDays() if self.horizontalSwipe{ addHorizontalSwipe() } if self.verticalSwipe{ addVerticalSwipe() } self.content.layer.borderColor = self.borderColor.cgColor self.content.layer.borderWidth = self.borderWidth self.content.layer.cornerRadius = self.cornerRadius } private func setUpInitialCalendar(){ self.currentMonth = cal.component(.month, from: currentDate) self.currentYear = cal.component(.year, from: currentDate) self.weeksInMonth = cal.range(of: .weekOfMonth, in: .month, for: currentDate)!.count if firstDay == 2 { self.weeksInMonth = self.weeksInMonth + 1 } self.numberOfDaysInMonth = cal.range(of: .day, in: .month, for: currentDate)!.count } func addHorizontalSwipe(){ let horizontalLeftSwipe = UISwipeGestureRecognizer(target: self, action: #selector(horizontalLeftSwipe(_:))) horizontalLeftSwipe.direction = .left self.addGestureRecognizer(horizontalLeftSwipe) let horizontalRightSwipe = UISwipeGestureRecognizer(target: self, action: #selector(horizontalRightSwipe(_:))) horizontalRightSwipe.direction = .right self.addGestureRecognizer(horizontalRightSwipe) } func addVerticalSwipe(){ let verticalTopSwipe = UISwipeGestureRecognizer(target: self, action: #selector(verticalTopSwipe(_:))) verticalTopSwipe.direction = .up self.addGestureRecognizer(verticalTopSwipe) let verticalDownSwipe = UISwipeGestureRecognizer(target: self, action: #selector(verticalDownSwipe(_:))) verticalDownSwipe.direction = .down self.addGestureRecognizer(verticalDownSwipe) } func updateViewForNewMonth(){ self.updateCurrentDate() self.cleanContentView() self.setUpView() self.animateView() } func cleanContentView(){ for item in self.content.subviews{ item.removeFromSuperview() } } func updateCurrentDate(){ let formatter = DateFormatter() formatter.dateFormat = "yyyy/MM/dd" let someDateTime = formatter.date(from: "\(currentYear)/\(currentMonth)/\(01)") self.currentDate = someDateTime! } func addMonthName(){ let horizontalStackView = UIStackView(frame: CGRect(x: 0, y: spaceBetweenMarginAndHeader, width: self.frame.width, height: self.monthHeader)) horizontalStackView.axis = .horizontal horizontalStackView.distribution = .fill horizontalStackView.alignment = .center let labelName = UILabel(frame: CGRect(x: 0, y: spaceBetweenMarginAndHeader, width: self.frame.width, height: self.monthHeader)) labelName.text = currentDate.monthAsString().uppercased() labelName.textColor = UIColor.black labelName.textAlignment = .center labelName.font.withSize(25) labelName.adjustsFontSizeToFitWidth = true labelName.minimumScaleFactor = 0.2 labelName.numberOfLines = 1 if self.arrowsAvailable{ //Left Arrow ----- let leftArrowImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: self.monthHeader / 2, height: self.monthHeader / 2)) if self.leftArrowImage != nil{ leftArrowImageView.image = self.leftArrowImage leftArrowImageView.isUserInteractionEnabled = true leftArrowImageView.contentMode = .scaleAspectFit } leftArrowImageView.widthAnchor.constraint(equalToConstant: self.headerHeight).isActive = true let leftTapGesture = UITapGestureRecognizer(target: self, action: #selector(leftArrowSelected(_:))) leftArrowImageView.addGestureRecognizer(leftTapGesture) //Left Arrow ----- let rightArrowImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: self.monthHeader / 2, height: self.monthHeader / 2)) if self.rightArrowImage != nil{ rightArrowImageView.image = self.rightArrowImage rightArrowImageView.isUserInteractionEnabled = true rightArrowImageView.contentMode = .scaleAspectFit } rightArrowImageView.widthAnchor.constraint(equalToConstant: self.headerHeight).isActive = true let rightTapGesture = UITapGestureRecognizer(target: self, action: #selector(rightArrowSelected(_:))) rightArrowImageView.addGestureRecognizer(rightTapGesture) horizontalStackView.addArrangedSubview(leftArrowImageView) horizontalStackView.addArrangedSubview(labelName) horizontalStackView.addArrangedSubview(rightArrowImageView) }else{ horizontalStackView.addArrangedSubview(labelName) } self.content.addSubview(horizontalStackView) } func addHeaders(){ let horizontalStack = UIStackView(frame: CGRect(x: 0, y: spaceBetweenMarginAndHeader + monthHeader + spaceBetweenMonthAndHeader, width: self.bounds.width, height: headerHeight)) horizontalStack.axis = .horizontal horizontalStack.distribution = .fillEqually horizontalStack.spacing = spaceBetweenDays var days = DayItems.allCasesIterable if self.firstDay == 1{ days = [DayItems.sunday, DayItems.monday, DayItems.tuesday, DayItems.wednesday, DayItems.thursday, DayItems.friday, DayItems.saturday] } for item in days{ let widthForHeader = (self.bounds.width / CGFloat(DayItems.allCasesIterable.count)) - (spaceBetweenDays * CGFloat(DayItems.allCasesIterable.count)) let headerLabel = UILabel(frame: CGRect(x: 0, y: 0, width: widthForHeader, height: headerHeight)) headerLabel.textAlignment = .center headerLabel.text = item.getDayName().uppercased() headerLabel.adjustsFontSizeToFitWidth = true headerLabel.minimumScaleFactor = 0.2 headerLabel.numberOfLines = 1 horizontalStack.addArrangedSubview(headerLabel) } self.content.addSubview(horizontalStack) // let leadingConstraint = NSLayoutConstraint(item: horizontalStack, attribute: .leading, relatedBy: .equal, toItem: self.content, attribute: .leading, multiplier: 1, constant: 0) // let trailingConstraint = NSLayoutConstraint(item: horizontalStack, attribute: .trailing, relatedBy: .equal, toItem: self.content, attribute: .trailing, multiplier: 1, constant: 0) // let topConstraint = NSLayoutConstraint(item: horizontalStack, attribute: .top, relatedBy: .equal, toItem: self.content, attribute: .top, multiplier: 1, constant: 0) // horizontalStack.heightAnchor.constraint(equalToConstant: headerHeight).isActive = true // // self.addConstraints([leadingConstraint, trailingConstraint, topConstraint]) // // NSLayoutConstraint.activate([leadingConstraint, trailingConstraint, topConstraint]) } func addDays(){ //let weeksInMonth = cal.range(of: .weekOfMonth, in: .month, for: currentDate)?.count //self.dayHeight = ((self.content.bounds.height - self.spaceBetweenMarginAndHeader - self.monthHeader - self.spaceBetweenMonthAndHeader - self.headerHeight - self.spaceBetweenHeaderAndDays) - (CGFloat(self.weeksInMonth) * (self.verticalSpaceBetweenDays * 1.2))) / CGFloat(self.weeksInMonth) let height = self.frame.height * 0.65//(dayHeight * CGFloat(weeksInMonth)) + (verticalSpaceBetweenDays * CGFloat(weeksInMonth - 1)) //spaceBetweenMarginAndHeader + monthHeader + 10 let verticalStack = UIStackView(frame: CGRect(x: 0, y: (monthHeader + spaceBetweenMonthAndHeader + spaceBetweenMarginAndHeader + headerHeight + spaceBetweenHeaderAndDays), width: self.bounds.width, height: height)) verticalStack.axis = .vertical verticalStack.distribution = .fillEqually verticalStack.spacing = verticalSpaceBetweenDays / 2 var dayCount = 1 let firstDayOfMonth = getFirstDay(week: WeekNumber.first, month: self.currentMonth, year: self.currentYear) let lastDayOfMonth = numberOfDays(month: self.currentMonth, year: self.currentYear) for i in 1...weeksInMonth { let horizontalStack = UIStackView(frame: CGRect(x: 0, y: 0, width: self.bounds.width, height: self.dayHeight)) horizontalStack.axis = .horizontal horizontalStack.spacing = spaceBetweenDays horizontalStack.distribution = .fillEqually for j in 1...7 { let widthForButton = (self.bounds.width / CGFloat(DayItems.allCasesIterable.count)) - (spaceBetweenDays * CGFloat(DayItems.allCasesIterable.count)) let dayLabel = UILabel(frame: CGRect(x: 0, y: 0, width: widthForButton, height: dayHeight)) horizontalStack.addArrangedSubview(dayLabel) //dayLabel.widthAnchor.constraint(equalToConstant: widthForButton).isActive = true dayLabel.textAlignment = .center dayLabel.isUserInteractionEnabled = true dayLabel.adjustsFontSizeToFitWidth = true dayLabel.minimumScaleFactor = 0.2 dayLabel.numberOfLines = 1 var dayAdded = false if (dayCount > self.numberOfDaysInMonth){ dayAdded = false dayCount += 1 }else if (((i == 1)&&(j >= firstDayOfMonth))||((i != 1) && (i < weeksInMonth))){ dayLabel.text = "\(dayCount)" if self.verifyIfDayIsAvailable(day: dayCount, month: self.currentMonth, year: self.currentYear) != nil{ dayLabel.textColor = UIColor.lightGray } dayAdded = true dayCount += 1 }else{ if (i == 1){ dayLabel.text = "" }else if (dayCount <= lastDayOfMonth){ dayLabel.text = "\(dayCount)" if self.verifyIfDayIsAvailable(day: dayCount, month: self.currentMonth, year: self.currentYear) != nil{ dayLabel.textColor = UIColor.lightGray } dayAdded = true dayCount += 1 }else if((i == weeksInMonth) && (j <= lastDayOfMonth)){ dayLabel.text = "\(dayCount)" if self.verifyIfDayIsAvailable(day: dayCount, month: self.currentMonth, year: self.currentYear) != nil{ dayLabel.textColor = UIColor.lightGray } dayAdded = true dayCount += 1 }else{ dayLabel.text = "" } } if dayAdded{ let gestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(selectedDay(_:))) dayLabel.addGestureRecognizer(gestureRecognizer) let day = Int(dayLabel.text!) if let dayTasks = verifyIfDayHaveTasks(day: day!, month: self.currentMonth, year: self.currentYear) as DayModel?{ let yPoint = horizontalStack.frame.height - 6 let point = CGPoint(x: dayLabel.frame.width / 2, y: yPoint) var differenceForTask1: CGFloat = 16 var differenceForTask2: CGFloat = 11 if((dayTasks.task1 && !dayTasks.task2) || (!dayTasks.task1 && dayTasks.task2)){ differenceForTask1 = point.x * 1.5 differenceForTask2 = point.x * 1.5 } if dayTasks.task1{ let viewTask1 = UIView(frame: CGRect(x: point.x + differenceForTask1, y: point.y, width: 3, height: 3)) viewTask1.backgroundColor = self.task1Color viewTask1.roundBourdersUntilCircle() dayLabel.addSubview(viewTask1) } if dayTasks.task2{ let viewTask2 = UIView(frame: CGRect(x: point.x + differenceForTask2, y: point.y, width: 3, height: 3)) viewTask2.backgroundColor = self.task2Color viewTask2.roundBourdersUntilCircle() dayLabel.addSubview(viewTask2) } } } } verticalStack.addArrangedSubview(horizontalStack) //horizontalStack.heightAnchor.constraint(equalToConstant: dayHeight).isActive = true } self.content.addSubview(verticalStack) // let leadingConstraint = NSLayoutConstraint(item: verticalStack, attribute: .leading, relatedBy: .equal, toItem: self.content, attribute: .leading, multiplier: 1, constant: 0) // let trailingConstraint = NSLayoutConstraint(item: verticalStack, attribute: .trailing, relatedBy: .equal, toItem: self.content, attribute: .trailing, multiplier: 1, constant: 0) // let topConstraint = NSLayoutConstraint(item: verticalStack, attribute: .top, relatedBy: .equal, toItem: self.content, attribute: .top, multiplier: 1, constant: 70) // // verticalStack.heightAnchor.constraint(equalToConstant: height).isActive = true // // self.addConstraints([leadingConstraint, trailingConstraint, topConstraint]) // // NSLayoutConstraint.activate([leadingConstraint, trailingConstraint, topConstraint]) } func getFirstDay(week: WeekNumber, month: Int, year: Int)-> Int{ let formatter = DateFormatter() formatter.dateFormat = "yyyy/MM/dd" let someDateTime = formatter.date(from: "\(year)/\(month)/\(1)") var day = Calendar.current.component(.weekday, from: someDateTime!) if self.firstDay == 2{ day -= 1 if day == 0 { day = 7 } } return day } func numberOfDays(month: Int, year: Int) -> Int { let formatter = DateFormatter() formatter.dateFormat = "yyyy/MM/dd" let someDateTime = formatter.date(from: "\(year)/\(month)/\(1)") let daysInMonth = Calendar.current.range(of: .day, in: .month, for: someDateTime!)!.count let someLastDateTime = formatter.date(from: "\(year)/\(month)/\(daysInMonth)") let day = Calendar.current.component(.weekday, from: someLastDateTime!) // if self.firstDay == 2{ // day -= 1 // if day == 0 { // day = 7 // } // } return day } func verifyIfDayHaveTasks(day: Int, month: Int, year: Int) -> DayModel?{ for dayElement in self.daysWithTasks{ if ((dayElement.day == day) && (dayElement.month == month) && (dayElement.year == year)){ return dayElement } } return nil } func verifyIfDayIsAvailable(day: Int, month: Int, year: Int) -> DayModel?{ for dayElement in self.notAvailableDays{ if ((dayElement.day == day) && (dayElement.month == month) && (dayElement.year == year)){ return dayElement } } return nil } } //MARK: - Calendar functions extension GMCalendar{ func verificationForDateUpdate(){ if currentMonth > 12{ self.currentYear += 1 self.currentMonth = 1 }else if currentMonth < 1 { self.currentYear -= 1 self.currentMonth = 12 } } } //MARK: - Animation Functions extension GMCalendar{ func animateView(){ let translate = CGAffineTransform(translationX: 100, y: 100) let rotateRight = CGAffineTransform(rotationAngle: 360) let rotateLeft = CGAffineTransform(rotationAngle: -360) let scale = CGAffineTransform(scaleX: 5, y: 5) if animation{ switch animationForMonthUpdate { case .zoom: DispatchQueue.main.async { UIView.animate(withDuration: self.animationDuration, delay: 0, options: .autoreverse, animations: { self.content.transform = scale }, completion: { _ in self.content.transform = .identity }) } case .xyTraslation: DispatchQueue.main.async { UIView.animate(withDuration: self.animationDuration, delay: 0, options: .autoreverse, animations: { self.content.transform = translate }, completion: { _ in self.content.transform = .identity }) } case .rotationRight: DispatchQueue.main.async { UIView.animate(withDuration: self.animationDuration, delay: 0, options: .autoreverse, animations: { self.content.transform = rotateRight }, completion: { _ in self.content.transform = .identity }) } case .rotationLeft: DispatchQueue.main.async { UIView.animate(withDuration: self.animationDuration, delay: 0, options: .autoreverse, animations: { self.content.transform = rotateLeft }, completion: { _ in self.content.transform = .identity }) } case .rotationRightWithZoom: DispatchQueue.main.async { UIView.animate(withDuration: self.animationDuration, delay: 0, options: .autoreverse, animations: { self.content.transform = rotateRight.concatenating(scale) }, completion: { _ in self.content.transform = .identity }) } case .rotationLeftWithZoom: DispatchQueue.main.async { UIView.animate(withDuration: self.animationDuration, delay: 0, options: .autoreverse, animations: { self.content.transform = rotateLeft.concatenating(scale) }, completion: { _ in self.content.transform = .identity }) } case .other: DispatchQueue.main.async { UIView.animate(withDuration: self.animationDuration, delay: 0, options: .allowUserInteraction, animations: { self.layoutIfNeeded() }, completion: nil) } } } } } //MARK: - Gesture actions extension GMCalendar{ func createViewForDaySelected(label: UILabel){ self.viewForDaySelected?.removeFromSuperview() let xForView = ((label.bounds.maxX - label.bounds.minX) / 2) - (label.bounds.height / 2) let viewForDaySelected = UIView(frame: CGRect(x: xForView, y: 0, width: 0, height: 0)) viewForDaySelected.roundBourdersUntilCircle() viewForDaySelected.backgroundColor = self.colorForDaySelected.withAlphaComponent(0.5) label.addSubview(viewForDaySelected) self.viewForDaySelected = viewForDaySelected if animation { DispatchQueue.main.async { UIView.animate(withDuration: self.animationDuration / 4, animations: { viewForDaySelected.frame = CGRect(x: xForView, y: 0, width: label.bounds.height, height: label.bounds.height) viewForDaySelected.roundBourdersUntilCircle() viewForDaySelected.layoutIfNeeded() }) } }else{ viewForDaySelected.frame = CGRect(x: xForView, y: 0, width: label.bounds.height, height: label.bounds.height) viewForDaySelected.roundBourdersUntilCircle() } } @objc func selectedDay(_ sender: Any){ guard let gesture = sender as? UITapGestureRecognizer else{ return } guard let view = gesture.view as? UILabel else{ return } var day = 0 var available = true if view.text != ""{ day = Int(view.text!)! } if self.verifyIfDayIsAvailable(day: day, month: self.currentMonth, year: self.currentYear) != nil{ available = false } //print("Selected day: ", day) self.createViewForDaySelected(label: view) self.delegate?.didSelectedDay(view: view, day: day, isAvailable: available) } @objc func rightArrowSelected(_ sender: Any){ //print("Right") self.currentMonth += 1 self.verificationForDateUpdate() self.updateViewForNewMonth() //self.delegate?.didUpdateMonth(view: self, month: currentMonth, year: currentYear) } @objc func leftArrowSelected(_ sender: Any){ //print("Left") self.currentMonth -= 1 self.verificationForDateUpdate() self.updateViewForNewMonth() //self.delegate?.didUpdateMonth(view: self, month: currentMonth, year: currentYear) } @objc func horizontalLeftSwipe(_ sender: Any){ //print("Left") self.currentMonth += 1 self.verificationForDateUpdate() self.updateViewForNewMonth() self.delegate?.didUpdateMonth(view: self, month: currentMonth, year: currentYear) } @objc func horizontalRightSwipe(_ sender: Any){ //print("Right") self.currentMonth -= 1 self.verificationForDateUpdate() self.updateViewForNewMonth() self.delegate?.didUpdateMonth(view: self, month: currentMonth, year: currentYear) } @objc func verticalTopSwipe(_ sender: Any){ //print("Top") self.currentMonth -= 1 self.verificationForDateUpdate() self.updateViewForNewMonth() self.delegate?.didUpdateMonth(view: self, month: currentMonth, year: currentYear) } @objc func verticalDownSwipe(_ sender: Any){ //print("Down") self.currentMonth += 1 self.verificationForDateUpdate() self.updateViewForNewMonth() self.delegate?.didUpdateMonth(view: self, month: currentMonth, year: currentYear) } }
[ -1 ]
e9205c02a6b8aca763ed42ef2d5fa821d8d420bd
e97a67715936f811803eead6a1b09669cc61d61d
/Trilly/Other/TrillyCollectionCell.swift
b0080ba72a6b15766f6bb557761004034d5295b8
[]
no_license
d-soto11/Trilly-iOS
cf791c11f8c08d395c5bfd3e70bfda1ee0239981
104240e2805a8c15bd5f79ac4c7d33e37ffbd55a
refs/heads/master
2019-08-28T12:52:04.543329
2017-11-14T03:18:19
2017-11-14T03:18:19
56,779,941
0
0
null
null
null
null
UTF-8
Swift
false
false
490
swift
// // TrillyCollectionCell.swift // Trilly // // Created by Daniel Soto on 10/25/17. // Copyright © 2017 Tres Astronautas. All rights reserved. // import UIKit class TrillyCollectionCell: UICollectionViewCell { public var uiUpdates: ((UICollectionViewCell) -> Void)? override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func layoutSubviews() { super.layoutSubviews() uiUpdates?(self) } }
[ -1 ]
d6e10c7b628836f5091d46b1f7b7c3308d55f8a6
a9dc496ed60e74beda605119ff6f2c636a915416
/ToDo/KeyChainAccessible.swift
5142e05cc70774cf61bf3fbfc1c6a897bdebf949
[]
no_license
dacioleal/ToDo
3b86fc5a6f23cc08bd9b561f18fb3fbe8ad022a7
b4f53a9d387fd31e0df92f1558507bceba07cbab
refs/heads/master
2021-01-11T07:31:34.039909
2016-10-23T16:43:36
2016-10-23T16:43:36
69,093,615
0
0
null
null
null
null
UTF-8
Swift
false
false
391
swift
// // KeyChainAccessible.swift // ToDo // // Created by Dacio Leal Rodriguez on 23/10/16. // Copyright © 2016 Dacio Leal Rodriguez. All rights reserved. // import Foundation protocol KeyChainAccesible { func setPassword(password: String, account: String) func deletePasswordForAccount(account: String) func passwordForAccount(account: String) -> String? }
[ -1 ]
fa03507b1473910b6ee3c11b74d0fb48722f2867
1772c4ec8027c516bf8ce644c33b88e27d19ef2b
/Africa/Modifier/CenterModifier.swift
ae3de860901d55a2d65d04266e5d174508c3ca4b
[]
no_license
mabastu/Africa-SwiftUI
2294317efb789e4ffe048af491188bf1236209fb
9bf6457dcff3a6ca4615e6347d1734919b3d92c8
refs/heads/main
2023-03-30T23:02:41.568863
2021-04-13T20:39:23
2021-04-13T20:39:23
357,344,145
0
0
null
null
null
null
UTF-8
Swift
false
false
277
swift
// // CenterModifier.swift // Africa // // Created by Mabast on 4/4/21. // import SwiftUI struct CenterModifier: ViewModifier { func body(content: Content) -> some View { HStack { Spacer() content Spacer() } } }
[ -1 ]
739491956fd91e3b0899d02c4c1e8ea6e549ac51
7486df44d57448f529bafc247348669ed3f1afaf
/AccountingApp/DatabaseFetchAndSave/ProjectDatabase.swift
0cd1730dd1aa0c8885decd341c0c5d10da66b9fa
[]
no_license
jeewanct/AccountingApp
a6aa10c6889b98ef66d947c5e09c014fdee384f9
40a32b4c2d2eda95ab303d7bc8e440629dd9187d
refs/heads/master
2020-04-14T17:36:00.182204
2019-03-01T18:37:25
2019-03-01T18:37:25
163,986,225
0
0
null
null
null
null
UTF-8
Swift
false
false
10,583
swift
// // ProjectDatabase.swift // AccountingApp // // Created by JEEVAN TIWARI on 22/01/19. // Copyright © 2019 AccountingApp. All rights reserved. // import CoreData import Foundation class ProjectDatabase{ class func saveProjects(projects: [ProjectListModel], appdelegate: AppDelegate) -> PojectEntity?{ ProfileDatabase.deleteData(entityName: "Projects", context: appdelegate) if let projectEntity = NSEntityDescription.insertNewObject(forEntityName: "Projects", into: appdelegate.persistentContainer.viewContext) as? Projects{ if UserHelper.userType() == "1" || UserHelper.userType() == "2"{ projectEntity.canCreateProject = true }else{ projectEntity.canCreateProject = false } for project in projects{ if let projectType = NSEntityDescription.insertNewObject(forEntityName: "ProjectsList", into: appdelegate.persistentContainer.viewContext ) as? ProjectsList{ projectType.projectName = project.ProjectName projectType.sortingStartDate = Helper.convertStringToDate(date: project.StartDate) as? NSDate projectType.sortingStartDate = Helper.convertStringToDate(date: project.EndDate) as? NSDate projectType.createdBy = project.CreatedByName projectType.startDate = Helper.getProjectStartingDate(date: Helper.convertStringToDate(date: project.StartDate)) projectType.endDate = Helper.getProjectStartingDate(date: Helper.convertStringToDate(date: project.EndDate)) if let projectId = project.ProjectID{ projectType.projectId = String(projectId) } if UserHelper.userType() == "1" || UserHelper.userType() == "2"{ projectType.canEditProject = true }else { if let userId = project.UserID{ let (id, _) = CredentialsCheck.usersIdAndHisCompanyId() if String(userId) == id{ projectType.canEditProject = true }else{ projectType.canEditProject = false } } } if let endDate = project.EndDate{ projectType.serverEndDate = String(endDate) } if let startDate = project.StartDate{ projectType.serverStartDate = String(startDate) } projectEntity.addToProjectLists(projectType) if let projectDates = project.projectTasks{ for date in projectDates{ if let projectDatabaseDate = NSEntityDescription.insertNewObject(forEntityName: "ProjectDates", into: appdelegate.persistentContainer.viewContext) as? ProjectDates{ let (dayName, dateName) = Helper.projectDayDate(date: date.TaskDate) projectDatabaseDate.projectDate = dateName projectDatabaseDate.projectDay = dayName if let projectTasks = date.Task{ for task in projectTasks{ if let projectDatabaseTask = NSEntityDescription.insertNewObject(forEntityName: "ProjectTasks", into: appdelegate.persistentContainer.viewContext) as? ProjectTasks{ if let taskId = task.TaskId{ projectDatabaseTask.taskId = String(taskId) } if let projectId = task.ProjectId{ projectDatabaseTask.taskProjectId = String(projectId) } projectDatabaseTask.taskName = task.TaskText projectDatabaseTask.taskDescription = task.Description projectDatabaseDate.addToProjectTaskList(projectDatabaseTask) } } } projectType.addToProjectDatesList(projectDatabaseDate) } } } projectEntity.addToProjectLists(projectType) } } appdelegate.saveContext() } return getProjectsFromDatabase(appdelegate: appdelegate) } class func getProjectsFromDatabase(appdelegate: AppDelegate) -> PojectEntity?{ let fetchRequest = NSFetchRequest<Projects>(entityName: "Projects") do{ let projects = try appdelegate.persistentContainer.viewContext.fetch(fetchRequest) if projects.count > 0{ let projectFromDb = projects[0] let projectEntity = PojectEntity() projectEntity.isCreateProjectHidden = projectFromDb.canCreateProject var projectArray = [ProjectsEntity]() if let projectList = projectFromDb.projectLists { for list in projectList{ let projectDetails = ProjectsEntity() if let savingList = list as? ProjectsList{ projectDetails.canEdit = savingList.canEditProject projectDetails.createdBy = savingList.createdBy projectDetails.startDate = savingList.startDate projectDetails.endDate = savingList.endDate projectDetails.projectId = savingList.projectId projectDetails.projectName = savingList.projectName projectDetails.sort = savingList.sortingStartDate as Date? if let projectDates = savingList.projectDatesList{ var projectDateArray = [ProjectDateEntity]() for dates in projectDates{ if let date = dates as? ProjectDates{ let projectDateModel = ProjectDateEntity() projectDateModel.date = date.projectDate projectDateModel.day = date.projectDay if let projectTasks = date.projectTaskList{ var projectTaskArray = [ProjectTaskEntity]() for task in projectTasks{ if let getTask = task as? ProjectTasks{ let projectTaskEntity = ProjectTaskEntity() projectTaskEntity.taskDescription = getTask.taskDescription projectTaskEntity.taskAndHours = getTask.taskName projectTaskEntity.taskId = getTask.taskId projectTaskEntity.projectId = getTask.taskProjectId projectTaskArray.append(projectTaskEntity) } } projectDateModel.taskList = projectTaskArray } projectDateArray.append(projectDateModel) } } projectDetails.dates = projectDateArray } projectArray.append(projectDetails) } } } projectArray.sort { (value1, value2) -> Bool in if value1.sort! > value2.sort!{ return true } return false } projectEntity.projectList = projectArray if let firstProject = projectArray.first{ projectEntity.currentDisplayDate = firstProject.dates if let firstDate = firstProject.dates?.first?.taskList{ projectEntity.currentDisplayTask = firstDate } } return projectEntity } }catch _{ } return nil } }
[ -1 ]
a6efa85f2bb7e59de776ddcd859b32f59d1c109c
9d6b5cb876650f1176bde07c33ad2a8eceb396ca
/Practica-3/Practica-3/ViewController.swift
5f1a14159694fd34fde7156db89d0eb91e971f81
[ "MIT" ]
permissive
Rubi-AG/Practica3
5bf21e4680c62443eeaf9bb45188f3e058fbc714
4640dd9e1aa66cfe0d334f88273aed815a9624fa
refs/heads/master
2020-04-27T19:28:20.543912
2019-03-08T22:36:59
2019-03-08T22:36:59
174,619,695
0
0
null
null
null
null
UTF-8
Swift
false
false
1,166
swift
// // ViewController.swift // Practica-3 // // Created by Universidad Politecnica de Gómez Palacio on 08/03/19. // Copyright © 2019 Universidad Politecnica de Gómez Palacio. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var txfFullName: UITextField! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. self.txfFullName.text = "Rubi Alvarado" } @IBAction func sendData(_ sender: Any) { //self.txfFullName.text = "Estrella" let fullName : String = self.txfFullName.text ?? "" self.performSegue(withIdentifier: "sgSecondTVC", sender: fullName) } override func prepare (for segue : UIStoryboardSegue, sender : Any?) { if segue.identifier == "sgSecondTVC" { if let secondTVC : SecondTVC = segue.destination as? SecondTVC { if let fullName : String = sender as? String { secondTVC.fullName = fullName } } } } }
[ -1 ]
6f06e499995689d16d8fbf10bf91595d8ab40fc5
f4218ab2d3e93de4fd4abdd7c0bbff58e3785006
/iOS/Application/Source/Foundation/Constants/Environment.swift
34de23e377976eb5a8a068248a4078c50f1f391a
[]
no_license
Narsail/CryptoMarket
c12f9db7a72312c68b2d7163d6d7ed5770cc1e2c
78636c77b707e43adfcd43ed919c9387a026248d
refs/heads/master
2021-01-11T06:20:31.658911
2018-02-06T11:04:53
2018-02-06T11:04:53
69,963,097
0
0
null
null
null
null
UTF-8
Swift
false
false
761
swift
// // Environment.swift // SmartNetworking // // Created by David Moeller on 23.11.17. // Copyright © 2017 David Moeller. All rights reserved. // struct Environment { static let isSimulator: Bool = { #if arch(i386) || arch(x86_64) return true #else return false #endif }() static let isScreenshots: Bool = { #if Screenshots return true #else return false #endif }() static let isDebug: Bool = { #if DEBUG return true #else return false #endif }() static let isIOS11: Bool = { if #available(iOS 11.0, *) { return true } return false }() }
[ -1 ]
66f5d8a4576f37aec1fdb5b1212cc7ecf7fbc00b
ec15fe432a6bac645dbd2c26100e5ccdfae21c63
/BaseMVVM/ViewController.swift
fc6b6df8e22eef0f29cbde9e4f198a5d95d08079
[]
no_license
nguyenkhiemit/IOS-Base-MVVM
ab25071d0e1fb6db322d315a80f710a0b16ae0a1
fe57cc9d53cb3ae97f2a45542a88a2aa4445298e
refs/heads/master
2020-08-29T19:58:12.143660
2019-10-28T22:41:59
2019-10-28T22:41:59
218,156,540
0
0
null
null
null
null
UTF-8
Swift
false
false
321
swift
// // ViewController.swift // BaseMVVM // // Created by Nguyen on 10/29/19. // Copyright © 2019 Apple. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } }
[ 325510, 323334, 324104, 329869, 249229, 189326, 319888, 342547, 316949, 314774, 291223, 245530, 342300, 318109, 314780, 316317, 324512, 135840, 135842, 172578, 340649, 172586, 316331, 242346, 337068, 336557, 241071, 243505, 324018, 172722, 316346, 244411, 294845, 314048, 339520, 323268, 313029, 319815, 323016, 326600, 182474, 316626, 146645, 313182, 354654, 326241, 250212, 321253, 315492, 56044, 215408, 319990, 327033, 314748, 334205 ]
ea0bc55686301aa558e5031787d1e5235ca36271
660b86de881b107449fc035160ea7bcb653a5c73
/GroupedMessages/ChatTableViewController.swift
5afe0965a05a28d1c2455e89c664c088547b7e85
[]
no_license
charlesmartinreed/GroupedMessages
b37be579247a3642d81b786e8134b783ce8e4867
cb1a7be7db1fdc1f58dec328294d90166a02e013
refs/heads/master
2020-04-09T10:16:23.442086
2018-12-04T22:20:10
2018-12-04T22:20:10
160,264,842
0
0
null
null
null
null
UTF-8
Swift
false
false
4,557
swift
// // ViewController.swift // GroupedMessages // // Created by Charles Martin Reed on 12/3/18. // Copyright © 2018 Charles Martin Reed. All rights reserved. // import UIKit struct ChatMessage { var contents: String var isIncoming: Bool let timeStamp: Date } extension Date { //custom dates for our message timestamps static func dateFromCustomString(customString: String) -> Date { let dateFormatter = DateFormatter() dateFormatter.dateFormat = "MM/dd/yyyy" return dateFormatter.date(from: customString) ?? Date() } } class ChatTableViewController: UITableViewController { private let cellId = "id123" //storing dummy data in 2D arrays for easier sectioning let chatMessages = [ [ ChatMessage(contents: "Here's my very first message", isIncoming: true, timeStamp: Date.dateFromCustomString(customString: "08/03/2018")), ChatMessage(contents: "I'm going to message another long message that should word wrap. Pretty sure lorem ipusum would've been a good implementation for this tutorial, but maybe that's no cool anymore?", isIncoming: false, timeStamp: Date.dateFromCustomString(customString: "08/03/2018")) ], [ ChatMessage(contents: "Here's my very first message", isIncoming: false, timeStamp: Date.dateFromCustomString(customString: "08/05/2018")), ChatMessage(contents: "I'm going to message another long message that should word wrap. Pretty sure lorem ipusum would've been a good implementation for this tutorial, but maybe that's no cool anymore? Here's my very first message I'm going to message another long message that should word wrap. Pretty sure lorem ipusum would've been a good implementation for this tutorial, but maybe that's no cool anymore?", isIncoming: true, timeStamp: Date.dateFromCustomString(customString: "08/05/2018")), ChatMessage(contents: "One last message for the road. Thanks for that!", isIncoming: true, timeStamp: Date.dateFromCustomString(customString: "08/05/2018")) ], [ ChatMessage(contents: "Get at me, dawg!", isIncoming: false, timeStamp: Date.dateFromCustomString(customString: "08/17/2018")), ChatMessage(contents: "This message is on the left, in white", isIncoming: true, timeStamp: Date.dateFromCustomString(customString: "08/17/2018")), ChatMessage(contents: "This message is on the right, in black", isIncoming: false, timeStamp: Date.dateFromCustomString(customString: "08/17/2018")) ] ] override func viewDidLoad() { super.viewDidLoad() navigationItem.title = "Messages" navigationController?.navigationBar.prefersLargeTitles = true //registering our cell for dequeuing //registering our ChatMessageCell instead of the regular UITableViewCell tableView.register(ChatMessageCell.self, forCellReuseIdentifier: cellId) tableView.separatorStyle = .none tableView.backgroundColor = UIColor(white: 0.95, alpha: 1) } //MARK:- Delegate methods override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return chatMessages[section].count //using section as our index, we can get number of items in an internal array } override func numberOfSections(in tableView: UITableView) -> Int { return chatMessages.count //should be 3 right now } override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { guard let firstMessageInSection = chatMessages[section].first else { return "Section: \(Date())" } //formatting the date let dateFormatter = DateFormatter() dateFormatter.dateFormat = "MM/dd/yyyy" let dateString = dateFormatter.string(from: firstMessageInSection.timeStamp) return dateString } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: cellId, for: indexPath) as! ChatMessageCell let chatMessage = chatMessages[indexPath.section][indexPath.row] cell.chatMessage = chatMessage //cell.messageLabel.text = chatMessage.contents //cell.isIncoming = chatMessage.isIncoming //odd number rows are "outgoing" or light colored return cell } }
[ -1 ]
cfb30843bd91493eadbbc0fdf474ceef06a0364b
8d72ab2f4fb84f333eb2ad5a504cd36d742b7160
/RufaidaGUI/RufaidaGUI.swift
1114a494f8c342d0f7ee1ba7901e7023a93a8afa
[ "MIT" ]
permissive
rufaidasdn/rufaida-rupa-iosgui
3bedfd88329c1ac2415384d95f057cfd95828f2f
e31c79141899554eaa82a03886da76faea38a913
refs/heads/master
2020-11-24T18:59:19.522311
2019-12-17T02:32:01
2019-12-17T02:32:01
228,301,473
0
0
null
null
null
null
UTF-8
Swift
false
false
424
swift
// // RufaidaGUI.swift // RufaidaGUI // // Created by Md Shahed Hossain on 16/12/2019. // Copyright © 2019 Medical Systems Company Ltd. All rights reserved. // import Foundation public final class HelloWorld: NSObject { public func hello(_ name: String) -> String { return "Hello, \(name)!" } public func info(_ name: String) -> Void { print("INFO: \(self.hello(name))") } }
[ -1 ]
6393b80d3c114b743beaab6fe7fe2983fd849057
2d8e66f33bad795cf151aabcf6db9c980c4475d2
/Test/ViewController.swift
e80f96db91305bac014ec42c0e97cd1b5762e924
[]
no_license
scot-forsyth/myTest
ed0a3ec85b6dee9cb2d6daac7e381f1c03f47680
ba8948f9961ed3b9d4b3003fb00069d33c809a7d
refs/heads/master
2021-01-10T04:06:51.889185
2015-10-19T12:34:09
2015-10-19T12:34:09
44,533,132
0
0
null
null
null
null
UTF-8
Swift
false
false
595
swift
// // ViewController.swift // Test // // Created by Scot Forsyth on 19/10/2015. // Copyright © 2015 Scot Forsyth. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /** Test method for a certain thing */ func testMethod(){ } }
[ 278543, 286775, 288827, 286786, 286796, 237655, 307288, 200802, 309347, 309349, 309351, 309353, 307311, 276612, 280710, 303242, 311437, 278675, 299165, 278693, 100521, 307379, 280760, 280770, 227523, 280772, 280775, 276686, 229585, 307410, 278749, 280797, 278752, 301284, 280808, 280810, 286963, 280821, 286965, 280826, 280832, 276736, 287004, 233767, 307516, 278845, 289088, 289112, 311645, 227688, 313706, 299374, 199024, 276849, 313733, 233869, 285087, 289187, 289190, 289191, 305577, 289196, 305582, 289204, 278968, 127418, 293308, 278973, 279011, 281078, 236022, 233980, 287231, 279041, 279046, 215562, 287243, 281107, 279064, 281118, 295460, 289318, 309807, 281142, 279096, 234043, 129604, 301637, 158285, 311913, 281202, 277108, 117399, 228000, 225955, 287399, 326311, 277171, 299709, 285377, 226009, 291556, 277224, 199402, 312049, 289524, 226038, 234232, 230147, 226055, 299786, 369434, 281373, 228127, 281380, 283433, 289578, 293682, 289596, 283453, 279360, 293700, 277318, 308064, 162672, 277364, 207738, 303998, 183173, 304008, 324491, 304012, 304015, 279442, 226196, 277406, 275358, 234402, 291755, 297903, 324528, 234423, 277432, 293816, 291774, 295874, 299973, 234465, 168936, 289771, 183278, 277487, 277512, 275466, 300057, 304174, 300086, 234551, 300089, 238653, 293961, 203858, 281703, 296042, 277612, 164974, 300149, 234619, 226447, 234641, 349332, 285855, 302256, 283839, 277696, 228551, 279751, 279754, 230604, 298189, 302286, 230608, 290004, 290006, 189655, 302295, 298202, 298206, 363743, 290020, 228585, 120054, 312586, 130346, 234829, 296272, 306540, 333179, 290175, 275842, 224643, 300432, 226705, 310673, 306577, 306578, 288165, 370093, 286126, 277935, 279982, 282035, 292277, 296374, 130487, 306633, 286158, 280015, 310734, 163289, 280028, 280029, 280030, 286175, 282095, 308721, 296436, 302580, 288251, 290299, 290303, 284197, 296487, 296489, 286249, 226878, 288321, 228932, 226887, 226896, 212561, 284242, 292435, 228945, 300629, 276054, 280146, 212573, 40545, 284261, 306791, 286314, 284275, 314996, 284277, 276087, 284279, 292478, 284287, 284289, 284298, 278157, 280219, 284315, 284317, 282270, 282275, 284323, 313007, 284336, 284341, 286390, 300727, 276150, 282301, 296638, 302788, 282311, 284361, 282320, 317137, 284373, 282329, 282338, 282346, 358127, 282357, 358139, 282365, 286462, 282368, 358147, 282377, 300817, 282389, 282393, 278298, 329499, 315170, 282403, 304933, 282411, 159541, 282426, 288579, 307029, 298842, 241499, 298843, 188253, 292701, 296813, 315250, 292730, 284570, 284574, 284577, 284580, 276396, 282548, 298936, 165832, 301012, 301016, 294889, 231405, 227315 ]
e8102a5d44ca3babb5acaf593947ce350d2b4695
d557cb1502e304383db279bd8844e92cc0c0ece7
/JWT/JWT.swift
28e286de77fc5da042ed3bbaf72f315ee0c98f58
[ "BSD-2-Clause", "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
bradeckert/JSONWebToken.swift
061421f869e7dc73ba7bf6b9d17d13ca441f77ec
074eaca9e977e361ff0734f3ba9e280db3f88b34
refs/heads/master
2021-01-21T03:08:38.774638
2015-10-13T17:24:57
2015-10-13T17:24:57
43,328,639
0
0
null
2015-09-28T21:42:52
2015-09-28T21:42:52
null
UTF-8
Swift
false
false
4,277
swift
import Foundation import CryptoSwift public typealias Payload = [String:AnyObject] /// The supported Algorithms public enum Algorithm : CustomStringConvertible { /// No Algorithm, i-e, insecure case None /// HMAC using SHA-256 hash algorithm case HS256(String) /// HMAC using SHA-384 hash algorithm case HS384(String) /// HMAC using SHA-512 hash algorithm case HS512(String) static func algorithm(name:String, key:String?) -> Algorithm? { if name == "none" { if key != nil { return nil // We don't allow nil when we configured a key } return Algorithm.None } else if let key = key { if name == "HS256" { return .HS256(key) } else if name == "HS384" { return .HS384(key) } else if name == "HS512" { return .HS512(key) } } return nil } public var description:String { switch self { case .None: return "none" case .HS256: return "HS256" case .HS384: return "HS384" case .HS512: return "HS512" } } /// Sign a message using the algorithm func sign(message:String) -> String { func signHS(key:String, variant:CryptoSwift.HMAC.Variant) -> String { let keyData = key.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! let messageData = message.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! let mac = Authenticator.HMAC(key: keyData.arrayOfBytes(), variant:variant) let result = mac.authenticate(messageData.arrayOfBytes())! return base64encode(NSData.withBytes(result)) } switch self { case .None: return "" case .HS256(let key): return signHS(key, variant: .sha256) case .HS384(let key): return signHS(key, variant: .sha384) case .HS512(let key): return signHS(key, variant: .sha512) } } /// Verify a signature for a message using the algorithm func verify(message:String, signature:NSData) -> Bool { return sign(message) == base64encode(signature) } } // MARK: Encoding /*** Encode a payload - parameter payload: The payload to sign - parameter algorithm: The algorithm to sign the payload with - returns: The JSON web token as a String */ public func encode(payload:Payload, algorithm:Algorithm) -> String { func encodeJSON(payload:Payload) -> String? { if let data = try? NSJSONSerialization.dataWithJSONObject(payload, options: NSJSONWritingOptions(rawValue: 0)) { return base64encode(data) } return nil } let header = encodeJSON(["alg": algorithm.description])! let payload = encodeJSON(payload)! let signingInput = "\(header).\(payload)" let signature = algorithm.sign(signingInput) return "\(signingInput).\(signature)" } public class PayloadBuilder { var payload = Payload() public var issuer:String? { get { return payload["iss"] as? String } set { payload["iss"] = newValue } } public var audience:String? { get { return payload["aud"] as? String } set { payload["aud"] = newValue } } public var expiration:NSDate? { get { if let expiration = payload["exp"] as? NSTimeInterval { return NSDate(timeIntervalSince1970: expiration) } return nil } set { payload["exp"] = Int(newValue!.timeIntervalSince1970) } } public var notBefore:NSDate? { get { if let notBefore = payload["nbf"] as? NSTimeInterval { return NSDate(timeIntervalSince1970: notBefore) } return nil } set { payload["nbf"] = Int(newValue!.timeIntervalSince1970) } } public var issuedAt:NSDate? { get { if let issuedAt = payload["iat"] as? NSTimeInterval { return NSDate(timeIntervalSince1970: issuedAt) } return nil } set { payload["iat"] = Int(newValue!.timeIntervalSince1970) } } public subscript(key: String) -> AnyObject? { get { return payload[key] } set { payload[key] = newValue } } } public func encode(algorithm:Algorithm, closure:(PayloadBuilder -> ())) -> String { let builder = PayloadBuilder() closure(builder) return encode(builder.payload, algorithm: algorithm) }
[ -1 ]
9f2455516b592382e12c6b6a36ce87456b361961
e8c36171007973b7fad12defd8cae193f71de1c5
/FlixPt1/MovieGridCell.swift
d986c3c622ab5dce9be259cef43bcbd53e029200
[]
no_license
jliby/Flix
42803f961fb84ec750a09d97ed8d674aba5e763b
a7b58dbdcc29ebd80ac243dd614f940b1977cd78
refs/heads/main
2023-08-02T14:25:02.723215
2021-09-20T03:52:06
2021-09-20T03:52:06
null
0
0
null
null
null
null
UTF-8
Swift
false
false
204
swift
// // MovieGridCell.swift // FlixPt1 // // Created by James Luberisse on 9/19/21. // import UIKit class MovieGridCell: UICollectionViewCell { @IBOutlet weak var posterView: UIImageView! }
[ -1 ]
d096c1022ff7eae5726a4bc098121120483d1c0d
ca854ccaa1172582aa4ab3d40f1e6f60dc1b0568
/KeyJam/KeyJam/AppDelegate.swift
db8b3d09c029ff795b13be6180e369799f1354f0
[ "MIT" ]
permissive
thomasdegry/KeyJam
e784763b727ca915f8d3e631cb93dd079ccbbc62
6240d91562adc5564695e42c5e583f43884f3fa3
refs/heads/master
2021-01-12T10:19:13.045447
2016-12-14T02:44:17
2016-12-14T02:44:17
76,420,168
1
0
null
2016-12-14T03:11:48
2016-12-14T03:11:48
null
UTF-8
Swift
false
false
2,234
swift
// // AppDelegate.swift // KeyJam // // Created by Taylor Guidon on 11/7/16. // Copyright © 2016 Taylor Guidon. 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. UIApplication.shared.statusBarStyle = .lightContent 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, 294924, 229388, 327695, 229391, 229394, 229397, 229399, 229402, 278556, 229405, 229408, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 229432, 204856, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 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, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 295220, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 278983, 319945, 278986, 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, 279082, 279084, 172591, 172598, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 303696, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 172655, 172656, 352880, 295538, 189039, 172660, 287349, 189040, 189044, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 287371, 279178, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 287390, 303773, 172705, 287394, 172707, 303780, 164509, 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, 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, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 303976, 336744, 303981, 303985, 303987, 328563, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 304007, 304009, 213895, 304011, 304013, 295822, 189325, 279438, 189329, 295825, 304019, 189331, 58262, 304023, 304027, 279452, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 197580, 312272, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 295945, 230413, 197645, 320528, 140312, 295961, 238620, 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, 337018, 189562, 279679, 304258, 279683, 66690, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 304348, 279777, 304354, 296163, 320740, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 230679, 320792, 230681, 296215, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 288154, 337306, 173472, 288160, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 312759, 279991, 288185, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 148946, 370130, 222676, 288210, 280021, 288212, 288214, 329177, 239064, 288217, 288218, 280027, 239070, 288220, 288224, 370146, 288226, 280036, 288229, 280038, 288230, 288232, 288234, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 206336, 296450, 230916, 230919, 230923, 304651, 304653, 370187, 402969, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 239202, 370279, 312938, 280183, 116354, 288408, 280222, 419489, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 321266, 288499, 419570, 288502, 288510, 124671, 280324, 198405, 288519, 280331, 198416, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 280375, 321336, 296767, 288576, 345921, 337732, 280388, 304968, 280402, 173907, 313171, 313176, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 247688, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 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, 280681, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 288895, 321670, 215175, 141455, 280725, 313498, 275608, 100520, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 280811, 280817, 125171, 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, 280919, 248153, 215387, 354653, 354656, 313700, 313705, 280937, 190832, 280946, 313720, 280956, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289227, 436684, 281047, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 330244, 240132, 223752, 150025, 338440, 281095, 223757, 281102, 223763, 223765, 322074, 281127, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 199262, 338528, 338532, 199273, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 182929, 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, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 183184, 289687, 224151, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 183260, 420829, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281711, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 216303, 322801, 306427, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 216376, 380226, 298306, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 298365, 290174, 306555, 224641, 281987, 298372, 314756, 281990, 224647, 298377, 314763, 142733, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 306608, 282034, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 290305, 306694, 192008, 323084, 257550, 290321, 290325, 282133, 241175, 290328, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282255, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 323260, 282300, 323266, 282310, 282319, 306897, 241362, 306904, 298714, 52959, 282337, 241380, 216806, 323304, 282345, 12011, 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, 298822, 315211, 307027, 315221, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 315251, 315253, 315255, 339838, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 44948, 298901, 241560, 282520, 241563, 241565, 241567, 241569, 241574, 298922, 241581, 241583, 323504, 241586, 290739, 241588, 282547, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 307374, 307376, 299185, 323763, 184503, 299191, 307385, 176311, 258235, 307388, 176316, 307390, 299200, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 299225, 233701, 307432, 282881, 282893, 323854, 291089, 282906, 291104, 233766, 295583, 307508, 315701, 332086, 307510, 307512, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 315739, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 291197, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 291226, 242075, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 291254, 283062, 127417, 291260, 127421, 283069, 127424, 299457, 127429, 127431, 127434, 315856, 127440, 176592, 315860, 176597, 127447, 283095, 299481, 127449, 176605, 160221, 242143, 127455, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127494, 283142, 127497, 233994, 135689, 127500, 233998, 127506, 234003, 234006, 127511, 152087, 283161, 242202, 135707, 234010, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 184952, 135805, 135808, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 299706, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 299740, 201444, 299750, 283368, 234219, 283372, 381677, 185074, 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, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 234321, 234324, 185173, 201557, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 201603, 226182, 234375, 308105, 324490, 226185, 234379, 234384, 234390, 324504, 234393, 209818, 308123, 234396, 324508, 291742, 226200, 234401, 291747, 291748, 234405, 291750, 324518, 324520, 234407, 324522, 234410, 291756, 291754, 226220, 324527, 291760, 234417, 201650, 324531, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 234437, 226245, 234443, 291788, 193486, 234446, 193488, 234449, 275406, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 234501, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 234585, 275545, 242777, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 234627, 275588, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 324757, 234647, 226453, 275606, 234650, 308379, 234648, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 283813, 234661, 234664, 177318, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 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, 349451, 177424, 275725, 283917, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 243003, 283963, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 218473, 136562, 324978, 333178, 275834, 275836, 275840, 316803, 316806, 316811, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 227426, 144820, 374196, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 292414, 284223, 284226, 284228, 243268, 292421, 284231, 226886, 128584, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 235097, 243290, 284249, 284251, 284253, 300638, 284255, 284258, 292452, 292454, 284263, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 325251, 276095, 276098, 284297, 317066, 284299, 317068, 284301, 276109, 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, 284365, 284368, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 276206, 358128, 284399, 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, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 366406, 276295, 292681, 153417, 358224, 276308, 178006, 317271, 284502, 276315, 292700, 317279, 292715, 300912, 292721, 284529, 300915, 292729, 317306, 284540, 292734, 325512, 317332, 358292, 399252, 284564, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292784, 358326, 161718, 358330, 276411, 276418, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 292839, 276455, 350186, 292843, 276460, 178161, 227314, 276466, 325624, 350200, 276472, 317435, 276476, 276479, 350210, 276482, 178181, 317446, 276485, 350218, 276490, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 178224, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 243779, 325700, 284739, 292934, 243785, 350293, 350295, 309337, 194649, 350299, 227418, 350302, 194654, 350304, 178273, 309346, 227423, 194660, 350308, 309350, 309348, 292968, 309352, 350313, 309354, 350316, 301163, 276583, 301167, 276586, 350321, 276590, 227440, 284786, 350325, 252022, 276595, 350328, 292985, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 309491, 227571, 309494, 243960, 227583, 276735, 276739, 227596, 325910, 309530, 342298, 211232, 317729, 211241, 325937, 325943, 211260, 276809, 285002, 276811, 235853, 235858, 276829, 276833, 391523, 276836, 293227, 293232, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 276878, 285077, 227738, 317853, 276896, 317858, 342434, 317864, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 129486, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 113167, 309779, 317971, 309781, 277011, 227877, 227879, 293417, 227882, 309804, 293421, 236082, 23094, 277054, 219714, 129603, 301636, 318020, 301639, 301643, 285265, 399955, 309844, 277080, 309849, 326244, 318055, 277100, 309871, 121458, 170619, 309885, 309888, 277122, 277128, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 318108, 318110, 227998, 137889, 383658, 318128, 277170, 293555, 318132, 154292, 277173, 342707, 277177, 277181, 318144, 277187, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 277223, 342760, 285417, 56043, 56045, 277232, 228081, 56059, 310015, 285441, 310020, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 301884, 293696, 310080, 293706, 277322, 162643, 310100, 301911, 277337, 301913, 301921, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 276579, 293817, 293820, 203715, 326603, 342994, 293849, 293861, 228327, 318442, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 244731, 56313, 285690, 293887, 277507, 277511, 293899, 293908, 302105, 293917, 293939, 318516, 310336, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 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, 294132, 138485, 228601, 204026, 228606, 64768, 310531, 285958, 138505, 228617, 318742, 277798, 130345, 113964, 285997, 384302, 285999, 113969, 318773, 318776, 286010, 417086, 302403, 294211, 384328, 294221, 146765, 294223, 326991, 179547, 146784, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 310657, 351619, 294276, 310659, 327046, 253320, 310665, 318858, 310672, 351633, 310689, 130468, 228776, 277932, 310703, 310710, 130486, 310712, 310715, 302526, 228799, 302534, 310727, 245191, 64966, 302541, 302543, 310737, 286169, 228825, 163290, 310749, 310755, 187880, 310764, 286188, 310772, 40440, 212472, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 302614, 302617, 286233, 302621, 286240, 187936, 146977, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 245288, 310831, 278057, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 310892, 40557, 40560, 294521, 343679, 294537, 310925, 286354, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 302764, 278188, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 294601, 302793, 343757, 212690, 319187, 286420, 229076, 278227, 286425, 319194, 278235, 229086, 278238, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 319290, 229192, 302925, 188247, 188252, 237409, 294776, 360317, 294785, 327554, 360322, 40851, 294811, 237470, 319390, 40865, 319394, 294817, 311209, 180142, 343983, 294831, 188340, 40886, 294844, 294847, 24528, 393177, 294876, 294879, 393190, 294890, 311279, 278513, 237555, 311283, 237562 ]
48ee64ce9d53fc41dde1a82b97ed5d79347c7c97
4c2f680068a520d5c2e4577bbb7ea86a1228ef3e
/iOS/Charter/Charter/Threads View Controller/ThreadsViewController.swift
177133caf5a0b14e28cf73aaf8f4cd14ba8dc7a2
[ "MIT" ]
permissive
bkobilansky/Charter
776737c915e262f23b82887c125c3b141145b393
e84d330d6c74b939caef793c197aa36f98607e74
refs/heads/master
2021-01-16T19:15:38.887227
2016-03-04T10:46:08
2016-03-04T10:46:08
52,130,526
0
0
null
2016-02-20T01:31:16
2016-02-20T01:31:16
null
UTF-8
Swift
false
false
2,640
swift
// // ThreadsViewController.swift // Swift Mailing List // // Created by Matthew Palmer on 29/01/2016. // Copyright © 2016 Matthew Palmer. All rights reserved. // import UIKit protocol ThreadsViewControllerDelegate: class { func threadsViewController(threadsViewController: ThreadsViewController, didSelectEmail email: Email) } class ThreadsViewController: UIViewController, UITableViewDelegate { @IBOutlet weak var tableView: UITableView! private let dataSource: ThreadsViewControllerDataSource weak var delegate: ThreadsViewControllerDelegate? init(dataSource: ThreadsViewControllerDataSource) { self.dataSource = dataSource super.init(nibName: "ThreadsViewController", bundle: nil) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } lazy var refreshControl: UIRefreshControl = { let refreshControl = UIRefreshControl() refreshControl.addTarget(self, action: "didRequestRefresh:", forControlEvents: .ValueChanged) return refreshControl }() override func viewDidLoad() { self.dataSource.registerTableView(tableView) tableView.delegate = self tableView.dataSource = dataSource navigationItem.title = dataSource.mailingList.name tableView.estimatedRowHeight = 80 tableView.rowHeight = UITableViewAutomaticDimension tableView.addSubview(refreshControl) updateSeparatorStyle() } override func viewWillDisappear(animated: Bool) { super.viewWillDisappear(animated) if let selected = tableView.indexPathForSelectedRow { tableView.deselectRowAtIndexPath(selected, animated: true) } } private func updateSeparatorStyle() { if dataSource.isEmpty { tableView.separatorStyle = .None } } func didRequestRefresh(sender: AnyObject) { dataSource.refreshDataFromNetwork { (success) -> Void in self.refreshControl.endRefreshing() self.tableView.reloadData() self.updateSeparatorStyle() } } func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { if dataSource.isEmpty { cell.userInteractionEnabled = false } } func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { delegate?.threadsViewController(self, didSelectEmail: dataSource.emailAtIndexPath(indexPath)) } }
[ -1 ]
8476dc9feeb53bb01d027aee177be4c8922853a5
d1f83d41a26d0d5096c5c50154b2649ec6abada1
/PassengerApp/Screens/ChooseAddressUV.swift
feb4e607b8bd1a03b00ae322a6577288362f2e17
[]
no_license
IbrahimMoGedami/Passenger
722c24282f99410682363ad444b6f4d35212c0f6
5831cc4a1e07610d74e85977d1a0d33173f0ed86
refs/heads/main
2023-04-19T02:46:01.337375
2021-04-17T05:50:12
2021-04-17T05:50:12
358,640,386
0
0
null
null
null
null
UTF-8
Swift
false
false
22,754
swift
// // ChooseAddressUV.swift // PassengerApp // // Created by ADMIN on 09/10/17. // Copyright © 2017 V3Cube. All rights reserved. // import UIKit class ChooseAddressUV: UIViewController, UITableViewDelegate, UITableViewDataSource { @IBOutlet weak var contentView: UIView! @IBOutlet weak var tableView: UITableView! let generalFunc = GeneralFunctions() var userProfileJson:NSDictionary! var bookingType = "" var ufxSelectedVehicleTypeId = "" var ufxSelectedVehicleTypeName = "" var ufxSelectedLatitude = "" var ufxSelectedLongitude = "" var ufxSelectedAddress = "" var ufxSelectedQty = "" var ufXProviderFlow = false var ufxServiceItemDict:NSDictionary! var heightContainerList = [CGFloat]() var loaderView:UIView! var dataArrList = [NSDictionary]() var nextPage_str = 1 var isLoadingMore = false var isNextPageAvail = false var errorLbl:MyLabel! var selectedAddressPosition = -1 var cntView:UIView! var isDataSet = false var isSafeAreaSet = false var companyId = "" var iDriverID = "" var isDeliverAll = "" var selectedAddressID = "" override func viewWillAppear(_ animated: Bool) { self.configureRTLView() GeneralFunctions.postNotificationSignal(key: ConfigPubNub.resumeInst_key, obj: self) } override func viewDidLoad() { super.viewDidLoad() userProfileJson = (GeneralFunctions.getValue(key: Utils.USER_PROFILE_DICT_KEY) as! String).getJsonDataDict().getObj(Utils.message_str) cntView = self.generalFunc.loadView(nibName: "ChooseAddressScreenDesign", uv: self, contentView: contentView) cntView.isHidden = true self.contentView.addSubview(cntView) self.addBackBarBtn() setData() self.tableView.delegate = self self.tableView.dataSource = self self.tableView.bounces = false self.tableView.contentInset = UIEdgeInsets(top: 6, left: 0, bottom: 6, right: 0) self.tableView.tableFooterView = UIView() self.tableView.register(UINib(nibName: "ChooseAddressTVCell", bundle: nil), forCellReuseIdentifier: "ChooseAddressTVCell") let rightButton = UIBarButtonItem(image: UIImage(named: "ic_add_nav_bar")!, style: UIBarButtonItem.Style.plain, target: self, action: #selector(self.openAddNewAddress)) self.navigationItem.rightBarButtonItem = rightButton self.dataArrList.removeAll() self.heightContainerList.removeAll() } override func closeCurrentScreen(){ if(ufXProviderFlow == true){ self.performSegue(withIdentifier: "unwindToUFXCheckOut", sender: self) return } if companyId == "" { super.closeCurrentScreen() }else { self.selectedAddressPosition = -2 self.performSegue(withIdentifier: "unwindToCheckOut", sender: self) } } override func viewDidLayoutSubviews() { if(isSafeAreaSet == false){ if(cntView != nil){ cntView.frame.size.height = cntView.frame.size.height + GeneralFunctions.getSafeAreaInsets().bottom } isSafeAreaSet = true } } override func viewDidAppear(_ animated: Bool) { if(isDataSet == false){ cntView.frame = self.contentView.frame cntView.isHidden = false isDataSet = true getDtata() } } func setData(){ self.navigationItem.title = self.generalFunc.getLanguageLabel(origValue: "Select Address", key: "LBL_SELECT_ADDRESS_TITLE_TXT") self.title = self.generalFunc.getLanguageLabel(origValue: "Select Address", key: "LBL_SELECT_ADDRESS_TITLE_TXT") } func getDtata(){ if(loaderView == nil){ loaderView = self.generalFunc.addMDloader(contentView: self.contentView) loaderView.backgroundColor = UIColor.clear }else if(loaderView != nil && isLoadingMore == false){ loaderView.isHidden = false } if(self.errorLbl != nil){ self.errorLbl.isHidden = true } let parameters = ["type": "DisplayUserAddress", "eUserType": Utils.appUserType, "iUserId": GeneralFunctions.getMemberd(), "page": self.nextPage_str.description, "iCompanyId": self.companyId, "PassengerLat": self.ufxSelectedLatitude, "PassengerLon": self.ufxSelectedLongitude, "iDriverId":self.iDriverID, "eSystem":isDeliverAll] let exeWebServerUrl = ExeServerUrl(dict_data: parameters, currentView: self.view, isOpenLoader: false) exeWebServerUrl.executePostProcess(completionHandler: { (response) -> Void in if(response != ""){ let dataDict = response.getJsonDataDict() if(dataDict.get("Action") == "1"){ let dataArr = dataDict.getArrObj(Utils.message_str) for i in 0 ..< dataArr.count{ let dataTemp = dataArr[i] as! NSDictionary self.dataArrList += [dataTemp] var address = "" if(dataTemp.get("vAddressType") == ""){ address = "\(dataTemp.get("vBuildingNo")), \(dataTemp.get("vLandmark"))\n\(dataTemp.get("vServiceAddress"))" }else{ address = "\(dataTemp.get("vAddressType"))\n\(dataTemp.get("vBuildingNo")), \(dataTemp.get("vLandmark"))\n\(dataTemp.get("vServiceAddress"))" } var addHeight = address.height(withConstrainedWidth: Application.screenSize.width - 80, font: UIFont(name: Fonts().light, size: 15)!) addHeight = addHeight + 45 if(dataTemp.get("eLocationAvailable").uppercased() == "NO"){ addHeight = addHeight + self.generalFunc.getLanguageLabel(origValue: "", key: "LBL_SERVICE_NOT_AVAIL_ADDRESS_RESTRICT").height(withConstrainedWidth: Application.screenSize.width - 50, font: UIFont(name: Fonts().light, size: 14)!) }else{ addHeight = addHeight - 20 } self.heightContainerList += [addHeight + 50] } let NextPage = dataDict.get("NextPage") if(NextPage != "" && NextPage != "0"){ self.isNextPageAvail = true self.nextPage_str = Int(NextPage)! self.addFooterView() }else{ self.isNextPageAvail = false self.nextPage_str = 0 self.removeFooterView() } self.tableView.reloadData() }else{ if(self.isLoadingMore == false){ if(self.errorLbl != nil){ self.errorLbl.isHidden = false }else{ self.errorLbl = GeneralFunctions.addMsgLbl(contentView: self.view, msg: self.generalFunc.getLanguageLabel(origValue: "", key: dataDict.get("message"))) } }else{ self.isNextPageAvail = false self.nextPage_str = 0 self.removeFooterView() } } // self.generalFunc.setError(uv: self, title: "", content: self.generalFunc.getLanguageLabel(origValue: "", key: dataDict.get("message"))) }else{ if(self.isLoadingMore == false){ self.generalFunc.setError(uv: self) } } self.isLoadingMore = false self.loaderView.isHidden = true }) } @objc func openAddNewAddress(){ let addAddressUv = GeneralFunctions.instantiateViewController(pageName: "AddAddressUV") as! AddAddressUV addAddressUv.ufxSelectedLatitude = self.ufxSelectedLatitude addAddressUv.ufxSelectedLongitude = self.ufxSelectedLongitude addAddressUv.ufxSelectedAddress = self.ufxSelectedAddress addAddressUv.ufxSelectedVehicleTypeId = self.ufxSelectedVehicleTypeId addAddressUv.companyId = self.companyId addAddressUv.unwindToChoose = true addAddressUv.ufXProviderFlow = self.ufXProviderFlow self.pushToNavController(uv: addAddressUv) } func numberOfSections(in tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections return 1 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return self.dataArrList.count } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return self.heightContainerList[indexPath.item] } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "ChooseAddressTVCell", for: indexPath) as! ChooseAddressTVCell let dataTemp = self.dataArrList[indexPath.item] var address = "" if(dataTemp.get("vAddressType") == ""){ address = "\(dataTemp.get("vBuildingNo")), \(dataTemp.get("vLandmark"))\n\(dataTemp.get("vServiceAddress"))" }else{ address = "\(dataTemp.get("vAddressType"))\n\(dataTemp.get("vBuildingNo")), \(dataTemp.get("vLandmark"))\n\(dataTemp.get("vServiceAddress"))" } if((self.selectedAddressPosition != -1 && self.selectedAddressPosition == indexPath.item) || selectedAddressID == dataTemp.get("iUserAddressId")){ cell.selectImgView.image = UIImage(named: "ic_select_true") }else{ cell.selectImgView.image = UIImage(named: "ic_select_false") } GeneralFunctions.setImgTintColor(imgView: cell.selectImgView, color: UIColor.UCAColor.AppThemeColor) if(dataTemp.get("eLocationAvailable").uppercased() == "NO"){ cell.selImgCenter.constant = -5 cell.addLblCenter.constant = -5 cell.serviceNotAvailLbl.text = self.generalFunc.getLanguageLabel(origValue: "", key: "LBL_SERVICE_NOT_AVAIL_ADDRESS_RESTRICT") cell.addressLbl.textColor = UIColor(hex: 0x999999) GeneralFunctions.setImgTintColor(imgView: cell.selectImgView, color: UIColor(hex: 0x999999)) }else{ cell.selImgCenter.constant = 0 cell.addLblCenter.constant = 0 cell.serviceNotAvailLbl.text = "" cell.addressLbl.textColor = UIColor.black GeneralFunctions.setImgTintColor(imgView: cell.selectImgView, color: UIColor.UCAColor.AppThemeColor) } cell.addressLbl.text = address cell.addressLbl.fitText() let deleteImg = UIImage(named: "ic_delete_address")!.tint(with: UIColor.UCAColor.AppThemeTxtColor)!.addImagePadding(x: 30, y: 30) cell.deleteImgView.image = deleteImg cell.deleteImgView.layer.addShadow(opacity: 0.8, radius: 2, UIColor.lightGray) cell.deleteImgView.layer.roundCorners(radius: 20) GeneralFunctions.setImgTintColor(imgView: cell.deleteImgView, color: UIColor.UCAColor.AppThemeTxtColor) cell.deleteImgView.tag = indexPath.item let deleteTapGue = UITapGestureRecognizer() deleteTapGue.addTarget(self, action: #selector(self.deleteImgTapped(sender:))) cell.deleteImgView.isUserInteractionEnabled = true cell.deleteImgView.addGestureRecognizer(deleteTapGue) cell.selectionStyle = .none cell.backgroundColor = UIColor.clear return cell } @objc func deleteImgTapped(sender:UITapGestureRecognizer){ self.generalFunc.setAlertMessage(uv: self, title: "", content: self.generalFunc.getLanguageLabel(origValue: "Do you want to delete this address?", key: "LBL_DELETE_CONFIRM_MSG"), positiveBtn: self.generalFunc.getLanguageLabel(origValue: "", key: "LBL_BTN_OK_TXT").uppercased(), nagativeBtn: self.generalFunc.getLanguageLabel(origValue: "", key: "LBL_CANCEL_TXT").uppercased(), completionHandler: { (btnClickedId) in if(btnClickedId == 0){ self.deleteAddress(iUserAddressId: self.dataArrList[sender.view!.tag].get("iUserAddressId")) } }) } func deleteAddress(iUserAddressId:String){ let parameters = ["type":"DeleteUserAddressDetail","iUserId": GeneralFunctions.getMemberd(), "eUserType": Utils.appUserType, "iUserAddressId": iUserAddressId, "PassengerLat": self.ufxSelectedLatitude, "PassengerLon": self.ufxSelectedLongitude] let exeWebServerUrl = ExeServerUrl(dict_data: parameters, currentView: self.view, isOpenLoader: true) exeWebServerUrl.setDeviceTokenGenerate(isDeviceTokenGenerate: false) exeWebServerUrl.currInstance = exeWebServerUrl exeWebServerUrl.executePostProcess(completionHandler: { (response) -> Void in if(response != ""){ let dataDict = response.getJsonDataDict() if(dataDict.get("Action") == "1"){ GeneralFunctions.saveValue(key: Utils.USER_PROFILE_DICT_KEY, value: response as AnyObject) self.generalFunc.setAlertMessage(uv: self, title: "", content: self.generalFunc.getLanguageLabel(origValue: "", key: dataDict.get("message1")), positiveBtn: self.generalFunc.getLanguageLabel(origValue: "", key: "LBL_BTN_OK_TXT"), nagativeBtn: "", completionHandler: { (btnClickedId) in let userProfileJson = (GeneralFunctions.getValue(key: Utils.USER_PROFILE_DICT_KEY) as! String).getJsonDataDict().getObj(Utils.message_str) if(userProfileJson.get("ToTalAddress") != "" && userProfileJson.get("ToTalAddress") != "0"){ self.dataArrList.removeAll() self.heightContainerList.removeAll() self.tableView.reloadData() self.getDtata() }else{ if (self.ufXProviderFlow == true){ GeneralFunctions.removeValue(key: "UFX_PROVIDER_FLOW_ADDRESS_DETAIS") self.performSegue(withIdentifier: "unwindToUFXCheckOut", sender: self) return } if self.companyId == "" { super.closeCurrentScreen() }else { self.selectedAddressPosition = -1 self.performSegue(withIdentifier: "unwindToCheckOut", sender: self) } } }) }else{ self.generalFunc.setError(uv: self, title: "", content: self.generalFunc.getLanguageLabel(origValue: "", key: dataDict.get("message"))) } }else{ self.generalFunc.setError(uv: self) } }) } func checkSelectedAddress(iUserAddressId:String, position:Int, address: String){ let parameters = ["type":"Checkuseraddressrestriction","iUserId": GeneralFunctions.getMemberd(), "UserType": Utils.appUserType, "iUserAddressId": iUserAddressId, "iSelectVehicalId": self.ufxSelectedVehicleTypeId] let exeWebServerUrl = ExeServerUrl(dict_data: parameters, currentView: self.view, isOpenLoader: true) exeWebServerUrl.setDeviceTokenGenerate(isDeviceTokenGenerate: false) exeWebServerUrl.currInstance = exeWebServerUrl exeWebServerUrl.executePostProcess(completionHandler: { (response) -> Void in if(response != ""){ let dataDict = response.getJsonDataDict() if(dataDict.get("Action") == "1"){ if(self.bookingType == "LATER"){ let chooseServiceDateUv = GeneralFunctions.instantiateViewController(pageName: "ChooseServiceDateUV") as! ChooseServiceDateUV chooseServiceDateUv.ufxSelectedVehicleTypeId = self.ufxSelectedVehicleTypeId chooseServiceDateUv.ufxSelectedVehicleTypeName = self.ufxSelectedVehicleTypeName chooseServiceDateUv.ufxSelectedQty = self.ufxSelectedQty chooseServiceDateUv.ufxAddressId = self.dataArrList[position].get("iUserAddressId") chooseServiceDateUv.ufxSelectedLatitude = self.dataArrList[position].get("vLatitude") chooseServiceDateUv.ufxSelectedLongitude = self.dataArrList[position].get("vLongitude") chooseServiceDateUv.serviceAreaAddress = address chooseServiceDateUv.ufxServiceItemDict = self.ufxServiceItemDict self.pushToNavController(uv: chooseServiceDateUv) }else{ let mainScreenUv = GeneralFunctions.instantiateViewController(pageName: "MainScreenUV") as! MainScreenUV mainScreenUv.ufxSelectedVehicleTypeId = self.ufxSelectedVehicleTypeId mainScreenUv.ufxSelectedVehicleTypeName = self.ufxSelectedVehicleTypeName mainScreenUv.ufxSelectedQty = self.ufxSelectedQty mainScreenUv.ufxAddressId = self.dataArrList[position].get("iUserAddressId") mainScreenUv.ufxSelectedLatitude = self.dataArrList[position].get("vLatitude") mainScreenUv.ufxSelectedLongitude = self.dataArrList[position].get("vLongitude") mainScreenUv.ufxServiceItemDict = self.ufxServiceItemDict self.pushToNavController(uv: mainScreenUv) } }else{ self.generalFunc.setError(uv: self, title: "", content: self.generalFunc.getLanguageLabel(origValue: "", key: dataDict.get("message"))) } }else{ self.generalFunc.setError(uv: self) } }) } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let dataTemp = self.dataArrList[indexPath.item] if(dataTemp.get("eLocationAvailable").uppercased() == "NO"){ return } let address = "\(self.dataArrList[indexPath.item].get("vAddressType"))\n\(self.dataArrList[indexPath.item].get("vBuildingNo")), \(self.dataArrList[indexPath.item].get("vLandmark"))\n\(self.dataArrList[indexPath.item].get("vServiceAddress"))" let previousSelectedAddressPosition = self.selectedAddressPosition self.selectedAddressPosition = indexPath.item if(previousSelectedAddressPosition != -1){ self.tableView.reloadRows(at: [IndexPath(row: previousSelectedAddressPosition, section: indexPath.section)], with: .none) } self.tableView.reloadRows(at: [IndexPath(row: indexPath.item, section: indexPath.section)], with: .none) if (ufXProviderFlow == true){ GeneralFunctions.saveValue(key: "UFX_PROVIDER_FLOW_ADDRESS_DETAIS", value: self.dataArrList[indexPath.item]) self.performSegue(withIdentifier: "unwindToUFXCheckOut", sender: self) return } if (self.companyId == "") { checkSelectedAddress(iUserAddressId: self.dataArrList[indexPath.item].get("iUserAddressId"), position: indexPath.item, address: address) }else { self.performSegue(withIdentifier: "unwindToCheckOut", sender: self) } } func scrollViewDidScroll(_ scrollView: UIScrollView) { let currentOffset = scrollView.contentOffset.y; let maximumOffset = scrollView.contentSize.height - scrollView.frame.size.height; if (maximumOffset - currentOffset <= 15) { if(isNextPageAvail==true && isLoadingMore==false){ isLoadingMore=true getDtata() } } } func addFooterView(){ let loaderView = self.generalFunc.addMDloader(contentView: self.tableView, isAddToParent: false) loaderView.backgroundColor = UIColor.clear loaderView.frame = CGRect(x:0, y:0, width: Application.screenSize.width, height: 80) self.tableView.tableFooterView = loaderView self.tableView.tableFooterView?.isHidden = false } func removeFooterView(){ self.tableView.tableFooterView = UIView(frame: CGRect.zero) self.tableView.tableFooterView?.isHidden = true } @IBAction func unwindToChooseAddress(_ segue:UIStoryboardSegue) { if(segue.source.isKind(of: AddAddressUV.self)){ self.dataArrList.removeAll() self.heightContainerList.removeAll() self.tableView.reloadData() getDtata() } } }
[ -1 ]
6e6a36d0856bcce46fba551b4bb27827af9822a8
0ec2737bbb41ff335613ae009f0eee8e97672ced
/HKAnimation/Classes/HKAnimationDescription/HKOpacity.swift
2b371f1bc6e59fd99e5533e976e12b7da574c493
[ "MIT" ]
permissive
xuvw/HKAnimation
f067202330e001dc58761cc92c72d87e5b77f5aa
7f40ea2a35a132127949c1c8455b4c9ec6da234b
refs/heads/master
2021-01-19T10:37:08.695976
2016-07-20T15:09:13
2016-07-20T15:09:13
63,476,813
0
0
null
null
null
null
UTF-8
Swift
false
false
1,385
swift
// // HKOpacity.swift // HKAnimation // // Created by heke on 16/7/12. // Copyright © 2016年 mhk. All rights reserved. // import UIKit class HKOpacity: HKAnimationDescription { override func createAnimation() ->CAAnimation? { if getAnimationType() == AnimationType.Basic { let path = self.path!.rawValue let basicAnimation = CABasicAnimation(keyPath: path) basicAnimation.fromValue = fromValue basicAnimation.toValue = toValue basicAnimation.byValue = byValue basicAnimation.duration = duration basicAnimation.timingFunction = CAMediaTimingFunction(name: pase!) basicAnimation.fillMode = fillMode basicAnimation.removedOnCompletion = false let animationDelegate = HKAnimationProxyDelegate() animationDelegate.animationStartCallback = self.animationStartCallback animationDelegate.animationStopCallback = self.animationStopCallback basicAnimation.delegate = animationDelegate return basicAnimation }else if getAnimationType() == AnimationType.Keyframe { return nil }else { print("params error can not create an Animation!!!!!!") return nil } } }
[ -1 ]
81473c1b22641d522d47f2d12ca778bfb985a3e9
7dda67769177423cfa0eb1750be7720c102b34e0
/Tests/SwiftEOSWithTestableSDKTests/SDK/Platform/GetUserInfoInterfaceTests.swift
c569fd71cda10c021ad134fd52518f208d00d308
[]
no_license
roman-dzieciol/swift-eos
e417638275d901e36eaeb2e9c8fd182145274a98
777655acf1c63fc5ccfaf2fb0061defb80946134
refs/heads/main
2022-07-28T03:01:20.388788
2021-07-24T13:20:38
2021-07-24T13:20:38
382,996,384
0
0
null
null
null
null
UTF-8
Swift
false
false
1,519
swift
import XCTest import EOSSDK @testable import SwiftEOSWithTestableSDK public final class SwiftEOS_Platform_GetUserInfoInterfaceTests: XCTestCase { public func testEOS_Platform_GetUserInfoInterface_Null() throws { try autoreleasepool { GTest.current.reset() // Given implementation for SDK release function __on_EOS_Platform_Release = { Handle in GTest.current.sdkReceived.append("EOS_Platform_Release") XCTAssertNil(Handle) } // Given implementation for SDK function __on_EOS_Platform_GetUserInfoInterface = { Handle in GTest.current.sdkReceived.append("EOS_Platform_GetUserInfoInterface") XCTAssertNil(Handle) return nil } defer { __on_EOS_Platform_GetUserInfoInterface = nil } // Given Actor let object: SwiftEOS_Platform_Actor = SwiftEOS_Platform_Actor(Handle: nil) // When SDK function is called let result: SwiftEOS_UserInfo_Actor = object.GetUserInfoInterface() // Then XCTAssertEqual(GTest.current.sdkReceived, ["EOS_Platform_GetUserInfoInterface"]) XCTAssertNil(result.Handle) } // Then __on_EOS_Platform_Release = nil XCTAssertEqual(GTest.current.sdkReceived, ["EOS_Platform_GetUserInfoInterface", "EOS_Platform_Release"]) } }
[ -1 ]
3d39a2122a02f3446e3f2b40a157755e72c9b596
0371f9204e4ea558ae722fd03a1b155038299f8d
/WeatherDB/WeatherDB/SettingsVC.swift
d37f014a92d75ef93fb3499b0415ca31a5c7874b
[]
no_license
myrithwik/mdb-mini-projects
b56b632c0f58e0a6442d6a835b30de03293f30d7
26f15e965a71873532d2914f7aa9272a14261545
refs/heads/main
2023-07-17T02:13:00.270302
2021-08-28T01:54:29
2021-08-28T01:54:29
339,222,052
0
2
null
null
null
null
UTF-8
Swift
false
false
1,885
swift
// // SettingsVC.swift // WeatherDB // // Created by Rithwik Mylavarapu on 3/31/21. import UIKit class SettingsVC: UIViewController { let placeHolder: UILabel = { let lbl = UILabel() lbl.text = "Place Holder" lbl.translatesAutoresizingMaskIntoConstraints = false return lbl }() lazy var toggleBT: UIButton = { let button = UIButton() button.frame = CGRect(x: 100, y: 100, width: 200, height: 100) button.backgroundColor = #colorLiteral(red: 0.2392156869, green: 0.6745098233, blue: 0.9686274529, alpha: 1) button.isSelected = false button.setTitle("Grid", for: .normal) button.setTitleColor(.white, for: .normal) button.titleLabel?.font = .boldSystemFont(ofSize: 14) button.addTarget(self, action: #selector(handleToggleBT), for: .touchUpInside) button.translatesAutoresizingMaskIntoConstraints = false return button }() @objc func handleToggleBT(sender: UIButton) { sender.isSelected = !sender.isSelected if sender.isSelected { } else { } } override func viewDidLoad() { super.viewDidLoad() view.addSubview(placeHolder) NSLayoutConstraint.activate([ placeHolder.centerXAnchor.constraint(equalTo: view.centerXAnchor), placeHolder.centerYAnchor.constraint(equalTo: view.centerYAnchor) ]) // Do any additional setup after loading the view. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }
[ -1 ]
6a3e417a859d426bbb14a9b737b9be37bf4a980d
7687cb8ed6e476f06dd349c194bb31789894da28
/I Am Rich/AppDelegate.swift
0a7e584e2f61a169e78221e036130f1c5d36d10f
[]
no_license
AronnoDIU/Simple-app-v2-IOS-12
7d7f206629ceb06e6a8691cceba0399272676092
292d3ca4ae0d369e098e2cb438c87aa724f93450
refs/heads/master
2020-05-23T19:49:40.164142
2019-05-16T00:24:05
2019-05-16T00:24:05
186,920,987
0
0
null
null
null
null
UTF-8
Swift
false
false
2,192
swift
// // AppDelegate.swift // I Am Rich // // Created by Yeasir Arafat Aronno on 4/15/19. // Copyright © 2019 Yeasir Arafat Aronno. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: 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, 229391, 327695, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 229426, 237618, 229428, 311349, 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, 278648, 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, 262448, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 287238, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 189039, 172660, 287349, 189040, 189044, 287355, 287360, 295553, 172675, 295557, 287365, 311942, 303751, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 164509, 303773, 172705, 287394, 172707, 303780, 287390, 287398, 205479, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 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, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 213895, 304007, 304009, 304011, 230284, 304013, 295822, 279438, 213902, 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, 295949, 197645, 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, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 66690, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 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, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 279929, 181626, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 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, 288210, 370130, 288212, 222676, 288214, 280021, 239064, 288217, 329177, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 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, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 337732, 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, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 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, 157940, 280819, 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, 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, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 281095, 223752, 150025, 338440, 330244, 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, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 240519, 322440, 314249, 338823, 183184, 142226, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 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, 196133, 282295, 282300, 323260, 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, 148946, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 44948, 298901, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 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, 176311, 299191, 307385, 307386, 307388, 258235, 307390, 176316, 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, 110926, 282957, 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, 194654, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 127434, 315856, 176592, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 283142, 127494, 127497, 233994, 135689, 127500, 291341, 233998, 127506, 234003, 234006, 127511, 152087, 283161, 242202, 135707, 234010, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 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, 226053, 234246, 226056, 234248, 291593, 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, 292433, 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, 201603, 226182, 234375, 308105, 226185, 234379, 324490, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 226200, 234396, 234398, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 324522, 234410, 291756, 226220, 291754, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 275384, 324536, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 226245, 234437, 234439, 226239, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 275606, 275608, 234650, 324757, 234648, 300189, 324766, 119967, 234653, 308379, 283805, 234657, 324768, 300197, 234661, 283813, 234664, 242852, 275626, 234667, 177318, 316596, 308414, 234687, 300226, 308418, 234692, 300229, 308420, 308422, 226500, 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, 283917, 177424, 275725, 349451, 349464, 415009, 283939, 259367, 283951, 292143, 300344, 226617, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 144796, 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, 227440, 316917, 308727, 292343, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 292414, 284223, 284226, 284228, 292421, 226886, 284231, 128584, 243268, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 276053, 284247, 317015, 284249, 243290, 284251, 276052, 284253, 235097, 284255, 300638, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 284290, 325250, 284292, 292485, 292479, 276098, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 292681, 153417, 358224, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 317332, 358292, 284564, 284566, 399252, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 276402, 358326, 161718, 358330, 276410, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 292843, 276460, 292845, 276464, 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, 194649, 227418, 350302, 227423, 350304, 178273, 309346, 194657, 194660, 350308, 309350, 309348, 292968, 309352, 227426, 276579, 227430, 276583, 309354, 301167, 276590, 350321, 350313, 350316, 284786, 350325, 252022, 276595, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 227571, 309491, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 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, 227810, 293346, 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, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 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, 310080, 293696, 277317, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 244731, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 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, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 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, 64966, 245191, 163272, 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, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 278057, 310831, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286313, 40554, 286312, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 319163, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 278227, 286420, 229076, 286425, 319194, 278235, 301163, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 188252, 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, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
068d77fa3ddaf14a013da96bebdf08a6422c8331
55d9b1c2fcb4336302e887ea8da4a9c80dd4e7dd
/Wikipedia/Code/ArticleCollectionViewCell.swift
c2ad197252f37e1be04853d2e91c2987a26f6fa0
[ "MIT" ]
permissive
ryanshih7206/wikipedia-ios
0b893915323c19a97fe37478f088775c3886d35b
2e5f312f0b515567b8e33758c42a341c6b7805c7
refs/heads/develop
2020-05-19T07:19:34.819547
2019-05-03T13:45:38
2019-05-03T13:45:38
184,892,161
3
0
MIT
2019-06-21T04:13:36
2019-05-04T12:31:08
Swift
UTF-8
Swift
false
false
14,884
swift
import UIKit open class ArticleCollectionViewCell: CollectionViewCell, SwipeableCell, BatchEditableCell { public let titleLabel = UILabel() public let descriptionLabel = UILabel() public let imageView = UIImageView() public var extractLabel: UILabel? public let actionsView = ActionsView() public var alertIcon = UIImageView() public var alertLabel = UILabel() open var alertType: ReadingListAlertType? public var statusView = UIImageView() // the circle that appears next to the article name to indicate the article's status private var _titleHTML: String? = nil private var _titleBoldedString: String? = nil private func updateTitleLabel() { if let titleHTML = _titleHTML { titleLabel.attributedText = titleHTML.byAttributingHTML(with: titleTextStyle, matching: traitCollection, withBoldedString: _titleBoldedString) } else { let titleFont = UIFont.wmf_font(titleTextStyle, compatibleWithTraitCollection: traitCollection) titleLabel.font = titleFont } } public var titleHTML: String? { set { _titleHTML = newValue updateTitleLabel() } get { return _titleHTML } } public func setTitleHTML(_ titleHTML: String?, boldedString: String?) { _titleHTML = titleHTML _titleBoldedString = boldedString updateTitleLabel() } public var actions: [Action] { set { actionsView.actions = newValue updateAccessibilityElements() } get { return actionsView.actions } } open override func setup() { titleTextStyle = .georgiaTitle3 imageView.contentMode = .scaleAspectFill imageView.clipsToBounds = true statusView.clipsToBounds = true imageView.accessibilityIgnoresInvertColors = true titleLabel.isOpaque = true descriptionLabel.isOpaque = true imageView.isOpaque = true contentView.addSubview(alertIcon) contentView.addSubview(alertLabel) contentView.addSubview(statusView) contentView.addSubview(imageView) contentView.addSubview(titleLabel) contentView.addSubview(descriptionLabel) super.setup() } // This method is called to reset the cell to the default configuration. It is called on initial setup and prepareForReuse. Subclassers should call super. override open func reset() { super.reset() _titleHTML = nil _titleBoldedString = nil titleTextStyle = .georgiaTitle3 descriptionTextStyle = .subheadline extractTextStyle = .subheadline saveButtonTextStyle = .mediumFootnote spacing = 3 imageViewDimension = 70 statusViewDimension = 6 alertIconDimension = 12 imageView.wmf_reset() resetSwipeable() isBatchEditing = false isBatchEditable = false actions = [] isAlertLabelHidden = true isAlertIconHidden = true isStatusViewHidden = true updateFonts(with: traitCollection) } override open func updateBackgroundColorOfLabels() { super.updateBackgroundColorOfLabels() titleLabel.backgroundColor = labelBackgroundColor descriptionLabel.backgroundColor = labelBackgroundColor extractLabel?.backgroundColor = labelBackgroundColor alertIcon.backgroundColor = labelBackgroundColor alertLabel.backgroundColor = labelBackgroundColor } open override func safeAreaInsetsDidChange() { super.safeAreaInsetsDidChange() if swipeState == .open { swipeTranslation = swipeTranslationWhenOpen } setNeedsLayout() } var actionsViewInsets: UIEdgeInsets { return safeAreaInsets } public final var statusViewDimension: CGFloat = 0 { didSet { setNeedsLayout() } } public final var alertIconDimension: CGFloat = 0 { didSet { setNeedsLayout() } } public var isStatusViewHidden: Bool = true { didSet { statusView.isHidden = isStatusViewHidden setNeedsLayout() } } public var isAlertLabelHidden: Bool = true { didSet { alertLabel.isHidden = isAlertLabelHidden setNeedsLayout() } } public var isAlertIconHidden: Bool = true { didSet { alertIcon.isHidden = isAlertIconHidden setNeedsLayout() } } public var isDeviceRTL: Bool { return effectiveUserInterfaceLayoutDirection == .rightToLeft } public var isArticleRTL: Bool { return articleSemanticContentAttribute == .forceRightToLeft } open override func sizeThatFits(_ size: CGSize, apply: Bool) -> CGSize { let size = super.sizeThatFits(size, apply: apply) if apply { let layoutMargins = calculatedLayoutMargins let isBatchEditOnRight = isDeviceRTL var batchEditSelectViewWidth: CGFloat = 0 var batchEditX: CGFloat = 0 if isBatchEditingPaneOpen { if isArticleRTL { batchEditSelectViewWidth = isBatchEditOnRight ? layoutMargins.left : layoutMargins.right // left and and right here are really leading and trailing, should change to UIDirectionalEdgeInsets when available } else { batchEditSelectViewWidth = isBatchEditOnRight ? layoutMargins.right : layoutMargins.left } if isBatchEditOnRight { batchEditX = size.width - batchEditSelectViewWidth } else { batchEditX = 0 } } else { if isBatchEditOnRight { batchEditX = size.width } else { batchEditX = 0 - batchEditSelectViewWidth } } let safeX = isBatchEditOnRight ? safeAreaInsets.right : safeAreaInsets.left batchEditSelectViewWidth -= safeX if !isBatchEditOnRight && isBatchEditingPaneOpen { batchEditX += safeX } if isBatchEditOnRight && !isBatchEditingPaneOpen { batchEditX -= batchEditSelectViewWidth } batchEditSelectView?.frame = CGRect(x: batchEditX, y: 0, width: batchEditSelectViewWidth, height: size.height) batchEditSelectView?.layoutIfNeeded() let actionsViewWidth = isDeviceRTL ? max(0, swipeTranslation) : -1 * min(0, swipeTranslation) let x = isDeviceRTL ? 0 : size.width - actionsViewWidth actionsView.frame = CGRect(x: x, y: 0, width: actionsViewWidth, height: size.height) actionsView.layoutIfNeeded() } return size } // MARK - View configuration // These properties can mutate with each use of the cell. They should be reset by the `reset` function. Call setsNeedLayout after adjusting any of these properties public var titleTextStyle: DynamicTextStyle! public var descriptionTextStyle: DynamicTextStyle! public var extractTextStyle: DynamicTextStyle! public var saveButtonTextStyle: DynamicTextStyle! public var imageViewDimension: CGFloat! //used as height on full width cell, width & height on right aligned public var spacing: CGFloat! public var isImageViewHidden = false { didSet { imageView.isHidden = isImageViewHidden setNeedsLayout() } } open override func updateFonts(with traitCollection: UITraitCollection) { super.updateFonts(with: traitCollection) updateTitleLabel() descriptionLabel.font = UIFont.wmf_font(descriptionTextStyle, compatibleWithTraitCollection: traitCollection) extractLabel?.font = UIFont.wmf_font(extractTextStyle, compatibleWithTraitCollection: traitCollection) alertLabel.font = UIFont.wmf_font(.semiboldCaption2, compatibleWithTraitCollection: traitCollection) } // MARK - Semantic content fileprivate var _articleSemanticContentAttribute: UISemanticContentAttribute = .unspecified fileprivate var _effectiveArticleSemanticContentAttribute: UISemanticContentAttribute = .unspecified open var articleSemanticContentAttribute: UISemanticContentAttribute { set { _articleSemanticContentAttribute = newValue updateEffectiveArticleSemanticContentAttribute() setNeedsLayout() } get { return _effectiveArticleSemanticContentAttribute } } // for items like the Save Button that are localized and should match the UI direction public var userInterfaceSemanticContentAttribute: UISemanticContentAttribute { return traitCollection.layoutDirection == .rightToLeft ? .forceRightToLeft : .forceLeftToRight } fileprivate func updateEffectiveArticleSemanticContentAttribute() { if _articleSemanticContentAttribute == .unspecified { let isRTL = effectiveUserInterfaceLayoutDirection == .rightToLeft _effectiveArticleSemanticContentAttribute = isRTL ? .forceRightToLeft : .forceLeftToRight } else { _effectiveArticleSemanticContentAttribute = _articleSemanticContentAttribute } let alignment = _effectiveArticleSemanticContentAttribute == .forceRightToLeft ? NSTextAlignment.right : NSTextAlignment.left titleLabel.textAlignment = alignment titleLabel.semanticContentAttribute = _effectiveArticleSemanticContentAttribute descriptionLabel.semanticContentAttribute = _effectiveArticleSemanticContentAttribute descriptionLabel.textAlignment = alignment extractLabel?.semanticContentAttribute = _effectiveArticleSemanticContentAttribute extractLabel?.textAlignment = alignment } open override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { updateEffectiveArticleSemanticContentAttribute() super.traitCollectionDidChange(previousTraitCollection) } // MARK - Accessibility open override func updateAccessibilityElements() { var updatedAccessibilityElements: [Any] = [] var groupedLabels = [titleLabel, descriptionLabel] if let extract = extractLabel { groupedLabels.append(extract) } updatedAccessibilityElements.append(LabelGroupAccessibilityElement(view: self, labels: groupedLabels, actions: actions)) accessibilityElements = updatedAccessibilityElements } // MARK: - Swipeable var swipeState: SwipeState = .closed { didSet { if swipeState != .closed && actionsView.superview == nil { contentView.addSubview(actionsView) contentView.backgroundColor = backgroundView?.backgroundColor clipsToBounds = true } else if swipeState == .closed && actionsView.superview != nil { actionsView.removeFromSuperview() contentView.backgroundColor = .clear clipsToBounds = false } } } public var swipeTranslation: CGFloat = 0 { didSet { assert(!swipeTranslation.isNaN && swipeTranslation.isFinite) let isArticleRTL = articleSemanticContentAttribute == .forceRightToLeft if isArticleRTL { layoutMarginsInteractiveAdditions.left = 0 - swipeTranslation layoutMarginsInteractiveAdditions.right = swipeTranslation } else { layoutMarginsInteractiveAdditions.right = 0 - swipeTranslation layoutMarginsInteractiveAdditions.left = swipeTranslation } setNeedsLayout() } } private var isBatchEditingPaneOpen: Bool { return batchEditingTranslation > 0 } private var batchEditingTranslation: CGFloat = 0 { didSet { let marginAddition = batchEditingTranslation / 1.5 if isArticleRTL { if isDeviceRTL { layoutMarginsInteractiveAdditions.left = marginAddition } else { layoutMarginsInteractiveAdditions.right = marginAddition } } else { if isDeviceRTL { layoutMarginsInteractiveAdditions.right = marginAddition } else { layoutMarginsInteractiveAdditions.left = marginAddition } } if isBatchEditingPaneOpen, let batchEditSelectView = batchEditSelectView { contentView.addSubview(batchEditSelectView) batchEditSelectView.clipsToBounds = true } setNeedsLayout() } } public override func layoutWidth(for size: CGSize) -> CGFloat { let layoutWidth = super.layoutWidth(for: size) - layoutMarginsInteractiveAdditions.left - layoutMarginsInteractiveAdditions.right return layoutWidth } public var swipeTranslationWhenOpen: CGFloat { let maxWidth = actionsView.maximumWidth let isRTL = effectiveUserInterfaceLayoutDirection == .rightToLeft return isRTL ? actionsViewInsets.left + maxWidth : 0 - maxWidth - actionsViewInsets.right } // MARK: Prepare for reuse func resetSwipeable() { swipeTranslation = 0 swipeState = .closed } // MARK: - BatchEditableCell public var batchEditSelectView: BatchEditSelectView? public var isBatchEditable: Bool = false { didSet { if isBatchEditable && batchEditSelectView == nil { batchEditSelectView = BatchEditSelectView() batchEditSelectView?.isSelected = isSelected } else if !isBatchEditable && batchEditSelectView != nil { batchEditSelectView?.removeFromSuperview() batchEditSelectView = nil } } } public var isBatchEditing: Bool = false { didSet { if isBatchEditing { isBatchEditable = true batchEditingTranslation = BatchEditSelectView.fixedWidth batchEditSelectView?.isSelected = isSelected } else { batchEditingTranslation = 0 } } } override open var isSelected: Bool { didSet { batchEditSelectView?.isSelected = isSelected } } }
[ -1 ]
45a10503bfbdc977cce382025ef7ee3e8567fde3
8ebb21f690a4e5f40b87703adfa07ba7e548db6a
/Package.swift
de6a54e508e546f795e6381f5dbda5a5584394b7
[ "Apache-2.0" ]
permissive
nugu-developers/nugu-ios
1b243f4e3dad32d0df019c241fe85f6ed352f954
dbf36a0b0de42d91c5b579b68912a5cbafde0d56
refs/heads/master
2023-08-09T09:15:06.051660
2023-06-29T06:53:57
2023-06-29T06:53:57
216,749,619
25
31
Apache-2.0
2023-09-14T08:11:45
2019-10-22T07:25:46
Swift
UTF-8
Swift
false
false
5,384
swift
// swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "nugu-ios", platforms: [ .iOS(.v12), .watchOS(.v7) ], products: [ .library( name: "nugu-ios", targets: ["NuguClientKit", "NuguAgents", "NuguUtils", "NuguServiceKit", "NuguLoginKit", "NuguUIKit", "KeenSense", "NuguCore"] ), .library( name: "nugu-core", targets: ["NuguUtils", "NuguCore", "SilverTray"] ) ], dependencies: [ .package(name: "RxSwift", url: "https://github.com/ReactiveX/RxSwift", from: "6.0.0"), .package(name: "NattyLog", url: "https://github.com/nugu-developers/natty-log-ios", from: "1.2.2"), .package(name: "Lottie", url: "https://github.com/airbnb/lottie-ios", from: "3.0.0") ], targets: [ .target( name: "NuguUtils", dependencies: ["RxSwift"], path: "NuguUtils/", exclude: ["Info.plist"] ), .target( name: "NuguObjcUtils", dependencies: [], path: "NuguObjcUtils/", exclude: ["Info.plist"] ), .binaryTarget( name: "TycheCommon", path: "TycheCommon.xcframework" ), .binaryTarget( name: "TycheEpd", path: "TycheEpd.xcframework" ), .binaryTarget( name: "TycheWakeup", path: "TycheWakeup.xcframework" ), .binaryTarget( name: "TycheSpeex", path: "TycheSpeex.xcframework" ), .target( name: "TycheSDK", dependencies: ["TycheCommon", "TycheEpd", "TycheWakeup", "TycheSpeex"], path: "TycheSDK/", exclude: ["Info.plist"], publicHeadersPath: "include/" ), .target( name: "JadeMarble", dependencies: ["NattyLog", "TycheSDK", "TycheCommon", "TycheEpd", "TycheSpeex"], path: "JadeMarble/", exclude: ["Info.plist"], resources: [.process("Resources/skt_epd_model.raw")], linkerSettings: [.linkedLibrary("c++")] ), .target( name: "KeenSense", dependencies: ["NattyLog", "NuguUtils", "TycheSDK"], path: "KeenSense/", exclude: ["Info.plist"], resources: [ .process("Resources/skt_trigger_search_aria.raw"), .process("Resources/skt_trigger_search_tinkerbell.raw"), .process("Resources/skt_trigger_am_aria.raw"), .process("Resources/skt_trigger_am_tinkerbell.raw") ], linkerSettings: [.linkedLibrary("c++")] ), .target( name: "NuguCore", dependencies: ["NuguUtils", "NattyLog"], path: "NuguCore/", exclude: ["Info.plist", "README.md"] ), .binaryTarget( name: "OpusCodec", path: "OpusCodec.xcframework" ), .target( name: "OpusSDK", dependencies: ["OpusCodec"], path: "OpusSDK/", exclude: ["Info.plist"], publicHeadersPath: "include/" ), .target( name: "SilverTray", dependencies: ["NuguUtils", "NuguObjcUtils", "OpusSDK"], path: "SilverTray/", exclude: ["Info.plist"], publicHeadersPath: "inlcude/" ), .target( name: "NuguAgents", dependencies: ["NuguUtils", "NuguCore", "JadeMarble", "KeenSense", "RxSwift", "NattyLog", "SilverTray"], path: "NuguAgents/", exclude: ["Info.plist", "README.md"] ), .target( name: "NuguServiceKit", dependencies: ["NattyLog", "NuguUtils"], path: "NuguServiceKit/", exclude: ["Info.plist", "README.md"] ), .target( name: "NuguUIKit", dependencies: ["NattyLog", "NuguAgents", "NuguUtils", "Lottie"], path: "NuguUIKit/", exclude: ["Info.plist", "README.md"], resources: [ .process("Resources/animations/07_speaking.json"), .process("Resources/animations/06_transition.json"), .process("Resources/animations/05_processing.json"), .process("Resources/animations/04_active.json"), .process("Resources/animations/03_transition.json"), .process("Resources/animations/02_passive.json"), .process("Resources/animations/01_intro.json"), .process("Resources/Assets.xcassets") ] ), .target( name: "NuguLoginKit", dependencies: ["NuguUtils", "NattyLog"], path: "NuguLoginKit/", exclude: ["Info.plist", "README.md"] ), .target( name: "NuguClientKit", dependencies: ["NuguAgents", "NattyLog", "RxSwift", "NuguUtils", "NuguServiceKit", "NuguLoginKit", "NuguUIKit", "KeenSense", "NuguCore"], path: "NuguClientKit/", exclude: ["Info.plist", "README.md"] ), ], swiftLanguageVersions: [.v5] )
[ -1 ]
c942866841b5a70553237d801bea1e4af8dd2b17
f1484d4fa079c304326bcc79d0093577035387d7
/OnboardingTest/SmileView.swift
0fe3225488200726aec402cb9f391dfcdd5ff696
[]
no_license
TravelAdventureGames/OnboardingMerel
3ecb1325e1ee70c253fd08a9b596e736f7fc7350
a805fa4317df75dc69081114fe2e118957b57ee9
refs/heads/master
2020-04-05T14:08:52.470574
2017-07-16T08:38:10
2017-07-16T08:38:10
94,789,543
0
0
null
null
null
null
UTF-8
Swift
false
false
6,009
swift
// // SmileView.swift // OnboardingTest // // Created by Martijn van Gogh on 19-06-17. // Copyright © 2017 Martijn van Gogh. All rights reserved. // import Foundation import UIKit //wordt gecalled vanuit scoreView @IBDesignable class SmileView: UIView { @IBInspectable var scale: CGFloat = 0.9 { didSet{setNeedsDisplay()} } @IBInspectable var mouthCurvature: Double = 1.0 { didSet{ setNeedsDisplay()}} //1 full smile -1 full frown @IBInspectable var eyesOpen: Bool = false { didSet{setNeedsDisplay()}} @IBInspectable var eyeBrowTilt: Double = -1.0 { didSet{setNeedsDisplay()}} // -1 full furrow, 1 fully relax @IBInspectable var color: UIColor = UIColor.white { didSet{setNeedsDisplay()}} @IBInspectable var lineWidth: CGFloat = 5.0 { didSet{setNeedsDisplay()}} func changeScale(_ recognizer: UIPinchGestureRecognizer){ switch recognizer.state { case .changed, .ended: scale *= recognizer.scale recognizer.scale = 1.0 default: break } } fileprivate var skullRadius: CGFloat { return min(bounds.size.width,bounds.size.height)/2*scale } fileprivate var skullCenter: CGPoint { return CGPoint(x: bounds.midX, y: bounds.midY) } fileprivate struct Ratios { static let ScullRadiusToEyeOffset: CGFloat = 3 static let ScullRadiusToEyeRadius: CGFloat = 10 static let ScullRadiusToMouthWidth: CGFloat = 1 static let ScullRadiusToMouthHeigth: CGFloat = 3 static let ScullRadiusToMouthOffset: CGFloat = 3 static let ScullRadiusToBrowOffset: CGFloat = 5 } fileprivate enum Eye { case left case rigth } override init(frame: CGRect) { super.init(frame: frame) commonInit() } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) commonInit() } private func commonInit() { self.clearsContextBeforeDrawing = true self.backgroundColor = .black } fileprivate func pathForCircleCentredAtPoint(midPoint withcenter: CGPoint, withRadius radius: CGFloat)->UIBezierPath { let path = UIBezierPath(arcCenter: withcenter, radius: radius, startAngle: 0.0, endAngle: CGFloat(2*M_PI), clockwise: false) path.lineWidth = lineWidth UIColor.white.set() return path } fileprivate func getEyeCenter(_ eye:Eye)->CGPoint { let eyeOffset = skullRadius/Ratios.ScullRadiusToEyeOffset var eyeCenter = skullCenter eyeCenter.y -= eyeOffset switch eye { case .left: eyeCenter.x -= eyeOffset case .rigth: eyeCenter.x += eyeOffset } return eyeCenter } fileprivate func pathForEye(_ eye:Eye)->UIBezierPath{ let eyeRadius = skullRadius/Ratios.ScullRadiusToEyeRadius let eyeCenter = getEyeCenter(eye) if eyesOpen { return pathForCircleCentredAtPoint(midPoint: eyeCenter, withRadius: eyeRadius) } else { let path = UIBezierPath() path.move(to: CGPoint(x: eyeCenter.x-eyeRadius, y: eyeCenter.y)) path.addLine(to: CGPoint(x: eyeCenter.x+eyeRadius, y: eyeCenter.y)) path.lineWidth = lineWidth return path } } fileprivate func pathForMouth()->UIBezierPath{ let mouthwidth = skullRadius / Ratios.ScullRadiusToMouthWidth let mouthHeigth = skullRadius / Ratios.ScullRadiusToMouthHeigth let mouthOffset = skullRadius / Ratios.ScullRadiusToMouthOffset let mouthRect = CGRect(x: skullCenter.x - mouthwidth/2, y:skullCenter.y+mouthOffset, width: mouthwidth, height: mouthHeigth) let smileOffset = CGFloat(max(-1, min(mouthCurvature,1)))*mouthRect.height let start = CGPoint(x: mouthRect.minX, y: mouthRect.minY) let end = CGPoint(x: mouthRect.maxX, y: mouthRect.minY) let cp1 = CGPoint(x: mouthRect.minX+mouthRect.width/3, y: mouthRect.minY + smileOffset) let cp2 = CGPoint(x: mouthRect.maxX-mouthRect.width/3, y: mouthRect.minY+smileOffset) let path = UIBezierPath() path.move(to: start) path.addCurve(to: end, controlPoint1: cp1, controlPoint2: cp2) path.lineWidth = lineWidth return path } func removeEyebouwAndMouthPaths() { pathForMouth().removeAllPoints() pathForBrow(.left).removeAllPoints() pathForBrow(.rigth).removeAllPoints() pathForEye(.left).removeAllPoints() pathForEye(.rigth).removeAllPoints() } fileprivate func pathForBrow(_ eye: Eye)-> UIBezierPath { var tilt = eyeBrowTilt switch eye { case .left: tilt *= -1.0 case .rigth: break } var browCenter = getEyeCenter(eye) browCenter.y -= skullRadius / Ratios.ScullRadiusToBrowOffset let eyeRadius = skullRadius / Ratios.ScullRadiusToEyeRadius let titleOffset = CGFloat(max(-1, min(tilt,1))) * eyeRadius / 2 let browStart = CGPoint(x: browCenter.x - eyeRadius, y: browCenter.y - titleOffset) let browEnd = CGPoint(x: browCenter.x + eyeRadius, y: browCenter.y + titleOffset) let path = UIBezierPath() path.move(to: browStart) path.addLine(to: browEnd) path.lineWidth = lineWidth return path } override func draw(_ rect: CGRect) { // Drawing code color.set() pathForCircleCentredAtPoint(midPoint: skullCenter, withRadius: skullRadius).stroke() pathForEye(.left).stroke() pathForEye(.rigth).stroke() pathForMouth().stroke() pathForBrow(.left).stroke() pathForBrow(.rigth).stroke() } }
[ -1 ]
609d7e7ce5503e729e7cb7b00f236f3b41e282dd
b405979c6a99a9d066327d3997352db62110ab37
/ElevateTechJam/ElevateTechJam/Model/Model.swift
681530ad60e11d59244673be2f0514a661a44f4b
[ "MIT" ]
permissive
kunaldhiman91/ElevateTechJam
1d18419f938e1cc4137364c2011ee39202498792
4d7092d7df7012e885ada94d40574f941514626d
refs/heads/master
2020-07-29T23:27:59.684524
2019-09-22T15:05:18
2019-09-22T15:05:18
210,001,337
0
0
null
null
null
null
UTF-8
Swift
false
false
666
swift
// // Model.swift // ElevateTechJam // // Created by Kunal Kumar on 2019-09-21. // Copyright © 2019 TD. All rights reserved. // import Foundation struct MemberDetail: Codable { var data: [CardDetail] func indexOfCardWithNumber(number:String) -> Int { for i: Int in 0..<data.count { if data[i].card == number { return i } } return -1 } } struct CardDetail: Codable { let name: String? let card: String? var data: [UserData] } struct UserData: Codable { let name: String let phoneNumber: String let amount: String let shouldDisplayCreditCard: Bool }
[ -1 ]
67de3b776da7e06a1a10147a6fd6fbf3e590c210
58cf815770a35a2ca74f96757794ffc3e5df2342
/Gainz/ModifyWorkoutExerciseViewCell.swift
7ac295ca9d8cd0d9ed4bfe4a4f9c055436ac3c0d
[]
no_license
alisonthemonster/Gainz
bde83cab0a96f7f8ee2ce4d8dbd6cb7fb576743b
2a58e40d719f38ae39186739cb5d38595a1b5b95
refs/heads/master
2021-01-10T14:26:52.076509
2016-05-03T21:49:30
2016-05-03T21:49:30
53,874,523
0
0
null
2016-03-24T06:39:52
2016-03-14T16:53:28
Swift
UTF-8
Swift
false
false
2,374
swift
// // ModifyWorkoutExerciseViewCell.swift // Gainz // // Created by Siena McFetridge on 3/16/16. // Copyright © 2016 cs378. All rights reserved. // import UIKit import Parse import ParseUI class ModifyWorkoutExerciseViewCell: PFTableViewCell, UITextFieldDelegate { @IBOutlet weak var nameField: UITextField! @IBOutlet weak var weightField: UITextField! @IBOutlet weak var repsField: UITextField! @IBOutlet weak var setsField: UITextField! var exercise:PFObject? var complete:Bool = false override func awakeFromNib() { self.nameField.delegate = self self.setsField.delegate = self self.repsField.delegate = self self.weightField.delegate = self self.setsField.keyboardType = UIKeyboardType.NumbersAndPunctuation self.repsField.keyboardType = UIKeyboardType.NumbersAndPunctuation self.weightField.keyboardType = UIKeyboardType.NumbersAndPunctuation } func textFieldShouldReturn(textField: UITextField) -> Bool { textField.resignFirstResponder() return true } // Saves exercise data of an exercise as the user finishes editing on any textField func textFieldShouldEndEditing(textField: UITextField) -> Bool { exercise?["name"] = nameField.text setTextFieldInt(setsField, key: "sets") setTextFieldInt(repsField, key: "reps") setTextFieldInt(weightField, key: "weight") exercise?.saveInBackgroundWithBlock{ (success: Bool, error: NSError?) -> Void in if (success) { print ("successful object save") } else { print ("it failed") } } return true } // Checks that all fields are filled with appropriate data func completed() -> Bool { if (nameField.text!.isEmpty || !isValidNum(setsField.text!) || repsField.text!.isEmpty || weightField.text!.isEmpty) { complete = false } else { complete = true } return complete } func isValidNum(str: String) -> Bool { return !str.isEmpty && Int(str) != nil } func setTextFieldInt(textField: UITextField, key: String) { if let num = Int(textField.text!) { exercise?[key] = num } exercise?.saveEventually() } }
[ -1 ]
00ddf336e3c823a2c2555a2aa53d38c998fa4bd8
67774b392629ce65a59b6ec7eff7598268c087e4
/Sources/Models/Subscriptions/Subscription.swift
815b9ce5701f3e5b80d7e7fcfe02bb930e31a554
[]
no_license
BalestraPatrick/stripe
96f8480dce767e57f4c3470c545727b03d152145
8f674b7e420b69f09540c123bd77bdb920c73f11
refs/heads/master
2021-01-20T06:15:06.366399
2017-07-18T02:54:01
2017-07-18T02:54:01
101,496,372
0
0
null
2017-08-26T15:58:14
2017-08-26T15:58:14
null
UTF-8
Swift
false
false
3,668
swift
// // Subscription.swift // Stripe // // Created by Andrew Edwards on 6/6/17. // // import Foundation import Vapor import Helpers /** Subscription Model https://stripe.com/docs/api/curl#subscription_object */ public final class Subscription: StripeModelProtocol { public private(set) var id: String? public private(set) var object: String? public private(set) var cancelAtPeriodEnd: Bool? public private(set) var canceledAt: Date? public private(set) var created: Date? public private(set) var currentPeriodEnd: Date? public private(set) var currentPeriodStart: Date? public private(set) var customer: String? public private(set) var discount: Discount? public private(set) var endedAt: Date? public private(set) var items: SubscriptionItemList? public private(set) var isLive: Bool? public private(set) var plan: Plan? public private(set) var start: Date? public private(set) var status: StripeSubscriptionStatus? public private(set) var trialStart: Date? /** Only these values ore mutable/updatable https://stripe.com/docs/api/curl#update_subscription */ public private(set) var applicationFeePercent: Double? public private(set) var metadata: Node? public private(set) var quantity: Int? public private(set) var taxPercent: Double? public private(set) var trialEnd: Date? public init(node: Node) throws { self.id = try node.get("id") self.object = try node.get("object") self.applicationFeePercent = try node.get("application_fee_percent") self.cancelAtPeriodEnd = try node.get("cancel_at_period_end") self.canceledAt = try node.get("canceled_at") self.created = try node.get("created") self.currentPeriodEnd = try node.get("current_period_end") self.currentPeriodStart = try node.get("current_period_start") self.customer = try node.get("customer") self.discount = try node.get("discount") self.endedAt = try node.get("ended_at") self.items = try node.get("items") self.isLive = try node.get("livemode") self.metadata = try node.get("metadata") self.plan = try node.get("plan") self.quantity = try node.get("quantity") self.start = try node.get("start") if let status = node["status"]?.string { self.status = StripeSubscriptionStatus(rawValue: status) } self.taxPercent = try node.get("tax_percent") self.trialEnd = try node.get("trial_end") self.trialStart = try node.get("trial_start") } public func makeNode(in context: Context?) throws -> Node { let object: [String: Any?] = [ "id": self.id, "object": self.object, "application_fee_percent": self.applicationFeePercent, "cancel_at_period_end": self.cancelAtPeriodEnd, "canceled_at": self.canceledAt, "created": self.created, "current_period_end": self.currentPeriodEnd, "current_period_start": self.currentPeriodStart, "customer": self.customer, "discount": self.discount, "ended_at": self.endedAt, "items": self.items, "livemode": self.isLive, "metadata": self.metadata, "plan": self.plan, "quantity": self.quantity, "start": self.start, "status": self.status?.rawValue, "tax_percent": self.taxPercent, "trial_end": self.trialEnd, "trial_start": self.trialStart ] return try Node(node: object) } }
[ -1 ]
ab747b7933a8b1cd69b50cf6ddfb817078dddc2a
e19b18affa4085bbfbf0dd217dce41cce62bfb2c
/WulleApp/ViewController.swift
df88c07928ae648eb4dc7a055b2a59a094d4a082
[]
no_license
NLaza/WulleApp
bc166f4835f24d6f1231eb14ebb6b46c0a6a88da
cbb1bf69c0fd40d58878071e7b05924d878a0f87
refs/heads/master
2021-01-22T04:05:06.742336
2017-02-13T18:54:30
2017-02-13T18:54:30
81,498,718
2
0
null
null
null
null
UTF-8
Swift
false
false
1,362
swift
// // ViewController.swift // WulleApp // // Created by Nico Lazarus on 09.02.17. // Copyright © 2017 Nico Lazarus. All rights reserved. // import UIKit class ViewController: UIViewController { var luegenWulle = "lügenwulle.jpg" var luegenImage: UIImage? @IBOutlet weak var luegenSwitch: UISwitch! @IBOutlet weak var sleppSwitch: UISwitch! @IBOutlet weak var label1: UILabel! @IBOutlet weak var imageView: UIImageView! @IBAction func luegenOnOff(_ sender: Any) { if( luegenSwitch.isOn == true) { luegenSwitch.setOn(true, animated: true) } else { luegenSwitch.setOn(true, animated: true) } } @IBAction func sleep(_ sender: Any) { if( sleppSwitch.isOn == true) { label1.text = "Wulle is awake" } else { label1.text = "Wulle is sleeping" } } override func viewDidLoad() { super.viewDidLoad() label1.text = "Wulle is fat" luegenImage = UIImage(named: luegenWulle) imageView = UIImageView(image: luegenImage!) // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ -1 ]
0081d094831033a687b9f93d9e78e6ebc0445473
4ca990be53185b5d73a679cfe78d918a84ac2b75
/StackHorizontalToVerticalTests/StackHorizontalToVerticalTests.swift
f70097febe49c54cefcc08f9f5ed37ba1ddfec0e
[]
no_license
SandsHellCreations/StackView-Animation-
beb799513233bc233250580f7f6e46888afdd403
6ed60ee4fbc5ca861db336c92388d852591c4359
refs/heads/master
2020-04-10T13:23:16.247927
2018-12-09T14:58:54
2018-12-09T14:58:54
null
0
0
null
null
null
null
UTF-8
Swift
false
false
979
swift
// // StackHorizontalToVerticalTests.swift // StackHorizontalToVerticalTests // // Created by Sandeep Kumar on 09/12/18. // Copyright © 2018 Sandeep Kumar. All rights reserved. // import XCTest @testable import StackHorizontalToVertical class StackHorizontalToVerticalTests: XCTestCase { override func 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. } 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. } } }
[ 360462, 229413, 204840, 344107, 155694, 229424, 229430, 163896, 180280, 376894, 352326, 254027, 163917, 196691, 385116, 237663, 254048, 319591, 221290, 319598, 204916, 131191, 131198, 278677, 196760, 426138, 278691, 377009, 278708, 295098, 139479, 229597, 311519, 205035, 327929, 344313, 147717, 368905, 254226, 319763, 368916, 262421, 377114, 237856, 237857, 311597, 98610, 336183, 180535, 287041, 319813, 319821, 344401, 377169, 368981, 155990, 368984, 106847, 98657, 270701, 246127, 270706, 246136, 246137, 139640, 311681, 311685, 106888, 385417, 311691, 385422, 213403, 246178, 385454, 311727, 377264, 319930, 311738, 33211, 336317, 336320, 311745, 254406, 188871, 278993, 278999, 328152, 369116, 287198, 279018, 319981, 319987, 279029, 254456, 377338, 279039, 377343, 254465, 279050, 139792, 303636, 393751, 279065, 377376, 377386, 197167, 385588, 115270, 385615, 426576, 369235, 295519, 139872, 66150, 344680, 139892, 287352, 344696, 311941, 336518, 311945, 369289, 344715, 311949, 287374, 377489, 311954, 352917, 230040, 271000, 377497, 303771, 377500, 205471, 344738, 139939, 295599, 205487, 303793, 336564, 164533, 230072, 287417, 287422, 377539, 164560, 385747, 361176, 418520, 287452, 279269, 246503, 369385, 312052, 312053, 172792, 344827, 221948, 205568, 295682, 336648, 197386, 434957, 312079, 426774, 197399, 426775, 336671, 197411, 295724, 353069, 197422, 353070, 164656, 295729, 328499, 353078, 197431, 336702, 279362, 353094, 353095, 353109, 377686, 230234, 189275, 435039, 295776, 303972, 385893, 246641, 246643, 295798, 246648, 361337, 254850, 369538, 58253, 295824, 140204, 377772, 304051, 230332, 377790, 353215, 353216, 213957, 345033, 279498, 386006, 418776, 50143, 123881, 320494, 271350, 295927, 320507, 328700, 328706, 410627, 320516, 295942, 386056, 353290, 377869, 238610, 418837, 140310, 320536, 336929, 369701, 238639, 312373, 238651, 336960, 377926, 214086, 238664, 205906, 156764, 304222, 173166, 377972, 353397, 337017, 377983, 402565, 386189, 296086, 238743, 296092, 238765, 238769, 402613, 337077, 230588, 353479, 353482, 402634, 189653, 419029, 148696, 296153, 304351, 222440, 328940, 353523, 386294, 386301, 320770, 386306, 312587, 328971, 353551, 320796, 222494, 353584, 345396, 386359, 345402, 312634, 378172, 279875, 312648, 337225, 304456, 230729, 238927, 353616, 378209, 386412, 312689, 296307, 116084, 337281, 148867, 296329, 304524, 296335, 9619, 370071, 173491, 304564, 353719, 361927, 296392, 280010, 280013, 239068, 280032, 271843, 329197, 329200, 296433, 288249, 230921, 329225, 296461, 304656, 329232, 370197, 402985, 394794, 312880, 288309, 312889, 280130, 288327, 239198, 99938, 345700, 312940, 222832, 247416, 288378, 337534, 337535, 263809, 288392, 239250, 419478, 206504, 321199, 337591, 321207, 280251, 321219, 403148, 9936, 313041, 9937, 370388, 272085, 345814, 181975, 18138, 345821, 321247, 321249, 345833, 345834, 280300, 239341, 67315, 173814, 288512, 288516, 280327, 321302, 345879, 321310, 255776, 247590, 362283, 378668, 296755, 321337, 345919, 436031, 403267, 345929, 18262, 362327, 280410, 345951, 362337, 345955, 296806, 280430, 214895, 313199, 362352, 182144, 305026, 247686, 329622, 337815, 436131, 436137, 362417, 362431, 280514, 174019, 214984, 362443, 329695, 436191, 313319, 174057, 296941, 436205, 329712, 362480, 313339, 43014, 354316, 313357, 239650, 223268, 329765, 354343, 354345, 223274, 346162, 288828, 436285, 288833, 288834, 436292, 403525, 313416, 436301, 354385, 338001, 338003, 280661, 329814, 338007, 354393, 280675, 329829, 321637, 280677, 43110, 436329, 288879, 288889, 215164, 313469, 215166, 280712, 346271, 436383, 362659, 239793, 182456, 280762, 379071, 280768, 338119, 149703, 346314, 321745, 387296, 280802, 379106, 338150, 346346, 321772, 436470, 149760, 411906, 313608, 272658, 338197, 338218, 321840, 379186, 321860, 280902, 289110, 215385, 354655, 354676, 436608, 362881, 248194, 240002, 436611, 240016, 108944, 190871, 149916, 420253, 141728, 289189, 108972, 272813, 338356, 436661, 289232, 256477, 330218, 281072, 109042, 174593, 420369, 322078, 207393, 289332, 174648, 338489, 338490, 322120, 297560, 436832, 436834, 420463, 346737, 313971, 346740, 420471, 330379, 117396, 346772, 264856, 289434, 346779, 166582, 314040, 109241, 248517, 363211, 363230, 264928, 330474, 289518, 322291, 191235, 264968, 322316, 117517, 322319, 166676, 207640, 281377, 289576, 191283, 273207, 289598, 322395, 109409, 330609, 207732, 158593, 240518, 109447, 224145, 355217, 256922, 289690, 240544, 289698, 420773, 289703, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 248796, 347103, 412651, 183279, 347123, 240630, 257024, 330754, 134150, 330763, 322582, 248872, 322612, 314448, 339030, 314467, 257125, 273515, 404593, 363641, 363644, 150657, 248961, 330888, 363669, 339100, 380061, 339102, 199839, 429214, 265379, 249002, 306346, 3246, 421048, 339130, 208058, 322749, 265412, 290000, 298208, 298212, 298213, 290022, 330984, 298221, 298228, 388349, 437505, 322824, 257305, 126237, 339234, 208164, 372009, 412971, 306494, 216386, 224586, 331090, 314710, 372054, 159066, 314720, 314726, 314728, 380271, 314739, 249204, 314741, 249205, 208244, 290173, 306559, 224640, 314751, 314758, 298374, 314760, 142729, 388487, 314766, 306579, 282007, 290207, 314783, 314789, 282022, 314791, 396711, 396712, 241066, 314798, 380337, 380338, 150965, 380357, 339398, 306639, 413137, 429542, 191981, 282096, 306673, 191990, 372227, 323080, 323087, 323089, 175639, 388632, 396827, 282141, 134686, 347694, 265798, 282183, 265804, 396882, 44635, 396895, 323172, 323178, 224883, 314998, 323196, 175741, 339584, 282245, 323207, 323217, 282271, 282276, 298661, 323236, 282280, 298667, 61101, 224946, 110268, 224958, 323263, 323264, 274115, 306890, 241361, 241365, 298720, 323331, 323332, 339715, 216839, 339720, 372496, 323346, 241441, 339745, 241442, 257830, 421672, 315202, 159562, 216918, 241495, 307039, 241528, 315264, 339841, 282504, 315273, 315274, 372626, 380821, 298909, 118685, 200627, 323507, 290745, 274371, 151497, 372701, 298980, 380908, 282612, 241692, 315432, 315434, 102445, 233517, 176175, 241716, 225351, 315465, 315476, 307289, 200794, 315487, 356447, 315497, 315498, 438377, 233589, 266357, 422019, 241808, 323729, 381073, 299174, 405687, 258239, 389313, 299203, 299209, 372941, 282831, 266449, 356576, 307435, 438511, 381172, 12542, 184575, 381208, 315673, 151839, 233762, 217380, 282919, 151847, 332083, 127284, 332085, 332089, 438596, 332101, 323913, 348492, 323920, 348500, 168281, 332123, 332127, 242023, 242029, 160110, 242033, 250226, 291192, 340357, 225670, 332167, 242058, 373134, 291224, 242078, 315810, 315811, 381347, 340398, 127427, 324039, 373197, 242139, 160225, 242148, 127465, 291311, 324097, 291333, 340490, 283153, 258581, 234036, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 340558, 381517, 332378, 201308, 242273, 242277, 111208, 184940, 373358, 389745, 209530, 373375, 152195, 348806, 184973, 316049, 111253, 316053, 111258, 111259, 332446, 176808, 299699, 422596, 422599, 291530, 225995, 242386, 422617, 422626, 234217, 299759, 299776, 291585, 430849, 291592, 62220, 422673, 430865, 291604, 422680, 283419, 152365, 422703, 422709, 152374, 160571, 430910, 160575, 160580, 381773, 201551, 242529, 349026, 357218, 275303, 201577, 308076, 242541, 177019, 185211, 308092, 398206, 291712, 381829, 316298, 308112, 349072, 390045, 127902, 185250, 185254, 316333, 373687, 316343, 373706, 316364, 340961, 324586, 340974, 349175, 201720, 127992, 357379, 324625, 308243, 357414, 300084, 324666, 308287, 21569, 218186, 250956, 341073, 439384, 250981, 300135, 300136, 316520, 316526, 357486, 144496, 300150, 291959, 300151, 160891, 300158, 349316, 349318, 373903, 169104, 177296, 185493, 324760, 119962, 300187, 300188, 300201, 300202, 373945, 259268, 283852, 283853, 259280, 333011, 316627, 234742, 128251, 439562, 292107, 414990, 251153, 177428, 349462, 333090, 382258, 300343, 382269, 177484, 406861, 259406, 234831, 283991, 374109, 333160, 243056, 316787, 357762, 112017, 112018, 275859, 234898, 259475, 357786, 251298, 333220, 316842, 374191, 210358, 292292, 300487, 300489, 366037, 210390, 210391, 210392, 210393, 144867, 103909, 54765, 251378, 308723, 333300, 333303, 300536, 259599, 316946, 308756, 398869, 374296, 374299, 308764, 333343, 431649, 169518, 431663, 194110, 349763, 218696, 292425, 243274, 128587, 333388, 333393, 128599, 333408, 300644, 415338, 243307, 120427, 54893, 325231, 325245, 235135, 194180, 415375, 153251, 300714, 210603, 415420, 333503, 333509, 259781, 333517, 333520, 333521, 333523, 325346, 333542, 153319, 325352, 284401, 325371, 243472, 366360, 325404, 341796, 399147, 431916, 300848, 259899, 325439, 325445, 153415, 341836, 415567, 325457, 317269, 341847, 350044, 128862, 292712, 325484, 423789, 292720, 325492, 276341, 341879, 317304, 333688, 112509, 325503, 55167, 333701, 243591, 317323, 325518, 333722, 350109, 292771, 333735, 415655, 284587, 292782, 243637, 301008, 153554, 292836, 292837, 317415, 325619, 432116, 333817, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 325674, 309295, 129076, 243767, 358456, 325694, 227428, 194666, 260207, 432240, 333940, 292988, 194691, 333955, 415881, 104587, 235662, 325776, 317587, 284826, 333991, 333992, 334042, 194782, 301279, 317664, 243962, 375039, 194820, 325905, 325912, 309529, 211235, 432421, 211238, 325931, 358703, 358709, 325968, 366930, 6489, 383332, 383336, 317820, 211326, 317831, 252308, 293274, 317852, 121245, 342450, 334260, 293303, 358843, 293310, 416197, 129483, 342476, 317901, 358882, 342498, 334309, 391655, 432618, 375276, 301571, 342536, 416286, 375333, 244269, 375343, 23092, 375351, 244281, 301638, 309830, 293448, 55881, 416341, 309846, 244310, 416351, 268899, 244327, 39530, 244347, 326287, 375440, 334481, 318106, 318107, 342682, 318130, 383667, 293556, 39614, 334547, 375526, 342762, 342763, 293612, 129773, 154359, 228088, 432893, 162561, 383754, 326414, 310036, 285466, 326429, 293664, 326433, 400166, 293672, 318250, 318252, 375609, 293693, 342847, 252741, 293711, 244568, 244570, 351077, 342887, 228215, 269178, 400252, 359298, 359299, 260996, 113542, 392074, 56208, 326553, 318364, 310176, 310178, 293800, 236461, 326581, 326587, 326601, 359381, 433115, 343005, 326635, 187374, 383983, 318461, 293886, 293893, 433165, 384016, 433174, 326685, 252958, 203830, 359478, 277597, 113760, 392290, 253029, 285798, 318572, 15471, 351344, 285814, 285820, 392318, 384131, 302216, 326804, 187544, 351390, 253099, 253100, 318639, 367799, 113850, 294074, 302274, 367810, 244940, 195808, 310497, 302325, 228600, 228609, 261377, 245019, 253216, 130338, 130348, 261425, 351537, 171317, 318775, 286013, 146762, 294218, 294219, 318805, 425304, 163175, 327024, 327025, 327031, 318848, 179587, 253317, 384393, 368011, 318864, 318868, 212375, 318875, 310692, 245161, 286129, 286132, 228795, 425405, 302531, 425418, 310748, 286172, 187878, 245223, 286202, 359930, 302590, 253451, 359950, 146964, 253463, 286244, 245287, 245292, 196164, 286288, 179801, 196187, 343647, 310889, 204397, 138863, 188016, 294529, 229001, 188048, 425626, 302754, 245412, 229029, 40614, 384695, 319162, 327358, 286399, 212685, 384720, 245457, 302802, 278233, 278240, 212716, 212717, 360177, 229113, 278272, 319233, 360195, 286494, 294700, 409394, 319292, 360252, 360264, 376669, 245599, 425825, 425833, 417654, 188292, 294807, 376732, 311199, 319392, 294823, 327596, 294843, 188348, 237504, 294850, 384964, 344013, 212942, 24532, 294886, 327661, 311281, 311282 ]
7fc91a20740b0c1661cc1f456a22930d0a0a38f7
7dccc36962890c390c6143a01bedd0fedec6c534
/semana3/libraryquery/libraryquery/ItemStore.swift
aaaafa038fb7416b734c646593ddfc853ad3cd55
[]
no_license
luiseduardo3004/cloud_with_ios
2087974f0434c7682b91d4b2f08b504e6af9a701
fda47e600e59537c488290b747970c5e34f205b9
refs/heads/master
2021-01-19T13:31:48.082925
2016-09-24T23:52:53
2016-09-24T23:52:53
null
0
0
null
null
null
null
UTF-8
Swift
false
false
992
swift
// // ItemStore.swift // libraryquery // // Created by José Manuel Gaytán on 24/09/16. // Copyright © 2016 José Manuel Gaytán. All rights reserved. // import Foundation class ItemStore { var allItems: [Item] = [] func moveItemAtIndex(_ fromIndex: Int, toIndex: Int) { if fromIndex == toIndex { return } // Get reference to object being moved so you can re-insert it let movedItem = allItems[fromIndex] // Remove item from array allItems.remove(at: fromIndex) // Insert item in array at new location allItems.insert(movedItem, at: toIndex) } func createItem() -> Item { let newItem = Item(opcDefault: true) allItems.append(newItem) return newItem } func removeItem(_ item: Item) { if let index = allItems.index(of: item) { allItems.remove(at: index) } } }
[ 280688 ]
bdeed1c114890e94b4f7e11269922519ecc5ddcc
2d9ca7719dc2a20267cca543a905a83688afebd2
/ios/Programming_for_Non-Programmers_iOS_15_and_Swift_5/FirstProject/FirstProjectUITests/FirstProjectUITestsLaunchTests.swift
6415c8be9cc83bc74576b29916e92d31f25e30cc
[]
no_license
PauloKeller/Mobile-Development
8e83216d34052fa49641dedcfb19f08971245feb
d4976d8dc456da630276558da6933c80ae7688b8
refs/heads/main
2023-03-16T21:14:56.056971
2023-02-18T00:43:51
2023-02-18T00:43:51
196,060,935
1
0
null
null
null
null
UTF-8
Swift
false
false
827
swift
// // FirstProjectUITestsLaunchTests.swift // FirstProjectUITests // // Created by Paulo Vinicius Keller on 11/30/22. // import XCTest final class FirstProjectUITestsLaunchTests: XCTestCase { override class var runsForEachTargetApplicationUIConfiguration: Bool { true } override func setUpWithError() throws { continueAfterFailure = false } func testLaunch() throws { let app = XCUIApplication() app.launch() // Insert steps here to perform after app launch but before taking a screenshot, // such as logging into a test account or navigating somewhere in the app let attachment = XCTAttachment(screenshot: app.screenshot()) attachment.name = "Launch Screen" attachment.lifetime = .keepAlways add(attachment) } }
[ 274433, 403464, 399371, 436236, 419858, 436247, 430119, 430126, 272431, 378932, 163893, 378935, 436282, 376893, 352325, 421959, 385096, 163915, 393292, 426075, 411739, 272478, 397410, 438373, 438379, 395374, 421999, 432242, 266360, 385146, 168068, 422021, 168071, 415882, 426123, 436373, 430230, 196759, 200857, 422043, 362657, 65699, 377011, 430264, 104634, 266426, 268480, 133314, 389315, 417995, 436428, 372942, 368848, 266448, 368851, 139477, 268505, 268516, 379111, 260336, 438513, 389360, 260339, 436467, 411893, 432374, 389363, 135415, 436481, 432386, 147715, 260356, 272643, 266503, 395537, 391447, 381209, 268569, 377115, 389405, 186659, 268582, 438574, 131375, 418096, 397619, 358708, 266548, 358711, 14653, 270662, 395590, 383310, 377167, 180560, 397651, 383326, 418143, 110956, 272754, 432502, 432510, 438654, 436610, 436612, 266629, 264589, 270734, 385424, 272785, 385427, 385436, 389535, 194979, 385447, 385450, 115115, 272814, 176564, 385462, 266683, 436678, 416202, 154062, 416207, 195022, 262618, 184798, 432607, 391653, 270822, 420327, 432617, 139765, 393720, 182778, 410107, 410110, 262658, 391685, 397840, 385553, 420375, 258585, 410137, 188956, 397854, 385568, 350757, 350760, 377387, 397871, 393776, 418353, 432693, 266813, 385602, 438851, 375372, 416333, 426574, 385619, 416339, 436830, 260704, 416352, 176750, 389743, 420462, 209528, 420472, 430723, 166532, 201349, 385668, 268939, 363156, 426647, 213655, 377498, 275103, 436898, 176804, 415739, 176811, 383669, 415743, 377532, 39615, 377535, 422592, 412358, 385752, 361177, 363229, 383709, 418530, 369384, 361193, 203501, 432882, 21238, 418551, 203512, 264952, 275192, 383739, 416510, 432895, 197378, 430852, 434955, 418578, 197397, 426773, 426776, 363296, 197413, 400167, 391981, 197423, 197427, 191284, 426808, 377657, 273210, 375611, 430908, 273208, 160577, 416578, 197452, 385881, 197466, 420701, 435037, 363360, 363363, 197480, 439146, 385900, 197488, 420721, 381810, 392056, 164731, 398204, 392066, 265093, 392072, 172937, 387976, 424843, 396172, 426893, 400270, 392079, 390035, 430998, 377753, 400281, 207775, 381855, 185251, 439203, 422824, 377779, 189364, 439227, 273340, 398276, 379846, 273352, 433105, 418775, 386008, 433113, 386010, 398304, 386017, 187373, 222192, 435184, 183290, 383995, 435196, 437246, 396293, 433167, 435215, 412691, 398369, 410666, 361523, 412726, 410686, 398404, 392289, 265319, 404583, 402537, 396394, 404588, 265324, 398445, 138355, 273524, 222329, 363642, 384121, 392316, 66685, 363657, 402569, 140427, 373901, 404623, 410771, 144534, 222365, 380068, 124074, 386224, 373938, 367797, 402617, 421049, 40125, 183493, 361669, 402631, 273617, 402642, 419027, 259286, 414955, 421101, 386289, 369911, 271608, 419065, 265466, 369914, 439549, 412927, 369928, 414988, 439564, 388370, 429333, 367896, 419098, 367899, 222495, 382242, 412964, 382247, 273712, 193854, 257352, 146761, 257355, 146764, 259407, 437586, 374111, 372065, 437601, 429411, 257385, 386414, 425332, 421239, 384378, 263560, 388489, 411027, 370067, 398741, 365986, 396710, 380330, 380336, 359859, 359862, 421303, 259512, 380349, 380351, 200135, 425416, 413139, 437725, 429541, 271851, 271852, 411120, 187901, 398845, 216576, 372225, 409094, 208396, 267792, 65042, 413203, 413205, 388631, 370201, 153114, 423452, 431645, 394792, 431661, 396849, 370232, 421436, 396866, 413254, 265799, 273993, 128588, 265808, 396884, 265815, 179799, 396888, 396897, 155237, 388711, 384617, 388714, 403058, 415359, 396928, 370308, 419461, 194182, 419463, 210568, 415370, 431755, 415377, 405139, 274072, 425625, 208546, 405156, 399013, 153253, 208549, 388776, 364203, 202414, 421555, 376501, 384694, 409276, 110269, 259779, 267977, 409290, 403150, 425681, 272086, 155361, 397039, 12016, 370418, 431860, 163574, 274171, 395017, 395020, 155409, 372498, 417555, 395025, 397077, 366359, 411416, 435994, 431900, 409382, 257832, 167721, 399149, 403247, 378672, 153393, 431919, 409395, 204601, 274235, 436030, 431934, 272206, 272209, 431954, 368472, 274275, 425831, 415591, 417647, 214897, 276342, 274295, 403325, 112511, 425874, 10152, 438187, 370605, 411588, 151493, 380875, 372700, 436188, 360415, 403424, 385010, 432115, 380921, 196603, 380924, 268287 ]
61f7a99d63381088208b0908e64b7c84cec740f6
d53d80cb8d2d74e42a6ed69c5c1e4ba5ce02e7cd
/Source/RxCharacteristicType.swift
3ef2c45412ed18c2d8960c249a0c726924631af1
[ "MIT" ]
permissive
MarvinNazari/RxBluetoothKit
0f13358b88cc3eed8b0deda2ae81a8d48b1550ce
9799637fbaa203c809d0343e55043aecd2475960
refs/heads/master
2021-01-23T19:56:43.106413
2017-09-08T07:42:58
2017-09-08T07:42:58
102,833,369
1
0
null
2017-09-08T07:41:28
2017-09-08T07:41:27
null
UTF-8
Swift
false
false
2,868
swift
// The MIT License (MIT) // // Copyright (c) 2016 Polidea // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. import Foundation import CoreBluetooth /** Protocol which wraps characteristic for bluetooth devices. */ protocol RxCharacteristicType { /// Unique identifier of an object. Should be removed in 4.0 @available(*, deprecated) var objectId: UInt { get } /// Characteristic UUID var uuid: CBUUID { get } /// Current characteristic value var value: Data? { get } /// True if characteristic value changes are notified var isNotifying: Bool { get } /// Characteristic properties var properties: CBCharacteristicProperties { get } /// Characteristic descriptors var descriptors: [RxDescriptorType]? { get } /// Characteristic service var service: RxServiceType { get } /// True if the two characteristic objects considered equal func isEqualTo(characteristic: RxCharacteristicType) -> Bool } extension Equatable where Self: RxCharacteristicType {} /** Characteristics are equal if their UUIDs are equal - parameter lhs: First characteristic to compare - parameter rhs: Second characteristic to compare - returns: True if characteristics are the same */ func == (lhs: RxCharacteristicType, rhs: RxCharacteristicType) -> Bool { return lhs.isEqualTo(characteristic: rhs) } /** Function compares if two characteristic arrays are the same, which is true if both of them in sequence are equal and their size is the same. - parameter lhs: First array of characteristics to compare - parameter rhs: Second array of characteristics to compare - returns: True if both arrays contain same characteristics */ func == (lhs: [RxCharacteristicType], rhs: [RxCharacteristicType]) -> Bool { return lhs.count == rhs.count && lhs.starts(with: rhs, by: ==) }
[ 395267, 196612, 395271, 395274, 395278, 395280, 395281, 395282, 395283, 395286, 395287, 395289, 395290, 196638, 395295, 395296, 196641, 98341, 61478, 98344, 98345, 98349, 124987, 174139, 354364, 229438, 229440, 229441, 395328, 174148, 229444, 395332, 327751, 174152, 395333, 395334, 174159, 229456, 112721, 106580, 106582, 106585, 106586, 106587, 112730, 174171, 235658, 229524, 303255, 303256, 125087, 215205, 215211, 215212, 241846, 241852, 241859, 241862, 241864, 317640, 241866, 241870, 241877, 241894, 241897, 241901, 241903, 241904, 241907, 241908, 241910, 260342, 241916, 141565, 141569, 241923, 241928, 141577, 141578, 241930, 241934, 241936, 241937, 141586, 141588, 12565, 227604, 241944, 227608, 12569, 141593, 141594, 141595, 141596, 141597, 141598, 141599, 141600, 227610, 141603, 241952, 241957, 141606, 141607, 141608, 289062, 241962, 289067, 141612, 289068, 12592, 289074, 289078, 141627, 141629, 141632, 241989, 213319, 141640, 141641, 141642, 141643, 213320, 241992, 241996, 241998, 241999, 242002, 141651, 242006, 141655, 215384, 282967, 141660, 168285, 141663, 141664, 141670, 141677, 141681, 190840, 190841, 430456, 190843, 190844, 430458, 375168, 141700, 141702, 141707, 430476, 141711, 430483, 217492, 217494, 197018, 197019, 197021, 295330, 295331, 197029, 430502, 168359, 303550, 160205, 381398, 305638, 223741, 61971, 191006, 191007, 57893, 57896, 328232, 57899, 57900, 295467, 57905, 57906, 336445, 336446, 336450, 336451, 336454, 336455, 336457, 336460, 336465, 336469, 336471, 336472, 336473, 336474, 336478, 336479, 336480, 336482, 336483, 336489, 297620, 297636, 135861, 242361, 244419, 66247, 244427, 248524, 127693, 244430, 66261, 127702, 127703, 334562, 127716, 334564, 62183, 127727, 127729, 318199, 318200, 142073, 164601, 334590, 318207, 244480, 334591, 334596, 334600, 318218, 334603, 318220, 334602, 334606, 318223, 334607, 318231, 318233, 318234, 318236, 318237, 318241, 187174, 187175, 318246, 187177, 187179, 187180, 314167, 316216, 396088, 396089, 396091, 396092, 396094, 148287, 316224, 396098, 314179, 279367, 396104, 396110, 396112, 396114, 396115, 396118, 396119, 396120, 396122, 396123, 396125, 396126, 396127, 396128, 396129, 299880, 396137, 162668, 299884, 187248, 396147, 396151, 248696, 396153, 187258, 187259, 322430, 185258, 185259, 23469, 185262, 23470, 23472, 23473, 23474, 23475, 23476, 185267, 23479, 287674, 23483, 23487, 281539, 23492, 23494, 228306, 23508, 23515, 23517, 23523, 23531, 23533, 152560, 23552, 171008, 23559, 23561, 23572, 23574, 23575, 23580, 23581, 23585, 23590, 23591, 23594, 23596, 23599, 189488, 97327, 187442, 189490, 187444, 189492, 189493, 187447, 189491, 23601, 97329, 144435, 23607, 144437, 144438, 144441, 97339, 23612, 144442, 144443, 144444, 23616, 144445, 341057, 341060, 222278, 341062, 341063, 341066, 341068, 203862, 285782, 285785, 115805, 115806, 115807, 293982, 115809, 115810, 185446, 115817, 242794, 115819, 115820, 185452, 185454, 115823, 185455, 115825, 115827, 242803, 115829, 242807, 294016, 205959, 40088, 312473, 189594, 208026, 40092, 208027, 189598, 40095, 208029, 208033, 27810, 228512, 228513, 312476, 312478, 189607, 312479, 189609, 189610, 312482, 189612, 312489, 312493, 189617, 312497, 189619, 312498, 189621, 312501, 189623, 189626, 322751, 292041, 292042, 181455, 292049, 152789, 152821, 152825, 294137, 294138, 206094, 206097, 206098, 294162, 206102, 206104, 206108, 206109, 181533, 294181, 27943, 181544, 294183, 27948, 181553, 173368, 206138, 173379, 312480, 152906, 152907, 152908, 152909, 152910, 290123, 290125, 290126, 290127, 290130, 312483, 290135, 290136, 245081, 290137, 290139, 378208, 222562, 222563, 222566, 228717, 228721, 222587, 222590, 222591, 222596, 177543, 222599, 222601, 222603, 222604, 54669, 222605, 222606, 222607, 54673, 54692, 152998, 54698, 54701, 54703, 298431, 370118, 157151, 222689, 222692, 222693, 112111, 112115, 112120, 362020, 362022, 116267, 282156, 34362, 173634, 173635, 316995, 316997, 106085, 319081, 319085, 319088, 300660, 300661, 300662, 300663, 394905, 394908, 394910, 394912, 339622, 147115, 292544, 108230, 341052, 108240, 108245, 212694, 34531, 192230, 192231, 192232, 296681, 34538, 34540, 34541, 216812, 216814, 216815, 216816, 216818, 216819, 296684, 296687, 216822, 296688, 296691, 296692, 216826, 296698, 216828, 216829, 296699, 296700, 216832, 216833, 216834, 296703, 216836, 216837, 216838, 296707, 296708, 296710, 296712, 296713, 313101, 313104, 313108, 313111, 313112, 149274, 149275, 149280, 159523, 321342, 210755, 210756, 210757, 210758, 321353, 218959, 218963, 218964, 223065, 180058, 229209, 223069, 229213, 169824, 229217, 169826, 237413, 169830, 292709, 128873, 169835, 128876, 169837, 128878, 223086, 223087, 128881, 128882, 128883, 128884, 141181, 327550, 108419, 141198, 108431, 108432, 219033, 108448, 219040, 141219, 219043, 219044, 141223, 141228, 141229, 108460, 108462, 229294, 229295, 141235, 141264, 40931, 40932, 141284, 141290, 40940, 40941, 141293, 141295, 174063, 231406, 174066, 174067, 237559, 174074 ]
454b750270b1da04ff120fb91b863afefaddb466
78ce30420ed351fe3a1ff24f521ca29e2aac1e28
/Partnr/Models/ProjectData.swift
3a02f79bc591217fd76e8911a8a67cae79fa640c
[]
no_license
yulian-simeonov/partnr-ios
ec01a129d79b84916bd07abfb9506ab10d4d3593
effef98f1c8781abca5a320aaa78bdc12ca67f60
refs/heads/master
2021-05-04T01:18:07.470892
2016-10-19T17:00:04
2016-10-19T17:00:04
71,186,852
1
0
null
null
null
null
UTF-8
Swift
false
false
3,549
swift
// // UserData.swift // Partnr // // Created by Yulian Simeonov on 2/5/16. // Copyright © 2016 YulianMobile. All rights reserved. // import UIKit import Parse class ProjectData: CommunityData { var id: String = "" var name: String = "" var profession: String = "" var brief: String = "" var deliverables: String = "" var price: Double = 0 var dueDate: NSDate = NSDate() var updatedDate: NSDate = NSDate() var image: PFFile? = nil var userId: String = "" var status: EProjectStatus = .Open var partnrId: String = "" var briefUserId: String = "" // var createdAt = NSDate() var parseObj: PFObject? = nil var userData: UserData? = nil var partnrData: UserData? = nil class func initWithParseObject(parseObj: PFObject?) -> ProjectData? { let project = ProjectData() if (parseObj == nil) { return nil } project?.communityType = .Project project?.parseObj = parseObj project!.id = (parseObj?.objectId)! project!.userId = Utilities.getValidString(parseObj!["userId"] as? String, defaultString: "") project!.partnrId = Utilities.getValidString(parseObj!["partnrId"] as? String, defaultString: "") project!.name = Utilities.getValidString(parseObj!["name"] as? String, defaultString: "") project?.profession = Utilities.getValidString(parseObj!["profession"] as? String, defaultString: "") project!.brief = Utilities.getValidString(parseObj!["brief"] as? String, defaultString: "") project!.deliverables = Utilities.getValidString(parseObj!["deliverables"] as? String, defaultString: "") project!.price = Double(parseObj!["price"] as! NSNumber) project?.dueDate = parseObj!["dueDate"] as! NSDate project!.image = parseObj!["image"] as? PFFile project?.updatedDate = (parseObj?.updatedAt)! project?.status = EProjectStatus(rawValue: parseObj!["status"] as! NSInteger)! project!.createdAt = parseObj!.createdAt! project!.briefUserId = Utilities.getValidString(parseObj!["briefUserId"] as? String, defaultString: "") return project } func updateUserData(callback:((userData: UserData?, error: NSError?) -> Void)) { let pointer = PFObject.init(withoutDataWithClassName: "_User", objectId: userId) PNAPIClient.sharedInstance.fetchUser(pointer) { (userData, error) -> Void in self.userData = userData callback(userData: userData, error: error) } } func updatePartnrData(callback:((userData: UserData?, error: NSError?) -> Void)) { let pointer = PFObject.init(withoutDataWithClassName: "_User", objectId: partnrId) PNAPIClient.sharedInstance.fetchUser(pointer) { (userData, error) -> Void in self.partnrData = userData callback(userData: userData, error: error) } } func setStatusToOpen() { PNAPIClient.sharedInstance.setProjectStatusTo(self.id, status: EProjectStatus.Open) { (finished, error) -> Void in } } func isPendingExpired() -> Bool { let timeInterval = NSDate().timeIntervalSinceDate(self.updatedDate) if timeInterval > 24*3600 && self.status == .WaitingForFunding { return true } else { return false } } // override init?() { // self.id = "" // } }
[ -1 ]
27b6a5f73b3ff434b40040d5f5b4464a2a7c3ba8
af7cffa3c0a8e7f5dd7e671f98a017dd42a6847e
/iOS/Swift for Developers (ud1025)/Silly Song/SillySongPrep.playground/Contents.swift
49d2789a987138ae1b6d6e88a18b77562f3206ea
[]
no_license
SFotakos/Study
e92b7f9fdaeaca01ebb96b509b286490023ebc26
b9888a7b8719d0d73df88eaedef66157ac48e53f
refs/heads/master
2022-10-17T03:34:13.227868
2022-10-11T23:45:05
2022-10-11T23:45:05
140,106,585
3
0
null
null
null
null
UTF-8
Swift
false
false
1,546
swift
import UIKit func shortNameFromName(name: String) -> String { var lowerCaseName = name.folding(options: .diacriticInsensitive, locale: NSLocale.current).lowercased() let vowelCharacterSet = CharacterSet.init(charactersIn: "aeiou") for unicodeScalar in lowerCaseName.unicodeScalars { if vowelCharacterSet.contains(UnicodeScalar(unicodeScalar.value)!) { return String(lowerCaseName[lowerCaseName.index(of: Character(unicodeScalar))!...]) } } return name } shortNameFromName(name: "Nate") shortNameFromName(name: "Talia") shortNameFromName(name: "Spyridion") shortNameFromName(name: "TALIA") shortNameFromName(name: "Zöe") shortNameFromName(name: "cccc") shortNameFromName(name: "aaaa") shortNameFromName(name: "") let bananaFanaTemplate = [ "<FULL_NAME>, <FULL_NAME>, Bo B<SHORT_NAME>", "Banana Fana Fo F<SHORT_NAME>", "Me My Mo M<SHORT_NAME>", "<FULL_NAME>"].joined(separator: "\n") func lyricsForName(lyricsTemplate: String, fullName: String) -> String { return lyricsTemplate .replacingOccurrences(of: "<FULL_NAME>", with: fullName) .replacingOccurrences(of: "<SHORT_NAME>", with: shortNameFromName(name: fullName)) } print(lyricsForName(lyricsTemplate: bananaFanaTemplate, fullName: "Nate")) print("-----------------------\n") print(lyricsForName(lyricsTemplate: bananaFanaTemplate, fullName: "Talia")) print("-----------------------\n") print(lyricsForName(lyricsTemplate: bananaFanaTemplate, fullName: "Spyridion")) print("-----------------------\n")
[ -1 ]
7ff872777aca128104306b8a34c8b18d7bdcc9d9
40f672d32ab88f35bacc046f0347834ddd827322
/Pickers/BIDDatePickerViewController.swift
026a24c6f819e2672aed62d8d754bee1d0bf95de
[]
no_license
Demon-liao/Pickers
e26c95685f2384d4121caa1da179cdedca907501
75508f24d74f206521beee255910b3573235fbe5
refs/heads/master
2021-01-18T14:28:53.905760
2014-08-20T07:54:42
2014-08-20T07:54:42
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,758
swift
// // BIDDatePickerViewController.swift // Pickers // // Created by demon on 14-6-30. // Copyright (c) 2014年 demon. All rights reserved. // import UIKit class BIDDatePickerViewController: UIViewController { // // init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { // super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) // // Custom initialization // } @IBOutlet var datePicker: UIDatePicker! override func viewDidLoad() { super.viewDidLoad() var now:NSDate=NSDate.date() self.datePicker.setDate(now, animated:false) // Do any additional setup after loading the view. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } @IBAction func buttonPressed(sender: AnyObject) { var selected:NSDate=self.datePicker.date var dateFormat:NSDateFormatter=NSDateFormatter() dateFormat.dateFormat="yyyy-MM-dd HH:mm" var date=dateFormat.stringFromDate(selected) var msg="你选择的时间为\(date)" //init(title: String!, message: String!, delegate: AnyObject!, cancelButtonTitle: String!) / var alert=UIAlertView() alert.message=msg alert.addButtonWithTitle("YES") alert.show() } /* // #pragma 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 ]
b4c1d699f87dbcca5f434b5b32c09f8faa2df1fe
b03b7e6d42fab1ecffe05a7637b02dc29d0c645a
/Need_A_Sitter/Need_A_Sitter/UIViewExtensions.swift
00c5ad7e68ca53f71e7d7dad8e5996b279ec6461
[]
no_license
pareekkhushboo77/Demo-all-social-login-demos
add16d15c9fe74a7403ba2d660b3fd2e0a21f6de
f2eb109f5d4674ee1782f5aa6067d5d52fa4ef5c
refs/heads/master
2021-01-17T17:36:08.435354
2016-06-03T07:15:53
2016-06-03T07:15:53
60,326,487
0
0
null
null
null
null
UTF-8
Swift
false
false
1,350
swift
// // UIViewExtensions.swift // Need_A_Sitter // // Created by Ratnakala58 on 4/6/16. // Copyright © 2016 Ratnakala33. All rights reserved. // import Foundation import UIKit extension UIView { // Name this function in a way that makes sense to you... // slideFromLeft, slideRight, slideLeftToRight, etc. are great alternative names func slideInFromLeft(duration: NSTimeInterval = 1.0, completionDelegate: AnyObject? = nil) { // Create a CATransition animation let slideInFromLeftTransition = CATransition() // Set its callback delegate to the completionDelegate that was provided (if any) if let delegate: AnyObject = completionDelegate { slideInFromLeftTransition.delegate = delegate } // Customize the animation's properties slideInFromLeftTransition.type = kCATransitionPush slideInFromLeftTransition.subtype = kCATransitionFromLeft slideInFromLeftTransition.duration = duration slideInFromLeftTransition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) slideInFromLeftTransition.fillMode = kCAFillModeRemoved // Add the animation to the View's layer self.layer.addAnimation(slideInFromLeftTransition, forKey: "slideInFromLeftTransition") } }
[ -1 ]