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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e95fd4a9322829d1ccc987eabfabcf664ff8fe10 | 0c7011928c4849f3640e6b8cb408d6f7e67829e7 | /اسقني/view controller/AddedPlantsToReminderVC.swift | 1b6ce92322a9133a62df3c5b8a4bf184c3276e24 | [] | no_license | 92-BadriyaMousaAlajmi/water-me- | b789f934cefd4f3dc438bd411005eb8457881c09 | 284a9c1ea45313e747ef2437542de4d321cbfbfc | refs/heads/master | 2022-11-21T00:43:58.404361 | 2020-07-20T01:04:00 | 2020-07-20T01:04:00 | 280,957,864 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,979 | swift | //
// AddedPlantsToReminderVC.swift
// اسقني
//
// Created by بدرية موسى العجمي on 7/20/20.
// Copyright © 2020 Moon. All rights reserved.
//
import UIKit
class AddedPlantsToReminderVC: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Uncomment the following line to preserve selection between presentations
// self.clearsSelectionOnViewWillAppear = false
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem
}
// MARK: - Table view data source
override func numberOfSections(in tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 0
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return 0
}
/*
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath)
// Configure the cell...
return cell
}
*/
/*
// Override to support conditional editing of the table view.
override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the specified item to be editable.
return true
}
*/
/*
// Override to support editing the table view.
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, 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.destination.
// Pass the selected object to the new view controller.
}
*/
}
| [
294401,
253315,
278662,
318729,
302858,
318730,
374286,
312591,
123646,
374289,
336148,
290330,
319773,
248990,
336157,
279327,
332323,
282918,
292141,
249775,
281140,
316725,
125110,
343225,
292155,
285243,
288190,
290167,
176710,
322635,
302924,
253140,
310741,
275541,
207957,
357080,
357084,
167390,
307041,
312673,
311652,
340709,
357093,
357094,
340712,
295784,
292333,
292334,
290158,
290159,
292337,
290162,
290163,
290164,
290165,
125175,
290168,
294525,
124670
] |
a7020b6854fbdc27098c78b70ad45ba956035c2d | e084c5d721c06ba0e3d7deb8ac5952156af07cda | /PiperChat/log.swift | fb6e9616a56783dc561ff5a73d5f5a08d878a900 | [] | no_license | allenx/PiperChat | 977230e53d1d0e364cf7818982dfe3d0d12f9edf | e7ec7a7d8283eba4e5fe6b9dd2f78807db3f547d | refs/heads/master | 2020-12-30T11:28:56.846259 | 2017-07-05T06:22:54 | 2017-07-05T06:22:54 | 91,571,454 | 3 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,075 | swift | //
// log.swift
// WePeiYang
//
// Created by Allen X on 8/8/16.
// Copyright © 2016 Qin Yubo. All rights reserved.
//
//TODO: Make this only availible in Debug Mode because printing actually stalls the app
import Foundation
enum log {
case errorMessage(_: String)
case error(_: Error)
case url(_: String)
case obj(_: AnyObject)
case date(_: Date)
case word(_: String)
case any(_: Any)
}
postfix operator /
postfix func /(toBeLogged: log?) {
guard let foo = toBeLogged else {
return
}
func log<T>(_ emoji: String, _ object: T) {
print(emoji + " " + String(describing: object))
}
switch foo {
case .error(let error):
log("❗️", error)
case .errorMessage(let errorMessage):
log("❗️", errorMessage)
case .url(let url):
log("🌏", url)
case .obj(let obj):
log("◽️", obj)
case .date(let date):
log("🕑", date)
case .word(let word):
log("✏️", word)
case .any(let any):
log("⚪️", any)
}
}
| [
-1
] |
5d8fab3785c0abf8161070ff4fdfcff03c96edb6 | c0bb2b0ea1ff4f98a93b7c94268d2ccbb00f90d1 | /Udder/AppDelegate.swift | d49de49cb58f3d710757746292002dba486b57b4 | [] | no_license | postmd/Udder | 219c96d501813371db9d6d22f97f7cf71adda4c3 | 35fc020c2c5c9fc854b66f802387401347539a5f | refs/heads/master | 2020-03-18T23:10:32.623484 | 2018-05-30T03:50:22 | 2018-05-30T03:50:22 | 135,386,940 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,183 | swift | //
// AppDelegate.swift
// Udder
//
// Created by POST MD on 5/30/18.
// Copyright © 2018 Grinning Zen Media and Design. 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,
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,
303347,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
287032,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
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,
213575,
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,
295583,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
172737,
279231,
287427,
312005,
312006,
107208,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
287450,
303835,
279258,
189149,
303838,
213724,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
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,
303981,
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,
197564,
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,
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,
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,
148946,
288214,
239064,
329177,
288217,
280027,
288220,
288218,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
370146,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
296446,
321022,
402942,
148990,
296450,
206336,
230916,
230919,
214535,
230923,
304651,
304653,
370187,
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,
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,
305464,
280891,
289087,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
379218,
280919,
248153,
215387,
354653,
354656,
313700,
313705,
280937,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289221,
289227,
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,
315211,
282446,
307027,
315221,
323414,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
282481,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
298901,
44948,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
307211,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
307290,
217179,
315482,
192605,
315483,
233567,
299105,
200801,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
315524,
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,
323854,
291089,
282906,
291104,
233766,
176435,
307508,
315701,
332086,
307510,
307512,
168245,
307515,
307518,
282942,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
276052,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
283033,
242075,
291226,
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,
127440,
315860,
176597,
127447,
283095,
299481,
127449,
176605,
242143,
127455,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
127490,
283142,
127494,
127497,
233994,
135689,
127500,
291341,
233998,
127506,
234003,
127509,
234006,
127511,
152087,
283161,
242202,
234010,
135707,
135710,
242206,
242208,
291361,
242220,
291378,
152118,
234038,
234041,
315961,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
135808,
291456,
373383,
299655,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
225948,
135839,
299680,
225954,
299684,
135844,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
226008,
299740,
242396,
201444,
299750,
283368,
234219,
283372,
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,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
324508,
234396,
291742,
226200,
234398,
234401,
291747,
291748,
234405,
291750,
234407,
324520,
324518,
324522,
234410,
291756,
291754,
226220,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
324536,
275384,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
324548,
234437,
226245,
234439,
226239,
234443,
291788,
234446,
275406,
193486,
234449,
316370,
193488,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
324599,
234490,
234493,
316416,
234496,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
316439,
234520,
234519,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
300085,
234549,
300088,
234553,
234556,
234558,
316479,
234561,
316483,
160835,
234563,
308291,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
242777,
234585,
275545,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
316530,
300148,
234614,
398455,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
226453,
234647,
275606,
275608,
234650,
308379,
324757,
300189,
324766,
119967,
234653,
324768,
283805,
234657,
242852,
300197,
234661,
283813,
234664,
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,
284223,
284226,
284228,
292421,
226886,
284231,
128584,
243268,
284234,
366155,
317004,
276043,
284238,
226895,
284241,
194130,
284243,
300628,
284245,
292433,
284247,
317015,
235097,
243290,
276053,
284249,
284251,
300638,
284253,
284255,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
325251,
276095,
276098,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
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,
350299,
350302,
227423,
350304,
178273,
309346,
194657,
194660,
350308,
309350,
309348,
292968,
309352,
309354,
301163,
350313,
350316,
227430,
301167,
276583,
350321,
276590,
284786,
276595,
350325,
252022,
227440,
350328,
292985,
301178,
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,
309491,
227571,
309494,
243960,
276735,
227583,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
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,
293706,
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,
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,
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,
280021,
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
] |
24228d2bb17c362be1361ba80e0ff76ff206e253 | 74e460c920b7baadd9a834bf1616f7c477189846 | /Tests/PathKitTests/PathKitSpec.swift | ad63e9d0c5ff2a8a68850dea2dd51cd74fec3780 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | farktronix/PathKit | 8a6552f4b28786b24afeaba188fe5e3df4349613 | c6416a96c13d9e6e0cdda0e413c95eca8b61a81a | refs/heads/master | 2020-05-02T03:35:37.884210 | 2019-03-26T07:10:14 | 2019-03-26T07:10:14 | 177,732,102 | 0 | 0 | null | 2019-03-26T06:59:19 | 2019-03-26T06:59:19 | null | UTF-8 | Swift | false | false | 15,138 | swift | import Foundation
import Spectre
@testable import PathKit
struct ThrowError: Error, Equatable {}
func == (lhs:ThrowError, rhs:ThrowError) -> Bool { return true }
public func testPathKit() {
describe("PathKit") {
let fixtures = Path(#file).parent() + "Fixtures"
$0.before {
Path.current = Path(#file).parent()
}
$0.it("provides the system separator") {
try expect(Path.separator) == "/"
}
$0.it("returns the current working directory") {
try expect(Path.current.description) == FileManager().currentDirectoryPath
}
$0.describe("initialisation") {
$0.it("can be initialised with no arguments") {
try expect(Path().description) == ""
}
$0.it("can be initialised with a string") {
let path = Path("/usr/bin/swift")
try expect(path.description) == "/usr/bin/swift"
}
$0.it("can be initialised with path components") {
let path = Path(components: ["/usr", "bin", "swift"])
try expect(path.description) == "/usr/bin/swift"
}
}
$0.describe("convertable") {
$0.it("can be converted from a string literal") {
let path: Path = "/usr/bin/swift"
try expect(path.description) == "/usr/bin/swift"
}
$0.it("can be converted to a string description") {
try expect(Path("/usr/bin/swift").description) == "/usr/bin/swift"
}
$0.it("can be converted to a string") {
try expect(Path("/usr/bin/swift").string) == "/usr/bin/swift"
}
$0.it("can be converted to a url") {
try expect(Path("/usr/bin/swift").url) == URL(fileURLWithPath: "/usr/bin/swift")
}
}
$0.describe("Equatable") {
$0.it("equates to an equal path") {
try expect(Path("/usr")) == Path("/usr")
}
$0.it("doesn't equate to a non-equal path") {
try expect(Path("/usr")) != Path("/bin")
}
}
$0.describe("Hashable") {
$0.it("exposes a hash value identical to an identical path") {
try expect(Path("/usr").hashValue) == Path("/usr").hashValue
}
}
$0.context("Absolute") {
$0.describe("a relative path") {
let path = Path("swift")
$0.it("can be converted to an absolute path") {
try expect(path.absolute()) == (Path.current + Path("swift"))
}
$0.it("is not absolute") {
try expect(path.isAbsolute) == false
}
$0.it("is relative") {
try expect(path.isRelative) == true
}
}
$0.describe("a relative path with tilde") {
let path = Path("~")
$0.it("can be converted to an absolute path") {
#if os(Linux)
if NSUserName() == "root" {
try expect(path.absolute()) == "/root"
}
else {
try expect(path.absolute()) == "/home/" + NSUserName()
}
#else
try expect(path.absolute()) == "/Users/" + NSUserName()
#endif
}
$0.it("is not absolute") {
try expect(path.isAbsolute) == false
}
$0.it("is relative") {
try expect(path.isRelative) == true
}
}
$0.describe("an absolute path") {
let path = Path("/usr/bin/swift")
$0.it("can be converted to an absolute path") {
try expect(path.absolute()) == path
}
$0.it("is absolute") {
try expect(path.isAbsolute) == true
}
$0.it("is not relative") {
try expect(path.isRelative) == false
}
}
}
$0.it("can be normalized") {
let path = Path("/usr/./local/../bin/swift")
try expect(path.normalize()) == Path("/usr/bin/swift")
}
$0.it("can be abbreviated") {
let home = Path.home.string
try expect(Path("\(home)/foo/bar").abbreviate()) == Path("~/foo/bar")
try expect(Path("\(home)").abbreviate()) == Path("~")
try expect(Path("\(home)/").abbreviate()) == Path("~")
try expect(Path("\(home)/backups\(home)").abbreviate()) == Path("~/backups\(home)")
try expect(Path("\(home)/backups\(home)/foo/bar").abbreviate()) == Path("~/backups\(home)/foo/bar")
#if os(Linux)
try expect(Path("\(home.uppercased())").abbreviate()) == Path("\(home.uppercased())")
#else
try expect(Path("\(home.uppercased())").abbreviate()) == Path("~")
#endif
}
struct FakeFSInfo: FileSystemInfo {
let caseSensitive: Bool
func isFSCaseSensitiveAt(path: Path) -> Bool {
return caseSensitive
}
}
$0.it("can abbreviate paths on a case sensitive fs") {
let home = Path.home.string
let fakeFSInfo = FakeFSInfo(caseSensitive: true)
var path = Path("\(home.uppercased())")
path.fileSystemInfo = fakeFSInfo
try expect(path.abbreviate().string) == home.uppercased()
}
$0.it("can abbreviate paths on a case insensitive fs") {
let home = Path.home.string
let fakeFSInfo = FakeFSInfo(caseSensitive: false)
var path = Path("\(home.uppercased())")
path.fileSystemInfo = fakeFSInfo
try expect(path.abbreviate()) == Path("~")
}
$0.describe("symlinking") {
$0.it("can create a symlink with a relative destination") {
let path = fixtures + "symlinks/file"
let resolvedPath = try path.symlinkDestination()
try expect(resolvedPath.normalize()) == fixtures + "file"
}
$0.it("can create a symlink with an absolute destination") {
let path = fixtures + "symlinks/swift"
let resolvedPath = try path.symlinkDestination()
try expect(resolvedPath) == Path("/usr/bin/swift")
}
$0.it("can create a relative symlink in the same directory") {
#if os(Linux)
throw skip()
#else
let path = fixtures + "symlinks/same-dir"
let resolvedPath = try path.symlinkDestination()
try expect(resolvedPath.normalize()) == fixtures + "symlinks/file"
#endif
}
}
$0.it("can return the last component") {
try expect(Path("a/b/c.d").lastComponent) == "c.d"
try expect(Path("a/..").lastComponent) == ".."
}
$0.it("can return the last component without extension") {
try expect(Path("a/b/c.d").lastComponentWithoutExtension) == "c"
try expect(Path("a/..").lastComponentWithoutExtension) == ".."
}
$0.it("can be split into components") {
try expect(Path("a/b/c.d").components) == ["a", "b", "c.d"]
try expect(Path("/a/b/c.d").components) == ["/", "a", "b", "c.d"]
try expect(Path("~/a/b/c.d").components) == ["~", "a", "b", "c.d"]
}
$0.it("can return the extension") {
try expect(Path("a/b/c.d").`extension`) == "d"
try expect(Path("a/b.c.d").`extension`) == "d"
try expect(Path("a/b").`extension`).to.beNil()
}
$0.describe("exists") {
$0.it("can check if the path exists") {
try expect(fixtures.exists).to.beTrue()
}
$0.it("can check if a path does not exist") {
let path = Path("/pathkit/test")
try expect(path.exists).to.beFalse()
}
}
$0.describe("file info") {
$0.it("can test if a path is a directory") {
try expect((fixtures + "directory").isDirectory).to.beTrue()
try expect((fixtures + "symlinks/directory").isDirectory).to.beTrue()
}
$0.it("can test if a path is a symlink") {
try expect((fixtures + "file/file").isSymlink).to.beFalse()
try expect((fixtures + "symlinks/file").isSymlink).to.beTrue()
}
$0.it("can test if a path is a file") {
try expect((fixtures + "file").isFile).to.beTrue()
try expect((fixtures + "symlinks/file").isFile).to.beTrue()
}
$0.it("can test if a path is executable") {
try expect((fixtures + "permissions/executable").isExecutable).to.beTrue()
}
$0.it("can test if a path is readable") {
try expect((fixtures + "permissions/readable").isReadable).to.beTrue()
}
$0.it("can test if a path is writable") {
try expect((fixtures + "permissions/writable").isWritable).to.beTrue()
}
// fatal error: isDeletableFile(atPath:) is not yet implemented
$0.it("can test if a path is deletable") {
#if os(Linux)
throw skip()
#else
try expect((fixtures + "permissions/deletable").isDeletable).to.beTrue()
#endif
}
}
$0.describe("changing directory") {
$0.it("can change directory") {
let current = Path.current
try Path("/usr/bin").chdir {
try expect(Path.current) == Path("/usr/bin")
}
try expect(Path.current) == current
}
$0.it("can change directory with a throwing closure") {
let current = Path.current
let error = ThrowError()
try expect {
try Path("/usr/bin").chdir {
try expect(Path.current) == Path("/usr/bin")
throw error
}
}.toThrow(error)
try expect(Path.current) == current
}
}
$0.describe("special paths") {
$0.it("can provide the home directory") {
try expect(Path.home) == Path("~").normalize()
}
$0.it("can provide the tempoary directory") {
try expect(Path.temporary) == Path(NSTemporaryDirectory())
try expect(Path.temporary.exists).to.beTrue()
}
}
$0.describe("reading") {
$0.it("can read Data from a file") {
let path = fixtures + "hello"
let contents: Data? = try path.read()
let string = NSString(data:contents! as Data, encoding: String.Encoding.utf8.rawValue)!
try expect(string) == "Hello World\n"
}
$0.it("errors when you read from a non-existing file as NSData") {
let path = Path("/tmp/pathkit-testing")
try expect {
try path.read() as Data
}.toThrow()
}
$0.it("can read a String from a file") {
let path = fixtures + "hello"
let contents: String? = try path.read()
try expect(contents) == "Hello World\n"
}
$0.it("errors when you read from a non-existing file as a String") {
let path = Path("/tmp/pathkit-testing")
try expect {
try path.read() as String
}.toThrow()
}
}
$0.describe("writing") {
$0.it("can write NSData to a file") {
let path = Path("/tmp/pathkit-testing")
let data = "Hi".data(using: String.Encoding.utf8, allowLossyConversion: true)
try expect(path.exists).to.beFalse()
try path.write(data!)
try expect(try? path.read()) == "Hi"
try path.delete()
}
$0.it("throws an error on failure writing data") {
#if os(Linux)
throw skip()
#else
let path = Path("/")
let data = "Hi".data(using: String.Encoding.utf8, allowLossyConversion: true)
try expect {
try path.write(data!)
}.toThrow()
#endif
}
$0.it("can write a String to a file") {
let path = Path("/tmp/pathkit-testing")
try path.write("Hi")
try expect(try path.read()) == "Hi"
try path.delete()
}
$0.it("throws an error on failure writing a String") {
#if os(Linux)
throw skip()
#else
let path = Path("/")
try expect {
try path.write("hi")
}.toThrow()
#endif
}
}
$0.it("can return the parent directory of a path") {
try expect((fixtures + "directory/child").parent()) == fixtures + "directory"
try expect((fixtures + "symlinks/directory").parent()) == fixtures + "symlinks"
try expect((fixtures + "directory/..").parent()) == fixtures + "directory/../.."
try expect(Path("/").parent()) == "/"
}
$0.it("can return the children") {
let children = try fixtures.children().sorted(by: <)
let expected = ["hello", "directory", "file", "permissions", "symlinks"].map { fixtures + $0 }.sorted(by: <)
try expect(children) == expected
}
$0.it("can return the recursive children") {
let parent = fixtures + "directory"
let children = try parent.recursiveChildren().sorted(by: <)
let expected = [".hiddenFile", "child", "subdirectory", "subdirectory/child"].map { parent + $0 }.sorted(by: <)
try expect(children) == expected
}
$0.describe("conforms to SequenceType") {
$0.it("without options") {
let path = fixtures + "directory"
var children = ["child", "subdirectory", ".hiddenFile"].map { path + $0 }
let generator = path.makeIterator()
while let child = generator.next() {
generator.skipDescendants()
if let index = children.firstIndex(of: child) {
children.remove(at: index)
} else {
throw failure("Generated unexpected element: <\(child)>")
}
}
try expect(children.isEmpty).to.beTrue()
try expect(Path("/non/existing/directory/path").makeIterator().next()).to.beNil()
}
$0.it("with options") {
#if os(Linux)
throw skip()
#else
let path = fixtures + "directory"
var children = ["child", "subdirectory"].map { path + $0 }
let generator = path.iterateChildren(options: .skipsHiddenFiles).makeIterator()
while let child = generator.next() {
generator.skipDescendants()
if let index = children.firstIndex(of: child) {
children.remove(at: index)
} else {
throw failure("Generated unexpected element: <\(child)>")
}
}
try expect(children.isEmpty).to.beTrue()
try expect(Path("/non/existing/directory/path").makeIterator().next()).to.beNil()
#endif
}
}
$0.it("can be pattern matched") {
try expect(Path("/var") ~= "~").to.beFalse()
try expect(Path("/Users") ~= "/Users").to.beTrue()
try expect((Path.home + "..") ~= "~/..").to.beTrue()
}
$0.it("can be compared") {
try expect(Path("a")) < Path("b")
}
$0.it("can be appended to") {
// Trivial cases.
try expect(Path("a/b")) == "a" + "b"
try expect(Path("a/b")) == "a/" + "b"
// Appending (to) absolute paths
try expect(Path("/")) == "/" + "/"
try expect(Path("/")) == "/" + ".."
try expect(Path("/a")) == "/" + "../a"
try expect(Path("/b")) == "a" + "/b"
// Appending (to) '.'
try expect(Path("a")) == "a" + "."
try expect(Path("a")) == "a" + "./."
try expect(Path("a")) == "." + "a"
try expect(Path("a")) == "./." + "a"
try expect(Path(".")) == "." + "."
try expect(Path(".")) == "./." + "./."
try expect(Path("../a")) == "." + "./../a"
try expect(Path("../a")) == "." + "../a"
// Appending (to) '..'
try expect(Path(".")) == "a" + ".."
try expect(Path("a")) == "a/b" + ".."
try expect(Path("../..")) == ".." + ".."
try expect(Path("b")) == "a" + "../b"
try expect(Path("a/c")) == "a/b" + "../c"
try expect(Path("a/b/d/e")) == "a/b/c" + "../d/e"
try expect(Path("../../a")) == ".." + "../a"
}
$0.describe("glob") {
$0.it("Path static glob") {
let pattern = (fixtures + "permissions/*able").description
let paths = Path.glob(pattern)
let results = try (fixtures + "permissions").children().map { $0.absolute() }.sorted(by: <)
try expect(paths) == results.sorted(by: <)
}
$0.it("can glob inside a directory") {
let paths = fixtures.glob("permissions/*able")
let results = try (fixtures + "permissions").children().map { $0.absolute() }.sorted(by: <)
try expect(paths) == results.sorted(by: <)
}
}
}
}
| [
-1
] |
56e0e0145f81c922a47edf1223d0bc907a489df3 | f3210742e8b57ce28f46a45e43783b9585347630 | /ZhiHuDaily/ZhiHuDaily/Models/NewsExtraModel.swift | 1a337a3bc079d316da05b3ab0c28a87e65f87988 | [
"MIT"
] | permissive | xiabob/ZhiHuDaily | 3e03b9ef31beb781de18f51e8283056ca81d3f98 | eafad860c01cf30e55d9a481fce42d96017a1fa7 | refs/heads/master | 2021-01-22T20:12:59.959192 | 2017-04-13T08:17:09 | 2017-04-13T08:17:09 | 85,297,799 | 3 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,415 | swift | //
// NewsCommentBriefModel.swift
// ZhiHuDaily
//
// Created by xiabob on 17/3/23.
// Copyright © 2017年 xiabob. All rights reserved.
//
import UIKit
import SwiftyJSON
class NewsExtraModel: NSObject {
///长评论总数
var longCommentNumber = 0
///点赞总数
var voteNumber = 0
///短评论总数
var shortCommentNumber = 0
///评论总数
var allCommentNumber = 0
///是否点赞
var hasVoted = false
///是否收藏
var hasCollect = false
override init() {
super.init()
}
convenience init(from briefDic: JSON) {
self.init()
update(from: briefDic)
}
func update(from briefDic: JSON) {
// {"count":{"long_comments":3,"short_comments":14,"comments":17,"likes":117},"vote_status":0,"favorite":false}
// long_comments : 长评论总数
// popularity : 点赞总数
// short_comments : 短评论总数
// comments : 评论总数
let countJson = briefDic["count"]
longCommentNumber = countJson["long_comments"].intValue
voteNumber = countJson["likes"].intValue
shortCommentNumber = countJson["short_comments"].intValue
allCommentNumber = countJson["comments"].intValue
hasVoted = briefDic["vote_status"].boolValue
hasCollect = briefDic["favorite"].boolValue
}
}
| [
-1
] |
8536665d6eb7bb6626365b8513c45fc7a7116bbe | 0edfdfd44b82e451f5581730b30f77bb877b3088 | /SPSample/scenes/UIKit/ComplexTableView2/ComplexTableViewController2.swift | 95107717e8c5047235bcf15c8b503fa85e6faaa9 | [] | no_license | sebbbbbb/SPSample | c0e92e724207bc4b5c25ed0c44d359e4d8aa637e | 21d45e42e71b1a0d44dab70f2591d28a47720c29 | refs/heads/master | 2021-06-14T04:32:50.185368 | 2021-03-06T19:00:07 | 2021-03-06T19:00:07 | 161,515,095 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,384 | swift | //
// ComplexTableViewController2.swift
// SPSample
//
// Created by Sebastien on 07/07/2019.
// Copyright © 2019 Sébastien Pécoul. All rights reserved.
//
import UIKit
class ComplexTableViewController2: UIViewController {
@IBOutlet weak var tableView: UITableView!
let dataSources: [UICollectionViewDataSource & UICollectionViewDelegateFlowLayout & DataSource] = [
MovieDatasource(),
SerieDataSource(),
MovieDatasource(),
SerieDataSource()
]
override func viewDidLoad() {
super.viewDidLoad()
tableView.register(cellType: ContainerTableViewCell.self)
}
}
extension ComplexTableViewController2: UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(for: indexPath) as ContainerTableViewCell
cell.setup(dataSource: dataSources[indexPath.row], delegate: dataSources[indexPath.row])
return cell
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return dataSources.count
}
}
extension ComplexTableViewController2: UITableViewDelegate {
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
let dataSource = dataSources[indexPath.row]
return dataSource.cellHeight() + ContainerTableViewCell.height()
}
}
| [
-1
] |
1ff66d01876ff3a8462058b752134a7c66ba3648 | 84bbe9ee623b4a83db2df42d6e2902083798884e | /SwiftyCompanion/SwiftyCompanion/APIController.swift | 180205451e3ce131d223f39df5a2457c4379170e | [] | no_license | wbellahc/Swifty_Companion | 6a5e05e2d6beda7d94388e4b5936558cc16c0155 | c354e9dc0235b9c9e9564b616892718bee9d0315 | refs/heads/master | 2020-05-23T04:50:44.818158 | 2019-05-14T15:18:41 | 2019-05-14T15:18:41 | 186,640,464 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,616 | swift | //
// APIController.swift
// SwiftyCompanion
//
// Created by Wahiba BELLAHCENE on 4/8/19.
// Copyright © 2019 Wahiba BELLAHCENE. All rights reserved.
//
import Foundation
import UIKit
let MY_UID: String = "#"
let SECRET: String = "#"
let BEARER = ((MY_UID + ":" + SECRET).data(using: String.Encoding.utf8))!.base64EncodedString(options: [])
class APIController {
weak var delegate : ManageUsers?
var accessToken: String? = nil
func validUser(user: UserData) -> Bool {
guard (user.id != nil), (user.displayname != nil),
(user.image_url != nil) else { return false }
return true
}
func getAccessToken(completionHandler: @escaping () -> Swift.Void) {
let url = NSURL(string: "https://api.intra.42.fr/oauth/token")
let req = NSMutableURLRequest(url: url! as URL)
req.httpMethod = "POST"
let bodyData = "grant_type=client_credentials&client_id=\(MY_UID)&client_secret=\(SECRET)"
req.httpBody = bodyData.data(using: String.Encoding.utf8)
req.setValue("Bearer " + BEARER, forHTTPHeaderField: "Authorization")
req.setValue("application/x-www-form-urlencoded;charset=UTF-8", forHTTPHeaderField: "Content-Type")
let task = URLSession.shared.dataTask(with: req as URLRequest) {
(data, res, error) in
if let err = error {
print(err)
}
else if let jsonData = data {
do {
if let dic: NSDictionary = try JSONSerialization.jsonObject(with: jsonData, options: JSONSerialization.ReadingOptions.mutableContainers) as? NSDictionary {
if let access = dic["access_token"] as? String {
self.accessToken = access
completionHandler()
}
}
}
catch(let err) {
print(err)
}
}
}
task.resume()
}
func getUsers(query: String) {
let trimQuery = query.trimmingCharacters(in: .whitespacesAndNewlines)
if let url = NSURL(string: "https://api.intra.42.fr/v2/users/\(trimQuery.lowercased())") {
print("\nurl : ", url as Any)
print("\n")
let req = NSMutableURLRequest(url: url as URL)
req.httpMethod = "GET"
req.setValue("Bearer " + self.accessToken!, forHTTPHeaderField: "Authorization")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
let task = URLSession.shared.dataTask(with: req as URLRequest) {
(data, res, error) in
if let err = error {
DispatchQueue.main.async { self.delegate?.Alerting() }
print(err)
} else if let d = data {
do {
let dataUser = try JSONDecoder().decode(UserData.self, from: d)
if self.validUser(user: dataUser) == true {
DispatchQueue.main.async {
self.delegate?.renderUser(user: dataUser)
}
return
}
} catch (let err) {
DispatchQueue.main.async { self.delegate?.Alerting() }
print(err)
}
}
}
task.resume()
} else {
DispatchQueue.main.async { self.delegate?.Alerting() }
}
}
}
| [
-1
] |
00b9705443bf2bb51083ca587e429f9ba44f14b2 | 69f9cb7121f7cd7c8025307f61e06add829fd2d6 | /SPAppOS/CalendarShit/RKViewController.swift | 72458f148d8a2a7b33c37312d5b81fc653b74765 | [] | no_license | gooftroop1330/SPAppOS | 5bb70823b1f264dbdfe504c568917f8d34f7d0b7 | 9d93cbd4ced10493a75984bc8fc0193def8b57e7 | refs/heads/master | 2022-04-29T03:20:35.401854 | 2020-04-30T18:29:55 | 2020-04-30T18:29:55 | 259,346,541 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 8,109 | swift | //
// RKViewController.swift
// RKCalendar
//
// Created by Raffi Kian on 7/14/19.
// Copyright © 2019 Raffi Kian. All rights reserved.
//
import SwiftUI
public struct RKViewController: View {
@Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>
@Binding var isPresented: Bool
@ObservedObject var rkManager: RKManager
@State var pages = [RKWeeklyPage]()
@State var index: Int = 0
@State private var contentOffset = CGPoint.zero
public var body: some View {
Group {
// needed for Mac
/**Button(action: onDone) {
HStack {
Text("Done")
Spacer()
}.padding(15)
}**/
rkManager.isWeeklyView ? AnyView(weeklyBody) : AnyView(monthlyBody)
}
}
public var monthlyBody: some View {
Group {
self.rkManager.isVertical
? self.rkManager.isContinuous ? AnyView(self.verticalView) : AnyView(self.verticalViewPage)
: self.rkManager.isContinuous ? AnyView(self.horizontalView) : AnyView(self.horizontalViewPage)
Spacer()
}
}
public var weeklyBody: some View {
Group {
self.rkManager.isContinuous
? AnyView(continuousView)
: AnyView(RKPageView(rkManager: rkManager, pages: pages))
}.onAppear(perform: loadWeeklyData)
}
func loadWeeklyData() {
for i in 0..<self.numberOfMonths() {
for j in 0..<self.numberOfWeeks(monthOffset: i) {
pages.append(RKWeeklyPage(isPresented: $isPresented, rkManager: rkManager, monthNdx: i, weekNdx: j))
}
}
}
// todo
var continuousView: some View {
// ScrollableView(self.$contentOffset, axis: .horizontal) {
ScrollView (.horizontal) {
HStack {
ForEach(0..<self.numberOfMonths()) { index in
VStack (spacing: 15) {
Divider()
HStack {
ForEach(0..<self.numberOfWeeks(monthOffset: index)) { _ in
VStack (spacing: 15) {
RKWeekdayHeader(rkManager: self.rkManager)
RKMonthHeader(rkManager: self.rkManager, monthOffset: index)
}
}
}
RKMonth(isPresented: self.$isPresented, rkManager: self.rkManager, monthOffset: index)
Spacer()
}
Divider()
}
}
}//.onAppear(perform: { self.contentOffset = self.todayWeeklyHScrollPos() })
}
// vertical continuous scroll
var verticalView: some View {
ScrollableView(self.$contentOffset) {
// ScrollView(.vertical) {
VStack (spacing: 25) {
ForEach(0..<self.numberOfMonths()) { index in
VStack(alignment: HorizontalAlignment.center, spacing: 15){
RKMonthHeader(rkManager: self.rkManager, monthOffset: index)
RKWeekdayHeader(rkManager: self.rkManager)
// Divider()
RKMonth(isPresented: self.$isPresented, rkManager: self.rkManager, monthOffset: index)
}
Divider()
}
}
}.onAppear(perform: { self.contentOffset = self.todayVScrollPos() })
}
// horizontal continuous scroll
var horizontalView: some View {
ScrollableView(self.$contentOffset, axis: .horizontal) {
// ScrollView(.horizontal) {
HStack {
ForEach(0..<self.numberOfMonths()) { index in
VStack (spacing: 15) {
RKMonthHeader(rkManager: self.rkManager, monthOffset: index)
RKWeekdayHeader(rkManager: self.rkManager)
Divider()
RKMonth(isPresented: self.$isPresented, rkManager: self.rkManager, monthOffset: index)
Spacer()
}
Divider()
}
}
}.onAppear(perform: { self.contentOffset = self.todayHScrollPos() })
}
// vertical page scroll
var verticalViewPage: some View {
RKPageView(rkManager: rkManager,
pages: (0..<numberOfMonths()).map { index in
RKPage(isPresented: $isPresented, rkManager: rkManager, index: index)
})
}
// horizontal page scroll
var horizontalViewPage: some View {
RKPageView(rkManager: rkManager,
pages: (0..<numberOfMonths()).map { index in
RKPage(isPresented: $isPresented, rkManager: rkManager, index: index)
})
}
func onDone() {
// to go back to the previous view
self.presentationMode.wrappedValue.dismiss()
}
func numberOfWeeks(monthOffset: Int) -> Int {
let firstOfMonth = firstOfMonthForOffset(monthOffset: monthOffset)
let rangeOfWeeks = rkManager.calendar.range(of: .weekOfMonth, in: .month, for: firstOfMonth)
return (rangeOfWeeks?.count)!
}
func firstOfMonthForOffset(monthOffset : Int) -> Date {
var offset = DateComponents()
offset.month = monthOffset
return rkManager.calendar.date(byAdding: offset, to: rkManager.RKFirstDateMonth())!
}
func numberOfMonths() -> Int {
return rkManager.calendar.dateComponents([.month], from: rkManager.minimumDate, to: RKMaximumDateMonthLastDay()).month! + 1
}
func RKMaximumDateMonthLastDay() -> Date {
var components = rkManager.calendar.dateComponents([.year, .month, .day], from: rkManager.maximumDate)
components.month! += 1
components.day = 0
return rkManager.calendar.date(from: components)!
}
func todayVScrollPos() -> CGPoint {
if self.rkManager.isBetweenMinAndMaxDates(date: Date()) {
let nMonths = rkManager.calendar.dateComponents([.month], from: rkManager.minimumDate, to: self.rkManager.selectedDate!).month!
let posSize = nMonths * 400
return CGPoint(x: 0, y: posSize)
} else {
return CGPoint.zero
}
}
func todayHScrollPos() -> CGPoint {
if self.rkManager.isBetweenMinAndMaxDates(date: Date()) {
let nMonths = rkManager.calendar.dateComponents([.month], from: rkManager.minimumDate, to: self.rkManager.selectedDate!).month!
let posSize = nMonths * 350
return CGPoint(x: posSize, y: 0)
} else {
return CGPoint.zero
}
}
// todo
func todayWeeklyHScrollPos() -> CGPoint {
if self.rkManager.isBetweenMinAndMaxDates(date: Date()) {
let nMonths = rkManager.calendar.dateComponents([.month], from: rkManager.minimumDate, to: Date()).month!
var nWeeks = 3
for i in 0..<nMonths {
nWeeks += numberOfWeeks(monthOffset: i)
}
let posSize = nWeeks * 350
return CGPoint(x: posSize, y: 0)
} else {
return CGPoint.zero
}
}
}
#if DEBUG
struct RKViewController_Previews : PreviewProvider {
static var previews: some View {
Group {
RKViewController(isPresented: .constant(false), rkManager: RKManager(calendar: Calendar.current, minimumDate: Date(), maximumDate: Date().addingTimeInterval(60*60*24*365), mode: 0))
RKViewController(isPresented: .constant(false), rkManager: RKManager(calendar: Calendar.current, minimumDate: Date(), maximumDate: Date().addingTimeInterval(60*60*24*32), mode: 0))
.environment(\.colorScheme, .dark)
.environment(\.layoutDirection, .rightToLeft)
}
}
}
#endif
| [
-1
] |
45e0a1388e02e8cd8853722bd3f0c4050dbe09b1 | cdd1377f50e69a7c43aeda05ab4e1b3aeb5bf312 | /Solutions/SolutionsTests/Medium/Medium_002_Add_Two_Numbers_Test.swift | bdddc78e0b7fb6495eac2f416af29dc7543b9e66 | [
"MIT"
] | permissive | DJBen/LeetCode-Solutions-in-Swift | ed5410b238c0133aa47b804445af3b596102c443 | 015c59cdd84efaf08b2529c3e30b5f9ea631c031 | refs/heads/master | 2021-01-20T01:50:27.894243 | 2015-12-11T07:07:08 | 2015-12-11T07:07:08 | 47,948,462 | 1 | 0 | null | 2015-12-14T02:51:27 | 2015-12-14T02:51:26 | null | UTF-8 | Swift | false | false | 3,150 | swift | //
// Medium_002_Add_Two_Numbers_Test.swift
// Solutions
//
// Created by Wu, Di on 3/26/15.
// Copyright (c) 2015 diwu. All rights reserved.
//
import XCTest
class Medium_002_Add_Two_Numbers_Test: XCTestCase {
func test_001() {
typealias ListNode = Medium_002_Add_Two_Numbers.ListNode
// Test Case
// 2 -> 4 -> 5
// 5 -> 6 -> 4
// Result:
// 7 -> 0 -> 0 -> 1
let dummy1: ListNode = ListNode()
let dummy2: ListNode = ListNode()
var tmp: ListNode? = ListNode(nodeValue: 2, nodeNext: nil)
dummy1.next = tmp
if let n = tmp {
n.next = ListNode(nodeValue: 4, nodeNext: nil)
tmp = n.next
}
if let n = tmp {
n.next = ListNode(nodeValue: 5, nodeNext: nil)
tmp = n.next
}
tmp = ListNode(nodeValue: 5, nodeNext: nil)
dummy2.next = tmp
if let n = tmp {
n.next = ListNode(nodeValue: 6, nodeNext: nil)
tmp = n.next
}
if let n = tmp {
n.next = ListNode(nodeValue: 4, nodeNext: nil)
tmp = n.next
}
var result: ListNode? = Medium_002_Add_Two_Numbers.addNumbers(dummy1.next, node2: dummy2.next)
var numericalValue: Int = 0
var base: Int = 0
while result != nil {
if let n = result {
numericalValue += n.value * Int(pow(Double(10), Double(base)))
result = result?.next
base++
}
}
XCTAssert(numericalValue == 1007, "Medium_002_Add_Two_Numbers_Test #1")
}
func test_001_objc() {
typealias ListNode = ObjC_Medium_002_Add_Two_Numbers_Node;
// Test Case
// 2 -> 4 -> 5
// 5 -> 6 -> 4
// Result:
// 7 -> 0 -> 0 -> 1
let dummy1: ListNode = ListNode()
let dummy2: ListNode = ListNode()
var tmp: ListNode? = ListNode.init(2, next: nil);
dummy1.next = tmp
if let n = tmp {
n.next = ListNode.init(4, next: nil)
tmp = n.next
}
if let n = tmp {
n.next = ListNode.init(5, next: nil)
tmp = n.next
}
tmp = ListNode.init(5, next: nil)
dummy2.next = tmp
if let n = tmp {
n.next = ListNode.init(6, next: nil)
tmp = n.next
}
if let n = tmp {
n.next = ListNode.init(4, next: nil)
tmp = n.next
}
var result: ListNode? = ObjC_Medium_002_Add_Two_Numbers.addNumbers(dummy1.next, node2: dummy2.next)
var numericalValue: Int = 0
var base: Int = 0
while result != nil {
if let n = result {
numericalValue += n.value * Int(pow(Double(10), Double(base)))
result = result?.next
base++
}
}
XCTAssert(numericalValue == 1007, "Medium_002_Add_Two_Numbers_Test #2 - \(numericalValue)")
}
}
/*
// Test Case
// 2 -> 4 -> 5
// 5 -> 6 -> 4
// Result:
// 7 -> 0 -> 0 -> 1
*/ | [
-1
] |
849faf12f68c1b95d6237faa5ba9760bb7dee97a | 20552caa8190636df69f6df4198ca158ead7d718 | /CountryList/SceneDeatail/CountryListDetailModels.swift | 2710d766f899e1aaa5dd1925159dbd4d2c11627a | [] | no_license | stscgamecs/CountryList | 2e6524c923db94e3e26bda21f48daee276fb684b | 6810fddb0d6c2ba48051c9c1ce3c03e9978b9efb | refs/heads/master | 2020-08-16T23:57:47.711800 | 2019-10-21T08:41:40 | 2019-10-21T08:41:40 | 215,574,532 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 795 | swift | //
// CountryListDetailModels.swift
// CountryList
//
// Created by Z64me on 16/10/2562 BE.
// Copyright (c) 2562 Z64me. All rights reserved.
//
import UIKit
struct CountryListDetail {
struct GetCity {
struct Request {}
struct Response {
let city: DataCity
}
struct ViewModel {
let countryName: String
let cityName:String
}
}
struct GetCountry {
struct Request {}
struct Response {}
struct ViewModel {}
}
struct Loding {
struct Response {
let isShowing: Bool
}
struct ViewModel {
let isShowing: Bool
}
}
struct LoadingError {
struct Response {
let urlError: String
}
struct ViewModel {
let urlError: String
}
}
}
| [
-1
] |
b8c719ee1d8ebfc70101b7720a33386fd7013334 | 1b111f6ae255ac7dcb8af14b573c6b4865a00f9b | /MVP/client/ScannerPrice/ScannerPrice/PreviewScan/PreviewScanController.swift | e2480f771a4d9466882671fe4343488dd64cec9e | [] | no_license | artIU7/eldohack | fb9fb505609958b51dc166720c04bf7ae99c0f39 | 060f1e82fb1ce5a101c541f054450621dd979836 | refs/heads/main | 2023-06-01T19:43:55.341273 | 2021-06-23T12:39:44 | 2021-06-23T12:39:44 | 378,406,953 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,986 | swift | //
// LoginController.swift
// ScannerPrice
//
// Created by Артем Стратиенко on 22.06.2021.
//
import UIKit
import SnapKit
class PreviewScanController: UIViewController {
var tabBarTag: Bool = true
override func viewDidLoad() {
super.viewDidLoad()
self.title = "Сканирование"
configLayout()
// 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.
}
*/
func configLayout() {
view.backgroundColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
// заголовок экрана приветсвия
let titleScreen = UILabel()
//titleScreen.font = UIFont.systemFont(ofSize: 25)
titleScreen.font = UIFont.boldSystemFont(ofSize: 25)
titleScreen.numberOfLines = 0
titleScreen.text = "Сканер"
//
view.addSubview(titleScreen)
titleScreen.snp.makeConstraints { (marker) in
marker.left.equalToSuperview().inset(20)
marker.top.equalToSuperview().inset(80)
}
let imageView = UIImageView()
var fonImage = UIImage()
fonImage = UIImage(named: "scan_scan")!
imageView.image = fonImage
view.addSubview(imageView)
imageView.snp.makeConstraints { (marker) in
marker.left.right.equalToSuperview().inset(120)
marker.top.equalTo(titleScreen).inset(190)
//marker.bottom.equalTo(startTour).inset(100)
marker.height.equalTo(20)
marker.width.equalTo(20)
marker.centerX.centerY.equalToSuperview()
}
// button continie
let startTour = UIButton(type: .system)
startTour.backgroundColor = #colorLiteral(red: 0.2192575336, green: 0.7275105119, blue: 0.3305970132, alpha: 1)
startTour.setTitle("Сканировать", for: .normal)
startTour.setTitleColor(.white, for: .normal)
startTour.layer.cornerRadius = 10
startTour.titleLabel?.font = UIFont.boldSystemFont(ofSize: 15)
view.addSubview(startTour)
startTour.snp.makeConstraints { (marker) in
marker.bottom.equalToSuperview().inset(80)
marker.centerX.equalToSuperview()
marker.width.equalTo(350)
marker.height.equalTo(50)
}
startTour.addTarget(self, action: #selector(viewTours), for: .touchUpInside)
/* // page controll
let pageControl = UIPageControl()
pageControl.frame = CGRect(x: 100, y: 100, width: 300, height: 300)
pageControl.numberOfPages = 2;
pageControl.currentPage = 0;
view.addSubview(pageControl)
pageControl.snp.makeConstraints { (marker) in
marker.bottom.equalTo(startTour).inset(40)
marker.left.right.equalToSuperview().inset(30)
}*/
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if tabBarTag == true {
self.tabBarController?.tabBar.tintColor = #colorLiteral(red: 0.2088217232, green: 0.8087635632, blue: 0.364161254, alpha: 1)//UIColor.blue
self.tabBarController?.tabBar.backgroundColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)//UIColor.cyan
} else {
self.tabBarController?.tabBar.tintColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)//UIColor.cyan
}
}
}
//
extension PreviewScanController {
@objc func viewTours() {
let viewTours = ScannerController()
//startTest.modalTransitionStyle = .flipHorizontal
viewTours.modalPresentationStyle = .fullScreen
viewTours.modalTransitionStyle = .crossDissolve
show(viewTours, sender: self)
//present(startTest, animated: true, completion: nil)
print("Launch second controller")
}
}
| [
-1
] |
f992562f995729deb20fb61e84ba5f4abf7c4459 | 5a72930254d8be4d00715c163daaf207e8c48ccb | /github-pr/SceneDelegate.swift | 68a6b7904fce52f3f38e7ce5f4ad29010ca28c26 | [] | no_license | aacebo/github-pr | 60c0cd2f1ecdc83d1a086dbb06db69a9e614c418 | 763398c6ded4ee2e03e9ad8329e14a44be76c330 | refs/heads/master | 2022-07-04T09:18:18.187087 | 2020-05-15T18:44:53 | 2020-05-15T18:44:53 | 262,142,775 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,320 | swift | //
// SceneDelegate.swift
// github-pr
//
// Created by Alex Acebo on 4/30/20.
// Copyright © 2020 Alex Acebo. All rights reserved.
//
import UIKit
import SwiftUI
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).
// Get the managed object context from the shared persistent container.
let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
// Create the SwiftUI view and set the context as the value for the managedObjectContext environment keyPath.
// Add `@Environment(\.managedObjectContext)` in the views that will need the context.
let contentView = ContentView().environment(\.managedObjectContext, context)
// Use a UIHostingController as window root view controller.
if let windowScene = scene as? UIWindowScene {
let window = UIWindow(windowScene: windowScene)
window.rootViewController = UIHostingController(rootView: contentView)
self.window = window
window.makeKeyAndVisible()
}
}
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.
// Save changes in the application's managed object context when the application transitions to the background.
(UIApplication.shared.delegate as? AppDelegate)?.saveContext()
}
}
| [
325633,
325637,
163849,
333838,
186388,
346140,
337980,
16444,
254020,
217158,
243782,
337995,
395340,
327757,
200786,
286804,
329816,
217180,
368736,
342113,
180322,
329833,
286833,
252021,
342134,
286845,
286851,
329868,
250008,
329886,
286880,
135328,
192674,
333989,
356521,
286889,
430257,
180418,
350411,
180432,
350417,
350423,
350426,
385243,
334047,
350436,
356580,
346344,
327915,
338161,
350449,
350454,
321787,
336124,
350459,
350462,
336129,
350465,
350469,
325895,
194829,
350477,
43279,
350481,
356631,
350487,
338201,
350491,
350494,
182559,
325920,
350500,
350505,
350510,
248112,
332081,
307507,
340276,
336181,
356662,
332091,
332098,
201030,
332107,
190797,
334162,
332118,
321880,
332126,
258399,
332130,
250211,
340328,
250217,
348523,
348528,
182642,
321911,
332153,
334204,
332158,
250239,
332162,
348548,
332175,
348566,
160152,
250272,
176545,
326059,
342453,
334263,
338363,
324032,
336326,
393671,
338387,
248279,
369119,
334306,
338404,
334312,
338411,
104940,
375279,
162289,
328178,
328180,
248309,
328183,
340473,
199165,
328190,
324095,
328193,
98819,
324100,
324103,
164362,
248332,
199182,
328207,
324112,
330254,
186898,
342546,
340501,
324118,
334359,
342551,
324122,
330268,
334364,
340512,
191012,
332325,
324134,
197160,
324141,
324143,
334386,
324156,
334397,
188990,
152128,
324161,
324165,
219719,
324171,
324174,
324177,
244309,
334425,
326240,
340580,
248427,
191085,
346736,
338544,
334466,
336517,
344710,
119432,
148106,
162446,
330384,
326291,
340628,
342685,
340639,
336549,
332460,
336556,
332464,
164535,
336568,
174775,
248505,
174778,
244410,
328379,
332473,
223936,
328387,
332484,
332487,
154318,
332494,
342737,
154329,
139998,
189154,
338661,
332521,
338665,
330479,
342769,
340724,
332534,
338680,
342777,
344832,
207620,
336644,
191240,
346891,
328462,
326417,
336660,
199455,
336676,
336681,
334633,
326444,
215854,
328498,
271154,
152371,
326452,
326455,
340792,
348983,
244542,
326463,
326468,
328516,
336709,
127815,
244552,
328520,
326474,
328523,
336712,
342857,
326479,
355151,
330581,
326486,
136024,
330585,
326494,
326503,
201580,
326508,
326511,
201583,
211826,
340850,
330612,
201589,
340859,
324476,
328574,
340863,
252801,
324482,
324488,
324496,
330643,
324502,
252823,
324511,
324514,
252838,
201638,
211885,
252846,
324525,
5040,
5047,
324539,
324542,
347082,
340940,
345046,
330711,
248794,
340958,
248799,
340964,
338928,
328690,
359411,
244728,
330750,
328703,
199681,
328710,
338951,
330761,
328715,
330769,
209944,
336922,
209948,
248863,
345119,
357411,
250915,
250917,
158759,
328747,
209966,
209969,
330803,
209973,
209976,
339002,
339010,
209988,
209991,
347208,
248905,
330827,
197708,
330830,
248915,
345172,
183384,
156762,
343132,
339037,
322660,
210028,
326764,
345200,
330869,
361591,
210042,
210045,
152704,
160896,
330886,
351366,
384136,
384140,
337048,
210072,
248986,
384152,
210078,
384158,
210081,
384161,
210085,
210089,
339118,
337072,
210096,
210100,
337076,
324792,
339133,
384189,
343232,
384192,
210116,
337093,
244934,
326858,
322763,
384202,
343246,
384209,
333010,
146644,
330966,
210139,
328925,
66783,
384225,
343272,
351467,
328942,
251123,
384247,
384250,
242947,
206084,
115973,
343307,
384270,
333075,
384276,
333079,
251161,
384284,
245021,
384290,
208167,
171304,
245032,
245042,
345400,
208189,
372035,
343366,
337224,
251211,
337230,
331089,
337235,
263509,
331094,
175458,
343394,
208228,
175461,
337252,
343399,
175464,
345449,
333164,
99692,
343410,
234867,
331124,
175478,
155000,
378232,
249210,
175484,
337278,
249215,
245121,
249219,
245128,
249225,
181644,
249228,
245137,
181650,
249235,
112021,
181655,
245143,
175514,
245146,
245149,
343453,
245152,
245155,
355749,
40358,
181671,
245158,
333222,
245163,
181679,
327090,
337330,
210357,
146878,
181697,
361922,
327108,
181704,
339401,
327112,
384457,
327118,
208338,
366035,
343509,
337366,
249310,
249313,
333285,
329195,
343540,
343545,
339464,
337416,
249355,
329227,
175637,
345626,
245275,
366118,
339504,
206397,
349762,
333387,
214611,
333400,
339553,
333415,
245358,
222831,
333423,
138865,
339572,
126597,
126611,
140955,
333472,
245410,
345763,
245415,
337588,
325309,
337607,
333512,
333515,
339664,
358100,
245463,
212700,
181982,
153311,
333535,
225000,
337643,
245487,
337647,
339696,
245495,
141052,
337661,
333566,
339711,
225027,
337671,
339722,
249617,
321300,
245528,
333593,
116512,
184096,
339748,
358192,
339773,
399166,
325441,
247618,
325447,
341831,
329545,
341835,
354124,
323404,
339795,
341844,
247639,
337751,
358235,
341852,
313181,
413539,
339818,
327532,
339827,
358260,
341877,
325494,
182136,
186233,
1914,
333690,
243584,
325505,
333699,
339845,
247692,
333709,
247701,
337814,
329625,
327590,
333737,
337845,
184245,
190393,
327613,
333767,
346059,
311244,
358348,
247760,
212945,
333777,
219094,
329699,
358372,
327655,
247790,
380919,
333819
] |
7c1328db58804281fd7b010a041ac61606ead0bf | 29858bbc8750958984c58da7702093740c5733a9 | /SecretSanta2/NameProfileViewController.swift | c31b202738fff76e865e6e46b2dbd1abdb18a690 | [] | no_license | dannyshiferaw/Secret-Santa | f38020d8985319d7504be3bc8cee7f98103786a3 | 2d93a7e760dcef94e945abdbc89bc83ef85c7583 | refs/heads/master | 2020-07-31T21:49:00.115001 | 2016-11-13T02:42:18 | 2016-11-13T02:42:18 | 73,591,053 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 891 | swift | //
// NameProfileViewController.swift
// SecretSanta2
//
// Created by Daniel Shiferaw on 11/12/16.
// Copyright © 2016 Daniel Shiferaw. All rights reserved.
//
import UIKit
class NameProfileViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
| [
187882
] |
c722f27c0611d1dba14019559a8ef5ec560ef359 | 4b65f5d51d8280973d5a276c8c9ec42698bb1670 | /BaoKanIOS/Classes/Module/News/View/List/JFNewsNoPicCell.swift | ffe2254fbd944ab7249d1433fde228e4ae8cff49 | [
"Apache-2.0"
] | permissive | wangshiyu13/BaoKanIOS | 73fbbaf6862f696d7d7a375be5de5da1e3efa786 | 44afe8c33a3a597a7523663c01538be9615075d5 | refs/heads/master | 2023-05-31T09:42:34.313794 | 2018-09-14T17:28:13 | 2018-09-14T17:28:13 | 62,638,173 | 0 | 0 | Apache-2.0 | 2023-05-16T16:09:46 | 2016-07-05T13:16:19 | Swift | UTF-8 | Swift | false | false | 1,377 | swift | //
// JFNewsNoPicCell.swift
// BaoKanIOS
//
// Created by jianfeng on 16/1/14.
// Copyright © 2016年 六阿哥. All rights reserved.
//
import UIKit
import YYWebImage
class JFNewsNoPicCell: UITableViewCell {
var postModel: JFArticleListModel? {
didSet {
articleTitleLabel.text = postModel?.title!
timeLabel.text = postModel?.newstimeString
commentLabel.text = postModel?.plnum!
showNumLabel.text = postModel?.onclick!
}
}
@IBOutlet weak var articleTitleLabel: UILabel!
@IBOutlet weak var timeLabel: UILabel!
@IBOutlet weak var commentLabel: UILabel!
@IBOutlet weak var showNumLabel: UILabel!
/**
计算行高
*/
func getRowHeight(_ postModel: JFArticleListModel) -> CGFloat {
self.postModel = postModel
layoutIfNeeded()
return timeLabel.frame.maxY + 15
}
override func awakeFromNib() {
super.awakeFromNib()
// 离屏渲染 - 异步绘制
layer.drawsAsynchronously = true
// 栅格化 - 异步绘制之后,会生成一张独立的图像,cell在屏幕上滚动的时候,本质滚动的是这张图片
layer.shouldRasterize = true
// 使用栅格化,需要指定分辨率
layer.rasterizationScale = UIScreen.main.scale
}
}
| [
-1
] |
f78222f2a4af1a891cc0b66c99153cd7085a09ed | 1f2b60eeb9f7a4f5562705009ba8e60b08037520 | /Cowork-SwiftUI/ContentView.swift | 05435e49e66052ec5d337d09b7e9821e8ead9582 | [] | no_license | lcr3/Cowork-SwiftUI | c8e0591c380374d277d2e27ddf167ce424c65d4b | 011f4d3aecfd6145cdf12abb80150d0b03475a72 | refs/heads/develop | 2022-12-11T04:28:52.785906 | 2020-07-08T01:22:43 | 2020-07-08T12:57:44 | 277,958,483 | 0 | 0 | null | 2020-07-09T10:22:40 | 2020-07-08T01:20:37 | Swift | UTF-8 | Swift | false | false | 360 | swift | //
// ContentView.swift
// Cowork-SwiftUI
//
// Created by ryookano on 2020/07/08.
// Copyright © 2020 lcr. All rights reserved.
//
import SwiftUI
struct ContentView: View {
var body: some View {
Text("Hello, World!")
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
| [
337594
] |
55cd31b8da77eff140beb352c2da0bbc65eddd91 | 38e500ce26b0fe15262b4617edbd6e950b5e3ea4 | /TodoTests/TodoTests.swift | 7fe5f2fe793e541aa85f5da25ae23eb35cd82e97 | [] | no_license | manaba/Todo | 7f2d900dd63ee2057d049420da494e9be9bdcabe | b0ea1aca5d3562e96cb55ead6b37a4ccde68b73d | refs/heads/master | 2021-01-21T02:02:37.523427 | 2016-07-06T13:08:32 | 2016-07-06T13:08:32 | 62,721,571 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 953 | swift | //
// TodoTests.swift
// TodoTests
//
// Created by Tammy on 16/5/15.
// Copyright © 2016年 Tammy. All rights reserved.
//
import XCTest
@testable import Todo
class TodoTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock {
// Put the code you want to measure the time of here.
}
}
}
| [
98333,
278558,
16419,
229413,
204840,
278570,
360491,
344107,
155694,
253999,
229424,
229430,
319542,
180280,
213052,
286788,
352326,
254027,
311372,
196691,
278615,
180311,
180312,
237663,
131178,
278634,
278638,
319598,
352368,
131189,
131191,
237689,
131198,
278655,
311435,
311438,
278677,
278685,
311458,
278691,
49316,
196773,
278699,
32941,
278704,
278708,
131256,
278714,
295098,
254170,
229597,
311519,
286958,
327929,
278797,
180493,
254226,
319763,
278810,
278816,
262450,
98610,
278842,
287041,
287043,
311621,
139589,
319813,
319821,
254286,
344401,
311636,
278869,
155990,
106847,
246127,
139640,
246136,
246137,
311681,
246178,
377264,
278961,
278965,
278970,
33211,
319930,
336317,
278978,
188871,
278989,
278993,
278999,
328152,
369116,
188894,
287198,
279008,
279013,
279018,
311786,
279022,
279029,
279032,
279039,
287241,
279050,
303631,
303636,
279062,
279065,
180771,
377386,
279094,
352829,
115270,
377418,
295519,
66150,
344680,
279146,
295536,
287346,
287352,
279164,
189057,
303746,
311941,
279177,
369289,
344715,
311949,
352917,
230040,
271000,
295576,
303771,
221852,
205471,
279206,
295590,
287404,
295599,
205487,
303793,
164533,
287417,
303803,
287422,
66242,
287433,
287439,
279252,
287452,
295652,
279269,
230125,
312047,
279280,
230134,
221948,
279294,
205568,
295682,
295697,
336671,
344865,
262951,
279336,
262954,
295724,
353069,
312108,
164656,
303920,
262962,
328499,
353078,
230199,
353079,
336702,
295744,
295746,
279362,
353094,
353095,
353109,
230234,
295776,
279392,
303972,
279397,
230248,
246641,
295798,
246648,
279417,
361337,
254850,
287622,
213894,
295824,
279456,
189348,
279464,
353195,
140204,
353197,
304051,
287677,
189374,
353216,
213960,
279498,
304087,
50143,
123881,
320493,
320494,
304110,
287731,
295927,
304122,
312314,
320507,
328700,
328706,
320516,
230410,
320527,
418837,
140310,
230423,
320536,
197657,
238623,
336929,
189474,
345132,
238639,
238651,
230463,
238664,
296019,
353367,
156764,
156765,
304222,
230499,
279660,
156785,
312434,
353397,
279672,
279685,
222343,
296086,
238743,
296092,
238765,
279728,
238769,
230588,
279747,
353479,
353481,
353482,
279760,
189652,
279765,
296153,
279774,
304351,
304356,
279785,
279792,
353523,
279814,
312587,
328971,
173334,
320796,
304421,
279854,
345396,
116026,
222524,
279875,
304456,
230729,
222541,
296270,
238927,
296273,
222559,
230756,
230765,
296303,
279920,
312689,
296307,
116084,
181625,
148867,
378244,
296329,
296335,
230799,
9619,
279974,
279984,
173491,
279989,
296375,
296387,
296391,
296392,
361927,
280010,
370123,
148940,
280013,
312782,
222675,
329173,
353750,
280032,
280041,
296425,
361963,
296433,
321009,
280055,
288249,
296448,
230913,
230921,
329225,
296461,
149007,
304656,
329232,
230943,
230959,
288309,
288318,
280130,
124485,
288326,
288327,
280147,
239198,
157281,
222832,
247416,
337535,
239237,
288392,
239250,
345752,
255649,
198324,
296628,
321207,
296632,
280251,
280257,
321219,
280267,
9936,
9937,
280278,
280280,
18138,
67292,
321247,
313065,
288491,
280300,
239341,
419569,
313081,
124669,
288512,
288516,
280327,
280329,
321295,
321302,
116505,
321310,
247590,
280366,
296755,
280372,
321337,
280380,
345919,
280390,
280392,
345929,
304977,
18262,
280410,
370522,
345951,
362337,
345955,
296806,
288619,
288620,
280430,
296814,
362352,
313203,
124798,
182144,
305026,
67463,
329622,
124824,
214937,
214938,
247712,
354212,
124852,
288697,
214977,
280514,
280519,
214984,
247757,
231375,
280541,
329695,
337895,
247785,
296941,
124911,
362480,
329712,
313339,
313357,
182296,
305179,
313375,
239650,
354343,
354345,
223274,
124975,
346162,
124984,
288828,
288833,
288834,
280649,
354385,
223316,
280661,
223318,
329814,
338007,
288857,
354393,
280675,
280677,
329829,
313447,
288879,
223350,
280694,
288889,
215164,
313469,
215166,
280712,
215178,
141450,
346271,
239793,
125109,
182456,
280762,
223419,
379071,
280768,
338119,
280778,
321745,
280795,
280802,
338150,
321772,
125169,
338164,
157944,
125183,
125188,
313608,
125193,
125198,
125199,
125203,
125208,
305440,
125217,
125235,
280887,
125240,
280902,
182598,
289110,
305495,
272729,
379225,
321894,
280939,
313713,
354676,
199029,
280961,
362881,
248194,
395659,
395661,
240016,
190871,
289189,
289194,
108972,
281037,
281040,
281072,
223767,
289304,
223769,
182817,
289332,
338490,
322120,
281166,
281171,
354911,
436832,
191082,
313966,
281199,
330379,
133774,
330387,
330388,
117397,
289434,
338613,
166582,
289462,
314040,
158394,
199366,
363211,
289502,
363230,
338662,
346858,
330474,
289518,
125684,
199414,
35583,
363263,
322313,
322319,
166676,
207640,
281377,
289576,
289598,
281408,
420677,
281427,
281433,
330609,
207732,
158593,
240518,
289698,
289703,
289727,
330689,
363458,
19399,
52172,
183248,
338899,
248797,
207838,
314342,
52200,
289774,
183279,
314355,
240630,
314362,
134150,
322570,
330763,
281625,
281626,
175132,
248872,
322612,
207938,
314448,
281697,
314467,
281700,
322663,
281706,
207979,
363644,
150657,
248961,
330888,
339102,
330913,
306338,
249002,
208058,
339130,
322749,
290000,
298208,
363744,
298212,
290022,
330984,
298221,
298228,
216315,
208124,
363771,
388349,
322824,
126237,
339234,
199971,
298291,
224586,
372043,
314709,
224606,
314720,
142689,
281957,
281962,
134506,
306542,
314739,
314741,
290173,
306559,
298374,
314758,
281992,
142729,
314760,
388487,
314766,
306579,
224661,
282007,
290207,
314783,
314789,
282022,
282024,
241066,
380357,
306631,
306639,
191981,
306673,
306677,
191990,
290300,
290301,
282114,
306692,
306693,
323080,
192010,
323087,
282129,
282136,
282141,
282146,
306723,
290358,
282183,
290390,
306776,
282213,
323178,
314998,
175741,
192131,
224901,
282245,
282246,
290443,
323217,
282259,
282271,
282273,
282276,
298661,
323236,
290471,
282280,
298667,
306874,
282303,
282312,
306890,
282318,
241361,
241365,
282327,
298712,
216795,
298720,
282339,
12010,
282348,
282355,
323316,
282358,
282369,
175873,
323331,
323332,
216839,
282378,
282391,
249626,
282400,
241441,
339745,
257830,
282409,
159533,
282417,
200498,
282427,
282434,
307011,
315202,
282438,
323406,
307025,
413521,
216918,
307031,
241495,
282474,
282480,
241528,
241540,
282504,
315273,
315274,
110480,
184208,
282518,
282519,
44952,
298909,
118685,
298920,
282549,
290746,
298980,
282612,
290811,
282633,
241692,
307231,
102437,
233517,
282672,
159807,
315476,
307289,
200794,
315487,
45153,
307299,
307301,
315498,
299121,
233589,
233590,
241808,
323729,
233636,
184484,
299174,
233642,
323762,
299187,
184505,
299198,
299203,
282831,
356576,
176362,
233715,
184570,
168188,
184575,
282909,
299293,
282913,
233762,
217380,
282919,
151847,
332085,
332089,
315706,
282939,
307517,
241986,
332101,
323916,
348492,
250192,
323920,
348500,
168281,
323935,
242029,
242033,
291192,
225670,
291224,
283038,
61857,
61859,
381347,
340398,
299441,
61873,
61880,
283064,
291267,
127427,
127428,
283075,
324039,
373197,
176601,
242139,
160225,
242148,
291311,
233978,
291333,
340490,
283153,
291358,
283182,
283184,
234036,
315960,
70209,
348742,
70215,
348749,
242277,
111208,
291454,
184962,
348806,
152203,
184973,
299699,
299700,
225995,
225997,
242386,
226004,
226007,
299746,
226019,
234217,
299759,
299770,
234234,
299776,
242433,
234241,
291585,
209670,
226058,
234250,
234253,
291604,
234263,
283419,
234268,
234277,
283430,
234283,
152365,
234286,
234289,
242485,
234294,
234301,
160575,
234311,
234312,
299849,
283467,
234317,
201549,
201551,
234323,
234326,
234331,
242529,
349026,
234340,
234343,
275303,
177001,
234346,
201577,
308076,
242541,
234355,
209783,
234360,
209785,
234361,
177019,
234366,
234367,
291712,
234372,
226181,
226184,
308107,
308112,
234386,
234387,
234392,
209817,
324506,
324507,
234400,
234404,
324517,
283558,
234409,
275371,
234419,
234425,
234427,
234430,
349121,
234436,
234438,
316364,
234444,
234445,
234451,
234454,
234457,
340955,
234463,
340961,
234466,
234472,
234473,
324586,
234477,
340974,
234482,
316405,
201720,
234498,
234500,
234506,
324625,
234514,
308243,
316437,
201755,
234531,
300068,
234534,
357414,
234542,
300084,
234548,
324666,
234555,
308287,
234560,
21569,
234565,
234569,
300111,
234577,
341073,
234583,
234584,
234587,
250981,
300135,
300136,
316520,
275565,
316526,
357486,
144496,
300146,
275571,
300151,
234616,
398457,
291959,
160891,
341115,
300158,
234622,
349316,
349318,
275591,
234632,
234638,
169104,
177296,
234642,
308372,
185493,
283802,
119962,
119963,
300187,
300188,
234656,
234659,
234663,
300201,
300202,
275625,
226481,
283840,
259268,
283847,
62665,
283852,
283853,
316627,
357595,
234733,
292085,
234742,
292091,
316669,
234755,
242954,
292107,
251153,
226608,
300343,
333117,
226624,
193859,
300359,
226632,
234827,
177484,
251213,
234831,
120148,
283991,
357719,
218462,
234850,
292195,
333160,
284014,
243056,
111993,
112017,
112018,
234898,
357786,
333220,
316842,
210358,
284089,
292283,
415171,
292292,
300487,
300489,
284107,
284116,
366037,
210390,
210391,
210393,
226781,
144867,
316902,
54765,
251378,
333300,
300535,
300536,
333303,
300542,
210433,
366083,
316946,
308756,
398869,
308764,
349726,
333343,
349741,
169518,
194110,
235070,
349763,
218696,
276040,
366154,
292425,
243274,
276045,
128587,
333388,
333393,
300630,
128599,
235095,
243292,
333408,
300644,
374372,
317032,
54893,
276085,
366203,
325245,
235135,
276120,
276126,
333470,
300714,
300728,
218819,
276173,
333517,
333520,
333521,
333523,
276195,
153319,
284401,
276210,
276219,
325371,
194303,
194304,
300811,
284429,
276238,
284431,
366360,
284442,
325404,
276253,
325410,
341796,
333610,
317232,
276282,
276283,
276287,
325439,
276294,
276298,
341836,
325457,
284507,
300894,
284512,
284514,
276327,
292712,
325484,
292720,
284532,
325492,
300918,
276344,
317304,
194429,
325503,
333701,
243591,
325515,
243597,
325518,
300963,
292771,
333735,
284587,
292782,
243637,
276408,
276421,
284619,
276430,
301008,
153554,
194515,
276444,
219101,
292836,
292837,
276454,
317415,
276459,
325619,
333817,
292858,
333828,
145435,
317467,
292902,
227370,
243759,
276534,
358456,
227417,
194656,
309345,
227428,
276582,
194666,
276589,
227439,
284788,
333940,
292988,
292992,
194691,
227460,
333955,
235662,
325776,
276627,
317587,
276632,
284826,
333991,
333992,
284842,
153776,
129203,
227513,
301251,
309444,
227524,
276682,
227548,
301279,
317664,
211193,
227578,
243962,
309503,
375051,
325905,
325912,
309529,
227616,
211235,
211238,
260418,
227654,
227658,
276813,
6481,
6482,
366929,
366930,
6489,
391520,
276835,
416104,
276847,
285040,
227725,
227726,
178578,
178582,
293274,
317852,
285090,
375207,
293303,
276920,
293306,
276925,
293310,
317901,
326100,
285150,
227809,
358882,
342498,
227813,
195045,
309744,
301571,
276998,
342536,
186893,
342553,
375333,
293419,
244269,
236081,
23092,
277048,
309830,
301638,
293448,
55881,
244310,
277094,
277101,
277111,
301689,
277133,
227990,
342682,
285353,
285361,
342706,
293556,
342713,
285371,
285372,
285373,
285374,
154316,
203477,
96984,
318173,
285415,
342762,
277227,
154359,
228088,
162561,
285444,
285458,
326429,
326433,
318250,
318252,
285487,
301871,
285497,
293693,
162621,
162626,
277316,
318278,
277325,
293711,
301918,
293730,
351077,
342887,
400239,
277366,
228215,
269178,
277370,
359298,
277381,
113542,
228233,
228234,
56208,
293781,
318364,
310176,
310178,
310182,
293800,
236461,
293806,
130016,
64485,
277479,
326635,
203757,
277492,
293886,
277509,
277510,
146448,
277523,
277524,
293910,
310317,
252980,
359478,
302139,
277563,
359495,
277597,
113760,
302177,
285798,
228458,
15471,
187506,
285814,
285820,
187521,
285828,
302213,
285830,
253063,
302216,
228491,
228493,
285838,
162961,
326804,
187544,
302240,
343203,
253099,
367799,
294074,
277690,
64700,
228542,
302274,
343234,
367810,
244940,
228563,
310497,
195811,
228588,
253167,
302325,
204022,
228600,
228609,
245019,
277792,
130338,
130343,
277800,
113966,
351537,
286018,
113987,
15686,
294218,
318805,
294243,
163175,
327024,
327025,
327031,
294275,
179587,
368011,
318864,
318875,
310692,
310701,
286129,
286132,
228795,
302529,
302531,
163268,
163269,
310732,
302540,
64975,
327121,
228827,
286172,
310757,
187878,
343542,
343543,
286202,
286205,
302590,
228861,
294400,
228867,
253452,
65041,
146964,
204313,
286244,
245287,
278060,
245292,
286254,
196164,
56902,
228943,
286288,
196187,
147036,
343647,
286306,
310889,
138863,
188031,
294529,
286343,
229001,
310923,
188048,
229020,
302754,
245412,
229029,
40613,
40614,
40615,
278191,
286388,
286391,
319162,
286399,
302797,
212685,
212688,
245457,
302802,
286423,
278233,
278234,
294622,
278240,
229088,
212716,
212717,
229113,
286459,
278272,
319233,
311042,
278291,
278293,
294678,
278299,
286494,
294700,
360252,
188251,
245599,
237408,
302946,
253829,
40853,
294807,
294809,
294814,
311199,
319392,
294823,
294843,
98239,
237504,
294850,
163781,
344013,
212946,
24532,
294886,
253929,
327661,
278512,
311281,
311282
] |
22154ebca1cd1d851ad5c091f27906c24d6750ed | 2e54b7f1c5c79228286ff9ffed84b070c975eade | /FinalProject/FinalProject/ViewControllers/ViewController.swift | f1fdb68ae9b2d37b1f9b071a0728afcb00e19ff3 | [] | no_license | danielkobe/ResellTracker | 8cbf9ec5a6cf2a026448bda9fee3f77e6c604f2d | 11e0b8b08b78e0bf2bbf1565a332665b939faaf9 | refs/heads/master | 2020-03-19T04:27:30.120734 | 2018-06-02T15:47:57 | 2018-06-02T15:47:57 | 135,830,568 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,217 | swift | //
// ViewController.swift
// FinalProject
//
// Created by Daniel Koberstein on 4/12/18.
// Copyright © 2018 Daniel Koberstein. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var textView: UITextView!
@IBOutlet weak var textField: UITextField!
var responseString:String?
func handleResponse (data: Data?, response: URLResponse?, error: Error?) {
if let err = error {
print("error: \(err.localizedDescription)")
} else {
let httpResponse = response as! HTTPURLResponse
let statusCode = httpResponse.statusCode
if statusCode != 200 {
let msg = HTTPURLResponse.localizedString(forStatusCode:
statusCode)
print("HTTP \(statusCode) error: \(msg)")
} else {
// response okay, do something with data
//let dataStr = String(data: data!, encoding: .utf8)
// response okay, do something with data
if let jsonObj = try? JSONSerialization.jsonObject(with: data!) {
let jsonDict = jsonObj as! [String: AnyObject]
//let first = jsonDict["hits"] as! String!
if let hits = jsonDict["hits"] as? [AnyObject]
{
for hit in hits{
let shoe = hit as! Dictionary<String, AnyObject>
print(shoe["name"]!)
}
//print(first["thumbnail_url"])
}
else{
print("error in hits")
}
}
else {
print("error: invalid JSON data")
}
}
}
}
@IBAction func buttonTapped(_ sender: UIButton) {
let jsonStr = "{\"params\":\"query=" + textField.text! + "&facets=*&page=0&hitsPerPage=50\"}";
let jsonData = jsonStr.data(using: .utf8)
let url = URL(string: "https://xw7sbct9v6-dsn.algolia.net/1/indexes/products/query")
var request = URLRequest(url: url!)
request.httpMethod = "POST"
request.httpBody = jsonData!
request.setValue("Algolia for vanilla JavaScript 3.22.1", forHTTPHeaderField: "x-algolia-agent")
request.setValue("XW7SBCT9V6", forHTTPHeaderField: "x-algolia-application-id")
request.setValue("6bfb5abee4dcd8cea8f0ca1ca085c2b3", forHTTPHeaderField: "x-algolia-api-key")
let dataTask = URLSession.shared.dataTask(with: request,
completionHandler: handleResponse)
dataTask.resume()
}
override func viewDidLoad() {
super.viewDidLoad()
navigationController?.navigationBar.barTintColor = UIColor.green
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
| [
-1
] |
d91758835c2fba4dd47e131b8a5c88625182f04f | a502285b7c8adf638e097ebc097fa4a114c8fcbe | /HSBitcoinKit/HSBitcoinKit/Network/Messages/NetworkAddress.swift | 6f794db433e309c204a38b7704bde2742ffe519e | [
"MIT"
] | permissive | sparklyhiking/bitcoin-kit-ios | a64a9fced7be4b7ac506f428122af6038c0bd644 | 1e54599fdea29b9088d611439ef2465c1a97facf | refs/heads/master | 2020-04-25T15:54:46.528569 | 2019-02-27T09:55:35 | 2019-02-27T09:55:35 | 172,892,558 | 0 | 0 | MIT | 2019-02-27T10:17:28 | 2019-02-27T10:17:27 | null | UTF-8 | Swift | false | false | 1,233 | swift | import Foundation
import HSCryptoKit
/// When a network address is needed somewhere,
/// this structure is used. Network addresses are not prefixed with a timestamp in the version message.
struct NetworkAddress {
let services: UInt64
let address: String
let port: UInt16
init(services: UInt64, address: String, port: UInt16) {
self.services = services
self.address = address
self.port = port
}
init(byteStream: ByteStream) {
services = byteStream.read(UInt64.self)
let addrData = byteStream.read(Data.self, count: 16)
let addr = ipv6(from: addrData)
if addr.hasPrefix("0000:0000:0000:0000:0000:ffff") {
address = "0000:0000:0000:0000:0000:ffff:" + ipv4(from: addrData)
} else {
address = addr
}
port = byteStream.read(UInt16.self)
}
func serialized() -> Data {
var data = Data()
data += services.littleEndian
data += pton(address)
data += port.bigEndian
return data
}
}
extension NetworkAddress: CustomStringConvertible {
var description: String {
return "[\(address)]:\(port.bigEndian) \(ServiceFlags(rawValue: services))"
}
}
| [
-1
] |
f3dfa016c1cdd834d0d132c07d3acbdcff605131 | 534007f32f7b23d710fc638c5825b686174356d4 | /Playground/iOS/AwesomeApp/ContentView.swift | 4bf9e08ec40367158c9bd8ce3f0818ba5c9e268a | [
"CC0-1.0"
] | permissive | Sherlouk/awesome-snapshot-testing | b4d040cd0ab666ef20bacbeb517b706800742ed5 | 6dda2ca55d963509f6ccf5719142845ea3943f18 | refs/heads/main | 2023-06-05T01:53:50.348829 | 2021-07-05T08:43:07 | 2021-07-05T08:43:07 | 382,614,996 | 3 | 0 | CC0-1.0 | 2021-07-03T13:14:25 | 2021-07-03T12:52:09 | null | UTF-8 | Swift | false | false | 341 | swift | //
// ContentView.swift
// AwesomeApp
//
// Created by James Sherlock on 03/07/2021.
//
import SwiftUI
struct ContentView: View {
var body: some View {
Text("Hello, world!")
.font(.title2)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
| [
411346
] |
a701b20bb6bbb274c6a74d3caca5f8da9d127cb7 | aa24d3a333d8dda2b36d090ea5b1e5ea0d83e995 | /Realm/Tests/SwiftUITestHost/SwiftUITestHostApp.swift | 314c1ca12d8d2739edb1b7315f2dfadf7e23e490 | [
"Apache-2.0",
"LicenseRef-scancode-generic-export-compliance"
] | permissive | StreamLayer/realm-cocoa | 67eec9999ae0f1fe960938a80f3ab036829b7890 | c4b36c55ebf5e7f37746f80de50b9b4389d7e548 | refs/heads/master | 2022-05-15T23:10:58.841069 | 2022-05-04T17:50:16 | 2022-05-04T17:50:16 | 228,553,834 | 0 | 0 | NOASSERTION | 2021-12-16T06:57:57 | 2019-12-17T07:01:10 | Objective-C | UTF-8 | Swift | false | false | 13,959 | swift | ////////////////////////////////////////////////////////////////////////////
//
// Copyright 2021 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////
import RealmSwift
import SwiftUI
struct ReminderFormView: View {
@ObservedRealmObject var reminder: Reminder
var body: some View {
Form {
TextField("title", text: $reminder.title).accessibility(identifier: "formTitle")
DatePicker("date", selection: $reminder.date)
Picker("priority", selection: $reminder.priority, content: {
ForEach(Reminder.Priority.allCases) { priority in
Text(priority.description).tag(priority)
}
}).accessibilityIdentifier("picker")
}
.navigationTitle(reminder.title)
}
}
struct ReminderListView: View {
@ObservedRealmObject var list: ReminderList
@State var activeReminder: Reminder.ID?
var body: some View {
VStack {
List {
ForEach(list.reminders) { reminder in
NavigationLink(destination: ReminderFormView(reminder: reminder),
tag: reminder.id, selection: $activeReminder) {
Text(reminder.title)
}
}
.onMove(perform: $list.reminders.move)
.onDelete(perform: $list.reminders.remove)
}
}.navigationTitle(list.name)
.navigationBarItems(trailing: HStack {
EditButton()
Button("add") {
let reminder = Reminder()
$list.reminders.append(reminder)
activeReminder = reminder.id
}.accessibility(identifier: "addReminder")
})
}
}
struct ReminderListResultsView: View {
// Only receive notifications on "name" to work around what appears to be
// a SwiftUI bug introduced in iOS 14.5: when we're two levels deep in
// NagivationLinks, refreshing this view makes the second NavigationLink pop
@ObservedResults(ReminderList.self, keyPaths: ["name", "icon"]) var reminders
@Binding var searchFilter: String
@State var activeList: ReminderList.ID?
struct Row: View {
@ObservedRealmObject var list: ReminderList
var body: some View {
HStack {
Image(systemName: list.icon)
TextField("List Name", text: $list.name)
Spacer()
Text("\(list.reminders.count)")
}.accessibility(identifier: "hstack")
}
}
var body: some View {
List {
ForEach(reminders) { list in
NavigationLink(destination: ReminderListView(list: list), tag: list.id, selection: $activeList) {
Row(list: list)
}.accessibilityIdentifier(list.name).accessibilityActivationPoint(CGPoint(x: 0, y: 0))
}.onDelete(perform: $reminders.remove)
}.onChange(of: searchFilter) { value in
if ProcessInfo.processInfo.environment["query_type"] == "type_safe_query" {
$reminders.where = value.isEmpty ? nil : { $0.name.contains(value, options: .caseInsensitive) }
} else {
$reminders.filter = value.isEmpty ? nil : NSPredicate(format: "name CONTAINS[c] %@", value)
}
}
}
}
public extension Color {
static let lightText = Color(UIColor.lightText)
static let darkText = Color(UIColor.darkText)
static let label = Color(UIColor.label)
static let secondaryLabel = Color(UIColor.secondaryLabel)
static let tertiaryLabel = Color(UIColor.tertiaryLabel)
static let quaternaryLabel = Color(UIColor.quaternaryLabel)
static let systemBackground = Color(UIColor.systemBackground)
static let secondarySystemBackground = Color(UIColor.secondarySystemBackground)
static let tertiarySystemBackground = Color(UIColor.tertiarySystemBackground)
}
struct SearchView: View {
@Binding var searchFilter: String
var body: some View {
VStack {
Spacer()
HStack {
Image(systemName: "magnifyingglass").foregroundColor(.gray)
.padding(.leading, 7)
.padding(.top, 7)
.padding(.bottom, 7)
TextField("search", text: $searchFilter)
.padding(.top, 7)
.padding(.bottom, 7)
.accessibility(identifier: "searchField")
}.background(RoundedRectangle(cornerRadius: 15)
.fill(Color.secondarySystemBackground))
Spacer()
}.frame(maxHeight: 40).padding()
}
}
struct Footer: View {
let realm = try! Realm()
var body: some View {
HStack {
Button(action: {
try! realm.write {
realm.add(ReminderList())
}
}, label: {
HStack {
Image(systemName: "plus.circle")
Text("Add list")
}
}).buttonStyle(BorderlessButtonStyle())
.padding()
.accessibility(identifier: "addList")
Spacer()
}
}
}
struct ContentView: View {
@State var searchFilter: String = ""
var body: some View {
NavigationView {
VStack {
SearchView(searchFilter: $searchFilter)
ReminderListResultsView(searchFilter: $searchFilter)
Spacer()
Footer()
}
.navigationBarItems(trailing: EditButton())
.navigationTitle("reminders")
}
}
}
struct MultiRealmContentView: View {
struct RealmView: View {
@Environment(\.realm) var realm
var body: some View {
Text(realm.configuration.inMemoryIdentifier ?? "no memory identifier")
.accessibilityIdentifier("test_text_view")
}
}
@State var showSheet = false
var body: some View {
NavigationView {
VStack {
NavigationLink("Realm A", destination: RealmView().environment(\.realmConfiguration, Realm.Configuration(inMemoryIdentifier: "realm_a")))
NavigationLink("Realm B", destination: RealmView().environment(\.realmConfiguration, Realm.Configuration(inMemoryIdentifier: "realm_b")))
Button("Realm C") {
showSheet = true
}
}.sheet(isPresented: $showSheet, content: {
RealmView().environment(\.realmConfiguration, Realm.Configuration(inMemoryIdentifier: "realm_c"))
})
}
}
}
struct UnmanagedObjectTestView: View {
struct NestedViewOne: View {
struct NestedViewTwo: View {
@Environment(\.realm) var realm
@Environment(\.presentationMode) var presentationMode
@ObservedRealmObject var reminderList: ReminderList
var body: some View {
Button("Delete") {
$reminderList.delete()
presentationMode.wrappedValue.dismiss()
}
}
}
@ObservedRealmObject var reminderList: ReminderList
@Environment(\.presentationMode) var presentationMode
@State var shown = false
var body: some View {
NavigationLink("Next", destination: NestedViewTwo(reminderList: reminderList)).onAppear {
if shown {
presentationMode.wrappedValue.dismiss()
}
shown = true
}
}
}
@ObservedRealmObject var reminderList = ReminderList()
@Environment(\.realm) var realm
@State var passToNestedView = false
var body: some View {
NavigationView {
Form {
TextField("name", text: $reminderList.name).accessibilityIdentifier("name")
NavigationLink("test", destination: NestedViewOne(reminderList: reminderList), isActive: $passToNestedView)
}.navigationBarItems(trailing: Button("Add", action: {
try! realm.write { realm.add(reminderList) }
passToNestedView = true
}).accessibility(identifier: "addReminder"))
}.onAppear {
print("ReminderList: \(reminderList)")
}
}
}
struct ObservedResultsKeyPathTestView: View {
@ObservedResults(ReminderList.self, keyPaths: ["reminders.isFlagged"]) var reminders
var body: some View {
VStack {
List {
ForEach(reminders) { list in
ObservedResultsKeyPathTestRow(list: list)
}.onDelete(perform: $reminders.remove)
}
.navigationBarItems(trailing: EditButton())
.navigationTitle("reminders")
Footer()
}
}
}
struct ObservedResultsKeyPathTestRow: View {
var list: ReminderList
var body: some View {
HStack {
Image(systemName: list.icon)
Text(list.name)
}.frame(minWidth: 100).accessibility(identifier: "hstack")
}
}
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
struct ObservedResultsSearchableTestView: View {
@ObservedResults(ReminderList.self, where: { $0.name.starts(with: "reminder") }) var reminders
@State var searchFilter: String = ""
var body: some View {
NavigationView {
List {
ForEach(reminders) { reminder in
Text(reminder.name)
}
}
.searchable(text: $searchFilter,
collection: $reminders,
keyPath: \.name) {
ForEach(reminders) { remindersFiltered in
Text(remindersFiltered.name).searchCompletion(remindersFiltered.name)
}
}
.navigationTitle("Reminders")
.navigationBarItems(trailing:
Button("add") {
let reminder = ReminderList()
$reminders.append(reminder)
}.accessibility(identifier: "addList"))
}
}
}
struct ObservedResultsConfiguration: View {
@ObservedResults(ReminderList.self) var remindersA // config from `.environment`
@ObservedResults(ReminderList.self,
configuration: Realm.Configuration(inMemoryIdentifier: "realm_b")) var remindersB
var body: some View {
NavigationView {
VStack {
Text(remindersA.realm?.configuration.inMemoryIdentifier ?? "no memory identifier")
.accessibility(identifier: "realm_a_label")
Text(remindersB.realm?.configuration.inMemoryIdentifier ?? "no memory identifier")
.accessibility(identifier: "realm_b_label")
List {
ForEach(remindersA) { reminder in
Text(reminder.name)
}
}.accessibility(identifier: "ListA")
List {
ForEach(remindersB) { reminder in
Text(reminder.name)
}
}.accessibility(identifier: "ListB")
}
.navigationTitle("Reminders")
.navigationBarItems(leading:
Button("add A") {
let reminder = ReminderList()
$remindersA.append(reminder)
}.accessibility(identifier: "addListA")
)
.navigationBarItems(trailing:
Button("add B") {
let reminder = ReminderList()
$remindersB.append(reminder)
}.accessibility(identifier: "addListB")
)
}
}
}
@main
struct App: SwiftUI.App {
var body: some Scene {
if let realmPath = ProcessInfo.processInfo.environment["REALM_PATH"] {
Realm.Configuration.defaultConfiguration =
Realm.Configuration(fileURL: URL(string: realmPath)!, deleteRealmIfMigrationNeeded: true)
} else {
Realm.Configuration.defaultConfiguration =
Realm.Configuration(deleteRealmIfMigrationNeeded: true)
}
let view: AnyView = {
switch ProcessInfo.processInfo.environment["test_type"] {
case "multi_realm_test":
return AnyView(MultiRealmContentView())
case "unmanaged_object_test":
return AnyView(UnmanagedObjectTestView())
case "observed_results_key_path":
return AnyView(ObservedResultsKeyPathTestView())
case "observed_results_searchable":
if #available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) {
return AnyView(ObservedResultsSearchableTestView())
} else {
return AnyView(EmptyView())
}
case "observed_results_configuration":
return AnyView(ObservedResultsConfiguration()
.environment(\.realmConfiguration, Realm.Configuration(inMemoryIdentifier: "realm_a")))
default:
return AnyView(ContentView())
}
}()
return WindowGroup {
view
}
}
}
| [
-1
] |
4c45d56b073117c3eaae3156a9300fb61a43b873 | 9e89ecd6729d2214c7fc49b3420ec2e02558a3b4 | /Podcast/RecommendedEpisodesOuterTableViewCell.swift | 95358992ff6f7a2e68c6b64c17a1daa8a5765724 | [
"MIT"
] | permissive | jonneyHo/podcast-ios | c5e61697a43eda28dfe4814482f76cbd2edb406c | e902d90c92d715b5a6e8ed660ea10951ff66e302 | refs/heads/master | 2021-08-31T15:50:10.959845 | 2017-12-03T19:55:55 | 2017-12-03T19:55:55 | 115,100,797 | 1 | 0 | null | 2017-12-22T09:38:08 | 2017-12-22T09:38:07 | null | UTF-8 | Swift | false | false | 6,073 | swift | //
// RecommendedEpisodesOuterTableViewCell.swift
// Podcast
//
// Created by Kevin Greer on 2/19/17.
// Copyright © 2017 Cornell App Development. All rights reserved.
//
import UIKit
protocol RecommendedEpisodesOuterTableViewCellDataSource: class {
func recommendedEpisodesTableViewCell(cell: RecommendedEpisodesOuterTableViewCell, dataForItemAt indexPath: IndexPath) -> Episode
func numberOfRecommendedEpisodes(forRecommendedEpisodesOuterTableViewCell cell: RecommendedEpisodesOuterTableViewCell) -> Int
}
protocol RecommendedEpisodesOuterTableViewCellDelegate: class {
func recommendedEpisodesOuterTableViewCell(cell: RecommendedEpisodesOuterTableViewCell, didSelectItemAt indexPath: IndexPath)
func recommendedEpisodesOuterTableViewCellDidPressTagButton(episodeTableViewCell: EpisodeTableViewCell, episode: Episode, index: Int)
func recommendedEpisodesOuterTableViewCellDidPressShowActionSheet(episodeTableViewCell: EpisodeTableViewCell, episode: Episode)
func recommendedEpisodeOuterTableViewCellDidPressRecommendButton(episodeTableViewCell: EpisodeTableViewCell, episode: Episode)
func recommendedEpisodeOuterTableViewCellDidPressBookmarkButton(episodeTableViewCell: EpisodeTableViewCell, episode: Episode)
func recommendedEpisodeOuterTableViewCellDidPressPlayButton(episodeTableViewCell: EpisodeTableViewCell, episode: Episode)
}
class RecommendedEpisodesOuterTableViewCell: UITableViewCell, UITableViewDelegate, UITableViewDataSource, EpisodeTableViewCellDelegate {
var tableView: UITableView!
weak var dataSource: RecommendedEpisodesOuterTableViewCellDataSource?
weak var delegate: RecommendedEpisodesOuterTableViewCellDelegate?
var currentlyPlayingIndexPath: IndexPath?
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
tableView = UITableView(frame: bounds)
tableView.backgroundColor = .paleGrey
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(EpisodeTableViewCell.self, forCellReuseIdentifier: "Cell")
tableView.isScrollEnabled = false
contentView.addSubview(tableView)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return dataSource?.numberOfRecommendedEpisodes(forRecommendedEpisodesOuterTableViewCell: self) ?? 0
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as? EpisodeTableViewCell else { return UITableViewCell() }
let episode = dataSource?.recommendedEpisodesTableViewCell(cell: self, dataForItemAt: indexPath) ?? Episode()
cell.setupWithEpisode(episode: episode)
cell.delegate = self
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableViewAutomaticDimension
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
delegate?.recommendedEpisodesOuterTableViewCell(cell: self, didSelectItemAt: indexPath)
}
override func layoutSubviews() {
super.layoutSubviews()
tableView.frame = bounds
tableView.layoutSubviews()
tableView.setNeedsLayout()
}
//MARK
//MARK - Episode Cell Delegate
//MARK
func episodeTableViewCellDidPressPlayPauseButton(episodeTableViewCell: EpisodeTableViewCell) {
guard let episodeIndexPath = tableView.indexPath(for: episodeTableViewCell), let episode = dataSource?.recommendedEpisodesTableViewCell(cell: self, dataForItemAt: episodeIndexPath) else { return }
delegate?.recommendedEpisodeOuterTableViewCellDidPressPlayButton(episodeTableViewCell: episodeTableViewCell, episode: episode)
}
func episodeTableViewCellDidPressRecommendButton(episodeTableViewCell: EpisodeTableViewCell) {
guard let episodeIndexPath = tableView.indexPath(for: episodeTableViewCell), let episode = dataSource?.recommendedEpisodesTableViewCell(cell: self, dataForItemAt: episodeIndexPath) else { return }
delegate?.recommendedEpisodeOuterTableViewCellDidPressRecommendButton(episodeTableViewCell: episodeTableViewCell, episode: episode)
}
func episodeTableViewCellDidPressBookmarkButton(episodeTableViewCell: EpisodeTableViewCell) {
guard let episodeIndexPath = tableView.indexPath(for: episodeTableViewCell), let episode = dataSource?.recommendedEpisodesTableViewCell(cell: self, dataForItemAt: episodeIndexPath) else { return }
delegate?.recommendedEpisodeOuterTableViewCellDidPressBookmarkButton(episodeTableViewCell: episodeTableViewCell, episode: episode)
}
func episodeTableViewCellDidPressTagButton(episodeTableViewCell: EpisodeTableViewCell, index: Int) {
guard let episodeIndexPath = tableView.indexPath(for: episodeTableViewCell), let episode = dataSource?.recommendedEpisodesTableViewCell(cell: self, dataForItemAt: episodeIndexPath) else { return }
delegate?.recommendedEpisodesOuterTableViewCellDidPressTagButton(episodeTableViewCell: episodeTableViewCell, episode: episode, index: index)
}
func episodeTableViewCellDidPressMoreActionsButton(episodeTableViewCell: EpisodeTableViewCell) {
guard let episodeIndexPath = tableView.indexPath(for: episodeTableViewCell), let episode = dataSource?.recommendedEpisodesTableViewCell(cell: self, dataForItemAt: episodeIndexPath) else { return }
delegate?.recommendedEpisodesOuterTableViewCellDidPressShowActionSheet(episodeTableViewCell: episodeTableViewCell, episode: episode)
}
}
| [
-1
] |
1f82dcf0e22e51382a962dfc4a512baa6aad66d5 | 715dfb66aefa244fe3ac0d5946ad8ba67ff7f712 | /KikoInstaller/ThemeColor.swift | 77fb01b6e508ea9c23d6cead576bb75eb1399359 | [] | no_license | Vijaybrightgreen/KIKOInstaller | 5dd693bf329e06280a18f2a081137c401453760f | ffe4381e67396e0e911b1e63ecd416a1c7a281b4 | refs/heads/master | 2020-03-07T21:08:55.331774 | 2018-04-06T08:08:58 | 2018-04-06T08:08:58 | 127,718,919 | 2 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,482 | swift | //
// ThemeColor.swift
// KikoInstaller
//
// Created by Prabhakar Annavi on 1/19/17.
// Copyright © 2017 Eoxys Systems. All rights reserved.
//
import UIKit
import Foundation
class ThemeColor{
var customUtil = CustomUtil()
var gradientLayer: CAGradientLayer!
//Text Field
let placeholderNormalColor:UIColor = UIColor.white
let placeholderActiveColor:UIColor = UIColor.white
let dividerNormalColor:UIColor = UIColor.white
let dividerActiveColor:String = "4ABFA7"
let clearBtnTintColor:UIColor = UIColor.white
//Navigation bar
let navigationBarBgColor:String = "475A6B"
let navigationBarBackColor:String = "4ABFA7"
//Left bar Button
let BarButtonColor:UIColor = UIColor.white
//Home Screen Label text color
let labelTextColor:UIColor = UIColor.white
//Dashboard number color
let dashboardNumColor:String = "5FB9B7"
func createGradientLayer(view:UIView) {
gradientLayer = CAGradientLayer()
gradientLayer.frame = view.bounds
gradientLayer.colors = [customUtil.hexStringToUIColor(hex: "5D6D7E").cgColor, customUtil.hexStringToUIColor(hex: "39454E").cgColor]
//gradientLayer.locations = [-0.5]
gradientLayer.startPoint = CGPoint(x: 0.0, y: 0.0)
gradientLayer.endPoint = CGPoint(x: 1.0, y: 1.0)
// self.view.layer.addSublayer(gradientLayer)
view.layer.insertSublayer(gradientLayer, at: 0)
}
}
| [
-1
] |
3da8a9f6eb0ca145605a41fc76df0fa683b89fe2 | d86c6054e291238527edfecf093ff3445bdb9601 | /TDefense/GameScene.swift | 7299d2d2dd96689482b3067bc2d9bfa74f8b2942 | [
"MIT"
] | permissive | ramtiga/TDefense | a7f47b79359b85ae828e1e60d8485c1ba707193f | da04db3fc2383c93985a38612b5f47145612be2d | refs/heads/master | 2021-08-17T08:14:33.809455 | 2017-11-21T00:06:35 | 2017-11-21T00:06:35 | 111,476,156 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,972 | swift | //
// GameScene.swift
// TDefense
//
// Created by Dai Haneda on 2017/11/21.
// Copyright © 2017年 Dai Haneda. All rights reserved.
//
import SpriteKit
struct PhysicsCategory {
static let Char : UInt32 = 0x1 << 1
static let Enemy : UInt32 = 0x1 << 2
}
class GameScene: SKScene, SKPhysicsContactDelegate {
enum State {
case Playing
case GameClear
case GameOver
}
var state = State.Playing
let enemy = SKSpriteNode(imageNamed: "Enemy")
let char = SKSpriteNode(imageNamed: "Char")
override func didMove(to view: SKView) { let fieldImageSize : CGFloat = 32
self.physicsWorld.contactDelegate = self
self.physicsWorld.gravity = CGVector(dx: 0, dy: 0)
for i in Int(-self.frame.width / 2)...Int(self.frame.width / 2) + 1{
for j in Int(-self.frame.height / 2)...Int(self.frame.height / 2) + 1{
let field = SKSpriteNode(imageNamed: "Field")
field.position = CGPoint(x: CGFloat(i) * fieldImageSize, y: CGFloat(j) * fieldImageSize)
field.zPosition = -1
self.addChild(field)
}
}
//敵キャラ
enemy.position = CGPoint(x: -100, y: 0)
enemy.physicsBody = SKPhysicsBody(rectangleOf: enemy.size)
enemy.physicsBody?.categoryBitMask = PhysicsCategory.Enemy
enemy.physicsBody?.collisionBitMask = PhysicsCategory.Char
enemy.physicsBody?.contactTestBitMask = PhysicsCategory.Char
self.addChild(enemy)
//味方キャラ
char.position = CGPoint(x: 100, y: 0)
char.physicsBody = SKPhysicsBody(rectangleOf: char.size)
char.physicsBody?.categoryBitMask = PhysicsCategory.Char
char.physicsBody?.collisionBitMask = PhysicsCategory.Enemy
char.physicsBody?.contactTestBitMask = PhysicsCategory.Enemy
self.addChild(char)
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
}
override func update(_ currentTime: TimeInterval) {
// Called before each frame is rendered
if state == .Playing {
enemy.position.x += 10
if enemy.position.x > self.frame.width / 2 {
state = .GameOver
let gameOverLbl = SKLabelNode()
gameOverLbl.text = "Game Over"
gameOverLbl.fontName = "HiraginoSans-W6"
gameOverLbl.position = CGPoint(x: 0, y: 0)
gameOverLbl.fontSize = 45
self.addChild(gameOverLbl)
}
}
}
func didBegin(_ contact: SKPhysicsContact) {
if contact.bodyA.categoryBitMask == PhysicsCategory.Char && contact.bodyB.categoryBitMask == PhysicsCategory.Enemy ||
contact.bodyB.categoryBitMask == PhysicsCategory.Char && contact.bodyA.categoryBitMask == PhysicsCategory.Enemy {
state = .GameClear
enemy.removeFromParent()
let gameClearLbl = SKLabelNode(fontNamed: "HiraginoSans-W6")
gameClearLbl.text = "Clear"
gameClearLbl.position = CGPoint(x: 0, y: 0)
gameClearLbl.fontSize = 45
self.addChild(gameClearLbl)
}
}
}
| [
-1
] |
33bf71244d28bc82e48cf9994188d5e90bb501e5 | 2afd8657b3c3bb14367d932e25e96549c814bff5 | /ecommerce-ios/Extensions/View+CustomOverlayView.swift | b677e9dc8c084d02398a98224144509227324926 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | nimblehq/nimble-ecommerce-ios | c6214a94f5ab33ef0b0e4ff9d7586d36a05b32c0 | a6f173f8cb4a84a4df346136eaa22c4a13c3e096 | refs/heads/develop | 2023-05-15T02:01:20.919781 | 2021-06-04T03:53:53 | 2021-06-04T03:53:53 | 346,559,560 | 2 | 0 | MIT | 2021-06-04T03:54:41 | 2021-03-11T02:56:04 | Swift | UTF-8 | Swift | false | false | 285 | swift | //
// View+CustomOverlayView.swift
// ecommerce-ios
//
// Created by Nguyen M. Tam on 17/05/2021.
//
import SwiftUI
public extension View {
func overlay<Content>(@ViewBuilder customView: () -> Content) -> some View where Content: View {
overlay(customView())
}
}
| [
-1
] |
01e2f0bd76596b092967a88c1a54a6ac34a08252 | d439a95c18c503bc47b418d78094b97bcfd895cc | /validation-test/compiler_crashers_fixed/26320-swift-modulefile-getimportedmodules.swift | e0090bd55cd44a9cb0c5b75957904d99d16e5745 | [
"Apache-2.0",
"Swift-exception"
] | permissive | DougGregor/swift | 7e40d5a1b672e6fca9b28130ef8ac0ce601cf650 | 16b686989c12bb1acf9d1a490c1f301d71428f47 | refs/heads/master | 2023-08-05T05:11:53.545515 | 2016-07-06T18:23:34 | 2016-07-06T18:23:34 | 50,400,732 | 14 | 2 | Apache-2.0 | 2023-08-23T05:19:32 | 2016-01-26T03:34:10 | C++ | UTF-8 | Swift | false | false | 464 | swift | // This source file is part of the Swift.org open source project
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
// RUN: not %target-swift-frontend %s -parse
class a{struct Q<T where B:N
class A{enum B<T where B:a{enum b
func b<T
| [
74170,
74206,
74807,
74942,
74943,
74947,
74949,
74951,
74952,
74953,
74954,
74956,
74958,
74959,
74962,
74964,
74966,
74970,
74974,
74975,
74976,
74977,
74978,
74979,
74981,
74982,
74983,
74984,
74985,
74987,
74988,
74990,
74991,
74992,
74993,
74994,
74995,
74997,
75000,
75003,
75004,
75007,
75008,
75010,
75011,
75012,
75014,
75016,
75017,
75020,
75021,
75022,
75023,
75025,
75026,
75029,
75030,
75033,
75034,
75035,
75037,
75038,
75039,
75040,
75041,
75042,
75043,
75044,
75045,
75046,
75047,
75049,
75050,
75051,
75052,
75053,
75054,
75055,
75056,
75057,
75058,
75062,
75063,
75064,
75065,
75066,
75067,
75068,
75069,
75070,
75071,
75072,
75075,
75076,
75077,
75079,
75080,
75081,
75082,
75083,
75084,
75085,
75087,
75088,
75090,
75091,
75092,
75093,
75095,
75096,
75097,
75098,
75102,
75103,
75104,
75105,
75107,
75108,
75109,
75110,
75111,
75112,
75116,
75117,
75118,
75119,
75120,
75122,
75123,
75125,
75128,
75129,
75131,
75132,
75133,
75134,
75135,
75136,
75137,
75139,
75140,
75141,
75142,
75144,
75145,
75147,
75148,
75149,
75152,
75153,
75154,
75155,
75157,
75158,
75162,
75163,
75164,
75166,
75167,
75168,
75170,
75172,
75173,
75174,
75176,
75178,
75179,
75180,
75182,
75184,
75185,
75186,
75187,
75189,
75190,
75191,
75192,
75193,
75194,
75195,
75196,
75197,
75200,
75201,
75203,
75204,
75205,
75206,
75207,
75208,
75209,
75212,
75214,
75215,
75216,
75217,
75218,
75219,
75220,
75221,
75222,
75223,
75224,
75225,
75226,
75227,
75228,
75229,
75230,
75232,
75236,
75237,
75238,
75239,
75240,
75241,
75242,
75243,
75245,
75250,
75251,
75253,
75254,
75255,
75256,
75257,
75258,
75260,
75261,
75264,
75265,
75266,
75268,
75270,
75271,
75272,
75273,
75274,
75275,
75276,
75277,
75278,
75279,
75282,
75285,
75286,
75288,
75289,
75291,
75293,
75295,
75296,
75297,
75299,
75301,
75303,
75304,
75305,
75306,
75307,
75308,
75310,
75312,
75313,
75314,
75315,
75316,
75317,
75320,
75321,
75322,
75324,
75325,
75326,
75327,
75329,
75330,
75331,
75333,
75334,
75335,
75337,
75338,
75340,
75341,
75342,
75343,
75346,
75347,
75348,
75349,
75350,
75351,
75352,
75353,
75355,
75356,
75357,
75358,
75359,
75360,
75361,
75362,
75364,
75365,
75366,
75368,
75369,
75370,
75371,
75372,
75373,
75375,
75376,
75377,
75378,
75380,
75381,
75384,
75385,
75386,
75387,
75388,
75389,
75391,
75392,
75394,
75395,
75396,
75397,
75400,
75401,
75402,
75403,
75404,
75405,
75406,
75407,
75410,
75411,
75413,
75414,
75415,
75416,
75417,
75418,
75420,
75422,
75424,
75425,
75426,
75427,
75428,
75430,
75431,
75432,
75435,
75439,
75440,
75441,
75444,
75445,
75446,
75447,
75448,
75449,
75450,
75453,
75454,
75455,
75456,
75457,
75458,
75459,
75461,
75462,
75463,
75464,
75465,
75468,
75469,
75470,
75471,
75472,
75473,
75474,
75476,
75477,
75478,
75480,
75481,
75486,
75487,
75491,
75494,
75495,
75497,
75498,
75499,
75500,
75502,
75503,
75504,
75505,
75506,
75507,
75508,
75509,
75513,
75514,
75515,
75516,
75518,
75519,
75520,
75521,
75523,
75524,
75525,
75527,
75528,
75529,
75530,
75531,
75532,
75533,
75534,
75535,
75536,
75537,
75538,
75540,
75543,
75544,
75545,
75546,
75547,
75548,
75549,
75550,
75551,
75553,
75554,
75555,
75556,
75558,
75559,
75560,
75561,
75562,
75564,
75565,
75566,
75568,
75569,
75570,
75571,
75572,
75575,
75578,
75579,
75580,
75581,
75582,
75584,
75585,
75586,
75587,
75589,
75590,
75594,
75595,
75596,
75597,
75598,
75599,
75600,
75601,
75602,
75603,
75604,
75605,
75606,
75607,
75608,
75610,
75612,
75613,
75614,
75616,
75618,
75619,
75620,
75621,
75623,
75625,
75626,
75628,
75630,
75633,
75634,
75635,
75636,
75637,
75638,
75639,
75640,
75641,
75642,
75643,
75645,
75646,
75647,
75648,
75649,
75650,
75652,
75653,
75655,
75656,
75657,
75658,
75659,
75660,
75661,
75662,
75663,
75664,
75666,
75669,
75670,
75671,
75672,
75674,
75675,
75677,
75678,
75679,
75681,
75682,
75683,
75684,
75685,
75686,
75688,
75689,
75690,
75691,
75692,
75694,
75697,
75699,
75700,
75701,
75704,
75705,
75707,
75708,
75714,
75715,
75716,
75717,
75718,
75719,
75720,
75721,
75722,
75726,
75729,
75730,
75731,
75732,
75733,
75734,
75735,
75736,
75737,
75738,
75739,
75740,
75741,
75744,
75745,
75746,
75747,
75748,
75749,
75750,
75753,
75754,
75755,
75756,
75758,
75759,
75760,
75761,
75762,
75763,
75764,
75766,
75768,
75772,
75773,
75775,
75776,
75778,
75779,
75781,
75783,
75785,
75786,
75787,
75789,
75792,
75793,
75794,
75795,
75796,
75797,
75800,
75801,
75802,
75803,
75806,
75810,
75811,
75812,
75813,
75814,
75815,
75816,
75817,
75819,
75820,
75821,
75822,
75823,
75824,
75825,
75826,
75827,
75829,
75830,
75831,
75832,
75835,
75836,
75838,
75839,
75840,
75842,
75843,
75845,
75846,
75848,
75849,
75850,
75851,
75852,
75853,
75854,
75855,
75856,
75857,
75858,
75859,
75860,
75863,
75865,
75866,
75867,
75868,
75869,
75872,
75873,
75874,
75878,
75879,
75880,
75882,
75883,
75884,
75885,
75886,
75887,
75888,
75890,
75891,
75892,
75893,
75894,
75896,
75897,
75898,
75899,
75901,
75903,
75905,
75906,
75907,
75908,
75909,
75910,
75911,
75912,
75913,
75914,
75915,
75916,
75917,
75918,
75919,
75922,
75924,
75925,
75926,
75927,
75928,
75929,
75930,
75931,
75932,
75933,
75934,
75937,
75938,
75939,
75941,
75943,
75944,
75945,
75946,
75947,
75948,
75949,
75950,
75951,
75952,
75953,
75954,
75955,
75956,
75957,
75958,
75960,
75961,
75962,
75963,
75964,
75965,
75967,
75968,
75969,
75970,
75971,
75972,
75975,
75976,
75978,
75979,
75980,
75981,
75982,
75983,
75985,
75987,
75989,
75990,
75991,
75994,
75995,
75997,
75999,
76001,
76002,
76003,
76004,
76007,
76008,
76010,
76012,
76013,
76015,
76017,
76018,
76019,
76021,
76022,
76024,
76025,
76026,
76027,
76028,
76029,
76030,
76031,
76033,
76035,
76036,
76038,
76039,
76040,
76041,
76042,
76043,
76044,
76045,
76046,
76047,
76048,
76049,
76051,
76052,
76053,
76054,
76056,
76058,
76059,
76060,
76061,
76062,
76064,
76065,
76066,
76067,
76069,
76070,
76071,
76073,
76075,
76076,
76077,
76078,
76079,
76080,
76082,
76083,
76086,
76089,
76091,
76092,
76093,
76094,
76095,
76096,
76097,
76098,
76099,
76101,
76102,
76104,
76108,
76109,
76110,
76111,
76112,
76113,
76115,
76116,
76117,
76120,
76121,
76122,
76123,
76124,
76126,
76127,
76129,
76130,
76131,
76133,
76134,
76135,
76136,
76137,
76138,
76139,
76140,
76141,
76142,
76144,
76145,
76146,
76147,
76149,
76150,
76151,
76156,
76158,
76159,
76161,
76162,
76163,
76164,
76165,
76169,
76170,
76171,
76172,
76173,
76174,
76175,
76176,
76179,
76180,
76181,
76182,
76183,
76184,
76185,
76186,
76187,
76191,
76192,
76193,
76194,
76195,
76196,
76197,
76198,
76199,
76201,
76202,
76203,
76205,
76208,
76210,
76212,
76213,
76215,
76216,
76218,
76219,
76220,
76221,
76222,
76223,
76224,
76225,
76226,
76227,
76228,
76229,
76232,
76233,
76234,
76235,
76236,
76237,
76238,
76239,
76240,
76241,
76242,
76243,
76244,
76247,
76250,
76252,
76254,
76255,
76256,
76257,
76259,
76261,
76262,
76263,
76264,
76266,
76267,
76268,
76270,
76272,
76275,
76276,
76277,
76278,
76279,
76281,
76284,
76285,
76286,
76287,
76288,
76290,
76291,
76293,
76294,
76295,
76296,
76297,
76298,
76299,
76300,
76301,
76303,
76304,
76305,
76306,
76307,
76308,
76309,
76310,
76311,
76313,
76314,
76315,
76316,
76318,
76319,
76320,
76323,
76324,
76326,
76328,
76329,
76330,
76331,
76332,
76334,
76335,
76336,
76337,
76338,
76339,
76341,
76342,
76344,
76347,
76348,
76350,
76351,
76352,
76354,
76356,
76357,
76358,
76359,
76360,
76362,
76365,
76368,
76369,
76371,
76373,
76375,
76376,
76381,
76382,
76383,
76385,
76386,
76388,
76389,
76392,
76393,
76395,
76396,
76398,
76399,
76401,
76402,
76403,
76404,
76405,
76408,
76409,
76411,
76412,
76413,
76414,
76415,
76418,
76420,
76422,
76423,
76424,
76425,
76426,
76427,
76428,
76429,
76431,
76432,
76434,
76435,
76436,
76437,
76438,
76439,
76441,
76442,
76445,
76446,
76447,
76448,
76449,
76451,
76452,
76453,
76454,
76455,
76457,
76459,
76460,
76462,
76463,
76464,
76466,
76467,
76468,
76469,
76470,
76471,
76472,
76473,
76475,
76476,
76477,
76480,
76481,
76482,
76483,
76485,
76489,
76490,
76491,
76492,
76493,
76494,
76497,
76498,
76499,
76500,
76503,
76504,
76505,
76506,
76507,
76508,
76509,
76510,
76511,
76512,
76513,
76514,
76515,
76516,
76519,
76521,
76522,
76523,
76524,
76525,
76526,
76527,
76528,
76529,
76530,
76531,
76532,
76534,
76535,
76536,
76537,
76538,
76539,
76540,
76542,
76543,
76544,
76545,
76546,
76547,
76548,
76549,
76550,
76552,
76554,
76555,
76557,
76558,
76559,
76560,
76561,
76563,
76564,
76566,
76567,
76568,
76569,
76572,
76573,
76575,
76576,
76577,
76578,
76579,
76582,
76584,
76585,
76587,
76588,
76590,
76591,
76592,
76595,
76596,
76597,
76598,
76599,
76600,
76601,
76604,
76605,
76607,
76609,
76611,
76612,
76613,
76614,
76615,
76616,
76617,
76618,
76621,
76623,
76624,
76625,
76628,
76630,
76631,
76633,
76634,
76635,
76636,
76637,
76638,
76640,
76641,
76642,
76643,
76644,
76645,
76647,
76648,
76649,
76651,
76657,
76659,
76660,
76663,
76665,
76666,
76667,
76668,
76669,
76670,
76672,
76673,
76674,
76675,
76676,
76683,
76684,
76685,
76687,
76688,
76690,
76691,
76692,
76694,
76695,
76696,
76697,
76698,
76699,
76700,
76702,
76703,
76704,
76705,
76706,
76707,
76708,
76710,
76711,
76712,
76713,
76714,
76715,
76716,
76717,
76718,
76719,
76722,
76723,
76725,
76726,
76727,
76728,
76729,
76731,
76733,
76734,
76735,
76736,
76737,
76738,
76739,
76740,
76742,
76743,
76744,
76745,
76746,
76748,
76749,
76751,
76752,
76753,
76755,
76758,
76759,
76761,
76763,
76764,
76765,
76766,
76768,
76770,
76771,
76772,
76773,
76774,
76775,
76776,
76777,
76778,
76780,
76783,
76785,
76786,
76788,
76789,
76790,
76791,
76794,
76795,
76797,
76801,
76802,
76803,
76804,
76805,
76806,
76808,
76809,
76810,
76811,
76812,
76813,
76814,
76815,
76816,
76817,
76818,
76819,
76820,
76821,
76822,
76823,
76824,
76825,
76826,
76827,
76828,
76829,
76831,
76832,
76833,
76835,
76836,
76838,
76841,
76842,
76844,
76847,
76849,
76851,
76852,
76853,
76856,
76858,
76859,
76860,
76862,
76863,
76864,
76865,
76866,
76872,
76873,
76874,
76875,
76876,
76877,
76878,
76882,
76884,
76885,
76887,
76888,
76889,
76891,
76893,
76895,
76896,
76897,
76898,
76900,
76903,
76904,
76905,
76906,
76907,
76909,
76910,
76911,
76912,
76913,
76914,
76915,
76916,
76917,
76918,
76919,
76921,
76922,
76923,
76925,
76926,
76927,
76928,
76929,
76930,
76931,
76933,
76934,
76937,
76938,
76940,
76941,
76942,
76943,
76944,
76945,
76947,
76948,
76949,
76950,
76952,
76953,
76954,
76955,
76956,
76957,
76959,
76960,
76962,
76964,
76965,
76966,
76967,
76968,
76969,
76970,
76971,
76972,
76973,
76974,
76975,
76976,
76978,
76980,
76981,
76983,
76984,
76987,
76989,
76990,
76991,
76992,
76993,
76994,
76995,
76996,
76997,
76999,
77000,
77001,
77002,
77003,
77006,
77008,
77009,
77010,
77011,
77012,
77013,
77014,
77015,
77018,
77020,
77021,
77022,
77023,
77025,
77026,
77028,
77029,
77030,
77031,
77032,
77033,
77034,
77035,
77036,
77037,
77038,
77039,
77041,
77042,
77043,
77044,
77045,
77047,
77048,
77049,
77050,
77051,
77052,
77054,
77055,
77056,
77057,
77059,
77060,
77061,
77062,
77063,
77064,
77065,
77066,
77067,
77068,
77071,
77073,
77074,
77075,
77076,
77077,
77078,
77083,
77084,
77087,
77088,
77090,
77092,
77093,
77094,
77095,
77096,
77097,
77098,
77100,
77101,
77103,
77106,
77107,
77110,
77111,
77112,
77114,
77115,
77116,
77118,
77120,
77121,
77124,
77131,
77132,
77135,
77136,
77138,
77140,
77141,
77143,
77144,
77145,
77146,
77147,
77148,
77150,
77151,
77154,
77155,
77158,
77159,
77160,
77161,
77162,
77163,
77164,
77165,
77169,
77170,
77172,
77173,
77174,
77175,
77176,
77177,
77179,
77180,
77181,
77182,
77183,
77184,
77186,
77187,
77188,
77189,
77190,
77191,
77192,
77194,
77196,
77198,
77200,
77201,
77202,
77203,
77208,
77209,
77210,
77211,
77212,
77213,
77214,
77216,
77220,
77221,
77223,
77224,
77225,
77226,
77227,
77228,
77229,
77231,
77232,
77233,
77235,
77238,
77239,
77240,
77241,
77242,
77244,
77245,
77248,
77249,
77254,
77255,
77256,
77257,
77258,
77259,
77260,
77263,
77266,
77267,
77268,
77269,
77270,
77272,
77273,
77275,
77276,
77277,
77278,
77280,
77281,
77282,
77284,
77285,
77286,
77287,
77290,
77293,
77294,
77295,
77297,
77298,
77299,
77300,
77302,
77303,
77305,
77306,
77307,
77311,
77314,
77315,
77316,
77317,
77318,
77320,
77321,
77322,
77323,
77325,
77327,
77328,
77329,
77330,
77331,
77332,
77333,
77334,
77335,
77336,
77337,
77338,
77339,
77340,
77341,
77342,
77344,
77345,
77347,
77348,
77351,
77352,
77355,
77358,
77359,
77360,
77361,
77362,
77363,
77364,
77366,
77368,
77369,
77370,
77374,
77375,
77380,
77381,
77382,
77384,
77385,
77386,
77387,
77389,
77390,
77391,
77392,
77393,
77395,
77396,
77398,
77400,
77402,
77405,
77406,
77408,
77409,
77411,
77413,
77414,
77415,
77416,
77417,
77419,
77420,
77421,
77422,
77423,
77424,
77425,
77426,
77427,
77428,
77429,
77430,
77432,
77433,
77434,
77435,
77436,
77439,
77440,
77441,
77442,
77443,
77444,
77445,
77446,
77447,
77449,
77450,
77451,
77453,
77455,
77457,
77459,
77460,
77461,
77462,
77464,
77465,
77466,
77467,
77469,
77471,
77472,
77473,
77476,
77478,
77479,
77480,
77483,
77484,
77486,
77487,
77488,
77489,
77490,
77491,
77492,
77493,
77494,
77495,
77496,
77498,
77499,
77501,
77502,
77504,
77505,
77506,
77508,
77509,
77510,
77511,
77512,
77514,
77515,
77517,
77518,
77520,
77521,
77522,
77523,
77524,
77525,
77527,
77530,
77533,
77534,
77535,
77536,
77537,
77538,
77540,
77541,
77543,
77544,
77545,
77546,
77547,
77549,
77550,
77551,
77553,
77554,
77556,
77557,
77558,
77559,
77560,
77561,
77562,
77563,
77564,
77566,
77567,
77568,
77569,
77571,
77572,
77575,
77577,
77578,
77579,
77580,
77581,
77582,
77583,
77584,
77585,
77586,
77588,
77589,
77590,
77591,
77592,
77593,
77595,
77597,
77599,
77601,
77603,
77604,
77606,
77608,
77609,
77610,
77611,
77612,
77613,
77615,
77616,
77617,
77619,
77620,
77621,
77622,
77623,
77624,
77626,
77627,
77628,
77631,
77632,
77633,
77634,
77635,
77636,
77638,
77639,
77640,
77642,
77643,
77645,
77646,
77648,
77649,
77650,
77651,
77653,
77655,
77659,
77661,
77662,
77663,
77664,
77666,
77667,
77669,
77670,
77672,
77673,
77674,
77675,
77676,
77678,
77679,
77680,
77681,
77682,
77684,
77688,
77689,
77690,
77691,
77692,
77693,
77694,
77695,
77696,
77698,
77700,
77701,
77702,
77704,
77706,
77708,
77709,
77710,
77712,
77713,
77714,
77716,
77717,
77718,
77719,
77720,
77721,
77722,
77725,
77727,
77728,
77730,
77731,
77732,
77733,
77734,
77735,
77737,
77738,
77740,
77741,
77743,
77744,
77747,
77749,
77750,
77751,
77752,
77753,
77755,
77757,
77758,
77759,
77761,
77763,
77764,
77766,
77767,
77768,
77769,
77770,
77772,
77773,
77774,
77775,
77777,
77778,
77779,
77781,
77782,
77783,
77784,
77785,
77786,
77787,
77788,
77789,
77790,
77791,
77792,
77793,
77794,
77795,
77796,
77797,
77799,
77801,
77802,
77805,
77806,
77807,
77808,
77809,
77810,
77811,
77812,
77813,
77814,
77815,
77817,
77818,
77819,
77820,
77821,
77826,
77827,
77828,
77829,
77830,
77831,
77832,
77834,
77835,
77836,
77837,
77838,
77839,
77840,
77842,
77843,
77847,
77848,
77849,
77850,
77852,
77854,
77857,
77858,
77859,
77860,
77861,
77862,
77863,
77864,
77868,
77869,
77870,
77871,
77872,
77873,
77874,
77875,
77876,
77877,
77878,
77879,
77880,
77882,
77883,
77884,
77885,
77886,
77887,
77888,
77890,
77891,
77892,
77894,
77895,
77896,
77897,
77898,
77899,
77900,
77903,
77904,
77906,
77907,
77909,
77910,
77912,
77913,
77915,
77916,
77917,
77918,
77920,
77921,
77922,
77923,
77925,
77926,
77929,
77930,
77931,
77932,
77934,
77936,
77937,
77938,
77939,
77941,
77942,
77943,
77944,
77945,
77948,
77949,
77950,
77951,
77952,
77954,
77955,
77956,
77957,
77958,
77959,
77960,
77961,
77962,
77964,
77965,
77966,
77969,
77971,
77973,
77974,
77975,
77976,
77977,
77978,
77979,
77980,
77981,
77982,
77983,
77984,
77986,
77987,
77988,
77989,
77990,
77991,
77993,
77995,
77996,
77997,
77999,
78001,
78002,
78003,
78005,
78007,
78008,
78009,
78011,
78014,
78015,
78016,
78019,
78021,
78022,
78023,
78024,
78026,
78027,
78028,
78030,
78031,
78032,
78033,
78034,
78035,
78037,
78038,
78039,
78040,
78041,
78042,
78045,
78048,
78053,
78054,
78055,
78056,
78057,
78058,
78059,
78061,
78062,
78063,
78065,
78066,
78067,
78068,
78070,
78071,
78072,
78074,
78076,
78077,
78078,
78079,
78080,
78081,
78082,
78083,
78084,
78085,
78086,
78087,
78088,
78089,
78090,
78091,
78092,
78093,
78094,
78095,
78096,
78098,
78099,
78100,
78101,
78102,
78104,
78106,
78109,
78110,
78111,
78112,
78113,
78114,
78115,
78116,
78117,
78118,
78119,
78121,
78122,
78123,
78124,
78126,
78127,
78129,
78130,
78131,
78132,
78133,
78134,
78136,
78137,
78138,
78139,
78140,
78141,
78143,
78144,
78145,
78146,
78147,
78148,
78149,
78150,
78152,
78154,
78155,
78156,
78157,
78158,
78160,
78161,
78162,
78163,
78164,
78166,
78168,
78169,
78170,
78171,
78172,
78173,
78174,
78176,
78177,
78179,
78181,
78183,
78184,
78185,
78186,
78187,
78188,
78189,
78190,
78191,
78192,
78194,
78195,
78196,
78197,
78198,
78199,
78200,
78202,
78203,
78204,
78205,
78206,
78207,
78208,
78210,
78212,
78213,
78214,
78215,
78218,
78219,
78220,
78221,
78222,
78223,
78224,
78225,
78226,
78227,
78228,
78229,
78230,
78231,
78232,
78234,
78236,
78237,
78239,
78240,
78241,
78243,
78244,
78246,
78247,
78248,
78249,
78250,
78251,
78252,
78253,
78254,
78255,
78256,
78257,
78258,
78259,
78262,
78263,
78264,
78265,
78266,
78267,
78268,
78271,
78275,
78276,
78277,
78278,
78279,
78280,
78281,
78282,
78285,
78286,
78287,
78288,
78289,
78291,
78292,
78294,
78295,
78296,
78297,
78298,
78299,
78300,
78301,
78304,
78305,
78307,
78308,
78310,
78311,
78312,
78315,
78316,
78317,
78318,
78319,
78320,
78321,
78322,
78323,
78324,
78326,
78327,
78330,
78333,
78334,
78335,
78337,
78338,
78339,
78340,
78341,
78342,
78343,
78345,
78346,
78347,
78349,
78352,
78355,
78356,
78357,
78358,
78359,
78360,
78361,
78362,
78364,
78365,
78366,
78367,
78369,
78370,
78372,
78373,
78374,
78375,
78376,
78377,
78378,
78379,
78380,
78381,
78382,
78383,
78384,
78385,
78387,
78389,
78390,
78394,
78397,
78398,
78400,
78402,
78404,
78405,
78407,
78410,
78412,
78413,
78414,
78415,
78416,
78418,
78419,
78420,
78422,
78423,
78424,
78425,
78426,
78428,
78429,
78432,
78435,
78436,
78437,
78438,
78440,
78441,
78443,
78445,
78446,
78447,
78448,
78450,
78451,
78453,
78456,
78457,
78458,
78459,
78460,
78461,
78462,
78463,
78464,
78465,
78466,
78467,
78468,
78469,
78471,
78472,
78473,
78474,
78476,
78478,
78480,
78482,
78483,
78484,
78485,
78486,
78487,
78490,
78491,
78493,
78494,
78497,
78498,
78499,
78501,
78503,
78504,
78508,
78510,
78511,
78512,
78513,
78514,
78515,
78516,
78517,
78519,
78520,
78521,
78522,
78523,
78524,
78526,
78527,
78528,
78529,
78530,
78531,
78533,
78534,
78536,
78537,
78539,
78540,
78541,
78542,
78545,
78547,
78548,
78549,
78550,
78551,
78553,
78554,
78555,
78556,
78557,
78558,
78561,
78562,
78563,
78564,
78565,
78566,
78567,
78568,
78569,
78570,
78573,
78574,
78575,
78579,
78580,
78581,
78584,
78587,
78589,
78591,
78592,
78593,
78594,
78598,
78600,
78602,
78603,
78606,
78607,
78608,
78609,
78610,
78611,
78612,
78613,
78615,
78616,
78617,
78618,
78619,
78620,
78623,
78624,
78625,
78627,
78628,
78629,
78630,
78632,
78634,
78635,
78637,
78638,
78639,
78640,
78641,
78642,
78643,
78645,
78646,
78647,
78648,
78650,
78652,
78654,
78655,
78656,
78657,
78658,
78661,
78662,
78663,
78665,
78667,
78668,
78670,
78671,
78673,
78675,
78678,
78679,
78681,
78682,
78683,
78684,
78686,
78688,
78689,
78691,
78694,
78695,
78696,
78697,
78698,
78699,
78700,
78701,
78702,
78703,
78704,
78706,
78709,
78710,
78711,
78712,
78713,
78714,
78715,
78716,
78717,
78718,
78719,
78720,
78721,
78723,
78724,
78725,
78727,
78728,
78729,
78730,
78732,
78733,
78734,
78735,
78736,
78738,
78739,
78740,
78741,
78742,
78743,
78744,
78746,
78748,
78749,
78750,
78752,
78753,
78755,
78756,
78757,
78758,
78759,
78760,
78761,
78762,
78763,
78764,
78766,
78767,
78768,
78769,
78770,
78772,
78774,
78776,
78777,
78778,
78780,
78781,
78783,
78786,
78787,
78788,
78789,
78792,
78793,
78794,
78795,
78796,
78797,
78798,
78799,
78800,
78801,
78802,
78803,
78806,
78807,
78809,
78810,
78811,
78812,
78813,
78815,
78817,
78818,
78819,
78820,
78823,
78824,
78828,
78829,
78832,
78833,
78834,
78836,
78837,
78838,
78840,
78841,
78842,
78844,
78845,
78846,
78847,
78848,
78849,
78851,
78852,
78856,
78857,
78858,
78859,
78860,
78861,
78862,
78863,
78864,
78866,
78868,
78870,
78872,
78873,
78874,
78875,
78877,
78878,
78879,
78880,
78881,
78882,
78883,
78884,
78886,
78887,
78888,
78889,
78890,
78892,
78893,
78894,
78895,
78897,
78900,
78901,
78904,
78905,
78906,
78907,
78908,
78909,
78910,
78912,
78913,
78914,
78918,
78920,
78922,
78924,
78926,
78927,
78928,
78930,
78931,
78932,
78933,
78935,
78936,
78937,
78939,
78941,
78942,
78943,
78944,
78945,
78946,
78947,
78948,
78952,
78953,
78954,
78955,
78956,
78958,
78959,
78961,
78962,
78963,
78964,
78965,
78966,
78968,
78971,
78972,
78973,
78974,
78975,
78976,
78977,
78978,
78979,
78981,
78982,
78983,
78985,
78987,
78988,
78989,
78990,
78991,
78992,
78994,
78995,
78996,
78997,
78999,
79001,
79005,
79007,
79009,
79010,
79011,
79013,
79014,
79015,
79016,
79017,
79018,
79019,
79021,
79022,
79023,
79024,
79025,
79026,
79027,
79028,
79030,
79031,
79033,
79034,
79035,
79036,
79037,
79038,
79040,
79041,
79042,
79043,
79044,
79045,
79046,
79047,
79048,
79049,
79050,
79051,
79054,
79055,
79057,
79059,
79060,
79061,
79063,
79064,
79065,
79067,
79069,
79070,
79071,
79075,
79077,
79078,
79080,
79081,
79082,
79083,
79084,
79085,
79086,
79089,
79090,
79091,
79092,
79093,
79094,
79096,
79097,
79100,
79102,
79103,
79104,
79105,
79106,
79107,
79110,
79112,
79113,
79114,
79115,
79116,
79117,
79119,
79120,
79121,
79122,
79123,
79125,
79126,
79127,
79128,
79130,
79131,
79133,
79134,
79135,
79137,
79138,
79139,
79140,
79142,
79145,
79146,
79147,
79148,
79152,
79153,
79154,
79155,
79156,
79157,
79158,
79159,
79160,
79161,
79162,
79163,
79164,
79165,
79170,
79171,
79172,
79173,
79175,
79177,
79178,
79179,
79180,
79181,
79182,
79183,
79184,
79185,
79186,
79187,
79188,
79189,
79191,
79192,
79193,
79196,
79197,
79198,
79201,
79202,
79203,
79204,
79207,
79208,
79210,
79212,
79213,
79214,
79215,
79216,
79217,
79218,
79219,
79220,
79221,
79222,
79223,
79224,
79225,
79227,
79228,
79229,
79231,
79232,
79233,
79234,
79235,
79237,
79238,
79239,
79240,
79241,
79244,
79245,
79246,
79247,
79248,
79249,
79250,
79251,
79252,
79253,
79255,
79256,
79258,
79259,
79260,
79262,
79263,
79264,
79265,
79266,
79267,
79268,
79269,
79270,
79271,
79272,
79275,
79276,
79277,
79278,
79279,
79281,
79283,
79284,
79285,
79286,
79287,
79288,
79289,
79290,
79291,
79292,
79293,
79294,
79295,
79296,
79299,
79300,
79301,
79304,
79305,
79306,
79307,
79308,
79310,
79311,
79312,
79313,
79314,
79315,
79316,
79318,
79319,
79322,
79324,
79325,
79327,
79328,
79329,
79330,
79331,
79332,
79334,
79336,
79338,
79339,
79340,
79342,
79344,
79346,
79347,
79348,
79353,
79354,
79356,
79357,
79358,
79359,
79360,
79361,
79362,
79365,
79366,
79369,
79370,
79371,
79372,
79373,
79374,
79375,
79376,
79377,
79383,
79384,
79385,
79387,
79388,
79389,
79390,
79391,
79394,
79395,
79397,
79398,
79399,
79400,
79401,
79402,
79403,
79404,
79406,
79407,
79408,
79409,
79410,
79412,
79413,
79416,
79417,
79418,
79419,
79420,
79421,
79422,
79423,
79425,
79426,
79427,
79428,
79429,
79430,
79431,
79432,
79433,
79436,
79438,
79439,
79440,
79442,
79444,
79445,
79447,
79449,
79450,
79451,
79452,
79454,
79455,
79457,
79459,
79460,
79461,
79462,
79463,
79464,
79465,
79466,
79467,
79468,
79469,
79471,
79472,
79473,
79474,
79477,
79478,
79479,
79480,
79481,
79482,
79483,
79484,
79485,
79491,
79492,
79493,
79494,
79496,
79497,
79498,
79499,
79500,
79502,
79505,
79506,
79508,
79509,
79510,
79513,
79514,
79515,
79517,
79518,
79519,
79520,
79521,
79522,
79523,
79524,
79525,
79526,
79527,
79528,
79529,
79532,
79533,
79534,
79535,
79536,
79537,
79538,
79539,
79540,
79541,
79542,
79543,
79544,
79547,
79548,
79549,
79550,
79551,
79552,
79553,
79555,
79556,
79557,
79558,
79561,
79562,
79563,
79564,
79566,
79567,
79569,
79570,
79572,
79573,
79574,
79577,
79578,
79580,
79582,
79583,
79585,
79586,
79588,
79591,
79592,
79594,
79595,
79596,
79598,
79599,
79600,
79601,
79602,
79605,
79606,
79608,
79609,
79610,
79611,
79613,
79615,
79616,
79617,
79618,
79619,
79620,
79621,
79622,
79623,
79624,
79626,
79628,
79629,
79631,
79632,
79633,
79634,
79636,
79637,
79638,
79639,
79640,
79641,
79642,
79644,
79645,
79649,
79650,
79651,
79655,
79656,
79657,
79660,
79661,
79662,
79663,
79664,
79665,
79666,
79668,
79669,
79670,
79672,
79673,
79674,
79675,
79676,
79677,
79678,
79680,
79681,
79683,
79685,
79686,
79687,
79688,
79689,
79692,
79693,
79694,
79695,
79697,
79698,
79699,
79700,
79701,
79702,
79704,
79705,
79706,
79707,
79708,
79709,
79710,
79711,
79712,
79713,
79716,
79717,
79718,
79719,
79720,
79722,
79723,
79724,
79725,
79726,
79727,
79728,
79729,
79732,
79733,
79734,
79735,
79736,
79739,
79740,
79741,
79742,
79743,
79747,
79749,
79750,
79751,
79752,
79753,
79757,
79759,
79760,
79761,
79762,
79763,
79764,
79765,
79766,
79767,
79768,
79769,
79770,
79772,
79774,
79775,
79777,
79778,
79779,
79780,
79781,
79782,
79783,
79784,
79785,
79786,
79787,
79788,
79789,
79790,
79791,
79793,
79795,
79796,
79797,
79798,
79799,
79800,
79801,
79803,
79804,
79805,
79807,
79808,
79810,
79811,
79812,
79813,
79814,
79815,
79816,
79817,
79818,
79819,
79820,
79821,
79822,
79824,
79825,
79826,
79827,
79828,
79829,
79831,
79833,
79835,
79836,
79838,
79839,
79840,
79842,
79843,
79844,
79845,
79846,
79847,
79849,
79851,
79855,
79856,
79857,
79861,
79863,
79864,
79865,
79866,
79867,
79868,
79869,
79870,
79871,
79872,
79873,
79874,
79875,
79876,
79877,
79878,
79879,
79880,
79882,
79883,
79884,
79885,
79888,
79889,
79891,
79892,
79893,
79894,
79895,
79896,
79897,
79898,
79900,
79901,
79903,
79904,
79905,
79907,
79908,
79909,
79910,
79911,
79912,
79913,
79914,
79918,
79919,
79920,
79922,
79923,
79924,
79926,
79928,
79929,
79930,
79931,
79932,
79934,
79935,
79936,
79937,
79938,
79939,
79941,
79943,
79944,
79946,
79947,
79949,
79950,
79951,
79952,
79953,
79955,
79957,
79958,
79960,
79962,
79963,
79965,
79966,
79967,
79968,
79969,
79971,
79972,
79973,
79974,
79975,
79976,
79980,
79981,
79982,
79983,
79984,
79985,
79986,
79987,
79988,
79989,
79990,
79991,
79994,
79995,
79997,
79998,
79999,
80000,
80002,
80003,
80004,
80005,
80006,
80007,
80008,
80009,
80010,
80011,
80013,
80015,
80016,
80017,
80019,
80020,
80021,
80022,
80024,
80026,
80028,
80029,
80030,
80031,
80033,
80034,
80036,
80037,
80039,
80042,
80043,
80044,
80045,
80046,
80047,
80048,
80050,
80051,
80052,
80054,
80055,
80056,
80057,
80058,
80060,
80061,
80062,
80063,
80064,
80065,
80066,
80067,
80070,
80072,
80073,
80074,
80075,
80077,
80078,
80080,
80081,
80082,
80083,
80085,
80086,
80087,
80090,
80092,
80093,
80095,
80096,
80098,
80099,
80100,
80103,
80106,
80108,
80109,
80110,
80111,
80114,
80115,
80116,
80118,
80119,
80120,
80121,
80122,
80123,
80124,
80125,
80126,
80127,
80128,
80129,
80130,
80131,
80133,
80134,
80135,
80137,
80138,
80139,
80140,
80141,
80142,
80144,
80145,
80146,
80147,
80148,
80149,
80150,
80151,
80152,
80153,
80154,
80155,
80156,
80157,
80158,
80159,
80160,
80162,
80163,
80164,
80165,
80166,
80167,
80168,
80169,
80170,
80173,
80174,
80175,
80176,
80178,
80179,
80180,
80181,
80182,
80183,
80184,
80186,
80187,
80189,
80190,
80191,
80192,
80193,
80194,
80195,
80197,
80199,
80200,
80203,
80205,
80206,
80208,
80210,
80211,
80212,
80213,
80214,
80215,
80216,
80218,
80219,
80220,
80221,
80222,
80223,
80225,
80226,
80227,
80228,
80229,
80230,
80231,
80232,
80233,
80234,
80235,
80237,
80238,
80239,
80242,
80243,
80244,
80246,
80248,
80249,
80252,
80253,
80255,
80258,
80259,
80260,
80263,
80264,
80266,
80267,
80268,
80270,
80272,
80273,
80274,
80275,
80276,
80280,
80282,
80283,
80284,
80285,
80286,
80290,
80291,
80292,
80294,
80295,
80296,
80297,
80299,
80300,
80301,
80303,
80305,
80306,
80308,
80309,
80311,
80312,
80313,
80314,
80315,
80317,
80318,
80319,
80320,
80321,
80323,
80324,
80325,
80326,
80329,
80330,
80332,
80333,
80335,
80337,
80338,
80339,
80340,
80341,
80342,
80343,
145878,
80344,
80346,
80347,
80348,
80349,
80350,
80351,
80353,
80354,
80355,
80356,
80358,
80362,
80363,
80364,
80365,
80366,
80367,
80368,
80369,
80370,
80372,
80373,
80374,
80375,
80376,
80377,
80380,
80381,
80382,
80383,
80384,
80388,
80389,
80390,
80393,
80394,
80395,
80397,
80398,
80399,
80401,
80404,
80407,
80408,
80409,
80410,
80412,
80413,
80414,
80415,
80417,
80418,
80420,
80421,
80422,
80423,
80425,
80426,
80427,
80429,
80430,
80431,
80432,
80433,
80434,
80437,
80438,
80439,
80440,
80441,
80444,
80445,
80446,
80449,
80450,
80451,
80452,
80453,
80455,
80456,
80457,
80458,
80460,
80462,
80464,
80465,
80466,
80467,
80471,
80472,
80474,
80477,
80478,
80479,
80480,
80481,
80483,
80484,
80485,
80487,
80488,
80490,
80491,
80492,
80493,
80495,
80497,
80498,
80499,
80500,
80501,
80502,
80503,
80504,
80505,
80506,
80507,
80508,
80509,
80510,
80511,
80512,
80516,
80519,
80520,
80521,
80522,
80523,
80524,
80525,
80526,
80527,
80528,
80529,
80530,
80531,
80532,
80533,
80535,
80536,
80537,
80539,
80540,
80541,
80543,
80545,
80548,
80549,
80550,
80551,
80552,
80554,
80555,
80556,
80557,
80558,
80559,
80560,
80561,
80563,
80564,
80565,
80566,
80568,
80570,
80571,
80572,
80573,
80574,
80575,
80576,
80577,
80579,
80581,
80582,
80583,
80584,
80585,
80586,
80588,
80589,
80590,
80591,
80592,
80593,
80594,
80597,
80598,
80599,
80600,
80602,
80603,
80605,
80606,
80607,
87746,
88094,
88115,
88256,
88631,
88664,
88710,
88766,
88776,
88778,
88856,
88857,
88858,
88859,
88860,
88862,
88864,
88867,
88868,
88869,
88870,
88871,
88873,
88874,
88875,
88876,
88877,
88878,
88880,
88881,
88882,
88883,
88884,
88886,
88887,
88888,
88889,
88890,
88891,
88892,
88893,
88894,
88895,
88897,
88898,
88901,
88902,
88904,
88905,
88906,
88907,
88908,
88909,
88911,
88912,
88913,
88914,
88915,
88917,
88918,
88919,
88921,
88922,
88923,
88924,
88925,
91280,
91314,
91316,
91317,
91351,
91362,
91645,
91647,
91648,
91650,
91651,
91654,
91656,
91658,
91659,
91660,
91663,
91665,
91669,
91671,
91673,
91674,
91675,
91679,
91680,
91681,
91682,
91683,
91684,
91685,
91686,
91688,
91689,
91690,
91691,
91694,
91695,
91696,
91698,
91699,
91701,
91702,
91703,
91704,
91705,
91706,
91707,
91708,
91711,
91712,
91713,
91714,
91715,
91716,
91717,
91718,
91719,
91720,
91721,
91722,
91724,
91725,
91726,
91727,
91728,
91729,
91730,
91731,
91732,
91733,
91734,
91735,
91736,
91737,
91738,
91739,
91740,
91741,
91742,
91743,
91744,
91745,
91746,
91747,
91748,
91749,
91751,
91752,
91753,
91754,
91755,
91756,
91757,
91758,
91759,
91760,
91761,
91762,
91764,
91765,
91766,
91767,
91769,
91770,
91771,
91772,
91773,
91774,
91775,
91776,
91777,
91778,
91779,
91780,
91781,
91782,
91783,
91784,
91785,
91787,
91789,
91790,
91792,
91794,
91795,
91796,
91799,
91800,
91801,
91802,
91803,
91805,
91806,
91808,
91811,
91812,
91814,
91815,
91816,
91817,
91818,
91819,
91820,
91821,
91822,
91823,
91825,
91827,
91828,
91829,
91830,
91831,
91832,
91833,
91834,
91835,
91837,
91840,
91842,
91843,
91844,
91845,
91846,
91847,
91848,
91849,
91850,
91852,
91853,
91854,
91856,
91858,
91859,
91860,
91862,
91863,
91864,
91865,
91866,
91867,
91869,
91870,
91871,
91872,
91873,
91874,
91875,
91876,
91877,
91878,
91880,
91881,
91883,
91884,
91885,
91886,
91887,
91888,
91889,
91891,
91893,
91894,
91895,
91896,
91897,
91898,
91899,
91900,
91901,
91902,
91903,
91904,
91905,
91906,
91907,
91908,
91909,
91910,
91911,
91915,
91916,
91917,
91918,
91919,
91920,
91922,
91927,
91928,
91930,
91931,
91932,
91933,
91934,
91935,
91936,
91937,
91939,
91940,
91941,
91943,
91945,
91946,
91947,
91948,
91949,
91950,
91953,
91956,
91957,
91959,
91960,
91962,
91964,
91965,
91966,
91967,
91970,
91973,
91974,
91975,
91976,
91978,
91980,
91981,
91982,
91983,
91984,
91986,
91987,
91988,
91989,
91992,
91993,
91995,
91996,
91997,
91999,
92000,
92001,
92002,
92003,
92004,
92005,
92008,
92009,
92010,
92011,
92012,
92013,
92014,
92016,
92017,
92018,
92019,
92020,
92021,
92023,
92025,
92026,
92028,
92029,
92030,
92031,
92032,
92033,
92035,
92036,
92037,
92038,
92039,
92040,
92042,
92043,
92044,
92045,
92046,
92047,
92048,
92050,
92051,
92053,
92054,
92055,
92056,
92057,
92059,
92060,
92061,
92062,
92063,
92064,
92065,
92066,
92067,
92069,
92071,
92072,
92073,
92074,
92075,
92077,
92079,
92081,
92082,
92083,
92084,
92085,
92087,
92088,
92091,
92095,
92096,
92099,
92100,
92101,
92102,
92103,
92104,
92107,
92108,
92109,
92110,
92111,
92112,
92114,
92115,
92116,
92119,
92120,
92121,
92122,
92123,
92124,
92125,
92126,
92127,
92128,
92129,
92130,
92131,
92133,
92135,
92136,
92137,
92141,
92142,
92144,
92145,
92146,
92147,
92149,
92150,
92151,
92152,
92153,
92154,
92158,
92159,
92160,
92161,
92162,
92164,
92165,
92167,
92168,
92169,
92170,
92171,
92172,
92173,
92174,
92175,
92176,
92177,
92178,
92179,
92180,
92181,
92183,
92184,
92186,
92187,
92188,
92189,
92190,
92191,
92192,
92193,
92194,
92196,
92197,
92198,
92199,
92201,
92202,
92203,
92204,
92205,
92207,
92208,
92209,
92210,
92211,
92212,
92213,
92214,
92216,
92217,
92220,
92221,
92222,
92223,
92226,
92227,
92228,
92229,
92231,
92232,
92234,
92235,
92236,
92237,
92238,
92239,
92240,
92241,
92242,
92243,
92244,
92245,
92246,
92247,
92248,
92250,
92252,
92253,
92254,
92256,
92258,
92259,
92260,
92261,
92262,
92264,
92265,
92267,
92268,
92269,
92270,
92272,
92273,
92274,
92275,
92276,
92277,
92278,
92279,
92280,
92281,
92282,
92283,
92284,
92285,
92286,
92287,
92289,
92290,
92292,
92293,
92294,
92295,
92296,
92297,
92298,
92299,
92300,
92301,
92302,
92303,
92306,
92308,
92309,
92311,
92312,
92314,
92315,
92316,
92318,
92319,
92320,
92321,
92322,
92323,
92325,
92326,
92327,
92328,
92330,
92333,
92335,
92336,
92339,
92340,
92341,
92342,
92344,
92346,
92347,
92348,
92349,
92350,
92351,
92352,
92353,
92354,
92355,
92359,
92361,
92362,
92363,
92364,
92365,
92366,
92367,
92368,
92369,
92370,
92371,
92372,
92373,
92376,
92377,
92378,
92379,
92380,
92381,
92382,
92383,
92384,
92385,
92386,
92387,
92388,
92389,
92390,
92391,
92392,
92393,
92394,
92395,
92396,
92397,
92398,
92401,
92402,
92403,
92404,
92406,
92407,
92408,
92409,
92411,
92413,
92414,
92415,
92417,
92420,
92421,
92422,
92423,
92424,
92425,
92428,
92429,
92430,
92433,
92434,
92437,
92438,
92439,
92440,
92441,
92442,
92443,
92444,
92445,
92446,
92447,
92448,
92449,
92450,
92451,
92452,
92454,
92455,
92456,
92457,
92460,
92461,
92463,
92464,
92465,
92467,
92468,
92470,
92471,
92472,
92473,
92474,
92475,
92476,
92477,
92478,
92479,
92480,
92481,
92482,
92483,
92484,
92485,
92486,
92487,
92488,
92490,
92491,
92492,
92493,
92494,
92497,
92498,
92499,
92503,
92504,
92505,
92508,
92509,
92510,
92511,
92513,
92514,
92515,
92516,
92517,
92518,
92519,
92520,
92522,
92524,
92526,
92527,
92528,
92529,
92530,
92531,
92532,
92533,
92534,
92535,
92536,
92537,
92538,
92539,
92540,
92542,
92543,
92545,
92546,
92547,
92548,
92549,
92550,
92551,
92552,
92553,
92554,
92555,
92557,
92558,
92560,
92562,
92563,
92565,
92566,
92567,
92568,
92569,
92570,
92571,
92572,
92573,
92574,
92575,
92576,
92577,
92578,
92579,
92580,
92581,
92582,
92583,
92584,
92585,
92586,
92587,
92588,
92589,
92590,
92591,
92592,
92593,
92594,
92595,
92596,
92598,
92599,
92600,
92603,
92604,
92606,
92608,
92610,
92611,
92612,
92615,
92616,
92617,
92618,
92619,
92620,
92621,
92622,
92623,
92624,
92625,
92626,
92627,
92628,
92629,
92630,
92633,
92634,
92635,
92636,
92637,
92639,
92641,
92642,
92644,
92645,
92646,
92647,
92648,
92649,
92650,
92651,
92652,
92653,
92655,
92656,
92657,
92658,
92660,
92661,
92662,
92663,
92664,
92666,
92667,
92668,
92669,
92670,
92671,
92673,
92675,
92676,
92677,
92678,
92679,
92680,
92681,
92682,
92683,
92684,
92685,
92686,
92688,
92689,
92690,
92691,
92692,
92693,
92694,
92695,
92696,
92698,
92699,
92700,
92701,
92702,
92703,
92704,
92705,
92706,
92707,
92708,
92709,
92710,
92711,
92712,
92713,
92715,
92716,
92717,
92718,
92719,
92720,
92721,
92723,
92724,
92726,
92727,
92728,
92729,
92730,
92731,
92732,
92733,
92734,
92735,
92736,
92737,
92739,
92740,
92741,
92742,
92745,
92746,
92748,
92749,
92750,
92751,
92752,
92753,
92754,
92755,
92759,
92760,
92761,
92762,
92763,
92764,
92765,
92766,
92767,
92769,
92770,
92771,
92772,
92773,
92774,
92775,
92776,
92778,
92780,
92781,
92782,
92783,
92784,
92785,
92786,
92788,
92789,
92790,
92792,
92795,
92797,
92798,
92799,
92800,
92803,
92805,
92806,
92807,
92808,
92809,
92810,
92811,
92812,
92813,
92814,
92815,
92818,
92819,
92820,
92821,
92822,
92823,
92824,
92825,
92826,
92827,
92828,
92830,
92831,
92835,
92836,
92837,
92838,
92839,
92841,
92843,
92844,
92846,
92847,
92848,
92849,
92850,
92851,
92852,
92853,
92854,
92855,
92856,
92857,
92858,
92860,
92861,
92863,
92864,
92865,
92866,
92868,
92869,
92870,
92871,
92872,
92873,
92874,
92875,
92876,
92877,
92879,
92880,
92881,
92882,
92883,
92884,
92885,
92886,
92888,
92889,
92890,
92892,
92893,
92894,
92895,
92896,
92897,
92898,
92900,
92902,
92903,
92904,
92905,
92906,
92907,
92908,
92909,
92910,
92911,
92913,
92915,
92916,
92918,
92919,
92921,
92922,
92923,
92925,
92927,
92928,
92929,
92930,
92932,
92933,
92935,
92936,
92937,
92938,
92939,
92941,
92943,
92945,
92946,
92951,
92952,
92953,
92954,
92955,
92956,
92958,
92959,
92962,
92963,
92965,
92966,
92968,
92969,
92971,
92972,
92973,
92974,
92975,
92978,
92979,
92981,
92982,
92983,
92984,
92987,
92989,
92991,
92992,
92993,
92994,
92995,
92996,
92997,
92998,
93000,
93001,
93002,
93003,
93004,
93006,
93007,
93009,
93010,
93013,
93014,
93015,
93016,
93017,
93019,
93020,
93021,
93022,
93023,
93024,
93025,
93027,
93028,
93030,
93031,
93032,
93034,
93036,
93037,
93038,
93039,
93040,
93041,
93043,
93044,
93045,
93046,
93047,
93048,
93049,
93050,
93052,
93055,
93056,
93057,
93058,
93059,
93060,
93061,
93064,
93065,
93066,
93067,
93068,
93069,
93070,
93071,
93072,
93073,
93074,
93075,
93076,
93077,
93078,
93079,
93080,
93081,
93082,
93084,
93085,
93086,
93087,
93088,
93089,
93090,
93091,
93092,
93093,
93094,
93095,
93096,
93097,
93098,
93099,
93100,
93101,
93103,
93104,
93105,
93106,
93107,
93108,
93109,
93110,
93111,
93112,
93113,
93114,
93115,
93116,
93117,
93118,
93119,
93120,
93121,
93122,
93123,
93124,
93125,
93126,
93129,
93130,
93132,
93133,
93134,
93136,
93137,
93139,
93140,
93142,
93143,
93145,
93146,
93147,
93148,
93149,
93150,
93151,
93152,
93153,
93154,
93155,
93158,
93160,
93161,
93162,
93164,
93165,
93166,
93167,
93168,
93169,
93170,
93172,
93173,
93175,
93176,
93177,
93180,
93182,
93183,
93185,
93186,
93187,
93188,
93189,
93190,
93192,
93193,
93194,
93195,
93196,
93197,
93198,
93199,
93200,
93203,
93205,
93207,
93208,
93211,
93213,
93214,
93215,
93216,
93217,
93219,
93220,
93221,
93222,
93223,
93225,
93227,
93229,
93230,
93232,
93233,
93234,
93235,
93237,
93238,
93239,
93240,
93241,
93242,
93243,
93244,
93245,
93246,
93247,
93248,
93249,
93250,
93251,
93252,
93253,
93254,
93255,
93256,
93257,
93258,
93259,
93260,
93262,
93263,
93264,
93265,
93266,
93267,
93268,
93269,
93270,
93271,
93273,
93274,
93275,
93276,
93277,
93278,
93280,
93281,
93282,
93283,
93284,
93286,
93287,
93289,
93290,
93291,
93292,
93293,
93294,
93295,
93296,
93297,
93298,
93300,
93301,
93302,
93303,
93305,
93307,
93308,
93309,
93310,
93311,
93312,
93313,
93314,
93317,
93318,
93319,
93320,
93321,
93322,
93325,
93326,
93328,
93329,
93332,
93333,
93334,
93335,
93336,
93337,
93339,
93340,
93341,
93342,
93343,
93344,
93345,
93346,
93347,
93348,
93349,
93350,
93351,
93352,
93353,
93354,
93355,
93356,
93357,
93358,
93359,
93360,
93361,
93362,
93363,
93364,
93365,
93366,
93368,
93371,
93373,
93376,
93378,
93381,
93382,
93385,
93387,
93388,
93389,
93391,
93392,
93393,
93394,
93395,
93399,
93400,
93401,
93402,
93403,
93404,
93407,
93409,
93411,
93412,
93413,
93415,
93417,
93419,
93420,
93421,
93422,
93423,
93424,
93427,
93428,
93429,
93430,
93432,
93433,
93434,
93435,
93436,
93437,
93438,
93439,
93440,
93441,
93442,
93444,
93445,
93446,
93448,
93449,
93450,
93451,
93452,
93453,
93454,
93455,
93456,
93459,
93460,
93462,
93463,
93464,
93465,
93466,
93468,
93469,
93470,
93472,
93473,
93474,
93475,
93476,
93478,
93479,
93480,
93481,
93482,
93483,
93484,
93485,
93486,
93487,
93488,
93489,
93490,
93491,
93492,
93493,
93494,
93495,
93497,
93498,
93499,
93500,
93502,
93503,
93504,
93505,
93506,
93508,
93509,
93510,
93511,
93512,
93513,
93514,
93515,
93516,
93518,
93519,
93520,
93521,
93522,
93524,
93525,
93526,
93527,
93528,
93529,
93530,
93531,
93533,
93534,
93536,
93537,
93538,
93539,
93541,
93542,
93544,
93545,
93546,
93547,
93548,
93549,
93550,
93551,
93552,
93553,
93554,
93555,
93556,
93557,
93558,
93559,
93560,
93563,
93564,
93565,
93566,
93567,
93569,
93570,
93571,
93572,
93573,
93574,
93575,
93576,
93577,
93578,
93579,
93580,
93581,
93582,
93583,
93585,
93587,
93588,
93589,
93590,
93591,
93592,
93595,
93596,
93599,
93600,
93602,
93604,
93605,
93606,
93607,
93608,
93609,
93610,
93612,
93613,
93614,
93615,
93618,
93619,
93622,
93623,
93624,
93626,
93627,
93628,
93630,
93632,
93633,
93635,
93636,
93640,
93641,
93642,
93643,
93645,
93646,
93647,
93648,
93649,
93651,
93652,
93654,
93655,
93656,
93657,
93658,
93660,
93661,
93664,
93665,
93666,
93667,
93668,
93670,
93671,
93672,
93673,
93674,
93675,
93678,
93679,
93681,
93682,
93683,
93684,
93685,
93686,
93688,
93689,
93690,
93691,
93692,
93693,
93694,
93696,
93697,
93698,
93699,
93700,
93702,
93705,
93707,
93708,
93709,
93714,
93715,
93716,
93717,
93718,
93719,
93720,
93721,
93723,
93724,
93725,
93727,
93728,
93729,
93730,
93731,
93732,
93733,
93735,
93736,
93737,
93739,
93741,
93742,
93743,
93744,
93745,
93746,
93747,
93748,
93750,
93751,
93756,
93757,
93758,
93759,
93760,
93762,
93765,
93766,
93767,
93768,
93770,
93771,
93772,
93773,
93774,
93775,
93777,
93778,
93779,
93781,
93782,
93783,
93785,
93786,
93787,
93788,
93789,
93791,
93792,
93793,
93794,
93796,
93797,
93799,
93800,
93801,
93802,
93806,
93808,
93809,
93810,
93811,
93813,
93814,
93815,
93816,
93818,
93820,
93821,
93822,
93823,
93824,
93825,
93826,
93827,
93828,
93829,
93830,
93831,
93832,
93833,
93834,
93835,
93836,
93838,
93839,
93841,
93844,
93846,
93847,
93848,
93849,
93850,
93851,
93852,
93854,
93855,
93856,
93859,
93860,
93861,
93865,
93866,
93867,
93868,
93869,
93870,
93871,
93872,
93873,
93875,
93876,
93877,
93878,
93879,
93880,
93881,
93882,
93883,
93884,
93885,
93887,
93890,
93891,
93892,
93894,
93896,
93897,
93899,
93900,
93902,
93903,
93904,
93905,
93906,
93907,
93908,
93909,
93911,
93912,
93913,
93914,
93915,
93916,
93917,
93919,
93920,
93921,
93922,
93923,
93924,
93925,
93926,
93928,
93929,
93930,
93931,
93932,
93933,
93934,
93935,
93936,
93937,
93938,
93940,
93941,
93942,
93943,
93945,
93946,
93947,
93948,
93951,
93952,
93953,
93954,
93957,
93958,
93959,
93960,
93961,
93962,
93963,
93964,
93965,
93966,
93967,
93968,
93970,
93971,
93972,
93973,
93974,
93975,
93976,
93977,
93979,
93980,
93981,
93982,
93983,
93985,
93986,
93987,
93988,
93989,
93991,
93992,
93993,
93994,
93995,
93996,
93998,
94001,
94002,
94004,
94005,
94006,
94007,
94008,
94010,
94011,
94013,
94014,
94015,
94016,
94018,
94019,
94020,
94021,
94022,
94024,
94025,
94026,
94027,
94028,
94029,
94030,
94031,
94033,
94034,
94035,
94036,
94037,
94038,
94039,
94040,
94042,
94044,
94045,
94046,
94047,
94048,
94049,
94050,
94051,
94052,
94053,
94054,
94055,
94056,
94059,
94060,
94061,
94063,
94065,
94066,
94068,
94069,
94070,
94071,
94072,
94073,
94074,
94075,
94077,
94078,
94079,
94081,
94082,
94083,
94084,
94085,
94086,
94088,
94089,
94090,
94093,
94094,
94095,
94096,
94097,
94098,
94099,
94100,
94101,
94103,
94104,
94106,
94107,
94108,
94109,
94111,
94112,
94114,
94116,
94117,
94119,
94121,
94122,
94123,
94124,
94125,
94126,
94127,
94129,
94130,
94132,
94133,
94134,
94135,
94136,
94138,
94139,
94140,
94142,
94145,
94146,
94147,
94148,
94149,
94150,
94151,
94152,
94154,
94155,
94156,
94157,
94158,
94160,
94162,
94163,
94164,
94166,
94167,
94168,
94170,
94171,
94172,
94173,
94174,
94178,
94179,
94181,
94182,
94183,
94184,
94185,
94186,
94187,
94189,
94190,
94192,
94193,
94195,
94197,
94198,
94199,
94200,
94201,
94203,
94204,
94205,
94206,
94207,
94209,
94211,
94212,
94214,
94215,
94216,
94217,
94218,
94220,
94221,
94222,
94224,
94225,
94227,
94228,
94229,
94230,
94231,
94232,
94233,
94234,
94235,
94236,
94237,
94238,
94239,
94240,
94241,
94242,
94244,
94246,
94247,
94249,
94250,
94251,
94252,
94253,
94254,
94255,
94256,
94257,
94258,
94259,
94260,
94262,
94263,
94264,
94265,
94266,
94267,
94269,
94271,
94272,
94273,
94274,
94275,
94276,
94277,
94278,
94279,
94280,
94281,
94282,
94283,
94284,
94285,
94286,
94288,
94289,
94290,
94291,
94292,
94295,
94296,
94298,
94299,
94300,
94301,
94302,
94303,
94304,
94306,
94308,
94309,
94310,
94311,
94312,
94313,
94314,
94315,
94316,
94317,
94318,
94319,
94320,
94322,
94323,
94324,
94325,
94326,
94327,
94328,
94330,
94331,
94332,
94334,
94335,
94336,
94337,
94338,
94339,
94340,
94343,
94344,
94346,
94347,
94349,
94350,
94352,
94353,
94354,
94355,
94356,
94357,
94358,
94359,
94360,
94362,
94363,
94364,
94366,
94367,
94368,
94369,
94372,
94373,
94374,
94375,
94377,
94378,
94379,
94380,
94382,
94383,
94384,
94385,
94386,
94387,
94389,
94390,
94391,
94392,
94393,
94394,
94395,
94396,
94397,
94399,
94400,
94401,
94404,
94405,
94406,
94408,
94409,
94410,
94411,
94412,
94413,
94414,
94415,
94416,
94417,
94419,
94420,
94421,
94422,
94423,
94424,
94425,
94426,
94427,
94428,
94429,
94430,
94431,
94432,
94433,
94434,
94435,
94437,
94438,
94439,
94441,
94442,
94443,
94444,
94445,
94448,
94450,
94451,
94452,
94453,
94454,
94455,
94457,
94458,
94459,
94460,
94461,
94462,
94464,
94465,
94466,
94467,
94468,
94471,
94472,
94473,
94474,
94475,
94476,
94478,
94479,
94480,
94481,
94482,
94483,
94484,
94485,
94486,
94487,
94488,
94490,
94491,
94493,
94496,
94497,
94498,
94499,
94500,
94501,
94502,
94503,
94504,
94505,
94506,
94507,
94508,
94509,
94510,
94511,
94512,
94513,
94514,
94515,
94516,
94517,
94518,
94519,
94520,
94521,
94524,
94526,
94529,
94530,
94531,
94532,
94533,
94534,
94535,
94536,
94537,
94539,
94540,
94541,
94543,
94544,
94546,
94547,
94548,
94549,
94551,
94552,
94553,
94554,
94555,
94556,
94558,
94559,
94560,
94561,
94562,
94563,
94565,
94566,
94567,
94568,
94569,
94570,
94571,
94572,
94573,
94574,
94575,
94576,
94578,
94580,
94581,
94582,
94583,
94584,
94585,
94586,
94588,
94589,
94591,
94592,
94593,
94594,
94595,
94596,
94597,
94598,
94599,
94600,
94601,
94602,
94603,
94604,
94605,
94606,
94607,
94608,
94609,
94610,
94611,
94612,
94613,
94614,
94615,
94616,
94617,
94618,
94620,
94622,
94623,
94624,
94625,
94626,
94628,
94629,
94630,
94631,
94632,
94633,
94634,
94635,
94636,
94637,
94638,
94639,
94640,
94641,
94642,
94644,
94645,
94646,
94647,
94649,
94650,
94651,
94653,
94655,
94656,
94657,
94658,
94659,
94660,
94661,
94662,
94663,
94664,
94665,
94666,
94669,
94670,
94671,
94672,
94673,
94674,
94675,
94676,
94680,
94682,
94683,
94684,
94685,
94686,
94687,
94688,
94691,
94692,
94693,
94694,
94695,
94696,
94697,
94698,
94699,
94700,
94701,
94702,
94703,
94704,
94705,
94708,
94709,
94711,
94712,
94714,
94715,
94716,
94719,
94720,
94721,
94722,
94723,
94724,
94725,
94726,
94727,
94729,
94730,
94731,
94733,
94734,
94736,
94737,
94738,
94739,
94740,
94741,
94742,
94743,
94744,
94745,
94747,
94748,
94749,
94750,
94751,
94754,
94756,
94757,
94758,
94759,
94760,
94761,
94762,
94763,
94764,
94766,
94767,
94768,
94769,
94770,
94771,
94772,
94774,
94775,
94776,
94777,
94778,
94779,
94780,
94781,
94782,
94783,
94785,
94787,
94788,
94789,
94792,
94793,
94795,
94796,
94797,
94798,
94800,
94802,
94803,
94805,
94806,
94807,
94808,
94809,
94810,
94811,
94812,
94813,
94814,
94815,
94816,
94818,
94819,
94820,
94821,
94822,
94824,
94825,
94826,
94828,
94829,
94830,
94831,
94832,
94833,
94834,
94835,
94836,
94837,
94838,
94839,
94840,
94841,
94842,
94843,
94844,
94845,
94846,
94848,
94851,
94852,
94853,
94854,
94855,
94856,
94857,
94858,
94859,
94860,
94861,
94862,
94863,
94864,
94865,
94866,
94867,
94868,
94870,
94872,
94873,
94875,
94876,
94877,
94878,
94879,
94880,
94883,
94884,
94886,
94887,
94890,
94892,
94894,
94898,
94900,
94901,
94902,
94903,
94904,
94905,
94906,
94907,
94908,
94909,
94910,
94911,
94912,
94913,
94914,
94915,
94916,
94917,
94918,
94919,
94920,
94921,
94923,
94925,
94926,
94927,
94928,
94929,
94930,
94933,
94935,
94936,
94937,
94938,
94939,
94941,
94942,
94943,
94944,
94945,
94946,
94947,
94948,
94949,
94950,
94951,
94952,
94953,
94954,
94955,
94956,
94957,
94960,
94961,
94962,
94964,
94966,
94967,
94968,
94969,
94970,
94971,
94974,
94975,
94976,
94978,
94979,
94980,
94984,
94986,
94989,
94990,
94991,
94992,
94993,
94994,
94995,
94997,
94998,
94999,
95000,
95001,
95002,
95005,
95006,
95007,
95009,
95010,
95011,
95012,
95013,
95015,
95016,
95017,
95018,
95019,
95020,
95021,
95022,
95023,
95024,
95025,
95026,
95028,
95030,
95031,
95032,
95033,
95034,
95035,
95036,
95039,
95040,
95042,
95044,
95045,
95046,
95047,
95048,
95050,
95052,
95055,
95056,
95058,
95059,
95060,
95061,
95062,
95064,
95065,
95067,
95069,
95070,
95071,
95072,
95073,
95074,
95075,
95076,
95077,
95079,
95080,
95081,
95082,
95083,
95084,
95085,
95086,
95087,
95088,
95089,
95090,
95091,
95092,
95093,
95095,
95096,
95097,
95099,
95100,
95101,
95102,
95103,
95104,
95105,
95106,
95107,
95108,
95110,
95111,
95112,
95113,
95114,
95115,
95116,
95118,
95120,
95121,
95123,
95124,
95126,
95127,
95128,
95129,
95130,
95131,
95132,
95133,
95134,
95135,
95136,
95137,
95138,
95139,
95141,
95142,
95143,
95145,
95146,
95147,
95149,
95151,
95152,
95153,
95154,
95155,
95156,
95157,
95158,
95159,
95160,
95161,
95162,
95163,
95164,
95165,
95166,
95167,
95168,
95170,
95171,
95172,
95173,
95174,
95175,
95176,
95177,
95178,
95179,
95181,
95182,
95183,
95184,
95185,
95187,
95188,
95189,
95191,
95192,
95193,
95195,
95196,
95197,
95198,
95199,
95200,
95201,
95203,
95204,
95205,
95206,
95207,
95208,
95209,
95210,
95211,
95212,
95214,
95215,
95219,
95220,
95221,
95222,
95223,
95224,
95225,
95226,
95227,
95229,
95231,
95232,
95233,
95235,
95236,
95237,
95238,
95240,
95241,
95242,
95244,
95245,
95246,
95248,
95249,
95250,
95251,
95252,
95254,
95256,
95257,
95258,
95260,
95261,
95262,
95264,
95265,
95266,
95267,
95268,
95269,
95270,
95271,
95272,
95273,
95274,
95278,
95280,
95281,
95282,
95284,
95285,
95286,
95287,
95289,
95290,
95291,
95292,
95294,
95295,
95296,
95297,
95299,
95300,
95301,
95302,
95303,
95304,
95306,
95308,
95309,
95310,
95311,
95312,
95313,
95314,
95315,
95317,
95318,
95319,
95320,
95321,
95323,
95326,
95327,
95328,
95329,
95330,
95331,
95332,
95333,
95334,
95335,
95336,
95337,
95338,
95340,
95341,
95342,
95343,
95344,
95345,
95347,
95348,
95349,
95350,
95352,
95353,
95354,
95356,
95357,
95358,
95360,
95361,
95362,
95363,
95364,
95365,
95366,
95367,
95368,
95369,
95370,
95371,
95372,
95374,
95375,
95376,
95377,
95378,
95379,
95380,
95381,
95383,
95384,
95385,
95386,
95387,
95388,
95389,
95390,
95391,
95392,
95393,
95394,
95395,
95396,
95397,
95398,
95399,
95400,
95401,
95402,
95405,
95406,
95408,
95409,
95410,
95411,
95412,
95414,
95415,
95417,
95418,
95419,
95420,
95421,
95424,
95425,
95426,
95427,
95428,
95430,
95431,
95432,
95433,
95434,
95435,
95436,
95438,
95440,
95441,
95442,
95443,
95444,
95445,
95446,
95447,
95449,
95450,
95451,
95452,
95453,
95454,
95455,
95456,
95459,
95461,
95462,
95463,
95464,
95465,
95466,
95467,
95468,
95469,
95470,
95471,
95473,
95474,
95475,
95476,
95477,
95478,
95479,
95481,
95482,
95483,
95485,
95486,
95487,
95488,
95490,
95491,
95492,
95493,
95494,
95495,
95496,
95499,
95500,
95501,
95502,
95503,
95504,
95505,
95506,
95507,
95508,
95509,
95510,
95511,
95512,
95513,
95514,
95516,
95517,
95518,
95519,
95520,
95523,
95524,
95525,
95526,
95527,
95528,
95529,
95530,
95531,
95532,
95533,
95535,
95536,
95537,
95539,
95540,
95543,
95544,
95547,
95548,
95549,
95550,
95552,
95553,
95554,
95555,
95556,
95558,
95559,
95560,
95561,
95562,
95563,
95564,
95565,
95566,
95567,
95569,
95570,
95571,
95572,
95573,
95575,
95576,
95577,
95578,
95579,
95581,
95582,
95583,
95584,
95585,
95586,
95587,
95588,
95589,
95590,
95592,
95593,
95594,
95595,
95597,
95598,
95599,
95600,
95601,
95602,
95603,
95604,
95605,
95608,
95609,
95610,
95611,
95612,
95614,
95616,
95617,
95618,
95619,
95620,
95621,
95622,
95623,
95624,
95625,
95626,
95627,
95628,
95629,
95630,
95631,
95632,
95635,
95636,
95637,
95638,
95639,
95641,
95642,
95643,
95644,
95645,
95646,
95647,
95649,
95651,
95653,
95654,
95656,
95657,
95658,
95659,
95660,
95662,
95663,
95664,
95666,
95667,
95669,
95671,
95672,
95673,
95674,
95676,
95678,
95679,
95681,
95682,
95683,
95684,
95685,
95686,
95689,
95690,
95693,
95694,
95695,
95696,
95697,
95698,
95699,
95700,
95701,
95704,
95706,
95707,
95709,
95710,
95711,
95712,
95713,
95714,
95715,
95716,
95717,
95718,
95719,
95720,
95721,
95722,
95723,
95724,
95725,
95726,
95727,
95728,
95729,
95732,
95733,
95734,
95735,
95736,
95737,
95738,
95739,
95741,
95742,
95743,
95744,
95745,
95746,
95747,
95749,
95750,
95752,
95753,
95754,
95755,
95757,
95758,
95760,
95761,
95762,
95763,
95764,
95765,
95767,
95768,
95770,
95772,
95773,
95774,
95775,
95776,
95777,
95778,
95779,
95780,
95781,
95782,
95784,
95785,
95786,
95789,
95790,
95791,
95792,
95793,
95794,
95795,
95796,
95797,
95800,
95801,
95803,
95804,
95805,
95806,
95808,
95809,
95810,
95811,
95813,
95816,
95817,
95819,
95820,
95823,
95824,
95825,
95826,
95827,
95828,
95829,
95830,
95831,
95832,
95833,
95834,
95835,
95836,
95837,
95838,
95839,
95842,
95843,
95844,
95845,
95846,
95847,
95848,
95849,
95850,
95851,
95852,
95853,
95854,
95857,
95858,
95859,
95860,
95861,
95862,
95864,
95865,
95866,
95867,
95869,
95870,
95871,
95872,
95874,
95875,
95877,
95878,
95879,
95880,
95881,
95882,
95884,
95885,
95887,
95888,
95889,
95891,
95893,
95896,
95897,
95899,
95900,
95902,
95903,
95905,
95906,
95907,
95909,
95910,
95911,
95912,
95913,
95914,
95915,
95916,
95917,
95919,
95920,
95921,
95922,
95923,
95924,
95925,
95926,
95927,
95928,
95929,
95931,
95932,
95934,
95935,
95936,
95938,
95939,
95940,
95941,
95942,
95944,
95945,
95946,
95947,
95948,
95949,
95950,
95951,
95954,
95955,
95956,
95957,
95959,
95960,
95961,
95962,
95963,
95964,
95965,
95966,
95968,
95969,
95970,
95971,
95972,
95973,
95974,
95975,
95976,
95977,
95978,
95979,
95980,
95981,
95982,
95983,
95984,
95985,
95986,
95987,
95988,
95989,
95990,
95991,
95992,
95993,
95995,
95996,
95997,
95998,
95999,
96001,
96002,
96003,
96004,
96005,
96006,
96007,
96008,
96009,
96012,
96013,
96014,
96015,
96017,
96018,
96019,
96020,
96021,
96022,
96023,
96024,
96027,
96028,
96029,
96030,
96031,
96033,
96034,
96035,
96036,
96037,
96038,
96042,
96044,
96045,
96046,
96047,
96048,
96049,
96051,
96052,
96053,
96054,
96055,
96056,
96057,
96058,
96059,
96060,
96061,
96062,
96064,
96066,
96067,
96069,
96070,
96071,
96072,
96073,
96074,
96075,
96076,
96077,
96078,
96079,
96080,
96081,
96082,
96084,
96085,
96086,
96088,
96089,
96090,
96092,
96093,
96094,
96096,
96097,
96099,
96100,
96101,
96103,
96104,
96105,
96106,
96107,
96108,
96109,
96110,
96111,
96112,
96113,
96114,
96115,
96116,
96117,
96118,
96119,
96121,
96122,
96124,
96125,
96126,
96128,
96129,
96131,
96132,
96133,
96135,
96137,
96141,
96142,
96143,
96144,
96145,
96147,
96149,
96150,
96151,
96152,
96153,
96154,
96155,
96156,
96157,
96158,
96159,
96160,
96161,
96162,
96163,
96165,
96166,
96167,
96168,
96169,
96170,
96171,
96173,
96174,
96175,
96176,
96177,
96178,
96179,
96180,
96181,
96183,
96184,
96185,
96187,
96188,
96189,
96190,
96191,
96192,
96193,
96194,
96195,
96197,
96198,
96199,
96200,
96201,
96202,
96203,
96205,
96206,
96207,
96208,
96209,
96210,
96212,
96213,
96214,
96215,
96216,
96218,
96220,
96221,
96223,
96224,
96225,
96226,
96227,
96228,
96229,
96231,
96233,
96234,
96235,
96236,
96238,
96239,
96241,
96242,
96243,
96244,
96246,
96247,
96248,
96249,
96250,
96251,
96253,
96254,
96255,
96256,
96257,
96258,
96259,
96260,
96261,
96262,
96263,
96264,
96266,
96267,
96268,
96269,
96270,
96271,
96273,
96274,
96275,
96276,
96277,
96278,
96279,
96280,
96281,
96282,
96284,
96285,
96286,
96287,
96288,
96289,
96290,
96292,
96294,
96296,
96297,
96298,
96300,
96301,
96303,
96305,
96306,
96308,
96309,
96310,
96311,
96312,
96314,
96315,
96317,
96318,
96319,
96321,
96322,
96323,
96324,
96325,
96326,
96327,
96330,
96332,
96333,
96334,
96335,
96337,
96338,
96340,
96341,
96342,
96343,
96344,
96345,
96346,
96348,
96349,
96351,
96352,
96353,
96354,
96355,
96357,
96358,
96359,
96362,
96365,
96367,
96368,
96369,
96370,
96371,
96372,
96373,
96374,
96376,
96377,
96378,
96379,
96380,
96381,
96382,
96383,
96384,
96385,
96386,
96387,
96389,
96391,
96393,
96394,
96395,
96396,
96397,
96398,
96399,
96400,
96401,
96402,
96403,
96405,
96406,
96407,
96408,
96409,
96410,
96411,
96412,
96413,
96414,
96415,
96416,
96417,
96418,
96419,
96420,
96421,
96422,
96423,
96424,
96425,
96427,
96428,
96429,
96430,
96432,
96433,
96434,
96435,
96436,
96437,
96438,
96440,
96441,
96443,
96444,
96445,
96446,
96447,
96448,
96449,
96450,
96451,
96452,
96454,
96456,
96457,
96458,
96459,
96461,
96462,
96463,
96464,
96465,
96466,
96467,
96468,
96469,
96470,
96471,
96472,
96473,
96474,
96475,
96476,
96477,
96478,
96479,
96480,
96481,
96483,
96484,
96485,
96488,
96489,
96490,
96491,
96492,
96494,
96495,
96498,
96499,
96501,
96504,
96505,
96506,
96508,
96510,
96511,
96512,
96513,
96514,
96516,
96517,
96518,
96519,
96520,
96522,
96524,
96525,
96526,
96527,
96528,
96529,
96532,
96533,
96534,
96535,
96536,
96537,
96538,
96539,
96540,
96542,
96543,
96544,
96546,
96548,
96549,
96551,
96552,
96554,
96555,
96556,
96557,
96558,
96559,
96560,
96561,
96562,
96563,
96564,
96565,
96566,
96567,
96570,
96571,
96573,
96574,
96576,
96578,
96579,
96580,
96581,
96582,
96583,
96584,
96585,
96586,
96587,
96588,
96590,
96591,
96592,
96593,
96594,
96596,
96597,
96601,
96602,
96603,
96604,
96605,
96606,
96607,
96608,
96609,
96611,
96612,
96613,
96614,
96615,
96618,
96619,
96620,
96621,
96622,
96623,
96625,
96626,
96627,
96628,
96629,
96631,
96632,
96633,
96635,
96636,
96637,
96639,
96640,
96641,
96642,
96644,
96645,
96646,
96648,
96649,
96650,
96651,
96653,
96654,
96656,
96657,
96658,
96660,
96661,
96662,
96664,
96665,
96666,
96667,
96668,
96669,
96672,
96673,
96674,
96675,
96676,
96679,
96680,
96681,
96682,
96684,
96685,
96686,
96687,
96688,
96690,
96691,
96692,
96693,
96695,
96699,
96700,
96701,
96702,
96703,
96704,
96705,
96707,
96710,
96711,
96712,
96713,
96714,
96715,
96716,
96717,
96718,
96720,
96721,
96722,
96723,
96724,
96725,
96726,
96728,
96729,
96730,
96731,
96732,
96733,
96734,
96735,
96736,
96737,
96738,
96739,
96740,
96741,
96742,
96743,
96744,
96746,
96747,
96748,
96749,
96750,
96751,
96752,
96753,
96754,
96755,
96756,
96757,
96758,
96759,
96760,
96761,
96762,
96763,
96764,
96765,
96766,
96768,
96769,
96770,
96772,
96774,
96777,
96778,
96779,
96780,
96781,
96783,
96784,
96785,
96786,
96787,
96788,
96789,
96791,
96792,
96793,
96794,
96795,
96796,
96797,
96798,
96799,
96800,
96801,
96802,
96803,
96804,
96805,
96806,
96807,
96808,
96809,
96810,
96811,
96812,
96813,
96815,
96816,
96817,
96818,
96819,
96820,
96821,
96824,
96825,
96826,
96828,
96830,
96831
] |
7cb865d8c2b13a599ec7e5f9e822e1a2ab785f05 | 2d4a75f40631edeec2f1b65c7dc07b6412cd16c5 | /ZendeskConnect/ZendeskConnect/NetworkClient/Models/PairDevice.swift | 155e12f97efc293f9c300bdd762f2afe82c39e0d | [
"Apache-2.0"
] | permissive | arshiacont/connect-ios-sdk | 1d159d3aa1f8a51f959e7be2fcedb93ecc2e5123 | 2f29402596d2d6c314a94b4f8517fbfb8e6c15b4 | refs/heads/master | 2020-06-26T18:46:12.671849 | 2019-02-13T16:39:56 | 2019-02-13T16:39:56 | 199,719,237 | 0 | 0 | Apache-2.0 | 2019-07-30T20:03:00 | 2019-07-30T20:02:59 | null | UTF-8 | Swift | false | false | 1,614 | swift | /*
* Copyright (c) 2018 Zendesk. All rights reserved.
*
* By downloading or using the Zendesk Mobile SDK, You agree to the Zendesk Master
* Subscription Agreement https://www.zendesk.com/company/customers-partners/master-subscription-agreement and Application Developer and API License
* Agreement https://www.zendesk.com/company/customers-partners/application-developer-api-license-agreement and
* acknowledge that such terms govern Your use of and access to the Mobile SDK.
*
*/
import Foundation
struct PairDevice: Codable {
var code: Int
var deviceToken: String
var deviceName: String
init(code: Int, deviceToken: String, deviceName: String) {
self.code = code
self.deviceToken = deviceToken
self.deviceName = deviceName
}
private enum CodingKeys: String, CodingKey {
case code
case deviceToken
case deviceName
}
// Encodable protocol methods
func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(code, forKey: .code)
try container.encode(deviceToken, forKey: .deviceToken)
try container.encode(deviceName, forKey: .deviceName)
}
// Decodable protocol methods
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
code = try container.decode(Int.self, forKey: .code)
deviceToken = try container.decode(String.self, forKey: .deviceToken)
deviceName = try container.decode(String.self, forKey: .deviceName)
}
}
| [
-1
] |
e3b50301a9191a6a2fd7b810762830c45f82ab12 | cffa896e4cd3afce77f74a6ae758e86a8788dafa | /iOSClub/ActivityViewController.swift | 228abe5a28f89449920190fc3039326025008614 | [] | no_license | FCU-iOSClub/official-iosclub-app | b1d7cf26930e16789f725801ac8dea236684baf9 | 28df18890f14d375bdec899eec7afa68fd0b62f3 | refs/heads/master | 2021-05-19T05:58:20.672738 | 2019-07-24T16:37:57 | 2019-07-24T16:37:57 | 251,556,915 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 8,508 | swift | //
// ActivityViewController.swift
// iOSClub
//
// Created by iMac02 on 2019/7/4.
// Copyright © 2019年 FCUiosclub. All rights reserved.
//
import UIKit
import Alamofire
class ActivityViewController: UIViewController,UITableViewDelegate,UITableViewDataSource{
var data:[ Int: [(TimelinePoint, UIColor, String, String, String, String?, String?, String?)]] = [0:[
(TimelinePoint(color: UIColor.orange, filled: true), UIColor.darkGray, "2019/09/15","社團博覽會", "歡迎新生來社團攤位", nil, nil, "maple"),
(TimelinePoint(), UIColor.black, "2019/10/15","新生茶會", "歡迎新生來社團攤", nil, nil, nil),
(TimelinePoint(color: UIColor.black, filled: true), UIColor.black, "2019/11/15","雙十烤肉", "歡迎新生來社團", "參考用", "Apple", nil),
(TimelinePoint(), UIColor.clear, "2019/12/15","聖誕節交換禮物及期末聚", "歡迎新生來社團", nil, nil, nil)
], 1:[
(TimelinePoint(), UIColor.lightGray, "2019/08/15","期末聚", "歡迎新生來社團", "60 mins", nil, nil),
(TimelinePoint(), UIColor.lightGray, "2019/07/15","歡迎新生來社團", "30 mins",nil, nil, nil),
(TimelinePoint(), UIColor.lightGray, "2019/06/15","社員大會", "歡迎新生來社團",nil, nil, "Sun"),
(TimelinePoint(), UIColor.lightGray, "2019/05/15","幹部宣布", "歡迎新生來社團", "60 mins", nil, "Sun"),
(TimelinePoint(), UIColor.lightGray, "2019/04/15","期末聚", "歡迎新生來社團", "30 mins", "Apple", "Sun"),
(TimelinePoint(), UIColor.lightGray, "2019/03/15","期中聚", "歡迎新生來社團", "120 mins", "Apple", "spring flower"),
(TimelinePoint(), UIColor.lightGray, "2019/02/15","workshop", "歡迎新生來社團", "150 mins", "Apple", "Sun"),
(TimelinePoint(), UIColor.lightGray, "2019/01/15","烤肉", "歡迎新生來社團", "60 mins", nil, "Sun"),
(TimelinePoint(), UIColor.lightGray, "2018/12/15","聖誕交換禮物", "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", nil, nil, "Moon"),
(TimelinePoint(), UIColor.lightGray, "2018/11/15","烤肉", "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", "30 mins", nil, "Moon"),
(TimelinePoint(), backColor: UIColor.clear, "2018/10/15","萬聖節", "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", nil, nil, "Moon")
]]
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
guard let sectionData = data[section] else {
return 0
}
return sectionData.count
}
func numberOfSections(in tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return data.count
}
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
if(section==0)
{
return "未來活動"
}
else
{
return "過往活動"
}
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "TimelineTableViewCell", for: indexPath) as! TimelineTableViewCell
// Configure the cell...
guard let sectionData = data[indexPath.section] else {
return cell
}
let (timelinePoint, timelineBackColor, title,date, description, lineInfo, thumbnail, illustration) = sectionData[indexPath.row]
var timelineFrontColor = UIColor.clear
if (indexPath.row > 0) {
timelineFrontColor = sectionData[indexPath.row - 1].1
}
//timelinePoint.diameter = 18
cell.timelinePoint = timelinePoint
cell.timeline.frontColor = timelineFrontColor
cell.timeline.backColor = timelineBackColor
cell.timeline.width = 2
cell.titleLabel.text = title
cell.dateLabel.text = date
cell.descriptionLabel.text = description
cell.lineInfoLabel.text = lineInfo
if let thumbnail = thumbnail {
cell.thumbnailImageView.image = UIImage(named: thumbnail)
}
else {
cell.thumbnailImageView.image = nil
}
if let illustration = illustration {
cell.illustrationImageView.image = UIImage(named: illustration)
}
else {
cell.illustrationImageView.image = nil
}
return cell
}
@IBOutlet weak var tableview: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
tableview.delegate = self
tableview.dataSource = self
let timelineTableViewCellNib=UINib(nibName: "TimelineTableViewCell", bundle: Bundle(for:TimelineTableViewCell.self))
tableview.register(timelineTableViewCellNib, forCellReuseIdentifier: "TimelineTableViewCell")
Alamofire.request("http://127.0.0.1:2914/api/v1/activities").responseJSON(completionHandler: {(res) in
if let result = res.result.value{
if let activities = result as? [[String:AnyObject]]{
self.data[0] = []
self.data[1] = []
let dateFormatter = DateFormatter.init()
dateFormatter.dateFormat = "yyyy-MM-dd"
for i in activities{
let dateStr = i["date"] as! String
let date = dateFormatter.date(from: dateStr)
let color = i["color"] as! [CGFloat]
let type = i["type"] as! Int
let title = i["title"] as! String
let summary = i["summary"] as! String
let lineInfo = i["lineInfo"] as! String
let isEmp = i["isEmphasized"] as! Int
if date!.timeIntervalSinceReferenceDate - Date().timeIntervalSinceReferenceDate > 0 {
self.data[0]?.append((TimelinePoint(color: UIColor(red: color[0]/255, green: color[1]/255, blue: color[2]/255, alpha: 1), filled: false), UIColor(red: color[0]/255, green: color[1]/255, blue: color[2]/255, alpha: 1), dateStr, title, summary, lineInfo == "null" ? nil : lineInfo, nil, isEmp == 0 ? nil : "Moon"))
}else{
self.data[1]?.append((TimelinePoint(color: UIColor(red: color[0]/255, green: color[1]/255, blue: color[2]/255, alpha: 1), filled: true), UIColor(red: color[0]/255, green: color[1]/255, blue: color[2]/255, alpha: 1), dateStr, title, summary, lineInfo == "null" ? nil : lineInfo, nil, isEmp == 0 ? nil : "Moon"))
}
}
self.data[0]?.reverse()
self.tableview.reloadData()
}
}
})
// Do any additional setup after loading the view.
}
override func viewWillAppear(_ animated: Bool) {
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: 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
] |
be13c3b943933e15d074c01117041ca86e539fb8 | 4e8c44ec324c164d86d9bb6690a6d394a88147e5 | /App/Royals/Sources/Scenes/Map/View/Controller/SpotEvaluationViewController.swift | 96f51d8d8e59ef9ace89bd1c69db8f834842551a | [] | no_license | vcoutasso/Royals | 4e7a0df0dde173dd41caf61aa71bace45b3acf92 | 79ea559cbdb8ce459efc18bbef927e6fab165254 | refs/heads/develop | 2023-08-10T16:55:36.619841 | 2021-09-23T21:22:29 | 2021-09-23T21:22:29 | 399,824,936 | 1 | 1 | null | 2021-09-23T17:01:35 | 2021-08-25T13:15:00 | Swift | UTF-8 | Swift | false | false | 3,574 | swift | //
// SpotEvaluationViewController.swift
// Royals
//
// Created by Maria Luiza Amaral on 18/09/21.
//
import UIKit
class SpotEvaluationViewController: UIViewController {
private lazy var profile: SpotEvaluationView =
.init(profileImage: UIImageView(image: Assets.Images.profileImage.image),
profileName: "Malu", nomeSpot: "Pico Sei lá Meu")
private lazy var commentProfile1: CardComments =
.init(profileImage: UIImageView(image: Assets.Images.profileImage2.image),
profileName: "Puppy", nomeSpot: "Pico Sei lá Meu",
ratingStars: 4,
commentText: "Pico maneiro, true demais.", data: "Há 3 dias")
private lazy var commentProfile2: CardComments =
.init(profileImage: UIImageView(image: Assets.Images.profileImage3.image),
profileName: "Erick", nomeSpot: "Pico Sei lá Meu",
ratingStars: 4,
commentText: "Pico maneiro, deu até pra tirar um ronco.", data: "Há 5 dias")
private var scrollView = UIScrollView()
let contentView = UIView()
override func viewDidLoad() {
super.viewDidLoad()
scrollView.frame = view.bounds
setupHierarchy()
setupConstraints()
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
}
// MARK: - Private methods
private func setupHierarchy() {
view.addSubview(scrollView)
contentView.addSubview(profile)
contentView.addSubview(commentProfile1)
contentView.addSubview(commentProfile2)
scrollView.addSubview(contentView)
scrollView.contentSize = contentView.bounds.size
// scrollView.contentSize = contentView.bounds.size
}
private func setupConstraints() {
profile.snp.makeConstraints { make in
make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
make.leading.trailing.equalToSuperview()
make.height.equalTo(LayoutMetrics.heightProfile)
}
commentProfile1.snp.makeConstraints { make in
make.top.equalTo(profile.snp.bottom).offset(LayoutMetrics.commentProfileTopAtProfile)
make.leading.equalToSuperview().offset(LayoutMetrics.leadingGereral)
make.trailing.equalToSuperview().offset(LayoutMetrics.trailingGereral)
}
commentProfile2.snp.makeConstraints { make in
make.top.equalTo(commentProfile1.snp.bottom).offset(LayoutMetrics.commentProfileTop)
make.leading.equalToSuperview().offset(LayoutMetrics.leadingGereral)
make.trailing.equalToSuperview().offset(LayoutMetrics.trailingGereral)
}
contentView.snp.makeConstraints { make in
make.leading.equalToSuperview()
make.trailing.equalToSuperview()
make.top.equalToSuperview()
make.bottom.equalTo(commentProfile2.snp.bottom)
}
scrollView.snp.makeConstraints { make in
make.leading.equalToSuperview()
make.trailing.equalToSuperview()
make.top.equalToSuperview()
make.bottom.equalToSuperview()
}
view.backgroundColor = Assets.Colors.darkSystemGray6.color
}
private enum LayoutMetrics {
static let heightProfile: CGFloat = 430
static let commentProfileTopAtProfile: CGFloat = 32
static let topTable: CGFloat = 510
static let leadingGereral: CGFloat = 15
static let trailingGereral: CGFloat = -15
static let commentProfileTop: CGFloat = 16
}
}
| [
-1
] |
1bfd94e4939f495286cfba1ba917119ce6c802c4 | 4992fe24e104785a79b0cdf8662ffa5d2a44ea46 | /TSWeChat/General/TSFullyHorizontalFlowLayout.swift | a04c223841fd3d4957a5612f94ac7d1491f688c4 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | gewill/TSWeChat | b84a244da86aa8263e59f9081643b4c11db822bf | b322526eeee2b00754019e90e48a33108d64d9b4 | refs/heads/master | 2021-02-04T18:10:49.338227 | 2020-02-28T06:57:34 | 2020-02-28T06:57:34 | 243,695,795 | 0 | 0 | MIT | 2020-02-28T06:39:18 | 2020-02-28T06:39:17 | null | UTF-8 | Swift | false | false | 3,292 | swift | //
// TSFullyHorizontalFlowLayout.swift
// TSWeChat
//
// Created by Hilen on 3/9/16.
// Copyright © 2016 Hilen. All rights reserved.
//
/*
This class is inspired by: https://github.com/philippeauriach/fullyhorizontalcollectionview
Rewrite in Swift
*/
import UIKit
class TSFullyHorizontalFlowLayout: UICollectionViewFlowLayout {
internal var nbColumns: Int = -1
internal var nbLines: Int = -1
override init() {
super.init()
self.scrollDirection = .horizontal
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes {
guard let collectionView = self.collectionView else {
return UICollectionViewLayoutAttributes()
}
let nbColumns: Int = self.nbColumns != -1 ? self.nbColumns : Int(self.collectionView!.frame.size.width / self.itemSize.width)
let nbLines: Int = self.nbLines != -1 ? self.nbLines : Int(collectionView.frame.size.height / self.itemSize.height)
let idxPage: Int = Int(indexPath.row) / (nbColumns * nbLines)
let O: Int = indexPath.row - (idxPage * nbColumns * nbLines)
let xD: Int = Int(O / nbColumns)
let yD: Int = O % nbColumns
let D: Int = xD + yD * nbLines + idxPage * nbColumns * nbLines
let fakeIndexPath: IndexPath = IndexPath(item: D, section: indexPath.section)
let attributes: UICollectionViewLayoutAttributes = super.layoutAttributesForItem(at: fakeIndexPath)!
return attributes
}
override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
let newX: CGFloat = min(0, rect.origin.x - rect.size.width / 2)
let newWidth: CGFloat = rect.size.width * 2 + (rect.origin.x - newX)
let newRect: CGRect = CGRect(x: newX, y: rect.origin.y, width: newWidth, height: rect.size.height)
let attributes = super.layoutAttributesForElements(in: newRect)!
var attributesCopy = [UICollectionViewLayoutAttributes]()
for itemAttributes in attributes {
let itemAttributesCopy = itemAttributes.copy() as! UICollectionViewLayoutAttributes
attributesCopy.append(itemAttributesCopy)
}
return attributesCopy.map { attr in
let newAttr: UICollectionViewLayoutAttributes = self.layoutAttributesForItem(at: attr.indexPath)
attr.frame = newAttr.frame
attr.center = newAttr.center
attr.bounds = newAttr.bounds
attr.isHidden = newAttr.isHidden
attr.size = newAttr.size
return attr
}
}
override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {
return true
}
override var collectionViewContentSize : CGSize {
let size: CGSize = super.collectionViewContentSize
let collectionViewWidth: CGFloat = self.collectionView!.frame.size.width
let nbOfScreens: Int = Int(ceil((size.width / collectionViewWidth)))
let newSize: CGSize = CGSize(width: collectionViewWidth * CGFloat(nbOfScreens), height: size.height)
return newSize
}
}
| [
61332
] |
c22e245ece44652e87383dfe1d02e8330b4a7bb8 | db7bbe1aba9472cff751d35b33aaddc652764fd7 | /RickAndMorty/UI/Cells/CharacterTableViewCell.swift | 46101f514782812a3b8b8b6185a3db07f103a655 | [] | no_license | matijakregar/RickAndMorty | f41c5a3ada5118a399dc059879bcff892913985c | 7ed44312578c940a86e07b9280509dbd944db437 | refs/heads/master | 2020-05-25T22:49:50.706750 | 2019-05-23T10:45:56 | 2019-05-23T10:45:56 | 188,022,474 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,062 | swift | //
// CharacterTableViewCell.swift
// RickAndMorty
//
// Created by Matija Kregar on 22/05/2019.
// Copyright © 2019 Matija Kregar. All rights reserved.
//
import UIKit
class CharacterTableViewCell: UITableViewCell, NibBackedTableViewCell {
@IBOutlet private var containerView: UIView!
@IBOutlet private var characterImageView: UIImageView!
@IBOutlet private var nameLabel: UILabel!
@IBOutlet private var speciesLabel: UILabel!
@IBOutlet private var loadingIndicator: UIActivityIndicatorView!
private var imageDataTask: URLSessionDataTask? {
didSet {
oldValue?.cancel()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
containerView.layer.cornerRadius = Theme.View.cornerRadius
}
override func prepareForReuse() {
super.prepareForReuse()
// Cancel the previous image from getting loaded and presenting any unwanted results.
imageDataTask?.suspend()
nameLabel.text = ""
speciesLabel.text = ""
setHighlighted(false, animated: false)
}
override func setHighlighted(_ highlighted: Bool, animated: Bool) {
let color = highlighted ? Theme.Colors.highlightedContainer : Theme.Colors.container
if animated {
UIView.animate(withDuration: .shortAnimation) {
self.containerView.backgroundColor = color
}
}
else {
containerView.backgroundColor = color
}
}
override func setSelected(_ selected: Bool, animated: Bool) {
setHighlighted(selected, animated: animated)
}
func configure(with character: CharacterListDisplayable?) {
if let character = character {
nameLabel.text = character.name
speciesLabel.text = character.species
if imageDataTask?.state == .suspended,
imageDataTask?.currentRequest?.url == character.imageURL {
imageDataTask?.resume()
}
else {
characterImageView.image = nil
imageDataTask = characterImageView.loadImage(from: character.imageURL)
}
containerView.fadeIn()
loadingIndicator.stopAnimating()
}
else {
containerView.alpha = 0
loadingIndicator.startAnimating()
}
}
}
| [
-1
] |
7cf6024db031180e524fb37300ab6234a689b14e | 4c6420c6471b47309d769697852c9db8b1a6314e | /UIImagePickerControllerSample/UIImagePickerControllerSample/ViewController.swift | 4efe97b3c5ca347ff1cb0d7dd6476401adb330d5 | [
"MIT"
] | permissive | MasaoAsano/iOS_Samples | 5d012be861fed856ab6f127ee8b6c5b512722658 | eb6b77e17691e27fb34616ad432f53d94fcf1d61 | refs/heads/master | 2023-03-17T09:51:03.624641 | 2019-09-23T02:23:09 | 2019-09-23T02:23:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,887 | swift | //
// ViewController.swift
// UIImagePickerControllerSample
//
// Created by RyutaMiyamoto on 2019/09/22.
// Copyright © 2019 RyutaMiyamoto. All rights reserved.
//
import UIKit
class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
@IBOutlet weak var imageView: UIImageView!
@IBAction func tapPhotoLibraryButton(_ sender: UIButton) {
openPicker(type: .photoLibrary)
}
@IBAction func tapCameraButton(_ sender: UIButton) {
openPicker(type: .camera)
}
@IBAction func tapSaveButton(_ sender: UIButton) {
guard let image = imageView.image else { return }
UIImageWriteToSavedPhotosAlbum(image, self, #selector(self.saveImage(_:didFinishSavingWithError:contextInfo:)), nil)
}
func openPicker(type: UIImagePickerController.SourceType) {
guard UIImagePickerController.isSourceTypeAvailable(type) else { return }
let picker = UIImagePickerController()
picker.sourceType = type
picker.delegate = self
present(picker, animated: true, completion: nil)
}
// MARK: - UIImagePickerControllerDelegate
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
guard let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage else { return }
imageView.image = image
picker.dismiss(animated: true, completion: nil)
}
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
picker.dismiss(animated: true, completion: nil)
}
@objc func saveImage(_ image: UIImage, didFinishSavingWithError error: NSError!, contextInfo: UnsafeMutableRawPointer) {
if error == nil {
print("save success")
}
}
}
| [
-1
] |
3ad957cc3af8ab53312c79d759cb6c8a0fa121b1 | d57a4c82c43f9e43e483ae167397a743919df6b4 | /varshalomidze/ViewController.swift | d660cf06464b5edbd12c84e4fc34dad089d3e64d | [] | no_license | varshalomidze/varshalomidze | 0f3eefeca67a67bdf8ebe85233024f8d93594eb9 | 61e7c7e0d822bf29df11d99131e84b83f45fcc1e | refs/heads/master | 2021-04-30T05:52:53.006794 | 2018-02-13T20:26:14 | 2018-02-13T20:26:14 | 121,427,978 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 550 | swift | //
// ViewController.swift
// varshalomidze
//
// Created by Enver Varshalomidze on 2/13/18.
// Copyright © 2018 Enver Varshalomidze. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
print("hello world")
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
| [
-1
] |
d5bf0bbe609b7eca25d46495d1709b79609743cf | c0e2488aa6b75c18bbe6b945f9eb1fe5a78d9f6f | /LabTest/LabTest/AppDelegate.swift | 944bfb3f7d5784e45908f1986de46ea906fc961a | [] | no_license | akash13deep/coredata | e38ddf699028181efc36233781e449856fc1115b | 686863863e02dd96a0822897f4ec1d58cb4a4043 | refs/heads/master | 2020-12-07T03:18:30.049082 | 2020-01-08T17:31:15 | 2020-01-08T17:31:15 | 232,620,125 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,702 | swift | //
// AppDelegate.swift
// LabTest
//
// Created by MacStudent on 2020-01-08.
// Copyright © 2020 MacStudent. All rights reserved.
//
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
// MARK: - Core Data stack
lazy var persistentContainer: NSPersistentContainer = {
/*
The persistent container for the application. This implementation
creates and returns a container, having loaded the store for the
application to it. This property is optional since there are legitimate
error conditions that could cause the creation of the store to fail.
*/
let container = NSPersistentContainer(name: "LabTest")
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
/*
Typical reasons for an error here include:
* The parent directory does not exist, cannot be created, or disallows writing.
* The persistent store is not accessible, due to permissions or data protection when the device is locked.
* The device is out of space.
* The store could not be migrated to the current model version.
Check the error message to determine what the actual problem was.
*/
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
return container
}()
// MARK: - Core Data Saving support
func saveContext () {
let context = persistentContainer.viewContext
if context.hasChanges {
do {
try context.save()
} catch {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
let nserror = error as NSError
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
}
}
}
}
| [
199680,
379906,
253443,
418820,
328199,
384007,
249351,
377866,
372747,
326668,
379914,
199180,
329233,
349202,
186387,
350738,
262677,
330774,
324121,
245274,
377371,
345630,
340511,
384032,
362529,
349738,
394795,
404523,
262701,
245293,
349744,
361524,
337975,
343609,
375867,
333373,
418366,
152127,
339009,
413250,
214087,
352840,
337994,
377930,
370253,
330319,
200784,
173647,
436306,
333395,
244308,
374358,
329815,
254042,
402522,
326239,
322658,
340579,
244329,
333422,
349295,
204400,
173169,
339571,
330868,
344693,
268921,
343167,
192639,
344707,
330884,
336516,
266374,
385670,
346768,
268434,
409236,
333988,
336548,
379048,
377001,
356520,
361644,
402614,
361655,
339132,
325308,
343231,
403138,
337092,
244933,
322758,
337606,
367816,
257738,
342736,
245460,
257751,
385242,
366300,
165085,
350433,
345826,
328931,
395495,
363755,
343276,
346348,
338158,
325358,
212722,
251122,
350453,
338679,
393465,
351482,
264961,
115972,
268552,
346890,
336139,
328460,
362251,
333074,
356628,
257814,
333592,
397084,
342813,
257824,
362272,
377120,
334631,
336680,
389416,
384298,
254252,
204589,
271150,
366383,
328497,
257842,
339768,
326969,
257852,
384828,
204606,
386365,
375615,
339792,
358737,
389970,
361299,
155476,
366931,
257880,
330584,
361305,
362843,
429406,
374112,
353633,
439137,
355184,
361333,
332156,
337277,
260992,
245120,
380802,
389506,
264583,
337290,
155020,
337813,
250262,
348565,
155044,
333221,
373671,
333736,
252845,
356781,
288174,
268210,
370610,
342452,
210356,
370102,
338362,
327612,
358335,
380352,
201157,
187334,
333766,
336325,
339400,
349128,
358347,
393670,
347081,
272848,
379856,
155603,
219091,
399317,
249302,
379863,
372697,
155102,
329182,
182754,
360429,
338927,
330224,
379895,
201723,
257020,
254461
] |
6de1ffc17d5e173ce2a3531a43501b321cb848fa | 5bac27e267fc92568f9a1c34bf0cb2182f0ca61a | /HealtTracer/Models/TreningNode.swift | 65d6d51de97df57f97fd1709b8fcc2841ab850ae | [] | no_license | Cosaquee/HealthTracer | e55a6944d0008063e00165be8c7c1848d634dfaa | 9eb74cb5af8bbc684009e5d733f337f2c3a2ee03 | refs/heads/master | 2020-03-12T20:35:11.740467 | 2018-06-17T18:42:49 | 2018-06-17T18:42:49 | 130,809,045 | 5 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 314 | swift | //
// TreningNode.swift
// HealtTracer
//
// Created by Karol Kozakowski on 15/06/2018.
// Copyright © 2018 Karol Kozakowski. All rights reserved.
//
import Foundation
import ARKit
import MapKit
class TreningNode: SCNCapsule {
var heartRate: Double = 0
var location: LocationMark = LocationMark()
}
| [
-1
] |
2e1c79a18aabe9d5e6eecd3755d6a989f522aa5e | 4f4764c21f2a3306b2163b30234ab375a5996412 | /Flow/PresentationLayer/Flows/OnboardingFlow/Coordinator/OnboardingCoordinatorOutput.swift | 8298f9396c3e9cc3d6747ba639a06eb1af797350 | [
"MIT"
] | permissive | mohsinalimat/Flow-1 | 337e0bef9d6272f8a5ac4963f14b627b5f7ed98f | 2f62d3fa7a2000c66a41e903f5701e5b6b8b03df | refs/heads/master | 2020-04-23T06:09:49.154798 | 2019-01-08T15:49:12 | 2019-01-08T15:49:12 | 170,964,366 | 1 | 0 | MIT | 2019-02-16T04:56:20 | 2019-02-16T04:56:20 | null | UTF-8 | Swift | false | false | 244 | swift | //
// OnboardingCoordinatorOutput.swift
// Flow
//
// Created by Beslan Tularov on 27/07/2018.
// Copyright © 2018 Flow. All rights reserved.
//
protocol OnboardingCoordinatorOutput: class {
var finishFlow: (() -> Void)? { get set }
}
| [
-1
] |
b3ee9257bb5e0c41b409640074443f724841ddbb | 28fac584fd8cac056b042d6baa151fae89090452 | /TraktTV/Common/Helpers/ImageLoader/ImageLoader.swift | 0b7c413857ca522a934117ed9dd80a33da5b2a06 | [
"MIT"
] | permissive | dedeexe/TraktTV | 1a0e46c69e6139b411a4f7d2eedc16d0187dcfa8 | 18c3eb1b4a77981db656ba1ae4c6017f5dff9289 | refs/heads/master | 2021-01-19T12:42:52.960169 | 2017-08-21T05:53:33 | 2017-08-21T05:53:33 | 100,801,026 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 270 | swift | //
// ImageLoader.swift
// Dede.exe
//
// Created by dede.exe on 05/06/17.
// Copyright © 2017 Dede. All rights reserved.
//
import UIKit
public protocol ImageLoader : class {
func loadFrom(url:String, completion:@escaping (RequestResult<UIImage>) -> Void)
}
| [
-1
] |
546e9948baca4b6567badc60c3f0d48cc1ab46f4 | 39968bb367ee409f5b941b4b3d06e8253e77a709 | /IDEHospital/Views/Custom Views/HospitalButton.swift | 0e55dbbf7329660d02c5c6858c714657458b6bf8 | [] | no_license | MostafaSale7/IDE-Hospital-EG | 8902085f643771a4731e43837046746a6c09b580 | 82ad82cc6b71830bcb3f2623458d442fcf9580fc | refs/heads/main | 2023-02-22T04:04:34.308716 | 2021-01-17T16:00:17 | 2021-01-17T16:00:17 | 330,428,643 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 901 | swift | //
// HospitalButton.swift
// IDEHospital
//
// Created by Yousef Mohamed on 16/12/2020.
//
import UIKit
class HospitalButton: UIButton {
override init(frame: CGRect) {
super.init(frame: frame)
configure()
}
init(frame: CGRect, tittle: String, color:ColorName) {
super.init(frame: frame)
self.setTitle(tittle, for: .normal)
configure(color: color)
}
required init?(coder: NSCoder) {
super.init(coder: coder)
configure()
}
private func configure(color:ColorName = ColorName.darkRoyalBlue){
self.titleLabel?.font = UIFont(font: FontFamily.PTSans.bold, size: 12)
self.titleLabel?.font = self.titleLabel?.font.withSize(12)
self.translatesAutoresizingMaskIntoConstraints = false
self.backgroundColor = UIColor(named: color)
self.layer.cornerRadius = 10
}
}
| [
-1
] |
2e654b42d77dd6c9b0fecc9e640a57b6fba49fc7 | fa8f3284e986a239fc7c46196d797915796532e1 | /Example/Tests/Tests.swift | 14584c34d02a35b9f86710ffb58d72020d16a8d4 | [
"MIT"
] | permissive | YehiaSherifSamak/SKImageExtension | 2fdb51023b8e48aa95b2116f56e14b0349a51648 | 77ec718c5ead0e9df67d9153c3c2e9352b44251a | refs/heads/master | 2023-02-28T07:25:49.996543 | 2021-02-08T12:11:45 | 2021-02-08T12:11:45 | 337,057,865 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 753 | swift | import XCTest
import SKImageExtension
class Tests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
XCTAssert(true, "Pass")
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure() {
// Put the code you want to measure the time of here.
}
}
}
| [
276492,
305179,
278558,
307231,
313375,
102437,
227370,
360491,
276533,
276534,
159807,
276543,
286788,
280649,
223316,
315476,
223318,
288857,
227417,
278618,
194652,
194656,
276577,
309345,
227428,
43109,
276582,
276585,
223340,
276589,
278638,
227439,
276592,
131189,
223350,
276603,
276606,
292992,
141450,
311435,
215178,
311438,
276627,
276631,
276632,
184475,
227492,
196773,
129203,
299187,
131256,
176314,
280762,
223419,
299198,
309444,
227528,
276682,
276687,
278742,
278746,
280802,
276709,
276710,
276715,
233715,
227576,
157944,
211193,
168188,
276753,
276760,
309529,
278810,
299293,
282919,
262450,
276792,
315706,
278846,
164162,
311621,
280902,
278856,
227658,
276813,
278863,
6481,
6482,
276821,
6489,
323935,
276835,
321894,
416104,
276847,
285040,
278898,
280961,
178571,
227725,
178578,
190871,
293274,
61857,
61859,
278954,
278961,
278965,
293303,
276920,
278969,
33211,
276925,
278978,
278985,
111056,
278993,
176594,
287198,
227809,
358882,
227813,
279013,
279022,
281072,
279039,
276998,
287241,
279050,
186893,
303631,
223767,
223769,
277017,
291358,
277029,
293419,
277048,
277049,
301634,
369220,
277066,
295519,
66150,
277094,
166507,
277101,
287346,
277111,
279164,
277117,
277118,
291454,
184962,
303746,
152203,
225933,
277133,
133774,
225936,
277138,
277141,
277142,
225944,
230040,
164512,
225956,
285353,
225962,
209581,
205487,
285361,
303793,
154291,
299699,
293556,
154294,
342706,
166580,
285371,
199366,
225997,
164563,
277204,
226004,
203477,
279252,
226007,
119513,
363231,
201442,
226019,
285415,
342762,
277227,
230134,
234234,
209660,
279294,
234241,
226051,
209670,
277254,
226058,
234250,
234253,
234256,
234263,
369432,
234268,
105246,
348959,
228129,
234277,
234280,
279336,
289576,
234283,
277289,
234286,
234289,
234294,
230199,
234301,
162621,
289598,
234304,
281408,
162626,
293693,
277316,
234311,
234312,
299849,
234317,
277325,
277327,
293711,
234323,
234326,
277339,
234331,
301918,
234335,
279392,
297822,
349026,
297826,
234340,
174949,
234343,
234346,
234349,
277360,
234355,
213876,
277366,
234360,
234361,
279417,
209785,
177019,
277370,
234366,
234367,
226170,
158593,
234372,
226181,
113542,
213894,
226184,
234377,
277381,
228234,
234381,
226189,
295824,
226194,
234387,
234386,
234392,
324507,
279456,
234400,
277410,
234404,
289703,
234409,
275371,
234412,
236461,
226222,
234419,
226227,
234425,
234427,
277435,
287677,
234430,
234436,
275397,
234438,
226249,
52172,
234444,
234445,
183248,
234450,
234451,
234454,
234457,
275418,
234463,
234466,
277479,
179176,
234472,
234473,
234477,
234482,
287731,
277492,
314355,
234492,
277505,
234498,
234500,
277509,
277510,
234503,
234506,
230410,
234509,
277517,
197647,
277518,
295953,
277523,
234517,
230423,
281625,
197657,
281626,
175132,
234530,
234531,
234534,
275495,
234539,
275500,
310317,
277550,
234542,
275505,
234548,
277563,
234555,
7229,
7230,
230463,
7231,
156733,
234560,
277566,
238651,
234565,
207938,
234569,
300111,
207953,
296018,
277585,
234577,
296019,
234583,
234584,
275547,
277596,
234594,
230499,
281700,
300135,
234603,
281707,
275565,
156785,
312434,
275571,
234612,
300150,
300151,
234616,
398457,
234622,
300158,
285828,
302213,
275590,
253063,
234631,
277640,
302217,
234632,
275591,
234642,
226451,
308372,
277651,
275607,
119963,
234652,
234656,
330913,
306338,
234659,
277665,
234663,
275625,
300201,
208043,
275628,
226479,
238769,
226481,
208058,
277690,
230588,
283840,
279747,
279760,
290000,
189652,
203989,
363744,
195811,
298212,
304356,
285929,
279792,
298228,
204022,
234742,
228600,
208124,
204041,
292107,
277792,
339234,
199971,
259363,
304421,
277800,
277803,
113966,
277806,
226608,
226609,
277814,
300343,
277821,
277824,
277825,
226624,
15686,
277831,
226632,
294218,
177484,
222541,
277838,
277841,
296273,
222548,
277844,
277845,
314709,
283991,
357719,
224605,
224606,
218462,
142689,
230756,
277862,
163175,
281962,
173420,
277868,
284014,
277871,
279919,
226675,
181625,
277882,
142716,
275838,
275839,
277890,
277891,
226694,
275847,
277896,
277897,
281992,
277900,
230799,
112017,
296338,
277907,
206228,
306579,
226711,
226712,
310692,
279974,
277927,
282024,
370091,
277936,
277939,
279989,
296375,
277943,
277946,
277949,
277952,
296387,
415171,
163269,
277957,
296391,
300487,
277962,
282060,
277965,
280013,
312782,
284116,
277974,
228823,
228824,
277977,
277980,
226781,
277983,
277988,
310757,
316902,
277993,
277994,
296425,
277997,
278002,
306677,
300542,
306693,
153095,
192010,
149007,
65041,
282136,
204313,
278056,
278060,
286254,
194110,
276040,
366154,
276045,
276046,
286288,
276050,
280147,
300630,
243292,
147036,
298590,
370271,
282213,
317032,
222832,
276084,
276085,
276088,
278140,
188031,
276097,
192131,
276100,
276101,
229001,
310923,
312972,
278160,
282259,
276116,
276117,
276120,
278170,
280220,
276126,
282273,
276129,
282276,
278191,
278195,
276148,
296628,
198324,
286388,
278201,
276156,
278214,
323276,
276173,
302797,
212688,
9936,
302802,
276179,
276180,
9937,
286423,
216795,
216796,
276195,
153319,
313065,
280300,
419569,
276210,
276219,
194303,
288512,
311042,
288516,
278285,
276238,
227091,
184086,
294678,
284442,
278299,
276253,
276257,
288547,
278307,
159533,
165677,
276279,
276282,
276283,
276287,
345919,
276294,
282438,
276298,
216918,
276311,
307031,
276318,
237408,
282474,
288619,
276332,
110452,
276344,
194429,
255872,
1923,
40850,
40853,
44952,
247712,
294823,
276394,
276401,
276408,
161722,
290746,
276413,
276421,
276422,
276430,
231375,
153552,
153554,
276444,
280541,
153566,
276454,
276459,
296941,
278518
] |
55eba0df270c85679186122a1e74f5e971549e1a | 7b4e295555b5735a534f6229ba2787a032f84ce3 | /driveIt/skill.swift | 84ed34b49e4daadda80219263a3b6723336930da | [
"MIT"
] | permissive | SebastienVProject/driveIT | 8959657c81999b2f3d82e38c138566b39fbcea3b | b09efdc38ef018c22a7d1752649ceff5f338d744 | refs/heads/master | 2021-01-25T08:20:09.643436 | 2017-07-14T23:58:08 | 2017-07-14T23:58:08 | 93,758,053 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 368 | swift | //
// skill.swift
// driveIt
//
// Created by utilisateur on 09/07/2017.
// Copyright © 2017 SVInfo. All rights reserved.
//
class skill {
var id: String?
var name: String?
var category: String?
init(id: String?, name: String?, category: String?) {
self.id = id
self.name = name
self.category = category
}
}
| [
-1
] |
3ed291922f10faff3a786e9c9b9f9aa5fce64776 | e373b46b34c68d4b9b0db57321cf6dd6950bc62e | /OpenWeatherApp/Providers/Weather/APIRequester/CodableResponse.swift | 398e8d5e274a572255d42a85eb70e3b271bdd701 | [] | no_license | demarte/open-weather | e6da8e427a41b384c2cd945f6c56c18eb8835644 | 004805ac5754ee81c39223839d836dee52d2c839 | refs/heads/master | 2020-04-19T19:26:41.525381 | 2020-04-04T15:02:22 | 2020-04-04T15:02:22 | 168,388,611 | 0 | 0 | null | 2020-03-27T20:01:41 | 2019-01-30T17:55:59 | null | UTF-8 | Swift | false | false | 250 | swift | //
// CodableResponses.swift
// OpenWeatherApp
//
// Created by Ivan De Martino on 2/26/20.
// Copyright © 2020 Ivan De Martino. All rights reserved.
//
import Foundation
struct OpenWeatherResponse<T: Decodable>: Decodable {
let list: [T]
}
| [
-1
] |
c43f5e3e28f669289d88ee953d917f4f556b7e19 | 9e5d9e11e8721a377ad5075e60f8664bd515a5bf | /TaskCompanyUSA/Communicator.swift | a392e7055f4513375d3f59701ceb5a945283978f | [] | no_license | RamiALAIDY/TaskComapanyUSA | b24fa96832af8c7450fa24245ebdc02c8161572e | de17f0d36bf3c3f5f4c25058958d18800518bdf2 | refs/heads/master | 2021-06-23T11:54:10.198241 | 2017-08-27T18:20:49 | 2017-08-27T18:20:49 | 101,543,948 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,754 | swift | //
// Communicator.swift
// TaskCompanyUSA
//
// Created by rami alaidy on 8/26/17.
// Copyright © 2017 rami alaidy. All rights reserved.
//
import Foundation
import Alamofire
class Communicator: NSObject {
public enum CommunicatorHTTPMethod: Int {
case get = 0
case post = 1
}
class func performAsyncRequest(httpMethod: CommunicatorHTTPMethod,
parameters:Dictionary<String, Any>?,
target: UIViewController? = nil,
showHUD: Bool = false,
completionClouser:@escaping (_ isSuccess:Bool, _ error:Error? ,_ response:Any?, _ message:String?) -> Void){
//let fullURL = API
var http:HTTPMethod
switch httpMethod {
case .get:
http = .get
case .post:
http = .post
}
// Show Indecator while loading JSON
let user = "[email protected]"
let password = "admin"
let credential = URLCredential(user: user, password: password, persistence: .forSession)
Alamofire.request( "http://34.208.106.205:8080/api/machine?page=0&size=10/\(user)/\(password)")
.authenticate(usingCredential: credential)
.responseJSON { (_ response) in
if response.error != nil {
// Error
completionClouser(false, response.error! ,nil, (response.error?.localizedDescription)!)
}
else{
completionClouser(true, nil, response.result.value, nil)
}
}
}
}
| [
-1
] |
517844d79b15c11fd6a8489c526d6fa65e982d14 | f200b7819aec5e4a52b97389351ff83e33ee318e | /Ari/ArrayExtension.swift | 4c4d80acee38fbefd15c1b1f65bef993b00e4fc9 | [] | no_license | yamazaki-sensei/Ari | 87b1bf0100acc4d9d3e07f129d4f85ca36e84023 | 85403ebcc4110e05c8a754a6543d6ff028017f40 | refs/heads/master | 2021-06-09T21:26:43.840079 | 2016-10-26T12:18:35 | 2016-10-26T12:18:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,578 | swift | //
// ArrayExtension.swift
// Ari
//
// Created by Hiraku Ohno on 2016/07/22.
// Copyright © 2016年 Hiraku Ohno. All rights reserved.
//
import Foundation
enum ArrayExtensionError: Error {
case generics
case invalidTarget
}
protocol Target: Equatable, Comparable {
}
extension Int: Target {}
extension Float: Target {}
extension Double: Target {}
extension UInt64: Target {}
extension Array where Element: Target {
/* value <= array[x] となる 最小のxを返す */
func lowerBound<T: Target>(_ value: T) throws -> Int {
guard value is Array.Iterator.Element else { throw ArrayExtensionError.generics }
guard let last = self.last , value <= last as! T else { throw ArrayExtensionError.invalidTarget }
let index = try! binarySearch(value)
if self.count <= index {
throw ArrayExtensionError.invalidTarget
}
let found = self[index] as! T
if value <= found {
return index
}
if found <= value && index < self.count - 1 {
return index + 1
}
throw ArrayExtensionError.invalidTarget
}
func binarySearch<T: Target>(_ value: T) throws -> Int {
guard value is Array.Iterator.Element else { throw ArrayExtensionError.generics }
var lo = 0
var hi = self.count - 1
while lo < hi {
let mid = lo + (hi - lo) / 2
if (self[mid] as! T) < value {
lo = mid + 1
} else {
hi = mid
}
}
return lo
}
}
| [
-1
] |
91103384b98880fdb6dee64890c2ddb6adec2d1a | 51948dfa2d3a0dd546b6ddd5061a9774f0462361 | /SlotMachine/Factory.swift | 0021b1a7dcea5989ecd48fade0b64b6b8421e398 | [] | no_license | bcanty7785/SlotMachine | 8ee0864ba16b2f7e3e60af38c16c32d7cda6f976 | c95f98a60e5f56874aea367e61ae11bac25bf354 | refs/heads/master | 2016-09-03T07:38:23.752812 | 2015-05-08T02:47:08 | 2015-05-08T02:47:08 | 35,255,097 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,571 | swift | //
// Factory.swift
// SlotMachine
//
// Created by Brian Canty on 5/7/15.
// Copyright (c) 2015 Brian Canty. All rights reserved.
//
import Foundation
import UIKit
class Factory {
class func createSlots () -> [[Slot]] {
let kNumberOfSlots = 3
let kNumberOfContainers = 3
var slots: [[Slot]] = []
for var containerNumber = 0; containerNumber < kNumberOfContainers; ++containerNumber {
var slotArray: [Slot] = []
for var slotNumber = 0; slotNumber < kNumberOfSlots; ++slotNumber {
var slot = Factory.createSlot(slotArray)
slotArray.append(slot)
}
slots.append(slotArray)
}
return slots
}
class func createSlot (currentCards: [Slot]) -> Slot {
var currentCardValues: [Int] = []
for slot in currentCards {
currentCardValues.append(slot.value)
}
var randomNumber = Int(arc4random_uniform(UInt32(13)))
while contains(currentCardValues, randomNumber + 1) {
randomNumber = Int(arc4random_uniform(UInt32(13)))
}
var slot:Slot
switch randomNumber {
case 0:
slot = Slot(value: 1, image: UIImage(named: "Ace"), isRed: true)
case 1:
slot = Slot(value: 2, image: UIImage(named: "Two"), isRed: true)
case 2:
slot = Slot(value: 3, image: UIImage(named: "Three"), isRed: true)
case 3:
slot = Slot(value: 4, image: UIImage(named: "Four"), isRed: true)
case 4:
slot = Slot(value: 5, image: UIImage(named: "Five"), isRed: false)
case 5:
slot = Slot(value: 6, image: UIImage(named: "Six"), isRed: false)
case 6:
slot = Slot(value: 7, image: UIImage(named: "Seven"), isRed: true)
case 7:
slot = Slot(value: 8, image: UIImage(named: "Eight"), isRed: false)
case 8:
slot = Slot(value: 9, image: UIImage(named: "Nine"), isRed: false)
case 9:
slot = Slot(value: 10, image: UIImage(named: "Ten"), isRed: true)
case 10:
slot = Slot(value: 11, image: UIImage(named: "Jack"), isRed: false)
case 11:
slot = Slot(value: 12, image: UIImage(named: "Queen"), isRed: false)
case 12:
slot = Slot(value: 13, image: UIImage(named: "King"), isRed: true)
default:
slot = Slot(value: 0, image: UIImage(named: "Ace"), isRed: true)
}
return slot
}
}
| [
-1
] |
1bcdf658c1d1b7c6f1843919d00c9c221d7f333b | b6f89401a1813fea94d3e1e8fa4fe709c539d309 | /HelloWorld/AppDelegate.swift | b34a61a02f77db27a2f11492733a352f76beb9ca | [] | no_license | omiyamairi/HelloWorld | bf3b24b9e4ccfde86c57fdc3946e53c4b174f4a5 | 4b179425728cb1c686a7a124a74c122917c45eed | refs/heads/master | 2022-11-29T23:51:57.964422 | 2020-08-18T11:26:34 | 2020-08-18T11:26:34 | 288,433,899 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,424 | swift | //
// AppDelegate.swift
// HelloWorld
//
// Created by 深松美帆 on 2020/08/18.
// Copyright © 2020 miho.fukamatsu. 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,
213048,
376889,
385081,
393275,
376905,
327756,
254030,
286800,
368727,
180313,
368735,
180320,
376931,
286831,
368752,
286844,
262283,
286879,
286888,
327871,
180416,
377036,
180431,
377046,
377060,
327914,
393456,
393460,
418043,
336123,
385280,
336128,
262404,
180490,
368911,
262416,
262422,
377117,
262436,
336180,
262454,
262472,
344403,
213332,
65880,
418144,
262496,
262499,
213352,
262507,
246123,
262510,
213372,
385419,
262550,
262552,
385440,
385443,
385451,
262573,
393647,
385458,
262586,
344511,
262592,
360916,
369118,
328177,
328179,
328182,
328189,
328192,
164361,
410128,
393747,
254490,
188958,
385570,
33316,
197159,
377383,
352821,
188987,
418363,
369223,
385609,
385616,
352864,
369253,
262760,
352874,
352887,
254587,
377472,
148105,
377484,
352918,
98968,
344744,
361129,
336555,
385713,
434867,
164534,
336567,
164538,
328378,
328386,
344776,
352968,
352971,
418507,
385742,
385748,
361179,
189153,
369381,
418553,
344831,
336643,
344835,
344841,
336659,
418580,
418585,
434970,
369435,
418589,
262942,
418593,
336675,
328484,
418598,
418605,
336696,
361273,
328515,
336708,
336711,
328519,
361288,
336714,
328522,
426841,
197468,
361309,
254812,
361315,
361322,
328573,
377729,
222128,
345035,
345043,
386003,
386011,
386018,
386022,
435187,
328702,
328714,
361489,
386069,
336921,
386073,
336925,
345118,
377887,
345133,
345138,
386101,
197707,
189520,
345169,
156761,
361567,
148578,
345199,
386167,
361593,
410745,
214149,
345222,
386186,
337047,
345246,
214175,
337071,
337075,
386258,
328924,
66782,
222437,
328941,
386285,
386291,
345376,
353570,
345379,
410917,
345382,
345399,
378169,
369978,
337222,
337234,
263508,
402791,
345448,
271730,
378227,
271745,
181638,
353673,
181643,
181649,
181654,
230809,
181673,
337329,
181681,
181684,
361917,
181696,
337349,
337365,
271839,
329191,
361960,
329194,
116210,
337398,
337415,
329226,
419339,
419343,
419349,
345625,
419355,
370205,
419359,
394786,
419362,
370213,
419368,
419376,
206395,
214593,
419400,
419402,
353867,
419406,
419410,
345701,
394853,
222830,
370297,
403075,
198280,
345736,
345749,
345757,
345762,
419491,
345765,
419497,
419501,
370350,
419506,
419509,
337592,
419512,
419517,
337599,
419527,
419530,
419535,
272081,
394966,
419542,
419544,
181977,
419547,
419550,
419559,
337642,
419563,
337645,
370415,
337659,
141051,
337668,
362247,
395021,
362255,
116509,
345887,
378663,
345905,
354106,
354111,
247617,
354117,
370503,
329544,
370509,
354130,
247637,
337750,
370519,
313180,
354142,
345964,
345967,
345970,
345974,
403320,
354172,
247691,
337808,
247700,
329623,
436126,
436132,
337833,
362413,
337844,
346057,
247759,
346063,
329697,
354277,
190439,
247789,
354313,
346139,
436289,
378954,
395339,
338004,
100453,
329832,
329855,
329885,
411805,
346272,
362660,
100524,
379066,
387260,
256191,
346316,
411861,
411864,
411868,
411873,
379107,
411876,
387301,
346343,
387306,
387312,
346355,
436473,
321786,
379134,
411903,
379152,
395538,
387349,
338199,
387352,
182558,
338211,
395566,
248111,
362822,
436555,
190796,
379233,
354673,
321910,
248186,
420236,
379278,
354727,
338352,
330189,
338381,
338386,
338403,
338409,
248308,
199164,
330252,
199186,
330267,
354855,
10828,
199249,
174695,
248425,
191084,
338543,
191092,
346742,
330383,
354974,
150183,
174774,
248504,
174777,
223934,
355024,
355028,
273108,
264918,
183005,
436962,
338660,
338664,
264941,
363251,
207619,
264964,
338700,
199452,
363293,
396066,
346916,
396069,
215853,
355122,
355131,
355140,
355143,
355150,
330580,
355166,
265055,
355175,
387944,
355179,
330610,
330642,
355218,
412599,
207808,
379848,
396245,
248792,
248798,
347105,
257008,
183282,
265207,
330748,
265214,
330760,
330768,
248862,
396328,
158761,
199728,
330800,
396339,
339001,
388154,
388161,
347205,
339036,
412764,
257120,
265320,
248951,
420984,
330889,
347287,
248985,
339097,
44197,
380070,
339112,
249014,
330958,
330965,
265432,
388319,
388347,
159005,
208166,
273708,
372015,
347441,
372018,
199988,
396600,
437566,
437570,
437575,
437583,
331088,
437587,
331093,
396633,
437595,
175457,
208227,
175460,
175463,
265580,
437620,
175477,
249208,
175483,
249214,
249218,
249227,
175513,
396705,
355748,
380332,
396722,
372163,
216517,
380360,
216522,
339404,
372176,
208337,
339412,
413141,
339417,
249308,
339420,
339424,
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,
126596,
421508,
224904,
224909,
159374,
11918,
224913,
126610,
224916,
224919,
126616,
208538,
224922,
224926,
224929,
224932,
224936,
257704,
224942,
257712,
224947,
257716,
257720,
224953,
257724,
224959,
257732,
224965,
224969,
339662,
224975,
257747,
224981,
224986,
224993,
257761,
257764,
224999,
339695,
225012,
257787,
225020,
339710,
257790,
225025,
257794,
257801,
339721,
257804,
225038,
257807,
372499,
167700,
225043,
225048,
257819,
225053,
184094,
225058,
339747,
339749,
257833,
225066,
257836,
413484,
225070,
225073,
372532,
257845,
225079,
397112,
225082,
397115,
225087,
225092,
225096,
323402,
257868,
225103,
257871,
397139,
225108,
225112,
257883,
257886,
225119,
257890,
339814,
225127,
257896,
274280,
257901,
225137,
339826,
257908,
225141,
257912,
257916,
225148,
257920,
225155,
339844,
225165,
397200,
225170,
380822,
225175,
225180,
118691,
184244,
372664,
372702,
372706,
356335,
380918,
405533,
430129,
421960,
356439,
430180,
421990,
266350,
356466,
266362,
381068,
225423,
250002,
250004,
225429,
356506,
225437,
135327,
225441,
438433,
225444,
438436,
225447,
438440,
225450,
258222,
225455,
225458,
225461,
225466,
389307,
225470,
381120,
372929,
225475,
389320,
225484,
225487,
225490,
225493,
266453,
225496,
225499,
225502,
225505,
356578,
217318,
225510,
225514,
225518,
372976,
381176,
389380,
356637,
356640,
356643,
356646,
356649,
356655,
332080,
340275,
356660,
397622,
332090,
225597,
332097,
201028,
348488,
332106,
332117,
250199,
250202,
332125,
250210,
332152,
250238,
389502,
332161,
332172,
373145,
340379,
389550,
324030,
266687,
160234,
127471,
340472,
324094,
266754,
324099,
324102,
324111,
340500,
324117,
324131,
332324,
381481,
324139,
356907,
324142,
356916,
324149,
324155,
348733,
324164,
356934,
348743,
381512,
324170,
324173,
324176,
389723,
332380,
381545,
340627,
184982,
373398,
258721,
332453,
332459,
389805,
332463,
381617,
332471,
332483,
332486,
373449,
332493,
357069,
357073,
332511,
332520,
340718,
332533,
348924,
389926,
152370,
348978,
340789,
348982,
398139,
127814,
357206,
389978,
357211,
430939,
357214,
201579,
201582,
349040,
340849,
201588,
430965,
324472,
398201,
119674,
324475,
430972,
340861,
324478,
340858,
324481,
373634,
398211,
324484,
324487,
381833,
324492,
324495,
324498,
430995,
324501,
324510,
324513,
201637,
398245,
324524,
340909,
324533,
324538,
324541,
398279,
340939,
340941,
209873,
340957,
431072,
398306,
340963,
209895,
201711,
349172,
349180,
439294,
431106,
209943,
250914,
357410,
185380,
357418,
209965,
209968,
209971,
209975,
209979,
209987,
209990,
341071,
349267,
250967,
210010,
341091,
210025,
210027,
210030,
210036,
210039,
210044,
349308,
152703,
349311,
160895,
210052,
349319,
210055,
210067,
210071,
210077,
210080,
210084,
251044,
185511,
210088,
210095,
210098,
210107,
210115,
332997,
210127,
333009,
210131,
333014,
210138,
210143,
251128,
275706,
275712,
275715,
275721,
349459,
333078,
251160,
349484,
349491,
251189,
415033,
251210,
357708,
210260,
365911,
259421,
365921,
333154,
251235,
374117,
333162,
234866,
390516,
333175,
357755,
251271,
136590,
112020,
349590,
357792,
415166,
415185,
366034,
366038,
415191,
415193,
415196,
415199,
423392,
333284,
366056,
366061,
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,
333498,
333511,
358099,
333534,
366307,
366311,
431851,
366318,
210672,
366321,
366325,
210695,
268041,
210698,
366348,
210706,
399128,
333594,
358191,
366387,
399159,
358200,
325440,
366401,
341829,
325446,
46920,
341834,
341838,
341843,
415573,
341851,
350045,
399199,
259938,
399206,
399215,
268143,
358255,
358259,
341876,
333689,
243579,
325504,
333698,
333708,
333724,
382890,
350146,
333774,
358371,
350189,
350193,
350202,
333818,
350206,
350213,
268298,
350231,
333850,
350237,
350240,
350244,
350248,
178218,
350251,
350256,
350259,
350271,
243781,
350285,
374864,
342111,
342133,
374902,
432271,
333997,
334011,
260289,
260298,
350416,
350422,
211160,
350425,
334045,
350445,
375026,
358644,
350458,
350461,
350464,
325891,
350467,
350475,
375053,
268559,
350480,
432405,
350486,
325914,
350490,
325917,
350493,
350498,
350504,
358700,
350509,
391468,
358704,
358713,
358716,
383306,
334161,
383321,
383330,
383333,
391530,
334203,
268668,
194941,
391563,
366990,
416157,
342430,
375208,
326058,
375216,
334262,
334275,
326084,
358856,
195039,
334304,
334311,
375277,
334321,
350723,
186897,
342545,
334358,
342550,
342554,
334363,
350761,
252461,
334384,
358961,
334394,
252482,
219718,
334407,
334420,
350822,
375400,
334465,
334468,
162445,
326290,
342679,
342683,
260766,
342710,
244409,
260797,
260801,
350917,
154317,
391894,
154328,
416473,
64230,
113388,
342766,
375535,
203506,
342776,
391937,
391948,
326416,
375568,
326441,
326451,
326454,
244540,
260924,
326460,
375612,
326467,
244551,
326473,
326477,
326485,
416597,
342874,
326490,
326502,
375656,
433000,
326507,
326510,
211825,
211831,
351104,
342915,
400259,
236430,
342930,
252822,
392091,
400285,
252836,
359334,
211884,
400306,
351168,
326598,
359366,
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,
326855,
244937,
253130,
343244,
146642,
359649,
343270,
351466,
351479,
343306,
261389,
359694,
261393,
384275,
245020,
245029,
171302,
351534,
376110,
245040,
212291,
384323,
343365,
212303,
367965,
343393,
343398,
367980,
343409,
154999,
253303,
343417,
327034,
245127,
384397,
245136,
245142,
245145,
343450,
245148,
245151,
245154,
245157,
245162,
327084,
359865,
384443,
146876,
327107,
384453,
327110,
327115,
327117,
359886,
359890,
343507,
368092,
343534,
343539,
368119,
343544,
368122,
409091,
359947,
359955,
359983,
343630,
327275,
245357,
138864,
155254,
155273,
368288,
245409,
425638,
425649,
155322,
425662,
155327,
155351,
155354,
212699,
155363,
245475,
245483,
409335,
155393,
155403,
155422,
360223,
155442,
155447,
155461,
360261,
376663,
155482,
261981,
425822,
155487,
376671,
155490,
155491,
327531,
261996,
376685,
261999,
262002,
327539,
147317,
425845,
262005,
262008,
262011,
155516,
155521,
155525,
360326,
155531,
262027,
262030,
262033,
262036,
262039,
262042,
262045,
155549,
262048,
262051,
327589,
155559,
155562,
155565,
393150,
384977,
393169,
155611,
155619,
253923,
155621,
253926,
327654,
393203,
360438,
393206,
393212,
155646
] |
8067fa52e7ed593b23575003403ee4f203436446 | d6c8ca74e8faa48b6b537d4dd683c68842f2a0b6 | /iOS/Andre/Andre/Sugestao.swift | 5d3d6c7a0e8b8fbffc67ac89af3502699915c3fb | [] | no_license | joffilyfe/graduacao | 3f7bff56a17778fe91ea8ca2ca3ada7e1ef50660 | f3587964cff8bc9745b882a2ee1f1c4d37afa42c | refs/heads/master | 2021-01-24T10:53:01.937280 | 2017-05-16T11:00:47 | 2017-05-16T11:00:47 | 70,293,205 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 961 | swift | //
// Sugestao.swift
// Andre
//
// Created by admin on 17/03/17.
// Copyright © 2017 Joffily. All rights reserved.
//
import Foundation
class Sugestao:NSObject, NSCoding {
var nome:String!
var chocolate:String!
var data:Date!
override var description: String {
return "\(self.nome) - \(self.chocolate)"
}
init(nome:String, chocolate:String, data:Date) {
self.nome = nome
self.chocolate = chocolate
self.data = data
}
required init?(coder aDecoder: NSCoder) {
self.nome = aDecoder.decodeObject(forKey: "nome") as! String
self.chocolate = aDecoder.decodeObject(forKey: "chocolate") as! String
self.data = aDecoder.decodeObject(forKey: "data") as! Date
}
func encode(with aCoder: NSCoder) {
aCoder.encode(self.nome, forKey: "nome")
aCoder.encode(self.chocolate, forKey: "chocolate")
aCoder.encode(self.data, forKey: "data")
}
}
| [
-1
] |
e05f906f74c1514b49bf4d9e05c26e3a5a4c988f | 74926e2e6615f48b19f39395fd34999960c06558 | /rff/ViewController/Tracking/Vac and Loan/Vac Approval/VacData.swift | 60b4d7a8a6ad9dc04e04cdbb1115ba21c1653533 | [] | no_license | Riyadhfoods/rff.app | 33525a3c744167f1645ac645b754dcdd6f645193 | b3065711287b56a0db61e23fec6723e654e778ed | refs/heads/master | 2020-03-21T17:58:53.170175 | 2018-11-01T06:20:34 | 2018-11-01T06:20:34 | 138,865,486 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 6,114 | swift | //
// VacData.swift
// rff
//
// Created by Riyadh Foods Industrial Co. on 25/07/2018.
// Copyright © 2018 Riyadh Foods Industrial Co. All rights reserved.
//
import Foundation
class VacData{
static let shared = VacData()
private var EmpName = ""
private var JoinDate = ""
private var StartDate = ""
private var ManagerName = ""
private var JobDesc = ""
private var SubJobDesc = ""
private var Department = ""
private var Nationality = ""
private var NumberofDays = ""
private var LeaveStartDate = ""
private var ReturnDate = ""
private var RequestDate = ""
private var VacationType = ""
private var ExitReEntry = ""
private var ExitReEntryDays = ""
private var City = ""
private var VacNumber = ""
private var VacTypeAdmin = ""
private var VacationDays_Details = ""
private var Used_Details = ""
private var Requested = ""
private var Remaining_Detail = ""
var companionsDetailsArray = [CompanionsDetails]()
private var Total_SettlementAmount = ""
private var TicketRequired = ""
func setEmpGeneralInfo(empVac: VacationApprovalModul) -> EmployeeGeneralInfo{
EmpName = EmpName == "" ? empVac.EmpName : EmpName
JoinDate = JoinDate == "" ? empVac.JoinDate : JoinDate
StartDate = StartDate == "" ? empVac.StartDate : StartDate
ManagerName = ManagerName == "" ? empVac.ManagerName : ManagerName
JobDesc = JobDesc == "" ? empVac.JobDesc : JobDesc
SubJobDesc = SubJobDesc == "" ? empVac.SubJobDesc : SubJobDesc
Department = Department == "" ? empVac.Department : Department
Nationality = Nationality == "" ? empVac.Nationality : Nationality
return EmployeeGeneralInfo(EmpName: EmpName,
JoinDate: JoinDate,
StartDate: StartDate,
ManagerName: ManagerName,
JobDesc: JobDesc,
SubJobDesc: SubJobDesc,
Department: Department,
Nationality: Nationality)
}
func setleaveDetailsInfo(empVac: VacationApprovalModul) -> LeaveDetails {
NumberofDays = NumberofDays == "" ? empVac.NumberofDays : NumberofDays
LeaveStartDate = LeaveStartDate == "" ? empVac.LeaveStartDate : LeaveStartDate
ReturnDate = ReturnDate == "" ? empVac.ReturnDate : ReturnDate
RequestDate = RequestDate == "" ? empVac.RequestDate : RequestDate
VacationType = VacationType == "" ? empVac.VacationType : VacationType
ExitReEntry = ExitReEntry == "" ? empVac.ExitReEntry : ExitReEntry
ExitReEntryDays = ExitReEntryDays == "" ? empVac.ExitReEntryDays : ExitReEntryDays
City = City == "" ? empVac.City : City
VacNumber = VacNumber == "" ? empVac.Vacation_Number : VacNumber
return LeaveDetails(NumberofDays: NumberofDays,
LeaveStartDate: LeaveStartDate,
ReturnDate: ReturnDate,
RequestDate: RequestDate,
VacationType: VacationType,
ExitReEntry: ExitReEntry,
ExitReEntryDays: ExitReEntryDays,
City: City,
Vacation_Number: VacNumber)
}
func setAdministrativeUse(empVac: VacationApprovalModul) -> AdministrativeUse{
VacTypeAdmin = VacTypeAdmin == "" ? empVac.VacTypeAdmin : VacTypeAdmin
VacationDays_Details = VacationDays_Details == "" ? empVac.VacationDays_Details : VacationDays_Details
Used_Details = Used_Details == "" ? empVac.Used_Details : Used_Details
Requested = Requested == "" ? empVac.Requested : Requested
Remaining_Detail = Remaining_Detail == "" ? empVac.Remaining_Detail : Remaining_Detail
return AdministrativeUse(VacTypeAdmin: VacTypeAdmin,
VacationDays_Details: VacationDays_Details,
Used_Details: Used_Details,
Requested: Requested,
Remaining_Detail: Remaining_Detail)
}
func setCompanionsDetails(empVac: VacationApprovalModul) -> [CompanionsDetails]{
if empVac.Name_Companion != ""{
companionsDetailsArray.append(CompanionsDetails(Name_Companion: empVac.Name_Companion,
City_Companion: empVac.City_Companion,
DOB_Companion: empVac.DOB_Companion,
VisaRequest_Companion: empVac.VisaRequest_Companion))
}
return companionsDetailsArray
}
func setSettlementAndTicketDetails(empVac: VacationApprovalModul) -> SettlementAndTicketDetails{
Total_SettlementAmount = Total_SettlementAmount == "" ? empVac.Total_SettlementAmount : Total_SettlementAmount
TicketRequired = TicketRequired == "" ? empVac.TicketRequired : TicketRequired
return SettlementAndTicketDetails(Total_SettlementAmount: Total_SettlementAmount,
TicketRequired: TicketRequired)
}
func setValueToDefault(){
EmpName = ""
JoinDate = ""
StartDate = ""
ManagerName = ""
JobDesc = ""
SubJobDesc = ""
Department = ""
Nationality = ""
NumberofDays = ""
LeaveStartDate = ""
ReturnDate = ""
RequestDate = ""
VacationType = ""
ExitReEntry = ""
ExitReEntryDays = ""
City = ""
VacTypeAdmin = ""
VacationDays_Details = ""
Used_Details = ""
Requested = ""
Remaining_Detail = ""
Total_SettlementAmount = ""
companionsDetailsArray = [CompanionsDetails]()
TicketRequired = ""
}
}
| [
-1
] |
8dc69bd5283251deca519b1d9f894f7ee848fac6 | 0288d2b60808b504ac0c4b7e56acb59e366aab0d | /FlippingApp/View Controllers/SettingsViewController.swift | 8bf707ba181e386fb786313c6088068f3e897f00 | [
"MIT"
] | permissive | claywatkins/Just-Flip-It | 147c9c8ad49d6fc7afbb7ff067019d181ac3096c | 1f0a06abadc58c5113c13079cb4315da0c58c958 | refs/heads/main | 2023-03-24T22:29:40.563323 | 2021-03-22T18:03:16 | 2021-03-22T18:03:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 12,203 | swift | //
// SettingsViewController.swift
// FlippingApp
//
// Created by Bronson Mullens on 2/12/21.
//
import UIKit
import StoreKit
protocol SettingsDelegate {
func dataWasErased()
}
struct IAP {
var name: String
var handler: (() -> Void)
}
class SettingsViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
// MARK: - Properties
var itemController: ItemController?
var eraseDelegate: SettingsDelegate?
var IAPs = [IAP]()
var totalTipped: Double {
return UserDefaults.standard.double(forKey: "tipped")
}
enum settings: String {
case whatsNew = "🗞 What's New?"
case twitter = "🐦 Twitter"
case tipJar = "💰 Tip Jar"
case rateTheApp = "⭐️ Rate the App"
case feedback = "🦻🏻 Feedback"
case helpfulTips = "🆘 Helpful Tips"
case privacyPolicy = "⚖️ Privacy Policy"
case eraseInventory = "🗑 Erase All Inventory"
case erasesoldItems = "🗑 Erase All Sold Items"
case eraseCustomTags = "🗑 Erase All Custom Tags"
case eraseData = "⛔️ Erase All Data"
}
let sectionOne: [settings] = [
settings.whatsNew,
settings.twitter]
let sectionTwo: [settings] = [
settings.tipJar,
settings.rateTheApp,
settings.feedback,
settings.helpfulTips]
let sectionThree: [settings] = [
settings.eraseInventory,
settings.erasesoldItems,
settings.eraseCustomTags,
settings.eraseData]
let staticSettings: [[String]] = [
[settings.whatsNew.rawValue,
settings.twitter.rawValue],
[settings.tipJar.rawValue,
settings.rateTheApp.rawValue,
settings.feedback.rawValue,
settings.helpfulTips.rawValue],
[settings.eraseInventory.rawValue,
settings.erasesoldItems.rawValue,
settings.eraseCustomTags.rawValue,
settings.eraseData.rawValue],
]
lazy var numberOfRows = [sectionOne.count,
sectionTwo.count,
sectionThree.count]
// MARK: - IBOutlets
@IBOutlet weak var appLogoImageView: UIImageView!
@IBOutlet weak var appVersionLabel: UILabel!
@IBOutlet weak var tableView: UITableView!
// MARK: - Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
appendIAPs()
updateViews()
configureColors()
}
func updateViews() {
appVersionLabel.text = "App Version \(UIApplication.appVersion!)"
appLogoImageView.layer.cornerRadius = 12
}
func configureColors() {
view.backgroundColor = UIColor(named: "Background")
appVersionLabel.textColor = UIColor(named: "Text")
tableView.backgroundColor = UIColor(named: "Background")
tableView.separatorColor = UIColor(named: "Background")
}
// MARK: - Methods
func whatsNew() {
let alert = UIAlertController(title: "\(UIApplication.appVersion!) Notes", message:
"""
- Bug fix: Tapping on a sold item while filtering by tag no longer displays the wrong item.
- Bug fix: Fixed the scaling of the sold item popover to better display info on smaller screens.
- Bug fix: Corrected inconsistent capitalization.
- Bug fix: Keyboard in inventory now hides after search is pressed.
- Bug fix: Added a bug. Then I removed it.
"""
, preferredStyle: .alert)
let action = UIAlertAction(title: "Awesome!", style: .cancel, handler: nil)
alert.addAction(action)
present(alert, animated: true, completion: nil)
}
func twitter() {
let screenName = "bronsonmullens"
let appURL = URL(string: "twitter://user?screen_name=\(screenName)")!
let webURL = URL(string: "https://twitter.com/\(screenName)")!
let application = UIApplication.shared
if application.canOpenURL(appURL as URL) {
application.open(appURL)
} else {
application.open(webURL)
}
}
func tipJar() {
let alert = UIAlertController(title: "Tip Jar", message: "Thank you for your generosity. All tips go toward the continuous development of my apps.", preferredStyle: .actionSheet)
let tier1TipAction = UIAlertAction(title: "Small tip ($0.99)", style: .default) { (_) in
self.IAPs[0].handler()
}
let tier2TipAction = UIAlertAction(title: "Generous tip ($4.99)", style: .default) { (_) in
self.IAPs[1].handler()
}
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
alert.addAction(tier1TipAction)
alert.addAction(tier2TipAction)
alert.addAction(cancelAction)
present(alert, animated: true, completion: nil)
}
func appendIAPs() {
IAPs.append(IAP(name: "Small Tip", handler: {
IAPManager.shared.purchase(product: .tier1Tip) { [weak self] tipped in
DispatchQueue.main.async {
let currentTipped = self?.totalTipped ?? 0
let newTipped = currentTipped + tipped
UserDefaults.standard.setValue(newTipped, forKey: "tipped")
}
}
}))
IAPs.append(IAP(name: "Generous Tip", handler: {
IAPManager.shared.purchase(product: .tier2Tip) { [weak self] tipped in
DispatchQueue.main.async {
let currentTipped = self?.totalTipped ?? 0
let newTipped = currentTipped + tipped
UserDefaults.standard.setValue(newTipped, forKey: "tipped")
}
}
}))
}
func helpfulTips() {
let helpMessage =
"""
Begin by taping the '+' icon on the inventory card in your dashboard. Once you've added an item, you can then tap the '+' icon in the sold items card to record a sale. Tap on an item in your inventory to see or change information of the item.
"""
let alert = UIAlertController(title: "How to use this app",
message: helpMessage,
preferredStyle: .alert)
let action = UIAlertAction(title: "OK",
style: .cancel,
handler: nil)
alert.addAction(action)
present(alert, animated: true)
}
func feedback() {
let email: String = "[email protected]"
let alert = UIAlertController(title: "Submit Feedback", message: "Whether it's a bug report, feature request, or general feedback, I'd love to hear from you. Send me an email at \(email).", preferredStyle: .alert)
let action = UIAlertAction(title: "Ok", style: .cancel, handler: nil)
alert.addAction(action)
present(alert, animated: true, completion: nil)
}
func rateTheApp() {
SKStoreReviewController.requestReview()
}
func privacyPolicy() {
let privacyPolicyURL = URL(string: "https://github.com/bronsonmullens/FlippingApp/blob/main/PrivacyPolicy.MD")!
let application = UIApplication.shared
application.open(privacyPolicyURL)
}
func eraseInventory() {
let alert = UIAlertController(title: "Warning!", message: "Proceeding will permanently delete all stored inventory. This cannot be reversed.", preferredStyle: .alert)
let confirm = UIAlertAction(title: "I Understand", style: .destructive) { (_) in
self.itemController?.eraseAllInventory()
self.eraseDelegate?.dataWasErased()
}
let cancel = UIAlertAction(title: "Nevermind", style: .cancel, handler: nil)
alert.addAction(confirm)
alert.addAction(cancel)
present(alert, animated: true, completion: nil)
}
func eraseSoldItems() {
let alert = UIAlertController(title: "Warning!", message: "Proceeding will permanently delete all stored sales. This cannot be reversed.", preferredStyle: .alert)
let confirm = UIAlertAction(title: "I Understand", style: .destructive) { (_) in
self.itemController?.eraseAllSoldItems()
self.eraseDelegate?.dataWasErased()
}
let cancel = UIAlertAction(title: "Nevermind", style: .cancel, handler: nil)
alert.addAction(confirm)
alert.addAction(cancel)
present(alert, animated: true, completion: nil)
}
func eraseTags() {
let alert = UIAlertController(title: "Warning!", message: "Proceeding will permanently delete all custom tags. This cannot be reversed.", preferredStyle: .alert)
let confirm = UIAlertAction(title: "I Understand", style: .destructive) { (_) in
self.itemController?.eraseAllTags()
self.eraseDelegate?.dataWasErased()
}
let cancel = UIAlertAction(title: "Nevermind", style: .cancel, handler: nil)
alert.addAction(confirm)
alert.addAction(cancel)
present(alert, animated: true, completion: nil)
}
func eraseAllData() {
let alert = UIAlertController(title: "Warning!",
message: "Proceeding will permanently delete all stored user data. This includes all sales, profit, inventory, and tags. This cannot be reversed."
, preferredStyle: .alert)
let confirm = UIAlertAction(title: "I Understand", style: .destructive) { (_) in
UserDefaults.standard.setValue(false, forKey: "gnomes")
self.itemController?.eraseAllData()
self.eraseDelegate?.dataWasErased()
}
let cancel = UIAlertAction(title: "Nevermind", style: .cancel, handler: nil)
alert.addAction(confirm)
alert.addAction(cancel)
present(alert, animated: true, completion: nil)
}
// MARK: - Table view delegate
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
numberOfRows[section]
}
func numberOfSections(in tableView: UITableView) -> Int {
staticSettings.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "SettingCell", for: indexPath) as! SettingsCell
cell.settingTypeLabel.text = staticSettings[indexPath.section][indexPath.row]
if cell.settingTypeLabel.text == settings.eraseData.rawValue {
cell.settingTypeLabel.textColor = .systemRed
cell.settingTypeLabel.font = .boldSystemFont(ofSize: 16)
} else {
cell.settingTypeLabel.textColor = .white
cell.settingTypeLabel.font = .boldSystemFont(ofSize: 16)
}
cell.backgroundColor = UIColor(named: "Foreground")
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
switch staticSettings[indexPath.section][indexPath.row] {
case settings.whatsNew.rawValue:
whatsNew()
case settings.twitter.rawValue:
twitter()
case settings.tipJar.rawValue:
tipJar()
case settings.feedback.rawValue:
feedback()
case settings.rateTheApp.rawValue:
rateTheApp()
case settings.helpfulTips.rawValue:
helpfulTips()
case settings.privacyPolicy.rawValue:
privacyPolicy()
case settings.eraseInventory.rawValue:
eraseInventory()
case settings.erasesoldItems.rawValue:
eraseSoldItems()
case settings.eraseCustomTags.rawValue:
eraseTags()
case settings.eraseData.rawValue:
eraseAllData()
default:
NSLog("Error occured when attempting to select a settings option.")
}
tableView.deselectRow(at: indexPath, animated: true)
}
}
| [
-1
] |
ce6114cbfb3dbaed6926b566b08ccc8263ac2a94 | 5fa0f350f2617e9a87b16ce846eede474bc435c2 | /BarcodeCaptureSettingsSample/BarcodeCaptureSettingsSample/Data Source/Settings/View/Viewfinder/AimerViewfinderDotColor.swift | 94a3f20fd668a34e4663839810b68f2574c8a80e | [] | no_license | sicklessteven/datacapture-ios-samples | b18f92bb18316ac210fac5169669a87835c264b7 | b18f52a30a55be2ad379a50fde7eb7103a86e154 | refs/heads/master | 2023-02-15T00:24:30.262787 | 2021-01-14T20:06:57 | 2021-01-14T20:06:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,064 | swift | /*
* 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
enum AimerViewfinderDotColor: CaseIterable, CustomStringConvertible {
case `default`, blue, red
var description: String {
switch self {
case .default: return "Default"
case .blue: return "Blue"
case .red: return "Red"
}
}
var uiColor: UIColor {
switch self {
case .default: return SettingsManager.current.defaultAimerViewfinderDotColor
case .blue: return .blue
case .red: return .red
}
}
}
| [
-1
] |
2609f05049d06e3ca2ac48662e821e63b0625b7c | 34811d6c5e64d74e408b9854accdb263f5993d30 | /SafeSpace/SafeSpace/controllers/viewControllers/PlacesTableViewController.swift | b11fb0a6b02f2f994e009363f6d890b7f7bfc0ca | [] | no_license | deltas2k/SafeSpace | 0422b4bf5ecf5519932834791fdaabbcfccf5054 | 606bda45426f093f5d4e27885623ef3176331350 | refs/heads/master | 2020-08-29T02:33:25.039808 | 2019-11-16T17:21:29 | 2019-11-16T17:21:29 | 217,895,839 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 5,286 | swift | //
// PlacesTableViewController.swift
// SafeSpace
//
// Created by Matthew O'Connor on 11/11/19.
// Copyright © 2019 Matthew O'Connor. All rights reserved.
//
import UIKit
class PlacesTableViewController: UITableViewController {
let places: [Places] = []
@IBOutlet weak var placesButton: UIBarButtonItem!
override func viewDidLoad() {
super.viewDidLoad()
self.loadData()
}
@IBAction func placesButtonTapped(_ sender: Any) {
// presentAlertController(for: nil)
}
override func viewWillAppear(_ animated: Bool) {
tableView.reloadData()
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return PlacesController.sharedPlaces.places.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "placesCell", for: indexPath)
let place = PlacesController.sharedPlaces.places[indexPath.row]
cell.textLabel?.text = place.placesName
cell.detailTextLabel?.text = place.placesComment
return cell
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let placeToUpdate = PlacesController.sharedPlaces.places[indexPath.row]
//presentAlertController(for: placeToUpdate)
}
// Override to support editing the table view.
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
let placeToDelete = PlacesController.sharedPlaces.places[indexPath.row]
guard let index = PlacesController.sharedPlaces.places.firstIndex(of: placeToDelete) else {return}
PlacesController.sharedPlaces.delete(placeToDelete) { (success) in
if success {
PlacesController.sharedPlaces.places.remove(at: index)
DispatchQueue.main.async {
tableView.deleteRows(at: [indexPath], with: .automatic)
}
}
}
}
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "toDetailVC" {
if let detailVC = segue.destination as? PlacesDetailViewController,
let selectedRow = tableView.indexPathForSelectedRow?.row {
let places = PlacesController.sharedPlaces.places[selectedRow]
detailVC.places = places
}
}
}
// MARK: - Methods
/*
func presentAlertController(for place: Places?) {
let alertcontroller = UIAlertController(title: "Enter a favorite place", message: "One of you favorite spots that you can relax", preferredStyle: .alert)
alertcontroller.addTextField { (textfield) in
textfield.placeholder = "Enter the place here"
textfield.autocorrectionType = .yes
textfield.autocapitalizationType = .sentences
if let place = place {
textfield.text = place.placesName
}
}
alertcontroller.addTextField { (textfield) in
textfield.placeholder = "Why is place important?"
textfield.autocorrectionType = .yes
textfield.autocapitalizationType = .sentences
if let place = place {
textfield.text = place.placesComment
}
}
let postAction = UIAlertAction(title: "Save", style: .default) { (_) in
guard let placeName = alertcontroller.textFields?[0].text,
let placeComment = alertcontroller.textFields?[1].text,
!placeName.isEmpty else {return}
if let place = place {
place.placesName = placeName
place.placesComment = placeComment
PlacesController.sharedPlaces.updatePlaces(place) { (success) in
DispatchQueue.main.async {
self.tableView.reloadData()
}
}
} else {
PlacesController.sharedPlaces.savePlaces(with: placeName, placeComment: placeComment, completion: { (success) in
if success {
DispatchQueue.main.async {
self.tableView.reloadData()
}
}
})
}
}
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
alertcontroller.addAction(postAction)
alertcontroller.addAction(cancelAction)
present(alertcontroller, animated: true)
}*/
func updateViews() {
DispatchQueue.main.async {
self.tableView.reloadData()
}
}
func loadData() {
PlacesController.sharedPlaces.fetchPlaces { (success) in
if success {
self.updateViews()
}
}
}
}
| [
-1
] |
a1601524639154382382d324fe93d2090ac76352 | 006667dff25056435b15f35320fd55aeb4a09dfd | /Example/BLAMPayment/MenuViewController.swift | 04a6facde5950110373394d5138f937ba08529e5 | [
"MIT"
] | permissive | petetodd/BLAMPayment | 21d7ddbe9209a2ba45c9af7e7b25296c80b64ec2 | 81233eadf804a7f056ab79566eca1bdcd8adac7b | refs/heads/master | 2021-01-21T17:56:38.472222 | 2019-05-24T08:14:22 | 2019-05-24T08:14:22 | 66,277,431 | 0 | 0 | MIT | 2019-05-24T08:14:23 | 2016-08-22T13:59:22 | Swift | UTF-8 | Swift | false | false | 1,790 | swift | //
// MenuViewController.swift
// BLAMPayment
//
// Created by Peter Todd Air on 16/10/2016.
// Copyright © 2016 CocoaPods. All rights reserved.
//
import UIKit
enum DisplayOption {
case normal
case subscribe
case subscribeText
}
class MenuViewController: UIViewController {
var displayOption = DisplayOption.normal
var paymentTypeText : String?
@IBOutlet weak var txtCustom: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if (segue.identifier == "segueShowSelector")
{
let destVC = segue.destination as! ViewController
destVC.displayOption = self.displayOption
if paymentTypeText != nil{
destVC.paymentTypeText = self.paymentTypeText
}
}
}
@IBAction func butDefaultAction(_ sender: AnyObject) {
displayOption = DisplayOption.normal
performSegue(withIdentifier: "segueShowSelector", sender: self)
}
@IBAction func butSubscribeTextAction(_ sender: AnyObject) {
displayOption = DisplayOption.subscribeText
if (txtCustom.text?.count ?? 0 > 0){
paymentTypeText = txtCustom.text
}else {
paymentTypeText = ""
}
performSegue(withIdentifier: "segueShowSelector", sender: self)
}
}
| [
-1
] |
ea85bc054edbb096134c14abee37c9c50395b141 | 2b4d226ce9c1c47cf09762ed3c3d4ac64dce7989 | /EncryptionTests/EncryptionTests.swift | ff963647a66e079b2a4df3b6ff00ac830b82249e | [
"MIT"
] | permissive | Z-JaDe/Encryption | e75519f5892b34ce0fd039befd1d5fdf5aee3092 | af9772c9bceaa951485fb7426869681ae151b8dc | refs/heads/master | 2021-06-23T11:34:03.449492 | 2021-06-19T07:52:45 | 2021-06-19T07:52:45 | 153,754,290 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 876 | swift | //
// EncryptionTests.swift
// EncryptionTests
//
// Created by Apple on 2019/7/26.
// Copyright © 2019 zjade. All rights reserved.
//
import XCTest
class EncryptionTests: XCTestCase {
override func setUp() {
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
| [
360462,
229413,
204840,
344107,
155694,
253999,
229430,
163896,
180280,
376894,
352326,
254027,
163917,
196691,
278618,
385116,
237663,
254048,
319591,
221290,
319598,
204916,
131189,
131191,
196760,
426138,
377009,
295098,
278742,
139479,
229597,
311519,
205035,
327929,
344313,
147717,
368905,
254226,
368916,
262421,
377114,
237856,
237857,
311597,
98610,
336183,
180535,
164162,
319821,
344401,
377169,
368981,
155990,
368984,
98657,
270701,
246127,
270706,
246136,
246137,
139640,
311685,
106888,
385417,
311691,
385422,
213403,
246178,
385454,
377264,
278961,
278965,
319930,
311738,
33211,
336317,
336320,
311745,
254406,
188871,
328152,
287198,
319981,
254456,
377338,
377343,
254465,
139792,
303636,
393751,
377376,
377386,
197167,
385588,
115270,
385615,
426576,
369235,
139872,
344680,
189036,
189037,
295535,
189042,
189043,
139892,
287352,
344696,
311941,
336518,
311945,
369289,
344715,
311949,
287374,
377489,
311954,
352917,
230040,
271000,
377497,
303771,
377500,
205471,
344738,
139939,
205487,
303793,
336564,
287417,
287422,
377539,
164560,
385747,
361176,
418520,
287452,
279269,
369385,
312052,
312053,
172792,
344827,
221948,
205568,
295682,
336648,
197386,
434957,
312079,
426774,
197399,
426775,
369432,
336671,
197411,
295724,
353069,
197422,
353070,
164656,
295729,
353078,
197431,
336702,
353094,
353095,
353109,
377686,
230234,
189275,
435039,
295776,
303972,
385893,
246641,
246643,
295798,
361337,
254850,
369538,
213894,
295824,
140204,
377772,
304051,
230332,
287677,
377790,
353215,
353216,
213957,
345033,
386006,
418776,
50143,
123881,
320494,
271350,
295927,
320507,
328700,
328706,
410627,
320516,
295942,
386056,
353290,
377869,
238610,
418837,
140310,
320536,
336929,
369701,
238639,
312373,
238651,
336960,
377926,
156764,
304222,
173166,
377972,
353397,
337017,
377983,
402565,
386189,
238743,
238765,
238769,
402613,
353479,
353482,
402634,
189653,
419029,
148696,
296153,
304351,
222440,
328940,
353523,
386294,
386301,
320770,
386306,
328971,
353551,
320796,
222494,
353584,
345396,
386359,
345402,
312634,
378172,
312648,
337225,
304456,
230729,
238927,
353616,
222548,
378209,
386412,
312689,
296307,
116084,
337281,
148867,
296329,
296335,
9619,
206228,
370071,
370091,
173491,
304564,
353719,
361927,
271843,
296433,
329225,
296461,
304656,
329232,
370197,
402985,
394794,
312880,
288309,
312889,
288327,
239198,
99938,
345700,
312940,
222832,
337534,
337535,
263809,
288392,
239250,
419478,
337591,
403148,
9936,
9937,
370388,
272085,
345814,
181975,
345821,
321247,
321249,
345833,
345834,
67315,
173814,
288512,
288516,
321302,
345879,
321310,
255776,
247590,
362283,
378668,
296755,
345919,
436031,
403267,
345929,
18262,
362327,
345951,
362337,
345955,
296806,
214895,
313199,
362352,
182144,
305026,
247686,
329622,
337815,
436131,
436137,
362417,
362431,
174019,
214984,
362443,
329695,
436191,
313319,
174057,
436205,
329712,
362480,
43014,
354316,
313357,
223268,
329765,
346162,
288828,
436285,
288833,
288834,
436292,
403525,
436301,
338001,
338003,
280661,
329814,
338007,
223318,
280675,
329829,
321637,
280677,
43110,
436329,
215164,
215166,
280712,
346271,
436383,
362659,
239793,
182456,
379071,
338119,
149703,
346314,
321745,
387296,
280802,
379106,
338150,
346346,
321772,
436470,
149760,
411906,
313608,
272658,
338197,
338218,
321840,
379186,
321860,
289110,
215385,
354655,
354676,
436608,
362881,
248194,
240002,
436611,
108944,
190871,
149916,
420253,
141728,
289189,
108972,
272813,
338356,
436661,
281037,
289232,
256477,
330218,
109042,
174593,
420369,
207393,
289332,
174648,
338489,
338490,
322120,
297560,
436832,
436834,
420463,
346737,
313971,
346740,
420471,
330379,
133774,
117396,
346772,
264856,
289434,
346779,
314040,
109241,
248517,
363211,
363230,
264928,
330474,
289518,
322291,
191235,
117517,
322319,
166676,
207640,
289576,
191283,
273207,
289598,
109409,
330609,
207732,
158593,
240518,
109447,
224145,
355217,
256922,
289690,
240544,
420773,
289703,
363438,
347055,
289727,
273344,
330689,
363458,
379844,
19399,
248796,
347103,
412651,
347123,
240630,
257024,
330754,
330763,
322582,
248872,
314448,
339030,
314467,
257125,
273515,
281707,
404593,
363641,
363644,
150657,
248961,
330888,
347283,
363669,
339100,
380061,
429214,
199839,
265379,
249002,
306346,
3246,
421048,
339130,
322749,
265412,
290000,
298208,
298212,
298213,
330984,
298221,
298228,
437505,
322824,
257305,
126237,
339234,
208164,
372009,
412971,
306494,
216386,
224586,
142669,
331090,
314710,
372054,
159066,
314720,
281962,
380271,
249204,
249205,
208244,
290173,
306559,
314751,
298374,
314758,
314760,
142729,
388487,
314766,
290207,
314783,
314789,
314791,
396711,
396712,
241066,
314798,
380337,
380338,
150965,
380357,
339398,
306639,
413137,
429542,
191990,
372227,
323080,
323087,
323089,
175639,
388632,
396827,
134686,
347694,
265798,
265804,
396882,
44635,
396895,
323172,
224883,
314998,
323196,
339584,
192131,
323207,
323236,
298661,
61101,
224946,
110268,
224958,
323263,
274115,
306890,
241361,
241365,
298720,
339715,
339720,
372496,
323346,
241441,
339745,
241442,
257830,
421672,
315202,
159562,
216918,
241495,
241528,
339841,
315273,
315274,
372626,
380821,
44952,
118685,
298909,
323507,
290745,
274371,
151497,
372701,
298980,
380908,
241692,
315432,
315434,
102445,
233517,
176175,
241716,
241720,
225351,
315465,
307289,
200794,
315487,
356447,
315497,
315498,
438377,
233589,
266357,
422019,
241808,
381073,
184475,
299174,
405687,
258239,
389313,
299203,
299209,
372941,
266449,
356576,
307435,
438511,
381172,
12542,
184575,
381208,
151839,
233762,
217380,
332083,
127284,
332085,
332089,
438596,
332101,
323913,
348492,
323920,
348500,
168281,
332123,
332127,
242023,
160110,
242033,
250226,
291192,
340357,
225670,
332167,
242058,
373134,
242078,
315810,
315811,
381347,
340398,
127427,
324039,
373197,
242139,
160225,
242148,
127465,
291311,
324097,
291333,
340490,
258581,
234036,
315960,
348732,
242237,
70209,
348742,
70215,
348749,
340558,
381517,
332378,
201308,
242273,
242277,
111208,
184940,
373358,
389745,
209530,
373375,
152195,
348806,
184973,
316049,
111253,
316053,
111258,
111259,
332446,
176808,
299699,
422596,
422599,
291530,
225995,
242386,
422617,
422626,
234217,
299759,
291585,
430849,
291592,
62220,
422673,
430865,
291604,
422680,
152365,
422703,
422709,
152374,
160571,
430910,
160575,
160580,
381773,
201551,
242529,
349026,
357218,
308076,
242541,
177019,
185211,
308092,
398206,
291712,
381829,
226181,
316298,
349072,
390045,
127902,
185250,
185254,
275371,
373687,
373706,
316364,
340961,
340974,
349175,
201720,
127992,
357379,
275469,
324625,
308243,
357414,
300084,
324666,
308287,
218186,
250956,
341073,
439384,
275547,
250981,
300135,
316520,
316526,
357486,
144496,
275571,
300150,
291959,
300151,
160891,
300158,
349316,
349318,
275591,
373903,
169104,
177296,
275607,
324760,
119962,
300187,
300188,
275620,
300201,
300202,
275625,
226481,
373945,
259268,
283852,
283853,
259280,
333011,
316627,
234742,
120056,
128251,
439562,
292107,
414990,
251153,
177428,
349462,
382258,
300343,
382269,
226624,
177484,
406861,
259406,
234831,
374109,
333160,
243056,
316787,
226675,
275831,
357762,
112017,
112018,
234898,
259475,
275859,
357786,
251298,
333220,
316842,
374191,
210358,
300489,
366037,
210390,
210391,
210392,
210393,
144867,
103909,
54765,
251378,
308723,
333300,
333303,
300536,
259599,
316946,
308756,
398869,
374296,
374299,
308764,
333343,
431649,
169518,
431663,
194110,
349763,
128583,
218696,
292425,
243274,
128587,
333388,
276045,
333393,
276050,
128599,
333408,
300644,
415338,
243307,
120427,
54893,
325231,
276085,
325245,
276097,
194180,
415375,
276116,
153251,
300714,
210603,
415420,
276156,
333503,
333509,
259781,
333517,
333520,
333523,
325346,
333542,
153319,
325352,
276211,
325371,
243472,
366360,
325404,
341796,
399147,
431916,
300848,
259899,
325439,
325445,
153415,
341836,
415567,
325457,
317269,
341847,
350044,
128862,
292712,
325484,
423789,
325492,
276341,
341879,
317304,
333688,
276344,
112509,
325503,
55167,
227199,
333701,
243591,
317323,
325518,
333722,
350109,
292771,
333735,
415655,
276401,
243637,
301008,
153554,
292836,
292837,
317415,
325619,
432116,
333817,
292858,
415741,
333828,
358410,
399373,
317467,
145435,
325674,
129076,
243767,
358456,
325694,
276577,
276582,
194666,
260207,
432240,
276592,
276606,
415881,
104587,
235662,
325776,
317587,
276627,
284826,
227492,
333991,
333992,
227528,
276687,
334042,
194782,
301279,
317664,
243962,
375039,
276737,
325905,
276753,
325912,
276764,
211235,
432421,
211238,
325931,
358703,
358709,
366930,
6482,
276831,
383332,
383336,
211326,
317831,
252308,
317852,
121245,
276900,
342450,
334260,
293303,
293310,
416197,
129483,
342476,
317901,
342498,
358882,
334309,
391655,
432618,
375276,
186893,
416286,
375333,
244269,
375343,
23092,
375351,
244281,
301634,
301638,
309830,
293448,
55881,
416341,
244310,
416351,
268899,
277094,
244327,
39530,
244347,
326287,
375440,
334481,
318106,
318107,
342682,
318130,
383667,
293556,
285372,
39614,
285374,
334547,
203478,
375526,
342762,
342763,
293612,
154359,
432893,
162561,
383754,
326414,
310036,
326429,
293664,
326433,
400166,
293672,
277289,
375609,
342847,
277316,
252741,
277325,
293711,
244568,
244570,
351077,
342887,
277360,
277366,
269178,
400252,
359298,
359299,
260996,
277381,
113542,
392074,
326553,
318364,
310176,
310178,
293800,
236461,
326581,
326587,
277435,
326601,
359381,
433115,
343005,
326635,
187374,
383983,
318461,
293886,
277505,
293893,
433165,
384016,
433174,
326685,
252958,
310317,
203830,
359478,
277563,
7229,
7231,
392290,
277603,
253029,
318572,
351344,
285814,
392318,
384131,
302216,
277640,
326804,
351390,
277665,
253099,
253100,
318639,
367799,
113850,
294074,
277690,
302274,
367810,
195808,
310497,
302325,
261377,
204041,
245019,
253216,
277792,
277800,
130348,
261425,
351537,
171317,
318775,
286013,
15686,
146762,
294218,
294219,
318805,
425304,
163175,
327024,
327025,
277883,
318848,
253317,
384393,
368011,
318864,
318868,
310692,
277925,
245161,
277936,
286129,
286132,
228795,
425405,
302531,
425418,
310748,
286172,
286202,
359930,
302590,
253451,
359950,
146964,
253463,
286244,
245287,
245292,
228917,
196164,
179801,
196187,
147036,
343647,
310889,
204397,
138863,
188016,
278140,
294529,
229001,
188048,
425626,
278170,
302754,
245412,
40614,
278195,
384695,
319162,
327358,
212685,
384720,
245457,
302802,
212716,
212717,
360177,
319233,
360195,
278285,
286494,
409394,
319292,
360252,
360264,
376669,
245599,
425825,
425833,
417654,
188292,
294807,
376732,
311199,
319392,
294823,
327596,
294843,
188348,
237504,
294850,
384964,
344013,
212942,
24532,
327661,
311281,
311282
] |
1bacb7c2829b30f4199646883928901f2727d070 | 59912081646c9ac800a24cd5db293fbfaf8ab6e5 | /Marshroute/Sources/Transitions/TransitionAnimationsLaunching/AnimationsLaunching/AnimationLaunchingContextBoxes/ResettingAnimationLaunchingContextBox.swift | 52fde88e62e30a39053fbe4178a43016a4b9ba0a | [
"MIT"
] | permissive | jormungand/Marshroute | 5b6e95c3d10612df95e39b4537ff208e44d3098e | 4af78ad2787995cb68697f81613515da8770696a | refs/heads/master | 2021-01-21T00:17:56.531854 | 2016-06-13T08:02:45 | 2016-06-13T08:02:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,633 | swift | import UIKit
/// Описание параметров запуска reset-анимаций
public enum ResettingAnimationLaunchingContextBox {
case SettingNavigationRoot(launchingContext: SettingAnimationLaunchingContext)
case ResettingNavigationRoot(launchingContext: ResettingAnimationLaunchingContext)
case Registering
case RegisteringEndpointNavigation
public var resettingTransitionsAnimatorBox: ResettingTransitionsAnimatorBox
{
switch self {
case .SettingNavigationRoot(let launchingContext):
return .SettingNavigationRoot(animator: launchingContext.animator)
case .ResettingNavigationRoot(let launchingContext):
return .ResettingNavigationRoot(animator: launchingContext.animator)
case .Registering:
return .Registering
case .RegisteringEndpointNavigation:
return .RegisteringEndpointNavigation
}
}
public mutating func appendSourceViewController(sourceViewController: UIViewController)
{
switch self {
case .SettingNavigationRoot(_):
break // has no source view controller property
case .ResettingNavigationRoot(var launchingContext):
launchingContext.sourceViewController = sourceViewController
self = .ResettingNavigationRoot(launchingContext: launchingContext)
case .Registering:
break // no need for animations
case .RegisteringEndpointNavigation:
break // no need for animations
}
}
} | [
-1
] |
994c6ec4b9b99e794eb2f783623a0d1cf3650cc1 | 54754ecc51ec580d70e2c9b716ed140f21e2d991 | /tippy/ColorExtension.swift | 0bf3ea9dec2b2dce96a77cb14ee075c8f8170ec6 | [
"Apache-2.0"
] | permissive | etty427/TipCalculator | 36a661ff661f0c5e10e1ca92a9cae3567aaadabf | d838af9011e8774315ccb9b380beebff3c963a8d | refs/heads/master | 2021-01-19T02:00:18.038573 | 2017-05-12T23:36:57 | 2017-05-12T23:36:57 | 84,400,650 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 774 | swift | //
// ColorExtension.swift
// tippy
//
// Created by Ty rainey on 3/10/17.
// Copyright © 2017 Rainman Technologies. All rights reserved.
//
import Foundation
import UIKit
extension UserDefaults {
func colorForKey(_ key: String) -> UIColor {
var color: UIColor?
if let colorData = data(forKey: key) {
color = NSKeyedUnarchiver.unarchiveObject(with: colorData) as? UIColor
}
return color!
}
func setColor(_ color: UIColor?, forKey key: String) {
var colorData: NSData?
if let color = color {
colorData = NSKeyedArchiver.archivedData(withRootObject: color) as NSData?
}
set(colorData, forKey: key)
}
}
| [
-1
] |
c940028bf44969447121981b83145018df1b6148 | ed582f4e3e0fe9aed6ae915d83db111ba9359c7c | /rtf/_store/effects/statistics.effect.swift | 78efdb160ac797f209e6c0944ece978731a3e8cd | [] | no_license | antonkokorev/rtf | 376ba5ab2812fe8b29fc29a44658be29c21c1116 | 96c4c8da248f83d039a8801dcf5a7cdded52add4 | refs/heads/master | 2020-11-30T15:06:36.012183 | 2020-02-03T09:39:25 | 2020-02-03T09:39:25 | 230,424,911 | 0 | 0 | null | 2020-02-02T16:35:14 | 2019-12-27T10:35:45 | Swift | UTF-8 | Swift | false | false | 2,704 | swift | //
// search.effect.swift
// rtf
//
// Created by Anton Elistratov on 16.01.2020.
// Copyright © 2020 team. All rights reserved.
//
import Foundation
import ReSwift
import Alamofire
struct IAttrResponce: Codable, Hashable {
let aObjects:[IAttr]
}
func stringify(json: Any, prettyPrinted: Bool = false) -> String {
var options: JSONSerialization.WritingOptions = []
if prettyPrinted {
options = JSONSerialization.WritingOptions.prettyPrinted
}
do {
let data = try JSONSerialization.data(withJSONObject: json, options: options)
if let string = String(data: data, encoding: String.Encoding.utf8) {
return string
}
} catch {
print(error)
}
return ""
}
var statisticsEffect: Middleware<AppState> = { dispatch, getState in
return { next in
return { action in
guard let statisticsAction = action as? statisticsActions else {
next(action)
return
}
/* делает реквест только если pending вызвано */
switch statisticsAction {
case .pendingGetStatisticsAttributes(let id):
AF.request(Interceptor.serviceRequest(service: "assessment/getItemsForAttributeStatistic",body: stringify(json: ["iSize": 10, "iPage":0, "sAttributeId":id]))).response { response in
/* обработка ошибок */
switch response.error {
case .none:
let data = try? JSONDecoder().decode(IAttrResponce.self, from: response.data!)
next(statisticsActions.successGetStatisticsAttributes(data!.aObjects))
case .some(let error):
print(error)
}
}
break
case .pendingGetStatisticsCompetencies(let period):
AF.request(Interceptor.serviceRequest(service: "assessment/getStatisticsForCompetencies",body: stringify(json: ["sDatePeriod": period]))).response { response in
/* обработка ошибок */
switch response.error {
case .none:
let data = try? JSONDecoder().decode(IStatColl.self, from: response.data!)
next(statisticsActions.successGetStatisticsCompetencies(data!))
case .some(let error):
print(error)
}
}
break
default:
break
}
}
}
}
| [
-1
] |
e4ec6bf2c376d82afd326cb9a16df457ae6061c2 | c333fcd3cf5ebeb3b033dbe8b5069da9acb8bf47 | /Sources/DMS/v3/ApiModels/Generated/DMS/Resources/DMSAttachSupplementaryFileResource.swift | 774e3895a433d8e62d09fcf0dc6ecfd487b3200a | [
"Apache-2.0"
] | permissive | tokend/ios-sdk | 11303690b01ea59da69034ed1879cd3730408c18 | 6aff90d20474dcfcac8536a74d7e49e7ff28afb2 | refs/heads/master | 2023-06-25T10:14:57.218808 | 2022-03-10T16:59:04 | 2022-03-10T16:59:04 | 153,674,582 | 13 | 2 | Apache-2.0 | 2022-09-26T14:03:56 | 2018-10-18T19:09:29 | Swift | UTF-8 | Swift | false | false | 968 | swift | // Auto-generated code. Do not edit.
import Foundation
import DLJSONAPI
// MARK: - AttachSupplementaryFileResource
extension DMS {
open class AttachSupplementaryFileResource: Resource {
open override class var resourceType: String {
return "attach_supplementary_file"
}
public enum CodingKeys: String, CodingKey {
// attributes
case comment
case file
case fileChanges
case fileName
}
// MARK: Attributes
open var comment: String? {
return self.stringOptionalValue(key: CodingKeys.comment)
}
open var file: [String: Any] {
return self.dictionaryOptionalValue(key: CodingKeys.file) ?? [:]
}
open var fileChanges: [String: Any]? {
return self.dictionaryOptionalValue(key: CodingKeys.fileChanges)
}
open var fileName: String {
return self.stringOptionalValue(key: CodingKeys.fileName) ?? ""
}
}
}
| [
-1
] |
e00998e41d9e9f4d513790f9ec9b901daa4b52c7 | 45ac006b017e96dbcf7917b3de35ebb0a00cd664 | /EnginnerApp/SearchViewController.swift | 53a7e4ee20b285e167b6c015c269ce2887f9212f | [] | no_license | MMaciejewski1/ForumForStudent | e2b89ac7f935adadff2d47df39e234030c1ae652 | a2ffe9d7257f76ad25ab26a290a0177133f73f8b | refs/heads/master | 2022-04-08T13:03:59.219353 | 2020-03-12T11:17:21 | 2020-03-12T11:17:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 9,712 | swift | //
// SearchViewController.swift
// EnginnerApp
//
// Created by majkel on 24.01.2018.
// Copyright © 2018 majkel. All rights reserved.
//
import UIKit
import QRCode
class SearchViewController: UIViewController,UITableViewDelegate,UITableViewDataSource {
var thinkToSearch = ""
var circle : Array<CircleModel> = Array<CircleModel>()
var top : Array<TopicModel> = Array<TopicModel>()
var id = 1
@IBAction func searchClick(_ sender: Any) {
if thinkToSearch == "topic" {
searchTopic(howMany: String(10), name: searchTextField.text!, id: String(id)){ circle in DispatchQueue.main.async {
self.top = circle
self.topicTableView.reloadData()
}
}}
if thinkToSearch == "circle" {
searchCircle(howMany: String(10), name: searchTextField.text!, description: searchTextField.text!){circle in
DispatchQueue.main.async {
self.circle = circle
self.circleTableView.reloadData()
}
}
}
}
@IBOutlet weak var qrGeneratedView: UIView!
@IBOutlet weak var qrGenerated: UIImageView!
@IBAction func dissQr(_ sender: Any){
qrGeneratedView.isHidden = true
}
var qrt = ""
func shareButton(sender: UIButton){
let index = sender.tag
if qrt == "circle"{
let qrCode = QRCode("DMTAPP;Circle;Red;\(index)")
qrGenerated.image = qrCode?.image
qrGeneratedView.isHidden = false
}
else {
//topic
let qrCode = QRCode("DMTAPP;Topic;Red;\(index)")
qrGenerated.image = qrCode?.image
qrGeneratedView.isHidden = false
}
}
@IBAction func dissClick(_ sender: Any) {
dismiss(animated: true, completion: nil)
}
@IBOutlet weak var searchTextField: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
circleTableView.delegate = self
circleTableView.dataSource = self
topicTableView.delegate = self
topicTableView.dataSource = self
circleTableView
.estimatedRowHeight = 44.0
circleTableView.rowHeight = UITableViewAutomaticDimension
topicTableView.estimatedRowHeight = 44.0
topicTableView.rowHeight = UITableViewAutomaticDimension
if thinkToSearch == "topic" {
circleTableView.isHidden = true
topicTableView.isHidden = false
}
if thinkToSearch == "circle" {
circleTableView.isHidden = false
topicTableView.isHidden = true
}
// Do any additional setup after loading the view.
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cellIdentifier = "Cell"
let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier) as! CustomCell
if tableView == self.circleTableView {
cell.NumberFollowerLabelCircle.text = String(circle[indexPath.item].countSubbed)
let date = String(describing: (circle[indexPath.item].publishDate))
let str = date.substring(to: date.index(date.startIndex, offsetBy: 11))
cell.DateLabelCircle.text = str
qrt = "circle"
cell.circleSearchShare.tag = indexPath.item
cell.circleSearchShare.addTarget(self, action: #selector(SearchViewController.shareButton), for: .touchUpInside)
var encoded = circle[indexPath.item].author.avatar as String
if encoded.characters.count > 1 {
if encoded.characters.count > 100 {
let ind = encoded.startIndex
encoded = encoded[encoded.index(ind,offsetBy: 22) ..< encoded.endIndex ]
if let imageData = Data(base64Encoded: encoded , options: .ignoreUnknownCharacters){
let image = UIImage(data : imageData as Data)
cell.ImageViewCircle.image = image
}
}
else {
let url = URL(string: encoded)
let data = try? Data(contentsOf: url!)
cell.ImageViewCircle.image = UIImage(data: data!)
}
}
cell.NumberTopicsLabelCircle.text = String(circle[indexPath.item].countTopic)
cell.AuthorLabelCircle.text = circle[indexPath.item].author.lastName
cell.ContentLabelCircle.text = circle[indexPath.item].description
cell.ContentLabelCircle.sizeToFit()
cell.NameLabelCircle.text = circle[indexPath.item].name
cell.ImageViewCircle.layer.cornerRadius = cell.ImageViewCircle.frame.size.width / 2
cell.ImageViewCircle.clipsToBounds = true
cell.cardViewCircle()
}
if tableView == self.topicTableView {
qrt = "topic"
cell.topicSearchShare.tag = indexPath.item
cell.topicSearchShare.addTarget(self, action: #selector(SearchViewController.shareButton), for: .touchUpInside)
cell.CountSubTopic.text = String(top[indexPath.item].countSubbed)
let date = String(describing: (top[indexPath.item].publishDate))
let str = date.substring(to: date.index(date.startIndex, offsetBy: 11))
cell.dateTopic.text = str
cell.nameTopic.text = top[indexPath.item].name
cell.countAnswTopic.text = String(top[indexPath.item].countAnswer)
cell.contentTopic.text = top[indexPath.item].description
cell.authorTopic.text = top[indexPath.item].author.lastName
cell.cardViewTopic()
var encoded = top[indexPath.item].author.avatar as String
if encoded.characters.count > 1 {
if encoded.characters.count > 100 {
let ind = encoded.startIndex
encoded = encoded[encoded.index(ind,offsetBy: 22) ..< encoded.endIndex ]
if let imageData = Data(base64Encoded: encoded , options: .ignoreUnknownCharacters){
let image = UIImage(data : imageData as Data)
cell.imageTopic.image = image
}
}
else {
let url = URL(string: encoded)
let data = try? Data(contentsOf: url!)
cell.imageTopic.image = UIImage(data: data!)
}
cell.imageTopic.layer.cornerRadius = cell.imageTopicSub.frame.size.width / 2
cell.imageTopic.clipsToBounds = true}
}
return cell
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView == self.circleTableView { return circle.count
}
else
{
return top.count
}
}
var typeSeg = ""
//answerSegue
var row : String?
var isSubC : Int?
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath){
// let e = ExampleMessengerViewController()
// e.bootstrapWithRandomMessages = 6
// navigationController?.pushViewController(e, animated: true)
// present(e,animated:true,completion:nil)
if tableView == self.circleTableView {
row = circle[indexPath.item].name
id = circle[indexPath.item].idCircle
isSubC = circle[indexPath.item].isSubbed
thinkToSearch = "circle"
performSegue(withIdentifier: "searchTopicInCircleSegue", sender: self)
}
if tableView == self.topicTableView {
row = top[indexPath.item].name
id = top[indexPath.item].idCircle
isSubC = top[indexPath.item].isSubbed
thinkToSearch = "topic"
performSegue(withIdentifier: "searchAnswerInTopicSegue", sender: self)
}
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if thinkToSearch == "circle"{
let dest: TopicViewController = segue.destination as! TopicViewController
dest.idCircle = id
dest.nameCircle = row!
dest.isSubC = isSubC!
}
if thinkToSearch == "topic"{
let dest: AnswerViewController = segue.destination as! AnswerViewController
dest.idTopic = id
dest.nameTopic = row
dest.isSub = isSubC
}
}
@IBOutlet weak var circleTableView: UITableView!
@IBOutlet weak var topicTableView: UITableView!
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
] |
275746ced26997a4a26cdefab712357137b934ca | 6dd580c748f0f9093cecc364e45005fd1aebf075 | /CountWithFriends/RoundHandler.swift | a758ceaaae240261277955c87ba5bccdcb1f9afb | [] | no_license | andrewbihl/CountWithFriends | 12d065b2f0e3dcace0529f3856d1067a9e908c72 | 21417d70375064a455a36cd2fd4ad318acbc115d | refs/heads/master | 2020-04-06T07:08:25.430652 | 2016-09-15T16:26:36 | 2016-09-15T16:26:36 | 62,065,577 | 2 | 0 | null | 2016-07-17T22:40:43 | 2016-06-27T15:12:52 | Swift | UTF-8 | Swift | false | false | 10,198 | swift | //
// RoundHandler.swift
// CountWithFriends
//
// Created by Andrew Bihl on 6/27/16.
// Copyright © 2016 Andrew Bihl. All rights reserved.
//
import UIKit
import Foundation
//Object created when a new round is begun in the user interface.
class RoundHandler: NSObject {
var target: Int?
var inputNumbers: Array<Int>?
var myMatchData: NSData?{
didSet(newValue){
generateMyMatchDataDict()
}
}
var myMatchDataDict: Dictionary<String,AnyObject>?
var localPlayerIsPlayer0: Bool?
var opponentDisplayName: String?
func startNewRound(numberOfInputValues: Int)->(){
generateMyMatchDataDict()
if localPlayerIsPlayer0!{
var currentRoundInputs = Dictionary<String,AnyObject>()
//localPlayerIsPlayer0 --> it's a new round. Generate new numbers.
let generatedInputs = generateNewInputValues(numberOfInputValues)
target = generatedInputs.target
inputNumbers = generatedInputs.inputNumbers
currentRoundInputs.updateValue(target!, forKey: "target")
currentRoundInputs.updateValue(inputNumbers!, forKey: "inputNumbers")
//Set up matchData for new game
if myMatchData?.length == 0{
print("MatchData is nil")
myMatchDataDict?.updateValue([currentRoundInputs], forKey: "roundInputs")
}
else{
var existingRoundInputs = myMatchDataDict!["roundInputs"] as! Array<Dictionary<String,AnyObject>>
existingRoundInputs.append(currentRoundInputs)
myMatchDataDict?.updateValue(existingRoundInputs, forKey: "roundInputs")
}
}
else{
// generateMyMatchDataDict()
let roundInputs = myMatchDataDict!["roundInputs"] as! Array<Dictionary<String,AnyObject>>
let lastRoundInputs = roundInputs.last
target = lastRoundInputs!["target"] as! Int
inputNumbers = lastRoundInputs!["inputNumbers"] as! [Int]
}
}
func generateMyMatchDataDict(){
myMatchDataDict = NSKeyedUnarchiver.unarchiveObjectWithData(myMatchData!) as? Dictionary<String,AnyObject>
if myMatchDataDict == nil{
myMatchDataDict = Dictionary<String,AnyObject>()
}
if myMatchDataDict!["playerScores"] == nil{
myMatchDataDict?.updateValue([0,0], forKey: "playerScores")
}
}
func generateNewInputValues(numberOfInputValues: Int)->(target: Int, inputNumbers: [Int]){
var targetResult : Int
var inputNumbersResult = Array<Int>()
for _ in 1..<4{
let newSmallNumber = Int(arc4random_uniform(9)+1)
inputNumbersResult.append(newSmallNumber)
}
while inputNumbersResult.count < numberOfInputValues{
//get number divisible by 5 between 10 and 95
let newLargeNumber = Int(arc4random_uniform(18) + 1) * 5 + 5
//No repeated large numbers
if !(inputNumbersResult.contains(newLargeNumber)){
inputNumbersResult.append(newLargeNumber)
}
}
var newTarget = arc4random_uniform(900)
newTarget += 100
targetResult = Int(newTarget)
return (targetResult, inputNumbersResult)
}
func getPreviousRoundOperations()->[Dictionary<String,AnyObject>]?{
let roundOperationsDict = myMatchDataDict!["roundOperations"] as? [Dictionary<String,AnyObject>]
return roundOperationsDict
}
//Return player's score and opponents score, or nil for both if final round was not finished.
//Only called by 2nd player at end of a round
// func getGameFinalScores()->(localPlayerScore: Int?, opponentScore: Int?){
// //Check if just played Round 3
// if (myMatchDataDict!["roundInputs"]!.count >= 3){
// print("END OF GAME!")
// let playerScores = myMatchDataDict!["playerScores"] as! [Int]
// if localPlayerIsPlayer0!{
// return (localPlayerScore: playerScores[0], opponentScore: playerScores[1])
// }else{
// return (localPlayerScore: playerScores[1], opponentScore: playerScores[0])
// }
// }
// else{
// return (localPlayerScore: nil, opponentScore: nil)
// }
// }
func setPlayerOutcomes(localPlayerDidWin: Bool){
GCTurnBasedMatchHelper.sharedInstance.setPlayerOutcomes(localPlayerIsPlayer0!)
}
func getPlayerScores()->[Int]?{
//playerScores value gets initialized on creation of game.
return myMatchDataDict!["playerScores"] as? [Int]
}
func getRoundNumber()->Int{
return myMatchDataDict!["roundInputs"]!.count
}
func getScoreIfRoundComplete(finalResult: Int, timeRemaining: Int)->(currentPlayerDidWin: Bool?, score: Int?){
guard let lastRoundOperations = myMatchDataDict!["roundOperations"]?.lastObject as? Dictionary<String,AnyObject> else{
return (nil, nil)
}
//Check if on new round (current round data not yet stored)
if lastRoundOperations.keys.contains("player1Operations"){
return (nil, nil)
}
else{
//TODO: Calculate score.
let opponentResult = lastRoundOperations["player0Result"] as! Int
let opponentTimeRemaining = lastRoundOperations["player0TimeRemaining"] as! Int
var localPlayerWon = true
let localPlayerDifference = abs(target! - finalResult)
let opponentDifference = abs(target! - opponentResult)
//if tie occured
if localPlayerDifference < opponentDifference{
localPlayerWon = true
}
else if localPlayerDifference > opponentDifference{
localPlayerWon = false
}
else{
if timeRemaining < opponentTimeRemaining{
return (true, opponentTimeRemaining - timeRemaining)
}
else if timeRemaining > opponentTimeRemaining{
return (false, timeRemaining - opponentTimeRemaining)
}
else{
//True tie
return (false, 0)
}
}
var resultDifference = (target! - finalResult)-(target! - opponentResult)
//localPlayer lost or Tied
resultDifference = abs(resultDifference)
var calculatedRoundScore = 100 + (5 * resultDifference)
if localPlayerWon{
calculatedRoundScore = calculatedRoundScore + opponentTimeRemaining - timeRemaining
}
else{
calculatedRoundScore = calculatedRoundScore + timeRemaining - opponentTimeRemaining
}
//Double score on bullseye
if finalResult == target! || opponentResult == target!{
calculatedRoundScore *= 2
}
return (localPlayerWon, calculatedRoundScore)
}
}
func saveRoundData(equations: [String], finalResult: Int, player0ScoreSummand: Int, player1ScoreSummand: Int, timeRemaining: Int){
//Save round information to database.
let qualityOfServiceClass = QOS_CLASS_BACKGROUND
let backgroundQueue = dispatch_get_global_queue(qualityOfServiceClass, 0)
dispatch_async(backgroundQueue, {
GCTurnBasedMatchHelper.sharedInstance.saveRoundData(equations, finalResult: finalResult, player0ScoreSummand: player0ScoreSummand, player1ScoreSummand: player1ScoreSummand, localPlayerIsPlayer0: self.localPlayerIsPlayer0!, currentMatchDataObject: self.myMatchDataDict!, timeRemaining: timeRemaining, roundNumber: self.getRoundNumber())
dispatch_async(dispatch_get_main_queue(), { () -> Void in
print("This is run on the main queue, after the previous code in outer block")
})
})
}
//
// func getScore(userResult : Int) -> (Int){
// return 9001
// }
}
//Use input values to generate a target value
// func generateTarget(){
// target = 0
// var values = Array<Int>()
// for number in inputNumbers!{
// values.append(number)
// }
// target = values[0]
// values.removeAtIndex(0)
// while values.count > 0{
// let randomIndex = Int(arc4random_uniform(UInt32(values.count)))
// let num = values[randomIndex]
// var operatorSelector = arc4random_uniform(6)
// //print(operatorSelector)
// if operatorSelector < 3{
// //Do subtraction if does not create negative
// if target! - num > 0{
// print("Subtracted \(num) from \(target!)")
// target! -= num
// values.removeAtIndex(randomIndex)
// continue
// }
// //otherwise try to do division
// else{
// operatorSelector += 1
// }
// }
// if operatorSelector == 3{
// //if can divide to an integer
// if target! % num == 0{
// print("Divided \(target!) by \(num))")
// target! /= num
// values.removeAtIndex(randomIndex)
// continue
// }
// //otherwise move on to multiplication or addition by adding 1 or 2
// else{
// operatorSelector += arc4random_uniform(2) + 1
// }
// }
// if operatorSelector == 4 && target! * num < 5000{
// print("Multiplied \(target!) by \(num)")
// target! *= num
// values.removeAtIndex(randomIndex)
// continue
// }
// else {
// print("Added \(num) to \(target!)")
// target! += num
// values.removeAtIndex(randomIndex)
// }
//
// }
//
// }
| [
-1
] |
ed468ba504d1390cb99755ed27be9dcb7019f37f | a42c38bc7d005ad89a0314df487acca14ca15aa9 | /GoodAsOldPhones/GoodAsOldPhones/AppDelegate.swift | 17818116a887da1c34fecde8fdd67aef1d8125b5 | [] | no_license | xyyHIT/SwiftProjects | 301191de028dc3ba1742237b238a73b0bc1faea9 | 434c069f835813796668b398a083be07896d06bd | refs/heads/master | 2021-01-02T09:45:17.083605 | 2017-08-11T06:03:30 | 2017-08-11T06:03:30 | 99,289,795 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,178 | swift | //
// AppDelegate.swift
// GoodAsOldPhones
//
// Created by xuyang on 2017/8/4.
// Copyright © 2017年 www.xyy.com. 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,
286774,
286776,
319544,
286778,
204856,
229432,
352318,
286791,
237640,
286797,
278605,
311375,
163920,
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,
286916,
295110,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
303347,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
278983,
319945,
278986,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
172534,
180727,
164343,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
172552,
320007,
287238,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
213575,
172618,
303690,
33357,
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,
312005,
312006,
107208,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
287450,
303835,
279258,
189149,
303838,
213724,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
205564,
303871,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
295720,
303914,
279340,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303981,
303985,
303987,
328563,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
304007,
213895,
304009,
304011,
304013,
295822,
279438,
189325,
189329,
295825,
304019,
189331,
213902,
58262,
304023,
304027,
279452,
234648,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
197564,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
295945,
230413,
295949,
197645,
320528,
140312,
295961,
238620,
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,
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,
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,
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,
148946,
288214,
239064,
329177,
288217,
280027,
288220,
288218,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
370146,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
296446,
321022,
402942,
148990,
296450,
206336,
230916,
230919,
230923,
304651,
304653,
370187,
402969,
230940,
222752,
108066,
296486,
296488,
157229,
239152,
230961,
157236,
288320,
288325,
124489,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
370272,
239202,
370279,
312938,
280183,
280185,
280191,
116354,
280194,
280208,
280211,
288408,
280222,
419489,
190118,
198310,
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,
313073,
321266,
419570,
288499,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
337732,
304968,
280393,
280402,
173907,
313171,
313176,
42842,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
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,
280681,
313451,
223341,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
288895,
321670,
215175,
288909,
141455,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
288947,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
280819,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
305464,
280891,
289087,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
280919,
248153,
215387,
354653,
354656,
313700,
313705,
280937,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289227,
436684,
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,
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,
174955,
224110,
207733,
207737,
158596,
183172,
338823,
322440,
314249,
240519,
183184,
142226,
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,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281711,
289912,
248995,
306341,
306344,
306347,
322734,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
216376,
380226,
298306,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
306555,
298365,
290174,
224641,
281987,
298372,
314756,
281990,
224647,
298377,
314763,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
290305,
306694,
192008,
323084,
257550,
282127,
290321,
282130,
290325,
282133,
241175,
290328,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
28219,
282186,
224849,
282195,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282255,
282261,
175770,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
196133,
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,
298822,
315211,
307027,
315221,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
315253,
315255,
339838,
315267,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
298901,
44948,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
241581,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
307287,
307290,
217179,
315482,
192605,
315483,
233567,
299105,
200801,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
315524,
307338,
233613,
241813,
307352,
299164,
299167,
315552,
184479,
184481,
315557,
184486,
307370,
307372,
307374,
307376,
299185,
323763,
184503,
176311,
299191,
307386,
258235,
307388,
307385,
307390,
176316,
299200,
307394,
299204,
307396,
184518,
307399,
323784,
233679,
307409,
307411,
299225,
233701,
307432,
282881,
282893,
323854,
291089,
282906,
291104,
233766,
295583,
307508,
315701,
332086,
307510,
307512,
307515,
307518,
282942,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
276052,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
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,
291269,
127431,
127434,
315856,
176592,
127440,
315860,
176597,
127447,
283095,
299481,
127449,
176605,
242143,
127455,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
283142,
127494,
127497,
233994,
135689,
127500,
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,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
135839,
299680,
225954,
299684,
135844,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
299740,
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,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
324508,
234396,
291742,
226200,
234398,
234401,
291747,
291748,
234405,
291750,
234407,
324520,
324518,
324522,
234410,
291756,
291754,
226220,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
324536,
275384,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
324548,
234437,
226245,
234439,
226239,
234443,
291788,
234446,
275406,
193486,
234449,
316370,
193488,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
324599,
234490,
234493,
316416,
234496,
308226,
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,
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,
243003,
283963,
226628,
300357,
283973,
177482,
283983,
316758,
357722,
316766,
316768,
292192,
218464,
292197,
316774,
218473,
284010,
136562,
324978,
275834,
333178,
275836,
275840,
316803,
316806,
316811,
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,
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,
284258,
292452,
292454,
284263,
284265,
292458,
284267,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
325251,
276095,
276098,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
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,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
292681,
153417,
358224,
276308,
178006,
317271,
284502,
276315,
292700,
317279,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
292729,
317306,
284540,
292734,
325512,
276365,
317332,
358292,
284564,
399252,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
317353,
284585,
276395,
292784,
358326,
161718,
358330,
276410,
276411,
276418,
301009,
301011,
301013,
292823,
358360,
301017,
301015,
292828,
276446,
153568,
276448,
276452,
292839,
276455,
350186,
292843,
276460,
292845,
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,
350299,
350302,
227423,
350304,
178273,
309346,
194657,
194660,
350308,
309350,
309348,
292968,
309352,
309354,
301163,
350313,
350316,
227430,
301167,
276583,
350321,
276590,
284786,
276595,
350325,
252022,
227440,
350328,
292985,
301178,
350332,
292989,
301185,
292993,
350339,
317570,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
276638,
284837,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
243948,
309491,
227571,
309494,
243960,
276735,
227583,
227587,
276739,
276742,
227593,
227596,
325910,
309530,
342298,
276766,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
285061,
366983,
317833,
178572,
285070,
285077,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
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,
113167,
309779,
317971,
309781,
277011,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
23094,
277054,
219714,
129603,
301636,
318020,
301639,
301643,
277071,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
309871,
121458,
277106,
170619,
309885,
309888,
277122,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
334488,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
318132,
342707,
154292,
277173,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
342745,
137946,
342747,
113378,
228069,
277223,
342760,
285417,
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,
301884,
310080,
293696,
277317,
277322,
293706,
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,
293917,
293939,
318516,
277561,
277564,
310336,
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,
64768,
310531,
285958,
138505,
228617,
318742,
277798,
130345,
113964,
285997,
384302,
285999,
113969,
318773,
318776,
286010,
417086,
286016,
302403,
294211,
384328,
294221,
146765,
294223,
326991,
179547,
146784,
302436,
294246,
327015,
310632,
327017,
351594,
351607,
310648,
310651,
310657,
351619,
294276,
310659,
327046,
253320,
310665,
318858,
310672,
351633,
310689,
130468,
228776,
277932,
310703,
310710,
130486,
310712,
310715,
302526,
228799,
302534,
310727,
245191,
64966,
163272,
302541,
302543,
310737,
228825,
163290,
310749,
310755,
187880,
310764,
286188,
310772,
40440,
212472,
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,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
40521,
286283,
40525,
40527,
212560,
400976,
228944,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286312,
40554,
286313,
310892,
40557,
40560,
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,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
319280,
278320,
319290,
229192,
302925,
188247,
280021,
188252,
237409,
229233,
294776,
360317,
294785,
327554,
360322,
40851,
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
] |
112efeaf91e8a5f0a05c807645b401c22969bb4a | a5bf3b3e2da53178c42fd1ba6f686b0338f8ab3c | /Carthage/Checkouts/RxSwift/RxExample/RxExample/Examples/TableViewPartialUpdates/NumberCell.swift | 3d3592adc1d3d4cc0caedeb60d9c0c7eb2de0a86 | [
"MIT"
] | permissive | CoreyHorn/iOSTest | 8e8250f1a1ce43abb4f4ee77e426eb8d412b5767 | 0120409999ab497064ba0a4ef80e471e05664ed2 | refs/heads/master | 2020-04-25T18:18:23.772902 | 2019-03-28T19:37:06 | 2019-03-28T19:37:06 | 172,979,785 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 252 | swift | //
// NumberCell.swift
// RxExample
//
// Created by Krunoslav Zaher on 7/2/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import UIKit
class NumberCell : UICollectionViewCell {
@IBOutlet var value: UILabel?
}
| [
286571,
170693
] |
95aada85a02019f4ecb654013fcd90a1e2a34af1 | b987cef7c62535b5ccc733f6fcceb912929efc19 | /Example/ChatLayout/Chat/Model/Caches.swift | 0ffe4068967af5be5869460b7cd3b96d004fb9b3 | [
"MIT"
] | permissive | PhanithNY/ChatLayout | 97d5f73ad959008512fd61653d1b929234e25250 | b812cd8292250b49698edf73ecf87ddd4025cee5 | refs/heads/master | 2023-08-28T19:11:12.022371 | 2021-10-08T12:08:05 | 2021-10-08T12:08:05 | 415,229,120 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 962 | swift | //
// ChatLayout
// Caches.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//
import Foundation
let loader = CachingImageLoader(cache: imageCache, loader: DefaultImageLoader())
@available(iOS 13, *)
var metadataCache = IterativeCache(mainCache: MetaDataCache(cache: MemoryDataCache<URL>()),
backupCache: MetaDataCache(cache: PersistentDataCache<URL>(cacheFileExtension: "metadataCache")))
let imageCache = IterativeCache(mainCache: ImageForUrlCache(cache: MemoryDataCache<CacheableImageKey>()),
backupCache: ImageForUrlCache(cache: PersistentDataCache<CacheableImageKey>()))
// Uncomment to reload dynamic content on every start.
// @available(iOS 13, *)
// var metadataCache = MetaDataCache(cache: MemoryDataCache<URL>())
//
// let imageCache = ImageForUrlCache(cache: MemoryDataCache<CacheableImageKey>())
| [
-1
] |
25fff7175bb8d605e6ada036295b01f928cc9505 | 5c7043e82c0946eb378c5d17ceb1ab35996f5b8f | /Roomie/Roomie/AppDelegate.swift | 83a088e2e70c08f7c11fd1c23d878dcf7c1b4d23 | [] | no_license | ssuperGeorge/Xmate | 6ab18e0f9031b2f2c34cbcf634d6267ac918ceae | 498ea1f93b1d8ba700fcd42e130d8b3366887f46 | refs/heads/master | 2021-05-03T16:12:06.925588 | 2016-11-10T23:15:36 | 2016-11-10T23:15:36 | 70,003,882 | 0 | 0 | null | 2016-11-10T19:16:14 | 2016-10-04T20:34:25 | JavaScript | UTF-8 | Swift | false | false | 6,081 | swift | //
// AppDelegate.swift
// Roomie
//
// Created by Guozhu Zheng on 10/12/16.
// Copyright © 2016 Xmate. All rights reserved.
//
import UIKit
import CoreData
@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:.
// Saves changes in the application's managed object context before the application terminates.
self.saveContext()
}
// MARK: - Core Data stack
lazy var applicationDocumentsDirectory: NSURL = {
// The directory the application uses to store the Core Data store file. This code uses a directory named "com.g.xmate.Roomie" in the application's documents Application Support directory.
let urls = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)
return urls[urls.count-1]
}()
lazy var managedObjectModel: NSManagedObjectModel = {
// The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model.
let modelURL = NSBundle.mainBundle().URLForResource("Roomie", withExtension: "momd")!
return NSManagedObjectModel(contentsOfURL: modelURL)!
}()
lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator = {
// The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail.
// Create the coordinator and store
let coordinator = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel)
let url = self.applicationDocumentsDirectory.URLByAppendingPathComponent("SingleViewCoreData.sqlite")
var failureReason = "There was an error creating or loading the application's saved data."
do {
try coordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: nil)
} catch {
// Report any error we got.
var dict = [String: AnyObject]()
dict[NSLocalizedDescriptionKey] = "Failed to initialize the application's saved data"
dict[NSLocalizedFailureReasonErrorKey] = failureReason
dict[NSUnderlyingErrorKey] = error as NSError
let wrappedError = NSError(domain: "YOUR_ERROR_DOMAIN", code: 9999, userInfo: dict)
// Replace this with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog("Unresolved error \(wrappedError), \(wrappedError.userInfo)")
abort()
}
return coordinator
}()
lazy var managedObjectContext: NSManagedObjectContext = {
// Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) This property is optional since there are legitimate error conditions that could cause the creation of the context to fail.
let coordinator = self.persistentStoreCoordinator
var managedObjectContext = NSManagedObjectContext(concurrencyType: .MainQueueConcurrencyType)
managedObjectContext.persistentStoreCoordinator = coordinator
return managedObjectContext
}()
// MARK: - Core Data Saving support
func saveContext () {
if managedObjectContext.hasChanges {
do {
try managedObjectContext.save()
} catch {
// Replace this implementation with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
let nserror = error as NSError
NSLog("Unresolved error \(nserror), \(nserror.userInfo)")
abort()
}
}
}
}
| [
283144,
277514,
277003,
280085,
278551,
278042,
276510,
281635,
194085,
277030,
228396,
277038,
223280,
278577,
280132,
162394,
282203,
189025,
292450,
285796,
279148,
278125,
285296,
227455,
278656,
228481,
276611,
278665,
280205,
225934,
278674,
188050,
276629,
283803,
278687,
282274,
277154,
278692,
228009,
287402,
227499,
278700,
284845,
278705,
276149,
278711,
279223,
278718,
283838,
228544,
279753,
229068,
227533,
280273,
278751,
201439,
226031,
159477,
280312,
279304,
203532,
181516,
277262,
280335,
284432,
278289,
278801,
284434,
321296,
276751,
278287,
276755,
278808,
278297,
282910,
281379,
282915,
280370,
277306,
278844,
280382,
282433,
237382,
164166,
226634,
276313,
278877,
280415,
277344,
276321,
227687,
334185,
279405,
278896,
277363,
281972,
275828,
278902,
280439,
276347,
228220,
279422,
278916,
284557,
293773,
191374,
277395,
283028,
288147,
214934,
278943,
282016,
283554,
230320,
230322,
281011,
283058,
286130,
278971,
276923,
282558,
299970,
280007,
288200,
284617,
287689,
286157,
326096,
281041,
283091,
282585,
294390,
282616
] |
20aa45a29e55ca214724781f4588e67042096fd1 | 8175727f9061bf070b6f1d0d64ada683dc8aa24e | /LocalStorege_cw20/Controllers/TutorialViewController.swift | 432a0df7802a53534f88b16d6130fd55e744bbcf | [] | no_license | kwijyk/LocalStorage_cw20 | f1108dda058a68cb3fbafca73bc64532fde12f6d | b32414e0409da8027636a44a2bd8a7f8e8711281 | refs/heads/master | 2021-08-28T15:19:43.904954 | 2017-12-12T15:33:45 | 2017-12-12T15:33:45 | 114,007,469 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 760 | swift | //
// TutorialViewController.swift
// LocalStorege_cw20
//
// Created by Sergey Intern on 12/11/17.
// Copyright © 2017 Sergey Intern . All rights reserved.
//
import UIKit
class TutorialViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - Navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
guard segue.identifier == "showMainScreen" else { return }
DataManager.instance.isTutorialCompletedStorageKey = true
}
}
| [
-1
] |
b8b77a139693ecef420417ed77550e667744ff64 | 93c24a71bdac0dad5ce7e4bd5e6c41558b5596e1 | /NowPlaying/AppDelegate.swift | b985f80489fafaa0a10d016c3f86aa9bd5971f59 | [] | no_license | nekrich/NowPlaying | fe79c24515880602cfde31ae20817bbcc587692d | 4e4fd0c21b1150045df6ce1183b9aba042309a14 | refs/heads/master | 2021-01-22T18:32:54.462007 | 2018-12-26T10:16:38 | 2018-12-26T10:16:38 | 85,088,912 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 846 | swift | //
// AppDelegate.swift
// NowPlaying
//
// Created by Vitalii Budnik on 3/14/17.
// Copyright © 2017 Vitalii Budnik. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?)
-> Bool
{
let nowPlayingController = NowPlayingCollectionViewController()
let navigationController = UINavigationController(rootViewController: nowPlayingController)
navigationController.navigationBar.barTintColor = .navigationBarTintColor
let window = UIWindow(frame: UIScreen.main.bounds)
window.makeKeyAndVisible()
window.rootViewController = navigationController
self.window = window
return true
}
}
| [
138272,
149725
] |
24b6a321ec6c016bef407c9b5d5feb740255dca5 | eef4d87100839e4524245395b3cce8f56758d72f | /CatJumpGame/CatJumpGame/RootViewController.swift | 7e45d87de6a7fbd07e9d9d7458d9bb1093ea5787 | [] | no_license | ijl0322/Pastry-Dream | 0b7cb9dcdc2dece03caa1b2f6750f8f82dd3bd7f | 49443ca402fb88cc4288da32cbe14060cabc0cff | refs/heads/master | 2021-01-20T21:19:48.691334 | 2017-08-29T13:29:03 | 2017-08-29T13:29:03 | 101,764,086 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 433 | swift | //
// RootViewController.swift
// CatJumpGame
//
// Created by Isabel Lee on 26/05/2017.
// Copyright © 2017 isabeljlee. All rights reserved.
//
import UIKit
class RootViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
@IBAction func unwindToRoot(_ sender: UIStoryboardSegue) {
}
}
| [
-1
] |
7ce7d1f4a3d9b26a4d10ee6100f29060f6b91608 | eb7253b27d40bfb7e590ecd878f336fbd856e153 | /weatherWithAlamo/Models/Coordinate.swift | 9c556104107af19ae8eaf624ae1a8b6e1c5fa845 | [] | no_license | iamGus/WeatherUnfold | 1f9d0221d529eaf9e268afdf5872248b5b1b8192 | 6815c11c6de26a256b64d0fe3a8bc9b80f5503ab | refs/heads/master | 2021-04-03T07:38:36.607923 | 2018-03-09T09:49:19 | 2018-03-09T09:49:19 | 124,365,733 | 2 | 1 | null | null | null | null | UTF-8 | Swift | false | false | 373 | swift | //
// Coordinate.swift
// weatherWithAlamo
//
// Created by Angus Muller on 02/03/2018.
// Copyright © 2018 Angus Muller. All rights reserved.
//
import Foundation
struct Coordinate {
let latitude: Double
let longitude: Double
}
extension Coordinate: CustomStringConvertible {
var description: String {
return "\(latitude),\(longitude)"
}
}
| [
-1
] |
404ed49318df4a5e50aed55dd1f28865ac018900 | 02786bb8cd08dbc8013d288ab8d0d68bbe5a26d7 | /Articlyy/CustomViews/GradientButton.swift | a573298f5e3d0281b8c9396fc2b897a5f77bf316 | [] | no_license | kunalverma25/Articlyy | 49e594733fd2897e0e7ac10620c5721521ee7cf9 | 26effab2a6c4b8fa0e6e618eb0336b9844c7972e | refs/heads/master | 2020-03-25T22:51:52.901528 | 2018-08-10T16:04:51 | 2018-08-10T16:04:51 | 144,246,747 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,062 | swift | //
// GradientView.swift
// Articlyy
//
// Created by Kunal Verma on 09/08/18.
// Copyright © 2018 Kunal Verma. All rights reserved.
//
import Foundation
import UIKit
class GradientButton: UIButton {
override func draw(_ rect: CGRect) {
addLeftToRightGradient()
self.layer.cornerRadius = rect.height / 2
self.layer.masksToBounds = true
self.layer.borderColor = UIColor.white.cgColor
self.layer.borderWidth = 0.5
self.titleLabel?.adjustsFontSizeToFitWidth = true
}
func addLeftToRightGradient(colors : [CGColor] = [#colorLiteral(red: 0.337254902, green: 0.5176470588, blue: 0.9607843137, alpha: 1),#colorLiteral(red: 0.3764705882, green: 0.7764705882, blue: 0.9529411765, alpha: 1)]){
self.layoutIfNeeded()
let gradient = CAGradientLayer()
gradient.colors = colors
gradient.startPoint = CGPoint(x: 0.0, y: 0.5)
gradient.endPoint = CGPoint(x: 1.0, y: 0.5)
gradient.frame = self.bounds
self.layer.insertSublayer(gradient, at: 0)
}
}
| [
-1
] |
aaa4649a4e8580771c5ca9fa684cd4aa9a279a0b | 9abda56d3464e5c67d5f591be14b676c565d8c4e | /Trekker/Controller/HelpersAndExtensions/CloudKitController.swift | dafa2c6b01391268dc6cb11ede20fe0f95af226f | [] | no_license | jmandoz/Hykr | 7e4e0eff5ac17d765d436132a3fe90f7c4c84b88 | 7e02f2b3c4847becc29985aa58266bf4b3646bbb | refs/heads/master | 2020-07-07T01:05:18.563958 | 2019-09-05T18:10:02 | 2019-09-05T18:10:02 | 203,194,088 | 0 | 0 | null | 2019-09-05T18:10:03 | 2019-08-19T14:55:17 | Swift | UTF-8 | Swift | false | false | 2,953 | swift | //
// CloudKitController.swift
// Trekker
//
// Created by Jason Mandozzi on 8/20/19.
// Copyright © 2019 Jason Mandozzi. All rights reserved.
//
import Foundation
import CloudKit
class CloudKitController {
//Shared Instance
static let shared = CloudKitController()
//Database
let publicDB = CKContainer.default().publicCloudDatabase
//CRUD
//Create
func save(record: CKRecord, database: CKDatabase, completion: @escaping (CKRecord?) -> Void) {
database.save(record) { (record, error) in
if let error = error {
print("Error in \(#function) : \(error.localizedDescription) /n---/n \(error)")
completion(nil)
}
completion(record)
}
}
//Read
func fetchAppleUserReference(completion: @escaping (CKRecord.Reference?) -> Void) {
CKContainer.default().fetchUserRecordID { (appleUserReferenceID, error) in
if let error = error {
print("\(error.localizedDescription)")
completion(nil)
return
}
guard let referenceID = appleUserReferenceID else {completion(nil); return}
let appleUserReference = CKRecord.Reference(recordID: referenceID, action: .deleteSelf)
completion(appleUserReference)
}
}
func fetchRecords(ofType type: String, withPredicate predicate: NSPredicate, database: CKDatabase, completion: @escaping ([CKRecord]?) -> Void) {
let query = CKQuery(recordType: type, predicate: predicate)
database.perform(query, inZoneWith: nil) { (record, error) in
if let error = error {
print("Error in \(#function) : \(error.localizedDescription) /n---/n \(error)")
completion(nil)
}
guard let record = record else {completion(nil); return}
completion(record)
}
}
//Update
func update(record: CKRecord, database: CKDatabase, completion: @escaping (Bool) -> Void) {
//Declare the operation
let operation = CKModifyRecordsOperation()
//Override the operation attributes
operation.recordsToSave = [record]
operation.savePolicy = .changedKeys
operation.qualityOfService = .userInteractive
operation.queuePriority = .high
operation.completionBlock = {
completion(true)
}
//To edit a record, it requires an operation
database.add(operation)
}
//Delete
func delete(recordID: CKRecord.ID, database: CKDatabase, completion: @escaping (Bool) -> Void) {
database.delete(withRecordID: recordID) { (_, error) in
if let error = error {
print("Error in \(#function) : \(error.localizedDescription) /n---/n \(error)")
completion(false)
}
completion(true)
}
}
}
| [
-1
] |
170c66ea04a08fb2b274ecbd58ba5e9685cb9b60 | 2e7691379839f2e5ed75cb2c60db72051b4c8183 | /Domain/UseCases/BeersUseCase.swift | c726c23bb6e28d356ec3d8cd0ba6bd65391d06fe | [] | no_license | ionescuvlad12/beerFinderRXSwift | a5680abbb6755d9422fdf68cbbe94991bfd887c2 | 0912c60bc5de238b9372a1c0d58d0211c860c65f | refs/heads/master | 2021-09-07T13:27:15.294253 | 2018-02-23T15:02:03 | 2018-02-23T15:02:03 | 122,628,938 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 220 | swift | import Foundation
import RxSwift
public protocol BeersUseCase {
func beers() -> Observable<[Beer]>
func sortBeers(ascending: Bool) -> Observable<[Beer]>
func beersByFood(food:String) -> Observable<[Beer]>
}
| [
-1
] |
14b7e8ca12faf8b80e3abf3f028abbc08b973c40 | aceed7a9be8fe0b972078c0cc280c81b7d6714aa | /GameOfLife/CellView.swift | 68bb5d5837c25e47611f550aa0415c85e17d17c8 | [
"MIT"
] | permissive | garynewby/GameOfLife | 822527b30785e950df594f0d58c86293002ed1ef | 20ceb3049cc1ee11627299014eafdd9a686f451a | refs/heads/master | 2020-05-17T16:10:16.691794 | 2020-03-18T00:58:00 | 2020-03-18T00:58:00 | 27,451,824 | 4 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 794 | swift | //
// CellView.swift
// GameOfLife
//
// Created by Gary Newby on 5/2/19.
// Copyright © 2019 Gary Newby. All rights reserved.
//
import SpriteKit
protocol CellViewDelegate: AnyObject {
func cellViewDidToggleAlive(_ cellView: CellView)
}
final class CellView: SKShapeNode {
weak var delegate: CellViewDelegate?
init(frame: CGRect) {
super.init()
self.path = CGPath(ellipseIn: frame, transform: nil)
isUserInteractionEnabled = true
lineWidth = 0
fillColor = GameScene.deadColour
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
delegate?.cellViewDidToggleAlive(self)
}
}
| [
-1
] |
cd6cb87c5ced0bbd3db4477e866d1ec4f6180ca1 | a878b922bed7e353d920d52afc104e98e1aa076c | /CustomPullTab/SceneDelegate.swift | 7052f66a401d088ca8e493866ac66f5a10aca4e6 | [] | no_license | ShobhitChourasia/CustomHStack | b18a761897c768b016889a6c72b6950fe743559c | 5cbc27e9759c4a65e96f3caf65eaf6e3545312aa | refs/heads/main | 2023-06-14T19:51:27.443052 | 2021-06-27T18:33:05 | 2021-06-27T18:33:05 | 376,545,093 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,528 | swift | //
// SceneDelegate.swift
// CustomPullTab
//
// Created by Shobhit on 13/06/21.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let scene = (scene as? UIWindowScene) else { return }
window = .init(windowScene: scene)
let viewControllerOne = AmountSelectionViewController()
let viewControllerTwo = DurationSelectionViewController()
let viewControllerThree = PaymentModeSelectionViewController()
let viewCont = ViewController(viewControllerOne: viewControllerOne,
viewControllerTwo: viewControllerTwo,
viewControllerThree: viewControllerThree)
window?.rootViewController = UINavigationController(rootViewController: viewCont)
window?.makeKeyAndVisible()
}
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.
}
}
| [
375297,
415362,
391813,
210696,
264585,
379915,
271382,
395033,
344736,
436393,
380333,
399409,
370611,
244917,
264502,
44343,
355132,
415301,
396874,
216523,
343631,
386259,
264661,
250203,
383323,
423393,
340452,
346340,
369254,
155241,
274281,
343277,
372977,
173170,
163193,
341114,
248187,
257021,
373499
] |
6b745049a767278b68f854e188d9d5988bc57a93 | 51a336d6c16f9537de741985e8681f39f1f5430f | /SwiftDungeon/Abilities/DefensiveStanceAbility.swift | 3898eb83082f7d516ddba58fed3bf030f09d3b3f | [] | no_license | samgreen/SwiftDungeon | 39ca840de3aa94cdb9a8e087df33de394ed27fe3 | 00318a20f8ac32fb2d57e9372e7116130022f734 | refs/heads/master | 2021-01-10T03:56:17.395630 | 2015-10-27T18:52:05 | 2015-10-27T18:52:05 | 44,508,900 | 2 | 1 | null | null | null | null | UTF-8 | Swift | false | false | 858 | swift | //
// DefensiveStanceAbility.swift
// SwiftDungeon
//
// Created by Sam Green on 10/18/15.
// Copyright © 2015 Sam Green. All rights reserved.
//
import Foundation
import UIKit
class DefensiveStanceAbility: Ability {
let cost = 2
let name = "Hunker Down"
let description = "Forego an attack in favor of increased defense for this turn."
let animationType: CharacterSpriteAnimation = .CastSpell
let targetAnimationType: CharacterSpriteAnimation = .None
let imageName = "DefensiveStance"
let imageColor = UIColor.grayColor()
let owner: Character
init(owner: Character) {
self.owner = owner
}
func execute(executor: Character, target: Character) {
executor.damageReduction = 0.5
}
func canExecuteOnTarget(target: Character) -> Bool {
return true
}
} | [
-1
] |
b665e75768d6f7d9326f3741ce7d37741208d754 | c60fdac0ca73b26d4f44d430c2a6e9745cc3d07b | /vox.Force/AppDelegate.swift | 0fcb937a4a4bbdf3879499172938d1093c9f29ba | [
"MIT"
] | permissive | yangfengzzz/fluid-engine-Swift | 17c91c54c3f9481fafa71fb9cd3c78718139a49d | 812669b56125602ed80c1212a5fb1d705861cac5 | refs/heads/master | 2022-12-23T02:13:12.395456 | 2020-09-21T02:56:06 | 2020-09-21T02:56:06 | 295,703,139 | 31 | 4 | null | null | null | null | UTF-8 | Swift | false | false | 1,414 | swift | //
// AppDelegate.swift
// vox.Force
//
// Created by Feng Yang on 2020/7/23.
// Copyright © 2020 Feng Yang. 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,
376889,
385081,
393275,
376905,
327756,
254030,
286800,
368727,
180313,
368735,
180320,
376931,
286831,
286844,
417924,
262283,
286879,
286888,
377012,
327871,
180416,
377036,
180431,
377046,
377060,
327914,
205036,
393456,
393460,
336123,
418043,
336128,
385280,
262404,
180490,
368911,
262416,
262422,
262436,
336180,
262454,
393538,
262472,
213332,
65880,
262496,
418144,
262499,
213352,
246123,
262507,
262510,
213372,
385419,
393612,
262550,
262552,
385440,
385443,
385451,
262573,
393647,
385458,
262586,
344511,
262592,
360916,
369118,
328177,
328179,
328182,
328189,
328192,
164361,
328206,
410128,
393747,
254490,
188958,
385570,
33316,
377383,
197159,
352821,
188987,
369223,
385609,
385616,
352856,
352864,
369253,
262760,
352874,
254587,
377472,
336512,
148105,
352918,
98968,
361129,
385713,
434867,
164534,
336567,
328378,
328386,
352968,
344776,
352971,
418507,
352973,
385742,
385748,
361179,
189153,
369381,
361195,
418553,
344831,
336643,
344835,
344841,
361230,
336659,
418580,
418585,
434970,
369435,
418589,
262942,
418593,
336675,
328484,
418605,
336696,
361273,
328515,
336708,
328519,
336711,
328522,
336714,
426841,
197468,
361309,
254812,
361315,
361322,
328573,
377729,
369542,
361360,
222128,
345035,
345043,
386003,
386011,
386018,
386022,
435187,
328702,
328714,
361489,
386069,
336921,
386073,
336925,
345118,
377887,
345133,
345138,
386101,
197707,
189520,
345169,
156761,
361567,
345199,
386167,
361593,
410745,
361598,
214149,
386186,
337047,
345246,
214175,
337071,
337075,
345267,
386258,
328924,
66782,
222437,
328941,
386285,
386291,
345376,
345379,
410917,
337205,
345399,
378169,
369978,
337222,
337229,
337234,
263508,
402791,
345448,
271730,
378227,
181638,
353673,
181643,
181649,
181654,
181670,
181673,
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,
214610,
419410,
345701,
394853,
222830,
370297,
403070,
353919,
403075,
198280,
345736,
403091,
345749,
345757,
345762,
419491,
345765,
419497,
419501,
370350,
419509,
337592,
419512,
337599,
419527,
419530,
419535,
272081,
394966,
419542,
419544,
181977,
345818,
419547,
419550,
419559,
337642,
419563,
337645,
370415,
141051,
337659,
337668,
395021,
362255,
321299,
116509,
345887,
378663,
345905,
354111,
247617,
354117,
370503,
329544,
345930,
370509,
354130,
247637,
337750,
313180,
354142,
345970,
345974,
403320,
354172,
247691,
337808,
247700,
329623,
436126,
436132,
337833,
362413,
337844,
346057,
247759,
346063,
329697,
354277,
190439,
247789,
354313,
346139,
436289,
378954,
395339,
338004,
100453,
329832,
329855,
329867,
329885,
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,
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,
199186,
420376,
330267,
354855,
10828,
199249,
174695,
248425,
191084,
338543,
346742,
330383,
354974,
150183,
174774,
248504,
174777,
223934,
355024,
273108,
264918,
183005,
338660,
338664,
264941,
363251,
207619,
338700,
256786,
199452,
363293,
396066,
346916,
396069,
215853,
355122,
355131,
355140,
355143,
338763,
355150,
330580,
355166,
355175,
387944,
355179,
330610,
330642,
355218,
412599,
207808,
379848,
396245,
330710,
248792,
248798,
347105,
257008,
183282,
330748,
330760,
330768,
248862,
396328,
158761,
199728,
330800,
396336,
396339,
339001,
388154,
388161,
347205,
248904,
330826,
248914,
339036,
412764,
257120,
248951,
420984,
330889,
248985,
339097,
44197,
380070,
339112,
249014,
330958,
330965,
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,
249214,
175486,
175489,
249218,
249227,
249234,
175513,
175516,
396705,
175522,
355748,
380332,
396722,
208311,
388542,
372163,
216517,
380360,
216522,
339404,
372176,
208337,
339412,
413141,
339417,
249308,
339420,
339424,
339428,
339434,
249328,
69113,
372228,
339461,
208398,
380432,
175635,
339503,
265778,
265795,
396872,
265805,
224853,
224857,
257633,
372327,
257646,
372337,
224884,
224887,
224890,
224894,
224897,
216707,
339588,
126596,
421508,
224904,
159374,
11918,
339601,
126610,
224913,
224916,
224919,
126616,
224922,
224926,
224929,
224932,
257704,
224936,
224942,
257712,
224947,
257716,
257720,
257724,
257732,
339662,
257747,
224981,
224986,
224993,
257761,
224999,
339695,
225012,
225020,
339710,
257790,
225025,
257794,
339721,
257801,
257804,
225038,
225043,
167700,
372499,
225048,
257819,
225053,
184094,
225058,
339747,
339749,
257833,
225066,
257836,
413484,
225070,
225073,
372532,
257845,
397112,
225082,
397115,
225087,
225092,
323402,
257868,
225103,
257871,
397139,
225108,
225112,
257883,
225119,
257896,
274280,
257901,
225137,
257908,
225141,
257912,
257916,
225148,
257920,
225155,
339844,
225165,
397200,
225170,
380822,
225175,
225180,
118691,
184244,
372664,
372702,
356335,
380918,
405533,
430129,
266294,
266297,
217157,
421960,
356439,
430180,
266350,
381068,
225423,
250002,
250004,
225429,
356506,
225437,
135327,
225441,
438433,
225444,
438436,
225447,
438440,
225450,
258222,
225455,
430256,
225458,
225461,
225466,
225470,
381120,
372929,
430274,
225475,
389320,
225484,
225487,
225490,
225493,
266453,
225496,
225499,
225502,
225505,
356578,
217318,
225510,
225514,
225518,
372976,
381176,
389380,
61722,
356637,
356640,
356643,
356646,
266536,
356649,
356655,
332080,
340275,
356660,
397622,
332090,
332097,
201028,
348488,
332106,
332117,
348502,
250199,
250202,
332125,
250210,
348525,
332152,
250238,
389502,
356740,
332172,
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,
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,
389978,
430939,
201579,
201582,
349040,
340849,
201588,
381813,
430965,
324472,
398201,
119674,
324475,
340858,
340861,
324478,
324481,
373634,
324484,
324487,
381833,
324492,
324495,
324498,
430995,
324501,
324510,
422816,
324513,
398245,
201637,
324524,
340909,
324533,
5046,
324538,
324541,
398279,
340939,
340941,
340957,
431072,
398306,
340963,
209895,
201711,
349172,
381946,
349180,
439294,
431106,
209943,
250914,
357418,
209965,
209968,
209971,
209975,
209979,
209987,
209990,
341071,
349267,
250967,
210010,
341091,
210025,
210027,
210030,
210039,
341113,
210044,
349308,
152703,
160895,
349311,
210052,
349319,
210055,
210067,
210071,
210077,
210080,
210084,
251044,
185511,
210088,
210095,
210098,
210107,
210115,
332997,
333009,
210131,
333014,
210138,
218354,
251128,
218360,
275706,
275712,
275715,
275721,
349459,
333078,
251160,
349484,
349491,
251189,
415033,
251210,
357708,
365911,
259421,
365921,
333154,
251235,
374117,
333162,
234866,
390516,
333175,
136590,
112020,
357792,
259515,
415166,
415185,
366034,
366038,
415193,
415199,
423392,
333284,
415207,
366056,
366061,
415216,
210420,
423423,
415257,
415263,
366117,
415270,
144939,
415278,
415281,
415285,
210487,
415290,
415293,
349761,
415300,
333386,
333399,
366172,
333413,
423528,
423532,
210544,
415353,
333439,
415361,
267909,
153227,
333498,
333511,
210631,
259788,
358099,
153302,
333534,
366307,
366311,
431851,
366318,
210672,
366321,
366325,
210695,
210698,
366348,
210706,
399128,
333594,
358191,
210739,
366387,
399159,
358200,
325440,
366401,
341829,
325446,
46920,
341834,
341838,
341843,
415573,
358234,
341851,
350045,
399199,
399206,
268143,
358255,
399215,
358259,
341876,
333689,
243579,
325504,
333698,
333708,
333724,
382890,
350146,
358339,
333774,
358371,
350189,
350193,
333818,
350202,
350206,
350213,
268298,
350224,
350231,
333850,
350237,
350244,
350248,
178218,
350251,
350256,
350271,
243781,
350285,
374864,
342111,
342133,
374902,
432271,
333997,
334011,
260289,
350410,
260298,
350416,
350422,
211160,
350425,
268507,
334045,
350445,
375026,
358644,
350458,
350461,
350464,
325891,
350467,
350475,
268559,
350480,
350486,
350490,
325914,
325917,
350493,
350498,
350504,
358700,
350509,
391468,
358704,
358713,
358716,
383306,
334161,
383321,
383330,
391530,
383341,
334203,
268668,
194941,
391563,
366990,
268701,
342430,
416157,
375208,
326058,
375216,
334262,
334275,
326084,
358856,
334304,
334311,
375277,
334321,
350723,
186897,
342545,
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,
334528,
260801,
350917,
391894,
154328,
416473,
64230,
342766,
375535,
203506,
342776,
391937,
326416,
375568,
375571,
162591,
326441,
326451,
326454,
244540,
326460,
375612,
326467,
244551,
326473,
326477,
326485,
416597,
326490,
326502,
375656,
433000,
326507,
326510,
211825,
211831,
351097,
392060,
359295,
351104,
342915,
400259,
236430,
342930,
252822,
392091,
400285,
252836,
359334,
211884,
400306,
351168,
359361,
326598,
359366,
359382,
359388,
383967,
343015,
359407,
261108,
244726,
383997,
261129,
359451,
261147,
211998,
261153,
261159,
359470,
359476,
343131,
384098,
384101,
367723,
384107,
187502,
343154,
384114,
212094,
351364,
384135,
384139,
384143,
351381,
384151,
384160,
384168,
367794,
244916,
384181,
384188,
351423,
384191,
384198,
326855,
244937,
384201,
253130,
343244,
384208,
146642,
384224,
359649,
343270,
351466,
384246,
351479,
384249,
343306,
261389,
359694,
253200,
261393,
384275,
384283,
245020,
384288,
245029,
171302,
351534,
376110,
245040,
384314,
425276,
384323,
212291,
343365,
212303,
367965,
343393,
343398,
367980,
425328,
343409,
154999,
253303,
343417,
327034,
245127,
384397,
245136,
245142,
245145,
343450,
245148,
245151,
245154,
245157,
245162,
327084,
359865,
384443,
146876,
327107,
384453,
327110,
327115,
327117,
359886,
359890,
343507,
368092,
343534,
343539,
368119,
343544,
368122,
359947,
359955,
359983,
343630,
327275,
245357,
138864,
155254,
155273,
245409,
425638,
155322,
425662,
155327,
245460,
155351,
155354,
212699,
245475,
155363,
245483,
155371,
409335,
155393,
155403,
245525,
155422,
360223,
155438,
155442,
155447,
155461,
360261,
376663,
155482,
261981,
425822,
155487,
376671,
155490,
155491,
327531,
261996,
376685,
261999,
262002,
327539,
425845,
262005,
147317,
262008,
262011,
155516,
155521,
155525,
360326,
376714,
262027,
155531,
262030,
262036,
262039,
262042,
155549,
262045,
262048,
262051,
327589,
155559,
155562,
155565,
393150,
384977,
393169,
155611,
155619,
253923,
155621,
327654,
253926,
393203,
360438,
253943,
393206,
393212,
155646
] |
9fb92e7458c3f3f475b5b5c5e7f96e83eddee3df | da99835f985b8812dec3108d08db46e29011f839 | /TsubameVIPER/VIPER.xctemplate/___FILEBASENAME___Presenter.swift | ccaeaf9e2dcca9bed597a70a501fd51d35194128 | [] | no_license | SwiftTsubame/TsubameVIPER | a33e8820c464dabadad11cc7944e759c411670cf | fc414ddc9aa3fcc485edf51ec757e486417c5edd | refs/heads/master | 2021-08-23T11:11:59.472425 | 2017-12-04T16:48:55 | 2017-12-04T16:48:55 | 113,028,550 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 913 | swift | //
// ___FILENAME___
// ___PROJECTNAME___
//
// Created ___FULLUSERNAME___ on ___DATE___.
// Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
//
// Template generated by Haiyan Ma @SwiftTsubame
//
import Foundation
protocol ___VARIABLE_productName:identifier___Presentation: class {
var interactor: ___VARIABLE_productName: identifier___Interaction { get }
var router: ___VARIABLE_productName: identifier___Routing { get }
}
class ___VARIABLE_productName:identifier___Presenter: ___VARIABLE_productName:identifier___Presentation {
var interactor: ___VARIABLE_productName: identifier___Interaction
var router: ___VARIABLE_productName: identifier___Routing
init(interactor: ___VARIABLE_productName: identifier___Interaction,
router: ___VARIABLE_productName: identifier___Routing) {
self.interactor = interactor
self.router = router
}
}
| [
-1
] |
e2bc20e558d4f4477cfffbc8052b596e19b466bb | 014caf4abb953c786cbcf10cda23443ad30f36a2 | /iOS/IssueTrackerApp/IssueTrackerApp/Scene/IssueScene/View/FilterIssueCell.swift | 2ef93fe15ec54a7a53d1c67aee34a17c65364197 | [] | no_license | boostcamp-2020/IssueTracker-2 | fadc8cb425e86b8e9338999d0cddc1fe5bfd04d2 | 549a1934678b41cf7073e583c6b1abc8368e63a4 | refs/heads/master | 2023-02-03T21:40:37.085482 | 2020-12-23T13:44:46 | 2020-12-23T13:44:46 | 307,283,290 | 11 | 6 | null | 2020-12-23T13:44:48 | 2020-10-26T06:44:22 | Swift | UTF-8 | Swift | false | false | 282 | swift | //
// FilterIssueCell.swift
// IssueTrackerApp
//
// Created by 송주 on 2020/11/03.
//
import UIKit
class FilterIssueCell: UITableViewCell {
@IBOutlet weak var filterItemLabel: UILabel!
func updateCell(withText text: String) {
filterItemLabel.text = text
}
}
| [
-1
] |
0b02f01a77dff4efa4101f655f347bbab9a2b79a | 23f379a5c9b68db3dcf31e946160569e1e6dd139 | /moiveIMDB/ViewController.swift | e25d224000b7735ec407ed5df2f6447d7c6d01d5 | [] | no_license | mactyagi/moiveIMDB | a8ee6dce3b82589f92432842fea38e632baa8da4 | 4b7e96610f737c763cbd2304de1de91106b7f141 | refs/heads/main | 2023-08-24T16:27:20.013204 | 2021-10-29T10:01:22 | 2021-10-29T10:01:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 5,090 | swift | //
// ViewController.swift
// moiveIMDB
//
// Created by manukant tyagi on 29/10/21.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var image: UIImageView!
@IBOutlet weak var tableView: UITableView!
let urlString = "https://api.themoviedb.org/3/discover/movie?api_key=d507293cec045151e8c4ac64583721e8"
let posterUrl = "https://image.tmdb.org/t/p/w200"
let alert = UIAlertController(title: nil, message: "Please Wait", preferredStyle: .alert)
let lodingIndicator = UIActivityIndicatorView(frame: CGRect(x: 10, y: 5, width: 50, height: 50))
var data: Welcome? = nil
var imageArray: [UIImage] = []
override func viewDidLoad() {
super.viewDidLoad()
lodingIndicator.hidesWhenStopped = true
lodingIndicator.startAnimating()
alert.view.addSubview(lodingIndicator)
tableView.register(UINib(nibName: "TableViewCell", bundle: nil), forCellReuseIdentifier: "cell")
tableView.delegate = self
tableView.dataSource = self
// tableView.estimatedRowHeight = 100
movieListAPICalling(url: urlString) { (success) in
if success{
self.callingImageApi { (success) in
if success{
DispatchQueue.main.async {
self.tableView.reloadData()
self.dismiss(animated: true, completion: nil)
}
}
}
print("success")
}
}
}
func callingImageApi(completionHandler: @escaping(Bool) -> ()){
if let results = self.data?.results{
for i in results{
let string = self.posterUrl + (i.posterPath)
let url = URL(string: string)
if let data = try? Data(contentsOf: url!){
self.imageArray.append(UIImage(data: data)!)
}
}
}
completionHandler(true)
}
func movieListAPICalling(url: String, completionHandler: @escaping(Bool)-> ()){
present(alert, animated: true, completion: nil)
let url = URL(string: url)
var urlRequest = URLRequest(url: url!)
urlRequest.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: urlRequest) { (data, response, eror) in
// print(response)
if let data = data{
do {
self.data = try JSONDecoder().decode(Welcome.self, from: data)
completionHandler(true)
print(data)
}
catch{
print(error)
completionHandler(false)
}
}
completionHandler(true)
}
task.resume()
}
}
extension ViewController: UITableViewDelegate, UITableViewDataSource{
func numberOfSections(in tableView: UITableView) -> Int {
data?.results.count ?? 0
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
1
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! tableViewCell
if !imageArray.isEmpty {
cell.movieImageView.image = imageArray[indexPath.section]
}
cell.mainLabel.text = self.data?.results[indexPath.section].title
cell.dateLabel.text = self.data?.results[indexPath.section].releaseDate
cell.overViewLabel.text = self.data?.results[indexPath.section].overview
// cell.textLabel?.text = "dgf"
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "secondViewController") as! SecondViewController
vc.id = data?.results[indexPath.row].id
self.navigationController?.pushViewController(vc, animated: true)
// print(id)
// if let id = id {
// let url = movieUrlString + String(id) + apiKey
// movieDetailAPICalling(url: url) { (success) in
// if success{
// print("success")
// }
// }
// }
}
}
class tableViewCell: UITableViewCell{
@IBOutlet weak var dateLabel: UILabel!
@IBOutlet weak var movieImageView: UIImageView!
@IBOutlet weak var mainLabel: UILabel!
@IBOutlet weak var overViewLabel: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
overViewLabel.sizeToFit()
overViewLabel.lineBreakMode = .byWordWrapping
overViewLabel.numberOfLines = 0
}
}
| [
-1
] |
9e8efad1798acbe827e900bc501a1e56e4cc2ec4 | ef2e56d670259841120c227741e1370ef5f1f637 | /TvTime/FeedViewController/PushAnimator.swift | 5bddc25b804129ce0d8568be676e5ac819dd77d6 | [] | no_license | nofelmahmood/TvTime | 03a67a649dd5a85b756609ff40d442964f16b2fb | 6d50973642b2de6d76b7f3b0fccb56620068b759 | refs/heads/master | 2021-03-27T16:11:26.472034 | 2017-03-27T11:05:00 | 2017-03-27T11:05:00 | 84,308,817 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,813 | swift | //
// PushAnimator.swift
// TvTime
//
// Created by Nofel Mahmood on 10/03/2017.
// Copyright © 2017 Nineish. All rights reserved.
//
import UIKit
class PushAnimator: NSObject {
}
extension PushAnimator: UIViewControllerAnimatedTransitioning {
func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
return 0.25
}
func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
let containerView = transitionContext.containerView
guard let fromViewController = transitionContext.viewController(forKey: .from), let toViewController = transitionContext.viewController(forKey: .to) else {
return
}
containerView.addSubview(fromViewController.view)
containerView.addSubview(toViewController.view)
let feedViewController = fromViewController as! FeedViewController
let collectionView = feedViewController.collectionView
let rect = CGRect.zero
let rectInSuperview = collectionView.convert(rect, to: feedViewController.view)
let cell = collectionView.cellForItem(at: feedViewController.selectedRowIndexPath) as! FeedItemCollectionViewCell
let image = cell.itemImageView.image
let imageViewRect = CGRect(x: rectInSuperview.origin.x + 10, y: rectInSuperview.origin.y + 10, width: 90, height: 125)
let imageView = UIImageView(frame: imageViewRect)
imageView.image = image
containerView.addSubview(imageView)
let finalFrameWidth = 135
let finalFrameHeight = 188
let statusBarHeight = UIApplication.shared.statusBarFrame.size.height
let navigationBarHeight: CGFloat = 52 + 8
let finalFrame = CGRect(x: 16, y: Int(statusBarHeight + navigationBarHeight), width: finalFrameWidth, height: finalFrameHeight)
toViewController.view.alpha = 0
let tvShowViewController = toViewController as! TvShowViewController
tvShowViewController.itemImageView.alpha = 0
UIView.animate(withDuration: transitionDuration(using: transitionContext), delay: 0, options: UIViewAnimationOptions.curveEaseInOut, animations: {
imageView.frame = finalFrame
toViewController.view.alpha = 1
fromViewController.view.alpha = 0
}, completion: { completed in
fromViewController.view.removeFromSuperview()
imageView.removeFromSuperview()
tvShowViewController.itemImageView.alpha = 1.0
transitionContext.completeTransition(!transitionContext.transitionWasCancelled)
})
}
}
| [
-1
] |
9b397387034a59405e0921a5100020c943c66824 | a12b228e5ebe71955aac9bd739d24ff3b2006e8f | /TransitionAnimation/TransitionAnimation/ModelViewController.swift | 17847b65ec8dca0995bf67475b493b0da623f5ce | [
"MIT"
] | permissive | kjxBoy/TransitionAnimation | 852b2eab683ce0994cd328c1ac4c1c72b56220fb | a76bb94b0c37e6e185da90fb110041bec85c6a5f | refs/heads/master | 2021-01-25T05:09:10.595156 | 2018-12-28T06:43:39 | 2018-12-28T06:44:42 | 93,504,453 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 990 | swift | //
// ModelViewController.swift
// 按钮位置变化
//
// Created by apple on 16/2/16.
// Copyright © 2016年 kang. All rights reserved.
//
import UIKit
class ModelViewController: UIViewController {
var newDelegate: UIViewControllerTransitioningDelegate? = JXCoolTransitioningDelegate()
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .orange
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
setup()
}
override init(nibName nibNameOrNil: String!, bundle nibBundleOrNil: Bundle!) {
super.init(nibName: nil, bundle: nil)
setup()
}
convenience init() {
self.init(nibName: nil, bundle: nil)
}
func setup() {
// init
self.modalPresentationStyle = UIModalPresentationStyle.custom
//transition 转场,转成代理
self.transitioningDelegate = newDelegate
}
}
| [
-1
] |
f3f96ab300289abf3244a1bdffb09599e76171f6 | c9d23e9e9a3d55423d85c292076e2a92f1610acc | /Connections/Student/StudentInvite/StudentInviteCell.swift | 846aa24cad22efe0907cb6d4ffb6467f9ce1a045 | [] | no_license | hallamager/Connections | 956adad8abd59466056c2c2f59f5d748421e8598 | 16d1f3cb0846b578798d51e41619f4f29313233c | refs/heads/master | 2021-05-15T23:06:35.451261 | 2018-05-23T07:16:09 | 2018-05-23T07:16:09 | 106,877,995 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,282 | swift | //
// StudentInviteCell.swift
// Connections
//
// Created by Hallam John Ager on 30/03/2018.
// Copyright © 2018 Hallam John Ager. All rights reserved.
//
import Foundation
import UIKit
import Firebase
import FoldingCell
protocol RearrangeCellDelegate: class {
func selected(for student: Student)
func didTapButton(_ sender: UIButton)
}
class StudentInviteCell: FoldingCell {
var student: Student!
weak var delegate: RearrangeCellDelegate?
@IBOutlet weak var studentImg: UIImageView!
@IBOutlet weak var foldedStudentImg: UIImageView!
@IBOutlet weak var studentName: UILabel!
@IBOutlet weak var foldedStudentName: UILabel!
@IBOutlet weak var InviteType: UILabel!
@IBOutlet weak var foldedInviteType: UILabel!
@IBOutlet weak var date: UILabel!
@IBOutlet weak var time: UILabel!
@IBOutlet weak var response: UILabel!
@IBOutlet weak var foldedResponse: UILabel!
@IBOutlet weak var date2: UILabel!
@IBOutlet weak var time2: UILabel!
@IBOutlet weak var firstDateResponse: UILabel!
@IBOutlet weak var secondDateResponse: UILabel!
//Defines sides, shadows and colour of the cells for the viewcontroller.
override func awakeFromNib() {
foregroundView.layer.shadowOpacity = 0.3
foregroundView.layer.shadowOffset = CGSize(width: 0, height: 0)
foregroundView.layer.shadowRadius = 3.2
foregroundView.layer.shadowColor = UIColor.lightGray.cgColor
foregroundView.layer.cornerRadius = 10
backgroundColor = .clear
super.awakeFromNib()
}
//Defines times for flipping animation.
override func animationDuration(_ itemIndex:NSInteger, type:AnimationType)-> TimeInterval {
// durations count equal it itemCount
let durations = [0.20, 0.20, 0.20] // timing animation for each view
return durations[itemIndex]
}
@IBAction func rearrangeDates(_ sender: UIButton) {
sender.transform = CGAffineTransform(scaleX: 0.9, y: 0.9)
UIView.animate(withDuration: 1.5,
delay: 0,
usingSpringWithDamping: CGFloat(0.25),
initialSpringVelocity: CGFloat(8.0),
options: UIViewAnimationOptions.allowUserInteraction,
animations: {
sender.transform = CGAffineTransform.identity
},
completion: { Void in() }
)
delegate?.selected(for: student)
}
@IBAction func cancelInvite(_ sender: UIButton) {
sender.transform = CGAffineTransform(scaleX: 0.9, y: 0.9)
UIView.animate(withDuration: 1.5,
delay: 0,
usingSpringWithDamping: CGFloat(0.25),
initialSpringVelocity: CGFloat(8.0),
options: UIViewAnimationOptions.allowUserInteraction,
animations: {
sender.transform = CGAffineTransform.identity
},
completion: { Void in() }
)
delegate?.didTapButton(sender)
print("tapped")
}
}
| [
-1
] |
592fbbcc3306ef107947ca6edfd122305954fef7 | e591e13ad53fcac5a4ba8faf26f5cbfe40e55cc5 | /ChatUI/AppDelegate.swift | f2c0dd64a23da880e0216a1142b91634d5fd15b8 | [] | no_license | YuyaAbo/ChatUI | e425143dee78659a7016ab0e77d2ae9b8c319345 | bf8f83c42f144ad44f39ccdc7c9633b2093bd46e | refs/heads/master | 2021-01-02T23:17:02.144396 | 2017-08-06T16:38:34 | 2017-08-06T16:38:34 | 99,495,835 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,168 | swift | //
// AppDelegate.swift
// ChatUI
//
// Created by YuyaAbo on 2017/08/04.
// Copyright © 2017年 YuyaAbo. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
| [
229380,
229383,
229385,
278539,
229388,
294924,
278542,
229391,
327695,
278545,
229394,
278548,
229397,
229399,
229402,
352284,
229405,
278556,
278559,
229408,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
229426,
237618,
229428,
311349,
286774,
319544,
204856,
229432,
286776,
286778,
352318,
286791,
237640,
278605,
286797,
311375,
163920,
237646,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
278648,
237693,
303230,
327814,
131209,
303241,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
295110,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
303347,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
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,
287238,
172552,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
213575,
172618,
303690,
33357,
287309,
279124,
172634,
262752,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
189039,
295538,
172660,
189040,
189044,
287349,
287355,
287360,
295553,
295557,
311942,
303751,
287365,
352905,
311946,
279178,
287371,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
287390,
303773,
164509,
172705,
287394,
172702,
303780,
172707,
287398,
205479,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
279231,
287427,
312006,
107208,
107212,
172748,
287436,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
287450,
303835,
279258,
189149,
303838,
213724,
279267,
312035,
295654,
279272,
312048,
230128,
312050,
230131,
205564,
303871,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
303914,
279340,
205613,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303981,
303985,
303987,
328563,
279413,
303991,
303997,
295806,
295808,
304005,
295813,
304007,
320391,
213895,
304009,
304011,
230284,
304013,
279438,
189325,
213902,
189329,
295822,
189331,
304019,
295825,
58262,
304023,
279452,
234648,
410526,
279461,
279462,
304042,
213931,
304055,
230327,
287675,
197564,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
295873,
213963,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
295949,
197645,
230413,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
296004,
132165,
336964,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
361576,
296040,
205931,
296044,
279661,
205934,
164973,
312432,
279669,
337018,
189562,
279679,
304258,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
165038,
238766,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
230679,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
230718,
296259,
378181,
296262,
230727,
296264,
238919,
320840,
296267,
296271,
222545,
230739,
312663,
337244,
222556,
230752,
312676,
230760,
173418,
410987,
148843,
230763,
230768,
296305,
312692,
230773,
304505,
181626,
304506,
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,
148990,
321022,
206336,
402942,
296446,
296450,
230916,
230919,
214535,
304651,
370187,
304653,
230923,
402969,
230940,
222752,
108066,
296486,
296488,
157229,
239152,
230961,
157236,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
370272,
181854,
239202,
370279,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
419489,
190118,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
419522,
313027,
280260,
419525,
206536,
280264,
206539,
206541,
206543,
280276,
313044,
321239,
280283,
18140,
313052,
288478,
313055,
321252,
313066,
280302,
288494,
280304,
313073,
419570,
288499,
321266,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
337732,
304968,
280393,
280402,
173907,
313176,
42842,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
10170,
296890,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
354265,
354270,
239586,
313320,
354281,
231404,
124913,
165876,
321528,
313340,
239612,
288764,
239617,
313347,
288773,
313358,
305176,
321560,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
223327,
329830,
280681,
313451,
223341,
280687,
215154,
313458,
280691,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
288909,
141455,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
280755,
288947,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
321740,
313548,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
280819,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
280891,
289087,
280897,
280900,
239944,
305480,
280906,
239947,
305485,
305489,
379218,
280919,
248153,
215387,
354653,
313700,
313705,
280937,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
240011,
199051,
289166,
240017,
297363,
190868,
297365,
240021,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
305594,
289210,
281024,
289218,
289221,
289227,
436684,
281045,
281047,
215526,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
330244,
281095,
223752,
338440,
150025,
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,
158317,
19053,
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,
183172,
158596,
338823,
322440,
314249,
240519,
183184,
142226,
240535,
289687,
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,
298306,
380226,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
306555,
314747,
298365,
290171,
290174,
224641,
281987,
314756,
298372,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
282133,
290325,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
28219,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282255,
282261,
175770,
298651,
323229,
282269,
298655,
323231,
61092,
282277,
306856,
196133,
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,
307009,
413506,
241475,
307012,
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,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
315482,
217179,
315483,
192605,
233567,
200801,
299105,
217188,
299109,
307303,
315495,
356457,
307307,
45163,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
315524,
307338,
233613,
241813,
307352,
299164,
184479,
299167,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
299185,
323763,
176311,
299191,
307385,
307386,
258235,
307388,
176316,
307390,
184503,
299200,
184512,
307394,
307396,
299204,
184518,
307399,
323784,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
282893,
323854,
291089,
282906,
291104,
233766,
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,
291231,
61855,
283042,
291238,
291241,
127403,
127405,
127407,
291247,
299440,
299444,
127413,
283062,
291254,
127417,
291260,
283069,
127421,
127424,
299457,
127429,
127431,
315856,
176592,
315860,
176597,
283095,
127447,
299481,
176605,
242143,
127457,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
135672,
233979,
291323,
291330,
283142,
127494,
127497,
233994,
135689,
291341,
233998,
127506,
234003,
234006,
127511,
152087,
283161,
242202,
234010,
135707,
135710,
242206,
242208,
291361,
242220,
291378,
152118,
234038,
234041,
315961,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
135808,
291456,
373383,
299655,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
225948,
135839,
299680,
225954,
135844,
299684,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
226008,
242396,
299740,
201444,
299750,
283368,
234219,
283372,
185074,
226037,
283382,
316151,
234231,
234236,
226045,
242431,
234239,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
234248,
291593,
242443,
234252,
242445,
234254,
291601,
242450,
234258,
242452,
234261,
348950,
201496,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
234278,
299814,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
160572,
283452,
234302,
234307,
242499,
234309,
316233,
234313,
316235,
234316,
283468,
242511,
234319,
234321,
234324,
201557,
185173,
234329,
234333,
308063,
234336,
234338,
349027,
242530,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
234364,
291711,
234368,
234370,
201603,
291714,
234373,
316294,
226182,
234375,
308105,
226185,
234379,
324490,
291716,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
324508,
234396,
226200,
234398,
291742,
234401,
291747,
291748,
234405,
291750,
234407,
324520,
324518,
234410,
291754,
291756,
324522,
226220,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
324536,
275384,
234428,
291773,
234431,
242623,
324544,
324546,
234434,
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,
324599,
234487,
234490,
234493,
234496,
316416,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
234519,
316439,
234520,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
234549,
300085,
300088,
234553,
234556,
234558,
316479,
234561,
308291,
316483,
234563,
234568,
234570,
316491,
300108,
234572,
234574,
300115,
234580,
234581,
242777,
234585,
275545,
234590,
234593,
234595,
300133,
234597,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
316530,
300148,
234614,
398455,
144506,
234618,
275579,
234620,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
226453,
234647,
275606,
275608,
234650,
308379,
324757,
234653,
300189,
119967,
324766,
324768,
283805,
234657,
242852,
234661,
283813,
300197,
234664,
275626,
234667,
316596,
308414,
300223,
234687,
300226,
308418,
283844,
300229,
308420,
308422,
226500,
234692,
283850,
300234,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
316663,
275703,
300284,
275710,
300287,
300289,
292097,
161027,
300292,
300294,
275719,
177419,
300299,
242957,
283917,
300301,
177424,
349451,
275725,
349464,
415009,
283939,
259367,
292143,
283951,
300344,
226617,
243003,
283963,
226628,
283973,
300357,
177482,
283983,
316758,
357722,
316766,
316768,
292192,
218464,
292197,
316774,
243046,
218473,
284010,
324978,
136562,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
144812,
284076,
144814,
144820,
284084,
284087,
292279,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
226802,
292338,
316917,
292343,
308727,
300537,
316933,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
284213,
308790,
284215,
316983,
194103,
284218,
194101,
226877,
292414,
284223,
284226,
284228,
292421,
226886,
284231,
128584,
243268,
284234,
366155,
317004,
276043,
284238,
226895,
284241,
292433,
284243,
300628,
284245,
194130,
284247,
317015,
235097,
243290,
276053,
284249,
284251,
300638,
284253,
284255,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
276086,
284278,
292470,
292473,
284283,
276093,
284286,
276095,
284288,
292481,
284290,
325250,
284292,
292485,
292479,
276098,
284297,
317066,
284299,
317068,
276109,
284301,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
358080,
276160,
284354,
358083,
276166,
284358,
358089,
284362,
276170,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
276187,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
325408,
300832,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
153417,
292681,
358224,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
284511,
317279,
227175,
292715,
300912,
284529,
292721,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
358292,
284564,
317332,
399252,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
284585,
317353,
276395,
292776,
292784,
276402,
358326,
161718,
276410,
276411,
358330,
276418,
276425,
301009,
301011,
301013,
292823,
301015,
301017,
358360,
292828,
276446,
153568,
276448,
276452,
292839,
276455,
350186,
292843,
276460,
292845,
276464,
178161,
227314,
276466,
350200,
276472,
325624,
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,
276539,
235581,
178238,
325692,
276544,
243779,
284739,
325700,
292934,
243785,
276553,
350293,
350295,
309337,
194649,
227418,
350299,
350302,
227423,
194654,
178273,
309346,
194657,
309348,
350308,
309350,
227426,
309352,
350313,
309354,
301163,
350316,
194660,
227430,
276583,
276590,
350321,
284786,
276595,
301167,
350325,
227440,
350328,
292985,
301178,
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,
309450,
301258,
276685,
309455,
276689,
309462,
301272,
276699,
309468,
194780,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
309491,
227571,
309494,
243960,
276735,
227583,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
276843,
293227,
276848,
293232,
186744,
211324,
227709,
285061,
366983,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
129486,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
301562,
293370,
317951,
309764,
301575,
121352,
236043,
317963,
342541,
55822,
113167,
309779,
317971,
309781,
277011,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
219714,
129603,
318020,
301636,
301639,
301643,
277071,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
309871,
121458,
277106,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
334488,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
342707,
318132,
154292,
293555,
277173,
285368,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
342745,
137946,
342747,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
56045,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
293666,
285474,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
285499,
301884,
310080,
293696,
277317,
277322,
293706,
277329,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
15224,
236408,
277368,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
276579,
293811,
293817,
293820,
203715,
326603,
342994,
276586,
293849,
293861,
228327,
228328,
228330,
318442,
228332,
326638,
277486,
351217,
318450,
293876,
293877,
285686,
302073,
285690,
121850,
293882,
302075,
244731,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
310344,
277577,
293960,
277583,
203857,
310355,
293971,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
285817,
367737,
302205,
285821,
392326,
285831,
253064,
302218,
285835,
294026,
384148,
162964,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
285958,
138505,
228617,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
384302,
285999,
277804,
113969,
277807,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
302403,
294211,
384328,
277832,
277836,
146765,
294221,
326991,
294223,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
310659,
351619,
294276,
327046,
277892,
253320,
310665,
318858,
277894,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
228776,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
245191,
310727,
64966,
163272,
277959,
292968,
302541,
277963,
302543,
277966,
310737,
277971,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
310764,
286188,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
310780,
40448,
228864,
286214,
228871,
302603,
65038,
302614,
302617,
286233,
302621,
187936,
146977,
286240,
187939,
40484,
294435,
40486,
286246,
40488,
278057,
245288,
40491,
294439,
294440,
294443,
310831,
294445,
286248,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
327240,
40521,
286283,
40525,
40527,
400976,
212560,
228944,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286312,
40554,
286313,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
122517,
278168,
179870,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
302793,
294601,
343757,
212690,
278227,
286420,
319187,
229076,
286425,
319194,
278235,
278238,
229086,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
311048,
294664,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
319280,
278320,
319290,
229192,
302925,
188247,
188252,
237409,
229233,
294776,
360317,
294785,
327554,
360322,
40840,
40851,
294803,
188312,
294811,
319390,
237470,
40865,
319394,
294817,
294821,
311209,
180142,
294831,
188340,
40886,
319419,
294844,
294847,
237508,
393177,
294876,
294879,
294883,
393190,
294890,
311279,
278513,
237555,
311283,
278516,
278519,
237562
] |
604aa026becdcf6770df555444a23862d9969947 | 29682b424bf35c7874ce0bb2acf72f8b641f1747 | /Acua/Classes/DateTimePicker/WWCalendarTimeSelector.swift | b038ac51d22a1e5861524cab2bd298107ee95814 | [] | no_license | AppHero2/Acua-iOS | e6cc97d4583363c0ddb592608fd76a34f379b993 | a7b49b45a5ded9d647864e958a4293628cb45621 | refs/heads/master | 2020-03-15T04:12:35.722066 | 2018-09-13T12:24:07 | 2018-09-13T12:24:07 | 131,959,992 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 126,770 | swift | //
// WWCalendarTimeSelector.swift
// WWCalendarTimeSelector
//
// Created by Weilson Wonder on 18/4/16.
// Copyright © 2016 Wonder. All rights reserved.
//
import UIKit
@objc public final class WWCalendarTimeSelectorStyle: NSObject {
fileprivate(set) public var showDateMonth: Bool = true
fileprivate(set) public var showMonth: Bool = false
fileprivate(set) public var showYear: Bool = true
fileprivate(set) public var showTime: Bool = true
fileprivate var isSingular = false
public func showDateMonth(_ show: Bool) {
showDateMonth = show
showMonth = show ? false : showMonth
if show && isSingular {
showMonth = false
showYear = false
showTime = false
}
}
public func showMonth(_ show: Bool) {
showMonth = show
showDateMonth = show ? false : showDateMonth
if show && isSingular {
showDateMonth = false
showYear = false
showTime = false
}
}
public func showYear(_ show: Bool) {
showYear = show
if show && isSingular {
showDateMonth = false
showMonth = false
showTime = false
}
}
public func showTime(_ show: Bool) {
showTime = show
if show && isSingular {
showDateMonth = false
showMonth = false
showYear = false
}
}
fileprivate func countComponents() -> Int {
return (showDateMonth ? 1 : 0) +
(showMonth ? 1 : 0) +
(showYear ? 1 : 0) +
(showTime ? 1 : 0)
}
fileprivate convenience init(isSingular: Bool) {
self.init()
self.isSingular = isSingular
showDateMonth = true
showMonth = false
showYear = false
showTime = false
}
}
/// Set `optionSelectionType` with one of the following:
///
/// `Single`: This will only allow the selection of a single date. If applicable, this also allows selection of year and time.
///
/// `Multiple`: This will allow the selection of multiple dates. This automatically ignores the attribute of `optionPickerStyle`, hence selection of multiple year and time is currently not available.
///
/// `Range`: This will allow the selection of a range of dates. This automatically ignores the attribute of `optionPickerStyle`, hence selection of multiple year and time is currently not available.
///
/// - Note:
/// Selection styles will only affect date selection. It is currently not possible to select multiple/range
@objc public enum WWCalendarTimeSelectorSelection: Int {
/// Single Selection.
case single
/// Multiple Selection. Year and Time interface not available.
case multiple
/// Range Selection. Year and Time interface not available.
case range
}
/// Set `optionMultipleSelectionGrouping` with one of the following:
///
/// `Simple`: No grouping for multiple selection. Selected dates are displayed as individual circles.
///
/// `Pill`: This is the default. Pill-like grouping where dates are grouped only if they are adjacent to each other (+- 1 day).
///
/// `LinkedBalls`: Smaller circular selection, with a bar connecting adjacent dates.
@objc public enum WWCalendarTimeSelectorMultipleSelectionGrouping: Int {
/// Displayed as individual circular selection
case simple
/// Rounded rectangular grouping
case pill
/// Individual circular selection with a bar between adjacent dates
case linkedBalls
}
/// Set `optionTimeStep` to customise the period of time which the users will be able to choose. The step will show the user the available minutes to select (with exception of `OneMinute` step, see *Note*).
///
/// - Note:
/// Setting `optionTimeStep` to `OneMinute` will show the clock face with minutes on intervals of 5 minutes.
/// In between the intervals will be empty space. Users will however be able to adjust the minute hand into the intervals of those 5 minutes.
///
/// - Note:
/// Setting `optionTimeStep` to `SixtyMinutes` will disable the minutes selection entirely.
@objc public enum WWCalendarTimeSelectorTimeStep: Int {
/// 1 Minute interval, but clock will display intervals of 5 minutes.
case oneMinute = 1
/// 5 Minutes interval.
case fiveMinutes = 5
/// 10 Minutes interval.
case tenMinutes = 10
/// 15 Minutes interval.
case fifteenMinutes = 15
/// 30 Minutes interval.
case thirtyMinutes = 30
/// Disables the selection of minutes.
case sixtyMinutes = 60
}
@objc open class WWCalendarTimeSelectorDateRange: NSObject {
fileprivate(set) open var start: Date = Date().beginningOfDay
fileprivate(set) open var end: Date = Date().beginningOfDay
open var array: [Date] {
var dates: [Date] = []
var i = start.beginningOfDay
let j = end.beginningOfDay
while i.compare(j) != .orderedDescending {
dates.append(i)
i = i + 1.day
}
return dates
}
open func setStartDate(_ date: Date) {
start = date.beginningOfDay
if start.compare(end) == .orderedDescending {
end = start
}
}
open func setEndDate(_ date: Date) {
end = date.beginningOfDay
if start.compare(end) == .orderedDescending {
start = end
}
}
}
/// The delegate of `WWCalendarTimeSelector` can adopt the `WWCalendarTimeSelectorProtocol` optional methods. The following Optional methods are available:
///
/// `WWCalendarTimeSelectorDone:selector:dates:`
/// `WWCalendarTimeSelectorDone:selector:date:`
/// `WWCalendarTimeSelectorCancel:selector:dates:`
/// `WWCalendarTimeSelectorCancel:selector:date:`
/// `WWCalendarTimeSelectorWillDismiss:selector:`
/// `WWCalendarTimeSelectorDidDismiss:selector:`
@objc public protocol WWCalendarTimeSelectorProtocol {
/// Method called before the selector is dismissed, and when user is Done with the selector.
///
/// This method is only called when `optionMultipleSelection` is `true`.
///
/// - SeeAlso:
/// `WWCalendarTimeSelectorDone:selector:date:`
///
/// - Parameters:
/// - selector: The selector that will be dismissed.
/// - dates: Selected dates.
@objc optional func WWCalendarTimeSelectorDone(_ selector: WWCalendarTimeSelector, dates: [Date])
/// Method called before the selector is dismissed, and when user is Done with the selector.
///
/// This method is only called when `optionMultipleSelection` is `false`.
///
/// - SeeAlso:
/// `WWCalendarTimeSelectorDone:selector:dates:`
///
/// - Parameters:
/// - selector: The selector that will be dismissed.
/// - dates: Selected date.
@objc optional func WWCalendarTimeSelectorDone(_ selector: WWCalendarTimeSelector, date: Date)
/// Method called before the selector is dismissed, and when user Cancel the selector.
///
/// This method is only called when `optionMultipleSelection` is `true`.
///
/// - SeeAlso:
/// `WWCalendarTimeSelectorCancel:selector:date:`
///
/// - Parameters:
/// - selector: The selector that will be dismissed.
/// - dates: Selected dates.
@objc optional func WWCalendarTimeSelectorCancel(_ selector: WWCalendarTimeSelector, dates: [Date])
/// Method called before the selector is dismissed, and when user Cancel the selector.
///
/// This method is only called when `optionMultipleSelection` is `false`.
///
/// - SeeAlso:
/// `WWCalendarTimeSelectorCancel:selector:dates:`
///
/// - Parameters:
/// - selector: The selector that will be dismissed.
/// - dates: Selected date.
@objc optional func WWCalendarTimeSelectorCancel(_ selector: WWCalendarTimeSelector, date: Date)
/// Method called before the selector is dismissed.
///
/// - SeeAlso:
/// `WWCalendarTimeSelectorDidDismiss:selector:`
///
/// - Parameters:
/// - selector: The selector that will be dismissed.
@objc optional func WWCalendarTimeSelectorWillDismiss(_ selector: WWCalendarTimeSelector)
/// Method called after the selector is dismissed.
///
/// - SeeAlso:
/// `WWCalendarTimeSelectorWillDismiss:selector:`
///
/// - Parameters:
/// - selector: The selector that has been dismissed.
@objc optional func WWCalendarTimeSelectorDidDismiss(_ selector: WWCalendarTimeSelector)
/// Method if implemented, will be used to determine if a particular date should be selected.
///
/// - Parameters:
/// - selector: The selector that is checking for selectablity of date.
/// - date: The date that user tapped, but have not yet given feedback to determine if should be selected.
@objc optional func WWCalendarTimeSelectorShouldSelectDate(_ selector: WWCalendarTimeSelector, date: Date) -> Bool
}
open class WWCalendarTimeSelector: UIViewController, UITableViewDelegate, UITableViewDataSource, WWCalendarRowProtocol, WWClockProtocol {
/// The delegate of `WWCalendarTimeSelector` can adopt the `WWCalendarTimeSelectorProtocol` optional methods. The following Optional methods are available:
///
/// `WWCalendarTimeSelectorDone:selector:dates:`
/// `WWCalendarTimeSelectorDone:selector:date:`
/// `WWCalendarTimeSelectorCancel:selector:dates:`
/// `WWCalendarTimeSelectorCancel:selector:date:`
/// `WWCalendarTimeSelectorWillDismiss:selector:`
/// `WWCalendarTimeSelectorDidDismiss:selector:`
open weak var delegate: WWCalendarTimeSelectorProtocol?
/// A convenient identifier object. Not used by `WWCalendarTimeSelector`.
open var optionIdentifier: AnyObject?
/// Set `optionPickerStyle` with one or more of the following:
///
/// `DateMonth`: This shows the the date and month.
///
/// `Year`: This shows the year.
///
/// `Time`: This shows the clock, users will be able to select hour and minutes as well as am or pm.
///
/// - Note:
/// `optionPickerStyle` should contain at least 1 of the following style. It will default to all styles should there be none in the option specified.
///
/// - Note:
/// Defaults to all styles.
open var optionStyles: WWCalendarTimeSelectorStyle = WWCalendarTimeSelectorStyle()
/// Set `optionTimeStep` to customise the period of time which the users will be able to choose. The step will show the user the available minutes to select (with exception of `OneMinute` step, see *Note*).
///
/// - Note:
/// Setting `optionTimeStep` to `OneMinute` will show the clock face with minutes on intervals of 5 minutes.
/// In between the intervals will be empty space. Users will however be able to adjust the minute hand into the intervals of those 5 minutes.
///
/// - Note:
/// Setting `optionTimeStep` to `SixtyMinutes` will disable the minutes selection entirely.
///
/// - Note:
/// Defaults to `OneMinute`.
open var optionTimeStep: WWCalendarTimeSelectorTimeStep = .oneMinute
/// Set to `true` will show the entire selector at the top. If you only wish to hide the *title bar*, see `optionShowTopPanel`. Set to `false` will hide the entire top container.
///
/// - Note:
/// Defaults to `true`.
///
/// - SeeAlso:
/// `optionShowTopPanel`.
open var optionShowTopContainer: Bool = true
/// Set to `true` to show the weekday name *or* `optionTopPanelTitle` if specified at the top of the selector. Set to `false` will hide the entire panel.
///
/// - Note:
/// Defaults to `true`.
open var optionShowTopPanel = true
/// Set to nil to show default title. Depending on `privateOptionStyles`, default titles are either **Select Multiple Dates**, **(Capitalized Weekday Full Name)** or **(Capitalized Month Full Name)**.
///
/// - Note:
/// Defaults to `nil`.
open var optionTopPanelTitle: String? = nil
/// Set `optionSelectionType` with one of the following:
///
/// `Single`: This will only allow the selection of a single date. If applicable, this also allows selection of year and time.
///
/// `Multiple`: This will allow the selection of multiple dates. This automatically ignores the attribute of `optionPickerStyle`, hence selection of multiple year and time is currently not available.
///
/// `Range`: This will allow the selection of a range of dates. This automatically ignores the attribute of `optionPickerStyle`, hence selection of multiple year and time is currently not available.
///
/// - Note:
/// Selection styles will only affect date selection. It is currently not possible to select multiple/range
open var optionSelectionType: WWCalendarTimeSelectorSelection = .single
/// Set to default date when selector is presented.
///
/// - SeeAlso:
/// `optionCurrentDates`
///
/// - Note:
/// Defaults to current date and time, with time rounded off to the nearest hour.
open var optionCurrentDate = Date().minute < 30 ? Date().beginningOfHour : Date().beginningOfHour + 1.hour
/// Set the default dates when selector is presented.
///
/// - SeeAlso:
/// `optionCurrentDate`
///
/// - Note:
/// Selector will show the earliest selected date's month by default.
open var optionCurrentDates: Set<Date> = []
/// Set the default dates when selector is presented.
///
/// - SeeAlso:
/// `optionCurrentDate`
///
/// - Note:
/// Selector will show the earliest selected date's month by default.
open var optionCurrentDateRange: WWCalendarTimeSelectorDateRange = WWCalendarTimeSelectorDateRange()
/// Set the background blur effect, where background is a `UIVisualEffectView`. Available options are as `UIBlurEffectStyle`:
///
/// `Dark`
///
/// `Light`
///
/// `ExtraLight`
open var optionStyleBlurEffect: UIBlurEffectStyle = .dark
/// Set `optionMultipleSelectionGrouping` with one of the following:
///
/// `Simple`: No grouping for multiple selection. Selected dates are displayed as individual circles.
///
/// `Pill`: This is the default. Pill-like grouping where dates are grouped only if they are adjacent to each other (+- 1 day).
///
/// `LinkedBalls`: Smaller circular selection, with a bar connecting adjacent dates.
open var optionMultipleSelectionGrouping: WWCalendarTimeSelectorMultipleSelectionGrouping = .pill
// Fonts & Colors
open var optionCalendarFontMonth = UIFont.systemFont(ofSize: 14)
open var optionCalendarFontDays = UIFont.systemFont(ofSize: 13)
open var optionCalendarFontToday = UIFont.boldSystemFont(ofSize: 13)
open var optionCalendarFontTodayHighlight = UIFont.boldSystemFont(ofSize: 14)
open var optionCalendarFontPastDates = UIFont.systemFont(ofSize: 12)
open var optionCalendarFontPastDatesHighlight = UIFont.systemFont(ofSize: 13)
open var optionCalendarFontFutureDates = UIFont.systemFont(ofSize: 12)
open var optionCalendarFontFutureDatesHighlight = UIFont.systemFont(ofSize: 13)
open var optionCalendarFontColorMonth = UIColor.black
open var optionCalendarFontColorDays = UIColor.black
open var optionCalendarFontColorToday = UIColor.darkGray
open var optionCalendarFontColorTodayHighlight = UIColor.white
open var optionCalendarBackgroundColorTodayHighlight = UIColor.brown
open var optionCalendarBackgroundColorTodayFlash = UIColor.white
open var optionCalendarFontColorPastDates = UIColor.darkGray
open var optionCalendarFontColorPastDatesHighlight = UIColor.white
open var optionCalendarBackgroundColorPastDatesHighlight = UIColor.brown
open var optionCalendarBackgroundColorPastDatesFlash = UIColor.white
open var optionCalendarFontColorFutureDates = UIColor.darkGray
open var optionCalendarFontColorFutureDatesHighlight = UIColor.white
open var optionCalendarBackgroundColorFutureDatesHighlight = UIColor.brown
open var optionCalendarBackgroundColorFutureDatesFlash = UIColor.white
open var optionCalendarFontCurrentYear = UIFont.boldSystemFont(ofSize: 18)
open var optionCalendarFontCurrentYearHighlight = UIFont.boldSystemFont(ofSize: 20)
open var optionCalendarFontColorCurrentYear = UIColor.darkGray
open var optionCalendarFontColorCurrentYearHighlight = UIColor.black
open var optionCalendarFontPastYears = UIFont.boldSystemFont(ofSize: 18)
open var optionCalendarFontPastYearsHighlight = UIFont.boldSystemFont(ofSize: 20)
open var optionCalendarFontColorPastYears = UIColor.darkGray
open var optionCalendarFontColorPastYearsHighlight = UIColor.black
open var optionCalendarFontFutureYears = UIFont.boldSystemFont(ofSize: 18)
open var optionCalendarFontFutureYearsHighlight = UIFont.boldSystemFont(ofSize: 20)
open var optionCalendarFontColorFutureYears = UIColor.darkGray
open var optionCalendarFontColorFutureYearsHighlight = UIColor.black
open var optionClockFontAMPM = UIFont.systemFont(ofSize: 18)
open var optionClockFontAMPMHighlight = UIFont.systemFont(ofSize: 20)
open var optionClockFontColorAMPM = UIColor.black
open var optionClockFontColorAMPMHighlight = UIColor.white
open var optionClockBackgroundColorAMPMHighlight = UIColor.brown
open var optionClockFontHour = UIFont.systemFont(ofSize: 16)
open var optionClockFontHourHighlight = UIFont.systemFont(ofSize: 18)
open var optionClockFontColorHour = UIColor.black
open var optionClockFontColorHourHighlight = UIColor.white
open var optionClockBackgroundColorHourHighlight = UIColor.brown
open var optionClockBackgroundColorHourHighlightNeedle = UIColor.brown
open var optionClockFontMinute = UIFont.systemFont(ofSize: 12)
open var optionClockFontMinuteHighlight = UIFont.systemFont(ofSize: 14)
open var optionClockFontColorMinute = UIColor.black
open var optionClockFontColorMinuteHighlight = UIColor.white
open var optionClockBackgroundColorMinuteHighlight = UIColor.brown
open var optionClockBackgroundColorMinuteHighlightNeedle = UIColor.brown
open var optionClockBackgroundColorFace = UIColor(white: 0.9, alpha: 1)
open var optionClockBackgroundColorCenter = UIColor.black
open var optionButtonShowCancel: Bool = false
open var optionButtonTitleDone: String = "Done"
open var optionButtonTitleCancel: String = "Cancel"
open var optionButtonFontCancel = UIFont.systemFont(ofSize: 16)
open var optionButtonFontDone = UIFont.boldSystemFont(ofSize: 16)
open var optionButtonFontColorCancel = UIColor.brown
open var optionButtonFontColorDone = UIColor.brown
open var optionButtonFontColorCancelHighlight = UIColor.brown.withAlphaComponent(0.25)
open var optionButtonFontColorDoneHighlight = UIColor.brown.withAlphaComponent(0.25)
open var optionButtonBackgroundColorCancel = UIColor.clear
open var optionButtonBackgroundColorDone = UIColor.clear
open var optionTopPanelBackgroundColor = UIColor.brown
open var optionTopPanelFont = UIFont.systemFont(ofSize: 16)
open var optionTopPanelFontColor = UIColor.white
open var optionSelectorPanelFontMonth = UIFont.systemFont(ofSize: 16)
open var optionSelectorPanelFontDate = UIFont.systemFont(ofSize: 16)
open var optionSelectorPanelFontYear = UIFont.systemFont(ofSize: 16)
open var optionSelectorPanelFontTime = UIFont.systemFont(ofSize: 16)
open var optionSelectorPanelFontMultipleSelection = UIFont.systemFont(ofSize: 16)
open var optionSelectorPanelFontMultipleSelectionHighlight = UIFont.systemFont(ofSize: 17)
open var optionSelectorPanelFontColorMonth = UIColor(white: 1, alpha: 0.5)
open var optionSelectorPanelFontColorMonthHighlight = UIColor.white
open var optionSelectorPanelFontColorDate = UIColor(white: 1, alpha: 0.5)
open var optionSelectorPanelFontColorDateHighlight = UIColor.white
open var optionSelectorPanelFontColorYear = UIColor(white: 1, alpha: 0.5)
open var optionSelectorPanelFontColorYearHighlight = UIColor.white
open var optionSelectorPanelFontColorTime = UIColor(white: 1, alpha: 0.5)
open var optionSelectorPanelFontColorTimeHighlight = UIColor.white
open var optionSelectorPanelFontColorMultipleSelection = UIColor.white
open var optionSelectorPanelFontColorMultipleSelectionHighlight = UIColor.white
open var optionSelectorPanelBackgroundColor = UIColor.brown.withAlphaComponent(0.9)
open var optionMainPanelBackgroundColor = UIColor.white
open var optionBottomPanelBackgroundColor = UIColor.white
/// Set global tint color.
open var optionTintColor : UIColor! {
get{
return tintColor
}
set(color){
tintColor = color;
optionCalendarFontColorMonth = UIColor.black
optionCalendarFontColorDays = UIColor.black
optionCalendarFontColorToday = UIColor.darkGray
optionCalendarFontColorTodayHighlight = UIColor.white
optionCalendarBackgroundColorTodayHighlight = tintColor
optionCalendarBackgroundColorTodayFlash = UIColor.white
optionCalendarFontColorPastDates = UIColor.darkGray
optionCalendarFontColorPastDatesHighlight = UIColor.white
optionCalendarBackgroundColorPastDatesHighlight = tintColor
optionCalendarBackgroundColorPastDatesFlash = UIColor.white
optionCalendarFontColorFutureDates = UIColor.darkGray
optionCalendarFontColorFutureDatesHighlight = UIColor.white
optionCalendarBackgroundColorFutureDatesHighlight = tintColor
optionCalendarBackgroundColorFutureDatesFlash = UIColor.white
optionCalendarFontColorCurrentYear = UIColor.darkGray
optionCalendarFontColorCurrentYearHighlight = UIColor.black
optionCalendarFontColorPastYears = UIColor.darkGray
optionCalendarFontColorPastYearsHighlight = UIColor.black
optionCalendarFontColorFutureYears = UIColor.darkGray
optionCalendarFontColorFutureYearsHighlight = UIColor.black
optionClockFontColorAMPM = UIColor.black
optionClockFontColorAMPMHighlight = UIColor.white
optionClockBackgroundColorAMPMHighlight = tintColor
optionClockFontColorHour = UIColor.black
optionClockFontColorHourHighlight = UIColor.white
optionClockBackgroundColorHourHighlight = tintColor
optionClockBackgroundColorHourHighlightNeedle = tintColor
optionClockFontColorMinute = UIColor.black
optionClockFontColorMinuteHighlight = UIColor.white
optionClockBackgroundColorMinuteHighlight = tintColor
optionClockBackgroundColorMinuteHighlightNeedle = tintColor
optionClockBackgroundColorFace = UIColor(white: 0.9, alpha: 1)
optionClockBackgroundColorCenter = UIColor.black
optionButtonFontColorCancel = tintColor
optionButtonFontColorDone = tintColor
optionButtonFontColorCancelHighlight = tintColor.withAlphaComponent(0.25)
optionButtonFontColorDoneHighlight = tintColor.withAlphaComponent(0.25)
optionButtonBackgroundColorCancel = UIColor.clear
optionButtonBackgroundColorDone = UIColor.clear
optionTopPanelBackgroundColor = tintColor
optionTopPanelFontColor = UIColor.white
optionSelectorPanelFontColorMonth = UIColor(white: 1, alpha: 0.5)
optionSelectorPanelFontColorMonthHighlight = UIColor.white
optionSelectorPanelFontColorDate = UIColor(white: 1, alpha: 0.5)
optionSelectorPanelFontColorDateHighlight = UIColor.white
optionSelectorPanelFontColorYear = UIColor(white: 1, alpha: 0.5)
optionSelectorPanelFontColorYearHighlight = UIColor.white
optionSelectorPanelFontColorTime = UIColor(white: 1, alpha: 0.5)
optionSelectorPanelFontColorTimeHighlight = UIColor.white
optionSelectorPanelFontColorMultipleSelection = UIColor.white
optionSelectorPanelFontColorMultipleSelectionHighlight = UIColor.white
optionSelectorPanelBackgroundColor = tintColor.withAlphaComponent(0.9)
optionMainPanelBackgroundColor = UIColor.white
optionBottomPanelBackgroundColor = UIColor.white
}
}
/// This is the month's offset when user is in selection of dates mode. A positive number will adjusts the month higher, while a negative number will adjust the month lower.
///
/// - Note:
/// Defaults to 30.
open var optionSelectorPanelOffsetHighlightMonth: CGFloat = 30
/// This is the date's offset when user is in selection of dates mode. A positive number will adjusts the date lower, while a negative number will adjust the date higher.
///
/// - Note:
/// Defaults to 24.
open var optionSelectorPanelOffsetHighlightDate: CGFloat = 24
/// This is the scale of the month when it is in active view.
open var optionSelectorPanelScaleMonth: CGFloat = 2.5
open var optionSelectorPanelScaleDate: CGFloat = 4.5
open var optionSelectorPanelScaleYear: CGFloat = 4
open var optionSelectorPanelScaleTime: CGFloat = 2.75
/// This is the height calendar's "title bar". If you wish to hide the Top Panel, consider `optionShowTopPanel`
///
/// - SeeAlso:
/// `optionShowTopPanel`
open var optionLayoutTopPanelHeight: CGFloat = 28
/// The height of the calendar in portrait mode. This will be translated automatically into the width in landscape mode.
open var optionLayoutHeight: CGFloat?
/// The width of the calendar in portrait mode. This will be translated automatically into the height in landscape mode.
open var optionLayoutWidth: CGFloat?
/// If optionLayoutHeight is not defined, this ratio is used on the screen's height.
open var optionLayoutHeightRatio: CGFloat = 0.9
/// If optionLayoutWidth is not defined, this ratio is used on the screen's width.
open var optionLayoutWidthRatio: CGFloat = 0.85
/// When calendar is in portrait mode, the ratio of *Top Container* to *Bottom Container*.
///
/// - Note: Defaults to 7 / 20
open var optionLayoutPortraitRatio: CGFloat = 7/20
/// When calendar is in landscape mode, the ratio of *Top Container* to *Bottom Container*.
///
/// - Note: Defaults to 3 / 8
open var optionLayoutLandscapeRatio: CGFloat = 3/8
// All Views
@IBOutlet fileprivate weak var topContainerView: UIView!
@IBOutlet fileprivate weak var bottomContainerView: UIView!
@IBOutlet fileprivate weak var backgroundDayView: UIView!
@IBOutlet fileprivate weak var backgroundSelView: UIView!
@IBOutlet fileprivate weak var backgroundRangeView: UIView!
@IBOutlet fileprivate weak var backgroundContentView: UIView!
@IBOutlet fileprivate weak var backgroundButtonsView: UIView!
@IBOutlet fileprivate weak var cancelButton: UIButton!
@IBOutlet fileprivate weak var doneButton: UIButton!
@IBOutlet fileprivate weak var selDateView: UIView!
@IBOutlet fileprivate weak var selYearView: UIView!
@IBOutlet fileprivate weak var selTimeView: UIView!
@IBOutlet fileprivate weak var selMultipleDatesTable: UITableView!
@IBOutlet fileprivate weak var dayLabel: UILabel!
@IBOutlet fileprivate weak var monthLabel: UILabel!
@IBOutlet fileprivate weak var dateLabel: UILabel!
@IBOutlet fileprivate weak var yearLabel: UILabel!
@IBOutlet fileprivate weak var timeLabel: UILabel!
@IBOutlet fileprivate weak var rangeStartLabel: UILabel!
@IBOutlet fileprivate weak var rangeToLabel: UILabel!
@IBOutlet fileprivate weak var rangeEndLabel: UILabel!
@IBOutlet fileprivate weak var calendarTable: UITableView!
@IBOutlet fileprivate weak var yearTable: UITableView!
@IBOutlet fileprivate weak var clockView: WWClock!
@IBOutlet fileprivate weak var monthsView: UIView!
@IBOutlet fileprivate var monthsButtons: [UIButton]!
// All Constraints
@IBOutlet fileprivate weak var dayViewHeightConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var topContainerTopConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var topContainerLeftConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var topContainerWidthConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var topContainerHeightConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var bottomContainerTopConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var bottomContainerLeftConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var bottomContainerWidthConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var bottomContainerHeightConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selMonthXConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selMonthYConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selDateXConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selDateYConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selDateTopConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selDateLeftConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selDateRightConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selDateHeightConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selYearTopConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selYearLeftConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selYearRightConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selYearHeightConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selTimeTopConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selTimeLeftConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selTimeRightConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var selTimeHeightConstraint: NSLayoutConstraint!
// Private Variables
fileprivate let selAnimationDuration: TimeInterval = 0.4
fileprivate let selInactiveHeight: CGFloat = 48
fileprivate var portraitContainerWidth: CGFloat { return optionLayoutWidth ?? optionLayoutWidthRatio * portraitWidth }
fileprivate var portraitTopContainerHeight: CGFloat { return optionShowTopContainer ? (optionLayoutHeight ?? optionLayoutHeightRatio * portraitHeight) * optionLayoutPortraitRatio : 0 }
fileprivate var portraitBottomContainerHeight: CGFloat { return (optionLayoutHeight ?? optionLayoutHeightRatio * portraitHeight) - portraitTopContainerHeight }
fileprivate var landscapeContainerHeight: CGFloat { return optionLayoutWidth ?? optionLayoutWidthRatio * portraitWidth }
fileprivate var landscapeTopContainerWidth: CGFloat { return optionShowTopContainer ? (optionLayoutHeight ?? optionLayoutHeightRatio * portraitHeight) * optionLayoutLandscapeRatio : 0 }
fileprivate var landscapeBottomContainerWidth: CGFloat { return (optionLayoutHeight ?? optionLayoutHeightRatio * portraitHeight) - landscapeTopContainerWidth }
fileprivate var selActiveHeight: CGFloat { return backgroundSelView.frame.height - selInactiveHeight }
fileprivate var selInactiveWidth: CGFloat { return backgroundSelView.frame.width / 2 }
fileprivate var selActiveWidth: CGFloat { return backgroundSelView.frame.height - selInactiveHeight }
fileprivate var selCurrrent: WWCalendarTimeSelectorStyle = WWCalendarTimeSelectorStyle(isSingular: true)
fileprivate var isFirstLoad = false
fileprivate var selTimeStateHour = true
fileprivate var calRow1Type: WWCalendarRowType = WWCalendarRowType.date
fileprivate var calRow2Type: WWCalendarRowType = WWCalendarRowType.date
fileprivate var calRow3Type: WWCalendarRowType = WWCalendarRowType.date
fileprivate var calRow1StartDate: Date = Date()
fileprivate var calRow2StartDate: Date = Date()
fileprivate var calRow3StartDate: Date = Date()
fileprivate var yearRow1: Int = 2016
fileprivate var multipleDates: [Date] { return optionCurrentDates.sorted(by: { $0.compare($1) == ComparisonResult.orderedAscending }) }
fileprivate var multipleDatesLastAdded: Date?
fileprivate var flashDate: Date?
fileprivate let defaultTopPanelTitleForMultipleDates = "Select Multiple Dates"
fileprivate var viewBoundsHeight: CGFloat {
return view.bounds.height - topLayoutGuide.length - bottomLayoutGuide.length
}
fileprivate var viewBoundsWidth: CGFloat {
return view.bounds.width
}
fileprivate var portraitHeight: CGFloat {
return max(viewBoundsHeight, viewBoundsWidth)
}
fileprivate var portraitWidth: CGFloat {
return min(viewBoundsHeight, viewBoundsWidth)
}
fileprivate var isSelectingStartRange: Bool = true { didSet { rangeStartLabel.textColor = isSelectingStartRange ? optionSelectorPanelFontColorDateHighlight : optionSelectorPanelFontColorDate; rangeEndLabel.textColor = isSelectingStartRange ? optionSelectorPanelFontColorDate : optionSelectorPanelFontColorDateHighlight } }
fileprivate var shouldResetRange: Bool = true
fileprivate var tintColor : UIColor! = UIColor.brown
/// Only use this method to instantiate the selector. All customization should be done before presenting the selector to the user.
/// To receive callbacks from selector, set the `delegate` of selector and implement `WWCalendarTimeSelectorProtocol`.
///
/// let selector = WWCalendarTimeSelector.instantiate()
/// selector.delegate = self
/// presentViewController(selector, animated: true, completion: nil)
///
open static func instantiate() -> WWCalendarTimeSelector {
let podBundle = Bundle(for: self.classForCoder())
let bundleURL = podBundle.url(forResource: "WWCalendarTimeSelectorStoryboardBundle", withExtension: "bundle")
var bundle: Bundle?
if let bundleURL = bundleURL {
bundle = Bundle(url: bundleURL)
}
return UIStoryboard(name: "WWCalendarTimeSelector", bundle: bundle).instantiateInitialViewController() as! WWCalendarTimeSelector
}
open override func awakeFromNib() {
super.awakeFromNib()
modalPresentationStyle = UIModalPresentationStyle.overCurrentContext
modalTransitionStyle = UIModalTransitionStyle.crossDissolve
}
open override func viewDidLoad() {
super.viewDidLoad()
// Take up the whole view when pushed from a navigation controller
if navigationController != nil {
optionLayoutWidthRatio = 1
optionLayoutHeightRatio = 1
}
// Add background
let background: UIView
if navigationController != nil {
background = UIView()
background.backgroundColor = UIColor.white
} else {
background = UIVisualEffectView(effect: UIBlurEffect(style: optionStyleBlurEffect))
}
background.translatesAutoresizingMaskIntoConstraints = false
view.insertSubview(background, at: 0)
view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[bg]|", options: [], metrics: nil, views: ["bg": background]))
view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[bg]|", options: [], metrics: nil, views: ["bg": background]))
let seventhRowStartDate = optionCurrentDate.beginningOfMonth
calRow3StartDate = ((seventhRowStartDate - 1.day).beginningOfWeek - 1.day).beginningOfWeek
calRow2StartDate = (calRow3StartDate - 1.day).beginningOfWeek
calRow1StartDate = (calRow2StartDate - 1.day).beginningOfWeek
yearRow1 = optionCurrentDate.year - 5
selMultipleDatesTable.isHidden = optionSelectionType != .multiple
backgroundSelView.isHidden = optionSelectionType != .single
backgroundRangeView.isHidden = optionSelectionType != .range
dayViewHeightConstraint.constant = optionShowTopPanel ? optionLayoutTopPanelHeight : 0
view.layoutIfNeeded()
UIDevice.current.beginGeneratingDeviceOrientationNotifications()
NotificationCenter.default.addObserver(self, selector: #selector(WWCalendarTimeSelector.didRotateOrNot), name: NSNotification.Name.UIDeviceOrientationDidChange, object: nil)
backgroundDayView.backgroundColor = optionTopPanelBackgroundColor
backgroundSelView.backgroundColor = optionSelectorPanelBackgroundColor
backgroundRangeView.backgroundColor = optionSelectorPanelBackgroundColor
backgroundContentView.backgroundColor = optionMainPanelBackgroundColor
backgroundButtonsView.backgroundColor = optionBottomPanelBackgroundColor
selMultipleDatesTable.backgroundColor = optionSelectorPanelBackgroundColor
doneButton.backgroundColor = optionButtonBackgroundColorDone
cancelButton.backgroundColor = optionButtonBackgroundColorCancel
doneButton.setAttributedTitle(NSAttributedString(string: optionButtonTitleDone, attributes: [NSAttributedStringKey.font: optionButtonFontDone, NSAttributedStringKey.foregroundColor: optionButtonFontColorDone]), for: UIControlState())
cancelButton.setAttributedTitle(NSAttributedString(string: optionButtonTitleCancel, attributes: [NSAttributedStringKey.font: optionButtonFontCancel, NSAttributedStringKey.foregroundColor: optionButtonFontColorCancel]), for: UIControlState())
doneButton.setAttributedTitle(NSAttributedString(string: optionButtonTitleDone, attributes: [NSAttributedStringKey.font: optionButtonFontDone, NSAttributedStringKey.foregroundColor: optionButtonFontColorDoneHighlight]), for: UIControlState.highlighted)
cancelButton.setAttributedTitle(NSAttributedString(string: optionButtonTitleCancel, attributes: [NSAttributedStringKey.font: optionButtonFontCancel, NSAttributedStringKey.foregroundColor: optionButtonFontColorCancelHighlight]), for: UIControlState.highlighted)
if !optionButtonShowCancel {
cancelButton.isHidden = true
}
dayLabel.textColor = optionTopPanelFontColor
dayLabel.font = optionTopPanelFont
monthLabel.font = optionSelectorPanelFontMonth
dateLabel.font = optionSelectorPanelFontDate
yearLabel.font = optionSelectorPanelFontYear
rangeStartLabel.font = optionSelectorPanelFontDate
rangeEndLabel.font = optionSelectorPanelFontDate
rangeToLabel.font = optionSelectorPanelFontDate
let firstMonth = Date().beginningOfYear
for button in monthsButtons {
button.setTitle((firstMonth + button.tag.month).stringFromFormat("MMM"), for: UIControlState())
button.titleLabel?.font = optionCalendarFontMonth
button.tintColor = optionCalendarFontColorMonth
}
clockView.delegate = self
clockView.minuteStep = optionTimeStep
clockView.backgroundColorClockFace = optionClockBackgroundColorFace
clockView.backgroundColorClockFaceCenter = optionClockBackgroundColorCenter
clockView.fontAMPM = optionClockFontAMPM
clockView.fontAMPMHighlight = optionClockFontAMPMHighlight
clockView.fontColorAMPM = optionClockFontColorAMPM
clockView.fontColorAMPMHighlight = optionClockFontColorAMPMHighlight
clockView.backgroundColorAMPMHighlight = optionClockBackgroundColorAMPMHighlight
clockView.fontHour = optionClockFontHour
clockView.fontHourHighlight = optionClockFontHourHighlight
clockView.fontColorHour = optionClockFontColorHour
clockView.fontColorHourHighlight = optionClockFontColorHourHighlight
clockView.backgroundColorHourHighlight = optionClockBackgroundColorHourHighlight
clockView.backgroundColorHourHighlightNeedle = optionClockBackgroundColorHourHighlightNeedle
clockView.fontMinute = optionClockFontMinute
clockView.fontMinuteHighlight = optionClockFontMinuteHighlight
clockView.fontColorMinute = optionClockFontColorMinute
clockView.fontColorMinuteHighlight = optionClockFontColorMinuteHighlight
clockView.backgroundColorMinuteHighlight = optionClockBackgroundColorMinuteHighlight
clockView.backgroundColorMinuteHighlightNeedle = optionClockBackgroundColorMinuteHighlightNeedle
updateDate()
isFirstLoad = true
}
open override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
if isFirstLoad {
isFirstLoad = false // Temp fix for i6s+ bug?
calendarTable.reloadData()
yearTable.reloadData()
clockView.setNeedsDisplay()
selMultipleDatesTable.reloadData()
self.didRotateOrNot(animated: false)
if optionStyles.showDateMonth {
showDate(true, animated: false)
}
else if optionStyles.showMonth {
showMonth(true, animated: false)
}
else if optionStyles.showYear {
showYear(true, animated: false)
}
else if optionStyles.showTime {
showTime(true, animated: false)
}
}
}
open override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
isFirstLoad = false
}
open override var preferredStatusBarStyle: UIStatusBarStyle {
return UIStatusBarStyle.lightContent
}
@objc internal func didRotateOrNot(animated: Bool = true) {
let orientation = UIApplication.shared.statusBarOrientation
if orientation == .landscapeLeft || orientation == .landscapeRight || orientation == .portrait || orientation == .portraitUpsideDown {
let isPortrait = orientation == .portrait || orientation == .portraitUpsideDown
let size = CGSize(width: viewBoundsWidth, height: viewBoundsHeight)
topContainerWidthConstraint.constant = isPortrait ? optionShowTopContainer ? portraitContainerWidth : 0 : landscapeTopContainerWidth
topContainerHeightConstraint.constant = isPortrait ? portraitTopContainerHeight : optionShowTopContainer ? landscapeContainerHeight : 0
bottomContainerWidthConstraint.constant = isPortrait ? portraitContainerWidth : landscapeBottomContainerWidth
bottomContainerHeightConstraint.constant = isPortrait ? portraitBottomContainerHeight : landscapeContainerHeight
if isPortrait {
let width = min(size.width, size.height)
let height = max(size.width, size.height)
topContainerLeftConstraint.constant = (width - topContainerWidthConstraint.constant) / 2
topContainerTopConstraint.constant = (height - (topContainerHeightConstraint.constant + bottomContainerHeightConstraint.constant)) / 2
bottomContainerLeftConstraint.constant = optionShowTopContainer ? topContainerLeftConstraint.constant : (width - bottomContainerWidthConstraint.constant) / 2
bottomContainerTopConstraint.constant = topContainerTopConstraint.constant + topContainerHeightConstraint.constant
}
else {
let width = max(size.width, size.height)
let height = min(size.width, size.height)
topContainerLeftConstraint.constant = (width - (topContainerWidthConstraint.constant + bottomContainerWidthConstraint.constant)) / 2
topContainerTopConstraint.constant = (height - topContainerHeightConstraint.constant) / 2
bottomContainerLeftConstraint.constant = topContainerLeftConstraint.constant + topContainerWidthConstraint.constant
bottomContainerTopConstraint.constant = optionShowTopContainer ? topContainerTopConstraint.constant : (height - bottomContainerHeightConstraint.constant) / 2
}
if animated {
UIView.animate(
withDuration: selAnimationDuration,
delay: 0,
usingSpringWithDamping: 0.8,
initialSpringVelocity: 0,
options: [UIViewAnimationOptions.allowAnimatedContent, UIViewAnimationOptions.allowUserInteraction],
animations: {
self.view.layoutIfNeeded()
},
completion: nil
)
} else {
self.view.layoutIfNeeded()
}
if selCurrrent.showDateMonth {
showDate(false, animated: animated)
}
else if selCurrrent.showMonth {
showMonth(false, animated: animated)
}
else if selCurrrent.showYear {
showYear(false, animated: animated)
}
else if selCurrrent.showTime {
showTime(false, animated: animated)
}
}
}
open override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.all
}
open override var shouldAutorotate: Bool {
return false
}
@IBAction func selectMonth(_ sender: UIButton) {
let date = (optionCurrentDate.beginningOfYear + sender.tag.months).beginningOfDay
if delegate?.WWCalendarTimeSelectorShouldSelectDate?(self, date: date) ?? true {
optionCurrentDate = optionCurrentDate.change(year: date.year, month: date.month, day: date.day).beginningOfDay
updateDate()
}
}
@IBAction func selectStartRange() {
if isSelectingStartRange == true {
let date = optionCurrentDateRange.start
let seventhRowStartDate = date.beginningOfMonth
calRow3StartDate = ((seventhRowStartDate - 1.day).beginningOfWeek - 1.day).beginningOfWeek
calRow2StartDate = (calRow3StartDate - 1.day).beginningOfWeek
calRow1StartDate = (calRow2StartDate - 1.day).beginningOfWeek
flashDate = date
calendarTable.reloadData()
calendarTable.scrollToRow(at: IndexPath(row: 4, section: 0), at: UITableViewScrollPosition.top, animated: true)
}
else {
isSelectingStartRange = true
}
shouldResetRange = false
updateDate()
}
@IBAction func selectEndRange() {
if isSelectingStartRange == false {
let date = optionCurrentDateRange.end
let seventhRowStartDate = date.beginningOfMonth
calRow3StartDate = ((seventhRowStartDate - 1.day).beginningOfWeek - 1.day).beginningOfWeek
calRow2StartDate = (calRow3StartDate - 1.day).beginningOfWeek
calRow1StartDate = (calRow2StartDate - 1.day).beginningOfWeek
flashDate = date
calendarTable.reloadData()
calendarTable.scrollToRow(at: IndexPath(row: 4, section: 0), at: UITableViewScrollPosition.top, animated: true)
}
else {
isSelectingStartRange = false
}
shouldResetRange = false
updateDate()
}
@IBAction func showDate() {
if optionStyles.showDateMonth {
showDate(true)
}
else {
showMonth(true)
}
}
@IBAction func showYear() {
showYear(true)
}
@IBAction func showTime() {
showTime(true)
}
@IBAction func cancel() {
let picker = self
let del = delegate
if optionSelectionType == .single {
del?.WWCalendarTimeSelectorCancel?(picker, date: optionCurrentDate)
}
else {
del?.WWCalendarTimeSelectorCancel?(picker, dates: multipleDates)
}
dismiss()
}
@IBAction func done() {
let picker = self
let del = delegate
switch optionSelectionType {
case .single:
del?.WWCalendarTimeSelectorDone?(picker, date: optionCurrentDate)
case .multiple:
del?.WWCalendarTimeSelectorDone?(picker, dates: multipleDates)
case .range:
del?.WWCalendarTimeSelectorDone?(picker, dates: optionCurrentDateRange.array)
}
dismiss()
}
fileprivate func dismiss() {
let picker = self
let del = delegate
del?.WWCalendarTimeSelectorWillDismiss?(picker)
if let navigationController = self.navigationController {
navigationController.popViewController(animated: true)
del?.WWCalendarTimeSelectorDidDismiss?(picker)
} else if presentingViewController != nil {
dismiss(animated: true) {
del?.WWCalendarTimeSelectorDidDismiss?(picker)
}
}
}
fileprivate func showDate(_ userTap: Bool, animated: Bool = true) {
changeSelDate(animated: animated)
if userTap {
let seventhRowStartDate = optionCurrentDate.beginningOfMonth
calRow3StartDate = ((seventhRowStartDate - 1.day).beginningOfWeek - 1.day).beginningOfWeek
calRow2StartDate = (calRow3StartDate - 1.day).beginningOfWeek
calRow1StartDate = (calRow2StartDate - 1.day).beginningOfWeek
calendarTable.reloadData()
calendarTable.scrollToRow(at: IndexPath(row: 4, section: 0), at: UITableViewScrollPosition.top, animated: animated)
}
else {
calendarTable.reloadData()
}
let animations = {
self.calendarTable.alpha = 1
self.monthsView.alpha = 0
self.yearTable.alpha = 0
self.clockView.alpha = 0
}
if animated {
UIView.animate(
withDuration: selAnimationDuration,
delay: 0,
options: [UIViewAnimationOptions.allowAnimatedContent, UIViewAnimationOptions.beginFromCurrentState, UIViewAnimationOptions.allowUserInteraction, UIViewAnimationOptions.curveEaseOut],
animations: animations,
completion: nil
)
} else {
animations()
}
}
fileprivate func showMonth(_ userTap: Bool, animated: Bool = true) {
changeSelMonth(animated: animated)
if userTap {
}
else {
}
let animations = {
self.calendarTable.alpha = 0
self.monthsView.alpha = 1
self.yearTable.alpha = 0
self.clockView.alpha = 0
}
if animated {
UIView.animate(
withDuration: selAnimationDuration,
delay: 0,
options: [UIViewAnimationOptions.allowAnimatedContent, UIViewAnimationOptions.beginFromCurrentState, UIViewAnimationOptions.allowUserInteraction, UIViewAnimationOptions.curveEaseOut],
animations: animations,
completion: nil
)
} else {
animations()
}
}
fileprivate func showYear(_ userTap: Bool, animated: Bool = true) {
changeSelYear(animated: animated)
if userTap {
yearRow1 = optionCurrentDate.year - 5
yearTable.reloadData()
yearTable.scrollToRow(at: IndexPath(row: 3, section: 0), at: UITableViewScrollPosition.top, animated: animated)
}
else {
yearTable.reloadData()
}
let animations = {
self.calendarTable.alpha = 0
self.monthsView.alpha = 0
self.yearTable.alpha = 1
self.clockView.alpha = 0
}
if animated {
UIView.animate(
withDuration: selAnimationDuration,
delay: 0,
options: [UIViewAnimationOptions.allowAnimatedContent, UIViewAnimationOptions.beginFromCurrentState, UIViewAnimationOptions.allowUserInteraction, UIViewAnimationOptions.curveEaseOut],
animations: animations,
completion: nil
)
} else {
animations()
}
}
fileprivate func showTime(_ userTap: Bool, animated: Bool = true) {
if userTap {
if selCurrrent.showTime {
selTimeStateHour = !selTimeStateHour
}
else {
selTimeStateHour = true
}
}
if optionTimeStep == .sixtyMinutes {
selTimeStateHour = true
}
changeSelTime(animated: animated)
if userTap {
clockView.showingHour = selTimeStateHour
}
clockView.setNeedsDisplay()
if animated {
UIView.transition(
with: clockView,
duration: selAnimationDuration / 2,
options: [UIViewAnimationOptions.transitionCrossDissolve],
animations: {
self.clockView.layer.displayIfNeeded()
},
completion: nil
)
} else {
self.clockView.layer.displayIfNeeded()
}
let animations = {
self.calendarTable.alpha = 0
self.monthsView.alpha = 0
self.yearTable.alpha = 0
self.clockView.alpha = 1
}
if animated {
UIView.animate(
withDuration: selAnimationDuration,
delay: 0,
options: [UIViewAnimationOptions.allowAnimatedContent, UIViewAnimationOptions.beginFromCurrentState, UIViewAnimationOptions.allowUserInteraction, UIViewAnimationOptions.curveEaseOut],
animations: animations,
completion: nil
)
} else {
animations()
}
}
fileprivate func updateDate() {
if let topPanelTitle = optionTopPanelTitle {
dayLabel.text = topPanelTitle
}
else {
if optionSelectionType == .single {
if optionStyles.showMonth {
dayLabel.text = optionCurrentDate.stringFromFormat("MMMM")
}
else {
dayLabel.text = optionCurrentDate.stringFromFormat("EEEE")
}
}
else {
dayLabel.text = defaultTopPanelTitleForMultipleDates
}
}
monthLabel.text = optionCurrentDate.stringFromFormat("MMM")
dateLabel.text = optionStyles.showDateMonth ? optionCurrentDate.stringFromFormat("d") : nil
yearLabel.text = optionCurrentDate.stringFromFormat("yyyy")
rangeStartLabel.text = optionCurrentDateRange.start.stringFromFormat("d' 'MMM' 'yyyy")
rangeEndLabel.text = optionCurrentDateRange.end.stringFromFormat("d' 'MMM' 'yyyy")
rangeToLabel.textColor = optionSelectorPanelFontColorDate
if shouldResetRange {
rangeStartLabel.textColor = optionSelectorPanelFontColorDateHighlight
rangeEndLabel.textColor = optionSelectorPanelFontColorDateHighlight
}
else {
rangeStartLabel.textColor = isSelectingStartRange ? optionSelectorPanelFontColorDateHighlight : optionSelectorPanelFontColorDate
rangeEndLabel.textColor = isSelectingStartRange ? optionSelectorPanelFontColorDate : optionSelectorPanelFontColorDateHighlight
}
let timeText = optionCurrentDate.stringFromFormat("h':'mma").lowercased()
let paragraph = NSMutableParagraphStyle()
paragraph.alignment = NSTextAlignment.center
let attrText = NSMutableAttributedString(string: timeText, attributes: [NSAttributedStringKey.font: optionSelectorPanelFontTime, NSAttributedStringKey.foregroundColor: optionSelectorPanelFontColorTime, NSAttributedStringKey.paragraphStyle: paragraph])
if selCurrrent.showDateMonth {
monthLabel.textColor = optionSelectorPanelFontColorMonthHighlight
dateLabel.textColor = optionSelectorPanelFontColorDateHighlight
yearLabel.textColor = optionSelectorPanelFontColorYear
}
else if selCurrrent.showMonth {
monthLabel.textColor = optionSelectorPanelFontColorMonthHighlight
dateLabel.textColor = optionSelectorPanelFontColorDateHighlight
yearLabel.textColor = optionSelectorPanelFontColorYear
}
else if selCurrrent.showYear {
monthLabel.textColor = optionSelectorPanelFontColorMonth
dateLabel.textColor = optionSelectorPanelFontColorDate
yearLabel.textColor = optionSelectorPanelFontColorYearHighlight
}
else if selCurrrent.showTime {
monthLabel.textColor = optionSelectorPanelFontColorMonth
dateLabel.textColor = optionSelectorPanelFontColorDate
yearLabel.textColor = optionSelectorPanelFontColorYear
// let colonIndex2 = timeText.characters.distance(from: timeText.startIndex, to: timeText.range(of: ":")!.lowerBound)
let colonIndex = Substring(timeText).distance(from: timeText.startIndex, to: timeText.range(of: ":")!.lowerBound)
let hourRange = NSRange(location: 0, length: colonIndex)
let minuteRange = NSRange(location: colonIndex + 1, length: 2)
if selTimeStateHour {
attrText.addAttributes([NSAttributedStringKey.foregroundColor: optionSelectorPanelFontColorTimeHighlight], range: hourRange)
}
else {
attrText.addAttributes([NSAttributedStringKey.foregroundColor: optionSelectorPanelFontColorTimeHighlight], range: minuteRange)
}
}
timeLabel.attributedText = attrText
}
fileprivate func changeSelDate(animated: Bool = true) {
let selActiveHeight = self.selActiveHeight
let selInactiveHeight = self.selInactiveHeight
let selInactiveWidth = self.selInactiveWidth
let selInactiveWidthDouble = selInactiveWidth * 2
let selActiveHeightFull = backgroundSelView.frame.height
backgroundSelView.sendSubview(toBack: selYearView)
backgroundSelView.sendSubview(toBack: selTimeView)
// adjust date view (because it's complicated)
selMonthXConstraint.constant = 0
selMonthYConstraint.constant = -optionSelectorPanelOffsetHighlightMonth
selDateXConstraint.constant = 0
selDateYConstraint.constant = optionSelectorPanelOffsetHighlightDate
// adjust positions
selDateTopConstraint.constant = 0
selDateLeftConstraint.constant = 0
selDateRightConstraint.constant = 0
selDateHeightConstraint.constant = optionStyles.countComponents() > 1 ? selActiveHeight : selActiveHeightFull
selYearLeftConstraint.constant = 0
selTimeRightConstraint.constant = 0
if optionStyles.showYear {
selYearTopConstraint.constant = selActiveHeight
selYearHeightConstraint.constant = selInactiveHeight
if optionStyles.showTime {
selYearRightConstraint.constant = selInactiveWidth
selTimeHeightConstraint.constant = selInactiveHeight
selTimeTopConstraint.constant = selActiveHeight
selTimeLeftConstraint.constant = selInactiveWidth
}
else {
selYearRightConstraint.constant = 0
selTimeHeightConstraint.constant = 0
selTimeTopConstraint.constant = 0
selTimeLeftConstraint.constant = selInactiveWidthDouble
}
}
else {
selYearTopConstraint.constant = 0
selYearHeightConstraint.constant = 0
selYearRightConstraint.constant = selInactiveWidthDouble
if optionStyles.showTime {
selTimeHeightConstraint.constant = selInactiveHeight
selTimeTopConstraint.constant = selActiveHeight
selTimeLeftConstraint.constant = 0
}
else {
selTimeHeightConstraint.constant = 0
selTimeTopConstraint.constant = 0
selTimeLeftConstraint.constant = selInactiveWidthDouble
}
}
monthLabel.contentScaleFactor = UIScreen.main.scale * optionSelectorPanelScaleMonth
dateLabel.contentScaleFactor = UIScreen.main.scale * optionSelectorPanelScaleDate
let animations = {
self.monthLabel.transform = CGAffineTransform.identity.scaledBy(x: self.optionSelectorPanelScaleMonth, y: self.optionSelectorPanelScaleMonth)
self.dateLabel.transform = CGAffineTransform.identity.scaledBy(x: self.optionSelectorPanelScaleDate, y: self.optionSelectorPanelScaleDate)
self.yearLabel.transform = CGAffineTransform.identity
self.timeLabel.transform = CGAffineTransform.identity
self.view.layoutIfNeeded()
}
let completion = { (_: Bool) in
if self.selCurrrent.showDateMonth {
self.yearLabel.contentScaleFactor = UIScreen.main.scale
self.timeLabel.contentScaleFactor = UIScreen.main.scale
}
}
if animated {
UIView.animate(
withDuration: selAnimationDuration,
delay: 0,
usingSpringWithDamping: 0.8,
initialSpringVelocity: 0,
options: [UIViewAnimationOptions.allowAnimatedContent, UIViewAnimationOptions.allowUserInteraction],
animations: animations,
completion: completion
)
} else {
animations()
completion(true)
}
selCurrrent.showDateMonth(true)
updateDate()
}
fileprivate func changeSelMonth(animated: Bool = true) {
let selActiveHeight = self.selActiveHeight
let selInactiveHeight = self.selInactiveHeight
let selInactiveWidth = self.selInactiveWidth
let selInactiveWidthDouble = selInactiveWidth * 2
let selActiveHeightFull = backgroundSelView.frame.height
backgroundSelView.sendSubview(toBack: selYearView)
backgroundSelView.sendSubview(toBack: selTimeView)
// adjust date view
selMonthXConstraint.constant = 0
selMonthYConstraint.constant = 0
selDateXConstraint.constant = 0
selDateYConstraint.constant = 0
// adjust positions
selDateTopConstraint.constant = 0
selDateLeftConstraint.constant = 0
selDateRightConstraint.constant = 0
selDateHeightConstraint.constant = optionStyles.countComponents() > 1 ? selActiveHeight : selActiveHeightFull
selYearLeftConstraint.constant = 0
selTimeRightConstraint.constant = 0
if optionStyles.showYear {
selYearTopConstraint.constant = selActiveHeight
selYearHeightConstraint.constant = selInactiveHeight
if optionStyles.showTime {
selYearRightConstraint.constant = selInactiveWidth
selTimeHeightConstraint.constant = selInactiveHeight
selTimeTopConstraint.constant = selActiveHeight
selTimeLeftConstraint.constant = selInactiveWidth
}
else {
selYearRightConstraint.constant = 0
selTimeHeightConstraint.constant = 0
selTimeTopConstraint.constant = 0
selTimeLeftConstraint.constant = selInactiveWidthDouble
}
}
else {
selYearTopConstraint.constant = 0
selYearHeightConstraint.constant = 0
selYearRightConstraint.constant = selInactiveWidthDouble
if optionStyles.showTime {
selTimeHeightConstraint.constant = selInactiveHeight
selTimeTopConstraint.constant = selActiveHeight
selTimeLeftConstraint.constant = 0
}
else {
selTimeHeightConstraint.constant = 0
selTimeTopConstraint.constant = 0
selTimeLeftConstraint.constant = selInactiveWidthDouble
}
}
monthLabel.contentScaleFactor = UIScreen.main.scale * optionSelectorPanelScaleMonth
dateLabel.contentScaleFactor = UIScreen.main.scale * optionSelectorPanelScaleDate
let animations = {
self.monthLabel.transform = CGAffineTransform.identity.scaledBy(x: self.optionSelectorPanelScaleMonth, y: self.optionSelectorPanelScaleMonth)
self.dateLabel.transform = CGAffineTransform.identity.scaledBy(x: self.optionSelectorPanelScaleDate, y: self.optionSelectorPanelScaleDate)
self.yearLabel.transform = CGAffineTransform.identity
self.timeLabel.transform = CGAffineTransform.identity
self.view.layoutIfNeeded()
}
let completion = { (_: Bool) in
if self.selCurrrent.showMonth {
self.yearLabel.contentScaleFactor = UIScreen.main.scale
self.timeLabel.contentScaleFactor = UIScreen.main.scale
}
}
if animated {
UIView.animate(
withDuration: selAnimationDuration,
delay: 0,
usingSpringWithDamping: 0.8,
initialSpringVelocity: 0,
options: [UIViewAnimationOptions.allowAnimatedContent, UIViewAnimationOptions.allowUserInteraction],
animations: animations,
completion: completion
)
} else {
animations()
completion(true)
}
selCurrrent.showDateMonth(true)
updateDate()
}
fileprivate func changeSelYear(animated: Bool = true) {
let selInactiveHeight = self.selInactiveHeight
let selActiveHeight = self.selActiveHeight
let selInactiveWidth = self.selInactiveWidth
let selMonthX = monthLabel.bounds.width / 2
let selInactiveWidthDouble = selInactiveWidth * 2
let selActiveHeightFull = backgroundSelView.frame.height
backgroundSelView.sendSubview(toBack: selDateView)
backgroundSelView.sendSubview(toBack: selTimeView)
selDateXConstraint.constant = optionStyles.showDateMonth ? -selMonthX : 0
selDateYConstraint.constant = 0
selMonthXConstraint.constant = optionStyles.showDateMonth ? selMonthX : 0
selMonthYConstraint.constant = 0
selYearTopConstraint.constant = 0
selYearLeftConstraint.constant = 0
selYearRightConstraint.constant = 0
selYearHeightConstraint.constant = optionStyles.countComponents() > 1 ? selActiveHeight : selActiveHeightFull
selDateLeftConstraint.constant = 0
selTimeRightConstraint.constant = 0
if optionStyles.showDateMonth || optionStyles.showMonth {
selDateHeightConstraint.constant = selInactiveHeight
selDateTopConstraint.constant = selActiveHeight
if optionStyles.showTime {
selDateRightConstraint.constant = selInactiveWidth
selTimeHeightConstraint.constant = selInactiveHeight
selTimeTopConstraint.constant = selActiveHeight
selTimeLeftConstraint.constant = selInactiveWidth
}
else {
selDateRightConstraint.constant = 0
selTimeHeightConstraint.constant = 0
selTimeTopConstraint.constant = 0
selTimeLeftConstraint.constant = selInactiveWidthDouble
}
}
else {
selDateHeightConstraint.constant = 0
selDateTopConstraint.constant = 0
selDateRightConstraint.constant = selInactiveWidthDouble
if optionStyles.showTime {
selTimeHeightConstraint.constant = selInactiveHeight
selTimeTopConstraint.constant = selActiveHeight
selTimeLeftConstraint.constant = 0
}
else {
selTimeHeightConstraint.constant = 0
selTimeTopConstraint.constant = 0
selTimeLeftConstraint.constant = selInactiveWidthDouble
}
}
yearLabel.contentScaleFactor = UIScreen.main.scale * optionSelectorPanelScaleYear
let animations = {
self.yearLabel.transform = CGAffineTransform.identity.scaledBy(x: self.optionSelectorPanelScaleYear, y: self.optionSelectorPanelScaleYear)
self.monthLabel.transform = CGAffineTransform.identity
self.dateLabel.transform = CGAffineTransform.identity
self.timeLabel.transform = CGAffineTransform.identity
self.view.layoutIfNeeded()
}
let completion = { (_: Bool) in
if self.selCurrrent.showYear {
self.monthLabel.contentScaleFactor = UIScreen.main.scale
self.dateLabel.contentScaleFactor = UIScreen.main.scale
self.timeLabel.contentScaleFactor = UIScreen.main.scale
}
}
if animated {
UIView.animate(
withDuration: selAnimationDuration,
delay: 0,
usingSpringWithDamping: 0.8,
initialSpringVelocity: 0,
options: [UIViewAnimationOptions.allowAnimatedContent, UIViewAnimationOptions.allowUserInteraction],
animations: animations,
completion: completion
)
} else {
animations()
completion(true)
}
selCurrrent.showYear(true)
updateDate()
}
fileprivate func changeSelTime(animated: Bool = true) {
let selInactiveHeight = self.selInactiveHeight
let selActiveHeight = self.selActiveHeight
let selInactiveWidth = self.selInactiveWidth
let selMonthX = monthLabel.bounds.width / 2
let selInactiveWidthDouble = selInactiveWidth * 2
let selActiveHeightFull = backgroundSelView.frame.height
backgroundSelView.sendSubview(toBack: selYearView)
backgroundSelView.sendSubview(toBack: selDateView)
selDateXConstraint.constant = optionStyles.showDateMonth ? -selMonthX : 0
selDateYConstraint.constant = 0
selMonthXConstraint.constant = optionStyles.showDateMonth ? selMonthX : 0
selMonthYConstraint.constant = 0
selTimeTopConstraint.constant = 0
selTimeLeftConstraint.constant = 0
selTimeRightConstraint.constant = 0
selTimeHeightConstraint.constant = optionStyles.countComponents() > 1 ? selActiveHeight : selActiveHeightFull
selDateLeftConstraint.constant = 0
selYearRightConstraint.constant = 0
if optionStyles.showDateMonth || optionStyles.showMonth {
selDateHeightConstraint.constant = selInactiveHeight
selDateTopConstraint.constant = selActiveHeight
if optionStyles.showYear {
selDateRightConstraint.constant = selInactiveWidth
selYearHeightConstraint.constant = selInactiveHeight
selYearTopConstraint.constant = selActiveHeight
selYearLeftConstraint.constant = selInactiveWidth
}
else {
selDateRightConstraint.constant = 0
selYearHeightConstraint.constant = 0
selYearTopConstraint.constant = 0
selYearLeftConstraint.constant = selInactiveWidthDouble
}
}
else {
selDateHeightConstraint.constant = 0
selDateTopConstraint.constant = 0
selDateRightConstraint.constant = selInactiveWidthDouble
if optionStyles.showYear {
selYearHeightConstraint.constant = selInactiveHeight
selYearTopConstraint.constant = selActiveHeight
selYearLeftConstraint.constant = 0
}
else {
selYearHeightConstraint.constant = 0
selYearTopConstraint.constant = 0
selYearLeftConstraint.constant = selInactiveWidthDouble
}
}
timeLabel.contentScaleFactor = UIScreen.main.scale * optionSelectorPanelScaleTime
let animations = {
self.timeLabel.transform = CGAffineTransform.identity.scaledBy(x: self.optionSelectorPanelScaleTime, y: self.optionSelectorPanelScaleTime)
self.monthLabel.transform = CGAffineTransform.identity
self.dateLabel.transform = CGAffineTransform.identity
self.yearLabel.transform = CGAffineTransform.identity
self.view.layoutIfNeeded()
}
let completion = { (_: Bool) in
if self.selCurrrent.showTime {
self.monthLabel.contentScaleFactor = UIScreen.main.scale
self.dateLabel.contentScaleFactor = UIScreen.main.scale
self.yearLabel.contentScaleFactor = UIScreen.main.scale
}
}
if animated {
UIView.animate(
withDuration: selAnimationDuration,
delay: 0,
usingSpringWithDamping: 0.8,
initialSpringVelocity: 0,
options: [UIViewAnimationOptions.allowAnimatedContent, UIViewAnimationOptions.allowUserInteraction],
animations: animations,
completion: completion
)
} else {
animations()
completion(true)
}
selCurrrent.showTime(true)
updateDate()
}
open func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if tableView == calendarTable {
return tableView.frame.height / 8
}
else if tableView == yearTable {
return tableView.frame.height / 5
}
return tableView.frame.height / 5
}
open func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView == calendarTable {
return 16
}
else if tableView == yearTable {
return 11
}
return multipleDates.count
}
open func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
var cell: UITableViewCell
if tableView == calendarTable {
if let c = tableView.dequeueReusableCell(withIdentifier: "cell") {
cell = c
}
else {
cell = UITableViewCell(style: UITableViewCellStyle.default, reuseIdentifier: "cell")
let calRow = WWCalendarRow()
calRow.translatesAutoresizingMaskIntoConstraints = false
calRow.delegate = self
calRow.backgroundColor = UIColor.clear
calRow.monthFont = optionCalendarFontMonth
calRow.monthFontColor = optionCalendarFontColorMonth
calRow.dayFont = optionCalendarFontDays
calRow.dayFontColor = optionCalendarFontColorDays
calRow.datePastFont = optionCalendarFontPastDates
calRow.datePastFontHighlight = optionCalendarFontPastDatesHighlight
calRow.datePastFontColor = optionCalendarFontColorPastDates
calRow.datePastHighlightFontColor = optionCalendarFontColorPastDatesHighlight
calRow.datePastHighlightBackgroundColor = optionCalendarBackgroundColorPastDatesHighlight
calRow.datePastFlashBackgroundColor = optionCalendarBackgroundColorPastDatesFlash
calRow.dateTodayFont = optionCalendarFontToday
calRow.dateTodayFontHighlight = optionCalendarFontTodayHighlight
calRow.dateTodayFontColor = optionCalendarFontColorToday
calRow.dateTodayHighlightFontColor = optionCalendarFontColorTodayHighlight
calRow.dateTodayHighlightBackgroundColor = optionCalendarBackgroundColorTodayHighlight
calRow.dateTodayFlashBackgroundColor = optionCalendarBackgroundColorTodayFlash
calRow.dateFutureFont = optionCalendarFontFutureDates
calRow.dateFutureFontHighlight = optionCalendarFontFutureDatesHighlight
calRow.dateFutureFontColor = optionCalendarFontColorFutureDates
calRow.dateFutureHighlightFontColor = optionCalendarFontColorFutureDatesHighlight
calRow.dateFutureHighlightBackgroundColor = optionCalendarBackgroundColorFutureDatesHighlight
calRow.dateFutureFlashBackgroundColor = optionCalendarBackgroundColorFutureDatesFlash
calRow.flashDuration = selAnimationDuration
calRow.multipleSelectionGrouping = optionMultipleSelectionGrouping
calRow.multipleSelectionEnabled = optionSelectionType != .single
cell.contentView.addSubview(calRow)
cell.backgroundColor = UIColor.clear
cell.contentView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[cr]|", options: [], metrics: nil, views: ["cr": calRow]))
cell.contentView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[cr]|", options: [], metrics: nil, views: ["cr": calRow]))
}
for sv in cell.contentView.subviews {
if let calRow = sv as? WWCalendarRow {
calRow.tag = (indexPath as NSIndexPath).row + 1
switch optionSelectionType {
case .single:
calRow.selectedDates = [optionCurrentDate]
case .multiple:
calRow.selectedDates = optionCurrentDates
case .range:
calRow.selectedDates = Set(optionCurrentDateRange.array)
}
calRow.setNeedsDisplay()
if let fd = flashDate {
if calRow.flashDate(fd) {
flashDate = nil
}
}
}
}
}
else if tableView == yearTable {
if let c = tableView.dequeueReusableCell(withIdentifier: "cell") {
cell = c
}
else {
cell = UITableViewCell(style: UITableViewCellStyle.default, reuseIdentifier: "cell")
cell.backgroundColor = UIColor.clear
cell.textLabel?.textAlignment = NSTextAlignment.center
cell.selectionStyle = UITableViewCellSelectionStyle.none
}
let currentYear = Date().year
let displayYear = yearRow1 + (indexPath as NSIndexPath).row
if displayYear > currentYear {
cell.textLabel?.font = optionCurrentDate.year == displayYear ? optionCalendarFontFutureYearsHighlight : optionCalendarFontFutureYears
cell.textLabel?.textColor = optionCurrentDate.year == displayYear ? optionCalendarFontColorFutureYearsHighlight : optionCalendarFontColorFutureYears
}
else if displayYear < currentYear {
cell.textLabel?.font = optionCurrentDate.year == displayYear ? optionCalendarFontPastYearsHighlight : optionCalendarFontPastYears
cell.textLabel?.textColor = optionCurrentDate.year == displayYear ? optionCalendarFontColorPastYearsHighlight : optionCalendarFontColorPastYears
}
else {
cell.textLabel?.font = optionCurrentDate.year == displayYear ? optionCalendarFontCurrentYearHighlight : optionCalendarFontCurrentYear
cell.textLabel?.textColor = optionCurrentDate.year == displayYear ? optionCalendarFontColorCurrentYearHighlight : optionCalendarFontColorCurrentYear
}
cell.textLabel?.text = "\(displayYear)"
}
else { // multiple dates table
if let c = tableView.dequeueReusableCell(withIdentifier: "cell") {
cell = c
}
else {
cell = UITableViewCell(style: UITableViewCellStyle.default, reuseIdentifier: "cell")
cell.textLabel?.textAlignment = NSTextAlignment.center
cell.selectionStyle = UITableViewCellSelectionStyle.none
cell.backgroundColor = UIColor.clear
}
let date = multipleDates[(indexPath as NSIndexPath).row]
cell.textLabel?.font = date == multipleDatesLastAdded ? optionSelectorPanelFontMultipleSelectionHighlight : optionSelectorPanelFontMultipleSelection
cell.textLabel?.textColor = date == multipleDatesLastAdded ? optionSelectorPanelFontColorMultipleSelectionHighlight : optionSelectorPanelFontColorMultipleSelection
cell.textLabel?.text = date.stringFromFormat("EEE', 'd' 'MMM' 'yyyy")
}
return cell
}
open func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if tableView == yearTable {
let displayYear = yearRow1 + (indexPath as NSIndexPath).row
let newDate = optionCurrentDate.change(year: displayYear)
if delegate?.WWCalendarTimeSelectorShouldSelectDate?(self, date: newDate!) ?? true {
optionCurrentDate = newDate!
updateDate()
tableView.reloadData()
}
}
else if tableView == selMultipleDatesTable {
let date = multipleDates[(indexPath as NSIndexPath).row]
multipleDatesLastAdded = date
selMultipleDatesTable.reloadData()
let seventhRowStartDate = date.beginningOfMonth
calRow3StartDate = ((seventhRowStartDate - 1.day).beginningOfWeek - 1.day).beginningOfWeek
calRow2StartDate = (calRow3StartDate - 1.day).beginningOfWeek
calRow1StartDate = (calRow2StartDate - 1.day).beginningOfWeek
flashDate = date
calendarTable.reloadData()
calendarTable.scrollToRow(at: IndexPath(row: 4, section: 0), at: UITableViewScrollPosition.top, animated: true)
}
}
open func scrollViewDidScroll(_ scrollView: UIScrollView) {
let offsetY = scrollView.contentOffset.y
if scrollView == calendarTable {
let twoRow = backgroundContentView.frame.height / 4
if offsetY < twoRow {
// every row shift by 4 to the back, recalculate top 3 towards earlier dates
let detail1 = WWCalendarRowGetDetails(-3)
let detail2 = WWCalendarRowGetDetails(-2)
let detail3 = WWCalendarRowGetDetails(-1)
calRow1Type = detail1.type
calRow1StartDate = detail1.startDate
calRow2Type = detail2.type
calRow2StartDate = detail2.startDate
calRow3Type = detail3.type
calRow3StartDate = detail3.startDate
scrollView.contentOffset = CGPoint(x: 0, y: offsetY + twoRow * 2)
calendarTable.reloadData()
}
else if offsetY > twoRow * 3 {
// every row shift by 4 to the front, recalculate top 3 towards later dates
let detail1 = WWCalendarRowGetDetails(5)
let detail2 = WWCalendarRowGetDetails(6)
let detail3 = WWCalendarRowGetDetails(7)
calRow1Type = detail1.type
calRow1StartDate = detail1.startDate
calRow2Type = detail2.type
calRow2StartDate = detail2.startDate
calRow3Type = detail3.type
calRow3StartDate = detail3.startDate
scrollView.contentOffset = CGPoint(x: 0, y: offsetY - twoRow * 2)
calendarTable.reloadData()
}
}
else if scrollView == yearTable {
let triggerPoint = backgroundContentView.frame.height / 10 * 3
if offsetY < triggerPoint {
yearRow1 = yearRow1 - 3
scrollView.contentOffset = CGPoint(x: 0, y: offsetY + triggerPoint * 2)
yearTable.reloadData()
}
else if offsetY > triggerPoint * 3 {
yearRow1 = yearRow1 + 3
scrollView.contentOffset = CGPoint(x: 0, y: offsetY - triggerPoint * 2)
yearTable.reloadData()
}
}
}
// CAN DO BETTER! TOO MANY LOOPS!
internal func WWCalendarRowGetDetails(_ row: Int) -> (type: WWCalendarRowType, startDate: Date) {
if row == 1 {
return (calRow1Type, calRow1StartDate)
}
else if row == 2 {
return (calRow2Type, calRow2StartDate)
}
else if row == 3 {
return (calRow3Type, calRow3StartDate)
}
else if row > 3 {
var startRow: Int
var startDate: Date
var rowType: WWCalendarRowType
if calRow3Type == .date {
startRow = 3
startDate = calRow3StartDate
rowType = calRow3Type
}
else if calRow2Type == .date {
startRow = 2
startDate = calRow2StartDate
rowType = calRow2Type
}
else {
startRow = 1
startDate = calRow1StartDate
rowType = calRow1Type
}
for _ in startRow..<row {
if rowType == .month {
rowType = .day
}
else if rowType == .day {
rowType = .date
startDate = startDate.beginningOfMonth
}
else {
let newStartDate = startDate.endOfWeek + 1.day
if newStartDate.month != startDate.month {
rowType = .month
}
startDate = newStartDate
}
}
return (rowType, startDate)
}
else {
// row <= 0
var startRow: Int
var startDate: Date
var rowType: WWCalendarRowType
if calRow1Type == .date {
startRow = 1
startDate = calRow1StartDate
rowType = calRow1Type
}
else if calRow2Type == .date {
startRow = 2
startDate = calRow2StartDate
rowType = calRow2Type
}
else {
startRow = 3
startDate = calRow3StartDate
rowType = calRow3Type
}
for _ in row..<startRow {
if rowType == .date {
if startDate.day == 1 {
rowType = .day
}
else {
let newStartDate = (startDate - 1.day).beginningOfWeek
if newStartDate.month != startDate.month {
startDate = startDate.beginningOfMonth
}
else {
startDate = newStartDate
}
}
}
else if rowType == .day {
rowType = .month
}
else {
rowType = .date
startDate = (startDate - 1.day).beginningOfWeek
}
}
return (rowType, startDate)
}
}
internal func WWCalendarRowDidSelect(_ date: Date) {
if delegate?.WWCalendarTimeSelectorShouldSelectDate?(self, date: date) ?? true {
switch optionSelectionType {
case .single:
optionCurrentDate = optionCurrentDate.change(year: date.year, month: date.month, day: date.day)
updateDate()
case .multiple:
var indexPath: IndexPath
var indexPathToReload: IndexPath? = nil
if let d = multipleDatesLastAdded {
let indexToReload = multipleDates.index(of: d)!
indexPathToReload = IndexPath(row: indexToReload, section: 0)
}
if let indexToDelete = multipleDates.index(of: date) {
// delete...
indexPath = IndexPath(row: indexToDelete, section: 0)
optionCurrentDates.remove(date)
selMultipleDatesTable.scrollToRow(at: indexPath, at: UITableViewScrollPosition.middle, animated: true)
multipleDatesLastAdded = nil
selMultipleDatesTable.beginUpdates()
selMultipleDatesTable.deleteRows(at: [indexPath], with: UITableViewRowAnimation.left)
if let ip = indexPathToReload , ip != indexPath {
selMultipleDatesTable.reloadRows(at: [ip], with: UITableViewRowAnimation.fade)
}
selMultipleDatesTable.endUpdates()
}
else {
// insert...
var shouldScroll = false
optionCurrentDates.insert(date)
let indexToAdd = multipleDates.index(of: date)!
indexPath = IndexPath(row: indexToAdd, section: 0)
if indexPath.row < optionCurrentDates.count - 1 {
selMultipleDatesTable.scrollToRow(at: indexPath, at: UITableViewScrollPosition.middle, animated: true)
}
else {
shouldScroll = true
}
multipleDatesLastAdded = date
selMultipleDatesTable.beginUpdates()
selMultipleDatesTable.insertRows(at: [indexPath], with: UITableViewRowAnimation.right)
if let ip = indexPathToReload {
selMultipleDatesTable.reloadRows(at: [ip], with: UITableViewRowAnimation.fade)
}
selMultipleDatesTable.endUpdates()
if shouldScroll {
selMultipleDatesTable.scrollToRow(at: indexPath, at: UITableViewScrollPosition.middle, animated: true)
}
}
case .range:
let rangeDate = date.beginningOfDay
if shouldResetRange {
optionCurrentDateRange.setStartDate(rangeDate)
optionCurrentDateRange.setEndDate(rangeDate)
isSelectingStartRange = false
shouldResetRange = false
}
else {
if isSelectingStartRange {
optionCurrentDateRange.setStartDate(rangeDate)
isSelectingStartRange = false
}
else {
let date0 : Date = rangeDate
let date1 : Date = optionCurrentDateRange.start
optionCurrentDateRange.setStartDate(min(date0, date1))
optionCurrentDateRange.setEndDate(max(date0, date1))
shouldResetRange = true
}
}
updateDate()
}
calendarTable.reloadData()
}
}
internal func WWClockGetTime() -> Date {
return optionCurrentDate
}
internal func WWClockSwitchAMPM(isAM: Bool, isPM: Bool) {
var newHour = optionCurrentDate.hour
if isAM && newHour >= 12 {
newHour = newHour - 12
}
if isPM && newHour < 12 {
newHour = newHour + 12
}
optionCurrentDate = optionCurrentDate.change(hour: newHour)
updateDate()
clockView.setNeedsDisplay()
UIView.transition(
with: clockView,
duration: selAnimationDuration / 2,
options: [UIViewAnimationOptions.transitionCrossDissolve, UIViewAnimationOptions.allowUserInteraction, UIViewAnimationOptions.beginFromCurrentState],
animations: {
self.clockView.layer.displayIfNeeded()
},
completion: nil
)
}
internal func WWClockSetHourMilitary(_ hour: Int) {
optionCurrentDate = optionCurrentDate.change(hour: hour)
updateDate()
clockView.setNeedsDisplay()
}
internal func WWClockSetMinute(_ minute: Int) {
optionCurrentDate = optionCurrentDate.change(minute: minute)
updateDate()
clockView.setNeedsDisplay()
}
}
@objc internal enum WWCalendarRowType: Int {
case month, day, date
}
internal protocol WWCalendarRowProtocol: NSObjectProtocol {
func WWCalendarRowGetDetails(_ row: Int) -> (type: WWCalendarRowType, startDate: Date)
func WWCalendarRowDidSelect(_ date: Date)
}
internal class WWCalendarRow: UIView {
internal weak var delegate: WWCalendarRowProtocol!
internal var monthFont: UIFont!
internal var monthFontColor: UIColor!
internal var dayFont: UIFont!
internal var dayFontColor: UIColor!
internal var datePastFont: UIFont!
internal var datePastFontHighlight: UIFont!
internal var datePastFontColor: UIColor!
internal var datePastHighlightFontColor: UIColor!
internal var datePastHighlightBackgroundColor: UIColor!
internal var datePastFlashBackgroundColor: UIColor!
internal var dateTodayFont: UIFont!
internal var dateTodayFontHighlight: UIFont!
internal var dateTodayFontColor: UIColor!
internal var dateTodayHighlightFontColor: UIColor!
internal var dateTodayHighlightBackgroundColor: UIColor!
internal var dateTodayFlashBackgroundColor: UIColor!
internal var dateFutureFont: UIFont!
internal var dateFutureFontHighlight: UIFont!
internal var dateFutureFontColor: UIColor!
internal var dateFutureHighlightFontColor: UIColor!
internal var dateFutureHighlightBackgroundColor: UIColor!
internal var dateFutureFlashBackgroundColor: UIColor!
internal var flashDuration: TimeInterval!
internal var multipleSelectionGrouping: WWCalendarTimeSelectorMultipleSelectionGrouping = .pill
internal var multipleSelectionEnabled: Bool = false
internal var selectedDates: Set<Date> {
set {
originalDates = newValue
comparisonDates = []
for date in newValue {
comparisonDates.insert(date.beginningOfDay)
}
}
get {
return originalDates
}
}
fileprivate var originalDates: Set<Date> = []
fileprivate var comparisonDates: Set<Date> = []
//fileprivate let days = ["S", "M", "T", "W", "T", "F", "S"]
fileprivate let multipleSelectionBorder: CGFloat = 12
fileprivate let multipleSelectionBar: CGFloat = 8
internal override func draw(_ rect: CGRect) {
let detail = delegate.WWCalendarRowGetDetails(tag)
let startDate = detail.startDate.beginningOfDay
let ctx = UIGraphicsGetCurrentContext()
let boxHeight = rect.height
let boxWidth = rect.width / 7
let paragraph = NSMutableParagraphStyle()
paragraph.alignment = NSTextAlignment.center
if detail.type == .month {
let monthName = startDate.stringFromFormat("MMMM yyyy").capitalized
let monthHeight = ceil(monthFont.lineHeight)
let str = NSAttributedString(string: monthName, attributes: [NSAttributedStringKey.font: monthFont, NSAttributedStringKey.foregroundColor: monthFontColor, NSAttributedStringKey.paragraphStyle: paragraph])
str.draw(in: CGRect(x: 0, y: boxHeight - monthHeight, width: rect.width, height: monthHeight))
}
else if detail.type == .day {
let dayHeight = ceil(dayFont.lineHeight)
let y = (boxHeight - dayHeight) / 2
let formatter = DateFormatter()
formatter.locale = Locale.autoupdatingCurrent
formatter.calendar = Calendar.autoupdatingCurrent
let days = formatter.veryShortWeekdaySymbols ?? ["S", "M", "T", "W", "T", "F", "S"]
for (index, element) in days.enumerated() {
let str = NSAttributedString(string: element, attributes: [NSAttributedStringKey.font: dayFont, NSAttributedStringKey.foregroundColor: dayFontColor, NSAttributedStringKey.paragraphStyle: paragraph])
str.draw(in: CGRect(x: CGFloat(index) * boxWidth, y: y, width: boxWidth, height: dayHeight))
}
}
else {
let today = Date().beginningOfDay
var date = startDate
var str: NSMutableAttributedString
for i in 1...7 {
if date.weekday == i {
var font = comparisonDates.contains(date) ? dateFutureFontHighlight : dateFutureFont
var fontColor = dateFutureFontColor
var fontHighlightColor = dateFutureHighlightFontColor
var backgroundHighlightColor = dateFutureHighlightBackgroundColor.cgColor
if date == today {
font = comparisonDates.contains(date) ? dateTodayFontHighlight : dateTodayFont
fontColor = dateTodayFontColor
fontHighlightColor = dateTodayHighlightFontColor
backgroundHighlightColor = dateTodayHighlightBackgroundColor.cgColor
}
else if date.compare(today) == ComparisonResult.orderedAscending {
font = comparisonDates.contains(date) ? datePastFontHighlight : datePastFont
fontColor = datePastFontColor
fontHighlightColor = datePastHighlightFontColor
backgroundHighlightColor = datePastHighlightBackgroundColor.cgColor
}
let dateHeight = ceil(font!.lineHeight) as CGFloat
let y = (boxHeight - dateHeight) / 2
if comparisonDates.contains(date) {
ctx?.setFillColor(backgroundHighlightColor)
if multipleSelectionEnabled {
var testStringSize = NSAttributedString(string: "00", attributes: [NSAttributedStringKey.font: dateTodayFontHighlight, NSAttributedStringKey.paragraphStyle: paragraph]).size()
var dateMaxWidth = testStringSize.width
var dateMaxHeight = testStringSize.height
if dateFutureFontHighlight.lineHeight > dateTodayFontHighlight.lineHeight {
testStringSize = NSAttributedString(string: "00", attributes: [NSAttributedStringKey.font: dateFutureFontHighlight, NSAttributedStringKey.paragraphStyle: paragraph]).size()
dateMaxWidth = testStringSize.width
dateMaxHeight = testStringSize.height
}
if datePastFontHighlight.lineHeight > dateFutureFontHighlight.lineHeight {
testStringSize = NSAttributedString(string: "00", attributes: [NSAttributedStringKey.font: datePastFontHighlight, NSAttributedStringKey.paragraphStyle: paragraph]).size()
dateMaxWidth = testStringSize.width
dateMaxHeight = testStringSize.height
}
let size = min(max(dateHeight, dateMaxWidth) + multipleSelectionBorder, min(boxHeight, boxWidth))
let maxConnectorSize = min(max(dateMaxHeight, dateMaxWidth) + multipleSelectionBorder, min(boxHeight, boxWidth))
let x = CGFloat(i - 1) * boxWidth + (boxWidth - size) / 2
let y = (boxHeight - size) / 2
// connector
switch multipleSelectionGrouping {
case .simple:
break
case .pill:
if comparisonDates.contains(date - 1.day) {
ctx?.fill(CGRect(x: CGFloat(i - 1) * boxWidth, y: y, width: boxWidth / 2 + 1, height: maxConnectorSize))
}
if comparisonDates.contains(date + 1.day) {
ctx?.fill(CGRect(x: CGFloat(i - 1) * boxWidth + boxWidth / 2, y: y, width: boxWidth / 2 + 1, height: maxConnectorSize))
}
case .linkedBalls:
if comparisonDates.contains(date - 1.day) {
ctx?.fill(CGRect(x: CGFloat(i - 1) * boxWidth, y: (boxHeight - multipleSelectionBar) / 2, width: boxWidth / 2 + 1, height: multipleSelectionBar))
}
if comparisonDates.contains(date + 1.day) {
ctx?.fill(CGRect(x: CGFloat(i - 1) * boxWidth + boxWidth / 2, y: (boxHeight - multipleSelectionBar) / 2, width: boxWidth / 2 + 1, height: multipleSelectionBar))
}
}
// ball
ctx?.fillEllipse(in: CGRect(x: x, y: y, width: size, height: size))
}
else {
let size = min(boxHeight, boxWidth)
let x = CGFloat(i - 1) * boxWidth + (boxWidth - size) / 2
let y = (boxHeight - size) / 2
ctx?.fillEllipse(in: CGRect(x: x, y: y, width: size, height: size))
}
str = NSMutableAttributedString(string: "\(date.day)", attributes: [NSAttributedStringKey.font: font!, NSAttributedStringKey.foregroundColor: fontHighlightColor!, NSAttributedStringKey.paragraphStyle: paragraph])
}
else {
str = NSMutableAttributedString(string: "\(date.day)", attributes: [NSAttributedStringKey.font: font!, NSAttributedStringKey.foregroundColor: fontColor!, NSAttributedStringKey.paragraphStyle: paragraph])
}
str.draw(in: CGRect(x: CGFloat(i - 1) * boxWidth, y: y, width: boxWidth, height: dateHeight))
date = date + 1.day
if date.month != startDate.month {
break
}
}
}
}
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
let detail = delegate.WWCalendarRowGetDetails(tag)
if detail.type == .date {
let boxWidth = bounds.width / 7
if let touch = touches.sorted(by: { $0.timestamp < $1.timestamp }).last {
let boxIndex = Int(floor(touch.location(in: self).x / boxWidth))
let dateTapped = detail.startDate + boxIndex.days - (detail.startDate.weekday - 1).days
if dateTapped.month == detail.startDate.month {
delegate.WWCalendarRowDidSelect(dateTapped)
}
}
}
}
fileprivate func flashDate(_ date: Date) -> Bool {
let detail = delegate.WWCalendarRowGetDetails(tag)
if detail.type == .date {
let today = Date().beginningOfDay
let startDate = detail.startDate.beginningOfDay
let flashDate = date.beginningOfDay
let boxHeight = bounds.height
let boxWidth = bounds.width / 7
var date = startDate
for i in 1...7 {
if date.weekday == i {
if date == flashDate {
var flashColor = dateFutureFlashBackgroundColor
if flashDate == today {
flashColor = dateTodayFlashBackgroundColor
}
else if flashDate.compare(today) == ComparisonResult.orderedAscending {
flashColor = datePastFlashBackgroundColor
}
let flashView = UIView(frame: CGRect(x: CGFloat(i - 1) * boxWidth, y: 0, width: boxWidth, height: boxHeight))
flashView.backgroundColor = flashColor
flashView.alpha = 0
addSubview(flashView)
UIView.animate(
withDuration: flashDuration / 2,
delay: 0,
options: [UIViewAnimationOptions.allowAnimatedContent, UIViewAnimationOptions.allowUserInteraction, UIViewAnimationOptions.beginFromCurrentState, UIViewAnimationOptions.curveEaseOut],
animations: {
flashView.alpha = 0.75
},
completion: { _ in
UIView.animate(
withDuration: self.flashDuration / 2,
delay: 0,
options: [UIViewAnimationOptions.allowAnimatedContent, UIViewAnimationOptions.allowUserInteraction, UIViewAnimationOptions.beginFromCurrentState, UIViewAnimationOptions.curveEaseIn],
animations: {
flashView.alpha = 0
},
completion: { _ in
flashView.removeFromSuperview()
}
)
}
)
return true
}
date = date + 1.day
if date.month != startDate.month {
break
}
}
}
}
return false
}
}
internal protocol WWClockProtocol: NSObjectProtocol {
func WWClockGetTime() -> Date
func WWClockSwitchAMPM(isAM: Bool, isPM: Bool)
func WWClockSetHourMilitary(_ hour: Int)
func WWClockSetMinute(_ minute: Int)
}
internal class WWClock: UIView {
internal weak var delegate: WWClockProtocol!
internal var backgroundColorClockFace: UIColor!
internal var backgroundColorClockFaceCenter: UIColor!
internal var fontAMPM: UIFont!
internal var fontAMPMHighlight: UIFont!
internal var fontColorAMPM: UIColor!
internal var fontColorAMPMHighlight: UIColor!
internal var backgroundColorAMPMHighlight: UIColor!
internal var fontHour: UIFont!
internal var fontHourHighlight: UIFont!
internal var fontColorHour: UIColor!
internal var fontColorHourHighlight: UIColor!
internal var backgroundColorHourHighlight: UIColor!
internal var backgroundColorHourHighlightNeedle: UIColor!
internal var fontMinute: UIFont!
internal var fontMinuteHighlight: UIFont!
internal var fontColorMinute: UIColor!
internal var fontColorMinuteHighlight: UIColor!
internal var backgroundColorMinuteHighlight: UIColor!
internal var backgroundColorMinuteHighlightNeedle: UIColor!
internal var showingHour = true
internal var minuteStep: WWCalendarTimeSelectorTimeStep! {
didSet {
minutes = []
let iter = 60 / minuteStep.rawValue
for i in 0..<iter {
minutes.append(i * minuteStep.rawValue)
}
}
}
fileprivate let border: CGFloat = 8
fileprivate let ampmSize: CGFloat = 52
fileprivate var faceSize: CGFloat = 0
fileprivate var faceX: CGFloat = 0
fileprivate let faceY: CGFloat = 8
fileprivate let amX: CGFloat = 8
fileprivate var pmX: CGFloat = 0
fileprivate var ampmY: CGFloat = 0
fileprivate let numberCircleBorder: CGFloat = 12
fileprivate let centerPieceSize = 4
fileprivate let hours = [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
fileprivate var minutes: [Int] = []
internal override func draw(_ rect: CGRect) {
// update frames
faceSize = min(rect.width - border * 2, rect.height - border * 2 - ampmSize / 3 * 2)
faceX = (rect.width - faceSize) / 2
pmX = rect.width - border - ampmSize
ampmY = rect.height - border - ampmSize
let time = delegate.WWClockGetTime()
let ctx = UIGraphicsGetCurrentContext()
let paragraph = NSMutableParagraphStyle()
paragraph.alignment = NSTextAlignment.center
ctx?.setFillColor(backgroundColorClockFace.cgColor)
ctx?.fillEllipse(in: CGRect(x: faceX, y: faceY, width: faceSize, height: faceSize))
ctx?.setFillColor(backgroundColorAMPMHighlight.cgColor)
if time.hour < 12 {
ctx?.fillEllipse(in: CGRect(x: amX, y: ampmY, width: ampmSize, height: ampmSize))
var str = NSAttributedString(string: "AM", attributes: [NSAttributedStringKey.font: fontAMPMHighlight, NSAttributedStringKey.foregroundColor: fontColorAMPMHighlight, NSAttributedStringKey.paragraphStyle: paragraph])
var ampmHeight = fontAMPMHighlight.lineHeight
str.draw(in: CGRect(x: amX, y: ampmY + (ampmSize - ampmHeight) / 2, width: ampmSize, height: ampmHeight))
str = NSAttributedString(string: "PM", attributes: [NSAttributedStringKey.font: fontAMPM, NSAttributedStringKey.foregroundColor: fontColorAMPM, NSAttributedStringKey.paragraphStyle: paragraph])
ampmHeight = fontAMPM.lineHeight
str.draw(in: CGRect(x: pmX, y: ampmY + (ampmSize - ampmHeight) / 2, width: ampmSize, height: ampmHeight))
}
else {
ctx?.fillEllipse(in: CGRect(x: pmX, y: ampmY, width: ampmSize, height: ampmSize))
var str = NSAttributedString(string: "AM", attributes: [NSAttributedStringKey.font: fontAMPM, NSAttributedStringKey.foregroundColor: fontColorAMPM, NSAttributedStringKey.paragraphStyle: paragraph])
var ampmHeight = fontAMPM.lineHeight
str.draw(in: CGRect(x: amX, y: ampmY + (ampmSize - ampmHeight) / 2, width: ampmSize, height: ampmHeight))
str = NSAttributedString(string: "PM", attributes: [NSAttributedStringKey.font: fontAMPMHighlight, NSAttributedStringKey.foregroundColor: fontColorAMPMHighlight, NSAttributedStringKey.paragraphStyle: paragraph])
ampmHeight = fontAMPMHighlight.lineHeight
str.draw(in: CGRect(x: pmX, y: ampmY + (ampmSize - ampmHeight) / 2, width: ampmSize, height: ampmHeight))
}
if showingHour {
let textAttr : [NSAttributedStringKey : Any] = [NSAttributedStringKey.font: fontHour, NSAttributedStringKey.foregroundColor: fontColorHour, NSAttributedStringKey.paragraphStyle: paragraph]
let textAttrHighlight : [NSAttributedStringKey : Any] = [NSAttributedStringKey.font: fontHourHighlight, NSAttributedStringKey.foregroundColor: fontColorHourHighlight, NSAttributedStringKey.paragraphStyle: paragraph]
let templateSize = NSAttributedString(string: "12", attributes: textAttr).size()
let templateSizeHighlight = NSAttributedString(string: "12", attributes: textAttrHighlight).size()
let maxSize = max(templateSize.width, templateSize.height)
let maxSizeHighlight = max(templateSizeHighlight.width, templateSizeHighlight.height)
let highlightCircleSize = maxSizeHighlight + numberCircleBorder
let radius = faceSize / 2 - maxSize
let radiusHighlight = faceSize / 2 - maxSizeHighlight
ctx?.saveGState()
ctx?.translateBy(x: faceX + faceSize / 2, y: faceY + faceSize / 2) // everything starts at clock face center
let degreeIncrement = 360 / CGFloat(hours.count)
let currentHour = get12Hour(time)
for (index, element) in hours.enumerated() {
let angle = getClockRad(CGFloat(index) * degreeIncrement)
if element == currentHour {
// needle
ctx?.saveGState()
ctx?.setStrokeColor(backgroundColorHourHighlightNeedle.cgColor)
ctx?.setLineWidth(1)
ctx?.move(to: CGPoint(x: 0, y: 0))
ctx?.scaleBy(x: -1, y: 1)
ctx?.addLine(to: CGPoint(x: (radiusHighlight - highlightCircleSize / 2) * cos(angle), y: -((radiusHighlight - highlightCircleSize / 2) * sin(angle))))
ctx?.scaleBy(x: -1, y: 1)
ctx?.strokePath()
ctx?.restoreGState()
// highlight
ctx?.saveGState()
ctx?.setFillColor(backgroundColorHourHighlight.cgColor)
ctx?.scaleBy(x: -1, y: 1)
ctx?.translateBy(x: radiusHighlight * cos(angle), y: -(radiusHighlight * sin(angle)))
ctx?.scaleBy(x: -1, y: 1)
ctx?.fillEllipse(in: CGRect(x: -highlightCircleSize / 2, y: -highlightCircleSize / 2, width: highlightCircleSize, height: highlightCircleSize))
ctx?.restoreGState()
// numbers
let hour = NSAttributedString(string: "\(element)", attributes: textAttrHighlight)
ctx?.saveGState()
ctx?.scaleBy(x: -1, y: 1)
ctx?.translateBy(x: radiusHighlight * cos(angle), y: -(radiusHighlight * sin(angle)))
ctx?.scaleBy(x: -1, y: 1)
ctx?.translateBy(x: -hour.size().width / 2, y: -hour.size().height / 2)
hour.draw(at: CGPoint.zero)
ctx?.restoreGState()
}
else {
// numbers
let hour = NSAttributedString(string: "\(element)", attributes: textAttr)
ctx?.saveGState()
ctx?.scaleBy(x: -1, y: 1)
ctx?.translateBy(x: radius * cos(angle), y: -(radius * sin(angle)))
ctx?.scaleBy(x: -1, y: 1)
ctx?.translateBy(x: -hour.size().width / 2, y: -hour.size().height / 2)
hour.draw(at: CGPoint.zero)
ctx?.restoreGState()
}
}
}
else {
let textAttr : [NSAttributedStringKey : Any] = [NSAttributedStringKey.font: fontMinute, NSAttributedStringKey.foregroundColor: fontColorMinute, NSAttributedStringKey.paragraphStyle: paragraph]
let textAttrHighlight : [NSAttributedStringKey : Any] = [NSAttributedStringKey.font: fontMinuteHighlight, NSAttributedStringKey.foregroundColor: fontColorMinuteHighlight, NSAttributedStringKey.paragraphStyle: paragraph]
let templateSize = NSAttributedString(string: "60", attributes: textAttr).size()
let templateSizeHighlight = NSAttributedString(string: "60", attributes: textAttrHighlight).size()
let maxSize = max(templateSize.width, templateSize.height)
let maxSizeHighlight = max(templateSizeHighlight.width, templateSizeHighlight.height)
let minSize: CGFloat = 0
let highlightCircleMaxSize = maxSizeHighlight + numberCircleBorder
let highlightCircleMinSize = minSize + numberCircleBorder
let radius = faceSize / 2 - maxSize
let radiusHighlight = faceSize / 2 - maxSizeHighlight
ctx?.saveGState()
ctx?.translateBy(x: faceX + faceSize / 2, y: faceY + faceSize / 2) // everything starts at clock face center
let degreeIncrement = 360 / CGFloat(minutes.count)
let currentMinute = get60Minute(time)
for (index, element) in minutes.enumerated() {
let angle = getClockRad(CGFloat(index) * degreeIncrement)
if element == currentMinute {
// needle
ctx?.saveGState()
ctx?.setStrokeColor(backgroundColorMinuteHighlightNeedle.cgColor)
ctx?.setLineWidth(1)
ctx?.move(to: CGPoint(x: 0, y: 0))
ctx?.scaleBy(x: -1, y: 1)
if minuteStep.rawValue < 5 && element % 5 != 0 {
ctx?.addLine(to: CGPoint(x: (radiusHighlight - highlightCircleMinSize / 2) * cos(angle), y: -((radiusHighlight - highlightCircleMinSize / 2) * sin(angle))))
}
else {
ctx?.addLine(to: CGPoint(x: (radiusHighlight - highlightCircleMaxSize / 2) * cos(angle), y: -((radiusHighlight - highlightCircleMaxSize / 2) * sin(angle))))
}
ctx?.scaleBy(x: -1, y: 1)
ctx?.strokePath()
ctx?.restoreGState()
// highlight
ctx?.saveGState()
ctx?.setFillColor(backgroundColorMinuteHighlight.cgColor)
ctx?.scaleBy(x: -1, y: 1)
ctx?.translateBy(x: radiusHighlight * cos(angle), y: -(radiusHighlight * sin(angle)))
ctx?.scaleBy(x: -1, y: 1)
if minuteStep.rawValue < 5 && element % 5 != 0 {
ctx?.fillEllipse(in: CGRect(x: -highlightCircleMinSize / 2, y: -highlightCircleMinSize / 2, width: highlightCircleMinSize, height: highlightCircleMinSize))
}
else {
ctx?.fillEllipse(in: CGRect(x: -highlightCircleMaxSize / 2, y: -highlightCircleMaxSize / 2, width: highlightCircleMaxSize, height: highlightCircleMaxSize))
}
ctx?.restoreGState()
// numbers
if minuteStep.rawValue < 5 {
if element % 5 == 0 {
let min = NSAttributedString(string: "\(element)", attributes: textAttrHighlight)
ctx?.saveGState()
ctx?.scaleBy(x: -1, y: 1)
ctx?.translateBy(x: radiusHighlight * cos(angle), y: -(radiusHighlight * sin(angle)))
ctx?.scaleBy(x: -1, y: 1)
ctx?.translateBy(x: -min.size().width / 2, y: -min.size().height / 2)
min.draw(at: CGPoint.zero)
ctx?.restoreGState()
}
}
else {
let min = NSAttributedString(string: "\(element)", attributes: textAttrHighlight)
ctx?.saveGState()
ctx?.scaleBy(x: -1, y: 1)
ctx?.translateBy(x: radiusHighlight * cos(angle), y: -(radiusHighlight * sin(angle)))
ctx?.scaleBy(x: -1, y: 1)
ctx?.translateBy(x: -min.size().width / 2, y: -min.size().height / 2)
min.draw(at: CGPoint.zero)
ctx?.restoreGState()
}
}
else {
// numbers
if minuteStep.rawValue < 5 {
if element % 5 == 0 {
let min = NSAttributedString(string: "\(element)", attributes: textAttr)
ctx?.saveGState()
ctx?.scaleBy(x: -1, y: 1)
ctx?.translateBy(x: radius * cos(angle), y: -(radius * sin(angle)))
ctx?.scaleBy(x: -1, y: 1)
ctx?.translateBy(x: -min.size().width / 2, y: -min.size().height / 2)
min.draw(at: CGPoint.zero)
ctx?.restoreGState()
}
}
else {
let min = NSAttributedString(string: "\(element)", attributes: textAttr)
ctx?.saveGState()
ctx?.scaleBy(x: -1, y: 1)
ctx?.translateBy(x: radius * cos(angle), y: -(radius * sin(angle)))
ctx?.scaleBy(x: -1, y: 1)
ctx?.translateBy(x: -min.size().width / 2, y: -min.size().height / 2)
min.draw(at: CGPoint.zero)
ctx?.restoreGState()
}
}
}
}
// center piece
ctx?.setFillColor(backgroundColorClockFaceCenter.cgColor)
ctx?.fillEllipse(in: CGRect(x: -centerPieceSize / 2, y: -centerPieceSize / 2, width: centerPieceSize, height: centerPieceSize))
ctx?.restoreGState()
}
fileprivate func get60Minute(_ date: Date) -> Int {
return date.minute
}
fileprivate func get12Hour(_ date: Date) -> Int {
let hr = date.hour
return hr == 0 || hr == 12 ? 12 : hr < 12 ? hr : hr - 12
}
fileprivate func getClockRad(_ degrees: CGFloat) -> CGFloat {
let radOffset = 90.degreesToRadians // add this number to get 12 at top, 3 at right
return degrees.degreesToRadians + radOffset
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
if let touch = touches.sorted(by: { $0.timestamp < $1.timestamp }).last {
let pt = touch.location(in: self)
// see if tap on AM or PM, making the boundary bigger
let amRect = CGRect(x: 0, y: ampmY, width: ampmSize + border * 2, height: ampmSize + border)
let pmRect = CGRect(x: bounds.width - ampmSize - border, y: ampmY, width: ampmSize + border * 2, height: ampmSize + border)
if amRect.contains(pt) {
delegate.WWClockSwitchAMPM(isAM: true, isPM: false)
}
else if pmRect.contains(pt) {
delegate.WWClockSwitchAMPM(isAM: false, isPM: true)
}
else {
touchClock(pt: pt)
}
}
}
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
if let touch = touches.sorted(by: { $0.timestamp < $1.timestamp }).last {
let pt = touch.location(in: self)
touchClock(pt: pt)
}
}
fileprivate func touchClock(pt: CGPoint) {
let touchPoint = CGPoint(x: pt.x - faceX - faceSize / 2, y: pt.y - faceY - faceSize / 2) // this means centerpoint will be 0, 0
if showingHour {
let degreeIncrement = 360 / CGFloat(hours.count)
var angle = 180 - atan2(touchPoint.x, touchPoint.y).radiansToDegrees // with respect that 12 o'clock position is 0 degrees, and 3 o'clock position is 90 degrees
if angle < 0 {
angle = 0
}
angle = angle - degreeIncrement / 2
var index = Int(floor(angle / degreeIncrement)) + 1
if index < 0 || index > (hours.count - 1) {
index = 0
}
let hour = hours[index]
let time = delegate.WWClockGetTime()
if hour == 12 {
delegate.WWClockSetHourMilitary(time.hour < 12 ? 0 : 12)
}
else {
delegate.WWClockSetHourMilitary(time.hour < 12 ? hour : 12 + hour)
}
}
else {
let degreeIncrement = 360 / CGFloat(minutes.count)
var angle = 180 - atan2(touchPoint.x, touchPoint.y).radiansToDegrees // with respect that 12 o'clock position is 0 degrees, and 3 o'clock position is 90 degrees
if angle < 0 {
angle = 0
}
angle = angle - degreeIncrement / 2
var index = Int(floor(angle / degreeIncrement)) + 1
if index < 0 || index > (minutes.count - 1) {
index = 0
}
let minute = minutes[index]
delegate.WWClockSetMinute(minute)
}
}
}
private extension CGFloat {
var doubleValue: Double { return Double(self) }
var degreesToRadians: CGFloat { return CGFloat(doubleValue * .pi / 180) }
var radiansToDegrees: CGFloat { return CGFloat(doubleValue * 180 / .pi) }
}
private extension Int {
var doubleValue: Double { return Double(self) }
var degreesToRadians: CGFloat { return CGFloat(doubleValue * .pi / 180) }
var radiansToDegrees: CGFloat { return CGFloat(doubleValue * 180 / .pi) }
}
| [
-1
] |
785cc9ae6391cf7c29f553c6b70e9d7431761d70 | 5727cee5385fbdc9517cac8a162d3444411b340f | /appdb/Tabs/Settings/AltStoreRepos/Apps/AltStoreAppDetails+Extension.swift | 2c4a1f78de88d032255ca0de50501b13946623c3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | n3d1117/appdb | e9d812df49f7cb04ca2a02023e4da4d1c422c5b8 | 64a3ec231b6bc1533ea61620dab92063ae4b0ba9 | refs/heads/master | 2023-08-18T04:03:25.299014 | 2023-04-06T07:37:21 | 2023-04-06T07:37:21 | 80,340,463 | 283 | 46 | MIT | 2023-08-24T09:27:02 | 2017-01-29T10:37:31 | Swift | UTF-8 | Swift | false | false | 3,165 | swift | //
// AltStoreAppDetails+Extension.swift
// appdb
//
// Created by stev3fvcks on 17.03.23.
// Copyright © 2023 stev3fvcks. All rights reserved.
//
import UIKit
import Cartography
import ObjectMapper
extension AltStoreAppDetails {
// Set up
func setUp() {
// Register cells
for cell in header { tableView.register(type(of: cell), forCellReuseIdentifier: cell.identifier) }
for cell in details { tableView.register(type(of: cell), forCellReuseIdentifier: cell.identifier) }
tableView.register(DetailsDescription.self, forCellReuseIdentifier: "description")
tableView.register(DetailsChangelog.self, forCellReuseIdentifier: "changelog")
if Global.isIpad {
// Add 'Dismiss' button for iPad
let dismissButton = UIBarButtonItem(title: "Dismiss".localized(), style: .done, target: self, action: #selector(self.dismissAnimated))
self.navigationItem.rightBarButtonItems = [dismissButton]
}
// Hide separator for empty cells
tableView.tableFooterView = UIView()
// UI
tableView.theme_backgroundColor = Color.veryVeryLightGray
tableView.separatorStyle = .none // Let's use self made separators instead
// Fix random separator margin issues
if #available(iOS 9, *) { tableView.cellLayoutMarginsFollowReadableWidth = false }
// Fix iOS 15 tableview section header padding
if #available(iOS 15.0, *) {
tableView.sectionHeaderTopPadding = 0
}
}
// Initialize cells
func initializeCells() {
header = [DetailsHeader(type: .altstore, content: app, delegate: self)]
details = [
DetailsScreenshots(type: .altstore, screenshots: app.screenshots, delegate: self),
DetailsDescription(), // dynamic
DetailsChangelog(), // dynamic
DetailsInformation(type: .altstore, content: app)
]
details.append(DetailsPublisher("© " + app.developer))
}
@objc func dismissAnimated() { dismiss(animated: true) }
// Setting the right estimated height for rows with dynamic content helps with tableview jumping issues
override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
if details[indexPath.row] is DetailsDescription {
return 145 ~~ 135
} else if details[indexPath.row] is DetailsChangelog {
return 115 ~~ 105
} else {
return 32
}
}
// Reload data on rotation to update ElasticLabel text
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
coordinator.animate(alongsideTransition: { (_: UIViewControllerTransitionCoordinatorContext!) -> Void in
guard self.tableView != nil else { return }
self.tableView.reloadData()
}, completion: nil)
}
}
extension AltStoreAppDetails: DetailsHeaderDelegate {
func installClicked(sender: RoundedButton) {
install(sender: sender)
}
}
| [
-1
] |
e5f091adad34877db2b276eb0f7c908851e986e0 | 265fd1f66250785a4dbfbb58975125b1f09a9f0b | /lib/OCSwiftComponentA/OCSwiftComponentA/Classes/Controllers/OCSwiftComponentBController.swift | c09bfc22c7b76b72a6226a6ddb7f0c682cf58e00 | [
"MIT"
] | permissive | LiuPengKun1993/OCSwiftComponentDemo | 4f0f0532d948a64b3b8e7d31fdd144625df9a8b1 | 857a1b799b140a0c07ba5e6c4dc40dca26ec17b1 | refs/heads/main | 2023-04-02T08:12:24.302865 | 2021-04-12T12:32:28 | 2021-04-12T12:32:28 | 354,028,654 | 0 | 2 | null | null | null | null | UTF-8 | Swift | false | false | 1,294 | swift | //
// OCSwiftComponentBController.swift
// OCSwiftComponentA
//
// Created by PaulLi on 2021/4/6.
//
import UIKit
public class OCSwiftComponentBController: UIViewController {
public override func viewDidLoad() {
super.viewDidLoad()
navigationItem.title = "Swift 控制器"
view.backgroundColor = UIColor.cyan
addSubViews()
}
func addSubViews() {
let label = UILabel.init(frame: CGRect(x: 0, y: 0, width: 200, height: 30))
label.text = "点击跳转 OC 控制器"
label.textAlignment = NSTextAlignment.center
view.addSubview(label)
label.center = view.center
}
public override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesBegan(touches, with: event)
let a = OCSwiftComponentAController.init()
self.navigationController?.pushViewController(a, animated: 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.destination.
// Pass the selected object to the new view controller.
}
*/
}
| [
-1
] |
10526623bf3537bf86341dd29c52efec94f4f570 | fb5b1504eb5b24abca61bcce4e8556a912738809 | /build/src/Models/TrunkErrorInfo.swift | bf4128e4f55b0922d9488dc77490f0715715b813 | [
"MIT"
] | permissive | MyPureCloud/platform-client-sdk-ios | 135f1d124730ecc7e47e68df90a3215ba4ba6880 | 04ee2b0f5d3f8ad73078eb713427cb6f9e164dda | refs/heads/master | 2023-08-17T05:03:39.340378 | 2023-08-15T06:49:56 | 2023-08-15T06:49:56 | 130,367,583 | 0 | 2 | null | null | null | null | UTF-8 | Swift | false | false | 456 | swift | //
// TrunkErrorInfo.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
//
import Foundation
public class TrunkErrorInfo: Codable {
public var text: String?
public var code: String?
public var details: TrunkErrorInfoDetails?
public init(text: String?, code: String?, details: TrunkErrorInfoDetails?) {
self.text = text
self.code = code
self.details = details
}
}
| [
-1
] |
22da55d0811647aca5b2b81c61d589af34b82607 | ad2cecf4187cf5066e95cceb6adacb41908c2472 | /swift/robot-name/Sources/RobotName/RobotName.swift | fd2b5d17d12695605841c43f849b0580d792c426 | [] | no_license | mstange22/Exercism | ac0d15dd3555d24b5c9f44345e63bfd8ebf68da5 | 23903125853c870a972e29d4b6b6bb260ee4ab3b | refs/heads/master | 2023-01-12T19:33:30.632673 | 2020-10-18T15:30:47 | 2020-10-18T15:30:47 | 164,342,472 | 0 | 0 | null | 2023-01-06T04:33:04 | 2019-01-06T20:22:42 | C++ | UTF-8 | Swift | false | false | 708 | swift | fileprivate let ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
class Robot {
public var name = "";
private var names = Set<String>()
init() {
resetName()
}
public func resetName() {
var newName: String
repeat {
newName = getNewName()
} while(names.contains(newName))
self.name = newName
self.names.insert(newName)
}
private func getNewName() -> String {
return (
String(ALPHA.randomElement()!) +
String(ALPHA.randomElement()!) +
String(Int.random(in: 0 ..< 10)) +
String(Int.random(in: 0 ..< 10)) +
String(Int.random(in: 0 ..< 10))
)
}
}
| [
-1
] |
124b475c61d39bc4b08e4ef1a5699588a2501b18 | 9209efa9f433f2d43b63aa64b7ac142483753b33 | /ThreeLineReview/Model/ReviewModel.swift | d481eac0552c91306b1ade541b619cd4d62251b3 | [] | no_license | LeFal/ThreeLineReview | 7b379be4e29d52c3cabb9a7437d99c9764a88e5b | a87d1bd8ba9fe2b17de5edc3960737d90e952384 | refs/heads/master | 2021-01-20T12:25:09.772784 | 2017-06-28T14:29:59 | 2017-06-28T14:29:59 | 90,362,630 | 0 | 0 | null | 2017-06-27T03:58:17 | 2017-05-05T09:59:18 | Swift | UTF-8 | Swift | false | false | 827 | swift | //
// ReviewModel.swift
// ThreeLineReview
//
// Created by LEOFALCON on 2017. 6. 28..
// Copyright © 2017년 LeFal. All rights reserved.
//
import ObjectMapper
struct Review : Mappable {
var id: Int!
var writer: String?
var targetId : String?
var score : Double?
var content : String?
var inputDate : Date?
init?(map: Map) {
}
mutating func mapping(map: Map) {
self.id <- map["id"]
self.writer <- map["writer"]
self.targetId <- map["target_id"]
self.content <- map["content"]
self.score <- map["score"]
let format = DateFormatter()
format.dateFormat = "yyyy-MM-dd HH:mm:ss"
self.inputDate <- (map["input_date"], DateFormatterTransform(dateFormatter: format))
}
}
| [
-1
] |
796308e8ac2d7d1e68d7fd2b283a38ddb4cb4dd2 | bc8e1f7de40391136bf7d06644230fea0d2fbe62 | /BHPostsCodeTest/BHPostsCodeTest/Classes/Common/Models/CoreData/CDPost+CoreDataClass.swift | b2451146a1dfa73a5a37906e571cc2c6e59c93df | [] | no_license | jdev7/BHPostsCodeTest | a5da8645df7c01b8c5a2194b0bda240e63f64178 | 4ca9331aa1cfc99b34a56d8b45ebd02d57a71106 | refs/heads/master | 2021-01-11T18:37:50.414067 | 2017-01-24T07:47:58 | 2017-01-24T07:47:58 | 79,585,940 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 747 | swift | //
// CDPost+CoreDataClass.swift
// BHPostsCodeTest
//
// Created by Juan Navas Martin on 23/1/17.
// Copyright © 2017 Perhapps. All rights reserved.
//
import Foundation
import CoreData
public class CDPost: NSManagedObject {
func toDictionary() -> NSDictionary {
let dictionary = NSMutableDictionary()
if body != nil{
dictionary["body"] = body
}
dictionary["id"] = Int(id)
if title != nil{
dictionary["title"] = title
}
dictionary["userId"] = Int(userId)
return dictionary
}
func bind(withPost post: Post) {
body = post.body
id = Int16(post.id)
userId = Int16(post.userId)
title = post.title
}
}
| [
-1
] |
499f7f56b3aa3d076b7e294b6b80caf5c4aa93b7 | d1632a6aa8e9b4971c914f06237aacb40a8dfb89 | /aNYJob/Views/ComparisonView.swift | 9b790a1901ef3f7d156ca2b76bd0ec3af6616869 | [] | no_license | dementedcactus/aNYJob | a1eabbd0276af34d71e83603905077b769903318 | 05f2e250e991603dbc49d1709e9764de122a5c5a | refs/heads/master | 2021-03-31T02:03:09.103756 | 2018-03-05T18:42:05 | 2018-03-05T18:42:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,142 | swift | //
// ComparisonView.swift
// aNYJob
//
// Created by Richard Crichlow on 3/3/18.
// Copyright © 2018 aMigos. All rights reserved.
//
import UIKit
import Charts
class ComparisonView: UIView {
// For the container view, just add all the objects from the jobDetailTableViewCell and contrain them to inside the container view.
lazy var containerView: UIView = {
let view = UIView()
view.layer.cornerRadius = 20
view.layer.masksToBounds = true
view.backgroundColor = UIColor(red: 0.859, green: 0.859, blue: 0.969, alpha: 1.00)
return view
}()
lazy var barChart: BarChartView = {
let barChart = BarChartView()
return barChart
}()
public func updateBarChart(with array: [BaseSalary]) {
var barEntries = [BarChartDataEntry]()
for i in 0...50 {
let dataEntry = BarChartDataEntry(x: Double(i+1), y: Double(array[i].base_salary)!)
barEntries.append(dataEntry)
}
let dataSet = BarChartDataSet(values: barEntries, label: "Salaries")
dataSet.colors = ChartColorTemplates.material()
let data = BarChartData(dataSets: [dataSet])
barChart.data = data
barChart.chartDescription?.text = ""
barChart.notifyDataSetChanged()
}
lazy var comparisonTableView: UITableView = {
let tv = UITableView()
//create and register a cell
tv.register(ComparisonTableViewCell.self, forCellReuseIdentifier: "ComparisonCell")
tv.backgroundColor = UIColor(red: 0.933, green: 0.494, blue: 0.212, alpha: 1.00)
return tv
}()
override init(frame: CGRect) {
super.init(frame: UIScreen.main.bounds)
commonInit()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
commonInit()
}
private func commonInit() {
backgroundColor = .white
setupViews()
}
private func setupViews() {
//addSubview(containerView)
addSubview(barChart)
addSubview(comparisonTableView)
// containerView.snp.makeConstraints { (make) in
// make.centerX.equalTo(self.safeAreaLayoutGuide.snp.centerX)
// make.top.equalTo(self.safeAreaLayoutGuide.snp.top)
// make.height.equalTo(self.safeAreaLayoutGuide.snp.height).multipliedBy(0.2)
// make.width.equalTo(self.safeAreaLayoutGuide.snp.width).multipliedBy(0.9)
// }
barChart.snp.makeConstraints { (make) in
make.centerX.equalTo(self.safeAreaLayoutGuide.snp.centerX)
make.top.equalTo(self.safeAreaLayoutGuide.snp.top)
make.height.equalTo(self.safeAreaLayoutGuide.snp.height).multipliedBy(0.5)
make.width.equalTo(self.safeAreaLayoutGuide.snp.width)//.multipliedBy(0.9)
}
comparisonTableView.snp.makeConstraints { (make) in
make.top.equalTo(barChart.snp.bottom)
make.width.equalTo(self.safeAreaLayoutGuide.snp.width)
make.bottom.equalTo(self.safeAreaLayoutGuide.snp.bottom)
}
}
}
| [
-1
] |
e06774d417715c376cf6d9a87b22d8e9efaf5a51 | 52981893264867ac7429957fd05e58e088ac6121 | /thinkit/App/Scenes/Detail/MovieDetailView.swift | 2a178bd1b176b60bc6cce882aa5c9cebd66fc69d | [] | no_license | Aamirali86/thinkit | 6508fe99e1ebb87ebdcf059619fd8a230b2b4e5c | ce62cd97ff4be818fd59ce7c4284f1150c3df1b3 | refs/heads/main | 2023-02-01T17:16:59.850682 | 2020-12-07T20:21:42 | 2020-12-07T20:21:42 | 318,443,596 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,887 | swift | //
// MovieDetailView.swift
// thinkit
//
// Created by Amir on 05/12/2020.
// Copyright © 2020 Thinkit. All rights reserved.
//
import SwiftUI
struct MovieDetailView: View {
private let viewModel: MovieDetailViewModelType
//MARK:- Init
init(viewModel: MovieDetailViewModelType) {
self.viewModel = viewModel
}
//MARK:- Properties
var body: some View {
ScrollView {
VStack(spacing: 20) {
MovieDetailHeaderView(movie: viewModel.movie)
HStack {
VStack(alignment: .leading, spacing: 10) {
Text("Opening Crawl")
Text(viewModel.movie.openingCrawl)
}
Spacer()
}
.padding([.leading, .trailing], 10)
HStack(spacing: 24) {
TitleDetailView(title: "Created",
detail: viewModel.created ?? "",
titleStyle: .style(.dark, .font(13)),
descriptionStyle: .style(.dark, .font(14)))
TitleDetailView(title: "Edited",
detail: viewModel.edited ?? "",
titleStyle: .style(.dark, .font(13)),
descriptionStyle: .style(.dark, .font(14)))
Spacer()
}
.padding([.leading, .trailing], 10)
Spacer()
}
.navigationBarTitle(Text(viewModel.movie.title), displayMode: .inline)
}
}
}
struct MovieDetailView_Previews: PreviewProvider {
static var previews: some View {
NavigationView {
MovieDetailView(viewModel: MovieDetailViewModel.mock)
}
}
}
| [
-1
] |
d308323ef2f37f837393cbb9502f3d8699a414cb | 1ec2c14bef2c16eef81d64e4bce555d7ea58aaa5 | /WePeiYang/Read/Model/Review.swift | dec3fbae7945191bdb1cda9bb8f5545ddfb893fb | [] | no_license | IssacLu/WePeiYang-iOS-Everest | fde2784985946b5784ce9aa1fa7e20c89610ec24 | 497f4f4dd8ea7fb27c0aeaf7bf67e46796b345ba | refs/heads/master | 2020-03-10T14:20:21.784284 | 2018-04-02T17:47:23 | 2018-04-02T17:47:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,291 | swift | //
// Review.swift
// WePeiYang
//
// Created by Halcao on 2017/4/7.
// Copyright © 2017年 twtstudio. All rights reserved.
//
import Foundation
class Review {
var reviewID = 0
var bookID = 0
var title = ""
var username = ""
var avatar = ""
var score = 0.0
var content = ""
var updateTime = ""
var liked = false
var like = 0
var rating: Double = 3
// FIXME: bookName ???
let bookName: String = ""
// reviewID: reviewID, bookID: bookID, bookName: title, userName: username, avatarURL: avatar, rating: score, like: like, content: content, updateTime: updateTime, liked: liked
init(reviewID: Int, bookID: Int, title: String, username: String, avatarURL: String, rating: Double, like: Int, content: String, updateTime: String, liked: Bool) {
self.reviewID = reviewID
self.bookID = bookID
self.title = title
self.username = username
self.avatar = avatarURL
self.score = rating
self.content = content
self.updateTime = updateTime
self.like = like
self.liked = liked
}
}
class StarReview {
let name: String
let content: String
init(name: String, content: String) {
self.name = name
self.content = content
}
}
| [
-1
] |
e0558f62adb430e639c69fee9a30863dea1bd163 | 79c07b0acf0c0eae79ad16fa28bef11e2449b768 | /Climat/Climat/Model/weatherModel.swift | 217f007dae39b58fb80dcbe7919d0130268b4a4c | [] | no_license | fireyoungdragon/weather-app | 5404fe8739b182ee9152cf31d8bc94c5c636e25b | 95559bc6a641909856a3559c19a7f30d3c8da83b | refs/heads/main | 2023-04-20T15:57:26.869454 | 2021-05-12T19:02:48 | 2021-05-12T19:02:48 | 360,324,268 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 663 | swift | import Foundation
struct WeatherModel {
let cityName: String
let temperature: Double
let conditionId: Int
var temperatureString: String{
return String(format: "%.0f", temperature)
}
var conditionType: String{
switch conditionId {
case 200...232:
return "cloud.bolt"
case 300...321:
return "cloud.drizzle"
case 500...531:
return "cloud.rain"
case 600...622:
return "cloud.snow"
case 800:
return "sun.max"
case 801...804:
return "cloud"
default:
return ""
}
}
}
| [
200740
] |
a1642d06bc5bab7a5b8bba282a76263c57e3bf5e | d44120fbe7b3a0b9400b05ee68c0538a7266746d | /UniversityAssessmentPlanningTool/Views/CircularProgressBar.swift | 32ac68f10caf8b01f1eb5deddf2193e25f23b512 | [] | no_license | Suwadith/University-Assessment-Planning-and-Study-Tool-iOS-13-iPad | 0a160d253528d38c72b56b051ccc533ae75633a1 | a9d37a16098f9effbfa906a974a6955caf7ff936 | refs/heads/master | 2022-11-17T03:27:33.829204 | 2020-07-16T21:46:44 | 2020-07-16T21:46:44 | 263,148,138 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 5,425 | swift | //
// CircularProgressBar.swift
// UniversityAssessmentPlanningTool
//
// Created by Suwadith on 5/16/20.
// Copyright © 2020 Suwadith. All rights reserved.
//
// Source: https://github.com/brionmario/project-planner-ios
import UIKit
class CircularProgressBar: UIView {
@IBInspectable public var backCircleColor: UIColor = UIColor.lightGray
@IBInspectable public var startGradientColor: UIColor = UIColor.red
@IBInspectable public var endGradientColor: UIColor = UIColor.orange
@IBInspectable public var textColor: UIColor = UIColor.black
@IBInspectable public var customTitle: String = ""
@IBInspectable public var customSubtitle: String = ""
private var backgroundLayer: CAShapeLayer!
private var foregroundLayer: CAShapeLayer!
private var titleTextLayer: CATextLayer!
private var subTitleTextLayer: CATextLayer!
private var gradientLayer: CAGradientLayer!
public var progress: CGFloat = 0 {
didSet {
didProgressUpdated()
}
}
override func draw(_ rect: CGRect) {
// Drawing code
guard layer.sublayers == nil else {
return
}
var title = "\(Int(progress * 100))"
var subtitle = ""
if customTitle != "" {
title = customTitle
}
if customSubtitle != "" {
subtitle = customSubtitle
}
let width = rect.width
let height = rect.height
let lineWidth = 0.1 * min(width, height)
backgroundLayer = createCircularLayer(rect: rect, strokeColor: backCircleColor.cgColor, fillColor: UIColor.clear.cgColor, lineWidth: lineWidth)
foregroundLayer = createCircularLayer(rect: rect, strokeColor: UIColor.red.cgColor, fillColor: UIColor.clear.cgColor, lineWidth: lineWidth)
gradientLayer = CAGradientLayer()
gradientLayer.startPoint = CGPoint(x: 0.5, y: 0.0)
gradientLayer.endPoint = CGPoint(x: 0.5, y: 1.0)
gradientLayer.colors = [startGradientColor.cgColor, endGradientColor.cgColor]
gradientLayer.frame = rect
gradientLayer.mask = foregroundLayer
titleTextLayer = createTitle(rect: rect, text: title, textColor: textColor.cgColor)
subTitleTextLayer = createSubTitle(rect: rect, text: subtitle, textColor: textColor.cgColor)
layer.addSublayer(backgroundLayer)
layer.addSublayer(gradientLayer)
layer.addSublayer(titleTextLayer)
layer.addSublayer(subTitleTextLayer)
}
private func createCircularLayer(rect: CGRect, strokeColor: CGColor,
fillColor: CGColor, lineWidth: CGFloat) -> CAShapeLayer {
let width = rect.width
let height = rect.height
let center = CGPoint(x: width / 2, y: height / 2)
let radius = (min(width, height) - lineWidth) / 2
let startAngle = -CGFloat.pi / 2
let endAngle = startAngle + 2 * CGFloat.pi
let circularPath = UIBezierPath(arcCenter: center, radius: radius, startAngle: startAngle, endAngle: endAngle, clockwise: true)
let shapeLayer = CAShapeLayer()
shapeLayer.path = circularPath.cgPath
shapeLayer.strokeColor = strokeColor
shapeLayer.fillColor = fillColor
shapeLayer.lineWidth = lineWidth
shapeLayer.lineCap = .round
return shapeLayer
}
private func createTitle(rect: CGRect, text: String, textColor: CGColor) -> CATextLayer {
let width = rect.width
let height = rect.height
let fontSize = min(width, height) / 4
let offset = min(width, height) * 0.1
let layer = CATextLayer()
layer.string = "\(text)%"
layer.backgroundColor = UIColor.clear.cgColor
layer.foregroundColor = textColor
layer.fontSize = fontSize
layer.frame = CGRect(x: 0, y: (height - fontSize - offset) / 2, width: width, height: fontSize + offset)
layer.alignmentMode = .center
return layer
}
private func createSubTitle(rect: CGRect, text: String, textColor: CGColor) -> CATextLayer {
let width = rect.width
let height = rect.height
let fontSize = min(width, height) / 15
let offset = min(width, height) * 0.35
let layer = CATextLayer()
layer.string = "\(text)%"
layer.backgroundColor = UIColor.clear.cgColor
layer.foregroundColor = textColor
layer.fontSize = fontSize
layer.frame = CGRect(x: 0, y: (height - fontSize + offset) / 2, width: width, height: fontSize + offset)
layer.alignmentMode = .center
return layer
}
private func didProgressUpdated() {
var title = "\(Int(progress * 100))%"
var subtitle = ""
if customTitle != "" {
title = customTitle
}
if customSubtitle != "" {
subtitle = customSubtitle
}
titleTextLayer?.string = title
subTitleTextLayer?.string = subtitle
foregroundLayer?.strokeEnd = progress
gradientLayer?.colors = [startGradientColor.cgColor, endGradientColor.cgColor]
}
}
| [
-1
] |
b646a544ef835c9a09b54754da472d74101b52fa | 7e000d3e5a8851792590379fdfcd4708584867f1 | /chinchinso/Controller/ManageBlind/ManageBlindController.swift | 6dbc3ec7e6f12456d97bfe42761e97e4fddab6ec | [] | no_license | hyunsooo/chinchinso | 1ce84a6225769a84fb8ebcc3c564bd0d8ac0cf76 | 81585c8c89892f47ba25a786c3381908ef666948 | refs/heads/master | 2020-03-21T13:38:32.767427 | 2018-06-25T15:56:00 | 2018-06-25T15:56:00 | 138,608,416 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 10,229 | swift | //
// FriendManageController.swift
// chinchinso
//
// Created by hyunsu han on 2017. 11. 27..
// Copyright © 2017년 hyunsu han. All rights reserved.
//
import UIKit
import Alamofire
import AlamofireImage
import LBTAComponents
protocol ManageBlindControllerDelegate: class {
func refresh()
}
class ManageBlindController: BaseViewController {
var manage: Model.ManageBlind? {
didSet {
guard let manage = manage else { return }
print(manage)
if let url = manage.user.profileUrl { myImageView.af_setImage(withURL: url) }
if let url = manage.friend.profileUrl { friendImageView.af_setImage(withURL: url); view.bringSubview(toFront: friendImageView) }
else { view.bringSubview(toFront: choiceFriendButton) }
view.bringSubview(toFront: myImageView)
friendNameLabel.attributedText = NSMutableAttributedString(string: manage.friend.name, attributes: [.kern: 3])
recommendMessageView.text = manage.friend.recommend
dataSource = manage.pokes
}
}
let cellName = "PokeCell"
var dataSource = [Model.Poke]() {
didSet {
self.collectionView.reloadData()
}
}
let label1: UILabel = {
let lb = UILabel()
lb.text = "# 친구 소개팅 관리"
lb.font = UIFont.systemFont(ofSize: 15, weight: .medium)
lb.textAlignment = .left
return lb
}()
let myImageView: UIImageView = {
let iv = UIImageView(image: #imageLiteral(resourceName: "profile"))
iv.contentMode = .scaleAspectFill
iv.layer.cornerRadius = 25
iv.layer.masksToBounds = true
iv.clipsToBounds = true
return iv
}()
lazy var friendImageView: UIImageView = {
let iv = UIImageView(image: #imageLiteral(resourceName: "profile"))
iv.contentMode = .scaleAspectFill
iv.layer.cornerRadius = 75
iv.layer.masksToBounds = true
iv.clipsToBounds = true
iv.isUserInteractionEnabled = true
iv.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(choiceFriend)))
return iv
}()
let friendNameLabel: UILabel = {
let lb = UILabel()
lb.font = UIFont.systemFont(ofSize: 16, weight: .bold)
lb.textAlignment = .center
return lb
}()
let label2: UILabel = {
let lb = UILabel()
lb.text = "# 나를 콕 찌른 친구들"
lb.font = UIFont.systemFont(ofSize: 15, weight: .medium)
lb.textAlignment = .left
return lb
}()
let recommendMessageView: UITextView = {
let tv = UITextView()
tv.layer.cornerRadius = 5
tv.layer.masksToBounds = true
tv.layer.borderWidth = 3
tv.layer.borderColor = Color.shared.darkGreen.cgColor
tv.backgroundColor = .white
tv.font = UIFont.systemFont(ofSize: 15, weight: .medium)
tv.contentInset = UIEdgeInsetsMake(10, 10, 10, 10)
tv.allowsEditingTextAttributes = false
tv.isEditable = false
return tv
}()
lazy var recommendEditButton: UIButton = {
let btn = UIButton(type: .system)
btn.backgroundColor = .white
btn.layer.borderColor = Color.shared.font.cgColor
btn.setTitleColor(Color.shared.font, for: .normal)
btn.setTitle("편집", for: .normal)
btn.layer.masksToBounds = true
btn.layer.cornerRadius = 15
btn.addTarget(self, action: #selector(editRecommendMessage), for: .touchUpInside)
return btn
}()
lazy var choiceFriendButton: UIButton = {
let btn = UIButton(type: .system)
btn.backgroundColor = .white
btn.layer.borderColor = Color.shared.font.cgColor
btn.setTitleColor(Color.shared.font, for: .normal)
btn.setTitle("친구 선택", for: .normal)
btn.layer.masksToBounds = true
btn.layer.cornerRadius = 75
btn.addTarget(self, action: #selector(choiceFriend), for: .touchUpInside)
return btn
}()
let collectionView: UICollectionView = {
let layout = UICollectionViewFlowLayout()
let cv = UICollectionView(frame: .zero, collectionViewLayout: layout)
cv.backgroundColor = Color.shared.darkGreen
cv.contentInset = UIEdgeInsetsMake(10, 0, 10, 0)
cv.layer.cornerRadius = 5
cv.layer.masksToBounds = true
cv.alwaysBounceVertical = true
return cv
}()
override func viewDidLoad() {
super.viewDidLoad()
initView()
App.api.manageBlind { [weak self] (dataResponse: DataResponse<Model.ManageBlind>) in
guard let `self` = self else { return }
switch dataResponse.result {
case .success(let data): self.manage = data
case .failure(let error): print(error)
}
}
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
fileprivate func initView() {
view.addSubview(label1)
view.addSubview(myImageView)
view.addSubview(friendNameLabel)
view.addSubview(friendImageView)
view.addSubview(choiceFriendButton)
view.addSubview(recommendMessageView)
view.addSubview(recommendEditButton)
view.addSubview(label2)
view.addSubview(collectionView)
collectionView.delegate = self
collectionView.dataSource = self
collectionView.register(PokeCell.self, forCellWithReuseIdentifier: cellName)
label1.anchor(view.safeAreaLayoutGuide.topAnchor, left: view.leftAnchor, bottom: nil, right: nil, topConstant: 20, leftConstant: 20, bottomConstant: 0, rightConstant: 0, widthConstant: 150, heightConstant: 20)
friendImageView.anchor(label1.bottomAnchor, left: nil, bottom: nil, right: nil, topConstant: 10, leftConstant: 0, bottomConstant: 0, rightConstant: 0, widthConstant: 150, heightConstant: 150)
friendImageView.anchorCenterXToSuperview()
choiceFriendButton.anchor(label1.bottomAnchor, left: nil, bottom: nil, right: nil, topConstant: 10, leftConstant: 0, bottomConstant: 0, rightConstant: 0, widthConstant: 150, heightConstant: 150)
choiceFriendButton.anchorCenterXToSuperview()
friendNameLabel.anchor(friendImageView.bottomAnchor, left: nil, bottom: nil, right: nil, topConstant: 10, leftConstant: 0, bottomConstant: 0, rightConstant: 0, widthConstant: 150, heightConstant: 20)
friendNameLabel.anchorCenterXToSuperview()
myImageView.anchor(nil, left: nil, bottom: friendImageView.bottomAnchor, right: friendImageView.rightAnchor, topConstant: 0, leftConstant: 0, bottomConstant: 0, rightConstant: -8, widthConstant: 50, heightConstant: 50)
recommendMessageView.anchor(friendNameLabel.bottomAnchor, left: view.leftAnchor, bottom: nil, right: view.rightAnchor, topConstant: 25, leftConstant: 20, bottomConstant: 0, rightConstant: 20, widthConstant: 0, heightConstant: 150)
recommendEditButton.anchor(nil, left: nil, bottom: recommendMessageView.topAnchor, right: recommendMessageView.rightAnchor, topConstant: 0, leftConstant: 0, bottomConstant: 5, rightConstant: 0, widthConstant: 80, heightConstant: 30)
label2.anchor(recommendMessageView.bottomAnchor, left: view.leftAnchor, bottom: nil, right: nil, topConstant: 30, leftConstant: 20, bottomConstant: 0, rightConstant: 0, widthConstant: 150, heightConstant: 20)
collectionView.anchor(label2.bottomAnchor, left: view.leftAnchor, bottom: nil, right: view.rightAnchor, topConstant: 5, leftConstant: 20, bottomConstant: 0, rightConstant: 20, widthConstant: 0, heightConstant: 150)
}
}
extension ManageBlindController: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return dataSource.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellName, for: indexPath) as? PokeCell else { return PokeCell() }
cell.update(data: dataSource[indexPath.row])
return cell
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: collectionView.frame.width, height: 50)
}
}
extension ManageBlindController: ManageBlindControllerDelegate {
func refresh() {
App.api.manageBlind { [weak self] (dataResponse: DataResponse<Model.ManageBlind>) in
guard let `self` = self else { return }
switch dataResponse.result {
case .success(let data): self.manage = data
case .failure(let error): print(error)
}
}
}
}
extension ManageBlindController {
@objc fileprivate func choiceFriend() {
guard GlobalState.instance.uid != -1 else { return }
let friendsController = FriendsController()
friendsController.manageBlindControllerDelegate = self
self.navigationController?.pushViewController(friendsController, animated: true)
}
@objc fileprivate func editRecommendMessage() {
let recommendController = RecommendController()
recommendController.textView.text = recommendMessageView.text
recommendController.manageBlindControllerDelegate = self
self.navigationController?.pushViewController(recommendController, animated: true)
// if recommendMessageView.isEditable {
// // 저장 액션
// print("\(recommendMessageView.text)")
// }
// recommendMessageView.isEditable = !recommendMessageView.isEditable
// recommendEditButton.setTitle(recommendMessageView.isEditable ? "저장" : "편집", for: .normal)
}
}
| [
-1
] |
6ea5357ad5d838a24caae92803d3914bf966d20a | af3db6179638e4869b8d73783a1f5d28a751bde4 | /Graphs/View Controllers/File List/FileListViewController+NSTextFieldDelegate.swift | 0be87019ca0cd5403879eb9e740a24bbc097871d | [
"MIT"
] | permissive | HildrethResearchGroup/Graphs | 761054f1a25780702dfd28e32ed6e2c4f03d9016 | 86ee4bf8635dfc81c59a446fa1ada2b4165b5d7a | refs/heads/master | 2023-06-02T17:22:26.802741 | 2020-11-27T02:46:21 | 2020-11-27T02:46:21 | 258,667,783 | 5 | 0 | null | 2021-06-17T04:47:38 | 2020-04-25T02:11:52 | Swift | UTF-8 | Swift | false | false | 1,574 | swift | //
// FileListViewController+NSTextFieldDelegate.swift
// Graphs
//
// Created by Connor Barnes on 6/7/20.
// Copyright © 2020 Connor Barnes. All rights reserved.
//
import Cocoa
// MARK: NSTextFieldDelegate
extension FileListViewController: NSTextFieldDelegate {
/// Called when an NSTextField ends editing.
func controlTextDidEndEditing(_ notification: Notification) {
// Only the NSTextField in the NSTableViewCell should have this controller as its delegate -- no other subclasses of NSControl should thus be calling this method.
guard let textField = textField(for: notification) else {
print("[WARNING] A subclass of NSControl has called controlTextDidEndEditing(_:) that is not an NSTextField. Only the NSTextField in the data cell of the NSTableViewCell should have its delegate set to the SidebarViewController.")
return
}
let newName = textField.stringValue
// In order to determine the File instance that the text field is referencing the following chain is used:
// The Edited NSTableView -> The container NSTableViewCell -> The row index of the cell -> The file at that index
guard let tableViewCell = textField.superview else {
print("[WARNING] NSOutlineView could not find the table view cell of the editing text field.")
return
}
let row = tableView.row(for: tableViewCell)
guard row != -1 else {
print("[WARNING] NSOutlineView could not find the row of the editing text field.")
return
}
if let file = dataController?.filesDisplayed[row] {
dataController?.rename(file: file, to: newName)
}
}
}
| [
-1
] |
72e6efcd66e5306130fa5f32ae2dc10c27411740 | 305c589bbe3f93f97232ffcb012f9295b33f41dc | /BaseProject/LeftMenuViewController.swift | bec87df81fe48a592ee7d6551e57cb8c28f7c389 | [] | no_license | TAREQ-AL-ABEDIN/storyappios | 06f7bb52c1fa111b89bf331aa88b5cef6fc64aeb | f8e4e230700e2d9a4ae24a38258d13b349a667ce | refs/heads/master | 2020-04-26T08:59:31.442519 | 2019-04-02T10:44:53 | 2019-04-02T10:44:53 | 173,440,794 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 12,681 | swift | //
// LeftMenuViewController.swift
// StoryApp
//
// Created by M Khairul Bashar on 1/31/18.
// Copyright © 2018 Annanovas IT Ltd. All rights reserved.
//
import UIKit
class LeftMenuViewController: UIViewController,UITableViewDelegate, UITableViewDataSource {
@IBOutlet var listTableView: UITableView!
var dataArray = [NSDictionary]()
@IBOutlet var btnRemoveAdds:UIButton!
func reloadData(){
let mqdbm = MyQueryDBManager.sharedManager() as! MyQueryDBManager
_ = mqdbm.openDB()
self.dataArray = mqdbm.getCategoryList() as! [NSDictionary]
//print("self.dataArray = \(String(describing: self.dataArray))")
mqdbm.closeDB()
listTableView.reloadData()
}
override func viewDidLoad() {
super.viewDidLoad()
self.rootAction()
self.listTableView.delegate = self
self.listTableView.dataSource = self
}
override func viewWillAppear(_ animated: Bool) {
self.reloadData()
}
// MARK: - Button Action
@IBAction func rootAction(){
/*if (btnHome?.isSelected)!{
print("already selected")
return
}
*/
//btnRemoveAdds.isSelected = false
if(appDelegate.rootNaviCon == nil){
//let storyboard = UIStoryboard(name: "Main", bundle: nil)
let rvc = appDelegate.storyBoard?.instantiateViewController(withIdentifier: "CategoryViewController") as? CategoryViewController
appDelegate.rootNaviCon = UINavigationController(rootViewController: rvc!)
appDelegate.rootNaviCon?.navigationBar.isHidden = true
appDelegate.rootNaviCon?.toolbar.isHidden = true
appDelegate.currentNaviCon = (appDelegate.rootNaviCon)!
appDelegate.window?.addSubview((appDelegate.rootNaviCon?.view)!)
((appDelegate.rootNaviCon?.view)!).alpha = 1;
((appDelegate.rootNaviCon?.view)!).frame = CGRect(x:0.0, y:0.0, width:ScreenSize.SCREEN_WIDTH, height:ScreenSize.SCREEN_HEIGHT)
}
else{
appDelegate.currentNaviCon = (appDelegate.rootNaviCon)!
appDelegate.window?.bringSubview(toFront: (appDelegate.currentNaviCon?.view)!)
}
appDelegate.drawerController?.mainViewController = appDelegate.currentNaviCon
appDelegate.currentNaviCon?.navigationBar.isHidden = true
appDelegate.currentNaviCon?.toolbar.isHidden = true
self.didTapCloseButton()
}
@IBAction func removeAddsAction(){
if (btnRemoveAdds?.isSelected)!{
print("already selected")
return
}
btnRemoveAdds?.isSelected = true
appDelegate.previousNaviCon = appDelegate.currentNaviCon
print("\(String(describing: appDelegate.currentNaviCon?.title))")
if(appDelegate.removeAddsNaviCon == nil){
//let storyboard = UIStoryboard(name: "Main", bundle: nil)
let ravc = appDelegate.storyBoard?.instantiateViewController(withIdentifier: "RemoveAdsViewController") as? RemoveAdsViewController
appDelegate.removeAddsNaviCon = UINavigationController(rootViewController: ravc!)
appDelegate.removeAddsNaviCon?.navigationBar.isHidden = true
appDelegate.removeAddsNaviCon?.toolbar.isHidden = true
appDelegate.currentNaviCon = (appDelegate.removeAddsNaviCon)!
appDelegate.window?.addSubview((appDelegate.removeAddsNaviCon?.view)!)
((appDelegate.removeAddsNaviCon?.view)!).alpha = 1;
((appDelegate.removeAddsNaviCon?.view)!).frame = CGRect(x:0.0, y:0.0, width:ScreenSize.SCREEN_WIDTH, height:ScreenSize.SCREEN_HEIGHT)
}
else{
appDelegate.currentNaviCon = (appDelegate.removeAddsNaviCon)!
appDelegate.window?.bringSubview(toFront: (appDelegate.currentNaviCon?.view)!)
}
appDelegate.drawerController?.mainViewController = appDelegate.currentNaviCon
appDelegate.currentNaviCon?.navigationBar.isHidden = true
appDelegate.currentNaviCon?.toolbar.isHidden = true
self.didTapCloseButton()
}
func settingShow(){
appDelegate.previousNaviCon = appDelegate.currentNaviCon
if(appDelegate.settingNaviCon == nil){
let svc = appDelegate.storyBoard?.instantiateViewController(withIdentifier: "SettingViewController") as? SettingViewController
appDelegate.settingNaviCon = UINavigationController(rootViewController: svc!)
appDelegate.settingNaviCon?.navigationBar.isHidden = true
appDelegate.settingNaviCon?.toolbar.isHidden = true
appDelegate.currentNaviCon = (appDelegate.settingNaviCon)!
appDelegate.window?.addSubview((appDelegate.settingNaviCon?.view)!)
((appDelegate.settingNaviCon?.view)!).alpha = 1;
((appDelegate.settingNaviCon?.view)!).frame = CGRect(x:0.0, y:0.0, width:ScreenSize.SCREEN_WIDTH, height:ScreenSize.SCREEN_HEIGHT)
}
else{
appDelegate.currentNaviCon = (appDelegate.settingNaviCon)!
appDelegate.window?.bringSubview(toFront: (appDelegate.currentNaviCon?.view)!)
}
appDelegate.drawerController?.mainViewController = appDelegate.currentNaviCon
appDelegate.currentNaviCon?.navigationBar.isHidden = true
appDelegate.currentNaviCon?.toolbar.isHidden = true
self.didTapCloseButton()
}
@IBAction func settingAction(){
print("settingAction")
appDelegate.isSetting_flag = 0
self.settingShow()
}
func didTapCloseButton() {
if let drawerController = parent as? KYDrawerController {
drawerController.setDrawerState(.closed, animated: true)
}
}
// MARK: - Table Delegates
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return dataArray.count
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 34.0
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell:TableCell = tableView.dequeueReusableCell(withIdentifier: "TableCell", for: indexPath) as! TableCell
let info = dataArray[indexPath.row]
cell.lblTitle?.text = info.object(forKey: "name") as? String
let cid = info.value(forKey: "id") as! Int
if paid_categories.contains(cid){
if cid == 2 && ((prefs.value(forKey: product_adventure) != nil && (prefs.value(forKey: product_adventure) as! String) == "purchased") || (prefs.value(forKey: product_allCategories) != nil && (prefs.value(forKey: product_allCategories) as! String) == "purchased")){
cell.imgLock?.alpha = 0
cell.imgIcon?.alpha = 1
}
else if cid == 7 && ((prefs.value(forKey: product_flashFiction) != nil && (prefs.value(forKey: product_flashFiction) as! String) == "purchased") || (prefs.value(forKey: product_allCategories) != nil && (prefs.value(forKey: product_allCategories) as! String) == "purchased")){
cell.imgLock?.alpha = 0
cell.imgIcon?.alpha = 1
}
else if cid == 11 && ((prefs.value(forKey: product_scifi) != nil && (prefs.value(forKey: product_scifi) as! String) == "purchased") || (prefs.value(forKey: product_allCategories) != nil && (prefs.value(forKey: product_allCategories) as! String) == "purchased")){
cell.imgLock?.alpha = 0
cell.imgIcon?.alpha = 1
}
else{
cell.imgLock?.alpha = 1
cell.imgIcon?.alpha = 0
}
}
else{
cell.imgLock?.alpha = 0
cell.imgIcon?.alpha = 1
}
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print("\(indexPath.row)")
let info = dataArray[indexPath.row]
let cid = info.value(forKey: "id") as! Int
if paid_categories.contains(cid){
if cid == 2 && ((prefs.value(forKey: product_adventure) != nil && (prefs.value(forKey: product_adventure) as! String) == "purchased") || (prefs.value(forKey: product_allCategories) != nil && (prefs.value(forKey: product_allCategories) as! String) == "purchased")){
self.goNext(withInfo: info)
}
else if cid == 7 && ((prefs.value(forKey: product_flashFiction) != nil && (prefs.value(forKey: product_flashFiction) as! String) == "purchased") || (prefs.value(forKey: product_allCategories) != nil && (prefs.value(forKey: product_allCategories) as! String) == "purchased")){
self.goNext(withInfo: info)
}
else if cid == 11 && ((prefs.value(forKey: product_scifi) != nil && (prefs.value(forKey: product_scifi) as! String) == "purchased") || (prefs.value(forKey: product_allCategories) != nil && (prefs.value(forKey: product_allCategories) as! String) == "purchased")){
self.goNext(withInfo: info)
}
else{
let alert = UIAlertController(title: "", message: "Do you want to buy this chapter with 0.99$", preferredStyle: .alert)
let yesButton = UIAlertAction(title: "Buy", style: .default, handler: { action in
#if (arch(i386) || arch(x86_64)) && os(iOS)
print("It's an iOS Simulator")
var key = ""
if cid == 2{
key = product_adventure
}
else if cid == 7 {
key = product_flashFiction
}
else if cid == 11 {
key = product_scifi
}
prefs.set("purchased", forKey: key)
prefs.synchronize()
self.listTableView.reloadData()
#else
print("It's a device")
//[appDelegate showLoadingPurchase];
//MKStoreManager.shared().buyUnit("Chapter \(chapter.cid())")
#endif
alert.dismiss(animated: true)
})
let noButton = UIAlertAction(title: "Cancel", style: .default, handler: { action in
alert.dismiss(animated: true)
})
alert.addAction(yesButton)
alert.addAction(noButton)
present(alert, animated: true)
}
}
else{
self.goNext(withInfo: info)
}
}
func goNext(withInfo : NSDictionary){
var storyboard = UIStoryboard.init(name: "Main-iPhone5", bundle: nil)
if DeviceType.IS_IPHONE_6{
storyboard = UIStoryboard.init(name: "Main", bundle: nil)
}
else if DeviceType.IS_IPHONE_6P{
storyboard = UIStoryboard.init(name: "Main-iPhone6P", bundle: nil)
}
else if DeviceType.IS_IPHONE_X || DeviceType.IS_IPHONE_XR{
storyboard = UIStoryboard.init(name: "Main-iPhoneX", bundle: nil)
}
let hvc = storyboard.instantiateViewController(withIdentifier: "HomeViewController") as? HomeViewController
hvc?.storyInfo = withInfo
appDelegate.currentNaviCon?.pushViewController(hvc!, animated: true)
self.didTapCloseButton()
}
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
] |
48505586a98d7858cfcf13639cc6c01e08fa8e7c | 867c3e0b658a11e76b500f2a830ceb21636254ba | /PagaMe/Common/Protocols/ContinueButtonPresentable.swift | b3d567de5ee03b4401ccb333e89b664f857de3ca | [
"MIT"
] | permissive | glm4/PagaMe | 1f803f13da155a32cb8769d72476eef4549fd678 | eacf4f7ccfaf00a244b91b63e9dda4168d051e0e | refs/heads/master | 2023-01-19T11:37:48.039229 | 2020-11-24T21:47:43 | 2020-11-24T21:47:43 | 314,371,228 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,966 | swift | //
// ContinueButtonPresentable.swift
// PagaMe
//
// Created by German on 11/20/20.
// Copyright © 2020 German Lopez. All rights reserved.
//
import UIKit
import RxSwift
import RxCocoa
internal protocol ContinueButtonPresentable: RxDisposable {
var continueButton: UIButton! { get }
var buttonTitle: String { get }
var validationDriver: Driver<Bool> { get }
func setupButtonLayoutConstraints()
func setupButtonBindings()
func continueButtonTapped()
func stylizeContinueButton()
}
extension ContinueButtonPresentable where Self: UIViewController {
var buttonTitle: String {
"continue_button.default".localized.uppercased()
}
func setupButtonLayoutConstraints() {
continueButton.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
continueButton.heightAnchor.constraint(
equalToConstant: ContinueButton.height
),
continueButton.leadingAnchor.constraint(
equalTo: view.safeAreaLayoutGuide.leadingAnchor,
constant: AtomicLayout.defaultMargins
),
continueButton.trailingAnchor.constraint(
equalTo: view.safeAreaLayoutGuide.trailingAnchor,
constant: -AtomicLayout.defaultMargins
),
continueButton.bottomAnchor.constraint(
equalTo: view.safeAreaLayoutGuide.bottomAnchor,
constant: -ContinueButton.bottom)
])
}
func setupButtonBindings() {
validationDriver
.drive(continueButton.rx.isEnabled)
.disposed(by: disposeBag)
validationDriver
.map({ $0 ? 1 : 0.75 })
.drive(continueButton.rx.alpha)
.disposed(by: disposeBag)
continueButton.rx.tap.bind { [weak self] in
self?.continueButtonTapped()
}.disposed(by: disposeBag)
}
func stylizeContinueButton() {
continueButton.setTitleColor(.body, for: .normal)
continueButton.setTitle(buttonTitle, for: .normal)
continueButton.applyDefaultStyle()
}
}
| [
-1
] |
1465ae26a568aeacfabe34e6cad5ef6fc3181a0e | 48d969702ed8f45202192a8d4e7928bd0aed7090 | /ex_idus/Module/ProductList/Cell/ProductCell.swift | 5efc7476e5c466c2be8001c9eee5c079b4c9371e | [] | no_license | Rootbro92/ex_idus | 436200eecfb33e2ba0734e3fe033314a6d731fba | 4718856dd03ca9ea25dfed643e2083097240e1c9 | refs/heads/master | 2021-01-07T09:42:54.328095 | 2020-04-13T14:49:18 | 2020-04-13T14:49:18 | 241,653,650 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,026 | swift | //
// ProductCell.swift
// ex_idus
//
// Created by 박근형 on 2020/02/23.
// Copyright © 2020 pgh. All rights reserved.
//
import UIKit
import Kingfisher
class ProductCell: UICollectionViewCell {
struct UI {
static let imageRadius: CGFloat = 14
static let fontSize: CGFloat = 15
}
@IBOutlet weak var productImage: UIImageView!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var sellerLabel: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
titleLabel.font = AppTheme.font.NotoSansCJKkrBlack(size: UI.fontSize)
sellerLabel.font = AppTheme.font.NotoSansCJKkrBold(size: UI.fontSize)
}
func configure(with product: Product) {
let url = URL(string: product.thumb)
productImage.kf.setImage(with: url)
productImage.clipsToBounds = true
productImage.layer.cornerRadius = UI.imageRadius
titleLabel.text = product.title
sellerLabel.text = product.seller
}
}
| [
-1
] |
fb0f4b6883d4ffb3484de1c17f4685b41ede8b6f | 3b5e9c38529f078e6d88221a927412cef1f427e2 | /MSColor/MSColor.swift | 283c09493b5b85369db272b3c88bf2888e837945 | [] | no_license | marsportillo/MSColor | 644bfb9d8cd336c29c07ce5429e8881805fc3578 | 5f149ee1bc5661efbf44e9bbad5c93d44d3a2846 | refs/heads/master | 2021-01-12T14:52:19.679507 | 2016-09-22T15:14:12 | 2016-09-22T15:14:12 | 68,933,416 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,978 | swift | //
// MSColor.swift
// MSColor
//
// Created by marco sportillo on 22/09/2016.
// Copyright © 2016 msportillo.me. All rights reserved.
//
import UIKit
class MSColor: UIColor {
convenience init(red: Int, green: Int, blue: Int) {
assert(red >= 0 && red <= 255, "Invalid red component")
assert(green >= 0 && green <= 255, "Invalid green component")
assert(blue >= 0 && blue <= 255, "Invalid blue component")
self.init(red: CGFloat(red) / 255.0, green: CGFloat(green) / 255.0, blue: CGFloat(blue) / 255.0, alpha: 1.0)
}
// Example: MSColor.init("0xff00ff")
convenience init(hexInt:Int) {
self.init(red:(hexInt >> 16) & 0xff, green:(hexInt >> 8) & 0xff, blue:hexInt & 0xff)
}
// Example: MSColor.init("ff00ff")
convenience init(hexIntRaw: String) {
let intRaw = Int(hexIntRaw,radix: 16)
self.init(red:(intRaw! >> 16) & 0xff, green:(intRaw! >> 8) & 0xff, blue:intRaw! & 0xff)
}
//Example: MSColor.init("#ff00ff")
convenience init(hexIntRawWithDash: String) {
var str = hexIntRawWithDash
str.remove(at: str.startIndex)
let hexValue = Int(str,radix: 16)
self.init(red:(hexValue! >> 16) & 0xff, green:(hexValue! >> 8) & 0xff, blue:hexValue! & 0xff)
}
}
extension UIColor {
convenience init(red: Int, green: Int, blue: Int) {
assert(red >= 0 && red <= 255, "Invalid red component")
assert(green >= 0 && green <= 255, "Invalid green component")
assert(blue >= 0 && blue <= 255, "Invalid blue component")
self.init(red: CGFloat(red) / 255.0, green: CGFloat(green) / 255.0, blue: CGFloat(blue) / 255.0, alpha: 1.0)
}
convenience init(netHex:Int) {
self.init(red:(netHex >> 16) & 0xff, green:(netHex >> 8) & 0xff, blue:netHex & 0xff)
}
}
| [
-1
] |
0096e08cb0f2b672133425f4d58edf6b2f95d47e | 1d7fc97f124539b01b1eb3617296b115d83fdbd7 | /BVSwiftTests/BVConversations/Display/BVQuestionQueryTest.swift | 1ea165c7556d05a5608d9435e16e87af47f3a602 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | bazaarvoice/bv-ios-swift-sdk | 91e8aa14a8d10a935eb3656a4e90030cdbc8fdd1 | d0b851bcd490d22d38734f9820da29b5e33fe5b2 | refs/heads/master | 2023-08-17T00:32:46.444026 | 2023-08-16T09:29:51 | 2023-08-16T09:29:51 | 134,313,502 | 10 | 9 | NOASSERTION | 2023-08-15T10:12:03 | 2018-05-21T19:09:01 | Swift | UTF-8 | Swift | false | false | 11,277 | swift | //
//
// BVQuestionQueryTest.swift
// BVSwiftTests
//
// Copyright © 2018 Bazaarvoice. All rights reserved.
//
import Foundation
import XCTest
@testable import BVSwift
class BVQuestionQueryTest: XCTestCase {
private static var config: BVConversationsConfiguration =
{ () -> BVConversationsConfiguration in
let analyticsConfig: BVAnalyticsConfiguration =
.dryRun(
configType: .staging(clientId: "apitestcustomer"))
return BVConversationsConfiguration.display(
clientKey: "kuy3zj9pr3n7i0wxajrzj04xo",
configType: .staging(clientId: "apitestcustomer"),
analyticsConfig: analyticsConfig)
}()
private static var syndicationSourceConfig: BVConversationsConfiguration =
{ () -> BVConversationsConfiguration in
let analyticsConfig: BVAnalyticsConfiguration =
.dryRun(
configType: .staging(clientId: "testcust-contentoriginsynd"))
return BVConversationsConfiguration.display(
clientKey: "carz85SqKJp9FrZgeb2irdiEBT4b0DSe7m1KUm18elijE",
configType: .staging(clientId: "testcust-contentoriginsynd"),
analyticsConfig: analyticsConfig)
}()
private static var privateSession:URLSession = {
return URLSession(configuration: .default)
}()
override class func setUp() {
super.setUp()
BVPixel.skipAllPixelEvents = true
}
override class func tearDown() {
super.tearDown()
BVPixel.skipAllPixelEvents = false
}
func testtQuestionQueryConstruction() {
let questionQuery =
BVQuestionQuery(productId: "test1", limit: 10, offset: 0)
.configure(BVQuestionQueryTest.config)
.filter((.categoryAncestorId("testID1"), .equalTo),
(.categoryAncestorId("testID2"), .equalTo),
(.categoryAncestorId("testID3"), .equalTo),
(.categoryAncestorId("testID4"), .notEqualTo),
(.categoryAncestorId("testID5"), .notEqualTo))
guard let url = questionQuery.request?.url else {
XCTFail()
return
}
print(url.absoluteString)
XCTAssertTrue(url.absoluteString.contains(
"CategoryAncestorId:eq:testID1,testID2,testID3"))
XCTAssertTrue(url.absoluteString.contains(
"CategoryAncestorId:neq:testID4,testID5"))
}
func testQuestionQuerySyndicationSource() {
let expectation =
self.expectation(description: "testCommentQuerySyndicationSource")
let questionQuery =
BVQuestionQuery(productId: "Concierge-Common-Product-1", limit: 10, offset: 0)
.include(.answers)
.filter(((.hasAnswers(true), .equalTo)))
.configure(BVQuestionQueryTest.syndicationSourceConfig)
.handler { (response: BVConversationsQueryResponse<BVQuestion>) in
if case .failure(let error) = response {
print(error)
XCTFail()
expectation.fulfill()
return
}
guard case let .success(_, questions) = response else {
XCTFail()
expectation.fulfill()
return
}
guard let question: BVQuestion = questions.first(where: { $0.questionId == "1536656" }) else {
XCTFail()
expectation.fulfill()
return
}
//Source Client
XCTAssertEqual(question.sourceClient, "testcust-contentorigin")
//Syndicated Source
XCTAssertNotNil(question.syndicationSource)
XCTAssertEqual(question.syndicationSource?.logoImageUrl, "https://contentorigin-stg.bazaarvoice.com/testsynd-origin/en_US/SYND1_SKY.png")
XCTAssertEqual(question.syndicationSource?.name, "TestCustomer-Contentorigin_Synd_en_US")
guard let answer: BVAnswer = question.answers?.first(where: { $0.answerId == "1577185" }) else {
XCTFail()
expectation.fulfill()
return
}
//Source Client
XCTAssertEqual(answer.sourceClient, "testcust-contentorigin")
//Syndicated Source
XCTAssertNotNil(answer.syndicationSource)
XCTAssertEqual(answer.syndicationSource?.logoImageUrl, "https://contentorigin-stg.bazaarvoice.com/testsynd-origin/en_US/SYND1_SKY.png")
XCTAssertEqual(answer.syndicationSource?.name, "TestCustomer-Contentorigin_Synd_en_US")
expectation.fulfill()
}
guard let req = questionQuery.request else {
XCTFail()
expectation.fulfill()
return
}
print(req)
questionQuery.async()
self.waitForExpectations(timeout: 20) { (error) in
XCTAssertNil(
error, "Something went horribly wrong, request took too long.")
}
}
func testQuestionQueryDisplay() {
let expectation =
self.expectation(description: "testQuestionQueryDisplay")
let questionQuery =
BVQuestionQuery(productId: "test1", limit: 10, offset: 0)
.include(.answers)
.filter(((.hasAnswers(true), .equalTo)))
.configure(BVQuestionQueryTest.config)
.handler { (response: BVConversationsQueryResponse<BVQuestion>) in
if case .failure(let error) = response {
print(error)
XCTFail()
expectation.fulfill()
return
}
guard case let .success(_, questions) = response else {
XCTFail()
expectation.fulfill()
return
}
guard let question: BVQuestion = questions.first,
let answers: [BVAnswer] = question.answers,
let answerIds: [String] = question.answerIds else {
XCTFail()
expectation.fulfill()
return
}
XCTAssertEqual(questions.count, 10)
XCTAssertEqual(question.questionSummary, "Das ist mein test :)")
XCTAssertEqual(question.questionDetails, "Das ist mein test :)")
XCTAssertEqual(question.userNickname, "123thisisme")
XCTAssertEqual(question.authorId, "eplz083100g")
XCTAssertEqual(question.moderationStatus, "APPROVED")
XCTAssertEqual(question.questionId, "14828")
let questionAnswers: [BVAnswer] =
answers.filter { (answer: BVAnswer) -> Bool in
guard let answerId: String = answer.answerId else {
return false
}
return answerIds.contains(answerId)
}
guard let firstQuestionAnswer: BVAnswer = questionAnswers.first else {
XCTFail()
expectation.fulfill()
return
}
XCTAssertEqual(questionAnswers.count, 1)
XCTAssertEqual(firstQuestionAnswer.userNickname, "asdfasdfasdfasdf")
XCTAssertEqual(firstQuestionAnswer.questionId, "14828")
XCTAssertEqual(firstQuestionAnswer.authorId, "c6ryqeb2bq0")
XCTAssertEqual(firstQuestionAnswer.moderationStatus, "APPROVED")
XCTAssertEqual(firstQuestionAnswer.answerId, "16292")
XCTAssertEqual(
firstQuestionAnswer.answerText,
"zxnc,vznxc osaidmf oaismdfo ims adoifmaosidmfoiamsdfimasdf")
questions.forEach { (question) in
XCTAssertEqual(question.productId, "test1")
}
expectation.fulfill()
}
guard let req = questionQuery.request else {
XCTFail()
expectation.fulfill()
return
}
print(req)
questionQuery.async()
self.waitForExpectations(timeout: 20) { (error) in
XCTAssertNil(
error, "Something went horribly wrong, request took too long.")
}
}
func testQuestionFilterByPassingArrayInsteadOfVariadicArguments() {
let expectation =
self.expectation(description: "testQuestionFilterByPassingArrayInsteadOfVariadicArguments")
let questionQuery =
BVQuestionQuery(productId: "test1")
.filter([(.contentLocale(Locale(identifier: "en_US")), .equalTo),(.contentLocale(Locale(identifier: "en_CA")), .equalTo)])
.configure(BVQuestionQueryTest.config)
.handler { (response: BVConversationsQueryResponse<BVQuestion>) in
if case .failure(let error) = response {
print(error)
XCTFail()
expectation.fulfill()
return
}
guard case let .success(_, questions) = response else {
XCTFail()
expectation.fulfill()
return
}
questions.forEach { (question) in
XCTAssert(question.contentLocale == "en_US" || question.contentLocale == "en_CA")
}
expectation.fulfill()
}
XCTAssert(questionQuery.request?.url?.absoluteString.contains("Filter=ContentLocale:eq:en_CA,en_US") == true)
questionQuery.async()
self.waitForExpectations(timeout: 20) { (error) in
XCTAssertNil(
error, "Something went horribly wrong, request took too long.")
}
}
}
| [
-1
] |
294a6c4d7fa5aeb29cb2e04cc7e2d17665f342a1 | 51ef3b664b02a215a003de2cb72f78e5209d54ee | /AppApp/TutorialView/WelcomeView.swift | 7ec77e9f22c916c2387e9789ea7a7ba09ae21022 | [] | no_license | harumidiv/AppApp | 02a5137dbf68f9007aa27cdf189894d4898f3106 | ab24b5bf9524bf781114c0fb1885512220667f47 | refs/heads/master | 2022-11-27T06:47:47.987962 | 2019-03-05T23:03:32 | 2019-03-05T23:03:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,431 | swift | //
// WelcomeView.swift
// AppApp
//
// Created by 久保 玲於奈 on 2017/12/01.
// Copyright © 2017年 Reona Kubo. All rights reserved.
//
import UIKit
class WelcomeView: UIView {
override func awakeFromNib() {
super.awakeFromNib()
self.backgroundColor = UIColor.allLabel()
setup()
}
func setup(){
let width = UIScreen.main.bounds.width
//let height = UIScreen.main.bounds.height
let margin:CGFloat = 30.0
//画像を置く
let logoView = UIImageView(frame:CGRect(x:margin,y:margin,width:250,height:70))
let titlePath = Bundle.main.path(forResource: "appapp_logo1", ofType: "png")
logoView.image = UIImage(contentsOfFile:titlePath!)?.withRenderingMode(.alwaysTemplate)
logoView.tintColor = UIColor.white
logoView.contentMode = .scaleAspectFit
self.addSubview(logoView)
//ラベルを置く
let explain = UILabel(frame:CGRect(x:logoView.frame.minX + margin,y:logoView.frame.maxY,width:width - (margin * 4),height:150))
explain.font = UIFont.boldSystemFont(ofSize: 20 + VersionManager.excess)
explain.textColor = UIColor.white
explain.numberOfLines = 0
explain.text = "はじめまして。\nAppAppは、アイコンデザインを収集・閲覧するためのアプリです。"
self.addSubview(explain)
}
}
| [
-1
] |
949507c9d700163dfad3bc13b59249dad7fcce05 | 44652644d6dcb8c59ee7527f14d599d153b2b434 | /Part3_App/Chapter19/section19-6/coreLocation_compass/coreLocation_compass/AppDelegate.swift | 390ea990fafb019848aabab9165d6739c42b7aa8 | [] | no_license | iOS-Lec-2017-1/swift-3-app-development | 247ff2b34ad21d5cf4f71153bd52bd7d22a2f858 | ef5aac80c5b8d95a0ba116fc03258d36c8219146 | refs/heads/master | 2021-01-22T13:22:43.070268 | 2017-08-16T08:08:02 | 2017-08-16T08:08:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,200 | swift | //
// AppDelegate.swift
// coreLocation_compass
//
// Created by yoshiyuki oshige on 2016/09/27.
// Copyright © 2016年 yoshiyuki oshige. 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,
229394,
278548,
229397,
229399,
229402,
352284,
229405,
278556,
278559,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
229426,
237618,
229428,
311349,
286774,
286776,
319544,
286778,
229432,
204856,
352318,
286791,
237640,
286797,
278605,
311375,
163920,
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,
286916,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
295220,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
278983,
319945,
278986,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
172534,
180727,
164343,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
172552,
287238,
320007,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
172618,
303690,
33357,
303696,
279124,
172634,
262752,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
295538,
189039,
172660,
287349,
189040,
189044,
287355,
287360,
295553,
172675,
295557,
287365,
311942,
303751,
352905,
279178,
287371,
311946,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
164509,
303773,
172705,
287394,
172707,
303780,
287390,
287398,
205479,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
328381,
287423,
328384,
172737,
279231,
287427,
312005,
107208,
172748,
287436,
172751,
287440,
295633,
172755,
303827,
279255,
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,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303985,
328563,
303987,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
213895,
304007,
304009,
304011,
304013,
295822,
279438,
189325,
189329,
295825,
304019,
213902,
58262,
304023,
304027,
279452,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
295945,
230413,
295949,
197645,
320528,
140312,
295961,
238620,
304164,
304170,
304175,
238641,
238652,
238655,
230465,
238658,
336964,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
279661,
205934,
164973,
312432,
279669,
337018,
189562,
279679,
304258,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
230592,
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,
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,
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,
280021,
239064,
288217,
329177,
280027,
288220,
288218,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
370146,
288234,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
296446,
321022,
402942,
148990,
296450,
206336,
230916,
230919,
230923,
304651,
304653,
370187,
402969,
230940,
222752,
108066,
296486,
296488,
157229,
230961,
157236,
288320,
288325,
124489,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
370272,
239202,
370279,
312938,
280183,
280185,
280191,
116354,
280194,
280208,
280211,
288408,
280222,
419489,
190118,
198310,
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,
321266,
288499,
419570,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
337732,
304968,
280393,
280402,
173907,
313171,
313176,
42842,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
124817,
280468,
239510,
280473,
124827,
247709,
214944,
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,
280681,
313451,
223341,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
288895,
321670,
215175,
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,
305464,
280888,
280891,
289087,
108865,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
280919,
248153,
215387,
354653,
313700,
280937,
313705,
190832,
280946,
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,
289227,
436684,
281047,
215526,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
240132,
281095,
223752,
150025,
338440,
330244,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
289317,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
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,
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,
174955,
224110,
207733,
207737,
158596,
183172,
240519,
322440,
314249,
338823,
183184,
289687,
224151,
240535,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
420829,
281567,
289762,
322534,
297961,
183277,
281581,
322550,
322563,
314372,
330764,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281711,
289912,
248995,
306341,
306344,
306347,
322734,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
216376,
380226,
298306,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
298365,
290174,
306555,
224641,
281987,
298372,
314756,
281990,
224647,
298377,
314763,
298381,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
290305,
306694,
192008,
323084,
257550,
282127,
290321,
282130,
290325,
282133,
241175,
290328,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
282186,
224849,
282195,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282255,
282261,
175770,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
282295,
282300,
323260,
323266,
282310,
323273,
282319,
306897,
241362,
306904,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
241450,
282410,
306988,
306991,
315184,
323376,
315190,
241464,
159545,
282425,
298811,
118593,
307009,
413506,
307012,
315211,
307027,
315221,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
315253,
315255,
339838,
315267,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
44948,
298901,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
241581,
241583,
323504,
241586,
290739,
241588,
282547,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
307287,
307290,
217179,
315482,
192605,
315483,
233567,
299105,
200801,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
241813,
307352,
299164,
299167,
315552,
184479,
184481,
184486,
307370,
307372,
307374,
307376,
323763,
184503,
299191,
176311,
307385,
307386,
307388,
258235,
307390,
176316,
299200,
307394,
299204,
307396,
184518,
307399,
323784,
233679,
307409,
307411,
299225,
233701,
307432,
282881,
184586,
282893,
291089,
282906,
291104,
233766,
299304,
295583,
307508,
315701,
332086,
307510,
307512,
307515,
307518,
282942,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
276052,
315739,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
291226,
242075,
283033,
194654,
61855,
291231,
283042,
291238,
291241,
127403,
127405,
291247,
299440,
127407,
299444,
127413,
291254,
283062,
127417,
291260,
127421,
283069,
127424,
299457,
127429,
127431,
127434,
315856,
127440,
176592,
315860,
176597,
127447,
283095,
299481,
127449,
176605,
242143,
127455,
127457,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
127490,
127494,
283142,
127497,
233994,
135689,
127500,
233998,
127506,
234003,
127509,
234006,
127511,
152087,
283161,
242202,
234010,
135707,
242206,
135710,
242208,
291361,
242220,
291378,
234038,
152118,
234041,
315961,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
291456,
135808,
373383,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
135839,
299680,
225954,
299684,
135844,
242343,
209576,
242345,
373421,
299706,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
299740,
201444,
299750,
283368,
234219,
283372,
185074,
226037,
283382,
316151,
234231,
234236,
226045,
242431,
234239,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
291593,
234248,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
348950,
201496,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
299814,
234278,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
160572,
283452,
234302,
234307,
242499,
234309,
292433,
316233,
234313,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
291711,
234368,
291714,
234370,
291716,
234373,
201603,
226182,
234375,
308105,
226185,
234379,
324490,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
234396,
324508,
291742,
226200,
234398,
234401,
291747,
291748,
234405,
291750,
234407,
324520,
324518,
324522,
234410,
291756,
226220,
291754,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
275384,
324536,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
324548,
226245,
234437,
234439,
226239,
234443,
291788,
234446,
275406,
193486,
234449,
316370,
193488,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
324599,
234490,
234493,
316416,
234496,
308226,
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,
234648,
275606,
234650,
275608,
324757,
300189,
324766,
119967,
234653,
308379,
283805,
234657,
242852,
300197,
234661,
283813,
234664,
324768,
275626,
234667,
316596,
308414,
234687,
300226,
308418,
234692,
300229,
308420,
308422,
226500,
283844,
300234,
283850,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
292097,
300289,
161027,
300292,
300294,
275719,
234760,
177419,
300299,
242957,
300301,
283917,
177424,
349451,
275725,
349464,
415009,
283939,
259367,
292143,
283951,
300344,
243003,
283963,
226628,
300357,
283973,
177482,
283983,
316758,
357722,
316766,
292192,
316768,
218464,
292197,
316774,
218473,
284010,
136562,
324978,
275834,
333178,
275836,
275840,
316803,
316806,
316811,
316814,
226703,
300433,
234899,
300436,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
144812,
284076,
144814,
144820,
374196,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
292338,
226802,
227440,
316917,
308727,
292343,
300537,
316933,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
194101,
284213,
316983,
194103,
284215,
308790,
284218,
226877,
292414,
284223,
284226,
284228,
292421,
226886,
284231,
128584,
243268,
284234,
276043,
317004,
366155,
284238,
226895,
284241,
194130,
284243,
300628,
284245,
276053,
284247,
317015,
284249,
243290,
284251,
235097,
284253,
300638,
284255,
284258,
292452,
292454,
284263,
284265,
292458,
284267,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
276095,
276098,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
276160,
358080,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
284365,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
276187,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
300832,
325408,
300834,
317221,
227109,
358183,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
292681,
153417,
358224,
276308,
284502,
317271,
276315,
292700,
317279,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
292729,
317306,
284540,
292734,
325512,
276365,
317332,
358292,
284564,
399252,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
317353,
292776,
284585,
276395,
292784,
358326,
161718,
358330,
276410,
276411,
276418,
301009,
301011,
301013,
292823,
358360,
301017,
301015,
292828,
276446,
153568,
276448,
276452,
292839,
276455,
350186,
292843,
276460,
292845,
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,
227426,
276579,
227430,
276583,
309354,
301167,
276590,
350321,
350313,
350316,
284786,
350325,
252022,
276595,
350328,
292985,
301178,
350332,
292989,
301185,
292993,
350339,
317570,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
276638,
284837,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
227571,
309491,
309494,
243960,
276735,
227583,
227587,
276739,
276742,
227593,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
285061,
366983,
317833,
178572,
285070,
285077,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
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,
113167,
309779,
317971,
309781,
277011,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
23094,
277054,
219714,
129603,
301636,
318020,
301639,
301643,
277071,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
121458,
277106,
170619,
309885,
309888,
277122,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
342707,
154292,
277173,
318132,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
342745,
137946,
342747,
113378,
228069,
277223,
342760,
285417,
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,
301884,
293696,
310080,
277317,
277322,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
236408,
15224,
277368,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
293817,
293820,
203715,
326603,
342994,
276586,
293849,
293861,
228327,
228328,
318442,
228330,
228332,
326638,
277486,
351217,
318450,
293876,
293877,
285686,
302073,
121850,
293882,
302075,
244731,
285690,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
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,
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,
64768,
310531,
285958,
138505,
228617,
318742,
277798,
130345,
113964,
285997,
384302,
285999,
113969,
318773,
318776,
286010,
417086,
286016,
302403,
294211,
384328,
294221,
146765,
294223,
326991,
179547,
146784,
302436,
294246,
327015,
310632,
327017,
351594,
351607,
310648,
310651,
310657,
351619,
294276,
310659,
327046,
253320,
310665,
318858,
310672,
351633,
310689,
130468,
228776,
277932,
310703,
310710,
130486,
310712,
310715,
302526,
228799,
302534,
310727,
64966,
245191,
163272,
302541,
302543,
310737,
228825,
163290,
310749,
310755,
187880,
310764,
286188,
310772,
40440,
212472,
40443,
286203,
40448,
228864,
286214,
228871,
302603,
65038,
302614,
286233,
302617,
302621,
286240,
146977,
187936,
187939,
40484,
294435,
40486,
286246,
294440,
40488,
294439,
294443,
40491,
294445,
278057,
310831,
245288,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
327240,
40521,
286283,
40525,
40527,
212560,
400976,
228944,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286313,
40554,
286312,
310892,
40557,
40560,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
122517,
278168,
179870,
327333,
229030,
278188,
302764,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
319187,
278227,
286420,
229076,
286425,
319194,
278235,
301163,
278238,
229086,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
278320,
319280,
319290,
229192,
302925,
188247,
188252,
237409,
294776,
294785,
327554,
360322,
40851,
294811,
237470,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
343983,
294831,
188340,
40886,
294844,
294847,
393177,
294876,
294879,
294883,
393190,
311279,
278513,
237555,
278516,
311283,
278519,
237562
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.