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
7a70cbd2dcc40950e981b9bb6ce0781fe29046dd
6e8144fbc486c7854892b58dccea5b3465b799f2
/Auto Layout Calculator/AppDelegate.swift
c8ed539597f9dd1e9edc326a2d01114abee85f97
[]
no_license
Shoko75/Auto-Layout-Calculator
a0f37d41ff9dc12b09aedc35f1bb34e449c80250
e3a5ec27460ace51c093ad803f51adb9bca62bbd
refs/heads/master
2020-05-24T05:32:28.200737
2019-05-17T00:15:22
2019-05-17T00:15:22
187,118,230
0
0
null
null
null
null
UTF-8
Swift
false
false
2,196
swift
// // AppDelegate.swift // Auto Layout Calculator // // Created by 橋本 翔子 on 2019-03-14. // Copyright © 2019 Shoko Hashimoto. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 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, 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, 303696, 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, 213902, 295822, 189329, 295825, 189331, 304019, 58262, 304023, 279452, 410526, 279461, 279462, 304042, 213931, 304055, 230327, 287675, 197564, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 295949, 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, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 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, 239586, 313320, 231404, 124913, 165876, 321528, 313340, 239612, 288764, 239617, 313347, 288773, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 215154, 313458, 280691, 149618, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 321740, 313548, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 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, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 281095, 223752, 338440, 150025, 330244, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 297594, 281210, 158347, 182926, 133776, 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, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 306555, 314747, 298365, 290171, 290174, 224641, 281987, 314756, 298372, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282261, 175770, 298651, 323229, 282269, 298655, 323231, 61092, 282277, 306856, 196133, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 306904, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 307009, 413506, 241475, 307012, 298822, 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, 307211, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 315483, 217179, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 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, 127447, 283095, 299481, 176605, 242143, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 127490, 283142, 127494, 127497, 233994, 135689, 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, 135844, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 242450, 234258, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 201557, 185173, 234329, 234333, 308063, 234336, 234338, 349027, 242530, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 201603, 291714, 234373, 316294, 226182, 234375, 308105, 226185, 234379, 324490, 291716, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 226200, 234396, 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, 226239, 324548, 234437, 226245, 234439, 234434, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 308291, 316483, 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, 234648, 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, 300299, 177419, 242957, 283917, 300301, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 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, 194103, 316983, 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, 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, 292843, 276460, 292845, 276464, 178161, 227314, 276466, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 276539, 235581, 178238, 325692, 276544, 284739, 325700, 243779, 292934, 243785, 276553, 350293, 350295, 309337, 194649, 227418, 350299, 350302, 227423, 194654, 178273, 309346, 194657, 309348, 350308, 309350, 227426, 309352, 350313, 309354, 301163, 350316, 194660, 227430, 276583, 276590, 350321, 284786, 276595, 301167, 350325, 227440, 350328, 292985, 301178, 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, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 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, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 277322, 293706, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 15224, 236408, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 276579, 293811, 293817, 293820, 203715, 326603, 276586, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 326638, 277486, 318450, 293876, 293877, 285686, 302073, 285690, 121850, 302075, 293882, 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, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 326991, 294223, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 310659, 351619, 294276, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 245191, 310727, 64966, 163272, 277959, 292968, 302541, 277963, 302543, 277966, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 302617, 286233, 302621, 286240, 146977, 187939, 294435, 40484, 40486, 286246, 40488, 278057, 294439, 40491, 294440, 294443, 294445, 310831, 245288, 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, 40840, 40851, 294803, 188312, 294811, 319390, 237470, 40865, 319394, 294817, 294821, 311209, 180142, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
beb5f6a09e196522e46f553ae4b67f3683b719b6
3fc45fe95a935453ebee52be897720e13f986956
/calculator_sf/ViewController.swift
c13ac3048712a9d70a1e624759d9a2439d174440
[]
no_license
an3wers/calculator_sf_20
86509a7846c67769120688592ccc087670be3eda
eb793ca18c0766962daca0343195040df5eeb51a
refs/heads/main
2023-02-03T23:18:04.159810
2020-12-20T16:36:59
2020-12-20T16:36:59
323,107,527
0
0
null
null
null
null
UTF-8
Swift
false
false
3,182
swift
// // ViewController.swift // calculator_sf // // Created by Artem on 20.12.2020. // import UIKit class ViewController: UIViewController { @IBOutlet weak var labelResult: UILabel! var typing = false var firstNumber:Double = 0 var secondNumber:Double = 0 var operation:String = "" var dotIsYes = false var currentValue:Double { get { return Double(labelResult.text!)! } set { labelResult.text! = ("\(newValue)") typing = false } } override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } // Кнопки с цифрами @IBAction func numberPressedBtn(_ sender: UIButton) { let number = sender.currentTitle! //print(number) if typing { labelResult.text = labelResult.text! + number } else { labelResult.text = number typing = true } } // Кнопки с вычислениями @IBAction func computationPressedBtn(_ sender: UIButton) { operation = sender.currentTitle! firstNumber = currentValue typing = false dotIsYes = false } // func operateWithNubres(operation: (Double, Double) -> Double) { currentValue = operation(firstNumber, secondNumber) typing = false } // Кнопка равно @IBAction func equalPressedBtn(_ sender: UIButton) { if typing { secondNumber = currentValue } dotIsYes = false switch operation { case "+": operateWithNubres {$0 + $1} case "-": operateWithNubres {$0 - $1} case "×": operateWithNubres {$0 * $1} case "÷": operateWithNubres {$0 / $1} default: break } } // Кнопка очищения @IBAction func clearPressedBtn(_ sender: UIButton) { firstNumber = 0 secondNumber = 0 currentValue = 0 labelResult.text = "0" typing = false operation = "" dotIsYes = false } // Кнопка плюс минус @IBAction func plusMinusPressedBtn(_ sender: UIButton) { currentValue = -currentValue } // Кнопка процент @IBAction func persentPressedBtn(_ sender: UIButton) { if firstNumber == 0 { currentValue = currentValue / 100 } else { secondNumber = firstNumber * currentValue / 100 } typing = false } // Кнопка возведения в квадрат @IBAction func squarePressedBtn(_ sender: UIButton) { currentValue = currentValue * currentValue } //Кнопка точка @IBAction func dotPressedBtn(_ sender: UIButton) { if typing && !dotIsYes { labelResult.text = labelResult.text! + "." dotIsYes = true } else if !typing && !dotIsYes { labelResult.text = "0." } } }
[ -1 ]
59c0f56a9e900e78939d7f50ddccdbcf81b15b6d
9ae5086d3c8c635e4bb7007b1f599de247a9e87a
/WebimClientLibrary/Backend/DeltaCallback.swift
220f572d1f4c046556c67a1a4038fa38f46b6c63
[ "MIT" ]
permissive
OberemkovGrigoriy/webim-client-sdk-ios
5445c327cd0ea81bc4804371531c625f856c3d3e
b0eb9824bfccd2a066ed790306681750fcae67a7
refs/heads/master
2021-05-04T20:33:14.115526
2018-02-01T11:42:12
2018-02-01T11:42:12
119,822,044
0
0
null
2018-02-01T10:43:01
2018-02-01T10:43:01
null
UTF-8
Swift
false
false
12,213
swift
// // DeltaCallback.swift // WebimClientLibrary // // Created by Nikita Lazarev-Zubov on 12.10.17. // Copyright © 2017 Webim. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // import Foundation /** Class that handles server response when SDK requests chat updates. - SeeAlso: `DeltaResponse` - Author: Nikita Lazarev-Zubov - Copyright: 2017 Webim */ final class DeltaCallback { // MARK: - Properties private let currentChatMessageMapper: MessageFactoriesMapper private var currentChat: ChatItem? private var messageHolder: MessageHolder? private var messageStream: MessageStreamImpl? // MARK: - Initialization init(currentChatMessageMapper: MessageFactoriesMapper) { self.currentChatMessageMapper = currentChatMessageMapper } // MARK: - Methods func set(messageStream: MessageStreamImpl, messageHolder: MessageHolder) { self.messageStream = messageStream self.messageHolder = messageHolder } func process(deltaList: [DeltaItem]) { guard messageStream != nil, messageHolder != nil else { return } for delta in deltaList { let deltaType = delta.getObjectType() guard deltaType != nil else { continue } switch deltaType! { case .CHAT: handleChatUpdateBy(delta: delta, messageStream: messageStream!) break case .CHAT_MESSAGE: handleChatMessageUpdateBy(delta: delta, messageStream: messageStream!, messageHolder: messageHolder!, currentChatMessageMapper: currentChatMessageMapper) break case .CHAT_OPERATOR: handleChatOperatorUpdateBy(delta: delta, messageStream: messageStream!) break case .CHAT_OPERATOR_TYPING: handleChatOperatorTypingUpdateBy(delta: delta, messageStream: messageStream!) break case .CHAT_READ_BY_VISITOR: handleChatReadByVisitorUpdateBy(delta: delta, messageStream: messageStream!) break case .CHAT_STATE: handleChatStateUpdateBy(delta: delta, messageStream: messageStream!) break case .DEPARTMENT_LIST: handleDepartmentListUpdateBy(delta: delta, messageStream: messageStream!) break case .OPERATOR_RATE: handleOperatorRateUpdateBy(delta: delta, messageStream: messageStream!) break case .VISIT_SESSION_STATE: handleVisitSessionStateUpdateBy(delta: delta, messageStream: messageStream!) break default: // Not supported delta type. break } } } func process(fullUpdate: FullUpdate) { guard messageStream != nil else { return } if let visitSessionState = fullUpdate.getState() { messageStream!.set(visitSessionState: (VisitSessionStateItem(rawValue: visitSessionState) ?? .UNKNOWN)) } if let departments = fullUpdate.getDepartments() { messageStream!.onReceiving(departmentItemList: departments) } currentChat = fullUpdate.getChat() messageStream!.changingChatStateOf(chat: currentChat) messageStream!.saveLocationSettingsOn(fullUpdate: fullUpdate) if let onlineStatusString = fullUpdate.getOnlineStatus() { if let onlineStatus = OnlineStatusItem(rawValue: onlineStatusString) { messageStream!.onOnlineStatusChanged(to: onlineStatus) } } } // MARK: Private methods private func handleChatUpdateBy(delta: DeltaItem, messageStream: MessageStreamImpl) { if delta.getEvent() == .UPDATE { if let deltaData = delta.getData() as? [String: Any?] { currentChat = ChatItem(jsonDictionary: deltaData) messageStream.changingChatStateOf(chat: currentChat) } } } private func handleChatMessageUpdateBy(delta: DeltaItem, messageStream: MessageStreamImpl, messageHolder: MessageHolder, currentChatMessageMapper: MessageFactoriesMapper) { let deltaEvent = delta.getEvent() let deltaID = delta.getID() if deltaEvent == .DELETE { if currentChat != nil { var currentChatMessages = currentChat!.getMessages() for (currentChatMessageIndex, currentChatMessage) in currentChatMessages.enumerated() { if currentChatMessage.getID() == deltaID { // Deleted message ID is passed as delta ID. currentChatMessages.remove(at: currentChatMessageIndex) currentChat!.set(messages: currentChatMessages) break } } } messageHolder.deletedMessageWith(id: deltaID) } else { if let deltaData = delta.getData() as? [String: Any?] { let messageItem = MessageItem(jsonDictionary: deltaData) let message = currentChatMessageMapper.map(message: messageItem) if deltaEvent == .ADD { currentChat?.add(message: messageItem) if message != nil { messageHolder.receive(newMessage: message!) } } else if deltaEvent == .UPDATE { if currentChat != nil { var currentChatMessages = currentChat!.getMessages() for (currentChatMessageIndex, currentChatMessage) in currentChatMessages.enumerated() { if currentChatMessage.getID() == messageItem.getID() { currentChatMessages[currentChatMessageIndex] = messageItem break } } } if message != nil { messageHolder.changed(message: message!) } } } } } private func handleChatOperatorUpdateBy(delta: DeltaItem, messageStream: MessageStreamImpl) { if let deltaData = delta.getData() as? [String: Any?] { let operatorItem = OperatorItem(jsonDictionary: deltaData) if delta.getEvent() == .UPDATE { currentChat?.set(operator: operatorItem) messageStream.changingChatStateOf(chat: currentChat) } } } private func handleChatOperatorTypingUpdateBy(delta: DeltaItem, messageStream: MessageStreamImpl) { if let operatorTyping = delta.getData() as? Bool { if delta.getEvent() == .UPDATE { currentChat?.set(operatorTyping: operatorTyping) messageStream.changingChatStateOf(chat: currentChat) } } } private func handleChatReadByVisitorUpdateBy(delta: DeltaItem, messageStream: MessageStreamImpl) { if let readByVisitor = delta.getData() as? Bool { if delta.getEvent() == .UPDATE { currentChat?.set(readByVisitor: readByVisitor) // Set unread messages by visitor timestamp to current date after receiving information that chat is read by visitor. if readByVisitor { messageStream.set(unreadByVisitorTimestamp: Date()) } } } } private func handleChatStateUpdateBy(delta: DeltaItem, messageStream: MessageStreamImpl) { if let chatState = delta.getData() as? String { if delta.getEvent() == .UPDATE { currentChat?.set(state: ChatItem.ChatItemState(rawValue: chatState)!) messageStream.changingChatStateOf(chat: currentChat) } } } private func handleDepartmentListUpdateBy(delta: DeltaItem, messageStream: MessageStreamImpl) { guard let deltaData = delta.getData() as? [Any] else { return } var departmentItems = [DepartmentItem]() for departmentData in deltaData { if let departmentDictionary = departmentData as? [String: Any] { if let deparmentItem = DepartmentItem(jsonDictionary: departmentDictionary) { departmentItems.append(deparmentItem) } } } messageStream.onReceiving(departmentItemList: departmentItems) } private func handleOperatorRateUpdateBy(delta: DeltaItem, messageStream: MessageStreamImpl) { if let deltaData = delta.getData() as? [String: Any?] { if let rating = RatingItem(jsonDictionary: deltaData) { if delta.getEvent() == .UPDATE { currentChat?.set(rating: rating, toOperatorWithId: rating.getOperatorID()) } } } } private func handleVisitSessionStateUpdateBy(delta: DeltaItem, messageStream: MessageStreamImpl) { if let sessionState = delta.getData() as? String { if sessionState == VisitSessionStateItem.OFFLINE_MESSAGE.rawValue { messageStream.set(onlineStatus: .OFFLINE) messageStream.getWebimActions().closeChat() } if delta.getEvent() == .UPDATE { messageStream.set(visitSessionState: (VisitSessionStateItem(rawValue: sessionState) ?? .UNKNOWN)) } } } }
[ -1 ]
c733c9532c9ff0bf11300bee68bb2afbf167df50
bdf9d3d7125b919482da4a5cc07037bc1f5fbe39
/SDK v1 Examples/Wayfinding Demo/Source/Views/PathSelectStatus.swift
19d250eedf800d19814d120004ae0cc14022c206
[ "MIT" ]
permissive
MappedIn/ios
08b5055e03adc51a9734b997f0d8930ca6932e3c
93a0d0d5dd9099e31623955305f211444a558da5
refs/heads/master
2023-07-27T22:25:48.714303
2023-06-16T18:31:12
2023-06-16T18:31:12
50,521,112
6
6
MIT
2023-08-28T15:47:25
2016-01-27T16:33:07
Swift
UTF-8
Swift
false
false
967
swift
// // PathSelectStatus.swift // Example // // Created by Coraline Sherratt on 2018-02-28. // Copyright © 2018 Mappedin. All rights reserved. // import Foundation import UIKit import Mappedin class PathSelectStatus: UIView { @IBOutlet weak var storeIcon: RoundImageView! @IBOutlet weak var goButton: RoundButton! @IBOutlet weak var descriptionLabel: UILabel! var destination: Navigatable? { didSet{ guard self.destination != nil else { return } descriptionLabel.text = destination!.name() } } static func initFromNib() -> PathSelectStatus { return UINib(nibName: "PathSelectStatus", bundle: nil) .instantiate(withOwner: nil, options: nil)[0] as! PathSelectStatus } typealias SimpleAction = () -> () var goButtonPressed: SimpleAction? @IBAction func goButtonPressed(_ sender: Any) { goButtonPressed?() } }
[ -1 ]
8c848167e4ed21c6050a508c6b8c84c95303d82d
73ff2204a4a558204cf2e9d2b3341db619c298af
/shoutit-iphone/Model/TwilioAuth.swift
f28083f04d2f77dea0589fc64acbc7552ac38652
[]
no_license
shoutit/shoutit-ios
4e9a887c2bae14d86abb9392851a8d4176153376
002c7c03d3ffd3bb049ce674927b649a2f8fdb7d
refs/heads/master
2021-08-17T20:37:56.109851
2016-04-27T13:42:21
2016-04-27T13:42:21
48,968,817
0
0
null
null
null
null
UTF-8
Swift
false
false
1,022
swift
// // TwilioAuth.swift // shoutit-iphone // // Created by Piotr Bernad on 18.03.2016. // Copyright © 2016 Shoutit. All rights reserved. // import Foundation import Argo import Curry import Ogra struct TwilioAuth { let token: String let identity: String } extension TwilioAuth: Decodable { static func decode(j: JSON) -> Decoded<TwilioAuth> { return curry(TwilioAuth.init) <^> j <| "token" <*> j <| "identity" } } extension TwilioAuth: Encodable { func encode() -> JSON { return JSON.Object(["token": self.token.encode(), "identity" : self.identity.encode()]) } } struct TwilioIdentity { let identity: String } extension TwilioIdentity: Decodable { static func decode(j: JSON) -> Decoded<TwilioIdentity> { return curry(TwilioIdentity.init) <^> j <| "identity" } } extension TwilioIdentity: Encodable { func encode() -> JSON { return JSON.Object(["identity" : self.identity.encode()]) } }
[ -1 ]
2fe4921f4447d94e725ff50790b31731d8ceff19
db65dc3dc4bccda8e41d2aee440b36c2ef4c2cb0
/chat/Bootstrap/BootstrapProtocols.swift
240f383e768955421e997836139b2fa7a89b7d3f
[]
no_license
pichukov/p2p-chat
85db61ae36738c327b249cdb1d4627f3f5e28000
25d832ea95a8dded19d060142f9d361d1ebcebf8
refs/heads/master
2020-03-08T16:04:09.400347
2018-04-05T15:56:32
2018-04-05T15:56:32
128,226,874
0
0
null
null
null
null
UTF-8
Swift
false
false
368
swift
// // BootstrapProtocols.swift // chat // // Created by Alexey Pichukov on 04.11.2017. // Copyright © 2017 Alexey Pichukov. All rights reserved. // import Foundation protocol BootstrapViewDelegate: class, ErrorAndLoadingShowable { func showRegistration() func hideRegistration(withCompletion completionBlock: @escaping () -> Void) func showChat() }
[ -1 ]
4fdef50e38a019e65c9c7b80dc88cb950a8bf2d7
bc50bb282a89737a4205e4f8be0da45d8ee2113e
/parstagram/AppDelegate.swift
d21c6900407b51cc6e9a5db20c1aaeba164a9441
[]
no_license
shahzodr/cpInstagram
a242cc030d37470582092dfd6d7d9e62632fb43e
82b1d11eb19bb073b242a964e7f245f72abf2627
refs/heads/main
2023-03-18T00:50:57.235891
2021-03-27T01:39:57
2021-03-27T01:39:57
349,634,199
0
0
null
null
null
null
UTF-8
Swift
false
false
1,677
swift
// // AppDelegate.swift // Parstagram // // Created by SRP on 3/19/21. // import UIKit import Parse @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. let parseConfig = ParseClientConfiguration { $0.applicationId = "HpHHdEZ9z0sZdT3B8XNXb7OxGrY6Bg0N9WiJaZlP" $0.clientKey = "0eL6Rv1jc7Iv9xYJMqkbrlEjSzjUWLOy59PwLrAN" $0.server = "https://parseapi.back4app.com" } Parse.initialize(with: parseConfig) 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. } }
[ 350213, 354313, 268298, 393230, 354142, 350231, 333850, 346139, 405533, 350237, 350240, 393250, 350244, 344102, 350248, 178218, 350251, 393261, 350256, 350259, 376889, 385081, 350271, 436289, 243781, 421960, 395339, 327756, 350285, 254030, 338004, 225119, 356439, 368727, 368735, 100453, 421990, 329832, 356466, 342133, 374902, 266362, 329855, 262283, 381068, 225423, 432271, 225429, 356506, 329885, 411805, 135327, 346272, 225441, 438433, 225444, 438436, 225447, 100524, 333997, 258222, 225455, 225458, 377012, 225461, 379066, 389307, 225466, 334011, 327871, 381120, 372929, 225475, 389320, 260298, 395466, 346316, 225484, 225487, 350416, 225490, 266453, 411861, 350422, 411864, 377046, 418010, 225496, 350425, 225499, 411868, 334045, 411873, 225505, 379107, 411876, 387301, 217318, 225510, 387306, 327914, 350445, 225518, 372976, 387312, 375026, 346355, 358644, 393456, 381176, 436473, 350458, 418043, 350461, 379134, 411903, 350464, 385280, 325891, 262404, 350467, 180490, 350475, 268559, 262416, 368911, 395538, 350480, 379152, 387349, 262422, 350486, 432405, 387352, 325914, 350490, 325917, 350493, 377117, 350498, 356643, 262436, 356646, 266536, 350504, 356649, 358700, 391468, 350509, 356655, 358704, 332080, 395566, 336180, 356660, 262454, 397622, 358713, 332090, 358716, 225597, 332097, 393538, 201028, 362822, 262472, 348488, 383306, 436555, 344403, 213332, 332117, 250199, 65880, 383321, 332125, 418144, 379233, 383330, 262499, 383333, 213352, 391530, 262507, 383341, 262510, 354673, 332152, 334203, 213372, 194941, 389502, 332161, 356740, 385419, 332172, 366990, 379278, 262550, 262552, 373145, 340379, 416157, 342430, 385440, 385443, 354727, 326058, 385451, 389550, 393647, 375216, 385458, 334262, 262586, 324030, 344511, 262592, 358856, 330189, 338381, 360916, 369118, 338403, 338409, 160234, 375277, 127471, 328177, 328182, 340472, 199164, 328189, 324094, 328192, 266754, 324099, 324102, 164361, 330252, 324111, 410128, 186897, 199186, 342545, 393747, 324117, 334358, 254490, 330267, 334363, 342554, 188958, 385570, 324131, 33316, 332324, 377383, 197159, 354855, 350761, 324139, 356907, 324142, 334384, 358961, 356916, 352821, 324149, 334394, 418363, 188987, 348733, 324155, 252482, 324164, 219718, 348743, 381512, 334407, 369223, 324170, 10828, 324173, 385609, 324176, 199249, 334420, 389723, 373343, 352864, 369253, 350822, 174695, 262760, 375400, 352874, 381545, 191084, 191092, 352887, 254587, 148105, 377484, 326290, 340627, 184982, 342679, 98968, 352918, 260766, 350202, 332453, 150183, 344744, 361129, 332459, 336555, 332463, 381617, 434867, 342710, 164534, 336567, 174774, 332471, 174777, 164538, 260797, 244409, 223934, 328378, 260801, 328386, 332483, 350917, 332486, 352968, 344776, 418507, 357069, 154317, 385742, 355024, 357073, 355028, 391894, 264918, 154328, 416473, 361179, 183005, 256734, 332511, 338660, 369381, 64230, 332520, 113388, 264941, 340718, 342766, 203506, 418553, 348924, 391937, 207619, 264964, 336643, 344841, 391948, 338700, 375568, 326416, 336659, 418585, 434970, 199452, 363293, 418589, 162591, 418593, 396066, 328484, 346916, 418598, 215853, 418605, 383793, 152370, 326451, 348978, 340789, 326454, 348982, 355122, 361273, 355131, 398139, 244540, 260924, 326460, 326467, 355140, 328515, 127814, 355143, 244551, 336711, 326473, 326477, 355150, 357201, 330580, 416597, 326485, 357206, 426841, 342874, 357211, 197468, 361309, 355166, 265055, 357214, 389978, 326502, 355175, 387944, 375656, 361322, 201579, 326507, 355179, 201582, 349040, 211825, 330610, 340849, 430965, 211831, 324472, 398201, 119674, 324475, 430972, 340861, 324478, 377729, 373634, 342915, 324484, 400259, 324487, 381833, 324492, 236430, 324495, 355218, 430995, 330642, 342930, 324501, 392091, 400285, 324510, 324513, 252836, 201637, 359334, 398245, 211884, 324524, 340909, 222128, 400306, 324538, 324541, 207808, 351168, 359366, 379848, 340939, 340941, 209873, 345043, 396245, 248792, 386011, 359388, 340957, 248798, 383967, 431072, 347105, 386018, 398306, 386022, 209895, 343015, 201711, 359407, 183282, 435187, 261108, 244726, 261111, 265207, 349180, 383997, 330748, 330760, 261129, 328714, 330768, 361489, 386069, 386073, 261147, 359451, 336925, 211998, 377887, 248862, 261153, 357410, 345118, 185380, 250914, 261159, 396328, 158761, 357418, 345133, 199728, 330800, 345138, 396339, 359476, 386101, 339001, 388154, 209979, 361536, 388161, 347205, 197707, 341071, 345169, 349267, 250967, 210010, 343131, 361567, 257120, 148578, 384098, 367723, 187502, 343154, 384114, 210036, 386167, 248951, 361593, 410745, 420984, 349308, 212094, 349311, 152703, 351364, 210052, 214149, 210055, 349319, 330889, 386186, 210067, 351381, 337047, 347287, 248985, 345246, 214175, 251044, 44197, 380070, 185511, 337071, 367794, 337075, 210107, 351423, 257908, 343244, 330958, 210127, 333009, 386258, 210131, 146642, 265432, 328924, 66782, 210143, 388319, 359649, 222437, 343270, 147317, 351466, 328941, 386285, 386291, 351479, 251128, 388347, 275712, 275715, 343306, 261389, 359694, 253200, 349459, 251160, 159005, 345376, 353570, 345379, 245029, 171302, 208166, 345382, 273708, 351534, 372015, 245040, 347441, 372018, 376110, 199988, 251189, 345399, 396600, 378169, 369978, 415033, 437566, 437570, 212291, 343365, 337222, 437575, 357708, 437583, 331088, 337234, 437587, 210260, 263508, 331093, 396633, 437595, 367965, 175457, 365921, 208227, 175460, 343398, 175463, 345448, 333162, 367980, 265580, 343409, 234866, 271730, 437620, 390516, 175477, 253303, 154999, 343417, 333175, 327034, 175483, 357755, 175486, 271745, 249218, 181638, 245127, 251271, 353673, 181643, 384397, 245136, 349590, 181654, 245142, 230809, 175513, 245145, 245148, 245151, 357792, 396705, 175522, 245154, 355748, 245157, 181673, 245162, 327084, 181681, 337329, 396722, 181684, 384443, 146876, 361917, 415166, 181696, 372163, 327107, 216517, 327110, 337349, 380360, 384453, 216522, 327115, 339404, 327117, 359886, 372176, 208337, 359890, 415185, 339412, 413141, 366038, 339417, 339420, 249308, 368092, 271839, 415199, 339424, 339428, 415207, 329191, 361960, 366056, 343534, 415216, 249328, 116210, 343539, 210420, 368119, 69113, 368122, 423423, 409091, 372228, 419339, 359947, 208398, 419343, 380432, 175635, 359955, 419349, 415257, 419355, 370205, 415263, 419359, 419362, 394786, 370213, 366117, 419368, 359983, 419376, 415281, 206395, 214593, 265795, 415300, 396872, 419400, 419402, 265805, 343630, 419406, 419410, 224853, 224857, 366172, 257633, 394853, 345701, 224870, 372327, 423528, 327275, 423532, 245357, 222830, 210544, 138864, 372337, 155254, 224887, 370297, 415353, 224890, 403070, 224894, 333439, 372353, 415361, 216707, 403075, 126596, 267909, 421508, 198280, 155273, 224904, 345736, 224909, 11918, 159374, 224913, 126610, 403091, 224916, 345749, 224919, 126616, 208538, 224922, 345757, 224926, 345970, 245409, 345762, 419491, 224932, 345765, 425638, 224936, 419497, 419501, 370350, 224942, 257712, 425649, 419506, 224947, 257716, 419509, 339826, 337592, 224953, 155322, 257724, 155327, 224959, 257732, 224965, 419527, 333511, 224969, 224975, 419535, 272081, 257747, 224981, 394966, 155351, 419544, 181977, 224986, 419547, 155354, 419550, 333534, 224993, 257761, 155363, 257764, 366307, 350206, 419559, 224999, 366311, 337642, 155371, 419563, 245483, 337645, 366318, 210672, 339695, 431851, 366321, 225012, 409335, 337659, 141051, 225020, 257787, 257790, 155393, 225025, 337668, 210695, 362247, 257801, 210698, 155403, 339721, 395021, 257804, 362255, 225038, 257807, 210706, 225043, 372499, 167700, 225048, 399128, 333594, 257819, 116509, 155422, 225053, 345887, 360223, 225058, 378663, 257833, 225066, 257836, 413484, 225070, 345905, 155442, 225073, 372532, 366387, 257845, 155447, 225079, 225082, 397115, 354106, 225087, 325440, 354111, 225092, 155461, 325446, 354117, 225096, 46920, 329544, 341834, 257868, 370503, 341838, 225103, 257871, 370509, 354130, 397139, 225108, 247637, 337750, 376663, 225112, 370519, 415573, 155482, 257883, 341851, 350045, 376671, 399199, 425822, 155490, 155491, 257886, 155487, 354150, 225127, 399206, 257890, 259938, 339814, 354156, 257896, 261996, 268143, 257901, 225137, 262002, 399215, 345967, 225141, 376685, 261999, 262008, 358259, 327539, 262011, 155516, 225148, 354172, 257912, 257916, 155521, 257920, 225155, 325504, 333698, 360326, 155525, 345974, 155531, 247691, 225165, 262027, 262030, 397200, 333708, 225170, 262033, 247700, 262036, 380822, 225175, 262039, 329623, 262042, 155549, 262045, 262048, 262051, 118691, 327589, 436132, 155559, 337833, 155562, 382890, 362413, 372664, 393150, 350146, 346063, 247759, 393169, 384977, 155611, 372702, 329697, 155619, 253923, 155621, 358371, 253926, 190439, 327654, 247789, 350189, 356335, 350193, 360438, 380918, 333818, 393212, 155646 ]
3cc4a7a38afd71978bd916f005c0ea9d1bee5e7e
794001a2a31c0102e32a136463097dd7018c82a6
/Fonts/Damascus/Damascus-FontStyles.swift
8e57eefe529efefc53b1a9b9a34c00c6d02206ff
[ "MIT", "Apache-2.0" ]
permissive
Ghadaalshamii/FontConstants
06b76f3689585fac7d75f8f899ae874276467a13
aab4f02c481ab73e54c3d4c7abe269911b962ed0
refs/heads/master
2022-02-17T23:21:47.730421
2017-08-11T17:16:32
2017-08-11T17:16:32
null
0
0
null
null
null
null
UTF-8
Swift
false
false
375
swift
import UIKit @available(iOS 7.0 ,watchOS 8.0, *) public extension UIFont { public enum damascus: String { case bold = "DamascusBold" case regular = "Damascus" case light = "DamascusLight" case medium = "DamascusMedium" case semiBold = "DamascusSemiBold" public func font(size: CGFloat) -> UIFont { return UIFont(name: self.rawValue, size: size)! } } }
[ -1 ]
72382735a8f6e9a8a644cb4653630da52d8e44cb
df3648c173a2cb7251383c1775c0b40aec974160
/PlayList+CoreDataProperties.swift
1ac671713f20687b9b2b316280e5629c7c7818f7
[]
no_license
shenfive/a207Play
4ed96ab21f629c1faaf2032a9717a4b53f20eaa0
ae2102590dc77030896f5c3ad14f365bd2c7b25e
refs/heads/main
2022-12-20T14:51:10.959406
2020-09-19T09:11:15
2020-09-19T09:11:15
296,819,405
0
0
null
null
null
null
UTF-8
Swift
false
false
434
swift
// // PlayList+CoreDataProperties.swift // a207Play // // Created by 申潤五 on 2020/9/19. // // import Foundation import CoreData extension PlayList { @nonobjc public class func fetchRequest() -> NSFetchRequest<PlayList> { return NSFetchRequest<PlayList>(entityName: "PlayList") } @NSManaged public var filename: String? @NSManaged public var url: String? } extension PlayList : Identifiable { }
[ -1 ]
83de261458a88ffc0bfcde6acb6b769aa46bcdd6
6580abd8227fb4a9a9530e781a159ffd3f50bdb2
/TrackpadMac/AppDelegate.swift
836a603a9634ded52401c8d2e8de99aa40f9a3ee
[]
no_license
SorenMG/Trackpad
8599bb85c06b9f762de20b6e0e80670137e952d7
957b58bc9f5b1260d366de62ab36d6e5a7ae2647
refs/heads/master
2021-03-16T19:45:51.260925
2020-03-12T21:45:53
2020-03-12T21:45:53
246,936,426
0
0
null
null
null
null
UTF-8
Swift
false
false
448
swift
// // AppDelegate.swift // TrackpadMac // // Created by Søren Møller Gade Hansen on 24/11/2018. // Copyright © 2018 Søren Møller Gade Hansen. All rights reserved. // import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { } func applicationWillTerminate(_ notification: Notification) { } }
[ 259353 ]
dbe155ca26cad227973530fbbdc8f6d155407e2b
2b932fd6cfdb3906f9138308176308bcc7942694
/CoffeeOrder/ViewModels/OrderViewModel.swift
5e4de0642421f8ebef6f2984dff802e195e1b699
[]
no_license
armandkamffer/iOS-SwiftUI-CofeeOrder
6d345111b36ef73a54ebe6e6b7f966d146192831
644370795247a3c975c527eedd1696687da89477
refs/heads/master
2022-04-04T10:12:18.360073
2020-01-16T10:10:37
2020-01-16T10:10:37
null
0
0
null
null
null
null
UTF-8
Swift
false
false
573
swift
// // OrderViewModel.swift // CoffeeOrder // // Created by Armand Kamffer on 2020/01/03. // Copyright © 2020 Armand Kamffer. All rights reserved. // import Foundation class OrderViewModel: Identifiable { let id = UUID() var order: Order init(with order: Order) { self.order = order } var name: String { self.order.name } var size: String { self.order.size } var coffeeName: String { self.order.coffeeName } var total: Double { self.order.total } }
[ -1 ]
2e4eba27416e539f89cda2bc677925656b650165
2f5ea5338d2adb0151d18cb2d90c1dd9c2b41bfe
/DemoApps/GRDBDemoiOS/GRDBDemoiOS/AppDelegate.swift
1e5b37cd7278fe75918fa27008e29caaccf30160
[ "MIT" ]
permissive
peter-ss/GRDB.swift
91ad018a00ea9dbb8bb080fbfd078deed8c59e13
7d5533432b0004a40ad0d9e579befbb929d9e9e0
refs/heads/master
2021-01-15T16:15:13.783102
2015-08-17T20:31:37
2015-08-17T20:31:37
40,735,542
1
0
null
2015-08-14T20:51:19
2015-08-14T20:51:19
null
UTF-8
Swift
false
false
3,349
swift
// // GRDB.swift // https://github.com/groue/GRDB.swift // Copyright (c) 2015 Gwendal Roué // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import UIKit import GRDB var dbQueue: DatabaseQueue! @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. let splitViewController = self.window!.rootViewController as! UISplitViewController let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem() splitViewController.delegate = self // Database dbQueue = DatabaseQueue() var migrator = DatabaseMigrator() migrator.registerMigration("createPersons") { db in try db.execute("CREATE TABLE persons (id INTEGER PRIMARY KEY, firstName TEXT, lastName TEXT)") } migrator.registerMigration("addPersons") { db in try Person(firstName: "Arthur", lastName: "Miller").insert(db) try Person(firstName: "Barbara", lastName: "Streisand").insert(db) try Person(firstName: "Cinderella").insert(db) } try! migrator.migrate(dbQueue) return true } // MARK: - Split view func splitViewController(splitViewController: UISplitViewController, collapseSecondaryViewController secondaryViewController:UIViewController, ontoPrimaryViewController primaryViewController:UIViewController) -> Bool { guard let secondaryAsNavController = secondaryViewController as? UINavigationController else { return false } guard let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController else { return false } if topAsDetailController.person == nil { // Return true to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded. return true } return false } }
[ 142465, 278185, 244430 ]
8b2bcab6610cb85b82923473253782be00216891
bbe6122ccfdec1afed247fccbe32c93614b5aaee
/Swift_Day8/Functional_Swift/Functional_Swift/Car_Imperative.swift
d123085f50676d9e8592b303e5fb25eda9305524
[]
no_license
tranhieutt/Swift_traning
715bdf3fadeff43af1b702a19808e48577d722d2
1d62f9079a940ad153097106d5c40a720a8cae49
refs/heads/master
2021-01-10T01:56:19.143604
2016-02-11T10:26:45
2016-02-11T10:26:45
43,535,819
14
2
null
2015-12-07T02:34:29
2015-10-02T04:27:08
Swift
UTF-8
Swift
false
false
1,137
swift
// // Car_Imperative.swift // Functional_Swift // // Created by Dang Thai Son on 10/8/15. // Copyright © 2015 Dang Thai Son. All rights reserved. // import Foundation /// Imperative - Second attempt /// class CarImperative { var time = 5 var carPositions = [1, 1, 1] func race() { while(time > 0) { runStepOfRace() draw() } } // Helpers Function func runStepOfRace() -> () { time -= 1 moveCars() } func draw() { // print("\n") for carPosition in carPositions { drawCar(carPosition) } } func moveCars() -> () { for index in 0..<carPositions.count { if(arc4random_uniform(3) == 1) { carPositions[index] += 1 } } } func drawCar(carPosition: Int) -> () { for _ in 0..<carPosition { print("-") } // print("\n") } func randomPositiveNumberUpTo(upperBound: Int) -> Int { return Int(arc4random_uniform(UInt32(upperBound))) } }
[ -1 ]
a190a77b8f29a37c79f787703a76920e27ae1546
e46aa3d5dff89072c8ec5ce0b5ced2069a1998f7
/GoldenHour/AppDelegate.swift
2c90eabdc05e9e0aebf0d48334dcf5c02984d25a
[]
no_license
dhruvshah8/GoldenHour
de318bb7ebb05d742a3984e5490d5189dbd27936
419907ba37cd09341ac26df6207069cc3d1dd3fb
refs/heads/master
2022-11-23T14:13:29.412790
2020-08-02T19:25:38
2020-08-02T19:25:38
271,919,141
3
0
null
null
null
null
UTF-8
Swift
false
false
1,418
swift
// // AppDelegate.swift // GoldenHour // // Created by Dhruv Shah on 2020-06-08. // Copyright © 2020 Dhruv Shah. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 163891, 213048, 385081, 376889, 393275, 376905, 327756, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 286831, 368752, 286844, 417924, 262283, 286879, 286888, 377012, 327871, 180416, 377036, 180431, 377046, 377060, 327914, 205036, 393456, 393460, 336123, 418043, 336128, 385280, 262404, 180490, 368911, 262416, 262422, 377117, 262436, 336180, 262454, 393538, 262472, 344403, 213332, 65880, 262496, 418144, 262499, 213352, 246123, 262507, 262510, 213372, 385419, 393612, 262550, 262552, 385440, 385443, 385451, 262573, 393647, 385458, 262586, 344511, 262592, 360916, 369118, 328177, 328179, 328182, 328189, 328192, 164361, 328206, 410128, 393747, 254490, 188958, 385570, 33316, 197159, 377383, 352821, 188987, 418363, 369223, 385609, 385616, 352856, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 336512, 148105, 377484, 352918, 98968, 344744, 361129, 336555, 385713, 434867, 164534, 336567, 328378, 164538, 328386, 352968, 344776, 418507, 352971, 352973, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 336643, 344835, 344841, 336659, 418580, 418585, 434970, 369435, 418589, 262942, 418593, 336675, 328484, 418598, 418605, 336696, 361273, 328515, 336708, 328519, 336711, 361288, 328522, 336714, 426841, 197468, 254812, 361309, 361315, 361322, 328573, 377729, 222128, 345035, 345043, 386003, 386011, 386018, 386022, 435187, 328702, 328714, 361489, 386069, 336921, 386073, 336925, 345118, 377887, 345133, 345138, 386101, 361536, 197707, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 361598, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 345267, 386258, 328924, 66782, 222437, 386285, 328941, 386291, 345376, 353570, 345379, 410917, 345382, 337205, 345399, 378169, 369978, 337222, 337229, 337234, 263508, 402791, 345448, 271730, 378227, 271745, 181638, 353673, 181643, 181649, 181654, 230809, 181670, 181673, 181678, 337329, 181681, 181684, 181690, 361917, 181696, 337349, 181703, 337365, 271839, 329191, 361960, 329194, 116210, 337398, 337415, 329226, 419339, 419343, 419349, 345625, 419355, 370205, 419359, 419362, 394786, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 419410, 345701, 394853, 222830, 370297, 353919, 403075, 345736, 198280, 403091, 345749, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 337592, 419512, 419517, 337599, 419527, 419530, 419535, 272081, 394966, 419542, 419544, 181977, 345818, 419547, 419550, 419559, 337642, 419563, 337645, 370415, 141051, 337659, 337668, 362247, 395021, 362255, 321299, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 370509, 354130, 247637, 337750, 370519, 313180, 354142, 345964, 345967, 345970, 345974, 403320, 354172, 247691, 337808, 247700, 329623, 436126, 436132, 337833, 362413, 337844, 346057, 247759, 346063, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329832, 329855, 329867, 329885, 411805, 346272, 362660, 100524, 387249, 379066, 387260, 256191, 395466, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 346343, 338152, 387306, 387312, 346355, 436473, 321786, 379134, 411903, 411916, 379152, 395538, 387349, 338199, 387352, 182558, 338211, 395566, 248111, 362822, 436555, 190796, 321879, 379233, 354673, 321910, 248186, 420236, 379278, 272786, 354727, 338352, 330189, 338381, 338386, 256472, 338403, 338409, 248308, 199164, 330252, 199186, 330267, 354855, 10828, 199249, 346721, 174695, 248425, 191084, 338543, 191092, 346742, 330383, 354974, 150183, 174774, 248504, 174777, 223934, 355024, 273108, 355028, 264918, 183005, 256734, 436962, 338660, 338664, 264941, 363251, 207619, 264964, 338700, 256786, 199452, 363293, 396066, 346916, 396069, 215853, 355122, 355131, 355140, 355143, 338763, 355150, 330580, 355166, 265055, 265058, 355175, 387944, 355179, 330610, 330642, 355218, 412599, 207808, 379848, 396245, 330710, 248792, 248798, 347105, 257008, 183282, 265207, 330748, 265214, 330760, 330768, 248862, 396328, 158761, 396336, 199728, 330800, 396339, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 339036, 412764, 257120, 265320, 248951, 420984, 330889, 347287, 248985, 339097, 44197, 380070, 339112, 249014, 330958, 330965, 265432, 265436, 388319, 388347, 175375, 159005, 175396, 208166, 273708, 372015, 347441, 372018, 199988, 44342, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 175450, 437595, 175457, 208227, 175460, 175463, 265580, 437620, 175477, 249208, 175483, 175486, 249214, 175489, 249218, 249224, 249227, 249234, 175513, 175516, 396705, 175522, 355748, 380332, 396722, 208311, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 249308, 339420, 249312, 339424, 339428, 339434, 249328, 69113, 372228, 339461, 208398, 380432, 175635, 339503, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 224897, 372353, 216707, 339588, 126596, 421508, 224904, 224909, 159374, 11918, 339601, 224913, 126610, 224916, 224919, 126616, 208538, 224922, 224926, 224929, 224932, 224936, 257704, 224942, 257712, 224947, 257716, 257720, 224953, 257724, 224959, 257732, 224965, 224969, 339662, 224975, 257747, 224981, 224986, 224993, 257761, 257764, 224999, 339695, 225012, 257787, 225020, 339710, 257790, 225025, 257794, 339721, 257801, 257804, 225038, 257807, 372499, 167700, 225043, 225048, 257819, 225053, 184094, 225058, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 225079, 397112, 225082, 397115, 225087, 225092, 225096, 323402, 257868, 257871, 225103, 397139, 225108, 225112, 257883, 257886, 225119, 257890, 339814, 225127, 257896, 274280, 257901, 225137, 339826, 257908, 225141, 257912, 257916, 225148, 257920, 225155, 339844, 225165, 397200, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 405533, 430129, 266294, 266297, 217157, 421960, 356439, 430180, 421990, 266350, 356466, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 225444, 438436, 225447, 438440, 225450, 258222, 225455, 430256, 225458, 225461, 225466, 389307, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 266453, 225493, 225496, 225499, 225502, 225505, 356578, 225510, 217318, 225514, 225518, 372976, 381176, 397571, 389380, 61722, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 225597, 332097, 201028, 348488, 332106, 332117, 250199, 250202, 332125, 250210, 348522, 348525, 348527, 332152, 250238, 389502, 332161, 356740, 332172, 373145, 340379, 389550, 324030, 266687, 340451, 160234, 127471, 340472, 324094, 266754, 324099, 324102, 324111, 340500, 324117, 324131, 332324, 381481, 324139, 356907, 324142, 356916, 324149, 324155, 348733, 324160, 324164, 356934, 348743, 381512, 324170, 324173, 324176, 389723, 332380, 373343, 381545, 340627, 184982, 373398, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 373449, 332493, 357069, 357073, 332511, 332520, 340718, 332533, 348924, 373510, 389926, 152370, 348978, 340789, 348982, 398139, 127814, 357201, 357206, 389978, 357211, 430939, 357214, 201579, 201582, 349040, 340849, 201588, 430965, 324472, 398201, 119674, 324475, 430972, 340861, 324478, 340858, 324481, 373634, 398211, 324484, 324487, 381833, 324492, 324495, 324498, 430995, 324501, 324510, 422816, 324513, 398245, 201637, 324524, 340909, 324533, 5046, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 209895, 201711, 349172, 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, 341113, 210044, 349308, 152703, 160895, 349311, 210052, 210055, 349319, 210067, 210071, 210077, 210080, 210084, 251044, 185511, 210088, 210095, 210098, 210107, 210115, 332997, 210127, 333009, 210131, 333014, 210138, 210143, 218354, 251128, 218360, 275706, 275712, 275715, 275721, 349459, 333078, 251160, 349484, 349491, 251189, 415033, 251210, 357708, 210260, 365911, 259421, 365921, 333154, 251235, 374117, 333162, 234866, 390516, 333175, 357755, 251271, 136590, 112020, 349590, 357792, 259515, 415166, 415185, 366034, 366038, 415191, 415193, 415196, 415199, 423392, 333284, 415207, 366056, 366061, 415216, 210420, 415224, 423423, 415257, 415263, 366117, 415270, 144939, 415278, 415281, 415285, 210487, 415290, 415293, 349761, 415300, 333386, 333399, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 267909, 153227, 333498, 333511, 210631, 259788, 358099, 333534, 366307, 366311, 431851, 366318, 210672, 366321, 366325, 210695, 268041, 210698, 366348, 210706, 399128, 333594, 210719, 358191, 210739, 366387, 399159, 358200, 325440, 366401, 341829, 325446, 46920, 341834, 341838, 341843, 415573, 358234, 341851, 350045, 399199, 259938, 399206, 358255, 399215, 268143, 358259, 341876, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 358339, 333774, 358371, 350189, 350193, 350202, 333818, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350240, 350244, 350248, 178218, 350251, 350256, 350259, 350271, 243781, 350285, 374864, 342111, 342133, 374902, 432271, 333997, 334011, 260289, 350410, 260298, 350416, 350422, 211160, 350425, 268507, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 325891, 350467, 350475, 375053, 268559, 350480, 432405, 350486, 350490, 325914, 325917, 350493, 350498, 350504, 358700, 350509, 391468, 358704, 358713, 358716, 383306, 334161, 383321, 383330, 383333, 391530, 383341, 334203, 268668, 194941, 391563, 366990, 416157, 268701, 342430, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 195039, 334304, 334311, 375277, 334321, 350723, 186897, 342545, 334358, 342550, 342554, 334363, 358941, 350761, 252461, 334384, 383536, 358961, 334394, 252482, 219718, 334407, 334420, 350822, 375400, 334465, 334468, 162445, 326290, 342679, 342683, 260766, 342710, 244409, 260797, 334528, 260801, 350917, 154317, 391894, 154328, 416473, 64230, 113388, 342766, 375535, 203506, 342776, 391937, 391948, 326416, 375568, 375571, 162591, 326441, 326451, 326454, 244540, 326460, 375612, 260924, 326467, 244551, 326473, 326477, 326485, 416597, 326490, 342874, 326502, 375656, 433000, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 342915, 400259, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 359366, 326598, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 367723, 384107, 187502, 384114, 343154, 212094, 351364, 384135, 384139, 384143, 351381, 384151, 384160, 384168, 367794, 244916, 384181, 367800, 384188, 351423, 384191, 384198, 326855, 244937, 384201, 253130, 343244, 384208, 146642, 384224, 359649, 343270, 351466, 384246, 351479, 384249, 343306, 261389, 359694, 253200, 261393, 384275, 384283, 245020, 384288, 245029, 171302, 351534, 376110, 245040, 384314, 425276, 384323, 212291, 343365, 212303, 367965, 343393, 343398, 367980, 425328, 343409, 154999, 253303, 343417, 327034, 245127, 384397, 245136, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327110, 327115, 327117, 359886, 359890, 343507, 368092, 343534, 343539, 368119, 343544, 368122, 409091, 359947, 359955, 359983, 343630, 327275, 245357, 138864, 155254, 155273, 368288, 245409, 425638, 425649, 155322, 425662, 155327, 245460, 155351, 155354, 212699, 245475, 155363, 245483, 155371, 409335, 155393, 155403, 245525, 155422, 360223, 155438, 155442, 155447, 155461, 360261, 376663, 155482, 261981, 425822, 155487, 376671, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 262005, 147317, 425845, 262008, 262011, 155516, 155521, 155525, 360326, 155531, 262027, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 393169, 384977, 155611, 155619, 253923, 155621, 327654, 253926, 204784, 393203, 360438, 253943, 393206, 393212, 155646 ]
64df25eb714f9ea7d20cf2547940f388bb739497
a34ba4435c14c44809c7fc960d0cb264c7bfde38
/JobAssignments/Models/User.swift
3cdaca6d62e79a78f5d64c6d26142b39cea6a220
[]
no_license
shikamaru-dev/employment-2020
c28eea96feb1c92d7932cc3f20bebce183a72db0
939f66dfa24ffdc2e0d301e16a51a2c29eb59464
refs/heads/master
2020-12-21T17:39:11.671305
2020-01-27T14:31:28
2020-01-27T14:31:28
236,507,205
0
0
null
null
null
null
UTF-8
Swift
false
false
442
swift
// // User.swift // JobAssignments // // Created by 村田 司 on 2019/10/25. // Copyright © 2019 曹 一凡. All rights reserved. // import Foundation class User { var uid: String = "" var displayName: String = "" var email: String = "" init(){} init(uid: String, displayName: String, email: String) { self.uid = uid self.displayName = displayName self.email = email } }
[ -1 ]
7a46d6585b4379d3385ea146631235f938991b55
fc55fadc500a809e02fd9f0978dfec958390fde5
/RepoMan/Scenes/Repos/ReposConfigurator.swift
e96a99c67f2c8dedfa27b63aee81ab10cfd2f59b
[]
no_license
andersu/RepoMan
845a457c6c2ecdf802dab31a80b9c7ad16cb013f
318a71051d4cd17684371f72b915509f3f71ff8d
refs/heads/master
2021-01-12T00:05:11.936745
2017-01-24T21:56:20
2017-01-24T21:56:20
78,668,498
0
0
null
null
null
null
UTF-8
Swift
false
false
926
swift
// // ReposConfigurator.swift // RepoMan // // Created by Anders Ullnæss on 21/01/17. // Copyright (c) 2017 Anders Ullnæss. All rights reserved. // import UIKit struct ReposConfigurator { // MARK: Object lifecycle static let sharedInstance = ReposConfigurator() private init() { // Enforce Singleton } // MARK: Configuration func configure(viewController: ReposViewController) { let viewModel = ReposViewModel() let presenter = ReposPresenter(viewModel: viewModel) presenter.output = viewController let client = HttpClient() let githubService = GithubService(client: client) let interactor = ReposInteractor(githubService: githubService) interactor.output = presenter let router = ReposRouter(viewController: viewController) viewController.output = interactor viewController.router = router } }
[ -1 ]
986f935687b2a92d4f9fa99c923f893f63378757
f0bf1739c1946b71b2c4d3ef7826973a8105dcd1
/Tests/MuckTests/CollectionTests.swift
1ad2049fe95e5da82c230b165a10e5ff195915cb
[]
no_license
dcutting/Muck
cbf6da15122b6e9163b9059e5b609673c72ea0e1
e59492ca00ce21ccf1846cdd90a935a6a0653959
refs/heads/master
2021-05-11T07:09:17.533175
2020-03-04T14:58:25
2020-03-04T14:58:25
118,009,183
79
1
null
null
null
null
UTF-8
Swift
false
false
520
swift
import XCTest @testable import Muck class CollectionTests: XCTestCase { func test_flattened_emptyElements_returnsEmpty() { let input: [[Int]] = [[]] let actual: [Int] = input.flattened() let expected: [Int] = [] XCTAssertEqual(expected, actual) } func test_flattened() { let input: [[Int]] = [[5, 4], [1], [], [4, 3, 6]] let actual: [Int] = input.flattened() let expected: [Int] = [5, 4, 1, 4, 3, 6] XCTAssertEqual(expected, actual) } }
[ -1 ]
c3f8722bc6af7eec4fb50966ce583e528de64e5c
2ef4c31f8bf213654f311312c33bec98031de55e
/BallClub/BallClub/Custom Views/User/UserInviteCustomCell.swift
24d4e08027a546a01c886526ea5b71d4fe0a5303
[]
no_license
ace-rivera/ballclub
d871fe670ae04dfd3cc7a83e632f4eb591bada30
c62be5748365ed6b783e459a9f942263cd620984
refs/heads/master
2020-12-25T15:07:53.617408
2017-09-04T14:51:10
2017-09-04T14:51:10
66,897,683
0
0
null
2017-09-04T14:51:11
2016-08-30T02:10:29
Objective-C
UTF-8
Swift
false
false
1,692
swift
// // UserInviteCustomCell.swift // BallClub // // Created by Geraldine Forto on 31/08/2016. // Copyright © 2016 Geraldine Forto. All rights reserved. // import UIKit import Nuke protocol UserInviteCustomCellDelegate { func didTapOnInvitee(tag: Int) func didTapOnViewGame(tag: Int) } class UserInviteCustomCell: UITableViewCell { @IBOutlet weak var userProfileImage: UIImageView! @IBOutlet weak var userName: UILabel! @IBOutlet weak var inviteStatus: UILabel! @IBOutlet weak var viewGameButton: UIButton! var delegate: UserInviteCustomCellDelegate? override func awakeFromNib() { super.awakeFromNib() viewGameButton.layer.borderColor = UIColor.lightGray.cgColor //TapGesture recognizers let tapGesture = UITapGestureRecognizer(target: self, action: #selector(self.didTapOnPlayerAssets)) self.userProfileImage.addGestureRecognizer(tapGesture) self.userName.addGestureRecognizer(tapGesture) } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) } //MARK:- Setters Getters func setFriendUserName (name : String){ userName.text = name } func setFriendUserImage (image : String){ if let url = URL(string: image) { Nuke.loadImage(with: url, into: self.userProfileImage) } } func setFriendInviteStatus (status : String) { inviteStatus.text = status } func didTapOnPlayerAssets() { if let d = delegate { d.didTapOnInvitee(tag: self.tag) } } //MARK:- IBActions @IBAction func viewGameButtonPressed(_ sender: AnyObject) { if let d = delegate { d.didTapOnViewGame(tag: self.tag) } } }
[ -1 ]
544cc68cac28beac35fb9ca4be1891cf3576906f
79d503f334edbddc7873a3fccab5d85cc172ffe2
/TemplateMethod.playground/Contents.swift
3db78e723f8c1b87924936472a25c3375a457a17
[]
no_license
wtildestar/DesignPatterns
ad28278d3fbdc5aeedd395c4c2729c8b6cf778b4
3df97ebb9416da8e3a2b0005a7adf949133ef4e2
refs/heads/master
2020-12-02T21:45:59.283443
2020-03-03T20:53:48
2020-03-03T20:53:48
231,129,768
0
0
null
null
null
null
UTF-8
Swift
false
false
1,917
swift
protocol DriveVehicle { func haveASeat() func useProtection() func lootAtTheMirror() func turnSignal() func driveForward() func startVehicle() } extension DriveVehicle { func startVehicle() { haveASeat() useProtection() lootAtTheMirror() turnSignal() driveForward() } func haveASeat() { preconditionFailure("this method should be overriden") } // метод перехватчик func closeTheDoor() { } func useProtection() { preconditionFailure("this method should be overriden") } func lootAtTheMirror() { preconditionFailure("this method should be overriden") } func turnSignal() { preconditionFailure("this method should be overriden") } func driveForward() { preconditionFailure("this method should be overriden") } } class Bicycle: DriveVehicle { func haveASeat() { print("sit down on a bicycle seat") } func useProtection() { print("wear a helmet") } func lootAtTheMirror() { print("look at the little mirror") } func turnSignal() { print("show left hand") } func driveForward() { print("pedal") } } class Car: DriveVehicle { func haveASeat() { print("sit down on a car seat") closeTheDoor() } func closeTheDoor() { print("close the door") } func useProtection() { print("fasten seat belt") } func lootAtTheMirror() { print("look at the rearview mirror") } func turnSignal() { print("turn on left turn light") } func driveForward() { print("push pedal") } } let car = Car() let bicycle = Bicycle() car.startVehicle() print(""" ########### """) bicycle.startVehicle()
[ 358217 ]
b7be836bca2bb69522bde993048c1c4ba361a6e1
3d9253e57b7f5592ef84fceeca84d8609b4b2f7b
/Instagram Feed/ViewController.swift
f9a137eaf92d876bdecf2a30eea185f4d06c5edf
[]
no_license
ethancdaniel/Instagram-Feed
79a2dbbfbd792addf3c3cda9fddfd42ff965ec5e
4e2247afbb5b790b2c59f7b4f3b5b737a0b43e36
refs/heads/master
2020-04-13T12:40:18.782251
2018-12-27T00:50:25
2018-12-27T00:50:25
163,209,084
0
0
null
null
null
null
UTF-8
Swift
false
false
1,351
swift
// // ViewController.swift // Instagram Feed // // Created by Ethan Daniel on 12/24/18. // Copyright © 2018 Ethan Daniel. All rights reserved. // import UIKit class ViewController: UITableViewController { var postArray = [Post(imageUrl: "testImage1", authorName: "jack", profilePic: "defaultProfile"), Post(imageUrl: "testImage2", authorName: "john", profilePic: "defaultProfile"), Post(imageUrl: "testImage3", authorName: "bill", profilePic: "defaultProfile")] override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. self.tableView.rowHeight = 500 } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "customPost") as! CustomPostCell cell.imageView?.image = UIImage(named: postArray[indexPath.row].imageUrl) cell.authorLabel.text = postArray[indexPath.row].authorName cell.authorProfilePicture.image = UIImage(named: postArray[indexPath.row].authorProfilePicUrl) return cell } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return postArray.count } }
[ -1 ]
8b2a1eda478bce8c248482714131fbc426b59c37
a88117517edce234b87b46a55a439d2292538bea
/GitManager/BusinessLogicLayer/FileParser/GitHubFileParser.swift
329b00e29ad7e818495be374831dea27caa55250
[]
no_license
MadL0rd/GitManager
76eef2fecf1484b4d04885e027dc59845fdc6e69
3abc6d605b50d379f140257757fe77c77457345d
refs/heads/master
2020-08-27T11:20:22.884243
2020-06-22T06:43:02
2020-06-22T06:43:02
217,349,172
19
0
null
2020-05-09T12:31:24
2019-10-24T16:54:14
Swift
UTF-8
Swift
false
false
3,953
swift
// // FileParser.swift // GitManager // // Created by Антон Текутов on 02.12.2019. // Copyright © 2019 Антон Текутов. All rights reserved. // class GitHubFileParser: FileParserProtocol { func parsePage(htmlSource: String) -> String? { return parsePageAsCodeFile(htmlSource: htmlSource) ?? parsePageAsReadMe(htmlSource: htmlSource) ?? parsePageAsImage(htmlSource: htmlSource) } func parsePageAsReadMe(htmlSource: String) -> String? { var html = htmlSource let body = "<body" let article = "<article " let articleEnd = "</article>" if var indexCutBegin = html.index(of: body), var indexCutEnd = html.index(of: article), html.endIndex(of: articleEnd) != nil{ while html[indexCutBegin] != ">" { indexCutBegin = html.index(indexCutBegin, offsetBy : 1) } indexCutBegin = html.index(indexCutBegin, offsetBy : 1) indexCutEnd = html.index(indexCutEnd, offsetBy : -1) html.removeSubrange(indexCutBegin ... indexCutEnd) if var indexArticleEnd = html.endIndex(of: articleEnd) { indexArticleEnd = html.index(indexArticleEnd, offsetBy : 1) let htmlEnd = html.index(html.endIndex, offsetBy : -1) html.removeSubrange(indexArticleEnd ... htmlEnd) } html += "</body> </html>" return html } return nil } func parsePageAsCodeFile(htmlSource: String) -> String? { var html = htmlSource let body = "<body" let table = "<table class=\"highlight tab-size js-file-line-container\" " let tableEnd = "</table>" if var indexCutBegin = html.index(of: body), var indexCutEnd = html.index(of: table), html.endIndex(of: tableEnd) != nil{ while html[indexCutBegin] != ">" { indexCutBegin = html.index(indexCutBegin, offsetBy : 1) } indexCutBegin = html.index(indexCutBegin, offsetBy : 1) indexCutEnd = html.index(indexCutEnd, offsetBy : -1) html.removeSubrange(indexCutBegin ... indexCutEnd) if var indexTabeEnd = html.endIndex(of: tableEnd) { indexTabeEnd = html.index(indexTabeEnd, offsetBy : 1) let htmlEnd = html.index(html.endIndex, offsetBy : -1) html.removeSubrange(indexTabeEnd ... htmlEnd) } html += "</body> </html>" return html } return nil } func parsePageAsImage(htmlSource: String) -> String? { var html = htmlSource let body = "<body" let table = "<span class=\"border-wrap\">" let tableEnd = "</span>" if var indexCutBegin = html.index(of: body), var indexCutEnd = html.index(of: table), html.endIndex(of: tableEnd) != nil{ while html[indexCutBegin] != ">" { indexCutBegin = html.index(indexCutBegin, offsetBy : 1) } indexCutBegin = html.index(indexCutBegin, offsetBy : 1) indexCutEnd = html.index(indexCutEnd, offsetBy : -1) html.removeSubrange(indexCutBegin ... indexCutEnd) if var indexTabeEnd = html.endIndex(of: tableEnd) { indexTabeEnd = html.index(indexTabeEnd, offsetBy : 1) let htmlEnd = html.index(html.endIndex, offsetBy : -1) html.removeSubrange(indexTabeEnd ... htmlEnd) } if let imageSrcIndex = html.index(of: "img src=\"") { let gitUrl = "https://github.com" html.insert(contentsOf: gitUrl, at: html.index(imageSrcIndex, offsetBy : 9)) } html += "</body> </html>" return html } return nil } }
[ -1 ]
2f1a61b4c2829882619317f91bf88c188d2ac9cf
b951bb50ca85d294744df75d9d64e10a3bba91bd
/RockPaperScissors/Modules/OptionScreen/Contract/OptionScreenContract.swift
ca90c9116b0207af1351106d93ed80b208c10dc0
[]
no_license
Zulqurnain24/rock_paper_scissors_game
e2715e38a79749f4c28a461d8f9ad5eb079f442a
b4f82e86c5515fe57a666553704fc033c0b78df6
refs/heads/master
2020-07-10T07:31:07.486997
2019-08-24T19:52:12
2019-08-24T19:52:12
204,204,576
0
0
null
null
null
null
UTF-8
Swift
false
false
1,046
swift
// // OptionScreenContract.swift // RockPaperScissors // // Created by Mohammad Zulqarnain on 19/01/2019. // Copyright © 2019 Mohammad Zulqarnain. All rights reserved. // import UIKit protocol OptionScreenViewType: class { var presenter: OptionScreenPresenterType? { get set } } protocol OptionScreenRouterType: class { func presentOptionScreenViewController(sender: UIViewController) func presentGameScreenViewController(sender: UIViewController) func presentCreditScreenViewController(sender: UIViewController) func presentOptionsSettingViewController(sender: UIViewController) func presentHelpScreenViewController(sender: UIViewController) } protocol OptionScreenPresenterType: class { init(view: OptionScreenViewType, router: OptionScreenRouterType) func viewDidLoad() func viewDidAppear() func presentGameScreenViewController() func presentCreditScreenViewController() func presentOptionsSettingViewController() func presentHelpScreenViewController() }
[ -1 ]
010be8f8726bc3c92034688fb86a27d8c137f540
2b21422e50cf7c3c5b330e157946ffd88d77d8a9
/SpiltCoffee/ViewControllers/RoasterProfileContentViewController.swift
b8adc9c94be69dc5e299aa578dd3cf3e4e5c9dd9
[]
no_license
Swoop12/SpiltCoffee
cd8f0ade82afa95022405a8539a49b26bb07bdcc
75e7506e9b0f2ebb64b0033275f086ebd98a908a
refs/heads/master
2021-07-15T13:01:55.687551
2020-06-01T02:45:56
2020-06-01T02:45:56
147,018,611
0
0
null
null
null
null
UTF-8
Swift
false
false
9,005
swift
// // RoasterProfileContentViewController.swift // SpiltCoffee // // Created by Trevor Adcock. // Copyright © 2018 DevMountain. All rights reserved. // // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- // MARK: - Import import UIKit // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- // MARK: - Class class RoasterProfileViewController: UIViewController { // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- // MARK: - Properties @IBOutlet weak var coverPhotoImageView: UIImageView! @IBOutlet weak var profilePictureImageView: UIImageView! @IBOutlet weak var roasterNameLabel: UILabel! @IBOutlet weak var locationLabel: UILabel! @IBOutlet weak var companyLabel: UILabel! @IBOutlet weak var productsLabel: UILabel! @IBOutlet weak var followingLabel: UILabel! @IBOutlet weak var followersLabel: UILabel! @IBOutlet weak var postsLabel: UILabel! @IBOutlet weak var segmentedControl: UISegmentedControl! @IBOutlet weak var contentContainerView: UIView! @IBOutlet weak var shopsContainerView: UIView! @IBOutlet weak var productContainerView: UIView! var roaster: Roaster?{ didSet{ updateView() } } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- // MARK: - Setup override func viewDidLoad() { super.viewDidLoad() self.setupUI() segmentedControl.selectedSegmentIndex = 0 presentTableViewFor(selectedSegementIndex: 0) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) // Navigation bar, if any self.navigationController?.setNavigationBarHidden(false, animated: true) } func updateView(){ guard let roaster = roaster else {return} roasterNameLabel.text = roaster.name if let coverPhoto = roaster.coverPhoto{ coverPhotoImageView.image = coverPhoto } if let profilePicture = roaster.profilePicture{ profilePictureImageView.image = profilePicture } if !roaster.shops.isEmpty{ locationLabel.text = "\(roaster.shops.first!.city), \(roaster.shops.first!.state)" } if let company = roaster.companyName{ companyLabel.text = company } productsLabel.text = "\(roaster.products.count)" followingLabel.text = "\(roaster.following.count) " followersLabel.text = "\(roaster.followers.count)" postsLabel.text = "\(roaster.post.count)" } fileprivate func setupUI() { // Navigation bar let navigationBar = self.navigationController!.navigationBar navigationBar.barTintColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1) navigationBar.tintColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0) navigationBar.titleTextAttributes = [ NSFontAttributeName : UIFont(name: "Lato-Regular", size: 17)!, NSForegroundColorAttributeName : UIColor(red: 0.36, green: 0.51, blue: 0.46, alpha: 1) ] self.navigationController?.setNavigationBarHidden(false, animated: true) // coverImageViewImageView self.coverPhotoImageView.layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5).cgColor self.coverPhotoImageView.layer.shadowRadius = 2.0 self.coverPhotoImageView.layer.shadowOffset = CGSize(width: 2.0, height: 2.0) self.coverPhotoImageView.layer.shadowOpacity = 1.0 self.coverPhotoImageView.layer.masksToBounds = false // profileImageViewImageView self.profilePictureImageView.layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5).cgColor self.profilePictureImageView.layer.shadowRadius = 2.0 self.profilePictureImageView.layer.shadowOffset = CGSize(width: 0.0, height: 2.0) self.profilePictureImageView.layer.shadowOpacity = 1.0 self.profilePictureImageView.layer.masksToBounds = false // Configure the base attributed string for roasterNameLabelLabel let roasterNameLabelLabelAttrString = NSMutableAttributedString(string: "Larry Nichols", attributes: [ NSForegroundColorAttributeName : UIColor(red: 1, green: 1, blue: 1, alpha: 1), NSFontAttributeName : UIFont(name: "AvenirNext-DemiBold", size: 28)!, NSKernAttributeName : 0.34, NSParagraphStyleAttributeName: NSMutableParagraphStyle(alignment: .left, lineHeight: nil, paragraphSpacing: 0) ]) self.roasterNameLabel.attributedText = roasterNameLabelLabelAttrString // Configure the base attributed string for locationLabelLabel let locationLabelLabelAttrString = NSMutableAttributedString(string: "Seattlle, WA", attributes: [ NSForegroundColorAttributeName : UIColor(red: 1, green: 1, blue: 1, alpha: 1), NSFontAttributeName : UIFont(name: "Avenir-BookOblique", size: 14)!, NSKernAttributeName : 0.25, NSParagraphStyleAttributeName: NSMutableParagraphStyle(alignment: .right, lineHeight: nil, paragraphSpacing: 0) ]) self.locationLabel.attributedText = locationLabelLabelAttrString // Configure the base attributed string for companyLabelLabel let companyLabelLabelAttrString = NSMutableAttributedString(string: "Independent Roaster", attributes: [ NSForegroundColorAttributeName : UIColor(red: 1, green: 1, blue: 1, alpha: 1), NSFontAttributeName : UIFont(name: "Avenir-BookOblique", size: 14)!, NSKernAttributeName : 0.25, NSParagraphStyleAttributeName: NSMutableParagraphStyle(alignment: .left, lineHeight: nil, paragraphSpacing: 0) ]) self.companyLabel.attributedText = companyLabelLabelAttrString // Configure the base attributed string for followingLabel let followingLabelAttrString = NSMutableAttributedString(string: "following", attributes: [ NSForegroundColorAttributeName : UIColor(red: 1, green: 1, blue: 1, alpha: 1), NSFontAttributeName : UIFont(name: "AvenirNext-Regular", size: 9)!, NSKernAttributeName : 0.16, NSParagraphStyleAttributeName: NSMutableParagraphStyle(alignment: .center, lineHeight: nil, paragraphSpacing: 0) ]) self.followingLabel.attributedText = followingLabelAttrString // Configure the base attributed string for followersLabel let followersLabelAttrString = NSMutableAttributedString(string: "followers", attributes: [ NSForegroundColorAttributeName : UIColor(red: 1, green: 1, blue: 1, alpha: 1), NSFontAttributeName : UIFont(name: "AvenirNext-Regular", size: 9)!, NSKernAttributeName : 0.16, NSParagraphStyleAttributeName: NSMutableParagraphStyle(alignment: .center, lineHeight: nil, paragraphSpacing: 0) ]) self.followersLabel.attributedText = followersLabelAttrString // Configure the base attributed string for bookmarksLabel let bookmarksLabelAttrString = NSMutableAttributedString(string: "bookmarks", attributes: [ NSForegroundColorAttributeName : UIColor(red: 1, green: 1, blue: 1, alpha: 1), NSFontAttributeName : UIFont(name: "AvenirNext-Regular", size: 9)!, NSKernAttributeName : 0.16, NSParagraphStyleAttributeName: NSMutableParagraphStyle(alignment: .center, lineHeight: nil, paragraphSpacing: 0) ]) self.postsLabel.attributedText = bookmarksLabelAttrString } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- // MARK: - Status bar override var prefersStatusBarHidden: Bool { return false } override var preferredStatusBarStyle: UIStatusBarStyle { return .lightContent } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- // MARK: - Actions @IBAction func onSegmentedControlViewValueChanged(_ sender: UISegmentedControl) { presentTableViewFor(selectedSegementIndex: sender.selectedSegmentIndex) } func presentTableViewFor(selectedSegementIndex: Int){ switch selectedSegementIndex { case 0: contentContainerView.isHidden = false shopsContainerView.isHidden = true productContainerView.isHidden = true case 1: contentContainerView.isHidden = true shopsContainerView.isHidden = true productContainerView.isHidden = false case 2: contentContainerView.isHidden = true shopsContainerView.isHidden = false productContainerView.isHidden = true default: contentContainerView.isHidden = false shopsContainerView.isHidden = true productContainerView.isHidden = true } } }
[ -1 ]
790f7ed157920388afba3026649f0912c09260fb
86ce2d97b8a38c38e58ca826f60025bb1e9775c2
/Swift UI LearningTests/Swift_UI_LearningTests.swift
c8d48dbb4112d231eb44bdcdbe1d51422af5c7fe
[]
no_license
shadowmanpat/Swift-UI-Learning
e92c1e1431570255f0a2955ffa594d31c317842f
71fdebac705954f763208d4ff3197c2559de70ba
refs/heads/main
2023-07-11T19:02:24.855297
2021-08-21T07:25:30
2021-08-21T07:25:30
396,903,550
0
0
null
null
null
null
UTF-8
Swift
false
false
934
swift
// // Swift_UI_LearningTests.swift // Swift UI LearningTests // // Created by Nikolaos Agas on 8/16/21. // import XCTest @testable import Swift_UI_Learning class Swift_UI_LearningTests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() throws { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 257024, 210433, 254465, 357379, 346118, 358410, 253451, 253452, 254987, 359950, 139791, 313357, 323089, 296461, 146964, 418837, 253463, 134686, 207393, 16419, 355876, 357414, 358954, 377386, 357423, 346162, 252980, 359478, 358456, 348732, 425535, 352326, 359495, 361543, 56902, 349781, 244310, 354911, 254048, 436832, 344680, 300136, 54893, 349294, 373358, 352368, 15471, 187506, 357486, 346740, 278638, 344696, 370296, 396922, 363644, 356989, 152195, 349318, 377483, 385680, 347283, 345752, 346779, 429214, 282271, 255649, 343203, 362659, 258214, 295590, 352937, 32941, 173, 364207, 224946, 318130, 342713, 208058, 224958, 417988, 253125, 62665, 346314, 417994, 254170, 333022, 159455, 383206, 345834, 253167, 322291, 353523, 338164, 313081, 286458, 175873, 320770, 351490, 360195, 386042, 369930, 180493, 322319, 422673, 254226, 272660, 368916, 169754, 344865, 333090, 342820, 257830, 151847, 254251, 189228, 362283, 285487, 353584, 351537, 355121, 355130, 197434, 360252, 336702, 355139, 252741, 348998, 420677, 360264, 182598, 348492, 383311, 337745, 355154, 366930, 348500, 215385, 272729, 189275, 323935, 357218, 275303, 333160, 368488, 355178, 207727, 314739, 116084, 211829, 313203, 361337, 315770, 382330, 362881, 359299, 260996, 253829, 225670, 378244, 349067, 395659, 350093, 395661, 39324, 212382, 253856, 251298, 310182, 377790, 349121, 163268, 148940, 176601, 219101, 207838, 256477, 347103, 354272, 354274, 64485, 366053, 337895, 354280, 361963, 327661, 281072, 251378, 349171, 201720, 233978, 320507 ]
eb83447817faeda089d51cfeca43aaafe9e470b6
af022f44d844a90806ea1c26a3799446fa133ccd
/swift/swift_files/TblAnimalPhotoData.swift
a26e17f9174eb8663751fb8a045f6305878af7f0
[]
no_license
asimo124/BillsSite
47856d284421d9e2a4b4a6297c2f87860c43cb5d
44d6d6bc115f74fb9285fc4aac89a3e489d8206e
refs/heads/master
2020-05-04T22:27:25.876420
2019-07-11T19:38:40
2019-07-11T19:38:40
179,512,828
0
0
null
null
null
null
UTF-8
Swift
false
false
22,669
swift
// // TblAnimalPhoto.swift // IOSApp3 // // Created by Alex Hawley on 8/12/16. // Copyright © 2016 Alex Hawley. All rights reserved. // import Foundation class TblAnimalPhotoData { var pk_id: Int = -1 var pk_id_str: String = "unset" var animal_registration: String = "unset" var animal_registration_str: String = "unset" var photo: String = "unset" var photo_str: String = "unset" var is_primary: Int = -1 var is_primary_str: String = "unset" var create_user: String = "unset" var create_user_str: String = "unset" var create_stamp: NSDate = NSDate.distantFuture() as NSDate var create_stamp_str: String = "unset" var update_user: String = "unset" var update_user_str: String = "unset" var update_stamp: NSDate = NSDate.distantFuture() as NSDate var update_stamp_str: String = "unset" var hide_from_rotation: Int = -1 var hide_from_rotation_str: String = "unset" var comment: String = "unset" var comment_str: String = "unset" func setPkId(pk_id: Int?) { self.pk_id = pk_id ?? 0 let pk_id2 = pk_id ?? 0 self.pk_id_str = String(pk_id2) self.pk_id_str = (self.pk_id_str == "0") ? "" : self.pk_id_str } func getPkId() -> Int { return self.pk_id } func getPkIdType() -> String { return "Int" }; func getPkIdStr() -> String { return pk_id_str }; func getPkIdStrPG() -> String { return pk_id_str }; func setAnimalRegistration(animal_registration: String?) { self.animal_registration = animal_registration ?? "" self.animal_registration_str = String(self.animal_registration) } func getAnimalRegistration() -> String { return self.animal_registration } func getAnimalRegistrationType() -> String { return "String" }; func getAnimalRegistrationStr() -> String { return animal_registration_str == "unset" ? "" : animal_registration_str }; func getAnimalRegistrationStrPG() -> String { return animal_registration_str == "unset" ? "" : animal_registration_str }; func setPhoto(photo: String?) { self.photo = photo ?? "" self.photo_str = String(self.photo) } func getPhoto() -> String { return self.photo } func getPhotoType() -> String { return "String" }; func getPhotoStr() -> String { return photo_str == "unset" ? "" : photo_str }; func getPhotoStrPG() -> String { return photo_str == "unset" ? "" : photo_str }; func setIsPrimary(is_primary: Int?) { self.is_primary = is_primary ?? 0 self.is_primary_str = ((self.is_primary) == 1) ? "t" : "f" } func getIsPrimary() -> Int { return self.is_primary } func getIsPrimaryType() -> String { return "Int" }; func getIsPrimaryStr() -> String { return String(is_primary) }; func getIsPrimaryStrPG() -> String { return is_primary_str }; func setCreateUser(create_user: String?) { self.create_user = create_user ?? "" self.create_user_str = String(self.create_user) } func getCreateUser() -> String { return self.create_user } func getCreateUserType() -> String { return "String" }; func getCreateUserStr() -> String { return create_user_str == "unset" ? "" : create_user_str }; func getCreateUserStrPG() -> String { return create_user_str == "unset" ? "" : create_user_str }; func setCreateStamp(create_stamp: NSDate?) { self.create_stamp = create_stamp ?? NSDate.distantPast() as NSDate self.create_stamp_str = Utils.dateToString(self.create_stamp) } func getCreateStamp() -> NSDate { return self.create_stamp } func getCreateStampType() -> String { return "NSDate" }; func getCreateStampStr() -> String { return create_stamp_str == "unset" || create_stamp_str == "0000-12-30 00:00:00 +0000" ? "" : create_stamp_str }; func getCreateStampStrPG() -> String { return create_stamp_str == "unset" || create_stamp_str == "0000-12-30 00:00:00 +0000" ? "" : create_stamp_str }; func setUpdateUser(update_user: String?) { self.update_user = update_user ?? "" self.update_user_str = String(self.update_user) } func getUpdateUser() -> String { return self.update_user } func getUpdateUserType() -> String { return "String" }; func getUpdateUserStr() -> String { return update_user_str == "unset" ? "" : update_user_str }; func getUpdateUserStrPG() -> String { return update_user_str == "unset" ? "" : update_user_str }; func setUpdateStamp(update_stamp: NSDate?) { self.update_stamp = update_stamp ?? NSDate.distantPast() as NSDate self.update_stamp_str = Utils.dateToString(self.update_stamp) } func getUpdateStamp() -> NSDate { return self.update_stamp } func getUpdateStampType() -> String { return "NSDate" }; func getUpdateStampStr() -> String { return update_stamp_str == "unset" || update_stamp_str == "0000-12-30 00:00:00 +0000" ? "" : update_stamp_str }; func getUpdateStampStrPG() -> String { return update_stamp_str == "unset" || update_stamp_str == "0000-12-30 00:00:00 +0000" ? "" : update_stamp_str }; func setHideFromRotation(hide_from_rotation: Int?) { self.hide_from_rotation = hide_from_rotation ?? 0 self.hide_from_rotation_str = ((self.hide_from_rotation) == 1) ? "t" : "f" } func getHideFromRotation() -> Int { return self.hide_from_rotation } func getHideFromRotationType() -> String { return "Int" }; func getHideFromRotationStr() -> String { return String(hide_from_rotation) }; func getHideFromRotationStrPG() -> String { return hide_from_rotation_str }; func setComment(comment: String?) { self.comment = comment ?? "" self.comment_str = String(self.comment) } func getComment() -> String { return self.comment } func getCommentType() -> String { return "String" }; func getCommentStr() -> String { return comment_str == "unset" ? "" : comment_str }; func getCommentStrPG() -> String { return comment_str == "unset" ? "" : comment_str }; func getFieldType(field: String) -> String { switch field { case "pk_id": return "Int" case "animal_registration": return "String" case "photo": return "String" case "is_primary": return "Int" case "create_user": return "String" case "create_stamp": return "NSDate" case "update_user": return "String" case "update_stamp": return "NSDate" case "hide_from_rotation": return "Int" case "comment": return "String" default: return "String" } } func getFieldString(field: String) -> String { switch field { case "pk_id": return self.getPkIdStr() case "animal_registration": return self.getAnimalRegistrationStr() case "photo": return self.getPhotoStr() case "is_primary": return self.getIsPrimaryStr() case "create_user": return self.getCreateUserStr() case "create_stamp": return self.getCreateStampStr() case "update_user": return self.getUpdateUserStr() case "update_stamp": return self.getUpdateStampStr() case "hide_from_rotation": return self.getHideFromRotationStr() case "comment": return self.getCommentStr() default: break; } return "" } func keyIsSet(field: String) -> Bool { var i = 0 let obj = self let reflected = Mirror(reflecting: obj) for child in reflected.children { guard let key = child.label else { continue } let value: Any = child.value if key == field { let field_type = self.getFieldType(field) switch (field_type) { case "String": let str4 = value as! String if str4 == "unset" { return false } break case "NSDate": let date4 = value as! NSDate if date4 == NSDate.distantFuture() as NSDate { return false } break case "Int": let int4 = value as! Int if int4 == -1 { return false } break case "Double": let doub4 = value as! Double if doub4 == -1.0 { return false } break; default: break; } break } i += 1 } return true } func loadByID(animal_registration: String) -> [String: String] { let qb = QueryBuilder() qb.selectFrom("tbl_animal_photo") .Where("animal_registration = ?") var fieldsArr: [AnyObject] = [] fieldsArr.append(animal_registration) var fields = [String: String]() let (resultset, error) = SDOld.executeQuery(qb.getQuery(), withArgs: fieldsArr) if (error != nil) { SDOld.printDie(error!) } else { if resultset.count > 0 { let row = resultset[0] self.setPkId((row["pk_id"]?.asInt())); self.setAnimalRegistration((row["animal_registration"]?.asString())); self.setPhoto((row["photo"]?.asString())); self.setIsPrimary((row["is_primary"]?.asMyBool())); self.setCreateUser((row["create_user"]?.asString())); self.setCreateStamp((row["create_stamp"]?.asDate())); self.setUpdateUser((row["update_user"]?.asString())); self.setUpdateStamp((row["update_stamp"]?.asDate())); self.setHideFromRotation((row["hide_from_rotation"]?.asMyBool())); self.setComment((row["comment"]?.asString())); var fields = [String: String]() fields["pk_id"] = self.getPkIdStr() fields["animal_registration"] = self.getAnimalRegistrationStr() fields["photo"] = self.getPhotoStr() fields["is_primary"] = self.getIsPrimaryStr() fields["create_user"] = self.getCreateUserStr() fields["create_stamp"] = self.getCreateStampStr() fields["update_user"] = self.getUpdateUserStr() fields["update_stamp"] = self.getUpdateStampStr() fields["hide_from_rotation"] = self.getHideFromRotationStr() fields["comment"] = self.getCommentStr() return fields } } return fields } func getFields() -> [String: String] { var fields = [String: String]() fields["pk_id"] = self.getPkIdStr() fields["animal_registration"] = self.getAnimalRegistrationStr() fields["photo"] = self.getPhotoStr() fields["is_primary"] = self.getIsPrimaryStr() fields["create_user"] = self.getCreateUserStr() fields["create_stamp"] = self.getCreateStampStr() fields["update_user"] = self.getUpdateUserStr() fields["update_stamp"] = self.getUpdateStampStr() fields["hide_from_rotation"] = self.getHideFromRotationStr() fields["comment"] = self.getCommentStr() return fields } func getFieldsPG() -> [String: String] { var fields = [String: String]() fields["pk_id"] = self.getPkIdStrPG() fields["animal_registration"] = self.getAnimalRegistrationStrPG() fields["photo"] = self.getPhotoStrPG() fields["is_primary"] = self.getIsPrimaryStrPG() fields["create_user"] = self.getCreateUserStrPG() fields["create_stamp"] = self.getCreateStampStrPG() fields["update_user"] = self.getUpdateUserStrPG() fields["update_stamp"] = self.getUpdateStampStrPG() fields["hide_from_rotation"] = self.getHideFromRotationStrPG() fields["comment"] = self.getCommentStrPG() return fields } func addNew() { var statement = "INSERT INTO tbl_animal_photo (" var i = 0 let obj = self let reflected = Mirror(reflecting: obj) for child in reflected.children { guard let key = child.label else { continue } let _: Any = child.value if key != "_id" && key.rangeOfString("_str") != nil { let use_key = key.stringByReplacingOccurrencesOfString("_str", withString: "") if self.keyIsSet(use_key) { if i == 0 { statement += use_key } else { statement += ", " + use_key } i += 1 } } } statement += ") VALUES (" // get all field/values as string values var fields = self.getFields() i = 0 for child in reflected.children { guard let key = child.label else { continue } let _: Any = child.value if key != "_id" && key.rangeOfString("_str") != nil { let use_key = key.stringByReplacingOccurrencesOfString("_str", withString: "") if self.keyIsSet(use_key) { var value2 = fields[use_key]!.stringByReplacingOccurrencesOfString("'", withString: "''") let matches = Utils.matchesForRegexInText("^Optional\\(", text: value2) if matches.count > 0 { value2 = value2.stringByReplacingOccurrencesOfString("Optional(", withString: "") value2.removeAtIndex(value2.endIndex.predecessor()) } if i == 0 { statement += "'" + value2 + "'" } else { statement += ", '" + value2 + "'" } i += 1 } } } statement += ")" let dbn = DatabaseOld() dbn.query(statement) } func addNewPG() { var statement = "INSERT INTO tbl_animal_photo (" var i = 0 let obj = self let reflected = Mirror(reflecting: obj) for child in reflected.children { guard let key = child.label else { continue } let _: Any = child.value if key != "_id" && key.rangeOfString("_str") != nil { let use_key = key.stringByReplacingOccurrencesOfString("_str", withString: "") if self.keyIsSet(use_key) { if i == 0 { statement += use_key } else { statement += ", " + use_key } i += 1 } } } statement += ") VALUES (" // get all field/values as string values var fields = self.getFieldsPG() i = 0 for child in reflected.children { guard let key = child.label else { continue } let _: Any = child.value if key != "_id" && key.rangeOfString("_str") != nil { let use_key = key.stringByReplacingOccurrencesOfString("_str", withString: "") if self.keyIsSet(use_key) { var value2 = fields[use_key]!.stringByReplacingOccurrencesOfString("'", withString: "''") let matches = Utils.matchesForRegexInText("^Optional\\(", text: value2) if matches.count > 0 { value2 = value2.stringByReplacingOccurrencesOfString("Optional(", withString: "") value2.removeAtIndex(value2.endIndex.predecessor()) } if i == 0 { statement += "'" + value2 + "'" } else { statement += ", '" + value2 + "'" } i += 1 } } } statement += ")" let dbn = DatabaseOld() dbn.query("INSERT INTO " + SyncableQueries.TABLE_NAME + " (" + SyncableQueries.SQL_QUERY + ") " + " VALUES " + " ('" + statement + "')"); } func appendInsert(withString: String) -> String { var ret_str = withString let obj = self var i = 0 if (withString == "") { var statement = "INSERT INTO tbl_animal_photo (" let reflected = Mirror(reflecting: obj) for child in reflected.children { guard let key = child.label else { continue } let _: Any = child.value if key != "_id" && key.rangeOfString("_str") != nil { let use_key = key.stringByReplacingOccurrencesOfString("_str", withString: "") if self.keyIsSet(use_key) { if i == 0 { statement += use_key } else { statement += ", " + use_key } i += 1 } } } statement += ") " ret_str = statement } // get all field/values as string values var fields = self.getFields() i = 0 var statement = "" if ret_str.rangeOfString("select") == nil { statement = "select " } else { statement = "union all select " } let reflected = Mirror(reflecting: obj) for child in reflected.children { guard let key = child.label else { continue } let _: Any = child.value if key != "_id" && key.rangeOfString("_str") != nil { let use_key = key.stringByReplacingOccurrencesOfString("_str", withString: "") if self.keyIsSet(use_key) { var value2 = fields[use_key]!.stringByReplacingOccurrencesOfString("'", withString: "''") let matches = Utils.matchesForRegexInText("^Optional\\(", text: value2) if matches.count > 0 { value2 = value2.stringByReplacingOccurrencesOfString("Optional(", withString: "") value2.removeAtIndex(value2.endIndex.predecessor()) } if i == 0 { statement += "'" + value2 + "'" } else { statement += ", '" + value2 + "'" } i += 1 } } } ret_str += statement return ret_str } func update(forID: String) { // get all field/values as string values var fields = self.getFields() var statement = "UPDATE tbl_animal_photo " var i = 0 let obj = self let reflected = Mirror(reflecting: obj) for child in reflected.children { guard let key = child.label else { continue } let _: Any = child.value if key != "_id" && key.rangeOfString("_str") != nil { let use_key = key.stringByReplacingOccurrencesOfString("_str", withString: "") if self.keyIsSet(use_key) { var value2 = fields[use_key]!.stringByReplacingOccurrencesOfString("'", withString: "''") let matches = Utils.matchesForRegexInText("^Optional\\(", text: value2) if matches.count > 0 { value2 = value2.stringByReplacingOccurrencesOfString("Optional(", withString: "") value2.removeAtIndex(value2.endIndex.predecessor()) } if i == 0 { statement += "SET " + use_key + " = '" + value2 + "' " } else { statement += ", " + use_key + " = '" + value2 + "' " } i += 1 } } } statement += "WHERE animal_registration = " + String(forID) let dbn = DatabaseOld() dbn.query(statement) } func updatePG(forID: String) { // get all field/values as string values var fields = self.getFieldsPG() var statement = "UPDATE tbl_animal_photo " var i = 0 let obj = self let reflected = Mirror(reflecting: obj) for child in reflected.children { guard let key = child.label else { continue } let _: Any = child.value if key != "_id" && key.rangeOfString("_str") != nil { let use_key = key.stringByReplacingOccurrencesOfString("_str", withString: "") if self.keyIsSet(use_key) { var value2 = fields[use_key]!.stringByReplacingOccurrencesOfString("'", withString: "''") let matches = Utils.matchesForRegexInText("^Optional\\(", text: value2) if matches.count > 0 { value2 = value2.stringByReplacingOccurrencesOfString("Optional(", withString: "") value2.removeAtIndex(value2.endIndex.predecessor()) } if i == 0 { statement += "SET " + use_key + " = '" + value2 + "' " } else { statement += ", " + use_key + " = '" + value2 + "' " } i += 1 } } } statement += "WHERE animal_registration = " + String(forID) let dbn = DatabaseOld() dbn.query("INSERT INTO " + SyncableQueries.TABLE_NAME + " (" + SyncableQueries.SQL_QUERY + ") " + " VALUES " + " ('" + statement + "')"); } func delete(forID: Int) { let query = "DELETE FROM tbl_animal_photo WHERE animal_registration = " + String(forID) let dbn = DatabaseOld() dbn.query(query) } func deletePG(forID: String) { let statement = "DELETE FROM tbl_animal_photo WHERE animal_registration = " + String(forID) let dbn = DatabaseOld() dbn.query("INSERT INTO " + SyncableQueries.TABLE_NAME + " (" + SyncableQueries.SQL_QUERY + ") " + " VALUES " + " ('" + statement + "')"); } class func getLastanimalRegistration() -> String { let animal_registration: String = "" let query = "SELECT animal_registration from tbl_animal_photo ORDER BY _id DESC LIMIT 1 " let (resultset, err) = SDOld.executeQuery(query) if (err == nil) { if resultset.count > 0 { let row = resultset[0] let animal_registration2 = row["animal_registration"]?.asString() ?? "" return animal_registration2 } } return animal_registration } }
[ -1 ]
f783186a7d9c7502fdfb1eacf9a027a62b49a241
2dc42cfbc5e488a44bd833fa26cb8fb7bbcd28a3
/Click counter/AppDelegate.swift
8446fecb4b5f499de93d376efacf02234186ecc3
[]
no_license
q45/ios_count
7a32b8a4ed680c06ac25aa421260bd827c068f1b
e98ec6250009d84179ae9cb4cee6f25276ceb6c8
refs/heads/master
2020-06-03T15:16:44.622418
2015-03-09T05:44:02
2015-03-09T05:44:02
31,881,376
0
0
null
null
null
null
UTF-8
Swift
false
false
2,151
swift
// // AppDelegate.swift // Click counter // // Created by Quintin Smith on 3/8/15. // Copyright (c) 2015 wasatch code. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 352284, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 229426, 237618, 229428, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 286797, 311375, 237646, 163920, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 278648, 131192, 237693, 327814, 131209, 417930, 303241, 311436, 303244, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 278760, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 278849, 319809, 319810, 319814, 311623, 319818, 311628, 229709, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 319978, 279020, 172526, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 287238, 172550, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 287390, 295583, 303773, 172702, 287394, 230045, 303780, 172705, 287398, 172707, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 279231, 287423, 328384, 287427, 312006, 107208, 107212, 172748, 287436, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 312035, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 222018, 295755, 377676, 148302, 287569, 303959, 279383, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 320391, 213895, 304007, 304009, 304011, 230284, 304013, 213902, 279438, 295822, 189329, 295825, 304019, 189331, 279445, 58262, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 304063, 238528, 304065, 189378, 213954, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 197645, 295949, 230413, 320528, 140312, 295961, 238620, 197663, 304164, 189479, 304170, 238641, 312374, 238652, 238655, 230465, 238658, 296004, 336964, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 279661, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 165038, 238766, 230576, 238770, 304311, 350308, 230592, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 279788, 320748, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 230718, 296259, 378181, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 181626, 304506, 304505, 181631, 312711, 312712, 296331, 288140, 230800, 288144, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 173488, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 280014, 312783, 288208, 230865, 288210, 370130, 288212, 280021, 288214, 222676, 239064, 288217, 288218, 280027, 288220, 329177, 239070, 288224, 288226, 370146, 280036, 288229, 280038, 288230, 288232, 280034, 288234, 320998, 288236, 288238, 288240, 291754, 288242, 296435, 288244, 296439, 288250, 402942, 148990, 296446, 206336, 296450, 321022, 230916, 230919, 214535, 370187, 304651, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 280264, 206536, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 419570, 321266, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 304968, 280393, 280402, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280458, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 223303, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 280671, 223327, 149599, 321634, 149601, 149603, 329830, 280681, 313451, 223341, 280687, 313458, 280691, 215154, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 288936, 100520, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 280819, 157940, 125171, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 280835, 125187, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 354653, 313700, 280937, 313705, 280940, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 281084, 240124, 305662, 305664, 240129, 305666, 305668, 240132, 223749, 281095, 338440, 150025, 223752, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 199262, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 199367, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 207661, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 240519, 322440, 338823, 314249, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 281581, 183277, 322550, 134142, 322563, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 281923, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 298365, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 224657, 306581, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 282410, 241450, 306988, 306991, 315184, 323376, 315190, 241464, 282425, 159545, 298811, 307009, 413506, 241475, 307012, 148946, 315211, 282446, 307027, 315221, 282454, 315223, 241496, 323414, 241498, 307035, 307040, 282465, 110433, 241509, 110438, 298860, 110445, 282478, 282481, 110450, 315251, 315249, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 282514, 298898, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 217179, 315483, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 282931, 307508, 315701, 307510, 332086, 151864, 307512, 176435, 307515, 168245, 282942, 307518, 151874, 282947, 282957, 323917, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 283080, 176592, 315856, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 291299, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 127497, 233994, 135689, 291341, 233998, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 381677, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 283421, 234269, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 201603, 291714, 234373, 226182, 234375, 291716, 226185, 308105, 234379, 234384, 234388, 234390, 226200, 324504, 234393, 209818, 308123, 324508, 234398, 234396, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 234414, 324527, 291760, 234417, 201650, 324531, 226230, 234422, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 226245, 234437, 234439, 234434, 234443, 291788, 193486, 275406, 193488, 234446, 234449, 316370, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 275545, 242777, 234585, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 234607, 160879, 275569, 234610, 300148, 234614, 398455, 144506, 275579, 234618, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 275594, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 234648, 308379, 283805, 234653, 324766, 119967, 234657, 300189, 324768, 242852, 283813, 234661, 300197, 234664, 275626, 234667, 316596, 308414, 234687, 316610, 300226, 226500, 234692, 300229, 308420, 283844, 308418, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 283904, 300289, 292097, 300292, 300294, 275719, 300299, 177419, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 283963, 243003, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 284076, 144812, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 284099, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 259567, 300527, 308720, 226802, 316917, 308727, 292343, 300537, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194101, 284215, 194103, 284218, 226877, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 366155, 276043, 317004, 284238, 226895, 284241, 194130, 284243, 276052, 276053, 284245, 284247, 317015, 284249, 243290, 284251, 300628, 284253, 235097, 284255, 300638, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 276098, 284290, 325250, 284292, 292479, 292485, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 317158, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 284418, 358146, 317187, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 186139, 300828, 300830, 276255, 325408, 284449, 300834, 300832, 227109, 317221, 358183, 186151, 276268, 300845, 194351, 243504, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 276466, 227314, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 276539, 235579, 235581, 325692, 178238, 276544, 284739, 292934, 276553, 243785, 350293, 350295, 194649, 227418, 309337, 194654, 227423, 350302, 194657, 227426, 276579, 178273, 194660, 227430, 276583, 309346, 309348, 276586, 309350, 309352, 309354, 276590, 350313, 227440, 350316, 284786, 350321, 276595, 301167, 350325, 350328, 292985, 301178, 292989, 292993, 301185, 350339, 317570, 317573, 350342, 227463, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 276713, 317674, 325867, 243948, 194801, 227571, 309491, 276725, 309494, 243960, 227583, 276735, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 211241, 325937, 276789, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 285051, 211324, 227709, 285061, 317833, 178572, 285070, 178575, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 277011, 317971, 309781, 309779, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 277106, 121458, 170618, 170619, 309885, 309888, 277122, 227975, 285320, 277128, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 318132, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277314, 277317, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 277368, 15224, 236408, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 244731, 121850, 302075, 293882, 293887, 277504, 277507, 277511, 277519, 293908, 277526, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 277608, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 253064, 302218, 285835, 294026, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 285862, 277671, 302248, 64682, 277678, 294063, 228526, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 204023, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 228617, 138505, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 294211, 302403, 277832, 384328, 277836, 294221, 326991, 294223, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 277892, 327046, 253320, 310665, 318858, 277898, 277894, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 277923, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 64966, 245191, 163272, 302534, 310727, 277959, 292968, 302541, 277966, 302543, 277963, 310737, 277971, 277975, 286169, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 286188, 310764, 278000, 278003, 310772, 228851, 278006, 212472, 278009, 40440, 40443, 286203, 228864, 40448, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187939, 294435, 40484, 286246, 294439, 286248, 278057, 294440, 294443, 40486, 294445, 40488, 310831, 40491, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 228944, 212560, 400976, 40533, 147032, 40537, 40539, 278109, 40541, 40544, 40548, 40550, 286312, 286313, 40554, 40552, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 278150, 310925, 286354, 278163, 302740, 122517, 278168, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 278227, 229076, 286420, 319187, 286425, 319194, 278235, 301163, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 171774, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 237409, 294776, 360317, 294785, 327554, 40840, 40851, 294803, 188312, 294811, 319390, 294817, 319394, 40865, 294821, 311209, 180142, 294831, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
02fc39116e19ab540d0bf4e77e80a2b35fe6e466
dc59e2a9d78df3781bc9453e10eedc4be437224b
/ios-web-client/Extension/SKProduct+Extension.swift
de3f4879d8f163e8158f2eb291f1e5f10ce5d96c
[]
no_license
Vitali55/ios-wkwebview
e5163be71f8828e6b83bb97137a5a7a225275003
aafa47211ea1ba1c0b09c5bb5b2aa2d78ea39530
refs/heads/master
2022-12-09T16:48:15.569067
2020-09-14T15:41:12
2020-09-14T15:41:12
null
0
0
null
null
null
null
UTF-8
Swift
false
false
783
swift
// // SKProduct+Extension.swift // ios-web-client // // Created by Nazar Yavornytskyi on 8/31/20. // Copyright © 2020 apescodes. All rights reserved. // import StoreKit import SwiftyStoreKit extension SKProduct { fileprivate static var formatter: NumberFormatter { let formatter = NumberFormatter() formatter.numberStyle = .currency return formatter } var localizedPrice: String { self.priceLocale.currencyCode ?? "" } } extension Encodable { func dictionary() -> [String: Any]? { let encoder = JSONEncoder() guard let data = try? encoder.encode(self), let jsonObject = try? JSONSerialization.jsonObject(with: data, options: .allowFragments) else { return nil } return jsonObject as? [String: Any] } }
[ -1 ]
2cfb6f27015ccb0565ebc719556db1ab2cc93432
55944d9f1f4fd8041af76ba0711bc04a749779bb
/MessengerApp/Extensions.swift
0b5ebb5962aa475fa52562fe50db5fca7cc93210
[]
no_license
dxbvo/MessengerApp
09a2f329daa385f30ffeb509140f862ae7e2886d
b873df9279f1ae94c99e61977530cf4fe0f705fb
refs/heads/main
2023-07-18T02:03:15.793706
2021-08-29T06:58:24
2021-08-29T06:58:24
400,610,862
0
0
null
null
null
null
UTF-8
Swift
false
false
747
swift
// // Extensions.swift // MessengerApp // // Created by Diego Belusky on 26.08.21. // import Foundation import UIKit extension UIView { public var width: CGFloat { return self.frame.size.width } public var height: CGFloat { return self.frame.size.height } public var top: CGFloat { return self.frame.origin.y } public var bottom: CGFloat { return self.frame.size.height + self.frame.origin.y } public var left: CGFloat { return self.frame.origin.x } public var right: CGFloat { return self.frame.size.width + self.frame.origin.x } } extension Notification.Name { static let didLogInNotification = Notification.Name("didLogInNotification") }
[ -1 ]
38a33a6fb5242814f88d142a8bc8770d9b846d40
5d8767c9a0fcba2ddc9afe058dd0d996b49e358a
/flixster/PosterImageView.swift
a86f7edade45fd1936c57836fc7e21d2cb1ade7b
[]
no_license
EfazAhmed/codepath_ios_flix
aded90c26fc9a631caaf00bdae082bed58c651ce
8dc499fe5d1478388b7aabee66b88755db8d4ea3
refs/heads/master
2023-06-16T18:23:42.486804
2021-07-17T00:24:14
2021-07-17T00:24:14
382,972,464
1
0
null
null
null
null
UTF-8
Swift
false
false
365
swift
// // PosterImageView.swift // flixster // // Created by Efaz on 7/16/21. // import UIKit class PosterImageView: UIImageView { /* // Only override draw() if you perform custom drawing. // An empty implementation adversely affects performance during animation. override func draw(_ rect: CGRect) { // Drawing code } */ }
[ -1 ]
5d66e45b281d3ff7e6f8bef66fb6f8af80d4a419
142da8e34ef9a4c0cf669546987cc133b90392fd
/ZeroCopyTests/Views/StartStopCellSpec.swift
07d5a0027a82cd6abae9d099d461dd993873a0a5
[]
no_license
mgopsill/ZeroCopy
84dad43da579235f5d5c6436ff4005afdbb2e97e
a8daa40db863a9362037a78dbc71bb93ddad0235
refs/heads/master
2021-05-10T12:38:07.361191
2018-04-30T12:01:29
2018-04-30T12:01:29
118,446,474
0
1
null
2018-02-28T15:09:00
2018-01-22T11:10:03
Swift
UTF-8
Swift
false
false
2,577
swift
// // StartStopCellSpec.swift // ZeroCopyTests // // Created by Mike Gopsill on 28/02/2018. // Copyright © 2018 Mike Gopsill. All rights reserved. // import Quick import Nimble @testable import ZeroCopy class StartStopCellSpec: QuickSpec { override func spec() { describe("Start Stop Cell") { var subject: StartStopCell! beforeEach { subject = StartStopCell() } context("when creating a cell") { it("cell should not be nil") { expect(subject).notTo(beNil()) } } context("when button is press to start a fast") { var mockDelegate: MockStartStopCellDelegate! beforeEach { mockDelegate = MockStartStopCellDelegate() subject.delegate = mockDelegate subject.fastingButton.isSelected = false subject.fastingButton.sendActions(for: .touchUpInside) } it("should call runtimer method on delegate") { expect(mockDelegate.didCallDelegateRunTimer).to(beTrue()) expect(mockDelegate.didCallDelegatePresentMethod).toNot(beTrue()) } } context("when button is press to end a fast") { var mockDelegate: MockStartStopCellDelegate! beforeEach { mockDelegate = MockStartStopCellDelegate() subject.delegate = mockDelegate subject.fastingButton.isSelected = true subject.fastingButton.sendActions(for: .touchUpInside) } it("should call runtimer method on delegate") { expect(mockDelegate.didCallDelegateRunTimer).toNot(beTrue()) expect(mockDelegate.didCallDelegatePresentMethod).to(beTrue()) } } } } } fileprivate class MockStartStopCellDelegate: StartStopCellDelegate { var didCallDelegatePresentMethod: Bool = false var didCallDelegateRunTimer: Bool = false func presentSaveFastViewContoller(closure: @escaping () -> Void) { didCallDelegatePresentMethod = true } func runTimer() { didCallDelegateRunTimer = true } }
[ -1 ]
c6643f54c00d8a4373bc6d98faf6fd6bd0962b18
b11d2044162057dd81e6a7af630895084b63c560
/OnionBrowser/Startup/PermissionViewController.swift
c68ea31a18bb8dce961aca46c1fd5e957ab74a2e
[ "BSD-3-Clause" ]
permissive
OnionBrowser/OnionBrowser
aa21481e5f7a82c66625cce0a0594b512f01252d
3bce08a167eaba6261aa84b5b350f41ed3ff734b
refs/heads/3.X
2023-09-01T01:13:14.032207
2023-08-29T12:37:51
2023-08-29T12:37:51
3,534,119
1,336
226
NOASSERTION
2023-06-26T14:02:39
2012-02-24T08:50:51
HTML
UTF-8
Swift
false
false
4,236
swift
// // PermissionViewController.swift // OnionBrowser // // Created by Benjamin Erhart on 03.05.23. // Copyright © 2023 Tigas Ventures, LLC (Mike Tigas) // // This file is part of Onion Browser. See LICENSE file for redistribution terms. // import UIKit import OrbotKit class PermissionViewController: UIViewController, WhyDelegate { var error: Error? @IBOutlet weak var statusIv: UIImageView! @IBOutlet weak var titleLb: UILabel! { didSet { titleLb.text = String( format: NSLocalizedString( "%@ installed! One more step.", comment: "Placeholder is 'Orbot'"), OrbotKit.orbotName) } } @IBOutlet weak var body1Lb: UILabel! { didSet { body1Lb.text = String( format: NSLocalizedString( "Ask %@ for permission to access it.", comment: "Placeholder is 'Orbot'"), OrbotKit.orbotName) } } @IBOutlet weak var body2Lb: UILabel! { didSet { let text = NSMutableAttributedString(string: String( format: NSLocalizedString( "This will allow %@ to:", comment: "Placeholder is 'Onion Browser'"), Bundle.main.displayName)) if let range = text.string.range(of: Bundle.main.displayName), let descriptor = body2Lb.font.fontDescriptor.withSymbolicTraits(.traitBold) { text.setAttributes([.foregroundColor: UIColor.accent!, .font: UIFont(descriptor: descriptor, size: 0)], range: NSRange(range, in: text.string)) } body2Lb.attributedText = text } } @IBOutlet weak var body2Top: NSLayoutConstraint! private lazy var body20Height: NSLayoutConstraint = { body2Lb.heightAnchor.constraint(equalToConstant: 0) }() @IBOutlet weak var body3Lb: UILabel! { didSet { body3Lb.text = String( format: NSLocalizedString( "%1$@ Use %2$@ to connect to the official Tor network.", comment: "Placeholder 1 is bullet point, placeholder 2 is 'Orbot'"), "•", OrbotKit.orbotName) } } private lazy var body30Height: NSLayoutConstraint = { body3Lb.heightAnchor.constraint(equalToConstant: 0) }() @IBOutlet weak var body4Lb: UILabel! { didSet { body4Lb.text = String( format: NSLocalizedString( "%@ Get updates on the status of the connection.", comment: "Placeholder is bullet point"), "•") } } private lazy var body40Height: NSLayoutConstraint = { body4Lb.heightAnchor.constraint(equalToConstant: 0) }() @IBOutlet weak var requestAccessBt: UIButton! { didSet { requestAccessBt.setTitle(buttonTitle) } } @IBOutlet weak var whyBt: UIButton! { didSet { whyBt.setTitle(NSLocalizedString("Why", comment: "")) } } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) if error != nil || Settings.orbotApiToken == Settings.orbotAccessDenied { var description = error?.localizedDescription if case OrbotKit.Errors.httpError(statusCode: 403)? = error { description = nil } statusIv.tintColor = .error statusIv.image = .init(systemName: "nosign") titleLb.text = String( format: NSLocalizedString( "Access to %@ was Denied", comment: "Placeholder is 'Orbot'"), OrbotKit.orbotName) body1Lb.text = NSLocalizedString("Ask again to continue.", comment: "") if let description = description { body2Lb.attributedText = .init(string: description, attributes: [.foregroundColor: UIColor.error!]) } else { body2Lb.isHidden = true body2Top?.constant = 0 body20Height.isActive = true } body3Lb.isHidden = true body30Height.isActive = true body4Lb.isHidden = true body40Height.isActive = true } else if Settings.orbotWasAlreadyInstalled { titleLb.text = String( format: NSLocalizedString( "%1$@ now relies on %2$@ for a secure connection to Tor.", comment: "Placeholder 1 is 'Onion Browser', placeholder 2 is 'Orbot'"), Bundle.main.displayName, OrbotKit.orbotName) } } // MARK: WhyDelegate var buttonTitle: String { NSLocalizedString("Request Access", comment: "") } // MARK: Actions @IBAction func action() { OrbotKit.shared.open(.requestApiToken(needBypass: false, callback: URL(string: "onionbrowser:token-callback"))) } @IBAction func why() { present(WhyViewController.instantiate(self)) } }
[ -1 ]
8d66aa9d9dde88463b91a1acc4c57f6d2561db85
4ab97534db67e65de71a1ad89595e335f3d84356
/Habitz/Habitz/UI/UIColorExtension.swift
f7835bf4565b66b660b722842cb34a1e7b01d688
[]
no_license
wittrura/Habitz
38ff3979c1c3659ca625e6bade60e20a7b287a71
5cafefe715d478449cee6f2fa818173500769703
refs/heads/master
2021-05-14T09:49:21.802713
2018-01-26T21:06:41
2018-01-26T21:06:41
116,335,340
0
1
null
null
null
null
UTF-8
Swift
false
false
1,775
swift
// // UIColorExtension // Habitz // // Created by Ryan Wittrup on 1/20/18. // Copyright © 2018 Ryan Wittrup. All rights reserved. // import Foundation import UIKit extension UIColor { /** Creates an UIColor from HEX String in "#363636" format - parameter hexString: HEX String in "#363636" format - returns: UIColor from HexString */ convenience init(hexString: String) { let hexString: String = (hexString as NSString).trimmingCharacters(in: .whitespacesAndNewlines) let scanner = Scanner(string: hexString as String) if hexString.hasPrefix("#") { scanner.scanLocation = 1 } var color: UInt32 = 0 scanner.scanHexInt32(&color) let mask = 0x000000FF let r = Int(color >> 16) & mask let g = Int(color >> 8) & mask let b = Int(color) & mask let red = CGFloat(r) / 255.0 let green = CGFloat(g) / 255.0 let blue = CGFloat(b) / 255.0 self.init(red:red, green:green, blue:blue, alpha:1) } /** Creates an UIColor Object based on provided RGB value in integer - parameter red: Red Value in integer (0-255) - parameter green: Green Value in integer (0-255) - parameter blue: Blue Value in integer (0-255) - returns: UIColor with specified RGB values */ 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) } }
[ -1 ]
a757d016f299ee4ae2bd8cf6300f1d78b5ec0f7c
eebe904e19415c33b02954487c524b575ec5f4b4
/ReaderTranslatorMobile/Views/GTranslatorView.swift
8045c12e7bd4186789e3860441e874d60a57385c
[]
no_license
filimo/ReaderTranslator
889e2ad2c38f55fb04d2c67cf264b1f5834ad363
b6d68125c789be650446f76f681e2b14cebf4f16
refs/heads/master
2023-01-24T06:02:40.052692
2023-01-21T06:30:15
2023-01-21T06:30:15
208,761,054
110
15
null
2019-10-26T21:13:01
2019-09-16T09:27:44
Swift
UTF-8
Swift
false
false
584
swift
// // GTranslatorView.swift // ReaderTranslatorMobile // // Created by Viktor Kushnerov on 28/2/20. // Copyright © 2020 Viktor Kushnerov. All rights reserved. // import SwiftUI struct GTranslatorView: View { @ObservedObject private var store = Store.shared var body: some View { GTranslatorRepresenter(selectedText: self.$store.translateAction) .onAppear { GTranslatorRepresenter.isMiniMode = false } } } struct GTranslatorView_Previews: PreviewProvider { static var previews: some View { GTranslatorView() } }
[ -1 ]
54ae58c70549461204eaa0d0b68efff1fed658c5
fbbeb6cabae81570d66e2845f95fd37e73e68229
/105-2_iOS程式設計/TaipeiHotel/TaipeiHotelTests/TaipeiHotelTests.swift
faa6acb7a2e2edc1d1f09f5377f5cef33a14612f
[]
no_license
ycwang812/VNU
166db663d8f317a562033ce6e1a4ab7730f9776d
c877deedeb4e63353c7567196eb8ecde22bcb141
refs/heads/master
2022-05-02T23:01:51.195181
2022-03-21T05:32:12
2022-03-21T05:32:12
93,036,957
4
4
null
null
null
null
UTF-8
Swift
false
false
984
swift
// // TaipeiHotelTests.swift // TaipeiHotelTests // // Created by eHappyMac2 on 2016/2/28. // Copyright © 2016年 eHappy. All rights reserved. // import XCTest @testable import TaipeiHotel class TaipeiHotelTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 313357, 305179, 145435, 98333, 278558, 307231, 313375, 317467, 241692, 239650, 102437, 292902, 329765, 354343, 354345, 227370, 360491, 223274, 315434, 325674, 233517, 282672, 241716, 276534, 180280, 288828, 159807, 288833, 288834, 286788, 280649, 315465, 311372, 311374, 354385, 196691, 223316, 315476, 223318, 329814, 307289, 288857, 227417, 354393, 200794, 194656, 309345, 280675, 227428, 280677, 276582, 43110, 321637, 329829, 131178, 194666, 276589, 278638, 227439, 319598, 288879, 204916, 131189, 223350, 131191, 233590, 288889, 280694, 233589, 131198, 292992, 194691, 227460, 141450, 215178, 311435, 319629, 311438, 235662, 325776, 276627, 276632, 284826, 184484, 196773, 299174, 153776, 239793, 129203, 299187, 131256, 184505, 227513, 295098, 280762, 223419, 299198, 180408, 258239, 280768, 301251, 309444, 227524, 276682, 321745, 280795, 194782, 301279, 311519, 356576, 280802, 346346, 176362, 286958, 125169, 233715, 157944, 211193, 227578, 184570, 168188, 327929, 184575, 309503, 194820, 321800, 278797, 338197, 309529, 278810, 282909, 299293, 227616, 282913, 233762, 278816, 305440, 211235, 282919, 151847, 262450, 332083, 332085, 280887, 332089, 315706, 282939, 278842, 287041, 287043, 139589, 227654, 311621, 280902, 182597, 227658, 276813, 282960, 6481, 6482, 325968, 366929, 278869, 289110, 168281, 6489, 332123, 334171, 323935, 106847, 332127, 354655, 276835, 321894, 416104, 280939, 276847, 285040, 242033, 313713, 199029, 291192, 315773, 211326, 291198, 280961, 332167, 242058, 311691, 227725, 240016, 108944, 178578, 190871, 291224, 293274, 285084, 317852, 242078, 141728, 61857, 285090, 61859, 315810, 289189, 315811, 381347, 108972, 278961, 299441, 278965, 293303, 276920, 283064, 278970, 293306, 33211, 276925, 311738, 293310, 291265, 278978, 291267, 127427, 127428, 283075, 311745, 278989, 281037, 317901, 281040, 278993, 289232, 326100, 328152, 369116, 285150, 287198, 279008, 227809, 358882, 160225, 279013, 227813, 127465, 279018, 311786, 330218, 279022, 291311, 309744, 281072, 109042, 319987, 279029, 233978, 279039, 301571, 291333, 276998, 342536, 287241, 279050, 186893, 303631, 283153, 303636, 279062, 223767, 289304, 223769, 279065, 291358, 180771, 293419, 244269, 283182, 283184, 234036, 289332, 277048, 338490, 115270, 293448, 55881, 377418, 281166, 295519, 66150, 277094, 244327, 279146, 277101, 313966, 295536, 287346, 277111, 287352, 301689, 244347, 279164, 291454, 189057, 184962, 303746, 279177, 152203, 330379, 277133, 133774, 311949, 316049, 330387, 330388, 117397, 111253, 230040, 295576, 289434, 111258, 221852, 207732, 279206, 285353, 287404, 295599, 205487, 303793, 285361, 299699, 293556, 342706, 166582, 289462, 299700, 164533, 109241, 285371, 285372, 285373, 285374, 287422, 303803, 158394, 66242, 248517, 199366, 287433, 363211, 154316, 225997, 242386, 226004, 203477, 279252, 226007, 289502, 299746, 226019, 295652, 285415, 234217, 342762, 277227, 230125, 289518, 299759, 209783, 312047, 125684, 230134, 199414, 228088, 154359, 234234, 221948, 279294, 205568, 242433, 299776, 234241, 285444, 295682, 209670, 291592, 322313, 226058, 234250, 234253, 326414, 312079, 322319, 295697, 166676, 291604, 234263, 207640, 234268, 291612, 293664, 281377, 326433, 234277, 283430, 262951, 279336, 289576, 234283, 312108, 295724, 234286, 285487, 152365, 234289, 262962, 301871, 318252, 164656, 234294, 230199, 285497, 293693, 162621, 234301, 289598, 281408, 295746, 162626, 277316, 160575, 318278, 234311, 234312, 299849, 234317, 277325, 293711, 201549, 201551, 234323, 281427, 353109, 234326, 281433, 230234, 234331, 322395, 301918, 279392, 109409, 349026, 293730, 303972, 234340, 279397, 234343, 177001, 234346, 201577, 242541, 400239, 330609, 234355, 174963, 109428, 295798, 277366, 234360, 279417, 209785, 177019, 234361, 277370, 234366, 234367, 291712, 158593, 234372, 226181, 113542, 213894, 226184, 277381, 228234, 308107, 109447, 416646, 228233, 316298, 56208, 308112, 295824, 234386, 234387, 236428, 234392, 209817, 289690, 324507, 127902, 234400, 279456, 310178, 234404, 189348, 283558, 310182, 289703, 234409, 240552, 275371, 353195, 236461, 293806, 316333, 293800, 234419, 316343, 234425, 289722, 234427, 230332, 287677, 234430, 289727, 353215, 234436, 234438, 213960, 279498, 52172, 234444, 234445, 316364, 183248, 234451, 234454, 304087, 234457, 234463, 50143, 234466, 277479, 234472, 234473, 52200, 326635, 203757, 304110, 234477, 289774, 320493, 234482, 287731, 277492, 314355, 316405, 295927, 240630, 312314, 314362, 328700, 234498, 328706, 234500, 277509, 277510, 293893, 134150, 230410, 234506, 330763, 320527, 238610, 277523, 277524, 308243, 293910, 230423, 316437, 197657, 281626, 281625, 175132, 326685, 234531, 300068, 234534, 310317, 234542, 238639, 234548, 322612, 238651, 234555, 277563, 302139, 230463, 234560, 21569, 207938, 234565, 214086, 238664, 234569, 300111, 234577, 296019, 339030, 234583, 234584, 353367, 295744, 277597, 304222, 113760, 281697, 230499, 281700, 314467, 300135, 322663, 300136, 228458, 207979, 281706, 275565, 318572, 316526, 15471, 156785, 312434, 275571, 353397, 300150, 300151, 234616, 398457, 337017, 291959, 285820, 234622, 300158, 150657, 187521, 285828, 279685, 285830, 302213, 253063, 234632, 275591, 228491, 228493, 177296, 234642, 308372, 185493, 296086, 238743, 187544, 326804, 119962, 119963, 296092, 283802, 285851, 300188, 234656, 330913, 306338, 234659, 234663, 275625, 300202, 300201, 306346, 279728, 238769, 226481, 294074, 208058, 277690, 230588, 228542, 228540, 283840, 302274, 279747, 283847, 353479, 353481, 283852, 279760, 290000, 189652, 189653, 279765, 148696, 333022, 304351, 363744, 310497, 279774, 195811, 298212, 304356, 290022, 234733, 298221, 279792, 353523, 298228, 292085, 204022, 234742, 228600, 216315, 208124, 292091, 228609, 320770, 292107, 251153, 177428, 245019, 126237, 115998, 277792, 130338, 339234, 199971, 304421, 333090, 130343, 277800, 113966, 279854, 226608, 298291, 171317, 300343, 318775, 286013, 333117, 226624, 286018, 113987, 15686, 300359, 226632, 230729, 294218, 312648, 177484, 222541, 296270, 234831, 296273, 331090, 120148, 314709, 314710, 357719, 283991, 134491, 316765, 218462, 224606, 222559, 142689, 292195, 230756, 281957, 163175, 333160, 281962, 230765, 306542, 296303, 284014, 327025, 249204, 249205, 181625, 111993, 290169, 306559, 224640, 306560, 148867, 294275, 298374, 281992, 142729, 296329, 368011, 304524, 296335, 230799, 112017, 112018, 306579, 234898, 224661, 318875, 310692, 282022, 279974, 282024, 241066, 316842, 310701, 314798, 286129, 173491, 286132, 279989, 296375, 228795, 292283, 296387, 292292, 415171, 163269, 306631, 296392, 300489, 296391, 300487, 310732, 280013, 312782, 284107, 302540, 64975, 310736, 222675, 284116, 327121, 306639, 228827, 286172, 226781, 280032, 144867, 310757, 316902, 103909, 245223, 280041, 296425, 191981, 282096, 296433, 321009, 329200, 306677, 191990, 280055, 300536, 286202, 290300, 290301, 300542, 286205, 296448, 230913, 306692, 306693, 292356, 230921, 192010, 296461, 149007, 323087, 65041, 323089, 308756, 282136, 204313, 282141, 187938, 278060, 245292, 286254, 230959, 288309, 290358, 194110, 288318, 280130, 196164, 288326, 282183, 288327, 276040, 366154, 56902, 292423, 276045, 243274, 333388, 286288, 224847, 228943, 280147, 118353, 290390, 128599, 235095, 300630, 306776, 44635, 147036, 243292, 239198, 333408, 157281, 286306, 300644, 282213, 317032, 312940, 204397, 222832, 224883, 276085, 314998, 333430, 175741, 188031, 337535, 294529, 235135, 192131, 312965, 282246, 288392, 229001, 290443, 310923, 188048, 323217, 282259, 302739, 276120, 229020, 276126, 282271, 333470, 282273, 302754, 257699, 282276, 229029, 40613, 40614, 282280, 40615, 298661, 290471, 61101, 278191, 321199, 198324, 286388, 296628, 286391, 337591, 306874, 280251, 327358, 282303, 286399, 323264, 321219, 333509, 282312, 306890, 280267, 276173, 302797, 282318, 212688, 9936, 302802, 9937, 280278, 282327, 286423, 278233, 278234, 216795, 67292, 280280, 294622, 298712, 278240, 229088, 298720, 276195, 321249, 153319, 313065, 12010, 288491, 280300, 239341, 282348, 284401, 419569, 276210, 323316, 282355, 282358, 229113, 313081, 286459, 276219, 325371, 194303, 288512, 194304, 311042, 280004, 288516, 216839, 280327, 282378, 276238, 321295, 284431, 243472, 161554, 323346, 294678, 282391, 116505, 284442, 278299, 310131, 276253, 313120, 241441, 315171, 282409, 284459, 294700, 159533, 282417, 200498, 296755, 280372, 276282, 276283, 319292, 280380, 345919, 276287, 315202, 307011, 325445, 282438, 276294, 153415, 280392, 276298, 325457, 413521, 304977, 317269, 216918, 307031, 18262, 280410, 284507, 300894, 245599, 237408, 284512, 302946, 296806, 276327, 282474, 288619, 288620, 325484, 280430, 296814, 282480, 292720, 313203, 325492, 300918, 276344, 241528, 194429, 325503, 315264, 188292, 241540, 327557, 67463, 243591, 315273, 315274, 282504, 243597, 110480, 40853, 282518, 282519, 44952, 329622, 294807, 294809, 298909, 294814, 311199, 247712, 292771, 300963, 313254, 294823, 298920, 284587, 292782, 317360, 276408, 290746, 294843, 214977, 280514, 276421, 214984, 284619, 344013, 276430, 231375, 301008, 153554, 276444, 280541, 294886, 276454, 317415, 276459, 296941, 278512, 311281, 311282, 223218, 333817, 292858 ]
d8ae9ca116a721b67b819c0678718285bce2a629
dd41d910f09653aafabbe5db88f0d190e402ad85
/ordenarPizzaAppleWatch WatchKit Extension/masaController.swift
b01481b5871e616fcdc5605c581491766d601439
[]
no_license
AaronMqz/ordenarPizzaAppleWatch
614494b175e53554c956257ea46f0cda8eccb87b
74a00c046ca8d56140bdbf9f5ff5f3c515b5b70f
refs/heads/master
2021-01-11T11:17:34.935010
2015-11-30T07:55:47
2015-11-30T07:55:47
47,103,506
0
0
null
null
null
null
UTF-8
Swift
false
false
1,214
swift
// // masaController.swift // ordenarPizzaAppleWatch // // Created by Aaron Marquez on 29/11/15. // Copyright © 2015 Aaron Marquez. All rights reserved. // import WatchKit import Foundation class masaController: WKInterfaceController { override func awakeWithContext(context: AnyObject?) { super.awakeWithContext(context) // Configure interface objects here. } override func willActivate() { // This method is called when watch view controller is about to be visible to user super.willActivate() } override func didDeactivate() { // This method is called when watch view controller is no longer visible super.didDeactivate() } @IBAction func btnDelgada() { datosDeLaPizzza.tipoMasa = "Delgada" pushControllerWithName("viewQueso", context: datosDeLaPizzza) } @IBAction func btnCrujiente() { datosDeLaPizzza.tipoMasa = "Crujiente" pushControllerWithName("viewQueso", context: datosDeLaPizzza) } @IBAction func btnGruesa() { datosDeLaPizzza.tipoMasa = "Gruesa" pushControllerWithName("viewQueso", context: datosDeLaPizzza) } }
[ 284834, 282370, 282340, 282404, 282313, 282380, 282412, 282350, 282322, 282419, 282359, 282394, 282331 ]
1fbda922bf43aa3242df7f1f413c5af987ff2ff9
c0d7448a4a73948b2d951a4960cd32fd7247a733
/Feedmin/Feedmin/IndividualArticleViewController.swift
ad44226cbb026b6eb761a5f3c92f958b65b2423e
[]
no_license
togamin/NewFeedmin
6908b3b3a8bf1e2846cd23bd7c8f8f7a1c7a48b2
786c84bab2cbe96e82f131b9c52dffc46514ceb9
refs/heads/master
2020-03-21T04:36:33.470760
2018-08-15T09:56:53
2018-08-15T09:56:53
138,117,729
0
0
null
null
null
null
UTF-8
Swift
false
false
4,563
swift
// // IndividualArticleViewController.swift // Feedmin // // Created by Togami Yuki on 2018/08/11. // Copyright © 2018 Togami Yuki. All rights reserved. // import UIKit import WebKit import GoogleMobileAds class IndividualArticleViewController: UIViewController,GADBannerViewDelegate { @IBOutlet weak var progresss: UIProgressView! @IBOutlet weak var IndividualArticleWebView: WKWebView! var link:String! // Shareボタン var shareBtn: UIBarButtonItem! // AdMob(アドセンス) let AdMobID = "ca-app-pub-6754000737510695/2034002134" let TestID = "ca-app-pub-3940256099942544/2934735716" // for test // Your TestDevice ID let DEVICE_ID = "FOSFMRTB216QH9IIKCG5RMUOI" let AdMobTest:Bool = false let SimulatorTest:Bool = false var admobView: GADBannerView = GADBannerView() var tabbarheight:CGFloat! override func viewDidLoad() { super.viewDidLoad() // shareBtnを設置 self.shareBtn = UIBarButtonItem(barButtonSystemItem: .action, target: self, action:"articleShare") self.navigationItem.rightBarButtonItem = self.shareBtn //監視の設定(progressView) self.IndividualArticleWebView.addObserver(self, forKeyPath: "loading", options: .new, context: nil) self.IndividualArticleWebView.addObserver(self, forKeyPath: "estimatedProgress", options: .new, context: nil) print("テストテスト") if let url = URL(string: self.link){ let request = URLRequest(url:url) self.IndividualArticleWebView.load(request) } //広告の表示 print("広告コード開始") //スクリーンサイズの取得 let myBoundSize: CGSize = UIScreen.main.bounds.size let customAdSize = GADAdSizeFromCGSize(CGSize(width: myBoundSize.width, height: 60)) self.admobView = GADBannerView(adSize:customAdSize) self.admobView.frame.size = CGSize(width: myBoundSize.width, height: self.admobView.frame.height) self.admobView.adUnitID = AdMobID if AdMobTest { self.admobView.adUnitID = TestID } else{ self.admobView.adUnitID = AdMobID } self.admobView.delegate = self self.admobView.rootViewController = self let admobRequest:GADRequest = GADRequest() if AdMobTest { if SimulatorTest { admobRequest.testDevices = [kGADSimulatorID] } else { admobRequest.testDevices = [DEVICE_ID] } } self.admobView.load(admobRequest) self.IndividualArticleWebView.addSubview(admobView) print("広告コード終了") } override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() self.tabbarheight = tabBarController?.tabBar.frame.size.height self.admobView.frame.origin = CGPoint(x: 0, y: self.IndividualArticleWebView.frame.size.height - self.admobView.frame.height/* - tabbarheight!*/) } override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { if keyPath == "estimatedProgress"{ //estimatedProgressが変更されたときに、setProgressを使ってプログレスバーの値を変更する。 self.progresss.setProgress(Float(self.IndividualArticleWebView.estimatedProgress), animated: true) }else if keyPath == "loading"{ UIApplication.shared.isNetworkActivityIndicatorVisible = self.IndividualArticleWebView.isLoading if self.IndividualArticleWebView.isLoading { self.progresss.setProgress(0.1, animated: true) }else{ //読み込みが終わったら0に self.progresss.setProgress(0.0, animated: false) } } } @objc func articleShare() { let controller = UIActivityViewController(activityItems: [URL(string: self.link)], applicationActivities:nil) //iPadでエラーが出ないようにする controller.popoverPresentationController?.sourceView = self.view self.present(controller, animated: true,completion:nil) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ -1 ]
a2911346249a3a80a688f14faa0f581be1068346
de9b4e531a45cc95965650afb02fff3875bcf160
/WinIt/Constants/Global.swift
3bbe4ec0e24e190bfac8d2ce83dbdcea2b60444e
[]
no_license
toger5/WinIt
aff01118b6b32ca63ba1a6be73dca7c7d9e1fd83
839123be92afeec566c5be040592d1cf17bf9db7
refs/heads/master
2021-01-19T02:38:13.499820
2016-07-12T23:20:39
2016-07-12T23:20:39
62,668,944
4
1
null
2016-07-12T23:31:31
2016-07-05T20:52:58
Swift
UTF-8
Swift
false
false
312
swift
// // Global.swift // WinIt // // Created by Timo on 08/07/16. // Copyright © 2016 Timo. All rights reserved. // import Foundation class Global { static var timeOffset: Double = 0.0 static func getTimeStamp() -> Double { return NSDate().timeIntervalSince1970 + timeOffset } }
[ -1 ]
45f56250e81151c2671d2a19789b47ec4407c770
00b996394fb67bd214b17b1e7c748efb95fdc417
/Tasty Fridge!/Custom Classes/FoodCategoryPicker.swift
19b6746939ab91904103a9526b130854aba99fc8
[]
no_license
ArtyomGrigoryan/Tasty-Fridge
3c142086c80c5656587c99c3728eb825746c67d1
30acc31ac5a8109503eb46ca31048f8e403b7be7
refs/heads/master
2022-08-12T07:19:39.633812
2022-07-28T09:32:31
2022-07-28T09:32:31
184,703,200
0
0
null
null
null
null
UTF-8
Swift
false
false
1,419
swift
// // FoodCategoryPicker.swift // Tasty Fridge! // // Created by Артем Григорян on 21/04/2019. // Copyright © 2019 Artyom Grigoryan. All rights reserved. // import UIKit class FoodCategoryPicker: UIPickerView { let foodCategoryPickerData = CoreDataHelper.sharedInstance.fetchFoodCategories() var textFieldForFoodCategoryId: UITextField? var textField: UITextField? func setTextField(textField: UITextField) { self.textField = textField } func setTextFieldForFoodCategoryId(textField: UITextField) { self.textFieldForFoodCategoryId = textField } } extension FoodCategoryPicker: UIPickerViewDataSource { func numberOfComponents(in pickerView: UIPickerView) -> Int { return 1 } func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { return foodCategoryPickerData.count } } extension FoodCategoryPicker: UIPickerViewDelegate { func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { return foodCategoryPickerData[row].name! } func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { self.textField?.text = foodCategoryPickerData[row].name! self.textFieldForFoodCategoryId?.text = String(describing: foodCategoryPickerData[row].id) } }
[ -1 ]
9953b5e3dc2251d433e7426ff8858e2b8b750966
53d1f55449b750a23325539fa221e0447749062c
/RiotSwiftUI/Modules/Room/UserSuggestion/ViewModel/UserSuggestionViewModel.swift
3d7dca491660acbedebb539d6d91524339b9acad
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
rajatpagare/element-ios
18aeeb74296831e761f6428144a68fa33a9325d1
1126e5f9a6b12b9de9c8aadfe5f1733de8c94f89
refs/heads/develop
2023-08-12T09:09:10.245694
2021-10-15T08:13:43
2021-10-15T08:13:43
417,834,314
0
0
Apache-2.0
2021-10-16T15:00:58
2021-10-16T13:19:30
null
UTF-8
Swift
false
false
3,178
swift
// File created from SimpleUserProfileExample // $ createScreen.sh Room/UserSuggestion UserSuggestion // // Copyright 2021 New Vector Ltd // // 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 SwiftUI import Combine @available(iOS 14, *) typealias UserSuggestionViewModelType = StateStoreViewModel <UserSuggestionViewState, UserSuggestionStateAction, UserSuggestionViewAction> @available(iOS 14, *) class UserSuggestionViewModel: UserSuggestionViewModelType, UserSuggestionViewModelProtocol { // MARK: - Properties // MARK: Private private let userSuggestionService: UserSuggestionServiceProtocol // MARK: Public var completion: ((UserSuggestionViewModelResult) -> Void)? // MARK: - Setup static func makeUserSuggestionViewModel(userSuggestionService: UserSuggestionServiceProtocol) -> UserSuggestionViewModelProtocol { return UserSuggestionViewModel(userSuggestionService: userSuggestionService) } private init(userSuggestionService: UserSuggestionServiceProtocol) { self.userSuggestionService = userSuggestionService super.init(initialViewState: Self.defaultState(userSuggestionService: userSuggestionService)) setupItemsObserving() } private func setupItemsObserving() { let updatePublisher = userSuggestionService.items .map(UserSuggestionStateAction.updateWithItems) .eraseToAnyPublisher() dispatch(actionPublisher: updatePublisher) } private static func defaultState(userSuggestionService: UserSuggestionServiceProtocol) -> UserSuggestionViewState { let viewStateItems = userSuggestionService.items.value.map { suggestionItem in return UserSuggestionViewStateItem(id: suggestionItem.userId, avatar: suggestionItem, displayName: suggestionItem.displayName) } return UserSuggestionViewState(items: viewStateItems) } // MARK: - Public override func process(viewAction: UserSuggestionViewAction) { switch viewAction { case .selectedItem(let item): completion?(.selectedItemWithIdentifier(item.id)) } } override class func reducer(state: inout UserSuggestionViewState, action: UserSuggestionStateAction) { switch action { case .updateWithItems(let items): state.items = items.map({ item in UserSuggestionViewStateItem(id: item.userId, avatar: item, displayName: item.displayName) }) } } }
[ -1 ]
79f55dd1e0fc53dd62d021655959e48d8fd56ab4
ddf10ce369cd2c3e0f9d7fcab12208d5cb3e5ca9
/News/NewsDetailsModule/NewsDetailViewController.swift
22b8d19dd67c72056b268f62addcc7c4ceba8120
[]
no_license
Bananzaaa/News
a1b7f3127df80c0ab4c7dec5c4b5f48b06b830bd
9b43ec4826686d08c8b6e66168237d34b2ba77a3
refs/heads/main
2023-02-18T17:42:26.211336
2021-01-10T07:47:33
2021-01-10T07:47:33
327,278,512
0
0
null
null
null
null
UTF-8
Swift
false
false
1,868
swift
// // NewsDetailViewController.swift // News // // Created by Ацкий Станислав on 06.01.2021. // import UIKit class NewsDetailViewController: UITableViewController { // MARK: - UI @IBOutlet private weak var sourceLabel: UILabel! @IBOutlet private weak var dateLabel: UILabel! @IBOutlet private weak var titleLabel: UILabel! @IBOutlet private weak var imageView: UIImageView! @IBOutlet private weak var descriptionLabel: UILabel! @IBOutlet private weak var spinner: UIActivityIndicatorView! // MARK: - Public var newsItem: NewsItem? // MARK: - Lifecycle override func viewDidLoad() { super.viewDidLoad() title = "Detail" configureUI(with: newsItem) tableView.separatorStyle = .none } // MARK: - Helpful private func configureUI(with item: NewsItem?) { sourceLabel?.text = item?.source?.capitalized dateLabel?.text = item?.date?.formatDate titleLabel?.text = item?.title descriptionLabel?.text = item?.description imageView?.image = UIImage(named: "placeholder") if let stringURL = item?.imageURL { spinner.startAnimating() DispatchQueue.global(qos: .userInitiated).async { if let url = URL(string: stringURL), let data = try? Data(contentsOf: url) { DispatchQueue.main.async { [weak self] in self?.spinner.stopAnimating() self?.imageView?.image = UIImage(data: data) } } } } } // MARK: - TableView Datasource override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return UITableView.automaticDimension } }
[ -1 ]
d7ece590c896e74cbfdffec3a0b7f39ec815b427
44f9ca0e52de7f39ec82d291e720743551c1b1f0
/Tests/SketchKitTests/UILayoutGuide/UILayoutGuide+CenterAnchorTests.swift
ccded0342a53f16ec4f355c5a282168bd1fb763a
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
dogo/SketchKit
114e3bca84efcfd75ea285175b98f7e47403ae23
ce6863760b11f719aa9b326bcd2442d4869e5989
refs/heads/develop
2023-08-16T11:21:36.500728
2023-04-30T14:24:31
2023-04-30T14:24:31
212,876,564
54
11
MIT
2023-01-10T21:27:38
2019-10-04T18:14:07
Swift
UTF-8
Swift
false
false
2,000
swift
// // UILayoutGuide+CenterAnchorTests.swift // SketchKitTests // // Created by Diogo Autilio on 17/10/20. // import XCTest @testable import SketchKit final class UILayoutGuide_CenterAnchorTests: XCTestCase { private var scrollView: UIScrollView! override func setUp() { super.setUp() self.scrollView = UIScrollView() } override func tearDown() { super.tearDown() self.scrollView = nil } // MARK: - CenterXAnchor equalTo func testCenterXAnchor() { let containerLayoutGuide = UILayoutGuide() scrollView.addLayoutGuide(containerLayoutGuide) containerLayoutGuide.layout.applyConstraint { guide in guide.centerXAnchor(equalTo: scrollView.centerXAnchor, constant: 10) } let constraints = self.scrollView.constraints XCTAssertEqual(constraints.count, 1, "Should have 1 constraint installed") XCTAssertEqual(constraints[0].constant, 10, "Should be 10") XCTAssertEqual(constraints[0].firstAttribute, .centerX, "Should be centerX") XCTAssertEqual(constraints[0].relation, .equal, "Should be equal") } // MARK: - CenterYAnchor equalTo func testCenterYAnchorTests() { let containerLayoutGuide = UILayoutGuide() scrollView.addLayoutGuide(containerLayoutGuide) containerLayoutGuide.layout.applyConstraint { guide in guide.centerYAnchor(equalTo: scrollView.centerYAnchor, constant: 10) } let constraints = self.scrollView.constraints XCTAssertEqual(constraints.count, 1, "Should have 1 constraint installed") XCTAssertEqual(constraints[0].constant, 10, "Should be 10") XCTAssertEqual(constraints[0].firstAttribute, .centerY, "Should be centerY") XCTAssertEqual(constraints[0].relation, .equal, "Should be equal") } static var allTests = [ ("testCenterXAnchor", testCenterXAnchor), ("testCenterXAnchor", testCenterXAnchor) ] }
[ -1 ]
495c442594933fbc95f179b6740587c6fc51b459
779b5b301e6ec6e3f7257b91661c1f30f34aaea1
/BestBrain/BestBrain/MVC/Cell/MatchesDetailCell.swift
702013886b862c6760f120915a91b35965e46053
[]
no_license
chetanrathore/bestbrain
58fc367b052e1b300a46e897bc3565286d0ce78d
777afa1666f7b3fdf317624e2976ca7e19781fbe
refs/heads/master
2021-01-12T02:20:01.666531
2017-02-22T12:56:09
2017-02-22T12:56:09
78,501,660
0
0
null
2017-02-22T12:56:10
2017-01-10T05:44:18
Swift
UTF-8
Swift
false
false
678
swift
// // MatchesDetailCell.swift // BestBrain // // Created by sparth on 2/8/17. // Copyright © 2017 bestbrainLLC. All rights reserved. // import UIKit class MatchesDetailCell: UITableViewCell { @IBOutlet var imgUser: UIImageView! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } func setCellInterface() { imgUser.layer.cornerRadius = self.imgUser.frame.width/2 imgUser.clipsToBounds = true } }
[ 314697, 179594, 135815 ]
b0ab8dae3e8b8ba5c7619fcfb259e186dbed56cb
128525d1fd092b768805259fc4e8885a3802b8b5
/Sources/AWSSDKSwift/Services/MediaStoreData/MediaStoreData_API.swift
78185c88b3e2ce059980d481f5e3a55d92fa5e0e
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
timokoenig/aws-sdk-swift
881e515dec00645c8025ac0da017750e441685f2
49790f389848b632fd32faf40d92f755bf235a91
refs/heads/master
2020-05-07T22:26:56.944094
2019-03-12T00:32:46
2019-03-12T00:32:46
180,945,446
0
0
Apache-2.0
2019-04-12T06:34:16
2019-04-12T06:34:16
null
UTF-8
Swift
false
false
2,357
swift
// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/noppoMan/aws-sdk-swift/blob/master/Sources/CodeGenerator/main.swift. DO NOT EDIT. import Foundation import AWSSDKSwiftCore /** An AWS Elemental MediaStore asset is an object, similar to an object in the Amazon S3 service. Objects are the fundamental entities that are stored in AWS Elemental MediaStore. */ public struct MediaStoreData { let client: AWSClient public init(accessKeyId: String? = nil, secretAccessKey: String? = nil, region: AWSSDKSwiftCore.Region? = nil, endpoint: String? = nil) { self.client = AWSClient( accessKeyId: accessKeyId, secretAccessKey: secretAccessKey, region: region, service: "data.mediastore", serviceProtocol: ServiceProtocol(type: .restjson), apiVersion: "2017-09-01", endpoint: endpoint, middlewares: [], possibleErrorTypes: [MediaStoreDataErrorType.self] ) } /// Uploads an object to the specified path. Object sizes are limited to 25 MB. public func putObject(_ input: PutObjectRequest) throws -> PutObjectResponse { return try client.send(operation: "PutObject", path: "/{Path+}", httpMethod: "PUT", input: input) } /// Gets the headers for an object at the specified path. public func describeObject(_ input: DescribeObjectRequest) throws -> DescribeObjectResponse { return try client.send(operation: "DescribeObject", path: "/{Path+}", httpMethod: "HEAD", input: input) } /// Provides a list of metadata entries about folders and objects in the specified folder. public func listItems(_ input: ListItemsRequest) throws -> ListItemsResponse { return try client.send(operation: "ListItems", path: "/", httpMethod: "GET", input: input) } /// Deletes an object at the specified path. public func deleteObject(_ input: DeleteObjectRequest) throws -> DeleteObjectResponse { return try client.send(operation: "DeleteObject", path: "/{Path+}", httpMethod: "DELETE", input: input) } /// Downloads the object at the specified path. public func getObject(_ input: GetObjectRequest) throws -> GetObjectResponse { return try client.send(operation: "GetObject", path: "/{Path+}", httpMethod: "GET", input: input) } }
[ -1 ]
bc463804f7076651e7aca11b70f83d307f5a642a
b9a0773757f241f484a36d02070ce2c6201f3fe3
/Sources/BitBar/Global.swift
013e1be7c2776ebc8ca27c718378a87ba1af188d
[ "MIT" ]
permissive
oleander/bitbar
e240eeb45c5a3f7c5b6eca6cc6627070345e0418
2fe4d295b955280de9aa7904d54789c136c85f16
refs/heads/master
2021-01-13T12:08:28.168813
2017-07-04T19:30:50
2017-07-04T19:30:50
77,517,263
44
7
null
2016-12-28T08:40:56
2016-12-28T08:40:56
null
UTF-8
Swift
false
false
275
swift
import Cocoa func notify(text: String, subtext: String? = nil) { let alert = NSAlert() alert.messageText = text if let sub = subtext { alert.informativeText = sub } alert.display() } func bug(_ msg: String) -> Never { preconditionFailure("[Bug] " + msg) }
[ -1 ]
7e1f3a3f73d792a9ed8d88e399b47b3bcf264715
92825c67a0afd4188fc54fdb36400d272566c5b7
/Metal 3.0/Metal 3.0/RMXValue.swift
839b24452ff6f138ae02ba54fae30358113cf772
[]
no_license
maxbilbow/RattleGL
7ee57574e06bf05cfd13513e2145981b745ef121
06b0fe76920cf9137b762f66749cd300389651a9
refs/heads/master
2021-01-01T16:00:28.086047
2015-03-20T17:20:18
2015-03-20T17:20:18
30,997,400
0
0
null
null
null
null
UTF-8
Swift
false
false
2,200
swift
// // RMXCoreExtensions.swift // OC to Swift oGL // // Created by Max Bilbow on 17/02/2015. // Copyright (c) 2015 Rattle Media Ltd. All rights reserved. // import Foundation //import SceneKit import UIKit class RMXValue<T: Comparable> { // var n: NSValue = 0 class func isNegative(n:Int) -> Bool { return n < 0 } class func isNegative(n:Float) -> Bool { return n < 0 } class func isNegative(n:Double) -> Bool { return n < 0 } class func isNegative(n:T) -> Bool { return false } class func toData(sender:T, dp:String) -> String { // func isNegative(n:Double) -> Bool { // return n < 0.0 // } //switch sender var s: String = "" if sender is Int { //s = isNegative(sender as Int) ? "" : " " s += NSString(format: "\(s)%\(dp)i",sender as Int) } else if (sender is Float) { //s = isNegative(sender as Float) ? "" : " " s += NSString(format: "\(s)%\(dp)f",sender as Float) } else if (sender is CGFloat) { //s = isNegative(sender as Float) ? "" : " " s += NSString(format: "\(s)%\(dp)f",sender as CGFloat) }else if sender is Double { //s = isNegative(sender as Double) ? "" : " " s += NSString(format: "\(s)%\(dp)f",sender as Double) } else { s = "ERROR: number is not Int, Foat of Double. " } return s } } extension Int { func toData(dp:String="05") -> String { return RMXValue.toData(self, dp: dp)///NSString(format: "%.\(dp)f", self) } } extension Float { func toData(dp:String="05.2") -> String { return RMXValue.toData(self, dp: dp)///NSString(format: "%.\(dp)f", self) } } extension CGFloat { func toData(dp:String="05.2") -> String { return RMXValue.toData(self, dp: dp)///NSString(format: "%.\(dp)f", self) } } extension Double { func toData(dp:String="05.2") -> String { return RMXValue.toData(self, dp: dp) } // var cgFloat: CGFloat { // let f: CGFloat(self) // return f // } }
[ -1 ]
f066b606f4b2d3c1d0331e07dc984896da07192b
d8914a34b68048cfd933f8b2b5d0e53b7ff39ef0
/Student Resources/5 - Working With the Web/6 - WWW Concurrency/lab/iTunesSearch/iTunesSearch/StoreItemListTableViewController.swift
74c907234d2ea415a89eb1db3616e8ccdacbb7a2
[]
no_license
samalex1014/App-Dev-with-Swift
9b3720a0827f930a13f3a863762039d28f436348
e7c1923a78cad1b84c8b91c0a63291111f056083
refs/heads/master
2020-04-11T12:52:47.706669
2019-01-03T15:25:49
2019-01-03T15:25:49
161,795,259
0
0
null
null
null
null
UTF-8
Swift
false
false
3,164
swift
import UIKit class StoreItemListTableViewController: UITableViewController { var storeItemController = StoreItemController() @IBOutlet weak var searchBar: UISearchBar! @IBOutlet weak var filterSegmentedControl: UISegmentedControl! // add item controller property var items = [StoreItem]() let queryOptions = ["movie", "music", "software", "ebook"] override func viewDidLoad() { super.viewDidLoad() } func fetchMatchingItems() { self.items = [] self.tableView.reloadData() let searchTerm = searchBar.text ?? "" let mediaType = queryOptions[filterSegmentedControl.selectedSegmentIndex] if !searchTerm.isEmpty { // set up query dictionary let query: [String: String] = ["term":searchTerm, "media":mediaType] // use the item controller to fetch items // if successful, use the main queue to set self.items and reload the table view // otherwise, print an error to the console self.storeItemController.fetchItems(matching: query) { (storeItems) in guard let reses = storeItems else { print("FATAL ERROR") return } DispatchQueue.main.async { self.items = reses self.tableView.reloadData() } } } } func configure(cell: UITableViewCell, forItemAt indexPath: IndexPath) { let item = items[indexPath.row] cell.textLabel?.text = item.trackName cell.detailTextLabel?.text = item.artistName // set label to the item's name // set detail label to the item's subtitle // reset the image view to the gray image // initialize a network task to fetch the item's artwork // if successful, use the main queue capture the cell, to initialize a UIImage, and set the cell's image view's image to the // resume the task } @IBAction func filterOptionUpdated(_ sender: UISegmentedControl) { fetchMatchingItems() } // MARK: - Table view data source override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return items.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "itemCell", for: indexPath) configure(cell: cell, forItemAt: indexPath) return cell } // MARK: - Table view delegate override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: true) } } extension StoreItemListTableViewController: UISearchBarDelegate { func searchBarSearchButtonClicked(_ searchBar: UISearchBar) { fetchMatchingItems() searchBar.resignFirstResponder() } }
[ -1 ]
df39a780b5050c854b67bd552b71d064647a1324
9c117b1377e663508b6b053cdfb094618828e8b1
/DeliveryApp/Domain/Entities/Response/DeliverItem.swift
30a966e8d870c6b20173c037b56553168666c0d0
[]
no_license
farhad1985/DeliveryApp
d44edd43c238455f3180f54f5c2769ce33d601a3
80478bec8258c8d8eccd4a9d12c81b335c3d5ec6
refs/heads/master
2023-08-24T15:43:53.089577
2021-02-21T17:08:50
2021-02-21T17:08:50
340,818,317
2
0
null
null
null
null
UTF-8
Swift
false
false
1,107
swift
// // a.swift // Domain // // Created by Farhad on 2/19/21. // import ObjectMapper struct DeliverItem: Mappable { var id, remarks: String? var pickupTime: Date? var goodsPicture: String? var deliveryFee: String = "" var surcharge: String = "" var route: Route? var sender: Sender? var isFavorite = false var fee: String { let deliveryFeePrice = getPrice(fee: deliveryFee) let surchargePrice = getPrice(fee: surcharge) let sum = deliveryFeePrice + surchargePrice return String(format: "%0.2f", sum) } init() {} init?(map: Map) {} mutating func mapping(map: Map) { id <- map["id"] remarks <- map["remarks"] pickupTime <- map["pickupTime"] goodsPicture <- map["goodsPicture"] deliveryFee <- map["deliveryFee"] surcharge <- map["surcharge"] route <- map["route"] sender <- map["sender"] } private func getPrice(fee: String) -> Double { return Double(fee.replacingOccurrences(of: "$", with: "")) ?? 0 } }
[ -1 ]
9ee4e04de09509b47000db7de333704ebb7dc948
daad9f8cb59372e5724457e58599d22a1ea7d1b2
/Pet-Dynamic-Form/Controllers/PageViewController.swift
9938e90aaa1924df73dbfa5141ce7ce75e4ea0e0
[]
no_license
Achemsamuel/Pet-Adoption-Application-Form
8fa70289aac22b912d8937ad59fa5e3417cd25cb
96359432515a93ed3dbc1a99c60623e32f36b972
refs/heads/master
2020-06-17T15:27:40.355398
2019-07-09T08:19:39
2019-07-09T08:19:39
195,963,854
0
0
null
null
null
null
UTF-8
Swift
false
false
14,765
swift
// // PageViewController.swift // Pet-Dynamic-Form // // Created by Achem Samuel on 7/7/19. // Copyright © 2019 Achem Samuel. All rights reserved. // import UIKit import SnapKit class PageViewController: UIViewController { let label: String let section: [Section] let sectionLabel : UILabel = UILabel() var datePicker : UIDatePicker? var dateTextField = UITextField() let scrollView = UIScrollView() let stackView = UIStackView() var textFieldArray : [UITextField] = [UITextField]() var formattedNumTextArray : [UITextField] = [UITextField]() var dateFieldArray : [UITextField] = [UITextField]() lazy var pagesCount = 0 override func viewDidLoad() { super.viewDidLoad() let tapGesture = UITapGestureRecognizer(target: self, action: #selector(viewTapped)) view.addGestureRecognizer(tapGesture) } @objc func viewTapped () { view.endEditing(true) } init(label: String, sections : [Section]) { self.label = label self.sectionLabel.text = label self.section = sections super.init(nibName: nil, bundle: nil) scrollViewSetup() self.stackView.addArrangedSubview(self.sectionLabel) for i in 0 ..< sections.count { getSections(no: i) getElements(no: i) } addSubmitButton(label : label) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } /*------------------------------- Mark: Get Sections Methods -------------------------------*/ func getSections (no : Int) { let thisSection = section[no].label let sectionsLabel = UILabel() sectionsLabel.text = thisSection print(sectionsLabel.text!) let labelView = views.addLabel(label: thisSection ?? "", view: view) self.stackView.addArrangedSubview(labelView) } /*------------------------------- Mark: Get Elements Methods -------------------------------*/ lazy var target = [String]() lazy var isHiddenState = Bool() lazy var hiddenField = UITextField() var mySwitch : UISwitch? func getElements (no : Int) { for i in (section[no].elements)! { print("All targets \(target)") switch i.type { case "embeddedphoto": createImageView(imageUrl: i.file ?? "no image url") case "text": if i.isMandatory == true { let mandatoryTextField = createTextView(placeholder: i.label ?? "", uniqueID: i.unique_id ?? "") mandatoryTextField.requiredField() self.textFieldArray.append(mandatoryTextField) for k in target { if (k == i.unique_id) { self.hiddenField = getTargetElement(textField: mandatoryTextField) } } } else { let field = createTextView(placeholder: i.label ?? "", uniqueID: i.unique_id ?? "") for k in target { if (k == i.unique_id) { self.hiddenField = getTargetElement(textField: field) } } } case "formattednumeric": if i.isMandatory == true { let mandatoryPhoneField = createFormattedNumericView() mandatoryPhoneField.requiredField() self.formattedNumTextArray.append(mandatoryPhoneField) } else { _ = createFormattedNumericView() } case "datetime": if i.isMandatory == true { let mandatoryDateField = createDateView() mandatoryDateField.requiredField() self.dateFieldArray.append(mandatoryDateField) } else { _ = createDateView() } case "yesno": createLabel(title: i.label ?? "no label for target") self.mySwitch = createYesNoSwitch(label: i.label ?? "") var action = "" var otherwise = "" if i.rules?.isEmpty == false { _ = i.rules?.map({ (key) -> String in self.target = key.target ?? ["Nothing here"] action = key.action ?? "" otherwise = key.otherwise ?? "" print(target, action, otherwise) return key.action! }) } default: print("") } } } func isDependent (element : Element) -> Bool { if element.rules?.isEmpty == false { return true } return false } func getTargetElement (textField : UITextField) -> UITextField { textField.isHidden = true return textField } @objc func switchChanged(sender: UISwitch!) -> Bool { print("Switch value is \(sender.isOn)") if sender.isOn { self.hiddenField.isHidden = false return true } else { self.hiddenField.isHidden = true return false } } /*------------------------------- Mark: Get View Methods -------------------------------*/ let views = Views() func createImageView (imageUrl : String) { let imageView = views.embedPhoto(fileUrl: imageUrl, view: view, y: 0) self.stackView.addArrangedSubview(imageView) } func createTextView (placeholder : String, uniqueID: String) -> UITextField { let textView = views.addTextField(label: placeholder, view: view, y: 0, uniqueID: uniqueID) self.stackView.addArrangedSubview(textView) return textView } func createFormattedNumericView () -> UITextField { let phoneInputView = views.addFormattedNumberField(label: "phone", view: view, y: 0) self.stackView.addArrangedSubview(phoneInputView) return phoneInputView } func createDateView () -> UITextField { let dateTimeView = addDateTimeField(label: "date", view: view, y: 0) self.stackView.addArrangedSubview(dateTimeView) dateTextField = dateTimeView return dateTimeView } func createYesNoSwitch (label : String) -> UISwitch { let yesNo = addSwitch(view: view, label: label) self.stackView.addArrangedSubview(yesNo) return yesNo } func createLabel (title : String) { let label = views.addLabel(label: title, view: view) self.stackView.addArrangedSubview(label) } func addSubmitButton (label : String) { self.getPageCount() let pageTag = label.filter("0123456789".contains) let currentPageNumber = self.stringToInt(value: pageTag) if (currentPageNumber == self.pagesCount) { let submitButton = views.submitButton() submitButton.addTarget(self, action: #selector(valaidate), for: .touchUpInside) stackView.addArrangedSubview(submitButton) } } func addSwitch (view : UIView, label : String) -> UISwitch { let toggleSwitch = UISwitch() toggleSwitch.center = view.center toggleSwitch.setOn(false, animated: false) toggleSwitch.tintColor = .red toggleSwitch.onTintColor = .flatGreenDark //mySwitch.thumbTintColor = UIColor(hexString: "7e57c2") toggleSwitch.thumbTintColor = .gray toggleSwitch.addTarget(self, action: #selector(switchChanged(sender:)), for: UIControl.Event.valueChanged) return toggleSwitch } /*------------------------------- Get Page Count -------------------------------*/ func getPageCount () { let parseJson = Parsejson() parseJson.getPetJsonData { (response) in if let pagesN = response.pages?.count { self.pagesCount = pagesN } } } //Convert String to Int func stringToInt (value : String) -> Int { if let newValue : Int = Int(value) { return newValue } else { return 0 } } /*------------------------------- Mark: Validation -------------------------------*/ @objc func valaidate() { let validationKey = validateFields(textArray: textFieldArray, phoneFIeldArray: formattedNumTextArray, dateFieldArray: dateFieldArray) if validationKey { print("All fields validated") successfulAlert() } else { print("Some required fields are missing") missingFieldsAlert() } } func validateFields (textArray : [UITextField], phoneFIeldArray : [UITextField], dateFieldArray : [UITextField]) -> Bool { //TextArray for field in textArray { if (field.text?.isEmpty == true && field.text!.count < 5) { print("You have not filled this correctly") return false } } for field in phoneFIeldArray { if (field.text?.isEmpty == true && field.text!.count < 11 && field.text!.count > 11) { print("You did not enter a valid phone number") inputCorrectNumber() return false } } for field in dateFieldArray { if (field.text?.isEmpty == true) { print("Select the proper date") return false } } return true } } /*------------------------------- Mark: ScrollView Delegate Methods -------------------------------*/ extension PageViewController : UIScrollViewDelegate { func scrollViewDidScroll(_ scrollView: UIScrollView) { } } /*------------------------------- Mark: ScrollView Setup Methods -------------------------------*/ extension PageViewController { func scrollViewSetup () { self.view.addSubview(self.scrollView) self.scrollView.translatesAutoresizingMaskIntoConstraints = false //Constrain scroll view self.scrollView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: 20).isActive = true self.scrollView.topAnchor.constraint(equalTo: self.view.topAnchor, constant: 100).isActive = true self.scrollView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: -20).isActive = true self.scrollView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor, constant: -20).isActive = true //********* self.scrollView.addSubview(self.stackView) self.stackView.translatesAutoresizingMaskIntoConstraints = false self.stackView.axis = .vertical self.stackView.spacing = 40 self.stackView.distribution = .equalSpacing self.stackView.backgroundColor = .blue //constrain stack view to scroll view self.stackView.leadingAnchor.constraint(equalTo: self.scrollView.leadingAnchor).isActive = true self.stackView.topAnchor.constraint(equalTo: self.scrollView.topAnchor).isActive = true self.stackView.trailingAnchor.constraint(equalTo: self.scrollView.trailingAnchor).isActive = true self.stackView.bottomAnchor.constraint(equalTo: self.scrollView.bottomAnchor, constant: -50).isActive = true //constrain width of stack view to width of self.view, NOT scroll view self.stackView.widthAnchor.constraint(equalTo: self.scrollView.widthAnchor).isActive = true } } /*------------------------------- Mark: Date Setup Methods -------------------------------*/ extension PageViewController { @objc func dateChanged (datePicker: UIDatePicker, textField: UITextField, view : UIView) { let dateFormatter = DateFormatter() dateFormatter.dateFormat = "dd-MM-yyyy" dateTextField.text = dateFormatter.string(from: datePicker.date) viewTapped() } func datePickers (textField: UITextField) { datePicker = UIDatePicker() datePicker?.datePickerMode = .date textField.inputView = datePicker datePicker?.addTarget(self, action: #selector(PageViewController.dateChanged(datePicker:textField:view:)), for: .valueChanged) datePicker?.backgroundColor = .white } func addDateTimeField (label : String, view : UIView, y: Int) -> UITextField { let dateField : UITextField = UITextField(frame: (CGRect(x: 30, y: y, width: Int(view.frame.width - 60), height: 30))) //dateField.setPadding(forLeft: 20, forRight: 20) dateField.placeholder = label dateField.minimumFontSize = 0.3 dateField.adjustsFontSizeToFitWidth = true dateField.borderStyle = .roundedRect datePickers(textField: dateField) return dateField } } /* Alerts */ extension PageViewController { func missingFieldsAlert () { let alert = UIAlertController(title: "Missing Fields!", message: "Some required fields are empty or improperly filled. \n Please go back and fill them correctly", preferredStyle: .alert) alert.addAction(UIAlertAction(title: "Back", style: .destructive, handler: nil)) self.present(alert, animated: true) } func successfulAlert () { let alert = UIAlertController(title: "Successful", message: "Thank you for submitting an application, we will get back to you shortly", preferredStyle: .alert) alert.addAction(UIAlertAction(title: "Done", style: .default, handler: nil)) self.present(alert, animated: true) } func inputCorrectNumber () { let alert = UIAlertController(title: "Incorrect Number", message: "Please input a correct phone number", preferredStyle: .actionSheet) alert.addAction(UIAlertAction(title: "Done", style: .default, handler: nil)) self.present(alert, animated: true) } }
[ -1 ]
f5fcf557bee18c775de3a4068dcaec80394d4a65
a9ff0753cddf66c63a4d4c919d42981d885aaad7
/task2_generic_api_client/Domain/Employer.swift
9f108b324fb521032b5666e840883e997e3f0dc6
[ "MIT" ]
permissive
coldsteelbr/task2_generic_api_client
b8e933735e0a134b71d7988de213070ab556f6f3
bd002a1513c5c2722dd55f9b7c8b67cd3b858552
refs/heads/master
2020-03-21T12:41:38.309557
2018-07-01T20:26:13
2018-07-01T20:26:13
138,566,949
0
0
null
null
null
null
UTF-8
Swift
false
false
643
swift
// // Employer.swift // task2_generic_api_client // // Created by Roman Brazhnikov on 26.06.2018. // Copyright © 2018 Roman Brazhnikov. All rights reserved. // import Foundation /// Represents an employer class Employer { let name: String let description: String? let logoUrl: String? init(Name name: String, Description description: String, LogoUrl logoUrl: String?){ self.name = name self.description = description self.logoUrl = logoUrl } static func genericEmployer() -> Employer { return Employer(Name: "Generic", Description: "Employer", LogoUrl: nil) } }
[ -1 ]
f423b3168c95893adb28ebf79834460a3ab31f2e
9abbd2583f3bac17f4eb29e17cfa2b51085ff632
/Yangola/Classes/Controllers/Settings/SettingsTableViewController.swift
3b1104c6e6de4b6307b3916b5567cec59cc7e988
[]
no_license
Lasithih/Yangola
393445654283d9e9172b1406ba8069079b1f001c
9cefa77c74e18a7ef63c1c2ffa2660fb9d5850ac
refs/heads/master
2021-01-20T08:46:48.271999
2017-08-28T05:21:57
2017-08-28T05:21:57
101,574,171
0
0
null
null
null
null
UTF-8
Swift
false
false
509
swift
// // SettingsTableViewController.swift // Yangola // // Created by Lasith Hettiarachchi on 8/18/17. // Copyright © 2017 Lasith Hettiarachchi. All rights reserved. // import UIKit import InAppSettingsKit class SettingsTableViewController: IASKAppSettingsViewController { override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ 292418, 53876 ]
e0d3339bef653c493e9fd78e11bd1746e2863f03
5133c5a81b8c3bb7ed0d10a739babc58e6fd5150
/Child Labor/String+Link.swift
72f14def1c4e7873f0b188904e7e012277af36d4
[]
no_license
USDepartmentofLabor/Child-Labor
88fa8bc9846f95eae4a16b3b54dbad8a3ffea00a
d8520e86e738280419d05fda9bb8ae0b39f6c2c5
refs/heads/master
2023-08-22T14:45:03.429390
2023-08-11T15:35:47
2023-08-11T15:35:47
37,860,521
29
18
null
2023-09-14T18:03:16
2015-06-22T14:35:39
Swift
UTF-8
Swift
false
false
490
swift
// // String+Link.swift // Child Labor // // Created by Gnanendra Kumar on 23/07/21. // Copyright © 2021 U.S. Department of Labor. All rights reserved. // import Foundation extension NSMutableAttributedString { public func SetAsLink(textToFind:String, linkURL:String) { let foundRange = self.mutableString.range(of: textToFind) if foundRange.location != NSNotFound { self.addAttribute(.link, value: linkURL, range: foundRange) } } }
[ -1 ]
02ec69eba9d7addca5c3d2109852cf244ace4135
f21d0fee60300373baa445e160fc71589c08e0c3
/LTC1/WhileLoops/35_SmartWhile.swift
dcc8056da52decb900834dc37168a09d5f39c375
[]
no_license
Tyrhen/SwiftPlaygroundSolutions
26ef8f034128960e7a9b9480e47a0656ebe19b65
1c0812bc919b2627ba534dd63661edb1a21ba4be
refs/heads/master
2023-03-01T12:25:13.448456
2021-02-06T17:56:35
2021-02-06T17:56:35
317,055,183
1
0
null
null
null
null
UTF-8
Swift
false
false
103
swift
while !isOnGem && !isBlocked{ moveForward() if isOnClosedSwitch{ toggleSwitch() } }
[ -1 ]
5fcc82f79a74aef8eab51a2b679642e4751d6a05
8fd9aca9e71036294c41ff61c294ab02d8884d4c
/App_delegate/App_delegate/AppDelegate.swift
1873bf178ec77bc16e72b08f2eb3e361e963365e
[]
no_license
bjpark4002/Practice
8546a1f26537074840086ce5f1f8044f3ebeabac
7d1d15de565323f89d8be47eaaea90e50f3d7863
refs/heads/master
2020-07-21T16:45:02.492522
2020-04-18T02:10:09
2020-04-18T02:10:09
206,923,124
0
0
null
2019-09-28T09:45:39
2019-09-07T05:57:28
Swift
UTF-8
Swift
false
false
2,401
swift
// // AppDelegate.swift // App_delegate // // Created by Bumjin Park on 9/19/19. // Copyright © 2019 Bumjin Park. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. print("화면이 내려갈떄") } 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. print("백그라운드 상태") } 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. print("Enter foreground ") } 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. print("화면이 올라올때") } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. print("앱완전종료") } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 229426, 237618, 229428, 311349, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 286797, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 327814, 131209, 303241, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 319978, 279020, 172526, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 287238, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 172655, 172656, 189039, 295538, 189040, 172660, 189044, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 303773, 172702, 230045, 287390, 287394, 172705, 303780, 172707, 287398, 205479, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 279231, 287427, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 312035, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 295813, 304005, 213895, 320391, 304007, 304009, 304011, 230284, 304013, 279438, 213902, 295822, 189329, 295825, 304019, 189331, 58262, 304023, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 295949, 197645, 230413, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 279750, 312518, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 230718, 296259, 378181, 296262, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 148843, 230763, 230768, 296305, 312692, 230773, 279929, 304506, 304505, 181626, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 173488, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 222676, 288214, 280021, 239064, 288217, 329177, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 402942, 148990, 296446, 321022, 296450, 206336, 230916, 230919, 214535, 304651, 370187, 304653, 230923, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 206536, 280264, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 304968, 280393, 280402, 173907, 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, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 280671, 149599, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 313458, 280691, 215154, 149618, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 354653, 313700, 280937, 313705, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 240132, 223749, 281095, 338440, 150025, 223752, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 240519, 322440, 338823, 314249, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 298365, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282255, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 306904, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 307009, 413506, 241475, 307012, 148946, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 282465, 110433, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 217179, 315483, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 307510, 332086, 307512, 168245, 307515, 282942, 307518, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 176592, 315856, 315860, 176597, 127447, 283095, 299481, 176605, 242143, 127457, 291299, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 127490, 283142, 127494, 127497, 233994, 135689, 291341, 233998, 127506, 234003, 127509, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 315961, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 291711, 234368, 234370, 201603, 291714, 234373, 226182, 234375, 291716, 226185, 308105, 234379, 324490, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 226200, 234396, 234398, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 291754, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 226245, 234437, 234439, 234434, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 275579, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 234648, 308379, 234653, 324766, 119967, 283805, 300189, 234657, 324768, 242852, 234661, 283813, 300197, 234664, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 226500, 234692, 300229, 308420, 283844, 308422, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 300289, 292097, 300292, 300294, 275719, 300299, 177419, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 243003, 283963, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 226802, 292338, 316917, 308727, 292343, 300537, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194101, 284215, 194103, 284218, 226877, 292414, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 276052, 284245, 276053, 284247, 317015, 284249, 243290, 284251, 300628, 284253, 235097, 284255, 300638, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 284290, 325250, 284292, 292479, 276098, 292485, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 317158, 358119, 284392, 325353, 284394, 358122, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 325408, 300832, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 292681, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 227314, 276466, 325624, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 276539, 235581, 325692, 178238, 276544, 284739, 292934, 243785, 276553, 350293, 350295, 194649, 227418, 309337, 350299, 350302, 227423, 194654, 178273, 194657, 227426, 194660, 276579, 227430, 276583, 309346, 309348, 309350, 309352, 309354, 350308, 276590, 350313, 350316, 350321, 284786, 276595, 301167, 350325, 227440, 350328, 292985, 301178, 350332, 292989, 292993, 301185, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 227571, 309491, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 276789, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 6485, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 293370, 301562, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 317971, 309779, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 326321, 277170, 342707, 154292, 293555, 277173, 318132, 277177, 277181, 244415, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 15224, 236408, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 276586, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 121850, 302075, 244731, 293882, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 392326, 285831, 253064, 302218, 285835, 294026, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 294211, 302403, 384328, 277832, 277836, 294221, 326991, 294223, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 64966, 245191, 163272, 302534, 310727, 277959, 292968, 302541, 277963, 302543, 277966, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187939, 294435, 40484, 286246, 294439, 294440, 278057, 40486, 294443, 40488, 294445, 40491, 310831, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 228944, 400976, 40533, 147032, 40537, 40539, 278109, 40541, 40544, 40548, 40550, 286312, 286313, 40554, 40552, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 278227, 286420, 319187, 229076, 286425, 319194, 278235, 301163, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 188252, 237409, 294776, 360317, 294785, 327554, 40840, 40851, 294803, 188312, 294811, 319390, 294817, 319394, 40865, 294821, 311209, 180142, 294831, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
61e1f75769f58d3814e01d1545ea8c6e5e99e824
42a97f8a9ce16540431487b5c52637e84502a58c
/Hotels/AppDelegate.swift
a5bb392612bfa4064078f40408e6db3b5c143e41
[]
no_license
Rnorback/Hotels
9c6b093975b6f13e459a0e149214fa3ee3f28444
60a7658d1b69b2e1410964fcdee1400f4242640e
refs/heads/master
2016-08-12T13:53:52.173949
2016-01-08T07:06:04
2016-01-08T07:06:04
49,185,733
0
0
null
null
null
null
UTF-8
Swift
false
false
2,140
swift
// // AppDelegate.swift // Hotels // // Created by Rob Norback on 1/6/16. // Copyright © 2016 Rob Norback. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 352284, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 286797, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 278648, 131192, 237693, 327814, 131209, 417930, 303241, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 278760, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 278849, 319809, 319810, 319814, 311623, 319818, 311628, 229709, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 319978, 279020, 172526, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 287238, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 303773, 295583, 172702, 230045, 287394, 287390, 303780, 172705, 287398, 172707, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 279231, 287423, 328384, 287427, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 312035, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 222018, 295755, 377676, 148302, 287569, 279383, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 213895, 320391, 304007, 304009, 304011, 230284, 304013, 213902, 279438, 295822, 189329, 295825, 304019, 189331, 279445, 58262, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 304063, 238528, 304065, 189378, 213954, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 197645, 295949, 230413, 320528, 140312, 295961, 238620, 197663, 304164, 189479, 304170, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 279661, 205934, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 350308, 230592, 279750, 312518, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 279788, 320748, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 230718, 296259, 378181, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 304506, 304505, 181626, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 173488, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 280014, 312783, 288208, 230865, 370130, 288210, 288212, 280021, 288214, 222676, 239064, 288217, 288218, 280027, 329177, 288220, 239070, 288224, 370146, 280034, 280036, 288226, 280038, 288229, 288230, 288232, 288234, 320998, 288236, 288238, 288240, 291754, 288242, 296435, 288244, 288250, 402942, 148990, 296446, 206336, 296450, 321022, 230916, 230919, 214535, 370187, 304651, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 206536, 280264, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 304968, 280393, 280402, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 223327, 280671, 149599, 321634, 149601, 149603, 329830, 280681, 313451, 223341, 280687, 313458, 280691, 215154, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 288936, 100520, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 280819, 157940, 125171, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 280835, 125187, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 354653, 313700, 280937, 313705, 280940, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 281084, 240124, 305662, 305664, 240129, 305666, 305668, 240132, 223749, 281095, 338440, 150025, 223752, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 199262, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 199367, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 281401, 289593, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 240519, 322440, 338823, 314249, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 281581, 183277, 322550, 134142, 322563, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 281923, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 298365, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 224657, 306581, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 282410, 241450, 306988, 306991, 315184, 323376, 315190, 241464, 282425, 159545, 298811, 307009, 413506, 241475, 307012, 148946, 315211, 282446, 307027, 315221, 282454, 315223, 241496, 323414, 241498, 307035, 307040, 282465, 110433, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 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, 315483, 217179, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 176435, 307508, 315701, 307510, 332086, 307512, 151864, 168245, 307515, 282942, 307518, 151874, 282947, 282957, 323917, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 283080, 176592, 315856, 315860, 176597, 127447, 283095, 299481, 176605, 242143, 291299, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 127497, 233994, 135689, 291341, 233998, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 291711, 234368, 234370, 201603, 291714, 234373, 226182, 234375, 291716, 226185, 308105, 234379, 234384, 234388, 234390, 226200, 324504, 234393, 209818, 308123, 324508, 234398, 234396, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 234414, 324527, 291760, 234417, 201650, 324531, 226230, 234422, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 226245, 234437, 234439, 234434, 234443, 291788, 275406, 234446, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 275545, 242777, 234585, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 234607, 160879, 275569, 234610, 300148, 234614, 398455, 144506, 275579, 234618, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 275594, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 234648, 308379, 283805, 234653, 324766, 119967, 234657, 300189, 324768, 242852, 283813, 234661, 300197, 234664, 275626, 234667, 316596, 308414, 234687, 300226, 308418, 226500, 234692, 300229, 308420, 283844, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 283904, 300289, 292097, 300292, 300294, 275719, 300299, 177419, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 283963, 243003, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 284076, 144812, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 284099, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 226802, 316917, 308727, 292343, 300537, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194101, 284215, 194103, 284218, 226877, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 276052, 276053, 284245, 284247, 317015, 284249, 243290, 284251, 300628, 284253, 235097, 284255, 300638, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 276098, 284290, 325250, 284292, 292479, 292485, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 317158, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 284418, 358146, 317187, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 186139, 300828, 300830, 276255, 325408, 284449, 300834, 300832, 227109, 317221, 358183, 186151, 276268, 300845, 194351, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 227314, 276466, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 276539, 235579, 235581, 325692, 178238, 276544, 284739, 292934, 276553, 243785, 350293, 350295, 194649, 227418, 309337, 350302, 227423, 194654, 194657, 178273, 276579, 227426, 194660, 227430, 276583, 309346, 309348, 276586, 309350, 309352, 309354, 276590, 350313, 350316, 350321, 284786, 276595, 227440, 301167, 350325, 350328, 292985, 301178, 292989, 292993, 301185, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 227540, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 276713, 317674, 325867, 243948, 194801, 227571, 309491, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 211241, 325937, 276789, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 317833, 178572, 285070, 178575, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 277011, 317971, 309781, 309779, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 277106, 121458, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 318132, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277314, 277317, 277322, 277329, 162643, 310100, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 326514, 310134, 277368, 15224, 236408, 416639, 416640, 113538, 310147, 416648, 277385, 39817, 187274, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 121850, 302075, 244731, 293882, 293887, 277504, 277507, 277511, 277519, 293908, 277526, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 277608, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 253064, 302218, 285835, 294026, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 285862, 277671, 302248, 64682, 277678, 228526, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 228617, 138505, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 294211, 302403, 384328, 277832, 277836, 294221, 326991, 294223, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 64966, 245191, 163272, 302534, 310727, 277959, 292968, 302541, 277963, 302543, 277966, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 286188, 310764, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 228864, 40448, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187939, 294435, 40484, 286246, 294439, 286248, 278057, 294440, 294443, 40486, 294445, 40488, 310831, 40491, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 228944, 212560, 400976, 40533, 147032, 40537, 40539, 278109, 40541, 40544, 40548, 40550, 286312, 286313, 40554, 40552, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 278150, 310925, 286354, 278163, 302740, 122517, 278168, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 278227, 229076, 286420, 319187, 286425, 319194, 278235, 301163, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 171774, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 237409, 294776, 360317, 294785, 327554, 40840, 40851, 294803, 188312, 294811, 319390, 294817, 319394, 40865, 294821, 311209, 180142, 294831, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
0a3498e81fa02962865a4e81ece523b97d9acd1a
8fb30c8c113912a63663e4c374231b6523a296ef
/DS/Algorithms/Sort/MergeSort.swift
ad4e71aa46df0e018d97b1c5435a704b672bd083
[]
no_license
hdchan/ds_swift
976f2b965d3b161c8f70afaa3aa909d52523cc59
d7f9b8c655f5d38e7b96d153753989b94afa8e48
refs/heads/master
2021-07-09T15:21:02.231005
2021-03-06T19:01:09
2021-03-06T19:01:09
233,177,699
0
0
null
null
null
null
UTF-8
Swift
false
false
1,949
swift
// // MergeSort.swift // DS // // Created by Henry Chan on 1/4/20. // Copyright © 2020 HDC. All rights reserved. // import Foundation struct MergeSort<T: Comparable> { enum PivotStrategy { case naive } static func sort(_ comparable: [T], _ pivotStrategy: PivotStrategy = .naive) -> [T] { guard comparable.count > 1 else { return comparable } let pivotIndex = pickPivotIndex(comparable, pivotStrategy) let leftValues = sort(Array(comparable[0..<pivotIndex])) let rightValues = sort(Array(comparable[pivotIndex...])) var sortedValues: [T] = [] var leftPointer = 0 var rightPointer = 0 while leftPointer < leftValues.count && rightPointer < rightValues.count { let leftValue = leftValues[leftPointer] let rightValue = rightValues[rightPointer] if leftValue < rightValue { sortedValues.append(leftValues[leftPointer]) leftPointer += 1 } else if rightValue < leftValue { sortedValues.append(rightValues[rightPointer]) rightPointer += 1 } else { // both are equal sortedValues.append(leftValues[leftPointer]) leftPointer += 1 sortedValues.append(rightValues[rightPointer]) rightPointer += 1 } } if leftPointer < leftValues.count { sortedValues += leftValues[leftPointer...] } else if rightPointer < rightValues.count { sortedValues += rightValues[rightPointer...] } return sortedValues } private static func pickPivotIndex(_ comparable: [T], _ pivotStrategy: PivotStrategy) -> Int { switch pivotStrategy { case .naive: return comparable.count / 2 } } }
[ -1 ]
6d753df1c0034072ce30fc9f378fd5f4366dc5b6
cfadf3c96acf2c5815cafb56427a293e934c827c
/NNScrollableSegmentedControl/Cells/SegmentCellWithImage.swift
81de6a9d85cd245800918e1b4696aae90edfd38b
[ "MIT" ]
permissive
Nang01T2/NNScrollableSegmentedControl
17bed877a232d6b6822ed85b8360c70ae9c532a1
01453f24b10223899a1c790cb633cde2aeadbc77
refs/heads/master
2020-05-22T14:17:48.195617
2019-05-20T07:42:39
2019-05-20T07:42:39
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,767
swift
// // SegmentCellWithImage.swift // DevKit // // Created by Nang Nguyen on 5/7/19. // Copyright © 2019 Evizi. All rights reserved. // import Foundation class SegmentCellWithImage: BaseSegmentCell { lazy var imageView: UIImageView = { let imageView = UIImageView() imageView.translatesAutoresizingMaskIntoConstraints = false imageView.tintColor = BaseSegmentCell.defaultTextColor return imageView }() override var contentColor:UIColor? { didSet { imageView.tintColor = (contentColor == nil) ? BaseSegmentCell.defaultTextColor : contentColor! } } override var isHighlighted: Bool { didSet { if isHighlighted { imageView.tintColor = (selectedContentColor == nil) ? BaseSegmentCell.defaultTextColor : selectedContentColor! } else { imageView.tintColor = (contentColor == nil) ? BaseSegmentCell.defaultTextColor : contentColor! } } } override var isSelected: Bool { didSet { if isSelected { imageView.tintColor = (selectedContentColor == nil) ? BaseSegmentCell.defaultTextColor : selectedContentColor! } else { imageView.tintColor = (contentColor == nil) ? BaseSegmentCell.defaultTextColor : contentColor! } } } override init(frame: CGRect) { super.init(frame: frame) setupViewHierarchy() setupConstraints() } required init?(coder aDecoder: NSCoder) { return nil } private func setupViewHierarchy() { contentView.addSubview(imageView) contentView.addSubview(verticalSeparatorView) } private func setupConstraints() { imageView .centerXAnchor(equalTo: contentView.centerXAnchor) .centerYAnchor(equalTo: contentView.centerYAnchor) .leadingAnchor(greaterThanOrEqualTo: contentView.leadingAnchor, constant: BaseSegmentCell.textPadding) contentView .trailingAnchor(greaterThanOrEqualTo: imageView.trailingAnchor, constant: BaseSegmentCell.textPadding) verticalSeparatorView .topAnchor(equalTo: contentView.topAnchor) .bottomAnchor(equalTo: contentView.bottomAnchor) .trailingAnchor(equalTo: contentView.trailingAnchor) .widthAnchor(equalTo: 1) } override func setup(_ viewModel: ViewModel, isLastCell: Bool) { super.setup(viewModel, isLastCell: isLastCell) imageView.image = viewModel.image } override func configCell(_ viewModel: ViewModel, isLastCell: Bool) { setup(viewModel, isLastCell: isLastCell) } }
[ -1 ]
1c7a6f0856563f8833952d3d2446dd51b040055c
9e062c02d4bc36546556333a437e034bfcbacfad
/Jaiben/VC_Base.swift
6944d4771cb413b3d6994f253f4065db8c0132dd
[]
no_license
andrew54068/Jiaben_xcode8
87b365b2ef6303cd2ce935e848c598184828180b
af9446f5c2f9ce83d0aaac9f831f34f2b12e132f
refs/heads/master
2021-01-21T05:09:47.714667
2017-11-13T04:29:28
2017-11-13T04:29:28
83,133,956
0
0
null
null
null
null
UTF-8
Swift
false
false
6,082
swift
// // VC_Base.swift // Jaiben // // Created by kidnapper on 11/02/2017. // Copyright © 2017 JaiBen. All rights reserved. // import UIKit class VC_Base: UIViewController, UITextFieldDelegate{ override func viewDidLoad() { super.viewDidLoad() //gradien Background let color1 = UIColor(red: 238/255, green: 110/255, blue: 73/255, alpha: 1) let color2 = UIColor(red: 238/255, green: 158/255, blue: 73/255, alpha: 1) let gradient = CAGradientLayer() gradient.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height) gradient.colors = [color1.cgColor, color2.cgColor] gradient.startPoint = CGPoint(x: 0,y: 0) gradient.endPoint = CGPoint(x: 1, y: 1.2) self.view.layer.insertSublayer(gradient, at: 0) // Do any additional setup after loading the view. } // override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) { // let touch = touches.first // print("1234566") // print(touch!.locationInView(self.view)) // print("1234566") // self.view.endEditing(true) // } override var shouldAutorotate : Bool { return false } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func buildJBRequest(input: String, urlAfterJB: String!, log: String?) -> URLRequest{ var requestString = "hash=This is Ivan Speaking." if (input != "") { requestString += "&" + input } var request = URLRequest(url: NSURL(string: "http://actionstar.sa.ntnu.edu.tw/jiabong/" + urlAfterJB)! as URL) request.httpMethod = "POST" request.httpBody = requestString.data(using: .utf8) if (log != "") { // print(log! + requestString) } return request } func buildDataTaskWithRequst(request: URLRequest, requestName: String?, f:@escaping (() ->())={return }){ URLSession.shared.dataTask(with: request){ data, response, error in print("error = \(error as AnyObject)") guard (data != nil && error == nil) else{ print("error") self.showMessage(message: "發生錯誤,請檢查網路連線後再試一次(error)", buttonText: "確認") return } if data == nil{ self.showMessage(message: "無法取得資料,請確認連線正常後再試一次", buttonText: "確認") }else if let httpStatus = response as? HTTPURLResponse, httpStatus.statusCode != 200{ print("statusCode should be 200 but it's \(httpStatus.statusCode)") print("response = \(response)") self.showMessage(message: "發生錯誤,請檢查網路連線後再試一次", buttonText: "確認") return } let result = String(data: data!, encoding: .utf8)! print("******************************") if (result != "{\"success\":\"False\"}") { print("here is dump started \(result as AnyObject) here is dump end") self.getDataAfterRequest(result: result) print("data! = \(data!)") } // print("result = \(result)") DispatchQueue.main.async { f() } }.resume() } func showMessage(message: String!, buttonText: String!){ let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert) let action = UIAlertAction(title: buttonText, style: .default, handler: {action in self.doThingsAfterComfirmed()}) alert.addAction(action) self.present(alert, animated: true, completion: nil) } func doThingsAfterComfirmed(){ } func getDataAfterRequest(result: String){ } func decodeFromJson(result: String) -> [String:Any]?{ do{ if let data = result.data(using: .utf8){ let json = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as AnyObject print("success decodeFromJson") print("json = \(json)") let json1 = json as! [String:Any] return json1 }else{ print("here") return nil } }catch{ print(error) print("陣列抓不成功") return nil } } // func textViewShouldEndEditing(textView: UITextView) -> Bool { // textView.resignFirstResponder() // return true // } // func textFieldShouldReturn(textField: UITextField) -> Bool { // self.view.endEditing(true) // return true // } // override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) { // self.view.endEditing(true) // } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ } extension NSLayoutConstraint { func setMultiplier(multiplier:CGFloat) -> NSLayoutConstraint{ NSLayoutConstraint.deactivate([self]) let newConstrain = NSLayoutConstraint(item: firstItem, attribute: firstAttribute, relatedBy: relation, toItem: secondItem, attribute: secondAttribute, multiplier: multiplier, constant: constant) newConstrain.priority = priority newConstrain.shouldBeArchived = self.shouldBeArchived newConstrain.identifier = self.identifier NSLayoutConstraint.activate([newConstrain]) return newConstrain } }
[ -1 ]
adef2a01cbcaceba2b65be96a3f5c5ac01304283
b7692c9098b139a9d96dccdd9f0804a039f620be
/TestingEarthtunesVideo/TestingEarthtunesVideoApp.swift
aa106bcbaac71b350dfd2a43372efc8c512d03c2
[]
no_license
heltena/TestingEarthtunesVideo
0ccbeb9718490d09a7ccb443a3d3d25d00bb7811
1d3c74dfa830f874ea70e494e7f831d1e317422d
refs/heads/main
2023-07-02T06:51:38.892926
2021-08-12T20:26:22
2021-08-12T20:26:22
395,433,638
0
0
null
null
null
null
UTF-8
Swift
false
false
269
swift
// // TestingEarthtunesVideoApp.swift // TestingEarthtunesVideo // // Created by Helio Tejedor on 8/12/21. // import SwiftUI @main struct TestingEarthtunesVideoApp: App { var body: some Scene { WindowGroup { ContentView() } } }
[ -1 ]
6a1c42f1fa1abf22e74895b18778f419d9c6cb16
55a063004d7e993f055b5457d4bcf512eeaf0cce
/Instagram/Resources/Extensions.swift
ccc5da3c0833acc5554b52ac17d9c7d388250c09
[]
no_license
punreachrany/Instagram-Clone-with-Swift
95bf7cbbd37723aac4e7db25a06bf89a11962554
cc5d52ae60c7317e40234eac949b5029bdedd2ce
refs/heads/main
2023-05-05T08:46:20.962154
2021-05-30T08:25:37
2021-05-30T08:25:37
363,597,504
1
0
null
null
null
null
UTF-8
Swift
false
false
745
swift
// // Extensions.swift // Instagram // // Created by elite on 2021/05/18. // import UIKit extension UIView { public var width: CGFloat { return frame.size.width } public var height: CGFloat { return frame.size.height } public var top: CGFloat { return frame.origin.y } public var bottom: CGFloat { return frame.origin.y + frame.size.height } public var left: CGFloat { return frame.origin.x } public var right: CGFloat { return frame.origin.x + frame.size.width } } extension String { mutating func safeDatabaseKey() -> String { return self.replacingOccurrences(of: ".", with: "-") } }
[ -1 ]
9a9f8174975cd889a3300efad19d059e59a6deda
c594eab2ff419e3848c50b9d1b4d55da720e773d
/treehouse-project-5/AmusementParkPassGeneratorPartII/SingleViewAppSwiftTemplate/Supporting Files/AppDelegate.swift
d841c5ba6cd3a1f3d68fc0360f7698ca71faed2f
[]
no_license
aoblea/AmusementParkPassGeneratorPart2
2d152d720b75e006f335116419ed337c78f8b5d2
a521bee8b668d577dc5145490cf26cd82bd28528
refs/heads/master
2022-03-04T04:41:57.833744
2019-09-20T22:53:49
2019-09-20T22:53:49
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,197
swift
// // AppDelegate.swift // SingleViewAppSwiftTemplate // // Created by Treehouse on 1/1/19. // Copyright © 2016 Treehouse. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? internal func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 229426, 237618, 229428, 311349, 286774, 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, 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, 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, 172618, 303690, 33357, 287309, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 189039, 295538, 172660, 189040, 189044, 287349, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 279178, 287371, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 287390, 303773, 164509, 172705, 287394, 172702, 303780, 172707, 287398, 205479, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 279231, 287427, 312005, 312006, 107208, 107212, 172748, 287436, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 279267, 312035, 295654, 279272, 312048, 230128, 312050, 230131, 189169, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 304007, 320391, 213895, 304009, 304011, 230284, 304013, 279438, 189325, 295822, 189329, 213902, 189331, 304019, 295825, 58262, 304023, 279452, 234648, 410526, 279461, 279462, 304042, 213931, 304055, 230327, 287675, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 295949, 230413, 197645, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 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, 66690, 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, 320803, 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, 230763, 148843, 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, 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, 148990, 321022, 206336, 402942, 296446, 296450, 230916, 312837, 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, 263888, 280276, 313044, 321239, 280283, 18140, 313052, 288478, 313055, 419555, 321252, 313066, 280302, 288494, 280304, 313073, 419570, 288499, 321266, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 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, 149618, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 321740, 313548, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 215387, 354653, 354656, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 240011, 199051, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 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, 256716, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 338823, 322440, 314249, 240519, 183184, 142226, 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, 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, 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, 307338, 233613, 241813, 307352, 299164, 241821, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 176311, 299191, 307385, 307386, 258235, 307388, 176316, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 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, 127440, 315860, 176597, 283095, 127447, 299481, 127449, 176605, 242143, 127455, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 135672, 127480, 233979, 291323, 127485, 291330, 283142, 127494, 127497, 233994, 135689, 127500, 291341, 233998, 127506, 234003, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 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, 291742, 226200, 234398, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 234410, 291754, 291756, 324522, 226220, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 324536, 275384, 234428, 291773, 234431, 242623, 324544, 324546, 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, 160835, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 275579, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 275606, 275608, 234650, 308379, 324757, 234653, 300189, 119967, 324766, 324768, 283805, 234657, 242852, 234661, 283813, 300197, 234664, 177318, 275626, 234667, 316596, 308414, 300223, 234687, 300226, 308418, 283844, 300229, 308420, 308422, 226500, 234692, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 300289, 292097, 161027, 300292, 300294, 275719, 234760, 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, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194101, 284215, 316983, 194103, 284218, 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, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 325251, 276095, 276098, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 276166, 284358, 358089, 284362, 276170, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 325408, 300832, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 292681, 358224, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 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, 325624, 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, 284739, 292934, 243785, 276553, 350293, 350295, 309337, 194649, 227418, 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, 227571, 309491, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 129486, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 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, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 56045, 277232, 228081, 56059, 310015, 285441, 310020, 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, 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, 244731, 302075, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 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, 280021, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 319390, 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 ]
a11ebbd29f39b82eec0aab22edcdfb225f7327be
3b9b0d65c1bf29ce105870d36409aeb92bc74f1d
/MyBarkPack/AppearanceController.swift
37d42cbfc0e914234a7d79db2683918f919580aa
[]
no_license
retikak/myBarkPack
a9f72823ee1777da2924f8f2fcab87505ffb4171
9f16ae2eea15555de07f3f1d932deea896736640
refs/heads/master
2021-01-24T17:05:49.340556
2016-04-25T20:43:21
2016-04-25T20:43:21
null
0
0
null
null
null
null
UTF-8
Swift
false
false
502
swift
// // AppearanceController.swift // MyBarkPack // // Created by Diego Aguirre on 4/23/16. // Copyright © 2016 home. All rights reserved. // import UIKit class AppearanceController { static func initializeAppearanceDefaults() { UINavigationBar.appearance().barTintColor = UIColor.lightBlue() UINavigationBar.appearance().tintColor = UIColor.whiteColor() UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()] } }
[ -1 ]
3969be3ad65ed3e68b69d45fb7b5df2df7c6aa93
a126982de3458230f025f301cc3780492e17b402
/Assignment1UITests/Assignment1UITests.swift
ab703c6992c7ea47d299cdb4c687230ddf067801
[]
no_license
msdewitt/ParkingRateAndStudentGradeCalculator
b7008663fb083fd0640f28bb68e7a24b98aa32f6
7215f38d364ebcb5332009263ce7b3cad91c1cde
refs/heads/master
2021-08-12T08:25:57.394342
2017-11-14T16:02:43
2017-11-14T16:02:43
110,711,630
0
0
null
null
null
null
UTF-8
Swift
false
false
1,260
swift
// // Assignment1UITests.swift // Assignment1UITests // // Created by Matheu DeWitt on 9/14/16. // Copyright © 2016 Matheu DeWitt. All rights reserved. // import XCTest class Assignment1UITests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. XCUIApplication().launch() // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } }
[ 333827, 243720, 282634, 155665, 305173, 237599, 241695, 223269, 354342, 229414, 292901, 102441, 354346, 278571, 313388, 315433, 325675, 282671, 102446, 229425, 124974, 243763, 241717, 229431, 180279, 215095, 319543, 213051, 288829, 325695, 286787, 288835, 307269, 237638, 313415, 239689, 315468, 233548, 311373, 278607, 196687, 311377, 354386, 223317, 315477, 323678, 315488, 321632, 45154, 280676, 313446, 215144, 233578, 194667, 278637, 288878, 319599, 278642, 284789, 131190, 288890, 131199, 194692, 235661, 323730, 278676, 311447, 153752, 327834, 284827, 299166, 278690, 233635, 215204, 311459, 299176, 284840, 184489, 284843, 278698, 278703, 184498, 278707, 125108, 280761, 223418, 295099, 180409, 299197, 258233, 280767, 227517, 278713, 299202, 139459, 309443, 227525, 131270, 176325, 301255, 280779, 227536, 282832, 301270, 301271, 280792, 311520, 325857, 280803, 307431, 182503, 319719, 295147, 317676, 286957, 125166, 125170, 313595, 125180, 184574, 125184, 309504, 125192, 125197, 125200, 227601, 125204, 278805, 319764, 334104, 282908, 299294, 311582, 282912, 233761, 278817, 125215, 211239, 282920, 125225, 317738, 311596, 321839, 315698, 98611, 125236, 282938, 168251, 278843, 287040, 319812, 311622, 280903, 227655, 323914, 201037, 282959, 229716, 289109, 379224, 168280, 323934, 391521, 239973, 381286, 285031, 416103, 313703, 280938, 242027, 321901, 278895, 354671, 287089, 227702, 199030, 291193, 291194, 248188, 313726, 311679, 211327, 240003, 158087, 313736, 227721, 242059, 311692, 227730, 285074, 240020, 190870, 315798, 190872, 291225, 293275, 285083, 317851, 283039, 227743, 285089, 293281, 242079, 289185, 305572, 156069, 301482, 289195, 377265, 299449, 311739, 293309, 278974, 311744, 317889, 291266, 278979, 278988, 326093, 281038, 281039, 278992, 283089, 283088, 289229, 279000, 176602, 160224, 279009, 291297, 285152, 188899, 195044, 279014, 242150, 319976, 279017, 311787, 281071, 319986, 279030, 311800, 279033, 317949, 279042, 233987, 283138, 287237, 322057, 309770, 342537, 279053, 303634, 303635, 279060, 279061, 182802, 283154, 279066, 188954, 322077, 291359, 227881, 293420, 236080, 283185, 289328, 279092, 23093, 234037, 244279, 244280, 338491, 301635, 309831, 55880, 377419, 281165, 303693, 301647, 281170, 326229, 287319, 309847, 115287, 189016, 111197, 295518, 287327, 242274, 244326, 279143, 279150, 281200, 287345, 287348, 301688, 189054, 287359, 303743, 291455, 297600, 301702, 279176, 311944, 311948, 184974, 316048, 311953, 287379, 227991, 295575, 289435, 303772, 221853, 205469, 314020, 279207, 295598, 279215, 285360, 342705, 285362, 299698, 287412, 166581, 318127, 154295, 293552, 303802, 314043, 287418, 66243, 291529, 287434, 225996, 363212, 242385, 303826, 279249, 279253, 158424, 230105, 299737, 322269, 342757, 295653, 289511, 234216, 330473, 230120, 285419, 289517, 279278, 170735, 312046, 215790, 125683, 230133, 199415, 234233, 242428, 279293, 205566, 322302, 289534, 299777, 291584, 228099, 285443, 291591, 322312, 295688, 285450, 312076, 285457, 295698, 166677, 291605, 283418, 285467, 221980, 281378, 234276, 283431, 318247, 279337, 293673, 318251, 289580, 164655, 301872, 303921, 234290, 285493, 230198, 285496, 301883, 201534, 281407, 289599, 295745, 222017, 293702, 318279, 283466, 281426, 279379, 295769, 201562, 281434, 234330, 322396, 230238, 301919, 279393, 349025, 293729, 281444, 303973, 279398, 177002, 308075, 242540, 310132, 295797, 228214, 207735, 295799, 177018, 279418, 269179, 308093, 314240, 291713, 158594, 240517, 287623, 299912, 228232, 279434, 416649, 316299, 234382, 308111, 308113, 293780, 310166, 289691, 209820, 283551, 240543, 310177, 289699, 189349, 289704, 279465, 293801, 177074, 304050, 289720, 289723, 189373, 213956, 19398, 345030, 213961, 279499, 56270, 191445, 183254, 304086, 234469, 314343, 304104, 324587, 183276, 234476, 320492, 289773, 203758, 287730, 240631, 214009, 312313, 312317, 234499, 293894, 320520, 230411, 322571, 320526, 234513, 238611, 238617, 197658, 316441, 132140, 113710, 189487, 281647, 322609, 312372, 203829, 238646, 300087, 238650, 320571, 21567, 308288, 336962, 160834, 314437, 349254, 238663, 300109, 207954, 234578, 296023, 205911, 314458, 281698, 281699, 285795, 230500, 322664, 228457, 279659, 318571, 234606, 300145, 230514, 238706, 279666, 312435, 187508, 302202, 285819, 314493, 285823, 150656, 234626, 222344, 285833, 318602, 234635, 228492, 337037, 177297, 162962, 187539, 308375, 324761, 285850, 296091, 119965, 302239, 330912, 300192, 339106, 306339, 234655, 234662, 300200, 249003, 208044, 302251, 3243, 322733, 238764, 294069, 300215, 64699, 294075, 228541, 283841, 148674, 283846, 312519, 279752, 283849, 148687, 290001, 189651, 316628, 279766, 189656, 279775, 304352, 304353, 310496, 298209, 279780, 228587, 279789, 290030, 302319, 234741, 316661, 283894, 208123, 279803, 292092, 228608, 234756, 322826, 242955, 312588, 177420, 318732, 126229, 318746, 320795, 320802, 304422, 130342, 130344, 298290, 312628, 300342, 222523, 286012, 181568, 279872, 279874, 300354, 300355, 294210, 193858, 372039, 304457, 337226, 230730, 296269, 222542, 224591, 238928, 234830, 296274, 314708, 318804, 283990, 357720, 300378, 300379, 294236, 316764, 292194, 230757, 281958, 134504, 306541, 284015, 296304, 327023, 230772, 314742, 310650, 224637, 306558, 314752, 243073, 179586, 306561, 294278, 296328, 298378, 296330, 368012, 304523, 314771, 306580, 224662, 234902, 282008, 318876, 282013, 290206, 148899, 298406, 282023, 279979, 279980, 241067, 314797, 286128, 173492, 286133, 279988, 284090, 310714, 228796, 302523, 415170, 280003, 292291, 228804, 306630, 302530, 310725, 300488, 306634, 280011, 302539, 370122, 300490, 310735, 310731, 312785, 222674, 234957, 280020, 280025, 310747, 239069, 144862, 286176, 187877, 310758, 320997, 280042, 280043, 191980, 300526, 337391, 282097, 308722, 296434, 191991, 288248, 40439, 286201, 300539, 288252, 312830, 290304, 228868, 292359, 218632, 302602, 230922, 323083, 294413, 304655, 323088, 282132, 230933, 302613, 282135, 316951, 374297, 302620, 222754, 313338, 306730, 245291, 312879, 230960, 288305, 290359, 239159, 323132, 157246, 288319, 288322, 280131, 349764, 310853, 194118, 282182, 288328, 286281, 292426, 124486, 224848, 224852, 290391, 239192, 306777, 128600, 235096, 212574, 345697, 204386, 323171, 300643, 300645, 282214, 312937, 243306, 224874, 312941, 310896, 294517, 288377, 290425, 325246, 333438, 235136, 280193, 282244, 239238, 288391, 282248, 323208, 286344, 179853, 286351, 188049, 229011, 239251, 280217, 323226, 179868, 229021, 302751, 198304, 282272, 282279, 298664, 298666, 317102, 286387, 300725, 286392, 302778, 306875, 296636, 280253, 282302, 280252, 286400, 323265, 323262, 280259, 321217, 282309, 239305, 280266, 306891, 296649, 212684, 302798, 9935, 241360, 282321, 286419, 241366, 280279, 282330, 280285, 294621, 282336, 294629, 153318, 12009, 282347, 288492, 282349, 323315, 67316, 34547, 284410, 288508, 200444, 282366, 286463, 319232, 288515, 280326, 282375, 323335, 284425, 300810, 116491, 282379, 280333, 216844, 284430, 300812, 161553, 124691, 284436, 278292, 278294, 116502, 282390, 118549, 321308, 321309, 282399, 241440, 282401, 186148, 186149, 315172, 241447, 333609, 294699, 284460, 286507, 280367, 300849, 282418, 280373, 282424, 280377, 319289, 321338, 282428, 413500, 280381, 241471, 280386, 280391, 153416, 315209, 159563, 280396, 307024, 317268, 237397, 241494, 18263, 307030, 188250, 284508, 300893, 237411, 284515, 276326, 282471, 296807, 292713, 282476, 296815, 292719, 313200, 317305, 124795, 317308, 339840, 315265, 280451, 327556, 188293, 243590, 282503, 243592, 67464, 305032, 315272, 315275, 325514, 184207, 311183, 124816, 282517, 294806, 214936, 294808, 124826, 239515, 214943, 298912, 319393, 294820, 219046, 333734, 294824, 298921, 284584, 313257, 292783, 126896, 200628, 300983, 343993, 288698, 294849, 214978, 280517, 280518, 214983, 282572, 282573, 153553, 24531, 231382, 323554, 292835, 190437, 292838, 294887, 317416, 298987, 278507, 311277, 296942, 124912, 278515, 325620, 239610 ]
5b480c7bc1d97c8793b5c087c6fd1fdfbda2d82f
744b37ff68b9cec46fa4bde35ae506e8ce936b92
/ZGParking/AddCarViewController.swift
18eb596c5dc87721074fded5fdad07833be607bf
[]
no_license
dhudicek/zgparking
81c38710fbdcb849c04b7828d3f6dfd4737209ed
80864f758c7024b5c1e442b0997bb7961c44e1e4
refs/heads/master
2021-01-19T11:34:38.248262
2017-04-11T20:49:10
2017-04-11T20:49:10
87,853,471
0
0
null
null
null
null
UTF-8
Swift
false
false
1,978
swift
// // AddCarViewController.swift // ZGParking // // Created by Damjan Hudiček on 11/04/2017. // Copyright © 2017 ngajski. All rights reserved. // import UIKit class AddCarViewController: UIViewController { @IBOutlet weak var nameLabel: UILabel! @IBOutlet weak var licensePlateLabel: UILabel! @IBOutlet weak var nameTextField: UITextField! @IBOutlet weak var licensePlateTextField: UITextField! var doneButton: UIBarButtonItem? override func viewDidLoad() { super.viewDidLoad() initBarButtons() initLabelsAndTextFields() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } func doneButtonTapped() { PersistenceService.addCar(name: nameTextField.text!, licensePlate: licensePlateTextField.text!.uppercased()) self.navigationController?.popViewController(animated: true) } private func initBarButtons() { self.doneButton = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(doneButtonTapped)) self.doneButton?.isEnabled = false self.navigationItem.rightBarButtonItem = doneButton } private func initLabelsAndTextFields() { self.nameLabel.text = "Ime: " self.licensePlateLabel.text = "Registracija: " NotificationCenter.default.addObserver(self, selector: #selector(textFieldDidChange), name: NSNotification.Name.UITextFieldTextDidChange, object: self.nameTextField) NotificationCenter.default.addObserver(self, selector: #selector(textFieldDidChange), name: NSNotification.Name.UITextFieldTextDidChange, object: self.licensePlateTextField) } func textFieldDidChange() { if ((self.licensePlateTextField.text?.isEmpty)! || (self.nameTextField.text?.isEmpty)!) { self.doneButton?.isEnabled = false } else { self.doneButton?.isEnabled = true } } }
[ -1 ]
01c786217db3637430e5438c4842d6bbf67adb03
09383ef19d3d2fc4ff5aee33777d07966d09f277
/PassTheLaugh/ChangeColorViewController.swift
e7d13b7a8f55186de928f72bcb75bd13080091e5
[]
no_license
JimCampagno/PassTheLaugh
017caef0cd54943172dfc4d74d7620482a438200
44a158710322503892fa3be2e30846b318e692e2
refs/heads/master
2020-04-12T06:39:28.377909
2016-12-18T05:25:52
2016-12-18T05:25:52
64,606,670
0
0
null
null
null
null
UTF-8
Swift
false
false
3,489
swift
// // ChangeColorViewController.swift // PassTheLaugh // // Created by Jim Campagno on 8/2/16. // Copyright © 2016 Gamesmith, LLC. All rights reserved. // import UIKit protocol UpdateColorDelegate { func updateColor(to color: UIColor) } final class ChangeColorViewController: UIViewController { var tableView: UITableView! var colorPalettes: [ColorPalette] = ColorPalette.dummyData() var updateColorDelegate: UpdateColorDelegate! let rowHeight: CGFloat = 106 var widthOfSideBar: CGFloat! override func viewDidLoad() { super.viewDidLoad() } fileprivate func setupView() { view.backgroundColor = UIColor.black.withAlphaComponent(0.8) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) setupView() setupTableView() } } // MARK: - ColorChangeView Delegate Methods extension ChangeColorViewController: ColorChangeViewDelegate { func colorChanged(to color: UIColor) { updateColorDelegate.updateColor(to: color) dismiss(animated: true) { [unowned self] _ in self.updateColorDelegate = nil } } } // MARK: - Setup TableView extension ChangeColorViewController { fileprivate func setupTableView() { tableView = UITableView(frame: CGRect.zero, style: .plain) tableView.backgroundColor = UIColor.clear tableView.translatesAutoresizingMaskIntoConstraints = false view.addSubview(tableView) let centerX = tableView.centerXAnchor.constraint(equalTo: view.centerXAnchor) centerX.constant -= widthOfSideBar / 2 centerX.isActive = true tableView.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true tableView.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.7).isActive = true tableView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true tableView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true tableView.delegate = self tableView.dataSource = self tableView.register(ColorChangeCell.self, forCellReuseIdentifier: ColorChangeCell.identifier) tableView.separatorStyle = .none tableView.allowsSelection = false tableView.showsVerticalScrollIndicator = false } } // MARK: - TableView Datasource Methods extension ChangeColorViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return colorPalettes.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: ColorChangeCell.identifier, for: indexPath) as! ColorChangeCell cell.colorChangeView.colorDelegate = self cell.backgroundColor = UIColor.clear return cell } } // MARK: - TableView Delegate Methods extension ChangeColorViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { let colorCell = cell as! ColorChangeCell print("CALLED!") colorCell.colorPalette = colorPalettes[indexPath.row] } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return rowHeight } }
[ -1 ]
ddac7cbcd5219a6ae0d920e6c02fb074f1162783
c3755673dc4136f377e87183406be5b645729d9d
/Projects/BandaAppCourse/BandaAppCourse/Storyboards/CreditsVC.swift
31e11311b945b00547be8c37b0689d11c946618f
[]
no_license
Ne0F1R3/cm2019-2
23f18f80fa58a9ac0643f2518edc25c6b275d9f9
e0b2964b38066c187e376070c675f30c01e034e5
refs/heads/master
2020-05-25T08:27:32.522643
2019-05-20T20:51:00
2019-05-20T20:51:00
187,710,315
0
0
null
2019-05-20T20:41:11
2019-05-20T20:41:11
null
UTF-8
Swift
false
false
377
swift
// // CreditsVC.swift // BandaAppCourse // // Created by Daniel Barcenas on 26/04/19. // Copyright © 2019 Erick Barcenas. All rights reserved. // import UIKit class CreditsVC: UIViewController { override func viewDidLoad() { super.viewDidLoad() } @IBAction func goBack(_ sender: Any) { self.dismiss(animated: true, completion: nil) } }
[ -1 ]
20cac1ad01e4249e015b0d31858f639dcff4f434
40994fda4732e65101a20484e9701c7e0e3e29e1
/TechflixAndChill/HomeScreenViewController.swift
3c1ed25d11b1873c1c30f26aa08e57ff4134b18d
[]
no_license
shiggins8/TechflixAndChill_iOS
1032777c2974ce790f5d694834ab5e2c7be091d5
5f794db4b8d0e75ab332791c5ede106c0d1efd64
refs/heads/master
2016-09-12T09:10:38.082140
2016-04-25T03:36:42
2016-04-25T03:36:42
56,786,049
0
0
null
null
null
null
UTF-8
Swift
false
false
1,346
swift
// // HomeScreenViewController.swift // TechflixAndChill // // Created by Scott Higgins on 4/21/16. // Copyright © 2016 Scott Higgins. All rights reserved. // import UIKit import Firebase class HomeScreenViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = UIColor(patternImage: UIImage(named: "blue_green.png")!) // Do any additional setup after loading the view. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ @IBAction func logoutAction(sender: AnyObject) { //CURRENT_USER.unauth() //NSUserDefaults.standardUserDefaults().setValue(nil, forKey: "uid") //NSUserDefaults.standardUserDefaults().setValue(nil, forKey: "username") self.dismissViewControllerAnimated(true, completion: nil) } }
[ -1 ]
197e942ccfb9669209dcbe5d861c9552527b9b95
f314fae3f2d3cf011b23ef7517b5615379626322
/ConcurrencyDemo/DownloadSegmentModel.swift
f250d3e4443235aeb5a278c84ea865ad6f6634bd
[]
no_license
coding226/URLSessionHLSDownload
124b0b630d08ad970451abe205c1899a4e8af63b
4783e72f332cded77ff1e70d4a2386d34fad2020
refs/heads/master
2021-09-14T18:40:56.035543
2018-04-24T17:31:44
2018-04-24T17:31:44
null
0
0
null
null
null
null
UTF-8
Swift
false
false
524
swift
// // DownloadSegmentModel.swift // ConcurrencyDemo // // Created by Dhairav Mehta on 23/01/18. // Copyright © 2018 Hossam Ghareeb. All rights reserved. // import Foundation class DownloadSegmentModel { let name: String let index: Int var downloaded = false let size: Float let downloadUrl: URL init(name: String, size: Float, index: Int, downloadUrl: URL) { self.name = name self.index = index self.size = size self.downloadUrl = downloadUrl } }
[ -1 ]
22ccd5f023f76f0e3228e113f3bc572a8e5e1945
1ba3d589ab3e9ce21307c101feb3c73cd65fc428
/BombsAwayTests/BombsAwayTests.swift
2eac6364adfbacb961e07c66a40efc844103f156
[]
no_license
bladnman/BombsAway
e11121ce2e1f2d64f8d83951e3f16d6de548800c
869054f8afc9880c8e411c68fa6e2b6d6e73e20e
refs/heads/main
2023-03-29T01:09:07.896669
2021-04-04T16:29:20
2021-04-04T16:29:20
343,257,137
0
0
null
null
null
null
UTF-8
Swift
false
false
2,791
swift
// // BombsAwayTests.swift // BombsAwayTests // // Created by Maher, Matt on 3/25/21. // import SceneKit import XCTest class BombsAwayTests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() throws { // This is an example of a performance test case. measure { // Put the code you want to measure the time of here. } } } @testable import BombsAway class BoardRangeTests: XCTestCase { func testCreatingRanges() { var boardRange: BoardRange boardRange = BoardRange(GridPoint(11, 11), BoardSize(columns: 5, rows: 1)) XCTAssertEqual(boardRange.columnRange, 11...15) XCTAssertEqual(boardRange.rowRange, 11...11) boardRange = BoardRange(GridPoint(10, 10), BoardSize(columns: 5, rows: -1)) XCTAssertEqual(boardRange.columnRange, 10...14) XCTAssertEqual(boardRange.rowRange, 10...10) boardRange = BoardRange(GridPoint(10, 10), BoardSize(columns: -5, rows: -1)) XCTAssertEqual(boardRange.columnRange, 6...10) XCTAssertEqual(boardRange.rowRange, 10...10) } } @testable import BombsAway class BoardSizeTests: XCTestCase { func test_boardSizesColRows() { var boardSize: BoardSize boardSize = BoardSize(columns: 5, rows: 0) XCTAssertEqual(boardSize.columns, 5) XCTAssertEqual(boardSize.rows, 0) } func test_boardSizesVectors() { var boardSize: BoardSize boardSize = BoardSize(SCNVector3(1, 0, 1)) XCTAssertEqual(boardSize.columns, 1) XCTAssertEqual(boardSize.rows, 1) boardSize = BoardSize(SCNVector3(10, 0, 0)) XCTAssertEqual(boardSize.columns, 10) XCTAssertEqual(boardSize.rows, 0) } func test_gridPointsForRange() { let startGP = GridPoint(2, 2) let boardRange = BoardRange(startGP, BoardSize(columns: 2, rows: 2)) let gridPoints = gridPointsFor(boardRange: boardRange) XCTAssertEqual(gridPoints.contains(where: {$0.column == 2 && $0.row == 2}), true) XCTAssertEqual(gridPoints.contains(where: {$0.column == 2 && $0.row == 3}), true) XCTAssertEqual(gridPoints.contains(where: {$0.column == 3 && $0.row == 2}), true) XCTAssertEqual(gridPoints.contains(where: {$0.column == 3 && $0.row == 3}), true) } }
[ -1 ]
e5a3d9b79154c112beb335117bec2e4d6a265805
069ba096839f6aea184721aaec980c9b50553480
/ClickAWash/Controllers/Subscriptions/SubscriptionsViewController.swift
93f613c710fb5195d262364298c137588b9dbc3e
[]
no_license
Nayyerali/ClickAWash
395ef5d94a3c878ba903c4d3cb533888e385cc16
740e0e55085c7c4785c5a29c8fc3e82bbb2f9ae7
refs/heads/master
2022-11-22T06:36:01.843288
2020-07-14T19:47:33
2020-07-14T19:47:33
266,936,295
0
0
null
null
null
null
UTF-8
Swift
false
false
295
swift
// // SubscriptionsViewController.swift // ClickAWash // // Created by Nayyer Ali on 5/15/20. // Copyright © 2020 NayyerAli. All rights reserved. // import UIKit class SubscriptionsViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } }
[ -1 ]
02eb63357c0da36426e5837cba317343d0406eed
4b4c8353d6a77603ce8f8f429f93c59a55969377
/mapDemo/MultipleCharts.swift
20e622b01ee8ceb6c60beb6e9e29227bd521a51a
[]
no_license
sushma1261/map-ios
d272f9a183b5e89772370b67f77c8b861c5e5e19
7bc5980e466d61ec441654bdcec208ec744f0bdd
refs/heads/master
2022-04-13T23:54:16.585479
2020-04-11T05:44:34
2020-04-11T05:44:34
254,801,515
0
0
null
null
null
null
UTF-8
Swift
false
false
2,883
swift
// // MultipleCharts.swift // mapDemo // // Created by DVNAGARAJU on 23/02/19. // Copyright © 2019 SVECW-5. All rights reserved. // import UIKit //import SwiftChart import Charts class MultipleCharts: UIViewController,UICollectionViewDelegate,UICollectionViewDataSource { @IBOutlet weak var collView: UICollectionView! func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return tasks1.count; } var arr = [12.3,4,2,1,1,2,4] var days:[String] = ["mon","tue","wed","thu","fri","sat","sun"] let tasks:[[Double]] = [[9.0,2.0,3.0,2.0,5.0,6.0,7.0],[19.0,12.0,23.0,12.0,15.0,6.0,17.0]] let tasks1:[[Double]] = [[10.0,12.0,13.0,12.0,15.01,16.0,17.0],[0.0,2.0,3.0,2.0,5.01,6.0,1.0]] func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collView.dequeueReusableCell(withReuseIdentifier: "GraphCell1", for: indexPath) as! GraphCollCell print("cell") cell.barChartView.noDataText = "no data available" var dataEntries : [BarChartDataEntry] = [] var dataEntries1 : [BarChartDataEntry] = [] var counter = 0.0 for i in 0..<days.count{ counter+=1.0 let dataEntry = BarChartDataEntry(x: Double(i), y: tasks[indexPath.item][i] ) let dataEntry1 = BarChartDataEntry(x: Double(i), y: tasks1[indexPath.item][i] ) dataEntries.append(dataEntry) dataEntries1.append(dataEntry1) } let chartDataSet = BarChartDataSet(values: dataEntries, label: "raw") let chartDataSet1 = BarChartDataSet(values: dataEntries1, label: "treated") let chartData :[BarChartDataSet] = [chartDataSet,chartDataSet1] chartDataSet.colors = [UIColor(red: 0/255, green: 0/255, blue: 255/255, alpha: 1)] chartDataSet1.colors = [UIColor(red: 0/255, green: 255/255, blue: 0/255, alpha: 1)] let chart1 = BarChartData(dataSets : chartData) let groupSpace = 0.3 let barSpace = 0.05 let barWidth = 1 let groupCount = days.count let x = 0 chart1.barWidth = Double(barWidth) cell.barChartView.xAxis.axisMinimum = Double(x) let gg = chart1.groupWidth(groupSpace: groupSpace, barSpace: barSpace) cell.barChartView.xAxis.axisMaximum = Double(x)+gg*Double(groupCount) chart1.groupBars(fromX: Double(x), groupSpace: groupSpace, barSpace: barSpace) cell.barChartView.notifyDataSetChanged() cell.barChartView.data = chart1 return cell } override func viewDidLoad() { super.viewDidLoad() print("Multiple Charts") // Do any additional setup after loading the view. } }
[ -1 ]
bfdcbe7a4b47dc59aabf2114f3d83fd6bd85eeaa
325a47b1f6c82da4a499b06c5417444dc5906058
/UnityTool/UnityEdit.swift
45a1e8f15757a4e32fe995a6725ad4d02a12bf83
[]
no_license
frandfeng/AR
9d63c486235c89b43574746f22ca9969b1d1dce2
e61ceb55275cd01f81ca34a752593035f8068522
refs/heads/master
2021-09-20T11:25:21.259740
2018-08-09T01:23:47
2018-08-09T01:23:47
109,641,871
0
0
null
null
null
null
UTF-8
Swift
false
false
15,978
swift
// // UnityEdit.swift // CityPlus // // Created by frandfeng on 07/02/2017. // Copyright © 2017 JHQC. All rights reserved. // import Foundation public class UnityEdit : NSObject { static let ProjectPath = "/Users/frand/Develop/AR/ARiOS2/"; /// 当工程中第一次导入Unity时需要调用的 public static func startUnityImport() -> Void { if editAppDelegate() { print("修改APPDelegate成功"); } else { print("修改APPDelegate失败"); } if replaceUniTool() { print("替换CPUniViewTool.mm文件成功"); } else { print("替换CPUniViewTool.mm文件失败"); } if replaceMainmm() { print("替换main.mm文件文件成功"); } else { print("替换main.mm文件文件失败"); } if insertHeaderInPch() { print("在pch文件中添加unity头成功"); } else { print("在pch文件中添加unity头失败"); } if insertHeadAndLibSearchPath() { print("在工程文件中插入unity header和lib的搜索路径成功"); } else { print("在工程文件中插入unity header和lib的搜索路径失败"); } } /// 当Unity重新导出需要刷新工程时需要调用的 public static func startUnityRefresh() -> Void { // let res : Bool = removeMainmm(); // if res { // print("移除main.mm成功"); // } else { // print("移除main.mm失败"); // } // let res1 : Bool = replaceDec2Attr(); // if res1 { // print("替换attribute成功"); // } else { // print("替换attribute失败"); // } //修改getAppController,去掉rootViewController的readOnly let res2 : Bool = editGetAppControllerH(); if res2 { print("修改GetAppController.h成功"); } else { print("修改GetAppController.h失败"); } //修改设置window的方法 let res3 : Bool = editGetAppControllerM(); if res3 { print("修改GetAppController.mm成功"); } else { print("修改GetAppController.mm失败"); } //IMPL_APP_CONTROLLER_SUBCLASS(VuforiaNativeRendererController) let res4 : Bool = editVuforia(); if res4 { print("修改VuforiaNativeRendererController成功"); } else { print("修改VuforiaNativeRendererController失败"); } } /// 将Native中的.h文件移动到一个暂时的文件夹中 public static func removeHFile() -> Void { let desNativeDir : String = ProjectPath + "Temp/Native/"; let srcNativeDir : String = ProjectPath + "Unity3DPlugin/Classes/Native/"; let fileManager : FileManager = FileManager.default; do { if fileManager.fileExists(atPath: desNativeDir) { try fileManager.removeItem(atPath: desNativeDir); } try fileManager.createDirectory(at: URL(string:"file://"+desNativeDir)!, withIntermediateDirectories: true, attributes: nil); print(Date()); let hfiles : [String] = try fileManager.contentsOfDirectory(atPath: srcNativeDir); for file : String in hfiles { if (file.contains(".h")) { try fileManager.moveItem(atPath: srcNativeDir+file, toPath: desNativeDir+file); } } print(Date()); } catch let error { print(error.localizedDescription); } } /// 将原来备份的.h文件移动回来 public static func moveHFileBack() -> Void { let srcNativeDir : String = ProjectPath + "Temp/Native/"; let desNativeDir : String = ProjectPath + "Unity3DPlugin/Classes/Native/"; let fileManager : FileManager = FileManager.default; do { print(Date()); let hfiles : [String] = try fileManager.contentsOfDirectory(atPath: srcNativeDir); for file : String in hfiles { if (file.contains(".h")) { try fileManager.moveItem(atPath: srcNativeDir+file, toPath: desNativeDir+file); } } print(Date()); if fileManager.fileExists(atPath: srcNativeDir) { try fileManager.removeItem(atPath: srcNativeDir); } } catch let error { print(error.localizedDescription); } } /// 修改AppDelegate static func editAppDelegate() -> Bool { let file : String = ProjectPath + "CityPlus/CityPlus/Class/AppDelegate/CPAppDelegate.m"; let mFileContent : String = UnityUtil.read(path: file); let myStrings : [String] = mFileContent.components(separatedBy: NSCharacterSet.newlines); var resultString : String = String(); for string : String in myStrings { if (string.hasPrefix("//") && string.contains("#import \"UnityAppController.h\"")) { resultString = resultString.appending(string.substring(from: string.index(string.startIndex, offsetBy: 2))); } else if (string.contains("return nil")) { resultString = resultString.appending(string.replacingOccurrences(of: "return nil", with: "return UnityGetMainWindow()")); } else if (string.contains("self.unityWindow") || string.contains("self.unityController")) { resultString = resultString.appending(string.substring(from: string.index(string.startIndex, offsetBy: 2))); } else { resultString = resultString.appending(string); } resultString = resultString.appending("\n"); } return UnityUtil.writeString(aStr: resultString, toFile: file); } /// 替换CPUniViewTool.mm文件 static func replaceUniTool() -> Bool { let srcDir : String = ProjectPath + "Temp/CPUniViewTool.mm"; let desDir : String = ProjectPath + "CityPlus/CityPlus/Class/Managers/CPUniViewTool.mm"; return UnityUtil.copyItem(fromPath: srcDir, toPath: desDir); } /// 替换main.mm文件 static func replaceMainmm() -> Bool { let srcDir : String = ProjectPath + "Temp/main.mm"; let desDir : String = ProjectPath + "CityPlus/CityPlus/Supporting Files/main.mm"; return UnityUtil.copyItem(fromPath: srcDir, toPath: desDir); } /// 在pch文件中添加unity头 static func insertHeaderInPch() -> Bool { let path : String = ProjectPath + "CityPlus/CityPlus/Supporting Files/CPPrefix.pch"; var content : String = UnityUtil.read(path: path); content = content.replacingOccurrences(of: "#import <UIKit/UIKit.h>", with: "#import <UIKit/UIKit.h>\n\n#include \"Preprocessor.h\"\n#include \"UnityTrampolineConfigure.h\"\n#include \"UnityInterface.h\"\n\n"); let res = UnityUtil.writeString(aStr: content, toFile: path); return res; } /// 在工程文件中插入unity header和lib的搜索路径 static func insertHeadAndLibSearchPath() -> Bool { let path : String = ProjectPath + "CityPlus/CityPlus.xcodeproj/project.pbxproj"; var content : String = UnityUtil.read(path: path); let headerPath : String = "HEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\","; let headerPathEnd : String = headerPath+"\n\t\t\t\t\t\"$(SRCROOT)/../AR3DCity/Unity3DPlugin\","+"\n\t\t\t\t\t\"$(SRCROOT)/../AR3DCity/Unity3DPlugin/Classes\","+"\n\t\t\t\t\t\"$(SRCROOT)/../AR3DCity/Unity3DPlugin/Classes/Native\","+"\n\t\t\t\t\t\"$(SRCROOT)/../AR3DCity/Unity3DPlugin/Classes/UI\","+"\n\t\t\t\t\t\"$(SRCROOT)/../AR3DCity/Unity3DPlugin/Libraries\","+"\n\t\t\t\t\t\"$(SRCROOT)/../AR3DCity/Unity3DPlugin/Libraries/libil2cpp/include\","; content = content.replacingOccurrences(of: headerPath, with: headerPathEnd); let libPath : String = "LIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\","; let libPathEnd : String = libPath+"\n\t\t\t\t\t\"$(SRCROOT)/../AR3DCity/Unity3DPlugin\","+"\n\t\t\t\t\t\"$(SRCROOT)/../AR3DCity/Unity3DPlugin/Libraries\","+"\n\t\t\t\t\t\"$(SRCROOT)/../AR3DCity/Unity3DPlugin/Libraries/Plugins/iOS\","; content = content.replacingOccurrences(of: libPath, with: libPathEnd); return UnityUtil.writeString(aStr: content, toFile: path); } /// 删除main.mm引用 /// /// - Returns: 是否删除main.mm引用成功 static func removeMainmm() -> Bool { let path : String = ProjectPath+"CityPlus/CityPlus.xcodeproj/project.pbxproj"; var keys : Set<String> = []; let propertyList : [String: Any] = UnityUtil.parseProject(path: path)!; //寻找所有的main.mm的id for key1 : String in propertyList.keys { if key1 == "objects" { let propertyList1 : [String: Any] = propertyList[key1] as! [String : Any]; for key2 : String in propertyList1.keys { let propertyList2 : [String: Any] = propertyList1[key2] as! [String : Any]; for key3 : String in propertyList2.keys { if (propertyList2[key3] is String) { let value3 : String = propertyList2[key3] as! String; if (key3 == "path" && value3 == "main.mm") { print("find key "+key2+" and path "+value3); keys.insert(key2); } } } } } } //只保留在AR3DCity/Unity3DPlugin文件夹下的main.mm的id for key1 : String in propertyList.keys { if key1 == "objects" { let propertyList1 : [String: Any] = propertyList[key1] as! [String : Any]; for key2 : String in propertyList1.keys { let propertyList2 : [String: Any] = propertyList1[key2] as! [String : Any]; if (propertyList2.keys.contains("path") && propertyList2["path"] is String) { let path : String = propertyList2["path"] as! String; for key3 : String in propertyList2.keys { if (propertyList2[key3] is [String]) { let value3 : [String] = propertyList2[key3] as! [String]; for value4 : String in value3 { if (keys.contains(value4)) { if (!path.contains("AR3DCity/Unity3DPlugin")) { print("remove key "+value4); keys.remove(value4); } } } } } } } } } print("all id is "+keys.description); if keys.count == 0 { print("find no key"); return false; } //备份project文件,读取备份内容,将内容中关于main.mm的id部分删除,再重写写入project文件 var url : URL = URL(string:"file://"+path)!; let backupURL = UnityUtil.backupURLOf(projectURL: &url); do { if FileManager().fileExists(atPath: backupURL.path) { try FileManager().removeItem(at: backupURL) } try FileManager().moveItem(at: url, to: backupURL) print("已备份project工程文件,地址backupURL: \(backupURL)") let content : String = UnityUtil.read(path: path+".backup"); let myStrings : [String] = content.components(separatedBy: NSCharacterSet.newlines); print(myStrings.count); var resultString : String = String(); for key : String in keys { for string : String in myStrings { if (string.contains(key)) { print(string); } else { resultString = resultString.appending(string).appending("\n"); } } } return UnityUtil.writeString(aStr: resultString, toFile: path); } catch let error { do { print("generate new project file failed: \(error.localizedDescription), try to roll back project file!") try FileManager().moveItem(at: backupURL, to: url) } catch _ { print("roll back project file failed! backup file url: \(backupURL), error: \(error.localizedDescription)") } return false; } } /// 修改il2cpp-config.h中的attribute static func replaceDec2Attr() -> Bool { let path : String = ProjectPath + "Unity3DPlugin/Libraries/libil2cpp/include/il2cpp-config.h"; var content : String = UnityUtil.read(path: path); if content.contains("__declspec(noreturn)") { content = content.replacingOccurrences(of: "__declspec(noreturn)", with: "__attribute__((noreturn))"); let res = UnityUtil.writeString(aStr: content, toFile: path); return res; } else { return false; } } /// 修改GetAppController中的代码 static func editGetAppControllerH() -> Bool { let path : String = ProjectPath + "Unity3DPlugin/Classes/UnityAppController.h"; var content : String = UnityUtil.read(path: path); if !content.contains("#import \"AppDelegate.h\"") { //添加#import "CPAppDelegate.h" content = content.replacingOccurrences(of: "#import <QuartzCore/CADisplayLink.h>", with: "#import <QuartzCore/CADisplayLink.h>\n#import \"AppDelegate.h\""); //替换GetAppController函数 content = content.replacingOccurrences(of: "(UnityAppController*)[UIApplication sharedApplication].delegate", with: "[(AppDelegate*)[UIApplication sharedApplication].delegate unityController]") content = content.replacingOccurrences(of: "@property (readonly, copy, nonatomic) UIViewController* rootViewController;", with: "@property (copy, nonatomic) UIViewController* rootViewController;") let res = UnityUtil.writeString(aStr: content, toFile: path); return res; } else { return false; } } static func editGetAppControllerM() -> Bool { let path : String = ProjectPath + "Unity3DPlugin/Classes/UnityAppController.mm"; var content : String = UnityUtil.read(path: path); if content.contains("- (void)setWindow:(id)object {}") { content = content.replacingOccurrences(of: "- (void)setWindow:(id)object {}", with: "- (void)setWindow:(id)object {_window = object;}"); let res = UnityUtil.writeString(aStr: content, toFile: path); return res; } else { return false; } } static func editVuforia() -> Bool { let path : String = ProjectPath + "Unity3DPlugin/Libraries/Plugins/iOS/VuforiaNativeRendererController.mm"; var content : String = UnityUtil.read(path: path); if content.contains("IMPL_APP_CONTROLLER_SUBCLASS(VuforiaNativeRendererController)") { content = content.replacingOccurrences(of: "IMPL_APP_CONTROLLER_SUBCLASS(VuforiaNativeRendererController)", with: "//IMPL_APP_CONTROLLER_SUBCLASS(VuforiaNativeRendererController)"); let res = UnityUtil.writeString(aStr: content, toFile: path); return res; } else { return false; } } }
[ -1 ]
8a0205144d7c343e94ffcbedf8a05b9388bc9132
e6eb07ec49b98e4065ce814c917737d3d172366f
/RouterTests/Source/Tests/RouterTests.swift
a1e2696db69a1b86b5d62a4f9248c473a81a60c6
[]
no_license
red-davis-ltd/Router
6338138acbd5c74a814d7b1976e092976745781a
7161a678d7cda4e1058e95e0a1353cbb06689406
refs/heads/master
2020-03-07T22:20:09.850010
2018-12-04T08:22:44
2018-12-04T08:22:44
127,751,101
0
0
null
null
null
null
UTF-8
Swift
false
false
1,102
swift
// // RouterTests.swift // RouterTests // // Created by Red Davis on 30/03/2018. // Copyright © 2018 Red Davis. All rights reserved. // import XCTest @testable import DeeplinkRouter internal final class RouterTests: XCTestCase { // MARK: Setup override func setUp() { super.setUp() } override func tearDown() { super.tearDown() } // MARK: Handling URLs internal func testHandlingURL() { let expectation = self.expectation(description: "call handler") let url = URL(string: "http://red.to/a/valueA/c/valueB")! let routeA = Route(path: "a/:varA/c/:varB") { (attributes) -> Bool in XCTAssertEqualOptional("valueA", attributes["varA"]) XCTAssertEqualOptional("valueB", attributes["varB"]) expectation.fulfill() return true } let router = Router() router.register(route: routeA) XCTAssert(router.handle(url: url)) self.waitForExpectations(timeout: 1.0, handler: nil) } }
[ -1 ]
0b51975aef7da07f52f1437caecef0d41f8489ab
9b3f0e0866dcee408241c9441412c96bf562e682
/Destini-iOS13/Model/Story.swift
71fe8906c34f394d22dbb6474fe39b7d12a11591
[]
no_license
christo57/Destini-iOS13
497f1b4c167377e3e5c63d2852ca62c19420e8bd
6b2001cb326b79ab03afd98ed9e381f0570bd753
refs/heads/master
2022-10-15T07:51:02.101534
2020-06-12T13:48:42
2020-06-12T13:48:42
271,788,154
0
0
null
null
null
null
UTF-8
Swift
false
false
635
swift
// // Sotry.swift // Destini-iOS13 // // Created by Angela Yu on 08/08/2019. // Copyright © 2019 The App Brewery. All rights reserved. // import Foundation struct Story { let title: String let choice1: String let choice2: String let choice1Destination: Int let choice2Destination: Int init(title: String, choice1: String, choice1Destination: Int, choice2: String, choice2Destination: Int) { self.title = title self.choice1 = choice1 self.choice2 = choice2 self.choice1Destination = choice1Destination self.choice2Destination = choice2Destination } }
[ 352877, 249230 ]
5f651a7029247f2e390d62e74bb5c48c5cb02da6
82fc012b94a883268bd5403a490594131301d71b
/Classic/project13/Project13/AppDelegate.swift
e282543111319ca0bdf1d5480b2e0c03ec01ce1c
[ "Unlicense" ]
permissive
twostraws/macOS
fd386799d6f92c6a9b28c3e1062a3c1d33e4b198
83a2d0d3104188aaad371fc5962792c2cc19157e
refs/heads/main
2023-02-09T00:04:52.465884
2022-12-29T12:50:10
2022-12-29T12:50:10
155,630,587
239
63
Unlicense
2023-02-04T06:43:50
2018-10-31T22:21:18
Swift
UTF-8
Swift
false
false
463
swift
// // AppDelegate.swift // Project13 // // Created by TwoStraws on 24/10/2016. // Copyright © 2016 Paul Hudson. All rights reserved. // import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { NSColorPanel.shared.showsAlpha = true } func applicationWillTerminate(_ aNotification: Notification) { // Insert code here to tear down your application } }
[ -1 ]
383b924d8da7d2c0c1014e7343267bbe5e8c32ed
4de16d1ee3e5c6c3f2d30098824299a1f09e91e8
/SnowSeeker/SnowSeeker/WelcomeView.swift
45bce5828b837089241c22e5775b86496db8b8ed
[ "MIT" ]
permissive
RobertShrestha/Practice_SwiftUi
feab725f1e9289d4648edbe8f18fc59b3c2933dc
c3d90fae334867d4db5a3f4d48880b4a37c26782
refs/heads/main
2023-01-13T03:27:38.898843
2020-11-22T16:32:14
2020-11-22T16:44:39
315,082,015
0
0
null
null
null
null
UTF-8
Swift
false
false
491
swift
// // WelcomeView.swift // SnowSeeker // // Created by Robert Shrestha on 11/22/20. // import SwiftUI struct WelcomeView: View { var body: some View { Text("Welcome to Snowseekers!") .font(.title) Text("Please select a resort from the left-hand menu; swipe from the left edge to show it.") .foregroundColor(.secondary) } } struct WelcomeView_Previews: PreviewProvider { static var previews: some View { WelcomeView() } }
[ 350448, 383601 ]
2532fb8168a96039770abaff972529427c04d022
8316c6440923899033e3560606ff5184d44dbdd7
/ios/Classes/SwiftFlutterToastPlugin.swift
1ea7094b9a4c1ae2b45ad0cffa413543e1ec4df3
[]
no_license
spporan/flutter_toast_plugin
a5b08644478961abcbd996daf851bbd2c852a422
7335a551ca863ee894bd2c73bd7a023176c6a8b9
refs/heads/master
2021-01-15T00:06:41.439178
2020-02-24T18:00:12
2020-02-24T18:00:12
242,805,460
0
0
null
null
null
null
UTF-8
Swift
false
false
529
swift
import Flutter import UIKit public class SwiftFlutterToastPlugin: NSObject, FlutterPlugin { public static func register(with registrar: FlutterPluginRegistrar) { let channel = FlutterMethodChannel(name: "flutter_toast_plugin", binaryMessenger: registrar.messenger()) let instance = SwiftFlutterToastPlugin() registrar.addMethodCallDelegate(instance, channel: channel) } public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { result("iOS " + UIDevice.current.systemVersion) } }
[ 359393 ]
3f4a13af74915264634c4ff95f35e6f901155902
5363c7eed28d824edfa5251bf4fc0ce0c954e30e
/WeatherAppTests/WeatherAppTests.swift
d26233aaf7e35f8cc870c4f2bf7f1423602ff31d
[]
no_license
DebhoraDsouza/WeatherApp
b6b9065096c5627e369afe415e249247db1ab40d
3ede54953d13a4fe6b4b775ba9b65367a34d15d1
refs/heads/main
2023-01-22T02:55:48.515585
2020-11-25T17:39:00
2020-11-25T17:39:00
314,277,610
0
0
null
null
null
null
UTF-8
Swift
false
false
909
swift
// // WeatherAppTests.swift // WeatherAppTests // // Created by Debhora D Souza on 17/11/20. // import XCTest @testable import WeatherApp class WeatherAppTests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() throws { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 268288, 358410, 182296, 16419, 344107, 399405, 309295, 352315, 385084, 376894, 329814, 338007, 254048, 176232, 385133, 352368, 325776, 422033, 362659, 173, 32941, 153776, 299187, 405687, 180408, 379071, 417988, 309444, 338119, 417994, 377035, 417999, 254170, 327904, 356576, 336120, 344313, 149760, 375051, 180493, 254226, 319763, 272660, 260377, 127284, 332085, 389439, 182598, 250192, 344401, 366930, 155990, 215385, 272729, 321894, 354677, 246137, 106874, 340357, 225670, 395659, 311691, 252308, 291224, 39324, 317852, 340398, 342450, 319930, 336317, 291265, 188871, 342476, 317901, 281037, 334290, 369116, 342498, 340453, 293367, 254456, 340490, 254488, 410136, 375333, 377386, 197167, 236081, 315960, 438849, 348742, 340558, 354911, 436832, 139872, 191082, 184941, 346737, 344696, 356989, 348806, 311945, 369289, 311949, 334481, 346772, 363163, 344738, 139939, 295590, 352937, 295599, 342713, 158394, 248517, 361176, 363230, 385761, 375526, 344828, 363263, 35583, 162561, 295697, 326429, 344865, 342820, 318252, 353078, 355137, 355139, 348998, 355146, 377686, 357218, 207727, 211836, 254850, 260996, 349067, 426895, 349072, 189328, 185250, 289698, 256935, 359338, 140204, 363438, 289722, 349121, 363458, 359364, 381897, 211914, 340955, 248796, 248797, 207838, 343005, 340961, 437221, 203757, 340974, 359406, 347123, 349171, 201720, 328700, 252958, 336929, 357414, 410670, 357423, 359478, 361535, 314436, 248901, 257094, 359495, 361543, 300111, 361566, 253029, 257125, 318572, 351344, 187506, 341115, 248961, 302213, 222343, 337039, 169104, 326804, 351390, 343203, 44203, 253100, 253099, 367799, 113850, 367810, 113861, 140486, 353479, 62665, 353481, 353482, 351446, 134366, 359647, 253167, 353523, 351478, 261377, 353551, 304421, 109861, 130348, 351537, 312634, 312635, 347453, 251213, 296303, 382330, 378244, 253317, 388487, 112018, 306579, 251298, 316842, 343476, 353719, 361927, 366037, 210393, 310757, 54765, 251378, 359930, 300542, 294400, 210433, 253452, 413204, 146964, 398869, 253463, 423453, 349726, 230943, 134686, 355876, 128587, 196187, 374372, 120427, 54893, 138863, 396915, 333430, 370296, 247416, 396922, 366203, 175741, 337534, 339585, 224901, 415374, 345752, 61101, 364207, 224946, 333503, 218819, 345821, 345834, 360177, 175873, 339715, 360195, 345879, 366360, 249626, 339745, 341796, 257830, 362283, 366381, 259899, 204605, 325439, 325445, 360264, 345929, 337745, 255829, 370522, 345951, 345955, 362352, 341879, 253829, 317323, 325515, 184208, 253856, 300963, 362431, 174019, 321480, 380881, 212946, 212951, 219101, 354272, 360417, 354280, 247785, 174057, 247791, 362480 ]
52440b23377b7a3b7004136c525de12cdd222c4f
34c359f079ad9d70294af0f1489c8e5453e5a678
/ApiTap/GreyViewController.swift
e0b4c1964bde24cb5aa1b2481dc1b65d8e9050f3
[]
no_license
ajay121007/ApitapIOSApp
d6e6dbd8344442e93be19391b1843c0e78388d53
bc6c73014e8b43d95dbac82c0184ddf9115df456
refs/heads/master
2020-05-29T13:09:39.035439
2019-05-29T04:42:35
2019-05-29T04:42:35
189,150,725
0
0
null
null
null
null
UTF-8
Swift
false
false
1,184
swift
// // GreyViewController.swift // Pager // // Created by Antonio Alves on 8/16/16. // Copyright © 2016 Cheesecake. All rights reserved. // import UIKit class GreyViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { @IBOutlet weak var tableView: UITableView! var didSelectRow: ((String) -> ())? override func viewDidLoad() { super.viewDidLoad() automaticallyAdjustsScrollViewInsets = false } // MARK: - Table view data source func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return 10 } public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath as IndexPath) cell.textLabel?.text = "Example at index \(indexPath.row + 1)" return cell } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { didSelectRow?("Detail for index \(indexPath.row + 1)") tableView.deselectRow(at: indexPath as IndexPath, animated: true) } }
[ 222864, 376713, 397624 ]
7e4c862d32ffd66ca76fab09fff67e9bf52c6f33
5d4bdef6d5537fa84fc62b872b88925fc282d905
/VDO/Controller/VideoInfoController.swift
77590170226d0a8898f8c24653ccb3e78161df97
[]
no_license
jeregrande/137frontrow
b1fe7122f10cc386ae826f97069cd2c4d32f4975
a13a659920fce4f7647cda8ca0c70197ab6fb81d
refs/heads/master
2020-04-27T04:47:31.126531
2019-05-13T11:48:49
2019-05-13T11:48:49
174,064,836
0
0
null
null
null
null
UTF-8
Swift
false
false
3,206
swift
// // VideoInfoController.swift // VDO // // Created by Juan Castillo on 5/12/19. // Copyright © 2019 137frontrow. All rights reserved. // import UIKit class VideoInfoController: UIViewController, UITableViewDelegate, UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return tableData.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = UITableViewCell(style: UITableViewCell.CellStyle.value1, reuseIdentifier: cellID) cell.textLabel?.text = tableData[indexPath.item].0 if let detail = tableData[indexPath.item].1 as? String { cell.detailTextLabel?.text = detail } if let detail = tableData[indexPath.item].1 as? NSNumber { cell.detailTextLabel?.text = detail.stringValue } cell.backgroundColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1) return cell } let api = API() @IBOutlet weak var metadataTableView: UITableView! let cellID = "cellID" var tableData = [(String, Any)]() var video: Video? {didSet{ getVideoMetadata() }} override func viewDidLoad() { super.viewDidLoad() metadataTableView.register(UITableViewCell.self, forCellReuseIdentifier: cellID) // Do any additional setup after loading the view. } func getVideoMetadata(){ let videoref = api.storageRef.reference(forURL: video!.fileURL) videoref.getMetadata { (metadata, error) in if let error = error { print("error fecthing metadata of video: \(self.video!.videoID)") } else { // let decoder = JSONDecoder() var dict = metadata?.dictionaryRepresentation() print("dict metadata: \(dict)") for (index, keyValue) in dict! { self.tableData.append((index, keyValue)) } DispatchQueue.main.async(execute: { self.metadataTableView.reloadData() }) // if let metadata = try? JSONSerialization.data(withJSONObject: dict!, options: []) { // let video = try? decoder.decode(Video.self, from: data) // completion(video) // } } } } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.tabBarController?.tabBar.isHidden=true } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) self.tabBarController?.tabBar.isHidden=false } /* // 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 ]
acaacd1bcc86664e61d13be341cc12adbca0e732
e3b8624edefeedb170b6a8a492ca7560fd29299f
/OnTheMap_MyProject/Controller/StudentLocationTableViewController.swift
90a2cf44aba824cb9efad72ee80c7f04e592df3f
[]
no_license
pranayboggarapu/OnTheMapProject
f723b3f4147b0c9ade42122afaf8bed7909d4345
e3d836952c51087a5ad8fe28574961db01a392a0
refs/heads/master
2020-06-26T23:07:26.929254
2019-08-11T19:15:53
2019-08-11T19:15:53
199,782,945
0
0
null
null
null
null
UTF-8
Swift
false
false
4,477
swift
// // StudentLocationTableViewController.swift // OnTheMap_MyProject // // Created by Pranay Boggarapu on 8/1/19. // Copyright © 2019 Pranay Boggarapu. All rights reserved. // import UIKit class StudentLocationTableViewController: UITableViewController { //MARK:- Variables declaration var students: StudentList? var spinner = UIActivityIndicatorView(style: .whiteLarge) //MARK:- View load and appear methods override func viewDidLoad() { super.viewDidLoad() spinner.color = UIColor.darkGray navigationItem.title = "On the Map" addNavBarButtons() setLoadingScreen() fetchListOfStudents() } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) fetchListOfStudents() tableView.reloadData() } //MARK:- Handle students service response func handleFetchStudentsListResponse(success: Bool, students: StudentList?, error: Error?) { //when success if success { self.students = students tableView.reloadData() self.removeLoadingScreen() } else { //if fails, display the error displayErrorMessage(errorTitle: "Error!!", errorMessage: "An unforeseen error occured. Please try again.") } } //MARK:- Refresh Button Pressed` override func refreshButtonPressed() { setLoadingScreen() fetchListOfStudents() tableView.reloadData() } //MARK:- Get List of students func fetchListOfStudents() { UdacityAPIClient.getListOfStudentLocations(completionHandler: handleFetchStudentsListResponse) } //MARK:- Logout override func logOutButtonPressed() { UdacityAPIClient.logOutUser { (success, error) in if success { DispatchQueue.main.async { self.dismiss(animated: true, completion: nil) } } else { //show error when service call fails DispatchQueue.main.async { self.displayErrorMessage(errorTitle: "Error", errorMessage: "Unable to logout. Please try again!!") } } } } //MARK:- Set the activity indicator into the main view private func setLoadingScreen() { spinner = UIActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 120, height:120)) spinner.style = .whiteLarge spinner.color = UIColor.darkGray self.spinner.center = CGPoint(x:self.view.center.x, y:self.view.center.y) spinner.contentMode = .scaleAspectFit spinner.startAnimating() tableView.addSubview(spinner) } // Remove the activity indicator from the main view private func removeLoadingScreen() { // Hides and stops the text and the spinner spinner.stopAnimating() spinner.isHidden = true } } //MARK:- TableView Controller to display the data extension StudentLocationTableViewController { //number of rows in each setction override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if let students = students { return students.studentsList.count } return 0 } //height of each row override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 80 } //cell in each row override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "userLocationCell", for: indexPath) as! StudentLocationsCell let firstName = students?.studentsList[indexPath.row].firstName ?? "" let lastName = students?.studentsList[indexPath.row].lastName ?? "" cell.studentName.text = firstName + lastName cell.studentWebsite.text = students?.studentsList[indexPath.row].mediaURL cell.studentImageView.image = UIImage(imageLiteralResourceName: "icon_pin") return cell } //tap functionality of each cell override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if let toOpen = students?.studentsList[indexPath.row].mediaURL { openExternalLink(toOpen) } } }
[ -1 ]
958432cf792612d5803236f42fae7b934ea04f2e
a0178decd41d8f518db72bbec7f465053adc5665
/TextFieldChallengeApp/AppDelegate.swift
2c3699c0065196ba955c427f55699299db4c483d
[]
no_license
travisgillespie/gillespieTextFieldChallengeApp
b0c2a0f5a51a5cf1a6391f1de6aa21859c453c1e
89f234b007f743b2e0f498f25b92e9ec546d1dab
refs/heads/master
2021-01-22T07:32:40.565261
2015-07-31T18:00:36
2015-07-31T18:00:36
40,018,006
0
0
null
null
null
null
UTF-8
Swift
false
false
2,167
swift
// // AppDelegate.swift // TextFieldChallengeApp // // Created by Travis Gillespie on 7/29/15. // Copyright (c) 2015 Travis Gillespie. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 237646, 311375, 163920, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 278648, 131192, 237693, 327814, 131209, 303241, 417930, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 278760, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 278849, 319809, 319810, 319814, 319818, 311628, 229709, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 319978, 279020, 172526, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 287238, 172550, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 279124, 172634, 262752, 311911, 189034, 295533, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 352905, 279178, 287371, 311946, 311951, 287377, 287381, 311957, 221850, 287386, 164509, 287390, 295583, 303773, 230045, 287394, 172705, 303780, 172702, 287398, 172707, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 279231, 287423, 328384, 287427, 312006, 279241, 107212, 172748, 287436, 172751, 295633, 172755, 303827, 279255, 172760, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 312035, 295654, 279272, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 303914, 279340, 205613, 279353, 230202, 312124, 222018, 295755, 377676, 148302, 287569, 279383, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 213895, 320391, 304007, 304009, 304011, 230284, 304013, 213902, 279438, 295822, 189329, 304019, 189331, 279445, 58262, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 304063, 238528, 304065, 189378, 213954, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 295949, 197645, 230413, 320528, 140312, 295961, 238620, 197663, 304164, 189479, 304170, 238641, 312374, 238652, 238655, 230465, 238658, 296004, 336964, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 164973, 205934, 279661, 279669, 337018, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 165038, 238766, 238770, 304311, 230592, 279750, 312518, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 296189, 320771, 312585, 296205, 230674, 320786, 230677, 296213, 296215, 230679, 230681, 320792, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 230718, 378181, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 181626, 304506, 304505, 181631, 312711, 312712, 296331, 288140, 230800, 288144, 304533, 337306, 288154, 288160, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 173488, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 280014, 312783, 288208, 230865, 288210, 370130, 288212, 280021, 288214, 222676, 239064, 288217, 288218, 280027, 288220, 329177, 239070, 288224, 288226, 370146, 280036, 288229, 280038, 288230, 288232, 280034, 288234, 320998, 288236, 288238, 288240, 291754, 288242, 296435, 288244, 288250, 402942, 148990, 296446, 206336, 296450, 321022, 230916, 230919, 214535, 370187, 304651, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 280264, 206536, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 419570, 321266, 288499, 288502, 280314, 288510, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 345921, 280388, 304968, 280393, 280402, 313176, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 313406, 288831, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 280671, 223327, 149601, 321634, 149603, 329830, 280681, 313451, 223341, 280687, 313458, 280691, 215154, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 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, 354653, 313700, 280937, 280940, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 190868, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 281084, 240124, 305662, 305664, 240129, 305666, 305668, 240132, 223749, 281095, 338440, 150025, 223752, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 199262, 338528, 338532, 281190, 281196, 158317, 19053, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 199367, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 207661, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 240519, 322440, 314249, 289687, 240535, 297883, 289694, 289696, 289700, 281529, 289724, 52163, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 314441, 207949, 322642, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 306354, 142531, 199877, 289991, 306377, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 298306, 380226, 281923, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 298365, 290174, 224641, 281987, 265604, 298372, 281990, 298377, 314763, 142733, 298381, 224657, 306581, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 307009, 241475, 307012, 148946, 315211, 282446, 307027, 315221, 282454, 315223, 241496, 323414, 241498, 307035, 307040, 282465, 110433, 241509, 110438, 298860, 110445, 282478, 282481, 110450, 315251, 315249, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 282514, 298898, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 241640, 298984, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 217179, 315483, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 315557, 184486, 307370, 184492, 307372, 307374, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 323784, 307409, 307411, 176343, 299225, 233701, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 282931, 307508, 315701, 307510, 176435, 151864, 307512, 168245, 307515, 332086, 282942, 307518, 151874, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 283080, 176592, 315856, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 291299, 242152, 291305, 176620, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 135689, 233994, 127497, 291341, 233998, 234003, 234006, 152087, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 381677, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 201496, 234264, 234266, 283421, 234269, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 201603, 291714, 291716, 226182, 234375, 234373, 226185, 308105, 234379, 234384, 234388, 234390, 226200, 324504, 234393, 209818, 308123, 324508, 234398, 234396, 291742, 234401, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 234414, 324527, 291760, 234417, 201650, 324531, 234422, 226230, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 226245, 234437, 234439, 234434, 234443, 291788, 193486, 234446, 193488, 275406, 234449, 316370, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234556, 234558, 316479, 234561, 316483, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234595, 300133, 234597, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 300148, 234614, 398455, 144506, 234618, 275579, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 275594, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 324757, 234648, 283805, 234653, 324766, 119967, 234657, 308379, 300189, 242852, 283813, 234661, 300197, 234664, 275626, 234667, 316596, 234687, 316610, 300226, 226500, 234692, 300229, 308420, 283844, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 300289, 292097, 300292, 300294, 275719, 177419, 300299, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 300344, 226617, 243003, 283963, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 284099, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 218597, 292329, 300523, 259565, 259567, 300527, 308720, 226802, 316917, 308727, 292343, 300537, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194101, 284215, 194103, 284218, 226877, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 366155, 276043, 317004, 284238, 226895, 284241, 194130, 284243, 276052, 284245, 276053, 284247, 317015, 284249, 243290, 284251, 300628, 284253, 235097, 284255, 300638, 243293, 284258, 292452, 177766, 284263, 292454, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 284290, 325250, 284292, 276098, 292485, 292479, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 284418, 358146, 317187, 317191, 284428, 300816, 317207, 284440, 186139, 300828, 300830, 276255, 325408, 284449, 300834, 300832, 317221, 227109, 358183, 186151, 276268, 194351, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 292715, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 292776, 276395, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 276466, 227314, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 276539, 235581, 325692, 178238, 276544, 284739, 243785, 276553, 350293, 350295, 194649, 227418, 309337, 194654, 227423, 350302, 178273, 227426, 194657, 194660, 276579, 227430, 276583, 309346, 309348, 309350, 309352, 309354, 350308, 276590, 350313, 227440, 350316, 284786, 350321, 276595, 301167, 350325, 350328, 292985, 301178, 292989, 292993, 301185, 350339, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 153765, 350375, 350379, 350381, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 309462, 301272, 276699, 309468, 194780, 301283, 317672, 276713, 317674, 325867, 243948, 194801, 227571, 309494, 243960, 227583, 276735, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 276775, 211241, 325937, 276789, 325943, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 317833, 178572, 285070, 178575, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 317951, 309764, 121352, 236043, 317963, 342541, 55822, 113167, 317971, 277011, 309781, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 318020, 301636, 277071, 285265, 309844, 277080, 309849, 285277, 285282, 326244, 277100, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 285320, 277128, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 285453, 310029, 228113, 285459, 277273, 326430, 228128, 293666, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 285499, 301884, 310080, 293696, 277314, 277317, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 277368, 15224, 236408, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 276586, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 244731, 121850, 293882, 302075, 293887, 277504, 277507, 277511, 277519, 293908, 277526, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 277608, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 302218, 285835, 294026, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 285862, 277671, 302248, 64682, 277678, 228526, 294063, 294065, 302258, 277687, 294072, 318651, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 204023, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 228617, 138505, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 277822, 417086, 286016, 294211, 302403, 384328, 277832, 277836, 294221, 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, 277892, 277894, 253320, 310665, 318858, 327046, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 277928, 277932, 310703, 277937, 310710, 130486, 277944, 310712, 310715, 277947, 277950, 228799, 277953, 64966, 245191, 163272, 310727, 277959, 302534, 292968, 302541, 277963, 302543, 277966, 310737, 277971, 286169, 228825, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 286240, 146977, 294435, 187939, 40484, 286246, 40486, 286248, 278057, 294439, 40488, 294440, 294443, 294445, 310831, 40491, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 212560, 228944, 400976, 40533, 147032, 40537, 40539, 278109, 40541, 40544, 40548, 40550, 286312, 286313, 40554, 40552, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 278150, 310925, 286354, 278163, 302740, 122517, 278168, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 319171, 302789, 294599, 278216, 294601, 343757, 212690, 278227, 286420, 319187, 229076, 286425, 319194, 278235, 301163, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 171774, 278274, 302852, 278277, 302854, 294664, 311048, 319243, 311053, 302862, 319251, 294682, 278306, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 237409, 360317, 327554, 40840, 40851, 294803, 188312, 294811, 319390, 294817, 319394, 40865, 294821, 311209, 180142, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
e316a248721ed8dcd26f1af49e145c07b425e93f
38bb05fc2110e16166d4d38c155d3614ab6df806
/Algorithm/Array/main.swift
010394a2e0d7fb3f671057f6cb7751e982fa6f17
[ "MIT" ]
permissive
liqinwen/algorithm
6d44f5783315c8fef3cee3701eea13e955e89168
171af7337bead1849f04dc68819c5133b293681f
refs/heads/master
2022-12-16T03:18:56.787262
2020-08-23T12:02:06
2020-08-23T12:02:06
null
0
0
null
null
null
null
UTF-8
Swift
false
false
951
swift
// // main.swift // Array // // Created by ggl on 2019/3/20. // Copyright © 2019年 ggl. All rights reserved. // import Foundation var array = DynamicExpansionArray(capcity: 10) for i in 1..<20 { array.add(num: i) } array.print() array.insert(num: 30, at: 25) array.print() array.insert(num: 31, at: 2) array.print() array.remove(at: 1) array.print() print("\n=====================================") var set = DynamicExpansionSet(capcity: 10) for i in 1..<20 { set.add(num: i) } set.print() set.add(num: 99) set.print() set.remove(num: 15) set.print() set.add(num: 87) set.print() print("\n=====================================") let array1 = [1, 8, 9, 10, 14] let array2 = [4, 9, 13, 20, 25] let count = array1.count + array2.count let sortedArray = mergeTwoSortedArray(arrOne: array1, arrOneCount: array1.count, arrTwo: array2, arrTwoCount: array2.count) printArray(arr: sortedArray, count: count) sortedArray.deallocate()
[ -1 ]
81e17468e5e681935f57897df09b632541c16322
af8a534c8bdae7c887bc809060230cd5e8134307
/CLDemo-Swift/CLDemo-Swift/Extension/AutoScale+Extension.swift
76cb8607b236df104f81292af6b8ff6756b0c74a
[]
permissive
993695620/CLDemo
86c1fb5f457adadee837274b6a0f44584033dced
d58ddf8adc1c4fc4686dbfa33de404e23ceccc8e
refs/heads/master
2022-08-14T20:02:57.647357
2022-02-14T07:49:52
2022-07-15T09:56:07
170,422,762
0
0
MIT
2019-04-01T03:27:59
2019-02-13T02:01:35
Objective-C
UTF-8
Swift
false
false
3,850
swift
// // AutoScale+Extension.swift // CL // // Created by JmoVxia on 2020/4/24. // Copyright © 2020 JmoVxia. All rights reserved. // import UIKit enum InchWidth: Double { case iPhone5 = 320 case iPhone6 = 375 static var iPhoneX: InchWidth { return .iPhone6 } } enum InchHeight: Double { case iPhone5 = 568 case iPhone6 = 667 case iPhoneX = 812 } extension Double { private func rounded(_ decimalPlaces: Int) -> Double { let divisor = pow(10.0, Double(max(0, decimalPlaces))) return (self * divisor).rounded() / divisor } func autoWidth(_ inch: InchWidth = .iPhone6) -> Double { guard UIDevice.current.userInterfaceIdiom == .phone else { return self } let base = inch.rawValue let screenWidth = Double(UIScreen.main.bounds.width) let screenHeight = Double(UIScreen.main.bounds.height) let width = min(screenWidth, screenHeight) - Double(safeAreaEdgeInsets.left - safeAreaEdgeInsets.right) return (self * (width / base)).rounded(3) } func autoHeight(_ inch: InchHeight = .iPhone6) -> Double { guard UIDevice.current.userInterfaceIdiom == .phone else { return self } let base = inch.rawValue let screenWidth = Double(UIScreen.main.bounds.width) let screenHeight = Double(UIScreen.main.bounds.height) let height = max(screenWidth, screenHeight) - Double(safeAreaEdgeInsets.top - safeAreaEdgeInsets.bottom) return (self * (height / base)).rounded(3) } } extension BinaryInteger { func autoWidth(_ inch: InchWidth = .iPhone6) -> Double { let temp = Double("\(self)") ?? 0 return temp.autoWidth(inch) } func autoWidth<T: BinaryInteger>(_ inch: InchWidth = .iPhone6) -> T { let temp = Double("\(self)") ?? 0 return T(temp.autoWidth(inch)) } func autoWidth<T: BinaryFloatingPoint>(_ inch: InchWidth = .iPhone6) -> T { let temp = Double("\(self)") ?? 0 return T(temp.autoWidth(inch)) } func autoHeight(_ inch: InchHeight = .iPhone6) -> Double { let temp = Double("\(self)") ?? 0 return temp.autoHeight(inch) } func autoHeight<T: BinaryInteger>(_ inch: InchHeight = .iPhone6) -> T { let temp = Double("\(self)") ?? 0 return T(temp.autoHeight(inch)) } func autoHeight<T: BinaryFloatingPoint>(_ inch: InchHeight = .iPhone6) -> T { let temp = Double("\(self)") ?? 0 return T(temp.autoHeight(inch)) } } extension BinaryFloatingPoint { func autoWidth(_ inch: InchWidth = .iPhone6) -> Double { let temp = Double("\(self)") ?? 0 return temp.autoWidth(inch) } func autoWidth<T: BinaryInteger>(_ inch: InchWidth = .iPhone6) -> T { let temp = Double("\(self)") ?? 0 return T(temp.autoWidth(inch)) } func autoWidth<T: BinaryFloatingPoint>(_ inch: InchWidth = .iPhone6) -> T { let temp = Double("\(self)") ?? 0 return T(temp.autoWidth(inch)) } func autoHeight(_ inch: InchHeight = .iPhone6) -> Double { let temp = Double("\(self)") ?? 0 return temp.autoHeight(inch) } func autoHeight<T: BinaryInteger>(_ inch: InchHeight = .iPhone6) -> T { let temp = Double("\(self)") ?? 0 return T(temp.autoHeight(inch)) } func autoHeight<T: BinaryFloatingPoint>(_ inch: InchHeight = .iPhone6) -> T { let temp = Double("\(self)") ?? 0 return T(temp.autoHeight(inch)) } } extension CGSize { func autoWidth(_ inch: InchWidth = .iPhone6) -> CGSize { return CGSize(width: width.autoWidth(), height: height.autoWidth()) } func autoHeight(_ inch: InchHeight = .iPhone6) -> CGSize { return CGSize(width: width.autoHeight(), height: height.autoHeight()) } }
[ -1 ]
02855cccb916a98d162af349f8e6b04d1bdd13f5
d9db98c50f66d6b4a141b029e2b10ad500abb721
/EmptyStateKit/Classes/EmptyStateView.swift
ca4616e7ea30d61e32ffacd04fa4617f018d6867
[ "MIT" ]
permissive
mohsinalimat/EmptyStateKit
f8b77f00afbe7844550c596d72e9f93089b5ba03
1860e136a96adc9aba62c0eec3b65f60bfb13b3b
refs/heads/master
2020-05-30T19:46:52.922114
2019-05-30T10:42:37
2019-05-30T10:42:37
189,932,309
2
1
null
2019-06-03T04:04:34
2019-06-03T04:04:34
null
UTF-8
Swift
false
false
5,922
swift
// // EmptyStateView.swift // StateView // // Created by Alberto Aznar de los Ríos on 23/05/2019. // Copyright © 2019 Alberto Aznar de los Ríos. All rights reserved. // import UIKit class EmptyStateView: NibView { @IBOutlet weak var messageView: UIView! @IBOutlet weak var coverImageView: UIImageView! @IBOutlet weak var imageView: UIImageView! @IBOutlet weak var titleLabel: UILabel! @IBOutlet weak var descriptionLabel: UILabel! @IBOutlet weak var primaryButton: UIButton! // Constraints @IBOutlet var primaryButtonWidthConstraint: NSLayoutConstraint! @IBOutlet var messageViewCenterYConstraint: NSLayoutConstraint! @IBOutlet var messageViewBottomConstraint: NSLayoutConstraint! @IBOutlet var messageViewTopConstraint: NSLayoutConstraint! @IBOutlet var messageViewLeftConstraint: NSLayoutConstraint! @IBOutlet var messageViewRightConstraint: NSLayoutConstraint! @IBOutlet var primaryButtonCenterXConstraint: NSLayoutConstraint! @IBOutlet var primaryButtonLeftConstraint: NSLayoutConstraint! @IBOutlet var primaryButtonRightConstraint: NSLayoutConstraint! @IBOutlet var primaryButtonTopConstraint: NSLayoutConstraint! @IBOutlet var primaryButtonTop2Constraint: NSLayoutConstraint! @IBOutlet var imageViewTopConstraint: NSLayoutConstraint! @IBOutlet var imageViewBottomConstraint: NSLayoutConstraint! @IBOutlet var imageViewTop2Constraint: NSLayoutConstraint! @IBOutlet var imageViewWidthConstraint: NSLayoutConstraint! @IBOutlet var imageViewHeightConstraint: NSLayoutConstraint! @IBOutlet var titleLabelTopConstraint: NSLayoutConstraint! @IBOutlet weak var coverImageViewTopConstraint: NSLayoutConstraint! @IBOutlet weak var coverImageViewBottomConstraint: NSLayoutConstraint! struct ViewModel { var image: UIImage? var title: String? var description: String? var titleButton: String? } var viewModel = ViewModel() { didSet { fillView() } } var format = EmptyStateFormat() { didSet { updateUI() } } var actionButton: ((UIButton)->())? private var gradientLayer: CAGradientLayer? override func awakeFromNib() { primaryButton.layer.cornerRadius = 20 } @IBAction func didPressPrimaryButton(_ sender: UIButton) { actionButton?(sender) } override func commonInit() { super.commonInit() setupView() } } extension EmptyStateView { private func setupView() { } private func fillView() { if case .cover(_, _) = format.position.image { coverImageView.image = viewModel.image imageView.image = nil } else { coverImageView.image = nil imageView.image = viewModel.image } if let title = viewModel.title { titleLabel.isHidden = false titleLabel.attributedText = NSAttributedString(string: title, attributes: format.titleAttributes) } else { titleLabel.isHidden = true } if let description = viewModel.description { descriptionLabel.isHidden = false descriptionLabel.attributedText = NSAttributedString(string: description, attributes: format.descriptionAttributes) } else { descriptionLabel.isHidden = true } if let titleButton = viewModel.titleButton { primaryButton.isHidden = false primaryButton.setAttributedTitle(NSAttributedString(string: titleButton, attributes: format.buttonAttributes), for: .normal) } else { primaryButton.isHidden = true } } private func updateUI() { imageView.isHidden = false coverImageView.isHidden = true // Primary button format primaryButton.backgroundColor = format.buttonColor primaryButton.layer.cornerRadius = format.buttonRadius primaryButton.layer.shadowColor = format.buttonColor.cgColor primaryButton.layer.shadowOffset = CGSize(width: 0.0, height: 0) primaryButton.layer.masksToBounds = false primaryButton.layer.shadowRadius = format.buttonShadowRadius primaryButton.layer.shadowOpacity = 0.5 if let buttonWidth = format.buttonWidth { primaryButtonWidthConstraint.isActive = true primaryButtonWidthConstraint.constant = buttonWidth } else { primaryButtonWidthConstraint.isActive = false } // Message format messageView.alpha = format.alpha // Background format backgroundColor = format.backgroundColor // Background gradient format if let gradientColor = format.gradientColor { gradientLayer?.removeFromSuperlayer() gradientLayer = CAGradientLayer() gradientLayer?.colors = [gradientColor.0.cgColor, gradientColor.1.cgColor] gradientLayer?.startPoint = CGPoint(x: 0.5, y: 1.0) gradientLayer?.endPoint = CGPoint(x: 0.5, y: 0.0) gradientLayer?.locations = [0, 1] gradientLayer?.frame = bounds layer.insertSublayer(gradientLayer!, at: 0) } else { gradientLayer?.removeFromSuperlayer() } // Setup constraints imageViewWidthConstraint.constant = format.imageSize.width imageViewHeightConstraint.constant = format.imageSize.height setupViewPosition(format.position.view) setupTextPosition(format.position.text) setupImagePosition(format.position.image) setupLateralPosition() } } extension EmptyStateView { func play() { format.animation?.play?(self) } } extension EmptyStateView: NibLoadable {}
[ -1 ]
90f1a715a382cb56d0904491df6068065b0fe3c6
a0c0de3429d01a8b0d6e58c93d6ea66e5c48da3b
/P500X/FeedViewController.swift
1a9a74b447e39ad0f1bd7ec3427f6e9693cc5f21
[]
no_license
ruparocks/P500X
fbfc13bac1586c94096d5f8e932a3458dc0f552c
2a2bdc42b3d94e0d73e7c6bb3a4fc41829bb3f43
refs/heads/master
2021-01-10T04:32:52.300341
2016-02-25T22:51:09
2016-02-25T22:51:09
52,427,756
0
0
null
null
null
null
UTF-8
Swift
false
false
5,032
swift
// // ViewController.swift // P500X // // Created by Rupa Sharma on 2/16/16. // Copyright © 2016 rupasharma. All rights reserved. // import UIKit class FeedViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { @IBOutlet weak var tableView: UITableView! // MARK: - Properties var photos = [Photo]() let searchController = UISearchController(searchResultsController: nil) var filteredPhotos = [Photo]() // MARK: - View Setup override func viewDidLoad() { super.viewDidLoad() getPhotos() searchController.searchResultsUpdater = self searchController.dimsBackgroundDuringPresentation = false definesPresentationContext = true tableView.tableHeaderView = searchController.searchBar searchController.searchBar.searchBarStyle = UISearchBarStyle.Minimal searchController.searchBar.placeholder = "search titles" searchController.searchBar.barTintColor = UIColor.rupaGreen() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // MARK: - Table Setup func numberOfSectionsInTableView(tableView: UITableView) -> Int { return 1 } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if searchController.active && searchController.searchBar.text != "" { return filteredPhotos.count } return self.photos.count } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! PhotoTableViewCell let photo : Photo if searchController.active && searchController.searchBar.text != "" { photo = filteredPhotos[indexPath.row] } else { photo = photos[indexPath.row] } cell.photo = photo return cell } func tableRefresh() { dispatch_async(dispatch_get_main_queue(), { self.tableView.reloadData() return }) } // MARK: - Segues override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showDetail" { let photo : Photo if let indexPath = tableView.indexPathForSelectedRow { if searchController.active && searchController.searchBar.text != "" { photo = filteredPhotos[indexPath.row] } else { photo = photos[indexPath.row] } let controller = segue.destinationViewController as! DetailViewController controller.detailPhoto = photo } } } func filterContentForSearchText(searchText: String, scope: String = "All") { filteredPhotos = photos.filter { photo in return photo.name.lowercaseString.containsString(searchText.lowercaseString) } tableView.reloadData() } //MARk: - Data calls func getPhotos() -> () { let url:NSURL = NSURL(string: "https://api.500px.com/v1/photos?feature=popular&consumer_key=vW8Ns53y0F57vkbHeDfe3EsYFCatTJ3BrFlhgV3W")!; let task = NSURLSession.sharedSession().dataTaskWithURL(url) { (data, response, error) -> Void in if (error != nil) { print(error) } else { if let jsonData = data { do { let jsonResult : NSDictionary = try NSJSONSerialization.JSONObjectWithData(jsonData, options: NSJSONReadingOptions.MutableContainers) as! NSDictionary if let images = jsonResult["photos"] { for var i = 0; i < images.count; i++ { if let name = images[i]["name"] as? String, imageUrl = images[i]["image_url"] as? String, desc = images[i]["description"] as? String, userPicUrl = images[i]["user"]!!["userpic_https_url"] as? String, username = images[i]["user"]!!["fullname"] as? String { let newPhoto : Photo = Photo(name: name, fullname: username, description: desc, imageUrl: imageUrl, userImageUrl: userPicUrl) self.photos.append(newPhoto) self.tableRefresh() } } } } catch { print("Json Serialization error") } } } } task.resume() } } extension FeedViewController: UISearchResultsUpdating { func updateSearchResultsForSearchController(searchController: UISearchController) { filterContentForSearchText(searchController.searchBar.text!) } }
[ -1 ]
b2630bf7878728cd45b2ad32ed53372471bee528
be27b7d78182f9336462af810400452f694fe2f5
/HolidayCalender/ViewController.swift
bde22d988ea6d8c3bfc8ed08a884fb3befb2e425
[]
no_license
gayanimadahapola/HolidayCalender
bd321d772d8408d8d27747c42a4b43d8f8dd8a94
74caa40630e496ee4830110943eceb978cb708fc
refs/heads/master
2021-01-01T13:04:31.956750
2020-02-09T11:21:50
2020-02-09T11:21:50
239,291,621
0
0
null
null
null
null
UTF-8
Swift
false
false
353
swift
// // ViewController.swift // HolidayCalender // // Created by Gayani Madubhashini on 2/9/20. // Copyright © 2020 Gayani Madubhashini. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } }
[ -1 ]
55ee91149ab3debbb82256a552dddee08d1c84b4
895e4da2308b26b064a1eec83dc9a33047187bbd
/Bamboo Breakout/WaitingForTap.swift
a402b707e1dec75cd6e10b294a82a1c9ddcdf1f2
[]
no_license
AOmine-27/ios_bamboo_breakout
0a60c97eb5df6f12a61e1ec26c97e5141668f3c6
952487d2ede6585709ab9a4c29f361b5d36474da
refs/heads/master
2022-12-09T19:56:01.605969
2020-09-04T23:02:37
2020-09-04T23:02:37
292,962,054
0
0
null
null
null
null
UTF-8
Swift
false
false
875
swift
// // WaitingForTap.swift // BreakoutSpriteKitTutorial // // Created by Michael Briscoe on 1/16/16. // Copyright © 2016 Razeware LLC. All rights reserved. // import SpriteKit import GameplayKit class WaitingForTap: GKState { unowned let scene: GameScene init(scene: SKScene) { print("comecou") self.scene = scene as! GameScene super.init() } override func didEnter(from previousState: GKState?) { let scale = SKAction.scale(to: 1.0, duration: 0.25) scene.childNode(withName: GameMessageName)!.run(scale) } override func willExit(to nextState: GKState) { if nextState is Playing { let scale = SKAction.scale(to: 0, duration: 0.4) scene.childNode(withName: GameMessageName)!.run(scale) } } override func isValidNextState(_ stateClass: AnyClass) -> Bool { return stateClass is Playing.Type } }
[ -1 ]
56ed6d3bbfb3ea141c6fc80b1482bbdc441e1827
9923e30eb99716bfc179ba2bb789dcddc28f45e6
/openapi-generator/swift4/OpenAPIClient/Classes/OpenAPIs/Models/FleetVehicleResponse.swift
e53edfac513bca3b3d43bdd1132391711cc7cf6e
[]
no_license
silverspace/samsara-sdks
cefcd61458ed3c3753ac5e6bf767229dd8df9485
c054b91e488ab4266f3b3874e9b8e1c9e2d4d5fa
refs/heads/master
2020-04-25T13:16:59.137551
2019-03-01T05:49:05
2019-03-01T05:49:05
172,804,041
2
0
null
null
null
null
UTF-8
Swift
false
false
1,054
swift
// // FleetVehicleResponse.swift // // Generated by openapi-generator // https://openapi-generator.tech // import Foundation /** A vehicle object as returned for fleet/vehicle */ public struct FleetVehicleResponse: Codable { public var externalIds: [String:String]? /** Harsh event detection setting. */ public var harshAccelSetting: String? /** ID of the vehicle. */ public var _id: Int64 /** Name of the vehicle. */ public var name: String public var vehicleInfo: FleetVehicleResponseVehicleInfo? public init(externalIds: [String:String]?, harshAccelSetting: String?, _id: Int64, name: String, vehicleInfo: FleetVehicleResponseVehicleInfo?) { self.externalIds = externalIds self.harshAccelSetting = harshAccelSetting self._id = _id self.name = name self.vehicleInfo = vehicleInfo } public enum CodingKeys: String, CodingKey { case externalIds case harshAccelSetting case _id = "id" case name case vehicleInfo } }
[ -1 ]
c99168dcf80f39f2f4ebd729ac9e3d0bcad9471f
e3e94fab4d6ac4de97787a3540b0c3cb40d6f5cb
/ShopSearch/Classes/GoogleVendor.swift
4e17e6b90d5759345b4433caf079d487fefdb1c2
[ "MIT" ]
permissive
HieuLsw/ShopSearch
04df8e8de06a0cd9d27cd2aac14201570bd89b68
a86259c77ea91c3d5bfdbd2b213ade6d23d0a3e5
refs/heads/master
2021-08-14T13:42:47.034851
2017-11-15T21:33:39
2017-11-15T21:33:39
null
0
0
null
null
null
null
UTF-8
Swift
false
false
400
swift
// // GoogleVendor.swift // ShopSearch // // Created by Ricardo Koch on 8/6/17. // Copyright © 2017 Ricardo Koch. All rights reserved. // import Foundation public struct GoogleVendor { init(name: String, linkUrl: String) { self.name = name self.linkUrl = linkUrl } public var name: String public var linkUrl: String public var basePrice: NSNumber? public var totalPrice: NSNumber? }
[ -1 ]
5ed72b6a8d09e9454e37a052b7d5eb1057f3d69a
21ea0b237822e37de817603a2b38727413fda0cc
/Study/CodingTest/Knowre/ProblemKit/ProblemView.swift
4e80e1213eae88caba11a555be9dc6dea75af187
[]
no_license
sungeunDev/Sungeun_iOS
270a5e2a98d0283492f9907a2b1ef9b1b0d88018
97ec11da68fdb3cc5ba69ab98f6134804fe00610
refs/heads/master
2021-06-22T12:34:55.926598
2019-08-28T00:53:28
2019-08-28T00:53:28
128,873,395
1
1
null
null
null
null
UTF-8
Swift
false
false
2,769
swift
// // ProblemView.swift // ProblemKit // // Created by Joshua Park on 16/07/2018. // Copyright © 2018 Knowre. All rights reserved. // import UIKit @objc public protocol ProblemViewDelegate { func problemView(_ problemView: ProblemView, didSubmitAnswer: String) } public class ProblemView: UIView { /// A factory method to instantiate a `ProblemView` object /// from the Interface Builder. public class func loadFromNib() -> ProblemView { let bundle = Bundle(for: ProblemView.self), nib = bundle.loadNibNamed("ProblemView", owner: nil, options: nil)! return nib[0] as! ProblemView } @IBOutlet public weak var delegate: ProblemViewDelegate? @IBOutlet private var problemLabel: UILabel! @IBOutlet private var textField: UITextField! @IBOutlet private var submitButton: UIButton! @IBOutlet private var resultImageView: UIImageView! // MARK: - Public /** Displays the problem on view. - Parameter problem: The problem data to display. */ public func displayProblem(_ problem: ProblemData) { problemLabel.text = problem.problem } public func clearDisplay() { problemLabel.text = "" textField.text = "" submitButton.isUserInteractionEnabled = false submitButton.backgroundColor = .gray resultImageView.image = nil } /** Displays the result on view. - Parameter result: The result of solving the problem. */ public func displayResult(_ result: Bool) { if result { resultImageView.image = UIImage(named: "correct", in: Bundle(for: type(of: self)), compatibleWith: nil) } else { resultImageView.image = UIImage(named: "incorrect", in: Bundle(for: type(of: self)), compatibleWith: nil) } } // MARK: - Private @IBAction private func submitAction(_ sender: Any) { assert(textField.text != nil) delegate?.problemView(self, didSubmitAnswer: textField.text!) } } extension ProblemView: UITextFieldDelegate { public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { let text = (textField.text! as NSString).replacingCharacters(in: range, with: string) if !text.isEmpty{ submitButton.backgroundColor = UIColor(red: 57/255, green: 213/255, blue: 121/255, alpha: 1) submitButton.isUserInteractionEnabled = true } else { submitButton.backgroundColor = .gray submitButton.isUserInteractionEnabled = false } return true } }
[ -1 ]
7286bdee3b44c2d937ed9c2f8fba91c6743919d0
c5ebb7b064092c79f7adc6ebd694d85fd74312bf
/iOS/4/MovieApplication/MovieApplicationTests/MovieApplicationTests.swift
ce90acec38a35acd2b71c7f27bcda747abaeb43f
[]
no_license
kpkuchur/SER-598
7986d89777a1ed5d02ac99df346e7663a6a3d1dc
a9e2e9a1dc130521ab17b672ddaefc3cc4e8c0a1
refs/heads/master
2021-01-20T13:23:38.959999
2016-05-20T05:22:01
2016-05-20T05:22:01
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,002
swift
// // MovieApplicationTests.swift // MovieApplicationTests // // Created by gnayak2 on 2/15/16. // Copyright © 2016 gnayak2. All rights reserved. // import XCTest @testable import MovieApplication class MovieApplicationTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock { // Put the code you want to measure the time of here. } } }
[ 313357, 305179, 145435, 317467, 278558, 241692, 239650, 229413, 292902, 354343, 204840, 354345, 227370, 223274, 278570, 233517, 155694, 309295, 229424, 282672, 315434, 325674, 237620, 241716, 229430, 180280, 288828, 288833, 288834, 286788, 315465, 311372, 311374, 354385, 196691, 223316, 280661, 315476, 278615, 329814, 307289, 354393, 200794, 315487, 237663, 45153, 309345, 280675, 227428, 307301, 280677, 313447, 43110, 321637, 131178, 278634, 329829, 319598, 288879, 299121, 284788, 204916, 223350, 233590, 280694, 237689, 131191, 288889, 292988, 215166, 131198, 292992, 194691, 227460, 280712, 215178, 319629, 235662, 311438, 325776, 278677, 284825, 284826, 311458, 278691, 233636, 299174, 233642, 284842, 239793, 299187, 180408, 227513, 278714, 223419, 295098, 280762, 299198, 258239, 280768, 301251, 227524, 309444, 280778, 282831, 321745, 280795, 227548, 229597, 194782, 301279, 311519, 356576, 280802, 176362, 346346, 286958, 125169, 327929, 329765, 194820, 321800, 278797, 338197, 282909, 299293, 278816, 237857, 227616, 211235, 217380, 305440, 211238, 151847, 282919, 332083, 332085, 280887, 332089, 278842, 315706, 282939, 307517, 287041, 260418, 311621, 139589, 280902, 319813, 182597, 282960, 6481, 325968, 366929, 289110, 305495, 6489, 379225, 168281, 332123, 334171, 323935, 106847, 332127, 354655, 321894, 416104, 280939, 285040, 313713, 242033, 199029, 291192, 315773, 211326, 291198, 311681, 332167, 242058, 311691, 227725, 240016, 108944, 190871, 291224, 285084, 317852, 283038, 242078, 141728, 61857, 285090, 61859, 315810, 289189, 315811, 381347, 108972, 299441, 293303, 283064, 278970, 311738, 293310, 291265, 278978, 291267, 127427, 127428, 283075, 311745, 278989, 281037, 317901, 281040, 278993, 289232, 326100, 278999, 328152, 176601, 369116, 188894, 287198, 279008, 160225, 358882, 285150, 279013, 127465, 279018, 311786, 330218, 291311, 281072, 309744, 109042, 319987, 279029, 279032, 233978, 279039, 301571, 291333, 342536, 287241, 279050, 303631, 283153, 279057, 279062, 289304, 279065, 291358, 180771, 293419, 244269, 283182, 283184, 236081, 23092, 234036, 279094, 338490, 70209, 309830, 70215, 115270, 55881, 377418, 281166, 281171, 287318, 285271, 309846, 295519, 66150, 244327, 111208, 279146, 313966, 281199, 295536, 287346, 287352, 301689, 244347, 279164, 291454, 152203, 330379, 311949, 287374, 316049, 330387, 330388, 111253, 230040, 314009, 295576, 303771, 221852, 111258, 205471, 279206, 279210, 287404, 295599, 285361, 303793, 299699, 342706, 299700, 166582, 289462, 314040, 287417, 158394, 303803, 164533, 285373, 287422, 109241, 248517, 287433, 225995, 154316, 363211, 287439, 242386, 279252, 96984, 287452, 289502, 299746, 295652, 279269, 285415, 342762, 293612, 230125, 289518, 312047, 279280, 299759, 230134, 199414, 154359, 299770, 234234, 221948, 279294, 205568, 242433, 295682, 299776, 285444, 291592, 322313, 326414, 312079, 322319, 295697, 291604, 207640, 283419, 291612, 293664, 281377, 326433, 234277, 283430, 279336, 289576, 262954, 295724, 312108, 152365, 285487, 164656, 301871, 303920, 262962, 318252, 230199, 285497, 293693, 289598, 160575, 281408, 295744, 295746, 318278, 201549, 201551, 281427, 353109, 281433, 230234, 322395, 301918, 295776, 109409, 293730, 349026, 303972, 230248, 177001, 201577, 308076, 242541, 400239, 330609, 174963, 207732, 310131, 109428, 228215, 209783, 209785, 279417, 308092, 158593, 113542, 287622, 109447, 228233, 228234, 308107, 416646, 316298, 236428, 56208, 308112, 234386, 293781, 209817, 324506, 324507, 289690, 127902, 310176, 310178, 283558, 289703, 279464, 293800, 310182, 240552, 353195, 236461, 293806, 316333, 304051, 316343, 289722, 230332, 189374, 353215, 19399, 213960, 279498, 316364, 183248, 50143, 314342, 234472, 234473, 52200, 326635, 203757, 289774, 183279, 287731, 277492, 316405, 240630, 295927, 304122, 312314, 314362, 328700, 328706, 234500, 277509, 293893, 134150, 322570, 330763, 320527, 234514, 308243, 238610, 316437, 140310, 230423, 197657, 281626, 175132, 326685, 238623, 189474, 300068, 238639, 300084, 312373, 203830, 322612, 238651, 302139, 308287, 21569, 214086, 238664, 234577, 296019, 339030, 353367, 234587, 277597, 304222, 281697, 302177, 230499, 281700, 314467, 285798, 300135, 322663, 228458, 281706, 279660, 207979, 318572, 15471, 144496, 234609, 312434, 316526, 353397, 285814, 300151, 279672, 300150, 337017, 160891, 285820, 300158, 150657, 187521, 234625, 285828, 279685, 302213, 222343, 302216, 285830, 228491, 228493, 234638, 177296, 308372, 185493, 326804, 238743, 119962, 283802, 296092, 285851, 300187, 300188, 302240, 306338, 234663, 249002, 300202, 306346, 238765, 279728, 238769, 208058, 64700, 228540, 228542, 230588, 283840, 302274, 279747, 283847, 353479, 353481, 283852, 279760, 290000, 189652, 279765, 189653, 148696, 279774, 304351, 298208, 333022, 298212, 304356, 290022, 279785, 228588, 234733, 279792, 353523, 298228, 302325, 234742, 216315, 292091, 208124, 228609, 320770, 234755, 292107, 312587, 251153, 177428, 173334, 245019, 126237, 115998, 339234, 333090, 130343, 279854, 298291, 171317, 318775, 286013, 333117, 286018, 279875, 300359, 304456, 312648, 294218, 234827, 224586, 222541, 296270, 234831, 238927, 296273, 331090, 120148, 314709, 314710, 283991, 357719, 134491, 316765, 222559, 292195, 294243, 230756, 281957, 163175, 333160, 284014, 306542, 279920, 296303, 327025, 296307, 249204, 249205, 181625, 111993, 290169, 290173, 306559, 306560, 224640, 179587, 294275, 298374, 142729, 368011, 304524, 296335, 112017, 234898, 306579, 112018, 224661, 282007, 318875, 310692, 279974, 282022, 282024, 241066, 316842, 314798, 286129, 173491, 304564, 279989, 292283, 228795, 280004, 300487, 306631, 296392, 280010, 284107, 310732, 302540, 280013, 64975, 312782, 306639, 310736, 222675, 327121, 228827, 286172, 239068, 280032, 144867, 103909, 187878, 316902, 245223, 280041, 191981, 282096, 306673, 321009, 308723, 329200, 306677, 191990, 300535, 280055, 288249, 286202, 300536, 290300, 286205, 302590, 290301, 294400, 230913, 282114, 300542, 306692, 306693, 292356, 296461, 323087, 282129, 323089, 308756, 282136, 282141, 302623, 187938, 306723, 286244, 245292, 230959, 288309, 290358, 288318, 194110, 280130, 56902, 288327, 282183, 218696, 292425, 292423, 243274, 333388, 228943, 286288, 224847, 118353, 280147, 300630, 290390, 306776, 128599, 235095, 44635, 239198, 333408, 157281, 286306, 282213, 317032, 310889, 312940, 204397, 222832, 224883, 314998, 333430, 288378, 175741, 337535, 294529, 239237, 282245, 286343, 282246, 229001, 288392, 290443, 312965, 188048, 323217, 239250, 282259, 302739, 229020, 298654, 282271, 282273, 302754, 257699, 282276, 40613, 40614, 40615, 282280, 290471, 229029, 298667, 300714, 298661, 61101, 321199, 286388, 286391, 300728, 337591, 280251, 327358, 282303, 286399, 280257, 323264, 218819, 321219, 333509, 306890, 280267, 302797, 9936, 9937, 302802, 280278, 286423, 282327, 278233, 18138, 278234, 67292, 298712, 278240, 229088, 298720, 282339, 321249, 153319, 12010, 282348, 239341, 280300, 282355, 282358, 313081, 229113, 286459, 300794, 325371, 194303, 194304, 288512, 278272, 311042, 67332, 288516, 280327, 216839, 280329, 300811, 284429, 284431, 243472, 321295, 161554, 278291, 323346, 278293, 282391, 116505, 284442, 286494, 282400, 313120, 241441, 315171, 282409, 284459, 294700, 280366, 282417, 200498, 296755, 280372, 282427, 319292, 282434, 315202, 307011, 325445, 280390, 282438, 153415, 280392, 304977, 307025, 413521, 325457, 317269, 18262, 216918, 307031, 280410, 188251, 284507, 300894, 245599, 237408, 284512, 284514, 302946, 296806, 276327, 292712, 282474, 288619, 288620, 325484, 280430, 296814, 282480, 292720, 313203, 325492, 300918, 241528, 194429, 325503, 315264, 305026, 188292, 241540, 327557, 67463, 282504, 243591, 315273, 315274, 243597, 110480, 184208, 282518, 282519, 329622, 214937, 214938, 294809, 239514, 298909, 294814, 294807, 311199, 300963, 292771, 313254, 294823, 298920, 284587, 292782, 317360, 282549, 288697, 290746, 294843, 98239, 237504, 214977, 280514, 294850, 163781, 280519, 214984, 284619, 344013, 231375, 301008, 194515, 292837, 294886, 317415, 296941, 278512, 311281, 311282, 223218, 333817, 292858, 290811 ]
fb47cd5b79530117713a8a565c390bc0155774a5
0dce7ea4b567c95bde02116b9dfdae36dd58afa5
/InclusiveUITests/InclusiveUITests.swift
7d1adaeeae9a28deaa0ab97b5281ab1846cd17c7
[]
no_license
SamFurlong30/CS316Project
f80b30714f72e825d6f98311d575cf4833afc02e
35c10a7cc3bed03c12ee47b5fd268b4e8425cd65
refs/heads/master
2021-08-29T18:47:37.060576
2017-12-14T17:08:21
2017-12-14T17:08:21
112,403,768
0
0
null
null
null
null
UTF-8
Swift
false
false
1,251
swift
// // InclusiveUITests.swift // InclusiveUITests // // Created by Sam Furlong on 11/17/17. // Copyright © 2017 Sam Furlong. All rights reserved. // import XCTest class InclusiveUITests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. XCUIApplication().launch() // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } }
[ 155665, 237599, 229414, 278571, 229425, 229431, 180279, 319543, 213051, 286787, 237638, 311373, 196687, 278607, 311377, 368732, 180317, 278637, 319599, 278642, 131190, 131199, 278669, 278676, 311447, 327834, 278684, 278690, 311459, 278698, 278703, 278707, 180409, 278713, 295099, 139459, 131270, 229591, 147679, 311520, 147680, 319719, 295147, 286957, 319764, 278805, 311582, 278817, 311596, 336177, 98611, 278843, 287040, 319812, 311622, 319816, 229716, 278895, 287089, 139641, 311679, 311692, 106893, 156069, 311723, 377265, 311739, 319931, 278974, 336319, 311744, 278979, 336323, 278988, 278992, 279000, 369121, 279009, 188899, 279014, 319976, 279017, 311787, 319986, 279030, 311800, 279033, 279042, 287237, 377352, 279053, 303634, 303635, 279060, 279061, 279066, 188954, 279092, 377419, 303693, 115287, 189016, 295518, 287327, 279143, 279150, 287345, 287348, 189054, 287359, 303743, 164487, 279176, 311944, 344714, 311948, 311950, 311953, 336531, 287379, 295575, 303772, 221853, 205469, 279207, 295591, 295598, 279215, 279218, 287412, 164532, 287418, 303802, 66243, 287434, 287438, 279249, 303826, 369365, 369366, 279253, 230105, 295653, 230120, 279278, 312046, 230133, 279293, 205566, 295688, 312076, 295698, 221980, 336678, 262952, 262953, 279337, 262957, 164655, 328495, 303921, 230198, 222017, 295745, 279379, 295769, 230238, 230239, 279393, 303973, 279398, 295797, 295799, 279418, 336765, 287623, 279434, 320394, 189327, 189349, 279465, 304050, 189373, 213956, 345030, 213961, 279499, 304086, 304104, 123880, 320492, 320495, 287730, 320504, 312313, 214009, 312315, 312317, 328701, 328705, 418819, 320520, 230411, 320526, 238611, 140311, 238617, 197658, 336930, 132140, 189487, 312372, 238646, 238650, 320571, 336962, 238663, 205911, 296023, 156763, 230500, 214116, 279659, 238706, 312435, 279666, 230514, 279686, 222344, 337037, 296091, 238764, 279729, 148674, 312519, 279752, 148687, 189651, 279766, 189656, 279775, 304352, 304353, 279780, 279789, 279803, 320769, 312588, 320795, 320802, 304422, 312628, 345398, 222523, 181568, 279872, 279874, 304457, 345418, 230730, 337228, 296269, 222542, 238928, 296274, 230757, 296304, 312688, 230772, 337280, 296328, 296330, 304523, 9618, 279955, 148899, 279979, 279980, 173492, 279988, 280003, 370122, 280011, 337359, 329168, 312785, 222674, 329170, 280020, 280025, 239069, 320997, 280042, 280043, 329198, 337391, 296434, 288248, 288252, 312830, 230922, 329231, 304655, 230933, 222754, 312879, 230960, 288305, 239159, 157246, 288319, 288322, 280131, 124486, 288328, 239192, 99937, 345697, 312937, 312941, 206447, 288377, 337533, 280193, 239238, 288391, 239251, 280217, 198304, 337590, 280252, 296636, 280253, 321217, 280259, 321220, 296649, 239305, 280266, 9935, 313042, 280279, 18139, 280285, 321250, 337638, 181992, 288492, 34547, 67316, 313082, 288508, 288515, 280326, 116491, 280333, 124691, 116502, 321308, 321309, 280367, 280373, 280377, 321338, 280381, 345918, 280386, 280391, 280396, 337746, 18263, 370526, 296807, 296815, 313200, 313204, 124795, 182145, 280451, 67464, 305032, 124816, 214936, 337816, 124826, 329627, 239515, 214943, 313257, 288698, 214978, 280517, 280518, 214983, 231382, 329696, 190437, 313322, 329707, 174058, 296942, 124912, 313338, 239610, 182277, 313356, 305173, 223269, 354342, 354346, 313388, 124974, 321589, 215095, 288829, 288835, 313415, 239689, 354386, 329812, 223317, 354394, 321632, 280676, 313446, 215144, 288878, 288890, 215165, 329884, 215204, 125108, 280761, 223418, 280767, 338118, 280779, 321744, 280792, 280803, 182503, 338151, 125166, 125170, 395511, 313595, 125180, 125184, 125192, 125197, 125200, 125204, 338196, 125215, 125225, 338217, 321839, 125236, 280903, 289109, 379224, 239973, 313703, 280938, 321901, 354671, 354672, 199030, 223611, 248188, 313726, 240003, 158087, 313736, 240020, 190870, 190872, 289185, 305572, 289195, 338359, 289229, 281038, 281039, 281071, 322057, 182802, 322077, 289328, 338491, 322119, 281165, 281170, 281200, 313970, 297600, 289435, 314020, 248494, 166581, 314043, 363212, 158424, 322269, 338658, 289511, 330473, 330476, 289517, 215790, 125683, 199415, 289534, 322302, 35584, 322312, 346889, 264971, 322320, 166677, 207639, 281378, 289580, 281407, 289599, 281426, 281434, 322396, 281444, 207735, 314240, 158594, 330627, 240517, 289691, 240543, 289699, 289704, 289720, 289723, 281541, 19398, 191445, 183254, 183258, 207839, 314343, 183276, 289773, 248815, 240631, 330759, 330766, 330789, 248871, 281647, 322609, 314437, 207954, 339031, 314458, 281698, 281699, 322664, 314493, 150656, 347286, 330912, 339106, 306339, 249003, 208044, 322733, 3243, 339131, 290001, 339167, 298209, 290030, 208123, 322826, 126229, 298290, 208179, 159033, 216387, 372039, 224591, 331091, 314708, 150868, 314711, 314721, 281958, 314727, 134504, 306541, 314734, 314740, 314742, 314745, 290170, 224637, 306558, 290176, 306561, 314752, 314759, 298378, 314771, 306580, 224662, 282008, 314776, 282013, 290206, 314788, 314790, 282023, 298406, 241067, 314797, 306630, 306634, 339403, 191980, 282097, 306678, 191991, 290304, 323083, 323088, 282132, 282135, 175640, 282147, 306730, 290359, 323132, 282182, 224848, 224852, 290391, 306777, 323171, 282214, 224874, 314997, 290425, 339579, 282244, 323208, 282248, 323226, 282272, 282279, 298664, 298666, 306875, 282302, 323262, 323265, 282309, 306891, 241360, 282321, 241366, 282330, 282336, 12009, 282347, 282349, 323315, 200444, 282366, 249606, 282375, 323335, 282379, 216844, 118549, 282390, 282399, 241440, 282401, 339746, 315172, 216868, 241447, 282418, 282424, 282428, 413500, 241471, 315209, 159563, 307024, 307030, 241494, 307038, 282471, 282476, 339840, 315265, 282503, 315272, 315275, 184207, 282517, 298912, 118693, 298921, 126896, 200628, 282572, 282573, 323554, 298987, 282634, 241695, 315431, 102441, 315433, 102446, 282671, 241717, 307269, 233548, 315468, 315477, 200795, 323678, 315488, 315489, 45154, 217194, 233578, 307306, 249976, 241809, 323730, 299166, 233635, 299176, 184489, 323761, 184498, 258233, 299197, 299202, 176325, 299208, 233678, 282832, 356575, 307431, 184574, 217352, 315674, 282908, 299294, 282912, 233761, 282920, 315698, 332084, 307514, 282938, 127292, 168251, 323914, 201037, 282959, 250196, 168280, 323934, 381286, 242027, 242028, 250227, 315768, 315769, 291194, 291193, 291200, 242059, 315798, 291225, 242079, 283039, 299449, 291266, 373196, 283088, 283089, 242138, 176602, 160224, 291297, 242150, 283138, 233987, 324098, 340489, 283154, 291359, 283185, 234037, 340539, 234044, 332379, 111197, 242274, 291455, 316044, 184974, 316048, 316050, 340645, 176810, 299698, 291529, 225996, 135888, 242385, 299737, 234216, 234233, 242428, 291584, 299777, 291591, 291605, 283418, 234276, 283431, 242481, 234290, 201534, 283466, 201562, 234330, 275294, 349025, 357219, 177002, 308075, 242540, 242542, 201590, 177018, 308093, 291713, 340865, 299912, 316299, 234382, 308111, 308113, 209820, 283551, 177074, 127945, 340960, 340967, 324587, 234476, 201721, 234499, 234513, 316441, 300087, 21567, 308288, 160834, 349254, 300109, 234578, 250965, 250982, 234606, 300145, 300147, 234626, 234635, 177297, 308375, 324761, 119965, 234655, 300192, 234662, 300200, 324790, 300215, 283841, 283846, 283849, 316628, 251124, 234741, 283894, 316661, 292092, 234756, 242955, 177420, 292145, 300342, 333114, 333115, 193858, 300354, 300355, 234830, 283990, 357720, 300378, 300379, 316764, 292194, 284015, 234864, 316786, 243073, 292242, 112019, 234902, 333224, 284086, 259513, 284090, 54719, 415170, 292291, 300488, 300490, 234957, 144862, 300526, 308722, 300539, 210429, 292359, 218632, 316951, 374297, 235069, 349764, 194118, 292424, 292426, 333389, 349780, 128600, 235096, 300643, 300645, 243306, 325246, 333438, 235136, 317102, 300725, 300729, 333508, 333522, 325345, 153318, 333543, 284410, 284425, 300810, 300812, 284430, 161553, 284436, 325403, 341791, 325411, 186148, 186149, 333609, 284460, 300849, 325444, 153416, 325449, 317268, 325460, 341846, 284508, 300893, 284515, 276326, 292713, 292719, 325491, 333687, 317305, 317308, 325508, 333700, 243590, 243592, 325514, 350091, 350092, 350102, 333727, 219046, 333734, 284584, 292783, 300983, 153553, 292835, 6116, 292838, 317416, 325620, 333827, 243720, 292901, 325675, 243763, 325695, 333902, 227432, 194667, 284789, 284790, 292987, 227459, 194692, 235661, 333968, 153752, 284827, 333990, 284840, 284843, 227517, 309443, 227525, 301255, 227536, 301270, 301271, 325857, 334049, 317676, 309504, 194832, 227601, 325904, 334104, 211239, 334121, 317738, 325930, 227655, 383309, 391521, 285031, 416103, 227702, 211327, 227721, 285074, 227730, 285083, 293275, 317851, 227743, 285089, 293281, 301482, 375211, 334259, 293309, 317889, 326083, 129484, 326093, 285152, 195044, 334315, 236020, 293368, 317949, 342537, 309770, 334345, 342560, 227881, 293420, 236080, 23093, 244279, 244280, 301635, 309831, 55880, 301647, 326229, 309847, 244311, 244326, 301688, 244345, 301702, 334473, 326288, 227991, 285348, 318127, 293552, 342705, 285362, 285360, 154295, 342757, 285419, 170735, 342775, 375552, 228099, 285443, 285450, 326413, 285457, 285467, 326428, 318247, 293673, 318251, 301872, 285493, 285496, 301883, 342846, 293702, 318279, 244569, 301919, 293729, 351078, 310132, 228214, 269179, 228232, 416649, 236427, 252812, 293780, 310166, 277404, 310177, 293801, 326571, 326580, 326586, 359365, 211913, 326602, 56270, 203758, 277493, 293894, 293911, 326684, 113710, 318515, 203829, 277600, 285795, 228457, 318571, 187508, 302202, 285819, 285823, 285833, 318602, 285834, 228492, 162962, 187539, 326803, 285850, 302239, 302251, 294069, 294075, 64699, 228541, 343230, 310496, 228587, 302319, 228608, 318732, 245018, 318746, 130342, 130344, 130347, 286012, 294210, 286019, 294220, 318804, 294236, 327023, 327030, 310650, 179586, 294278, 318860, 368012, 318876, 343457, 245160, 286128, 286133, 310714, 302523, 228796, 302530, 228804, 310725, 302539, 310731, 310735, 327122, 310747, 286176, 187877, 310758, 40439, 286201, 359931, 286208, 245249, 228868, 302602, 294413, 359949, 302613, 302620, 245291, 310853, 286281, 196184, 212574, 204386, 204394, 138862, 310896, 294517, 286344, 286351, 188049, 229011, 229021, 302751, 245413, 212649, 286387, 286392, 302778, 286400, 212684, 302798, 286419, 294621, 294629, 286457, 286463, 319232, 278273, 278292, 278294, 294699, 286507, 319289, 237397, 188250, 237411, 327556, 188293, 311183, 294806, 294808, 319393, 294820, 294824, 343993, 98240, 294849, 24531, 294887, 278507, 311277, 327666, 278515 ]
2f8a33e8634233abf6630294d6d56ac861098a69
dfa59b65f13389756579eb47ad4f990fbb3ac620
/Todoey/Data Model/Item.swift
dbe3bb3080f9b76c9bf919a88986ecf9192c3395
[]
no_license
felipecs81/Todoey
d8600f832d89ab10e24920e334d2f7cc316beedb
ac71ea8a2649b9ed241a07a756142756007e9cde
refs/heads/master
2020-04-29T21:39:14.223659
2019-04-10T08:31:51
2019-04-10T08:31:51
176,419,649
0
0
null
null
null
null
UTF-8
Swift
false
false
387
swift
// // Item.swift // Todoey // // Created by Felipe on 5/4/19. // Copyright © 2019 Felipe. All rights reserved. // import Foundation import RealmSwift class Item: Object{ @objc dynamic var title: String = "" @objc dynamic var done: Bool = false @objc dynamic var dateCreated : Date? var parentCategory = LinkingObjects(fromType: Category.self, property: "items") }
[ -1 ]
0d661fa542bc55b82c8f7bf0be36479b6bb60771
2546124718fffdfca65d0ebc6ff87f44898e0e9b
/Tests/JavaScriptKit/Expressions/ExecutionTests.swift
c3cc14a996219eec0d6609225618924fdc80acba
[ "MIT" ]
permissive
hboon/JavaScriptKit
6af19cdc87aaaea9abc8661329373591f4f810f4
60156bbc1f13555a90482c64d08b32f16f9809f4
refs/heads/master
2020-03-21T12:51:22.523942
2018-06-25T08:48:51
2018-06-25T08:48:51
138,575,283
3
0
MIT
2018-06-25T09:49:01
2018-06-25T09:49:01
null
UTF-8
Swift
false
false
29,440
swift
import XCTest import WebKit import Result @testable import JavaScriptKit /// /// Tests executing JavaScript expressions inside a web view. /// /// ## Usage /// To execute tests: /// /// ~~~swift /// testInWebView { /// webView in /// // Run your tests in this block. /// } /// ~~~ /// /// You can also use expectations in `testInWebView`: /// /// ~~~swift /// let callbackExpectation = expectation(description: "...") /// /// testInWebView(expectations: [callbackExpectation] { /// webView in /// callbackExpectation.fullfill() /// } /// ~~~ /// /// The default timeout is 10s. /// /// class ExecutionTests: XCTestCase { /// The web view where to execute the tests. var webView: WKWebView! /// Les URLs vers les ressources nécéssaires à l'éxécution des tests. let resources: (supportBundle: URL, html: URL) = { let supportBundleURL = Bundle(for: ExecutionTests.self) .url(forResource: "UnitTestsSupport", withExtension: "bundle")! let htmlURL = supportBundleURL.appendingPathComponent("Tests.html", isDirectory: false) return (supportBundleURL, htmlURL) }() /// The pending action queue. Managaed by the test case, do not manipulate. var actionQueue = [(WKWebView) -> Void]() // MARK: - Lifecycle override func setUp() { webView = WKWebView() webView.navigationDelegate = self } override func tearDown() { webView.navigationDelegate = nil webView = nil } } // MARK: - Test Expected Results extension ExecutionTests { /// Tests getting a property. func testProperty() { let property = JSVariable<String>("tester.title") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in property.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertSuccess(result, expectedValue: "AppFoundation Tests") } } } /// Tests executing a function that returns a value of the expected type. func testSuccessReturnValue() { let method = JSFunction<Bool>("tester.refresh") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertSuccess(result, expectedValue: true) } } } /// Tests executing a function that returns Void. func testVoidSuccessValue() { let method = JSFunction<JSVoid>("tester.clearQueue") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertSuccess(result, expectedValue: JSVoid()) } } } /// Tests that an error is thrown when the function does not exist. func testExpectedError() { let method = JSFunction<JSVoid>("yolo.refresh") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertExecutionError(result) } } } } // MARK: - Test Invalid Value Handling extension ExecutionTests { /// Tests that an error is thrown when an argument cannot be encoded. func testHandleExpressionGenerationError() { let value = NotSoEncodable(name: "Error") let method = JSFunction<JSVoid>("tester.refresh", arguments: [value]) let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertInvalidExpressionError(result) } } } /// Tests that an error is thrown when a value is returned and Void is expected. func testHandleUnexpectedReturnValue() { let method = JSFunction<JSVoid>("tester.refresh") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertInvalidTypeError(result, expectedFailingValue: true) } } } /// Tests that an error is thrown when the type is mismatching. func testInvalidReturnValue() { let method = JSFunction<String>("tester.refresh") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertInvalidTypeError(result, expectedFailingValue: true) } } } /// Tests that an error is thrown when the function does not return a value. func testMissingReturnValue() { let method = JSFunction<Bool>("tester.clearQueue") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertUnexpectedResultError(result) } } } } // MARK: - Test JS to Native decoding extension ExecutionTests { // MARK: Primitives /// Tests decoding a String. func testDecodeString() { let method = JSFunction<String>("tester.testString") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertSuccess(result, expectedValue: "Hello, world!") } } } /// Tests decoding a number. func testDecodeNumber() { let method = JSFunction<Int8>("tester.testNumber") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertSuccess(result, expectedValue: 42) } } } /// Tests decoding a Bool. func testDecodeBool() { let method = JSFunction<Bool>("tester.testBool") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertSuccess(result, expectedValue: true) } } } /// Tests decoding a Date. func testDecodeDate() { let method = JSFunction<Date>("tester.testDate") let resultExpectation = expectation(description: "Async execution callback is called") let testDate = Date(timeIntervalSince1970: 1500) testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertSuccess(result, expectedValue: testDate) } } } // MARK: RawRepresentable /// Tests decoding a RawRepresentable. func testDecodeValidRawRepresentable() { let method = JSFunction<MockTargetType>("tester.testValidMockTargetType") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertSuccess(result, expectedValue: .app) } } } /// Tests decoding an invalid RawRepresentable. func testDecodeInvalidRawRepresentable() { let method = JSFunction<MockTargetType>("tester.invalidTestMockTargetRawType") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertInvalidTypeError(result, expectedFailingValue: 100) } } } // MARK: Objects /// Tests decoding an object. func testDecodeObject() { let method = JSFunction<MockTarget>("tester.testTarget") let resultExpectation = expectation(description: "Async execution callback is called") let expectedTarget = MockTarget(name: "Client", targetType: .app, categories: ["News", "Entertainment"]) testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertSuccess(result, expectedValue: expectedTarget) } } } /// Tests failure when an object is expected but a primitive is returned. func testDecodeInvalidObject() { let method = JSFunction<MockTarget>("tester.invalidTestTarget") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertInvalidTypeError(result, expectedFailingValue: false) } } } /// Tests decoding failure. func testDecodeInvalidObjectPrototype() { let method = JSFunction<MockTarget>("tester.invalidTestTargetPrototype") let resultExpectation = expectation(description: "Async execution callback is called") let expectedFailingPayload: [AnyHashable : Any] = [ "name": "Client", "targetType": "app", "categories": NSNull() ] testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertInvalidTypeError(result, expectedFailingValue: expectedFailingPayload) } } } // MARK: Array of Primitives /// Tests decoding an array of primitives. func testDecodeArrayOfPrimitives() { let method = JSFunction<[UInt16]>("tester.testPrimitivesArray") let resultExpectation = expectation(description: "Async execution callback is called") let expectedArray: [UInt16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertSuccess(result, expectedValue: expectedArray) } } } /// Tests decoding and invalid array of primitives. func testDecodeInvalidArrayOfPrimitives() { let method = JSFunction<[UInt16]>("tester.testInvalidPrimitivesArray") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertInvalidTypeError(result, expectedFailingValue: "trolld") } } } /// Tests decoding an array of invalid primitives (mixed types). func testDecodeInvalidMixedArrayOfPrimitives() { let method = JSFunction<[String]>("tester.testInvalidMixedPrimitivesArray") let resultExpectation = expectation(description: "Async execution callback is called") let expectedFailingArray: [Any] = [1, "un", 2, "deux", 3, "trois"] testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertInvalidTypeError(result, expectedFailingValue: expectedFailingArray) } } } // MARK: Array of RawRepresentable /// Tests decoding an array of Raw Representables. func testDecodeArrayOfRawRepresentable() { let method = JSFunction<[MockTargetType]>("tester.testMockTargetTypes") let resultExpectation = expectation(description: "Async execution callback is called") let expectedValue: [MockTargetType] = [.app, .executable] testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertSuccess(result, expectedValue: expectedValue) } } } /// Tests decoding an array of invalid raw representable values. func testDecodeInvalidArrayOfRawRepresentable() { let method = JSFunction<[MockTargetType]>("tester.testInvalidMockTargetTypes") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertInvalidTypeError(result, expectedFailingValue: false) } } } /// Tests decoding an array that doesnt match the expected raw type. func testDecodeInvalidRawTypesArray() { let method = JSFunction<[MockTargetType]>("tester.testInvalidRawMockTargetTypes") let resultExpectation = expectation(description: "Async execution callback is called") let expectedFailingArray = [1, 2, 3] testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in resultExpectation.fulfill() self.assertInvalidTypeError(result, expectedFailingValue: expectedFailingArray) } } } /// Tests decoding an unknown raw value. func testDecodeUnknownRawValue() { let method = JSFunction<[MockTargetType]>("tester.testUnknownRawMockTargetTypes") let resultExpectation = expectation(description: "Async execution callback is called") let expectedFailingArray = ["app", "kext"] testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertInvalidTypeError(result, expectedFailingValue: expectedFailingArray) } } } // MARK: Array of Object /// Tests decoding an array of objects. func testDecodeArrayOfObjects() { let method = JSFunction<[MockTarget]>("tester.testObjects") let resultExpectation = expectation(description: "Async execution callback is called") let expectedArray: [MockTarget] = [ MockTarget(name: "Client", targetType: .app, categories: ["News", "Entertainment"]), MockTarget(name: "ClientTests", targetType: .unitTest, categories: ["DT", "Tests"]) ] testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertSuccess(result, expectedValue: expectedArray) } } } /// Tests decoding an invalid array of objects. func testDecodeInvalidArrayOfObjects() { let method = JSFunction<[MockTarget]>("tester.testInvalidObjects") let resultExpectation = expectation(description: "Async execution callback is called") testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertInvalidTypeError(result, expectedFailingValue: false) } } } /// Tests failure when decoding an array of invalid objects. func testDecodeInvalidObjectContainingArray() { let method = JSFunction<[MockTarget]>("tester.textMixedObjects") let resultExpectation = expectation(description: "Async execution callback is called") let expectedFailingValue: [AnyHashable] = [ ["name": "Client", "targetType": "app", "categories": ["News"]] as NSDictionary, false ] testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertInvalidTypeError(result, expectedFailingValue: expectedFailingValue) } } } /// Tests failure when the value is an array containing invalid prototypes. func testDecodeInvalidObjectPrototypeContainingArray() { let method = JSFunction<[MockTarget]>("tester.textDifferentObjectPrototypes") let resultExpectation = expectation(description: "Async execution callback is called") let expectedFailingValue: [AnyHashable] = [ ["name": "Client", "targetType": "app", "categories": ["News"]] as NSDictionary, ["name": "SpaceTravelKit"] as NSDictionary, ] testInWebView(expectations: [resultExpectation]) { webView in method.evaluate(in: webView) { result in assert(Thread.isMainThread) resultExpectation.fulfill() self.assertInvalidTypeError(result, expectedFailingValue: expectedFailingValue) } } } } // MARK: - Asserts extension ExecutionTests { /// Asserts that the result is a success containing the given value. func assertSuccess<R: Equatable, E>(_ result: Result<R, E>, expectedValue: R) { switch result { case .success(let value): XCTAssertEqual(value, expectedValue) case .failure(let error): XCTFail("Unexpected error : \(error)") } } /// Asserts that the result is a success containing the given value. func assertSuccess<R: Equatable, E>(_ result: Result<[R], E>, expectedValue: Array<R>) { switch result { case .success(let value): XCTAssertEqual(value, expectedValue) case .failure(let error): XCTFail("Unexpected error : \(error)") } } /// Asserts that the result is an invalid type error. func assertInvalidTypeError<R, T: Equatable>(_ result: Result<R, JSErrorDomain>, expectedFailingValue: T) { switch result { case .success(_): XCTFail("A value was returned but an `invalidReturnType` error was expected.") case .failure(let error): switch error { case .invalidReturnType(let value): XCTAssertTrue((value as? T) == expectedFailingValue, "A type error was thrown, but the associated value does not match the expected one.") XCTAssertEqual(error.nsError.domain, JSErrorDomain.identifier, "Incorrect error domain.") XCTAssertEqual(error.nsError.localizedDescription, error.errorDescription) case .executionError(_): XCTFail("An `executionError` error was thrown, expected`invalidReturnType` error.") case .unexpectedResult: XCTFail("An `unexpectedResult` error was thrown, expected `invalidReturnType` error.") case .invalidExpression(_): XCTFail("An `invalidExpression` error was thrown, expected `invalidReturnType` error.") } } } /// Asserts that the result is an invalid type error. func assertInvalidTypeError<R>(_ result: Result<[R], JSErrorDomain>, expectedFailingValue: [Any]) { switch result { case .success(_): XCTFail("A value was returned but an `invalidReturnType` error was expected.") case .failure(let error): switch error { case .invalidReturnType(let value): XCTAssertTrue((value as? NSArray)?.isEqual(to: expectedFailingValue) == true, "A type error was thrown, but the associated value does not match the expected one.") XCTAssertEqual(error.nsError.domain, JSErrorDomain.identifier, "Incorrect error domain.") XCTAssertEqual(error.nsError.localizedDescription, error.errorDescription) case .executionError(_): XCTFail("An `executionError` error was thrown, expected`invalidReturnType` error.") case .unexpectedResult: XCTFail("An `unexpectedResult` error was thrown, expected `invalidReturnType` error.") case .invalidExpression(_): XCTFail("An `unexpectedResult` error was thrown, expected `invalidExpression` error.") } } } /// Asserts that the result is an invalid type error. func assertInvalidTypeError<R>(_ result: Result<R, JSErrorDomain>, expectedFailingValue: [AnyHashable : Any]) { switch result { case .success(_): XCTFail("A value was returned but an `invalidReturnType` error was expected.") case .failure(let error): switch error { case .invalidReturnType(let value): XCTAssertTrue((value as? NSDictionary)?.isEqual(to: expectedFailingValue) == true, "A type error was thrown, but the associated value does not match the expected one.") XCTAssertEqual(error.nsError.domain, JSErrorDomain.identifier, "Incorrect error domain.") XCTAssertEqual(error.nsError.localizedDescription, error.errorDescription) case .executionError(_): XCTFail("An `executionError` error was thrown, expected`invalidReturnType` error.") case .unexpectedResult: XCTFail("An `unexpectedResult` error was thrown, expected `invalidReturnType` error.") case .invalidExpression(_): XCTFail("An `invalidExpression` error was thrown, expected `invalidReturnType` error.") } } } /// Asserts that the result is an execution error. func assertExecutionError<R>(_ result: Result<R, JSErrorDomain>) { switch result { case .success(_): XCTFail("A value was returned but an `executionError` error was expected.") case .failure(let error): switch error { case .invalidReturnType(_): XCTFail("An `invalidReturnType` error was thrown, expected `executionError` error.") case .executionError(_): XCTAssertEqual(error.nsError.domain, JSErrorDomain.identifier, "Incorrect error.") XCTAssertEqual(error.nsError.localizedDescription, error.errorDescription) case .unexpectedResult: XCTFail("An `unexpectedResult` error was thrown, expected `executionError` error.") case .invalidExpression(_): XCTFail("An `invalidExpression` error was thrown, expected `executionError` error.") } } } /// Asserts that the result is an unexpected result error. func assertUnexpectedResultError<R>(_ result: Result<R, JSErrorDomain>) { switch result { case .success(_): XCTFail("A value was returned but an `unexpectedResult` error was expected.") case .failure(let error): switch error { case .invalidReturnType(_): XCTFail("An `invalidReturnType` error was thrown, expected`unexpectedResult` error.") case .executionError(_): XCTFail("An `executionError` error was thrown, expected`unexpectedResult` error.") case .unexpectedResult: XCTAssertEqual(error.nsError.domain, JSErrorDomain.identifier, "Incorrect error domain.") XCTAssertEqual(error.nsError.localizedDescription, error.errorDescription) case .invalidExpression(_): XCTFail("An `invalidExpression` error was thrown, expected `unexpectedResult` error.") } } } /// Asserts that the result is an invalid expression error. func assertInvalidExpressionError<R>(_ result: Result<R, JSErrorDomain>) { switch result { case .success(_): XCTFail("A value was returned but an `invalidExpression` error was expected.") case .failure(let error): switch error { case .invalidReturnType(_): XCTFail("An `invalidReturnType` error was thrown, expected`invalidExpression` error.") case .executionError(_): XCTFail("An `executionError` error was thrown, expected `invalidExpression` error.") case .unexpectedResult: XCTFail("An `unexpectedResult` error was thrown, expected `invalidExpression` error.") case .invalidExpression(let underlyingError): XCTAssertEqual(error.nsError.domain, JSErrorDomain.identifier) XCTAssertEqual(underlyingError.domain, NSCocoaErrorDomain) XCTAssertEqual(error.nsError.localizedDescription, error.errorDescription) } } } } // MARK: - Web View Support extension ExecutionTests: WKNavigationDelegate { /// /// Éxécute un test dans la WebView. /// /// Cette méthode ne doit être utilisée qu'une seule fois par fonction de test. /// /// - parameter expectations: Une éventuelle liste d'expectations utilisées dans le bloc de test. /// - parameter timeout: Le timeout pour les `expecations`. Par défaut, 10 secondes. /// - parameter webViewAction: Le bloc de test à éxécuter une fois que la WebView a fini de charger les /// éléments de test. /// func testInWebView(expectations: [XCTestExpectation] = [], timeout: TimeInterval = 10, _ webViewAction: @escaping (WKWebView) -> Void) { _queue(webViewAction) _launchActions() if expectations.count > 0 { wait(for: expectations, timeout: timeout) } } private func _queue(_ webViewAction: @escaping (WKWebView) -> Void) { actionQueue.append(webViewAction) } private func _launchActions() { webView.loadFileURL(resources.html, allowingReadAccessTo: resources.supportBundle) } func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { for action in actionQueue { action(webView) } } }
[ -1 ]
01d64dd6a14188cd52b05165fb3db23b87acc83e
49bfca463062b17211f10eebbc3f7537acf0b9ff
/Las Recetitas/DescargarYParsear.swift
b0db090b709b58d831456ad85dee66b5a2ca30fd
[]
no_license
laurasirco/Las-Recetitas
95886165c6752e7039d39bcf681ea6bbaad103db
dab1cbe98e24e97e0954163e4b811992754cf05e
refs/heads/master
2016-09-15T01:53:44.552433
2015-09-23T17:33:24
2015-09-23T17:33:24
43,015,548
0
0
null
null
null
null
UTF-8
Swift
false
false
4,043
swift
// // DescargarYParsear.swift // Las Recetitas // // Created by Laura Sirvent Collado on 28/8/15. // Copyright © 2015 Laura Sirvent Collado. All rights reserved. // import Foundation import UIKit class DescargarYParsear: NSObject { let app_id = "178e427e" let app_key = "f42850f63ffda23a176b10e18a0fc532" let busca_base_url = "http://api.campbellskitchen.com/brandservice.svc/api/search?" let get_base_url = "http://api.campbellskitchen.com/brandservice.svc/api/recipe/" //keywords=chocolate&format=json&app_id=178e427e&app_key=f42850f63ffda23a176b10e18a0fc532" override init() { } func descargarListaRecetasPorKeywords(keywords: String, completionHandler: ((NSArray!) -> Void)!) -> Void { var arrayRecetas : NSArray! = NSArray() var urlString = "\(busca_base_url)keywords=\(keywords)&format=json&app_id=\(app_id)&app_key=\(app_key)" urlString = urlString.stringByReplacingOccurrencesOfString(" ", withString: "") let url = NSURL(string: urlString) //let url = NSURL(string: "http://api.campbellskitchen.com/brandservice.svc/api/search?keywords=tomato&format=json&app_id=178e427e&app_key=f42850f63ffda23a176b10e18a0fc532") let task = NSURLSession.sharedSession().dataTaskWithURL(url!) { (data, response, error) -> Void in //print(data) if let urlContent = data { do { let jsonResult = try NSJSONSerialization.JSONObjectWithData(urlContent, options: NSJSONReadingOptions.MutableContainers) //print(jsonResult) let allObject = jsonResult as? NSDictionary arrayRecetas = allObject!.valueForKey("recipes") as? NSArray return completionHandler(arrayRecetas) } catch { print("Error JSON") } } } task.resume() } class func descargarImagen(url: NSURL, handler: ((image: UIImage, NSError!) -> Void)) { let imageRequest: NSURLRequest = NSURLRequest(URL: url) NSURLConnection.sendAsynchronousRequest(imageRequest, queue: NSOperationQueue.mainQueue(), completionHandler:{response, data, error in handler(image: UIImage(data: data!)!, error) }) } func descargarRecetaPorID(ID: String, completionHandler: ((NSDictionary!) -> Void)!) -> Void { var urlString = "\(get_base_url)\(ID)?format=json&app_id=\(app_id)&app_key=\(app_key)" urlString = urlString.stringByReplacingOccurrencesOfString(" ", withString: "") let url = NSURL(string: urlString) //let url = NSURL(string: "http://api.campbellskitchen.com/brandservice.svc/api/search?keywords=tomato&format=json&app_id=178e427e&app_key=f42850f63ffda23a176b10e18a0fc532") let task = NSURLSession.sharedSession().dataTaskWithURL(url!) { (data, response, error) -> Void in //print(data) if let urlContent = data { do { let jsonResult = try NSJSONSerialization.JSONObjectWithData(urlContent, options: NSJSONReadingOptions.MutableContainers) //print(jsonResult) let allObject = jsonResult as? NSDictionary let receta = allObject!.valueForKey("results") as? NSDictionary //arrayRecetas = allObject!.valueForKey("recipes") as? NSArray return completionHandler(receta) } catch { print("Error JSON") } } } task.resume() } }
[ -1 ]
23212674240e80d5ff52e0a50bb9fc29af71d4ba
87c19d3d27c09ccbcf12e3a7ee0dd5bb22c6e401
/Vobble/Classes/Controllers/Home/ChatViewController_BACKUP_5628.swift
ed4c5f1fd8e980f5a0c6e50448c7274fa9ebddd5
[]
no_license
molhamstein/Vobble
c48be417cd1a511c1326658b5da661d8b91d215e
12b7379a9ef406cdcdead1a07db8c7efbe3f8cb7
refs/heads/master
2022-06-18T02:28:17.955885
2019-11-07T10:45:35
2019-11-07T10:45:35
121,665,441
2
0
null
2022-06-02T21:26:11
2018-02-15T18:26:30
Swift
UTF-8
Swift
false
false
78,493
swift
/* * Copyright (c) 2015 Razeware LLC * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ import UIKit import Photos import Firebase import JSQMessagesViewController import SwiftyJSON import NYTPhotoViewer import SDRecordButton import Flurry_iOS_SDK import SDWebImage import AVFoundation import FillableLoaders final class ChatViewController: JSQMessagesViewController, UIGestureRecognizerDelegate { // MARK: Properties private let imageURLNotSetKey = "NOTSET" var conversationRef: DatabaseReference? var conversationOriginalObject: Conversation? // passed by deeplinking var conversationId: String? private lazy var firstReplyRef: DatabaseReference = self.conversationRef!.child("is_seen") private lazy var messageRef: DatabaseReference = self.conversationRef!.child("messages") private var unseenCountRef: DatabaseReference? private var lastSeenMessageRef: DatabaseReference? private lazy var userIsTypingRef: DatabaseReference = self.conversationRef!.child("typingIndicator").child(self.senderId) private lazy var usersTypingQuery: DatabaseQuery = self.conversationRef!.child("typingIndicator").queryOrderedByValue().queryEqual(toValue: true) private var newMessageRefHandle: DatabaseHandle? private var updatedMessageRefHandle: DatabaseHandle? private var unseenMessagesCountRefHandle: DatabaseHandle? private var updateLastSeenMessageRefHandle: DatabaseHandle? private var updateFirstReplyRefHandle: DatabaseHandle? fileprivate var isLoadedMedia:Bool = true fileprivate var numberOfSentMedia = 0 fileprivate var messages: [JSQMessage] = [] private var messagesWithId: [String] = [] private var photoMessageMap = [String: JSQCustomPhotoMediaItem]() private var videoMessageMap = [String: JSQCustomVideoMediaItem]() private var audioMessageMap = [String: JSQCustomAudioMediaItem]() var retryUploadAttemptsLeft = 2 private var isChatBlockedShowedBefore = false // used to make sure we show the chat blocked screen only once fileprivate var isRTL:Bool = UIApplication.shared.userInterfaceLayoutDirection == .rightToLeft @IBOutlet var customNavBar: VobbleChatNavigationBar! @IBOutlet var recordButton : SDRecordButton! @IBOutlet var lblRecording : UILabel! @IBOutlet var lblTimerRecording : UILabel! @IBOutlet var ivRecordingIcon : UIImageView! @IBOutlet var recordButtonContainer : UIView! @IBOutlet var chatBlockedContainer : UIView! @IBOutlet var chatBlockedLabel : UILabel! @IBOutlet var chatPendingContainer : UIView! @IBOutlet var chatPendingLabel : UILabel! @IBOutlet var chatPendingImageView : UIImageView! @IBOutlet var chatPendingCloseButton : UIButton! var videoUploadLoader: WavesLoader? // notifications var lastNotificationSentDate: Date? private var localTyping = false private var isInitialised = false var convTitle: String? { didSet { // title = conversation?.user2?.firstName title = convTitle ?? "" } } var selectedImage: UIImage? var seconds: Double = 0.0 // VobbleChatNavigationBar public var navUserName: String? public var navShoreName: String? var audioUrl: URL? = nil var soundRecorder : AVAudioRecorder! var SoundPlayer : AVAudioPlayer! var isAnimating: Bool = false //var AudioFileName = "sound.m4a" var timeOut: Float = 0.0 var recordTimer: Timer? let recordSettings = [AVSampleRateKey : NSNumber(value: Float(44100.0)), AVFormatIDKey : NSNumber(value: Int32(kAudioFormatMPEG4AAC)), AVNumberOfChannelsKey : NSNumber(value: 2 as Int32), AVEncoderAudioQualityKey : NSNumber(value: Int32(AVAudioQuality.medium.rawValue) as Int32)] var replyVideoUrlToUpload: URL? var bottleToReplyTo: Bottle? var isTyping: Bool { get { return localTyping } set { localTyping = newValue userIsTypingRef.setValue(newValue) } } /// Navigation bar custome back button var navBackButton : UIBarButtonItem { let _navBackButton = UIButton() _navBackButton.setBackgroundImage(UIImage(named: "navBackIcon"), for: .normal) _navBackButton.frame = CGRect(x: 0, y: 0, width: 20, height: 17) _navBackButton.addTarget(self, action: #selector(backButtonAction(_:)), for: .touchUpInside) return UIBarButtonItem(customView: _navBackButton) } lazy var outgoingBubbleImageView: JSQMessagesBubbleImage = self.setupOutgoingBubble() lazy var incomingBubbleImageView: JSQMessagesBubbleImage = self.setupIncomingBubble() /// isSeen var lastSeenMessageId : String = "0" var messageCounter: Int = 0 /// Record beep var beepSound = NSURL(fileURLWithPath: Bundle.main.path(forResource: "audio_msg_beeb", ofType: "mp3")!) var beepPlayer = AVAudioPlayer() /// Audio messages var currentAudioIndex: Int! // MARK: View Lifecycle override func viewDidLoad() { super.viewDidLoad() // self.senderId = FIRAuth.auth()?.currentUser?.uid if let userId = DataStore.shared.me?.objectId { self.senderId = "\(userId)" self.senderDisplayName = "" } else { self.dismiss(animated: true, completion: nil) } customNavBar.delegate = self if let conv = conversationOriginalObject { initWithConversation(conversation: conv) observeMessages() observeFirstReply() } else if let convId = conversationId { if let _ = bottleToReplyTo { // this is the first reply on a bottle initNewConversation() } fetchConversationByid(convId: convId) } self.navigationItem.leftBarButtonItem = navBackButton // No avatars collectionView!.collectionViewLayout.incomingAvatarViewSize = CGSize.zero collectionView!.collectionViewLayout.outgoingAvatarViewSize = CGSize.zero self.topContentAdditionalInset = 55 // dismiss keyboard on press let tapGesture: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(closeKeyboard)) tapGesture.cancelsTouchesInView = false tapGesture.delegate = self self.collectionView.addGestureRecognizer(tapGesture) // Register new audio cells super.collectionView.register(UINib(nibName: "AudioCollectionViewCellOutgoing", bundle: nil), forCellWithReuseIdentifier: "AudioCollectionViewCellOutgoing_id") super.collectionView.register(UINib(nibName: "AudioCollectionViewCellIncoming", bundle: nil), forCellWithReuseIdentifier: "AudioCollectionViewCellIncoming_id") } override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() if isInitialised == false { if customNavBar.superview == nil { // init nav bar initNavBar() // re-add subiews connected from storyboard as the JSQM messages framewordk detaches them customNavBar.frame = CGRect(x: 0, y: -10, width: UIScreen.main.bounds.width, height: 110) self.view.addSubview(customNavBar) // record audio view lblRecording.font = AppFonts.bigBold lblRecording.text = "CHAT_RECORDING".localized lblTimerRecording.font = AppFonts.bigBold lblTimerRecording.textAlignment = .center self.recordButtonContainer.frame = CGRect(x: 0 , y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height - self.inputToolbar.frame.height) self.recordButton.frame = CGRect(x: self.view.frame.width/2 - 60 , y: self.view.frame.height/2 - 90, width: 120, height: 120) self.ivRecordingIcon.frame = CGRect(x: 0 , y: 0, width: 50, height: 50) self.ivRecordingIcon.center = self.recordButton.center self.lblRecording.frame = CGRect(x: self.view.frame.width/2 - 100 , y: self.recordButton.frame.origin.y - 50, width: 200, height: 30) self.lblTimerRecording.frame = CGRect(x: self.view.frame.width/2 - 100 , y: recordButton.frame.maxY + 10, width: 200, height: 30) self.view.addSubview(self.recordButtonContainer) // NSLayoutConstraint(item: recordButtonContainer, attribute: NSLayoutAttribute.centerX, relatedBy: NSLayoutRelation.equal, toItem: self.view, attribute: NSLayoutAttribute.centerX, multiplier: 1, constant: 0).isActive = true // NSLayoutConstraint(item: recordButtonContainer, attribute: NSLayoutAttribute.top, relatedBy: NSLayoutRelation.equal, toItem: self.view, attribute: NSLayoutAttribute.top, multiplier: 1, constant: 0).isActive = true // NSLayoutConstraint(item: recordButtonContainer, attribute: NSLayoutAttribute.width, relatedBy: NSLayoutRelation.equal, toItem: self.view, attribute: NSLayoutAttribute.width, multiplier: 1, constant: 0).isActive = true // NSLayoutConstraint(item: recordButtonContainer, attribute: NSLayoutAttribute.width, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: self.view.frame.height - inputToolbar.frame.height).isActive = true self.recordButtonContainer.applyGradient(colours: [AppColors.blueXDark, AppColors.blueXLight], direction: .diagonal) // recordButtonContainer.setNeedsLayout() // recordButton.setNeedsLayout() //self.view.layoutIfNeeded() // recordButtonContainer.layoutIfNeeded() // recordButton.layoutIfNeeded() recordButtonContainer.isHidden = true // chat blocked view self.chatBlockedContainer.frame = CGRect(x: 0 , y: UIScreen.main.bounds.height - 50, width: UIScreen.main.bounds.width, height: 50) self.chatBlockedLabel.frame = CGRect(x: 20 , y: 5, width: UIScreen.main.bounds.width - 40, height: 40) chatBlockedLabel.font = AppFonts.normal chatBlockedLabel.text = "CHAT_BLOCKED".localized self.view.addSubview(self.chatBlockedContainer) //self.chatBlockedContainer.isHidden = true // chat pending view self.chatPendingContainer.frame = CGRect(x: 0 , y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height - self.chatBlockedContainer.frame.height) self.chatPendingLabel.frame = CGRect(x: 20 , y: 160, width: UIScreen.main.bounds.width - 40, height: 80) self.chatPendingImageView.frame = CGRect(x: 25 , y: 300, width: UIScreen.main.bounds.width - 50, height: self.chatPendingContainer.frame.height - 400) self.chatPendingCloseButton.frame = CGRect(x: UIScreen.main.bounds.width - 45 , y: 45, width: 35, height: 35) chatPendingLabel.font = AppFonts.normalBold chatPendingLabel.text = "CHAT_REPLY_SENT_MSG".localized //self.chatPendingContainer.isHidden = true self.view.addSubview(self.chatPendingContainer) // chat background let bgImage = UIImageView() bgImage.frame = CGRect(x: 0 , y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height) bgImage.image = UIImage(named: "chat_bg") bgImage.contentMode = .scaleAspectFill bgImage.backgroundColor = UIColor(red:242/255, green:234/255, blue:220/255, alpha:0.0) self.collectionView.backgroundColor = UIColor.clear self.view.insertSubview(bgImage, belowSubview: self.collectionView) // upload the reply video here to make sure we can show the loader if let replyVideoUrl = replyVideoUrlToUpload { self.uploadVideo(videoUrl: replyVideoUrl) } setupRecorder() //chatPendingContainer.isHidden = true } isInitialised = true } } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) observeTyping() } deinit { disposeFirebaseReference() } func disposeFirebaseReference() { if let refHandle = newMessageRefHandle { messageRef.removeObserver(withHandle: refHandle) } if let refHandle = updatedMessageRefHandle { messageRef.removeObserver(withHandle: refHandle) } if let refHandle = unseenMessagesCountRefHandle { unseenCountRef?.removeObserver(withHandle: refHandle) } if let refHandle = updateLastSeenMessageRefHandle { lastSeenMessageRef?.removeObserver(withHandle: refHandle) } if let refHandle = updateFirstReplyRefHandle { firstReplyRef.removeObserver(withHandle: refHandle) } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() let alertController = UIAlertController(title: "MemoryWarning", message: "Memory Warning recieved", preferredStyle: .alert) let ok = UIAlertAction(title: "ok".localized, style: .default, handler: nil) alertController.addAction(ok) self.present(alertController, animated: true, completion: nil) } func initNavBar() { // customNavBar.title = convTitle ?? "" customNavBar.leftLabel.text = "CHAT_NAV_TIME_LEFT".localized if seconds != 0.0 { customNavBar.timerLabel.startTimer(seconds: TimeInterval(seconds)) } else { customNavBar.timerLabel.isHidden = true customNavBar.leftLabel.isHidden = true } customNavBar.shoreNameLabel.text = navShoreName customNavBar.userNameLabel.text = navUserName if let peerPicString = conversationOriginalObject?.getPeer?.profilePic, let picUrl = URL(string:peerPicString), picUrl.isValidUrl(){ customNavBar.userImageView.sd_setImage(with: picUrl) } customNavBar.userImageButton.addTarget(self, action: #selector(self.didTapPeerImage(_:)), for: .touchUpInside) customNavBar.viewcontroller = self } // init // this method is required func initWithConversation (conversation: Conversation) { let chatVc = self if chatVc.conversationRef == nil { chatVc.conversationRef = FirebaseManager.shared.conversationRef.child(conversation.idString ?? "") } chatVc.senderDisplayName = DataStore.shared.me?.userName ?? "" if conversation.isMyBottle { chatVc.convTitle = conversation.bottle?.owner?.userName ?? "" if let is_seen = conversation.is_seen, is_seen == 0 { chatVc.conversationRef?.updateChildValues(["is_seen": 1]) chatVc.conversationRef?.updateChildValues(["startTime": ServerValue.timestamp()]) chatVc.seconds = 24.0*60.0*60.0 // send push notification to peer to let him know that the chat is open now let msgToSend = String(format: "NOTIFICATION_CHAT_IS_ACTIVE".localized, (DataStore.shared.me?.userName)!) let msgToSendAr = String(format: "NOTIFICATION_CHAT_IS_ACTIVE_AR".localized, (DataStore.shared.me?.userName)!) ApiManager.shared.sendPushNotification(msg: msgToSend, msg_ar: msgToSendAr, targetUser: conversation.getPeer!, chatId: self.conversationId, completionBlock: { (success, error) in }) } } else { chatVc.convTitle = conversation.user?.userName ?? "" } if let is_seen = conversation.is_seen, is_seen == 1 { if let fTime = conversation.finishTime { let currentDate = Date().timeIntervalSince1970 * 1000 chatVc.seconds = (fTime - currentDate)/1000.0 } } if let userName = conversation.getPeer?.userName { chatVc.navUserName = userName } if let shore_id = conversation.bottle?.shoreId { for sh in DataStore.shared.shores { if sh.shore_id == shore_id { chatVc.navShoreName = sh.name ?? "" break } } } //if is_seen == false --> hide chat tool bar so we can't send any message if conversation.isMyBottle { inputToolbar.isHidden = false chatBlockedContainer.isHidden = true chatPendingContainer.isHidden = true initCustomToolBar() } else if let is_seen = conversation.is_seen, is_seen == 1 { inputToolbar.isHidden = false chatBlockedContainer.isHidden = true chatPendingContainer.isHidden = true initCustomToolBar() } else { if !isChatBlockedShowedBefore { inputToolbar.isHidden = true chatBlockedContainer.isHidden = false chatPendingContainer.isHidden = false isChatBlockedShowedBefore = true } } // show chat tutorial on first opening of an unblocked chat if let tutShowedBefore = DataStore.shared.tutorialChatShowed, !tutShowedBefore, chatBlockedContainer.isHidden{ DataStore.shared.tutorialChatShowed = true DataStore.shared.me?.chatTutShowed = true dispatch_main_after(2) { let viewController = UIStoryboard.mainStoryboard.instantiateViewController(withIdentifier: "ChatTutorial") as! ChatTutorialViewController viewController.alpha = 0.5 self.present(viewController, animated: true, completion: nil) if let me = DataStore.shared.me { ApiManager.shared.updateUser(user: me) { (success: Bool, err: ServerError?, user: AppUser?) in } } } } if let convId = conversationOriginalObject?.idString, let unsentText = DataStore.shared.getConversationsUnsentTextMesssage(key: convId) { self.inputToolbar.contentView.textView.text = unsentText DataStore.shared.setConversationUnsentMessage(key: convId, text: "") } chatVc.conversationOriginalObject = conversation chatVc.conversationId = conversationOriginalObject?.idString } func initNewConversation() { if let btl = bottleToReplyTo, let bottleOwnerId = btl.ownerId, let url = btl.attachment, let thumbUrl = btl.thumb { // send the bottle video as the first message in this // conversation on behalf of the peer, so we tomporary make the peer as the sender self.senderId = "\(bottleOwnerId)" self.submitMessageWithVideoURL(videoUrl: url, thumbURL: thumbUrl) // put the sender id to its correct state if let userId = DataStore.shared.me?.objectId { self.senderId = "\(userId)" } //send push notification to bottle owner to inform him about the new reply if let peer = btl.owner { let msgToSend = String(format: "NOTIFICATION_NEW_REPLY".localized, (DataStore.shared.me?.userName)!) let msgToSendAr = String(format: "NOTIFICATION_NEW_REPLY_AR".localized, (DataStore.shared.me?.userName)!) ApiManager.shared.sendPushNotification(msg: msgToSend, msg_ar: msgToSendAr, targetUser: peer, chatId: self.conversationId, completionBlock: { (success, error) in }) } } } func backButtonAction(_ sender: AnyObject) { if let unsentText = self.inputToolbar.contentView.textView.text, let convId = conversationOriginalObject?.idString { DataStore.shared.setConversationUnsentMessage(key: convId, text: unsentText) } disposeFirebaseReference() //if we opened this chat from FindBottleViewContrller to reply to a //bottle we should back to the home screen not to the previous screen if let _ = bottleToReplyTo { self.performSegue(withIdentifier: "unwindSendReply", sender: self) } else { self.dismiss(animated: true, completion: nil) } if let _ = AudioManager.shared.audioPlayer { AudioManager.shared.stopAudio() } customNavBar.removeFromSuperview() recordButton.removeFromSuperview() lblRecording.removeFromSuperview() ivRecordingIcon.removeFromSuperview() recordButtonContainer.removeFromSuperview() chatBlockedContainer.removeFromSuperview() chatBlockedLabel.removeFromSuperview() chatPendingContainer.removeFromSuperview() chatPendingLabel.removeFromSuperview() chatPendingImageView.removeFromSuperview() chatPendingCloseButton.removeFromSuperview() } @IBAction func cloesPandingChatViewAction(_ sender: AnyObject) { chatPendingContainer.isHidden = true } @IBAction func didTapPeerImage(_ sender: AnyObject) { if let peerImageUrl = conversationOriginalObject?.getPeer?.profilePic { let photo: PreviewPhoto = PreviewPhoto(image: UIImage.init(named: "user_placeholder"), title: "") let images = [photo] let photosViewController = NYTPhotosViewController(photos: images) photosViewController.rightBarButtonItem = nil present(photosViewController, animated: true, completion: nil) SDWebImageDownloader.shared().downloadImage( with: URL(string: peerImageUrl), options: SDWebImageDownloaderOptions(rawValue: 7), progress: nil, completed: { (image, data, error, bool) -> Void in DispatchQueue.main.async() { photo.image = image photosViewController.updateImage(for: photo) } }) } } // MARK: Collection view data source (and related) methods override func collectionView(_ collectionView: JSQMessagesCollectionView!, messageDataForItemAt indexPath: IndexPath!) -> JSQMessageData! { return messages[indexPath.item] } override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return messages.count } override func collectionView(_ collectionView: JSQMessagesCollectionView!, messageBubbleImageDataForItemAt indexPath: IndexPath!) -> JSQMessageBubbleImageDataSource! { let message = messages[indexPath.item] // 1 if isRTL { if message.senderId == senderId { // 2 return incomingBubbleImageView } else { // 3 return outgoingBubbleImageView } } else { // The app is in right-to-left mode if message.senderId == senderId { // 2 return outgoingBubbleImageView } else { // 3 return incomingBubbleImageView } } } override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = super.collectionView(collectionView, cellForItemAt: indexPath) as! JSQMessagesCollectionViewCell let message = messages[indexPath.item] if message.isMediaMessage { if message.media is JSQAudioMediaItem { let audioItem = message.media as! JSQCustomAudioMediaItem if message.senderId == senderId { let cell = super.collectionView.dequeueReusableCell(withReuseIdentifier: "AudioCollectionViewCellOutgoing_id", for: indexPath) as! AudioCollectionViewCellOutgoing cell.index = indexPath.row cell.url = audioItem.audioUrl cell.data = audioItem.audioData cell.audioDelegate = self if (audioItem.audioUrl?.isValidUrl())! { cell.indicatorView.stopAnimating() cell.indicatorView.isHidden = true cell.playButton.isHidden = false }else{ cell.indicatorView.startAnimating() cell.indicatorView.isHidden = false cell.playButton.isHidden = true } return cell } else { let cell = super.collectionView.dequeueReusableCell(withReuseIdentifier: "AudioCollectionViewCellIncoming_id", for: indexPath) as! AudioCollectionViewCellIncoming cell.index = indexPath.row cell.url = audioItem.audioUrl cell.data = audioItem.audioData cell.audioDelegate = self if (audioItem.audioUrl?.isValidUrl())! { cell.indicatorView.stopAnimating() cell.indicatorView.isHidden = true cell.playButton.isHidden = false }else{ cell.indicatorView.startAnimating() cell.indicatorView.isHidden = false cell.playButton.isHidden = true } return cell } } } if isRTL { if message.senderId == senderId { // 1 cell.textView?.textColor = UIColor.black // 3 } else { cell.textView?.textColor = UIColor.white // 2 } } else { if message.senderId == senderId { // 1 cell.textView?.textColor = UIColor.white // 2 } else { cell.textView?.textColor = UIColor.black // 3 } } return cell } override func collectionView(_ collectionView: JSQMessagesCollectionView!, avatarImageDataForItemAt indexPath: IndexPath!) -> JSQMessageAvatarImageDataSource! { return nil } override func collectionView(_ collectionView: JSQMessagesCollectionView!, layout collectionViewLayout: JSQMessagesCollectionViewFlowLayout!, heightForMessageBubbleTopLabelAt indexPath: IndexPath!) -> CGFloat { return 15 } override func collectionView(_ collectionView: JSQMessagesCollectionView!, layout collectionViewLayout: JSQMessagesCollectionViewFlowLayout!, heightForCellBottomLabelAt indexPath: IndexPath!) -> CGFloat { return 15 } override func collectionView(_ collectionView: JSQMessagesCollectionView?, attributedTextForMessageBubbleTopLabelAt indexPath: IndexPath!) -> NSAttributedString? { let message = messages[indexPath.item] switch message.senderId { case senderId: return nil default: guard let senderDisplayName = message.senderDisplayName else { assertionFailure() return nil } return NSAttributedString(string: senderDisplayName) } } override func collectionView(_ collectionView: JSQMessagesCollectionView!, attributedTextForCellBottomLabelAt indexPath: IndexPath!) -> NSAttributedString! { let message = messages[indexPath.item] let messageWithId = messagesWithId[indexPath.item] if message.senderId == DataStore.shared.me?.objectId { if messageWithId == self.lastSeenMessageId { let paragraphStyle = NSMutableParagraphStyle() if isRTL { paragraphStyle.alignment = .right }else{ paragraphStyle.alignment = .left } paragraphStyle.firstLineHeadIndent = 5.0 let attributes: [String: Any] = [ NSForegroundColorAttributeName: UIColor.blue, NSParagraphStyleAttributeName: paragraphStyle ] let seenStr = NSAttributedString(string: "SEEN".localized, attributes: attributes) return seenStr }else { return nil } }else{ return nil } } override func collectionView(_ collectionView: JSQMessagesCollectionView!, didTapMessageBubbleAt indexPath: IndexPath!) { let message = self.messages[indexPath.row] if message.isMediaMessage == true { let mediaItem = message.media // Photo Message if mediaItem is JSQCustomPhotoMediaItem { let photoItem = mediaItem as! JSQCustomPhotoMediaItem if let test: UIImage = photoItem.asyncImageView.image { let photo: PreviewPhoto = PreviewPhoto(image: test, title: "") let images = [photo] let photosViewController = NYTPhotosViewController(photos: images) photosViewController.rightBarButtonItem = nil present(photosViewController, animated: true, completion: nil) } } // Video Message if mediaItem is JSQCustomVideoMediaItem { let videoItem = mediaItem as! JSQCustomVideoMediaItem if let videoUrl = videoItem.message.videoUrl, (videoUrl.hasPrefix("http://") || videoUrl.hasPrefix("https://")) { let previewControl = UIStoryboard.mainStoryboard.instantiateViewController(withIdentifier: "PreviewMediaControl") as! PreviewMediaControl previewControl.from = .chatView previewControl.type = .VIDEO previewControl.videoUrl = NSURL(string: videoUrl)! present(previewControl, animated: false) } } } // hide keyboard //self.inputToolbar.contentView.textView.resignFirstResponder() //self.view.endEditing(true) } func closeKeyboard() { self.inputToolbar.contentView.textView.resignFirstResponder() } func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { return true } func fetchConversationByid (convId: String) { self.conversationRef = FirebaseManager.shared.conversationRef.child(convId) self.conversationRef?.observeSingleEvent(of: .value, with: { [weak self] snapshot in //print(snapshot) let conversation = Conversation(json: JSON(snapshot.value as! Dictionary<String, AnyObject>)) self?.conversationOriginalObject = conversation self?.conversationOriginalObject?.idString = snapshot.key self?.initWithConversation(conversation: conversation) self?.observeMessages() self?.observeFirstReply() self?.initNavBar() }) } // MARK: Firebase related methods private func observeMessages() { // if we dont have a reference to the conversation yet // then we need to fech it first // ex when the chat is opened from push notification deep linking if let convId = conversationId, conversationRef == nil { conversationRef = FirebaseManager.shared.conversationRef.child(convId) if let convRef = conversationRef{ messageRef = convRef.child("messages") } } else { // TODO here we are limiting the conversation messages count // we should implement paging messageRef = self.conversationRef!.child("messages") let messageQuery = messageRef.queryLimited(toLast:2000) // get messages count var messagesCount = 0 self.conversationRef!.child("messages").observe(.value, with: { [weak self] (snapshot) in messagesCount = Int(snapshot.childrenCount) } ) // We can use the observe method to listen for new // messages being written to the Firebase DB newMessageRefHandle = messageQuery.observe(.childAdded, with: { [weak self] (snapshot) -> Void in // let messageData = snapshot.value as! Dictionary<String, String> //let values = snapshot.value as? NSDictionary let message = Message(json: JSON(snapshot.value as! Dictionary<String, AnyObject>)) message.idString = snapshot.key // check seen messages if let selfRef = self { if selfRef.messageCounter == messagesCount || selfRef.messageCounter == messagesCount - 1 { if selfRef.messageCounter == messagesCount - 1 { self?.messageCounter += 1 } self?.checkLastSeenMessage(message: message) }else { self?.messageCounter += 1 } } if let id = message.senderId, let name = message.senderName, let text = message.text, text.characters.count > 0 { self?.addMessage(withId: id, name: name, text: text) self?.messagesWithId.append(message.idString!) self?.finishReceivingMessage() } else if let id = message.senderId, let mediaURL = message.photoUrl { let mediaItem = JSQCustomPhotoMediaItem(message: message, isOperator: id == self?.senderId) self?.addPhotoMessage(withId: id, key: snapshot.key, mediaItem: mediaItem) self?.messagesWithId.append(message.idString!) if mediaURL.hasPrefix("http://") || mediaURL.hasPrefix("https://") { mediaItem.message = message self?.fetchImageDataAtURL(mediaURL, forMediaItem: mediaItem, clearsPhotoMessageMapOnSuccessForKey: nil) } } else if let id = message.senderId, let mediaURL = message.videoUrl { let mediaItem = JSQCustomVideoMediaItem(message: message, isOperator: id == self?.senderId) self?.addVideoMessage(withId: id, key: snapshot.key, mediaItem: mediaItem) self?.messagesWithId.append(message.idString!) if mediaURL.hasPrefix("http://") || mediaURL.hasPrefix("https://") { mediaItem.message = message self?.fetchVideoDataAtURL(mediaURL, forMediaItem: mediaItem, clearsPhotoMessageMapOnSuccessForKey: nil) } } else if let id = message.senderId, let mediaURL = message.audioUrl { //let audioData = NSData(contentsOf: URL(string:mediaURL)!) let audioData = Data() let audioItem = JSQCustomAudioMediaItem(data: audioData as! Data) if let selfRef = self { audioItem.appliesMediaViewMaskAsOutgoing = (id == self?.senderId) == (!selfRef.isRTL) } audioItem.audioUrl = URL(string:mediaURL)! if id != DataStore.shared.me?.objectId { if let url = audioItem.audioUrl, url.isValidUrl() { self?.addAudioMessage(withId: id, key: snapshot.key, mediaItem: audioItem) self?.messagesWithId.append(message.idString!) } else { // dont add the message if its not mine and the url is not valid } } else { self?.addAudioMessage(withId: id, key: snapshot.key, mediaItem: audioItem) self?.messagesWithId.append(message.idString!) } if mediaURL.hasPrefix("http://") || mediaURL.hasPrefix("https://") { self?.collectionView.reloadData() self?.audioMessageMap.removeValue(forKey: snapshot.key) } } else { print("Error! Could not decode message data") } self?.scrollToBottom(animated: true) }) // We can also use the observer method to listen for // changes to existing messages. // We use this to be notified when a photo has been stored // to the Firebase Storage, so we can update the message data updatedMessageRefHandle = messageRef.observe(.childChanged, with: { [weak self] (snapshot) in let message = Message(json: JSON(snapshot.value as! Dictionary<String, AnyObject>)) message.idString = snapshot.key if let mediaURL = message.photoUrl { // The photo has been updated. if let mediaItem = self?.photoMessageMap[message.idString!] { mediaItem.message = message self?.fetchImageDataAtURL(mediaURL, forMediaItem: mediaItem, clearsPhotoMessageMapOnSuccessForKey: message.idString) } } else if let mediaURL = message.videoUrl { if let mediaItem = self?.videoMessageMap[message.idString!] { mediaItem.message = message self?.fetchVideoDataAtURL(mediaURL, forMediaItem: mediaItem, clearsPhotoMessageMapOnSuccessForKey: message.idString) } } else if let mediaURL = message.audioUrl { if let mediaItem = self?.audioMessageMap[message.idString!] { let audioData = Data() //NSData(contentsOf: URL(string:mediaURL)!) mediaItem.audioUrl = URL(string:mediaURL)! mediaItem.audioData = audioData self?.collectionView.reloadData() self?.audioMessageMap.removeValue(forKey: message.idString!) } else if let id = message.senderId { // the audio message migh not have been added cuz it was not uploaded yet let audioData = Data() let audioItem = JSQCustomAudioMediaItem(data: audioData as! Data) if let selfRef = self { audioItem.appliesMediaViewMaskAsOutgoing = id == selfRef.senderId } audioItem.audioUrl = URL(string:mediaURL)! if id != DataStore.shared.me?.objectId { if let url = audioItem.audioUrl, url.isValidUrl() { self?.addAudioMessage(withId: id, key: snapshot.key, mediaItem: audioItem) self?.messagesWithId.append(message.idString!) } else { // dont add the message if its not mine and the url is not valid } } else { self?.addAudioMessage(withId: id, key: snapshot.key, mediaItem: audioItem) self?.messagesWithId.append(message.idString!) } if mediaURL.hasPrefix("http://") || mediaURL.hasPrefix("https://") { self?.collectionView.reloadData() self?.audioMessageMap.removeValue(forKey: snapshot.key) } } } self?.scrollToBottom(animated: true) }) } // handle seen messages if self.conversationOriginalObject?.bottle?.owner?.objectId == DataStore.shared.me?.objectId { lastSeenMessageRef = self.conversationRef!.child("user2LastSeenMessageId") unseenCountRef = self.conversationRef!.child("user1_unseen") unseenMessagesCountRefHandle = self.unseenCountRef?.observe(.value, with: { [weak self] (snapshot) -> Void in self?.conversationRef?.updateChildValues(["user1_unseen": 0]) }) } else { lastSeenMessageRef = self.conversationRef!.child("user1LastSeenMessageId") unseenCountRef = self.conversationRef!.child("user2_unseen") unseenMessagesCountRefHandle = self.unseenCountRef?.observe(.value, with: { [weak self] (snapshot) -> Void in self?.conversationRef?.updateChildValues(["user2_unseen": 0]) }) } // hande seen message update updateLastSeenMessageRefHandle = self.lastSeenMessageRef!.observe(.value, with: { [weak self] (snapshot) -> Void in if let value = snapshot.value as? String { self?.lastSeenMessageId = value self?.collectionView.reloadData() } }) } private func observeFirstReply() { updateFirstReplyRefHandle = self.firstReplyRef.observe(.value, with: { [weak self] (snapshot) -> Void in if self?.conversationOriginalObject?.bottle?.owner?.objectId != DataStore.shared.me?.objectId { print(snapshot.value as! Int) if let is_seen = snapshot.value as? Int ,is_seen == 1 { if let oldValue = self?.conversationOriginalObject?.is_seen, oldValue != is_seen { // this means that the isSeen value has changed self?.inputToolbar.isHidden = false self?.chatBlockedContainer.isHidden = true self?.chatPendingContainer.isHidden = true self?.initCustomToolBar() } } } }) } private func fetchImageDataAtURL(_ mediaURL: String, forMediaItem mediaItem: JSQCustomPhotoMediaItem, clearsPhotoMessageMapOnSuccessForKey key: String?) { mediaItem.setImageWithURL() self.collectionView.reloadData() guard key != nil else { return } self.photoMessageMap.removeValue(forKey: key!) } private func fetchVideoDataAtURL(_ mediaURL: String, forMediaItem mediaItem: JSQCustomVideoMediaItem, clearsPhotoMessageMapOnSuccessForKey key: String?) { mediaItem.setThumbWithURL(url: URL(string: mediaURL)!) self.collectionView.reloadData() guard key != nil else { return } self.videoMessageMap.removeValue(forKey: key!) } private func checkLastSeenMessage(message : Message) { if let id = message.idString , let senderId = message.senderId { if self.conversationOriginalObject?.bottle?.owner?.objectId == DataStore.shared.me?.objectId { if senderId != DataStore.shared.me?.objectId { self.lastSeenMessageId = id self.conversationRef?.updateChildValues(["user1LastSeenMessageId" : self.lastSeenMessageId]) } }else{ if senderId != DataStore.shared.me?.objectId { self.lastSeenMessageId = id self.conversationRef?.updateChildValues(["user2LastSeenMessageId" : self.lastSeenMessageId]) } } } } private func observeTyping() { if let convRef = conversationRef { let typingIndicatorRef = convRef.child("typingIndicator") userIsTypingRef = typingIndicatorRef.child(senderId) userIsTypingRef.onDisconnectRemoveValue() usersTypingQuery = typingIndicatorRef.queryOrderedByValue().queryEqual(toValue: true) usersTypingQuery.observe(.value) { [weak self] (data: DataSnapshot) in // You're the only typing, don't show the indicator if let selfRef = self, data.childrenCount == 1 && selfRef.isTyping { return } // Are there others typing? self?.showTypingIndicator = data.childrenCount > 0 self?.scrollToBottom(animated: true) } } } override func didPressSend(_ button: UIButton!, withMessageText text: String!, senderId: String!, senderDisplayName: String!, date: Date!) { // 1 let itemRef = messageRef.childByAutoId() // 2 let messageItem = [ "senderId": senderId!, "senderName": senderDisplayName!, "text": text!, ] // 3 itemRef.setValue(messageItem) // 4 JSQSystemSoundPlayer.jsq_playMessageSentSound() onNewMessageSent() // 5 finishSendingMessage() isTyping = false } func sendMediaMessage(mediaType: AppMediaType) -> String? { let itemRef = messageRef.childByAutoId() var messageItem = [ "senderId": senderId!, ] if mediaType == .video { messageItem["videoURL"] = imageURLNotSetKey messageItem["thumb"] = imageURLNotSetKey } else if mediaType == .image { messageItem["photoURL"] = imageURLNotSetKey messageItem["thumb"] = imageURLNotSetKey } else { // audio messageItem["audioURL"] = imageURLNotSetKey } itemRef.setValue(messageItem) JSQSystemSoundPlayer.jsq_playMessageSentSound() finishSendingMessage() return itemRef.key } func setMediaURL(_ media: Media, forPhotoMessageWithKey key: String) { let itemRef = messageRef.child(key) if media.type == .image { itemRef.updateChildValues(["photoURL": media.fileUrl!]) } else if media.type == .video { if let thumbUrl = media.thumbUrl { itemRef.updateChildValues(["thumb": thumbUrl, "videoURL": media.fileUrl!]) } else { itemRef.updateChildValues(["videoURL": media.fileUrl!]) } } else if media.type == .audio { itemRef.updateChildValues(["audioURL": media.fileUrl!]) } } // MARK: UI and User Interaction private func setupOutgoingBubble() -> JSQMessagesBubbleImage { let bubbleImageFactory = JSQMessagesBubbleImageFactory() // return bubbleImageFactory!.outgoingMessagesBubbleImage(with: UIColor.jsq_messageBubbleBlue()) return bubbleImageFactory!.outgoingMessagesBubbleImage(with: AppColors.blueXLight) } private func setupIncomingBubble() -> JSQMessagesBubbleImage { let bubbleImageFactory = JSQMessagesBubbleImageFactory() return bubbleImageFactory!.incomingMessagesBubbleImage(with: UIColor.jsq_messageBubbleLightGray()) } override func didPressAccessoryButton(_ sender: UIButton) { let picker = UIImagePickerController() picker.delegate = self if (UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.camera)) { picker.sourceType = .camera } else { picker.sourceType = .photoLibrary } if let allMediaTypes = UIImagePickerController.availableMediaTypes(for: .camera) { picker.mediaTypes = allMediaTypes }else { picker.mediaTypes = ["public.image","public.movie"] } present(picker, animated: true, completion:nil) } private func addMessage(withId id: String, name: String, text: String) { if let message = JSQMessage(senderId: id, displayName: name, text: text) { messages.append(message) } } private func addPhotoMessage(withId id: String, key: String, mediaItem: JSQCustomPhotoMediaItem) { if let message = JSQMessage(senderId: id, displayName: "", media: mediaItem) { messages.append(message) if (mediaItem.image == nil) { photoMessageMap[key] = mediaItem } collectionView.reloadData() } } private func addVideoMessage(withId id: String, key: String, mediaItem: JSQCustomVideoMediaItem) { if let message = JSQMessage(senderId: id, displayName: "", media: mediaItem) { messages.append(message) if (mediaItem.thumbImageView.image == nil ) { videoMessageMap[key] = mediaItem } collectionView.reloadData() } } private func addAudioMessage(withId id: String, key: String, mediaItem: JSQCustomAudioMediaItem) { if let message = JSQMessage(senderId: id, displayName: "", media: mediaItem) { messages.append(message) if (mediaItem.audioData == nil || mediaItem.audioData?.count == 0) { audioMessageMap[key] = mediaItem } collectionView.reloadData() } } func onNewMessageSent() { // send a push notifications to the peer if the last push notification sent was more than 20 seconds ago var shouldSenPushNotification = false if let lastNotifDate = lastNotificationSentDate { shouldSenPushNotification = ((lastNotifDate.timeIntervalSinceNow) >= 30) } else { shouldSenPushNotification = true } if shouldSenPushNotification { lastNotificationSentDate = Date() if let peer = conversationOriginalObject?.getPeer { let msgToSend = String(format: "NOTIFICATION_NEW_MSG".localized, (DataStore.shared.me?.userName)!) let msgToSendAr = String(format: "NOTIFICATION_NEW_MSG_AR".localized, (DataStore.shared.me?.userName)!) ApiManager.shared.sendPushNotification(msg: msgToSend, msg_ar: msgToSendAr, targetUser: peer, chatId: self.conversationId, completionBlock: { (success, error) in }) } } // mark the other user as unread // if i"m the sender increase the unread count for the peer if self.conversationOriginalObject?.bottle?.owner?.objectId == self.senderId { self.conversationRef?.updateChildValues(["user2_unseen": 1]) } else { self.conversationRef?.updateChildValues(["user1_unseen": 1]) } // update the lastUpdate date of the conversation self.conversationRef?.updateChildValues(["updatedAt": ServerValue.timestamp()]) } // MARK: UITextViewDelegate methods override func textViewDidChange(_ textView: UITextView) { super.textViewDidChange(textView) // If the text is not empty, the user is typing isTyping = textView.text != "" } } // MARK: Image Picker Delegate extension ChatViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate { func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { picker.dismiss(animated: true, completion:nil) let mediaType = info[UIImagePickerControllerMediaType] as? String if mediaType == "public.image" { // if let mediaReferenceUrl = info[UIImagePickerControllerImageURL] as? URL { // uploadPhoto(photoUrl: mediaReferenceUrl) // }else if let mediaReferenceUrl = info[UIImagePickerControllerReferenceURL] as? URL { // uploadPhoto(photoUrl: mediaReferenceUrl) // } if let photo = info[UIImagePickerControllerOriginalImage] as? UIImage { uploadPhoto(photo: photo) } if let asset = info["UIImagePickerControllerPHAsset"] as? PHAsset{ if let fileName = asset.value(forKey: "filename") as? String{ print(fileName) } } } else if mediaType == "public.movie" { if let videoURL = info[UIImagePickerControllerMediaURL] as? URL { let compressedURL = NSURL.fileURL(withPath: NSTemporaryDirectory() + NSUUID().uuidString + ".m4v") ActionCompressVideo.execute(inputURL: videoURL, outputURL: compressedURL) { (exportSession) in guard let session = exportSession else { return } // use the original video captured by the camera as the deault Video to upload // and check if the compression successed then use the copressed video for upload var videoUrlForUpload = videoURL; switch session.status { case .completed: guard let compressedData = NSData(contentsOf: compressedURL) else { return } print("File size after compression: \(Double(compressedData.length / 1048576)) mb") videoUrlForUpload = compressedURL default: break } DispatchQueue.main.async { self.uploadVideo(videoUrl: videoUrlForUpload) } } } } } func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { picker.dismiss(animated: true, completion:nil) } func uploadPhoto(photo: UIImage) { if let key = sendMediaMessage(mediaType: .image) { // let assets = PHAsset.fetchAssets(withALAssetURLs: [photoUrl], options: nil) // let asset = assets.firstObject // asset?.requestContentEditingInput(with: nil, completionHandler: { (contentEditingInput, info) in // self.upload(url: (contentEditingInput?.fullSizeImageURL)!, key:key, mediaType: .image) // }) self.upload(url: nil, photo:photo, key:key, mediaType: .image) } } func submitMessageWithVideoURL(videoUrl: String, thumbURL: String) { if let key = sendMediaMessage(mediaType: .video) { let media:Media = Media() media.fileUrl = videoUrl media.thumbUrl = thumbURL media.type = .video self.setMediaURL(media, forPhotoMessageWithKey: key) } } func uploadVideo(videoUrl:URL) { if let key = sendMediaMessage(mediaType: .video) { self.upload(url: videoUrl, photo: nil, key:key, mediaType: .video) self.scrollToBottom(animated: true) } } func uploadAudio(audioUrl:URL) { if let key = sendMediaMessage(mediaType: .audio) { self.upload(url: audioUrl, photo: nil, key:key, mediaType: .audio) self.scrollToBottom(animated: true) } } func upload(url:URL?, photo: UIImage?, key:String, mediaType: AppMediaType) { self.isLoadedMedia = false self.numberOfSentMedia += 1 if mediaType != .audio { <<<<<<< HEAD videoUploadLoader = WavesLoader.showProgressBasedLoader(with:AppConfig.getBottlePath(), on: self.view) videoUploadLoader?.rectSize = 200 ======= //videoUploadLoader = WavesLoader.showProgressBasedLoader(with:AppConfig.getBottlePath()) >>>>>>> 1c90997afe1195b9deaee3adf1c12fdc3d7d5846 } let uploadCompletionBlock: (_ files: [Media], _ errorMessage: String?) -> Void = { [weak self] (files, errorMessage) in self?.videoUploadLoader?.removeLoader(true) if errorMessage == nil { self?.numberOfSentMedia -= 1 if let selfRef = self, selfRef.numberOfSentMedia == 0 { self?.isLoadedMedia = true } self?.retryUploadAttemptsLeft = 2 self?.setMediaURL(files[0], forPhotoMessageWithKey: key) self?.onNewMessageSent() if let selfRef = self, selfRef.messages.count <= 2 { // this means this was the first reply messsage in the conversation and the chat is not open yet // show explanation message self?.chatPendingContainer.isHidden = false // // let alertController = UIAlertController(title: "", message: "CHAT_REPLY_SENT_MSG".localized, preferredStyle: .alert) // let ok = UIAlertAction(title: "ok".localized, style: .default, handler: nil) // alertController.addAction(ok) // self.present(alertController, animated: true, completion: nil) Flurry.logEvent(AppConfig.reply_submitted); } // if let audioUrl = self.audioUrl, mediaType == .audio { // let fileManager = FileManager.default // do { // try fileManager.removeItem(at: audioUrl) // } catch { // print("Error clearing record file"); // } // } } else { self?.isLoadedMedia = true print("error uploading") self?.retryUploadAttemptsLeft -= 1 if let selfRef = self, selfRef.retryUploadAttemptsLeft > 0 { self?.upload(url:url, photo: photo, key: key, mediaType: mediaType) } } } if let imageObject = photo, mediaType == .image { ApiManager.shared.uploadImage(imageData: imageObject, completionBlock: uploadCompletionBlock) } else if let mediaURL = url { let urls:[URL] = [mediaURL] ApiManager.shared.uploadMedia(urls: urls, mediaType: mediaType, completionBlock: uploadCompletionBlock, progressBlock: {(progress) in if let progressPercent = progress { self.videoUploadLoader?.progress = CGFloat(progressPercent) } }) } } } // MARK:- ChatNavigationDelegate extension ChatViewController: ChatNavigationDelegate { func navLeftBtnPressed() { if self.isLoadedMedia { self.backButtonAction(self) //dismiss(animated: true, completion: nil) } else { let alertController = UIAlertController(title: "", message: "UPLOAD_MEDIA_WARNING".localized , preferredStyle: .alert) //We add buttons to the alert controller by creating UIAlertActions: let ok = UIAlertAction(title: "ok".localized, style: .default, handler: { (alertAction) in //self.dismiss(animated: true, completion: nil) self.backButtonAction(self) }) alertController.addAction(ok) let cancel = UIAlertAction(title: "Cancel".localized, style: .default, handler: nil) alertController.addAction(cancel) self.present(alertController, animated: true, completion: nil) } } } //TODO: make custom chat tool bar class // MARK:- AVAudioRecorderDelegate extension ChatViewController: AVAudioRecorderDelegate { fileprivate func initCustomToolBar() { let height: Float = Float(inputToolbar.contentView.leftBarButtonContainerView.frame.size.height) var image = UIImage(named: "chatMoreOptions") let mediaButton = UIButton(type: .custom) mediaButton.setImage(image, for: .normal) mediaButton.addTarget(self, action: #selector(self.showActionSheet), for: .touchUpInside) mediaButton.frame = CGRect(x: 0, y: 0, width: 40, height: CGFloat(height)) image = UIImage(named: "recordSoundMsg") let recordButton = UIButton(type: .custom) // record button gesture recognizers recordButton.setImage(image, for: .normal) let longGestureRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(self.didPressRecordAudio(_:))) recordButton.addGestureRecognizer(longGestureRecognizer) // used to show a tip for the user when cliking on the record button let tabGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.didTabRecordAudio(_:))) recordButton.addGestureRecognizer(tabGestureRecognizer) recordButton.frame = CGRect(x: 35, y: -5, width: 60, height: CGFloat(height + 10.0)) inputToolbar.contentView.leftBarButtonItemWidth = 85 inputToolbar.contentView.leftBarButtonContainerView.addSubview(mediaButton) inputToolbar.contentView.leftBarButtonContainerView.addSubview(recordButton) inputToolbar.contentView.leftBarButtonItem.isHidden = true } func showActionSheet() { let actionSheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) actionSheet.addAction(UIAlertAction(title: "Camera".localized, style: .default, handler: { (alert:UIAlertAction!) -> Void in self.camera() })) actionSheet.addAction(UIAlertAction(title: "Gallery".localized, style: .default, handler: { (alert:UIAlertAction!) -> Void in self.photoLibrary() })) actionSheet.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel, handler: nil)) present(actionSheet, animated: true, completion: nil) } func camera() { let picker = UIImagePickerController() picker.delegate = self; picker.sourceType = .camera picker.mediaTypes = ["public.image","public.movie"] present(picker, animated: true, completion:nil) } func photoLibrary() { let picker = UIImagePickerController() picker.delegate = self; picker.allowsEditing = false; picker.sourceType = .photoLibrary picker.mediaTypes = ["public.image","public.movie"] present(picker, animated: true, completion:nil) } func didTabRecordAudio(_ sender: UITapGestureRecognizer) { let alertController = UIAlertController(title: "", message: "RECORD_LONG_PRESS".localized, preferredStyle: .alert) let ok = UIAlertAction(title: "ok".localized, style: .default, handler: nil) alertController.addAction(ok) self.present(alertController, animated: true, completion: nil) self.playBeepSound() } func didPressRecordAudio(_ sender: UILongPressGestureRecognizer){ //print("Long tap is handled") if sender.state == .began { self.playBeepSound() //write the function for start recording the voice here //DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { // show record audio view self.recordButtonContainer.isHidden = false self.recordButtonContainer.alpha = 0.0 self.recordButtonContainer.transform = CGAffineTransform.identity.translatedBy(x: 0, y: 90) UIView.animate(withDuration: 0.6, delay: 0.0, usingSpringWithDamping:0.70, initialSpringVelocity:2.2, options: .curveEaseInOut, animations: { self.recordButtonContainer.transform = CGAffineTransform.identity self.recordButtonContainer.alpha = 1.0 }, completion: {(finished: Bool) in }) self.recordButton.setProgress(0.0) // reset the timer self.recordTimer?.invalidate() self.recordTimer = nil; // run the timer self.recordTimer = Timer.scheduledTimer(timeInterval: 0.05, target: self, selector: #selector(self.tickRecorder(timer:)), userInfo: nil, repeats: true) // run the timer let runner: RunLoop = RunLoop.current runner.add(self.recordTimer!, forMode: .defaultRunLoopMode) var recordingValid = true // we clear sound recorder after every recording session // so make sure we have a valid one before recording if self.soundRecorder == nil { do { // todo: handle recording permission not granted let audioSession:AVAudioSession = AVAudioSession.sharedInstance() try audioSession.setCategory(AVAudioSessionCategoryPlayAndRecord) try audioSession.setActive(true) try self.soundRecorder = AVAudioRecorder(url: self.directoryURL()!, settings: self.recordSettings) recordingValid = true } catch let error { let errstr = "Error Recording \(error)" print(errstr) let alertController = UIAlertController(title: "", message: errstr, preferredStyle: .alert) let ok = UIAlertAction(title: "ok".localized, style: .default, handler: nil) alertController.addAction(ok) self.present(alertController, animated: true, completion: nil) recordingValid = false } } if recordingValid { self.soundRecorder.prepareToRecord() self.soundRecorder.delegate = self self.soundRecorder.record() } //} } else if sender.state == .ended { recordTimer?.invalidate() stopRecorderTimer() recordButton.setProgress(0.0) self.playBeepSound() //write the function for stop recording the voice here } } func setupRecorder(){ let audioSession:AVAudioSession = AVAudioSession.sharedInstance() //ask for permission if (audioSession.responds(to: #selector(AVAudioSession.requestRecordPermission(_:)))) { AVAudioSession.sharedInstance().requestRecordPermission({ [weak self] (granted: Bool)-> Void in if granted { //set category and activate recorder session do { try audioSession.setCategory(AVAudioSessionCategoryPlayAndRecord) try audioSession.setActive(true) // if let selfRef = self { // try selfRef.soundRecorder = AVAudioRecorder(url: selfRef.directoryURL()!, settings: selfRef.recordSettings) // } // self?.soundRecorder.prepareToRecord() } catch { print("Error Recording"); } } }) } } func audioRecorderDidFinishRecording(_ recorder: AVAudioRecorder, successfully flag: Bool) { if !flag { let alertController = UIAlertController(title: "", message: "RECORD_FAILED_ERROR".localized, preferredStyle: .alert) let ok = UIAlertAction(title: "ok".localized, style: .default, handler: nil) alertController.addAction(ok) self.present(alertController, animated: true, completion: nil) } else { if let url = audioUrl { uploadAudio(audioUrl:url) } } soundRecorder = nil } func audioRecorderEncodeErrorDidOccur(_ recorder: AVAudioRecorder, error: Error?) { let alertController = UIAlertController(title: "Audio recording error", message: error?.localizedDescription, preferredStyle: .alert) let ok = UIAlertAction(title: "ok".localized, style: .default, handler: nil) alertController.addAction(ok) self.present(alertController, animated: true, completion: nil) } func directoryURL() -> URL? { let fileManager = FileManager.default let urls = fileManager.urls(for: .documentDirectory, in: .userDomainMask) let documentDirectory = urls[0] as URL let soundURL = documentDirectory.appendingPathComponent("reqsound.m4a") audioUrl = soundURL return soundURL } // Stop play image func tickRecorder(timer:Timer){ // count down 0 if (timeOut >= MAX_VIDEO_LENGTH){ // stop image timer recordTimer?.invalidate() recordTimer = nil; stopRecorderTimer() } else { timeOut += 0.05; self.lblTimerRecording.text = String(format: "%02d", Int(timeOut)) self.recordButton.setProgress(CGFloat(timeOut/MAX_VIDEO_LENGTH)) } } func stopRecorderTimer(){ // stop recording self.recordButton.setProgress(0) timeOut = 0.0 recordButtonContainer.isHidden = true if soundRecorder != nil { soundRecorder.stop() } } } extension ChatViewController : AudioCollectionViewCellIncomingDelegate { func didPressPlayButtonIncoming(_ cell: AudioCollectionViewCellIncoming) { if let audioPlayer = AudioManager.shared.audioPlayer { if audioPlayer.isPlaying { if self.currentAudioIndex == cell.index { AudioManager.shared.stopAudio() }else{ AudioManager.shared.stopAudio() startNewIncomingAudio(cell) } }else{ if self.currentAudioIndex == cell.index { AudioManager.shared.resumeAudio() }else{ startNewIncomingAudio(cell) } } }else{ startNewIncomingAudio(cell) } } func startNewIncomingAudio(_ cell: AudioCollectionViewCellIncoming) { if cell.data == nil || cell.data.count <= 0 { cell.playButton.isHidden = true cell.indicatorView.isHidden = false cell.indicatorView.startAnimating() AudioManager.shared.getDataFromUrl(url: cell.url, completion: {(data , response , error) in DispatchQueue.main.async { cell.playButton.isHidden = false cell.indicatorView.isHidden = true cell.indicatorView.stopAnimating() if error == nil { cell.data = data! (self.messages[cell.index].media as! JSQCustomAudioMediaItem).audioData = data! self.currentAudioIndex = cell.index AudioManager.shared.playAudio(data: data!, progressView: cell.audioProgressView, progressLabel: cell.audioProgressLabel, playButton: cell.playButton) } } }) }else{ self.currentAudioIndex = cell.index AudioManager.shared.playAudio(data: cell.data!, progressView: cell.audioProgressView, progressLabel: cell.audioProgressLabel, playButton: cell.playButton) } } } extension ChatViewController : AudioCollectionViewCellOutgoingDelegate { func didPressPlayButtonOutgoing(_ cell: AudioCollectionViewCellOutgoing) { if let audioPlayer = AudioManager.shared.audioPlayer { if audioPlayer.isPlaying { if self.currentAudioIndex == cell.index { AudioManager.shared.stopAudio() }else{ AudioManager.shared.stopAudio() startNewOutgoingAudio(cell) } }else{ if self.currentAudioIndex == cell.index { AudioManager.shared.resumeAudio() }else{ startNewOutgoingAudio(cell) } } }else{ startNewOutgoingAudio( cell) } } func startNewOutgoingAudio(_ cell: AudioCollectionViewCellOutgoing) { if cell.data == nil || cell.data.count <= 0 { cell.playButton.isHidden = true cell.indicatorView.isHidden = false cell.indicatorView.startAnimating() AudioManager.shared.getDataFromUrl(url: cell.url, completion: {(data , response , error) in DispatchQueue.main.async { cell.playButton.isHidden = false cell.indicatorView.isHidden = true cell.indicatorView.stopAnimating() if error == nil { cell.data = data! (self.messages[cell.index].media as! JSQCustomAudioMediaItem).audioData = data! self.currentAudioIndex = cell.index AudioManager.shared.playAudio(data: data!, progressView: cell.audioProgressView, progressLabel: cell.audioProgressLabel, playButton: cell.playButton) } } }) } else { self.currentAudioIndex = cell.index AudioManager.shared.playAudio(data: cell.data!, progressView: cell.audioProgressView, progressLabel: cell.audioProgressLabel, playButton: cell.playButton) } } } // beep sound extension ChatViewController { func playBeepSound () { // play beep sound do { // Prepare beep player self.beepPlayer = try AVAudioPlayer(contentsOf: beepSound as URL) try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback) try AVAudioSession.sharedInstance().setActive(true) self.beepPlayer.prepareToPlay() self.beepPlayer.play() }catch {} } } // MARK:- class PreviewPhoto class PreviewPhoto: NSObject, NYTPhoto { var image: UIImage? var imageData: Data? var placeholderImage: UIImage? let attributedCaptionTitle: NSAttributedString? let attributedCaptionSummary: NSAttributedString? = NSAttributedString(string: "", attributes: [NSForegroundColorAttributeName: UIColor.gray]) let attributedCaptionCredit: NSAttributedString? = NSAttributedString(string: "", attributes: [NSForegroundColorAttributeName: UIColor.darkGray]) init(image: UIImage? = nil, title: String) { self.image = image self.imageData = nil self.attributedCaptionTitle = NSAttributedString(string: title, attributes: [NSForegroundColorAttributeName: UIColor.gray]) super.init() } }
[ -1 ]
b2969cc07fd2eb8ff850f8890f6d57f040498e8c
1c020e3c24f839573cf37432da48650ff0ff5136
/DnDSpells/DnDSpells/Stories/AddSpell/Description/View/DescriptionSpellVC.swift
cdb05c9f6e7e98bb3467388d83ddeca10f9e8694
[ "MIT" ]
permissive
ThePowerOfSwift/example
5ae86784c93e261a5c71172757c530f2c6eeb975
f72bb36e6d4430d8e0e0d881be8da7a5ac10784e
refs/heads/master
2022-02-24T23:18:45.977200
2019-09-19T07:03:31
2019-09-19T07:03:31
null
0
0
null
null
null
null
UTF-8
Swift
false
false
738
swift
// // DescriptionSpellVC.swift // DnDSpells // // Created by Сергей Мельников on 14/07/2019. // Copyright © 2019 Сергей Мельников. All rights reserved. // import UIKit class DescriptionSpellVC: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }
[ -1 ]
78bb83a44f6fdb63a75cc2170f94a58a1b98634f
08b5f06c21f6c96b163694bb12531ccea4b21e4d
/LabBot/LBCalibratedPair.swift
05f7b79fdc8a98d313471e01657930a8bb40cd9b
[ "MIT" ]
permissive
Tanglo/LabBot
2edb426b12bdd9b0a4e9850d3b96f7e6a698f5b9
21345a4d3694eac26bb433b3cbe237bbe55e100b
refs/heads/master
2021-05-16T02:41:31.146969
2017-09-10T07:18:10
2017-09-10T07:18:10
19,262,732
1
1
null
2015-05-29T06:15:10
2014-04-29T03:40:10
Objective-C
UTF-8
Swift
false
false
1,149
swift
// // LBCalibrationPair.swift // LabBot // // Created by Lee Walsh on 9/04/2015. // Copyright (c) 2015 Lee David Walsh. All rights reserved. // This sofware is licensed under the The MIT License (MIT) // See: https://github.com/Tanglo/LabBot/blob/master/LICENSE.md // import Foundation /// A class that stores a pair of objects where one represents the calibrated version of the other. open class LBCalibratedPair: NSObject, NSCoding { /// The uncalibrated object. open var raw: AnyObject = 0.0 as AnyObject /// An object that represents the calibrated version of raw. open var calibrated: AnyObject = 0.0 as AnyObject public init(raw: AnyObject, calibrated: AnyObject){ self.raw = raw self.calibrated = calibrated } required public init?(coder aDecoder: NSCoder) { self.raw = aDecoder.decodeObject(forKey: "raw")! as AnyObject self.calibrated = aDecoder.decodeObject(forKey: "calibrated")! as AnyObject } open func encode(with aCoder: NSCoder) { aCoder.encode(raw, forKey: "raw") aCoder.encode(calibrated, forKey: "calibrated") } }
[ -1 ]
9d5ccfcc82b8af1568513da033b03dd442f0921e
9f402322a52274c2ab35c6a315a78b85c144081c
/Tests/ToucanTests/ToucanTests.swift
3108f2d45298f5729886a640ab06e31521216dd8
[ "MIT" ]
permissive
Workmoose/Toucan
ed2d5957678a61746585cc76f9a3214fcdae0020
29e0c0ac151f774b9bb2be38b12e257b3a9b8577
refs/heads/master
2020-04-02T15:22:45.243719
2018-10-24T20:34:59
2018-10-24T20:34:59
154,565,502
0
0
null
null
null
null
UTF-8
Swift
false
false
403
swift
import XCTest @testable import Toucan final class ToucanTests: XCTestCase { func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct // results. XCTAssertEqual(Toucan().text, "Hello, World!") } static var allTests = [ ("testExample", testExample), ] }
[ 45059, 340486, 154139, 399393, 342564, 343600, 321587, 399411, 168503, 321592, 162363, 54337, 162370, 392263, 389706, 399435, 415818, 421458, 385622, 14943, 139368, 333427, 431732, 253047, 339576, 346748, 347261, 245378, 160900, 323213, 391821, 326293, 258712, 311963, 315549, 352944, 336561, 225982, 373950, 326336, 225987, 315587, 339669, 317669, 177386, 378097, 10485, 315142, 208139, 315152, 338194, 347420, 150814, 385311, 336673, 134435, 334117, 393521, 398131, 347446, 328502, 354104, 244557, 325454, 253783, 339802, 253787, 253791, 253796, 431974, 244583, 253800, 253803, 253808, 386418, 253812, 110965, 359289, 164735, 43401, 106890, 293770, 106892, 349586, 200604, 321438, 219049, 298410, 178090, 355244, 141737, 222126, 235959, 150972, 225213, 326594, 344517, 201162, 324043, 373200, 139729, 338391, 416229, 350704, 200184 ]
d748a57f310ba652b160aadf73e02cadcc808dc7
4930f78aba165c309414436316c4128bc91140d6
/xcswiftapp/Views/MovieBackdropCarouselView.swift
23d96d78e34ba190cac50cff3fa512d9f9b76fb1
[]
no_license
Arod1327/iosmoovieapp
74fcbf2766ba6fc7460b50fd8b89c67244ce4443
62aca99d683e9bf639a70f1145032c6aa0614162
refs/heads/main
2023-03-05T05:20:19.682004
2021-02-09T17:39:46
2021-02-09T17:39:46
337,479,428
0
0
null
null
null
null
UTF-8
Swift
false
false
1,389
swift
// // MovieBackdropCarouselView.swift // SwiftUIMovieDb // // Created by Andy Chunab on 09/02/21. // Copyright © 2021 Andy Chunab. All rights reserved. // import SwiftUI struct MovieBackdropCarouselView: View { let title: String let movies: [Movie] var body: some View { VStack(alignment: .leading, spacing: 0) { Text(title) .font(.title) .fontWeight(.bold) .padding(.horizontal) ScrollView(.horizontal, showsIndicators: false) { HStack(alignment: .top, spacing: 16) { ForEach(self.movies) { movie in NavigationLink(destination: MovieDetailView(movieId: movie.id)) { MovieBackdropCard(movie: movie) .frame(width: 272, height: 200) } .buttonStyle(PlainButtonStyle()) .padding(.leading, movie.id == self.movies.first!.id ? 16 : 0) .padding(.trailing, movie.id == self.movies.last!.id ? 16 : 0) } } } } } } struct MovieBackdropCarouselView_Previews: PreviewProvider { static var previews: some View { MovieBackdropCarouselView(title: "Latest", movies: Movie.stubbedMovies) } }
[ 383913, 383917 ]