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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f00fd1f90893bcbc405d8e0263cb8144ff4fb068
|
249bcf7eaf1bbcd585748550b8d6d39dfe1c3d95
|
/buggyTests/buggyTests.swift
|
248a0a5d97407ab783eaeaf49b51dd56105bccde
|
[] |
no_license
|
DannyEspina/iOS_Buggy
|
1d308684d2f810dfc64108e611c0bccdd4617c5c
|
4970f798279def3bb083a0c8a37e060167906254
|
refs/heads/master
| 2021-07-10T21:09:48.134877 | 2017-10-12T20:38:31 | 2017-10-12T20:38:31 | 106,742,789 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 966 |
swift
|
//
// buggyTests.swift
// buggyTests
//
// Created by Danny Espina on 10/10/17.
// Copyright © 2017 Big Nerd Ranch. All rights reserved.
//
import XCTest
@testable import buggy
class buggyTests: 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,
131178,
278638,
319598,
352368,
204916,
131191,
237689,
131198,
278655,
319629,
311438,
278677,
196760,
426138,
278685,
311458,
278691,
49316,
32941,
278704,
377009,
278708,
131256,
180408,
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,
368984,
106847,
98657,
270701,
246127,
270706,
139640,
246136,
246137,
311685,
106888,
385417,
311691,
385422,
213403,
385454,
377264,
278970,
311738,
33211,
319930,
336317,
336320,
311745,
278978,
254406,
188871,
278989,
278993,
278999,
328152,
369116,
287198,
279008,
279013,
279018,
311786,
319981,
319987,
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,
295536,
287346,
139892,
287352,
344696,
279164,
189057,
311941,
336518,
311945,
369289,
344715,
279177,
311949,
287374,
377489,
311954,
352917,
230040,
271000,
377497,
303771,
221852,
377500,
295576,
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,
312052,
172792,
344827,
221948,
279294,
205568,
295682,
197386,
434957,
312079,
295697,
426774,
197399,
426775,
336671,
344865,
197411,
262951,
279336,
312108,
295724,
197422,
353070,
164656,
295729,
262962,
353069,
328499,
353078,
230199,
197431,
353079,
336702,
295746,
353094,
353095,
353109,
377686,
230234,
189275,
435039,
279392,
295776,
303972,
385893,
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,
418776,
50143,
123881,
304110,
320494,
287731,
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,
214086,
238664,
296019,
353367,
156764,
156765,
304222,
230499,
173166,
312434,
377972,
353397,
337017,
377983,
279685,
402565,
222343,
386189,
296086,
238743,
296092,
238765,
279728,
238769,
402613,
230588,
279747,
353479,
353481,
402634,
353482,
189652,
189653,
419029,
148696,
296153,
279774,
304351,
304356,
222440,
328940,
279792,
353523,
386294,
386301,
320770,
386306,
279814,
328971,
312587,
353551,
320796,
222494,
115998,
279854,
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,
181625,
337281,
148867,
378244,
296329,
304524,
296335,
9619,
370071,
279974,
173491,
304564,
279989,
353719,
280004,
361927,
296392,
370123,
148940,
280013,
312782,
222675,
353750,
280032,
271843,
280041,
361963,
329200,
296433,
321009,
280055,
288249,
296448,
230913,
329225,
230921,
296461,
304656,
329232,
370197,
230943,
402985,
394794,
230959,
288309,
312889,
288318,
280130,
124485,
288326,
288327,
280147,
239198,
157281,
99938,
312940,
222832,
247416,
337534,
337535,
263809,
312965,
288392,
239250,
419478,
345752,
255649,
321199,
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,
280329,
321295,
321302,
345879,
116505,
321310,
255776,
313120,
247590,
362283,
378668,
296755,
321337,
345919,
436031,
403267,
280392,
345929,
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,
313254,
436137,
362417,
124852,
288697,
362431,
214977,
280514,
214984,
362443,
247757,
231375,
280541,
329695,
436191,
313319,
337895,
247785,
296941,
436205,
362480,
223218,
313339,
43014,
354316,
313357,
182296,
239650,
329765,
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,
329829,
288879,
223350,
280694,
288889,
215164,
313469,
215166,
280712,
215178,
346271,
436383,
362659,
239793,
125109,
182456,
379071,
280768,
149703,
338119,
346314,
321745,
280795,
387296,
280802,
379106,
338150,
346346,
321772,
125169,
338164,
436470,
125183,
149760,
411906,
125188,
313608,
125193,
321800,
125198,
272658,
125203,
338197,
125208,
305440,
125217,
338218,
321840,
379186,
125235,
280887,
125240,
321860,
182597,
182598,
280902,
289110,
215385,
272729,
379225,
354655,
321894,
280939,
313713,
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,
330218,
281072,
109042,
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,
109241,
158394,
248517,
363211,
289502,
363230,
264928,
338662,
330474,
346858,
289518,
199414,
35583,
363263,
322313,
117517,
322319,
166676,
207640,
281377,
289576,
191283,
273207,
289598,
420677,
281427,
281433,
322395,
109409,
330609,
174963,
207732,
109428,
158593,
240518,
109447,
224145,
355217,
256922,
289690,
289698,
420773,
289703,
240552,
363438,
347055,
289722,
289727,
273344,
330689,
363458,
379844,
19399,
338899,
248796,
248797,
207838,
347103,
314342,
52200,
289774,
183279,
347123,
240630,
314362,
257024,
330754,
134150,
330763,
281626,
175132,
248872,
322612,
314448,
339030,
281697,
314467,
281700,
257125,
322663,
281706,
207979,
273515,
404593,
363641,
363644,
150657,
248961,
330888,
363669,
339100,
380061,
429214,
199839,
339102,
330913,
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,
134491,
314720,
281957,
306542,
380271,
314739,
208244,
249204,
249205,
290169,
290173,
306559,
314751,
224640,
306560,
298374,
314758,
314760,
142729,
388487,
314766,
306579,
224661,
282007,
290207,
314783,
314789,
282022,
314791,
396711,
396712,
282024,
241066,
314798,
380337,
380338,
150965,
380357,
339398,
306631,
306639,
413137,
429542,
191981,
282096,
191990,
290300,
290301,
282114,
372227,
306692,
323080,
323087,
323089,
175639,
388632,
396827,
282141,
134686,
282146,
306723,
347694,
290358,
265798,
282183,
265804,
224847,
118353,
396882,
290390,
306776,
44635,
396895,
323172,
282213,
323178,
224883,
314998,
323196,
175741,
339584,
224901,
282245,
282246,
290443,
323217,
282259,
298654,
282271,
257699,
282276,
298661,
323236,
290471,
282280,
61101,
224946,
306874,
110268,
224958,
282303,
323264,
274115,
306890,
241361,
282327,
298712,
298720,
12010,
282348,
323316,
282358,
175873,
339715,
323331,
323332,
216839,
339720,
282378,
372496,
323346,
249626,
282400,
339745,
241441,
315171,
257830,
421672,
282417,
200498,
282427,
315202,
307011,
282438,
413521,
216918,
241495,
282474,
282480,
241528,
315264,
339841,
241540,
315273,
315274,
110480,
372626,
380821,
282518,
282519,
298909,
118685,
298920,
323507,
290745,
274371,
151497,
372701,
298980,
380908,
282633,
241692,
102437,
315432,
315434,
102445,
233517,
176175,
282672,
241716,
225351,
315465,
315476,
307289,
200794,
315487,
356447,
438377,
315498,
299121,
233589,
266357,
233590,
422019,
241808,
381073,
323729,
233636,
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,
282960,
348500,
168281,
332123,
332127,
323935,
242023,
242029,
160110,
242033,
291192,
315773,
291198,
340357,
225670,
332167,
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,
127465,
291311,
233978,
291333,
340490,
283153,
258581,
291358,
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,
291612,
152365,
422703,
422709,
152374,
242485,
160571,
430910,
160575,
160580,
299849,
283467,
381773,
201549,
201551,
242529,
349026,
357218,
275303,
177001,
201577,
308076,
242541,
209783,
209785,
177019,
185211,
308092,
398206,
291712,
381829,
316298,
308107,
308112,
349072,
209817,
324506,
324507,
390045,
127902,
185250,
324517,
283558,
185254,
316333,
373687,
316343,
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,
119962,
300187,
300188,
283802,
300201,
300202,
373945,
259268,
283847,
62665,
283852,
283853,
259280,
316627,
333011,
357595,
333022,
234733,
234742,
128251,
292091,
316669,
439562,
292107,
242954,
414990,
251153,
177428,
349462,
333090,
382258,
300343,
382269,
333117,
193859,
300359,
177484,
406861,
259406,
234831,
251213,
120148,
357719,
283991,
374109,
316765,
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,
103909,
316902,
54765,
251378,
308723,
300535,
300536,
300542,
210433,
366083,
292356,
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,
415338,
243307,
54893,
325231,
333430,
366203,
325245,
194180,
415375,
153251,
300714,
210603,
415420,
333503,
218819,
259781,
333509,
333517,
333520,
333521,
333523,
325346,
153319,
325352,
284401,
325371,
194303,
194304,
284429,
284431,
243472,
161554,
366360,
284442,
325404,
325410,
341796,
399147,
431916,
284459,
300848,
317232,
259899,
325439,
325445,
153415,
341836,
415567,
325457,
317269,
341847,
284507,
350044,
300894,
128862,
284514,
276327,
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,
317360,
243637,
284619,
301008,
153554,
219101,
292836,
292837,
317415,
325619,
432116,
333817,
292858,
415741,
333828,
358410,
399373,
317467,
145435,
292902,
325674,
129076,
243767,
358456,
309345,
227428,
194666,
260207,
432240,
284788,
333940,
292988,
292992,
333955,
415881,
104587,
235662,
325776,
317587,
284826,
333991,
333992,
284842,
153776,
227513,
301251,
309444,
227524,
194782,
301279,
317664,
227578,
243962,
375039,
309503,
194820,
375051,
325905,
325912,
227616,
211235,
432421,
211238,
358703,
358709,
260418,
227654,
325968,
6481,
366930,
366929,
6489,
334171,
391520,
383332,
416104,
383336,
211326,
317831,
227725,
252308,
178582,
293274,
317852,
121245,
285084,
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,
244327,
39530,
301689,
244347,
326287,
375440,
334481,
227990,
318106,
318107,
342682,
318130,
383667,
293556,
342706,
342713,
285371,
285372,
285373,
285374,
39614,
154316,
318173,
375526,
285415,
342762,
342763,
293612,
154359,
228088,
432893,
162561,
285444,
383754,
326414,
310036,
326429,
293664,
326433,
400166,
293672,
318250,
318252,
285487,
301871,
375609,
293693,
252741,
318278,
293711,
244568,
244570,
293730,
351077,
342887,
400239,
310131,
269178,
400252,
359298,
359299,
260996,
113542,
416646,
228233,
392074,
228234,
236428,
56208,
318364,
310176,
310178,
310182,
293800,
236461,
293806,
326581,
326587,
326601,
359381,
433115,
343005,
130016,
64485,
326635,
203757,
187374,
383983,
277492,
318461,
293886,
277509,
293893,
433165,
384016,
146448,
277524,
293910,
433174,
326685,
252958,
252980,
203830,
359478,
302139,
359495,
277597,
392290,
253029,
228458,
318572,
15471,
351344,
187506,
285814,
285820,
392318,
187521,
384131,
285828,
302213,
285830,
302216,
228491,
228493,
285838,
162961,
326804,
187544,
285851,
351390,
302240,
343203,
253099,
253100,
318639,
367799,
294074,
113850,
64700,
228540,
228542,
302274,
367810,
343234,
244940,
228563,
195808,
310497,
228588,
253167,
302325,
228600,
261377,
228609,
245019,
253216,
130338,
130343,
261425,
351537,
171317,
318775,
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,
302540,
64975,
310736,
327121,
228827,
286172,
310757,
187878,
245223,
343542,
343543,
286202,
359930,
286205,
302590,
228867,
253451,
253452,
359950,
146964,
253463,
187938,
286244,
245287,
245292,
286254,
196164,
56902,
228943,
179801,
196187,
343647,
286306,
310889,
204397,
138863,
188016,
294529,
229001,
310923,
188048,
302739,
425626,
229020,
302754,
245412,
229029,
40614,
40613,
40615,
286391,
384695,
319162,
327358,
286399,
212685,
384720,
212688,
302802,
245457,
286423,
278233,
278234,
294622,
278240,
229088,
212716,
212717,
360177,
229113,
286459,
278272,
319233,
360195,
278291,
294678,
286494,
294700,
409394,
319292,
360252,
360264,
188251,
376669,
245599,
237408,
425825,
302946,
425833,
417654,
188292,
253829,
327557,
294807,
376732,
311199,
319392,
294823,
327596,
294843,
188348,
237504,
294850,
384964,
163781,
344013,
212942,
212946,
24532,
294886,
253929,
327661,
278512,
311281,
311282
] |
8d2e8f727b9e19433e20d53ac5d879037f960490
|
ee497039978c31a241a1642afbc35312153c123e
|
/Alberto Virzì/Controller/SplashController.swift
|
cb2bf16bc2fd01ada233328ab165584d3fef4517
|
[] |
no_license
|
AlbertoVirzi/App-IED-Alberto-Virz-
|
ad0c6477c2ed3f271bb71a43598a88dc55d1dfa7
|
cd1fc9ae70fe8a6564be112475d2cf68e98a0760
|
refs/heads/master
| 2020-05-25T05:19:36.568852 | 2019-07-01T16:05:50 | 2019-07-01T16:05:50 | 187,646,730 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 878 |
swift
|
//
// SplashController.swift
// Alberto Virzì
//
// Created by IED Student on 08/04/2019.
// Copyright © 2019 IED Student. All rights reserved.
//
import UIKit
class SplashController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
//Check meteo Roma
Network.richiestaMeteoRoma()
//popolo il database
Database.creaEventiDiProva()
//controllo se c'è un utente connesso
if LoginUtility.utenteConnesso == nil {
//nessun utente connesso
//vado alla pagina di login
performSegue(withIdentifier: "vaiAlLogin", sender: self)
}
else{
//utente connesso
//vado alla pagina Home
performSegue(withIdentifier: "dallaHome", sender: self)
}
}
}
|
[
-1
] |
1f6c1a57db0898d4fbd2535c01de600a957a31c0
|
36b11001806b2451bec0e9cdc48b49330a1ff359
|
/FitApp/TabBarController.swift
|
a2ae195177f4a38de17c50d1e8cf53ae44cd4ef5
|
[] |
no_license
|
KsenyaGorbovtsova/Diploma
|
9550c5b03a43661e3dca7c2a735188f2db390990
|
18a9ab6a4d4c4fb0de1957ac85d0d72289cea8be
|
refs/heads/master
| 2020-04-03T16:56:02.858407 | 2019-05-29T15:46:48 | 2019-05-29T15:46:48 | 155,424,748 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 386 |
swift
|
//
// TabBarController.swift
// FitApp
//
// Created by Gorbovtsova Ksenya on 05/05/2019.
// Copyright © 2019 Gorbovtsova Ksenya. All rights reserved.
//
import UIKit
class TabBarController: UITabBarController {
@IBInspectable var defaultIndex: Int = 2
override func viewDidLoad() {
super.viewDidLoad()
selectedIndex = defaultIndex
}
}
|
[
-1
] |
97bc3677ec223c4f16accd62ddaf075e51b9dc81
|
2fce1406531bb7b5ba36a4f21db32810f82957d9
|
/MovieDB/SceneDelegate.swift
|
aca24557e434b184588e0059f079ef8ec554b081
|
[] |
no_license
|
HFZ321/MovieDB
|
8db1dc32511fdc85b027973847a3ae984b705fe9
|
2faf57efb5d4f616bcf4ae733743d056f708c2cc
|
refs/heads/main
| 2023-07-28T22:36:23.458818 | 2021-09-30T16:24:58 | 2021-09-30T16:24:58 | 411,837,057 | 0 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,290 |
swift
|
//
// SceneDelegate.swift
// MovieDB
//
// Created by Hongfei Zheng on 9/24/21.
//
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,
336140,
164107,
262417,
368913,
262423,
377118,
377121,
262437,
254253,
336181,
262455,
393539,
262473,
344404,
213333,
418135,
270687,
262497,
418145,
262501,
213354,
246124,
262508,
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,
385714,
434868,
164535,
164539,
328379,
328387,
352969,
344777,
418508,
385743,
385749,
139998,
189154,
369382,
361196,
418555,
344832,
336644,
344837,
344843,
328462,
361231,
394002,
336660,
418581,
418586,
434971,
369436,
262943,
369439,
418591,
418594,
336676,
418600,
418606,
369464,
361274,
328516,
336709,
328520,
336712,
361289,
328523,
336715,
361300,
213848,
426842,
361307,
197469,
361310,
254813,
361318,
344936,
361323,
361335,
328574,
369544,
361361,
222129,
345036,
115661,
386004,
345046,
386012,
386019,
386023,
328690,
435188,
328703,
328710,
418822,
377867,
328715,
361490,
386070,
271382,
336922,
345119,
377888,
214060,
345134,
345139,
361525,
386102,
361537,
377931,
345172,
189525,
402523,
361568,
148580,
345200,
361591,
386168,
361594,
410746,
214150,
345224,
386187,
345247,
361645,
345268,
402615,
361657,
402636,
328925,
165086,
66783,
165092,
328933,
222438,
328942,
386286,
386292,
206084,
328967,
345377,
345380,
353572,
345383,
263464,
337207,
345400,
378170,
369979,
386366,
337230,
337235,
263509,
353634,
337252,
402792,
271731,
378232,
337278,
271746,
181639,
353674,
181644,
361869,
181650,
181655,
230810,
181671,
181674,
181679,
181682,
337330,
181687,
370105,
181691,
181697,
361922,
337350,
181704,
337366,
271841,
329192,
361961,
329195,
116211,
337399,
402943,
337416,
329227,
419341,
419345,
329234,
419351,
345626,
419357,
345631,
419360,
370208,
394787,
419363,
370214,
419369,
394796,
419377,
419386,
214594,
419401,
353868,
419404,
173648,
419408,
214611,
419412,
403040,
345702,
370298,
353920,
403073,
403076,
345737,
198282,
403085,
403092,
345750,
419484,
345758,
345763,
419492,
345766,
419498,
419502,
370351,
419507,
337588,
419510,
419513,
419518,
403139,
337607,
419528,
419531,
419536,
272083,
394967,
419543,
419545,
345819,
419548,
419551,
345829,
419560,
337643,
419564,
337647,
370416,
337671,
362249,
362252,
395022,
362256,
321300,
345888,
362274,
378664,
354107,
345916,
354112,
370504,
329545,
345932,
370510,
354132,
247639,
337751,
370520,
313181,
182110,
354143,
354157,
345965,
345968,
345971,
345975,
403321,
1914,
354173,
395148,
247692,
337809,
247701,
436127,
436133,
247720,
337834,
362414,
337845,
190393,
247760,
346064,
346069,
419810,
329699,
354275,
190440,
354314,
346140,
436290,
395340,
378956,
436307,
338005,
100454,
329833,
329853,
329857,
329868,
411806,
329886,
346273,
362661,
100525,
387250,
379067,
387261,
256193,
395467,
346317,
411862,
256214,
411865,
411869,
411874,
379108,
411877,
387303,
346344,
395496,
338154,
387307,
346350,
338161,
387314,
436474,
379135,
411905,
411917,
379154,
395539,
387350,
387353,
338201,
338212,
395567,
248112,
362823,
436556,
321880,
362844,
379234,
354674,
321911,
420237,
379279,
272787,
354728,
338353,
338382,
272849,
248279,
256474,
182755,
338404,
338411,
330225,
248309,
248332,
330254,
199189,
420377,
330268,
191012,
330320,
199250,
191069,
346722,
248427,
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,
355185,
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,
347208,
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,
175487,
249215,
175491,
249219,
249225,
249228,
249235,
175514,
175517,
396703,
396706,
175523,
355749,
396723,
388543,
380353,
216518,
380364,
339406,
372177,
339414,
249303,
413143,
339418,
339421,
249310,
339425,
249313,
339429,
339435,
249329,
69114,
372229,
208399,
380433,
175637,
405017,
134689,
265779,
421442,
413251,
265796,
265806,
224854,
224858,
339553,
257636,
224871,
372328,
257647,
372338,
224885,
224888,
224891,
224895,
372354,
126597,
421509,
224905,
11919,
224911,
224914,
126611,
224917,
224920,
126618,
208539,
224923,
224927,
224930,
224933,
257705,
224939,
224943,
257713,
224949,
257717,
257721,
224954,
257725,
224960,
257733,
224966,
224970,
257740,
224976,
257745,
257748,
224982,
257752,
224987,
257762,
224996,
225000,
225013,
257788,
225021,
339711,
257791,
225027,
257796,
339722,
257802,
257805,
225039,
257808,
249617,
225044,
167701,
372500,
257815,
225049,
257820,
225054,
184096,
397089,
257825,
225059,
339748,
225068,
257837,
413485,
225071,
225074,
257843,
225077,
257846,
225080,
397113,
225083,
397116,
257853,
225088,
225094,
225097,
257869,
257872,
225105,
397140,
225109,
225113,
257881,
257884,
257887,
225120,
257891,
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,
393215,
372739,
405534,
266295,
266298,
421961,
200786,
356440,
217180,
430181,
266351,
356467,
266365,
192640,
266375,
381069,
225425,
250003,
225430,
250008,
356507,
250012,
225439,
135328,
192674,
225442,
438434,
225445,
438438,
225448,
438441,
356521,
225451,
258223,
225456,
430257,
225459,
225462,
225468,
389309,
225472,
372931,
225476,
430275,
389322,
225485,
225488,
225491,
266454,
225494,
225497,
225500,
225503,
225506,
225511,
217319,
225515,
225519,
381177,
397572,
389381,
381212,
356638,
356641,
356644,
356647,
266537,
389417,
356650,
356656,
332081,
340276,
356662,
397623,
332091,
225599,
348489,
332107,
151884,
430422,
348503,
332118,
250201,
250203,
250211,
340328,
250217,
348523,
348528,
332153,
356734,
389503,
332158,
438657,
332162,
389507,
348548,
356741,
332175,
160152,
373146,
340380,
373149,
70048,
356783,
266688,
324032,
201158,
340452,
127473,
217590,
340473,
324095,
324100,
324103,
324112,
340501,
324118,
324122,
340512,
332325,
324134,
381483,
356908,
324141,
324143,
356917,
324150,
324156,
168509,
348734,
324161,
324165,
356935,
348745,
381513,
324171,
324174,
324177,
389724,
332381,
373344,
340580,
348777,
381546,
340628,
184983,
373399,
258723,
332455,
332460,
389806,
332464,
332473,
381626,
332484,
332487,
332494,
357070,
357074,
332512,
340724,
332534,
373499,
348926,
389927,
348979,
348983,
398141,
357202,
389971,
357208,
389979,
430940,
357212,
357215,
439138,
349041,
340850,
381815,
430967,
324473,
398202,
119675,
340859,
324476,
430973,
324479,
340863,
324482,
373635,
324485,
324488,
185226,
381834,
324493,
324496,
324499,
430996,
324502,
324511,
422817,
324514,
201638,
398246,
373672,
324525,
5040,
111539,
324534,
5047,
324539,
324542,
398280,
349129,
340942,
209874,
340958,
431073,
398307,
340964,
209896,
201712,
209904,
349173,
381947,
201724,
349181,
431100,
431107,
349203,
209944,
209948,
357411,
250917,
169002,
357419,
209966,
209969,
209973,
209976,
209980,
209988,
209991,
431180,
209996,
349268,
177238,
250968,
210011,
373853,
341094,
210026,
210028,
210032,
349296,
210037,
210042,
210045,
349309,
152704,
349313,
160896,
210053,
210056,
349320,
259217,
373905,
210068,
210072,
210078,
210081,
210085,
210089,
210096,
210100,
324792,
210108,
357571,
210116,
210128,
210132,
333016,
210139,
210144,
218355,
218361,
275709,
128254,
275713,
242947,
275717,
275723,
333075,
349460,
349486,
349492,
415034,
210261,
365912,
259423,
374113,
251236,
374118,
390518,
357756,
374161,
112021,
349591,
357793,
333222,
259516,
415168,
366035,
415187,
366039,
415192,
415194,
415197,
415200,
333285,
415208,
366057,
366064,
415217,
415225,
423424,
415258,
415264,
366118,
415271,
382503,
349739,
144940,
415279,
415282,
415286,
210488,
415291,
415295,
349762,
333396,
374359,
333400,
366173,
423529,
423533,
210547,
415354,
333440,
267910,
267929,
259789,
366301,
333535,
153311,
366308,
366312,
431852,
399086,
366319,
210673,
366322,
399092,
366326,
333566,
268042,
210700,
366349,
210707,
399129,
333595,
210720,
366384,
358192,
210740,
366388,
358201,
325441,
366403,
325447,
341831,
341839,
341844,
415574,
358235,
350046,
399200,
399208,
268144,
358256,
358260,
399222,
325494,
333690,
325505,
399244,
333709,
333725,
333737,
382891,
382898,
350153,
358348,
333777,
219094,
399318,
358372,
350190,
350194,
333819,
350204,
350207,
325633,
325637,
350214,
219144,
268299,
333838,
350225,
186388,
350232,
333851,
350238,
350241,
374819,
350245,
350249,
350252,
178221,
350257,
350260,
350272,
243782,
350281,
350286,
374865,
252021,
342134,
374904,
268435,
333998,
334012,
260299,
211161,
375027,
358645,
268553,
268560,
432406,
325920,
194854,
358701,
391469,
358705,
358714,
358717,
383307,
358738,
383331,
383334,
391531,
383342,
334204,
268669,
194942,
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,
375401,
334466,
334469,
391813,
162446,
342680,
342685,
260767,
342711,
244410,
260798,
334530,
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,
252801,
260993,
351105,
400260,
211846,
342921,
342931,
252823,
400279,
392092,
400286,
252838,
359335,
211885,
252846,
400307,
351169,
359362,
351172,
170950,
187335,
326599,
359367,
359383,
359389,
383968,
343018,
261109,
261112,
244728,
383999,
261130,
261148,
359452,
211999,
261155,
261160,
261166,
359471,
375868,
343132,
384099,
384102,
384108,
367724,
187503,
343155,
384115,
212095,
351366,
384136,
384140,
384144,
351382,
384152,
384158,
384161,
351399,
384169,
367795,
244917,
384182,
367801,
384189,
384192,
351424,
343232,
367817,
244938,
384202,
253132,
384209,
146644,
351450,
384225,
359650,
343272,
351467,
359660,
384247,
351480,
384250,
351483,
351492,
384270,
359695,
261391,
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,
425639,
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,
155488,
376672,
155492,
327532,
261997,
376686,
262000,
262003,
425846,
262006,
147319,
262009,
327542,
262012,
155517,
155523,
155526,
360327,
376715,
155532,
262028,
262031,
262034,
262037,
262040,
262043,
155550,
253854,
262046,
262049,
262052,
327590,
155560,
155563,
155566,
327613,
393152,
393170,
155604,
155620,
253924,
155622,
253927,
327655,
360432,
393204,
360439,
253944,
393209,
155647
] |
bfaa1eb1d9015e48a9fdb5ae6fab9f0fd6a7fd50
|
c942866789fa99467467cd0b43251ecc2cd63a76
|
/FameShopping/MenuViewController/MenuViewController.swift
|
8512c0c781c7198db6306402fb249aa039f5b9cb
|
[] |
no_license
|
bajs000/FameShopping
|
e6eb6a4b357b8d9d2428055c3d1ca216e7ca0af2
|
bd28d4c4315ecf3e653ca769a81791e361a7d0c8
|
refs/heads/master
| 2021-01-19T20:08:23.367798 | 2017-05-04T02:08:38 | 2017-05-04T02:08:38 | 83,738,938 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,736 |
swift
|
//
// MenuViewController.swift
// FameShopping
//
// Created by YunTu on 2017/3/3.
// Copyright © 2017年 YunTu. All rights reserved.
//
import UIKit
import SVProgressHUD
import SDWebImage
class MenuViewController: UITableViewController {
let titleArr:[String] = ["女装","男装","美妆","鞋包","母婴","数码","品牌生活"]
@IBOutlet weak var avatar: UIImageView!
@IBOutlet weak var nickname: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if UserModel.share.avatar.characters.count > 0 {
self.avatar.sd_setImage(with: URL(string: UserModel.share.avatar), placeholderImage: UIImage(named: "user-default-icon"))
self.nickname.text = UserModel.share.userName
self.avatar.layer.cornerRadius = 44
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
// MARK: - Table view data source
override func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return titleArr.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
(cell.viewWithTag(1) as! UIImageView).image = UIImage(named: "menu-icon-" + String(indexPath.row))
(cell.viewWithTag(2) as! UILabel).text = self.titleArr[indexPath.row]
(cell.viewWithTag(3) as! UIImageView).image = Helpers.image(#imageLiteral(resourceName: "access"), with: #colorLiteral(red: 0.5098039216, green: 0.5098039216, blue: 0.5098039216, alpha: 1))
return cell
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
(UIApplication.shared.delegate as! AppDelegate).hideLeftMenu(indexPath)
}
/*
// Override to support conditional editing of the table view.
override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the specified item to be editable.
return true
}
*/
/*
// Override to support editing the table view.
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
// Delete the row from the data source
tableView.deleteRows(at: [indexPath], with: .fade)
} else if editingStyle == .insert {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) {
}
*/
/*
// Override to support conditional rearranging of the table view.
override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the item to be re-orderable.
return true
}
*/
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
|
[
-1
] |
a1be478e686335d6ec6fd46d79464613b047d5f2
|
c30bc636bed70ae2a968949105b660b703da3a34
|
/JFPopup/Classes/Core/JFPopup.swift
|
7af4fa5b5e559b086c713d59722b5e0e869618dd
|
[
"MIT"
] |
permissive
|
LiMaoAtCD/JFPopup
|
dfce0e6b629f7d3559a6edf64af92985f8386ec4
|
5ec8c8f6186851ddad6912a6ae75ab4fc54d658a
|
refs/heads/main
| 2023-08-20T05:10:59.639033 | 2021-10-13T08:26:56 | 2021-10-13T08:26:56 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 464 |
swift
|
//
// Popup.swift
// PopupKit
//
// Created by 逸风 on 2021/10/9.
//
import JRBaseKit
public struct JFPopup<Base> {
public let base: Base
init(_ base: Base) {
self.base = base
}
}
public protocol JFPopupCompatible {}
public extension JFPopupCompatible {
static var popup: JFPopup<Self>.Type {
set {}
get { JFPopup<Self>.self }
}
var popup: JFPopup<Self> {
set {}
get { JFPopup(self) }
}
}
|
[
-1
] |
df1f148805711dd55090628e9f12250390cfe0a7
|
3dbddc4f84048bc9f32c39a8e048788ec69d81f5
|
/Twitter Clone/View/Shared/InputContainerView.swift
|
44bf0484977f3e38d8a1c6ebc2cd66a9ce0c757d
|
[] |
no_license
|
tsubbi/TwitterClone
|
0063e93db8135daf725d4f821cfb318ec8c3b745
|
f9e574c47abe98a7f44558f607f666e0efa79a06
|
refs/heads/master
| 2023-07-04T17:19:12.432254 | 2021-08-24T00:16:35 | 2021-08-24T00:16:35 | 381,139,625 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,009 |
swift
|
//
// Utilities.swift
// Twitter Clone
//
// Created by Jamie Chen on 2021-06-29.
//
import UIKit
class InputContainerView: UIView {
enum InputfieldType {
case email
case password
case fullName
case userName
var placeholderText: String {
switch self {
case .email:
return "Email"
case .password:
return "Password"
case .fullName:
return "Full Name"
case .userName:
return "User Name"
}
}
var displayImage: UIImage? {
let route = ImageAsset.self
switch self {
case .email:
return route.getImage(.emailIcon)
case .fullName,
.userName:
return route.getImage(.userIcon)
case .password:
return route.getImage(.passwordIcon)
}
}
}
private(set) var imageView: UIImageView
private(set) var textField: UITextField
private let dividerView: UIView
init(frame: CGRect = .zero, of type: InputfieldType) {
self.imageView = UIImageView(image: type.displayImage)
self.textField = UITextField()
self.dividerView = UIView()
super.init(frame: frame)
setupUI(of: type)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func setupUI(of type: InputfieldType) {
// image attributes
self.imageView.contentMode = .scaleAspectFit
// textfield attributes
self.textField.textColor = .white
// source: https://stackoverflow.com/a/27798073/14939990
self.textField.attributedPlaceholder =
NSAttributedString(string: type.placeholderText,
attributes: [NSAttributedString.Key.foregroundColor: UIColor.white])
self.textField.isSecureTextEntry = type == .password ? true : false
self.dividerView.backgroundColor = .white
self.addSubview(self.imageView)
self.addSubview(self.textField)
self.addSubview(self.dividerView)
}
// MARK: - positioning
override func layoutSubviews() {
self.snp.makeConstraints { $0.height.equalTo(50) }
self.imageView.snp.makeConstraints {
$0.width.height.equalTo(24)
$0.leading.equalTo(self).offset(8)
$0.bottom.equalTo(self).offset(-8)
}
self.textField.snp.makeConstraints {
$0.leading.equalTo(self.imageView.snp.trailing).offset(8)
$0.trailing.equalTo(self.snp.trailing).offset(-8)
$0.centerY.equalTo(self.imageView)
}
self.dividerView.snp.makeConstraints {
$0.width.equalTo(self)
$0.height.equalTo(0.75)
$0.bottom.leading.trailing.equalTo(self)
}
}
}
|
[
-1
] |
9c5dcad8a8942e0c8e7c540bb6d02b2ec9c25806
|
9bd9d40a1cd45e310878e7fa72c90d2ca849dbc7
|
/Sources/URITemplate.swift
|
e81cdf3faa5728e4969911ecf56a2c63b8b030d3
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
workivate/URITemplate.swift
|
554720b30129b22f1e937015855457ffcd29abac
|
8b6c3c544c14829a8c5168edc53c36b398176b45
|
refs/heads/master
| 2020-03-06T18:30:33.309364 | 2019-06-19T09:23:19 | 2019-06-19T09:23:19 | 127,008,418 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 18,051 |
swift
|
//
// URITemplate.swift
// URITemplate
//
// Created by Kyle Fuller on 25/11/2014.
// Copyright (c) 2014 Kyle Fuller. All rights reserved.
//
import Foundation
// MARK: URITemplate
/// A data structure to represent an RFC6570 URI template.
public struct URITemplate : CustomStringConvertible, Equatable, Hashable, ExpressibleByStringLiteral, ExpressibleByExtendedGraphemeClusterLiteral, ExpressibleByUnicodeScalarLiteral {
/// The underlying URI template
public let template:String
var regex:NSRegularExpression {
let expression: NSRegularExpression?
do {
expression = try NSRegularExpression(pattern: "\\{([^\\}]+)\\}", options: NSRegularExpression.Options(rawValue: 0))
} catch let error as NSError {
fatalError("Invalid Regex \(error)")
}
return expression!
}
var operators:[Operator] {
return [
StringExpansion(),
ReservedExpansion(),
FragmentExpansion(),
LabelExpansion(),
PathSegmentExpansion(),
PathStyleParameterExpansion(),
FormStyleQueryExpansion(),
FormStyleQueryContinuation(),
]
}
/// Initialize a URITemplate with the given template
public init(template:String) {
self.template = template
}
public typealias ExtendedGraphemeClusterLiteralType = StringLiteralType
public init(extendedGraphemeClusterLiteral value: ExtendedGraphemeClusterLiteralType) {
template = value
}
public typealias UnicodeScalarLiteralType = StringLiteralType
public init(unicodeScalarLiteral value: UnicodeScalarLiteralType) {
template = value
}
public init(stringLiteral value: StringLiteralType) {
template = value
}
public init(from decoder: Decoder) throws {
self.template = try decoder.singleValueContainer().decode(String.self)
}
/// Returns a description of the URITemplate
public var description: String {
return template
}
public func hash(into hasher: inout Hasher) {
template.hash(into: &hasher)
}
/// Returns the set of keywords in the URI Template
public var variables: [String] {
let expressions = regex.matches(template).map { expression -> String in
// Removes the { and } from the expression
return String(expression[expression.index(after: expression.startIndex)..<expression.index(before: expression.endIndex)])
}
return expressions.map { expression -> [String] in
var expression = expression
for op in self.operators {
if let op = op.op {
if expression.hasPrefix(op) {
expression = String(expression[expression.index(after: expression.startIndex)...])
break
}
}
}
return expression.components(separatedBy: ",").map { component in
if component.hasSuffix("*") {
return String(component[..<component.index(before: component.endIndex)])
} else {
return component
}
}
}.reduce([], +)
}
/// Expand template as a URI Template using the given variables
public func expand(_ variables: [String: Any]) -> String {
return regex.substitute(template) { string in
var expression = String(string[string.index(after: string.startIndex)..<string.index(before: string.endIndex)])
let firstCharacter = String(expression[..<expression.index(after: expression.startIndex)])
var op = self.operators.filter {
if let op = $0.op {
return op == firstCharacter
}
return false
}.first
if (op != nil) {
expression = String(expression[expression.index(after: expression.startIndex)...])
} else {
op = self.operators.first
}
let rawExpansions = expression.components(separatedBy: ",").map { vari -> String? in
var variable = vari
var prefix:Int?
if let range = variable.range(of: ":") {
prefix = Int(String(variable[range.upperBound...]))
variable = String(variable[..<range.lowerBound])
}
let explode = variable.hasSuffix("*")
if explode {
variable = String(variable[..<variable.index(before: variable.endIndex)])
}
if let value: Any = variables[variable] {
return op!.expand(variable, value: value, explode: explode, prefix:prefix)
}
return op!.expand(variable, value:nil, explode:false, prefix:prefix)
}
let expansions = rawExpansions.reduce([], { (accumulator, expansion) -> [String] in
if let expansion = expansion {
return accumulator + [expansion]
}
return accumulator
})
if expansions.count > 0 {
return op!.prefix + expansions.joined(separator: op!.joiner)
}
return ""
}
}
func regexForVariable(_ variable:String, op:Operator?) -> String {
if op != nil {
return "(.*)"
} else {
return "([A-z0-9%_\\-']+)"
}
}
func regexForExpression(_ expression:String) -> String {
var expression = expression
let op = operators.filter {
$0.op != nil && expression.hasPrefix($0.op!)
}.first
if op != nil {
expression = String(expression[expression.index(after: expression.startIndex)..<expression.endIndex])
}
let regexes = expression.components(separatedBy: ",").map { variable -> String in
return self.regexForVariable(variable, op: op)
}
return regexes.joined(separator: (op ?? StringExpansion()).joiner)
}
var extractionRegex:NSRegularExpression? {
let regex = try! NSRegularExpression(pattern: "(\\{([^\\}]+)\\})|[^(.*)]", options: NSRegularExpression.Options(rawValue: 0))
let pattern = regex.substitute(self.template) { expression in
if expression.hasPrefix("{") && expression.hasSuffix("}") {
let startIndex = expression.index(after: expression.startIndex)
let endIndex = expression.index(before: expression.endIndex)
return self.regexForExpression(String(expression[startIndex..<endIndex]))
} else {
return NSRegularExpression.escapedPattern(for: expression)
}
}
do {
return try NSRegularExpression(pattern: "^\(pattern)$", options: NSRegularExpression.Options(rawValue: 0))
} catch _ {
return nil
}
}
/// Extract the variables used in a given URL
public func extract(_ url:String) -> [String:String]? {
if let expression = extractionRegex {
let input = url as NSString
let range = NSRange(location: 0, length: input.length)
let results = expression.matches(in: url, options: NSRegularExpression.MatchingOptions(rawValue: 0), range: range)
if let result = results.first {
var extractedVariables:[String: String] = [:]
for (index, variable) in variables.enumerated() {
let range = result.range(at: index + 1)
let value = NSString(string: input.substring(with: range)).removingPercentEncoding
extractedVariables[variable] = value
}
return extractedVariables
}
}
return nil
}
}
extension URITemplate: Codable {
public func encode(to encoder: Encoder) throws {
var container = encoder.singleValueContainer()
try container.encode(template)
}
}
/// Determine if two URITemplate's are equivalent
public func ==(lhs:URITemplate, rhs:URITemplate) -> Bool {
return lhs.template == rhs.template
}
// MARK: Extensions
extension NSRegularExpression {
func substitute(_ string:String, block:((String) -> (String))) -> String {
let oldString = string as NSString
let range = NSRange(location: 0, length: oldString.length)
var newString = string as NSString
let matches = self.matches(in: string, options: NSRegularExpression.MatchingOptions(rawValue: 0), range: range)
for match in Array(matches.reversed()) {
let expression = oldString.substring(with: match.range)
let replacement = block(expression)
newString = newString.replacingCharacters(in: match.range, with: replacement) as NSString
}
return newString as String
}
func matches(_ string:String) -> [String] {
let input = string as NSString
let range = NSRange(location: 0, length: input.length)
let results = self.matches(in: string, options: NSRegularExpression.MatchingOptions(rawValue: 0), range: range)
return results.map { result -> String in
return input.substring(with: result.range)
}
}
}
extension String {
func percentEncoded() -> String {
return addingPercentEncoding(withAllowedCharacters: CharacterSet.URITemplate.unreserved)!
}
}
// MARK: Operators
protocol Operator {
/// Operator
var op:String? { get }
/// Prefix for the expanded string
var prefix:String { get }
/// Character to use to join expanded components
var joiner:String { get }
func expand(_ variable:String, value: Any?, explode:Bool, prefix:Int?) -> String?
}
class BaseOperator {
var joiner:String { return "," }
func expand(_ variable:String, value: Any?, explode:Bool, prefix:Int?) -> String? {
if let value = value {
if let values = value as? [String: Any] {
return expand(variable:variable, value: values, explode: explode)
} else if let values = value as? [Any] {
return expand(variable:variable, value: values, explode: explode)
} else if let _ = value as? NSNull {
return expand(variable:variable)
} else {
return expand(variable:variable, value:"\(value)", prefix:prefix)
}
}
return expand(variable:variable)
}
// Point to overide to expand a value (i.e, perform encoding)
func expand(value:String) -> String {
return value
}
// Point to overide to expanding a string
func expand(variable:String, value:String, prefix:Int?) -> String {
if let prefix = prefix {
let valueCount = value.count
if valueCount > prefix {
let index = value.index(value.startIndex, offsetBy: prefix, limitedBy: value.endIndex)
return expand(value: String(value[..<index!]))
}
}
return expand(value: value)
}
// Point to overide to expanding an array
func expand(variable:String, value:[Any], explode:Bool) -> String? {
let joiner = explode ? self.joiner : ","
return value.map { self.expand(value: "\($0)") }.joined(separator: joiner)
}
// Point to overide to expanding a dictionary
func expand(variable: String, value: [String: Any], explode: Bool) -> String? {
let joiner = explode ? self.joiner : ","
let keyValueJoiner = explode ? "=" : ","
let elements = value.map({ (key, value) -> String in
let expandedKey = self.expand(value: key)
let expandedValue = self.expand(value: "\(value)")
return "\(expandedKey)\(keyValueJoiner)\(expandedValue)"
})
return elements.joined(separator: joiner)
}
// Point to overide when value not found
func expand(variable: String) -> String? {
return nil
}
}
/// RFC6570 (3.2.2) Simple String Expansion: {var}
class StringExpansion : BaseOperator, Operator {
var op:String? { return nil }
var prefix:String { return "" }
override var joiner:String { return "," }
override func expand(value:String) -> String {
return value.percentEncoded()
}
}
/// RFC6570 (3.2.3) Reserved Expansion: {+var}
class ReservedExpansion : BaseOperator, Operator {
var op:String? { return "+" }
var prefix:String { return "" }
override var joiner:String { return "," }
override func expand(value:String) -> String {
return value.addingPercentEncoding(withAllowedCharacters: CharacterSet.uriTemplateReservedAllowed)!
}
}
/// RFC6570 (3.2.4) Fragment Expansion {#var}
class FragmentExpansion : BaseOperator, Operator {
var op:String? { return "#" }
var prefix:String { return "#" }
override var joiner:String { return "," }
override func expand(value:String) -> String {
return value.addingPercentEncoding(withAllowedCharacters: CharacterSet.urlFragmentAllowed)!
}
}
/// RFC6570 (3.2.5) Label Expansion with Dot-Prefix: {.var}
class LabelExpansion : BaseOperator, Operator {
var op:String? { return "." }
var prefix:String { return "." }
override var joiner:String { return "." }
override func expand(value:String) -> String {
return value.percentEncoded()
}
override func expand(variable:String, value:[Any], explode:Bool) -> String? {
if value.count > 0 {
return super.expand(variable: variable, value: value, explode: explode)
}
return nil
}
}
/// RFC6570 (3.2.6) Path Segment Expansion: {/var}
class PathSegmentExpansion : BaseOperator, Operator {
var op:String? { return "/" }
var prefix:String { return "/" }
override var joiner:String { return "/" }
override func expand(value:String) -> String {
return value.percentEncoded()
}
override func expand(variable:String, value:[Any], explode:Bool) -> String? {
if value.count > 0 {
return super.expand(variable: variable, value: value, explode: explode)
}
return nil
}
}
/// RFC6570 (3.2.7) Path-Style Parameter Expansion: {;var}
class PathStyleParameterExpansion : BaseOperator, Operator {
var op:String? { return ";" }
var prefix:String { return ";" }
override var joiner:String { return ";" }
override func expand(value:String) -> String {
return value.percentEncoded()
}
override func expand(variable:String, value:String, prefix:Int?) -> String {
let valueCount = value.count
if valueCount > 0 {
let expandedValue = super.expand(variable: variable, value: value, prefix: prefix)
return "\(variable)=\(expandedValue)"
}
return variable
}
override func expand(variable:String, value:[Any], explode:Bool) -> String? {
let joiner = explode ? self.joiner : ","
let expandedValue = value.map {
let expandedValue = self.expand(value: "\($0)")
if explode {
return "\(variable)=\(expandedValue)"
}
return expandedValue
}.joined(separator: joiner)
if !explode {
return "\(variable)=\(expandedValue)"
}
return expandedValue
}
override func expand(variable: String, value: [String: Any], explode: Bool) -> String? {
let expandedValue = super.expand(variable: variable, value: value, explode: explode)
if let expandedValue = expandedValue {
if (!explode) {
return "\(variable)=\(expandedValue)"
}
}
return expandedValue
}
}
/// RFC6570 (3.2.8) Form-Style Query Expansion: {?var}
class FormStyleQueryExpansion : BaseOperator, Operator {
var op:String? { return "?" }
var prefix:String { return "?" }
override var joiner:String { return "&" }
override func expand(value:String) -> String {
return value.percentEncoded()
}
override func expand(variable:String, value:String, prefix:Int?) -> String {
let expandedValue = super.expand(variable: variable, value: value, prefix: prefix)
return "\(variable)=\(expandedValue)"
}
override func expand(variable: String, value: [Any], explode: Bool) -> String? {
if value.count > 0 {
let joiner = explode ? self.joiner : ","
let expandedValue = value.map {
let expandedValue = self.expand(value: "\($0)")
if explode {
return "\(variable)=\(expandedValue)"
}
return expandedValue
}.joined(separator: joiner)
if !explode {
return "\(variable)=\(expandedValue)"
}
return expandedValue
}
return nil
}
override func expand(variable: String, value: [String: Any], explode: Bool) -> String? {
if value.count > 0 {
let expandedVariable = self.expand(value: variable)
let expandedValue = super.expand(variable: variable, value: value, explode: explode)
if let expandedValue = expandedValue {
if (!explode) {
return "\(expandedVariable)=\(expandedValue)"
}
}
return expandedValue
}
return nil
}
}
/// RFC6570 (3.2.9) Form-Style Query Continuation: {&var}
class FormStyleQueryContinuation : BaseOperator, Operator {
var op:String? { return "&" }
var prefix:String { return "&" }
override var joiner:String { return "&" }
override func expand(value:String) -> String {
return value.percentEncoded()
}
override func expand(variable:String, value:String, prefix:Int?) -> String {
let expandedValue = super.expand(variable: variable, value: value, prefix: prefix)
return "\(variable)=\(expandedValue)"
}
override func expand(variable: String, value: [Any], explode: Bool) -> String? {
let joiner = explode ? self.joiner : ","
let expandedValue = value.map {
let expandedValue = self.expand(value: "\($0)")
if explode {
return "\(variable)=\(expandedValue)"
}
return expandedValue
}.joined(separator: joiner)
if !explode {
return "\(variable)=\(expandedValue)"
}
return expandedValue
}
override func expand(variable: String, value: [String: Any], explode: Bool) -> String? {
let expandedValue = super.expand(variable: variable, value: value, explode: explode)
if let expandedValue = expandedValue {
if (!explode) {
return "\(variable)=\(expandedValue)"
}
}
return expandedValue
}
}
private extension CharacterSet {
struct URITemplate {
static let digits = CharacterSet(charactersIn: "0"..."9")
static let genDelims = CharacterSet(charactersIn: ":/?#[]@")
static let subDelims = CharacterSet(charactersIn: "!$&'()*+,;=")
static let unreservedSymbols = CharacterSet(charactersIn: "-._~")
static let unreserved = {
return alpha.union(digits).union(unreservedSymbols)
}()
static let reserved = {
return genDelims.union(subDelims)
}()
static let alpha = { () -> CharacterSet in
let upperAlpha = CharacterSet(charactersIn: "A"..."Z")
let lowerAlpha = CharacterSet(charactersIn: "a"..."z")
return upperAlpha.union(lowerAlpha)
}()
}
static let uriTemplateReservedAllowed = {
return URITemplate.unreserved.union(URITemplate.reserved)
}()
}
|
[
241025,
290909
] |
4649be52c42b84a0887f7bb77d0923607abef1fb
|
250b99cfdce19688a8be74bb2cc216ece3755af8
|
/Blogy2/Views/BlogCollectionViewCell.swift
|
d1bc945f09445347120432e4451039e7d111ae1e
|
[] |
no_license
|
ibrahim-zakarya/BlogySwift
|
407c20fe8bff02f00625860fae7f6605156870af
|
1ef048f501cad4642fa692716a94e9c68e036c95
|
refs/heads/master
| 2020-05-18T06:34:32.253282 | 2019-04-30T10:12:28 | 2019-04-30T10:12:28 | 184,238,070 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 398 |
swift
|
//
// BlogCollectionViewCell.swift
// Blogy2
//
// Created by admin on 29/09/2017.
// Copyright © 2017 admin. All rights reserved.
//
import UIKit
class BlogCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var blogImageView: CachedImageView!
@IBOutlet weak var blogTitleLabel: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
}
}
|
[
-1
] |
2f91a7f8b3521ac64e7e21257ab64cd889d02dd5
|
58c223f2efe451e516bc1b5acb174788fb4388e6
|
/SankalpDevonPPCoreDataProject/SankalpDevonPPCoreDataProject/addTodoListViewController.swift
|
859d58d3b3663a9bef45ef15234a6e0531c357ef
|
[] |
no_license
|
SankalpWSU/GitFolder
|
235f31dddc6296ef343e8334dc20c72d13bb4bd4
|
803a72aee641c1cd31465a453eb62ea13f60fca9
|
refs/heads/master
| 2020-07-27T04:11:15.655953 | 2019-12-26T18:49:14 | 2019-12-26T18:49:14 | 208,863,223 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 567 |
swift
|
//
// addTodoListViewController.swift
// SankalpDevonPPCoreDataProject
//
// Created by MAC on 9/23/19.
// Copyright © 2019 PaulRenfrew. All rights reserved.
//
import UIKit
protocol ViewDelegate {
func updateValues(with newValues: String?)
}
class addTodoListViewController: UIViewController {
var firstScreen: ViewDelegate?
@IBOutlet weak var inputItem: UITextField!
@IBAction func addItem(_ sender: UIButton) {
firstScreen?.updateValues(with: inputItem.text)
navigationController?.popViewController(animated: true)
}
}
|
[
-1
] |
9bcec1a85aec03577d1d98e31dfa09e0a925d7a6
|
6ed5cc1a40abdcea0c0e8d9a3abae70273948979
|
/stellarsdk/stellarsdk/service/TransactionsService.swift
|
7bdf11edee8b536e2efe962e9414309bcaaf7b1f
|
[
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] |
permissive
|
Dekalabs/stellar-ios-mac-sdk
|
dd4416d0594726f2da3b67569dacfad9dc31abbf
|
5dc013c3e5e70152aafe6b81f12d472ed98f75a4
|
refs/heads/master
| 2020-07-02T08:19:25.222942 | 2020-06-21T09:25:51 | 2020-06-21T09:25:51 | 201,471,062 | 0 | 1 | null | 2019-08-09T13:18:19 | 2019-08-09T13:18:18 | null |
UTF-8
|
Swift
| false | false | 13,845 |
swift
|
//
// TransactionsService.swift
// stellarsdk
//
// Created by Razvan Chelemen on 08/02/2018.
// Copyright © 2018 Soneso. All rights reserved.
//
import Foundation
public enum TransactionDetailsResponseEnum {
case success(details: TransactionResponse)
case failure(error: HorizonRequestError)
}
public enum TransactionPostResponseEnum {
case success(details: SubmitTransactionResponse)
case destinationRequiresMemo(destinationAccountId: String)
case failure(error: HorizonRequestError)
}
public enum CheckMemoRequiredResponseEnum {
case noMemoRequired
case memoRequired(destination: String)
case failure(error: HorizonRequestError)
}
public enum TransactionsChange {
case allTransactions(cursor:String?)
case transactionsForAccount(account:String, cursor:String?)
case transactionsForLedger(ledger:String, cursor:String?)
}
public typealias TransactionDetailsResponseClosure = (_ response:TransactionDetailsResponseEnum) -> (Void)
public typealias TransactionPostResponseClosure = (_ response:TransactionPostResponseEnum) -> (Void)
public typealias CheckMemoRequiredResponseClosure = (_ response:CheckMemoRequiredResponseEnum) -> (Void)
public class TransactionsService: NSObject {
let serviceHelper: ServiceHelper
let jsonDecoder = JSONDecoder()
private override init() {
serviceHelper = ServiceHelper(baseURL: "")
}
init(baseURL: String) {
serviceHelper = ServiceHelper(baseURL: baseURL)
}
open func getTransactions(cursor:String? = nil, order:Order? = nil, limit:Int? = nil, response:@escaping PageResponse<TransactionResponse>.ResponseClosure) {
let path = "/transactions"
getTransactions(onPath: path, from:cursor, order:order, limit:limit, response:response)
}
open func getTransactions(forAccount accountId:String, from cursor:String? = nil, order:Order? = nil, limit:Int? = nil, response:@escaping PageResponse<TransactionResponse>.ResponseClosure) {
let path = "/accounts/" + accountId + "/transactions"
getTransactions(onPath: path, from:cursor, order:order, limit:limit, response:response)
}
open func getTransactions(forLedger ledger:String, from cursor:String? = nil, order:Order? = nil, limit:Int? = nil, response:@escaping PageResponse<TransactionResponse>.ResponseClosure) {
let path = "/ledgers/" + ledger + "/transactions"
getTransactions(onPath: path, from:cursor, order:order, limit:limit, response:response)
}
open func getTransactionDetails(transactionHash:String, response:@escaping TransactionDetailsResponseClosure) {
let requestPath = "/transactions/" + transactionHash
serviceHelper.GETRequestWithPath(path: requestPath) { (result) -> (Void) in
switch result {
case .success(let data):
do {
self.jsonDecoder.dateDecodingStrategy = .formatted(DateFormatter.iso8601)
let transaction = try self.jsonDecoder.decode(TransactionResponse.self, from: data)
response(.success(details: transaction))
} catch {
response(.failure(error: .parsingResponseFailed(message: error.localizedDescription)))
}
case .failure(let error):
response(.failure(error:error))
}
}
}
open func submitTransaction(transaction:Transaction, skipMemoRequiredCheck:Bool = false, response:@escaping TransactionPostResponseClosure) throws {
let envelope = try transaction.encodedEnvelope()
postTransaction(transactionEnvelope:envelope, skipMemoRequiredCheck: skipMemoRequiredCheck, response: response)
}
open func submitFeeBumpTransaction(transaction:FeeBumpTransaction, response:@escaping TransactionPostResponseClosure) throws {
let envelope = try transaction.encodedEnvelope()
//print(envelope)
postTransactionCore(transactionEnvelope: envelope, response: { (result) -> (Void) in
switch result {
case .success(let transaction):
response(.success(details: transaction))
case .failure(let error):
response(.failure(error: error))
case .destinationRequiresMemo(let destinationAccountId):
response(.destinationRequiresMemo(destinationAccountId: destinationAccountId))
}
})
}
open func postTransaction(transactionEnvelope:String, skipMemoRequiredCheck:Bool = false, response:@escaping TransactionPostResponseClosure) {
if !skipMemoRequiredCheck, let transaction = try? Transaction(envelopeXdr: transactionEnvelope) {
checkMemoRequired(transaction: transaction, response: { (result) -> (Void) in
switch result {
case .noMemoRequired:
self.postTransactionCore(transactionEnvelope: transactionEnvelope, response: { (result) -> (Void) in
switch result {
case .success(let transaction):
response(.success(details: transaction))
case .failure(let error):
response(.failure(error: error))
case .destinationRequiresMemo(let destinationAccountId):
response(.destinationRequiresMemo(destinationAccountId: destinationAccountId))
}
})
case .memoRequired(let accountId):
response(.destinationRequiresMemo(destinationAccountId: accountId))
case .failure(let error):
response(.failure(error: error))
}
})
} else {
postTransactionCore(transactionEnvelope: transactionEnvelope, response: { (result) -> (Void) in
switch result {
case .success(let transaction):
response(.success(details: transaction))
case .failure(let error):
response(.failure(error: error))
case .destinationRequiresMemo(let destinationAccountId):
response(.destinationRequiresMemo(destinationAccountId: destinationAccountId))
}
})
}
}
private func checkMemoRequired(transaction: Transaction, response:@escaping CheckMemoRequiredResponseClosure) {
if transaction.memo != Memo.none {
response(.noMemoRequired)
return
}
var destinations = [String]()
for operation in transaction.operations {
var destination = ""
if let paymentOp = operation as? PaymentOperation, paymentOp.destinationAccountId.hasPrefix("G") {
destination = paymentOp.destinationAccountId
} else if let paymentOp = operation as? PathPaymentOperation, paymentOp.destinationAccountId.hasPrefix("G") {
destination = paymentOp.destinationAccountId
} else if let accountMergeOp = operation as? AccountMergeOperation, accountMergeOp.destinationAccountId.hasPrefix("G") {
destination = accountMergeOp.destinationAccountId
}
if destination.isEmpty || destinations.contains(destination) {
continue
}
destinations.append(destination)
}
if (destinations.count == 0) {
response(.noMemoRequired)
return
}
checkMemoRequiredForDestinations(destinations: destinations, response: { (result) -> (Void) in
switch result {
case .noMemoRequired:
response(.noMemoRequired)
case .memoRequired(let accountId):
response(.memoRequired(destination: accountId))
case .failure(let error):
response(.failure(error: error))
}
})
}
private func checkMemoRequiredForDestinations(destinations: [String], response:@escaping CheckMemoRequiredResponseClosure) {
var remainingDestinations = destinations
if let firstDestination = remainingDestinations.first {
let requestPath = "/accounts/\(firstDestination)"
serviceHelper.GETRequestWithPath(path: requestPath) { (result) -> (Void) in
switch result {
case .success(let data):
do {
let accountDetails = try self.jsonDecoder.decode(AccountResponse.self, from: data)
// "MQ==" is the base64 encoding of "1".
if let value = accountDetails.data["config.memo_required"], value == "MQ==" {
response(.memoRequired(destination: accountDetails.accountId))
} else {
remainingDestinations.removeFirst()
self.checkMemoRequiredForDestinations(destinations: remainingDestinations, response: { (nextResult) -> (Void) in
switch nextResult {
case .noMemoRequired:
response(.noMemoRequired)
case .memoRequired(let accountId):
response(.memoRequired(destination: accountId))
case .failure(let error):
response(.failure(error: error))
}
})
}
} catch {
response(.failure(error: .parsingResponseFailed(message: error.localizedDescription)))
}
case .failure(let error):
response(.failure(error:error))
}
}
} else {
response(.noMemoRequired)
}
}
private func postTransactionCore(transactionEnvelope:String, response:@escaping TransactionPostResponseClosure) {
let requestPath = "/transactions"
if let encoded = transactionEnvelope.urlEncoded {
let data = ("tx=" + encoded).data(using: .utf8)
serviceHelper.POSTRequestWithPath(path: requestPath, body: data) { (result) -> (Void) in
switch result {
case .success(let data):
do {
self.jsonDecoder.dateDecodingStrategy = .formatted(DateFormatter.iso8601)
let transaction = try self.jsonDecoder.decode(SubmitTransactionResponse.self, from: data)
response(.success(details: transaction))
} catch {
response(.failure(error: .parsingResponseFailed(message: error.localizedDescription)))
}
case .failure(let error):
response(.failure(error:error))
}
}
} else {
response(.failure(error: .parsingResponseFailed(message: "Failed to URL encode the xdr enveloper")))
}
}
open func stream(for transactionsType:TransactionsChange) -> TransactionsStreamItem {
var subpath:String!
switch transactionsType {
case .allTransactions(let cursor):
subpath = "/transactions"
if let cursor = cursor {
subpath = subpath + "?cursor=" + cursor
}
case .transactionsForAccount(let accountId, let cursor):
subpath = "/accounts/" + accountId + "/transactions"
if let cursor = cursor {
subpath = subpath + "?cursor=" + cursor
}
case .transactionsForLedger(let ledger, let cursor):
subpath = "/ledgers/" + ledger + "/transactions"
if let cursor = cursor {
subpath = subpath + "?cursor=" + cursor
}
}
let streamItem = TransactionsStreamItem(requestUrl: serviceHelper.requestUrlWithPath(path: subpath))
return streamItem
}
private func getTransactions(onPath path:String, from cursor:String? = nil, order:Order? = nil, limit:Int? = nil, response:@escaping PageResponse<TransactionResponse>.ResponseClosure) {
var requestPath = path
var params = Dictionary<String,String>()
params["cursor"] = cursor
params["order"] = order?.rawValue
if let limit = limit { params["limit"] = String(limit) }
if let pathParams = params.stringFromHttpParameters(),
pathParams.count > 0 {
requestPath += "?\(pathParams)"
}
getTransactionsFromUrl(url:serviceHelper.requestUrlWithPath(path: requestPath), response:response)
}
open func getTransactionsFromUrl(url:String, response:@escaping PageResponse<TransactionResponse>.ResponseClosure) {
serviceHelper.GETRequestFromUrl(url: url) { (result) -> (Void) in
switch result {
case .success(let data):
do {
self.jsonDecoder.dateDecodingStrategy = .formatted(DateFormatter.iso8601)
let transactions = try self.jsonDecoder.decode(PageResponse<TransactionResponse>.self, from: data)
response(.success(details: transactions))
} catch {
response(.failure(error: .parsingResponseFailed(message: error.localizedDescription)))
}
case .failure(let error):
response(.failure(error:error))
}
}
}
}
|
[
-1
] |
3b705eca32d01a9e017b6d5cfa3bf189efeb802d
|
5e98a36052a923aa91912b54a8ee7905ef203d0d
|
/WeatheriOSApp/HourDetailViewController.swift
|
e68ee5b91f5380af35900569a591b9caa4118fb9
|
[] |
no_license
|
michellesfc/WeatheriOSApp
|
c34a4f2795ffa3aef5a6d24cca68f72c09e7216a
|
1ba527b0d97ab2ec2cf61084bf2a20a629430169
|
refs/heads/master
| 2021-01-18T20:29:04.407376 | 2016-11-21T02:57:40 | 2016-11-21T02:57:40 | 72,126,750 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,039 |
swift
|
//
// HourDetailViewController.swift
// WeatheriOSApp
//
// Created by Michelle Gu on 11/5/16.
// Copyright © 2016 Michelle Gu. All rights reserved.
//
import UIKit
class HourDetailViewController: UIViewController {
@IBOutlet weak var navigationBar: UINavigationItem!
@IBOutlet weak var hourLabel: UILabel!
@IBOutlet weak var temperatureLabel: UILabel!
@IBOutlet weak var windSpeedLabel: UILabel!
@IBOutlet weak var popLabel: UILabel!
@IBOutlet weak var UVILabel: UILabel!
@IBOutlet weak var heatIndexLabel: UILabel!
@IBOutlet weak var windChillLabel: UILabel!
@IBOutlet weak var conditionLabel: UILabel!
@IBOutlet weak var iconLabel: UILabel!
var hour:WeatherHour = WeatherHour()
func setHourDetailLabels() {
let date = hour.date!
let idx = date.range(of: "on")?.upperBound
navigationBar.title = hour.dayOfWeek! + ", " + hour.date!.substring(from: idx!)
hourLabel.text = hour.hour!
iconLabel.text = hour.conditionImg!
conditionLabel.text = hour.conditions!
temperatureLabel.text = "Temperature: " + String(hour.temperature!) + "°F"
windSpeedLabel.text = "Wind Speed: " + String(hour.windSpeed!) + " mph"
popLabel.text = "Probability of Precipitation: " + String(hour.probOfPrecip!) + "%"
UVILabel.text = "UVI: \(hour.UVI!)"
if(hour.heatIndex! != -9999 && hour.heatIndex! != -999) {
heatIndexLabel.text = "Heat Index: \(hour.heatIndex!)"
}
else {
heatIndexLabel.text = "Heat Index: n/a"
}
if(hour.windChill! != -9999 && hour.windChill! != -999) {
windChillLabel.text = "Wind Chill: \(hour.windChill!)"
}
else {
windChillLabel.text = "Wind Chill: n/a"
}
}
override func viewDidLoad() {
super.viewDidLoad()
setHourDetailLabels()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
|
[
-1
] |
c31e2d70a30e613b6f0174b764ea734c740e2cca
|
7b28db1f842e86adfff01155f3a2dd0bf3e33cb0
|
/twilight/Views/ActionCell.swift
|
272e6ce7c4f441cc749bc2e1e00d1c5f4760dfef
|
[] |
no_license
|
acm-uiuc/twilight-ios-old
|
6fa813117d517ebbc5595e55ebd72f3cde473192
|
ecc005478c8e1dfdca39c57810bd8b449c85273c
|
refs/heads/master
| 2021-08-23T08:18:50.118114 | 2017-12-04T08:41:24 | 2017-12-04T08:41:24 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,010 |
swift
|
//
// ActionCell.swift
// twilight
//
// Created by Rauhul Varma on 11/12/17.
// Copyright © 2017 acm. All rights reserved.
//
import Foundation
import UIKit
protocol ActionCellDelegate {
func didPerformAction(atIndexPath indexPath: IndexPath)
}
class ActionCell: UITableViewCell {
static let REUSE_IDENTIFIER = "ActionCell"
var indexPath: IndexPath?
var delegate: ActionCellDelegate?
@IBOutlet weak var fieldLabel: UILabel!
@IBOutlet weak var actionButton: UIButton!
override func awakeFromNib() {
super.awakeFromNib()
actionButton.layer.cornerRadius = 4
}
override func prepareForReuse() {
super.prepareForReuse()
indexPath = nil
delegate = nil
fieldLabel.text = "Field"
actionButton.setTitle("Action", for: .normal)
}
@IBAction func didPerformAction(sender: Any?) {
guard let indexPath = indexPath else { return }
delegate?.didPerformAction(atIndexPath: indexPath)
}
}
|
[
-1
] |
8ab63b4c076dd90b6f29a55852a05e1cc364c9ba
|
df589a39666ce2c3d06d2f46a4e41a0b50faf8de
|
/arcgis-ios-sdk-samples/Utility network/Display utility associations/DisplayUtilityAssociationsViewController.swift
|
9a45ae4ee288d9568272bfa0dbe935bf4e747f01
|
[
"Apache-2.0"
] |
permissive
|
naomiseco/arcgis-runtime-samples-ios
|
0ead45d6371affc416a393512601cb022d279bd4
|
1111077da0c1d6f4d95772596174e699ffa390a4
|
refs/heads/master
| 2023-01-11T08:25:20.784403 | 2020-10-05T18:39:27 | 2020-10-05T18:39:27 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 8,553 |
swift
|
// Copyright 2020 Esri
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import UIKit
import ArcGIS
class DisplayUtilityAssociationsViewController: UIViewController {
// Set the map.
@IBOutlet var mapView: AGSMapView! {
didSet {
mapView.map = AGSMap(basemapType: .topographicVector, latitude: 41.8057655, longitude: -88.1489692, levelOfDetail: 23)
mapView.graphicsOverlays.add(associationsOverlay)
}
}
@IBOutlet var toolbar: UIToolbar!
private let utilityNetwork = AGSUtilityNetwork(url: URL(string: "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer")!)
private let maxScale = 2000.0
private let associationsOverlay = AGSGraphicsOverlay()
private let attachmentSymbol = AGSSimpleLineSymbol(style: .dot, color: .green, width: 5)
private let connectivitySymbol = AGSSimpleLineSymbol(style: .dot, color: .red, width: 5)
func loadUtilityNetwork() {
utilityNetwork.load { [weak self] error in
guard let self = self else { return }
if let error = error {
self.presentAlert(error: error)
} else {
// Get all the edges and junctions in the network.
let sourcesByType = Dictionary(grouping: self.utilityNetwork.definition.networkSources) { $0.sourceType }
let operationalLayers = self.mapView.map?.operationalLayers
// Add all edges that are not subnet lines to the map.
let edgeLayers = sourcesByType[.edge]!
.filter { $0.sourceUsageType != .subnetLine }
.map { AGSFeatureLayer(featureTable: $0.featureTable) }
operationalLayers?.addObjects(from: edgeLayers)
// Add all the junctions to the map.
let junctionLayers = sourcesByType[.junction]!.map { AGSFeatureLayer(featureTable: $0.featureTable) }
operationalLayers?.addObjects(from: junctionLayers)
// Create a renderer for the associations.
let attachmentValue = AGSUniqueValue(description: "Attachment", label: "", symbol: self.attachmentSymbol, values: [AGSUtilityAssociationType.attachment])
let connectivityValue = AGSUniqueValue(description: "Connectivity", label: "", symbol: self.connectivitySymbol, values: [AGSUtilityAssociationType.connectivity])
self.associationsOverlay.renderer = AGSUniqueValueRenderer(fieldNames: ["AssociationType"], uniqueValues: [attachmentValue, connectivityValue], defaultLabel: "", defaultSymbol: nil)
self.createSwatches()
self.addAssociationGraphics()
self.mapViewDidChange()
}
}
}
func addAssociationGraphics() {
// Check if the current viewpoint is outside of the max scale.
if let viewpoint = mapView.currentViewpoint(with: .centerAndScale),
viewpoint.targetScale >= maxScale {
return
}
// Check if the current viewpoint has an extent.
if let viewpoint = mapView.currentViewpoint(with: .boundingGeometry) {
// Get all of the associations in extent of the viewpoint.
utilityNetwork.associations(withExtent: viewpoint.targetGeometry.extent) { [weak self] (associations, error) in
guard let self = self else { return }
if let error = error {
self.presentAlert(error: error)
} else if let associations = associations {
let graphics: [AGSGraphic] = associations.compactMap { association in
// If it the current association does not exist, add it to the graphics overlay.
let associationGID = association.globalID
guard !self.associationsOverlay.graphics.contains(where: {
($0 as! AGSGraphic).attributes["GlobalId"] as? UUID == associationGID
}) else {
return nil
}
let symbol: AGSSymbol
switch association.associationType {
case .attachment:
symbol = self.attachmentSymbol
case .connectivity:
symbol = self.connectivitySymbol
default:
return nil
}
return AGSGraphic(
geometry: association.geometry,
symbol: symbol,
attributes: [
"GlobalId": associationGID,
"AssociationType": association.associationType
]
)
}
self.associationsOverlay.graphics.addObjects(from: graphics)
}
}
}
}
// Populate the legend.
func createSwatches() {
let swatchGroup = DispatchGroup()
var attachmentImage: UIImage?
var connectivityImage: UIImage?
swatchGroup.enter()
attachmentSymbol.createSwatch(withBackgroundColor: nil, screen: .main) { (image, error) in
defer { swatchGroup.leave() }
if let error = error {
self.presentAlert(error: error)
} else if let image = image {
attachmentImage = image.withRenderingMode(.alwaysOriginal)
}
}
swatchGroup.enter()
connectivitySymbol.createSwatch(withBackgroundColor: nil, screen: .main) { (image, error) in
defer { swatchGroup.leave() }
if let error = error {
self.presentAlert(error: error)
} else if let image = image {
connectivityImage = image.withRenderingMode(.alwaysOriginal)
}
}
swatchGroup.notify(queue: .main) { [weak self] in
let attachmentBBI = UIBarButtonItem(image: attachmentImage, style: .plain, target: nil, action: nil)
let connectivityBBI = UIBarButtonItem(image: connectivityImage, style: .plain, target: nil, action: nil)
let attachmentLabel = UIBarButtonItem(title: "Attachment", style: .plain, target: nil, action: nil)
attachmentLabel.tintColor = .black
let connectivityLabel = UIBarButtonItem(title: "Connectivity", style: .plain, target: nil, action: nil)
connectivityLabel.tintColor = .black
let fixedSpace1 = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil)
let fixedSpace2 = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil)
let flexibleSpace1 = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
let flexibleSpace2 = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
self?.toolbar.items = [
attachmentBBI,
fixedSpace1,
attachmentLabel,
flexibleSpace1,
connectivityBBI,
fixedSpace2,
connectivityLabel,
flexibleSpace2
]
}
}
// Observe the viewpoint.
func mapViewDidChange() {
self.mapView.viewpointChangedHandler = { [weak self] in
DispatchQueue.main.async {
self?.addAssociationGraphics()
}
}
}
override func viewDidLoad() {
super.viewDidLoad()
loadUtilityNetwork()
// Add the source code button item to the right of navigation bar.
(self.navigationItem.rightBarButtonItem as? SourceCodeBarButtonItem)?.filenames = ["DisplayUtilityAssociationsViewController"]
}
}
|
[
-1
] |
b96b3c566764c97dd93457885090c0c17eaa0a6f
|
d355174441aba82957024c3810f4748db5a431ee
|
/Project Templates/iOS/iDevs.io/VIPER.xctemplate/Classes/AppDelegate/Services/ApplicationService.swift
|
68ca296d08cbcc3f96d087231ada52f12b07bc61
|
[
"MIT"
] |
permissive
|
thearaoeun/Core-iOS-Application-Architecture
|
d749419122f3f295a93553a368488838ca0f72cc
|
a91087f3c4e6266e0ee2d1b94ab7c8609a78ab4b
|
refs/heads/master
| 2023-01-09T19:27:43.745422 | 2019-12-18T18:45:21 | 2019-12-18T18:45:21 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,089 |
swift
|
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___
// ___COPYRIGHT___
//
import UIKit
class ApplicationService: NSObject, AppDelegateService {
var window: UIWindow?
let container: DependencyContainer
lazy var appCoordinator: AppCoordinatorType = {
return self.container.resolve(AppCoordinatorAssembly.self).build()
}()
init(container: DependencyContainer, window: UIWindow?) {
self.container = container
self.window = window
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions
launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
// App Config
let appConfig = container.resolve(AppConfigServiceAssembly.self).build()
// Set defaults
appConfig.registerDefaults()
// Setup window
window = UIWindow()
window?.rootViewController = appCoordinator.toPresent()
window?.backgroundColor = .white
window?.makeKeyAndVisible()
// Configure deep link
let notification = launchOptions?[.remoteNotification] as? [String: AnyObject]
let deepLink = DeepLinkOption.build(with: notification)
appCoordinator.start(with: deepLink)
//printAllAvailableFonts()
return true
}
func application(_ application: UIApplication, didReceiveRemoteNotification
userInfo: [AnyHashable : Any]) {
// Configure deep link
let dict = userInfo as? [String: AnyObject]
let deepLink = DeepLinkOption.build(with: dict)
appCoordinator.start(with: deepLink)
}
func application(_ application: UIApplication, continue
userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
// Configure deep link
let deepLink = DeepLinkOption.build(with: userActivity)
appCoordinator.start(with: deepLink)
return true
}
}
|
[
-1
] |
8cbbfd0ce0faefd30366b95bdc0f06bf60a3a990
|
730b276c9f3c3c302363b837b9b75edd0c451e64
|
/Sourcery/Generating/Template/Swift/SwiftTemplate.swift
|
10b46f06a4ae010c872454b1cb768c84086fdb66
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
RovingMobile/Sourcery
|
41d78a40f5568d6f3147edd812c0d61b25244f3f
|
ddc70f3eed66d9bacf71874f5ca893f1b2f30cbb
|
refs/heads/master
| 2021-06-15T07:40:06.119207 | 2017-04-18T18:37:33 | 2017-04-18T18:37:33 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 8,509 |
swift
|
//
// SwiftTemplate.swift
// Sourcery
//
// Created by Krunoslav Zaher on 12/30/16.
// Copyright © 2016 Pixle. All rights reserved.
//
import Foundation
import PathKit
fileprivate enum SwiftTemplateParsingError: Error {
case unmatchedOpening(path: Path, line: Int)
case compilationError(path: Path, error: String)
}
fileprivate enum Delimiters {
static let open = "<%"
static let close = "%>"
}
fileprivate struct ProcessResult {
let output: String
let error: String
}
class SwiftTemplate: Template {
let sourcePath: Path
init(path: Path) throws {
self.sourcePath = path
}
enum Command {
case output(String)
case controlFlow(String)
case outputEncoded(String)
}
fileprivate static func generateSwiftCode(templateContent _templateContent: String, path: Path) throws -> String {
let templateContent = "<%%>" + _templateContent
let components = templateContent.components(separatedBy: Delimiters.open)
var sourceFile = [String]()
var commands = [Command]()
let currentLineNumber = {
return sourceFile.joined(separator: "").numberOfLineSeparators
}
for component in components.suffix(from: 1) {
guard let endIndex = component.range(of: Delimiters.close) else {
throw SwiftTemplateParsingError.unmatchedOpening(path: path, line: currentLineNumber())
}
var code = component.substring(to: endIndex.lowerBound)
let shouldTrimTrailingNewLines = code.trimSuffix("-")
let shouldTrimLeadingWhitespaces = code.trimPrefix("_")
let shouldTrimTrailingWhitespaces = code.trimSuffix("_")
// string after closing tag
var encodedPart = component.substring(from: endIndex.upperBound)
if shouldTrimTrailingNewLines {
// we trim only new line caused by script tag, not all of leading new lines in string after tag
encodedPart = encodedPart.replacingOccurrences(of: "^\\n{1}", with: "", options: .regularExpression, range: nil)
}
if shouldTrimTrailingWhitespaces {
// trim all leading whitespaces in string after tag
encodedPart = encodedPart.replacingOccurrences(of: "^[\\h\\t]*", with: "", options: .regularExpression, range: nil)
}
if shouldTrimLeadingWhitespaces {
if case .outputEncoded(let code)? = commands.last {
// trim all trailing white spaces in previously enqued code string
let trimmed = code.replacingOccurrences(of: "[\\h\\t]*$", with: "", options: .regularExpression, range: nil)
_ = commands.popLast()
commands.append(.outputEncoded(trimmed))
}
}
if code.trimPrefix("=") {
commands.append(.output(code))
} else {
if !code.hasPrefix("#") && !code.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
commands.append(.controlFlow(code))
}
}
if !encodedPart.isEmpty {
commands.append(.outputEncoded(encodedPart))
}
}
for command in commands {
switch command {
case let .output(code):
sourceFile.append("\n print(\"\\(" + code + ")\", terminator: \"\");")
case let .controlFlow(code):
sourceFile.append("\n \(code)")
case let .outputEncoded(code):
if !code.isEmpty {
sourceFile.append(("\n print(\"") + code.stringEncoded + "\", terminator: \"\");")
}
}
}
return sourceFile.joined(separator: "")
}
func render(types: Types, arguments: [String: NSObject]) throws -> String {
let context = TemplateContext(types: types, arguments: arguments)
let swiftCode = try SwiftTemplate.generateSwiftCode(templateContent: try sourcePath.read(), path: sourcePath)
let compilationDir = Path.cleanTemporaryDir(name: "build")
let runtimeFiles = try SwiftTemplate.swiftTemplatesRuntime.children().map { file in
return file.description
}
let mainFile = compilationDir + Path("main.swift")
let binaryFile = compilationDir + Path("bin")
let runableCode = "extension TemplateContext {\n\n override func generate() {" + swiftCode + "\n }\n\n}\nrun();"
try mainFile.write(runableCode)
let serializedContextPath = compilationDir + Path("context.bin")
let serializedContext = NSKeyedArchiver.archivedData(withRootObject: context)
try serializedContextPath.write(serializedContext)
#if DEBUG
// this is a sanity check, deserialized object should be equal to initial object
let diff = context.diffAgainst(NSKeyedUnarchiver.unarchiveObject(with: serializedContext))
if !diff.isEmpty {
print(diff.description)
}
assert(diff.isEmpty)
#endif
let arguments = [mainFile.description] +
runtimeFiles + [
"-suppress-warnings",
"-Onone",
"-module-name", "Sourcery",
"-o", binaryFile.description
]
let compilationResult = try Process.runCommand(path: "/usr/bin/swiftc",
arguments: arguments,
environment: [:])
if !compilationResult.error.isEmpty {
#if DEBUG
let command = "/usr/bin/swiftc " + arguments.map { "\"\($0)\"" }.joined(separator: " ")
print(command)
#endif
throw SwiftTemplateParsingError.compilationError(path: binaryFile, error: compilationResult.error)
}
let result = try Process.runCommand(path: binaryFile.description,
arguments: [serializedContextPath.description])
return result.output
}
}
fileprivate extension SwiftTemplate {
static var resourcesPath: Path {
return Bundle(for: Sourcery.self).resourcePath.flatMap { Path($0) }!
}
static var swiftTemplatesRuntime: Path {
return resourcesPath + Path("SwiftTemplateRuntime")
}
}
extension SwiftTemplateParsingError: CustomStringConvertible {
var description: String {
switch self {
case let .unmatchedOpening(path, line):
return "\(path):\(line) Error while parsing template. Unmatched <%"
case let .compilationError(_, error):
return error
}
}
}
// swiftlint:disable:next force_try
fileprivate let newlines = try! NSRegularExpression(pattern: "\\n\\r|\\r\\n|\\r|\\n", options: [])
private extension String {
var numberOfLineSeparators: Int {
return newlines.matches(in: self, options: [], range: NSRange(location: 0, length: self.characters.count)).count
}
var stringEncoded: String {
return self.unicodeScalars.map { x -> String in
return x.escaped(asASCII: true)
}.joined(separator: "")
}
}
private extension Process {
static func runCommand(path: String, arguments: [String], environment: [String: String] = [:]) throws -> ProcessResult {
let task = Process()
task.launchPath = path
task.arguments = arguments
task.environment = environment
let outputPipe = Pipe()
let errorPipe = Pipe()
task.standardOutput = outputPipe
task.standardError = errorPipe
let outHandle = outputPipe.fileHandleForReading
let errorHandle = errorPipe.fileHandleForReading
task.launch()
let outputData = outHandle.readDataToEndOfFile()
let errorData = errorHandle.readDataToEndOfFile()
outHandle.closeFile()
errorHandle.closeFile()
task.waitUntilExit()
let output = String(data: outputData, encoding: .utf8) ?? ""
let error = String(data: errorData, encoding: .utf8) ?? ""
if task.terminationReason != .exit {
throw NSError(domain: NSOSStatusErrorDomain, code: -1, userInfo: [
"terminationReason": task.terminationReason,
"error": error
])
}
return ProcessResult(output: output, error: error)
}
}
|
[
-1
] |
dede1f4ecb70a8074cf33c88ece522bfe8225aa8
|
cf4799f559915a904f5a66e4525516df155487b4
|
/Tests/ResterTests/IssuesTests.swift
|
2a75877ed659fb6f12659ba04bac0fca4241768f
|
[
"MIT"
] |
permissive
|
finestructure/Rester
|
a1ceb87f3d9a16e8ecf791312305736e3744e2e7
|
9015e6fcffc8b1bd45fad82b38522700439d23f5
|
refs/heads/main
| 2022-01-16T21:38:31.421157 | 2022-01-10T14:57:20 | 2022-01-10T14:57:20 | 166,947,034 | 48 | 4 |
MIT
| 2022-01-10T14:57:21 | 2019-01-22T07:20:01 |
Swift
|
UTF-8
|
Swift
| false | false | 1,140 |
swift
|
//
// IssuesTests.swift
// ResterTests
//
// Created by Sven A. Schmidt on 01/04/2019.
//
#if !os(watchOS)
import XCTest
import Yams
@testable import ResterCore
class IssuesTests: XCTestCase {
func test_issue_39_referencing_into_empty_array() async throws {
// https://github.com/finestructure/Rester/issues/39
// terminated by signal SIGILL (Illegal instruction)
// when referencing into empty array
let s = """
url: https://httpbin.org/anything
method: POST
body:
json:
values: []
validation:
status: 200
json:
json:
values:
0: a
"""
let d = try YAMLDecoder().decode(Request.Details.self, from: s)
let r = Request(name: "post-array", details: d)
let result = try await r.test()
XCTAssertEqual(result, .invalid("json invalid: key 'json' validation error: key 'values' validation error: index 0 out of bounds"))
}
}
#endif // !os(watchOS)
|
[
-1
] |
599023430f4180717676c9b8c16a5276fd5d91fe
|
f66809e901cb7571a4d9d34decabd2bc0316a35a
|
/simpoll/AddPollController.swift
|
c815a9ebae61278280cf06abc963ee2464dd3f51
|
[] |
no_license
|
spuleri/simpoll
|
36139f6e91f88cc1424bf4f33e72d707e6248e2a
|
7538674a067c0e098bfa5d8fb047d4fe24afb9a7
|
refs/heads/master
| 2021-01-10T03:38:38.398564 | 2015-11-10T05:21:59 | 2015-11-10T05:21:59 | 45,718,825 | 3 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 972 |
swift
|
//
// AddPollController.swift
// simpoll
//
// Created by James on 11/6/15.
// Copyright © 2015 Sergio Puleri. All rights reserved.
//
import Foundation
class AddPollController: NSObject {
var parent: PollListViewController!
// MARK: Initialization
// ------------------------------------------------------------------------------ Initialization
init(parent: PollListViewController) {
self.parent = parent
}
// MARK: Target Action
// ------------------------------------------------------------------------------- Target Action
func cancelButtonTouched() {
parent.dismissAddPollView()
}
func submitButtonTouched(question:String, option1:String, option2:String) {
if (!question.isEmpty && !option1.isEmpty && !option2.isEmpty) {
NetworkGuy.sharedInstance.createPoll(question, option1: option1, option2: option2)
}
parent.dismissAddPollView()
}
}
|
[
-1
] |
76e68852646fe85dc17e62a8a634a5d187ea5636
|
4f68469bfdc164ff7c018ddd9725fd2ea0b09ed7
|
/TinyAgainstTheGiants/LabelNode.swift
|
86ee946687a31883133ee846f56b4ac423d3e167
|
[] |
no_license
|
vantanllc/TinyAgainstTheGiants
|
bee01cb5a16f454f318e2bbcc4aa98db45d2c69a
|
ca44dc7479c4b484acb1c085864c73112f6604c8
|
refs/heads/production-release
| 2021-04-28T23:50:32.309924 | 2017-04-02T14:53:18 | 2017-04-02T14:53:18 | 77,726,906 | 0 | 0 | null | 2017-03-30T12:04:00 | 2016-12-31T05:34:40 |
Swift
|
UTF-8
|
Swift
| false | false | 278 |
swift
|
//
// LabelNode.swift
// TinyAgainstTheGiants
//
// Created by Thinh Luong on 2/11/17.
// Copyright © 2017 Vantan LLC. All rights reserved.
//
import SpriteKit
enum LabelIdentifier: String {
case timer, title
static let all: [LabelIdentifier] = [.timer, .title]
}
|
[
-1
] |
96ab90c27923784aaa873bcc3e423d7dfbd22a86
|
efe0abeb94ecdc5f71cfbb004a051fe5ecc38ccc
|
/MVVM.RxSwift/ViewController.swift
|
fdf03c70ee17e76609f05066d3fef4973f61e673
|
[] |
no_license
|
kotsuya/MVVM.RxSwift
|
38efa660cfc938c14afed907993a9b49daeb40f8
|
eb9baa768e8d53e0b0c719afb66eee8c27da1d62
|
refs/heads/master
| 2022-07-24T05:15:58.856331 | 2020-05-19T07:18:47 | 2020-05-19T07:18:47 | 265,173,598 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,291 |
swift
|
//
// ViewController.swift
// MVVM.RxSwift
//
// Created by seunghwan.yoo on 2020/05/19.
// Copyright © 2020 seunghwan.yoo. All rights reserved.
//
import UIKit
import RxSwift
import RxCocoa
class ViewController: UIViewController {
@IBOutlet weak var tableView: UITableView!
let disposeBag = DisposeBag()
private var viewModel: RestaurantsListViewModel!
static func instantiate(viewModel: RestaurantsListViewModel) -> ViewController {
let storyboard = UIStoryboard(name: "Main", bundle: .main)
let viewController = storyboard.instantiateInitialViewController() as! ViewController
viewController.viewModel = viewModel
return viewController
}
override func viewDidLoad() {
super.viewDidLoad()
tableView.tableFooterView = UIView()
navigationItem.title = viewModel.title
navigationController?.navigationBar.prefersLargeTitles = true
tableView.contentInsetAdjustmentBehavior = .never
viewModel.fetchRestaurantViewModels().observeOn(MainScheduler.instance).bind(to: tableView.rx.items(cellIdentifier: "cell")) { index, viewModel, cell in
cell.textLabel?.text = viewModel.displayText
}.disposed(by: disposeBag)
}
}
|
[
-1
] |
e4ec3043eed453cb8743d1ca0ed55335a77fb58f
|
7ce955fa75d6089f41a1d8d7f4604d2c95400abb
|
/slideshow/SwipableScrollableContentViewController.swift
|
b6ab7ed0436745b0c56ae7e19c801bfcd4d6a2b4
|
[] |
no_license
|
arashkashi/slideshow
|
304fdd779c3685e96ee2ee4757e7e720b648dbb1
|
cefb7590719b6f09b28b2008f54dd71fd4b86448
|
refs/heads/master
| 2021-01-24T11:09:29.312613 | 2016-10-11T16:12:56 | 2016-10-11T16:12:56 | 70,261,539 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 4,259 |
swift
|
//
// SlidableScrolableTextContent.swift
// slideshow
//
// Created by Arash Kashi on 10/7/16.
// Copyright © 2016 Arash Kashi. All rights reserved.
//
import Foundation
import UIKit
class SwipableScrollableContentViewController: UIViewController {
var deck: [ScrollableStackedViewController] = []
var leftDeck: [ScrollableStackedViewController] = []
let animationDuration: NSTimeInterval = 0.2
weak var container: UIView?
override func updateViewConstraints() {
self.view.translatesAutoresizingMaskIntoConstraints = false
guard (self.container != nil) else { return }
self.view.leftAnchor.constraintEqualToAnchor(self.container?.leftAnchor).active = true
self.view.rightAnchor.constraintEqualToAnchor(self.container?.rightAnchor).active = true
self.view.topAnchor.constraintEqualToAnchor(self.container?.topAnchor).active = true
self.view.bottomAnchor.constraintEqualToAnchor(self.container?.bottomAnchor).active = true
self.deck.forEach {
$0.view.translatesAutoresizingMaskIntoConstraints = false
$0.view.heightAnchor.constraintEqualToAnchor(self.view.heightAnchor).active = true
$0.view.widthAnchor.constraintEqualToAnchor(self.view.widthAnchor).active = true
if $0.centerXConstraint == nil {
$0.centerXConstraint = $0.view.centerXAnchor.constraintEqualToAnchor(self.view.centerXAnchor)
$0.centerXConstraint.active = true
}
$0.view.centerYAnchor.constraintEqualToAnchor(self.view.centerYAnchor).active = true
}
super.updateViewConstraints()
}
func add(item: ScrollableStackedViewController) {
self.deck.append(item)
self.initSubViews()
}
func initSubViews() {
for vc in self.deck {
guard vc.view.superview == nil else { continue }
self.view.addSubview(vc.view)
vc.container = self.view
if vc != self.deck.last {
vc.view.alpha = 0.0
}
}
self.updateViewConstraints()
}
func slideTopToLeft() {
guard self.deck.count > 1 else { return }
let last = self.deck.removeLast()
last.moveViewToLeft {
self.leftDeck.append(last)
}
self.deck.last?.fadeViewIn(nil)
}
func slideTopToRight() {
guard self.leftDeck.count > 0 else { return }
let last = self.leftDeck.removeLast()
last.moveViewToRight(nil)
self.deck.last?.fadeViewOut(nil)
self.deck.append(last)
}
func attachToContainer(container: UIView, withViews: [ScrollableStackedViewController]) {
self.deck = withViews
self.initSubViews()
self.container = container
container.addSubview(self.view)
self.updateViewConstraints()
}
func moveTopItemHorizontally(normalizedOffset: CGFloat) {
// Move the top one to the left
guard let validTopItem = self.deck.last else { return }
// Move to left just when is being slided to the left
if normalizedOffset >= 0.0 {
validTopItem.moveCenterXTo(normalizedOffset)
// Change the Alpha value for the underlying item
if self.deck.count > 1 {
let secondLastItem = self.deck[self.deck.count - 1 - 1]
secondLastItem.view.alpha = abs(normalizedOffset)
}
} else // If moving right bring the other object into the view
{
guard let validLeftItem = self.leftDeck.last else { return }
validLeftItem.moveCenterXTo(1.0 - normalizedOffset)
validTopItem.view.alpha = 1 - abs(normalizedOffset)
}
validTopItem.view.superview?.setNeedsLayout()
}
}
|
[
-1
] |
feb4c64d5e736efe35100faa2cc7c30a6c37c9ec
|
b1755d876f450f2b872a6362fdef9e26cd3ea82d
|
/MapboxNavigation/NavigationViewController.swift
|
e43f6a5bfc0a6cba96c60984fea4c8f23a4ccdb6
|
[
"ISC",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
rubythonode/mapbox-navigation-ios
|
82f917c669699c9169ab20da312046dcd260e112
|
d0a2423ee356d88979800673144a9ebc96bf207f
|
refs/heads/master
| 2021-08-15T17:33:11.727899 | 2017-11-17T21:49:34 | 2017-11-17T21:49:34 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 30,180 |
swift
|
import UIKit
import MapboxCoreNavigation
import MapboxDirections
import Mapbox
import Solar
/**
The `NavigationViewControllerDelegate` provides methods for configuring the map view shown by a `NavigationViewController` and responding to the cancellation of a navigation session.
*/
@objc(MBNavigationViewControllerDelegate)
public protocol NavigationViewControllerDelegate {
/**
Called when the user exits a route and dismisses the navigation view controller by tapping the Cancel button.
*/
@objc optional func navigationViewControllerDidCancelNavigation(_ navigationViewController : NavigationViewController)
/**
Called when the user arrives at the destination.
*/
@objc optional func navigationViewController(_ navigationViewController : NavigationViewController, didArriveAt waypoint: Waypoint)
/**
Returns whether the navigation view controller should be allowed to calculate a new route.
If implemented, this method is called as soon as the navigation view controller detects that the user is off the predetermined route. Implement this method to conditionally prevent rerouting. If this method returns `true`, `navigationViewController(_:willRerouteFrom:)` will be called immediately afterwards.
- parameter navigationViewController: The navigation view controller that has detected the need to calculate a new route.
- parameter location: The user’s current location.
- returns: True to allow the navigation view controller to calculate a new route; false to keep tracking the current route.
*/
@objc(navigationViewController:shouldRerouteFromLocation:)
optional func navigationViewController(_ navigationViewController: NavigationViewController, shouldRerouteFrom location: CLLocation) -> Bool
@objc(navigationViewController:shouldIncrementLegWhenArrivingAtWaypoint:)
optional func navigationViewController(_ navigationViewController: NavigationViewController, shouldIncrementLegWhenArrivingAtWaypoint waypoint: Waypoint) -> Bool
/**
Called immediately before the navigation view controller calculates a new route.
This method is called after `navigationViewController(_:shouldRerouteFrom:)` is called, simultaneously with the `RouteControllerWillReroute` notification being posted, and before `navigationViewController(_:didRerouteAlong:)` is called.
- parameter navigationViewController: The navigation view controller that will calculate a new route.
- parameter location: The user’s current location.
*/
@objc(navigationViewController:willRerouteFromLocation:)
optional func navigationViewController(_ navigationViewController: NavigationViewController, willRerouteFrom location: CLLocation)
/**
Called immediately after the navigation view controller receives a new route.
This method is called after `navigationViewController(_:willRerouteFrom:)` and simultaneously with the `RouteControllerDidReroute` notification being posted.
- parameter navigationViewController: The navigation view controller that has calculated a new route.
- parameter route: The new route.
*/
@objc(navigationViewController:didRerouteAlongRoute:)
optional func navigationViewController(_ navigationViewController: NavigationViewController, didRerouteAlong route: Route)
/**
Called when the navigation view controller fails to receive a new route.
This method is called after `navigationViewController(_:willRerouteFrom:)` and simultaneously with the `RouteControllerDidFailToReroute` notification being posted.
- parameter navigationViewController: The navigation view controller that has calculated a new route.
- parameter error: An error raised during the process of obtaining a new route.
*/
@objc(navigationViewController:didFailToRerouteWithError:)
optional func navigationViewController(_ navigationViewController: NavigationViewController, didFailToRerouteWith error: Error)
/**
Returns an `MGLStyleLayer` that determines the appearance of the route line.
If this method is unimplemented, the navigation map view draws the route line using an `MGLLineStyleLayer`.
*/
@objc optional func navigationMapView(_ mapView: NavigationMapView, routeStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer?
/**
Returns an `MGLStyleLayer` that determines the appearance of the route line’s casing.
If this method is unimplemented, the navigation map view draws the route line’s casing using an `MGLLineStyleLayer` whose width is greater than that of the style layer returned by `navigationMapView(_:routeStyleLayerWithIdentifier:source:)`.
*/
@objc optional func navigationMapView(_ mapView: NavigationMapView, routeCasingStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer?
/**
Returns an `MGLShape` that represents the path of the route line.
If this method is unimplemented, the navigation map view represents the route line using an `MGLPolylineFeature` based on `route`’s `coordinates` property.
*/
@objc optional func navigationMapView(_ mapView: NavigationMapView, shapeDescribing route: Route) -> MGLShape?
/**
Returns an `MGLShape` that represents the path of the route line’s casing.
If this method is unimplemented, the navigation map view represents the route line’s casing using an `MGLPolylineFeature` identical to the one returned by `navigationMapView(_:shapeDescribing:)`.
*/
@objc optional func navigationMapView(_ mapView: NavigationMapView, simplifiedShapeDescribing route: Route) -> MGLShape?
/*
Returns an `MGLStyleLayer` that marks the location of each destination along the route when there are multiple destinations. The returned layer is added to the map below the layer returned by `navigationMapView(_:waypointSymbolStyleLayerWithIdentifier:source:)`.
If this method is unimplemented, the navigation map view marks each destination waypoint with a circle.
*/
@objc optional func navigationMapView(_ mapView: NavigationMapView, waypointStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer?
/*
Returns an `MGLStyleLayer` that places an identifying symbol on each destination along the route when there are multiple destinations. The returned layer is added to the map above the layer returned by `navigationMapView(_:waypointStyleLayerWithIdentifier:source:)`.
If this method is unimplemented, the navigation map view labels each destination waypoint with a number, starting with 1 at the first destination, 2 at the second destination, and so on.
*/
@objc optional func navigationMapView(_ mapView: NavigationMapView, waypointSymbolStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer?
/**
Returns an `MGLShape` that represents the destination waypoints along the route (that is, excluding the origin).
If this method is unimplemented, the navigation map view represents the route waypoints using `navigationMapView(_:shapeFor:)`.
*/
@objc optional func navigationMapView(_ mapView: NavigationMapView, shapeFor waypoints: [Waypoint]) -> MGLShape?
@objc optional func navigationMapView(_ mapView: NavigationMapView, didTap route: Route)
/**
Return an `MGLAnnotationImage` that represents the destination marker.
If this method is unimplemented, the navigation map view will represent the destination annotation with the default marker.
*/
@objc optional func navigationMapView(_ mapView: MGLMapView, imageFor annotation: MGLAnnotation) -> MGLAnnotationImage?
/**
Returns a view object to mark the given point annotation object on the map.
The user location annotation view can also be customized via this method. When annotation is an instance of `MGLUserLocation`, return an instance of `MGLUserLocationAnnotationView` (or a subclass thereof). Note that, when `NavigationMapView.tracksUserCourse` is set to `true`, the map view uses a distinct user course view; to customize it, set the `NavigationMapView.userCourseView` property of the map view returned by this view controller’s `mapView` property.
*/
@objc optional func navigationMapView(_ mapView: MGLMapView, viewFor annotation: MGLAnnotation) -> MGLAnnotationView?
/**
Called when the user opens the feedback form.
*/
@objc optional func navigationViewControllerDidOpenFeedback(_ viewController: NavigationViewController)
/**
Called when the user dismisses the feedback form.
*/
@objc optional func navigationViewControllerDidCancelFeedback(_ viewController: NavigationViewController)
/**
Called when the user sends feedback.
- parameter viewController: The navigation view controller that reported the feedback.
- parameter feedbackId: A UUID string used to identify the feedback event.
- parameter feedbackType: The type of feedback event that was sent.
*/
@objc optional func navigationViewController(_ viewController: NavigationViewController, didSend feedbackId: String, feedbackType: FeedbackType)
/**
Returns the center point of the user course view in screen coordinates relative to the map view.
*/
@objc optional func navigationViewController(_ navigationViewController: NavigationViewController, mapViewUserAnchorPoint mapView: NavigationMapView) -> CGPoint
}
/**
`NavigationViewController` is fully featured, turn by turn navigation UI.
It provides step by step instructions, an overview of all steps for the given route and support for basic styling.
*/
@objc(MBNavigationViewController)
public class NavigationViewController: UIViewController, RouteMapViewControllerDelegate {
/**
A `Route` object constructed by [MapboxDirections](https://mapbox.github.io/mapbox-navigation-ios/directions/).
In cases where you need to update the route after navigation has started you can set a new `route` here and `NavigationViewController` will update its UI accordingly.
*/
public var route: Route! {
didSet {
if routeController == nil {
routeController = RouteController(along: route, directions: directions, locationManager: NavigationLocationManager())
routeController.delegate = self
} else {
routeController.routeProgress = RouteProgress(route: route)
}
mapViewController?.notifyDidReroute(route: route)
}
}
/**
An instance of `MGLAnnotation` that will be shown on on the destination of your route. The last coordinate of the route will be used if no destination is given.
*/
@available(*, deprecated, message: "Destination is no longer supported. A destination annotation will automatically be added to map given the route.")
public var destination: MGLAnnotation!
/**
An instance of `Directions` need for rerouting. See [Mapbox Directions](https://mapbox.github.io/mapbox-navigation-ios/directions/) for further information.
*/
public var directions: Directions!
/**
An optional `MGLMapCamera` you can use to improve the initial transition from a previous viewport and prevent a trigger from an excessive significant location update.
*/
public var pendingCamera: MGLMapCamera?
/**
An instance of `MGLAnnotation` representing the origin of your route.
*/
public var origin: MGLAnnotation?
/**
The receiver’s delegate.
*/
public weak var delegate: NavigationViewControllerDelegate?
/**
Provides access to various speech synthesizer options.
See `RouteVoiceController` for more information.
*/
public var voiceController: RouteVoiceController? = RouteVoiceController()
/**
Provides all routing logic for the user.
See `RouteController` for more information.
*/
public var routeController: RouteController!
/**
Styles that will be used for various system traits.
See `Style` and `DefaultStyle` for more information.
*/
public var styles: [Style]? {
didSet {
applyStyle()
}
}
/**
The main map view displayed inside the view controller.
- note: Do not change this map view’s delegate.
*/
public var mapView: NavigationMapView? {
get {
return mapViewController?.mapView
}
}
/**
Determines whether the user location annotation is moved from the raw user location reported by the device to the nearest location along the route.
By default, this property is set to `true`, causing the user location annotation to be snapped to the route.
*/
public var snapsUserLocationAnnotationToRoute = true
/**
Toggles sending of UILocalNotification upon upcoming steps when application is in the background. Defaults to `true`.
*/
public var sendNotifications: Bool = true
/**
Shows a button that allows drivers to report feedback such as accidents, closed roads, poor instructions, etc. Defaults to `false`.
*/
public var showsReportFeedback: Bool = true {
didSet {
mapViewController?.reportButton.isHidden = !showsReportFeedback
}
}
/**
If true, the map style and UI will automatically be updated given the time of day.
*/
public var automaticallyAdjustsStyleForTimeOfDay = true
var currentStyleType: StyleType?
var styleTypeForTimeOfDay: StyleType {
guard automaticallyAdjustsStyleForTimeOfDay else { return .dayStyle }
guard let location = routeController.location,
let solar = Solar(latitude: location.coordinate.latitude, longitude: location.coordinate.longitude),
let sunrise = solar.sunrise, let sunset = solar.sunset else {
return .dayStyle
}
return isNighttime(date: solar.date, sunrise: sunrise, sunset: sunset) ? .nightStyle : .dayStyle
}
func isNighttime(date: Date, sunrise: Date, sunset: Date) -> Bool {
let calendar = Calendar.current
let currentMinutesFromMidnight = calendar.component(.hour, from: date) * 60 + calendar.component(.minute, from: date)
let sunriseMinutesFromMidnight = calendar.component(.hour, from: sunrise) * 60 + calendar.component(.minute, from: sunrise)
let sunsetMinutesFromMidnight = calendar.component(.hour, from: sunset) * 60 + calendar.component(.minute, from: sunset)
return currentMinutesFromMidnight < sunriseMinutesFromMidnight || currentMinutesFromMidnight > sunsetMinutesFromMidnight
}
var mapViewController: RouteMapViewController?
/**
A Boolean value that determines whether the map annotates the locations at which instructions are spoken for debugging purposes.
*/
public var annotatesSpokenInstructions = false
/**
A Boolean value that determines whether the user can long-press a feedback item to dictate feedback.
*/
public var recordsAudioFeedback = false
let progressBar = ProgressBar()
let routeStepFormatter = RouteStepFormatter()
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
/**
Initializes a `NavigationViewController` that provides turn by turn navigation for the given route. A optional `direction` object is needed for potential rerouting.
See [Mapbox Directions](https://mapbox.github.io/mapbox-navigation-ios/directions/) for further information.
*/
@objc(initWithRoute:directions:style:locationManager:)
required public init(for route: Route,
directions: Directions = Directions.shared,
styles: [Style]? = [DayStyle(), NightStyle()],
locationManager: NavigationLocationManager? = NavigationLocationManager()) {
let storyboard = UIStoryboard(name: "Navigation", bundle: .mapboxNavigation)
let mapViewController = storyboard.instantiateViewController(withIdentifier: "RouteMapViewController") as! RouteMapViewController
self.mapViewController = mapViewController
super.init(nibName: nil, bundle: nil)
self.styles = styles ?? [DayStyle(), NightStyle()]
addChildViewController(mapViewController)
mapViewController.view.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(mapViewController.view)
let v = mapViewController.view!
v.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
v.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
v.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
v.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true
self.directions = directions
self.route = route
self.routeController = RouteController(along: route, directions: directions, locationManager: locationManager ?? NavigationLocationManager())
self.routeController.usesDefaultUserInterface = true
self.routeController.delegate = self
mapViewController.delegate = self
mapViewController.routeController = routeController
mapViewController.reportButton.isHidden = !showsReportFeedback
self.currentStyleType = styleTypeForTimeOfDay
if !(route.routeOptions is NavigationRouteOptions) {
print("`Route` was created using `RouteOptions` and not `NavigationRouteOptions`. Although not required, this may lead to a suboptimal navigation experience. Without `NavigationRouteOptions`, it is not guaranteed you will get congestion along the route line, better ETAs and ETA label color dependent on congestion.")
}
}
deinit {
suspendNotifications()
}
override public func viewDidLoad() {
super.viewDidLoad()
resumeNotifications()
progressBar.dock(on: view)
}
public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIApplication.shared.isIdleTimerDisabled = true
routeController.resume()
applyStyle()
if routeController.locationManager is SimulatedLocationManager {
let title = NSLocalizedString("USER_IN_SIMULATION_MODE", bundle: .mapboxNavigation, value: "Simulating Navigation", comment: "The text of a banner that appears during turn-by-turn navigation when route simulation is enabled.")
mapViewController?.statusView.show(title, showSpinner: false)
}
}
public override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
UIApplication.shared.isIdleTimerDisabled = false
routeController.suspendLocationUpdates()
}
// MARK: Route controller notifications
func resumeNotifications() {
NotificationCenter.default.addObserver(self, selector: #selector(progressDidChange(notification:)), name: RouteControllerProgressDidChange, object: routeController)
NotificationCenter.default.addObserver(self, selector: #selector(didPassInstructionPoint(notification:)), name: RouteControllerDidPassSpokenInstructionPoint, object: routeController)
}
func suspendNotifications() {
NotificationCenter.default.removeObserver(self, name: RouteControllerProgressDidChange, object: routeController)
NotificationCenter.default.removeObserver(self, name: RouteControllerDidPassSpokenInstructionPoint, object: routeController)
}
func progressDidChange(notification: NSNotification) {
let routeProgress = notification.userInfo![MBRouteControllerDidPassSpokenInstructionPointRouteProgressKey] as! RouteProgress
let location = notification.userInfo![RouteControllerProgressDidChangeNotificationLocationKey] as! CLLocation
let secondsRemaining = notification.userInfo![RouteControllerProgressDidChangeNotificationSecondsRemainingOnStepKey] as! TimeInterval
mapViewController?.notifyDidChange(routeProgress: routeProgress, location: location, secondsRemaining: secondsRemaining)
progressBar.setProgress(routeProgress.currentLegProgress.userHasArrivedAtWaypoint ? 1 : CGFloat(routeProgress.fractionTraveled), animated: true)
}
func didPassInstructionPoint(notification: NSNotification) {
let routeProgress = notification.userInfo![MBRouteControllerDidPassSpokenInstructionPointRouteProgressKey] as! RouteProgress
mapViewController?.updateMapOverlays(for: routeProgress)
mapViewController?.updateCameraAltitude(for: routeProgress)
clearStaleNotifications()
if let upComingStep = routeProgress.currentLegProgress.upComingStep, routeProgress.currentLegProgress.currentStepProgress.durationRemaining < RouteControllerHighAlertInterval {
scheduleLocalNotification(about: upComingStep, legIndex: routeProgress.legIndex, numberOfLegs: routeProgress.route.legs.count)
}
if routeProgress.currentLegProgress.userHasArrivedAtWaypoint {
delegate?.navigationViewController?(self, didArriveAt: routeProgress.currentLegProgress.leg.destination)
}
forceRefreshAppearanceIfNeeded()
}
func applyStyle() {
guard let styles = styles else { return }
for style in styles {
if style.styleType == styleTypeForTimeOfDay {
style.apply()
if mapView?.styleURL != style.mapStyleURL {
mapView?.style?.transition = MGLTransition(duration: 0.5, delay: 0)
mapView?.styleURL = style.mapStyleURL
}
}
}
}
func forceRefreshAppearanceIfNeeded() {
// Don't update the style if they are equal
guard currentStyleType != styleTypeForTimeOfDay else {
currentStyleType = styleTypeForTimeOfDay
return
}
styles?.forEach {
if $0.styleType == styleTypeForTimeOfDay {
$0.apply()
mapView?.style?.transition = MGLTransition(duration: 0.5, delay: 0)
mapView?.styleURL = $0.mapStyleURL
currentStyleType = $0.styleType
}
}
for window in UIApplication.shared.windows {
for view in window.subviews {
view.removeFromSuperview()
window.addSubview(view)
}
}
mapView?.reloadStyle(self)
}
func scheduleLocalNotification(about step: RouteStep, legIndex: Int?, numberOfLegs: Int?) {
guard sendNotifications else { return }
guard UIApplication.shared.applicationState == .background else { return }
let notification = UILocalNotification()
notification.alertBody = routeStepFormatter.string(for: step, legIndex: legIndex, numberOfLegs: numberOfLegs, markUpWithSSML: false)
notification.fireDate = Date()
clearStaleNotifications()
UIApplication.shared.cancelAllLocalNotifications()
UIApplication.shared.scheduleLocalNotification(notification)
}
func clearStaleNotifications() {
guard sendNotifications else { return }
// Remove all outstanding notifications from notification center.
// This will only work if it's set to 1 and then back to 0.
// This way, there is always just one notification.
UIApplication.shared.applicationIconBadgeNumber = 1
UIApplication.shared.applicationIconBadgeNumber = 0
}
func navigationMapView(_ mapView: NavigationMapView, routeCasingStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer? {
return delegate?.navigationMapView?(mapView, routeCasingStyleLayerWithIdentifier: identifier, source: source)
}
func navigationMapView(_ mapView: NavigationMapView, routeStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer? {
return delegate?.navigationMapView?(mapView, routeStyleLayerWithIdentifier: identifier, source: source)
}
func navigationMapView(_ mapView: NavigationMapView, didTap route: Route) {
delegate?.navigationMapView?(mapView, didTap: route)
}
func navigationMapView(_ mapView: NavigationMapView, shapeDescribing route: Route) -> MGLShape? {
return delegate?.navigationMapView?(mapView, shapeDescribing: route)
}
func navigationMapView(_ mapView: NavigationMapView, simplifiedShapeDescribing route: Route) -> MGLShape? {
return delegate?.navigationMapView?(mapView, shapeDescribing: route)
}
func navigationMapView(_ mapView: NavigationMapView, waypointStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer? {
return delegate?.navigationMapView?(mapView, waypointStyleLayerWithIdentifier: identifier, source: source)
}
func navigationMapView(_ mapView: NavigationMapView, waypointSymbolStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer? {
return delegate?.navigationMapView?(mapView, waypointSymbolStyleLayerWithIdentifier: identifier, source: source)
}
func navigationMapView(_ mapView: NavigationMapView, shapeFor waypoints: [Waypoint]) -> MGLShape? {
return delegate?.navigationMapView?(mapView, shapeFor: waypoints)
}
func navigationMapView(_ mapView: MGLMapView, imageFor annotation: MGLAnnotation) -> MGLAnnotationImage? {
return delegate?.navigationMapView?(mapView, imageFor: annotation)
}
func navigationMapView(_ mapView: MGLMapView, viewFor annotation: MGLAnnotation) -> MGLAnnotationView? {
return delegate?.navigationMapView?(mapView, viewFor: annotation)
}
func mapViewControllerDidOpenFeedback(_ mapViewController: RouteMapViewController) {
delegate?.navigationViewControllerDidOpenFeedback?(self)
}
func mapViewControllerDidCancelFeedback(_ mapViewController: RouteMapViewController) {
delegate?.navigationViewControllerDidCancelFeedback?(self)
}
func mapViewControllerDidCancelNavigation(_ mapViewController: RouteMapViewController) {
if delegate?.navigationViewControllerDidCancelNavigation?(self) != nil {
// The receiver should handle dismissal of the NavigationViewController
} else {
dismiss(animated: true, completion: nil)
}
}
func mapViewController(_ mapViewController: RouteMapViewController, didSend feedbackId: String, feedbackType: FeedbackType) {
delegate?.navigationViewController?(self, didSend: feedbackId, feedbackType: feedbackType)
}
func mapViewController(_ mapViewController: RouteMapViewController, mapViewUserAnchorPoint mapView: NavigationMapView) -> CGPoint? {
return delegate?.navigationViewController?(self, mapViewUserAnchorPoint: mapView)
}
func mapViewControllerShouldAnnotateSpokenInstructions(_ routeMapViewController: RouteMapViewController) -> Bool {
return annotatesSpokenInstructions
}
func mapViewControllerShouldRecordAudioFeedback(_ routeMapViewController: RouteMapViewController) -> Bool {
return recordsAudioFeedback
}
}
extension NavigationViewController: RouteControllerDelegate {
public func routeController(_ routeController: RouteController, shouldRerouteFrom location: CLLocation) -> Bool {
return delegate?.navigationViewController?(self, shouldRerouteFrom: location) ?? true
}
public func routeController(_ routeController: RouteController, shouldIncrementLegWhenArrivingAtWaypoint waypoint: Waypoint) -> Bool {
return delegate?.navigationViewController?(self, shouldIncrementLegWhenArrivingAtWaypoint: waypoint) ?? true
}
public func routeController(_ routeController: RouteController, willRerouteFrom location: CLLocation) {
delegate?.navigationViewController?(self, willRerouteFrom: location)
}
public func routeController(_ routeController: RouteController, didRerouteAlong route: Route) {
mapViewController?.notifyDidReroute(route: route)
delegate?.navigationViewController?(self, didRerouteAlong: route)
}
public func routeController(_ routeController: RouteController, didFailToRerouteWith error: Error) {
delegate?.navigationViewController?(self, didFailToRerouteWith: error)
}
public func routeController(_ routeController: RouteController, didUpdate locations: [CLLocation]) {
if snapsUserLocationAnnotationToRoute, let location = routeController.location ?? locations.last {
mapViewController?.mapView.updateCourseTracking(location: location, animated: true)
mapViewController?.labelCurrentRoad(at: location)
} else if let location = locations.last {
mapViewController?.mapView.updateCourseTracking(location: location, animated: true)
mapViewController?.labelCurrentRoad(at: location)
}
if !(routeController.locationManager is SimulatedLocationManager) {
mapViewController?.statusView.hide(delay: 3, animated: true)
}
}
public func routeController(_ routeController: RouteController, didDiscard location: CLLocation) {
let title = NSLocalizedString("WEAK_GPS", bundle: .mapboxNavigation, value: "Weak GPS signal", comment: "Inform user about weak GPS signal")
mapViewController?.statusView.show(title, showSpinner: false)
}
}
|
[
301827,
299092
] |
a4a39cc87fbafb372037535ef762bc8d0868d7cc
|
1d4fa3ef0dff50d66b4fb95beed8e0310b9ed49f
|
/PhotoMapTests/Mocks/Services/FirestoreServiceMock.swift
|
ec7e5007eb9a824f4a9ffd617c320ebcc4b105b5
|
[] |
no_license
|
atereshkov/photomap
|
1542e915d8349a92e5f2101c380c443d1e2eaec0
|
4822f52d406cc03f429f642e054b9547aa19e416
|
refs/heads/main
| 2023-07-15T13:38:16.712818 | 2021-08-31T10:06:09 | 2021-08-31T10:06:09 | 357,524,445 | 0 | 1 | null | 2021-08-31T10:06:10 | 2021-04-13T11:14:19 |
Swift
|
UTF-8
|
Swift
| false | false | 6,034 |
swift
|
//
// FirestoreServiceMock.swift
// PhotoMapTests
//
// Created by yurykasper on 27.05.21.
//
import Combine
import MapKit
@testable import PhotoMap
class FirestoreServiceMock {
var error: FirestoreError?
var image: UIImage?
var userHasDocuments: Bool?
var getMarkersCalled = false
var getMarkersEndWithValues = false
var getCategoriesCalled = false
var getCategoriesEndWithValues = false
var localImage: UIImage?
var downloadImage: UIImage?
var downloadImageEndWithImage = false
var currentUser: User?
var isEmptyPhotos = false
var isEmptyCategories = false
let categories = [
Category(id: "1", name: "DEFAULT", color: "#368EDF"),
Category(id: "2", name: "NATURE", color: "#578E18"),
Category(id: "3", name: "FRIENDS", color: "#F4A523")
]
lazy var photos = {
// swiftlint:disable line_length
[PhotoDVO(id: "1", image: UIImage(), imageUrls: ["url"], date: Date(), description: "", category: categories[safe: 0], coordinate: CLLocationCoordinate2D(latitude: 0, longitude: 0)),
PhotoDVO(id: "2", image: UIImage(), imageUrls: ["url"], date: Date(), description: "", category: categories[safe: 0], coordinate: CLLocationCoordinate2D(latitude: 0, longitude: 0)),
PhotoDVO(id: "3", image: UIImage(), imageUrls: ["url"], date: Date(), description: "", category: categories[safe: 0], coordinate: CLLocationCoordinate2D(latitude: 0, longitude: 0)),
PhotoDVO(id: "4", image: UIImage(), imageUrls: ["url"], date: Date(), description: "", category: categories[safe: 1], coordinate: CLLocationCoordinate2D(latitude: 0, longitude: 0)),
PhotoDVO(id: "5", image: UIImage(), imageUrls: ["url"], date: Date(), description: "", category: categories[safe: 1], coordinate: CLLocationCoordinate2D(latitude: 0, longitude: 0)),
PhotoDVO(id: "6", image: UIImage(), imageUrls: ["url"], date: Date(), description: "", category: categories[safe: 1], coordinate: CLLocationCoordinate2D(latitude: 0, longitude: 0)),
PhotoDVO(id: "7", image: UIImage(), imageUrls: ["url"], date: Date(), description: "", category: categories[safe: 2], coordinate: CLLocationCoordinate2D(latitude: 0, longitude: 0)),
PhotoDVO(id: "8", image: UIImage(), imageUrls: ["url"], date: Date(), description: "", category: categories[safe: 2], coordinate: CLLocationCoordinate2D(latitude: 0, longitude: 0)),
PhotoDVO(id: "9", image: UIImage(), imageUrls: ["url"], date: Date(), description: "", category: categories[safe: 2], coordinate: CLLocationCoordinate2D(latitude: 0, longitude: 0))
]
// swiftlint:enable line_length
}()
}
extension FirestoreServiceMock: FirestoreServiceType {
func saveUserIntoDatabase(_ user: User) -> AnyPublisher<Void, FirestoreError> {
Future { promise in promise(.success(())) }.eraseToAnyPublisher()
}
func getPhotos(for visibleRect: MKMapRect) -> AnyPublisher<[PhotoDVO], FirestoreError> {
Future { [weak self] promise in
if let error = self?.error { return promise(.failure(error)) }
guard self?.isEmptyPhotos == false else { return promise(.success([])) }
let photos = self?.photos ?? []
promise(.success(photos))
}.eraseToAnyPublisher()
}
func downloadImage(by url: String) -> Future<UIImage?, FirestoreError> {
Future { [weak self] promise in
if let error = self?.error { return promise(.failure(error)) }
promise(.success(self?.image)) }
}
func getCategories() -> Future<[PhotoMap.Category], FirestoreError> {
Future { [weak self] promise in
self?.getCategoriesCalled = true
if let error = self?.error { return promise(.failure(error)) }
guard self?.isEmptyCategories == false,
let categories = self?.categories else { return promise(.success([])) }
self?.getCategoriesEndWithValues = true
promise(.success(categories))
}
}
func addUserPhoto(with photo: UploadPhoto) -> AnyPublisher<Void, FirestoreError> {
Future { [weak self] promise in
if let error = self?.error { return promise(.failure(FirestoreError(error))) }
promise(.success(()))
}.eraseToAnyPublisher()
}
func getUserMarkers() -> AnyPublisher<[PhotoDVO], FirestoreError> {
Future { [weak self] promise in
self?.getMarkersCalled = true
if let error = self?.error { return promise(.failure(.custom(error.message))) }
guard self?.userHasDocuments != nil else {
self?.getMarkersEndWithValues = true
return promise(.success([]))
}
if self?.isEmptyPhotos == false, let photos = self?.photos {
self?.getMarkersEndWithValues = true
promise(.success(photos))
}
}.eraseToAnyPublisher()
}
func downloadImage(with url: URL?) -> Future<UIImage?, FirestoreError> {
Future { [weak self] promise in
if let localImage = self?.localImage {
self?.downloadImageEndWithImage = true
return promise(.success(localImage))
}
if let error = self?.error {
return promise(.failure(.custom(error.localizedDescription)))
}
guard let image = self?.downloadImage else { return promise(.failure(.custom("no image provided"))) }
self?.downloadImageEndWithImage = true
return promise(.success(image))
}
}
func getCurrentUser() -> Future<User, FirestoreError> {
Future { [weak self] promise in
if let error = self?.error { return promise(.failure(error)) }
guard let currentUser = self?.currentUser else { return promise(.failure(.custom("no current user"))) }
return promise(.success(currentUser))
}
}
}
|
[
-1
] |
a3bab574e34c5e96025638df4b05e46d11f24381
|
f44ba493da235fcc6c0fabe151881518f51e9def
|
/OC_P3/PROJET3.swift
|
5d6bc31db3a4eea2a5a3fa9863f59dfb784f71b8
|
[] |
no_license
|
MadNoodle/OC_P3_SWIFT
|
47a4239b63c4f0f2b042a976cfe53d0942d9245a
|
553f4d562a0fd1b61d8e2fc49bee8ac38503bfdf
|
refs/heads/master
| 2021-07-11T08:29:39.560261 | 2017-10-14T22:20:59 | 2017-10-14T22:20:59 | 106,966,615 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 11,402 |
swift
|
// /////////////// //
// MARK: GAME //
// /////////////// //
class Game {
var player1:Player
var player2:Player
init(player1:Player, player2:Player){
self.player1 = player1
self.player2 = player2
}
//Launch a new Game
func newGame(){
player1.createPlayerTeam()
player2.createPlayerTeam()
//TURN BY TURN LOGIC
while player1.playerTeam.count>0 || player2.playerTeam.count>0{
player1.turn(enemyPlayer:player2)
player2.turn(enemyPlayer:player1)
}
//WINNING CONDITIONS
if player1.playerTeam[0].health == 0 && player1.playerTeam[1].health == 0 && player1.playerTeam[2].health == 0 {print("\(player2.name) GAGNE")}
else if player2.playerTeam[0].health == 0 && player2.playerTeam[1].health == 0 && player2.playerTeam[2].health == 0 {print("\(player1.name) GAGNE")}
}
}
// /////////////// //
// MARK: PLAYERS //
// /////////////// //
class Player {
var id : Int
var name = ""
var playerTeam = [Character]()
init(id:Int){
self.id = id
}
// function that converts string input to input use to prevent crash when typing out of range input
func keyInput() -> Int{
let input = readLine(); //readLine optionnal
return Int(input!)! //Int conversion optionnal do not remove ! !
}
// ////////////////////////// //
// MARK: SELECT YOUR WARRRIORS //
// ////////////////////////// //
//CREATE TEAM
func createPlayerTeam(){
print("QUEL EST LE NOM DU JOUEUR \(self.id)?")
if let playerName = readLine(){
self.name = playerName
}
print("\u{001B}[0;33m \(self.name) VA COMPOSER SON EQUIPE\u{001B}[0;37m")
while playerTeam.count<3{
let hero = createHero()
// CONDITIONS TO FULFILL TO CREATE A PLAYER
//Name checking for duplicates
if playerTeam.contains (where: { $0.name == hero.name }) {
print("Ce guerrier existe déjà, Choisissez un autre nom")
} else {
//add hero to team
playerTeam.append(hero)
showTeam()
}
//limit team's size to 3
if playerTeam.count == 3 {
print("\u{001B}[0;31m⚔ ⚔ ⚔ ⚔ ⚔ ⚔ ⚔ ⚔\(self.name) EST PRET A COMBATTRE⚔ ⚔ ⚔ ⚔ ⚔ ⚔ ⚔ ⚔\u{001B}[0;37m")
}
}
}
// CREATE HERO
func createHero() -> Character{
var userChoice:Int
// Give a name to a champ
print ("\(self.name), comment s'appelle votre guerrier?")
var name = ""
if let nameChamp = readLine(){
name = nameChamp
print("Votre héros s'appelle \(nameChamp)")
}
// Choose character class
repeat { //Sanity check to prevent out of range input crash
print ("Quelle est sa profession ?"
+ "\n1. Guerrier"
+ "\n2. Mage"
+ "\n3. Colosse"
+ "\n4. Nain")
userChoice = keyInput()
} while userChoice != 1 && userChoice != 2 && userChoice != 3 && userChoice != 4
//Classe selection
var classe:Classe! // assuming the optionnal have a value cf. sanity check
switch userChoice {
case 1:
classe = .warrior
case 2:
classe = .mage
case 3:
classe = .colossus
case 4:
classe = .dwarf
default:
break
}
//Hero instanciantion
let champion = Character(name:name,classe:classe)
return champion
}
//SHOW CHAR DETAILS
func showTeamDetail (id:Int) ->String {
let detail:String
if playerTeam[id].classe == .mage{
detail = " Nom: \(playerTeam[id].name) - \(playerTeam[id].icon) Classe : \(playerTeam[id].classe) - ❤️ vie: \(playerTeam[id].health) pts - 💧 Soins: \(playerTeam[id].damages)"
}else{
detail = " Nom: \(playerTeam[id].name) - \(playerTeam[id].icon) Classe : \(playerTeam[id].classe) - ❤️ vie: \(playerTeam[id].health) pts - ⚔ Dommages: \(playerTeam[id].damages)"}
return detail
}
// SHOW TEAM STATS
func showTeam() {
for i in 0..<playerTeam.count {
print(
"====Heros n°\(i+1)========================================================================================"
+ "\n \(showTeamDetail(id:i))"
+ "\n=====================================================================================================")
}
}
// ////////////////////// //
// MARK: PLAYER TURN CHOICE //
// ////////////////////// //
// Different actions a player can do during a turn
func turn(enemyPlayer:Player){
print ("=====================AU TOUR DU JOUEUR \(self.id) DE JOUER====================="
+ "\n Que souhaitez vous faire?"
+ "\n1. 👁 voir l'état de votre équipe"
+ "\n2. ⚔ attaquer")
if let userChoice = readLine(){
switch userChoice {
case "1":
showTeam()
turn(enemyPlayer:enemyPlayer)
case "2":
fight(enemyPlayer:enemyPlayer)
default:
print("Je ne comprends pas")
}
}
}
// /////////////////// //
// MARK: FIGHT MECANICS //
// ////////////////// //
func fight(enemyPlayer:Player){
// Array where we store attacker and target ( will be cleared after each turn)
var fighter = [Character]()
//Choose your fighter
print("Choisissez votre attaquant"
+ "\n 1. \(self.showTeamDetail(id:0))"
+ "\n 2. \(self.showTeamDetail(id:1))"
+ "\n 3. \(self.showTeamDetail(id:2))")
/**
Todo: Add a check to disable dead players
*/
if let choice = readLine(){
var attacker:Character
switch choice {
case "1":
attacker = self.playerTeam[0]
fighter.append(attacker)
case "2":
attacker = self.playerTeam[1]
fighter.append(attacker)
case "3":
attacker = self.playerTeam[2]
fighter.append(attacker)
default:
print("Je ne comprends pas")
}
}
if fighter[0].classe == .mage {
//Choose your fighter
print("Choisissez la personne que vous voulez soigner"
+ "\n 1. \(self.showTeamDetail(id:0))"
+ "\n 2. \(self.showTeamDetail(id:1))"
+ "\n 3. \(self.showTeamDetail(id:2))")
if let choice = readLine(){
var target:Character
switch choice {
case "1":
target = self.playerTeam[0]
fighter.append(target)
heal(attacker:fighter[0], target:fighter[1])
fighter.removeAll()
case "2":
target = self.playerTeam[1]
fighter.append(target)
heal(attacker:fighter[0], target:fighter[1])
fighter.removeAll()
case "3":
target = self.playerTeam[2]
fighter.append(target)
heal(attacker:fighter[0], target:fighter[1])
fighter.removeAll()
default:
print("Je ne comprends pas")
}
}
}else{
//Choose your victim
print("Choisissez votre cible"
+ "\n 1. \(enemyPlayer.showTeamDetail(id:0)) "
+ "\n 2. \(enemyPlayer.showTeamDetail(id:1)) `"
+ "\n 3. \(enemyPlayer.showTeamDetail(id:2))")
if let choice = readLine(){
var target:Character
switch choice {
case "1":
target = enemyPlayer.playerTeam[0]
fighter.append(target)
attack(attacker:fighter[0], target:fighter[1])
fighter.removeAll()
case "2":
target = enemyPlayer.playerTeam[1]
fighter.append(target)
attack(attacker:fighter[0], target:fighter[1])
fighter.removeAll()
case "3":
target = enemyPlayer.playerTeam[2]
fighter.append(target)
attack(attacker:fighter[0], target:fighter[1])
fighter.removeAll()
default:
print("Je ne comprends pas")
}
}
}
}
// ATTACK => DO DAMAGES
func attack(attacker:Character, target:Character){
//Deal Damage
target.health -= attacker.damages
//Check if the character dies
if target.health <= 0 {
print ("☠️ \(target.name) est mort☠️ ☠️")
target.damages = 0
target.icon = "☠️"
} else {
print("\(attacker.name) fait \(attacker.damages) points de dommage à\(target.name). il lui reste \(target.health) points de vie.")
}
}
//HEAL
func heal(attacker:Character, target:Character){
//Check is dead or alive
if target.health <= 0 {
print ("☠️ On ne peut pas soigner les morts")
} else {
target.health += attacker.damages
print("\(attacker.name) soigne \(target.name) de \(attacker.damages) points de vie. \(target.name) a \(target.health) points de vie.")
}
}
}
// /////////////// //
// MARK: CHARACTERS //
// /////////////// //
//Character object
class Character {
let name : String // Fighter's name
var classe : Classe //Fighter's class
var health : Int // health points
var damages : Int // damages or heal value
var icon : String // class icon
init(name:String, classe : Classe){
self.name = name
self.classe = classe
//class caracteristics
switch self.classe{
case .warrior:
self.health = 10
self.damages = 10
self.icon = "⚔"
case .mage:
self.health = 50
self.damages = 20
self.icon = "✚"
case .colossus:
self.health = 150
self.damages = 2
self.icon = "⛰"
case .dwarf:
self.health = 25
self.damages = 30
self.icon = "⚒"
}
}
}
//Enum of all classes
enum Classe {
case warrior, mage, colossus, dwarf
}
// /////////////// //
// MARK: LOGIC //
// /////////////// //
let player1 = Player(id:1)
let player2 = Player(id:2)
let game = Game(player1:player1,player2:player2)
game.newGame()
|
[
-1
] |
6c18b30616d301a0be0613da91ec1d6d7aafe2d3
|
859fd90b6aa11cbe5ae3eab9e182bba77c7411e3
|
/SwiftDemo/RxSwiftDemo/Classes/TableView/TableViewController.swift
|
6a7113b6ed93f104a56d3771d0acf6eea8afc171
|
[
"MIT"
] |
permissive
|
nchkdxlq/SwiftDemo
|
12abaeb87f88ca0a1ca42cedec4e8b316726a403
|
d60b6670bc70479d67b69a6730dee4254817d6c4
|
refs/heads/master
| 2023-04-12T12:11:29.274786 | 2023-04-08T12:52:49 | 2023-04-08T12:53:04 | 123,677,772 | 0 | 0 |
MIT
| 2022-11-26T12:55:06 | 2018-03-03T09:28:54 |
Swift
|
UTF-8
|
Swift
| false | false | 1,694 |
swift
|
//
// TableViewController.swift
// RxSwiftDemo
//
// Created by Knox on 2019/10/13.
// Copyright © 2019 luoquan. All rights reserved.
//
import UIKit
import RxSwift
import RxCocoa
class TableViewController: BaseViewController {
@IBOutlet weak var tableView: UITableView!
let disposeBag = DisposeBag()
override func viewDidLoad() {
super.viewDidLoad()
title = "RxTableView"
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
// 动态的数据源如何处理???
let items = Observable.just( (0...20).map { $0.description } )
items.bind(to: tableView.rx.items(cellIdentifier: "cell", cellType: UITableViewCell.self)) {
(row, element, cell) in
cell.textLabel?.text = "\(element) @ row \(row)"
}.disposed(by: disposeBag)
// 选中哪一个数据源
tableView.rx.modelSelected(String.self)
.subscribe(onNext: { print($0) } )
.disposed(by: disposeBag)
// 选中具体行
tableView.rx.itemSelected
.subscribe(onNext: { [weak self] indexPath in
print(indexPath)
self?.tableView.deselectRow(at: indexPath, animated: false)
}).disposed(by: disposeBag)
}
/*
// 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
] |
41c09567d18a9f53017822fd61892781f155a42d
|
4ca98c79ac684766b771555c32b63a9f2d960e68
|
/Kode4Kids/View Controllers/NoteViewController.swift
|
a7c64b3b1357bf4429b5b3d9da9d2bdaa4d7c1ed
|
[] |
no_license
|
ryzer19/Kode4Kids
|
3d62bc99ce8ae2007830948371e2109b1865ad49
|
1453b8eae99aa9538f8d23fc50ae9f539e2e8fca
|
refs/heads/master
| 2022-11-13T01:43:54.849996 | 2020-07-12T14:46:04 | 2020-07-12T14:46:04 | 263,358,657 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 699 |
swift
|
//
// NoteViewController.swift
// Kode4Kids
//
// Created by Ryan Johnston on 23/06/2020.
// Copyright © 2020 Group9. All rights reserved.
//
import UIKit
class NoteViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// 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.
}
*/
}
|
[
330770
] |
65850737dc5bbcb599a7fceeba78740f1b838bfa
|
5a2c3520d64fd1581ac1abcf7409fd05572baf4f
|
/Polycon EasyLife/Viewer/employeeDocumentsViewer.swift
|
ccefa3831fd3e022f29f618286b598498551843c
|
[] |
no_license
|
Bambalow28/Polycon_EasyLife
|
ebedec10aa6232e759b526ab7fe59c6da7d44460
|
4a7ebc322f7886632bf9a893dc32fcd582ba93bd
|
refs/heads/main
| 2023-08-18T10:08:45.023338 | 2021-09-17T16:35:44 | 2021-09-17T16:35:44 | 313,484,272 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,917 |
swift
|
//
// employeeDocumentsViewer.swift
// Polycon EasyLife
//
// Created by Joshua Alanis on 2020-12-05.
//
import UIKit
class employeeDocumentsViewer: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
title = "Documents"
}
@IBAction func homeClicked(_ sender: Any) {
transitionToHome()
}
@IBAction func documentClicked(_ sender: Any) {
transitionToDocuments()
}
@IBAction func paystubClicked(_ sender: Any) {
transitionToPaystub()
}
@IBAction func profileClicked(_ sender: Any) {
transitionToProfile()
}
func transitionToHome() {
let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let employeeAccessController = storyBoard.instantiateViewController(withIdentifier: "employeeAccess") as! employeeAccess
let navController = UINavigationController(rootViewController: employeeAccessController)
navController.modalPresentationStyle = .fullScreen
navController.modalTransitionStyle = .crossDissolve
self.present(navController, animated: true, completion: nil)
}
func transitionToDocuments() {
let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let employeeDocumentsController = storyBoard.instantiateViewController(withIdentifier: "employeeDocumentsViewer") as! employeeDocumentsViewer
let navController = UINavigationController(rootViewController: employeeDocumentsController)
navController.modalPresentationStyle = .fullScreen
navController.modalTransitionStyle = .crossDissolve
self.present(navController, animated: true, completion: nil)
}
func transitionToPaystub() {
let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let employeePaystubController = storyBoard.instantiateViewController(withIdentifier: "employeePaystubViewer") as! employeePaystubViewer
let navController = UINavigationController(rootViewController: employeePaystubController)
navController.modalPresentationStyle = .fullScreen
navController.modalTransitionStyle = .crossDissolve
self.present(navController, animated: true, completion: nil)
}
func transitionToProfile() {
let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let employeeProfileController = storyBoard.instantiateViewController(withIdentifier: "employeeProfileViewer") as! employeeProfileViewer
let navController = UINavigationController(rootViewController: employeeProfileController)
navController.modalPresentationStyle = .fullScreen
navController.modalTransitionStyle = .crossDissolve
self.present(navController, animated: true, completion: nil)
}
}
|
[
-1
] |
ef7068063270e60cca337b5606c4e02be7c20842
|
2548100064c15cd893e7752c11f268e765cb0e36
|
/Package.swift
|
a4b403dcc0d66f9cec95424fc60273217d47433a
|
[] |
no_license
|
mahavrani/RoverSwiftCommandLine
|
2de49fc8a73c83c88bb8ec2d9962c51ac90dfca8
|
12ed425179ae7adc71dbfa99e7dd635bf01edbbe
|
refs/heads/master
| 2020-07-22T09:09:40.713239 | 2019-09-08T17:06:21 | 2019-09-08T17:06:21 | 207,144,269 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 843 |
swift
|
// swift-tools-version:5.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "RoverSwiftCommandLine",
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "RoverSwiftCommandLine",
dependencies: []),
.testTarget(
name: "RoverSwiftCommandLineTests",
dependencies: ["RoverSwiftCommandLine"]),
]
)
|
[
317062,
255882,
391820,
162966,
323612,
176930,
396342,
315574,
377914,
315579,
377408,
306373,
395337,
395096,
389856,
6121,
316779,
377967,
353013,
203768
] |
fc051c8bb14314dafd9c5548d918d218d1374e6c
|
722740a932765d2e4468e25e23bf7c6c01c6e72f
|
/Diet Butler/View Controllers/DayTableViewController.swift
|
e4c35ff852c1906e1610738b9c2205fd4204d5d5
|
[] |
no_license
|
slswalker/Diet-Butler
|
6e05d0f7a04b8680d93a364515710aaa18372ba8
|
a41c1e94815bbb41fdc93be9ac638df23a54a01d
|
refs/heads/master
| 2021-01-22T01:10:24.838976 | 2015-09-13T22:46:29 | 2015-09-13T22:46:29 | 39,323,489 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,818 |
swift
|
//
// DayTableViewController.swift
// Diet Butler
//
// Created by Samuel Walker on 7/18/15.
// Copyright © 2015 Samuel Walker. All rights reserved.
//
import UIKit
class DayTableViewController: UITableViewController {
var items: [Item] = []
let entryCellIentifier = "EntryCellIentifier"
var currentSelectedDay = ""
@IBAction func unwindToDayCancel(segue: UIStoryboardSegue) {
print("unwindToDayCancel")
}
@IBAction func unwindToDayDone(segue: UIStoryboardSegue) {
let source = segue.sourceViewController as! ItemMadeProtocol
if let item = source.item {
addItem(item)
}
}
override func viewDidLoad() {
MemoryReporter.reportMemory()
}
private func addItem(item: Item) {
tableView.beginUpdates()
items.append(item)
let index = (items.count - 1)
let indexPath = NSIndexPath(forRow:index , inSection: 0)
let array = [indexPath]
tableView.insertRowsAtIndexPaths(array, withRowAnimation: UITableViewRowAnimation.Automatic)
tableView.endUpdates()
}
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier(entryCellIentifier, forIndexPath: indexPath)
let entry = items[indexPath.row]
if (entry is Ingredient) {
let ingredient = entry as! Ingredient
cell.textLabel?.text = ingredient.name
cell.detailTextLabel?.text = ingredient.simpleDescription()
} else if (entry is Recipe) {
let recipe = entry as! Recipe
cell.textLabel?.text = recipe.name
cell.detailTextLabel?.text = recipe.simpleDescription()
}
return cell
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "ItemNotebookStoryboardID" {
let navController = segue.destinationViewController as! UINavigationController
let nextVC = navController.topViewController as! ItemNotebookTableViewController
nextVC.returnsItemSelected = true
}
}
override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
return true
}
override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
if editingStyle == .Delete {
self.items.removeAtIndex(indexPath.row)
tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.Automatic)
}
}
}
|
[
-1
] |
b5c74b25d450e1cde7dd1a4548bc2a3f6fc94b07
|
86ff15d85178904cdff599994542e28a892bfa17
|
/MovieApp-UIKit/AppDelegate.swift
|
49daaed2e120524583121986fe4c32c6d1bfad7b
|
[] |
no_license
|
muhal24/MovieApp-UIKit
|
a2d9b08e63b5e4ea1d8c9d4c258e643ddba7a5bf
|
6ad6716832a285130fd1ca04946cf3d292a79d8a
|
refs/heads/main
| 2023-08-17T23:40:12.766816 | 2021-09-22T11:56:15 | 2021-09-22T11:56:15 | 409,180,684 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,364 |
swift
|
//
// AppDelegate.swift
// MovieApp-UIKit
//
// Created by Muhammed Hanifi Alma on 22.09.2021.
//
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,
254030,
286800,
368727,
180313,
368735,
180320,
376931,
286831,
368752,
286844,
417924,
262283,
286879,
286888,
377012,
164028,
327871,
180416,
377036,
180431,
377046,
418007,
418010,
377060,
327914,
205036,
393456,
393460,
418043,
336123,
385280,
336128,
262404,
164106,
180490,
368911,
262416,
262422,
377117,
262436,
336180,
262454,
393538,
262472,
344403,
213332,
65880,
262496,
418144,
262499,
213352,
246123,
262507,
262510,
213372,
385419,
393612,
262550,
262552,
385440,
385443,
262566,
385451,
262573,
393647,
385458,
262586,
344511,
262592,
360916,
369118,
328177,
328179,
328182,
328189,
328192,
164361,
410128,
393747,
254490,
188958,
385570,
33316,
377383,
197159,
352821,
197177,
418363,
188987,
369223,
385609,
385616,
352864,
369253,
262760,
352874,
352887,
254587,
377472,
148105,
377484,
352918,
98968,
344744,
361129,
385713,
434867,
164534,
336567,
328378,
164538,
328386,
344776,
352968,
352971,
418507,
352973,
385742,
385748,
361179,
189153,
369381,
361195,
418553,
344831,
344835,
336643,
344841,
361230,
336659,
418580,
418585,
434970,
369435,
418589,
262942,
418593,
336675,
328484,
418598,
418605,
336696,
361273,
328515,
336708,
328519,
361288,
336711,
328522,
336714,
426841,
197468,
254812,
361309,
361315,
361322,
328573,
377729,
369542,
361360,
222128,
345035,
386003,
345043,
386011,
386018,
386022,
435187,
328702,
328714,
361489,
386069,
386073,
336921,
336925,
345118,
377887,
345133,
345138,
386101,
361536,
189520,
345169,
156761,
361567,
148578,
345199,
386167,
361593,
410745,
361598,
214149,
345222,
386186,
337047,
345246,
214175,
337071,
337075,
345267,
386258,
328924,
66782,
222437,
386285,
328941,
386291,
345376,
353570,
345379,
410917,
345382,
337205,
345399,
378169,
369978,
337222,
337229,
337234,
263508,
402791,
345448,
271730,
378227,
271745,
181638,
353673,
181643,
181649,
181654,
230809,
181670,
181673,
181678,
181681,
337329,
181684,
181690,
361917,
181696,
337349,
181703,
337365,
271839,
329191,
361960,
329194,
116210,
337398,
337415,
329226,
419339,
419343,
419349,
345625,
419355,
370205,
419359,
394786,
419362,
370213,
419368,
419376,
206395,
214593,
419400,
419402,
353867,
419406,
419410,
394853,
345701,
222830,
370297,
403070,
353919,
403075,
345736,
198280,
403091,
345749,
419483,
345757,
345762,
419491,
345765,
419497,
419501,
370350,
419506,
419509,
419512,
337592,
419517,
337599,
419527,
419530,
419535,
272081,
394966,
419542,
419544,
181977,
345818,
419547,
419550,
419559,
337642,
419563,
337645,
370415,
337659,
337668,
362247,
395021,
362255,
395029,
116509,
345887,
378663,
345905,
354106,
354111,
247617,
354117,
370503,
329544,
345930,
370509,
354130,
247637,
337750,
370519,
313180,
354142,
354150,
354156,
345964,
345967,
345970,
345974,
403320,
354172,
247691,
337808,
247700,
329623,
436126,
436132,
337833,
362413,
337844,
346057,
346063,
247759,
329697,
354277,
190439,
247789,
354313,
346139,
436289,
378954,
395339,
338004,
100453,
329832,
329855,
329885,
346272,
362660,
100524,
387249,
379066,
387260,
256191,
395466,
346316,
411861,
411864,
411868,
411873,
379107,
411876,
387301,
346343,
338152,
387306,
387312,
346355,
436473,
321786,
379134,
411903,
411916,
379152,
395538,
387349,
338199,
387352,
182558,
338211,
248111,
362822,
436555,
190796,
379233,
354673,
321910,
248186,
420236,
379278,
272786,
354727,
338352,
338381,
330189,
338386,
256472,
338403,
338409,
248308,
199164,
330252,
199186,
420376,
330267,
354855,
10828,
199249,
346721,
174695,
248425,
191084,
338543,
191092,
346742,
330383,
354974,
150183,
174774,
248504,
174777,
223934,
355024,
273108,
355028,
264918,
183005,
256734,
436962,
338660,
338664,
264941,
363251,
207619,
264964,
338700,
256786,
199452,
363293,
396066,
346916,
396069,
215853,
355122,
355131,
355140,
355143,
338763,
355150,
330580,
355166,
265055,
265058,
355175,
387944,
355179,
330610,
355218,
330642,
412599,
207808,
379848,
396245,
330710,
248792,
248798,
347105,
257008,
183282,
265207,
330748,
265214,
330760,
330768,
248862,
347176,
396328,
158761,
199728,
396336,
330800,
396339,
339001,
388154,
388161,
347205,
248904,
330826,
248914,
412764,
339036,
257120,
265320,
248951,
420984,
330889,
347287,
248985,
339097,
44197,
380070,
339112,
249014,
126144,
330958,
330965,
265432,
265436,
388319,
388347,
175375,
159005,
175396,
208166,
273708,
347437,
372015,
347441,
372018,
199988,
44342,
175415,
396600,
437566,
175423,
437570,
437575,
437583,
331088,
437587,
331093,
396633,
175450,
437595,
175457,
208227,
175460,
175463,
265580,
437620,
175477,
249208,
175483,
249214,
175486,
175489,
249218,
249224,
249227,
249234,
175513,
175516,
396705,
175522,
355748,
380332,
396722,
208311,
388542,
372163,
216517,
380360,
216522,
339404,
372176,
208337,
339412,
413141,
339417,
339420,
249308,
339424,
249312,
339428,
339434,
249328,
69113,
372228,
208398,
380432,
175635,
339503,
265778,
265795,
396872,
265805,
224853,
224857,
257633,
224870,
372327,
257646,
372337,
224884,
224887,
224890,
224894,
372353,
224897,
216707,
421508,
126596,
224904,
11918,
159374,
224913,
126610,
224916,
224919,
126616,
208538,
224922,
224926,
224929,
224932,
257704,
224936,
224942,
257712,
224947,
257716,
257720,
224953,
257724,
224959,
257732,
224965,
224969,
339662,
224975,
257747,
224981,
224986,
257761,
224993,
257764,
224999,
339695,
225012,
257787,
225020,
257790,
339710,
225025,
257794,
339721,
257801,
257804,
225038,
257807,
225043,
372499,
167700,
225048,
257819,
225053,
184094,
225058,
257833,
225066,
257836,
413484,
225070,
225073,
372532,
257845,
225079,
397112,
225082,
397115,
225087,
225092,
225096,
323402,
257868,
225103,
257871,
397139,
225108,
225112,
257883,
257886,
225119,
257890,
339814,
225127,
274280,
257896,
257901,
225137,
257908,
225141,
257912,
225148,
257916,
257920,
225155,
339844,
225165,
397200,
225170,
380822,
225175,
225180,
118691,
184244,
372664,
372702,
372706,
356335,
380918,
372738,
405533,
430129,
266294,
266297,
421960,
356439,
430180,
421990,
266350,
356466,
266362,
381068,
225423,
250002,
250004,
225429,
356506,
225437,
135327,
225441,
438433,
192673,
225444,
438436,
225447,
438440,
225450,
258222,
225455,
430256,
225458,
225461,
225466,
389307,
225470,
381120,
372929,
430274,
225475,
389320,
225484,
225487,
225490,
225493,
266453,
225496,
225499,
225502,
225505,
356578,
225510,
217318,
225514,
225518,
372976,
381176,
397571,
389380,
61722,
356637,
356640,
356643,
356646,
266536,
356649,
356655,
332080,
340275,
356660,
397622,
332090,
225597,
332097,
201028,
348488,
332106,
332117,
348502,
250199,
250202,
332125,
250210,
348522,
348525,
348527,
332152,
389502,
250238,
332161,
356740,
332172,
373145,
340379,
389550,
324030,
266687,
160234,
127471,
340472,
381436,
324094,
266754,
324111,
340500,
381481,
356907,
324142,
356916,
324149,
324155,
348733,
324164,
356934,
348743,
381512,
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,
348978,
152370,
340789,
348982,
398139,
127814,
357201,
357206,
389978,
430939,
357211,
357214,
201579,
201582,
349040,
340849,
201588,
430965,
381813,
324472,
398201,
119674,
324475,
430972,
340858,
340861,
324478,
324481,
373634,
398211,
324484,
324487,
381833,
324492,
324495,
324498,
430995,
324501,
324510,
422816,
324513,
398245,
201637,
324524,
340909,
324533,
324538,
324541,
398279,
340939,
340941,
209873,
340957,
431072,
398306,
340963,
209895,
201711,
349172,
381946,
349180,
439294,
431106,
209943,
357410,
250914,
185380,
357418,
209965,
209968,
209971,
209975,
209979,
209987,
209990,
209995,
341071,
349267,
250967,
210010,
341091,
210025,
210027,
210030,
210036,
210039,
349308,
210044,
349311,
160895,
152703,
210052,
210055,
349319,
218247,
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,
136590,
374160,
112020,
349590,
357792,
259515,
415166,
415185,
366034,
366038,
415191,
415193,
415196,
415199,
423392,
333284,
415207,
366056,
366061,
415216,
210420,
415224,
423423,
415257,
415263,
366117,
415270,
144939,
415278,
415281,
415285,
210487,
415290,
415293,
349761,
415300,
333386,
366172,
333413,
423528,
423532,
210544,
415353,
333439,
415361,
267909,
153227,
333498,
210631,
333511,
259788,
358099,
153302,
333534,
366307,
366311,
431851,
366318,
210672,
366321,
366325,
210695,
268041,
210698,
366348,
210706,
399128,
210719,
358191,
366387,
210739,
399159,
358200,
325440,
366401,
341829,
325446,
46920,
341834,
341838,
341843,
415573,
358234,
341851,
350045,
399199,
259938,
399206,
358255,
268143,
399215,
358259,
341876,
333689,
243579,
325504,
333698,
333708,
333724,
382890,
350146,
358339,
333774,
358371,
350189,
350193,
350202,
350206,
350213,
268298,
350224,
350231,
333850,
350237,
350240,
350244,
350248,
178218,
350251,
350256,
350259,
350271,
243781,
350285,
374864,
342111,
374902,
432271,
334011,
260289,
260298,
350410,
350416,
350422,
211160,
350425,
268507,
334045,
350445,
375026,
358644,
350458,
350461,
350464,
350467,
325891,
350475,
375053,
268559,
350480,
432405,
350486,
325914,
350490,
325917,
350493,
325919,
350498,
194852,
350504,
358700,
391468,
350509,
358704,
358713,
358716,
383306,
334161,
383321,
383330,
383333,
391530,
383341,
334203,
268668,
194941,
391563,
366990,
416157,
268701,
342430,
375208,
375216,
334262,
334275,
326084,
358856,
195039,
334304,
334311,
375277,
334321,
350723,
186897,
334358,
342550,
342554,
334363,
358941,
350761,
252461,
334384,
358961,
383536,
334394,
252482,
219718,
334407,
350822,
375400,
334465,
334468,
162445,
326290,
342679,
342683,
260766,
342710,
244409,
260797,
260801,
350917,
391894,
154328,
416473,
64230,
342766,
375535,
203506,
342776,
391937,
391948,
375568,
326416,
375571,
375574,
162591,
326441,
383793,
326451,
326454,
260924,
375612,
244540,
326460,
326467,
244551,
326473,
326477,
416597,
326485,
326490,
326502,
375656,
433000,
326507,
326510,
211825,
211831,
351097,
392060,
359295,
351104,
342915,
236430,
342930,
252822,
392091,
400285,
252836,
359334,
211884,
400306,
351168,
359361,
359366,
326598,
359382,
359388,
383967,
343015,
359407,
261108,
244726,
261111,
383997,
261129,
261147,
359451,
211998,
261153,
261159,
359470,
359476,
343131,
384098,
384101,
367723,
384107,
187502,
343154,
384114,
212094,
351364,
384135,
384139,
384143,
351381,
384160,
384168,
367794,
384181,
367800,
351423,
384191,
384198,
326855,
244937,
253130,
343244,
146642,
359649,
343270,
351466,
351479,
384249,
343306,
261389,
359694,
384269,
253200,
261393,
384275,
245020,
245029,
171302,
351534,
376110,
245040,
384314,
425276,
212291,
384323,
343365,
212303,
367965,
343393,
343398,
367980,
425328,
343409,
253303,
154999,
343417,
327034,
245127,
384397,
245136,
245142,
245145,
343450,
245148,
245151,
245154,
245157,
245162,
327084,
359865,
384443,
146876,
327107,
384453,
327110,
327115,
327117,
359886,
359890,
343507,
368092,
343534,
343539,
368119,
343544,
368122,
409091,
359947,
359955,
359983,
343630,
179802,
155239,
327275,
245357,
138864,
155254,
155273,
368288,
245409,
425638,
425649,
155322,
425662,
155327,
155351,
155354,
212699,
155363,
245475,
155371,
245483,
409335,
155393,
155403,
155422,
360223,
155438,
155442,
155447,
417595,
360261,
155461,
376663,
155482,
261981,
425822,
376671,
155487,
155490,
155491,
327531,
261996,
376685,
261999,
262002,
327539,
147317,
262005,
425845,
262008,
262011,
155516,
155521,
155525,
360326,
376714,
155531,
262027,
262030,
262033,
262036,
262039,
262042,
155549,
262045,
262048,
262051,
327589,
155559,
155562,
155565,
393150,
393169,
384977,
155611,
155619,
253923,
155621,
253926,
204784,
393203,
360438,
253943,
393206,
393212,
155646
] |
c457148aaacae9f40beae1b8b101dcf741be52dd
|
9e3fad083cbaae2be355c43888aa731e6d6101f9
|
/ShiftLog/ServerManager/ApiClient.swift
|
1b5ac394402506cd00ac08996b299934fad62f72
|
[] |
no_license
|
jiang-yi-siphty/ShiftLog
|
7b6ed4f2b35c593c97e1d12c5f2804c284e87a2c
|
f03e794a03c6fdad1c75d20756602e1cafa2201f
|
refs/heads/master
| 2021-04-09T11:58:44.682869 | 2018-03-20T15:34:43 | 2018-03-20T15:34:43 | 125,631,708 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 4,310 |
swift
|
//
// ApiClient.swift
// ShiftLog
//
// Created by Yi JIANG on 18/3/18.
// Copyright © 2018 Siphty. All rights reserved.
//
import Foundation
import RxSwift
//import RxCocoa
import Alamofire
class ApiClient: ApiService {
func postRestfulApi(_ config: ApiConfig, body: Data) -> Observable<RequestStatus> {
return Observable<RequestStatus>.create { observable -> Disposable in
self.networkRequest(config, body: body, completionHandler: { (data, error) in
guard let data = data else {
if let error = error {
observable.onNext(RequestStatus.fail(RequestError(error.errorDescription ?? "Unknown Error")))
} else {
observable.onNext(RequestStatus.fail(RequestError("Parse JSON information failed without error.")))
}
observable.onCompleted()
return
}
observable.onNext(RequestStatus.success(data))
observable.onCompleted()
})
return Disposables.create()
}.share()
}
func fetchRestfulApi(_ config: ApiConfig) -> Observable<RequestStatus> {
return Observable<RequestStatus>.create { observable -> Disposable in
self.networkRequest(config, body:nil , completionHandler: { (data, error) in
guard let data = data else {
if let error = error {
observable.onNext(RequestStatus.fail(RequestError(error.errorDescription ?? "Unknown Error")))
} else {
observable.onNext(RequestStatus.fail(RequestError("Parse JSON information failed without error.")))
}
observable.onCompleted()
return
}
observable.onNext(RequestStatus.success(data))
observable.onCompleted()
})
return Disposables.create()
}.share()
}
func networkRequest(_ config: ApiConfig, body: Data?, completionHandler: @escaping ((Data?, RequestError?) -> Void)) {
networkRequestByAlamoFire(config, body:body, completionHandler: completionHandler)
// networkRequestByNSURLSession(config, completionHandler: completionHandler)
}
}
// Other Network request methods and Response handler
extension ApiClient {
func networkRequestByAlamoFire(_ config: ApiConfig, body: Data?, completionHandler: @escaping ((_ data: Data?, _ error: RequestError?) -> Void)) {
URLCache.shared.removeAllCachedResponses()
guard let url = config.getFullUrl() else {
print("URL is nil, can't request.")
return
}
var request = URLRequest(url: url)
request.httpMethod = config.method
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
if let header = config.header {
request.allHTTPHeaderFields = header
}
request.httpBody = body
Alamofire.request(request).responseData { (response) in
guard let data = response.result.value else {
print("Error: \(String(describing: response.result.error))")
completionHandler(nil, RequestError((response.result.error?.localizedDescription)!))
return
}
completionHandler(data, nil)
}
}
func networkRequestByNSURLSession(_ config: ApiConfig,_ completionHandler: @escaping ((_ data: Data?, _ error: RequestError?) -> Void)) {
URLCache.shared.removeAllCachedResponses()
guard let url = config.getFullUrl() else {
print("URL is nil. Can't request.")
return
}
let session = URLSession.shared
let task = session.dataTask(with: url) { (data, response, error) in
self.responseHandler(data, error, completionHandler)
}
task.resume()
}
fileprivate func responseHandler(_ data: Data?, _ error: Error?, _ completionHandler: @escaping ((_ data: Data?, _ error: RequestError?) -> Void)){
completionHandler(data, RequestError(error?.localizedDescription ?? "Error with no message"))
}
}
|
[
-1
] |
e1e5bf965ab328f9ebeb2868579763c62c916c18
|
ef21d7c3f235af8a3e6c43b35f9cfb11e5db3c39
|
/远程控制/SceneDelegate.swift
|
ad178c5937f07e24bf0f47d8bcd2c828d72d84c6
|
[] |
no_license
|
DoLNw/BiShe_swift_RemoteControl
|
aebbb9b651a0d475bcdc6d97bb9d4de19b1f8749
|
2438ffa10818890187e3e462e662a7e6081cbe0a
|
refs/heads/master
| 2021-01-06T14:26:14.882567 | 2020-02-18T12:46:57 | 2020-02-18T12:46:57 | 241,359,663 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,346 |
swift
|
//
// SceneDelegate.swift
// 远程控制
//
// Created by JiaCheng on 2020/1/18.
// Copyright © 2020 JiaCheng. All rights reserved.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
}
|
[
393221,
163849,
393228,
393231,
393251,
352294,
344103,
393260,
393269,
213049,
376890,
385082,
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,
336140,
164107,
262417,
368913,
262423,
377118,
377121,
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,
164539,
328379,
328387,
352969,
418508,
385743,
385749,
189154,
369382,
361196,
418555,
344832,
336644,
344837,
344843,
328462,
361231,
394002,
336660,
418581,
418586,
434971,
369436,
262943,
369439,
418591,
418594,
336676,
418600,
418606,
369464,
361274,
328516,
336709,
328520,
336712,
361289,
328523,
336715,
361300,
213848,
426842,
361307,
197469,
361310,
254813,
361318,
344936,
361323,
361335,
328574,
369544,
361361,
222129,
345036,
386004,
345046,
386012,
386019,
386023,
328690,
435188,
328703,
328710,
418822,
377867,
328715,
361490,
386070,
336922,
345119,
377888,
214060,
345134,
345139,
361525,
361537,
377931,
189525,
402523,
361568,
148580,
345200,
361591,
386168,
361594,
410746,
214150,
345224,
386187,
345247,
361645,
337072,
345268,
402615,
361657,
402636,
328925,
165086,
165092,
328933,
222438,
328942,
386286,
386292,
206084,
328967,
345377,
345380,
353572,
345383,
263464,
337207,
345400,
378170,
369979,
386366,
337230,
337235,
263509,
353634,
337252,
402792,
271731,
378232,
337278,
271746,
181639,
353674,
181644,
361869,
181650,
181655,
230810,
181671,
181674,
181679,
181682,
337330,
181687,
370105,
181691,
181697,
361922,
337350,
181704,
337366,
271841,
329192,
361961,
329195,
116211,
337399,
402943,
337416,
329227,
419341,
419345,
329234,
419351,
345626,
419357,
345631,
419360,
370208,
394787,
419363,
370214,
419369,
394796,
419377,
419386,
214594,
419401,
353868,
419404,
173648,
419408,
214611,
419412,
403040,
345702,
370298,
353920,
403076,
345737,
198282,
403085,
403092,
345750,
419484,
345758,
345763,
419492,
345766,
419498,
419502,
370351,
419507,
337588,
419510,
419513,
419518,
403139,
337607,
419528,
419531,
419536,
272083,
394967,
419543,
419545,
345819,
419548,
419551,
345829,
419560,
337643,
419564,
337647,
370416,
337671,
362249,
362252,
395022,
362256,
321300,
345888,
362274,
378664,
354107,
345916,
354112,
370504,
329545,
345932,
370510,
247639,
337751,
370520,
313181,
182110,
354143,
354157,
345965,
345968,
345971,
345975,
403321,
1914,
354173,
395148,
247692,
337809,
247701,
436127,
436133,
247720,
337834,
362414,
337845,
190393,
247760,
346064,
346069,
329699,
354275,
190440,
354314,
346140,
436290,
395340,
378956,
436307,
338005,
100454,
329833,
329853,
329857,
329868,
411806,
329886,
346273,
362661,
100525,
387250,
379067,
387261,
256193,
395467,
346317,
411862,
256214,
411865,
411869,
411874,
379108,
411877,
387303,
346344,
395496,
338154,
387307,
346350,
338161,
436474,
379135,
411905,
411917,
379154,
395539,
387350,
387353,
338201,
338212,
395567,
248112,
362823,
436556,
321880,
362844,
379234,
354674,
321911,
420237,
379279,
272787,
354728,
338353,
338382,
272849,
248279,
256474,
182755,
338404,
338411,
330225,
248309,
248332,
330254,
199189,
420377,
330268,
191012,
330320,
199250,
191069,
346722,
248427,
338544,
191093,
346743,
346769,
150184,
174775,
248505,
174778,
363198,
223936,
355025,
273109,
264919,
338665,
264942,
363252,
338680,
264965,
338701,
256787,
363294,
396067,
346917,
396070,
215854,
355123,
355141,
355144,
338764,
330581,
330585,
387929,
355167,
265056,
265059,
355176,
355180,
355185,
330612,
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,
347208,
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,
175478,
175487,
249215,
175491,
249219,
249225,
249228,
249235,
175514,
175517,
396703,
396706,
175523,
355749,
396723,
388543,
380353,
216518,
380364,
339406,
372177,
339414,
249303,
413143,
339418,
339421,
249310,
339425,
249313,
339429,
339435,
249329,
69114,
372229,
208399,
175637,
405017,
134689,
265779,
421442,
413251,
265796,
265806,
224854,
224858,
339553,
257636,
224871,
372328,
257647,
372338,
224885,
224888,
224891,
224895,
372354,
126597,
421509,
224905,
11919,
224911,
224914,
126611,
224917,
224920,
126618,
208539,
224923,
224927,
224930,
224933,
257705,
224939,
224943,
257713,
224949,
257717,
257721,
224954,
257725,
224960,
257733,
224966,
224970,
257740,
224976,
257745,
257748,
224982,
257752,
224987,
257762,
224996,
225000,
339696,
225013,
257788,
225021,
339711,
257791,
225027,
257796,
339722,
257802,
257805,
225039,
257808,
249617,
225044,
167701,
372500,
257815,
225049,
257820,
225054,
184096,
397089,
257825,
225059,
339748,
225068,
257837,
413485,
225071,
225074,
257843,
225077,
257846,
225080,
397113,
225083,
397116,
257853,
225088,
225094,
225097,
257869,
257872,
225105,
397140,
225109,
225113,
257881,
257884,
257887,
225120,
257891,
225128,
257897,
225138,
257909,
225142,
372598,
257914,
257917,
225150,
257922,
380803,
225156,
339845,
257927,
225166,
397201,
225171,
380823,
225176,
225183,
184245,
372698,
372704,
372707,
356336,
380919,
393215,
372739,
405534,
266295,
266298,
421961,
200786,
356440,
217180,
430181,
266351,
356467,
266365,
192640,
266375,
381069,
225425,
250003,
225430,
250008,
356507,
250012,
225439,
135328,
192674,
225442,
438434,
225445,
438438,
225448,
438441,
225451,
258223,
225456,
430257,
225459,
225462,
225468,
389309,
225472,
372931,
225476,
430275,
389322,
225485,
225488,
225491,
266454,
225494,
225497,
225500,
225503,
225506,
225511,
217319,
225515,
225519,
381177,
397572,
389381,
356638,
356641,
356644,
356647,
266537,
389417,
356650,
356656,
332081,
340276,
356662,
397623,
332091,
225599,
348489,
332107,
151884,
430422,
348503,
332118,
250201,
250211,
340328,
250217,
348523,
348528,
332153,
356734,
389503,
332158,
438657,
332162,
389507,
348548,
356741,
332175,
160152,
373146,
373149,
70048,
356783,
266688,
324032,
201158,
127473,
217590,
340473,
324095,
324100,
324103,
324112,
340501,
324118,
324122,
340512,
332325,
324134,
381483,
356908,
324141,
324143,
356917,
324150,
324156,
168509,
348734,
324161,
324165,
356935,
348745,
381513,
324171,
324174,
324177,
389724,
332381,
373344,
340580,
348777,
381546,
340628,
184983,
373399,
258723,
332455,
332460,
389806,
332464,
332473,
381626,
332484,
332487,
332494,
357070,
357074,
332512,
340724,
332534,
348926,
389927,
348979,
398141,
357202,
389971,
357208,
389979,
430940,
357212,
357215,
439138,
349041,
340850,
381815,
430967,
324473,
398202,
119675,
340859,
324476,
430973,
324479,
340863,
324482,
324485,
324488,
185226,
381834,
324493,
324496,
324499,
430996,
324502,
324511,
422817,
324514,
201638,
398246,
373672,
324525,
5040,
111539,
324534,
5047,
324539,
324542,
398280,
349129,
340942,
209874,
340958,
431073,
398307,
340964,
209896,
201712,
209904,
349173,
381947,
201724,
349181,
431100,
431107,
349203,
209944,
209948,
250917,
357419,
209966,
209969,
209973,
209976,
209980,
209988,
209991,
431180,
209996,
349268,
250968,
210011,
373853,
341094,
210026,
210028,
210032,
349296,
210037,
210042,
210045,
349309,
152704,
349313,
160896,
210053,
210056,
349320,
259217,
373905,
210068,
210072,
210078,
210081,
210085,
210089,
210096,
210100,
324792,
210108,
357571,
210116,
210128,
333010,
210132,
333016,
210139,
210144,
218355,
218361,
275709,
128254,
275713,
242947,
275717,
275723,
333075,
349460,
349486,
349492,
415034,
210261,
365912,
259423,
374113,
251236,
374118,
390518,
357756,
374161,
112021,
349591,
357793,
333222,
259516,
415168,
366035,
415187,
366039,
415192,
415194,
415197,
415200,
333285,
415208,
366057,
366064,
415217,
415225,
423424,
415258,
415264,
366118,
415271,
382503,
349739,
144940,
415279,
415282,
415286,
210488,
415291,
415295,
333396,
333400,
366173,
423529,
423533,
210547,
415354,
333440,
267910,
267929,
333472,
259789,
366301,
333535,
366308,
366312,
431852,
399086,
366319,
210673,
366322,
399092,
366326,
333566,
268042,
210700,
366349,
210707,
399129,
333595,
210720,
366384,
358192,
210740,
366388,
358201,
325441,
366403,
325447,
341831,
341839,
341844,
415574,
358235,
350046,
399200,
399208,
268144,
358256,
358260,
399222,
325494,
333690,
325505,
399244,
333709,
333725,
333737,
382891,
382898,
358348,
333777,
219094,
399318,
358372,
350190,
350194,
333819,
350204,
350207,
325633,
325637,
350214,
333838,
350225,
350232,
333851,
350238,
350241,
374819,
350245,
350249,
350252,
178221,
350257,
350260,
350272,
243782,
350281,
350286,
374865,
252021,
342134,
374904,
268435,
333998,
334012,
260299,
211161,
375027,
358645,
268553,
268560,
432406,
325920,
358701,
391469,
358705,
358714,
358717,
383307,
358738,
383331,
383334,
391531,
383342,
334204,
268669,
194942,
391564,
366991,
334224,
342431,
375209,
375220,
334263,
326087,
358857,
195041,
334306,
334312,
104940,
375279,
162289,
350724,
186898,
342546,
350740,
342551,
342555,
416294,
350762,
252463,
358962,
334397,
358973,
252483,
219719,
399957,
334425,
326240,
375401,
334466,
334469,
391813,
162446,
342680,
342685,
260767,
342711,
244410,
260798,
334530,
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,
244572,
433001,
400238,
211826,
211832,
392061,
351102,
252801,
260993,
400260,
211846,
342921,
342931,
252823,
400279,
392092,
400286,
359335,
211885,
400307,
351169,
359362,
351172,
170950,
187335,
326599,
359367,
359383,
359389,
383968,
343018,
261109,
261112,
244728,
383999,
261130,
261148,
359452,
211999,
261155,
261160,
261166,
359471,
375868,
384099,
384102,
384108,
367724,
187503,
343155,
384115,
212095,
384136,
384140,
384144,
351382,
384152,
384158,
384161,
351399,
384169,
367795,
384182,
384189,
384192,
351424,
343232,
367817,
244938,
384202,
253132,
384209,
146644,
351450,
384225,
359650,
343272,
351467,
359660,
384247,
351480,
384250,
351483,
351492,
384270,
359695,
261391,
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,
359948,
359951,
359984,
400977,
400982,
179803,
155255,
155274,
368289,
245410,
425639,
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,
155488,
376672,
155492,
327532,
261997,
376686,
262000,
262003,
425846,
262006,
147319,
262009,
327542,
262012,
155517,
155523,
155526,
360327,
376715,
155532,
262028,
262031,
262034,
262037,
262040,
262043,
155550,
253854,
262046,
262049,
262052,
327590,
155560,
155563,
155566,
327613,
393152,
393170,
155604,
155620,
253924,
155622,
253927,
327655,
360432,
393204,
360439,
253944,
393209,
155647
] |
07d0ffb526b10136147d64e428c6534ea2efa428
|
b385d185db1f2625d0ed396592967a031687a955
|
/Tests/iOS Tests-Swift/PNBasicClientTestCase.swift
|
099ecb3e8e9e8ce6df4494f4cb697b3729e6cae8
|
[
"MIT"
] |
permissive
|
benallen/objective-c
|
bdaf421af6b795e4c3262e3272ecf65e4506fb15
|
040306d16895cf7d123709efce3d741f2d082d6c
|
refs/heads/master
| 2021-01-15T12:31:24.593620 | 2015-11-24T16:56:52 | 2015-11-24T16:56:52 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,224 |
swift
|
//
// PNBasicClientTestCase.swift
// PubNub Tests
//
// Created by Jordan Zucker on 7/27/15.
//
//
import Foundation
import UIKit
import XCTest
class PNBasicClientTestCase: JSZVCRTestCase {
lazy var configuration: PNConfiguration = {
let lazyConfig = PNConfiguration(publishKey: "demo-36", subscribeKey: "demo-36")
lazyConfig.uuid = "322A70B3-F0EA-48CD-9BB0-D3F0F5DE996C"
return self.overrideClientConfiguration(lazyConfig)
}()
lazy var client: PubNub = {
return PubNub.clientWithConfiguration(self.configuration)
}()
func overrideClientConfiguration(configuration: PNConfiguration) -> PNConfiguration! {
return configuration
}
override func matcherClass() -> AnyObject.Type! {
return JSZVCRUnorderedQueryMatcher.self
}
override func setUp() {
super.setUp()
PNLog.enabled(true)
// 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()
}
}
|
[
-1
] |
44e4d03d98a7d06e0d1581c234ad4147dc7b3307
|
6684fc348a5e14660942d20c1c4280ed8b945717
|
/Something/Supporting Files/AppDelegate.swift
|
c791f5cb9405ed02e87bf7b31229aa305d99a1e5
|
[] |
no_license
|
ksmks0921/something_ios
|
97707ac791fb5fa730ca0071cc96d9165c88a6ef
|
12b05a347a6c8077087832c9069f81941f5c5a53
|
refs/heads/master
| 2022-04-03T08:31:07.460934 | 2020-02-17T22:32:59 | 2020-02-17T22:32:59 | 228,249,529 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 14,743 |
swift
|
//
// AppDelegate.swift
// Something
//
// Created by Maninder Singh on 17/02/18.
// Copyright © 2018 Maninder Singh. All rights reserved.
//
import UIKit
import Firebase
import IQKeyboardManagerSwift
import FAPanels
import GoogleMaps
import GooglePlaces
import Fabric
import Crashlytics
import TwitterKit
import FBSDKLoginKit
import GoogleSignIn
import FirebaseMessaging
import UserNotifications
import FirebaseFirestore
import Braintree
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate,UNUserNotificationCenterDelegate {
var window: UIWindow?
var locationManager = CLLocationManager()
var userCurrentLocation : CLLocationCoordinate2D?
var userStartLocation : CLLocationCoordinate2D?
var isLocationUpdatedFirstTime = false
var ref : DatabaseReference!
var email: String?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
BTAppSwitch.setReturnURLScheme("com.initiatjive.something.payments")
IQKeyboardManager.shared.enable = true
Fabric.with([Crashlytics.self])
FirebaseApp.configure()
GMSServices.provideAPIKey(GoogleMapKey)
GMSPlacesClient.provideAPIKey(GoogleMapKey)
TWTRTwitter.sharedInstance().start(withConsumerKey:"5gS4rid3hKOwQzW7fYqw3H55K", consumerSecret:"2HfgDiW2HC3yfsi8G5i88c0DP7xslDFMuev3euhzfptZ1LqmgU")
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
GIDSignIn.sharedInstance().clientID = FirebaseApp.app()?.options.clientID
//Notifications
Messaging.messaging().delegate = self
Messaging.messaging().shouldEstablishDirectChannel = true
ref = Database.database().reference()
locationManager.delegate = self
locationManager.requestAlwaysAuthorization()
locationManager.startUpdatingLocation()
if #available(iOS 10.0, *) {
// For iOS 10 display notification (sent via APNS)
UNUserNotificationCenter.current().delegate = self
let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization(
options: authOptions,
completionHandler: {_, _ in })
// For iOS 10 data message (sent via FCM)
// Messaging.messaging().delegate = self
} else {
let settings: UIUserNotificationSettings =
UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
application.registerUserNotificationSettings(settings)
}
//
UIApplication.shared.registerForRemoteNotifications()
updateFirestorePushTokenIfNeeded()
self.getNotificationSettings()
setRootVC()
return true
}
func updateFirestorePushTokenIfNeeded() {
// if let token = Messaging.messaging().fcmToken {
// let usersRef = Firestore.firestore().collection(UserNode).document(DataManager.email!)
// usersRef.setData(["fcmToken": token], merge: true)
// }
}
func getNotificationSettings() {
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().getNotificationSettings { settings in
print("Notification settings: \(settings)")
guard settings.authorizationStatus == .authorized else { return }
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
}
}
} else {
// Fallback on earlier versions
}
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
// InstanceID.instanceID().setAPNSToken(deviceToken, type: InstanceIDAPNSTokenType.prod)
var token = ""
for i in 0..<deviceToken.count {
token = token + String(format: "%02.2hhx", arguments: [deviceToken[i]])
}
//InstanceID.instanceID().token()
print("Registration succeeded! Token: ", token)
updateFirestorePushTokenIfNeeded()
}
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
print("Registration failed!")
}
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:.
}
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
setRootVC()
return true
}
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
if url.scheme == "fb332197317551003"{
print("_________Awesome__________")
return FBSDKApplicationDelegate.sharedInstance().application(app, open: url, sourceApplication: options[.sourceApplication] as! String!, annotation: options[.annotation])
}
if url.scheme?.localizedCaseInsensitiveCompare("com.initiatjive.something.payments") == .orderedSame {
return BTAppSwitch.handleOpen(url, options: options)
}
if url.scheme == ""{
return GIDSignIn.sharedInstance().handle(url,sourceApplication:options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, annotation: [:])
}
else{
return TWTRTwitter.sharedInstance().application(app, open: url, options: options)
}
}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]) {
// If you are receiving a notification message while your app is in the background,
// this callback will not be fired till the user taps on the notification launching the application.
// TODO: Handle data of notification
// With swizzling disabled you must let Messaging know about the message, for Analytics
// Messaging.messaging().appDidReceiveMessage(userInfo)
// Print message ID.
// if let messageID = userInfo[gcmMessageIDKey] {
// print("Message ID: \(messageID)")
// }
// Print full message.
print(userInfo)
}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
// If you are receiving a notification message while your app is in the background,
// this callback will not be fired till the user taps on the notification launching the application.
// TODO: Handle data of notification
// With swizzling disabled you must let Messaging know about the message, for Analytics
// Messaging.messaging().appDidReceiveMessage(userInfo)
// Print message ID.
// Print full message.
Messaging.messaging().appDidReceiveMessage(userInfo)
print(userInfo)
completionHandler(UIBackgroundFetchResult.newData)
}
// Firebase notification received
@available(iOS 10.0, *)
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (_ options: UNNotificationPresentationOptions) -> Void) {
// custom code to handle push while app is in the foreground
print("Handle push from foreground\(notification.request.content.userInfo)")
if let dict = notification.request.content.userInfo["aps"] as? NSDictionary{
if let d = dict["alert"] as? NSDictionary{
let body : String = d["body"] as? String ?? ""
let title : String = d["title"] as? String ?? ""
self.showAlertAppDelegate(title: title,message: body,buttonTitle:"ok",window:self.window!)
}
}else{
self.showAlertAppDelegate(title: notification.request.content.title,message: notification.request.content.body ,buttonTitle:"ok",window:self.window!)
}
}
@available(iOS 10.0, *)
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
// if you set a member variable in didReceiveRemoteNotification, you will know if this is from closed or background
//setRootVC(isNotficationArrived: true)
print("Handle push from background or closed\(response.notification.request.content.userInfo)")
}
func showAlertAppDelegate(title: String,message : String,buttonTitle: String,window: UIWindow){
let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: buttonTitle, style: UIAlertActionStyle.default, handler: nil))
window.rootViewController?.present(alert, animated: false, completion: nil)
}
}
extension AppDelegate: MessagingDelegate{
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String) {
let token = Messaging.messaging().fcmToken
print("________FCM token: \(token ?? "")")
DataManager.deviceToken = token
}
func messaging(_ messaging: Messaging, didReceive remoteMessage: MessagingRemoteMessage) {
print("Received data message: \(remoteMessage.appData)")
}
}
extension AppDelegate {
func setRootVC(){
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
// if DataManager.isLogin!{
let NAVC = mainStoryboard.instantiateViewController(withIdentifier: "loginNAVC") as! UINavigationController
let VC = mainStoryboard.instantiateViewController(withIdentifier: "PannelVC") as! FAPanelController
let leftMenuVC = mainStoryboard.instantiateViewController(withIdentifier: "SideMenuVC") as! SideMenuVC
let rightMenuVC = mainStoryboard.instantiateViewController(withIdentifier: "HomeVC") as! HomeVC
let centerNavVC = UINavigationController(rootViewController: rightMenuVC)
centerNavVC.isNavigationBarHidden = true
VC.configs.shadowColor = UIColor.black.cgColor
VC.configs.shadowOffset = CGSize(width: 10.0, height: 200.0)
VC.configs.shadowOppacity = 0.5
VC.configs.leftPanelGapPercentage = 0.75
_ = VC.center(centerNavVC).left(leftMenuVC)
NAVC.setViewControllers([VC], animated: false)
window?.rootViewController = NAVC
// }else{
// let leftMenuVC = mainStoryboard.instantiateViewController(withIdentifier: "NAVC")
// self.window?.rootViewController = leftMenuVC
// }
}
}
extension AppDelegate : CLLocationManagerDelegate{
func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
let authorizationStatus = CLLocationManager.authorizationStatus()
if authorizationStatus == .denied || authorizationStatus == .restricted {
locationManager.stopUpdatingLocation()
let alert = UIAlertController(title: "Alert", message: "Please allow location services from setting.", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Open", style: UIAlertActionStyle.default, handler: nil))
window?.rootViewController?.present(alert, animated: true, completion: nil)
}
else if authorizationStatus == .notDetermined{
locationManager.requestAlwaysAuthorization()
}
else if authorizationStatus == .authorizedAlways{
locationManager.startUpdatingLocation()
}
}
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
guard let location = locations.first else {
return
}
globleCurrentLocation = location.coordinate
if !isLocationUpdatedFirstTime{
isLocationUpdatedFirstTime = true
NotificationCenter.default.post(Notification.init(name: Notification.Name.init("FirstUpdate")))
}
guard let _ = DataManager.userId else {
return
}
let geoRef = GeoFire.init(firebaseRef: ref.child(PinsGeofire))
let geoQuery = geoRef.query(at: location, withRadius: 0.1)
geoQuery.observe(.keyEntered) { (key, location) in
UpdatePinVM.shared.isPinVisited(pinId: key, completion: { (success) in
if !success{
UpdatePinVM.shared.addToMissedPin(pinId: key)
}
})
}
}
}
|
[
-1
] |
3c055bca60ad2a5ab86cce3073e7d2c50230cc99
|
9850454f0e7f9883a830fa61e72db918dafd2abd
|
/Chat-0.1/View/ConfigurableView.swift
|
3afb6df6381a85e4f6e2b130a5965afcf2c3b080
|
[] |
no_license
|
SunriseQQ/TinkoffCourse
|
de08936a13b5aae8c7562023cbf611d30b6e94d1
|
205fa87f27eb3ffb917b6221f0637ac155251f27
|
refs/heads/master
| 2021-01-04T22:19:18.392068 | 2020-03-15T17:02:52 | 2020-03-15T17:02:52 | 240,771,642 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 266 |
swift
|
//
// Protocols.swift
// Chat-0.1
//
// Created by Sunrise on 29.02.2020.
// Copyright © 2020 Sunrise. All rights reserved.
//
import UIKit
protocol ConfigurableView {
associatedtype ConfigurationModel
func configure(with model: ConfigurationModel)
}
|
[
-1
] |
9e4b87c231595f4079d974f08b5b96bfe7cd4f46
|
d50fe00df1c7a15b1d5eb8d8bf5b92bea05597fb
|
/Sources/main.swift
|
f0879baac48aaab5c9b457f5f9880e375af60c2d
|
[] |
no_license
|
RockfordWei/p404
|
9c74c5c1fca8c287bac0d0621fc76e7e352fa190
|
49a2622be7997183f6ad2fb69f1f91540adbb7c5
|
refs/heads/master
| 2021-01-20T05:20:31.958995 | 2017-08-25T20:15:30 | 2017-08-25T20:15:30 | 101,434,287 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,484 |
swift
|
//
// main.swift
// PerfectTemplate
//
// Created by Kyle Jessup on 2015-11-05.
// Copyright (C) 2015 PerfectlySoft, Inc.
//
//===----------------------------------------------------------------------===//
//
// This source file is part of the Perfect.org open source project
//
// Copyright (c) 2015 - 2016 PerfectlySoft Inc. and the Perfect project authors
// Licensed under Apache License v2.0
//
// See http://perfect.org/licensing.html for license information
//
//===----------------------------------------------------------------------===//
//
import PerfectLib
import PerfectHTTP
import PerfectHTTPServer
struct Filter404: HTTPResponseFilter {
func filterBody(response: HTTPResponse, callback: (HTTPResponseFilterResult) -> ()) {
callback(.continue)
}
func filterHeaders(response: HTTPResponse, callback: (HTTPResponseFilterResult) -> ()) {
if case .notFound = response.status {
let f = File("./webroot/notFound.html")
let html: String
do {
try f.open(.read)
html = try f.readString()
f.close()
}catch {
html = "\(error)"
}
response.setBody(string: html)
response.setHeader(.contentLength, value: "\(response.bodyBytes.count)")
response.setHeader(.contentType, value: "text/html")
callback(.done)
} else {
callback(.continue)
}
}
}
let server = HTTPServer()
server.setResponseFilters([(Filter404(), .high)])
server.serverPort = 8181
try server.start()
|
[
-1
] |
7664f6a30d4ace8d19b71257239d20c6b351d80d
|
06bfd8c10a1a0a0b164c71d5bca0ad320b0adf99
|
/ChineseFlashcards/AppDelegate.swift
|
09b17fafe6ca219d3897e4a237a8646ca084543c
|
[] |
no_license
|
gringisimo/Chinese-Flashcards
|
23d38f52075ce7213307b568784020c26cc7914f
|
50b6552b71f212a8704905f901d7aa8ebc90f5da
|
refs/heads/master
| 2021-01-09T05:54:32.172334 | 2017-02-09T23:19:05 | 2017-02-09T23:19:05 | 80,861,815 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,338 |
swift
|
//
// AppDelegate.swift
// ChineseFlashcards
//
// Created by Daniel Galyean on 1/18/17.
// Copyright © 2017 Daniel Galyean. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let splitViewController = self.window!.rootViewController as! UISplitViewController
let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController
navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem
splitViewController.delegate = self
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:.
}
// MARK: - Split view
func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController:UIViewController, onto primaryViewController:UIViewController) -> Bool {
guard let secondaryAsNavController = secondaryViewController as? UINavigationController else { return false }
guard let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController else { return false }
if topAsDetailController.detailItem == nil {
// Return true to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded.
return true
}
return false
}
}
|
[
416643,
279173,
276103,
227723,
292240,
311184,
227728,
226193,
289169,
283416,
129178,
209823,
298916,
278829,
279087,
239152,
208048,
279090,
278963,
290870,
228923,
277692,
176450,
284995,
287303,
281547,
300491,
280654,
229595,
226908,
187105,
280298,
277358,
285043,
228212,
277876,
279287,
276090
] |
53503ce3f95332fe8bcec123fa969acfc5a7759c
|
62ae7e25454dc74d398919cbe90733f9f0b19f80
|
/COVID-19/Repositories/TermsAndConditionsRepository.swift
|
a42153e31bf8530ba8e9f30229377415e5224113
|
[
"Apache-2.0"
] |
permissive
|
scalefocus/virusafe-ios
|
e5ff63cf4f7ad4e32578711c103a1302636a7655
|
e22a01767151907acb52b12ef5a604b91f402e72
|
refs/heads/develop
| 2022-09-25T18:12:41.669391 | 2020-05-28T06:10:44 | 2020-05-28T06:10:44 | 255,062,008 | 18 | 4 |
Apache-2.0
| 2022-09-12T11:35:11 | 2020-04-12T10:51:14 |
Swift
|
UTF-8
|
Swift
| false | false | 804 |
swift
|
//
// TermsAndConditionsRepository.swift
// COVID-19
//
// Created by Aleksandar Sergeev Petrov on 28.03.20.
// Copyright © 2020 Upnetix AD. All rights reserved.
//
import Foundation
final class TermsAndConditionsRepository: NSObject {
private var userDefaults = UserDefaults.standard
@objc dynamic var isAgree: Bool {
get {
return userDefaults.bool(forKey: "user_accepted_app_terms")
}
set {
userDefaults.set(newValue, forKey: "user_accepted_app_terms")
}
}
@objc dynamic var isAgreeDataProtection: Bool {
get {
return userDefaults.bool(forKey: "user_accepted_data_protection")
}
set {
userDefaults.set(newValue, forKey: "user_accepted_data_protection")
}
}
}
|
[
-1
] |
64067e5bb37b8a32ddb8736ebb4fac07d9871476
|
ed674482caa96a33e75c4148b325c2846d87415f
|
/ToDoList/ToDoList/MemotableviewTableViewController.swift
|
2ac9993453d4109d53c47fd627cbddae3e96095c
|
[
"MIT"
] |
permissive
|
SuperJerry/Swift
|
00097e20778ce1358a89e83bf5227a33c4563ea4
|
53b1c5e78e766424b9210092757c11d977ef8791
|
refs/heads/master
| 2021-01-11T11:16:58.878212 | 2015-08-01T06:02:40 | 2015-08-01T06:02:40 | 39,426,377 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,110 |
swift
|
//
// MemotableviewTableViewController.swift
// ToDoList
//
// Created by Jerry on 7/24/15.
// Copyright (c) 2015 Jerry. All rights reserved.
//
import UIKit
class MemotableviewTableViewController: UITableViewController {
var memo: Memo!
@IBOutlet weak var memoTITLE: UILabel!
@IBOutlet weak var memoDescription: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
memoTITLE.text = memo.title
memoDescription.text = memo.description
// Uncomment the following line to preserve selection between presentations
// self.clearsSelectionOnViewWillAppear = false
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - Table view data source
/*
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("reuseIdentifier", forIndexPath: indexPath) as! UITableViewCell
// Configure the cell...
return cell
}
*/
/*
// Override to support conditional editing of the table view.
override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
// Return NO if you do not want the specified item to be editable.
return true
}
*/
/*
// Override to support editing the table view.
override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
if editingStyle == .Delete {
// Delete the row from the data source
tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
} else if editingStyle == .Insert {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
override func tableView(tableView: UITableView, moveRowAtIndexPath fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) {
}
*/
/*
// Override to support conditional rearranging of the table view.
override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool {
// Return NO if you do not want the item to be re-orderable.
return true
}
*/
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
}
|
[
-1
] |
94f64abfe77f346520fc1e14079662eefc4dcdba
|
c5178a598b2de27ef3774046f933198d3be5fa6b
|
/RoseGame/SShape.swift
|
d9d6326d55eb815af35b1b986ec89d5442b14f77
|
[
"MIT"
] |
permissive
|
CanNotFind/RoseGame
|
87660013173ac3553bee7a6025968c6b3962277c
|
08d83189ee523ab2fc9b633941e987ec01017dc3
|
refs/heads/master
| 2020-09-21T12:10:24.106789 | 2016-08-26T22:19:04 | 2016-08-26T22:19:04 | 66,681,815 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,453 |
swift
|
//
// SShape.swift
// RoseGame
//
// Created by 吴青 on 16/8/27.
// Copyright © 2016年 tick. All rights reserved.
//
class SShape:Shape {
/*
Orientation 0
| 0•|
| 1 | 2 |
| 3 |
Orientation 90
• | 1 | 0 |
| 3 | 2 |
Orientation 180
| 0•|
| 1 | 2 |
| 3 |
Orientation 270
• | 1 | 0 |
| 3 | 2 |
• marks the row/column indicator for the shape
*/
override var blockRowColumnPositions: [Orientation: Array<(columnDiff: Int, rowDiff: Int)>] {
return [
Orientation.Zero: [(0, 0), (0, 1), (1, 1), (1, 2)],
Orientation.Ninety: [(2, 0), (1, 0), (1, 1), (0, 1)],
Orientation.OneEighty: [(0, 0), (0, 1), (1, 1), (1, 2)],
Orientation.TwoSeventy: [(2, 0), (1, 0), (1, 1), (0, 1)]
]
}
override var bottomBlocksForOrientations: [Orientation: Array<Block>] {
return [
Orientation.Zero: [blocks[SecondBlockIndex], blocks[FourthBlockIndex]],
Orientation.Ninety: [blocks[FirstBlockIndex], blocks[ThirdBlockIndex], blocks[FourthBlockIndex]],
Orientation.OneEighty: [blocks[SecondBlockIndex], blocks[FourthBlockIndex]],
Orientation.TwoSeventy: [blocks[FirstBlockIndex], blocks[ThirdBlockIndex], blocks[FourthBlockIndex]]
]
}
}
|
[
276132,
282676,
276134
] |
15655abc003c63640407bddcfb9ba7eff3a80ee0
|
3ceac19129a54fc26b54ab78f774fc36d9abccc8
|
/WindScribble/Utils/ImageCacheType.swift
|
d8efb7ab70659d4d0b74998e1e29e835ba5c2fce
|
[] |
no_license
|
norrisboat/Windscribble
|
72dc0bd7e7b06a011268d09d27faa6b26984317e
|
20f72aef9b6c4c440f73c5724a3c74f6520fe283
|
refs/heads/main
| 2023-07-30T17:04:26.812969 | 2021-09-21T23:41:56 | 2021-09-21T23:41:56 | 409,000,583 | 2 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 4,209 |
swift
|
//
// ImageCacheType.swift
// WindScribble
//
// Created by Norris Aboagye Boateng on 19/09/2021.
//
import Foundation
import UIKit.UIImage
import Combine
// Declares in-memory image cache
public protocol ImageCacheType: AnyObject {
// Returns the image associated with a given url
func image(for url: URL) -> UIImage?
// Inserts the image of the specified url in the cache
func insertImage(_ image: UIImage?, for url: URL)
// Removes the image of the specified url in the cache
func removeImage(for url: URL)
// Removes all images from the cache
func removeAllImages()
// Accesses the value associated with the given key for reading and writing
subscript(_ url: URL) -> UIImage? { get set }
}
public final class ImageCache: ImageCacheType {
// 1st level cache, that contains encoded images
private lazy var imageCache: NSCache<AnyObject, AnyObject> = {
let cache = NSCache<AnyObject, AnyObject>()
cache.countLimit = config.countLimit
return cache
}()
// 2nd level cache, that contains decoded images
private lazy var decodedImageCache: NSCache<AnyObject, AnyObject> = {
let cache = NSCache<AnyObject, AnyObject>()
cache.totalCostLimit = config.memoryLimit
return cache
}()
private let lock = NSLock()
private let config: Config
public struct Config {
public let countLimit: Int
public let memoryLimit: Int
public static let defaultConfig = Config(countLimit: 100, memoryLimit: 1024 * 1024 * 100) // 100 MB
}
public init(config: Config = Config.defaultConfig) {
self.config = config
}
public func image(for url: URL) -> UIImage? {
lock.lock(); defer { lock.unlock() }
// the best case scenario -> there is a decoded image in memory
if let decodedImage = decodedImageCache.object(forKey: url as AnyObject) as? UIImage {
return decodedImage
}
// search for image data
if let image = imageCache.object(forKey: url as AnyObject) as? UIImage {
let decodedImage = image.decodedImage()
decodedImageCache.setObject(image as AnyObject, forKey: url as AnyObject, cost: decodedImage.diskSize)
return decodedImage
}
return nil
}
public func insertImage(_ image: UIImage?, for url: URL) {
guard let image = image else { return removeImage(for: url) }
let decompressedImage = image.decodedImage()
lock.lock(); defer { lock.unlock() }
imageCache.setObject(decompressedImage, forKey: url as AnyObject, cost: 1)
decodedImageCache.setObject(image as AnyObject, forKey: url as AnyObject, cost: decompressedImage.diskSize)
}
public func removeImage(for url: URL) {
lock.lock(); defer { lock.unlock() }
imageCache.removeObject(forKey: url as AnyObject)
decodedImageCache.removeObject(forKey: url as AnyObject)
}
public func removeAllImages() {
lock.lock(); defer { lock.unlock() }
imageCache.removeAllObjects()
decodedImageCache.removeAllObjects()
}
public subscript(_ key: URL) -> UIImage? {
get {
return image(for: key)
}
set {
return insertImage(newValue, for: key)
}
}
}
fileprivate extension UIImage {
func decodedImage() -> UIImage {
guard let cgImage = cgImage else { return self }
let size = CGSize(width: cgImage.width, height: cgImage.height)
let colorSpace = CGColorSpaceCreateDeviceRGB()
let context = CGContext(data: nil, width: Int(size.width), height: Int(size.height), bitsPerComponent: 8, bytesPerRow: cgImage.bytesPerRow, space: colorSpace, bitmapInfo: CGImageAlphaInfo.noneSkipFirst.rawValue)
context?.draw(cgImage, in: CGRect(origin: .zero, size: size))
guard let decodedImage = context?.makeImage() else { return self }
return UIImage(cgImage: decodedImage)
}
// Rough estimation of how much memory image uses in bytes
var diskSize: Int {
guard let cgImage = cgImage else { return 0 }
return cgImage.bytesPerRow * cgImage.height
}
}
|
[
-1
] |
995c9b4c94bf622b0e0b548eea7fc1319fd759cb
|
48eb090cf55833f55f87449c6d4e76f56e53288d
|
/Pods/SwiftyCoreData/SwiftyCoreData/SCDPersistanceService.swift
|
39b3c77609ab13c0b49fd9cc6a0ddbfb4f776856
|
[] |
no_license
|
wojtowiczm/NasaAsteroids
|
264ebaa062a63abe657d41bece7edc75a6b1f4ef
|
31c514eeb66891c0b23ee6717da6a8eec49adf13
|
refs/heads/master
| 2020-04-14T13:09:01.617884 | 2019-01-04T15:12:43 | 2019-01-04T15:12:43 | 163,860,455 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 663 |
swift
|
//
// SCDPersistanceService.swift
// SwiftyCoreData
//
// Created by Michał Wójtowicz on 20/12/2018.
// Copyright © 2018 Michał Wójtowicz. All rights reserved.
//
import CoreData
public protocol SCDPersistanceService {
var persistanceContainer: NSPersistentContainer { get set }
}
public extension SCDPersistanceService {
var context: NSManagedObjectContext {
return persistanceContainer.viewContext
}
func saveContext() {
guard context.hasChanges else { return }
do {
try context.save()
} catch {
print("SCDError: \(error.localizedDescription)")
}
}
}
|
[
-1
] |
ed6f156b738961879a590ffee64a60797fd393f7
|
11412af5bde11339c10306966615808bec034462
|
/Weather/Weather/AppDelegate.swift
|
893a09075644ce833e962be76feb2ee092840466
|
[] |
no_license
|
daveweldon/Weather
|
2e6678796453b15e3de6ce5ba57b9439fffaddbb
|
b9ed1826261ba708606c10fafc97800b2c71a851
|
refs/heads/master
| 2021-07-09T14:41:20.766502 | 2017-10-11T09:19:14 | 2017-10-11T09:19:14 | 106,168,060 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,358 |
swift
|
//
// AppDelegate.swift
// Weather
//
// Created by David Weldon on 08/10/2017.
// Copyright © 2017 nsdave. 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.
/*
if let path = Bundle.main.path(forResource: "city.list", ofType: "json") {
GenerateInitialRealm.location(with: path)
}
*/
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,
229388,
294924,
278542,
229391,
327695,
278545,
229394,
278548,
229397,
229399,
229402,
278556,
229405,
278559,
229408,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
229426,
237618,
229428,
311349,
286774,
229432,
204856,
286776,
286778,
319544,
352318,
286791,
237640,
286797,
278605,
311375,
163920,
237646,
196692,
319573,
311383,
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,
319694,
286926,
131278,
131281,
286928,
278743,
278747,
295133,
155872,
131299,
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,
180727,
164343,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
320007,
172552,
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,
189044,
189040,
287355,
287360,
295553,
172675,
295557,
311942,
303751,
287365,
352905,
311946,
287371,
279178,
311951,
287377,
172691,
287381,
311957,
287386,
221850,
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,
279231,
287427,
312005,
312006,
107208,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
287450,
303835,
279258,
189149,
303838,
213724,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
189169,
205564,
303871,
230146,
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,
304007,
320391,
304009,
213895,
304011,
230284,
304013,
295822,
189325,
279438,
189329,
295825,
304019,
189331,
58262,
304023,
279452,
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,
230413,
197645,
295949,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
164973,
279661,
205934,
312432,
279669,
337018,
189562,
279679,
304258,
279683,
66690,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
165038,
238766,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
296213,
230677,
296215,
230679,
320792,
230681,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
230718,
296259,
378181,
296262,
230727,
296264,
320840,
238919,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
410987,
148843,
230763,
230768,
296305,
312692,
230773,
304505,
181626,
304506,
181631,
148865,
312711,
296331,
288140,
230800,
288144,
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,
222676,
288212,
288214,
148946,
239064,
329177,
288218,
280021,
288220,
288217,
239070,
280027,
288224,
288226,
370146,
280036,
288229,
280038,
288230,
288232,
320998,
288234,
280034,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
296446,
402942,
321022,
206336,
296450,
148990,
230916,
230919,
214535,
304651,
230923,
304653,
370187,
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,
198310,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
419522,
280260,
419525,
206536,
280264,
206539,
206541,
206543,
263888,
280276,
313044,
321239,
280283,
18140,
313052,
288478,
313055,
419555,
321252,
313066,
288494,
280302,
280304,
313073,
419570,
288499,
321266,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
337732,
280388,
304968,
280393,
280402,
173907,
313176,
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,
288764,
239612,
313340,
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,
280671,
149599,
149601,
321634,
149603,
223327,
329830,
280681,
313451,
223341,
280687,
215154,
313458,
280691,
149618,
313464,
321659,
280702,
288895,
321670,
215175,
141446,
141455,
275606,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
288947,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
321740,
313548,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
321817,
125209,
125218,
321842,
223539,
125239,
305464,
280888,
280891,
289087,
108865,
280897,
280900,
239944,
305480,
280906,
239947,
305485,
305489,
379218,
280919,
248153,
215387,
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,
436684,
281045,
281047,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
240132,
305668,
330244,
223749,
223752,
150025,
338440,
281095,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
289317,
281127,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
338528,
338532,
281190,
199273,
281196,
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,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
183172,
158596,
338823,
322440,
314249,
240519,
183184,
142226,
289687,
224151,
240535,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
420829,
281567,
289762,
322534,
297961,
183277,
322550,
134142,
322563,
314372,
330764,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
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,
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,
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,
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,
282337,
216801,
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,
282481,
110450,
315251,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
44948,
241556,
298901,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
290739,
241588,
282547,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
307211,
282639,
290835,
282645,
241693,
282654,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
315482,
315483,
217179,
192605,
233567,
200801,
299105,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
241813,
307352,
299164,
241821,
299167,
184479,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
299185,
323763,
299191,
176311,
307385,
184503,
258235,
307388,
176316,
307390,
307386,
299200,
184512,
307394,
299204,
307396,
184518,
307399,
323784,
233679,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
184586,
282893,
291089,
282906,
291104,
233766,
299304,
295583,
176435,
307508,
315701,
307510,
332086,
307512,
168245,
307515,
282942,
307518,
282947,
323917,
282957,
110926,
233808,
323921,
315733,
323926,
233815,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
291226,
242075,
283033,
291231,
61855,
283042,
291238,
291241,
127403,
127405,
291247,
299440,
127407,
299444,
127413,
291254,
283062,
127417,
291260,
127421,
127424,
299457,
127429,
127431,
127440,
315856,
176592,
315860,
176597,
127447,
283095,
127449,
299481,
176605,
127455,
242143,
127457,
291299,
127460,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
291314,
127474,
291317,
127480,
135672,
291323,
233979,
127485,
127490,
291330,
127494,
283142,
127497,
135689,
233994,
127500,
291341,
233998,
127506,
234003,
127509,
234006,
152087,
127511,
283161,
242202,
234010,
135707,
135710,
242206,
242208,
291361,
242220,
291378,
234038,
152118,
234041,
315961,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
135808,
291456,
299655,
373383,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
225948,
135839,
299680,
225954,
299684,
135844,
242343,
209576,
242345,
373421,
299706,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
226008,
242396,
299740,
201444,
299750,
283368,
234219,
283372,
185074,
226037,
283382,
234231,
316151,
234236,
226045,
242431,
234239,
209665,
234242,
299778,
242436,
234246,
226056,
291593,
234248,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
348950,
234264,
201496,
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,
201557,
234329,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
291711,
234368,
291714,
234370,
291716,
234373,
201603,
234375,
226182,
308105,
324490,
226185,
234379,
234384,
234388,
234390,
324504,
226200,
209818,
308123,
234396,
324508,
291742,
234393,
234398,
234401,
291747,
291748,
234405,
324518,
291750,
324520,
234407,
234410,
324522,
291756,
291754,
226220,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
324536,
275384,
234428,
291773,
234431,
242623,
324544,
234434,
324546,
324548,
226239,
226245,
234437,
234439,
234443,
291788,
193486,
234446,
193488,
234449,
316370,
275406,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
324599,
234490,
234493,
234496,
316416,
308226,
234501,
308231,
234504,
234507,
234510,
234515,
300054,
234519,
234520,
316439,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
234543,
234546,
275508,
234549,
300085,
300088,
234553,
234556,
234558,
316479,
234561,
160835,
234563,
308291,
316483,
234568,
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,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
324757,
234647,
234648,
226453,
234650,
308379,
275608,
234653,
300189,
119967,
324766,
324768,
234657,
283805,
242852,
300197,
234661,
283813,
234664,
177318,
275626,
234667,
316596,
308414,
234687,
300223,
300226,
308418,
234692,
283844,
300229,
308420,
308422,
283850,
300234,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
316663,
275703,
300284,
275710,
300287,
292097,
300289,
161027,
300292,
300294,
275719,
234760,
177419,
300299,
300301,
349451,
242957,
177424,
275725,
283917,
349464,
415009,
283939,
259367,
292143,
283951,
300344,
226617,
243003,
283963,
226628,
300357,
283973,
177482,
283983,
316758,
357722,
316766,
292192,
316768,
218464,
292197,
316774,
243046,
218473,
284010,
136562,
324978,
333178,
275834,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
226709,
357783,
316824,
316826,
300448,
144807,
144810,
144812,
284076,
144814,
144820,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
227430,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
300507,
103899,
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,
284213,
308790,
194103,
284215,
316983,
284218,
194101,
226877,
292414,
284223,
284226,
243268,
292421,
284228,
284231,
226886,
128584,
284234,
366155,
317004,
276043,
284238,
226895,
284241,
292433,
194130,
300628,
284245,
284243,
317015,
284247,
235097,
243290,
284249,
276053,
284253,
300638,
284251,
284255,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
292470,
284278,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
276095,
276098,
284297,
317066,
284299,
317068,
276109,
284301,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
358080,
276160,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
276175,
284368,
276177,
317138,
284370,
358098,
284372,
284377,
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,
284440,
300828,
300830,
276255,
300832,
325408,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
153417,
292681,
358224,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
358292,
399252,
317332,
284564,
284566,
350106,
284572,
276386,
284579,
276388,
292776,
358312,
317353,
276395,
284585,
292784,
276402,
358326,
161718,
358330,
276411,
276418,
276425,
301009,
301011,
301013,
292823,
301015,
358360,
301017,
292828,
276446,
276448,
153568,
276452,
292839,
276455,
350186,
292843,
276460,
292845,
178161,
227314,
276466,
350200,
276472,
325624,
317435,
276476,
276479,
350210,
276482,
178181,
317446,
276485,
350218,
276490,
292876,
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,
284739,
292934,
243785,
276553,
350293,
350295,
309337,
194649,
350299,
227418,
350302,
194654,
227423,
178273,
309346,
227426,
194660,
350308,
309348,
309350,
292968,
350313,
309354,
301163,
350316,
276583,
309352,
301167,
276586,
350321,
276590,
227440,
284786,
350325,
276595,
350328,
292985,
301178,
350332,
292989,
292993,
301185,
350339,
317570,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
276638,
153765,
284837,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
276699,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
227571,
309491,
309494,
243960,
227583,
276735,
276739,
211204,
276742,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
285061,
366983,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
342434,
317858,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
129486,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
293346,
276964,
293352,
236013,
293364,
293370,
301562,
317951,
309764,
301575,
121352,
236043,
317963,
342541,
55822,
113167,
309779,
317971,
309781,
277011,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
219714,
129603,
318020,
301636,
301639,
301643,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
309871,
121458,
277106,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
318094,
334476,
277136,
277139,
227992,
334488,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
342707,
154292,
277173,
318132,
285368,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
342745,
137946,
342747,
342749,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
56045,
277232,
228081,
56059,
310015,
285441,
310020,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
293666,
285474,
228135,
318248,
277291,
293677,
318253,
285489,
293685,
285494,
301880,
285499,
301884,
293696,
310080,
277317,
277322,
277329,
162643,
310100,
301911,
277337,
301913,
301921,
400236,
236397,
162671,
326514,
310134,
236408,
277368,
15224,
416639,
416640,
113538,
310147,
416648,
277385,
39817,
187274,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
276579,
293817,
293820,
203715,
326603,
342994,
293849,
293861,
228327,
228328,
318442,
228332,
326638,
277486,
351217,
318450,
293876,
293877,
285686,
302073,
121850,
302075,
244731,
293882,
285690,
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,
285792,
277601,
203872,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
285821,
392326,
253064,
294026,
285835,
302218,
162964,
384148,
187542,
302231,
302233,
285849,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
310486,
302296,
384222,
310498,
285927,
318698,
302315,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
138505,
228617,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
384302,
285999,
277804,
113969,
277807,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
294211,
302403,
384328,
277832,
277836,
146765,
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,
310659,
294276,
351619,
327046,
277892,
253320,
310665,
318858,
277894,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
228776,
277928,
277932,
310703,
277937,
130486,
310710,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
245191,
310727,
64966,
277959,
277963,
302541,
277966,
302543,
310737,
277971,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
286188,
310764,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
40448,
228864,
286214,
228871,
302603,
302614,
302617,
286233,
302621,
187936,
146977,
286240,
294435,
40484,
187939,
40486,
294439,
294440,
286246,
245288,
294443,
40488,
294445,
40491,
310831,
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,
327333,
229030,
212648,
302764,
278188,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
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,
188252,
237409,
229233,
294776,
360317,
294785,
327554,
360322,
40840,
294803,
40851,
188312,
294811,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
294831,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
393190,
294890,
311279,
278513,
237555,
311283,
278516,
278519,
237562
] |
8a482a5d74a125764888944fedc7bb4fffe6cf13
|
8e5089c3d1fd280deb61ba479b8eeb6dc4004188
|
/Taxis/JSONParser.swift
|
20f5845b4f7fcf1a5c80e8a18624c599ea961298
|
[] |
no_license
|
heltonrosa/Taxis
|
743650f34c6307f13d1b3d592bd63cea983aaa06
|
0d758981a33fc6f4a610ad871e2af6b4475f2101
|
refs/heads/master
| 2021-01-10T10:39:23.865688 | 2015-11-30T17:56:38 | 2015-11-30T17:56:38 | 47,136,369 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,326 |
swift
|
//
// JSONParser.swift
// Taxis
//
// Created by Helton Rosa on 28/11/15.
// Copyright © 2015 Helton Rosa. All rights reserved.
//
import Foundation
class JSONParser {
static let LatitudeKey = "latitude"
static let LongitudeKey = "longitude"
static let DriverIdKey = "driverId"
static let AvailabilityKey = "driverAvailable"
static func parse(json: NSData?) -> [Taxi]?{
var taxiArray = [Taxi]()
do{
if let json = try NSJSONSerialization.JSONObjectWithData(json!, options: NSJSONReadingOptions.MutableContainers) as? NSArray {
let count = json.count
for i in 0..<count {
if let taxiJSON = json.objectAtIndex(i) as? NSDictionary{
let taxi = Taxi(latitude: taxiJSON.objectForKey(LatitudeKey) as? Double ?? 0.0,
longitude: taxiJSON.objectForKey(LongitudeKey) as? Double ?? 0.0,
driverId: taxiJSON.objectForKey(DriverIdKey) as? Int ?? 0,
availability: taxiJSON.objectForKey(AvailabilityKey) as? Bool ?? false)
taxiArray.append(taxi)
}
}
}
} catch{
print("Parse JSON Failed")
}
return taxiArray
}
}
|
[
-1
] |
46b50d6f3b217c0296f4fcef9b929fd0f2372314
|
bbf363acc1bbd16531db5f57e96860924c6162f6
|
/code/Kotoba/Word.swift
|
3e63a155b9f04327f12239d1a7683c47be85d918
|
[
"MIT"
] |
permissive
|
chrisfinazzo/Kotoba
|
38b5453dcc0223e4525b11c18f4c2160d4aeb432
|
cf14b52d42f018c8ead0940d6dd2f3f9e2c13546
|
refs/heads/master
| 2023-09-04T02:26:54.134649 | 2023-08-12T01:33:17 | 2023-08-12T01:33:17 | 138,036,631 | 1 | 0 | null | 2018-06-20T13:28:58 | 2018-06-20T13:28:58 | null |
UTF-8
|
Swift
| false | false | 388 |
swift
|
//
// WordList.swift
// Words
//
// Created by Will Hains on 2016-06-05.
// Copyright © 2016 Will Hains. All rights reserved.
//
import UIKit
// MARK:- Model
/// Represents a saved word.
struct Word
{
let text: String
// TODO #14: This is where metadata would go.
func canonicalise() -> String
{
self.text.lowercased().trimmingCharacters(in: .whitespacesAndNewlines)
}
}
|
[
-1
] |
ee8b1e0ab8d2cb93b9710f04f7d3835f3f60b760
|
ad61620fe05f6f84d22541b77c358613cab8320a
|
/Homework2/BuildingsViewController.swift
|
95a88ac15a3cfc53d2bd3c6a1d265c8ea2010a72
|
[] |
no_license
|
RealityJ/SwiftProjectTwo
|
ff62de066742420254ab4549a57631968de5dc3d
|
ba8f699a50e325be0f690e274e93848ee3c362d5
|
refs/heads/master
| 2021-01-10T16:09:34.937192 | 2016-02-14T02:57:10 | 2016-02-14T02:57:10 | 51,267,682 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,774 |
swift
|
//
// BuildingsViewController.swift
// Homework2
//
// Created by Joaquin Castro-Calvo on 2/6/16.
// Copyright © 2016 Joaquin Castro-Calvo. All rights reserved.
//
import UIKit
class BuildingsViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var navigationbar: UINavigationBar!
@IBOutlet weak var TableView: UITableView!
var items: [String] = ["Library", "Engineering Hall", "Olin Engineering", "Cudahy"]
var chosenBuilding : NSString!
override func viewDidLoad() {
super.viewDidLoad()
self.navigationController?.setNavigationBarHidden(false, animated: false)
self.view.backgroundColor = UIColor(patternImage: UIImage(named: "background.png")!)
TableView.backgroundColor = UIColor.clearColor()
TableView.delegate = self
TableView.dataSource = self
TableView.separatorColor = UIColor.clearColor()
TableView.tableFooterView = UIView(frame: CGRectZero)
self.TableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell")
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
/*
// 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.
}
*/
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.items.count;
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell:UITableViewCell = TableView.dequeueReusableCellWithIdentifier("cell")! as UITableViewCell
cell.textLabel?.textColor = UIColor(red: 255/255, green: 197/255, blue: 38/255, alpha: 1)
cell.backgroundColor = UIColor.clearColor()
cell.textLabel?.text = self.items[indexPath.row]
return cell
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
TableView.deselectRowAtIndexPath(indexPath
, animated: false)
chosenBuilding = items[indexPath.row];
performSegueWithIdentifier("MapsSegue", sender: self)
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
if segue.identifier == "MapsSegue" {
let destinationVC = segue.destinationViewController as! MapsViewController
destinationVC.receivedBuilding = chosenBuilding;
}
}
}
|
[
-1
] |
94a1a317192ce3f5f5ef753fceca6f0b84aa75cc
|
908abe288bcc2105625e51878dfa97b2cdbc32ce
|
/app/CocoaPods/CPFontAndColourGateKeeper.swift
|
fc5a504a2ea9d0832fe0378ce9ee6713b73f3312
|
[
"MIT"
] |
permissive
|
Artproton/CocoaPods-app
|
c1e1c73c0e850e35634c60af950755ecc50fdc49
|
da5afd35bb6d9cc4f5abed966d8c363b0560e083
|
refs/heads/master
| 2020-06-29T13:41:45.750323 | 2019-08-10T16:56:53 | 2019-08-10T16:56:53 | 200,553,179 | 1 | 1 |
NOASSERTION
| 2019-08-11T13:40:54 | 2019-08-04T23:50:49 |
Swift
|
UTF-8
|
Swift
| false | false | 2,681 |
swift
|
import Cocoa
class CPFontAndColourGateKeeper: NSObject {
// MARK: - Colors
let cpLightYellow = NSColor(calibratedRed:1, green:1, blue:0.832, alpha:1.00)
let cpBlack = NSColor(calibratedRed:0.180, green:0.000, blue:0.008, alpha:1.00)
let cpRed = NSColor(calibratedRed:0.682, green:0.000, blue:0.000, alpha:1.00)
let cpGreen = NSColor(calibratedRed:0.161, green:0.608, blue:0.086, alpha:1.00)
let cpYellow = NSColor(calibratedRed:0.659, green:0.675, blue:0.055, alpha:1.00)
let cpBlue = NSColor(calibratedRed:0.227, green:0.463, blue:0.733, alpha:1.00)
let cpMagenta = NSColor(calibratedRed:0.427, green:0.404, blue:0.698, alpha:1.00)
let cpCyan = NSColor(calibratedRed:0.239, green:0.616, blue:0.753, alpha:1.00)
let cpWhite = NSColor(calibratedRed:0.812, green:0.812, blue:0.812, alpha:1.00)
let cpBrightBlack = NSColor(calibratedRed:0.012, green:0.012, blue:0.012, alpha:1.00)
let cpBrightRed = NSColor(calibratedRed:0.980, green:0.000, blue:0.000, alpha:1.00)
let cpBrightGreen = NSColor(calibratedRed:0.192, green:0.745, blue:0.098, alpha:1.00)
let cpBrightYellow = NSColor(calibratedRed:0.659, green:0.675, blue:0.055, alpha:1.00)
let cpBrightBlue = NSColor(calibratedRed:0.282, green:0.576, blue:0.902, alpha:1.00)
let cpBrightMagenta = NSColor(calibratedRed:0.553, green:0.522, blue:0.898, alpha:1.00)
let cpBrightCyan = NSColor(calibratedRed:0.282, green:0.729, blue:0.902, alpha:1.00)
let cpBrightWhite = NSColor(calibratedRed:0.773, green:0.773, blue:0.773, alpha:1.00)
let cpBrightLightBrown = NSColor(calibratedRed: 232/255, green:226/255 , blue: 224/255, alpha: 1)
let cpBrightBrown = NSColor(calibratedRed: 209/255, green:196/255 , blue: 192/255, alpha: 1)
let cpLinkRed = NSColor(calibratedRed:0.91, green:0.22, blue:0.24, alpha:1.00)
//MARK: - Font
fileprivate let kDefaultsDefaultFontSize = "defaultFontSize"
var defaultFont: NSFont? {
return NSFont(name: "Menlo", size: defaultFontSize)
}
fileprivate var defaultFontSize: CGFloat {
let defaults = UserDefaults.standard
if let fontSize = defaults.object(forKey: kDefaultsDefaultFontSize) as? Float {
return CGFloat(fontSize)
}
return 16
}
func increaseDefaultFontSize() -> NSFont? {
let newSize = defaultFontSize + 1
return changeDefaultFontSize(newSize)
}
func decreaseDefaultFontSize() -> NSFont? {
let newSize = max(1, defaultFontSize - 1)
return changeDefaultFontSize(newSize)
}
fileprivate func changeDefaultFontSize(_ size: CGFloat) -> NSFont? {
let defaults = UserDefaults.standard
defaults.set(Float(size), forKey: kDefaultsDefaultFontSize)
return defaultFont
}
}
|
[
-1
] |
adff00d88bc230a6e54ff6485bab5286377214d1
|
06549594b4249780ad2f55f919f9acf48579f21a
|
/ios/Starter/AppDelegate.swift
|
ce387eb38b25a562444f1ed924e9c952d808ffdc
|
[] |
no_license
|
jazhnaneh/Starter
|
bf02e671b73821bf16e9df32f667dc3e681cd283
|
21d4cad50bb32d392a3e293cd63a2fea6eb48b38
|
refs/heads/master
| 2023-01-09T11:46:20.868453 | 2020-03-19T05:48:02 | 2020-03-19T05:48:02 | 246,815,714 | 7 | 1 | null | 2023-01-06T12:34:33 | 2020-03-12T11:21:06 |
Java
|
UTF-8
|
Swift
| false | false | 1,413 |
swift
|
//
// AppDelegate.swift
// ListAndRequest
//
// Created by reza on 12/28/1398 AP.
// Copyright © 1398 reza. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
|
[
393222,
393224,
393230,
393250,
344102,
393261,
393266,
163891,
213048,
385081,
376889,
393275,
376905,
327756,
254030,
286800,
368727,
180313,
368735,
180320,
376931,
286831,
368752,
286844,
417924,
262283,
286879,
286888,
377012,
327871,
180416,
377036,
180431,
377046,
418007,
418010,
377060,
327914,
205036,
393456,
393460,
336123,
418043,
336128,
385280,
262404,
180490,
368911,
262422,
377117,
262436,
336180,
262454,
393538,
262472,
344403,
213332,
65880,
262496,
418144,
262499,
213352,
246123,
262507,
262510,
213372,
385419,
393612,
262550,
262552,
385440,
385443,
385451,
262573,
393647,
385458,
262586,
344511,
262592,
360916,
369118,
328177,
328179,
328182,
328189,
328192,
164361,
328206,
393747,
254490,
188958,
385570,
33316,
197159,
377383,
352821,
188987,
418363,
369223,
385609,
385616,
352856,
352864,
369253,
262760,
352874,
352887,
254587,
377472,
336512,
148105,
377484,
352918,
98968,
344744,
361129,
336555,
385713,
434867,
164534,
336567,
328378,
164538,
328386,
352968,
418507,
352971,
352973,
385742,
385748,
361179,
189153,
369381,
361195,
418553,
344831,
336643,
344835,
344841,
361230,
336659,
418580,
418585,
434970,
369435,
418589,
262942,
418593,
336675,
328484,
418598,
418605,
336696,
361273,
328515,
336708,
328519,
336711,
361288,
328522,
336714,
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,
222437,
386285,
328941,
386291,
345376,
345379,
410917,
337205,
345399,
378169,
369978,
337222,
337229,
337234,
263508,
402791,
345448,
271730,
378227,
271745,
181638,
353673,
181643,
181654,
230809,
181670,
181673,
181678,
337329,
181681,
181684,
181690,
361917,
181696,
337349,
181703,
337365,
271839,
329191,
361960,
329194,
116210,
337398,
337415,
329226,
419339,
419343,
419349,
345625,
419355,
370205,
419359,
419362,
394786,
370213,
419368,
419376,
206395,
214593,
419400,
419402,
353867,
419406,
419410,
345701,
394853,
222830,
370297,
353919,
403075,
345736,
198280,
403091,
345749,
345762,
419491,
345765,
419497,
419501,
370350,
419506,
337592,
419512,
419517,
337599,
419527,
419530,
419535,
272081,
394966,
419542,
419544,
181977,
345818,
419547,
419550,
419559,
337642,
419563,
337645,
370415,
141051,
337659,
337668,
362247,
395021,
362255,
321299,
116509,
345887,
378663,
345905,
354106,
354111,
247617,
354117,
329544,
370509,
354130,
247637,
337750,
370519,
313180,
345964,
345967,
345970,
345974,
403320,
354172,
247691,
337808,
247700,
329623,
436126,
436132,
337833,
337844,
346057,
247759,
346063,
329697,
354277,
190439,
247789,
354313,
346139,
436289,
378954,
395339,
338004,
100453,
329832,
329855,
329867,
329885,
346272,
362660,
100524,
387249,
379066,
387260,
256191,
395466,
346316,
411861,
411864,
411868,
411873,
379107,
411876,
387301,
346343,
338152,
387306,
387312,
346355,
436473,
321786,
379134,
411903,
411916,
379152,
395538,
387349,
338199,
387352,
182558,
338211,
248111,
362822,
436555,
190796,
321879,
379233,
354673,
321910,
248186,
420236,
379278,
272786,
354727,
338352,
330189,
338381,
338386,
256472,
338403,
338409,
248308,
199164,
330252,
330267,
354855,
199249,
346721,
174695,
248425,
191084,
338543,
191092,
346742,
330383,
354974,
150183,
174774,
248504,
174777,
223934,
355024,
273108,
355028,
264918,
183005,
256734,
436962,
338660,
338664,
264941,
207619,
264964,
338700,
256786,
199452,
363293,
396066,
346916,
396069,
215853,
355122,
355131,
355140,
355143,
338763,
355150,
330580,
355166,
265055,
265058,
387944,
355179,
330610,
330642,
355218,
412599,
207808,
396245,
330710,
248792,
248798,
347105,
257008,
183282,
265207,
330748,
265214,
330760,
330768,
248862,
396328,
158761,
396336,
199728,
330800,
396339,
339001,
388154,
388161,
347205,
248904,
330826,
248914,
183383,
339036,
412764,
257120,
265320,
248951,
420984,
330889,
248985,
339097,
44197,
380070,
339112,
249014,
126144,
330965,
265436,
388319,
388347,
175375,
159005,
175396,
208166,
273708,
372015,
347441,
372018,
199988,
44342,
175415,
396600,
437566,
175423,
437570,
437575,
437583,
331088,
437587,
331093,
396633,
175450,
437595,
175457,
208227,
175460,
175463,
437620,
175477,
249208,
175483,
175486,
249214,
175489,
249218,
249224,
249227,
249234,
175513,
175516,
396705,
175522,
355748,
380332,
396722,
208311,
372163,
216517,
380360,
216522,
339404,
372176,
208337,
339412,
413141,
339417,
249308,
339420,
249312,
339424,
339428,
339434,
249328,
69113,
372228,
339461,
208398,
380432,
175635,
339503,
265778,
265795,
396872,
265805,
224853,
224857,
257633,
224870,
372327,
257646,
372337,
224884,
224887,
224890,
224894,
224897,
372353,
216707,
339588,
126596,
224904,
159374,
11918,
339601,
224913,
126610,
224916,
224919,
126616,
208538,
224922,
224926,
224929,
224932,
224936,
257704,
224942,
257712,
224947,
257716,
257720,
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,
397112,
225082,
397115,
225087,
225092,
323402,
257868,
257871,
225103,
397139,
225108,
225112,
257883,
257886,
225119,
339814,
225127,
257896,
274280,
257901,
225137,
257908,
225141,
257912,
257916,
225148,
257920,
225155,
339844,
225165,
397200,
225170,
380822,
225175,
225180,
118691,
184244,
372664,
372702,
372706,
356335,
380918,
405533,
430129,
266294,
266297,
217157,
421960,
356439,
421990,
266350,
266362,
381068,
225423,
250002,
250004,
225429,
356506,
225437,
135327,
225441,
438433,
225444,
438436,
225447,
438440,
225450,
258222,
225455,
430256,
225458,
225461,
225466,
389307,
225470,
381120,
372929,
430274,
225475,
389320,
225484,
225487,
225490,
266453,
225493,
225496,
225499,
225502,
225505,
356578,
225510,
217318,
225514,
225518,
372976,
381176,
397571,
389380,
61722,
356637,
356640,
356643,
356646,
266536,
356649,
356655,
332080,
340275,
356660,
397622,
332090,
225597,
332097,
201028,
348488,
332106,
332117,
250199,
250202,
332125,
250210,
348522,
348525,
348527,
332152,
250238,
389502,
356740,
332172,
373145,
340379,
389550,
324030,
266687,
340451,
160234,
127471,
340472,
324094,
266754,
324099,
324102,
324111,
340500,
324117,
324131,
332324,
381481,
324139,
356907,
324142,
356916,
324149,
324155,
348733,
324160,
324164,
356934,
348743,
381512,
324170,
324173,
324176,
389723,
332380,
373343,
381545,
340627,
184982,
373398,
258721,
332453,
332459,
389805,
332463,
381617,
332471,
332483,
332486,
373449,
332493,
357069,
357073,
332511,
332520,
340718,
332533,
348924,
373510,
389926,
152370,
340789,
348982,
398139,
127814,
357201,
357206,
389978,
357211,
430939,
357214,
201579,
201582,
349040,
340849,
201588,
430965,
324472,
398201,
119674,
324475,
340858,
340861,
324478,
430972,
324481,
398211,
324484,
324487,
381833,
324492,
324495,
324498,
430995,
324501,
324510,
422816,
324513,
398245,
201637,
324524,
340909,
5046,
324538,
324541,
398279,
340939,
340941,
209873,
340957,
431072,
398306,
340963,
209895,
201711,
349172,
349180,
439294,
209943,
209946,
250914,
357410,
185380,
357418,
209965,
209968,
209971,
209975,
209979,
209987,
209990,
341071,
349267,
250967,
210010,
341091,
210025,
210027,
210030,
210036,
210039,
341113,
210044,
349308,
152703,
160895,
349311,
210052,
210055,
349319,
210067,
210071,
210077,
210080,
210084,
251044,
185511,
210088,
210095,
210098,
210107,
210115,
332997,
210127,
333009,
210131,
333014,
210138,
210143,
218354,
251128,
218360,
275706,
275712,
275715,
275721,
333078,
251160,
349484,
349491,
251189,
415033,
251210,
357708,
210260,
259421,
365921,
333154,
251235,
374117,
333162,
234866,
390516,
333175,
357755,
136590,
112020,
349590,
357792,
259515,
415166,
415185,
366034,
366038,
415191,
415193,
415196,
415199,
423392,
333284,
415207,
366056,
366061,
415216,
210420,
415224,
423423,
415257,
415263,
366117,
415270,
144939,
415278,
415281,
415285,
210487,
415290,
415293,
349761,
415300,
333386,
333399,
366172,
333413,
423528,
423532,
210544,
415353,
333439,
415361,
267909,
153227,
333498,
333511,
210631,
259788,
358099,
333534,
366311,
431851,
366318,
210672,
366321,
366325,
210695,
268041,
210698,
366348,
210706,
399128,
333594,
210719,
358191,
210739,
366387,
399159,
358200,
325440,
366401,
341829,
325446,
46920,
341834,
341838,
341843,
415573,
358234,
341851,
350045,
399199,
259938,
399206,
358255,
399215,
268143,
358259,
341876,
333689,
243579,
325504,
333698,
333708,
333724,
382890,
350146,
358339,
333774,
358371,
350189,
350193,
350202,
350206,
350213,
268298,
350224,
350231,
333850,
350237,
350240,
350244,
350248,
178218,
350251,
350256,
350259,
350271,
243781,
350285,
374864,
342111,
342133,
432271,
333997,
260289,
350410,
260298,
350416,
350422,
350425,
268507,
334045,
350445,
375026,
358644,
350458,
350461,
350464,
325891,
350467,
350475,
375053,
268559,
350480,
432405,
350486,
350490,
325914,
325917,
350493,
350498,
350504,
358700,
350509,
391468,
358704,
358713,
358716,
383306,
334161,
383321,
383330,
383333,
391530,
383341,
334203,
268668,
194941,
391563,
366990,
416157,
268701,
342430,
375208,
326058,
375216,
334262,
334275,
326084,
358856,
195039,
334304,
334311,
375277,
334321,
350723,
186897,
342545,
334358,
342550,
342554,
334363,
358941,
350761,
252461,
334384,
383536,
358961,
334394,
252482,
219718,
334407,
334420,
350822,
375400,
334465,
334468,
162445,
326290,
342679,
342683,
260766,
342710,
244409,
260797,
334528,
260801,
350917,
391894,
154328,
416473,
64230,
342766,
375535,
203506,
342776,
391937,
391948,
326416,
375568,
375571,
375574,
162591,
326441,
326451,
326454,
244540,
326460,
375612,
260924,
326467,
244551,
326473,
326477,
326485,
416597,
326490,
326502,
375656,
433000,
326507,
326510,
211825,
211831,
351097,
392060,
359295,
342915,
236430,
342930,
252822,
392091,
400285,
252836,
359334,
211884,
400306,
351168,
359361,
359366,
326598,
359382,
359388,
383967,
343015,
359407,
261108,
244726,
261111,
383997,
261129,
359451,
261147,
211998,
261153,
261159,
359470,
359476,
343131,
384098,
384101,
367723,
384107,
187502,
384114,
343154,
212094,
351364,
384135,
384139,
384143,
351381,
384151,
384160,
384168,
367794,
244916,
384181,
367800,
384188,
351423,
384191,
384198,
326855,
244937,
384201,
253130,
343244,
384208,
146642,
384224,
359649,
343270,
351466,
384246,
351479,
384249,
343306,
261389,
359694,
253200,
261393,
384275,
384283,
245020,
384288,
245029,
171302,
351534,
376110,
245040,
384314,
425276,
384323,
212291,
343365,
212303,
367965,
343393,
343398,
367980,
425328,
343409,
154999,
253303,
343417,
327034,
245127,
384397,
245136,
245142,
245145,
343450,
245148,
245151,
245154,
245157,
245162,
327084,
359865,
384443,
146876,
327107,
384453,
327110,
327115,
327117,
359886,
359890,
343507,
368092,
343534,
343539,
368119,
343544,
368122,
409091,
359947,
359955,
359983,
343630,
327275,
245357,
138864,
155254,
155273,
368288,
245409,
425638,
155322,
425662,
155327,
245460,
155351,
155354,
212699,
245475,
155363,
245483,
155371,
409335,
155393,
155403,
245525,
155422,
360223,
155438,
155442,
155447,
417595,
155461,
360261,
376663,
155482,
261981,
425822,
155487,
376671,
155490,
155491,
327531,
261996,
376685,
261999,
262002,
327539,
262005,
147317,
425845,
262008,
262011,
155516,
155521,
155525,
360326,
155531,
262027,
262030,
262033,
262036,
262039,
262042,
155549,
262045,
262048,
262051,
327589,
155559,
155562,
155565,
393150,
393169,
384977,
155611,
155619,
253923,
155621,
327654,
253926,
204784,
393203,
360438,
253943,
393206,
393212,
155646
] |
44a7501441449afc7bbb668b600ed60c6708de59
|
3c5eee9be6e01f7a75ca5f592b35c13d7242b626
|
/EMPageViewController/EMPageViewControllerTests/EMPageViewControllerTests.swift
|
1ed609b3e6d0717d8d74d1adaebc2ffccff93b49
|
[
"MIT"
] |
permissive
|
lyimin/EMPageController
|
c9271b0973b6c6fe8572b42c78e216862e357783
|
bfaf64253a999b14200333accb7e93f563f8e28c
|
refs/heads/master
| 2021-04-27T06:01:05.599734 | 2018-03-02T08:03:25 | 2018-03-02T08:03:25 | 122,605,131 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,022 |
swift
|
//
// EMPageViewControllerTests.swift
// EMPageViewControllerTests
//
// Created by 梁亦明 on 2018/2/23.
// Copyright © 2018年 com.eamon. All rights reserved.
//
import XCTest
@testable import EMPageViewController
class EMPageViewControllerTests: 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.
}
}
}
|
[
313357,
98333,
278558,
229413,
292902,
102437,
354345,
223274,
229424,
282672,
180280,
288834,
286788,
311372,
223316,
315476,
278615,
307289,
309345,
227428,
278638,
299121,
233590,
131191,
223350,
237689,
292988,
131198,
278655,
292992,
227460,
311438,
278677,
284826,
299174,
153776,
184505,
295098,
227513,
299198,
282831,
301279,
311519,
286958,
184570,
227578,
184575,
276744,
309529,
282909,
299293,
278816,
282913,
233762,
280887,
315706,
287041,
287043,
139589,
280902,
227654,
305495,
168281,
321894,
416104,
280939,
313713,
199029,
291192,
227725,
240016,
190871,
242078,
61857,
285090,
61859,
289189,
278970,
293306,
291267,
278989,
281037,
326100,
285150,
279008,
279013,
311786,
291311,
281072,
309744,
279029,
233978,
291333,
279050,
283153,
303636,
291358,
180771,
277029,
293419,
244269,
283182,
283184,
23092,
234036,
289332,
338489,
70209,
115270,
70215,
293448,
377418,
281166,
285271,
111208,
295536,
287346,
287352,
189057,
152203,
117397,
230040,
289434,
221852,
205471,
279206,
295599,
303793,
289462,
166582,
285371,
285372,
285373,
285374,
287422,
303803,
66242,
287433,
154316,
289502,
279269,
234217,
342762,
230125,
289518,
279280,
228088,
279294,
299776,
205568,
242433,
285444,
322313,
310036,
166676,
262951,
289576,
312108,
285487,
262962,
230199,
293693,
295744,
295746,
281433,
230234,
295776,
279392,
293730,
349026,
303972,
308076,
295798,
209783,
209785,
226170,
177019,
291712,
287622,
308107,
56208,
308112,
293781,
283558,
310182,
236461,
293806,
189374,
289727,
19399,
279498,
326635,
203757,
304110,
277492,
295927,
312314,
277509,
230410,
277524,
140310,
230423,
293910,
281626,
189474,
300068,
238639,
312373,
203830,
238651,
277597,
230499,
281700,
322663,
300135,
281706,
207979,
312434,
279672,
285820,
285828,
279685,
285830,
302213,
228491,
296086,
238743,
187544,
283802,
296092,
302240,
330913,
300202,
279728,
238769,
294074,
228542,
302274,
279747,
283847,
283852,
189652,
298208,
310497,
298212,
290022,
234733,
298221,
279792,
302325,
228600,
234755,
130338,
130343,
277806,
298291,
277815,
286018,
113987,
304456,
230729,
177484,
222541,
296270,
277841,
277844,
314709,
277845,
357719,
134491,
294243,
230756,
281957,
277862,
163175,
314728,
277866,
277868,
230765,
306542,
296303,
181625,
277882,
277883,
306559,
306560,
277890,
179587,
148867,
294275,
298374,
277896,
142729,
277897,
296335,
234898,
306579,
277907,
224661,
318875,
310692,
277925,
282022,
310701,
277936,
286129,
277946,
292292,
306631,
296392,
300489,
302540,
310732,
312782,
222675,
277974,
277977,
228827,
280032,
277988,
280041,
277997,
282096,
296433,
278002,
280055,
300536,
290300,
290301,
296448,
230913,
306692,
296461,
282141,
306723,
288309,
290358,
280130,
288326,
288327,
282183,
292425,
290390,
128599,
235095,
300630,
306776,
300644,
310889,
222832,
314998,
294529,
288392,
290443,
310923,
323217,
239250,
298654,
282271,
282273,
302754,
282276,
229029,
282280,
286391,
306874,
280251,
286399,
282303,
212688,
280278,
286423,
282327,
278233,
278234,
67292,
294622,
278240,
288491,
280300,
239341,
284401,
282355,
323316,
282358,
313081,
229113,
286459,
194303,
67332,
288516,
216839,
280327,
282378,
321295,
282391,
282400,
313120,
282409,
284459,
282417,
200498,
296755,
345919,
280390,
282438,
280410,
300894,
237408,
296806,
282474,
288619,
288620,
280430,
313203,
300918,
194429,
67463,
110480,
282518,
282519,
294809,
298909,
311199,
292771,
298920,
284587,
292782,
290746,
294843,
214977,
280514,
163781,
344013,
301008,
294886,
296941,
311282,
292858,
290811
] |
19639c226ae62533bc95e2d8c369d7c7a6b2201b
|
1503064e5639d0a7e7852a27e279e93a2362e183
|
/Structs-and-Classes/Structs-and-Classes/enums/Gender.swift
|
cb44648dab2de90084d6ab05fd19f0d36a548b2e
|
[] |
no_license
|
joinpursuit/Pursuit-Core-iOS-Structs-and-Classes
|
73ef5627bf00a887954e7b1b9abb8f477747fc6c
|
ed7993198b3af7e6041f7b81c08cf1e71703ebe1
|
refs/heads/master
| 2020-04-03T00:34:52.876990 | 2018-10-30T20:56:47 | 2018-10-30T20:56:47 | 154,902,984 | 0 | 4 | null | null | null | null |
UTF-8
|
Swift
| false | false | 204 |
swift
|
//
// Gender.swift
// Structs-and-Classes
//
// Created by Alex Paul on 10/29/18.
// Copyright © 2018 Alex Paul. All rights reserved.
//
import Foundation
enum Gender {
case male
case female
}
|
[
-1
] |
34087c520d7155190bf420d0d0054b8641d8c669
|
56336cecf545990bc458ddb0c1185863ee09e973
|
/destini-story/destini-story/ViewController.swift
|
54c9394cc51b3db15e499e93d6c3c4e2da8d81d1
|
[] |
no_license
|
loredana96/destinistory
|
9feb24a205d6024d9dd6a7091a3b9ba231ff29fd
|
abd0e64750a4f9de8d9a81e705a0adc8f26470c4
|
refs/heads/master
| 2020-07-02T09:18:31.996112 | 2019-08-14T12:09:23 | 2019-08-14T12:09:23 | 201,484,036 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 4,177 |
swift
|
//
// ViewController.swift
// destini-story
//
// Created by Loredana Todoran on 09/08/2019.
// Copyright © 2019 Loredana Todoran. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
let story1 : String = "Story 1: 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 and soulless eyes opens the passenger door for you and says: \"Need a ride, boy?\"."
let answer1a : String = "I'll hop in. Thanks for the help!"
let answer1b : String = "Well, I don't have many options. Better ask him if he's a murderer."
let story2 : String = " Story 2: He nods slowly, unphased by the question."
let answer2a : String = "At least he's honest. I'll climb in."
let answer2b : String = "Wait, I know how to change a tire."
let story3 : String = "Story 3:......fingers, and a cassette tape of Elton John. He reaches for the glove box."
let answer3a : String = "I love Elton John! Hand him the cassette tape."
let answer3b : String = "It’s him or me. Take the knife and stab him."
let story4 : String = " Story 4: What? Such a cop out! Did you know accidental traffic accidents are the second leading cause of accidental death for most adult age groups?"
let story5 : String = " Story 5: 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 story6 : String = " Story 6: 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.\" "
var storyindex : Int = 1
@IBOutlet weak var textStoryLabel: UILabel!
@IBOutlet weak var topButton: UIButton!
@IBOutlet weak var bottomButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
textStoryLabel.text = story1
topButton.setTitle(answer1a, for: .normal)
bottomButton.setTitle(answer1b, for: .normal)
}
@IBAction func buttonPressed(_ sender: UIButton) {
if sender.tag == 1 && storyindex == 1{
textStoryLabel.text = story3
topButton.setTitle(answer3a, for: .normal)
bottomButton.setTitle(answer3b, for: .normal)
storyindex = 3
}
else if sender.tag == 2 && storyindex == 1 {
textStoryLabel.text = story2
topButton.setTitle(answer2a, for: .normal)
bottomButton.setTitle(answer2b, for: .normal)
storyindex = 2
}
else if sender.tag == 1 && storyindex == 3 {
textStoryLabel.text = story6
topButton.isHidden = true
bottomButton.isHidden = true
storyindex = 6
}
else if sender.tag == 1 && storyindex == 2 {
textStoryLabel.text = story3
topButton.setTitle(answer3a, for: .normal)
bottomButton.setTitle(answer3b, for: .normal)
storyindex = 3
}
else if sender.tag == 1 && storyindex == 3 {
textStoryLabel.text = story6
topButton.isHidden = true
bottomButton.isHidden = true
storyindex = 6
}
else if sender.tag == 2 && storyindex == 3 {
textStoryLabel.text = story5
bottomButton.isHidden = true
topButton.isHidden = true
storyindex = 5
}
else if sender.tag == 2 && storyindex == 2 {
textStoryLabel.text = story4
bottomButton.isHidden = true
topButton.isHidden = true
storyindex = 4
}
}
@IBAction func restartButton(_ sender: Any) {
restart()
}
func restart() {
textStoryLabel.text = story1
topButton.setTitle(answer1a, for: .normal)
bottomButton.setTitle(answer1b, for: .normal)
storyindex = 1
topButton.isHidden = false
bottomButton.isHidden = false
}
}
|
[
-1
] |
39607c761c23fd21f74e50b10ef86bb7c1f4b05a
|
a498ef33c890e5466a36c1d002abc788290a347f
|
/CountryPickerView/NibView.swift
|
a52cb3608adca394f2a375a6f7ed3ea60ce60834
|
[
"MIT"
] |
permissive
|
subhajitregor/CountryPickerView
|
cb49e67fc455e53a792b256b35a2e78d61967aa1
|
9a489b5c3870035cd20b07a9b366aef934dc5dae
|
refs/heads/master
| 2020-03-21T00:04:48.908832 | 2018-06-19T10:59:15 | 2018-06-19T10:59:15 | 137,876,610 | 1 | 0 |
MIT
| 2018-06-19T10:59:16 | 2018-06-19T10:30:01 |
Swift
|
UTF-8
|
Swift
| false | false | 978 |
swift
|
//
// NibView.swift
// CountryPickerView
//
// Created by Kizito Nwose on 22/09/2017.
// Copyright © 2017 Kizito Nwose. All rights reserved.
//
import UIKit
public class NibView: UIView {
weak var view: UIView!
override public init(frame: CGRect) {
super.init(frame: frame)
nibSetup()
}
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
nibSetup()
}
fileprivate func nibSetup() {
view = loadViewFromNib()
view.frame = bounds
view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
addSubview(view)
}
fileprivate func loadViewFromNib() -> UIView {
let bundle = Bundle(for: type(of: self))
let nib = UINib(nibName: String(describing: type(of: self)), bundle: bundle)
let nibView = nib.instantiate(withOwner: self, options: nil).first as! UIView
return nibView
}
}
|
[
-1
] |
870dfe51882baf36fa6f000c3ce25e2415e75e7f
|
413943b58133afea2f2979adb8039fb7126b1dd0
|
/Babylonian/Babylonian/SetCourseTitle.swift
|
47d59dc89da49c1ca4192659cd4f56f5ca7ae487
|
[] |
no_license
|
BabylonianTeam/Babylonians
|
a7ae67736b9bf79e5ccab32a8730af0c910b28d3
|
fa172b0335e639b7aea7f2b882595ff71ad8f7d6
|
refs/heads/master
| 2021-01-17T07:10:14.407937 | 2016-05-31T06:14:06 | 2016-05-31T06:14:06 | 53,280,817 | 1 | 1 | null | 2016-05-03T17:41:11 | 2016-03-06T23:00:40 |
Objective-C
|
UTF-8
|
Swift
| false | false | 815 |
swift
|
//
// SetCourseTitle.swift
// Babylonian
//
// Created by Dongning Wang on 4/19/16.
// Copyright © 2016 BabylonianTeam. All rights reserved.
//
import UIKit
class SetCourseTitle: UITableViewCell, UITextFieldDelegate {
var currentCourse:BBCourse!
@IBOutlet weak var title: UITextField!
override func awakeFromNib() {
super.awakeFromNib()
title.delegate = self
// Initialization code
}
// func textFieldShouldReturn(textField: UITextField) -> Bool {
// currentCourse.setTitle(title.text!)
// textField.resignFirstResponder()
// return true
// }
override func setSelected(selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
|
[
-1
] |
ebcf4fc2aa1b278a92d5b3d6623178d15a0b6e14
|
2e19ad25e939419292a2866d7f06ce30b21b1edc
|
/MemeMe/MemeDetailViewController.swift
|
5b6170202bc753f0eaf43b21f9ffbfda255c8a29
|
[] |
no_license
|
ocedeno/MemeMe
|
68613bde0ec32bf9d48717ac54891ea257637d62
|
bdfae86276b7e275bc5b4a7901419d158ddefa82
|
refs/heads/master
| 2021-01-10T22:29:17.602966 | 2017-03-15T11:28:13 | 2017-03-15T11:28:13 | 41,250,870 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,267 |
swift
|
//
// MemeDetailViewController.swift
// MemeMe
//
// Created by Programming on 9/3/15.
// Copyright (c) 2015 Cedeno Enterprise, Inc. All rights reserved.
//
import UIKit
class MemeDetailViewController: UIViewController {
@IBOutlet weak var memeViewImage: UIImageView!
var rowSelected: Int?
var appDel: AppDelegate {
return (UIApplication.shared.delegate as! AppDelegate)
}
var image: UIImage!
override func viewDidLoad() {
super.viewDidLoad()
memeViewImage.image = image
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.tabBarController?.tabBar.isHidden = true
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.tabBarController?.tabBar.isHidden = false
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if (segue.identifier == "editMemeVC"){
let data = sender as? UIImage
let editMeme = segue.destination as! MemeEditorViewController
editMeme.memedImage = data
}
}
@IBAction func returnToMemeEditor(_ sender: UIBarButtonItem) {
let meme = appDel.memes[rowSelected!]
performSegue(withIdentifier: "editMemeVC", sender: meme.image)
}
@IBAction func deleteMeme(_ sender: UIBarButtonItem) {
let deleteAlert = UIAlertController(title: "Delete Meme?", message: "Are you sure you want to delete this Meme?", preferredStyle: .alert)
let cancelAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.cancel, handler: {(action) in
self.dismiss(animated: true, completion: nil)
})
deleteAlert.addAction(cancelAction)
let OkAction = UIAlertAction(title: "Delete", style: .default, handler: {(action) in
let meme = self.appDel.memes[self.rowSelected!]
self.appDel.memes.remove(at: self.rowSelected!)
self.navigationController?.popToRootViewController(animated: true)
})
deleteAlert.addAction(OkAction)
present(deleteAlert, animated: true, completion: nil)
}
}
|
[
-1
] |
5d687f507ec289022469d6813a081ff04f48b6bf
|
9849623ab2729c5c455c7ff442111561be6a233a
|
/EthereumKitDemo/EthereumKitDemo/Core/Manager.swift
|
47e04939ed8f18fe9bb5d3f8c5b3150a54f789e6
|
[
"MIT"
] |
permissive
|
5daytech/ethereum-kit-ios
|
fda7214e94836a0f96afcb0c3f12f177ed274cfa
|
4f7a56a3f72c6af351eab35e7e0b6192614d444b
|
refs/heads/master
| 2020-05-29T21:23:59.001007 | 2019-05-29T05:52:10 | 2019-05-29T05:52:10 | 189,378,831 | 0 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,344 |
swift
|
import RxSwift
import EthereumKit
import Erc20Kit
import HSHDWalletKit
class Manager {
static let shared = Manager()
private let keyWords = "mnemonic_words"
var ethereumKit: EthereumKit!
var ethereumAdapter: EthereumAdapter!
var erc20Adapters = [Erc20Adapter]()
init() {
if let words = savedWords {
initEthereumKit(words: words)
}
}
func login(words: [String]) {
try! EthereumKit.clear()
try! Erc20Kit.clear()
save(words: words)
initEthereumKit(words: words)
}
func logout() {
clearWords()
ethereumKit = nil
ethereumAdapter = nil
erc20Adapters = []
}
private func initEthereumKit(words: [String]) {
let configuration = Configuration.shared
let syncMode: EthereumKit.WordsSyncMode
switch configuration.syncMode {
case .api: syncMode = .api
case .spv: syncMode = .spv
case .geth: syncMode = .geth
}
let ethereumKit = try! EthereumKit.instance(
words: words,
syncMode: syncMode,
networkType: configuration.networkType,
infuraCredentials: configuration.infuraCredentials,
etherscanApiKey: configuration.etherscanApiKey,
minLogLevel: configuration.minLogLevel
)
ethereumAdapter = EthereumAdapter(ethereumKit: ethereumKit)
for token in configuration.erc20Tokens {
let adapter = Erc20Adapter(ethereumKit: ethereumKit, name: token.name, coin: token.coin, contractAddress: token.contractAddress, decimal: token.decimal)
erc20Adapters.append(adapter)
}
self.ethereumKit = ethereumKit
ethereumKit.start()
}
private var savedWords: [String]? {
if let wordsString = UserDefaults.standard.value(forKey: keyWords) as? String {
return wordsString.split(separator: " ").map(String.init)
}
return nil
}
private func save(words: [String]) {
UserDefaults.standard.set(words.joined(separator: " "), forKey: keyWords)
UserDefaults.standard.synchronize()
}
private func clearWords() {
UserDefaults.standard.removeObject(forKey: keyWords)
UserDefaults.standard.synchronize()
}
}
|
[
-1
] |
0b1aece944be72a1576d22aaa4059a9547a6c9fc
|
f89ced0552001f1926a8f181b82b697f8dd20e4e
|
/Swift进阶/内建集合-Set.playground/Contents.swift
|
d2ff6ec03f4c83bf09fafa1a8618a23cdd5594ce
|
[
"MIT"
] |
permissive
|
SwifterCat/StudyFlow
|
6a15748695d27b8abdddc46eb2ebe10ef60da18d
|
fd9463b49f45b2b5e6096ef38cfea645a0bef62b
|
refs/heads/master
| 2023-06-27T01:56:56.892031 | 2021-06-27T03:11:19 | 2021-06-27T03:14:29 | 217,482,006 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,334 |
swift
|
import UIKit
var str = "Hello, playground"
let naturals: Set = [1, 2, 3, 2]
naturals // [2, 3, 1]
naturals.contains(3) // true
naturals.contains(0) // false
/**
集合代数
集合 Set 和数学概念上的集合有着紧密关系;Set 也支持你在高中数学中学到的那
些基本集合操作。
*/
let iPods: Set = ["iPod touch", "iPod nano", "iPod mini", "iPod shuffe", "iPod Classic"]
let discontinuedIPods: Set = ["iPod mini", "iPod Classic", "iPod nano", "iPod shuffe"]
//补集
let currentIPods = iPods.subtracting(discontinuedIPods)
//交集
let touchscreen: Set = ["iPhone", "iPad", "iPod touch", "iPod nano"]
let iPodsWithTouch = iPods.intersection(touchscreen)
//并集
var discontinued: Set = ["iBook", "Powerbook", "Power Mac"]
discontinued.formUnion(discontinuedIPods)
var indices = IndexSet()
indices.insert(integersIn: 1..<5)
indices.insert(integersIn: 11..<15)
let evenIndices = indices.filter {$0 % 2 == 0 }
evenIndices
extension Sequence where Element:Hashable {
func unique() -> [Element] {
var seen: Set<Element> = []
return filter {
if seen.contains($0) {
return false
} else {
seen.insert($0)
return true
}
}
}
}
[1,2,3,12,1,3,4,5,6,4,6].unique() // [1, 2, 3, 12, 4, 5, 6]
|
[
-1
] |
72e7c61ffbf56b7a347f4a5f21822ced5920cd3d
|
d287bee14db47806ad7da3bb23fb0cb465d54362
|
/BowGame/DataCenter.swift
|
8648d8448e4ad517289a3873073c23cd394105b9
|
[] |
no_license
|
papanton/BowGame
|
dcfcc888eee6d025b423496d2444a70515a7fc1e
|
3fe1ff04d46422dd87e89ee812e86aae9dd8578d
|
refs/heads/master
| 2021-01-21T04:41:45.327685 | 2016-07-14T08:55:59 | 2016-07-14T08:55:59 | 42,066,193 | 0 | 3 | null | 2015-12-16T00:36:30 | 2015-09-07T17:32:27 |
Swift
|
UTF-8
|
Swift
| false | false | 2,928 |
swift
|
//
// DataCenter.swift
// BowGame
//
// Created by ZhangYu on 10/1/15.
// Copyright (c) 2015 Antonis papantoniou. All rights reserved.
//
import UIKit
import CoreData
class DataCenter: NSObject
{
var managedContext: NSManagedObjectContext!
//private var mArrowItem : ArrowItem!
private var mCurrentItem : CurrentItem!
private static var mInstance : DataCenter!
static func getInstance() ->DataCenter
{
if mInstance == nil{
mInstance = DataCenter()
mInstance.managedContext = (UIApplication.sharedApplication().delegate as! AppDelegate).managedObjectContext!
}
return mInstance!
}
/*func setArrowItemDamage(damage : Int)
{
initCurrentItem()
mArrowItem.name = "arrow"
mArrowItem.damage = damage
var error: NSError?
if !managedContext.save(&error) {
println("Could not save \(error), \(error?.userInfo)")
}else{
println("save successfully! \(mArrowItem.damage)")
}
}*/
private func setCurrentArrow(name : String)
{
initCurrentItem()
mCurrentItem.arrowname = name
var error: NSError?
do {
try managedContext.save()
print("save successfully! \(mCurrentItem.arrowname)")
} catch let error1 as NSError {
error = error1
print("Could not save \(error), \(error?.userInfo)")
}
}
func setArrowItemByName(name : String)
{
if ArrowColletion.getInstance().mArrowName.contains(name){
setCurrentArrow(name)
}
}
func setArrowItemByIndex(index : Int)
{
setCurrentArrow(ArrowColletion.getInstance().mArrowName[index])
}
private func initCurrentItem()
{
let fetchRequest = NSFetchRequest(entityName:"CurrentItem")
//let predicate = NSPredicate(format: "arrowname = %@", "arrow")
fetchRequest.returnsObjectsAsFaults = false;
let fetchedResults:[CurrentItem]!
//fetchRequest.predicate = predicate
do {
try fetchedResults = managedContext.executeFetchRequest(fetchRequest) as? [CurrentItem]
} catch let error as NSError {
print("Error: \(error.localizedDescription)")
abort()
}
print("initArrowItem")
let res = fetchedResults
if res != nil && res!.count > 0 {
mCurrentItem = res![0]
print("fetched \(mCurrentItem.arrowname)")
} else {
mCurrentItem = CurrentItem.getDefault()
print("Get Default Arrow")
}
}
func getArrowItem()->ArrowItem
{
if(mCurrentItem == nil){
initCurrentItem()
}
//println("mArrowItem damage = \(mArrowItem.name) \(mArrowItem.damage)")
return ArrowColletion.getInstance().mCollectionMap[mCurrentItem.arrowname]!
}
}
|
[
-1
] |
cd96ab5054fee6328038c652486b7d51f2113c64
|
4c65bd6f03e7577b2796b4ba4689693720931de9
|
/MyPlayground.playground/Pages/Reactive Cocoa2.xcplaygroundpage/Contents.swift
|
655387e8d029b9f6cb5be2cba8695a61f677932a
|
[] |
no_license
|
itsshahidsk/ReactiveConcepts
|
2af9369d5fac22a6bed7c74a169608e3263161c7
|
72316321e43d1148c10fbaf5b93afe5acf384748
|
refs/heads/master
| 2021-01-01T05:08:23.682197 | 2016-06-04T16:05:28 | 2016-06-04T16:05:28 | 56,006,760 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,413 |
swift
|
//: [Previous](@previous)
import Foundation
import ReactiveCocoa
import Result
//Flatten in reactive cocoa
////******** Merge *********///
//
//let (producerA,lettersObserver) = SignalProducer<String,NoError>.buffer(5)
//let (producerB,numbersObserver) = SignalProducer<String,NoError>.buffer(5)
//
//let (signal,observer) = SignalProducer<SignalProducer<String,NoError>,NoError>.buffer(5)
//signal.flatten(.Merge).startWithNext { (next) in
// print(next)
//}
//
//observer.sendNext(producerA)
//observer.sendNext(producerB)
//observer.sendCompleted()
//
//lettersObserver.sendNext("a") // prints "a"
//numbersObserver.sendNext("1") // prints "1"
//lettersObserver.sendNext("b") // prints "b"
//numbersObserver.sendNext("2") // prints "2"
//lettersObserver.sendNext("c") // prints "c"
//numbersObserver.sendNext("3")
//numbersObserver.sendNext("6")
//Concat Strategy doesnot send signals until one of them is complete
let (numbersSignal,numbersObserver) = SignalProducer<String,NoError>.buffer(5)
let (letterSignal,lettersObserver) = SignalProducer<String,NoError>.buffer(7)
/*
let (concatSignal,concatObserver) = SignalProducer<SignalProducer<String,NoError>,NoError>.buffer(5)
concatSignal.flatten(.Concat).startWithNext { (next) in
print(next)
}
concatObserver.sendNext(numbersSignal)
concatObserver.sendNext(letterSignal)
concatObserver.sendCompleted()
numbersObserver.sendNext("1")
lettersObserver.sendNext("A")
lettersObserver.sendNext("B")
lettersObserver.sendNext("C")
lettersObserver.sendNext("D")
lettersObserver.sendNext("E")
lettersObserver.sendNext("F")
lettersObserver.sendNext("G")
numbersObserver.sendNext("2")
numbersObserver.sendCompleted() */
//******** Latest Signal *******//
//Latest sends signals of the latest signal it is observing right now -
let (latestSignal,latestObserver) = SignalProducer<SignalProducer<String,NoError>,NoError>.buffer(5)
//latestSignal.flatMap(.Latest) { (newSignal) -> Signal<String, NoError> in
// return newSignal
//}
//latestSignal.flatMap(.Latest, transform: )
//latestSignal.flatten(.Latest).startWithNext { (next) in
// print(next)
//}
//
//latestObserver.sendNext(numbersSignal)
//latestObserver.sendNext(letterSignal)
//numbersObserver.sendNext("1")
//lettersObserver.sendNext("A")
//NOTE:
/*
Flat map is used to flatten the innersignal to give out its result rather than subscribing it to it again
*/
|
[
-1
] |
79181fbdfe54e7756f2e73378884fa8c16ee0c02
|
a6fcfc76515438e3f11c3d1268d67daa70fc907f
|
/DouYuZB/DouYuZB/Classs/Main/Controller/CustomNavigationController.swift
|
ad981de056dba6e01525914fdf78c545ec327862
|
[
"MIT"
] |
permissive
|
songgangqiang0619/DouYuZB
|
8ce901a6801c16eb917806b11939accd5e49b78f
|
ded31ab295d5a0e0e9d9c9d7e08ea7a04d52e059
|
refs/heads/master
| 2021-06-15T04:52:10.176208 | 2016-12-26T14:12:32 | 2016-12-26T14:12:32 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,724 |
swift
|
//
// CustomNavigationController.swift
// DouYuZB
//
// Created by HCL黄 on 2016/12/25.
// Copyright © 2016年 HCL黄. All rights reserved.
//
import UIKit
class CustomNavigationController: UINavigationController {
override func viewDidLoad() {
super.viewDidLoad()
// 1.获取系统的pop手势
guard let systemGes = interactivePopGestureRecognizer else {return}
// 2.获取手势添加到的view中
guard let gesView = systemGes.view else { return }
// 3.获取target/action
// 3.1利用运行时机制查看所有的属性名称
// var count : UInt32 = 0
// let ivars = class_copyIvarList(UIGestureRecognizer.self, &count)!
// for i in 0..<count {
// let ivar = ivars[Int(i)]
// let name = ivar_getName(ivar)
// print(String(cString: name!))
// }
let targets = systemGes.value(forKey: "_targets") as? [NSObject]
guard let targetObjc = targets?.first else { return }
// 3.2 取出target
guard let target = targetObjc.value(forKey: "target") else { return}
// 3.3 取出Action
let action = Selector(("handleNavigationTransition:"))
// 4 创建自己的pan手势
let panGes = UIPanGestureRecognizer()
gesView.addGestureRecognizer(panGes)
panGes.addTarget(target, action: action)
}
override func pushViewController(_ viewController: UIViewController, animated: Bool) {
// 隐藏要push的控制器的tabbar
viewController.hidesBottomBarWhenPushed = true
super.pushViewController(viewController, animated: animated)
}
}
|
[
-1
] |
3fd7709069c593705586ad8480bb2875cb430b76
|
0cbc122fbc75d1c60fbba3836464930ed86dd754
|
/FerryPortChallenge/Vehicles/Car.swift
|
33b51521157f0f932f62195468ce383eaa6cef1a
|
[] |
no_license
|
adamqure/FerryPort
|
f0a5ce77ecda815f673f44b125ba1422d3be30d0
|
592df58a9ff941f253b6def58f26293522c9cd62
|
refs/heads/main
| 2023-08-26T03:11:20.790449 | 2021-11-11T19:41:47 | 2021-11-11T19:41:47 | 427,121,101 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 415 |
swift
|
//
// Car.swift
// FerryPort
//
// Created by Adam Ure on 11/10/21.
//
import Foundation
class Car: SmallVehicle {
private var gasLevel: Double
init(gasLevel: Double) {
self.gasLevel = gasLevel
}
func getTicketPrice() -> Int {
return 3
}
func getGasLevel() -> Double {
return gasLevel
}
func fillGasTank() {
NSLog("")
}
}
|
[
-1
] |
314098934a00020572636793c6036b297325a489
|
8876ef49e4b35f3482c9ea4a4d6276d77e6a61e7
|
/FoodTracker/MealTableViewController.swift
|
6dfa5b279d6b20043f833e2629b101361b08c8af
|
[] |
no_license
|
carmen-c/FoodTracker
|
4e124a768f0c90c00bc7ffd0464851173d0a30fa
|
135d99df2847aabd30804d9a2ea41da65ae666ed
|
refs/heads/master
| 2021-06-06T12:46:48.857865 | 2016-12-05T04:29:51 | 2016-12-05T04:29:51 | 75,588,756 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 4,897 |
swift
|
//
// MealTableViewController.swift
// FoodTracker
//
// Created by carmen cheng on 2016-12-02.
// Copyright © 2016 carmen cheng. All rights reserved.
//
import UIKit
class MealTableViewController: UITableViewController {
//MARK: Properties
var meals = [Meal]()
override func viewDidLoad() {
super.viewDidLoad()
navigationItem.leftBarButtonItem = editButtonItem
if let savedMeals = loadMeals() {
meals += savedMeals
}else{
loadSampleMeals()
}
}
func loadSampleMeals() {
let photo1 = UIImage(named: "sample1")
let meal1 = Meal(name: "food", photo: photo1, rating: 3)
let photo2 = UIImage(named: "sample2")
let meal2 = Meal(name: "food2", photo: photo2, rating: 5)
let photo3 = UIImage(named: "sample3")
let meal3 = Meal(name: "food3", photo: photo3, rating: 2)
meals += [meal1!, meal2!, meal3!]
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - Table view data source
override func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return meals.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cellIdentifier = "MealTableViewCell"
let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) as! MealTableViewCell
let meal = meals[indexPath.row]
cell.nameLabel.text = meal.name
cell.photoImageView.image = meal.photo
cell.ratingControl.rating = meal.rating
return cell
}
// Override to support conditional editing of the table view.
override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the specified item to be editable.
return true
}
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
meals.remove(at: indexPath.row)
saveMeals()
tableView.deleteRows(at: [indexPath], with: .fade)
} else if editingStyle == .insert {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
/*
// Override to support rearranging the table view.
override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) {
}
*/
/*
// Override to support conditional rearranging of the table view.
override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the item to be re-orderable.
return true
}
*/
// MARK: - Navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "ShowDetail"{
let mealDetailViewController = segue.destination as! MealViewController
if let selectedMealCell = sender as? MealTableViewCell {
let indexPath = tableView.indexPath(for: selectedMealCell)!
let selectedMeal = meals[indexPath.row]
mealDetailViewController.meal = selectedMeal
}
}
else if segue.identifier == "AddItem"{
print ("Adding new meal.")
}
}
@IBAction func unwindToMealList(sender: UIStoryboardSegue) {
if let sourceViewController = sender.source as? MealViewController, let meal = sourceViewController.meal {
if let selectedIndexPath = tableView.indexPathForSelectedRow {
meals[selectedIndexPath.row] = meal
tableView.reloadRows(at: [selectedIndexPath], with: .none)
}else{
let newIndexPath = NSIndexPath(row: meals.count, section: 0)
meals.append(meal)
tableView.insertRows(at: [newIndexPath as IndexPath], with: .bottom)
}
saveMeals()
}
}
//MARK: NSCoding
func saveMeals(){
let isSuccessfulSave = NSKeyedArchiver.archiveRootObject(meals, toFile: Meal.ArchiveURL.path)
if !isSuccessfulSave {
print("Failed to save meals...")
}
}
func loadMeals() -> [Meal]? {
return NSKeyedUnarchiver.unarchiveObject(withFile: Meal.ArchiveURL.path) as? [Meal]
}
}
|
[
-1
] |
0b96d11c217aa858958ed2cacde48508381b4451
|
a6e36e59d3a2f71ac4843f33b46fa048f82c3fb0
|
/CoreImageExtensionsTests/Source/PerspectiveTransformWithExtentTests.swift
|
64b15cbf28b6ba1c2fb383c8e359bf13cc3c43e5
|
[
"BSD-2-Clause-Views"
] |
permissive
|
pixelrevision/CoreImageExtensions
|
28c3625e8111db21b23178f2e0723f1b067e50ef
|
8f66f2bbff5ca82126d12ccc3972e1e53e84134d
|
refs/heads/master
| 2021-01-20T20:38:47.671217 | 2016-07-29T00:47:30 | 2016-07-29T00:47:30 | 64,424,464 | 8 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,518 |
swift
|
import XCTest
class PerspectiveTransformWithExtentTests: XCTestCase {
func testDataStructure() {
let dataStructure = PerspectiveTransformWithExtent(topRight: CIVector(values: [646.0, 507.0], count: 2), image: CIImage(name: "sample_image_1", classForBundle: self.dynamicType)!, bottomRight: CIVector(values: [548.0, 140.0], count: 2), topLeft: CIVector(values: [118.0, 484.0], count: 2), bottomLeft: CIVector(values: [155.0, 153.0], count: 2), extent: CIVector(values: [0.0, 0.0, 300.0, 300.0], count: 4))
XCTAssertNotNil(dataStructure.filter())
let compareFilter = CIFilter(name: "CIPerspectiveTransformWithExtent")
XCTAssertEqual(dataStructure.topRight, compareFilter?.valueForKey("inputTopRight") as? CIVector)
XCTAssertEqual(dataStructure.bottomRight, compareFilter?.valueForKey("inputBottomRight") as? CIVector)
XCTAssertEqual(dataStructure.topLeft, compareFilter?.valueForKey("inputTopLeft") as? CIVector)
XCTAssertEqual(dataStructure.bottomLeft, compareFilter?.valueForKey("inputBottomLeft") as? CIVector)
XCTAssertEqual(dataStructure.extent, compareFilter?.valueForKey("inputExtent") as? CIVector)
let generatedFilter = dataStructure.filter()
XCTAssertEqual(generatedFilter?.valueForKey("inputTopRight") as? CIVector, compareFilter?.valueForKey("inputTopRight") as? CIVector)
XCTAssertEqual(generatedFilter?.valueForKey("inputBottomRight") as? CIVector, compareFilter?.valueForKey("inputBottomRight") as? CIVector)
XCTAssertEqual(generatedFilter?.valueForKey("inputTopLeft") as? CIVector, compareFilter?.valueForKey("inputTopLeft") as? CIVector)
XCTAssertEqual(generatedFilter?.valueForKey("inputBottomLeft") as? CIVector, compareFilter?.valueForKey("inputBottomLeft") as? CIVector)
XCTAssertEqual(generatedFilter?.valueForKey("inputExtent") as? CIVector, compareFilter?.valueForKey("inputExtent") as? CIVector)
let imageCompareResults = AssertFilterEqualityForImages(dataStructure.filter(), filter2: compareFilter, classForBundle: self.dynamicType)
XCTAssert(imageCompareResults.passes, imageCompareResults.message)
}
func testImagefilter() {
let newImage = CIImage(name: "sample_image_1", classForBundle: self.dynamicType)?.perspectiveTransformWithExtentFilter(CIVector(values: [646.0, 507.0], count: 2), bottomRight: CIVector(values: [548.0, 140.0], count: 2), topLeft: CIVector(values: [118.0, 484.0], count: 2), bottomLeft: CIVector(values: [155.0, 153.0], count: 2), extent: CIVector(values: [0.0, 0.0, 300.0, 300.0], count: 4))
XCTAssertNotNil(newImage)
}
}
|
[
-1
] |
56b8d912d36bbdd8d3c2f7d5044b293bf4d1cbad
|
e78933b71233183cde2650ef64924f6b4a9402a4
|
/Sources/MapboxMaps/Ornaments/OrnamentOptions.swift
|
175c9dae6be99015c2cd5d87e6395ffdf833c600
|
[
"ISC",
"BSL-1.0",
"BSD-2-Clause",
"MIT",
"LicenseRef-scancode-object-form-exception-to-mit",
"BSD-3-Clause",
"Zlib"
] |
permissive
|
patrickkempff/mapbox-maps-ios
|
3a5782eeb004ed28d5657e8fa17e94f8f2843210
|
b232b26e2ad4ffd0afeab4367628173f69aca0a9
|
refs/heads/main
| 2023-04-14T19:35:55.839196 | 2021-04-28T21:40:22 | 2021-04-28T21:40:22 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,866 |
swift
|
import UIKit
private let defaultOrnamentsMargin = CGPoint(x: 8.0, y: 8.0)
/// Used to configure Ornament-specific capabilities of the map
public struct OrnamentOptions: Equatable {
// MARK: - Scale Bar
public var scaleBarPosition: OrnamentPosition = .topLeft
public var scaleBarMargins: CGPoint = defaultOrnamentsMargin
public var scaleBarVisibility: OrnamentVisibility = .adaptive
// MARK: - Compass
public var compassViewPosition: OrnamentPosition = .topRight
public var compassViewMargins: CGPoint = defaultOrnamentsMargin
public var compassVisibility: OrnamentVisibility = .adaptive
// MARK: - Logo View
/**
Per our terms of service, a Mapbox map is required to display both
a Mapbox logo as well as an information icon that contains attribution
information. See https://docs.mapbox.com/help/how-mapbox-works/attribution/
for details.
*/
public var _logoViewIsVisible: Bool = true
public var logoViewPosition: OrnamentPosition = .bottomLeft
public var logoViewMargins: CGPoint = defaultOrnamentsMargin
// MARK: - Attribution Button
public var _attributionButtonIsVisible: Bool = true
public var attributionButtonPosition: OrnamentPosition = .bottomRight
public var attributionButtonMargins: CGPoint = defaultOrnamentsMargin
// MARK: - Validation
/// `true` if there is at most one non-hidden ornament in each position; `false` otherwise.
internal var isValid: Bool {
let positions = [
scaleBarVisibility != .hidden ? scaleBarPosition : nil,
compassVisibility != .hidden ? compassViewPosition : nil,
_logoViewIsVisible ? logoViewPosition : nil,
_attributionButtonIsVisible ? attributionButtonPosition : nil].compactMap { $0 }
return Set(positions).count == positions.count
}
}
|
[
-1
] |
04a78bfce40adbfecb6ce9e380a2654064f97c30
|
3cfa0ceee4ca4460d427a91764d6839e164ffea5
|
/AppleScavengerHunt/AppDelegate.swift
|
cab5e4e869392d7e3c08d772e428f72cc0797c09
|
[] |
no_license
|
littlejohntj/AppleScavengerHunt
|
17c87211fb847dff55b509acfe15312a3345519b
|
3452ce85b093716d3ad7edb5dd8a8814c51422a6
|
refs/heads/master
| 2021-01-10T08:12:07.382521 | 2016-02-05T05:23:42 | 2016-02-05T05:23:42 | 51,127,738 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,160 |
swift
|
//
// AppDelegate.swift
// AppleScavengerHunt
//
// Created by Todd Littlejohn on 2/4/16.
// Copyright © 2016 Todd Littlejohn. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
|
[
229380,
229383,
229385,
278539,
229388,
294924,
278542,
229391,
327695,
278545,
229394,
278548,
229397,
229399,
229402,
278556,
229405,
352284,
278559,
229408,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
229426,
237618,
229428,
286774,
229432,
286776,
286778,
319544,
204856,
286791,
237640,
278605,
286797,
311375,
237646,
163920,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
278648,
131192,
237693,
327814,
131209,
417930,
303241,
311436,
303244,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
278760,
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,
287032,
155966,
278849,
319809,
319810,
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,
287238,
172550,
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,
279124,
172634,
262752,
172644,
311911,
189034,
295533,
189039,
189040,
172655,
172656,
295538,
189044,
172660,
287349,
352880,
287355,
287360,
295553,
287365,
311942,
303751,
295557,
352905,
279178,
287371,
311946,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
164509,
287390,
295583,
303773,
172702,
287394,
230045,
303780,
172705,
287398,
172707,
287400,
279208,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
279231,
287423,
328384,
287427,
312006,
107208,
279241,
107212,
172748,
287436,
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,
369433,
230169,
295707,
328476,
295710,
230175,
303914,
279340,
205613,
279353,
230202,
312124,
222018,
295755,
377676,
148302,
287569,
279383,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303985,
328563,
303987,
279413,
303991,
303997,
295806,
295808,
304005,
295813,
320391,
213895,
304007,
304009,
304011,
230284,
304013,
213902,
279438,
295822,
189329,
295825,
304019,
189331,
279445,
58262,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
197564,
304063,
238528,
304065,
189378,
213954,
156612,
295873,
213963,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
197645,
295949,
230413,
320528,
140312,
295961,
238620,
197663,
304164,
189479,
304170,
238641,
312374,
238652,
238655,
230465,
238658,
296004,
336964,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
164973,
205934,
279661,
312432,
279669,
337018,
189562,
279679,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
165038,
238766,
230576,
238770,
304311,
350308,
230592,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
279788,
320748,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
222525,
296253,
312639,
296255,
230718,
296259,
378181,
230727,
238919,
320840,
296264,
296267,
296271,
222545,
230739,
312663,
337244,
222556,
230752,
312676,
230760,
173418,
410987,
230763,
230768,
296305,
312692,
230773,
279929,
181626,
304506,
304505,
181631,
312711,
312712,
296331,
288140,
230800,
288144,
304533,
337306,
288154,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
288176,
279985,
173488,
312755,
296373,
279991,
312759,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
280014,
312783,
288208,
230865,
288210,
370130,
288212,
280021,
288214,
222676,
239064,
288217,
288218,
280027,
288220,
329177,
239070,
288224,
288226,
370146,
280036,
288229,
280038,
288230,
288232,
280034,
288234,
320998,
288236,
288238,
288240,
291754,
288242,
296435,
288244,
296439,
288250,
402942,
148990,
296446,
206336,
296450,
321022,
230916,
230919,
214535,
370187,
304651,
304653,
230940,
222752,
108066,
296486,
296488,
157229,
230961,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
280152,
288344,
239194,
280158,
403039,
370272,
181854,
239202,
312938,
280183,
280185,
280188,
280191,
280194,
116354,
280208,
280211,
288408,
280218,
280222,
190118,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
313027,
280260,
280264,
206536,
206539,
206541,
206543,
280276,
313044,
321239,
280283,
313052,
288478,
313055,
321252,
313066,
280302,
288494,
280304,
313073,
419570,
321266,
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,
313176,
42842,
280419,
321381,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280458,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
10170,
296890,
288700,
296894,
280515,
190403,
296900,
337862,
165831,
280521,
231379,
296921,
239586,
313320,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
321560,
305176,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
223303,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
280671,
223327,
149599,
321634,
149601,
149603,
329830,
280681,
313451,
223341,
280687,
313458,
280691,
215154,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
141455,
141459,
280725,
313498,
288936,
100520,
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,
280819,
157940,
125171,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
280835,
125187,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
280891,
289087,
280897,
280900,
239944,
305480,
280906,
239947,
305485,
305489,
379218,
280919,
354653,
313700,
280937,
313705,
280940,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
297365,
240021,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
305594,
289210,
281024,
289218,
289221,
289227,
281045,
281047,
215526,
166378,
305647,
281075,
174580,
281084,
240124,
305662,
305664,
240129,
305666,
305668,
240132,
223749,
281095,
338440,
150025,
223752,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
199262,
338528,
338532,
281190,
199273,
281196,
158317,
19053,
313973,
281210,
297594,
158347,
133776,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
199367,
158409,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
207661,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
183172,
158596,
240519,
322440,
338823,
314249,
183184,
289687,
240535,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
281567,
289762,
322534,
297961,
281581,
183277,
322550,
134142,
322563,
175134,
322599,
322610,
314421,
281654,
314427,
207937,
314433,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
289912,
248995,
306341,
306344,
306347,
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,
281923,
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,
224657,
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,
324757,
282261,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
282295,
282300,
323260,
323266,
282310,
323273,
282319,
306897,
241362,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
282410,
241450,
306988,
306991,
315184,
323376,
315190,
241464,
282425,
159545,
298811,
307009,
413506,
241475,
307012,
148946,
315211,
282446,
307027,
315221,
282454,
315223,
241496,
323414,
241498,
307035,
307040,
282465,
110433,
241509,
110438,
298860,
110445,
282478,
282481,
110450,
315251,
315249,
315253,
315255,
339838,
282499,
315267,
315269,
241544,
282505,
241546,
241548,
298896,
282514,
298898,
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,
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,
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,
282931,
307508,
315701,
307510,
332086,
151864,
307512,
176435,
307515,
168245,
282942,
307518,
151874,
282947,
282957,
323917,
110926,
233808,
323921,
315733,
323926,
233815,
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,
283080,
176592,
315856,
315860,
176597,
283095,
127447,
299481,
176605,
242143,
291299,
127463,
242152,
291305,
127466,
176620,
127474,
291314,
291317,
135672,
233979,
291323,
291330,
283142,
127497,
233994,
135689,
291341,
233998,
234003,
234006,
152087,
127511,
283161,
242202,
234010,
135707,
242206,
135710,
242208,
291361,
242220,
291378,
234038,
152118,
234041,
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,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
225998,
299726,
226002,
226005,
119509,
226008,
242396,
299740,
201444,
299750,
283368,
234219,
283372,
381677,
226037,
283382,
234231,
316151,
234236,
226045,
234239,
242431,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
234248,
291593,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
348950,
201496,
234264,
234266,
283421,
234269,
234272,
234274,
152355,
234278,
299814,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
283452,
160572,
234302,
234307,
242499,
234309,
292433,
234313,
316233,
316235,
234316,
283468,
242511,
234319,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
234338,
242530,
349027,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
234364,
291711,
234368,
234370,
201603,
291714,
234373,
226182,
234375,
291716,
226185,
308105,
234379,
234384,
234388,
234390,
226200,
324504,
234393,
209818,
308123,
324508,
234398,
234396,
291742,
234401,
291747,
291748,
234405,
291750,
234407,
324518,
324520,
234410,
324522,
226220,
291756,
234414,
324527,
291760,
234417,
201650,
324531,
226230,
234422,
275384,
324536,
234428,
291773,
234431,
242623,
324544,
324546,
226239,
324548,
226245,
234437,
234439,
234434,
234443,
291788,
193486,
275406,
193488,
234446,
234449,
316370,
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,
234568,
234570,
316491,
300108,
234572,
234574,
300115,
234580,
234581,
275545,
242777,
234585,
234590,
234593,
234595,
300133,
234597,
234601,
300139,
234605,
234607,
160879,
275569,
234610,
300148,
234614,
398455,
144506,
275579,
234618,
234620,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
275594,
234636,
177293,
234640,
275602,
234643,
226453,
275606,
234647,
275608,
308373,
234650,
234648,
308379,
283805,
234653,
324766,
119967,
234657,
300189,
324768,
242852,
283813,
234661,
300197,
234664,
275626,
234667,
316596,
308414,
234687,
316610,
300226,
226500,
234692,
300229,
308420,
283844,
308418,
283850,
300234,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
161003,
300267,
300270,
300272,
120053,
300278,
316663,
275703,
300284,
275710,
300287,
283904,
300289,
292097,
300292,
300294,
275719,
300299,
177419,
283917,
300301,
242957,
177424,
275725,
349464,
283939,
259367,
283951,
292143,
300344,
226617,
283963,
243003,
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,
284076,
144812,
144814,
144820,
284084,
284087,
292279,
144826,
144828,
144830,
144832,
284099,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
259567,
300527,
308720,
226802,
316917,
308727,
292343,
300537,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
284213,
194101,
284215,
194103,
284218,
226877,
284223,
284226,
243268,
292421,
226886,
284231,
128584,
284228,
284234,
366155,
276043,
317004,
284238,
226895,
284241,
194130,
284243,
276052,
276053,
284245,
284247,
317015,
284249,
243290,
284251,
300628,
284253,
235097,
284255,
300638,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
276086,
284278,
292470,
292473,
284283,
276093,
284286,
276095,
284288,
292481,
276098,
284290,
325250,
284292,
292479,
292485,
284297,
317066,
284299,
317068,
276109,
284301,
284303,
276114,
284306,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
276137,
284329,
284331,
317098,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
276160,
358080,
284354,
358083,
276166,
284358,
358089,
276170,
284362,
276175,
284368,
276177,
284370,
317138,
284372,
358098,
284377,
276187,
284379,
284381,
284384,
284386,
358114,
358116,
276197,
317158,
358119,
284392,
325353,
284394,
358122,
284397,
276206,
284399,
358126,
358128,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
284418,
358146,
317187,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
186139,
300828,
300830,
276255,
325408,
284449,
300834,
300832,
227109,
317221,
358183,
186151,
276268,
300845,
194351,
243504,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
153417,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
284511,
227175,
292715,
300912,
284529,
292721,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
284564,
358292,
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,
292843,
276460,
276464,
178161,
276466,
227314,
276472,
325624,
317435,
276476,
276479,
276482,
276485,
317446,
276490,
292876,
276496,
317456,
317458,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
243762,
309298,
325685,
325689,
276539,
235579,
235581,
325692,
178238,
276544,
284739,
292934,
276553,
243785,
350293,
350295,
194649,
227418,
309337,
194654,
227423,
350302,
194657,
227426,
276579,
178273,
194660,
227430,
276583,
309346,
309348,
276586,
309350,
309352,
309354,
276590,
350313,
227440,
350316,
284786,
350321,
276595,
301167,
350325,
350328,
292985,
301178,
292989,
292993,
301185,
350339,
317570,
317573,
350342,
227463,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
276638,
350366,
284837,
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,
276713,
317674,
325867,
243948,
194801,
227571,
309491,
276725,
309494,
243960,
227583,
276735,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
276766,
211232,
317729,
276775,
211241,
325937,
276789,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
276843,
293227,
276848,
293232,
186744,
285051,
211324,
227709,
285061,
317833,
178572,
285070,
178575,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
301562,
317951,
309764,
301575,
121352,
236043,
317963,
342541,
55822,
113167,
277011,
317971,
309781,
309779,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
129603,
318020,
301636,
301639,
301643,
277071,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
277106,
121458,
170618,
170619,
309885,
309888,
277122,
227975,
285320,
277128,
301706,
318092,
326285,
318094,
334476,
277136,
277139,
227992,
285340,
318108,
227998,
318110,
137889,
383658,
285357,
318128,
277170,
342707,
154292,
277173,
293555,
318132,
285368,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
137946,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
285453,
228113,
285459,
277273,
293659,
326430,
228128,
285474,
293666,
228135,
318248,
277291,
293677,
318253,
285489,
293685,
285494,
301880,
285499,
301884,
310080,
293696,
277314,
277317,
277322,
277329,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
277368,
15224,
236408,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
293817,
293820,
203715,
326603,
293849,
293861,
228327,
228328,
228330,
318442,
228332,
277486,
326638,
318450,
293876,
293877,
285686,
302073,
285690,
244731,
121850,
302075,
293882,
293887,
277504,
277507,
277511,
277519,
293908,
277526,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
310344,
277577,
293960,
277583,
203857,
310355,
293971,
310359,
236632,
277594,
138332,
277598,
285792,
277601,
203872,
310374,
203879,
277608,
310376,
228460,
318573,
203886,
187509,
285815,
285817,
367737,
285821,
302205,
285824,
392326,
285831,
253064,
302218,
285835,
294026,
384148,
162964,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
285862,
277671,
302248,
64682,
277678,
228526,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
204023,
228601,
204026,
228606,
204031,
64768,
310531,
285958,
228617,
138505,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
277804,
285999,
277807,
113969,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
294211,
302403,
277832,
384328,
277836,
294221,
326991,
294223,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
277892,
327046,
253320,
310665,
318858,
277898,
277894,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
277923,
130468,
228776,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
64966,
245191,
163272,
302534,
310727,
277959,
292968,
302541,
277966,
302543,
277963,
310737,
277971,
277975,
286169,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
286188,
310764,
278000,
278003,
310772,
228851,
278006,
212472,
278009,
40440,
40443,
286203,
228864,
40448,
286214,
228871,
302603,
65038,
302614,
286233,
302617,
302621,
286240,
146977,
187939,
294435,
40484,
286246,
294439,
286248,
278057,
294440,
294443,
40486,
294445,
40488,
310831,
40491,
212538,
40507,
40511,
40513,
228933,
40521,
286283,
40525,
40527,
228944,
212560,
400976,
40533,
147032,
40537,
40539,
278109,
40541,
40544,
40548,
40550,
286312,
286313,
40554,
40552,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
278150,
310925,
286354,
278163,
302740,
122517,
278168,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
278227,
229076,
286420,
319187,
286425,
319194,
278235,
301163,
229086,
278238,
286432,
294625,
294634,
302838,
319226,
286460,
171774,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
294682,
278306,
188199,
294701,
278320,
319280,
319290,
229192,
302925,
188247,
237409,
294776,
360317,
294785,
327554,
40840,
40851,
294803,
188312,
294811,
319390,
294817,
319394,
40865,
294821,
311209,
180142,
294831,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
294890,
311279,
278513,
237555,
278516,
311283,
278519,
237562
] |
049728d211f17b1256ea0d301fa1aefc06c319d9
|
bd86aee97d4e0c5bd1ca6410d0377ac1168597c3
|
/StocksApp/CustomUI/ForListModule/ListSearchCell.swift
|
df2f09dc426025a353b8445b9385209842c8bc9c
|
[] |
no_license
|
mabeljarsdel/StocksApp
|
f245362402cf355a9f3e99958bfba0a435446c1e
|
b7acd110bfd5f1afaaf7728cf8d4e4fb178ed415
|
refs/heads/main
| 2023-09-02T12:24:34.745448 | 2021-10-12T22:37:36 | 2021-10-12T22:37:36 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,128 |
swift
|
//
// ListSearchCell.swift
// StocksApp
//
// Created by Савва Шулятьев on 01.10.2021.
//
import UIKit
protocol ListSearchCellProtocol: AnyObject {
func didTapSearchButton()
}
final class ListSearchCell: UITableViewCell {
weak var delegate: ListSearchCellProtocol?
private lazy var searchButton = SimpleButton()
// MARK: - Init
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.backgroundColor = Styles.Colors.white
self.selectionStyle = .none
setupButton()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// MARK: - Private Methods
private func setupButton() {
self.contentView.addSubview(searchButton)
self.searchButton.translatesAutoresizingMaskIntoConstraints = false
self.searchButton.top(0, to: self.topAnchor)
self.searchButton.leading(16, to: self.leadingAnchor)
self.searchButton.trailing(-16, to: self.trailingAnchor)
self.searchButton.height(48)
self.searchButton.backgroundColor = .clear
self.searchButton.layer.cornerRadius = 20
self.searchButton.layer.borderWidth = 1
self.searchButton.layer.borderColor = Styles.Colors.black.cgColor
self.searchButton.setTitle(Localization.FindCompanyOrTicker, for: .normal)
self.searchButton.setTitleColor(Styles.Colors.black, for: .normal)
self.searchButton.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .semibold)
self.searchButton.contentHorizontalAlignment = .left
self.searchButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 36, bottom: 0, right: 0)
self.searchButton.setImage(UIImage(named: ImageNames.ellipse), for: .normal)
self.searchButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 0)
self.searchButton.setAction {
self.delegate?.didTapSearchButton()
}
}
}
|
[
-1
] |
4023e57045ea773ced1c5e6782db1587dad92071
|
f47aec4f0f9b6bde7b571df98250696be03c624c
|
/Plan-Your-Travel/RouteViewController.swift
|
6ede532d0f673b1e59d8b539c7db902373e4bd30
|
[] |
no_license
|
vvarshad/Plan-Your-Travel
|
b46d82365685594f2cb13d172fe69c86bce4ed4c
|
b40344b4ab2cf4bc2b597da1d320f04c921fcece
|
refs/heads/master
| 2021-01-10T01:35:43.242565 | 2015-11-30T03:28:11 | 2015-11-30T03:28:11 | 46,037,199 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 6,615 |
swift
|
import UIKit
//import CoreLocation
import SwiftyJSON
class RouteViewController: UIViewController{
@IBOutlet var tableView: UITableView!
@IBOutlet weak var labelFromto:UILabel!
@IBOutlet weak var labelJourneySteps:UILabel!
@IBOutlet weak var labelTimeTaken:UILabel!
@IBOutlet weak var labelDistance:UILabel!
@IBOutlet weak var labelStartBy:UILabel!
var source:String!
var destination: String!
var reachingTime: Int!
let locationManager = CLLocationManager()
lazy var data = NSMutableData()
var mylocationCoordinates:String!
var items: [String]! = []
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
// locationManager.delegate = self
// locationManager.requestWhenInUseAuthorization()
labelFromto.text="Route to \(destination)"
self.tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell")
tableView.dataSource = self
tableView.delegate = self
startConnection()
}
func generateURL()-> String{
print(source)
var url:String
if(source == "myL"){
url = "https://maps.googleapis.com/maps/api/directions/json?origin=\(mylocationCoordinates)&destination=\(destination)&arrival_time=\(reachingTime)&mode=transit&traffic_model=optimistic&transit_routing_preference=less_walking&key=YOUR_DIRECTION_SERVER_KEY"
}
else{
url = "https://maps.googleapis.com/maps/api/directions/json?origin=\(source)&destination=\(destination)&arrival_time=\(reachingTime)&mode=transit&traffic_model=optimistic&transit_routing_preference=less_walking&key=YOUR_DIRECTION_SERVER_KEY"
}
print(url)
return url
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func startConnection(){
let urlPath: String = generateURL()
let url: NSURL = NSURL(string: urlPath.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding)!)!
let request: NSURLRequest = NSURLRequest(URL: url)
let connection: NSURLConnection = NSURLConnection(request: request, delegate: self, startImmediately: false)!
connection.start()
}
func processJSON(data1: NSDictionary!){
let json = JSON(data1)
let legs = json["routes"][0]["legs"][0]
labelDistance.text = "Distance :\(legs["distance"]["text"].stringValue)"
labelTimeTaken.text = "Travel Time:\(legs["duration"]["text"].stringValue)"
let stTimestamp = reachingTime - legs["duration"]["value"].intValue
let date = NSDate(timeIntervalSince1970: Double(stTimestamp))
let dateFormatter = NSDateFormatter()
dateFormatter.timeStyle = NSDateFormatterStyle.MediumStyle //Set time style
dateFormatter.dateStyle = NSDateFormatterStyle.MediumStyle //Set date style
dateFormatter.timeZone = NSTimeZone()
dateFormatter.dateFormat = "hh:mm a"
let localDate = dateFormatter.stringFromDate(date)
labelStartBy.text = "Start latest by\(localDate)"
let steps = legs["steps"].array
for step in steps!{
let htmlIns = step["html_instructions"].stringValue
items.append(htmlIns.html2String)
//print(htmlIns.html2String)
let tMode: String = step["travel_mode"].string!
if (step["transit_details"]["line"]["short_name"].string != nil ){
labelJourneySteps.text?.appendContentsOf("> \(step["transit_details"]["line"]["short_name"].stringValue)")
}
}
tableView.reloadData()
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if (segue.identifier=="goHome"){
segue.destinationViewController as? ViewController
}
if segue.identifier == "showMap" {
let mapViewController = segue.destinationViewController as? MapViewController
mapViewController?.source = self.source
mapViewController?.destination = self.destination
mapViewController?.reachingTime = self.reachingTime
mapViewController?.mylocationCoordinates = self.mylocationCoordinates
}
}
}
extension RouteViewController: NSURLConnectionDelegate{
func connection(connection: NSURLConnection!, didReceiveData data: NSData!){
self.data.appendData(data)
}
func buttonAction(sender: UIButton!){
startConnection()
}
func connectionDidFinishLoading(connection: NSURLConnection!) {
// throwing an error on the line below (can't figure out where the error message is)
do{
let jsonResult: NSDictionary = try NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers) as! NSDictionary as NSDictionary!;
//print(jsonResult)
processJSON(jsonResult)
}catch let error as NSError {
print("json error: \(error.localizedDescription)")
}
}
}
extension RouteViewController:UITableViewDataSource,UITableViewDelegate{
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.items.count;
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell:UITableViewCell = self.tableView.dequeueReusableCellWithIdentifier("cell")! as UITableViewCell
cell.textLabel?.text = self.items[indexPath.row]
return cell
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
}
}
extension String {
var html2AttributedString: NSAttributedString? {
guard
let data = dataUsingEncoding(NSUTF8StringEncoding)
else { return nil }
do {
return try NSAttributedString(data: data, options: [NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType,NSCharacterEncodingDocumentAttribute:NSUTF8StringEncoding], documentAttributes: nil)
} catch let error as NSError {
print(error.localizedDescription)
return nil
}
}
var html2String: String {
return html2AttributedString?.string ?? ""
}
}
|
[
-1
] |
cb80b76369bc706b1cf3a72b0c258b76ec8fb436
|
0aee18800578d107d56107e4b2e41c8ec504b8b8
|
/30 Days of Code/Day 1- Data Types/Day 1- Data Types.swift
|
0329ff7128cdaa16569f849200cd65266665a613
|
[] |
no_license
|
ozolc/HackerRank
|
a1dac8e0f269da5ee3982e37aa2609aed667ac95
|
98c7e98c0568fbb73f25bcb3c1b2fbd96cd2bf16
|
refs/heads/master
| 2020-05-04T15:11:02.730524 | 2019-04-16T08:29:48 | 2019-04-16T08:29:48 | 179,228,644 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 591 |
swift
|
var i = 4
var d = 4.0
var s = "HackerRank "
// Declare second integer, double, and String variables.
// Read and save an integer, double, and String to your variables.
// Print the sum of both integer variables on a new line.
// Print the sum of the double variables on a new line.
// Concatenate and print the String variables on a new line
// The 's' variable above should be printed first.
var i2 = 0
var d2: Double = 0.0
var s2 = ""
i2 = Int(readLine() ?? "") ?? 0
i2 += i
d2 = Double(readLine() ?? "") ?? 0.0
d2 += d
s2 = readLine() ?? ""
s2 = s + s2
print(i2)
print(d2)
print(s2)
|
[
-1
] |
bc5596d890003de1473c26dca0e4f5c5bba478f0
|
57a8f81aa7e2b1a9cb7d258631db34638067c75f
|
/FactoryPattern/FactoryPattern/Study/Abobora/AboboraNormal/AboboraCoordinator.swift
|
447e6ab5b10548e2eff6247bd70b35c7dd166b47
|
[] |
no_license
|
mockada/FactoryPattern
|
bf19e989703d3c7cca24bee943225e9a9c29a672
|
86836f573918af2b32872aa98c041a1d012b4960
|
refs/heads/main
| 2023-04-30T15:49:15.510997 | 2021-05-18T16:59:33 | 2021-05-18T16:59:33 | 368,280,093 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 547 |
swift
|
//
// AboboraCoordinator.swift
// FactoryPattern
//
// Created by Jade Silveira on 18/05/21.
//
import Foundation
import UIKit
enum AboboraAction {
case open
}
protocol AboboraCoordinating {
var viewController: UIViewController? { get set }
func perform(action: AboboraAction)
}
class AboboraCoordinator: AboboraCoordinating {
weak var viewController: UIViewController?
func perform(action: AboboraAction) {
viewController?.navigationController?.pushViewController(ViewController(), animated: true)
}
}
|
[
-1
] |
26d3fe1c5253d14681d9d4794f11968642fa5627
|
d78577314522c3e07dc819241214cff3d7c246f6
|
/MAM/colorExtension.swift
|
03e8a7154f41cecd2d06f6e087c28387937cfdd8
|
[] |
no_license
|
aikikai/MAM
|
4d42ddea39dedf3c212d76d76ec907d377fb176e
|
0a5a8bcba16f3d2a4b7a42c1cc253e6fabf845f8
|
refs/heads/master
| 2021-01-10T14:56:02.438605 | 2016-01-17T17:14:39 | 2016-01-17T17:14:39 | 49,795,696 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 589 |
swift
|
//
// colorExtension.swift
// MurAndMarti
//
// Created by Luciano Wehrli on 15/1/16.
// Copyright © 2016 Luciano Wehrli. All rights reserved.
//
import Foundation
import UIKit
extension UIColor{
static func RGBColor (red red:CGFloat, green:CGFloat, blue:CGFloat) -> UIColor{
return UIColor(red: red/255.0, green: green/255.0, blue: blue/255.0, alpha: 1.0)
}
static func RGBColor (red red:CGFloat, green:CGFloat, blue:CGFloat, alpha:CGFloat) -> UIColor{
return UIColor(red: red/255.0, green: green/255.0, blue: blue/255.0, alpha: alpha)
}
}
|
[
-1
] |
b00194d6854d744aaabc2c7323a03f1b516d5045
|
b3164211567a2a6b127774c9ceb7f608ba9d4d48
|
/MessagesExtension/DefaultView.swift
|
12ad71a7083f8b76483d26fec8cf8644a973ceca
|
[] |
no_license
|
SeanMurphy15/SecureMessage2
|
b5cf186be18921e03b1f072665580eb26526625c
|
16da77ca822a9bc48aa1bdcaed50519d38bcd7bc
|
refs/heads/master
| 2020-12-28T20:08:28.446194 | 2016-10-29T19:52:24 | 2016-10-29T19:52:24 | 68,480,639 | 2 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,047 |
swift
|
//
// DefaultView.swift
// SecureMessage2
//
// Created by Sean Murphy on 9/17/16.
// Copyright © 2016 Sean Murphy. All rights reserved.
//
import Foundation
import UIKit
class DefaultView: UIView {
@IBOutlet weak var animationImageView: UIImageView!
@IBOutlet weak var animationImageView2: UIImageView!
class func instanceFromNib() -> DefaultView {
return UINib(nibName: "DefaultView", bundle: nil).instantiate(withOwner: nil, options: nil)[0] as! DefaultView
}
func animateScan(){
UIView.animate(withDuration: 4.0, delay: 0.0, usingSpringWithDamping: 1.0, initialSpringVelocity: 1.0, options: .curveLinear, animations: {
self.animationImageView.center.x -= 200
self.animationImageView2.center.x += 200
}) { (finished) in
UIView.animate(withDuration: 4.0, delay: 0.0, usingSpringWithDamping: 1.0, initialSpringVelocity: 1.0, options: .curveLinear, animations: {
self.animationImageView.center.x += 200
self.animationImageView2.center.x -= 200
}) { (finished) in
self.animateScan()
}
}
}
}
|
[
-1
] |
d1b5032bb69ff0c7e4a88ab75ef8fc126ade5137
|
bf31a7a72ae0d7107db19c556a67a3c51dc10ab7
|
/Landmarks/Views/Badges/HexagonParameters.swift
|
698201b952be5f96fd3ea5034287728001c2db01
|
[] |
no_license
|
theSteveMitchell/Landmarks-ios
|
17c6b216e5bb4e745de860cf4ddd8e88ff919527
|
c5f3f4d6786399b7a9dd8ee041f5e28bc40028ca
|
refs/heads/main
| 2023-03-28T08:32:44.748937 | 2021-04-07T17:08:28 | 2021-04-07T17:08:28 | 352,657,086 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,661 |
swift
|
//
// HexagonParameters.swift
// Landmarks
//
// Created by Steve Mitchell on 4/1/21.
//
import CoreGraphics
struct HexagonParameters {
struct Segment {
let line: CGPoint
let curve: CGPoint
let control: CGPoint
}
static let adjustment: CGFloat = 0.085
// Points representing a hexagon. This part of the IOS tutorial was poorly done. Far too many magic numbers and zero explanation as to how vectors work.
// To make a vector image, we'll first create a Path and moveTo (moving the pencil in-air) to the top-right of a hexagon in a virtual 100*100 canvas
// then for each segment, we'll addLine to draw a line to where the corner curve starts. segment.line is the endpoint of the line
// we'll make a short line to where the curve ends. segment.curve is the endpoint of the curve.
// This draws a path counter-clockwise, that sort of looks like a hexagon, but with flat corners.
//
// We should then scale and offset, etc. so that the hexagon looks correctly proportioned.
// Then, we change the short lines to curves, using the existing endpoints and the segment.control point determines the curve shape.
// Scale factor + adjustment + xOffset are still poorly separated concerns and it's not clear what effect each has.
// also, the control points are not properly calculated to create a mooth curve (only the top and bottom points are set correctly)
static let segments = [
Segment(
line: CGPoint(x: 0.60, y: 0.05),
curve: CGPoint(x: 0.40, y: 0.05),
control: CGPoint(x: 0.50, y: 0.00)
),
Segment(
line: CGPoint(x: 0.05, y: 0.20 + adjustment),
curve: CGPoint(x: 0.00, y: 0.30 + adjustment),
control: CGPoint(x: 0.00, y: 0.25 + adjustment)
),
Segment(
line: CGPoint(x: 0.00, y: 0.70 - adjustment),
curve: CGPoint(x: 0.05, y: 0.80 - adjustment),
control: CGPoint(x: 0.00, y: 0.75 - adjustment)
),
Segment(
line: CGPoint(x: 0.40, y: 0.95),
curve: CGPoint(x: 0.60, y: 0.95),
control: CGPoint(x: 0.50, y: 1.00)
),
Segment(
line: CGPoint(x: 0.95, y: 0.80 - adjustment),
curve: CGPoint(x: 1.00, y: 0.70 - adjustment),
control: CGPoint(x: 1.00, y: 0.75 - adjustment)
),
Segment(
line: CGPoint(x: 1.00, y: 0.30 + adjustment),
curve: CGPoint(x: 0.95, y: 0.20 + adjustment),
control: CGPoint(x: 1.00, y: 0.25 + adjustment)
)
]
}
|
[
-1
] |
cf17c9eb5e74e5a73ce5d92ddbd12af5c6758512
|
12b32e4088976b4a80a1ba126e17264d2f95ae82
|
/MiaoPersonal/Classes/Mine/C/ChangeViewController.swift
|
97f1cc5d2e899820d0f5885ad4c93dc7184e0e3c
|
[] |
no_license
|
Miao123/JHFollowJust
|
5d060e818f7f20204bd48edd09500830f0feefc5
|
3f65a64ab0253d2cfcea96840bf60c7e8612b9d5
|
refs/heads/master
| 2021-01-01T19:53:59.145436 | 2017-08-24T10:07:37 | 2017-08-24T10:07:37 | 98,714,918 | 2 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 4,054 |
swift
|
//
// ChangeViewController.swift
// MiaoPersonal
//
// Created by 苗建浩 on 2017/8/1.
// Copyright © 2017年 苗建浩. All rights reserved.
//
import UIKit
// 更改信息
class ChangeViewController: UIViewController, UITextFieldDelegate{
var backStr = NSString()
var fieldStr = NSString()
var newText = NSString()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.title = backStr as String
self.view.backgroundColor = BaseBackColor
self.automaticallyAdjustsScrollViewInsets = false
let bottomView = UIView.init(frame: CGRect(origin: CGPoint(x:0, y:NAVGATION_ADD_STATUS_HEIGHT + 10),size: CGSize(width:screenWidth,height:45 * DISTENCEH)))
bottomView.backgroundColor = UIColor.white
self.view.addSubview(bottomView)
let nickLabel = UILabel.init(frame: CGRect(x:10, y:0, width:40 * DISTENCEW, height:45 * DISTENCEH))
nickLabel.text = "昵称:"
if #available(iOS 8.2, *) {
nickLabel.font = UIFont.systemFont(ofSize: 15 * DISTENCEW, weight: UIFontWeightThin)
} else {
// Fallback on earlier versions
}
nickLabel.textColor = BaseTextColor
bottomView.addSubview(nickLabel)
let nickField = UITextField.init(frame: CGRect(x:nickLabel.right, y:0, width:screenWidth - nickLabel.width - 10, height:45 * DISTENCEH))
nickField.keyboardType = UIKeyboardType.default
nickField.backgroundColor = UIColor.white
if #available(iOS 8.2, *) {
nickField.font = UIFont.systemFont(ofSize: 15 * DISTENCEW, weight: UIFontWeightThin)
} else {
// Fallback on earlier versions
}
nickField.placeholder = fieldStr as String
nickField.textColor = BaseTextColor
nickField.delegate = self
bottomView.addSubview(nickField)
let sureBtn = UIButton.init(frame: CGRect(x:20, y:bottomView.bottom + 20, width:screenWidth - 40, height:40 * DISTENCEH))
sureBtn.backgroundColor = RGB_COLOR(25, 156, 232)
sureBtn.setTitle("确 定", for: UIControlState.normal)
sureBtn.setTitleColor(UIColor.white, for: UIControlState.normal)
sureBtn.titleLabel?.font = UIFont.systemFont(ofSize: 15 * DISTENCEW)
sureBtn.layer.cornerRadius = 3 * DISTENCEH
sureBtn.addTarget(self, action: #selector(sureBtnClick), for: UIControlEvents.touchUpInside)
self.view.addSubview(sureBtn)
}
// 确定按钮
func sureBtnClick() {
self.view.endEditing(true)
let nickStr = UserDefaults.standard
if backStr == "修改昵称" {
nickStr.set(newText, forKey: "nickName")
}else{
nickStr.set(newText, forKey: "realName")
}
_ = self.navigationController?.popViewController(animated: true)
}
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
let currentText = textField.text ?? ""
newText = (currentText as NSString).replacingCharacters(in: range, with: string) as NSString
print(newText)
return true
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
self.view.endEditing(true)
}
// 析构器
deinit {
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
|
[
-1
] |
c6441017f74ce0507d479c3a36ced19b098e1171
|
811cd0e506cb9a7bbef0e152a222855c45044cc6
|
/Flash-Chat-iOS12-master/Flash Chat/ChatViewController.swift
|
bdaf83b3f4d1d5b8c04963fa7e07a40ba76d7275
|
[] |
no_license
|
razzvan91/flashchat
|
84d0bc4a3f2b09084d3ec04cd21fd2e9a26c8370
|
4090b5a288bed8d2309c558996ff1daa6621c4e0
|
refs/heads/master
| 2020-04-03T21:18:23.479468 | 2018-11-01T15:54:31 | 2018-11-01T15:54:31 | 155,570,231 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 6,031 |
swift
|
//
// ViewController.swift
// Flash Chat
//
// Created by Angela Yu on 29/08/2015.
// Copyright (c) 2015 London App Brewery. All rights reserved.
//
import UIKit
import Firebase
import ChameleonFramework
class ChatViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate {
// Declare instance variables here
var messageArray : [Message] = [Message]()
// We've pre-linked the IBOutlets
@IBOutlet var heightConstraint: NSLayoutConstraint!
@IBOutlet var sendButton: UIButton!
@IBOutlet var messageTextfield: UITextField!
@IBOutlet var messageTableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
//TODO: Set yourself as the delegate and datasource here:
messageTableView.delegate = self
messageTableView.dataSource = self
//TODO: Set yourself as the delegate of the text field here:
messageTextfield.delegate = self
//TODO: Set the tapGesture here:
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(tableViewTapped))
messageTableView.addGestureRecognizer(tapGesture)
//TODO: Register your MessageCell.xib file here:
messageTableView.register(UINib(nibName: "MessageCell", bundle: nil), forCellReuseIdentifier: "customMessageCell")
configureTableView()
retrieveMessages()
}
///////////////////////////////////////////
//MARK: - TableView DataSource Methods
//TODO: Declare cellForRowAtIndexPath here:
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "customMessageCell", for: indexPath) as! CustomMessageCell
cell.messageBody.text = messageArray[indexPath.row].messageBody
cell.senderUsername.text = messageArray[indexPath.row].sender
cell.avatarImageView.image = UIImage(named: "egg")
if cell.senderUsername.text == Auth.auth().currentUser?.email{
cell.avatarImageView.backgroundColor = UIColor.flatGreen()
cell.messageBackground.backgroundColor = UIColor.flatOrange()
} else {
cell.avatarImageView.backgroundColor = UIColor.flatSkyBlue()
cell.messageBackground.backgroundColor = UIColor.flatPurple()
}
messageTableView.setContentOffset(CGPoint.zero, animated: true)
return cell
}
//TODO: Declare numberOfRowsInSection here:
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return messageArray.count
}
//TODO: Declare tableViewTapped here:
@objc func tableViewTapped(){
messageTextfield.endEditing(true)
}
//TODO: Declare configureTableView here:
func configureTableView(){
messageTableView.rowHeight = UITableView.automaticDimension
messageTableView.estimatedRowHeight = 120.0
messageTableView.separatorStyle = .none
}
///////////////////////////////////////////
//MARK:- TextField Delegate Methods
//TODO: Declare textFieldDidBeginEditing here:
func textFieldDidBeginEditing(_ textField: UITextField) {
UIView.animate(withDuration: 0.5) {
self.heightConstraint.constant = 308
self.view.layoutIfNeeded()
}
}
//TODO: Declare textFieldDidEndEditing here:
func textFieldDidEndEditing(_ textField: UITextField) {
UIView.animate(withDuration: 0.5) {
self.heightConstraint.constant = 50
self.view.layoutIfNeeded()
}
}
///////////////////////////////////////////
//MARK: - Send & Recieve from Firebase
@IBAction func sendPressed(_ sender: AnyObject) {
messageTextfield.endEditing(true)
//TODO: Send the message to Firebase and save it in our database
messageTextfield.isEnabled = false
sendButton.isEnabled = false
let messagesDB = Database.database().reference().child("Messages")
let messageDict = ["Sender":Auth.auth().currentUser?.email, "Message":messageTextfield.text!]
messagesDB.childByAutoId().setValue(messageDict){
(error, reference) in
if error != nil{
print(error!)
} else {
print("Message sent. It's a success!")
self.messageTextfield.isEnabled = true
self.sendButton.isEnabled = true
self.messageTextfield.text = ""
}
}
}
//TODO: Create the retrieveMessages method here:
func retrieveMessages(){
let messagesDB = Database.database().reference().child("Messages")
messagesDB.observe(.childAdded) { (snapshot) in
let snapshotValue = snapshot.value as! Dictionary<String, String>
let text = snapshotValue["Message"]!
let sender = snapshotValue["Sender"]!
let message = Message()
message.messageBody = text
message.sender = sender
self.messageArray.append(message)
self.configureTableView()
self.messageTableView.reloadData()
}
}
@IBAction func logOutPressed(_ sender: AnyObject) {
//TODO: Log out the user and send them back to WelcomeViewController
do {
try Auth.auth().signOut()
navigationController?.popToRootViewController(animated: true)
} catch {
print("Could not sign out!")
}
}
}
|
[
321853,
323357,
300822
] |
05ebd783538e48805aaba1f3b4af4ed8e41871a1
|
61e652c81176c8f38c4c72776a883fb44f21e6de
|
/HiChat/HiChat/HiChatSwiftTest.swift
|
2ff46298e20efcd7569c6d44d493aa94816a9165
|
[
"MIT"
] |
permissive
|
ZIKSocketIOStudy/HiChat-iOS
|
3af1022f354e05c609226ba9e8bcf09a9e78843d
|
b0b46149adffc8e743e76ec6a40c3f489cf7f6a6
|
refs/heads/master
| 2020-04-14T19:35:17.912715 | 2019-01-17T11:11:46 | 2019-01-17T11:11:46 | 164,063,558 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 151 |
swift
|
//
// HiChatSwiftTest.swift
// HiChat
//
// Created by ZIKong on 2019/1/7.
// Copyright © 2019 ZIKong. All rights reserved.
//
import Foundation
|
[
-1
] |
cf1cb1eb3d7b12d99ed3cbecf6668a0cf5870be7
|
991a0e7162fa314fe322f11f0e16ce4adde30fb0
|
/Spring/Labs/yost-lab2/Dogs/Dogs/BreedData.swift
|
ade776b4433e4c531f07e33e146aaad55303db8a
|
[] |
no_license
|
myost/Madi-MobileAppDev
|
fe0e2d0769a009307a365ae37aa6ee025134d881
|
aa5844961ffd9284ed5b1ea26d7a0ac6a0983ad2
|
refs/heads/master
| 2021-07-03T02:59:16.246592 | 2019-05-04T21:29:58 | 2019-05-04T21:29:58 | 147,708,566 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 235 |
swift
|
//
// BreedData.swift
// Dogs
//
// Created by Madi Yost on 2/18/19.
// Copyright © 2019 Madi Yost. All rights reserved.
//
import Foundation
struct BreedsDataModel : Codable {
var group : String
var breeds : [String]
}
|
[
-1
] |
0a4d8f5e246fb876856454430d8bd3be6e35f0f2
|
27f63e7ef690e6eab1a87894b4930a8474bec825
|
/watchOS_by_Tutorials_v3/22-core-motion/final/DreamWalker/DreamWalker/WalkViewController.swift
|
34cf7478dda0673ee89c92880102215622bffdbe
|
[] |
no_license
|
tomtclai/learning
|
5ae0cf848c806ff1cc8d2c65b10193d014e8fb3f
|
bc76cc8e0a07db568c2c3457ed28521c69f14f6a
|
refs/heads/main
| 2023-08-07T10:42:37.144848 | 2023-07-31T04:25:53 | 2023-07-31T04:25:53 | 35,651,485 | 3 | 0 | null | 2021-12-24T18:30:21 | 2015-05-15T03:37:00 |
Swift
|
UTF-8
|
Swift
| false | false | 2,546 |
swift
|
/**
* Copyright (c) 2016 Razeware LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import UIKit
import MapKit
class WalkViewController: UIViewController {
@IBOutlet weak var image: UIImageView!
@IBOutlet weak var goalLabel: UILabel!
@IBOutlet weak var progressBarView: ProgressBarView!
@IBOutlet weak var walkLabel: UILabel!
@IBOutlet weak var infoTextView: UITextView!
var walk: Walk?
var distanceUnit = "km"
var completions: CGFloat = 0.0
var completionString = ""
override func viewDidLoad() {
super.viewDidLoad()
if let walk = walk {
image.image = UIImage(named: walk.imageName)
if distanceUnit == "km" {
let formattedString = String(format:"%.2f", walk.goal)
goalLabel.text = "Goal: \(formattedString)km completed \(completionString) times"
} else {
let formattedString = String(format:"%.2f", walk.goal.imperial())
goalLabel.text = "Goal: \(formattedString)mi completed \(completionString) times"
}
// progress bar shows color-coded progress towards the next completion
progressBarView.update(completions.fraction())
walkLabel.text = walk.walkTitle
infoTextView.text = walk.info
}
}
@IBAction func openMaps(_ sender: AnyObject) {
let launchOptions = [MKLaunchOptionsMapTypeKey: MKMapType.hybrid.rawValue]
// 2015/09/27 Xcode 7A220: doesn't open on simulator 6 plus or 6s
walk!.mapItem().openInMaps(launchOptions: launchOptions)
}
}
|
[
-1
] |
c15ce0e5cd734ecce2f664950a8ff2fa41faeb25
|
bdfe99d8f6bb18daef0c109c1196569b79199f72
|
/MessageCell.swift
|
84bd6c7be8c3001536098ffc4042915433c579cd
|
[] |
no_license
|
sek810i/Malnet
|
0120bc1abb697516f49afcf3a1cff20d3500956a
|
1cd4b5938d24a238a855e39f4d0e0c9781555329
|
refs/heads/master
| 2020-03-20T10:49:51.375400 | 2018-02-25T18:33:44 | 2018-02-25T18:33:44 | 137,385,925 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 715 |
swift
|
//
// MessageCell.swift
// MalNet
//
// Created by Oleg Bogdan on 16.08.17.
// Copyright © 2017 Богдан Олег. All rights reserved.
//
import UIKit
class MessageCell: UITableViewCell {
@IBOutlet weak var malnetImageCloud: UIImageView!
@IBOutlet weak var malnetTextMessage: UILabel!
@IBOutlet weak var userImageCloud: UIImageView!
@IBOutlet weak var userTextMessage: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
|
[
-1
] |
cf88a5f12f783c9e23c8a0c250b6836961d89ba6
|
6024a7ab3978a13027449cb0abfaa6909e9351e4
|
/Sources/TLDExtract/PunycodeSwift/Helpers.swift
|
96b8984b5e9052585dd35bf2d6095f4576018901
|
[
"MIT"
] |
permissive
|
MarcoEidinger/TLDExtractSwift
|
4802a4ef2082c5d6be8944382008c356a2909d91
|
31881abfbc146ea9e29fd8cc0f176ef613d7a799
|
refs/heads/master
| 2023-08-20T04:44:43.315648 | 2023-08-13T00:13:18 | 2023-08-15T11:17:37 | 668,520,931 | 7 | 0 |
MIT
| 2023-08-15T11:17:38 | 2023-07-20T02:31:14 |
Swift
|
UTF-8
|
Swift
| false | false | 612 |
swift
|
//
// Created by kojirof on 2018-11-19.
// Copyright (c) 2018 Gumob. All rights reserved.
//
import Foundation
/// Helpers
extension Substring {
internal func lastIndex(of element: Character) -> String.Index? {
var position: Index = endIndex
while position > startIndex {
position = self.index(before: position)
if self[position] == element {
return position
}
}
return nil
}
}
extension UnicodeScalar {
internal var isValid: Bool {
return value < 0xD880 || (value >= 0xE000 && value <= 0x1FFFFF)
}
}
|
[
-1
] |
13ad77f21a0f3302534e80469b89ad9362d60c92
|
fcefd8a0e57f50b7a33f32b29c00222bb94e7ee1
|
/StoryApp/CoreData/DBService.swift
|
77cdef5119107df8847d35584e59f7c576a6feee
|
[] |
no_license
|
shivangvyasiosdeveloper/storyApp
|
bb76090233f8bd40ee79d514ceccafbe3a6e34cf
|
f96d662ad9fdecbc32f5ef813dbf604ff55302eb
|
refs/heads/master
| 2020-12-02T02:16:05.667484 | 2019-12-31T02:58:42 | 2019-12-31T02:58:42 | 230,855,797 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,501 |
swift
|
//
// DBService.swift
// StoryApp
//
// Created by shivang on 28/12/19.
// Copyright © 2019 iOS Developer. All rights reserved.
//
import Foundation
import CoreData
protocol ObjectID {
}
extension NSManagedObjectID: ObjectID {
}
struct Sorted {
var key: String
var isAcending: Bool
}
protocol UpdateDBService {
associatedtype Element: DBObject
func update(block: @escaping () -> Void) throws
}
protocol DeleteDBService {
associatedtype Element: DBObject
func delete<Element: DBObject>(_ model: Element.Type, object: DBObject, completion: @escaping () -> Void) throws
func deleteAll<Element: DBObject>(_ model: Element.Type, completion:@escaping ((Bool) -> Void)) throws
func reset() throws
}
protocol FetchDBService {
associatedtype Element: DBObject
func fetch<Element: DBObject>(_ model: Element.Type, predicateFormat: String?, completion:@escaping (([Element]?) -> Void))
func fetchAll<Element: DBObject>(_ model: Element.Type, completion:@escaping (([Element]?) -> Void))
}
protocol ObjectFromFaultService {
associatedtype FaultID: ObjectID
func getObjectFromFault<FaultID: ObjectID>(objectID: FaultID, completion: ((DBObject?) -> Void))
}
protocol CreateDBService {
func create<Element: DBObject>(_ model: Element.Type, completion: @escaping ((Element?) -> Void)) throws
}
protocol DBService: CreateDBService, FetchDBService, UpdateDBService, DeleteDBService, ObjectFromFaultService {
func save(completion:() -> Void)
}
|
[
-1
] |
684525c4b3b58100fc296290e7330181f009f9c6
|
74fb71663674ada13d4ca5480ba7da41be5a38b6
|
/WeKiddo_Admin/Classes/Worksheet Submission/Worksheet Submission Cell/WorksheetSubmissionHeaderView.swift
|
ef1a894b9032f7c60b64e429c20b9a4e3e04bfe3
|
[] |
no_license
|
27ferryirawan/iosDocumentationWeKiddo
|
13b369584d813862182478c3ab150e3a2690b52f
|
04d611f571fb7c45f335edd849c0195eb26c5301
|
refs/heads/master
| 2022-11-14T04:30:01.696110 | 2020-03-25T17:54:20 | 2020-03-25T17:54:20 | 274,962,450 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,191 |
swift
|
//
// WorksheetSubmissionHeaderView.swift
// WeKiddo_Admin
//
// Created by zein rezky chandra on 22/03/20.
// Copyright © 2020 PT. Absolute Connection. All rights reserved.
//
import UIKit
class WorksheetSubmissionHeaderView: UITableViewHeaderFooterView {
@IBOutlet weak var classLabel: UILabel!
@IBOutlet weak var classView: UIView! {
didSet {
classView.layer.cornerRadius = 5.0
classView.layer.masksToBounds = true
}
}
@IBOutlet weak var subjectCountLabel: UILabel!
@IBOutlet weak var subjectNameLabel: UILabel!
@IBOutlet weak var subjectAndDateLabel: UILabel!
@IBOutlet weak var bgView: UIView! {
didSet {
bgView.layer.borderColor = UIColor.lightGray.cgColor
bgView.layer.borderWidth = 1.0
}
}
var detailObj: CoordinatorAssignmentListPerClass? {
didSet {
cellConfig()
}
}
func cellConfig() {
guard let obj = detailObj else { return }
subjectAndDateLabel.text = "\(obj.subject_topic_name) | \(convertTime(time: obj.quiz_start_datetime)) - \(convertTime(time: obj.quiz_end_datetime))"
subjectNameLabel.text = obj.subject_name
subjectCountLabel.text = "\(obj.total_student_assignment)/\(obj.total_student_assignment_submission)"
classLabel.text = obj.school_class
}
}
extension WorksheetSubmissionHeaderView {
func convertTime(time: String) -> String {
// Convert from string to date first
let dateFormatter = DateFormatter()
dateFormatter.timeZone = TimeZone(abbreviation: "GMT")
dateFormatter.locale = NSLocale.current
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
guard let date = dateFormatter.date(from: time) else {
return ""
}
// then convert date to string again
let dateFormatterResult = DateFormatter()
dateFormatterResult.timeZone = TimeZone(abbreviation: "GMT")
dateFormatterResult.locale = NSLocale.current
dateFormatterResult.dateFormat = "HH:mm"
let stringDate = dateFormatterResult.string(from: date)
return stringDate
}
}
|
[
-1
] |
6f8597f367f7439100d68e3010d1e591f9590e9e
|
44eb3ed729871874156083d3044b2e082c15461c
|
/Example/Source/AppDelegate.swift
|
b7699051c1e4ad4d3a895a9cdf789ba8678025ee
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
KAIMAN-iOS/DSSlider
|
4ed10de79297018eaa40a619357c746e7251f023
|
7fcffe466210ca925591817016318980309fe3f8
|
refs/heads/master
| 2023-03-22T04:35:03.033318 | 2021-03-12T13:10:00 | 2021-03-12T13:10:00 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,002 |
swift
|
//
// AppDelegate.swift
//
// Copyright (c) 2020 Konstantin Stolyarenko
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
import UIKit
@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
}
// MARK: UISceneSession Lifecycle
@available(iOS 13.0, *)
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)
}
}
|
[
-1
] |
513d7c3c9143ea4d7b0bae930ffa2bb18eb3aab3
|
dad54ed261d5df395d7aef4a85dab102e92671ab
|
/LineGraph/AppDelegate.swift
|
a4bccf797b2ecafe8d9a464cc3b99808bd7a95d0
|
[] |
no_license
|
slambert27/SwiftLineGraph
|
588bd47ee0c7b321e3dcebd8ea59ee30ae3c9469
|
a0336a173341eb6a0b94866f0463cdbc9a50fa1c
|
refs/heads/master
| 2020-08-29T21:24:58.040779 | 2020-03-02T01:23:08 | 2020-03-02T01:23:08 | 218,178,007 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,448 |
swift
|
//
// AppDelegate.swift
// LineGraph
//
// Created by Sam Lambert on 10/26/19.
// Copyright © 2019 Sam Lambert. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = ViewController.loadFromStoryboard()
window?.makeKeyAndVisible()
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and 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:.
}
}
public protocol StoryboardLoadable {
static var storyboardName: String { get }
}
// This implementation of StoryboardLoadable assumes the convention that
// the UIViewController subclass adopting this protocol has a storyboard
// file with the same name as the UIViewController subclass.
//
// For example,
// "class MyViewController: UIViewController, StoryBoardLoadable {}"
// should have a corresponding "MyViewController.storyboard" file.
//
// The storyboard file should contain a prototype of the UIViewController
// subclass, and it should be set as the "Initial View Controller".
public extension StoryboardLoadable where Self: UIViewController {
static var storyboardName: String {
return String(describing: Self.self)
}
static var storyboard: UIStoryboard {
let bundle = Bundle(for: Self.self)
return UIStoryboard(name: storyboardName, bundle: bundle)
}
static func loadFromStoryboard() -> Self {
guard let viewController = storyboard.instantiateInitialViewController() as? Self else {
fatalError("Error loading \(self) from storyboard")
}
return viewController
}
}
|
[
-1
] |
76a21c0328454cfc67868938dadb2455a4e788e1
|
ed44983b6beb5cb52d85a3789743c38ef3aa90fa
|
/DesignCode/RingView.swift
|
087b5ea0a881f2efeb3e87f6b5415f6d18578e69
|
[] |
no_license
|
rub1cc/switfui-course
|
b7009f1a1d270f9919d0e167aeadbd59ddd6b1d4
|
443a09f72c984c711e4cf270a98fa703b1a14a62
|
refs/heads/master
| 2022-04-13T21:53:07.745182 | 2020-03-22T16:12:37 | 2020-03-22T16:12:37 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,925 |
swift
|
//
// RingView.swift
// DesignCode
//
// Created by Faraz Muhammad Aulia on 21/03/20.
// Copyright © 2020 Faraz Muhammad Aulia. All rights reserved.
//
import SwiftUI
struct RingView: View {
var color1 = #colorLiteral(red: 0.8078431487, green: 0.02745098062, blue: 0.3333333433, alpha: 1)
var color2 = #colorLiteral(red: 0.3647058904, green: 0.06666667014, blue: 0.9686274529, alpha: 1)
var width: CGFloat = 88
var height: CGFloat = 88
var percent: CGFloat = 50
@Binding var show: Bool
var body: some View {
let multiplier = width / 44
let progress = 1 - percent / 100
return ZStack {
Circle()
.stroke(Color.black.opacity(0.1), style: StrokeStyle(lineWidth: 5 * multiplier))
.frame(width: width, height: height)
Circle()
.trim(from: show ? progress : 1, to: 1)
.stroke(
LinearGradient(gradient: Gradient(colors: [Color(color1), Color(color2)]), startPoint: .topTrailing, endPoint: .bottomLeading),
style: StrokeStyle(lineWidth: 5 * multiplier, lineCap: .round, lineJoin: .round, miterLimit: .infinity, dash: [20, 0], dashPhase: 0)
)
.rotationEffect(Angle(degrees: 90))
.rotation3DEffect(Angle(degrees: 180), axis: (x: 1, y: 0, z: 0))
.frame(width: width, height: height)
.shadow(color: Color(color2).opacity(0.1), radius: 3 * multiplier, x: 0, y: 3 * multiplier)
Text("\(Int(percent))%")
.font(.system(size: 14 * multiplier))
.fontWeight(.bold)
.onTapGesture {
self.show.toggle()
}
}
}
}
struct RingView_Previews: PreviewProvider {
static var previews: some View {
RingView(show: .constant(true))
}
}
|
[
115969,
368482
] |
dcaddc3bb1dac3ff89de91412049b6a8f087a42b
|
b70e89df3818645fae9bf5d2e722f26293f66a0b
|
/APPYSTORE/common/OtpVerificationPopUp.swift
|
96c896671dbdbd71e554cacad50cb334aba59740
|
[] |
no_license
|
BridgeLabzSource/appyPieStore
|
c86cc928ab158ada607c063cbf4cda147d6fa16d
|
9b4002bb4ed5d45b51b73c0b719578f9f826864b
|
refs/heads/master
| 2021-01-20T14:39:35.205307 | 2017-06-08T11:50:23 | 2017-06-08T11:50:23 | 82,764,998 | 0 | 0 | null | 2017-12-13T17:01:11 | 2017-02-22T05:35:58 |
Swift
|
UTF-8
|
Swift
| false | false | 4,733 |
swift
|
//
// FreeTrialOtpVerificationPopUp.swift
// APPYSTORE
//
// Created by ios_dev on 04/05/17.
// Copyright © 2017 MAUJ MOBILE PVT LTD. All rights reserved.
//
import Foundation
import Toaster
class OtpVerificationPopUp: BasePopUpController {
var mobileNumber = ""
var otp = ""
var trialResponseModel: OtpResponseModel!
var timer: Timer!
var second = 0
var onLoginAfterVerification : (String) -> () = {_ in}
override func viewDidLoad() {
super.viewDidLoad()
print("OtpVerificationPopUp bundle : \(bundle)")
mobileNumber = bundle?[BundleConstants.MOBILE_NUMBER] as! String
//otp = bundle?[BundleConstants.OTP] as! String
trialResponseModel = bundle?[BundleConstants.OTP_RESPONSE_MODEL] as! OtpResponseModel
showTitleLabel()
showCenterEditText()
showSecondButton()
showBottomTextView()
setValues()
}
func setValues() {
setTitleTextLabel("Enter the One Time Password sent to \(mobileNumber)")
setCenterEditTextValue(trialResponseModel.otp)
setCenterEditTextPlaceholder("Enter OTP")
setSecondButtonTextLabel("Submit")
setBottomTextView("","Resend OTP")
}
override func onBottomTextClick() {
Toast(text: "Otp sent").show()
requestOtp()
tvBottom.isUserInteractionEnabled = false
timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(updateCounter), userInfo: nil, repeats: true)
}
func updateCounter() {
second = second + 1
print("updateCounter \(second)")
if second >= 30 {
second = 0
tvBottom.isUserInteractionEnabled = true
timer.invalidate()
timer = nil
}
}
func requestOtp() {
OtpRequestParser().parse(params: HttpRequestBuilder.getOtpRequestParameters(method: OtpRequestParser.METHOD_NAME, msisdn: mobileNumber, smmKey: "appyt-f", androidId: HttpRequestBuilder.VENDOR_ID_VALUE, imei: HttpRequestBuilder.VENDOR_ID_VALUE), completion: {
statusType, result in
})
}
// override func crossButtonClick() {
// mainControllerCommunicator?.performBackButtonClick(self)
// var bundle = [String: Any]()
// bundle[BundleConstants.MOBILE_NUMBER] = mobileNumber
// }
override func secondButtonClick() {
let otp = centerEditText.text
if otp != nil {
showProgress()
OtpVerificationParser().parse(params: HttpRequestBuilder.getOtpVerificationParameters(method: OtpVerificationParser.METHOD_NAME, userId: trialResponseModel.userId, msisdn: trialResponseModel.msisdn, otp: otp!, smmKey: trialResponseModel.smmKey, androidId: AppConstants.VENDOR_ID!, imei: HttpRequestBuilder.VENDOR_ID_VALUE), completion: {
statusType, result in
self.hideProgress()
if statusType == BaseParser.REQUEST_SUCCESS {
let model = result as! OtpVerificatioResponsenModel
print("OtpVerificationPopUp user_id \(model.userId)")
UserInfo.getInstance().id = model.userId
UserInfo.getInstance().tInfo = model.tInfo
self.mainControllerCommunicator?.performBackButtonClick(self)
AuthenticationUtil.callLoginFunction(mobileNo: self.mobileNumber,mainControllerCommunicator: self.mainControllerCommunicator!, completion: self.onLoginAfterVerification)
} else if statusType == BaseParser.USER_ALREADY_SUBSCRIBED {
self.mainControllerCommunicator?.performBackButtonClick(self)
Toast(text: result as? String).show()
AuthenticationUtil.callLoginFunction(mobileNo: self.mobileNumber, mainControllerCommunicator: self.mainControllerCommunicator!, completion: self.onLoginAfterVerification)
} else if statusType == BaseParser.REQUEST_FAILURE {
Toast(text: "Request Failure").show()
} else if statusType == BaseParser.CONNECTION_ERROR {
Toast(text: "Connection Error").show()
}
})
} else {
Toast(text: "Request Failure").show()
}
}
override func showProgress() {
super.showProgress()
hideSecondButton()
}
override func hideProgress() {
super.hideProgress()
showSecondButton()
}
}
|
[
-1
] |
56f2b23c18e5ccfdc293ef314ad586e52389084b
|
7aeffcb57b92d6ceb3af89808758b3995e1fe226
|
/Volunteer/Extensions/UIView+Extension.swift
|
991b7f8540d02d0703e4f2c9aea5ab6ac372768a
|
[] |
no_license
|
HadyHammad22/Aoun
|
703fac7e1a7f572b68113c35a6b5bee51b421c49
|
af5eca102c43cdb2f9de3b5b81a9fcd49fe6694d
|
refs/heads/master
| 2020-07-12T23:14:48.785922 | 2020-03-08T13:38:25 | 2020-03-08T13:38:25 | 204,931,423 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,810 |
swift
|
//
// UIView.swift
// Volunteer
//
// Created by Hady Hammad on 2/13/20.
// Copyright © 2020 Hady Hammad. All rights reserved.
//
import Foundation
import UIKit
extension UIView{
func addShadowWith(color: UIColor, radius: CGFloat, opacity: Float?) {
self.layer.shadowColor = color.cgColor
self.layer.shadowOffset = CGSize(width: 0, height: 0)
self.layer.shadowRadius = radius
self.layer.shadowOpacity = opacity ?? 0.7
}
func addNormalShadow(){
self.layer.shadowColor = UIColor.black.cgColor
self.layer.shadowOffset = CGSize(width: 0, height: 0)
self.layer.shadowRadius = 5
self.layer.shadowOpacity = 0.2
}
func addCornerRadius(_ radius: CGFloat = 0) {
if radius == 0 {
self.layer.cornerRadius = self.frame.size.height / 2
} else {
self.layer.cornerRadius = radius
}
}
func addBorderWith(width: CGFloat, color: UIColor) {
self.layer.borderWidth = width
self.layer.borderColor = color.cgColor
}
func roundedFromSide(corners: UIRectCorner, cornerRadius: Double) {
let size = CGSize(width: cornerRadius, height: cornerRadius)
let bezierPath = UIBezierPath(roundedRect: self.bounds, byRoundingCorners: corners, cornerRadii: size)
let shapeLayer = CAShapeLayer()
shapeLayer.frame = self.bounds
shapeLayer.path = bezierPath.cgPath
self.layer.mask = shapeLayer
}
func rounded(borderWidth: CGFloat, cornerRadius: CGFloat, borderColor: UIColor) {
self.layer.borderWidth = borderWidth
self.layer.cornerRadius = cornerRadius
self.layer.masksToBounds = true
self.layer.borderColor = borderColor.cgColor
}
}
|
[
-1
] |
2cab3d78255903827d9d43e9ab5ccdd486bc1549
|
eb066120fb50cfe1996df9788ba01a537da56802
|
/Magic 8 Ball/ViewController.swift
|
2f557303f5a2e2ac0a55e06cfc061ea96574309d
|
[] |
no_license
|
fentybit/magic-8-ball
|
66019440d3346815e8ca0eb8729d3f9f09826841
|
009e4eae741b51cf7485b539250b40eacc9e186e
|
refs/heads/main
| 2023-02-01T20:14:29.978988 | 2020-12-19T23:49:59 | 2020-12-19T23:49:59 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 608 |
swift
|
//
// ViewController.swift
// Magic 8 Ball
//
// Created by Angela Yu on 14/06/2019.
// Copyright © 2019 The App Brewery. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var imageView: UIImageView!
@IBAction func askButtonPressed(_ sender: Any) {
let ballArray = [#imageLiteral(resourceName: "ball1.png"),#imageLiteral(resourceName: "ball2.png"),#imageLiteral(resourceName: "ball3.png"),#imageLiteral(resourceName: "ball4.png"),#imageLiteral(resourceName: "ball5.png")]
imageView.image = ballArray.randomElement()
}
}
|
[
332505,
265801,
352897,
249236
] |
e3d4d8c1305813f4c8fd5ee5369d23c74efe4d14
|
22a7423733e3d34f3154ed21d40792cc8a6a5324
|
/iOS 8开发指南3~13源码/11/UI010/TSwift/TSwift/DetailViewController.swift
|
82028dafd0f5ae6afa42ef6bd8df038d5b854ed5
|
[] |
no_license
|
GYTeam1/STUDY_CODES_iOS8_V3
|
962401d8dc7b1e2820bfcc7431ee637e0ba7aa64
|
38736bf0b32846b740cf36ab1f5ad5c93b1ad9df
|
refs/heads/master
| 2021-01-11T08:09:40.669238 | 2016-10-06T09:05:24 | 2016-10-06T09:05:24 | 70,135,408 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,679 |
swift
|
//
// DetailViewController.swift
// TSwift
import UIKit
class DetailViewController : UIViewController, UIPickerViewDataSource, UIPickerViewDelegate
{
override func viewDidLoad()
{
self.view!.backgroundColor = UIColor.whiteColor()
if self.title == "UIPageControl"
{
// PageControl
var pageControl = UIPageControl(frame:CGRectMake(60.0, 120.0, 200.0, 200.0))
pageControl.numberOfPages = 5
pageControl.currentPageIndicatorTintColor = UIColor.blackColor()
pageControl.pageIndicatorTintColor = UIColor.redColor()
self.view.addSubview(pageControl)
}
else
{}
}
override func viewWillAppear(animated: Bool) {}
override func viewDidAppear(animated: Bool) {}
override func viewWillDisappear(animated: Bool) {}
override func viewDidDisappear(animated: Bool) {}
// Button Action
func buttonAction(sender: UIButton)
{
var mathSum = MathSum()
var sum = mathSum.sum(11, number2: 22)
var alert = UIAlertController(title: "Title", message: String(format: "Result = %i", sum), preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)
/*
var alertView = UIAlertView()
alertView.title = "Title"
alertView.message = "Message"
alertView.addButtonWithTitle("OK")
alertView.show()
*/
}
// UIPickerViewDataSource Methods
// returns the number of 'columns' to display.
func numberOfComponentsInPickerView(pickerView: UIPickerView!) -> Int
{
return 3
}
// returns the # of rows in each component..
func pickerView(pickerView: UIPickerView!, numberOfRowsInComponent component: Int) -> Int
{
return 10
}
func pickerView(pickerView: UIPickerView!, titleForRow row: Int, forComponent component: Int) -> String!
{
return String(format:"%i", row)
}
// Button Handler
// showActionSheet
func showActionSheet()
{
var alertController = UIAlertController(title: "ActionSheet", message: "Message", preferredStyle: UIAlertControllerStyle.ActionSheet)
alertController.addAction(UIAlertAction(title: "Go Back", style: UIAlertActionStyle.Destructive, handler: nil))
self.presentViewController(alertController, animated: true, completion:nil)
}
// didReceiveMemoryWarning
override func didReceiveMemoryWarning()
{}
}
|
[
-1
] |
98859b1d7b80780ee4542c62da2584ff916bb563
|
35207dcacbfabc202fd4a7ded3e11f6f095d1962
|
/Project 1/Noise/Noise/AppDelegate.swift
|
7c749bd4947b5f8fca6098df27dd6d9c28bb60d9
|
[] |
no_license
|
akierson/akierson_mobileAppDev
|
f5b58e66283225ce1afae953fab3aa6c5477e1c3
|
ab8429db3c183324337ceb3a59ab556fc9e3cd72
|
refs/heads/master
| 2020-03-28T04:20:16.909396 | 2018-12-15T23:01:21 | 2018-12-15T23:01:21 | 147,708,343 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,193 |
swift
|
//
// AppDelegate.swift
// Noise
//
// Created by Azariah Kierson-Galeano on 10/2/18.
// Copyright © 2018 Azariah Kierson-Galeano. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
|
[
229380,
229383,
229385,
278539,
294924,
229388,
278542,
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,
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,
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,
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,
189325,
189329,
295825,
304019,
189331,
213902,
58262,
304023,
304027,
279452,
234648,
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,
132165,
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,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
230679,
214294,
304416,
230689,
173350,
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,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
279985,
312755,
296373,
312759,
337335,
288185,
279991,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
288210,
370130,
288212,
222676,
288214,
280021,
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,
402969,
230940,
222752,
108066,
296486,
296488,
157229,
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,
313044,
280276,
321239,
280283,
313052,
18140,
288478,
313055,
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,
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,
280891,
289087,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
379218,
280919,
248153,
215387,
354653,
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,
436684,
281045,
281047,
215526,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
330244,
281095,
223752,
150025,
338440,
240132,
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,
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,
158596,
183172,
338823,
322440,
314249,
240519,
183184,
289687,
240535,
224151,
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,
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,
282255,
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,
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,
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,
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,
299167,
315552,
184479,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
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,
295583,
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,
127431,
127434,
315856,
176592,
315860,
176597,
127447,
283095,
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,
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,
185074,
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,
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,
234396,
226200,
234398,
291742,
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,
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,
349451,
275725,
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,
284076,
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,
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,
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,
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,
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,
399252,
284566,
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,
350186,
292843,
276460,
276464,
178161,
227314,
276466,
325624,
350200,
276472,
317435,
276476,
276479,
276482,
350210,
276485,
317446,
178181,
276490,
350218,
292876,
350222,
317456,
276496,
317458,
178195,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
178224,
243762,
309298,
325685,
325689,
235579,
325692,
235581,
178238,
276539,
276544,
243779,
325700,
284739,
292934,
243785,
276553,
350293,
350295,
309337,
194649,
227418,
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,
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,
129486,
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,
219714,
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,
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,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
56045,
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,
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,
384302,
285999,
277804,
113969,
277807,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
302403,
294211,
384328,
277832,
277836,
294221,
146765,
294223,
326991,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
327046,
277892,
253320,
310665,
318858,
277894,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
228776,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
310727,
245191,
64966,
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,
302617,
286233,
302621,
286240,
146977,
187936,
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,
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,
188252,
237409,
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,
237508,
393177,
294876,
294879,
294883,
393190,
294890,
311279,
278513,
237555,
311283,
278516,
278519,
237562
] |
21e8fd7e178178e6097a05a40c62c28d030e044c
|
2ef4c31f8bf213654f311312c33bec98031de55e
|
/BallClub/BallClub/Custom Views/Friends/FriendsCollectionCustomView.swift
|
5cc78addaa75d77d2275a33c1533c1f741c00ea9
|
[] |
no_license
|
ace-rivera/ballclub
|
d871fe670ae04dfd3cc7a83e632f4eb591bada30
|
c62be5748365ed6b783e459a9f942263cd620984
|
refs/heads/master
| 2020-12-25T15:07:53.617408 | 2017-09-04T14:51:10 | 2017-09-04T14:51:10 | 66,897,683 | 0 | 0 | null | 2017-09-04T14:51:11 | 2016-08-30T02:10:29 |
Objective-C
|
UTF-8
|
Swift
| false | false | 457 |
swift
|
//
// FriendsCollectionCustomView.swift
// BallClub
//
// Created by Geraldine Forto on 09/09/2016.
// Copyright © 2016 Geraldine Forto. All rights reserved.
//
import UIKit
class FriendsCollectionCustomView: UIView {
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
override func drawRect(rect: CGRect) {
// Drawing code
}
*/
}
|
[
-1
] |
f8c3c1c95b8a0249a2aae3c45abf536104ecb8dc
|
1971ea2504b84573d2119e40209dbe44377f0089
|
/To the Gloom/GameScene.swift
|
59fe40506e3ce4fdf75035510d7052c16e29e960
|
[] |
no_license
|
adrianog21/ToTheGloom
|
7e8ee371c5a9610922c9dda36f72d633581b464e
|
69c83979ba70597041b70c23793a4c9680627d59
|
refs/heads/main
| 2023-01-08T03:39:24.983090 | 2020-11-01T20:07:14 | 2020-11-01T20:07:14 | 309,179,660 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 9,972 |
swift
|
//
// GameScene.swift
// To the Gloom
//
// Created by Adriano Gatto on 24/03/2020.
// Copyright © 2020 Adriano Gatto. All rights reserved.
//
import SpriteKit
import GameplayKit
import AVFoundation
import AudioToolbox
class GameScene: SKScene {
var entities = [GKEntity]()
var graphs = [String : GKGraph]()
var start:(location:CGPoint, time:TimeInterval)?
let minDistance:CGFloat = 10
let minSpeed:CGFloat = 1000
let maxSpeed:CGFloat = 8000
var gvc = GameViewController()
var direction = String()
var variation = CGFloat()
var variation2 = CGFloat()
var variation3 = CGFloat()
var variation4 = CGFloat()
var variation5 = CGFloat()
var variation6 = CGFloat()
var variation7 = CGFloat()
var variation8 = CGFloat()
var variation9 = CGFloat()
var variation10 = CGFloat()
var variation11 = CGFloat()
var variation12 = CGFloat()
var rotation = Float(0)
var audioPlayer: AVAudioPlayer?
var newAnswer = Answer()
private var lastUpdateTime : TimeInterval = 0
private var label : SKLabelNode?
private var spinnyNode : SKShapeNode?
var square : UIImageView!
override func sceneDidLoad() {
self.lastUpdateTime = 0
// Get label node from scene and store it for use later
// self.label = self.childNode(withName: "//helloLabel") as? SKLabelNode
if let label = self.label {
label.alpha = 0.0
label.run(SKAction.fadeIn(withDuration: 2.0))
}
// Create shape node to use during mouse interaction
let w = (self.size.width + self.size.height) * 0.05
self.spinnyNode = SKShapeNode.init(rectOf: CGSize.init(width: w, height: w), cornerRadius: w * 0.3)
if let spinnyNode = self.spinnyNode {
spinnyNode.lineWidth = 2.5
spinnyNode.run(SKAction.repeatForever(SKAction.rotate(byAngle: CGFloat(Double.pi), duration: 1)))
spinnyNode.run(SKAction.sequence([SKAction.wait(forDuration: 0.5),
SKAction.fadeOut(withDuration: 0.5),
SKAction.removeFromParent()]))
}
}
func touchDown(atPoint pos : CGPoint) {
if let n = self.spinnyNode?.copy() as! SKShapeNode? {
n.position = pos
n.strokeColor = SKColor.purple
n.setScale(0.21)
self.addChild(n)
}
}
fileprivate func visualEffect(_ pos: CGPoint) {
if let n = self.spinnyNode?.copy() as! SKShapeNode? {
n.position = pos
n.strokeColor = SKColor.black
n.fillColor = SKColor.init(red: 105/250, green: 63/250, blue: 227/250, alpha: 1)
n.setScale(0.1)
// n.position = CGPoint(x: pos.x + variation, y: pos.y + variation2)
self.addChild(n)
}
}
fileprivate func visualEffect2(_ pos: CGPoint) {
if let n = self.spinnyNode?.copy() as! SKShapeNode? {
n.position = pos
n.strokeColor = SKColor.black
n.fillColor = SKColor.init(red: 35/250, green: 240/250, blue: 240/250, alpha: 1)
n.setScale(0.1)
// n.position = CGPoint(x: pos.x + variation, y: pos.y + variation2)
self.addChild(n)
}
}
//image created
func createImage(pos : CGPoint){
square = UIImageView.init(image: #imageLiteral(resourceName: "square.png"))
let position = convertPoint(toView: pos)
square.frame = CGRect(x: position.x - 12, y: position.y - 12, width: 27, height: 27)
newTimer()
self.view?.addSubview(square)
UIView.animate(withDuration: 1, animations: {
self.square.alpha = 0
})
}
fileprivate func playSound() {
let music = Bundle.main.path(forResource: "feedback.mp3", ofType: nil)
let url = URL(fileURLWithPath: music!)
do {
audioPlayer = try AVAudioPlayer(contentsOf: url)
// audioPlayer?.play()
} catch {
print(error)
}
}
func touchMoved(toPoint pos : CGPoint) {
playSound()
createImage(pos: pos)
AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate))
print(AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate)))
print("aaa")
}
func touchUp(atPoint pos : CGPoint) {
createImage(pos: pos)
}
func newTimer(){
//Timer
_ = Timer.scheduledTimer(timeInterval: 0.01, target: self, selector: #selector(rotate), userInfo: nil, repeats: true)
}
@objc func rotate(){
self.square.transform = CGAffineTransform(rotationAngle: CGFloat(rotation))
}
func getDirection() -> String {
return direction
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
// if let label = self.label {
// label.run(SKAction.init(named: "Pulse")!, withKey: "fadeInOut")
//
// }
if let touch = touches.first {
start = (touch.location(in:self), touch.timestamp)
print("set")
}
// for t in touches { self.touchDown(atPoint: t.location(in: self)) }
}
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
for t in touches { self.touchMoved(toPoint: t.location(in: self)) }
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
// for t in touches { self.touchUp(atPoint: t.location(in: self)) }
var swiped = false
if let touch = touches.first, let startTime = self.start?.time,
let startLocation = self.start?.location {
let location = touch.location(in:self)
let dx = location.x - startLocation.x
let dy = location.y - startLocation.y
let distance = sqrt(dx*dx+dy*dy)
// // Check if the user's finger moved a minimum distance
// if distance > minDistance {
// let deltaTime = CGFloat(touch.timestamp - startTime)
// let speed = distance / deltaTime
//
// // Check if the speed was consistent with a swipe
// if speed >= minSpeed && speed <= maxSpeed {
// Determine the direction of the swipe
let x = abs(dx/distance) > 0.4 ? Int(sign(Float(dx))) : 0
let y = abs(dy/distance) > 0.4 ? Int(sign(Float(dy))) : 0
swiped = true
switch (x,y) {
// case (0,1):
// print("swiped up")
// case (0,-1):
// print("swiped down")
case (-1,0):
print("swiped leftYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY")
gvc.setDirection(direction: "left")
direction = "left"
newAnswer.setAnswer(answer2: "left")
case (1,0):
print("swiped rightXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
gvc.setDirection(direction: "right")
direction = "right"
newAnswer.setAnswer(answer2: "right")
// case (1,1):
// print("swiped diag up-right")
// case (-1,-1):
// print("swiped diag down-left")
// case (-1,1):
// print("swiped diag up-left")
// case (1,-1):
// print("swiped diag down-right")
default:
swiped = false
break
}
// }
// }
}
start = nil
if !swiped {
// Process non-swipes (taps, etc.)
print("not a swipe")
print("center")
}
}
override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {
for t in touches { self.touchUp(atPoint: t.location(in: self)) }
}
override func update(_ currentTime: TimeInterval) {
// Called before each frame is rendered
rotation += 0.21
variation = CGFloat.random(in: -21...21)
variation2 = CGFloat.random(in: -21...21)
variation3 = CGFloat.random(in: -21...21)
variation4 = CGFloat.random(in: -21...21)
variation5 = CGFloat.random(in: -21...21)
variation6 = CGFloat.random(in: -21...21)
variation7 = CGFloat.random(in: -21...21)
variation8 = CGFloat.random(in: -21...21)
variation9 = CGFloat.random(in: -21...21)
variation10 = CGFloat.random(in: -21...21)
variation11 = CGFloat.random(in: -21...21)
variation12 = CGFloat.random(in: -21...21)
// Initialize _lastUpdateTime if it has not already been
if (self.lastUpdateTime == 0) {
self.lastUpdateTime = currentTime
}
// Calculate time since last update
let dt = currentTime - self.lastUpdateTime
// Update entities
for entity in self.entities {
entity.update(deltaTime: dt)
}
self.lastUpdateTime = currentTime
}
}
|
[
-1
] |
7ab350ba61041ec503299e90da6d02cd9bb23de8
|
f35b05fd9bf4161f8a5b4fb28f541ad4fcc61885
|
/dataStructure/dataStructure/LeetCodes/237.删除链表中的节点.swift
|
9761b8529ad81ca9c17519b6f32501f942e88a68
|
[] |
no_license
|
petyou/swift-data-structure
|
f65fcc72356c99b583b4632ed45a244774759900
|
6725dae832e21b5845a8b4295ae830a3a062bcd4
|
refs/heads/master
| 2020-09-07T09:58:37.234085 | 2019-12-11T07:51:08 | 2019-12-11T07:51:08 | 220,745,947 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 802 |
swift
|
//
// 237删除链表中的节点.swift
// dataStructure
//
// Created by SGQ on 2019/11/12.
// Copyright © 2019 shigaoqiang. All rights reserved.
//
/*
https://leetcode-cn.com/problems/delete-node-in-a-linked-list/
*/
import Foundation
class LeetCode237 {
static func test(){
let node3 = ListNode.init(next: nil, val: 3)
let node2 = ListNode.init(next: node3, val: 2)
let node1 = ListNode.init(next: node2, val: 1)
let head = ListNode.init(next: node1, val: 0)
print(head)
deleteNode(node: head)
print(head)
}
static func deleteNode(node: ListNode){
if let next = node.next {
node.val = next.val
node.next = next.next
} else {
}
}
}
|
[
-1
] |
10836cf446236fb04e4a8907122a24285b7b8924
|
2d25f4fb3f223187b005243a00e2c3a304d18059
|
/DatabaseApp/AppDelegate.swift
|
543e028ab865e3c5c76a775b4e27f9cfa62e49ee
|
[] |
no_license
|
girijah/native-mobile-app-dev-ios
|
be71bee3b38b33862fb99420bd52604c248bc3da
|
d8380021568ae7ea3d6548fbc7d667c360ea8ef7
|
refs/heads/master
| 2021-03-27T12:47:48.436514 | 2018-05-06T12:51:52 | 2018-05-06T12:51:52 | 121,785,034 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 6,037 |
swift
|
//
// AppDelegate.swift
// DatabaseApp
//
// Created by Girijah Nagarajah on 3/30/18.
// Copyright © 2018 Core Sparker. All rights reserved.
//
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let splitViewController = self.window!.rootViewController as! UISplitViewController
let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController
navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem
splitViewController.delegate = self
let masterNavigationController = splitViewController.viewControllers[0] as! UINavigationController
let controller = masterNavigationController.topViewController as! MasterViewController
controller.managedObjectContext = self.persistentContainer.viewContext
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:.
// Saves changes in the application's managed object context before the application terminates.
self.saveContext()
}
// MARK: - Split view
func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController:UIViewController, onto primaryViewController:UIViewController) -> Bool {
guard let secondaryAsNavController = secondaryViewController as? UINavigationController else { return false }
guard let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController else { return false }
if topAsDetailController.detailItem == nil {
// Return true to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded.
return true
}
return false
}
// MARK: - Core Data stack
lazy var persistentContainer: NSPersistentContainer = {
/*
The persistent container for the application. This implementation
creates and returns a container, having loaded the store for the
application to it. This property is optional since there are legitimate
error conditions that could cause the creation of the store to fail.
*/
let container = NSPersistentContainer(name: "DatabaseApp")
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
/*
Typical reasons for an error here include:
* The parent directory does not exist, cannot be created, or disallows writing.
* The persistent store is not accessible, due to permissions or data protection when the device is locked.
* The device is out of space.
* The store could not be migrated to the current model version.
Check the error message to determine what the actual problem was.
*/
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
return container
}()
// MARK: - Core Data Saving support
func saveContext () {
let context = persistentContainer.viewContext
if context.hasChanges {
do {
try context.save()
} catch {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
let nserror = error as NSError
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
}
}
}
}
|
[
300491
] |
efb7746256202e24242ddb95da2c7ba05aff410b
|
13ba35dac74bf7e1d3d3c9d5bd852b5b88daa151
|
/GolfProfileUITests/GolfProfileUITests.swift
|
36bc9bf58de4bb3046e383e33ec62df3f8382ad6
|
[] |
no_license
|
dcotter1208/GolfProfile
|
9fe4e10159640946c8ab1532b8f0ea6ada987a5a
|
19681060ab649c601c09a00417f6461e2927b88c
|
refs/heads/master
| 2021-01-10T11:53:59.661136 | 2016-01-09T05:45:02 | 2016-01-09T05:45:02 | 45,423,189 | 1 | 0 | null | 2016-01-09T05:45:02 | 2015-11-02T21:27:40 |
Objective-C
|
UTF-8
|
Swift
| false | false | 1,261 |
swift
|
//
// GolfProfileUITests.swift
// GolfProfileUITests
//
// Created by Donovan Cotter on 11/2/15.
// Copyright © 2015 DonovanCotter. All rights reserved.
//
import XCTest
class GolfProfileUITests: 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,
237599,
241695,
223269,
229414,
292901,
354342,
315433,
354346,
325675,
278571,
315431,
124974,
282671,
102446,
229425,
102441,
243763,
313388,
241717,
321589,
180279,
229431,
215095,
319543,
213051,
288829,
325695,
288835,
286787,
307269,
237638,
313415,
239689,
315468,
311373,
333902,
278607,
196687,
311377,
354386,
285362,
329812,
223317,
315477,
354394,
200795,
323678,
321632,
315489,
315488,
45154,
280676,
313446,
227432,
215144,
233578,
194667,
307306,
217194,
288878,
319599,
278637,
278642,
284789,
131190,
284790,
288890,
292987,
215165,
131199,
227459,
194692,
235661,
278669,
241809,
323730,
278676,
311447,
153752,
327834,
284827,
278684,
329884,
299166,
278690,
233635,
215204,
311459,
284840,
299176,
278698,
284843,
184489,
278703,
323761,
184498,
278707,
125108,
180409,
278713,
295099,
258233,
299197,
280761,
280767,
223418,
227517,
299202,
139459,
309443,
176325,
131270,
301255,
299208,
227525,
280779,
233678,
227536,
282832,
321744,
301270,
229591,
280792,
301271,
311520,
325857,
334049,
280803,
182503,
319719,
307431,
338151,
295147,
317676,
286957,
125166,
125170,
313595,
125180,
184574,
125184,
309504,
217352,
125192,
125197,
194832,
227601,
325904,
125200,
125204,
319764,
278805,
334104,
315674,
282908,
299294,
125215,
282912,
233761,
278817,
311582,
211239,
282920,
125225,
317738,
311596,
321839,
315698,
98611,
125236,
332084,
307514,
282938,
278843,
168251,
287040,
319812,
311622,
227655,
280903,
319816,
323914,
201037,
282959,
229716,
289109,
168280,
379224,
323934,
391521,
239973,
381286,
313703,
285031,
416103,
280938,
242027,
242028,
321901,
354671,
278895,
287089,
199030,
227702,
315768,
315769,
291194,
223611,
248188,
139641,
313726,
211327,
291200,
311679,
291193,
240003,
158087,
313736,
227721,
242059,
311692,
285074,
227730,
240020,
190870,
315798,
190872,
291225,
317851,
293275,
285083,
227743,
242079,
293281,
283039,
285089,
305572,
289185,
156069,
301482,
311723,
289195,
377265,
338359,
299449,
311739,
319931,
293309,
278974,
311744,
317889,
291266,
278979,
326083,
278988,
289229,
281038,
326093,
278992,
283088,
281039,
283089,
279000,
242138,
176602,
285152,
291297,
279009,
369121,
195044,
160224,
242150,
279014,
319976,
279017,
188899,
311787,
281071,
319986,
236020,
279030,
311800,
279033,
317949,
279042,
283138,
233987,
287237,
377352,
322057,
309770,
342537,
279053,
182802,
283154,
303634,
279061,
303635,
254487,
279060,
279066,
188954,
322077,
291359,
227881,
293420,
236080,
283185,
279092,
23093,
234037,
244279,
244280,
338491,
234044,
301635,
309831,
322119,
55880,
377419,
303693,
281165,
301647,
281170,
326229,
309847,
189016,
115287,
287319,
332379,
111197,
295518,
287327,
283431,
242274,
244326,
279143,
279150,
281200,
287345,
313970,
287348,
301688,
244345,
189054,
287359,
297600,
303743,
291455,
301702,
164487,
311944,
334473,
279176,
316044,
311948,
184974,
311950,
316048,
311953,
316050,
287379,
326288,
227991,
295575,
289435,
303772,
205469,
221853,
285348,
314020,
279207,
295591,
295598,
279215,
318127,
248494,
293552,
299698,
287412,
166581,
164532,
154295,
342705,
285360,
287418,
303802,
314043,
66243,
291529,
287434,
225996,
363212,
287438,
242385,
303826,
164561,
279253,
158424,
230105,
299737,
322269,
342757,
295653,
289511,
230120,
330473,
234216,
285419,
330476,
289517,
279278,
312046,
215790,
170735,
125683,
230133,
199415,
234233,
242428,
279293,
322302,
289534,
205566,
299777,
291584,
228099,
285443,
291591,
295688,
322312,
285450,
264971,
312076,
326413,
322320,
285457,
295698,
166677,
291605,
283418,
285467,
326428,
221980,
281378,
234276,
318247,
262952,
262953,
279337,
318251,
289580,
262957,
293673,
164655,
301872,
242481,
303921,
234290,
328495,
285493,
230198,
285496,
301883,
201534,
281407,
289599,
295745,
222017,
342846,
293702,
318279,
283466,
281426,
279379,
295769,
201562,
244569,
281434,
322396,
275294,
301919,
230238,
293729,
230239,
279393,
349025,
281444,
279398,
303973,
351078,
177002,
308075,
242540,
242542,
310132,
295797,
201590,
207735,
228214,
295799,
177018,
269179,
279418,
308093,
314240,
291713,
158594,
240517,
287623,
299912,
416649,
279434,
316299,
252812,
228232,
320394,
308111,
189327,
308113,
234382,
293780,
310166,
289691,
209820,
277404,
240543,
283551,
310177,
289699,
189349,
289704,
293801,
279465,
326571,
177074,
304050,
326580,
289720,
326586,
289723,
189373,
213956,
281541,
19398,
345030,
213961,
279499,
56270,
191445,
304086,
183254,
183258,
234469,
314343,
304104,
324587,
183276,
320492,
203758,
320495,
234476,
289773,
287730,
277493,
240631,
320504,
214009,
312313,
312315,
312317,
328701,
328705,
234499,
293894,
320520,
230411,
322571,
320526,
330766,
234513,
238611,
140311,
293911,
316441,
238617,
197658,
330789,
132140,
113710,
189487,
281647,
322609,
312372,
203829,
238646,
300087,
238650,
320571,
21567,
308288,
160834,
336962,
314437,
349254,
238663,
300109,
207954,
234578,
296023,
205911,
314458,
156763,
277600,
281698,
285795,
281699,
214116,
230500,
322664,
228457,
318571,
279659,
234606,
300145,
238706,
312435,
187508,
279666,
300147,
230514,
302202,
285819,
314493,
285823,
150656,
234626,
279686,
222344,
285833,
285834,
318602,
228492,
337037,
234635,
177297,
162962,
187539,
326803,
308375,
324761,
285850,
296091,
119965,
302239,
300192,
330912,
339106,
306339,
234655,
234662,
300200,
249003,
238764,
322733,
208044,
3243,
302251,
279729,
294069,
300215,
294075,
64699,
228541,
283841,
148674,
283846,
312519,
279752,
283849,
148687,
290001,
189651,
316628,
279766,
189656,
279775,
304352,
298209,
304353,
310496,
279780,
228587,
279789,
290030,
302319,
251124,
234741,
283894,
316661,
208123,
292092,
279803,
228608,
320769,
234756,
322826,
242955,
177420,
312588,
318732,
126229,
318746,
320795,
245018,
320802,
130342,
304422,
130344,
292145,
298290,
312628,
300342,
159033,
333114,
333115,
286012,
222523,
181568,
279872,
294210,
216387,
286019,
193858,
279874,
300354,
300355,
304457,
230730,
372039,
294220,
296269,
234830,
224591,
238928,
222542,
296274,
314708,
318804,
283990,
314711,
357720,
300378,
300379,
294236,
234330,
316764,
314721,
292194,
230757,
281958,
314727,
134504,
306541,
314734,
327023,
234864,
312688,
296304,
316786,
230772,
314740,
314742,
327030,
284015,
314745,
290170,
310650,
224637,
306558,
290176,
243073,
179586,
306561,
314752,
294278,
314759,
296328,
298378,
296330,
318860,
314765,
368012,
304523,
292242,
279955,
306580,
314771,
224662,
234902,
282008,
314776,
112019,
318876,
282013,
290206,
148899,
314788,
298406,
314790,
245160,
333224,
282023,
241067,
279979,
314797,
279980,
286128,
279988,
173492,
284086,
286133,
284090,
302523,
228796,
310714,
54719,
302530,
280003,
228804,
310725,
306630,
292291,
300488,
415170,
306634,
280011,
302539,
300490,
310731,
370122,
339403,
329168,
222674,
327122,
280020,
329170,
234957,
312785,
310735,
280025,
310747,
239069,
144862,
286176,
187877,
320997,
310758,
280042,
280043,
191980,
300526,
329198,
337391,
282097,
296434,
308722,
306678,
40439,
191991,
288248,
286201,
300539,
288252,
312830,
233548,
286208,
290304,
245249,
228868,
292359,
323079,
218632,
230922,
302602,
323083,
294413,
304655,
323088,
329231,
282132,
230933,
302613,
316951,
282135,
374297,
302620,
313338,
282147,
222754,
306730,
245291,
312879,
230960,
288305,
239159,
290359,
323132,
235069,
157246,
288319,
288322,
280131,
349764,
310853,
124486,
194118,
288328,
282182,
286281,
292426,
333389,
224848,
224852,
290391,
128600,
306777,
196184,
235096,
239192,
212574,
99937,
204386,
323171,
300643,
300645,
345697,
282214,
312937,
224874,
243306,
204394,
312941,
206447,
310896,
294517,
314997,
288377,
290425,
325246,
333438,
235136,
280193,
282244,
239238,
288391,
286344,
323208,
282248,
179853,
286351,
188049,
239251,
229011,
280217,
323226,
179868,
229021,
302751,
282272,
198304,
282279,
298664,
212649,
298666,
317102,
286387,
300725,
337590,
286392,
300729,
302778,
306875,
280252,
296636,
282302,
280253,
286400,
323265,
323262,
280259,
321220,
282309,
321217,
333508,
239305,
296649,
306891,
212684,
280266,
302798,
9935,
241360,
282321,
313042,
286419,
241366,
280279,
282330,
18139,
294621,
280285,
282336,
321250,
294629,
153318,
333543,
181992,
12009,
337638,
282347,
288492,
282349,
34547,
67316,
323315,
286457,
284410,
288508,
200444,
282366,
286463,
319232,
278273,
288515,
280326,
282375,
323335,
284425,
300810,
282379,
116491,
216844,
280333,
300812,
284430,
161553,
124691,
278292,
118549,
116502,
282390,
278294,
284436,
325403,
321308,
321309,
282399,
241440,
282401,
325411,
315172,
186149,
186148,
241447,
333609,
286507,
294699,
284460,
280367,
300849,
282418,
280373,
282424,
280377,
321338,
319289,
282428,
280381,
345918,
241471,
413500,
280386,
280391,
153416,
315209,
325449,
159563,
280396,
307024,
317268,
237397,
307030,
18263,
241494,
188250,
284508,
300893,
307038,
237411,
284515,
276326,
282471,
296807,
292713,
282476,
292719,
296815,
313200,
325491,
313204,
333687,
317305,
124795,
317308,
339840,
315265,
280451,
327556,
188293,
243590,
282503,
243592,
305032,
325514,
67464,
315272,
315275,
184207,
124816,
311183,
279218,
282517,
294806,
214936,
294808,
337816,
239515,
214943,
298912,
319393,
333727,
294820,
333734,
219046,
284584,
294824,
313257,
298921,
292783,
126896,
200628,
300983,
343993,
288698,
98240,
294849,
214978,
280517,
280518,
214983,
282572,
282573,
153553,
24531,
231382,
329696,
323554,
292835,
6116,
190437,
292838,
294887,
317416,
313322,
298987,
329707,
311277,
296942,
278507,
124912,
327666,
278515,
325620,
239610
] |
d03e960443d0b8588407adad2ef33ef540ffeadb
|
16ae39df2e688eb1b5aae2e3f054adc8ec9f64ef
|
/PlaceAutocomplete/AppDelegate.swift
|
262579d2c60703bd3de7de2dae7a8c4accc867aa
|
[] |
no_license
|
Vossoughi/WeatherApp
|
86969320a2924116cdb4ba166955bd56bd97fee2
|
dd0593988934bfb79d9e311035e22a786d18edf7
|
refs/heads/master
| 2021-01-19T16:43:51.099369 | 2017-08-22T05:11:41 | 2017-08-22T05:11:41 | 101,023,474 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,314 |
swift
|
//
// AppDelegate.swift
// PlaceAutocomplete
//
// Created by Kaveh Vossoughi on 5/15/17.
// Copyright © 2017 Kaveh Vossoughi. All rights reserved.
//
import UIKit
import GooglePlaces
import GooglePlacePicker
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
GMSPlacesClient.provideAPIKey("AIzaSyCusOrnIyxCsUhNQ1wo2pkcCiY8IjSZNBQ")
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,
229388,
294924,
229391,
327695,
229394,
229397,
229399,
229402,
278556,
229405,
229408,
294950,
229415,
229417,
237613,
229422,
229426,
237618,
229428,
311349,
286774,
319544,
204856,
286778,
286776,
229432,
286791,
237640,
278605,
286797,
311375,
237646,
163920,
196692,
319573,
311383,
319590,
311400,
278635,
303212,
278639,
131192,
237693,
327814,
131209,
303241,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
286922,
286924,
319694,
131278,
286926,
131281,
286928,
278743,
278747,
295133,
155872,
131299,
319716,
237807,
303345,
286962,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
311601,
287032,
155966,
278849,
319809,
319810,
319814,
319818,
311628,
229709,
287054,
319822,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
279010,
287202,
279015,
172520,
319978,
279020,
172526,
279023,
311791,
172529,
279027,
319989,
164343,
180727,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
320007,
287238,
172552,
303623,
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,
279124,
172634,
262752,
311911,
189034,
295533,
172655,
172656,
189039,
295538,
189040,
172660,
189044,
287349,
352880,
287355,
287360,
295553,
295557,
287365,
303751,
311942,
352905,
279178,
287371,
311946,
311951,
287377,
287381,
311957,
221850,
287386,
164509,
230045,
287390,
295583,
303773,
287394,
172702,
303780,
172705,
287398,
205479,
279208,
287400,
172707,
295595,
279212,
230061,
172714,
189102,
287409,
172721,
66227,
303797,
189114,
287419,
303804,
328381,
279231,
287423,
328384,
287427,
312006,
107208,
107212,
287436,
172748,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
279258,
303835,
213724,
189149,
303838,
287450,
279267,
312035,
295654,
279272,
230128,
312048,
312050,
230131,
205564,
303871,
230146,
295685,
328453,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
303914,
279340,
205613,
279353,
230202,
312124,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303985,
303987,
328563,
279413,
303991,
303997,
295806,
295808,
295813,
304005,
213895,
304007,
304009,
320391,
304011,
230284,
304013,
295822,
279438,
295825,
189329,
304019,
189331,
58262,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
295873,
213963,
197580,
312272,
304084,
304090,
320481,
320490,
304106,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
230413,
197645,
295949,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
164973,
205934,
312432,
279669,
189562,
337018,
279679,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
165038,
238766,
230576,
238770,
304311,
230592,
279750,
230600,
230607,
148690,
279769,
304348,
279777,
304354,
296163,
279781,
304360,
279788,
320748,
279790,
304370,
320771,
312585,
296202,
296205,
320786,
230674,
296213,
214294,
296215,
320792,
230677,
230681,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
222525,
230718,
296255,
312639,
296259,
378181,
230727,
238919,
320840,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
230763,
410987,
230768,
296305,
230773,
304505,
181626,
304506,
181631,
312711,
312712,
296331,
288140,
230800,
288144,
304533,
337306,
288154,
173472,
288160,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
279985,
312755,
296373,
279991,
312759,
288185,
337335,
222652,
173507,
296389,
222665,
230860,
312783,
230865,
148946,
288210,
222676,
370130,
280021,
288212,
288214,
239064,
288217,
288218,
280027,
288220,
329177,
239070,
288224,
288226,
370146,
280036,
288229,
280038,
288230,
288232,
280034,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
296446,
321022,
402942,
206336,
296450,
148990,
230916,
230919,
214535,
230923,
304651,
370187,
304653,
230940,
222752,
108066,
296486,
296488,
157229,
230961,
157236,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
370272,
181854,
239202,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
190118,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
280260,
206536,
280264,
206539,
206541,
280276,
313044,
321239,
280283,
18140,
288478,
313055,
321252,
313066,
288494,
280302,
280304,
313073,
419570,
288499,
288502,
288510,
124671,
67330,
280324,
198405,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
304968,
280393,
280402,
173907,
313176,
280419,
321381,
296812,
313201,
1920,
255873,
305028,
247688,
280458,
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,
239586,
313320,
231404,
124913,
165876,
321528,
239612,
288764,
239617,
313347,
288773,
313358,
321560,
305176,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
378941,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
223327,
280671,
321634,
149603,
329830,
280681,
313451,
223341,
280687,
215154,
280691,
313458,
313464,
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,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
305464,
280888,
280891,
289087,
108865,
280897,
280900,
239944,
305480,
280906,
239947,
305485,
305489,
379218,
280919,
354653,
313700,
280937,
313705,
190832,
280946,
223606,
313720,
280956,
280959,
313731,
240011,
199051,
289166,
240017,
297363,
190868,
297365,
240021,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289221,
289227,
281045,
281047,
166378,
305647,
281075,
174580,
281084,
240124,
305662,
305664,
240129,
305666,
240132,
223749,
305668,
281095,
338440,
150025,
223752,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
289317,
281127,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
199262,
338528,
338532,
281190,
199273,
281196,
19053,
158317,
313973,
281210,
297594,
158347,
133776,
240275,
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,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
183172,
158596,
338823,
322440,
314249,
240519,
183184,
289687,
240535,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
281567,
289762,
322534,
297961,
183277,
281581,
322550,
134142,
322563,
175134,
322599,
322610,
314421,
281654,
314427,
207937,
314433,
314441,
207949,
322642,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
308373,
248995,
306341,
306344,
306347,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
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,
306555,
298365,
290174,
314747,
224641,
281987,
298372,
314756,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
224657,
306581,
314779,
314785,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
290298,
151036,
290302,
282111,
290305,
175621,
192008,
323084,
257550,
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,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282255,
282261,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
282295,
282300,
323260,
323266,
282310,
323273,
282319,
306897,
241362,
306904,
282328,
298714,
52959,
282337,
216801,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
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,
282465,
110433,
241509,
110438,
298860,
110445,
282478,
282481,
110450,
315251,
315249,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
282514,
298898,
241556,
298901,
241560,
282520,
241563,
241565,
241567,
241569,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
290739,
282547,
241588,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
315482,
217179,
315483,
192605,
233567,
200801,
299105,
217188,
299109,
315495,
307303,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
241813,
307352,
299164,
299167,
184479,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
299185,
323763,
299191,
176311,
307385,
184503,
258235,
176316,
307388,
307386,
307390,
299200,
184512,
307394,
299204,
307396,
184518,
323784,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
184586,
282893,
291089,
282906,
233766,
299304,
176435,
307508,
168245,
307510,
332086,
315701,
307515,
282942,
307518,
282947,
282957,
110926,
323917,
233808,
323921,
315733,
323926,
233815,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
291197,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
291226,
242075,
283033,
291231,
61855,
283042,
291238,
291241,
127403,
127405,
291247,
299440,
127407,
299444,
127413,
291254,
283062,
127417,
291260,
127421,
283069,
127424,
299457,
127429,
127431,
127434,
127440,
176592,
315856,
315860,
176597,
127447,
127449,
299481,
176605,
160221,
127455,
242143,
127457,
291299,
127460,
127463,
242152,
291305,
127466,
176620,
127469,
291314,
127474,
291317,
127480,
135672,
291323,
233979,
127490,
291330,
127494,
283142,
127497,
135689,
233994,
127500,
291341,
233998,
234003,
127509,
234006,
127511,
152087,
283161,
234010,
242202,
135707,
242206,
135710,
242208,
291361,
135717,
242220,
291378,
234038,
152118,
234041,
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,
242343,
209576,
242345,
373421,
299706,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
226008,
242396,
299740,
201444,
299750,
283368,
234219,
283372,
381677,
226037,
283382,
234231,
316151,
234236,
226045,
234239,
242431,
209665,
299778,
234242,
242436,
234246,
226056,
291593,
234248,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
348950,
234264,
201496,
234266,
283421,
234269,
234272,
234274,
152355,
299814,
234278,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
160572,
283452,
234302,
234307,
242499,
234309,
234313,
316233,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
234338,
242530,
349027,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
234364,
291711,
234368,
291714,
234370,
291716,
234373,
226182,
234375,
226185,
308105,
234379,
234384,
234388,
234390,
226200,
234393,
209818,
308123,
234396,
324504,
291742,
324508,
234401,
291747,
291748,
234405,
291750,
234407,
324518,
324520,
291754,
324522,
226220,
291756,
234414,
324527,
291760,
299952,
234417,
324531,
201650,
226230,
234422,
324536,
275384,
234428,
291773,
234431,
242623,
324544,
234434,
324546,
226239,
226245,
234437,
324548,
234439,
234443,
291788,
234446,
275406,
193486,
234449,
193488,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
324599,
234490,
234493,
234496,
316416,
234501,
308231,
234504,
234507,
234510,
234515,
300054,
234519,
234520,
316439,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
234549,
300085,
300088,
234553,
234556,
234558,
316479,
234561,
160835,
234563,
308291,
316483,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
234585,
275545,
242777,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
234607,
160879,
275569,
234610,
300148,
234614,
398455,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
226453,
275606,
234647,
234648,
275608,
234650,
308379,
324757,
234653,
283805,
119967,
300189,
234657,
324768,
324766,
242852,
300197,
283813,
234661,
234664,
275626,
234667,
316596,
308414,
234687,
300226,
308418,
234692,
283844,
300229,
308420,
283850,
300234,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
161003,
300267,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
292097,
300289,
300292,
300294,
275719,
234760,
177419,
300299,
300301,
242957,
275725,
177424,
283917,
349464,
283939,
259367,
292143,
283951,
300344,
226617,
243003,
283963,
226628,
300357,
177482,
283983,
316758,
357722,
316766,
292192,
218464,
316768,
292197,
316774,
243046,
218473,
136562,
324978,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
226699,
316811,
316814,
226703,
300433,
234899,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
284076,
144812,
144814,
144820,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
227430,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
300507,
103899,
333280,
218597,
292329,
300523,
259565,
300527,
259567,
308720,
292338,
226802,
316917,
308727,
300537,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
284213,
194101,
194103,
316983,
284215,
284218,
226877,
284223,
284226,
243268,
292421,
284228,
226886,
284231,
128584,
284234,
276043,
317004,
366155,
284238,
226895,
284241,
194130,
292433,
300628,
284245,
284243,
284247,
276053,
235097,
243290,
284249,
284251,
284253,
300638,
284255,
317015,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
292470,
276086,
284278,
292473,
284283,
276093,
284286,
292479,
276095,
292481,
284288,
276098,
284292,
284290,
292485,
325250,
284297,
317066,
284299,
317068,
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,
284358,
276166,
358089,
284362,
276170,
276175,
284368,
276177,
317138,
284370,
358098,
284372,
284377,
276187,
284379,
284381,
284384,
284386,
358116,
276197,
317158,
284392,
325353,
284394,
358122,
284397,
276206,
284399,
358128,
358126,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
284418,
317187,
358146,
317191,
284428,
300816,
300819,
317207,
300828,
300830,
276255,
300832,
325408,
227109,
317221,
358183,
186151,
276268,
300845,
243504,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
153417,
292681,
358224,
284499,
276308,
178006,
284502,
317271,
276315,
292700,
317279,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
284564,
358292,
284566,
350106,
284572,
276386,
284579,
276388,
292776,
358312,
284585,
317353,
276395,
292784,
276402,
161718,
358326,
358330,
276411,
276418,
276425,
276433,
301009,
301011,
301013,
292823,
301015,
358360,
301017,
292828,
276446,
276448,
153568,
276455,
292839,
292843,
276460,
292845,
178161,
227314,
276466,
276472,
325624,
317435,
276476,
276479,
276482,
276485,
276490,
292876,
276496,
317456,
317458,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
243762,
309298,
325685,
325689,
235579,
276539,
235581,
178238,
325692,
276544,
284739,
292934,
243785,
350293,
350295,
194649,
227418,
309337,
194654,
227423,
350302,
178273,
227426,
276579,
194660,
309346,
309348,
276583,
309350,
350308,
276586,
309354,
350313,
350316,
276590,
301167,
227440,
350321,
284786,
276595,
301163,
350325,
350328,
292985,
301178,
292989,
292993,
317570,
350339,
301185,
317573,
350342,
276617,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
276638,
350366,
153765,
284837,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
227522,
350402,
301252,
350406,
227529,
301258,
309450,
276685,
276689,
309462,
301272,
276699,
309468,
194780,
309471,
301283,
317672,
325867,
243948,
194801,
227571,
309491,
309494,
243960,
227583,
276735,
276739,
211204,
276742,
227596,
325910,
342298,
309530,
211232,
317729,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
293346,
276964,
293352,
236013,
293364,
293370,
301562,
317951,
309764,
301575,
121352,
236043,
317963,
342541,
55822,
113167,
277011,
309779,
309781,
317971,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
129603,
318020,
301636,
301639,
301643,
285265,
399955,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
309871,
121458,
170618,
170619,
309885,
309888,
277122,
146052,
227975,
277128,
285320,
301706,
318092,
326285,
318094,
334476,
277136,
277139,
227992,
285340,
318108,
227998,
318110,
137889,
383658,
285357,
318128,
277170,
293555,
318132,
154292,
277173,
342707,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
137946,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
277232,
228081,
56059,
310015,
285441,
310020,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
285474,
293666,
228135,
318248,
277291,
293677,
318253,
285489,
293685,
285494,
301880,
285499,
301884,
293696,
310080,
277314,
277317,
293706,
277322,
277329,
162643,
310100,
301911,
277337,
301913,
301921,
400236,
236397,
162671,
326514,
310134,
236408,
277368,
15224,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
310179,
293798,
293802,
236460,
277426,
293811,
293817,
293820,
203715,
326603,
293849,
293861,
228327,
228328,
318442,
277486,
326638,
318450,
293876,
293877,
285686,
56313,
121850,
302075,
244731,
293882,
302073,
285690,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
293960,
277577,
310344,
277583,
203857,
293971,
310359,
236632,
277594,
138332,
277598,
285792,
277601,
203872,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
285817,
367737,
285821,
302205,
253064,
302218,
285835,
294026,
162964,
384148,
187542,
302231,
302233,
285849,
285852,
302237,
285854,
285856,
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,
310486,
302294,
302296,
384222,
310498,
285927,
318698,
302315,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
285958,
138505,
228617,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
277804,
277807,
285999,
113969,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
294211,
302403,
384328,
277832,
277836,
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,
310659,
294276,
277892,
327046,
277894,
253320,
310665,
277898,
318858,
351619,
277903,
310672,
277905,
351633,
277908,
277917,
277921,
310689,
130468,
228776,
277928,
277932,
310703,
277937,
130486,
310710,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
64966,
302534,
310727,
245191,
277959,
277963,
292968,
302541,
277966,
302543,
310737,
277971,
286169,
163290,
228825,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
286188,
310764,
278000,
228851,
310772,
278003,
278006,
212472,
40440,
278009,
286203,
310780,
40443,
228864,
286214,
228871,
302603,
302614,
286233,
302617,
286240,
146977,
294435,
40484,
187939,
286246,
294439,
294440,
278057,
40486,
294443,
40488,
294445,
286248,
40491,
310831,
40502,
212538,
40507,
40511,
40513,
228933,
327240,
40521,
286283,
40525,
40527,
212560,
228944,
400976,
40533,
147032,
40537,
278109,
40541,
40544,
40548,
40550,
286312,
40552,
286313,
40554,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
122517,
278168,
327333,
229030,
212648,
302764,
278188,
278192,
319153,
278196,
319171,
302789,
294599,
278216,
294601,
302793,
212690,
278227,
229076,
286420,
319187,
286425,
319194,
278235,
229086,
278238,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
294682,
278306,
188199,
294701,
319280,
278320,
319290,
229192,
302925,
188247,
237409,
294776,
360317,
294785,
327554,
40840,
294803,
40851,
188312,
294811,
319390,
40865,
294817,
319394,
294821,
180142,
294831,
188340,
40886,
319419,
294844,
294847,
309352,
24528,
393177,
294876,
294879,
294883,
294890,
311279,
278513,
237555,
311283,
278516,
237562
] |
e2a9d1a98514f9b932ba392c140684dda0944d4e
|
d4f9d9a471c25c430450663a18aaf57aca7fe9bc
|
/MasterDetailsApplication/AppDelegate.swift
|
377c5b1307492e255aca71a513816686046acc81
|
[] |
no_license
|
RomisaaAttiaa/IOS
|
7af63aaa143f81e858ac72eb0a5e3720aba98dd7
|
5bdb17005f009bee775e15203edb820b3ef456fd
|
refs/heads/master
| 2021-06-18T02:45:03.264423 | 2017-06-04T12:00:48 | 2017-06-04T12:00:48 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,652 |
swift
|
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let splitViewController = self.window!.rootViewController as! UISplitViewController
let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController
navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem
splitViewController.delegate = self
return true
}
func applicationWillResignActive(_ application: UIApplication) {
}
func applicationDidEnterBackground(_ application: UIApplication) {
}
func applicationWillEnterForeground(_ application: UIApplication) {
}
func applicationDidBecomeActive(_ application: UIApplication) {
}
func applicationWillTerminate(_ application: UIApplication) {
}
// MARK: - Split view
func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController:UIViewController, onto primaryViewController:UIViewController) -> Bool {
guard let secondaryAsNavController = secondaryViewController as? UINavigationController else { return false }
guard let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController else { return false }
if topAsDetailController.detailItem == nil {
return true
}
return false
}
// MARK: - Core Data stack
lazy var persistentContainer: NSPersistentContainer = {
let container = NSPersistentContainer(name: "MasterDetailsApplication")
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
return container
}()
func saveContext () {
let context = persistentContainer.viewContext
if context.hasChanges {
do {
try context.save()
} catch {
let nserror = error as NSError
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
}
}
}
}
|
[
-1
] |
b03b141f480b9fe1b2314fcddad2ab55ffb61044
|
f8a36cc868e5778b9b1e1f336cca11a37a27dfa1
|
/NStackSDK/NStackSDK/Classes/Managers/ValidationManager.swift
|
4d7492ae925a6f26ab79db3ad2c6f7e7d1b59791
|
[
"MIT"
] |
permissive
|
nharbo/nstack-ios-sdk
|
3a110ddbb905c3a352e8418f192e7b6f578f6a30
|
7f9db4ccf7e414b37da88f635f7677ac3cc7797c
|
refs/heads/master
| 2020-09-20T04:53:16.151289 | 2019-11-12T11:32:59 | 2019-11-12T11:32:59 | 224,381,368 | 0 | 0 |
MIT
| 2020-02-07T10:20:16 | 2019-11-27T08:28:38 | null |
UTF-8
|
Swift
| false | false | 948 |
swift
|
//
// ValidationManager.swift
// NStackSDK
//
// Created by Andrew Lloyd on 28/06/2019.
// Copyright © 2019 Nodes ApS. All rights reserved.
//
import Foundation
public class ValidationManager {
// MARK: - Properites
internal var repository: ValidationRepository
// MARK: - Init
init(repository: ValidationRepository) {
self.repository = repository
}
/// Validate an email.
///
/// - Parameters
/// email: A string to be validated as a email
/// completion: Completion block when the API call has finished.
func validateEmail(_ email: String, completion: @escaping ((_ valid: Bool, _ error: Error?) -> Void)) {
repository.validateEmail(email) { (result) in
switch result {
case .success(let data):
completion(data.ok, nil)
case .failure(let error):
completion(false, error)
}
}
}
}
|
[
-1
] |
66e378c6c5e8501e24fe269188be2ddbf0c10516
|
cd7fb33da815a24c17d29de079948ea35623a070
|
/CardsRandom/Card.swift
|
ba0789bcbb0a33904f62a37e20fc9d4b4a3a9877
|
[] |
no_license
|
kilik42/randomCards
|
53395ca54a016904d988f54c00189f2c4e2b4a5a
|
9dcf06d7301d261aeeedd2d51c6890f56b1d5794
|
refs/heads/master
| 2022-07-03T16:29:41.287234 | 2020-05-17T19:05:20 | 2020-05-17T19:05:20 | 264,737,377 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,938 |
swift
|
//
// Card.swift
// CardsRandom
//
// Created by marvin evins on 5/17/20.
// Copyright © 2020 websavantmedia. All rights reserved.
//
import UIKit
struct Card{
static var allValues = [
UIImage(named: "2H")!,
UIImage(named: "3H")!,
UIImage(named: "4H")!,
UIImage(named: "5H")!,
UIImage(named: "6H")!,
UIImage(named: "7H")!,
UIImage(named: "8H")!,
UIImage(named: "9H")!,
UIImage(named: "10H")!,
UIImage(named: "JH")!,
UIImage(named: "QH")!,
UIImage(named: "KH")!,
UIImage(named: "AH")!,
UIImage(named: "2S")!,
UIImage(named: "3S")!,
UIImage(named: "4S")!,
UIImage(named: "5S")!,
UIImage(named: "6S")!,
UIImage(named: "7S")!,
UIImage(named: "8S")!,
UIImage(named: "9S")!,
UIImage(named: "10S")!,
UIImage(named: "JS")!,
UIImage(named: "QS")!,
UIImage(named: "KS")!,
UIImage(named: "AS")!,
UIImage(named: "2D")!,
UIImage(named: "3D")!,
UIImage(named: "4D")!,
UIImage(named: "5D")!,
UIImage(named: "6D")!,
UIImage(named: "7D")!,
UIImage(named: "8D")!,
UIImage(named: "9D")!,
UIImage(named: "10D")!,
UIImage(named: "JD")!,
UIImage(named: "QD")!,
UIImage(named: "KD")!,
UIImage(named: "AD")!,
UIImage(named: "2C")!,
UIImage(named: "3C")!,
UIImage(named: "4C")!,
UIImage(named: "5C")!,
UIImage(named: "6C")!,
UIImage(named: "7C")!,
UIImage(named: "8C")!,
UIImage(named: "9C")!,
UIImage(named: "10C")!,
UIImage(named: "JC")!,
UIImage(named: "QC")!,
UIImage(named: "KC")!,
UIImage(named: "AC")!,
]
}
|
[
-1
] |
282a96a05d8664f0addb63c52d0216ae7c0f2c40
|
8bfd2a9f1db0298f0f3c0e4c60ee322f78b14603
|
/SwiftUI_Presentation.playground/Pages/Giris.xcplaygroundpage/Contents.swift
|
2318f2a41de9d0d6eb3be27d4ac19bdbc2c2f5d3
|
[
"MIT"
] |
permissive
|
barisuyar/SwiftUI-Presentation
|
4aa09d0cd136e23ff9d61394514a8aaf7f189828
|
7888ab139f7cc3e060fdc0def9d5df5683d5a656
|
refs/heads/master
| 2020-09-02T03:59:31.647449 | 2019-12-12T05:22:49 | 2019-12-12T05:22:49 | 219,128,434 | 2 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 108 |
swift
|
/*:
# SwiftUI
* [Giriş](SwiftUI)
* [View vs UIView](View%20vs%20UIView)
* [State](State)
*/
|
[
18165
] |
8dc4ef3f08984c5b997146e4de718c34b7e20150
|
655b71491b6dd1d78d0f171d0249e63e29d26e02
|
/TicTacToe/ViewController.swift
|
e7f7b5d9d89a276ccbb98a96c87a8a2d5c2b5a29
|
[] |
no_license
|
edmund-h/swift-DayOneTicTacToe-lab-ios-0217
|
04570d55d56d164e9d316912b4d30ed17e45d361
|
da81cd34256fa5a1dd552d5e0e4accbefe953686
|
refs/heads/master
| 2021-01-22T03:06:27.114761 | 2017-02-07T15:39:17 | 2017-02-07T15:39:17 | 81,102,126 | 0 | 0 | null | 2017-02-06T15:35:52 | 2017-02-06T15:35:51 | null |
UTF-8
|
Swift
| false | false | 1,690 |
swift
|
//
// ViewController.swift
// TicTacToe
//
// Created by Jim Campagno on 2/5/17.
// Copyright © 2017 Jim Campagno. All rights reserved.
//
import UIKit
class ViewController: UIViewController, BoardDelegate {
@IBOutlet weak var boardZero: Board!
@IBOutlet weak var boardOne: Board!
@IBOutlet weak var boardTwo: Board!
@IBOutlet weak var boardThree: Board!
@IBOutlet weak var boardFour: Board!
@IBOutlet weak var boardFive: Board!
@IBOutlet weak var boardSix: Board!
@IBOutlet weak var boardSeven: Board!
@IBOutlet weak var boardEight: Board!
var allBoards: [Board] {
return [boardZero, boardOne, boardTwo, boardThree, boardFour, boardFive, boardSix, boardSeven, boardEight]
}
override func viewDidLoad() {
super.viewDidLoad()
initialSetup()
}
func initialSetup() { //sets up each board with a .position property equal to their numbered name
var boardPosition = 0
for board in allBoards {
board.position = boardPosition
board.delegate = self
//board.makeGame()
boardPosition += 1
}
}
func playerTurn(board: Board, position: Int) -> Player {
//beginning of ultimate tictactoe logic
var score: [String] = []
for myBoard in allBoards {
if let myWinner = myBoard.winner {
score.append(myWinner.string)
} else {score.append ("")}
}
let metagame = Game ()
//more uttt goes here
return board.game.setSquare(myLocation: position)
}
}
|
[
-1
] |
a08245b35dc82941dc42104f9c3da153d0bcbfae
|
47eda364078f3a9c8d944c47f8adbab36ea2dc0f
|
/SwiftCalc/SwiftCalc/ViewController.swift
|
53cf7253f3eeca3ee3b45a9b52f644ed6b51670a
|
[] |
no_license
|
aldoalexismendez/ios-decal-hw2
|
47d09dc7583ebdf527b19b70b54363c4d0e82d41
|
2c70b0d42b707def84f1770e657cb45533ee3346
|
refs/heads/master
| 2021-01-11T07:27:13.422134 | 2016-10-06T06:58:49 | 2016-10-06T06:58:49 | 69,290,602 | 0 | 0 | null | 2016-09-26T20:36:35 | 2016-09-26T20:36:34 | null |
UTF-8
|
Swift
| false | false | 13,210 |
swift
|
//
// ViewController.swift
// SwiftCalc
//
// Created by Zach Zeleznick on 9/20/16.
// Copyright © 2016 zzeleznick. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
// MARK: Width and Height of Screen for Layout
var w: CGFloat!
var h: CGFloat!
// IMPORTANT: Do NOT modify the name or class of resultLabel.
// We will be using the result label to run autograded tests.
// MARK: The label to display our calculations
var resultLabel = UILabel()
// TODO: This looks like a good place to add some data structures.
// One data structure is initialized below for reference.
var sequence: [String] = []
var currentValue: String = ""
var lastButtonIsOperator: Bool = false
override func viewDidLoad() {
super.viewDidLoad()
view = UIView(frame: UIScreen.main.bounds)
view.backgroundColor = UIColor(white: 1.0, alpha: 1.0)
w = view.bounds.size.width
h = view.bounds.size.height
navigationItem.title = "Calculator"
// IMPORTANT: Do NOT modify the accessibilityValue of resultLabel.
// We will be using the result label to run autograded tests.
resultLabel.accessibilityValue = "resultLabel"
makeButtons()
// Do any additional setup here.
resultLabel.text! = ""
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// TODO: A method to update your data structure(s) would be nice.
// Modify this one or create your own.
func updateSequence(_ content: String) {
sequence.append(content)
}
// TODO: Ensure that resultLabel gets updated.
// Modify this one or create your own.
func updateResultLabel(_ content: String, replaceResultLabel: Bool) {
if !replaceResultLabel {
if resultLabel.text!.characters.count < 7 {
resultLabel.text = resultLabel.text! + content
}
} else {
resultLabel.text = content
}
}
// TODO: A calculate method with no parameters, scary!
// Modify this one or create your own.
func calculate() -> String { // rewrite to handle double + double, int + double
//return String(intCalculate(a: first_button,b: second_button, operation: single_operator))
print(sequence)
simplifySequence()
print(sequence)
var result: String = String(doubleCalculate(a: sequence[0], b: sequence[2], operation: sequence[1]))
//result = String(intCalculate(a: Int(sequence[0])!, b: Int(sequence[2])!, operation: sequence[1]))
var count: Int = 3
while count < sequence.count {
//result = String(intCalculate(a: Int(result)!, b: Int(sequence[count + 1])!, operation: sequence[count]))
result = String(doubleCalculate(a: result, b: sequence[count + 1], operation: sequence[count]))
let isInteger = floor(Double(result)!) == Double(result)!
if isInteger == true {
result = String(Int(result)!)
}
count = count + 2
}
let isInteger = floor(Double(result)!) == Double(result)!
if isInteger == true {
result = String(Int(Double(result)!))
}
updateResultLabel(result, replaceResultLabel: true)
sequence = [result]
return result
}
//
func simplifySequence() {// simplifies sequence into [number, operator, number, operator,...]
var simplifiedSequence: [String] = []
var beginNumber: String = ""
var counter: Int = 0
// CMND + /
// for item in sequence {
// counter = counter + 1
// if Int(item) != nil { //Next element is a number
// beginNumber = beginNumber + item
// } else{ //Next element if an operator
// if beginNumber != "0"{
// simplifiedSequence.append(beginNumber)
// }
// simplifiedSequence.append(item)
// beginNumber = ""
// }
// if counter == sequence.count { //Since last element should be a number, we could hardcode the last number
// simplifiedSequence.append(beginNumber)
// }
// }
// sequence = simplifiedSequence
var itemBefore: String = "" //Used to see if number has been negated
for item in sequence {
counter = counter + 1
if Int(item) != nil { //Next element is a number
if itemBefore == "+/-" {
beginNumber = String((-1)*Int(beginNumber)!)
}
beginNumber = beginNumber + item
itemBefore = item
} else{ //Next element if an operator
print(item)
if item == "+/-" {
beginNumber = String((-1)*Int(beginNumber)!)
print(beginNumber)
} else {
//if beginNumber != "0"{
simplifiedSequence.append(beginNumber)
//}
simplifiedSequence.append(item)
beginNumber = ""
itemBefore = item
}
}
if counter == sequence.count {
//if item == "+/-" {
// beginNumber = String((-1)*Int(beginNumber)!)
//}
simplifiedSequence.append(beginNumber)
}
}
sequence = simplifiedSequence
}
// TODO: A simple calculate method for integers.
// Modify this one or create your own.
func intCalculate(a: Int, b:Int, operation: String) -> Int {
print("Calculation requested for \(a) \(operation) \(b)")
if operation == "+" {
return a + b
} else if operation == "-" {
return a - b
} else if operation == "/" {
return a/b
} else {
return a*b
}
}
// TODO: A general calculate method for doubles
// Modify this one or create your own.
func doubleCalculate(a: String, b:String, operation: String) -> Double {
print("Calculation requested for \(a) \(operation) \(b)")
let aDouble: Double = Double(a)!
let bDouble: Double = Double(b)!
if operation == "+" {
return aDouble + bDouble
} else if operation == "-" {
return aDouble - bDouble
} else if operation == "/" {
return aDouble/bDouble
} else {
return aDouble*bDouble
}
}
// REQUIRED: The responder to a number button being pressed.
func numberPressed(_ sender: CustomButton) {
guard Int(sender.content) != nil else { return }
print("The number \(sender.content) was pressed")
// Fill me in!
sequence.append(sender.content)
if resultLabel.text == "0" || lastButtonIsOperator == true {
updateResultLabel(sender.content, replaceResultLabel: true)
} //else if lastButtonIsOperator == true {
//updateResultLabel(sender.content, replaceResultLabel: true)
//}
else {
updateResultLabel(sender.content, replaceResultLabel: false)
}
lastButtonIsOperator = false
}
// REQUIRED: The responder to an operator button being pressed.
func operatorPressed(_ sender: CustomButton) {
// Fill me in!
print("The operator \(sender.content) was pressed")
lastButtonIsOperator = true
if sender.content == "=" {
currentValue = calculate()
//single_operator = ""
//sequence = []
updateResultLabel(currentValue, replaceResultLabel: true)
} else if sender.content == "C" {
//single_operator = ""
sequence = []
updateResultLabel("0", replaceResultLabel: true)
} else if sender.content == "+/-" {
updateResultLabel(String((-1)*Int(resultLabel.text!)!), replaceResultLabel: true)
sequence.append(sender.content)
}
else {
// if Int(sequence.last!) != nil{ //Is an integer
// if sequence.count > 2 {
// sequence = [calculate()] + sequence
// }
// }
if sequence.contains("+") || sequence.contains("-") || sequence.contains("*") || sequence.contains("/") {
currentValue = calculate()
}
updateSequence(sender.content)
updateResultLabel(currentValue, replaceResultLabel: true)
}
}
// REQUIRED: The responder to a number or operator button being pressed.
func buttonPressed(_ sender: CustomButton) {
// Fill me in!
if sender.content == "0" {
updateSequence(sender.content)
} else if sender.content == "." {
updateSequence(".")
}
}
// IMPORTANT: Do NOT change any of the code below.
// We will be using these buttons to run autograded tests.
func makeButtons() {
// MARK: Adds buttons
let digits = (1..<10).map({
return String($0)
})
let operators = ["/", "*", "-", "+", "="]
let others = ["C", "+/-", "%"]
let special = ["0", "."]
let displayContainer = UIView()
view.addUIElement(displayContainer, frame: CGRect(x: 0, y: 0, width: w, height: 160)) { element in
guard let container = element as? UIView else { return }
container.backgroundColor = UIColor.black
}
displayContainer.addUIElement(resultLabel, text: "0", frame: CGRect(x: 70, y: 70, width: w-70, height: 90)) {
element in
guard let label = element as? UILabel else { return }
label.textColor = UIColor.white
label.font = UIFont(name: label.font.fontName, size: 60)
label.textAlignment = NSTextAlignment.right
}
let calcContainer = UIView()
view.addUIElement(calcContainer, frame: CGRect(x: 0, y: 160, width: w, height: h-160)) { element in
guard let container = element as? UIView else { return }
container.backgroundColor = UIColor.black
}
let margin: CGFloat = 1.0
let buttonWidth: CGFloat = w / 4.0
let buttonHeight: CGFloat = 100.0
// MARK: Top Row
for (i, el) in others.enumerated() {
let x = (CGFloat(i%3) + 1.0) * margin + (CGFloat(i%3) * buttonWidth)
let y = (CGFloat(i/3) + 1.0) * margin + (CGFloat(i/3) * buttonHeight)
calcContainer.addUIElement(CustomButton(content: el), text: el,
frame: CGRect(x: x, y: y, width: buttonWidth, height: buttonHeight)) { element in
guard let button = element as? UIButton else { return }
button.addTarget(self, action: #selector(operatorPressed), for: .touchUpInside)
}
}
// MARK: Second Row 3x3
for (i, digit) in digits.enumerated() {
let x = (CGFloat(i%3) + 1.0) * margin + (CGFloat(i%3) * buttonWidth)
let y = (CGFloat(i/3) + 1.0) * margin + (CGFloat(i/3) * buttonHeight)
calcContainer.addUIElement(CustomButton(content: digit), text: digit,
frame: CGRect(x: x, y: y+101.0, width: buttonWidth, height: buttonHeight)) { element in
guard let button = element as? UIButton else { return }
button.addTarget(self, action: #selector(numberPressed), for: .touchUpInside)
}
}
// MARK: Vertical Column of Operators
for (i, el) in operators.enumerated() {
let x = (CGFloat(3) + 1.0) * margin + (CGFloat(3) * buttonWidth)
let y = (CGFloat(i) + 1.0) * margin + (CGFloat(i) * buttonHeight)
calcContainer.addUIElement(CustomButton(content: el), text: el,
frame: CGRect(x: x, y: y, width: buttonWidth, height: buttonHeight)) { element in
guard let button = element as? UIButton else { return }
button.backgroundColor = UIColor.orange
button.setTitleColor(UIColor.white, for: .normal)
button.addTarget(self, action: #selector(operatorPressed), for: .touchUpInside)
}
}
// MARK: Last Row for big 0 and .
for (i, el) in special.enumerated() {
let myWidth = buttonWidth * (CGFloat((i+1)%2) + 1.0) + margin * (CGFloat((i+1)%2))
let x = (CGFloat(2*i) + 1.0) * margin + buttonWidth * (CGFloat(i*2))
calcContainer.addUIElement(CustomButton(content: el), text: el,
frame: CGRect(x: x, y: 405, width: myWidth, height: buttonHeight)) { element in
guard let button = element as? UIButton else { return }
button.addTarget(self, action: #selector(buttonPressed), for: .touchUpInside)
}
}
}
}
|
[
-1
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.