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
c22e7f430d805afa79ec2e2ef064e201c2e27fdb
c51c2e534d7210a58dc35181f9d400db4e49d025
/FaceIt/AppDelegate.swift
0e3a32d79b2e1372369a2a8d80dfd88377179489
[]
no_license
Liuyubao/Swift-FaceIt
c722acdbb9014b85eb4c81712c4ea6a09de26755
5f33fbceb7494b5af3fac537fe3c36a7d7258001
refs/heads/master
2021-05-05T04:17:18.422083
2018-01-23T08:55:24
2018-01-23T08:55:24
118,583,846
0
0
null
null
null
null
UTF-8
Swift
false
false
2,169
swift
// // AppDelegate.swift // FaceIt // // Created by liuyubao on 2017/7/28. // Copyright © 2017年 liuyubao. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 327695, 229391, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 204856, 229432, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 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, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 320007, 287238, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 189040, 172660, 287349, 189044, 189039, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 287371, 279178, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 287390, 303773, 172705, 287394, 172707, 303780, 164509, 287398, 205479, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312005, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 189169, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303981, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 304007, 304009, 213895, 304011, 230284, 304013, 295822, 189325, 213902, 189329, 295825, 304019, 189331, 279438, 58262, 304023, 304027, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 230413, 197645, 295949, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 132165, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 279661, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 66690, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 230679, 320792, 230681, 296215, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 279929, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 288154, 337306, 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, 148946, 370130, 222676, 288210, 288212, 288214, 239064, 329177, 288217, 288218, 280027, 288220, 239070, 288224, 370146, 280034, 288226, 288229, 280036, 280038, 288232, 288230, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 402969, 230940, 222752, 108066, 296486, 296488, 157229, 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, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 337732, 280388, 304968, 280393, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 275606, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 280819, 157940, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 215387, 354653, 354656, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 436684, 281045, 281047, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 330244, 240132, 223752, 150025, 338440, 281095, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 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, 158596, 183172, 338823, 322440, 314249, 240519, 183184, 142226, 289687, 240535, 224151, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 420829, 281567, 289762, 322534, 297961, 183277, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 380226, 298306, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 298365, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 290325, 282133, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282255, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 196133, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 298822, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 282481, 110450, 315251, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 44948, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 290739, 241588, 282547, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 184503, 299191, 307385, 307386, 258235, 307388, 176311, 307390, 176316, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 323854, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 282957, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 291226, 242075, 283033, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 291254, 283062, 127417, 291260, 127421, 127424, 299457, 127429, 127431, 127434, 315856, 127440, 176592, 315860, 176597, 283095, 127447, 299481, 127449, 176605, 242143, 127455, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127494, 283142, 127497, 233994, 135689, 127500, 291341, 233998, 127506, 234003, 234006, 127511, 152087, 283161, 242202, 135707, 234010, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 299740, 242396, 201444, 299750, 283368, 234219, 283372, 185074, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 234246, 226056, 291593, 234248, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 316294, 226182, 234375, 308105, 226185, 234379, 201603, 324490, 234384, 234388, 234390, 226200, 234393, 209818, 308123, 234396, 324504, 291742, 324508, 234398, 234401, 291747, 291748, 234405, 291750, 324518, 324520, 234407, 324522, 234410, 291756, 291754, 226220, 324527, 234414, 234417, 201650, 324531, 291760, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 234437, 226239, 226245, 234439, 234443, 291788, 234446, 193486, 193488, 234449, 275406, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 234585, 275545, 242777, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 324757, 234647, 226453, 234648, 234650, 308379, 275608, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 177318, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 349451, 177424, 275725, 283917, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 333178, 275834, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 300448, 144807, 144810, 144812, 284076, 144814, 227426, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 292414, 284223, 284226, 284228, 243268, 292421, 284231, 226886, 128584, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 284249, 276052, 276053, 300638, 284251, 284253, 284255, 284258, 243293, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 325251, 276095, 276098, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 292681, 153417, 358224, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 317332, 358292, 284564, 399252, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 276402, 358326, 161718, 358330, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 350186, 292843, 276460, 292845, 178161, 227314, 276466, 325624, 350200, 276472, 317435, 276476, 276479, 350210, 276482, 178181, 317446, 276485, 350218, 276490, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 178224, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 243779, 325700, 284739, 292934, 243785, 276553, 350293, 350295, 309337, 227418, 350299, 194649, 350302, 194654, 350304, 178273, 309346, 227423, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 301163, 350313, 350316, 227430, 301167, 276583, 350321, 276590, 284786, 276595, 350325, 252022, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 153765, 284837, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 309491, 227571, 309494, 243960, 227583, 276735, 227587, 276739, 211204, 276742, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 129486, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 293346, 227810, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 301636, 318020, 301639, 301643, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 318132, 342707, 154292, 277173, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 56045, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 293696, 310080, 277317, 293706, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 276579, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 244731, 285690, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 384302, 285999, 277804, 113969, 277807, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 146765, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 245191, 64966, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 302614, 302617, 286233, 302621, 286240, 146977, 187936, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 245288, 310831, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 302764, 278188, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 280021, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
5f0b43844477ccf10d9ed8fc7ff75550da719830
c1aa7f125ee3a46cd5e07bee7d8d5e530d02be0e
/AutoCellFactory/Classes/BaseCell.swift
e3412e1c2b165952a20bf9dfdc9e58a2b109dbdb
[ "MIT" ]
permissive
OrenRosen/AutoCellFactory
d067acc7ba67049eb0a729e236cb291eb9c1ff07
a96e250cc043f9b9254692cb7b08e8bde9f746b4
refs/heads/master
2020-04-06T06:54:06.239432
2016-09-03T18:10:14
2016-09-03T18:10:14
65,581,453
0
0
null
null
null
null
UTF-8
Swift
false
false
1,946
swift
// // BaseCell.swift // AotoCellCellFactory // // Created by Oren Rosenblum on 8/8/16. // Copyright © 2016 Oren Rosenblum. All rights reserved. // import Foundation import UIKit public class ACBasicCellPresenterHolder: UITableViewCell, ACPresenterHolder, ACReusableView { var acPresenterPlaceHolder: ACModelHolder? { get { return nil } set(newPresenter) { } } public func getPresenter() -> ACModelHolder? { return acPresenterPlaceHolder } } public class ACBasicCell<PresenterType: AnyObject where PresenterType: AutoCellPresenterer> : ACBasicCellPresenterHolder { public var presenter: PresenterType! override var acPresenterPlaceHolder: ACModelHolder? { get { return presenter } set(newPresenter) { presenter = newPresenter as? PresenterType } } override public func awakeFromNib() { super.awakeFromNib() setup() } override public init(style: UITableViewCellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) setup() } public func configureCell() { } private func setup() { presenter = PresenterType() presenter.reloadView = { [weak self] in self?.configureCell() } } } public protocol ACModelHolder { var acModelPlaceHolder: Any? { get set } } protocol ACPresenterHolder: class { var acPresenterPlaceHolder: ACModelHolder? { get set } } extension ACPresenterHolder { var acPresenterPlaceHolder: ACModelHolder? { get { return nil } set(newPresenter) { } } } protocol ACReusableView { static var defaultReuseIdentifier: String { get } } extension ACReusableView where Self: UIView { static var defaultReuseIdentifier: String { return NSStringFromClass(self).componentsSeparatedByString(".").last! } }
[ -1 ]
9a8acf5d058bd6d46171f3bc4d5877098fe4e68e
f550145a6e145da6143842a5637d98304225af7c
/NavigationStack/ViewController/Stack/ViewController4.swift
1771bdd8a086ea4611b11b35fe921bcf42dbfc5a
[]
no_license
serkanmalagic/Navigation-Stack
3abc878a3cc26bad423b77724bcf9cceb69fb83b
33f014ca07a4cdabed4ec3e15bca3d9e3d2c5029
refs/heads/master
2023-08-01T05:14:03.079596
2021-09-10T12:49:00
2021-09-10T12:49:00
null
0
0
null
null
null
null
UTF-8
Swift
false
false
505
swift
// // ViewController4.swift // NavigationStack // // Created by Serkan Mehmet Malagiç on 30.05.2021. // import UIKit class ViewController4: BaseViewController { override func viewDidLoad() { super.viewDidLoad() } @IBAction func btnTapped(_ sender:UIButton!) { ViewController4.pushVc(storyboardName: "Main", from: self, fromStoryBoardId: "VC5") } @IBAction func btn4Tapped(_ sender: Any) { self.cleanAllViewControllers(viewcontroller: self) } }
[ -1 ]
d4878a5ce388d2f55db3eee1fe5a2f3818690ff8
9214b388a05a361b7d1a7896fe2511cf83c07faa
/Recipe Chef/ViewModels/RecipeModel.swift
8461ebe51300248a40bbc5c5177f42a596099e71
[]
no_license
johnjeang/Recipe-List
0acec97d42c759802e3ea7faf617df4d2a63dac1
e915f63dec2167d4b5b7b0821fe8a9e99fb6d142
refs/heads/main
2023-04-10T06:37:59.826712
2021-03-31T21:50:26
2021-03-31T21:50:26
350,479,969
0
0
null
null
null
null
UTF-8
Swift
false
false
2,030
swift
// // RecipeModel.swift // Recipe Chef // // Created by John Jeang on 3/19/21. // import Foundation class RecipeModel: ObservableObject{ @Published var recipes = [Recipe]() init(){ self.recipes = DataService.getLocalData() } static func getPortion(_ ingredient:Ingredient, _ recipeServings:Int, _ targetServings:Int) -> String{ var portion = "" var numerator = ingredient.num ?? 1 var denominator = ingredient.denom ?? 1 var wholePortions = 0 if ingredient.num != nil{ denominator *= recipeServings numerator *= targetServings let gcd = Rational.greatestCommonDivisor(numerator, denominator) numerator /= gcd denominator /= gcd if numerator > denominator{ wholePortions = numerator/denominator numerator = numerator%denominator portion += String(wholePortions) } if numerator >= 0{ portion += wholePortions > 0 ? " " : "" portion += numerator > 0 ? "\(numerator) / \(denominator) ":"" } if var unit = ingredient.unit{ if wholePortions > 1{ if unit.suffix(2) == "ch"{ unit += "es" } else if unit.suffix(1) == "f"{ unit = String(unit.dropLast()) unit += "ves" } else{ unit += "s" } } portion += ingredient.num == nil && ingredient.denom == nil ? "" : " " return(portion + unit) } } return(portion) } }
[ -1 ]
6c4c33781c7392ac8812e4bd84ecd9934d4907af
50a720046661ce9797978f567dfcf2795c54d19f
/weiBoSwift/weiBoSwift/Classes/Home/Controller/YBHomePresentationController.swift
6c24da9845cd7ddfee1fcffa741716020afd6c92
[ "Apache-2.0" ]
permissive
wangwugang1314/weiBoSwift
74fd7bdbce80e99b0ff77cda40d6b80ca26f4119
1331465d7b45a0537ff38c455e03edf331c8f435
refs/heads/master
2021-01-21T13:03:10.500677
2016-04-28T03:10:14
2016-04-28T03:10:14
46,861,748
0
0
null
null
null
null
UTF-8
Swift
false
false
1,324
swift
// // YBHomePresentationController.swift // weiBoSwift // // Created by MAC on 15/11/30. // Copyright © 2015年 MAC. All rights reserved. // import UIKit class YBHomePresentationController: UIPresentationController { /// 将要布局的时候调用 override func containerViewWillLayoutSubviews() { super.containerViewWillLayoutSubviews() coverView.frame = containerView!.bounds containerView?.insertSubview(coverView, belowSubview: presentedView()!) // 设置锚点 presentedView()?.layer.anchorPoint = CGPoint(x: 0.5, y: 0) // 设置展现试图的大小 presentedView()?.frame = CGRectMake(90, 60, 200, 300) } /// 将要展现的时候调用 override func presentationTransitionWillBegin() { // 添加手势(点击手势) coverView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: "tapGestureRecognizer")) } /// 添加手势方法 @objc private func tapGestureRecognizer(){ presentedViewController.dismissViewControllerAnimated(true, completion: nil) } // MARK: - 懒加载 private lazy var coverView: UIView = { let view = UIView() view.alpha = 0.5 view.backgroundColor = UIColor(white: 0, alpha: 0.5) return view }() }
[ -1 ]
501bbb1b9f154e2a852f29257fa59af37fdc5877
5a7a7fb430b7be5f107e57c0a502eb2c3fbd48b9
/DesignPatterns/DesignPatterns/TemplateMethod.swift
383008730ba819d9d5279de84e2baa50d3db2c5c
[]
no_license
sana/Swift
07694e6f61041bde1f0d39114d47cb2426e4c971
5fa515032958d1ece04b5abc7d5baadf0fd01d41
refs/heads/master
2021-07-18T12:25:36.180505
2021-02-15T17:30:02
2021-02-15T17:30:02
47,517,431
2
1
null
null
null
null
UTF-8
Swift
false
false
761
swift
// // TemplateMethod.swift // DesignPatterns // // Created by Laurentiu Dascalu on 12/25/15. // Copyright © 2015 Laurentiu Dascalu. All rights reserved. // import Foundation /** Define a skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure. */ protocol AbstractSentenceComposer { func who() -> String func did() -> String func what() -> String } extension AbstractSentenceComposer { // this is the actual template method and it combines various abstract // method calls into a single step of an algorithm func sentence() -> String { return "\(who()) \(did()) \(what())" } }
[ -1 ]
eb71ae1a75c865e81ac598539a2b49eca43f0a35
4a1627ef8450246956e0b285fa87a111aac41253
/IOS-Investment-App/IOS-Investment-App/Common/ViewComponents/IBDesignable/DesignableLabel.swift
b0428a6c23cbec54f0b587a80dd354e619d432ee
[]
no_license
Enkic/IOS-Investistment-App
43ba9cf9172f6faf74a3bb00d80e2212c11b12a8
60f9ef21f9244714b4dc7ef113e7a55e73eba888
refs/heads/master
2023-02-10T20:56:41.335937
2021-01-08T14:59:05
2021-01-08T14:59:05
315,309,495
0
0
null
null
null
null
UTF-8
Swift
false
false
3,556
swift
// // DesignableLabel.swift // IOS-Investment-App // // Created by enki corbin on 25/11/2020. // Copyright © 2020 enki corbin. All rights reserved. // import UIKit @IBDesignable class DesignableLabel: UILabel { @IBInspectable var cornerRadius: CGFloat = 0 @IBInspectable var topLeftCorner: Bool = true @IBInspectable var topRightCorner: Bool = true @IBInspectable var bottomLeftCorner: Bool = true @IBInspectable var bottomRightCorner: Bool = true @IBInspectable var borderWidth: CGFloat = 0 @IBInspectable public var borderColor: UIColor = UIColor.clear @IBInspectable var shadowOpacity: Float = 0.6 @IBInspectable var shadowX: Int = 4 @IBInspectable var shadowY: Int = 4 @IBInspectable var shadowRadius: Int = 6 @IBInspectable var shakeRepeat: Int = 2 @IBInspectable var shakeDuration: CGFloat = 0.1 @IBInspectable var shakeDistX: Int = 8 @IBInspectable var shakeDistY: Int = 0 @IBInspectable var topInset: CGFloat = 0 @IBInspectable var bottomInset: CGFloat = 0 @IBInspectable var leftInset: CGFloat = 0 @IBInspectable var rightInset: CGFloat = 0 private var stateStr: String = "available" override var intrinsicContentSize: CGSize { let size = super.intrinsicContentSize return CGSize(width: size.width + leftInset + rightInset, height: size.height + topInset + bottomInset) } override func layoutSubviews() { super.layoutSubviews() setupLabel() } override func drawText(in rect: CGRect) { let insets = UIEdgeInsets.init(top: topInset, left: leftInset, bottom: bottomInset, right: rightInset) super.drawText(in: rect.inset(by: insets)) } private func setupLabel() { layer.borderWidth = borderWidth layer.borderColor = borderColor.cgColor layer.cornerRadius = cornerRadius * min(bounds.size.width, bounds.size.height) layer.maskedCorners = CACornerMask( TL: topLeftCorner, TR: topRightCorner, BL: bottomLeftCorner, BR: bottomRightCorner) layer.shadowOpacity = shadowOpacity layer.shadowOffset = CGSize(width: shadowX, height: shadowY) layer.shadowRadius = CGFloat(shadowRadius) available() } public func shake() { let shake = CABasicAnimation(keyPath: "position") shake.duration = CFTimeInterval(shakeDuration) shake.repeatCount = Float(shakeRepeat) shake.autoreverses = true let fromPoint = CGPoint(x: center.x - CGFloat(shakeDistX), y: center.y - CGFloat(shakeDistY)) let fromValue = NSValue(cgPoint: fromPoint) let toPoint = CGPoint(x: center.x + CGFloat(shakeDistX), y: center.y + CGFloat(shakeDistY)) let toValue = NSValue(cgPoint: toPoint) shake.fromValue = fromValue shake.toValue = toValue layer.add(shake, forKey: "position") } func available() { layer.opacity = 1 isEnabled = true isHidden = false stateStr = "available" } func unavailable() { layer.opacity = 0.5 isEnabled = false isHidden = false stateStr = "unavailable" } func hidden() { layer.opacity = 0 isEnabled = false isHidden = true stateStr = "hidden" } func state() -> String { return stateStr } }
[ -1 ]
38fb063fa1994057c8549a08243b7dd30c37197a
bbc438e3a7ca22211aea8cfb7ee77738da0e9baf
/Tweeter/TweetsViewController.swift
8643fd095629ddb74a6b0df97c20d75a945d7a21
[ "Apache-2.0" ]
permissive
Shwinn/Tweeter
d2c0710ca4748fd83845831b7adbd27df359c832
b24dbd88db25cd7c07db152ec6fa4e3c35ffd36c
refs/heads/master
2021-01-21T05:20:33.830388
2017-03-06T03:27:50
2017-03-06T03:27:50
83,174,703
0
0
null
null
null
null
UTF-8
Swift
false
false
3,511
swift
// // TweetsViewController.swift // Tweeter // // Created by Ashwin Gupta on 2/26/17. // Copyright © 2017 Ashwin Gupta. All rights reserved. // import UIKit class TweetsViewController: UIViewController, UITableViewDataSource, UITableViewDelegate, TweetCellDelegator { @IBOutlet weak var tableView: UITableView! var tweets: [Tweet]! @IBAction func onLogoutButton(_ sender: Any) { TwitterClient.sharedInstance?.logout() } override func viewDidLoad() { super.viewDidLoad() tableView.delegate = self tableView.dataSource = self tableView.rowHeight = UITableViewAutomaticDimension tableView.estimatedRowHeight = 120 TwitterClient.sharedInstance?.homeTimeLine(success: { (tweets: [Tweet]) in self.tweets = tweets self.tableView.reloadData() }, failure: { (error: Error) in print(error.localizedDescription) }) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) TwitterClient.sharedInstance?.homeTimeLine(success: { (tweets: [Tweet]) in self.tweets = tweets self.tableView.reloadData() }, failure: { (error: Error) in print(error.localizedDescription) }) self.tableView.reloadData() } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int{ if (self.tweets != nil){ return self.tweets.count } else { return 0 } } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "TweetCell", for: indexPath as IndexPath) as! TweetCell cell.delegate = self cell.tweet = tweets[indexPath.row] cell.retweetButton.tag = indexPath.row cell.favoriteButton.tag = indexPath.row //cell.delegate = self return cell } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func callSegueFromCell(user: User){ self.performSegue(withIdentifier: "profileSeguefromCell", sender: user) } // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. if (segue.identifier == "tweetDetailSegue"){ let cell = sender as! UITableViewCell let indexPath = tableView.indexPath(for: cell) let tweet = tweets![indexPath!.row] let tweetDetailViewController = segue.destination as! TweetDetailViewController tweetDetailViewController.tweet = tweet } if (segue.identifier == "profileSeguefromMe"){ let profileViewController = segue.destination as! ProfileViewController profileViewController.tweetUser = User.currentUser } if (segue.identifier == "profileSeguefromCell") { let profileViewController = segue.destination as! ProfileViewController profileViewController.tweetUser = sender as! User } } }
[ -1 ]
bd24f976e66f482268f836b01a6198dfa62a034f
91882250cab9dda3b1b9ed23f48848c312e0fc83
/Lab - Operators.playground/Pages/7. Exercise - Numeric Type Conversion.xcplaygroundpage/Contents.swift
eeec3ec35e53181cb6e63058930efc8cc5cd1266
[]
no_license
Maryville-FA2018-ISYS-120-1M/app-dev-labs-1-3-apisciotta1
2ab481dc37a6f8c9ffc9b1def8ba1d2dae1c1023
a1ec172d1617c17c0448fb5f435fcf9ba77a0eda
refs/heads/master
2020-03-28T02:02:55.381019
2018-09-13T19:39:09
2018-09-13T19:39:09
147,544,070
0
0
null
null
null
null
UTF-8
Swift
false
false
1,024
swift
/*: ## Exercise - Numeric Type Conversion Create an integer constant `x` with a value of 10, and a double constant `y` with a value of 3.2. Create a constant `multipliedAsIntegers` equal to `x` times `y`. Does this compile? If not, fix it by converting your `Double` to an `Int` in the mathematical expression. Print the result. */ let x = 10 let y = 3.2 let multipliedAsIntegers = x * Int(y) print(multipliedAsIntegers) /*: Create a constant `multipliedAsDoubles` equal to `x` times `y`, but this time convert the `Int` to a `Double` in the expression. Print the result. */ let multipliedAsDoubles = Double(x) * y print(multipliedAsDoubles) /*: Are the values of `multipliedAsIntegers` and `multipliedAsDoubles` different? Print a statement to the console explaining why. */ print("Yes, these statements are different because the Integers aren't as specific as Doubles and round down to 3 instead of multiplying by 3.2") //: [Previous](@previous) | page 7 of 8 | [Next: App Exercise - Converting Types](@next)
[ -1 ]
570ae8752a858a5dfa748a4029371ed15317bf33
343c2bcefde78a20e5daf90a91f28a6ab1d111a6
/iosuiUITests/iosuiUITests.swift
e00beda67c14e68c2b7f30e45adb7d124db5887d
[]
no_license
vldrshv/ui_ios
ac448e4cadc784da8a2f3a95dd94f766b9f3e3af
55cbacbf6c615e1f3bedaff98f5faff474613880
refs/heads/main
2023-04-20T06:32:42.518157
2021-02-13T06:41:14
2021-02-13T06:41:14
336,835,960
0
0
null
null
null
null
UTF-8
Swift
false
false
1,402
swift
// // iosuiUITests.swift // iosuiUITests // // Created by vlad on 30.01.2021. // import XCTest class iosuiUITests: XCTestCase { override func setUpWithError() throws { // 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 // 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 tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // UI tests must launch the application that they test. let app = XCUIApplication() app.launch() // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testLaunchPerformance() throws { if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { // This measures how long it takes to launch your application. measure(metrics: [XCTApplicationLaunchMetric()]) { XCUIApplication().launch() } } } }
[ 360463, 376853, 344106, 253996, 163894, 385078, 319543, 352314, 376892, 32829, 352324, 352327, 385095, 163916, 368717, 196687, 254039, 426074, 368732, 180317, 32871, 352359, 221292, 385135, 376945, 385147, 426124, 196758, 49308, 65698, 49317, 377008, 377010, 377025, 377033, 164043, 417996, 254157, 368849, 368850, 139478, 385240, 254171, 147679, 147680, 205034, 254189, 254193, 344312, 336121, 262403, 147716, 385291, 368908, 180494, 262419, 254228, 368915, 377116, 254250, 131374, 418095, 336177, 368949, 180534, 155968, 270663, 319816, 368969, 254285, 180559, 377168, 344402, 368982, 270703, 139641, 385407, 385409, 106893, 270733, 385423, 385433, 213402, 385437, 254373, 385448, 385449, 311723, 115116, 385463, 336319, 336323, 188870, 262619, 377309, 377310, 369121, 369124, 270823, 213486, 360945, 139766, 393719, 377337, 254459, 410108, 410109, 262657, 377346, 410126, 393745, 385554, 262673, 254487, 410138, 188957, 377374, 385569, 385578, 377388, 197166, 393775, 418352, 33339, 352831, 33344, 385603, 385612, 426575, 385620, 369236, 270938, 352885, 352886, 344697, 369285, 385669, 344714, 377487, 426646, 180886, 352921, 377499, 344737, 352938, 418479, 164532, 336565, 377531, 377534, 377536, 385737, 385745, 369365, 369366, 385751, 361178, 352989, 352990, 418529, 295649, 385763, 369383, 361194, 418550, 344829, 197377, 434956, 418579, 426772, 197398, 426777, 344864, 197412, 336678, 189229, 197424, 197428, 336693, 377656, 426809, 197433, 222017, 377669, 197451, 369488, 385878, 385880, 197467, 435038, 385895, 197479, 385901, 197489, 164730, 254851, 369541, 172936, 426894, 189327, 377754, 140203, 172971, 377778, 189362, 189365, 377789, 345034, 418774, 386007, 418781, 386016, 123880, 418793, 435185, 222193, 271351, 435195, 328701, 386049, 328705, 418819, 410629, 377863, 189448, 320526, 361487, 435216, 386068, 254997, 336928, 336930, 410665, 345137, 361522, 386108, 410687, 377927, 361547, 205911, 156763, 361570, 214116, 214119, 402538, 173168, 377974, 66684, 377986, 402568, 140426, 337037, 386191, 410772, 222364, 418975, 124073, 402618, 402632, 148687, 402641, 419028, 222441, 386288, 66802, 271607, 386296, 369913, 419066, 369912, 386300, 386304, 320769, 369929, 419097, 320795, 115997, 222496, 369964, 353581, 116014, 66863, 312628, 345397, 345398, 386363, 345418, 337226, 337228, 353611, 353612, 378186, 353617, 378201, 312688, 337280, 353672, 263561, 304523, 370066, 9618, 411028, 370072, 148900, 361928, 337359, 329168, 329170, 353751, 329181, 320997, 361958, 271850, 271853, 329198, 411119, 116209, 386551, 312830, 271880, 198155, 329231, 370200, 157219, 157220, 394793, 353875, 99937, 345697, 271980, 206447, 403057, 42616, 337533, 370307, 419462, 149127, 149128, 419464, 214667, 411275, 345753, 255651, 337590, 370359, 403149, 345813, 370390, 272087, 345817, 337638, 181992, 345832, 345835, 141037, 173828, 395018, 395019, 395026, 124691, 435993, 345882, 411417, 321308, 255781, 362281, 378666, 403248, 378673, 345910, 182070, 182071, 436029, 337734, 272207, 272208, 337746, 395092, 345942, 362326, 345950, 370526, 362336, 255844, 214894, 362351, 214896, 124795, 182145, 337816, 124826, 329627, 354210, 436130, 436135, 10153, 362411, 370604, 362418, 411587, 362442, 346066, 354268, 436189, 403421, 329696, 354273, 403425, 190437, 354279, 436199, 174058, 354283, 247787, 329707, 337899, 247786, 313322, 436209, 124912, 346117, 182277, 354311, 403463, 354312, 43016, 354310, 436235, 419857, 436248, 346153, 124974, 272432, 403507, 378933, 378934, 436283, 403524, 436293, 436304, 329812, 411738, 272477, 395373, 346237, 436372, 362658, 436388, 125108, 133313, 395458, 338118, 436429, 346319, 321744, 379102, 387299, 18661, 379110, 125166, 149743, 379120, 436466, 125170, 411892, 395511, 436471, 436480, 125184, 272644, 125192, 338187, 338188, 125197, 395536, 125200, 338196, 272661, 157973, 379157, 125204, 125215, 125216, 338217, 125225, 125236, 362809, 379193, 395591, 272730, 436570, 215395, 362864, 354672, 272755, 354678, 248188, 313726, 436609, 240003, 395653, 436613, 395660, 264591, 272784, 420241, 436644, 272815, 436659, 338359, 436677, 256476, 420326, 166403, 322057, 420374, 322077, 330291, 191065, 436831, 420461, 313970, 346739, 346741, 420473, 166533, 346771, 363155, 264855, 363161, 436897, 355006, 363228, 436957, 436960, 264929, 338658, 346859, 330476, 35584, 133889, 346889, 264971, 322320, 207639, 363295, 355117, 191285, 355129, 273209, 273211, 355136, 355138, 420680, 355147, 355148, 355153, 387927, 363353, 363354, 322396, 420702, 363361, 363362, 412516, 355173, 355174, 207724, 355182, 207728, 420722, 330627, 265094, 387977, 396171, 355216, 224146, 224149, 256918, 256919, 256920, 256934, 273336, 273341, 330688, 379845, 363462, 273353, 207839, 347104, 134124, 412653, 257007, 248815, 347122, 437245, 257023, 125953, 396292, 330759, 347150, 330766, 412692, 330789, 248871, 412725, 257093, 404550, 314437, 339031, 257126, 404582, 265318, 396395, 265323, 404589, 273523, 363643, 248960, 150656, 363658, 404622, 224400, 347286, 265366, 429209, 339101, 429216, 339106, 265381, 380069, 421050, 339131, 265410, 183492, 273616, 339167, 421102, 363769, 52473, 52476, 412926, 437504, 388369, 380178, 429332, 126229, 412963, 257323, 273713, 208179, 159033, 347451, 216387, 257353, 257354, 109899, 437585, 331091, 150868, 372064, 429410, 437602, 388458, 265579, 314734, 314740, 314742, 421240, 314745, 388488, 314776, 396697, 396709, 380335, 355761, 421302, 134586, 380348, 380350, 216511, 216510, 200136, 273865, 339403, 372172, 413138, 437726, 429540, 3557, 3559, 191980, 191991, 265720, 216575, 372226, 437766, 208397, 323088, 413202, 388630, 413206, 175640, 216610, 372261, 347693, 323120, 396850, 200245, 323126, 134715, 421437, 396865, 413255, 265800, 273992, 421452, 265809, 396885, 265816, 396889, 388699, 396896, 323171, 388712, 388713, 339579, 396927, 224907, 396942, 405140, 274071, 208547, 208548, 405157, 388775, 364202, 421556, 224951, 224952, 323262, 323265, 241360, 241366, 224985, 159462, 372458, 397040, 12017, 274170, 175874, 249606, 323335, 372497, 397076, 421657, 339746, 257831, 167720, 241447, 421680, 421686, 274234, 241471, 339782, 315209, 241494, 339799, 274276, 274288, 372592, 274296, 339840, 315265, 372625, 118693, 438186, 151492, 380874, 372699, 380910, 380922, 380923, 274432, 372736, 241695, 315431, 430120, 315433, 430127, 405552, 249912, 225347, 421958, 176209, 381013, 53334, 200795, 356446, 438374, 176231, 438378, 217194, 422000, 249976, 266361, 422020, 381061, 168070, 168069, 381071, 323730, 430231, 200856, 422044, 192670, 192671, 258213, 323761, 430263, 266427, 356550, 372943, 266447, 258263, 356575, 438512, 372979, 389364, 381173, 135416, 356603, 266504, 61720, 381210, 315674, 389406, 438575, 266547, 332084, 397620, 438583, 127292, 438592, 332100, 397650, 348499, 250196, 348501, 389465, 332128, 110955, 242027, 160111, 250227, 438653, 266628, 340356, 225684, 373141, 373144, 389534, 397732, 373196, 242138, 184799, 201195, 324098, 340489, 397841, 258584, 397855, 348709, 348710, 397872, 340539, 266812, 438850, 348741, 381515, 348748, 430681, 332379, 184938, 373357, 184942, 176751, 389744, 356983, 356984, 209529, 356990, 422529, 373377, 152196, 201348, 356998, 348807, 356999, 316050, 275102, 340645, 176805, 422567, 176810, 160441, 422591, 135888, 242385, 373485, 373486, 21239, 275193, 348921, 430853, 430860, 62222, 430880, 152372, 160569, 430909, 160576, 348999, 439118, 275294, 381791, 127840, 357219, 439145, 242540, 242542, 381811, 201590, 398205, 340865, 349066, 316299, 349068, 381840, 390034, 373653, 430999, 209820, 381856, 185252, 398244, 422825, 381872, 398268, 349122, 398275, 373705, 127945, 340960, 398305, 340967, 398313, 127990, 349176, 201721, 349179, 357380, 398370, 357413, 357420, 21567, 398405, 218187, 250955, 250965, 439391, 250982, 398444, 62574, 357487, 119925, 349304, 349315, 349317, 373902, 177297, 324761, 373937, 373939, 324790, 218301, 259275, 259285, 357594, 414956, 251124, 439550, 439563, 242955, 414989, 349458, 259346, 259347, 382243, 382246, 382257, 382264, 333115, 193853, 251212, 406862, 259408, 316764, 374110, 382329, 259449, 357758, 243073, 357763, 112019, 398740, 333224, 374189, 251314, 259513, 54719, 259569, 251379, 398844, 210429, 366081, 153115, 431646, 349727, 431662, 374327, 210489, 235069, 349764, 128589, 333389, 333394, 349780, 415334, 54895, 366198, 210558, 210559, 415360, 333438, 415369, 431754, 210569, 267916, 415376, 259741, 153252, 399014, 210601, 202413, 317102, 415419, 259780, 333508, 267978, 333522, 325345, 333543, 325357, 431861, 161539, 366358, 169751, 431901, 341791, 325411, 333609, 399148, 202541, 431918, 153392, 431935, 415555, 325444, 325449, 341837, 415566, 431955, 325460, 317268, 341846, 259937, 382820, 415592, 325491, 341878, 276343, 333687, 350072, 317305, 112510, 325508, 333700, 243590, 350091, 350092, 350102, 350108, 333727, 219046, 128955, 219102, 6116, 432114, 415740, 268286, 415744, 333827, 243720, 399372, 153618, 358418, 178215, 325675, 243763, 358455, 325695, 399433, 333902, 104534, 260206, 432241, 374913, 374914, 415883, 333968, 333990, 104633, 260285, 268479, 374984, 334049, 325857, 268515, 383208, 317676, 260337, 260338, 432373, 375040, 432387, 260355, 375052, 194832, 325904, 391448, 334104, 268570, 178459, 186660, 268581, 334121, 358698, 325930, 260396, 358707, 432435, 178485, 358710, 14654, 268609, 383309, 383327, 391521, 366948, 416101, 383338, 432503, 432511, 252309, 39323, 317851, 375211, 334259, 129461, 342454, 358844, 317889, 326083, 416201, 129484, 154061, 416206, 432608, 195044, 391654, 432616, 334315, 375281, 334345, 432650, 342549, 416288, 342560, 350758, 350759, 358951, 358952, 219694, 219695, 432694, 375369, 375373, 416334, 416340, 244311, 416353, 260705, 375396, 268901, 244326, 244345, 375438, 326288, 383668, 342714, 39616, 383708, 269036, 432883, 203511, 342775, 383740, 416509, 359166, 162559, 375552, 432894, 383755, 326413, 326428, 318247, 342827, 391980, 318251, 375610, 342846, 416577, 244569, 375644, 252766, 351078, 342888, 392057, 211835, 269179, 392065, 260995, 400262, 392071, 424842, 236427, 252812, 400271, 392080, 400282, 7070, 211871, 359332, 359333, 326571, 252848, 326580, 261045, 261046, 326586, 359365, 211913, 326602, 342990, 252878, 433104, 359380, 433112, 433116, 359391, 187372, 343020, 383980, 383994, 171009, 384004, 433166, 384015, 433173, 326684, 252959, 384031, 375848, 261191, 375902, 375903, 392288, 253028, 351343, 187505, 138354, 384120, 392317, 343166, 384127, 392320, 253074, 326803, 359574, 351389, 253098, 367791, 367792, 367798, 343230, 367809, 253124, 113863, 351445, 195809, 253168, 351475, 351489, 367897, 367898, 245018, 130347, 261426, 212282, 359747, 359748, 146763, 114022, 253288, 425327, 425331, 163190, 327030, 384379, 253316, 384391, 253339, 253340, 343457, 245160, 359860, 359861, 343480, 425417, 327122, 425434, 310747, 253431, 359931, 187900, 343552, 409095, 359949, 253456, 253462, 146976, 245290, 245291, 343606, 163385, 425534, 138817, 147011, 147020, 196184, 179800, 343646, 155238, 204394, 138862, 188021, 425624, 245413, 384693, 376502, 409277, 319176, 409289, 425682, 245471, 155360, 212721, 163575, 319232, 360194, 409355, 155408, 417556, 204600, 319289, 384826, 409404, 360253, 409416, 376661, 368471, 425820, 368486, 384871, 409446, 40809, 368489, 425832, 417648, 417658, 360315, 253828, 327556, 425875, 253851, 376733, 253868, 188349, 212947, 212953, 360416, 253930, 385011 ]
4a815c31b1f5f37f9748b473bfc33b204fa1ab36
d91773c145051af0369bde2ab3c8671fa55a9417
/Shoreline/Expression/View/EqualsView.swift
d54dbdfca1d28374b35614f34d39de69fa7fc63d
[]
no_license
imapersonman/Shoreline
cbf8de75689344d7ce1a8e6c2b2d968213473373
93abee4c0922b5753dd029a3885aae7802e1fe19
refs/heads/master
2020-05-14T23:59:21.934338
2019-04-11T20:26:41
2019-04-11T20:26:41
182,004,734
0
0
null
null
null
null
UTF-8
Swift
false
false
3,923
swift
// // EqualsView.swift // Shoreline // // Created by Koissi Adjorlolo on 4/5/19. // Copyright © 2019 Koissi Adjorlolo. All rights reserved. // import Cocoa class EqualsView: ExpressionView { let left: ExpressionView let right: ExpressionView var equals = NSBox() // This sort of looks like a model. That's not good. Fix later. var selectionBoxes = [Int: NSBox]() var selectionRanges = [Int: (Int, Int)]() init(origin: NSPoint, left: ExpressionView, right: ExpressionView) { self.left = left self.right = right super.init(frame: NSRect(origin: origin, size: NSSize.zero)) self.addSubview(self.left) self.addSubview(self.right) self.left.setParent(self) self.left.setChildIndex(0) self.right.setParent(self) self.right.setChildIndex(1) self.addSubview(equals) self.layoutCustom() } convenience init(left: ExpressionView, right: ExpressionView) { self.init(origin: NSPoint.zero, left: left, right: right) } required init?(coder decoder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func getExpressionSubviews() -> [ExpressionView]? { return [self.left, self.right] } func createRangedSelectionFrame(range: (Int, Int)) -> NSRect { switch range { case (0, 0): // numerator view return self.left.frame case (1, 1): // denominator view return self.right.frame case (0, 1): // numerator and denominator view return self.frame default: print("this selection doesn't make any sense for a RationalView") return NSRect.zero } } override func selectRange(_ selectionIndex: Int, range: (Int, Int)) { super.selectRange(selectionIndex, range: range) if range.0 < 0 || range.0 > 1 || range.1 < 0 || range.1 > 1 { print("We're all going to die thanks to you. Great") exit(-1) // For now } let frame = self.createRangedSelectionFrame(range: range) let color = ExpressionView.getColorForSelectionIndex(selectionIndex) let newBox = ExpressionView.createBorderBox(color: color, frame: frame) newBox.isHidden = false self.selectionBoxes[selectionIndex] = newBox self.selectionRanges[selectionIndex] = range self.addSubview(newBox) } override func layoutCustom() { super.layoutCustom() self.left.setFontSize(size: self.fontSize) self.left.frame.origin = NSPoint.zero self.addSubview(self.left) let equals = NSTextField(labelWithAttributedString: NSAttributedString(string: "=")) equals.font = NSFont.systemFont(ofSize: self.fontSize) equals.sizeToFit() equals.frame.origin = NSPoint(x: self.left.frame.width, y: 0.0) self.addSubview(equals) self.right.setFontSize(size: self.fontSize) self.right.frame.origin = NSPoint( x: self.left.frame.width + equals.frame.width, y: 0.0) self.addSubview(self.right) self.frame.size = NSSize( width: self.left.frame.width + equals.frame.width + self.right.frame.width, height: max(self.left.frame.height, self.right.frame.height)) for view in self.subviews { view.frame.origin.y = self.frame.height / 2 - view.frame.height / 2 } for (index, box) in self.selectionBoxes { box.frame = self.createRangedSelectionFrame(range: self.selectionRanges[index]!) self.addSubview(box) } } override func draw(_ dirtyRect: NSRect) { super.draw(dirtyRect) // Drawing code here. } }
[ -1 ]
0439b21afcc4a1be2abdd27f87117c7ec9028cf3
0786c24d028460855bbf6bcf917f55a7c6f069b8
/PokeDex/Model/Pokemon.swift
67fac10793d708e532164fbe7b674a154e3ea87d
[]
no_license
acoutinho12/PokeDex
51c900271ca2a822479565d5057f3f1c44b2c50c
317ffb7eed3aa2b5ae06b29e9011e9e3df95069d
refs/heads/main
2023-05-03T15:26:11.029416
2021-06-02T16:11:32
2021-06-02T16:11:32
372,947,797
4
0
null
null
null
null
UTF-8
Swift
false
false
947
swift
// This file was generated from JSON Schema using quicktype, do not modify it directly. // To parse the JSON, add this file to your project and do: // // let pokemon = try? newJSONDecoder().decode(Pokemon.self, from: jsonData) import Foundation // MARK: - PokemonClass struct PokemonClass: Codable, Identifiable { let attack, defense: Int let pokemonDescription: String let evolutionChain: [EvolutionChain]? let height, id: Int let imageURL: String let name, type: String let weight: Int let pokemonDefense: Int? enum CodingKeys: String, CodingKey { case attack, defense case pokemonDescription = "description" case evolutionChain, height, id case imageURL = "imageUrl" case name, type, weight case pokemonDefense = "defense:" } } // MARK: - EvolutionChain struct EvolutionChain: Codable { let id, name: String } typealias Pokemon = [PokemonClass]
[ -1 ]
980c191cbfb3f469eda1c00b0faa0fa89f7d4759
358817c5985369b72fe48a298bf6a8886ee65b1f
/Notifications/Sending Notifications/Sending NotificationsTests/Sending_NotificationsTests.swift
dbb4665735866c779357192686059d269a41d7a4
[ "MIT" ]
permissive
miguelius/practice-swift
16310e8188aac2c79fb984ee4dc36d5ae69ee450
0ee3618fee2b2701f27e0f50f995eddc892f030f
refs/heads/master
2021-05-13T14:37:39.692460
2017-08-25T16:49:59
2017-08-25T16:49:59
116,742,836
1
0
null
2018-01-09T00:05:51
2018-01-09T00:05:51
null
UTF-8
Swift
false
false
932
swift
// // Sending_NotificationsTests.swift // Sending NotificationsTests // // Created by Domenico on 15/05/15. // Copyright (c) 2015 Domenico. All rights reserved. // import UIKit import XCTest class Sending_NotificationsTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. XCTAssert(true, "Pass") } func testPerformanceExample() { // This is an example of a performance test case. self.measure() { // Put the code you want to measure the time of here. } } }
[ 276481, 276484, 276489, 276492, 278541, 278550, 305179, 276509, 278558, 307231, 313375, 278561, 102437, 227370, 360491, 276534, 159807, 276543, 286788, 280649, 223316, 315476, 223318, 288857, 227417, 194652, 194656, 276577, 309345, 227428, 276581, 276582, 43109, 276585, 223340, 276589, 278638, 227439, 276592, 131189, 227446, 223350, 276603, 276606, 292992, 276613, 141450, 311435, 215178, 311438, 276627, 276631, 276632, 184475, 227492, 196773, 227495, 129203, 299187, 131256, 176314, 280762, 223419, 299198, 309444, 227528, 276682, 276684, 276687, 278742, 278746, 278753, 280802, 276709, 276710, 276715, 233715, 227576, 157944, 211193, 168188, 227585, 227592, 276748, 276753, 157970, 276760, 309529, 278810, 276764, 299293, 282919, 262450, 276787, 276792, 315706, 278846, 164162, 311621, 280902, 278856, 227658, 276813, 278862, 278863, 6481, 6482, 276821, 276822, 6489, 276831, 323935, 276835, 321894, 276839, 416104, 276847, 285040, 278898, 278908, 280961, 178571, 227725, 178578, 190871, 293274, 276891, 61857, 61859, 278951, 278954, 278961, 278965, 293303, 276920, 278969, 33211, 276925, 278978, 278985, 278993, 279002, 276958, 287198, 227809, 358882, 276962, 227813, 279013, 279019, 279022, 281072, 279039, 276998, 287241, 279050, 186893, 279054, 303631, 223767, 223769, 277017, 291358, 277029, 293419, 281138, 277048, 301634, 369220, 277066, 295519, 66150, 277094, 166507, 277101, 189037, 287346, 189042, 189043, 277111, 279164, 277117, 277118, 291454, 184962, 303746, 152203, 277133, 225933, 133774, 225936, 277138, 277142, 225943, 225944, 230040, 164512, 225956, 285353, 225962, 209581, 205487, 285361, 303793, 154291, 299699, 293556, 154294, 342706, 166580, 277175, 277176, 285371, 277182, 199366, 277190, 225997, 277198, 226001, 164563, 277204, 226004, 203477, 226007, 279252, 119513, 201442, 226019, 285415, 342762, 277227, 226035, 226036, 230134, 234234, 226043, 209660, 279294, 234238, 234241, 226051, 234245, 277254, 209670, 226058, 234250, 234253, 234256, 234263, 369432, 234268, 105246, 228129, 234277, 234280, 279336, 289576, 234283, 277289, 234286, 277294, 234289, 226097, 234294, 230199, 162621, 234301, 289598, 277312, 234304, 162626, 281408, 293693, 277316, 234305, 234311, 234312, 299849, 234317, 277325, 277327, 293711, 234323, 234326, 277339, 234331, 301918, 234335, 279392, 297822, 349026, 297826, 234340, 174949, 234343, 277354, 234346, 234349, 277360, 234355, 213876, 277366, 234360, 234361, 279417, 209785, 177019, 277370, 234366, 234367, 158593, 234372, 226181, 113542, 213894, 226184, 234377, 277381, 228234, 226189, 234381, 295824, 226194, 234387, 234386, 234392, 324507, 234395, 279456, 234400, 277410, 234404, 226214, 289703, 234409, 275371, 234412, 236461, 226223, 234419, 226227, 234425, 277435, 234427, 287677, 234430, 226241, 234436, 275397, 234438, 226249, 52172, 234444, 234445, 183248, 275410, 234450, 234451, 234454, 234457, 275418, 234463, 234466, 277479, 179176, 234472, 234473, 234477, 234482, 287731, 277492, 314355, 234492, 234495, 277505, 234498, 234500, 277509, 277510, 234503, 234506, 230410, 275469, 277517, 197647, 277518, 295953, 234509, 277523, 234517, 230423, 281625, 197657, 281626, 175132, 234530, 234531, 234534, 275495, 234539, 275500, 310317, 277550, 234542, 275505, 275506, 234548, 277563, 234555, 156733, 277566, 230463, 7229, 7230, 7231, 234560, 238651, 234565, 277574, 207938, 281666, 234569, 300111, 277585, 207953, 296018, 234577, 296019, 234583, 234584, 275547, 277596, 234594, 230499, 281700, 277603, 300135, 234603, 281707, 275565, 156785, 312434, 275571, 234612, 300151, 234616, 398457, 234622, 300158, 226435, 285828, 302213, 275590, 253063, 234631, 277640, 302217, 234632, 275591, 234642, 226451, 226452, 308372, 275607, 119963, 234652, 234656, 277665, 330913, 306338, 234659, 234663, 275625, 300201, 208043, 226479, 226481, 238769, 277686, 208058, 277690, 230588, 277694, 283840, 279747, 279760, 290000, 189652, 275671, 363744, 195811, 298212, 304356, 285929, 279792, 298228, 204022, 120055, 234742, 228600, 208124, 204041, 292107, 277792, 339234, 259363, 199971, 304421, 277800, 113962, 277803, 113966, 277806, 226608, 226609, 277809, 277815, 300343, 277821, 226624, 277824, 277825, 15686, 277831, 226632, 277834, 294218, 177484, 222541, 277838, 277841, 296273, 222548, 277845, 277844, 314709, 283991, 357719, 277852, 224605, 224606, 218462, 142689, 230756, 277862, 163175, 277866, 281962, 173420, 277868, 284014, 277871, 279919, 277878, 275831, 181625, 277882, 277883, 142716, 275838, 275839, 277890, 277891, 226694, 275847, 277896, 277897, 281992, 277900, 230799, 112017, 296338, 277907, 206228, 306579, 226711, 226712, 277911, 277919, 277920, 310692, 277925, 279974, 277927, 282024, 370091, 277936, 277939, 277940, 279989, 296375, 277946, 277949, 277952, 296387, 415171, 277957, 163269, 296391, 300487, 277962, 282060, 277965, 280013, 312782, 284116, 277974, 228823, 228824, 277977, 277980, 226781, 277983, 277988, 310757, 316902, 277993, 277994, 296425, 277997, 278002, 226805, 278005, 306677, 278008, 300542, 306693, 153095, 192010, 280077, 149007, 65041, 282136, 204313, 278060, 286254, 226875, 194110, 128583, 276040, 226888, 366154, 276045, 276046, 286288, 226897, 276050, 280147, 300630, 226906, 147036, 243292, 226910, 370271, 282213, 317032, 222832, 276085, 276088, 278140, 188031, 276097, 192131, 276100, 276101, 229001, 310923, 312972, 278160, 282259, 276116, 276117, 276120, 278170, 280220, 276126, 282273, 282276, 278191, 276146, 278195, 276148, 296628, 198324, 286388, 278201, 276156, 276165, 278214, 323276, 276173, 302797, 212688, 302802, 276179, 276180, 286423, 216795, 216796, 276195, 153319, 313065, 280300, 419569, 276210, 276211, 276219, 194303, 171776, 288512, 311042, 288516, 278285, 276238, 227091, 184086, 294678, 284442, 278299, 276253, 276257, 288547, 278307, 278316, 159533, 165677, 276279, 276282, 276283, 288574, 276287, 345919, 276294, 282438, 276298, 296779, 216918, 276311, 307031, 188246, 276318, 237408, 282474, 288619, 276332, 110452, 276344, 194429, 227199, 40850, 40853, 44952, 247712, 276385, 294823, 276394, 276400, 276401, 276408, 161722, 290746, 276413, 276421, 276422, 276430, 231375, 153552, 153554, 276443, 276444, 280541, 153566, 276450, 276451, 276454, 276459, 296941, 276462, 276468, 276469, 278518, 276475, 276478 ]
815a921787de0e54aec78190f4fc6ff0e96694e0
4e85a892e6f0701ac3b43f42e29bce06700cbb8b
/SwittTests/UnitTests/Grammar/LexicalAnalysis/Parser/TokenParser/TokenParsers/OptionalTokenParserTests.swift
d65e8b8694df3d5fd7f692ee06610d0bdc57e720
[ "MIT" ]
permissive
SwiftTools/Switt
1fd7345a5e96e64c4d454d8f3549e4e038570a9d
f277278782bf922cfbb9701252cb3b42b3b39cb3
refs/heads/master
2021-01-18T21:32:18.667349
2016-09-22T12:37:49
2016-09-22T12:37:49
53,415,079
7
0
null
null
null
null
UTF-8
Swift
false
false
1,624
swift
import Quick import Nimble @testable import Switt private class Helper { static func parser(rule: ParserRule) -> TokenParser { let parser = OptionalTokenParser( rule: rule, tokenParserFactory: TokenParserFactoryImpl( parserRules: ParserRules() ) ) return parser } } class OptionalTokenParserTests: QuickSpec { override func spec() { describe("OptionalTokenParser") { it("") { let stream = TokenStreamHelper.tokenStream([ "a" ]) let parser = Helper.parser(ParserRule.Terminal(terminal: "a")) let result = parser.parse(stream) let tokenStrings = result?.map { tree in tree.token?.string } expect(tokenStrings).to(equal(["a"])) expect(stream.index).to(equal(1)) } it("") { let stream = TokenStreamHelper.tokenStream([ "b" ]) let parser = Helper.parser(ParserRule.Terminal(terminal: "a")) let result = parser.parse(stream) expect(result).toNot(beNil()) expect(stream.index).to(equal(0)) } it("") { let stream = TokenStreamHelper.tokenStream([]) let parser = Helper.parser(ParserRule.Terminal(terminal: "a")) let result = parser.parse(stream) expect(result).toNot(beNil()) expect(stream.index).to(equal(0)) } } } }
[ -1 ]
763a46bfeec97f7f5cf9391dbda92c9aa9adba01
6de69e61b08aaf178d27ebfce76fc56db31f07bd
/Mi/Controller_InscriptionEtape1.swift
0e339f712a8cd7a307905e8548d0f965794c9bd3
[]
no_license
reactive-senior/mi-app-swift
41f6deb2bcf67153bae1d2b0bd34653146ce1ad4
dbc68dcb8dffa89f97b11db83f91ff0049a404a9
refs/heads/master
2020-03-19T23:28:12.700459
2018-06-12T02:42:15
2018-06-12T02:42:15
137,007,384
0
0
null
null
null
null
UTF-8
Swift
false
false
25,757
swift
// // Controller_InscriptionEtape1.swift // Timi_Test1 // // Created by Julien on 03/05/2017. // Copyright © 2017 Julien. All rights reserved. // import UIKit import SwiftHTTP import DatePickerDialog class Controller_InscriptionEtape1: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate { @IBOutlet weak var BtnFemme: UIButton! @IBOutlet weak var BtnHomme: UIButton! var imgProfil : UIImage? = nil @IBOutlet weak var imageViewSelfie: UIImageView! var imagePicker = UIImagePickerController() @IBOutlet weak var btnDateNaissance: UIButton! @IBOutlet weak var btnSexualité: UIButton! @IBOutlet weak var editPrenom: UITextField! @IBOutlet weak var editEmail: UITextField! @IBOutlet weak var editMotDePasse: UITextField! @IBOutlet weak var Checkbox_1: Checkbox! @IBOutlet weak var Checkbox_2: Checkbox! @IBOutlet weak var Cgu: UITextView! @IBOutlet weak var wView: UIView! @IBOutlet weak var BtnValider: UIButton! var prenom = "", email = "", pass = "", datenaissance = "", sexe = "", sexualite = "" let pickerSexeOptions = ["Homme","Femme"] let pickerSexualiteOptions = ["Hétérosexuel","Homosexuel","Bisexuel"] var preferences : UserDefaults = UserDefaults.standard var fimgProfil = false var alertController = UIAlertController(title: nil, message: "Chargement\n\n", preferredStyle: .alert) let spinnerIndicator = UIActivityIndicatorView(activityIndicatorStyle: .whiteLarge) var code : Int = 123456 override func viewDidLoad() { super.viewDidLoad() self.hideKeyboardWhenTappedAround() editPrenom.layer.borderColor = PrimaryColor.cgColor editPrenom.layer.borderWidth = 2.0 editPrenom.layer.cornerRadius = 5.0 btnDateNaissance.layer.borderColor = PrimaryColor.cgColor btnDateNaissance.layer.borderWidth = 2.0 btnDateNaissance.layer.cornerRadius = 5.0 btnSexualité.layer.borderColor = PrimaryColor.cgColor btnSexualité.layer.borderWidth = 2.0 btnSexualité.layer.cornerRadius = 5.0 editEmail.layer.borderColor = PrimaryColor.cgColor editEmail.layer.borderWidth = 2.0 editEmail.layer.cornerRadius = 5.0 editMotDePasse.layer.borderColor = PrimaryColor.cgColor editMotDePasse.layer.borderWidth = 2.0 editMotDePasse.layer.cornerRadius = 5.0 circularImage(photoImageView: imageViewSelfie) imageViewSelfie.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(imageProfilTapped(tapGestureRecognizer:)))) sexe = pickerSexeOptions[0] self.sexualite = pickerSexualiteOptions[0] initialiserChampsFacebook() SetBtnSexe () self.btnSexualité.setTitle(" " + self.sexualite, for: UIControlState.normal) self.btnSexualité.setTitleColor(UIColor.black, for: UIControlState.normal) BtnValider.layer.borderColor = PrimaryColor.cgColor BtnValider.layer.borderWidth = 2.0 BtnValider.layer.cornerRadius = 5.0 spinnerIndicator.center = CGPoint(x: 135.0, y: 65.5) spinnerIndicator.color = UIColor.black spinnerIndicator.startAnimating() alertController.view.addSubview(spinnerIndicator) let button = UIButton(frame: CGRect(x: 1, y: 15, width: 90, height: 40)) button.setTitleColor(PrimaryColor, for: .normal) button.setTitle("Retour", for: .normal) button.addTarget(self, action: #selector(Retour), for: .touchUpInside) view.addSubview(button) Checkbox_1.isChecked = false Checkbox_1.borderStyle = .square Checkbox_1.checkmarkStyle = .tick Checkbox_1.borderWidth = 1 Checkbox_2.isChecked = false Checkbox_2.borderStyle = .square Checkbox_2.checkmarkStyle = .tick Checkbox_2.borderWidth = 1 let wLargeText = "J’accepte <u>les C.G.U.</u> de Mi"; Cgu.attributedText = wLargeText.htmlToAttributedString Cgu.textColor = PrimaryColor let fGuesture = UITapGestureRecognizer(target: self, action: #selector(Cgu(sender:))) Cgu.addGestureRecognizer(fGuesture) } @objc func Cgu(sender: AnyObject){ UIApplication.shared.open(URL(string: "http://mi-app.fr/CGU-MI.pdf")!, options: [:], completionHandler: nil) } @objc func Retour () { let vc = self.storyboard?.instantiateViewController(withIdentifier: "controllerAccueilConnection") as! Controller_AccueilConnection self.present(vc, animated: true, completion: nil) } func initialiserChampsFacebook() { let FBID = preferences.string(forKey: "fbid") if(FBID == nil) { return } editPrenom.text = preferences.string(forKey: "fbprenom") editEmail.text = preferences.string(forKey: "fbemail") let fbgender = preferences.string(forKey: "fbgender") self.datenaissance = preferences.string(forKey: "fbdatenaissance")! self.btnDateNaissance.setTitle(" " + self.datenaissance, for: UIControlState.normal) self.btnDateNaissance.setTitleColor(.black, for: UIControlState.normal) self.sexe = pickerSexeOptions[1] if (fbgender == "male") { self.sexe = pickerSexeOptions[0] } self.sexualite = pickerSexualiteOptions[0] let wImgFB = "http://graph.facebook.com/" + preferences.string(forKey: "fbid")! + "/picture?type=normal" getImageFromWeb(wImgFB) { (image) in if let image = image { self.imgProfil = self.resizeImage(image: image, targetSize: CGSize(width: 500, height: 500)) self.imageViewSelfie.image = self.imgProfil self.imageViewSelfie.backgroundColor = UIColor.white } } } override func viewDidAppear(_ animated: Bool) { self.hideKeyboardWhenTappedAround() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } @IBAction func clickAnnuler(_ sender: Any) { self.dismiss(animated: true) } @IBAction func HommeClick(_ sender: Any) { self.sexe = pickerSexeOptions[0] SetBtnSexe () } @IBAction func FemmeClick(_ sender: Any) { self.sexe = pickerSexeOptions[1] SetBtnSexe () } func SetBtnSexe () { if (self.sexe == pickerSexeOptions[0]) { BtnFemme.layer.backgroundColor = UIColor.white.cgColor BtnFemme.layer.borderColor = PrimaryColor.cgColor BtnFemme.layer.borderWidth = 2.0 BtnFemme.layer.cornerRadius = 5.0 BtnFemme.setTitleColor(PrimaryColor, for: .normal) BtnHomme.layer.backgroundColor = PrimaryColor.cgColor BtnHomme.layer.borderColor = PrimaryColor.cgColor BtnHomme.layer.borderWidth = 2.0 BtnHomme.layer.cornerRadius = 5.0 BtnHomme.setTitleColor(UIColor.white, for: .normal) } else { BtnFemme.layer.backgroundColor = PrimaryColor.cgColor BtnFemme.layer.borderColor = PrimaryColor.cgColor BtnFemme.layer.borderWidth = 2.0 BtnFemme.layer.cornerRadius = 5.0 BtnFemme.setTitleColor(UIColor.white, for: .normal) BtnHomme.layer.backgroundColor = UIColor.white.cgColor BtnHomme.layer.borderColor = PrimaryColor.cgColor BtnHomme.layer.borderWidth = 2.0 BtnHomme.layer.cornerRadius = 5.0 BtnHomme.setTitleColor(PrimaryColor, for: .normal) } } @IBAction func clickSexualite(_ sender: Any) { let alert = UIAlertController(title: "Sexualité", message: "", preferredStyle: UIAlertControllerStyle.alert) for i in pickerSexualiteOptions { alert.addAction(UIAlertAction(title: i, style: .default, handler: doSexualite)) } self.present(alert, animated: true, completion: nil) } func doSexualite(action: UIAlertAction) { self.sexualite = action.title! self.btnSexualité.setTitle(" " + self.sexualite, for: UIControlState.normal) } @IBAction func clickDateNaissance(_ sender: Any) { var dateNaiss = Date() if (datenaissance != "") { let dateFormatter = DateFormatter() dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" dateNaiss = dateFormatter.date(from: datenaissance)! } DatePickerDialog().show("Date de naissance", doneButtonTitle: "Ok", cancelButtonTitle: "Annuler", buttonColor : PrimaryColor, defaultDate: dateNaiss, maximumDate: Date(), datePickerMode: .date) { (date) -> Void in if( date != nil ) { if( Global().daysBetweenDate(startDate: date!, endDate: Date()) >= 18 ) { let dateFormatter = DateFormatter() dateFormatter.dateFormat = "yyyy-MM-dd" self.datenaissance = dateFormatter.string(from:date!) self.btnDateNaissance.setTitle(" " + self.datenaissance, for: UIControlState.normal) self.btnDateNaissance.setTitleColor(.black, for: UIControlState.normal) } else { self.afficherPopup(title: "Action impossible", message: "Vous devez avoir 18 ans pour utiliser Mi") } } } } @objc func imageProfilTapped(tapGestureRecognizer: UITapGestureRecognizer) { if UIImagePickerController.isSourceTypeAvailable(.savedPhotosAlbum){ imagePicker.delegate = self as? UIImagePickerControllerDelegate & UINavigationControllerDelegate imagePicker.sourceType = .savedPhotosAlbum; imagePicker.allowsEditing = false self.present(imagePicker, animated: true, completion: nil) } } func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { imgProfil = resizeImage(image: info[UIImagePickerControllerOriginalImage] as! UIImage, targetSize: CGSize(width: 500, height: 500)) imageViewSelfie.image = imgProfil imageViewSelfie.backgroundColor = UIColor.white picker.dismiss(animated: true, completion: nil) } func resizeImage(image: UIImage, targetSize: CGSize) -> UIImage { let size = image.size let widthRatio = targetSize.width / image.size.width let heightRatio = targetSize.height / image.size.height var newSize: CGSize if(widthRatio > heightRatio) { newSize = CGSize(width: size.width * heightRatio, height: size.height * heightRatio) } else { newSize = CGSize(width: size.width * widthRatio, height: size.height * widthRatio) } let rect = CGRect(x: 0, y: 0, width: newSize.width, height: newSize.height) print("ns" + String(describing: newSize.width) + " x " + String(describing: newSize.height)) UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0) image.draw(in: rect) let newImage = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return newImage! } func circularImagevp(photoImageView: UIImageView?) { photoImageView!.layer.borderColor = PrimaryColor.cgColor photoImageView!.layer.borderWidth = 2 photoImageView!.layer.cornerRadius = photoImageView!.frame.height/2 photoImageView!.layer.masksToBounds = false photoImageView!.clipsToBounds = true let iwidth = photoImageView!.layer.bounds.width let wwidth = wView!.layer.bounds.width let x = (wwidth-iwidth)/2 let yPosition = photoImageView!.frame.origin.y let height = photoImageView!.frame.height let width = photoImageView!.frame.width photoImageView!.frame = CGRect(x: x, y: yPosition, width: width, height: height) } func circularImage(photoImageView: UIImageView?) { photoImageView!.layer.frame = photoImageView!.layer.frame.insetBy(dx: 0, dy: 0) photoImageView!.layer.borderColor = PrimaryColor.cgColor photoImageView!.layer.borderWidth = 2 photoImageView!.layer.cornerRadius = photoImageView!.frame.height/2 photoImageView!.layer.masksToBounds = false photoImageView!.clipsToBounds = true photoImageView!.contentMode = UIViewContentMode.scaleAspectFill } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if let insEtape3 = segue.destination as? Controller_InscriptionEtape3 { insEtape3.imageProfil = imgProfil! } } @IBAction func ValiderClick(_ sender: Any) { prenom = editPrenom.text! email = editEmail.text! pass = editMotDePasse.text! if( prenom == "" || email == "" || pass == "" || sexualite == "") { afficherPopup(title: "Action impossible",message: "Veuillez remplir tous les champs") } else if self.imgProfil == nil { afficherPopup(title: "Action impossible",message: "Veuillez choisir une photo de profil") } else if self.datenaissance == "" { afficherPopup(title: "Action impossible",message: "Veuillez renseigner votre date de naissance") } else if !isValidEmail(testStr: email) { afficherPopup(title: "Action impossible",message: "Votre email n'est pas valide") } else if pass.count < 6 { afficherPopup(title: "Action impossible",message: "Votre mot de passe est trop court") } else if !Checkbox_1.isChecked || !Checkbox_2.isChecked { afficherPopup(title: "Action impossible",message: "Les CGU et l'utilisatiuon de données doivent etre acceptées pour pouvoir continuer l'inscription.") } else { self.preferences.set(prenom, forKey: "inscription_prenom") self.preferences.set(email, forKey: "inscription_email") self.preferences.set(pass, forKey: "inscription_pass") self.preferences.set(datenaissance, forKey: "inscription_datenaissance") self.preferences.set(sexe, forKey: "inscription_sexe") self.preferences.set(sexualite, forKey: "inscription_sexualite") self.preferences.synchronize() sendinscriptionEtape1() } } func isValidEmail(testStr:String) -> Bool { let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}" let emailTest = NSPredicate(format:"SELF MATCHES %@", emailRegEx) return emailTest.evaluate(with: testStr) } func afficherPopup( title : String, message : String) { let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) let okAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.default) { UIAlertAction in alert.dismiss(animated: true, completion: nil) } alert.addAction(okAction) self.present(alert, animated: true, completion: nil) } func getImageFromWeb(_ urlString: String, closure: @escaping (UIImage?) -> ()) { guard let url = URL(string: urlString) else { return closure(nil) } let task = URLSession(configuration: .default).dataTask(with: url) { (data, response, error) in guard error == nil else { //print("error: \(String(describing: error))") return closure(nil) } guard response != nil else { //print("no response") return closure(nil) } guard data != nil else { //print("no data") return closure(nil) } DispatchQueue.main.async { closure(UIImage(data: data!)) } }; task.resume() } //******************************** //******************************** //******************************** func sendinscriptionEtape1() { print("etape 1") var params = [String : Any]() params["type"] = "sendinscription" params["prenom"] = preferences.string(forKey: "inscription_prenom") ?? "" params["email"] = preferences.string(forKey: "inscription_email") ?? "" params["pass"] = preferences.string(forKey: "inscription_pass") ?? "" params["datenaissance"] = preferences.string(forKey: "inscription_datenaissance") ?? "" params["sexe"] = preferences.string(forKey: "inscription_sexe") ?? "" params["sexualite"] = preferences.string(forKey: "inscription_sexualite") ?? "" params["symbole"] = preferences.string(forKey: "inscription_symbole") ?? "" params["code"] = String(code) params["couleuryeux"] = preferences.string(forKey: "inscription_couleuryeux") ?? "" params["couleurcheveux"] = preferences.string(forKey: "inscription_couleurcheveux") ?? "" params["longueurcheveux"] = preferences.string(forKey: "inscription_longueurcheveux") ?? "" params["physique"] = preferences.string(forKey: "inscription_physique") ?? "" params["taille"] = preferences.string(forKey: "inscription_taille") ?? "" params["style"] = preferences.string(forKey: "inscription_style") ?? "" params["origine"] = preferences.string(forKey: "inscription_origine") ?? "" params["religion"] = preferences.string(forKey: "inscription_religion") ?? "" params["profession"] = preferences.string(forKey: "inscription_profession") ?? "" params["fleurschocolats"] = preferences.string(forKey: "inscription_fleurchocolat") ?? "" params["filmprefere"] = "" params["musiqueprefere"] = "" params["lieuprefere"] = preferences.string(forKey: "inscription_rdv") ?? "" params["fbid"] = preferences.string(forKey: "fbid") ?? "" alertController = UIAlertController(title: nil, message: "Enregistrement\n1/2", preferredStyle: .alert) self.present(alertController, animated: true, completion: nil) do { let opt = try HTTP.POST(Global().url+"gestion_user.php", parameters: params) opt.start { response in if (response.error != nil) { self.alertController.dismiss(animated: true, completion: { self.afficherPopup(title : "Action impossible", message : "Une erreur est survenue, veuillez réessayer") }) return } do { let json = try JSONSerialization.jsonObject(with: response.data , options: .mutableContainers) as! Dictionary<String, AnyObject> print ("response" , json.debugDescription) if !json.isEmpty { if ( json["success"] as! Int == 1 ) { self.preferences.set(json["userid"], forKey: "userid") self.preferences.synchronize() self.alertController.dismiss(animated: true, completion: { self.sendinscriptionEtape2() }) } else if ( json["success"] as! Int == 2 ) { self.alertController.dismiss(animated: true, completion: { self.afficherPopup(title : "Action impossible", message : "Votre adresse email est déjà utilisée") }) } else { self.alertController.dismiss(animated: true, completion: { self.afficherPopup(title : "Action impossible ", message : "Une erreur est survenue, veuillez réessayer") }) } } else { self.alertController.dismiss(animated: true, completion: { self.afficherPopup(title : "Action impossible", message : "Une erreur est survenue, veuillez réessayer") }) } } catch { print("json error: \(error.localizedDescription)") self.alertController.dismiss(animated: true, completion: { self.afficherPopup(title : "Action impossible", message : "Une erreur est survenue, veuillez réessayer") }) } } } catch { self.alertController.dismiss(animated: true, completion: { self.afficherPopup(title : "Action impossible", message : "Une erreur est survenue, veuillez réessayer") }) } } func sendinscriptionEtape2() { print("etape 2") let imageData:NSData = UIImagePNGRepresentation(imgProfil!)! as NSData let strBase64:String = imageData.base64EncodedString(options: .lineLength64Characters) var params = [String : Any]() params["type"] = "sendimageprofil" params["userid"] = preferences.string(forKey: "userid") ?? "" params["imageprofil"] = strBase64 alertController = UIAlertController(title: nil, message: "Enregistrement\n2/2", preferredStyle: .alert) self.present(alertController, animated: true, completion: nil) do { let opt = try HTTP.POST(Global().url+"gestion_user.php", parameters: params) opt.start { response in if (response.error != nil) { self.alertController.dismiss(animated: true, completion: { self.alertController.dismiss(animated: true, completion: { self.afficherPopup(title : "Action impossible", message : "Une erreur est survenue, veuillez réessayer") }) }) return } print(response.text!) do { let json = try JSONSerialization.jsonObject(with: response.data , options: .mutableContainers) as! Dictionary<String, AnyObject> if !json.isEmpty { if ( json["success"] as! Int == 1 ) { self.alertController.dismiss(animated: true, completion: { let vc = self.storyboard?.instantiateViewController(withIdentifier: "Controller_Symboles") as! Controller_Symboles vc.wTitle = "Choisissez votre Symbole" self.present(vc, animated: true, completion: nil) }) } else { self.alertController.dismiss(animated: true, completion: { self.afficherPopup(title : "Action impossible", message : "Une erreur est survenue, veuillez réessayer") }) } } else { self.alertController.dismiss(animated: true, completion: { self.afficherPopup(title : "Action impossible", message : "Une erreur est survenue, veuillez réessayer") }) } } catch { print("json error: \(error.localizedDescription)") self.alertController.dismiss(animated: true, completion: { self.afficherPopup(title : "Action impossible", message : "Une erreur est survenue, veuillez réessayer") }) } } } catch { self.alertController.dismiss(animated: true, completion: { self.alertController.dismiss(animated: true, completion: { self.afficherPopup(title : "Action impossible", message : "Une erreur est survenue, veuillez réessayer") }) }) } } func afficherPopupFermable( title : String, message : String) { let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) let okAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.default) { UIAlertAction in self.dismiss(animated: true) } alertController.addAction(okAction) self.present(alertController, animated: true, completion: nil) } }
[ -1 ]
cfd51db43580ee89d098eaed157984bd805a205d
46511083925411dae3b7783646a64cd4b327557c
/MissCat/View/ReactionGenViewController.swift
b473c0a80c7db8c251362789807298bff0c4a3d4
[ "Apache-2.0" ]
permissive
harunonsystem/MissCat
99ec07b90b4fd24e95c5dbc06f56bc9256c3a48c
7005a1fe08d2e2f4a98be5f7cc7b5c068e57e6fe
refs/heads/master
2021-05-22T19:33:50.221626
2020-04-01T20:53:37
2020-04-01T20:53:37
null
0
0
null
null
null
null
UTF-8
Swift
false
false
10,744
swift
// // ReactionGenCell.swift // MissCat // // Created by Yuiga Wada on 2019/11/17. // Copyright © 2019 Yuiga Wada. All rights reserved. // import RxCocoa import RxDataSources import RxSwift import UIKit protocol ReactionGenViewControllerDelegate { func scrollUp() // 半モーダルviewを上まで引き上げる } private typealias ViewModel = ReactionGenViewModel typealias EmojisDataSource = RxCollectionViewSectionedReloadDataSource<ReactionGenViewController.EmojisSection> class ReactionGenViewController: UIViewController, UISearchBarDelegate, UIScrollViewDelegate, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout { @IBOutlet weak var searchBar: UISearchBar! @IBOutlet weak var iconImageView: UIImageView! @IBOutlet weak var displayNameLabel: UILabel! @IBOutlet weak var targetNoteTextView: UITextView! @IBOutlet weak var targetNoteDisplayView: UIView! @IBOutlet weak var settingsButton: UIButton! @IBOutlet weak var emojiCollectionView: UICollectionView! @IBOutlet weak var borderOriginXConstraint: NSLayoutConstraint! var delegate: ReactionGenViewControllerDelegate? var onPostViewController: Bool = false var selectedEmoji: PublishRelay<EmojiView.EmojiModel> = .init() private var viewModel: ReactionGenViewModel? private let disposeBag = DisposeBag() private var viewDidAppeared: Bool = false private var cellLoading: Bool = false private var previousCellCount = -1 private lazy var defaultCellsize = view.frame.width / 8 // MARK: Life Cycle override func viewDidLoad() { super.viewDidLoad() setupComponents() setupCollectionViewLayout() let viewModel = setupViewModel() setEmojiModel(viewModel: viewModel) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) targetNoteDisplayView.isHidden = onPostViewController borderOriginXConstraint.isActive = !onPostViewController iconImageView.layer.cornerRadius = iconImageView.frame.width / 2 } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) viewDidAppeared = true } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) viewDidAppeared = false } // MARK: Setup private func setupViewModel() -> ReactionGenViewModel { let viewModel = ReactionGenViewModel(with: .init(searchTrigger: getSearchTrigger()), and: disposeBag) let dataSource = setupDataSource() binding(dataSource: dataSource, viewModel: viewModel) self.viewModel = viewModel return viewModel } private func setupDataSource() -> EmojisDataSource { let dataSource = EmojisDataSource( configureCell: { dataSource, _, indexPath, _ in self.setupCell(dataSource, self.emojiCollectionView, indexPath) } ) return dataSource } private func binding(dataSource: EmojisDataSource?, viewModel: ViewModel) { guard let dataSource = dataSource else { return } let output = viewModel.output Observable.just(viewModel.output.favorites) .bind(to: emojiCollectionView.rx.items(dataSource: dataSource)) .disposed(by: disposeBag) output.otherEmojis.bind(to: emojiCollectionView.rx.items(dataSource: dataSource)).disposed(by: disposeBag) } private func setupComponents() { emojiCollectionView.register(UINib(nibName: "ReactionCollectionHeader", bundle: nil), forCellWithReuseIdentifier: "ReactionCollectionHeader") emojiCollectionView.register(UINib(nibName: "EmojiViewCell", bundle: nil), forCellWithReuseIdentifier: "EmojiCell") emojiCollectionView.rx.setDelegate(self).disposed(by: disposeBag) searchBar.delegate = self searchBar.autocorrectionType = .no searchBar.keyboardType = .emailAddress targetNoteTextView.textContainer.lineBreakMode = .byTruncatingTail targetNoteTextView.textContainer.maximumNumberOfLines = 2 settingsButton.titleLabel?.font = .awesomeSolid(fontSize: 15.0) settingsButton.rx.tap.subscribe(onNext: { _ in let alert = UIAlertController(title: "", message: "開発中です", preferredStyle: UIAlertController.Style.alert) let cancelAction: UIAlertAction = UIAlertAction(title: "閉じる", style: UIAlertAction.Style.cancel, handler: nil) alert.addAction(cancelAction) self.present(alert, animated: true, completion: nil) }).disposed(by: disposeBag) } private func setupCollectionViewLayout() { let flowLayout = UICollectionViewFlowLayout() flowLayout.itemSize = CGSize(width: defaultCellsize, height: defaultCellsize) flowLayout.minimumInteritemSpacing = 0 flowLayout.sectionInset = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 10) emojiCollectionView.collectionViewLayout = flowLayout } private func setupTapGesture(to view: EmojiViewCell, emojiModel: EmojiView.EmojiModel) { let tapGesture = UITapGestureRecognizer() // 各々のEmojiViewに対してtap gestureを付加する tapGesture.rx.event.bind { _ in guard let raw = emojiModel.isDefault ? emojiModel.defaultEmoji : ":" + emojiModel.rawEmoji + ":" else { return } if self.onPostViewController { // Post画面のときは入力をPostViewControllerへと渡す self.sendEmojiInput(emojiModel: emojiModel) } else { // NoteCell上ではReactionGenが投稿に対してサーバーにリアクションを送信する self.react2Note(raw: raw) self.selectedEmoji.accept(emojiModel) } }.disposed(by: disposeBag) view.addGestureRecognizer(tapGesture) } private func sendEmojiInput(emojiModel: EmojiView.EmojiModel) { selectedEmoji.accept(emojiModel) } private func react2Note(raw: String) { guard let targetNoteId = viewModel!.targetNoteId else { return } if viewModel!.hasMarked { viewModel!.cancelReaction(noteId: targetNoteId) } else { viewModel!.registerReaction(noteId: targetNoteId, reaction: raw) } dismiss(animated: true, completion: nil) // 半モーダルを消す } // MARK: Setup Cell private func setupCell(_ dataSource: CollectionViewSectionedDataSource<ReactionGenViewController.EmojisSection>, _ collectionView: UICollectionView, _ indexPath: IndexPath) -> UICollectionViewCell { let index = indexPath.row let item = dataSource.sectionModels[0].items[index] let isHeader = item is EmojiViewHeader if isHeader { guard let headerInfo = item as? EmojiViewHeader, let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "ReactionCollectionHeader", for: indexPath) as? ReactionCollectionHeader else { fatalError("Internal Error.") } cell.contentMode = .left cell.setTitle(headerInfo.title) return cell } else { guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "EmojiCell", for: indexPath) as? EmojiViewCell else { fatalError("Internal Error.") } cell.mainView.initialize() cell.mainView.emoji = item cell.mainView.isFake = item.isFake cell.contentMode = .left setupTapGesture(to: cell, emojiModel: item) return cell } } private func getSearchTrigger() -> Observable<String> { let debounceInterval = DispatchTimeInterval.milliseconds(300) return searchBar.rx.text.compactMap { $0?.localizedLowercase }.asObservable() .skip(1) .debounce(debounceInterval, scheduler: MainScheduler.instance) .distinctUntilChanged() } // MARK: Set Methods private func setEmojiModel(viewModel: ReactionGenViewModel) { viewModel.setEmojiModel() } private func setTargetNoteId(_ id: String?) { viewModel!.targetNoteId = id } // MARK: CollectionView Delegate // Headerセルの場合はの幅を設定 func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let defaultSize = CGSize(width: defaultCellsize, height: defaultCellsize) guard let viewModel = viewModel else { return defaultSize } let isHeader = viewModel.checkHeader(index: indexPath.row) return isHeader ? CGSize(width: emojiCollectionView.frame.width, height: 30) : defaultSize } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { return 0 } // MARK: Public Methods func setTargetNote(noteId: String, iconUrl: String?, displayName: String, username: String, note: NSAttributedString, hasFile: Bool, hasMarked: Bool) { // noteId setTargetNoteId(noteId) // icon image if let image = Cache.shared.getIcon(username: username) { iconImageView.image = image } else if let iconUrl = iconUrl, let url = URL(string: iconUrl) { url.toUIImage { [weak self] image in guard let self = self, let image = image else { return } DispatchQueue.main.async { Cache.shared.saveIcon(username: username, image: image) // CHACHE! self.iconImageView.image = image } } } // displayName displayNameLabel.text = displayName // note targetNoteTextView.attributedText = note // .changeColor(to: .lightGray) targetNoteTextView.alpha = 0.5 } // MARK: TextField Delegate func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) { guard let delegate = delegate else { return } delegate.scrollUp() } func searchBarSearchButtonClicked(_ searchBar: UISearchBar) { searchBar.endEditing(true) } }
[ -1 ]
f7140a58b2eb13e6dc3a8ed11e37e77a6b36786e
e74f1e25e18886e71a80573d2254751907f8f5da
/InstaStuff/InstaStuff/Classes/UI/TextEditorModule/Model/Colors.swift
47f0ec75124dceeaba9495a76e7250ec1611803e
[]
no_license
EzhovAndrei/instaStuff
2d9cfaf6f2175641c7123c1a0f0b4541032e6b43
0f6cf9733a050508ddf3bbc1644a03ec23aa73ab
refs/heads/master
2023-04-09T02:37:19.301161
2019-09-20T12:08:11
2019-09-20T12:08:11
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,639
swift
// // Colors.swift // InstaStuff // // Created by aezhov on 27/07/2019. // Copyright © 2019 Андрей Ежов. All rights reserved. // import UIKit enum ColorEnum { static let allCases: [ColorEnum] = [.white, .r206g181b141, .r248g229b210, .r227g220b184, .r219g192b178, .r186g142b105, .r150g174b160, .r80g76b69, .black] case white, r206g181b141, r248g229b210, r227g220b184, r219g192b178, r186g142b105, r150g174b160, r80g76b69, black var color: UIColor { switch self { case .white: return #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) case .r206g181b141: return #colorLiteral(red: 0.8078431373, green: 0.7098039216, blue: 0.5529411765, alpha: 1) case .r248g229b210: return #colorLiteral(red: 0.9725490196, green: 0.8980392157, blue: 0.8235294118, alpha: 1) case .r227g220b184: return #colorLiteral(red: 0.8901960784, green: 0.862745098, blue: 0.7215686275, alpha: 1) case .r219g192b178: return #colorLiteral(red: 0.8588235294, green: 0.7529411765, blue: 0.6980392157, alpha: 1) case .r186g142b105: return #colorLiteral(red: 0.7294117647, green: 0.5568627451, blue: 0.4117647059, alpha: 1) case .r150g174b160: return #colorLiteral(red: 0.5882352941, green: 0.6823529412, blue: 0.6274509804, alpha: 1) case .r80g76b69: return #colorLiteral(red: 0.3137254902, green: 0.2980392157, blue: 0.2705882353, alpha: 1) case .black: return #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1) } } }
[ -1 ]
fb384302c031296038ce5f9fd02852be7da49c55
c03784e94e832428f257f3f3c990477316c52f48
/RedFinPart1/Service.swift
2b18949d8e50f658d970fbe16a1201edaddd6fcb
[]
no_license
velairi/URLSession-JSONSerialization
c59d10ef1b397ff98a1986ed5a6388322c25740b
25ad4dab70d3bd985ba273bc3cc8c415f7c86068
refs/heads/master
2022-12-03T09:15:12.612451
2020-08-11T04:12:33
2020-08-11T04:12:33
286,643,423
1
0
null
null
null
null
UTF-8
Swift
false
false
491
swift
// // Service.swift // RedFinPart1 // // Created by Valerie Don on 8/10/20. // Copyright © 2020 Valerie Don. All rights reserved. // import UIKit class Service { } /** Where do i start? - PRAMP -> Interviews with random people - - don't try to be too perfect before practice - we're both learning - Don't want to waste my time <- - LL - Binary trees - What questions are you going to give me? - leetcode queestions - specific topics - company focused */
[ -1 ]
913190a0b66c05b79b35c7aa00297f40b2b3412e
e615713d93bf256a5db3f4024a00883d7e2cead7
/RobotConf/Model/Data/Providers/Json/JsonRoomsProvider.swift
466e3b4a46692a5d1c6ac34c2d46d67d293d22fe
[ "MIT" ]
permissive
paug/AndroidMakersApp-iOS
12be12b33d843a4177cbe4d53dbc0cb09eba14cb
90216c720f7aa0b64feadf45fe365bfb45fc6e6e
refs/heads/master
2023-05-07T12:09:48.692524
2023-04-16T10:49:28
2023-04-16T10:49:28
232,178,221
7
1
MIT
2020-04-26T17:17:12
2020-01-06T20:17:25
Swift
UTF-8
Swift
false
false
1,165
swift
// // Copyright © 2020 Paris Android User Group. All rights reserved. // import Foundation import Combine /// Object that provides rooms from a json file class JsonRoomsProvider: RoomsProvider { private struct RoomsContainer: Decodable { struct Rooms: Decodable { let allRooms: [RoomData] } let rooms: Rooms } var roomsPublisher = PassthroughSubject<[String: RoomData], Error>() init() { DispatchQueue.main.async { guard let url = Bundle.main.url(forResource: "schedule-app", withExtension: "json") else { fatalError("schedule-app.json is not embedded in the app.") } do { let data = try Data(contentsOf: url) let decoder = JSONDecoder() let roomsContainer = try decoder.decode(RoomsContainer.self, from: data) let rooms = Dictionary(uniqueKeysWithValues: roomsContainer.rooms.allRooms.map { ($0.roomId, $0) }) self.roomsPublisher.send(rooms) } catch { self.roomsPublisher.send(completion: .failure(error)) } } } }
[ -1 ]
683ee1929a7714b86500f64c0ad89c107106369a
cda08217fa5f06241186b22fb33d8721609c63f3
/Mestika Dashboard/Extensions/URL+Extensions.swift
9e3fc1c495a7c751257599d203395abf8a1d2738
[]
no_license
arraisi/SwiftUI-Vision-DG-Full
8e0a6c2a030a8c33bd43e6ffe56ebb1431b2a074
8be14b908affa54c94c9df5aa5e898f9640bbd80
refs/heads/main
2023-01-10T04:54:09.768546
2020-11-17T09:30:31
2020-11-17T09:30:31
313,555,998
0
0
null
null
null
null
UTF-8
Swift
false
false
1,548
swift
// // URL+Extensions.swift // Bank Mestika // // Created by Prima Jatnika on 20/10/20. // import Foundation extension URL { func appending(_ queryItem: String, value: String?) -> URL { guard var urlComponents = URLComponents(string: absoluteString) else { return absoluteURL } // Create array of existing query items var queryItems: [URLQueryItem] = urlComponents.queryItems ?? [] // Create query item let queryItem = URLQueryItem(name: queryItem, value: value) // Append the new query item in the existing query items array queryItems.append(queryItem) // Append updated query items array in the url component object urlComponents.queryItems = queryItems // Returns the url from new url components return urlComponents.url! } } extension URL { static func urlForSliderAssets() -> URL? { return URL(string: "https://my-json-server.typicode.com/primajatnika271995/dummy-json/assets-landing") } static func urlRegister() -> URL? { return URL(string: "http://159.65.2.90:8765/api/v1.0/user") } static func urlOTP() -> URL? { return URL(string: "http://159.65.2.90:8765/api/v1.0/otp") } static func urlSheduleInterview() -> URL? { return URL(string: "http://159.65.2.90:8765/api/v1.0/schedule/find-all") } static func urlSheduleInterviewFindById() -> URL? { return URL(string: "http://159.65.2.90:8765/api/v1.0/schedule/find-byid") } }
[ -1 ]
9cd33c2d5e5d3e50e571216b05f92b1b87481b9f
1b9f9965d3d12f7e55f255b7bfdd10aa3a1fd574
/LearningMachineLearning/Shared/AnimatedCharts/BaseChartView.swift
36826f18943939a662ce4d2dc35b1b6a81a236e2
[]
no_license
johndpope/LearningMachineLearning
75b13299bd02a87ba9e13e202a1403aca4ebb06d
7b3bd5990b33643fbee63a577f4e958375814347
refs/heads/master
2021-01-22T13:17:58.400223
2017-05-10T16:03:28
2017-05-10T16:03:28
65,738,516
2
1
null
2016-08-15T14:29:05
2016-08-15T14:29:04
Swift
UTF-8
Swift
false
false
7,885
swift
// // BaseChartView.swift // LearningMachineLearning // // Created by Grace on 7/26/15. // Copyright (c) 2015 Grace Avery. All rights reserved. // import UIKit import SwiftCharts struct ChartPadding : OptionSet { let rawValue: Int init(rawValue: Int) { self.rawValue = rawValue } static var PadNone: ChartPadding { return ChartPadding(rawValue: 0) } static var PadBottom: ChartPadding { return ChartPadding(rawValue: 1 << 0) } static var PadTop: ChartPadding { return ChartPadding(rawValue: 1 << 1) } static var PadLeft: ChartPadding { return ChartPadding(rawValue: 1 << 2) } static var PadRight: ChartPadding { return ChartPadding(rawValue: 1 << 3) } static var PadAll: ChartPadding { return ChartPadding(rawValue: 15) } } struct ChartOverrides { var minX, minY, maxX, maxY, xInterval, yInterval, xMaxMultiplier, yMaxMultiplier: Double? } class BaseChartView: UIView { var chartFrame: CGRect! var chart: Chart? var pointSize: Int? var minX, minY, maxX, maxY, xInterval, yInterval: Double! var overrides: ChartOverrides = ChartOverrides() var xAxisLabel: String! var yAxisLabel: String! var labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) var paddingOptions = ChartPadding.PadNone let layerSpecifications: [DataType : UIColor] = [ .type0 : UIColor.red, .type1 : UIColor.blue, .type2 : UIColor.green, .type3 : UIColor.yellow, .type4 : UIColor.purple, .type5 : UIColor.orange, .type6 : UIColor.black ] func setUpChartWithData(_ data: [LabeledInput], frame: CGRect, xAxisLabel: String, yAxisLabel: String) { setDataMinMaxInterval(data) self.xAxisLabel = xAxisLabel self.yAxisLabel = yAxisLabel let (xAxis, yAxis, innerFrame) = baseChartLayers(labelSettings, minX: minX, maxX: maxX, minY: minY, maxY: maxY, xInterval: xInterval, yInterval: yInterval, xAxisLabel: xAxisLabel, yAxisLabel: yAxisLabel) let scatterLayers = self.toLayers(data, layerSpecifications: layerSpecifications, xAxis: xAxis, yAxis: yAxis, chartInnerFrame: innerFrame) let guidelinesLayerSettings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) let guidelinesLayer = ChartGuideLinesDottedLayer(xAxis: xAxis, yAxis: yAxis, innerFrame: innerFrame, settings: guidelinesLayerSettings) let chart = Chart( frame: chartFrame, layers: [ xAxis, yAxis, guidelinesLayer, ] + scatterLayers ) addSubview(chart.view) self.chart = chart } func baseChartLayers(_ labelSettings: ChartLabelSettings, minX: Double, maxX: Double, minY: Double, maxY: Double, xInterval: Double, yInterval: Double, xAxisLabel: String, yAxisLabel: String) -> (ChartAxisLayer, ChartAxisLayer, CGRect) { let xValues = Array(stride(from: minX, through: maxX, by: xInterval)).map { ChartAxisValueFloat(CGFloat($0), labelSettings: labelSettings)} let yValues = Array(stride(from: minY, through: maxY, by: yInterval)).map {ChartAxisValueFloat(CGFloat($0), labelSettings: labelSettings)} let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: xAxisLabel, settings: labelSettings)) let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: yAxisLabel, settings: labelSettings.defaultVertical())) let chartFrame = ExamplesDefaults.chartFrame(self.chartFrame) let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: ExamplesDefaults.chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) return (coordsSpace.xAxis, coordsSpace.yAxis, coordsSpace.chartInnerFrame) } func baseChartLayers(xAxisLabel: String, yAxisLabel: String) -> (ChartAxisLayer, ChartAxisLayer, CGRect) { return baseChartLayers(labelSettings, minX: minX, maxX: maxX, minY: minY, maxY: maxY, xInterval: xInterval, yInterval: yInterval, xAxisLabel: xAxisLabel, yAxisLabel: yAxisLabel) } func toLayers(_ models: [LabeledInput], layerSpecifications: [DataType : UIColor], xAxis: ChartAxisLayer, yAxis: ChartAxisLayer, chartInnerFrame: CGRect) -> [ChartLayer] { // group chartpoints by type let groupedChartPoints: Dictionary<DataType, [ChartPoint]> = models.reduce(Dictionary<DataType, [ChartPoint]>()) {(dict, model) in let points = model.0 let type = model.1 let x = CGFloat(points[0]) let y = CGFloat(points[1]) let chartPoint = ChartPoint(x: ChartAxisValueFloat(x), y: ChartAxisValueFloat(y)) if dict[type] != nil { dict[type]!.append(chartPoint) } else { dict[type] = [chartPoint] } return dict } // create layer for each group var dim: CGFloat = Env.iPad ? 14 : 7 if let d = pointSize { dim = CGFloat(d) } let size = CGSize(width: dim, height: dim) let layers: [ChartLayer] = groupedChartPoints.map {(type, chartPoints) in let color = layerSpecifications[type]! return ChartPointsScatterCirclesLayer(xAxis: xAxis as! ChartAxis, yAxis: yAxis as! ChartAxis, chartPoints: chartPoints, displayDelay: chartInnerFrame, itemSize: size, itemFillColor: color) } return layers } func setDataMinMaxInterval(_ data: [LabeledInput]) { chartFrame = frame var minX = Double(UINT32_MAX) var minY = Double(UINT32_MAX) var maxX = -Double(UINT32_MAX) var maxY = -Double(UINT32_MAX) for input in data { let x = input.0[0] let y = input.0[1] if x < minX { minX = x } else if x > maxX { maxX = x } if y < minY { minY = y } else if y > maxY { maxY = y } } if let overrideMinX = overrides.minX { minX = overrideMinX } if let overrideMaxX = overrides.maxX { maxX = overrideMaxX } if let overrideMinY = overrides.minY { minY = overrideMinY } if let overrideMaxY = overrides.maxY { maxY = overrideMaxY } if let overrideXInterval = overrides.xInterval { xInterval = overrideXInterval } else { let xDiff = abs(maxX - minX) xInterval = xDiff/10 } if let overrideYInterval = overrides.yInterval { yInterval = overrideYInterval } else { let yDiff = abs(maxY - minY) yInterval = yDiff/8 } if let xMultiplier = overrides.xMaxMultiplier { maxX *= xMultiplier } if let yMultiplier = overrides.yMaxMultiplier { maxY *= yMultiplier } if paddingOptions.contains(.PadBottom) { minY -= yInterval } if paddingOptions.contains(.PadTop) { maxY += yInterval } if paddingOptions.contains(.PadLeft) { minX -= xInterval } if paddingOptions.contains(.PadRight) { maxX += xInterval } // the stride sometimes misses the top value if this is not included maxY += (yInterval / 5) maxX += (xInterval / 5) self.minX = minX self.minY = minY self.maxX = maxX self.maxY = maxY } }
[ -1 ]
0ca4bdcd722a9c8c0cf6f29b2483dd52d98cb8fa
c73cf32e22ac6ff94a623f002277350d6b85b06b
/Source/UI/Stories/Photos Story/ViewControllers/ShareViewController/ShareUserViewModel/ShareUserViewModel.swift
e192a1c74baaa5e412d5d11c354131a5f36365d6
[]
no_license
sreenivas-wal/PrivateEye
17b3afaf3e317191b986086c0a697bdb4a4ccf26
c318c3b52c219ac1666e2bd04843819c2076e2bd
refs/heads/master
2020-05-01T14:54:52.512010
2019-03-25T07:07:32
2019-03-25T07:07:32
177,532,681
0
0
null
null
null
null
UTF-8
Swift
false
false
282
swift
// // ShareUserViewModel.swift // MyMobileED // // Created by Maks Ovcharuk on 1/12/18. // Copyright © 2018 Company. All rights reserved. // import UIKit struct ShareUserViewModel { var username: String? var canSelect: Bool = false var isSelected: Bool = false }
[ -1 ]
58b205c4476418e59cf86cd3e2d487b12f58a714
eecb44a01bc616f508dcdf291c27ddebcacbd66b
/Sources/Chain/ChainLinks/ChainLink+File.swift
b31516fc007150cc0860a1c38f4c0ce344904619
[]
no_license
birwin93/CommandLine
339a19143fb415032883394917956982ba602241
483fac5e3144d254d6b9b49392a11b98ce9090e7
refs/heads/master
2022-06-19T08:32:59.630246
2020-05-10T22:38:44
2020-05-11T01:54:54
262,888,375
0
0
null
null
null
null
UTF-8
Swift
false
false
576
swift
// // FileSteps.swift // Chain // // Created by Billy Irwin on 5/9/20. // import Foundation import Combine extension ChainLink { public static func readFile<T>(_ urlString: String) -> Link<T, String> { return Link<T, String>.sync { _ in guard FileManager.default.fileExists(atPath: urlString) else { throw FileError.fileNotFound } return try String(contentsOf: URL(fileURLWithPath: urlString)) } } } public enum FileError: Error { case fileNotFound case invalidData }
[ -1 ]
a60c85b01ab929897ac27d291c0a6ccdabb8ef72
73cab0579e0fefd6c1baa8c10df1e6fcaf0f233f
/Collection/CollectionUITests/CollectionUITests.swift
d92cfc313adc749ca7c004a62c5cb51110c7eb2e
[]
no_license
KrygTomasz/iOS-Learning
15b9ca888e5ca8ce8f9b5e825084701dfeefe092
c9e86ca05cdefb6b82f903526c105cb1cc66b01a
refs/heads/master
2021-01-17T08:05:27.874527
2017-04-11T19:55:07
2017-04-11T19:55:07
83,844,054
0
0
null
null
null
null
UTF-8
Swift
false
false
1,255
swift
// // CollectionUITests.swift // CollectionUITests // // Created by Kryg Tomasz on 03.03.2017. // Copyright © 2017 Kryg Tomek. All rights reserved. // import XCTest class CollectionUITests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. XCUIApplication().launch() // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } }
[ 333827, 243720, 282634, 313356, 155665, 305173, 241695, 237599, 223269, 229414, 292901, 315431, 102441, 315433, 278571, 325675, 354346, 124974, 282671, 102446, 229425, 313388, 243763, 241717, 321589, 229431, 180279, 215095, 319543, 213051, 288829, 325695, 288835, 286787, 307269, 237638, 313415, 239689, 315468, 311373, 278607, 196687, 311377, 354386, 223317, 315477, 354394, 323678, 321632, 315489, 315488, 45154, 280676, 313446, 227432, 215144, 233578, 194667, 307306, 217194, 288878, 319599, 278637, 278642, 284789, 131190, 288890, 292987, 215165, 131199, 227459, 194692, 235661, 278669, 241809, 323730, 278676, 311447, 153752, 327834, 284827, 278684, 299166, 278690, 233635, 311459, 215204, 299176, 184489, 278698, 284843, 278703, 323761, 184498, 278707, 125108, 180409, 278713, 295099, 258233, 299197, 280761, 280767, 223418, 227517, 299202, 139459, 309443, 176325, 131270, 301255, 299208, 227525, 233678, 227536, 282832, 301270, 229591, 280792, 301271, 311520, 325857, 280803, 182503, 319719, 307431, 338151, 295147, 317676, 286957, 125166, 125170, 313595, 125180, 184574, 125184, 309504, 217352, 125192, 125197, 227601, 125204, 319764, 278805, 315674, 282908, 311582, 299294, 125215, 233761, 282912, 278817, 211239, 282920, 125225, 317738, 311596, 321839, 315698, 98611, 125236, 282938, 307514, 127292, 278843, 168251, 287040, 319812, 227655, 280903, 319816, 323914, 201037, 282959, 229716, 289109, 168280, 379224, 323934, 391521, 239973, 381286, 313703, 285031, 416103, 280938, 242027, 242028, 321901, 278895, 287089, 199030, 227702, 315768, 139641, 291194, 223611, 248188, 291193, 313726, 211327, 291200, 311679, 240003, 158087, 313736, 227721, 242059, 285074, 227730, 240020, 190870, 315798, 190872, 291225, 317851, 293275, 285083, 227743, 242079, 289185, 283039, 285089, 305572, 293281, 156069, 301482, 289195, 311723, 377265, 299449, 311739, 319931, 293309, 278974, 311744, 317889, 291266, 278979, 278988, 289229, 281038, 326093, 278992, 283088, 281039, 283089, 279000, 242138, 176602, 285152, 279009, 291297, 188899, 195044, 160224, 279014, 242150, 279017, 311787, 281071, 319986, 236020, 279030, 293368, 279033, 311800, 317949, 233987, 287237, 322057, 309770, 342537, 279053, 182802, 283154, 303635, 279061, 303634, 279066, 188954, 322077, 291359, 227881, 293420, 289328, 283185, 236080, 279092, 23093, 234037, 244279, 244280, 338491, 234044, 301635, 309831, 322119, 55880, 377419, 303693, 281165, 301647, 281170, 326229, 309847, 189016, 115287, 111197, 295518, 287327, 283431, 242274, 244326, 279143, 279150, 281200, 287345, 313970, 301688, 189054, 287359, 297600, 303743, 291455, 301702, 164487, 311944, 334473, 279176, 311948, 316044, 184974, 311950, 316048, 311953, 316050, 287379, 295575, 227991, 289435, 303772, 205469, 221853, 285348, 314020, 279207, 295591, 295598, 279215, 318127, 285360, 299698, 293552, 164532, 287412, 166581, 154295, 342705, 279218, 287418, 303802, 314043, 66243, 291529, 287434, 225996, 363212, 287438, 242385, 303826, 164561, 279249, 279253, 158424, 230105, 299737, 322269, 342757, 295653, 289511, 230120, 330473, 234216, 285419, 289517, 279278, 312046, 215790, 170735, 125683, 230133, 199415, 234233, 242428, 279293, 289534, 322302, 291584, 299777, 205566, 285443, 228099, 291591, 295688, 322312, 285450, 312076, 285457, 295698, 166677, 283418, 285467, 221980, 281378, 234276, 318247, 262952, 262953, 279337, 318251, 289580, 262957, 293673, 164655, 301872, 242481, 303921, 234290, 230198, 285496, 301883, 201534, 289599, 295745, 222017, 293702, 318279, 283466, 281426, 279379, 295769, 201562, 281434, 234330, 322396, 230238, 301919, 275294, 293729, 279393, 349025, 230239, 303973, 279398, 281444, 177002, 308075, 242540, 242542, 310132, 295797, 228214, 295799, 207735, 177018, 269179, 279418, 308093, 314240, 291713, 158594, 240517, 287623, 228232, 416649, 279434, 316299, 320394, 299912, 234382, 189327, 308111, 308113, 293780, 310166, 289691, 209820, 277404, 240543, 283551, 310177, 289699, 189349, 289704, 293801, 279465, 177074, 304050, 289720, 289723, 189373, 213956, 281541, 19398, 345030, 213961, 279499, 56270, 191445, 304086, 183258, 234469, 314343, 304104, 324587, 320492, 183276, 203758, 320495, 234476, 289773, 287730, 277493, 240631, 320504, 312313, 214009, 312315, 312317, 354342, 328705, 234499, 293894, 320520, 230411, 320526, 234513, 238611, 293911, 140311, 316441, 113710, 189487, 281647, 322609, 312372, 203829, 238646, 300087, 238650, 320571, 21567, 308288, 336962, 160834, 314437, 349254, 238663, 300109, 207954, 234578, 296023, 205911, 314458, 156763, 277600, 281699, 285795, 230500, 322664, 228457, 318571, 279659, 234606, 300145, 238706, 312435, 187508, 279666, 300147, 230514, 302202, 285819, 314493, 285823, 234626, 279686, 222344, 285834, 318602, 228492, 337037, 234635, 177297, 162962, 187539, 308375, 324761, 285850, 296091, 119965, 302239, 300192, 234655, 339106, 306339, 234662, 300200, 249003, 238764, 322733, 3243, 208044, 302251, 279729, 294069, 300215, 294075, 64699, 228541, 148674, 283846, 312519, 279752, 283849, 148687, 290001, 189651, 316628, 279766, 189656, 279775, 310496, 298209, 304353, 304352, 279780, 228587, 279789, 290030, 302319, 234741, 283894, 316661, 208123, 292092, 279803, 228608, 320769, 234756, 322826, 242955, 177420, 312588, 318732, 126229, 318746, 320795, 320802, 304422, 130342, 130344, 292145, 298290, 312628, 345397, 300342, 222523, 286012, 181568, 279872, 294210, 216387, 286019, 279874, 300354, 300355, 193858, 304457, 230730, 337226, 294220, 296269, 234830, 224591, 238928, 406862, 296274, 314708, 318804, 283990, 314711, 357720, 300378, 300379, 294236, 314721, 292194, 230757, 281958, 314727, 134504, 306541, 314734, 327023, 234864, 296304, 312688, 316786, 230772, 314740, 314742, 284015, 314745, 290170, 310650, 224637, 306558, 290176, 243073, 179586, 306561, 294278, 314759, 296328, 298378, 304523, 368012, 318860, 314765, 296330, 292242, 279955, 306580, 314771, 234902, 224662, 282008, 314776, 318876, 282013, 290206, 148899, 314788, 298406, 282023, 241067, 279979, 314797, 279980, 286128, 279988, 286133, 284086, 173492, 310714, 302523, 284090, 228796, 302530, 280003, 228804, 310725, 306630, 292291, 300488, 415170, 306634, 280011, 302539, 234957, 300490, 310731, 312785, 222674, 280020, 280025, 310747, 239069, 144862, 286176, 187877, 310758, 320997, 280042, 280043, 191980, 300526, 337391, 282097, 296434, 308722, 40439, 191991, 286201, 300539, 288252, 312830, 290304, 286208, 228868, 292359, 218632, 323079, 230922, 302602, 323083, 294413, 304655, 323088, 282132, 230933, 302613, 282135, 316951, 374297, 302620, 313338, 282147, 222754, 306730, 312879, 230960, 288305, 290359, 239159, 323132, 157246, 288319, 288322, 280131, 349764, 310853, 124486, 194118, 292424, 288328, 282182, 286281, 292426, 224848, 224852, 290391, 128600, 306777, 235096, 239192, 230999, 212574, 99937, 204386, 323171, 345697, 300645, 282214, 312937, 224874, 243306, 312941, 310896, 294517, 314997, 288377, 290425, 325246, 333438, 235136, 280193, 282244, 288391, 286344, 323208, 282248, 179853, 286351, 188049, 229011, 239251, 280217, 323226, 179868, 229021, 302751, 282272, 198304, 282279, 298664, 212649, 298666, 317102, 286387, 300725, 286392, 300729, 302778, 306875, 296636, 280252, 282302, 280253, 286400, 323265, 321217, 280259, 321220, 282309, 323262, 296649, 280266, 239305, 306891, 212684, 9935, 241360, 282321, 313042, 286419, 241366, 280279, 282330, 18139, 294621, 280285, 282336, 321250, 294629, 153318, 12009, 282347, 288492, 282349, 34547, 67316, 286457, 284410, 200444, 288508, 282366, 286463, 319232, 278273, 288515, 280326, 282375, 323335, 284425, 300810, 282379, 116491, 216844, 284430, 280333, 161553, 124691, 284436, 278292, 118549, 116502, 282390, 325403, 321308, 431901, 321309, 282399, 241440, 282401, 325411, 315172, 186148, 186149, 241447, 294699, 286507, 284460, 280367, 300849, 282418, 280373, 282424, 280377, 321338, 282428, 280381, 345918, 413500, 241471, 280386, 280391, 153416, 315209, 159563, 280396, 307024, 317268, 237397, 307030, 18263, 241494, 188250, 284508, 300893, 307038, 237411, 284515, 276326, 296807, 282471, 292713, 282476, 292719, 296815, 313200, 313204, 317305, 124795, 317308, 339840, 315265, 280451, 327556, 188293, 282503, 243592, 305032, 325514, 315272, 315275, 67464, 184207, 124816, 311183, 282517, 294806, 214936, 294808, 124826, 239515, 214943, 298912, 319393, 294820, 333734, 219046, 284584, 294824, 313257, 298921, 292783, 126896, 200628, 300983, 343993, 288698, 98240, 294849, 214978, 280517, 214983, 282572, 282573, 372039, 153553, 24531, 231382, 323554, 292835, 190437, 292838, 294887, 317416, 313322, 298987, 278507, 311277, 296942, 124912, 327666, 278515, 325620, 239610 ]
a9e58cdf337b799cd32eafa85d6051c7ac7b9101
f847398a54d5b26ea6047f464ee5f45e1ab2c092
/swift-DYZB/swift-DYZB/Classes/Main/View/CollectionBeautifulCell.swift
29e730527370f7837771be7800bec8936ff69e3c
[ "MIT" ]
permissive
hengZhuo/DouYuZhiBo
4aa87cda488bf9290f2f34289ba4f50fe84d27d4
959756fd1375a00e52e065585cf6c884ab4a7bee
refs/heads/master
2020-07-29T21:07:37.867769
2016-11-23T04:45:54
2016-11-23T04:45:54
73,658,402
0
0
null
null
null
null
UTF-8
Swift
false
false
1,891
swift
// // CollectionBeautifulCell.swift // swift-DYZB // // Created by chenrin on 2016/11/15. // Copyright © 2016年 zhuoheng. All rights reserved. // import UIKit import Kingfisher class CollectionBeautifulCell: UICollectionViewCell { @IBOutlet weak var photoImageView: UIImageView! @IBOutlet weak var nickNameLabel: UILabel! @IBOutlet weak var onlineLabel: UILabel! @IBOutlet weak var cityButton: UIButton! //定义模型属性 var anchor : AnchorModel?{ didSet{ //1.校验模型是否有值 guard let anchor = anchor else { return } //2.取出在线人数显示的文字 var onlineStr : String = "" if anchor.online >= 10000 { onlineStr = String(format: "%.1f", CGFloat(anchor.online) / CGFloat(10000)) onlineStr = "\(onlineStr)万人在线" }else{ onlineStr = "\(anchor.online)在线" } onlineLabel.text = onlineStr //3.昵称显示 nickNameLabel.text = anchor.nickname //4.所在城市 cityButton.setTitle(anchor.anchor_city, for: .normal) //5.图片 guard let iconUrl = URL(string:anchor.vertical_src) else { return } photoImageView.kf.setImage(with: iconUrl, placeholder: UIImage(named:"live_cell_default_phone"), options: nil, progressBlock: nil, completionHandler: nil) } } override func awakeFromNib() { super.awakeFromNib() photoImageView.layer.cornerRadius = 5 photoImageView.layer.masksToBounds = true onlineLabel.layer.cornerRadius = 3 onlineLabel.layer.masksToBounds = true onlineLabel.isHighlighted = true onlineLabel.highlightedTextColor = UIColor.white } }
[ -1 ]
a2322c0a2da5a6c68dafa162c3250813860de972
e20d297b26c5882205d88fbe613a9c8ed9d7ebd3
/Sources/Managers/APIManager.swift
bf1437f377d748f3227a6a5bf57362b5ff2243c9
[ "MIT" ]
permissive
helimarrabago/Siren
5249799ee14d31e5ff557aaf338a9f1772e8ac9a
42cb52727dbb8bfbfa6140380ef17a2dc4ae56ac
refs/heads/master
2021-08-09T23:55:48.390236
2021-01-08T06:11:30
2021-01-08T06:11:30
238,629,200
0
0
MIT
2021-01-08T06:09:17
2020-02-06T07:13:15
Swift
UTF-8
Swift
false
false
5,096
swift
// // APIManager.swift // Siren // // Created by Arthur Sabintsev on 11/24/18. // Copyright © 2018 Sabintsev iOS Projects. All rights reserved. // import Foundation /// APIManager for Siren public struct APIManager { /// Constants used in the `APIManager`. private struct Constants { /// Constant for the `bundleId` parameter in the iTunes Lookup API request. static let bundleID = "bundleId" /// Constant for the `country` parameter in the iTunes Lookup API request. static let country = "country" } /// Return results or errors obtained from performing a version check with Siren. typealias CompletionHandler = (Result<APIModel, KnownError>) -> Void /// The region or country of an App Store in which the app is available. let country: AppStoreCountry /// Initializes `APIManager` to the region or country of an App Store in which the app is available. /// By default, all version check requests are performed against the US App Store. /// - Parameter country: The country for the App Store in which the app is available. public init(country: AppStoreCountry = .unitedStates) { self.country = country } /// The default `APIManager`. /// /// The version check is performed against the US App Store. public static let `default` = APIManager() } extension APIManager { /// Convenience initializer that initializes `APIManager` to the region or country of an App Store in which the app is available. /// If nil, version check requests are performed against the US App Store. /// /// - Parameter countryCode: The raw country code for the App Store in which the app is available. public init(countryCode: String?) { self.init(country: .init(code: countryCode)) } /// Creates and performs a URLRequest against the iTunes Lookup API. /// /// - Parameter handler: The completion handler for the iTunes Lookup API request. func performVersionCheckRequest(completion handler: CompletionHandler?) { guard Bundle.main.bundleIdentifier != nil else { handler?(.failure(.missingBundleID)) return } do { let url = try makeITunesURL() let request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalAndRemoteCacheData, timeoutInterval: 30) URLSession.shared.dataTask(with: request) { (data, response, error) in URLCache.shared.removeCachedResponse(for: request) self.processVersionCheckResults(withData: data, response: response, error: error, completion: handler) }.resume() } catch { handler?(.failure(.malformedURL)) } } /// Parses and maps the the results from the iTunes Lookup API request. /// /// - Parameters: /// - data: The JSON data returned from the request. /// - response: The response metadata returned from the request. /// - error: The error returned from the request. /// - handler: The completion handler to call once the results of the request has been processed. private func processVersionCheckResults(withData data: Data?, response: URLResponse?, error: Error?, completion handler: CompletionHandler?) { if let error = error { handler?(.failure(.appStoreDataRetrievalFailure(underlyingError: error))) } else { guard let data = data else { handler?(.failure(.appStoreDataRetrievalFailure(underlyingError: nil))) return } do { let apiModel = try JSONDecoder().decode(APIModel.self, from: data) guard !apiModel.results.isEmpty else { handler?(.failure(.appStoreDataRetrievalEmptyResults)) return } DispatchQueue.main.async { handler?(.success(apiModel)) } } catch { handler?(.failure(.appStoreJSONParsingFailure(underlyingError: error))) } } } /// Creates the URL that points to the iTunes Lookup API. /// /// - Returns: The iTunes Lookup API URL. /// - Throws: An error if the URL cannot be created. private func makeITunesURL() throws -> URL { var components = URLComponents() components.scheme = "https" components.host = "itunes.apple.com" components.path = "/lookup" var items: [URLQueryItem] = [URLQueryItem(name: Constants.bundleID, value: Bundle.main.bundleIdentifier)] if let countryCode = country.code { let item = URLQueryItem(name: Constants.country, value: countryCode) items.append(item) } components.queryItems = items guard let url = components.url, !url.absoluteString.isEmpty else { throw KnownError.malformedURL } return url } }
[ 169624 ]
2c4e5453336d5cdf8a6cc450d960966cab189bf2
6ebe5815450738f211a4a8c679f3e4fc1087cedf
/Checklists/View Controller/IconPickerViewController.swift
533c08b16a85af04e1b8bfd979a8da897ca386b7
[]
no_license
BlondieG813/Checklists
b44ce488407dc321bb2c7f39e71064f85474a617
e115c0354b9f8ef0edf0badb655f9dc846b67d02
refs/heads/main
2023-08-06T09:21:38.462870
2021-10-03T20:24:23
2021-10-03T20:24:23
400,771,649
0
0
null
null
null
null
UTF-8
Swift
false
false
1,246
swift
// // IconPickerViewController.swift // Checklists // // Created by Michelle Guthrie-Harrigan on 9/28/21. // import UIKit protocol IconPickerViewControllerDelegate: class { func iconPicker(_ picker: IconPickerViewController, didPick iconName: String) } class IconPickerViewController: UITableViewController { weak var delegate: IconPickerViewControllerDelegate? let icons = [ "No Icon", "Appointments", "Birthdays", "Chores", "Drinks", "Folder", "Groceries", "Inbox", "Photos", "Trips" ] // MARK: - Table View Delegates override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return icons.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "IconCell", for: indexPath) let iconName = icons[indexPath.row] cell.textLabel!.text = iconName cell.imageView!.image = UIImage(named: iconName) return cell } override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if let delegate = delegate { let iconName = icons[indexPath.row] delegate.iconPicker(self, didPick: iconName) } } }
[ 296925, 305182 ]
bb0ca7c539b534e2c28eb40a2909c2d0552d5363
a64905bf3a5699e1c737fd7f3cdc17a5bffbb9a8
/flixster/MoviesViewController.swift
a8437d42adb316ff668fc218b123f70dfa8c13b1
[]
no_license
Dipu-Chowdhury/Flix-iOS
8a9e2de699647c3ce996aa8caece2f5af6eb344a
5c0b29b9dd5e91432159ba767e263274b648bf59
refs/heads/main
2023-07-09T23:47:54.230511
2021-08-11T05:43:24
2021-08-11T05:43:24
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,316
swift
// // MoviesViewController.swift // flixster // // Created by Muna Chowdhury on 7/11/21. // import UIKit import AlamofireImage class MoviesViewController: UIViewController, UITableViewDataSource, UITableViewDelegate{ @IBOutlet weak var tableView: UITableView! var movies = [[String:Any]]() override func viewDidLoad() { super.viewDidLoad() tableView.dataSource = self tableView.delegate = self // Do any additional setup after loading the view. let url = URL(string: "https://api.themoviedb.org/3/movie/now_playing?api_key=a07e22bc18f5cb106bfe4cc1f83ad8ed")! let request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData, timeoutInterval: 10) let session = URLSession(configuration: .default, delegate: nil, delegateQueue: OperationQueue.main) let task = session.dataTask(with: request) { (data, response, error) in // This will run when the network request returns if let error = error { print(error.localizedDescription) } else if let data = data { let dataDictionary = try! JSONSerialization.jsonObject(with: data, options: []) as! [String: Any] self.movies = dataDictionary["results"] as! [[String : Any]] self.tableView.reloadData() // TODO: Get the array of movies // TODO: Store the movies in a property to use elsewhere // TODO: Reload your table view data } } task.resume() } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return movies.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "MovieCell") as! MovieCell let movie = movies[indexPath.row] let title = movie["title"] as! String let synopsis = movie["overview"] as! String cell.titleLabel.text = title cell.synopsisLabel.text = synopsis let baseURL = "https://image.tmdb.org/t/p/w185" let posterPath = movie["poster_path"] as! String let posterURL = URL(string: baseURL+posterPath)! cell.posterView.af_setImage(withURL: posterURL) return cell } // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. print("Loading the details screen") let cell = sender as! UITableViewCell let indexPath = tableView.indexPath(for: cell)! let movie = movies[indexPath.row] let detailViewController = segue.destination as! MovieDetailsViewController detailViewController.movie = movie tableView.deselectRow(at: indexPath, animated: true) } }
[ 369379 ]
4ef4caa8a921245fb22569364fb22a5e49cedf21
ab7c838e69e284f9fdb91c283217c82558347e62
/FirstSwiftUIApp/ContentCellView.swift
abc9efc0d2b8c7d9d80f5a246733ef66595e7dd0
[]
no_license
zipper-studios/FirstSwiftUIApp
c9ffeb22cf8d2b9da1962892ff9608412297a9ac
5d7e4c12d55405c317714243cb78359aa72c6737
refs/heads/master
2020-06-22T20:01:40.883711
2019-07-23T08:22:18
2019-07-23T08:22:18
198,384,427
0
0
null
null
null
null
UTF-8
Swift
false
false
2,038
swift
// // ContentCellView.swift // FirstSwiftUIApp // // Created by Nicoleta Pop on 7/4/19. // Copyright © 2019 Nicoleta Pop. All rights reserved. // import SwiftUI import UIKit struct ContentCellView : View { @State var destination : Destination @State var image: Image? var body: some View { NavigationButton(destination: ContentDetailView(destination: destination)) { HStack { if ((UIImage(named: destination.city)) != nil) { Image(destination.city) .clipShape(Circle()) .overlay(Circle().stroke(Color.white, lineWidth: 1)) .shadow(radius: 10) } else { image! .frame(width: 120, height: 120) .scaledToFit() .clipShape(Circle()) .overlay(Circle().stroke(Color.white, lineWidth: 1)) .shadow(radius: 10) } Spacer() .frame(width: 90, height: 20, alignment: .center) .relativeWidth(20) VStack(alignment: .trailing) { Text(destination.city.capitalized) .font(.headline) .bold() .color(.init(.sRGB, red: 102/255, green: 76/255, blue: 76/255, opacity: 1.0)) Text("Read all about it") .font(.subheadline) .color(.init(.sRGB, red: 127/255, green: 102/255, blue: 102/255, opacity: 1.0)) } } .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: Alignment.topLeading) } } } #if DEBUG struct ContentCellView_Previews : PreviewProvider { static var previews: some View { ContentCellView(destination: Destination(city: "riga", country: "latvia"), image: nil) } } #endif
[ -1 ]
49b8461d67fbd7a9b57a2d49826702fc0bf12015
447fd8c68c6a54823a084ed96afd47cec25d9279
/icons/sort-clock-ascending/src/sort-clock-ascending.swift
c3a5c40d68f45314578e13a641086d7fa5d54d43
[]
no_license
friends-of-cocoa/material-design-icons
cf853a45d5936b16d0fddc88e970331379721431
d66613cf64e521e32a4cbb64dadd9cb20ea6199e
refs/heads/master
2022-07-29T15:51:13.647551
2020-09-16T12:15:32
2020-09-16T12:15:32
295,662,032
0
0
null
null
null
null
UTF-8
Swift
false
false
414
swift
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen // swiftlint:disable superfluous_disable_command identifier_name line_length nesting type_body_length type_name public enum MDIIcons { public static let sortClockAscending24pt = MDIIcon(name: "sort-clock-ascending_24pt").image } // swiftlint:enable superfluous_disable_command identifier_name line_length nesting type_body_length type_name
[ -1 ]
b589d02d6202652a4c2f5e8012c92897f847d332
2b21422e50cf7c3c5b330e157946ffd88d77d8a9
/SpiltCoffee/Views/RecepieCollectionViewCell.swift
1a195bbf7017e6a63d02a92914996ed42832ec97
[]
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
803
swift
// // Group3ThreeCollectionViewCell.swift // SpiltCoffee // // Created by Trevor Adcock. // Copyright © 2018 DevMountain. All rights reserved. // import UIKit class RecpeieCollectionViewCell: DataCollectionViewCell<Recepie> { //MARK: - IBOutlets @IBOutlet weak var bgView: UIView! @IBOutlet weak var headerImageView: RoundedImageView! @IBOutlet weak var titleLabel: UILabel! @IBOutlet weak var brewTimeLabel: UILabel! //MARK: - Methods override func updateViews(){ guard let recepie = data else {return} if let url = recepie.photoUrlStrings.first{ headerImageView.urlString = url }else{ headerImageView.image = recepie.brewMethod.image } titleLabel.text = recepie.title brewTimeLabel.text = "Brew Time: \(recepie.brewTimeInMinutes) min" } }
[ -1 ]
a4dc5adcb2d46beb00b6331a3df1f914e156ef56
50a4e264d20414b3b02e9a74dd7588a9508483a4
/igexplorer/SocialMaxxCode/IGDateSupport.swift
0afaec70e5b2845164bfcdde7e72292798d22193
[]
no_license
nagyistge/igexplorer
76a560f2cb4823a236c81b02c02d4b53638ce6aa
cca06bec8c9e5b5ede21028fc879d7cd897da411
refs/heads/master
2020-12-29T19:03:53.750914
2016-02-15T22:45:29
2016-02-15T22:45:29
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,037
swift
// // IGDateSupport.swift // SocialMaxx // // Created by bill donner on 1/17/16. // import Foundation struct MI { var m:Matrix var i:Int } struct IGDateSupport { // func timeStringFromUnixTime(unixTime: Double,dateFormatter:NSDateFormatter) -> String // func dayStringFromTime(unixTime: Double,dateFormatter:NSDateFormatter) -> String // func hourBucket(unixTime: Double,dateFormatter:NSDateFormatter)->Int // func dayOfWeekBucket(unixTime: Double,dateFormatter:NSDateFormatter)->Int // func calculateFail()->Matrix // func calculateMediaLikesHisto24x7(posts:OU.BunchOfMedia)->MI // func calculateMediaPostHisto24x7(posts:OU.BunchOfMedia)->MI // //func calculateMediaBestPostHisto24x7(posts:OU.BunchOfMedia)->Matrix } extension IGDateSupport { static func hourBucket(unixTime: Double,dateFormatter:NSDateFormatter)->Int { let date = NSDate(timeIntervalSince1970: unixTime) // Returns date formatted as 24 hour time. dateFormatter.dateFormat = "HH" return Int( dateFormatter.stringFromDate(date))! } static func dayOfWeekBucket(unixTime: Double,dateFormatter:NSDateFormatter)->Int { let date = NSDate(timeIntervalSince1970: unixTime) // Returns date formatted as 24 hour time. dateFormatter.locale = NSLocale(localeIdentifier: NSLocale.currentLocale().localeIdentifier) dateFormatter.dateFormat = "EEEE" let s = dateFormatter.stringFromDate(date) switch s { case "Sunday": return 0 case "Monday": return 1 case "Tuesday": return 2 case "Wednesday": return 3 case "Thursday": return 4 case "Friday": return 5 case "Saturday": return 6 default: fatalError("bad day of week bucket " + s) break } } static func timeStringFromUnixTime(unixTime: Double,dateFormatter:NSDateFormatter) -> String { let date = NSDate(timeIntervalSince1970: unixTime) // Returns date formatted as 12 hour time. dateFormatter.dateFormat = "hh:mm a" return dateFormatter.stringFromDate(date) } static func dayStringFromTime(unixTime: Double,dateFormatter:NSDateFormatter) -> String { let date = NSDate(timeIntervalSince1970: unixTime) dateFormatter.locale = NSLocale(localeIdentifier: NSLocale.currentLocale().localeIdentifier) dateFormatter.dateFormat = "EEEE" return dateFormatter.stringFromDate(date) } static func computeTimeBucketFromIGTimeStamp(ts:String) -> (hourOfDay:Int,dayOfWeek:Int) { let dateFormatter = Globals.shared.dateFormatter if let dd = Double(ts) { let hourOfDay = hourBucket(dd,dateFormatter: dateFormatter) let dayOfWeek = dayOfWeekBucket(dd,dateFormatter: dateFormatter) return (hourOfDay,dayOfWeek) } return (hourOfDay:0,dayOfWeek:0) } }
[ -1 ]
23583c31b0ac753e336e168d14b878513a021b8e
42fca831237ace198e2f418ce031f4af83a99887
/SKTUtils/SKTTimingFunctions.swift
f8238eafd3f05723514c8e499303d572b76fd582
[]
no_license
happywatch/SKTRings
1e27b1fdb749234236d286cb85142bc111d89e71
3c2f6bb5f87c27c4d816cb04f9cfd8b000ed7382
refs/heads/master
2021-01-12T13:00:41.743407
2016-12-30T23:38:47
2016-12-30T23:38:47
69,402,056
83
8
null
null
null
null
UTF-8
Swift
false
false
6,811
swift
/* * Timing functions for SKTEffects. Based on Robert Penner's easing equations * http://robertpenner.com/easing/ and https://github.com/warrenm/AHEasing * * Copyright (c) 2013-2014 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 Foundation import CoreGraphics public func SKTTimingFunctionLinear(_ t: CGFloat) -> CGFloat { return t } public func SKTTimingFunctionQuadraticEaseIn(_ t: CGFloat) -> CGFloat { return t * t } public func SKTTimingFunctionQuadraticEaseOut(_ t: CGFloat) -> CGFloat { return t * (2.0 - t) } public func SKTTimingFunctionQuadraticEaseInOut(_ t: CGFloat) -> CGFloat { if t < 0.5 { return 2.0 * t * t } else { let f = t - 1.0 return 1.0 - 2.0 * f * f } } func SKTTimingFunctionCubicEaseIn(_ t: CGFloat) -> CGFloat { return t * t * t } func SKTTimingFunctionCubicEaseOut(_ t: CGFloat) -> CGFloat { let f = t - 1.0 return 1.0 + f * f * f } public func SKTTimingFunctionCubicEaseInOut(_ t: CGFloat) -> CGFloat { if t < 0.5 { return 4.0 * t * t * t } else { let f = t - 1.0 return 1.0 + 4.0 * f * f * f } } public func SKTTimingFunctionQuarticEaseIn(_ t: CGFloat) -> CGFloat { return t * t * t * t } public func SKTTimingFunctionQuarticEaseOut(_ t: CGFloat) -> CGFloat { let f = t - 1.0 return 1.0 - f * f * f * f } public func SKTTimingFunctionQuarticEaseInOut(_ t: CGFloat) -> CGFloat { if t < 0.5 { return 8.0 * t * t * t * t } else { let f = t - 1.0 return 1.0 - 8.0 * f * f * f * f } } public func SKTTimingFunctionQuinticEaseIn(_ t: CGFloat) -> CGFloat { return t * t * t * t * t } public func SKTTimingFunctionQuinticEaseOut(_ t: CGFloat) -> CGFloat { let f = t - 1.0 return 1.0 + f * f * f * f * f } func SKTTimingFunctionQuinticEaseInOut(_ t: CGFloat) -> CGFloat { if t < 0.5 { return 16.0 * t * t * t * t * t } else { let f = t - 1.0 return 1.0 + 16.0 * f * f * f * f * f } } public func SKTTimingFunctionSineEaseIn(_ t: CGFloat) -> CGFloat { return sin((t - 1.0) * π/2) + 1.0 } public func SKTTimingFunctionSineEaseOut(_ t: CGFloat) -> CGFloat { return sin(t * π/2) } public func SKTTimingFunctionSineEaseInOut(_ t: CGFloat) -> CGFloat { return 0.5 * (1.0 - cos(t * π)) } public func SKTTimingFunctionCircularEaseIn(_ t: CGFloat) -> CGFloat { return 1.0 - sqrt(1.0 - t * t) } public func SKTTimingFunctionCircularEaseOut(_ t: CGFloat) -> CGFloat { return sqrt((2.0 - t) * t) } public func SKTTimingFunctionCircularEaseInOut(_ t: CGFloat) -> CGFloat { if t < 0.5 { return 0.5 * (1.0 - sqrt(1.0 - 4.0 * t * t)) } else { return 0.5 * sqrt(-4.0 * t * t + 8.0 * t - 3.0) + 0.5 } } public func SKTTimingFunctionExponentialEaseIn(_ t: CGFloat) -> CGFloat { return (t == 0.0) ? t : pow(2.0, 10.0 * (t - 1.0)) } public func SKTTimingFunctionExponentialEaseOut(_ t: CGFloat) -> CGFloat { return (t == 1.0) ? t : 1.0 - pow(2.0, -10.0 * t) } public func SKTTimingFunctionExponentialEaseInOut(_ t: CGFloat) -> CGFloat { if t == 0.0 || t == 1.0 { return t } else if t < 0.5 { return 0.5 * pow(2.0, 20.0 * t - 10.0) } else { return 1.0 - 0.5 * pow(2.0, -20.0 * t + 10.0) } } public func SKTTimingFunctionElasticEaseIn(_ t: CGFloat) -> CGFloat { return sin(13.0 * π/2 * t) * pow(2.0, 10.0 * (t - 1.0)) } public func SKTTimingFunctionElasticEaseOut(_ t: CGFloat) -> CGFloat { return sin(-13.0 * π/2 * (t + 1.0)) * pow(2.0, -10.0 * t) + 1.0 } public func SKTTimingFunctionElasticEaseInOut(_ t: CGFloat) -> CGFloat { if t < 0.5 { return 0.5 * sin(13.0 * π * t) * pow(2.0, 20.0 * t - 10.0) } else { return 0.5 * sin(-13.0 * π * t) * pow(2.0, -20.0 * t + 10.0) + 1.0 } } public func SKTTimingFunctionBackEaseIn(_ t: CGFloat) -> CGFloat { let s: CGFloat = 1.70158 return ((s + 1.0) * t - s) * t * t } public func SKTTimingFunctionBackEaseOut(_ t: CGFloat) -> CGFloat { let s: CGFloat = 1.70158 let f = 1.0 - t return 1.0 - ((s + 1.0) * f - s) * f * f } public func SKTTimingFunctionBackEaseInOut(_ t: CGFloat) -> CGFloat { let s: CGFloat = 1.70158 if t < 0.5 { let f = 2.0 * t return 0.5 * ((s + 1.0) * f - s) * f * f } else { let f = 2.0 * (1.0 - t) return 1.0 - 0.5 * ((s + 1.0) * f - s) * f * f } } public func SKTTimingFunctionExtremeBackEaseIn(_ t: CGFloat) -> CGFloat { return (t * t - sin(t * π)) * t } public func SKTTimingFunctionExtremeBackEaseOut(_ t: CGFloat) -> CGFloat { let f = 1.0 - t return 1.0 - (f * f - sin(f * π)) * f } public func SKTTimingFunctionExtremeBackEaseInOut(_ t: CGFloat) -> CGFloat { if t < 0.5 { let f = 2.0 * t return 0.5 * (f * f - sin(f * π)) * f } else { let f = 2.0 * (1.0 - t) return 1.0 - 0.5 * (f * f - sin(f * π)) * f } } public func SKTTimingFunctionBounceEaseIn(_ t: CGFloat) -> CGFloat { return 1.0 - SKTTimingFunctionBounceEaseOut(1.0 - t) } public func SKTTimingFunctionBounceEaseOut(_ t: CGFloat) -> CGFloat { if t < 1.0 / 2.75 { return 7.5625 * t * t } else if t < 2.0 / 2.75 { let f = t - 1.5 / 2.75 return 7.5625 * f * f + 0.75 } else if t < 2.5 / 2.75 { let f = t - 2.25 / 2.75 return 7.5625 * f * f + 0.9375 } else { let f = t - 2.625 / 2.75 return 7.5625 * f * f + 0.984375 } } public func SKTTimingFunctionBounceEaseInOut(_ t: CGFloat) -> CGFloat { if t < 0.5 { return 0.5 * SKTTimingFunctionBounceEaseIn(t * 2.0) } else { return 0.5 * SKTTimingFunctionBounceEaseOut(t * 2.0 - 1.0) + 0.5 } } public func SKTTimingFunctionSmoothstep(_ t: CGFloat) -> CGFloat { return t * t * (3 - 2 * t) } public func SKTCreateShakeFunction(_ oscillations: Int) -> (CGFloat) -> CGFloat { return {t in -pow(2.0, -10.0 * t) * sin(t * π * CGFloat(oscillations) * 2.0) + 1.0} }
[ 197620, 204334 ]
f62664424cbfbd9604db1cbce7fb86c16057d5c7
99deb12815c0fbbea4c6127ac69ae94d2a8be2a3
/TJMobileTests/TJMobileTests.swift
b9bb10f2951b2ef42d04dd4f7c7fca8fb53be65e
[]
no_license
dashtom3/TJMobile
9319e591ba452fb0725a240d8d8b7e00c6cd1f71
01aee5857781df64e98c0cb2a96d9bf41a286207
refs/heads/master
2021-03-12T20:16:44.483191
2015-08-11T07:31:13
2015-08-11T07:31:13
32,568,979
0
0
null
null
null
null
UTF-8
Swift
false
false
903
swift
// // TJMobileTests.swift // TJMobileTests // // Created by 田程元 on 14/12/18. // Copyright (c) 2014年 田程元. All rights reserved. // import UIKit import XCTest class TJMobileTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. XCTAssert(true, "Pass") } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock() { // Put the code you want to measure the time of here. } } }
[ 276481, 276484, 276489, 276492, 278550, 276509, 241720, 276543, 280649, 276555, 223318, 288857, 278618, 194653, 276577, 276581, 276582, 276589, 276592, 131189, 227446, 276606, 276613, 141450, 276627, 276631, 184475, 227492, 227495, 176314, 227528, 276682, 276684, 276687, 278742, 278746, 155867, 278753, 196834, 276709, 276710, 276715, 157944, 211193, 276737, 276744, 276748, 276753, 157970, 129301, 276760, 278810, 276764, 276774, 276787, 278846, 164162, 276813, 278862, 6482, 276821, 276831, 276835, 276839, 276847, 278898, 276891, 276900, 278954, 278961, 278965, 276919, 278969, 278985, 281037, 279002, 276958, 276962, 276963, 227813, 279019, 279022, 276998, 186893, 279054, 223767, 277029, 281138, 277048, 301634, 369220, 277066, 277083, 277094, 166507, 189036, 189037, 277101, 295535, 189042, 189043, 277118, 277133, 133774, 277138, 277141, 225943, 164512, 285353, 225962, 209581, 154291, 154294, 285372, 285374, 225997, 226001, 164563, 277204, 277203, 203478, 226007, 119513, 201442, 226019, 279269, 226033, 226035, 226036, 226043, 226051, 277254, 209670, 203529, 369432, 105246, 228129, 277289, 277294, 226097, 162626, 277316, 277325, 277327, 277339, 297822, 297826, 277354, 277360, 213876, 277366, 277370, 226170, 226181, 213894, 277381, 234377, 226189, 234381, 226194, 226214, 256937, 275371, 226222, 277435, 287677, 277480, 277505, 277513, 234509, 277518, 275469, 295953, 310317, 277550, 277563, 7229, 277566, 230463, 7230, 7231, 207938, 277574, 277579, 207953, 277585, 296018, 275547, 277603, 281707, 275571, 275585, 275590, 275591, 277640, 226451, 226452, 275607, 277665, 275620, 275625, 208043, 275628, 226476, 226481, 277690, 277694, 203989, 285929, 204022, 120056, 204041, 277792, 277800, 113962, 277806, 226608, 277809, 226609, 277814, 277815, 277821, 277824, 277825, 226624, 15686, 277831, 142669, 277838, 277841, 222548, 277845, 218462, 224606, 277856, 302438, 281962, 173420, 277868, 277871, 279919, 226675, 277878, 275831, 275832, 277882, 277883, 142716, 277890, 277891, 226694, 275847, 277896, 277897, 281992, 277900, 318864, 296338, 206228, 277911, 277919, 277920, 277925, 370091, 277936, 277939, 277940, 296375, 277943, 277949, 277952, 296387, 163269, 277957, 296391, 277965, 277969, 277974, 228823, 228824, 277980, 277983, 277988, 277993, 296425, 278002, 278005, 278008, 278023, 175625, 280077, 278060, 228917, 226875, 128583, 226888, 276045, 276046, 276050, 226906, 147036, 226910, 276085, 276088, 278140, 276097, 192131, 276100, 276101, 276116, 278170, 276126, 276129, 278191, 278195, 296628, 278201, 276156, 276165, 278214, 276172, 276180, 276195, 276210, 276211, 278285, 184086, 278299, 276253, 276257, 278307, 288547, 159533, 276279, 276282, 276283, 276287, 276298, 276318, 276325, 276332, 173936, 276344, 276350, 227199, 1923, 44952, 276394, 276400, 276401, 276408, 161722, 276421, 276422, 276430, 276444, 153566, 276450, 276451, 276459, 276462, 276463, 276468, 276469, 276475, 276478 ]
9a5d05a1572ac2b6c8a5f3915fceee6e555dedac
810a8d983a2446ecff04bfa642d0e0c04d03531c
/GrioBook/Book.swift
baaf3b91933736d97b50939b15c4b6e262c13e0e
[]
no_license
lkeude96/GrioBook
3c6593ae6c2017f75b2de3df3a6a900033a9ef1e
1d4d5268f07c840b62fcd33aca37de424fec3c29
refs/heads/master
2021-01-10T08:11:55.381391
2016-01-26T22:07:22
2016-01-26T22:07:22
50,453,559
0
0
null
null
null
null
UTF-8
Swift
false
false
860
swift
// // Book.swift // GrioBook // // Created by Eude Kinsley Lesperance on 1/26/16. // Copyright © 2016 Grio. All rights reserved. // import Foundation class Book { private let baseUrl = "http://eudelesperance.com/griobook/books/" var _id: String var title: String var author: String var fileName: String init(_id: String, title: String, author: String, fileName: String) { self._id = _id self.title = title self.author = author self.fileName = fileName } init(book: [String: AnyObject]) { self._id = book["_id"] as! String self.title = book["title"] as! String self.author = book["author"] as! String self.fileName = book["file_name"] as! String } func getBookStringUrl() -> String{ return baseUrl + "/" + fileName } }
[ -1 ]
6db3f450440e3d8ace5b13dc0f80a9a4920bb327
b144c122a1b18c6916cdac566010a997af7fc410
/ViperDemoTests/ViperDemoTests.swift
338bf8f64eb2dc77fbd18a0e4f91086c367d24eb
[]
no_license
hayasilin/viper-clean-architecture-swift
3a4eaf836a12683f67b3d87acb76a99c867f3262
f6501be8f1c54317dcf31161d7b9c16d28b425ce
refs/heads/master
2023-05-09T00:19:39.475085
2021-05-27T13:24:20
2021-05-27T13:24:20
370,425,306
1
0
null
null
null
null
UTF-8
Swift
false
false
898
swift
// // ViperDemoTests.swift // ViperDemoTests // // Created by kuanwei on 2021/5/24. // import XCTest @testable import ViperDemo class ViperDemoTests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() throws { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 360462, 98333, 16419, 229413, 204840, 278570, 344107, 155694, 253999, 229430, 319542, 163896, 180280, 352315, 376894, 352326, 311372, 196691, 278615, 385116, 237663, 254048, 319591, 221290, 278634, 319598, 352368, 204916, 131191, 237689, 278655, 278677, 196760, 426138, 278685, 311458, 278691, 49316, 32941, 173, 278704, 377009, 278708, 131256, 295098, 417988, 417994, 139479, 254170, 229597, 311519, 205035, 385262, 286958, 336120, 344313, 327929, 147717, 368905, 180493, 254226, 368916, 262421, 377114, 237856, 237857, 278816, 254251, 311597, 98610, 180535, 336183, 278842, 287041, 319821, 254286, 344401, 377169, 368981, 155990, 368984, 106847, 98657, 270701, 246127, 270706, 139640, 246137, 106874, 246136, 311685, 106888, 385417, 311691, 385422, 213403, 385454, 311727, 377264, 311738, 33211, 278970, 336317, 319930, 336320, 311745, 278978, 254406, 188871, 278993, 278999, 328152, 369116, 287198, 279008, 279013, 279018, 319981, 319987, 279029, 254456, 279032, 377338, 377343, 279039, 254465, 287241, 279050, 139792, 303636, 393751, 254488, 279065, 377376, 377386, 197167, 385588, 352829, 115270, 385615, 426576, 369235, 139872, 66150, 344680, 139892, 344696, 287352, 279164, 189057, 311941, 336518, 369289, 311945, 344715, 279177, 311949, 287374, 377489, 311954, 352917, 230040, 271000, 377497, 303771, 377500, 205471, 344738, 139939, 279206, 295590, 287404, 205487, 303793, 336564, 164533, 287417, 287422, 66242, 377539, 164560, 385747, 279252, 361176, 418520, 287452, 295652, 369385, 418546, 312052, 172792, 344827, 344828, 221948, 205568, 295682, 197386, 434957, 426774, 197399, 426775, 336671, 344865, 197411, 279336, 189228, 295724, 197422, 353070, 164656, 295729, 312108, 353069, 328499, 353078, 197431, 230199, 353079, 336702, 353094, 353095, 353109, 377686, 230234, 189275, 435039, 295776, 303972, 385893, 246641, 246643, 295798, 246648, 361337, 279417, 254850, 369538, 287622, 426895, 295824, 189348, 353195, 140204, 377772, 353197, 304051, 230332, 377790, 353215, 353216, 213957, 213960, 345033, 279498, 386006, 418776, 50143, 123881, 304110, 320494, 271350, 295927, 304122, 320507, 328700, 328706, 410627, 320516, 295942, 386056, 353290, 254987, 230410, 377869, 320527, 238610, 418837, 140310, 197657, 336929, 369701, 345132, 238639, 312373, 238651, 361535, 336960, 377926, 361543, 238664, 353367, 156764, 156765, 361566, 304222, 173166, 377972, 353397, 377983, 402565, 279685, 222343, 386189, 337039, 296086, 238743, 296092, 238765, 279728, 238769, 402613, 353479, 353481, 353482, 402634, 189653, 419029, 148696, 296153, 279774, 304351, 304356, 222440, 328940, 279792, 353523, 386294, 386301, 320770, 386306, 279814, 369930, 328971, 312587, 353551, 320796, 222494, 369956, 353584, 345396, 386359, 116026, 378172, 222524, 279875, 312648, 337225, 304456, 230729, 238927, 353616, 296273, 222559, 378209, 230756, 386412, 230765, 279920, 312689, 296307, 116084, 337281, 148867, 378244, 296329, 296335, 9619, 370071, 279974, 173491, 304564, 353719, 361927, 370123, 148940, 280013, 312782, 222675, 353750, 271843, 280041, 361963, 296433, 321009, 280055, 288249, 329225, 230921, 296461, 304656, 329232, 370197, 402985, 394794, 230959, 288309, 312889, 288318, 124485, 288326, 288327, 239198, 99938, 312940, 222832, 247416, 370296, 337534, 337535, 263809, 288392, 239250, 419478, 345752, 255649, 321199, 337591, 321207, 296632, 370363, 280251, 321219, 280267, 403148, 9936, 9937, 370388, 272085, 345814, 181975, 280278, 280280, 18138, 345821, 321247, 321249, 345833, 345834, 280300, 67315, 173814, 313081, 124669, 288512, 288516, 280329, 321302, 345879, 116505, 321310, 255776, 247590, 362283, 378668, 296755, 321337, 345919, 436031, 403267, 345929, 337745, 255829, 18262, 362327, 370522, 345951, 362337, 345955, 296806, 288619, 214895, 362352, 313199, 313203, 124798, 182144, 305026, 67463, 329622, 337815, 124824, 214937, 436131, 354212, 436137, 362417, 124852, 288697, 370619, 362431, 214977, 174019, 214984, 321480, 362443, 247757, 346067, 354269, 280541, 329695, 354272, 436191, 354274, 337895, 354280, 247785, 313319, 174057, 436205, 247791, 362480, 313339, 346118, 43014, 354316, 313357, 182296, 223268, 354345, 223274, 321583, 124975, 346162, 124984, 288828, 436285, 288833, 288834, 436292, 403525, 436301, 338001, 354385, 338003, 280661, 329814, 338007, 354393, 280675, 280677, 43110, 321637, 329829, 436329, 313447, 288879, 280694, 215164, 313469, 215166, 280712, 215178, 346271, 436383, 362659, 239793, 125109, 182456, 379071, 149703, 338119, 346314, 321745, 387296, 280802, 379106, 338150, 346346, 321772, 125169, 338164, 436470, 125183, 149760, 411906, 125188, 313608, 125193, 125198, 125199, 272658, 125203, 272660, 125208, 305440, 125217, 338218, 321840, 379186, 125235, 280887, 125240, 321860, 182598, 289110, 272729, 215385, 379225, 321894, 280939, 354676, 354677, 313727, 436608, 362881, 240002, 436611, 248194, 395659, 395661, 108944, 240016, 190871, 149916, 420253, 141728, 289189, 108972, 272813, 338356, 436661, 289232, 281040, 256477, 281072, 174593, 420369, 289304, 322078, 207393, 182817, 289332, 174648, 338489, 338490, 322120, 281166, 297560, 354911, 436832, 436834, 191082, 313966, 420463, 281199, 346737, 313971, 346740, 420471, 330379, 330387, 117396, 346772, 330388, 264856, 289434, 363163, 346779, 338613, 314040, 158394, 363211, 363230, 289502, 264928, 338662, 346858, 330474, 289518, 199414, 363263, 35583, 191235, 264968, 322316, 117517, 322319, 166676, 207640, 289576, 191283, 273207, 355130, 289598, 355137, 355139, 420677, 355146, 355154, 281427, 281433, 322395, 355165, 355178, 207727, 207729, 330609, 207732, 158593, 240518, 355217, 224145, 256922, 289690, 420773, 289703, 256935, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 338899, 330708, 248796, 248797, 207838, 347103, 314342, 52200, 289774, 347123, 240630, 314362, 257024, 330754, 330763, 330772, 281626, 248872, 322612, 314436, 248901, 257094, 314448, 339030, 314467, 281700, 257125, 322663, 273515, 207979, 404593, 363641, 363644, 248961, 150657, 330888, 347283, 363669, 339100, 380061, 429214, 199839, 339102, 265379, 249002, 306346, 44203, 3246, 421048, 339130, 265412, 290000, 134366, 298208, 298212, 298213, 330984, 298221, 298228, 363771, 216315, 208124, 388349, 437505, 322824, 257305, 126237, 339234, 109861, 372009, 412971, 306494, 216386, 224586, 372043, 331090, 314710, 372054, 159066, 314720, 380271, 314739, 208244, 249204, 314741, 290173, 306559, 314751, 298374, 388487, 314758, 314760, 142729, 314766, 306579, 282007, 290207, 314783, 314789, 314791, 396711, 396712, 282024, 241066, 380337, 380338, 150965, 380357, 339398, 306639, 413137, 429542, 191981, 290301, 282114, 372227, 323080, 323087, 323089, 175639, 388632, 396827, 134686, 282146, 306723, 355876, 347694, 290358, 265798, 265804, 396882, 290390, 44635, 396895, 323172, 282213, 323178, 224883, 314998, 323196, 175741, 339584, 339585, 224901, 282245, 282246, 323217, 282259, 323236, 298661, 282280, 61101, 364207, 224946, 110268, 224958, 282303, 323264, 274115, 306890, 241361, 241365, 224984, 298712, 298720, 12010, 372460, 282348, 282358, 175873, 339715, 323331, 323332, 339720, 372496, 323346, 249626, 282400, 339745, 241441, 257830, 421672, 282417, 339762, 282427, 315202, 307011, 339783, 216918, 241495, 241528, 339841, 315273, 315274, 372626, 380821, 282518, 282519, 118685, 298909, 323507, 290745, 274371, 151497, 372701, 298980, 380908, 282633, 241692, 102437, 315432, 315434, 102445, 233517, 176175, 241716, 241720, 225351, 315465, 315476, 307289, 200794, 356447, 315487, 438377, 315498, 299121, 233589, 266357, 422019, 241808, 381073, 323729, 233636, 258214, 299174, 405687, 184505, 299198, 258239, 389313, 299203, 299209, 372941, 282831, 266449, 356576, 176362, 307435, 438511, 381172, 356602, 184570, 184575, 381208, 315673, 299293, 151839, 233762, 217380, 151847, 282919, 332083, 127284, 332085, 332089, 315706, 282939, 241986, 438596, 332101, 323913, 348492, 323916, 323920, 250192, 348500, 168281, 332123, 332127, 323935, 242023, 242029, 160110, 242033, 291192, 340357, 225670, 332167, 242058, 373134, 291224, 242078, 283038, 61857, 315810, 315811, 381347, 61859, 340398, 61873, 61880, 283064, 127427, 127428, 283075, 324039, 373197, 176601, 242139, 160225, 242148, 340453, 291311, 233978, 291333, 348682, 340490, 258581, 291358, 283184, 234036, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 381517, 340558, 332378, 201308, 242277, 111208, 184940, 373358, 389745, 209530, 356989, 373375, 152195, 348806, 184973, 316049, 111253, 316053, 111258, 111259, 176808, 299699, 299700, 422596, 422599, 291530, 225995, 242386, 422617, 422626, 422631, 234217, 299759, 348920, 299776, 291585, 430849, 291592, 62220, 422673, 430865, 291604, 422680, 152365, 422703, 422709, 152374, 242485, 160571, 430910, 160575, 160580, 348998, 299849, 283467, 381773, 201551, 127841, 357218, 242529, 349026, 275303, 308076, 242541, 209785, 177019, 185211, 308092, 398206, 291712, 381829, 316298, 349067, 308107, 349072, 308112, 209817, 324506, 324507, 390045, 185250, 324517, 185254, 373687, 349121, 381897, 373706, 316364, 340955, 340961, 324586, 340974, 349171, 316405, 349175, 201720, 127992, 357379, 324625, 308243, 316437, 201755, 300068, 357414, 357423, 300084, 324666, 324667, 308287, 21569, 218186, 250954, 250956, 300111, 341073, 439384, 250981, 300135, 316520, 300136, 357486, 316526, 144496, 300150, 291959, 300151, 160891, 341115, 300158, 349316, 349318, 373903, 169104, 177296, 308372, 119962, 300187, 300188, 300201, 300202, 373945, 259268, 283847, 62665, 283852, 283853, 259280, 316627, 333011, 357595, 234733, 234742, 128251, 316669, 439562, 292107, 242954, 414990, 251153, 177428, 349462, 382258, 300343, 382269, 193859, 177484, 406861, 259406, 234831, 251213, 120148, 283991, 374109, 316765, 292195, 333160, 243056, 316787, 382330, 357759, 357762, 112017, 234898, 259475, 275859, 112018, 357786, 251298, 333220, 316842, 374191, 210358, 284089, 292283, 415171, 300487, 300489, 366037, 210390, 210391, 210392, 210393, 144867, 54765, 251378, 308723, 300536, 210433, 366083, 259599, 316946, 308756, 398869, 374296, 374299, 308764, 423453, 349726, 431649, 349741, 169518, 431663, 194110, 235070, 349763, 218696, 292425, 243274, 128587, 333388, 333393, 300630, 128599, 235095, 333408, 374372, 300644, 415338, 243307, 120427, 54893, 325231, 333430, 366203, 325245, 194180, 415375, 153251, 300714, 210603, 415420, 333503, 218819, 259781, 333509, 333517, 333520, 333521, 333523, 325346, 153319, 325352, 284401, 325371, 194303, 284429, 243472, 366360, 284442, 325404, 325410, 341796, 333610, 399147, 431916, 366381, 300848, 317232, 259899, 325439, 325445, 153415, 341836, 415567, 325457, 317269, 341847, 350044, 128862, 284514, 292712, 325484, 423789, 292720, 325492, 276341, 341879, 317304, 333688, 112509, 194429, 55167, 325503, 333701, 243591, 317323, 325515, 243597, 325518, 333722, 350109, 292771, 415655, 333735, 284587, 243637, 301008, 153554, 219101, 292836, 292837, 317415, 325619, 432116, 333817, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 292902, 325674, 243759, 129076, 243767, 358456, 325694, 309345, 194666, 260207, 432240, 333940, 284788, 292992, 333955, 415881, 104587, 235662, 325776, 317587, 284826, 333991, 333992, 284842, 333996, 301251, 309444, 194782, 301279, 317664, 243962, 375039, 309503, 194820, 375051, 325905, 334103, 325912, 211235, 432421, 211238, 358703, 358709, 260418, 383311, 6481, 366930, 366929, 6489, 391520, 383332, 383336, 211326, 317831, 227725, 252308, 39324, 121245, 317852, 285090, 375207, 342450, 293303, 358843, 293310, 342466, 416197, 129483, 342476, 317901, 6606, 334290, 326100, 285150, 342498, 358882, 334309, 195045, 391655, 432618, 375276, 342536, 342553, 416286, 375333, 358954, 244269, 375343, 23092, 375351, 244281, 301638, 309830, 293448, 55881, 416341, 244310, 416351, 268899, 39530, 244347, 326287, 375440, 334481, 227990, 342682, 318107, 318106, 318130, 383667, 293556, 342713, 285373, 39614, 318173, 375526, 285415, 342762, 342763, 293612, 154359, 432893, 162561, 285444, 383754, 310036, 326429, 293664, 326433, 342820, 400166, 293672, 318250, 318252, 375609, 342847, 252741, 293711, 244568, 244570, 293730, 351077, 342887, 326505, 211829, 269178, 211836, 400252, 359298, 359299, 260996, 113542, 228233, 392074, 228234, 56208, 318364, 310176, 310178, 293800, 359338, 236461, 252847, 326581, 326587, 359364, 326601, 211914, 359381, 359387, 433115, 343005, 130016, 64485, 326635, 359406, 187374, 383983, 383982, 318461, 293886, 293893, 433165, 146448, 384016, 433174, 252958, 252980, 359478, 203830, 302139, 359495, 392290, 253029, 228458, 351344, 187506, 285814, 392318, 187521, 384131, 302216, 228491, 228493, 285838, 162961, 326804, 351390, 302240, 343203, 253099, 253100, 318639, 367799, 113850, 294074, 64700, 367810, 302274, 343234, 253125, 244940, 228563, 351446, 359647, 195808, 310497, 228588, 253167, 351476, 302325, 351478, 261377, 351490, 228609, 245019, 253216, 130338, 130343, 130348, 351537, 261425, 286013, 286018, 146762, 294218, 294219, 318805, 425304, 294243, 163175, 327024, 327025, 327031, 318848, 253317, 384393, 368011, 318864, 318868, 310692, 245161, 286129, 286132, 343476, 228795, 425405, 302529, 302531, 163268, 425418, 310732, 64975, 327121, 228827, 286172, 310757, 187878, 245223, 343542, 343543, 359930, 286202, 286205, 302590, 228867, 253451, 253452, 359950, 146964, 253463, 187938, 286244, 245287, 245292, 286254, 425535, 196164, 56902, 179801, 196187, 343647, 310889, 204397, 138863, 188016, 294529, 229001, 310923, 188048, 425626, 229020, 302754, 245412, 40613, 40614, 40615, 229029, 384695, 319162, 327358, 286399, 319177, 212685, 384720, 245457, 302802, 278234, 294622, 278240, 212716, 212717, 294638, 360177, 286459, 278272, 319233, 360195, 278291, 294678, 286494, 409394, 360252, 319292, 360264, 188251, 376669, 245599, 425825, 425833, 417654, 188292, 253829, 327557, 294807, 376732, 311199, 319392, 253856, 294823, 327596, 294843, 188348, 237504, 294850, 384964, 163781, 344013, 212942, 212946, 24532, 212951, 360417, 294886, 253929, 327661, 311281, 311282 ]
8da2d5f4da1453b6c3cb2f8aae9ae9b27a56727a
79bd435b108330e4cd1a2d4586f668d05a0e2dfb
/DataModels/Utilities/Extensions/XCDYouTube/XCDYouTubeVideo+Quality.swift
ba99139fa731f7e1816addbc51a7e1f55dcc219e
[ "MIT" ]
permissive
samwelnella/OpenTube
198196eb02b6ef7e39250dabced200b2cbaf5b72
de205ec57d72243446ad1733d1cf592e24792cd0
refs/heads/master
2022-11-11T10:25:30.855043
2020-06-26T04:45:49
2020-06-26T04:45:49
275,056,435
0
0
MIT
2020-06-26T02:22:03
2020-06-26T02:22:03
null
UTF-8
Swift
false
false
554
swift
import AVKit import XCDYouTubeKit extension XCDYouTubeVideo { func urlWithQuality(_ quality: VideoQuality) -> URL? { switch quality { case .high: return highUrl case .medium: return mediumUrl case .low: return lowUrl } } private var highUrl: URL? { return streamURLs[VideoQuality.high.videoKey] ?? mediumUrl } private var mediumUrl: URL? { return streamURLs[VideoQuality.medium.videoKey] ?? lowUrl } private var lowUrl: URL? { return streamURLs[VideoQuality.low.videoKey] } }
[ -1 ]
f032dc7db11ad88ad46ead745cbd149e61dc535b
f0a3e10d2828d1cb0a53cd810a2a0dc01d9ce98c
/Sources/SwiftBSV/TxBuilder.swift
89ff92e20bdedb0a0af8cd6c958a79394ced8680
[ "MIT" ]
permissive
wtsnz/SwiftBSV
6db0aa71b2f6425570ebeb70511e5653d112a5df
7f4d140b3f7dbd3a8f90c69ad52e2a16d727daa4
refs/heads/main
2023-03-11T03:10:38.854653
2021-03-01T17:18:17
2021-03-01T17:18:17
305,236,268
14
2
null
null
null
null
UTF-8
Swift
false
false
12,189
swift
// // TxBuilder.swift // SwiftBSV // // Created by Will Townsend on 2020-10-18. // Copyright © 2020 wtsnz. All rights reserved. // import Foundation enum TxBuilderError: Error { case invalidNumberOfInputs case missingChangeOutput case invalidNumberOfOutputs case changeOutputLessThanDust case inputAmountLessThanOutputAmount } public class TxBuilder { private(set) public var transaction: Transaction = .empty private var transactionInputs: [TransactionInput] = [] private var transactionOutputs: [TransactionOutput] = [] private var uTxOutMap = TxOutMap() private var sigOperations = SigOperations() private(set) var changeScript: Script? private(set) var changeAmount: UInt64? private(set) var feeAmount: UInt64 = 0 private(set) var dustChangeToFees = true private(set) var nLockTime: UInt32 = 0 private(set) var version: UInt32 = 1 /// The desired fee per Kb private(set) var dust: UInt64 = Network.mainnet.txBuilder.dust private(set) var feePerKbNum: Float = Network.mainnet.txBuilder.feePerKb public init() { } @discardableResult public func setNLockTime(_ nLockTime: UInt32) -> Self { self.nLockTime = nLockTime return self } @discardableResult public func setVersion(_ version: UInt32) -> Self { self.version = version return self } @discardableResult public func setFeePerKb(_ fee: Float) -> Self { self.feePerKbNum = fee return self } @discardableResult public func setChangeAddress(_ changeAddress: Address) -> Self { let script: Script = Script.buildPublicKeyHashOut(pubKeyHash: changeAddress.hashBuffer) setChangeScript(script) return self } @discardableResult public func setChangeScript(_ changeScript: Script) -> Self { self.changeScript = changeScript return self } @discardableResult public func inputFromScript(_ txHashBuffer: Data, txOutNum: UInt32, txOut: TransactionOutput, script: Script, nSequence: UInt32) -> Self { let txIn = TransactionInput( previousOutput: TransactionOutPoint( hash: txHashBuffer, index: txOutNum ), signatureScript: script.data, sequence: nSequence ) transactionInputs.append(txIn) uTxOutMap.set(txHashBuf: txHashBuffer, txOutNum: txOutNum, txOut: txOut) return self } @discardableResult public func addSigOperation(_ txHashBuf: Data, txOutNum: UInt32, nScriptChunk: UInt32, type: SigOperation.OperationType, addressString: String, nHashType: SighashType) -> Self { sigOperations.addOne(txHashBuf: txHashBuf, txOutNum: txOutNum, nScriptChunk: nScriptChunk, addressString: addressString, nHashType: nHashType) return self } @discardableResult public func inputFromPubKeyHash(txHashBuffer: Data, txOutNum: UInt32, txOut: TransactionOutput, pubKey: PublicKey, nSequence: UInt32 = 0xffffffff, nHashType: SighashType = SighashType.BSV.ALL) -> Self { let transactionInput = TransactionInput.fromPubKeyHashOut( txHashBuf: txHashBuffer, txOutNum: txOutNum, txOut: txOut, pubKey: pubKey ) transactionInputs.append(transactionInput) uTxOutMap.set(txHashBuf: txHashBuffer, txOutNum: txOutNum, txOut: txOut) let addressString = pubKey.address.toString() addSigOperation(txHashBuffer, txOutNum: txOutNum, nScriptChunk: 0, type: .sig, addressString: addressString, nHashType: nHashType) addSigOperation(txHashBuffer, txOutNum: txOutNum, nScriptChunk: 1, type: .pubkey, addressString: addressString, nHashType: nHashType) return self } @discardableResult public func outputToAddress(value: UInt64, address: Address) -> Self { let script: Script = Script.buildPublicKeyHashOut(pubKeyHash: address.hashBuffer) outputToScript(value: value, script: script) return self } @discardableResult public func outputToScript(value: UInt64, script: Script) -> Self { let txOut = TransactionOutput(value: value, lockingScript: script.data) transactionOutputs.append(txOut) return self } /// Add the outputs to the transaction and return the total amount func buildOutputs() -> UInt64 { var totalOutputValue = UInt64() for txOut in transactionOutputs { // TODO: check if output amount is less than dust, and the output is an opreturn. //if (txOut.value < dust && !txOut.script.isOpReturn && !txOut.script.isSafeDataOut) { // throw error! // totalOutputValue += txOut.value transaction.addTransactionOutput(txOut) } return totalOutputValue } func buildInputs(outAmount: UInt64, extraInputsNum: UInt32 = 0) -> UInt64 { var totalInputAmount = UInt64() var extraInputsNum = extraInputsNum for txIn in transactionInputs { if let txOut = uTxOutMap.get(txHashBuf: txIn.previousOutput.hash, txOutNum: txIn.previousOutput.index) { totalInputAmount += txOut.value transaction.addTransactionInput(txIn) if totalInputAmount >= outAmount { if extraInputsNum <= 0 { break } extraInputsNum -= 1 } } else { fatalError("TxBuilder: Missing txOut in uTxOutMap") } } return totalInputAmount } // Thanks to SigOperations, if those are accurately used, then we can // accurately estimate what the size of the transaction is going to be once // all the signatures and public keys are inserted. func estimateSize() -> Int { // largest possible sig size. final 1 is for pushdata at start. second to // final is sighash byte. the rest are DER encoding. let sigSize = 1 + 1 + 1 + 1 + 32 + 1 + 1 + 32 + 1 + 1 // length of script, y odd, x value - assumes compressed public key let pubKeySize = 1 + 1 + 33 var size = transaction.serialized().count for txIn in transactionInputs { let sigOperations = self.sigOperations.get(txHashBuf: txIn.previousOutput.hash, txOutNum: txIn.previousOutput.index) ?? [] for sigOperation in sigOperations { size -= Int(txIn.scriptLength.underlyingValue) switch sigOperation.type { case .pubkey: size += pubKeySize case .sig: size += sigSize } } } size += 1 // assume txInsVi increases by 1 byte return size } func estimateFee(extraFeeAmount: UInt64 = 0) -> UInt64 { // new style pays lower fees - rounds up to satoshi, not per kb: let fee = Float(estimateSize()) / 1000 * feePerKbNum return UInt64(fee) + extraFeeAmount } @discardableResult public func build(useAllInputs: Bool) throws -> TxBuilder { var minFeeAmount = UInt64() self.changeAmount = 0 if transactionInputs.count <= 0 { throw TxBuilderError.invalidNumberOfInputs } guard let changeScript = changeScript else { throw TxBuilderError.missingChangeOutput } var extraInputsNum = useAllInputs ? UInt32(transactionInputs.count - 1) : 0 while (extraInputsNum < transactionInputs.count) { transaction = Transaction.empty let outputAmount = buildOutputs() // Add temporary change output transaction. let changeTxOut = TransactionOutput(value: changeAmount!, lockingScript: changeScript.data) transaction.addTransactionOutput(changeTxOut) let inputAmount = buildInputs(outAmount: outputAmount, extraInputsNum: extraInputsNum) // Set change amount from inAmountBn - outAmountBn changeAmount = inputAmount - outputAmount minFeeAmount = estimateFee() if changeAmount! >= minFeeAmount && (changeAmount! - minFeeAmount) > dust { break } extraInputsNum += 1 } // Calculate fee and change if changeAmount! >= minFeeAmount { // Subtract fee from change feeAmount = minFeeAmount changeAmount = changeAmount! - feeAmount // Recreate the change transaction output with the correct fee _ = transaction.removeLastTransactionOutput() let changeTxOut = TransactionOutput(value: changeAmount!, lockingScript: changeScript.data) transaction.addTransactionOutput(changeTxOut) // Check change amount is valid if changeAmount! < dust { if dustChangeToFees { // Remove the change output since it is less that dust and the // builder has requested that dust be sent to fees _ = transaction.removeLastTransactionOutput() feeAmount += changeAmount! changeAmount = 0 } else { throw TxBuilderError.changeOutputLessThanDust } } transaction.setLockTime(nLockTime) transaction.setVersion(version) if transaction.outputs.count == 0 { throw TxBuilderError.invalidNumberOfOutputs } return self } else { // not enough input for outputs and fees throw TxBuilderError.inputAmountLessThanOutputAmount } } // MARK: - Signatures func getSig(privateKey: PrivateKey, sighashType: SighashType = SighashType.BSV.ALL, nIn: Int, subScript: Script, signatureVersion: SignatureVersion = .forkId) -> Data { var value = UInt64() if sighashType.hasForkId && signatureVersion == .forkId { let txHashBuf = transactionInputs[nIn].previousOutput.hash let txOutNum = transactionInputs[nIn].previousOutput.index if let txOut = uTxOutMap.get(txHashBuf: txHashBuf, txOutNum: txOutNum) { value = txOut.value } } return transaction.sign(privateKey: privateKey, sighashType: sighashType, nIn: nIn, subScript: subScript, value: value, signatureVersion: signatureVersion) } /// Sign the input with the private key. Only supports PayToPublicKeyHash inputs @discardableResult public func signInTx(nIn: Int, privateKey: PrivateKey, txOut: TransactionOutput? = nil, nScriptChunk: Int? = nil, sighashType: SighashType = SighashType.BSV.ALL, signatureVersion: SignatureVersion = .forkId) -> Self { var nScriptChunk = nScriptChunk let txIn = transaction.inputs[nIn] let script = Script(data: txIn.signatureScript)! if nScriptChunk == nil && script.isPubKeyHashIn { nScriptChunk = 0 } guard let scriptChunk = nScriptChunk else { fatalError() } let txHashBuf = txIn.previousOutput.hash let txOutNum = txIn.previousOutput.index var txOut = txOut if txOut == nil { txOut = uTxOutMap.get(txHashBuf: txHashBuf, txOutNum: txOutNum) } if txOut == nil { fatalError() } let outputScript = txOut!.lockingScript let subScript = Script(data: outputScript)! let sig = getSig(privateKey: privateKey, sighashType: sighashType, nIn: nIn, subScript: subScript, signatureVersion: signatureVersion) fillSig(nIn: nIn, nScriptChunk: scriptChunk, sig: sig, sighashType: sighashType, publicKey: privateKey.publicKey) return self } func fillSig(nIn: Int, nScriptChunk: Int, sig: Data, sighashType: SighashType, publicKey: PublicKey) { transaction.fillSig(nIn: nIn, nScriptChunk: nScriptChunk, sig: sig, sighashType: sighashType, publicKey: publicKey) } }
[ -1 ]
ef06723200d534e8cb46d4754f87fd58ba8abb3d
cac1289e83cbb97817e6b65b1107448a75492031
/ZFJVoiceDemo/ZFJVoiceDemoTests/ZFJVoiceDemoTests.swift
ef30f28ba35b743b86827f96a3e87110365f2730
[]
no_license
zfj1128/ZFJVoiceDemo
09106da742feaa161970540c686dd9de653ff020
3c1a7769c53df4ff064ed7ac14e69fcb09872f29
refs/heads/master
2021-01-21T11:40:14.425127
2017-05-20T04:03:09
2017-05-20T04:03:09
91,752,121
0
0
null
null
null
null
UTF-8
Swift
false
false
978
swift
// // ZFJVoiceDemoTests.swift // ZFJVoiceDemoTests // // Created by ZFJ on 2017/5/19. // Copyright © 2017年 ZFJ. All rights reserved. // import XCTest @testable import ZFJVoiceDemo class ZFJVoiceDemoTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 360462, 98333, 16419, 229413, 204840, 278570, 344107, 155694, 253999, 229424, 229430, 319542, 163896, 180280, 352315, 376894, 286788, 352326, 311372, 196691, 278615, 385116, 237663, 254048, 319591, 131178, 278634, 221290, 319598, 352368, 204916, 131191, 237689, 131198, 278655, 311438, 278677, 196760, 426138, 278685, 311458, 278691, 49316, 32941, 278704, 377009, 278708, 131256, 278714, 295098, 139479, 254170, 229597, 311519, 205035, 286958, 327929, 344313, 147717, 368905, 180493, 254226, 368916, 262421, 377114, 278816, 237857, 237856, 311597, 98610, 180535, 336183, 278842, 287041, 139589, 319813, 311621, 319821, 254286, 344401, 377169, 368981, 155990, 368984, 106847, 98657, 270701, 246127, 270706, 139640, 246136, 106874, 246137, 311681, 311685, 106888, 385417, 385422, 213403, 385454, 377264, 278970, 311738, 33211, 319930, 336317, 336320, 311745, 278978, 254406, 188871, 278989, 278993, 278999, 328152, 369116, 188894, 287198, 279008, 279013, 279018, 319981, 279029, 254456, 279032, 377338, 377343, 279039, 254465, 287241, 279050, 139792, 303636, 393751, 254488, 279065, 377376, 180771, 377386, 197167, 385588, 279094, 352829, 115270, 385615, 426576, 369235, 295519, 139872, 66150, 344680, 279146, 295536, 139892, 287352, 344696, 279164, 189057, 311941, 336518, 279177, 369289, 311945, 344715, 311949, 287374, 377489, 311954, 352917, 230040, 271000, 377497, 303771, 377500, 205471, 344738, 139939, 279206, 295590, 287404, 205487, 303793, 336564, 164533, 287417, 287422, 66242, 377539, 287439, 164560, 385747, 279252, 361176, 418520, 287452, 295652, 369385, 312047, 279280, 312052, 230134, 172792, 344827, 221948, 205568, 295682, 197386, 434957, 295697, 426774, 197399, 426775, 336671, 344865, 197411, 279336, 262954, 295724, 353069, 197422, 353070, 164656, 303920, 262962, 295729, 312108, 328499, 353078, 230199, 353079, 197431, 336702, 353094, 353095, 353109, 377686, 230234, 189275, 435039, 295776, 303972, 385893, 230248, 246641, 246643, 295798, 246648, 279417, 361337, 254850, 369538, 287622, 295824, 189348, 279464, 353195, 140204, 353197, 377772, 304051, 230332, 189374, 377790, 353215, 353216, 213957, 213960, 345033, 279498, 386006, 418776, 50143, 123881, 320493, 320494, 304110, 287731, 271350, 295927, 304122, 320507, 328700, 328706, 410627, 320516, 295942, 386056, 353290, 230410, 377869, 320527, 238610, 418837, 140310, 197657, 336929, 369701, 345132, 238639, 312373, 238651, 377926, 238664, 296019, 353367, 156764, 156765, 304222, 230499, 279660, 173166, 377972, 353397, 377983, 279685, 402565, 222343, 386189, 296086, 238743, 296092, 238765, 279728, 238769, 402613, 279747, 353479, 353481, 353482, 402634, 279760, 189652, 279765, 189653, 419029, 148696, 296153, 279774, 304351, 304356, 222440, 279785, 328940, 279792, 353523, 386294, 386301, 320770, 386306, 279814, 328971, 312587, 353551, 173334, 320796, 222494, 353584, 345396, 386359, 116026, 378172, 222524, 279875, 312648, 337225, 304456, 230729, 296270, 238927, 353616, 296273, 222559, 378209, 230756, 386412, 230765, 279920, 312689, 296307, 116084, 337281, 148867, 378244, 296329, 296335, 9619, 370071, 279974, 173491, 304564, 279989, 353719, 361927, 296392, 280010, 370123, 148940, 280013, 312782, 222675, 353750, 280032, 271843, 280041, 361963, 296433, 321009, 280055, 288249, 296448, 230921, 329225, 296461, 304656, 329232, 370197, 402985, 394794, 230959, 288309, 312889, 288318, 280130, 124485, 288326, 288327, 280147, 239198, 157281, 99938, 312940, 222832, 247416, 337534, 337535, 263809, 239237, 288392, 239250, 419478, 345752, 255649, 337591, 321207, 296632, 280251, 280257, 321219, 280267, 403148, 9936, 9937, 370388, 272085, 345814, 280278, 280280, 18138, 67292, 345821, 321247, 321249, 345833, 345834, 280300, 239341, 67315, 173814, 313081, 124669, 288512, 288516, 280327, 280329, 321302, 345879, 116505, 321310, 255776, 247590, 362283, 378668, 296755, 321337, 280380, 345919, 436031, 403267, 280392, 345929, 304977, 255829, 18262, 362327, 280410, 370522, 345951, 362337, 345955, 296806, 288619, 288620, 214895, 313199, 362352, 313203, 124798, 182144, 305026, 67463, 329622, 337815, 124824, 214937, 214938, 239514, 436131, 354212, 436137, 362417, 124852, 288697, 362431, 214977, 280514, 280519, 214984, 362443, 247757, 346067, 280541, 329695, 436191, 313319, 337895, 247785, 296941, 436205, 329712, 362480, 313339, 43014, 354316, 313357, 182296, 239650, 223268, 354345, 223274, 124975, 346162, 124984, 288828, 436285, 288833, 288834, 436292, 403525, 436301, 338001, 354385, 338003, 223316, 280661, 329814, 338007, 354393, 280675, 280677, 43110, 313447, 321637, 436329, 288879, 223350, 280694, 215164, 313469, 215166, 280712, 215178, 346271, 436383, 362659, 239793, 125109, 182456, 223419, 379071, 149703, 338119, 280778, 346314, 321745, 280795, 387296, 280802, 379106, 338150, 346346, 321772, 125169, 338164, 436470, 125183, 149760, 411906, 125188, 313608, 125193, 125198, 272658, 125203, 125208, 305440, 125217, 338218, 321840, 379186, 125235, 280887, 125240, 321860, 280902, 182598, 289110, 215385, 272729, 379225, 321894, 280939, 313713, 354676, 199029, 436608, 362881, 240002, 436611, 248194, 395659, 395661, 108944, 240016, 190871, 149916, 420253, 141728, 289189, 108972, 272813, 338356, 436661, 281040, 289232, 256477, 281072, 174593, 420369, 289304, 207393, 182817, 289332, 174648, 338489, 338490, 322120, 281166, 281171, 297560, 354911, 436832, 436834, 191082, 313966, 281199, 420463, 346737, 313971, 346740, 420471, 330379, 330387, 117396, 346772, 330388, 264856, 314009, 289434, 346779, 338613, 166582, 314040, 158394, 363211, 289502, 363230, 264928, 338662, 330474, 346858, 289518, 125684, 199414, 35583, 363263, 322316, 117517, 322319, 166676, 207640, 289576, 191283, 273207, 289598, 281408, 420677, 355146, 355152, 355154, 281427, 281433, 355165, 355178, 330609, 207732, 158593, 240518, 224145, 355217, 256922, 289690, 420773, 289703, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 338899, 330708, 248796, 248797, 207838, 347103, 314342, 289774, 183279, 347123, 240630, 314362, 257024, 330754, 322570, 330763, 281626, 248872, 322612, 314448, 339030, 281697, 314467, 281700, 257125, 322663, 281706, 207979, 273515, 404593, 363641, 363644, 150657, 248961, 330888, 363669, 339100, 380061, 339102, 199839, 429214, 306338, 265379, 249002, 306346, 3246, 421048, 339130, 265412, 290000, 298208, 298212, 298213, 330984, 298221, 298228, 216315, 208124, 388349, 363771, 437505, 322824, 257305, 126237, 339234, 109861, 372009, 412971, 298291, 306494, 216386, 224586, 372043, 331090, 314710, 372054, 159066, 314720, 314728, 380271, 314739, 208244, 314741, 249204, 290173, 306559, 314751, 298374, 314758, 314760, 142729, 388487, 314766, 306579, 282007, 290207, 314783, 314789, 314791, 282024, 396711, 396712, 241066, 380337, 380338, 150965, 380357, 339398, 306631, 306639, 413137, 429542, 191981, 306673, 306677, 290300, 290301, 282114, 372227, 306692, 306693, 323080, 323087, 282129, 175639, 282136, 388632, 396827, 282141, 134686, 282146, 306723, 347694, 290358, 265798, 282183, 265804, 396882, 290390, 44635, 396895, 323172, 282213, 323178, 224883, 314998, 323196, 175741, 339584, 224901, 282245, 282246, 290443, 323217, 282259, 298654, 282271, 282273, 282276, 298661, 323236, 290471, 282280, 298667, 224946, 110268, 224958, 282303, 274115, 306890, 241361, 298712, 298720, 12010, 282348, 282358, 282369, 175873, 339715, 323331, 323332, 339720, 372496, 323346, 282391, 249626, 282400, 339745, 241441, 257830, 421672, 282409, 282417, 282427, 315202, 307011, 307025, 413521, 216918, 307031, 241495, 282480, 241528, 339841, 282504, 315273, 315274, 110480, 184208, 372626, 380821, 282518, 282519, 118685, 298909, 298920, 323507, 290745, 290746, 274371, 151497, 372701, 298980, 380908, 282612, 290811, 282633, 241692, 102437, 315432, 233517, 102445, 176175, 241716, 225351, 315465, 315476, 307289, 200794, 315487, 356447, 45153, 438377, 315498, 299121, 233589, 233590, 266357, 422019, 241808, 381073, 323729, 233636, 299174, 233642, 405687, 184505, 299198, 258239, 389313, 299203, 299209, 372941, 282831, 266449, 356576, 176362, 307435, 438511, 381172, 184570, 184575, 381208, 299293, 151839, 233762, 217380, 151847, 282919, 332083, 332085, 332089, 315706, 282939, 307517, 241986, 438596, 332101, 323913, 348492, 323916, 323920, 250192, 348500, 168281, 332123, 323935, 332127, 242023, 242029, 160110, 242033, 291192, 340357, 225670, 332167, 242058, 373134, 291224, 242078, 283038, 61857, 315810, 61859, 315811, 381347, 340398, 299441, 61873, 61880, 283064, 127427, 127428, 283075, 324039, 373197, 176601, 242139, 160225, 242148, 291311, 233978, 291333, 340490, 283153, 258581, 291358, 283182, 283184, 234036, 234040, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 340558, 381517, 332378, 201308, 111208, 184940, 373358, 389745, 209530, 373375, 152195, 348806, 152203, 184973, 316049, 316053, 111253, 111258, 111259, 176808, 299699, 299700, 422596, 422599, 291530, 225995, 242386, 422617, 422626, 234217, 299759, 299770, 299776, 242433, 291585, 430849, 291592, 62220, 422673, 430865, 291604, 422680, 234277, 283430, 152365, 422703, 422709, 152374, 242485, 160571, 430910, 160575, 160580, 299849, 283467, 381773, 201551, 242529, 349026, 357218, 275303, 177001, 308076, 242541, 209783, 209785, 177019, 185211, 308092, 398206, 291712, 381829, 316298, 308107, 308112, 349072, 234386, 209817, 324506, 324507, 390045, 185250, 324517, 283558, 185254, 316333, 316343, 373687, 349121, 373706, 316364, 340955, 340961, 324586, 340974, 316405, 349175, 201720, 127992, 357379, 234500, 324625, 234514, 308243, 316437, 201755, 300068, 357414, 300084, 324666, 308287, 21569, 218186, 300111, 234577, 341073, 439384, 234587, 250981, 300135, 316520, 300136, 316526, 357486, 144496, 300146, 300150, 300151, 291959, 160891, 341115, 300158, 349316, 349318, 373903, 169104, 177296, 308372, 185493, 283802, 119962, 300187, 300188, 300201, 300202, 373945, 283840, 259268, 283847, 62665, 283852, 283853, 259280, 316627, 333011, 357595, 234733, 292085, 234742, 292091, 128251, 316669, 439562, 292107, 242954, 414990, 251153, 177428, 349462, 382258, 300343, 382269, 193859, 300359, 234827, 177484, 406861, 259406, 234831, 251213, 120148, 283991, 374109, 292195, 333160, 284014, 243056, 316787, 357762, 112017, 234898, 259475, 275859, 112018, 357786, 251298, 333220, 316842, 374191, 210358, 284089, 292283, 415171, 300487, 300489, 366037, 210390, 210391, 210392, 210393, 144867, 54765, 251378, 308723, 300535, 300536, 300542, 210433, 366083, 259599, 316946, 308756, 398869, 374296, 374299, 308764, 349726, 431649, 349741, 169518, 431663, 194110, 235070, 349763, 218696, 292425, 243274, 128587, 333388, 333393, 349781, 300630, 128599, 235095, 333408, 374372, 300644, 317032, 415338, 243307, 54893, 325231, 366203, 325245, 194180, 415375, 153251, 300714, 210603, 415420, 333503, 218819, 259781, 333517, 333520, 333521, 333523, 325346, 153319, 325352, 284401, 325371, 194303, 194304, 300811, 284429, 243472, 366360, 284442, 325404, 325410, 341796, 399147, 431916, 317232, 300848, 259899, 325439, 153415, 341836, 415567, 325457, 317269, 341847, 284507, 350044, 128862, 284512, 284514, 276327, 292712, 325484, 423789, 292720, 325492, 276341, 300918, 341879, 317304, 333688, 194429, 112509, 55167, 325503, 333701, 243591, 350093, 325518, 243597, 333722, 350109, 300963, 292771, 333735, 415655, 284587, 292782, 317360, 243637, 301008, 153554, 194515, 219101, 292836, 292837, 317415, 325619, 432116, 333817, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 292902, 227370, 325674, 129076, 243767, 358456, 309345, 227428, 194666, 260207, 432240, 284788, 333940, 292988, 292992, 194691, 227460, 333955, 415881, 104587, 235662, 325776, 317587, 284826, 333991, 333992, 284842, 301251, 309444, 227548, 194782, 301279, 317664, 243962, 375039, 309503, 375051, 325905, 325912, 211235, 432421, 211238, 358703, 358709, 260418, 6481, 366930, 366929, 6489, 391520, 383332, 383336, 285040, 211326, 317831, 227725, 252308, 178582, 293274, 39324, 121245, 317852, 285090, 375207, 342450, 334260, 293303, 293310, 416197, 129483, 342476, 317901, 326100, 285150, 342498, 358882, 334309, 195045, 391655, 432618, 375276, 301571, 342536, 342553, 416286, 375333, 244269, 375343, 236081, 23092, 375351, 244281, 301638, 309830, 293448, 55881, 416341, 309846, 244310, 416351, 268899, 39530, 301689, 244347, 326287, 375440, 334481, 227990, 318106, 318107, 342682, 285361, 342706, 318130, 293556, 383667, 342713, 285373, 39614, 154316, 96984, 318173, 375526, 285415, 342762, 342763, 293612, 154359, 432893, 162561, 285444, 383754, 310036, 326429, 293664, 326433, 400166, 293672, 318250, 318252, 285487, 301871, 375609, 252741, 318278, 293711, 244568, 244570, 301918, 293730, 351077, 342887, 400239, 211829, 269178, 211836, 400252, 359298, 359299, 260996, 113542, 416646, 228233, 228234, 392074, 56208, 293781, 400283, 318364, 310176, 310178, 293800, 236461, 293806, 252847, 326581, 326587, 326601, 359381, 433115, 343005, 130016, 64485, 326635, 203757, 187374, 383983, 318461, 293886, 293893, 433165, 384016, 146448, 433174, 326685, 252958, 252980, 203830, 359478, 302139, 359495, 302177, 392290, 253029, 285798, 228458, 15471, 351344, 187506, 285814, 392318, 187521, 384131, 302216, 228491, 228493, 285838, 162961, 326804, 351390, 302240, 343203, 253099, 253100, 318639, 294068, 367799, 113850, 294074, 64700, 302274, 367810, 343234, 244940, 228563, 195808, 310497, 228588, 253167, 302325, 261377, 228609, 245019, 253216, 130338, 130343, 261425, 351537, 286013, 286018, 294218, 146762, 294219, 318805, 425304, 294243, 163175, 327024, 327025, 327031, 318848, 253317, 384393, 368011, 318864, 318868, 318875, 310692, 245161, 286129, 286132, 228795, 425405, 302529, 302531, 163268, 425418, 310732, 302540, 64975, 310736, 327121, 228827, 286172, 310757, 187878, 343542, 343543, 286202, 359930, 286205, 302590, 294400, 228867, 253451, 253452, 359950, 146964, 253463, 286244, 245287, 245292, 286254, 425535, 196164, 56902, 228943, 286288, 179801, 196187, 343647, 310889, 204397, 138863, 188016, 294529, 286343, 229001, 310923, 188048, 425626, 229020, 302754, 245412, 229029, 40613, 40614, 40615, 286388, 286391, 384695, 319162, 327358, 286399, 302797, 212685, 212688, 384720, 302802, 245457, 278233, 278234, 294622, 278240, 212716, 212717, 360177, 286459, 278272, 319233, 360195, 278291, 278293, 294678, 286494, 294700, 409394, 319292, 360252, 360264, 188251, 376669, 245599, 237408, 425825, 425833, 417654, 188292, 253829, 294807, 294809, 376732, 294814, 311199, 319392, 294823, 327596, 294843, 188348, 98239, 237504, 294850, 384964, 163781, 344013, 212942, 212946, 24532, 294886, 253929, 327661, 278512, 311281, 311282 ]
bc7d957b540aacb49d351fb13f5e89e6bb397ddf
f64c0f0b5df38e4b71d662a9844bbb97944a4b80
/PitchPerfect/PitchPerfect/RecordSoundsViewController.swift
9618ec7bb6d97498ad90856544cc07e8a2d4c385
[]
no_license
jk796/Pitch-Perfect
ae02765ab929cbddf5871c6599d70e8d7998bfee
cd7ba496148e99908ed966e0255e4587218a7295
refs/heads/main
2023-03-19T03:59:43.669453
2021-03-16T09:23:30
2021-03-16T09:23:30
347,251,660
0
0
null
2021-03-16T09:23:31
2021-03-13T02:24:12
Swift
UTF-8
Swift
false
false
2,614
swift
// // RecordSoundsViewController.swift // PitchPerfect // // Created by Jimin Kim on 10/31/20. // Copyright © 2020 Jimin Kim. All rights reserved. // import UIKit import AVFoundation class RecordSoundsViewViewController: UIViewController, AVAudioRecorderDelegate { var audioRecorder: AVAudioRecorder! @IBOutlet weak var recordingLabel: UILabel! @IBOutlet weak var recordButton: UIButton! @IBOutlet weak var stopRecordingButton: UIButton! override func viewDidLoad() { super.viewDidLoad() stopRecordingButton.isEnabled = false } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) print("viewWillAppear called") } @IBAction func recordAudio(_ sender: Any) { recordingLabel.text = "Recording in Progress" stopRecordingButton.isEnabled = true recordButton.isEnabled = false let dirPath = NSSearchPathForDirectoriesInDomains(.documentDirectory,.userDomainMask, true)[0] as String let recordingName = "recordedVoice.wav" let pathArray = [dirPath, recordingName] let filePath = URL(string: pathArray.joined(separator: "/")) let session = AVAudioSession.sharedInstance() try! session.setCategory(AVAudioSession.Category.playAndRecord, mode: AVAudioSession.Mode.default, options: AVAudioSession.CategoryOptions.defaultToSpeaker) try! audioRecorder = AVAudioRecorder(url: filePath!, settings: [:]) audioRecorder.delegate = self audioRecorder.isMeteringEnabled = true audioRecorder.prepareToRecord() audioRecorder.record() } @IBAction func stopRecording(_ sender: Any) { recordButton.isEnabled = true stopRecordingButton.isEnabled = false recordingLabel.text = "Tap to Record" audioRecorder.stop() let audioSession = AVAudioSession.sharedInstance() try! audioSession.setActive(false) } func audioRecorderDidFinishRecording(_ recorder: AVAudioRecorder, successfully flag: Bool) { if flag { performSegue(withIdentifier: "stopRecording", sender: audioRecorder.url) } else { print("recording was not successful") } } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "stopRecording" { let playSoundsVC = segue.destination as! PlaySoundsViewController let recordedAudioURL = sender as! URL playSoundsVC.recordedAudioURL = recordedAudioURL } } }
[ 289216, 336706, 237691, 366989, 307383, 296635, 230173 ]
74350f822f57c3dfdb95fdfd1e10aad614b7e602
2913e9ef56a16d62188ebca92a1c0187c59a8a7e
/Tests/SwiftSyntaxBuilderTest/IntegerLiteralTests.swift
b6d3ea792b44cdc20b3348836544d0ccea0e1134
[ "Apache-2.0", "Swift-exception" ]
permissive
phausler/swift-syntax
ce554c1e69a35adb27e78bd6ab0a3af692af441f
d8aa974f0532d7f0ce42b87afe476d5e4e9211ab
refs/heads/main
2023-02-17T08:09:03.819285
2021-01-21T07:37:14
2021-01-21T07:37:14
332,071,446
1
0
Apache-2.0
2021-01-22T21:56:46
2021-01-22T21:56:46
null
UTF-8
Swift
false
false
688
swift
import XCTest import SwiftSyntax import SwiftSyntaxBuilder final class IntegerLiteralTests: XCTestCase { func testIntegerLiteral() { let leadingTrivia = Trivia.garbageText("␣") let testCases: [UInt: (IntegerLiteral, String)] = [ #line: (IntegerLiteral(123), "␣123"), #line: (IntegerLiteral(-123), "␣-123"), #line: (123, "␣123"), #line: (-123, "␣-123"), ] for (line, testCase) in testCases { let (builder, expected) = testCase let syntax = builder.buildSyntax(format: Format(), leadingTrivia: leadingTrivia) var text = "" syntax.write(to: &text) XCTAssertEqual(text, expected, line: line) } } }
[ -1 ]
abd3ac0bf12b81c5f8c9222524f65a27df09394a
6d5f3c4f91b00f19c819c30e606cf85097bd3050
/PlaygroundBook/Chapters/Chapter1.playgroundchapter/Pages/Page2.playgroundpage/main.swift
b812334efef8c4bace0b44a8275ffec9f64a9db6
[]
no_license
viniciusmesquitac/MusicPerceptron
162ae223f5ff860b248eab0a62c7302e705cc95e
aa9334c09cdec6162aa7643ed66fdf02999bfe2a
refs/heads/master
2022-07-06T10:28:22.072583
2020-05-18T23:42:53
2020-05-18T23:42:53
264,173,901
3
0
null
null
null
null
UTF-8
Swift
false
false
1,463
swift
//#-hidden-code // // See LICENSE folder for this template’s licensing information. // // Abstract: // The Swift file containing the source code edited by the user of this playground book. // import PlaygroundSupport import SpriteKit import BookCore public typealias Velocity = Float func addSongToDatabase(_ songs: [Song]) { let coder = JSONEncoder() do { let data = try coder.encode(songs) if let liveView = PlaygroundPage.current.liveView as? PlaygroundRemoteLiveViewProxy { liveView.send(.data(data)) } } catch { } } //#-code-completion(everything, hide) //#-code-completion(identifier, show, Song) //#-end-hidden-code /*: In the collect data step you should help your model to know which music notes exist, it is also important to say that the instruments reproduce unique sounds, so make sure that your model knows all the notes of most instruments! * Experiment: update your [`dataset`](glossary://Dataset) to joe understand more about music, try to choose the corrent note in the process this will get better scores, if you chose an wrong note, you will createn an [`outlier`](glossary://Outlier), they are bad for your Machine Learning */ addSongToDatabase([ //#-editable-code Song(from: .beethoven, instrument: .piano), //#-end-editable-code ]) /*: [Next Page: Training](@next) */
[ -1 ]
17afecb7f5296c56edc1bdb5b0f5f8f43c29817a
8d0972eed6214b8800f77e6e5b7bc5c2b20ad71a
/commerce/Main_ViewController.swift
b6c319d2d9d991d897d15c59428fd112c3516f21
[]
no_license
SyedArifulIslamEmon/commerce_dev
2b3209939ca4f2f8447c686947a9b07096d6a85c
44cd3b3ac585ed37437887820b5c50ad2b7d16c6
refs/heads/master
2021-01-19T19:41:06.972669
2015-11-15T05:19:50
2015-11-15T05:19:50
null
0
0
null
null
null
null
UTF-8
Swift
false
false
165
swift
// // Main_ViewController.swift // commerce // // Created by jigwan on 2015. 11. 3.. // Copyright © 2015년 STRUCEL. All rights reserved. // import Foundation
[ -1 ]
294ab6148f57249cf2da24af5ff4581c97981aab
92f61b6a9b8cb88ac1599ecf43c8b032ef38d336
/IceCream/Classes/SyncEngine.swift
55483d2689997d9ebad032dc649fce0bc2e34749
[ "MIT" ]
permissive
liakhandrii/IceCream
a27195dfd8f9b1d359c636a62ded0f24a8919969
2e4941f1e895be19c101f01917df8d406428d906
refs/heads/master
2020-07-16T22:32:53.420618
2020-01-15T14:54:04
2020-01-15T14:54:04
205,882,185
0
0
MIT
2020-01-15T14:17:03
2019-09-02T15:08:45
Swift
UTF-8
Swift
false
false
4,505
swift
// // SyncEngine.swift // IceCream // // Created by 蔡越 on 08/11/2017. // import CloudKit /// SyncEngine talks to CloudKit directly. /// Logically, /// 1. it takes care of the operations of **CKDatabase** /// 2. it handles all of the CloudKit config stuffs, such as subscriptions /// 3. it hands over CKRecordZone stuffs to SyncObject so that it can have an effect on local Realm Database public final class SyncEngine { private let databaseManager: DatabaseManager public convenience init(objects: [Syncable], databaseScope: CKDatabase.Scope = .private, container: CKContainer = .default()) { switch databaseScope { case .private: let privateDatabaseManager = PrivateDatabaseManager(objects: objects, container: container) self.init(databaseManager: privateDatabaseManager) case .public: let publicDatabaseManager = PublicDatabaseManager(objects: objects, container: container) self.init(databaseManager: publicDatabaseManager) default: fatalError("Not supported yet") } } private init(databaseManager: DatabaseManager) { self.databaseManager = databaseManager setup() } public func setup() { databaseManager.prepare() databaseManager.container.accountStatus { [weak self] (status, error) in guard let self = self else { return } switch status { case .available: self.databaseManager.registerLocalDatabase() self.databaseManager.createCustomZonesIfAllowed() self.databaseManager.fetchChangesInDatabase(nil) self.databaseManager.resumeLongLivedOperationIfPossible() self.databaseManager.startObservingRemoteChanges() self.databaseManager.startObservingTermination() self.databaseManager.createDatabaseSubscriptionIfHaveNot() case .noAccount, .restricted: guard self.databaseManager is PublicDatabaseManager else { break } self.databaseManager.fetchChangesInDatabase(nil) self.databaseManager.resumeLongLivedOperationIfPossible() self.databaseManager.startObservingRemoteChanges() self.databaseManager.startObservingTermination() self.databaseManager.createDatabaseSubscriptionIfHaveNot() case .couldNotDetermine: break @unknown default: break } } } } // MARK: Public Method extension SyncEngine { /// Fetch data on the CloudKit and merge with local /// /// - Parameter completionHandler: Supported in the `privateCloudDatabase` when the fetch data process completes, completionHandler will be called. The error will be returned when anything wrong happens. Otherwise the error will be `nil`. public func pull(completionHandler: ((Error?) -> Void)? = nil) { databaseManager.fetchChangesInDatabase(completionHandler) } /// Push all existing local data to CloudKit /// You should NOT to call this method too frequently public func pushAll() { databaseManager.syncObjects.forEach { $0.pushLocalObjectsToCloudKit() } } } public enum Notifications: String, NotificationName { case cloudKitDataDidChangeRemotely } public enum IceCreamKey: String { /// Tokens case databaseChangesTokenKey case zoneChangesTokenKey /// Flags case subscriptionIsLocallyCachedKey case hasCustomZoneCreatedKey var value: String { return "icecream.keys." + rawValue } } /// Dangerous part: /// In most cases, you should not change the string value cause it is related to user settings. /// e.g.: the cloudKitSubscriptionID, if you don't want to use "private_changes" and use another string. You should remove the old subsription first. /// Or your user will not save the same subscription again. So you got trouble. /// The right way is remove old subscription first and then save new subscription. public enum IceCreamSubscription: String, CaseIterable { case cloudKitPrivateDatabaseSubscriptionID = "private_changes" case cloudKitPublicDatabaseSubscriptionID = "cloudKitPublicDatabaseSubcriptionID" var id: String { return rawValue } public static var allIDs: [String] { return IceCreamSubscription.allCases.map { $0.rawValue } } }
[ -1 ]
c5056df9ecc84fb5546716763544d7051c0d5da8
dbbfe841da1b6cc5f167b1c40371bd30df133c60
/Dotkun/ViewController/BattleiconCollectionViewController/CreateBattleIconViewController/CreateBattleIconViewController.swift
3c02fcd7b7e91c2d8750c078e758bde02c7a5814
[]
no_license
SakuragiYoshimasa/Dotkun
29c29e4d3e4351213cb44fd04b9f8646d81ec4d6
253aae5b410524bda008feec979b2d6bba96f006
refs/heads/master
2016-08-12T13:15:03.225771
2016-02-22T06:30:28
2016-02-22T06:30:28
45,382,599
1
0
null
2016-02-22T06:30:29
2015-11-02T08:49:13
Swift
UTF-8
Swift
false
false
7,135
swift
// // CreateIconViewController.swift // Dotkun // // Created by 山口智生 on 2015/11/03. // Copyright © 2015年 SakuragiYoshimasa. All rights reserved. // import UIKit class CreateBattleIconViewController: TabBarSlaveViewController { var drawableView: DrawableView! = nil var undoButton: UIButton! = nil var saveButton: UIButton! = nil var clearButton: UIButton! = nil var loadButton: UIButton! = nil var lineWidthSlider: UISlider! = nil var setColorButton: UIButton! = nil override func viewWillAppear(animated: Bool) { self.lineWidthSlider?.value = Float(sqrt(self.drawableView.getLineWidth())) } override func viewDidLoad() { super.viewDidLoad() let buttonWidth = self.view.bounds.width/4 let statusBarHeight = Util.getStatusBarHeight() if drawableView == nil { let drawableViewAreaWidth = CGFloat(Int(min(self.view.bounds.width, self.view.bounds.height - statusBarHeight - 100)/160)*160) drawableView = DrawableView(frame: CGRectMake((self.view.bounds.width-drawableViewAreaWidth)/2, 100 + statusBarHeight, drawableViewAreaWidth, drawableViewAreaWidth)) drawableView.backgroundColor = UIColor.whiteColor() drawableView.delegate = self self.view.addSubview(drawableView) } if undoButton == nil { undoButton = UIButton(frame: CGRectMake(0, statusBarHeight, buttonWidth, 100)) undoButton.backgroundColor = UIColor.yellowColor() undoButton.setTitle("undo", forState: .Normal) undoButton.setTitleColor(UIColor.brownColor(), forState: .Normal) undoButton.addTarget(drawableView, action: "undo", forControlEvents: .TouchUpInside) self.view.addSubview(undoButton) } if loadButton == nil { loadButton = UIButton(frame: CGRectMake(buttonWidth*1, statusBarHeight, buttonWidth, 100)) loadButton.backgroundColor = UIColor.orangeColor() loadButton.setTitle("load", forState: .Normal) loadButton.setTitleColor(UIColor.brownColor(), forState: .Normal) loadButton.addTarget(self, action: "load", forControlEvents: .TouchUpInside) self.view.addSubview(loadButton) } if clearButton == nil { clearButton = UIButton(frame: CGRectMake(buttonWidth*2, statusBarHeight, buttonWidth, 100)) clearButton.backgroundColor = UIColor.greenColor() clearButton.setTitle("clear", forState: .Normal) clearButton.setTitleColor(UIColor.brownColor(), forState: .Normal) clearButton.addTarget(drawableView, action: "clear", forControlEvents: .TouchUpInside) self.view.addSubview(clearButton) } if saveButton == nil { saveButton = UIButton(frame: CGRectMake(buttonWidth*3, statusBarHeight, buttonWidth, 100)) saveButton.backgroundColor = UIColor.cyanColor() saveButton.setTitle("save", forState: .Normal) saveButton.setTitleColor(UIColor.brownColor(), forState: .Normal) saveButton.addTarget(drawableView, action: "save", forControlEvents: .TouchUpInside) self.view.addSubview(saveButton) } if lineWidthSlider == nil { lineWidthSlider = UISlider(frame: CGRectMake(20, self.view.bounds.height - 50 - 25, self.view.bounds.width - 20 - 100, 50)) lineWidthSlider.minimumValue = 1.0 lineWidthSlider.maximumValue = 10.0 lineWidthSlider.addTarget(self, action: "lineWidthChanged:", forControlEvents: .ValueChanged) self.view.addSubview(lineWidthSlider) } if setColorButton == nil { setColorButton = UIButton(frame: CGRect(origin: CGPointZero, size: CGSizeMake(50, 50))) setColorButton.layer.position = CGPointMake(self.view.bounds.width - 50, self.view.bounds.height - 50) setColorButton.backgroundColor = UIColor.redColor() setColorButton.addTarget(self, action: "clickedColorButton:", forControlEvents: .TouchUpInside) self.view.addSubview(setColorButton) } } func clickedColorButton(sender: UIButton!) { let controller = ColorPickerViewController() controller.delegate = self self.presentPopver(controller, sourceView: sender) } func presentPopver(viewController: UIViewController!, sourceView: UIView!) { viewController.modalPresentationStyle = UIModalPresentationStyle.Popover viewController.preferredContentSize = CGSizeMake(300,400) let popoverController = viewController.popoverPresentationController popoverController?.delegate = self // 向き popoverController?.permittedArrowDirections = UIPopoverArrowDirection.Down // どこから出た感じにするか popoverController?.sourceView = sourceView popoverController?.sourceRect = sourceView.bounds self.presentViewController(viewController, animated: true, completion: nil) } func lineWidthChanged(sender: AnyObject?) { self.drawableView.setLineWidth(CGFloat(lineWidthSlider.value * lineWidthSlider.value)) } func load() { if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.PhotoLibrary) { let ipc: UIImagePickerController = UIImagePickerController() ipc.delegate = self ipc.allowsEditing = true ipc.sourceType = UIImagePickerControllerSourceType.PhotoLibrary self.presentViewController(ipc, animated:true, completion:nil) } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() print("memoryWarning") // Dispose of any resources that can be recreated. } } extension CreateBattleIconViewController: DrawableViewDelegate { func onUpdateDrawableView() { } func onFinishSave() { self.dismissViewControllerAnimated(true, completion: nil) } } extension CreateBattleIconViewController: UIImagePickerControllerDelegate { func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage, editingInfo: [String : AnyObject]?) { picker.dismissViewControllerAnimated(true, completion: nil) drawableView.setBackgroundImage(image) } } extension CreateBattleIconViewController: UIPopoverPresentationControllerDelegate, UINavigationControllerDelegate { func adaptivePresentationStyleForPresentationController(controller: UIPresentationController) -> UIModalPresentationStyle { return UIModalPresentationStyle.None } } extension CreateBattleIconViewController: ColorPickerViewDelegate { func onColorChanged(newColor: UIColor) { self.setColorButton.backgroundColor = newColor drawableView.setLineColor(newColor.CGColor) } }
[ -1 ]
e3f5bcb65e3c6d3574e5e04ac07d06ab72b0b3de
4b42fd0ab4151d1bb1060f1e1e0858f5fbe0c716
/DemoApp/Weather/WeatherWorker.swift
49adb4de4d3727dfb3a7304e316988e53fb8a0ff
[]
no_license
sreenureddy/WeatherApp
3938852ed454e9b8562bccdf98da500323934af6
610fe6852c2cee877abc32cbb452e4ab2c94e8f2
refs/heads/master
2021-02-16T06:13:37.076473
2020-03-04T18:41:08
2020-03-04T18:41:08
244,975,561
0
0
null
null
null
null
UTF-8
Swift
false
false
574
swift
// // WeatherWorker.swift // DemoApp // // Created by sreenu ramana on 4/3/20. // Copyright (c) 2020 sreenu ramana. All rights reserved. // import UIKit class WeatherWorker { func getTheWeatherForcastInformation(postParams: Weather.Forecast.Request, completionHandler: @escaping (_ reposne: WeatherResponse?, _ message: String?) -> Void) { let apiManager = APIManager() apiManager.fetchResources(postParameters: postParams) { (weatherReponse, statusMessage) in completionHandler(weatherReponse, statusMessage) } } }
[ -1 ]
5bf6a583e9f8cc30d6d093f34ef9cb38d14d54ee
3eaa0c61e8800f04aa63fe72fc2a45c4fdf303f1
/FirebaseTestApp/AppDelegate.swift
a9b8857492d6504a8e17e5cb4fcf04d65f1f7367
[]
no_license
agachan/SignUpFile
a22342e3a3dd29492e914ae1a0f2df85fc62f1dd
f93f1ca97da24918f5b7a7c2081e47c8c9d5ee7c
refs/heads/master
2022-11-17T14:02:10.034194
2020-06-24T07:25:32
2020-06-24T07:25:32
274,602,967
0
0
null
null
null
null
UTF-8
Swift
false
false
1,475
swift
// // AppDelegate.swift // FirebaseTestApp // // Created by AGA TOMOHIRO on 2020/06/18. // Copyright © 2020 AGA TOMOHIRO. All rights reserved. // import UIKit import Firebase @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { FirebaseApp.configure() // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 213048, 385081, 376889, 393275, 376905, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 286831, 368752, 286844, 417924, 262283, 286879, 286888, 377012, 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, 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, 410128, 393747, 254490, 188958, 385570, 33316, 197159, 377383, 352821, 188987, 418363, 369223, 385609, 385616, 352856, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 148105, 377484, 352918, 98968, 344744, 361129, 385713, 434867, 164534, 336567, 328378, 328386, 352968, 418507, 352971, 352973, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 336643, 344835, 344841, 336659, 418580, 418585, 434970, 369435, 418589, 262942, 418593, 336675, 328484, 418605, 336696, 361273, 328515, 336708, 328519, 336711, 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, 189520, 345169, 156761, 361567, 148578, 345199, 361593, 410745, 361598, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 345267, 386258, 328924, 328941, 386285, 386291, 345376, 345379, 410917, 337205, 345399, 378169, 369978, 337222, 337229, 337234, 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, 214610, 419410, 345701, 394853, 222830, 370297, 353919, 403075, 345736, 198280, 403091, 345749, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 337592, 419512, 337599, 419527, 419530, 419535, 272081, 394966, 419542, 419544, 181977, 345818, 419547, 419550, 419559, 337642, 419563, 337645, 370415, 337659, 337668, 362247, 395021, 362255, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 370509, 354130, 247637, 337750, 370519, 313180, 354142, 345970, 345974, 403320, 354172, 247691, 337808, 247700, 329623, 436126, 436132, 337833, 362413, 337844, 346057, 247759, 346063, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329832, 329855, 329885, 346272, 362660, 100524, 387249, 379066, 387260, 256191, 395466, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 346343, 338152, 387306, 387312, 346355, 436473, 321786, 379134, 411903, 411916, 379152, 395538, 387349, 338199, 387352, 182558, 338211, 248111, 362822, 436555, 190796, 379233, 354673, 321910, 248186, 420236, 379278, 272786, 354727, 338352, 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, 264918, 183005, 256734, 338660, 338664, 264941, 363251, 207619, 338700, 256786, 199452, 363293, 396066, 346916, 396069, 215853, 355122, 355131, 355140, 355143, 338763, 355150, 330580, 355166, 265055, 265058, 355175, 387944, 355179, 330610, 330642, 412599, 207808, 379848, 396245, 330710, 248792, 248798, 347105, 257008, 183282, 330748, 330760, 330768, 248862, 396328, 158761, 396336, 199728, 330800, 396339, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 339036, 412764, 257120, 265320, 248951, 420984, 330889, 248985, 339097, 44197, 380070, 339112, 249014, 330958, 330965, 265436, 388319, 388347, 175375, 175396, 208166, 273708, 372015, 372018, 199988, 44342, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 175450, 437595, 175457, 208227, 175460, 175463, 437620, 175477, 249208, 175483, 249214, 175486, 175489, 249218, 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, 69113, 372228, 208398, 380432, 175635, 339503, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 224897, 372353, 216707, 126596, 421508, 224904, 11918, 159374, 224913, 126610, 224916, 224919, 126616, 208538, 224922, 224926, 224929, 224932, 224936, 257704, 224942, 257712, 257716, 257720, 257724, 257732, 339662, 257747, 224981, 224993, 257761, 224999, 339695, 225020, 339710, 257790, 225025, 257794, 339721, 257801, 257804, 225038, 372499, 167700, 225043, 257819, 225053, 184094, 225058, 339747, 339749, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 397112, 225082, 397115, 225087, 225092, 323402, 257868, 257871, 225103, 397139, 225108, 225112, 257883, 257886, 225119, 257896, 274280, 257901, 225137, 257908, 225141, 257912, 257916, 257920, 339844, 225165, 397200, 225170, 380822, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 405533, 430129, 266294, 266297, 421960, 356439, 430180, 421990, 266350, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 225444, 438436, 225447, 438440, 225450, 258222, 225455, 430256, 225458, 225461, 225466, 389307, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 266453, 225493, 225496, 225499, 225502, 225505, 356578, 225510, 217318, 225514, 225518, 372976, 381176, 397571, 389380, 61722, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 225597, 332097, 201028, 348488, 332106, 332117, 250199, 250202, 332125, 250210, 348522, 348525, 348527, 332152, 250238, 389502, 356740, 332172, 373145, 340379, 389550, 324030, 266687, 340451, 160234, 127471, 340472, 324094, 266754, 324111, 340500, 332324, 381481, 356907, 324142, 356916, 324149, 324155, 348733, 324164, 356934, 348743, 381512, 324173, 324176, 389723, 332380, 373343, 381545, 340627, 373398, 184982, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 373449, 332493, 357069, 357073, 332511, 332520, 340718, 332533, 348924, 373510, 389926, 152370, 340789, 348982, 398139, 127814, 357201, 357206, 389978, 357211, 430939, 357214, 201579, 201582, 349040, 340849, 201588, 430965, 324472, 398201, 119674, 324475, 340858, 340861, 324478, 324481, 373634, 324484, 324487, 381833, 324492, 324495, 324498, 430995, 324501, 324510, 422816, 324513, 398245, 201637, 324524, 340909, 324533, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 209895, 201711, 349172, 349180, 439294, 431106, 209943, 250914, 357410, 209965, 209968, 209971, 209975, 209979, 209987, 209990, 341071, 349267, 250967, 210010, 341091, 210025, 210027, 210030, 210039, 341113, 349308, 210044, 160895, 152703, 349311, 210052, 210055, 349319, 210067, 210071, 210077, 210080, 251044, 210084, 185511, 210088, 210095, 210098, 210107, 210115, 332997, 210127, 333009, 210131, 333014, 210138, 210143, 218354, 251128, 218360, 275706, 275712, 275715, 275721, 333078, 251160, 349484, 349491, 251189, 415033, 251210, 357708, 365911, 259421, 333154, 251235, 374117, 333162, 234866, 390516, 333175, 136590, 112020, 349590, 357792, 259515, 415166, 415185, 366034, 366038, 415191, 415193, 415196, 415199, 423392, 333284, 415207, 366056, 415216, 210420, 415224, 423423, 415257, 415263, 366117, 415270, 144939, 415278, 415281, 415285, 210487, 415290, 415293, 349761, 415300, 333386, 333399, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 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, 399206, 268143, 358255, 399215, 358259, 341876, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 333774, 358371, 350189, 350193, 350202, 333818, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350240, 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, 350467, 325891, 350475, 268559, 350480, 432405, 350486, 325914, 350490, 325917, 350493, 350498, 350504, 358700, 350509, 391468, 358704, 358713, 358716, 383306, 334161, 383321, 383330, 383333, 391530, 383341, 334203, 268668, 194941, 391563, 366990, 416157, 342430, 268701, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 334304, 334311, 375277, 334321, 350723, 186897, 342545, 334358, 342550, 342554, 334363, 358941, 350761, 252461, 383536, 358961, 334384, 334394, 252482, 219718, 334407, 334420, 350822, 334465, 334468, 162445, 326290, 342679, 342683, 260766, 342710, 244409, 260797, 260801, 350917, 391894, 154328, 416473, 64230, 342766, 375535, 203506, 342776, 391937, 375568, 326416, 375571, 162591, 326441, 326451, 326454, 244540, 326460, 375612, 326467, 244551, 326473, 326477, 326485, 416597, 326490, 326502, 375656, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 342915, 400259, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 326598, 359366, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 367723, 384107, 187502, 384114, 343154, 212094, 351364, 384135, 384139, 384143, 351381, 384160, 384168, 367794, 384181, 351423, 384191, 384198, 326855, 244937, 253130, 343244, 146642, 359649, 343270, 351466, 351479, 384249, 343306, 261389, 359694, 253200, 261393, 384275, 245020, 245029, 171302, 351534, 376110, 245040, 384314, 425276, 384323, 212291, 343365, 212303, 367965, 343393, 343398, 367980, 425328, 343409, 154999, 253303, 343417, 327034, 245127, 384397, 245136, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327110, 327115, 327117, 359886, 359890, 343507, 368092, 343534, 343539, 368119, 343544, 368122, 359955, 359983, 343630, 327275, 245357, 138864, 155254, 155273, 368288, 245409, 425638, 155322, 425662, 155327, 155351, 155354, 212699, 155363, 245475, 245483, 155371, 409335, 155393, 155403, 245525, 155422, 360223, 155438, 155442, 155447, 155461, 360261, 376663, 155482, 261981, 425822, 376671, 155487, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 425845, 262005, 147317, 262008, 262011, 155516, 155521, 155525, 360326, 155531, 262027, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 393169, 384977, 155611, 155619, 253923, 155621, 253926, 204784, 393203, 360438, 253943, 393206, 393212, 155646 ]
59f74913306db93a100c4cfab2cb69ccdef7e77c
7e0813bade1fc74c4ae297bb8f7e5958d65a18e8
/PatissierTests/Product/ProductAPIClientTests.swift
45e13c06c4d2c37eed6d1a60166c1d338c7ac4b0
[ "MIT" ]
permissive
youhsuan/PatissierPlus
db1003a3cbce2989a1c743b71f7eb8b41a21b4e5
bd75c70bc228129d0662fa2f11ed784d59a7fefe
refs/heads/master
2021-08-20T05:53:18.007631
2017-11-28T09:39:47
2017-11-28T09:39:47
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,468
swift
// // ProductAPIClientTests.swift // Patissier // // Created by Roy Hsu on 24/06/2017. // Copyright © 2017 TinyWorld. All rights reserved. // // MARK: - ProductAPIClientTests import XCTest @testable import Patissier class ProductAPIClientTests: XCTestCase { func testIndexProducts() { // swiftlint:disable nesting struct StubData { let product: Product let paging: String } // swiftlint:enable nesting let product = Product(id: "123456", name: "Chocolate Cake", price: 120.0) let stubData = StubData( product: product, paging: "nextPage" ) let stubJSON: [String: Any] = [ "data": [ [ "id": stubData.product.id, "name": stubData.product.name, "price": stubData.product.price ] ], "paging": [ "next": stubData.paging ] ] let exception = XCTestExpectation(description: "Index products.") do { let data = try JSONSerialization.data( withJSONObject: stubJSON, options: .prettyPrinted ) let stubHTTPClient = StubHTTPClient( stubHTTPResult: HTTPResult.success(data) ) let productAPIClient: ProductAPIClient = NewAPIClient( router: Router.readProducts(paging: nil), httpClient: stubHTTPClient ) productAPIClient.indexProducts( page: Page.begin, success: { (_, paging) in exception.fulfill() XCTAssertEqual(product, stubData.product) XCTAssertEqual( paging, Page.next(IndexProductsPageToken(rawValue: stubData.paging)) ) }, failure: { error in exception.fulfill() XCTFail("\(error)") } ) } catch { exception.fulfill() XCTFail("\(error)") } wait( for: [ exception ], timeout: 10.0 ) } func testFailToIndexProducts() { let stubHTTPClient = StubHTTPClient( stubHTTPResult: HTTPResult.failure(StubHTTPError.stubError) ) let productAPIClient: ProductAPIClient = NewAPIClient( router: Router.readProducts(paging: nil), httpClient: stubHTTPClient ) let exception = XCTestExpectation(description: "Fail to index products.") productAPIClient.indexProducts( page: Page.begin, success: { (_, _) in exception.fulfill() XCTFail("Success handler should not be excuted in fail to index products.") }, failure: { error in exception.fulfill() guard let error = error as? StubHTTPError else { XCTFail("Error should be StubHTTPError in fail to index products.") return } XCTAssertEqual(error, StubHTTPError.stubError) } ) wait( for: [ exception ], timeout: 10.0 ) } }
[ -1 ]
8a6bf61ab96491b290c1cb319e0aca127016ace9
d27d6d569412bba8ac9d7df2eea1f97f90eb752a
/基础语法/01-变量&常量.playground/section-1.swift
84bcb6fee5343ffd960d0ecaa8bb4cfb5eb7f6c9
[ "Apache-2.0" ]
permissive
Markus-Feng/SwiftLearning
c803966b8ff463d202fea66592d1b1b4917a1c2e
43c0aaaeade9aa4930ed6e223ad4e059a52a1df2
refs/heads/master
2021-01-17T05:21:58.045769
2015-04-05T03:48:29
2015-04-05T03:48:29
null
0
0
null
null
null
null
UTF-8
Swift
false
false
914
swift
// 1. 变量 // `var` 用于定义变量,表示内容可以修改 // Swift中变量类型是根据初始赋值自动推断的 // 以下两个变量是 Int 类型 var intValue1 = 10 intValue1 = 100 var intValue2: Int = 20 var intResult = intValue1 + intValue2 // 定义一个 Double 类型的变量 var doubleValue = 10.5 // 在 Swift 中,不允许对不同数据类型直接进行操作,以下语句会报错 //var result = intValue1 + doubleValue // 操作前,需要指定变量的类型 var doubleResult1 = Double(intValue1) + doubleValue // 或者 var intResult2 = intValue1 + Int(doubleValue) // 2. 常量 // `let` 用于定义常量,表示内容一经设置,不允许修改 // 在实际开发中,为了保证安全,应该尽量先使用 `let`,如果真的确认需要修改,再改为 `var` let constValue = 100 // 以下语句试图修改一个常量,会报错 //constValue = 200
[ -1 ]
7ade5cde7e23deadfb0069249858ffc2ffdb9fdb
c34b15c4314a3048b021d61e1a8922af6ec7e46f
/Package.swift
9754a33abd3a4ff69ef2efcb63843e27697851b7
[ "MIT" ]
permissive
raulriera/xcoder
8f4809ab2f8e8be19a2721ac7b38be84b58871fc
ba2f38f95f2c25ef51166208f890c5c61f60c5e6
refs/heads/master
2022-08-06T22:56:36.146394
2019-10-29T15:57:42
2019-10-29T15:57:42
268,150,919
0
0
MIT
2020-05-30T20:02:41
2020-05-30T20:02:40
null
UTF-8
Swift
false
false
504
swift
// swift-tools-version:5.0 import PackageDescription let package = Package( name: "Xcoder", platforms: [ .macOS(.v10_14) ], products: [ .executable( name: "xcoder", targets: ["xcoder"] ), ], dependencies: [ .package(url: "https://github.com/g-Off/XcodeProject.git", from: "0.5.1"), .package(url: "https://github.com/g-Off/CommandRegistry.git", from: "0.1.2") ], targets: [ .target( name: "xcoder", dependencies: [ "XcodeProject", "CommandRegistry" ] ), ] )
[ -1 ]
1694b5d7e6c058d49bd834a1a86920e4566a7974
1d1a242e247469893cd2554af99f5a8f25155a07
/thanos menu/Sources/MarvelAPI/Endpoints/EventsEndpoint.swift
a8bcd6f8fc829b4e9f9dbcf5cfcc5f25090b291d
[ "MIT" ]
permissive
lmoreton/Thanos-Menu
bbb6ae7bdda15a6dd92466dc55e9a4f02db0eb46
513eefb60cee6d61753ae4e3de15d7f10a1bf913
refs/heads/master
2022-11-26T14:17:28.874468
2020-07-28T14:14:02
2020-07-28T14:14:02
280,891,753
3
0
null
null
null
null
UTF-8
Swift
false
false
752
swift
// // EventsEndpoint.swift // thanos menu // // Created by Lucas Moreton on 26/07/20. // Copyright © 2020 Lucas Moreton. All rights reserved. // import Foundation struct EventsEndpoint: EndpointProtocol { var path: String { return EndpointConfigs.default.path + "/characters/\(characterId)/events" } var method: HTTPMethod { return .get } var header: Header? { return nil } var parameters: Parameters? { var params = EndpointConfigs.default.parameters params["limit"] = limit params["offset"] = offset return params } var body: Body? { return nil } let limit: Int let offset: Int let characterId: Int }
[ -1 ]
2b811108f8ef130ad679cc6a785bc37dc47321f6
c4fef5fcd94d04320f88a7c126b7ee3d133c7ecb
/VideoPlayer/ViewController.swift
9d1a4c2c8d7785f4317c426d18596937545374db
[]
no_license
douglas1206/VideoPlayer
34717fe022bf72562ed06b396bf47583c3a281a9
c5874caaac9e7eecc346bb487a5a6cb00ee164e8
refs/heads/master
2021-01-18T10:41:05.854140
2015-01-29T23:12:53
2015-01-29T23:12:53
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,813
swift
// // ViewController.swift // VideoPlayer // // Created by messel on 8/22/14. // Copyright (c) 2014 messel. All rights reserved. // import UIKit import CoreMedia import MediaPlayer import AVKit import AVFoundation class ViewController: UIViewController { @IBOutlet var urlField : UITextField! // var moviePlayer : MPMoviePlayerViewController? // var player : AVPlayer? // var playerController : AVPlayerViewController? @IBAction func tapGesture(sender: AnyObject) { urlField.resignFirstResponder() NSLog("tapGesture called " + urlField.text) } @IBAction func urlChanged(sender: AnyObject) { NSLog("urlChanged called " + urlField.text) playVideo() } @IBAction func playPushed(sender: AnyObject) { NSLog("playPushed called " + urlField.text) playVideo() } // var url = "http://api.cameo.tv/montage/xTsJQBVx.m3u8" // var url = "http://api.cameo.tv/file/9bafd29deafc16edbfdc8dfcbc0489d1895c7178" // var path = NSBundle.mainBundle().pathForResource("victusSlowMo", ofType: "mov") var path = NSBundle.mainBundle().pathForResource("trim", ofType: "mov") // var path = NSBundle.mainBundle().pathForResource("rendered30fps", ofType: "m4v")! // var url = "https://s3.amazonaws.com/messel.test.cameo.tv/victusSlowMo.mov" // var url = "https://s3.amazonaws.com/messel.test.cameo.tv/rendered30fps.m4v" func initValues() { urlField.text = path!; } func playVideo() { // let videoURL = NSURL(string: urlField.text) let videoURL = NSURL.fileURLWithPath(urlField.text) // moviePlayer = MPMoviePlayerViewController(contentURL: videoURL ) // NSLog("about to play video " + urlField.text) // if let player = moviePlayer { // NSLog("setting stuff") // player.view.frame = self.view.bounds // self.presentViewController(moviePlayer!, animated: true, completion: nil) // NSLog("all done") // } if let player = AVPlayer(URL: videoURL) { let playerController = AVPlayerViewController() playerController.player = player self.addChildViewController(playerController) self.view.addSubview(playerController.view!) playerController.view.frame = self.view.frame player.play() } else { NSLog("no player") } } override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. initValues() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ -1 ]
2c557641071f9b5fd93df6fcacae408e97970257
47d5fe850b2eb8c2d284704d3898b20eb80b2fd9
/HelloSegue/HelloSegue/LightRedViewController.swift
9922b25918f0b03454b01a0eb859e15df26b38a2
[]
no_license
l5ee/iOS_Code
859f1afaf9593433bc336ffc2b0976ff9cd883c5
a19ec562a7b392af17abd8b6e5d27e3351d6e7ad
refs/heads/master
2020-06-11T03:46:45.055328
2017-05-10T08:11:24
2017-05-10T08:11:24
76,011,138
0
0
null
null
null
null
UTF-8
Swift
false
false
1,979
swift
// // LightRedViewController.swift // HelloSegue // // Created by l5ee on 2017/4/8. // Copyright © 2017年 l5ee. All rights reserved. // import UIKit protocol LightRedViewControllerDelegate { func setColor(colorType: String) } class LightRedViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate { @IBOutlet weak var myLabel: UILabel! var infoFromViewOne: String? let colorArray = ["red","green","blue"] var delegate:LightRedViewControllerDelegate? @IBOutlet weak var myPickerView: UIPickerView! @IBAction func backtoViewOne(_ sender: UIButton) { let colorNumber = myPickerView.selectedRow(inComponent: 0) let color = colorArray[colorNumber] delegate?.setColor(colorType: color) navigationController?.popViewController(animated: true) } override func viewDidLoad() { super.viewDidLoad() myLabel.text = infoFromViewOne myPickerView.dataSource = self myPickerView.delegate = self } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func numberOfComponents(in pickerView: UIPickerView) -> Int { return 1 } func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { return colorArray.count } func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { return colorArray[row] } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
4489dfb33237a84a497860d7f786b9ced462b544
547423c7553a49eb58518abbc47ee5feae0a18bd
/NetworkSimulation/NetworkSimulation/DisplayViewController.swift
57a39ee2d7a858c5b82990111a3e6e1ed89b845c
[ "MIT" ]
permissive
Tsiems/WirelessNetwork
cfd8b048aebb937a21d678b653887a44b5ed6633
25ae636e0c64e7f29f9c9b0e1e5aee4955149e87
refs/heads/master
2020-04-06T03:59:15.336466
2017-05-25T22:32:42
2017-05-25T22:32:42
83,084,448
0
0
null
null
null
null
UTF-8
Swift
false
false
39,544
swift
// // DisplayViewController.swift // NetworkSimulation // // Created by Travis Siems on 2/24/17. // Copyright © 2017 Travis Siems. All rights reserved. // import UIKit import SceneKit var CURRENT_NODES:[Node] = [] var CURRENT_EDGES:[Edge] = [] var CURRENT_CONNECTION_DISTANCE = 0.08 var TIME_TO_CREATE_GRAPH = 0.0 var TIME_TO_COLOR_GRAPH = 0.0 var TIME_FOR_SMALLEST_LAST_ORDERING = 0.0 var TIME_FOR_BIPARTITE = 0.0 var CURRENT_ADJACENCY_LIST:[[Node]] = [] var CURRENT_COLORS_ASSIGNED:[Int] = [] var CURRENT_COLOR_FREQUENCIES:[Int:Int] = [:] var CURRENT_COLOR_FREQUENCIES_PAIRED:[(Int,Int)] = [] var COLORS:[Int] = [] var DEGREE_WHEN_DELETED:[Int] = [] var ORIGINAL_DEGREE:[Int] = [] var TERMINAL_CLIQUE_SIZE = 1 let VERIFICATION_WALKTHROUGH = false func getRandomDouble() -> Double { return Double(Float(arc4random()) / Float(UINT32_MAX)) } func getRandomFloat() -> Float { return Float(arc4random()) / Float(UINT32_MAX) } class DisplayViewController: UIViewController,UIPickerViewDelegate, UIPickerViewDataSource { @IBOutlet weak var titleLabel: UILabel! var networkModel = "Square" var nodeCount = 128 // will be changed by the slider var connectionDistance = 0.075 var averageDegree = 6.0 var sphereNodes:[Node] = [] var sphereEdges:[Edge] = [] var extremeDegreeEdges:[Edge] = [] var shouldShowNodes = true var shouldShowEdges = true var shouldGenerateNewValues = true var node_size = 2.0 var edge_width = 0.2 var colorStats:[(String,String)] = [] var bipartiteStats:[(String,String)] = [] var graphAdjList:[[Node]] = [] @IBOutlet weak var sceneKitView: SCNView! @IBOutlet weak var drawView: DisplayView! @IBOutlet weak var showNodesSwitch: UISwitch! @IBOutlet weak var showEdgesSwitch: UISwitch! @IBOutlet weak var showBipartiteSwitch: UISwitch! override func viewDidLoad() { super.viewDidLoad() self.titleLabel.text = self.title showNodesSwitch.isOn = shouldShowNodes showEdgesSwitch.isOn = shouldShowEdges self.colorPicker.dataSource = self self.colorPicker.delegate = self self.showBipartiteSwitch.isEnabled = color1 != color2 && color1 != -1 && color2 != -1 CURRENT_CONNECTION_DISTANCE = connectionDistance TERMINAL_CLIQUE_SIZE = 1 let startTime = Date() if shouldGenerateNewValues { if networkModel == "Disk" { let nodes = generateRandomNodesInDisk(num: nodeCount) CURRENT_NODES = nodes let edges:[Edge] = generateEdgesUsingCellMethod(nodes: CURRENT_NODES, r: connectionDistance) CURRENT_EDGES = edges self.drawView.isHidden = false self.sceneKitView.isHidden = true } else if networkModel == "Sphere" { let nodes = generateRandomNodesInSphere(num: nodeCount) CURRENT_NODES = nodes let edges = generateEdgesUsingCellMethod3d(nodes: CURRENT_NODES, r: connectionDistance) CURRENT_EDGES = edges sphereEdges = edges sphereNodes = nodes } else { let nodes = generateRandomNodesInSquare(num: nodeCount) CURRENT_NODES = nodes let edges:[Edge] = generateEdgesUsingCellMethod(nodes: CURRENT_NODES, r: connectionDistance) CURRENT_EDGES = edges self.drawView.isHidden = false self.sceneKitView.isHidden = true } } let graphCreatedTime = Date() TIME_TO_CREATE_GRAPH = graphCreatedTime.timeIntervalSince(startTime) self.graphAdjList = getAdjacencyList(nodes: CURRENT_NODES, edges: CURRENT_EDGES) CURRENT_ADJACENCY_LIST = self.graphAdjList if VERIFICATION_WALKTHROUGH { print("\nAdjacency List") for row in CURRENT_ADJACENCY_LIST { for item in row { print(item.id,terminator:" -> ") } print("X") } print() } let minMaxDegreeIds = findMinAndMaxDegreeNodes() extremeDegreeEdges = [] for e in CURRENT_EDGES { if e.node1.id == minMaxDegreeIds.0 || e.node2.id == minMaxDegreeIds.0 { let edge = e edge.color = UIColor.blue extremeDegreeEdges.append(edge) } else if e.node1.id == minMaxDegreeIds.1 || e.node2.id == minMaxDegreeIds.1 { let edge = e edge.color = UIColor.green extremeDegreeEdges.append(edge) } } if networkModel == "Sphere" { displaySphereNetwork() } else { drawView.nodes = CURRENT_NODES drawView.edges = CURRENT_EDGES drawView.NODE_SIZE = self.node_size drawView.EDGE_WIDTH = self.edge_width drawView.shouldShowNodes = self.shouldShowNodes drawView.shouldShowEdges = self.shouldShowEdges drawView.extremeDegreeEdges = extremeDegreeEdges drawView.model = networkModel } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } @IBAction func backButtonPressed(_ sender: Any) { print("Going to menu") self.performSegue(withIdentifier: "unwindToMenu", sender: self) } func resetSphereNetwork() { self.sceneKitView.scene = SphereScene() } func displaySphereNetwork() { self.drawView.isHidden = true self.sceneKitView.isHidden = false self.sceneKitView.scene = SphereScene(nodes:sphereNodes,edges:sphereEdges,extremeEdges:extremeDegreeEdges,shouldShowNodes:shouldShowNodes,shouldShowEdges:shouldShowEdges,shouldShowExtremeEdges: !self.showBipartiteSwitch.isOn ) self.sceneKitView.backgroundColor = UIColor.black self.sceneKitView.allowsCameraControl = CURRENT_NODES.count < 7000 } func generateRandomNodesInSquare(num:Int) -> [Node]{ var nodes:[Node] = [] var current_id = 0 for _ in 0 ..< num { let x = getRandomDouble() let y = getRandomDouble() let node = Node(x:x,y:y, id: current_id, color: 0 ) nodes.append( node ) current_id += 1 } if VERIFICATION_WALKTHROUGH { for node in nodes { print(node) } } return nodes } func generateRandomNodesInDisk(num:Int) -> [Node]{ var nodes:[Node] = [] var current_id = 0 for _ in 0 ..< num { let r = sqrt(getRandomDouble()) let degree = getRandomDouble()*360 let x = (r * cos(degree) + 1.0)/2.0 let y = (r * sin(degree) + 1.0)/2.0 let node = Node(x:x,y:y, id: current_id, color: 0 ) nodes.append( node ) current_id += 1 } return nodes } func generateRandomNodesInSphere(num:Int) -> [Node]{ var nodes:[Node] = [] var current_id = 0 for _ in 0 ..< num { let u = getRandomDouble()*2.0 - 1.0 let degree = getRandomDouble()*360 let x = sqrt(1 - u*u)*cos(degree) let y = sqrt(1 - u*u)*sin(degree) let z = u nodes.append( Node(x:x,y:y,z:z, id: current_id, color: 0 ) ) current_id += 1 } return nodes } func generateEdgesBruteForce(nodes:[Node], r:Double) -> [Edge] { // WARNING: this is very slow and is O(n^2) var edges:[Edge] = [] for i in 0 ..< nodes.count-1 { for j in i+1 ..< nodes.count { if sqrt( pow(nodes[i].x-nodes[j].x,2) + pow(nodes[i].y-nodes[j].y,2) + pow(nodes[i].z-nodes[j].z,2)) <= r { edges.append( Edge(node1: nodes[i],node2: nodes[j])) } } } print("Brute Force Edges: ",edges.count) return edges } func generateEdgesUsingCellMethod(nodes:[Node], r:Double) -> [Edge] { var edges:[Edge] = [] let rowCount = Int(ceil(1.0/r)) var cells:[[[Node]]] = [[[Node]]](repeating: [[Node]](repeating: [], count: rowCount ), count: rowCount) for node in nodes { cells[ Int(node.x/r) ][ Int(node.y/r) ].append(node) } //for each cell var i = 0 while (i < rowCount) { var j = 0 while (j < rowCount) { var testNodes:[Node] = [] //find adjacent cells if i+1 < rowCount && j+1 < rowCount { let firstHalf = cells[i+1][j] let secondHalf = cells[i][j+1] + cells[i+1][j+1] testNodes.append(contentsOf:firstHalf + secondHalf) if j > 0 { testNodes.append(contentsOf:cells[i+1][j-1]) } } else if i+1 < rowCount { testNodes.append(contentsOf: cells[i+1][j]) if j > 0 { testNodes.append(contentsOf:cells[i+1][j-1]) } } else if j+1 < rowCount { testNodes.append(contentsOf: cells[i][j+1]) } // test nodes in adjacent cells for node in cells[i][j] { var l = 0 while (l < testNodes.count) { if sqrt( pow(node.x-testNodes[l].x,2) + pow(node.y-testNodes[l].y,2)) <= r { edges.append( Edge(node1: node,node2: testNodes[l])) } l += 1 } } // test nodes within var k = 0 while k < cells[i][j].count-1 { var l = k+1 while l < cells[i][j].count { if sqrt( pow(cells[i][j][k].x-cells[i][j][l].x,2) + pow(cells[i][j][k].y-cells[i][j][l].y,2)) <= r { edges.append( Edge(node1: cells[i][j][k],node2: cells[i][j][l])) } l += 1 } k += 1 } j += 1 } i += 1 } print(edges.count) return edges } func generateEdgesUsingCellMethod3d(nodes:[Node], r:Double) -> [Edge] { var edges:[Edge] = [] let rowCount = Int(ceil(2.0/r)) var cells:[[[[Node]]]] = [[[[Node]]]](repeating: [[[Node]]](repeating: [[Node]](repeating: [], count: rowCount ), count: rowCount ), count: rowCount) for node in nodes { let i = Int((node.x+1.0)/r) let j = Int((node.y+1.0)/r) let k = Int((node.z+1.0)/r) cells[ i ][ j ][ k ].append(node) } let time2 = Date() //for each cell var i = 0 while (i < rowCount) { var j = 0 while (j < rowCount) { var k = 0 while (k < rowCount) { if cells[i][j][k].count > 0 { var testNodes:[Node] = [] //find adjacent cells if i+1 < rowCount && j+1 < rowCount && k+1 < rowCount { let one = cells[i][j][k+1] let two = cells[i][j+1][k] let three = cells[i][j+1][k+1] let four = cells[i+1][j][k] let five = cells[i+1][j][k+1] let six = cells[i+1][j+1][k] let seven = cells[i+1][j+1][k+1] testNodes.append(contentsOf: ((one+two)+(three+four))+((five+six)+seven)) if j > 0 { let eight = cells[i+1][j-1][k] let nine = cells[i+1][j-1][k+1] testNodes.append(contentsOf: eight+nine) } } else if i+1 < rowCount && j+1 < rowCount { let two = cells[i][j+1][k] let four = cells[i+1][j][k] let six = cells[i+1][j+1][k] testNodes.append(contentsOf: (two+four)+six ) if j > 0 { let eight = cells[i+1][j-1][k] testNodes.append(contentsOf: eight) } } else if i+1 < rowCount && k+1 < rowCount { let one = cells[i][j][k+1] let four = cells[i+1][j][k] let five = cells[i+1][j][k+1] testNodes.append(contentsOf: (one+four)+five ) if j > 0 { let eight = cells[i+1][j-1][k] let nine = cells[i+1][j-1][k+1] testNodes.append(contentsOf: eight+nine) } } else if i+1 < rowCount { testNodes.append(contentsOf: cells[i+1][j][k]) if j > 0 { testNodes.append(contentsOf:cells[i+1][j-1][k]) } } else if j+1 < rowCount && k+1 < rowCount { let one = cells[i][j][k+1] let two = cells[i][j+1][k] let three = cells[i][j+1][k+1] testNodes.append(contentsOf: (one+two)+three ) } else if j+1 < rowCount { testNodes.append(contentsOf: cells[i][j+1][k]) } else if k+1 < rowCount { testNodes.append(contentsOf: cells[i][j][k+1]) } // test nodes in adjacent cells for node in cells[i][j][k] { var l = 0 while (l < testNodes.count) { if sqrt( pow(node.x-testNodes[l].x,2) + pow(node.y-testNodes[l].y,2) + pow(node.z-testNodes[l].z,2)) <= r { edges.append( Edge(node1: node,node2: testNodes[l])) } l += 1 } } // test nodes within var m = 0 while m < cells[i][j][k].count-1 { var l = m+1 while l < cells[i][j][k].count { if sqrt( pow(cells[i][j][k][m].x-cells[i][j][k][l].x,2) + pow(cells[i][j][k][m].y-cells[i][j][k][l].y,2) + pow(cells[i][j][k][m].z-cells[i][j][k][l].z,2)) <= r { edges.append( Edge(node1: cells[i][j][k][m],node2: cells[i][j][k][l])) } l += 1 } m += 1 } } k+=1 } j += 1 } i += 1 } let time3 = Date() print("Time new: ",time3.timeIntervalSince(time2)) print(edges.count) return edges } func getAdjacencyList(nodes:[Node],edges:[Edge]) -> [[Node]]{ var adjList:[[Node]] = [[Node]](repeating: [], count: nodes.count) for node in nodes { adjList[node.id] = [node] } for edge in edges { adjList[edge.node1.id].append(edge.node2) adjList[edge.node2.id].append(edge.node1) } return adjList } func updateValueLocation(id:Int, sortedList: inout [(Int,Int)], referenceList: inout [([Node],Int)]) { let testValue = sortedList[referenceList[id].1].1 var i = referenceList[id].1 let value = sortedList.remove(at: i) while i < sortedList.count { if sortedList[i].1 <= testValue { break } else { //update reference list referenceList[sortedList[i].0].1 = i } i += 1 } sortedList.insert(value, at: i) referenceList[sortedList[i].0].1 = i } func subtractBucket(value:Int,buckets: inout [[Int]], referenceList: inout [([Int],Int)]) { //iterate through current value's bucket for (index,nodeId) in buckets[ referenceList[value].1 ].enumerated() { //find node if nodeId == value { //move node to lower bucket _ = buckets[ referenceList[value].1 ].remove(at: index) referenceList[value].1 -= 1 buckets[ referenceList[value].1 ].append(value) break } } } func sortBySmallestLastDegreeFast(adjList: [[Node]], shouldPrint:Bool=false) -> [[Node]] { colorStats = [] DEGREE_WHEN_DELETED = [] ORIGINAL_DEGREE = [] let startTimeFaster = Date() var newList:[[Node]] = [] var buckets:[[Int]] = [[Int]](repeating: [], count: adjList.count-1) var referenceList:[([Int],Int)] = [([Int],Int)](repeating: ([],-1), count: adjList.count) var maxDegree = 0 var totalDegree = 0 TERMINAL_CLIQUE_SIZE = 1 //put values in list for list in adjList { buckets[list.count-1].append(list[0].id) var newList = list.map({$0.id}) newList.remove(at: 0) referenceList[list[0].id] = (newList,list.count-1) if list.count-1 > maxDegree { maxDegree = list.count-1 } totalDegree += list.count-1 } if shouldPrint { print(buckets) } let midTimeFaster = Date() var minIndex = 0 while newList.count < adjList.count { while( buckets[minIndex].count == 0 ) { minIndex += 1 } let min_bucket_size = buckets[minIndex].count let minVal = buckets[minIndex].popLast()! let number_left = adjList.count-newList.count if min_bucket_size == number_left && TERMINAL_CLIQUE_SIZE == 1 && minIndex+1 == min_bucket_size{ TERMINAL_CLIQUE_SIZE = min_bucket_size if shouldPrint { print(min_bucket_size,minIndex,newList.count,adjList.count) print("Terminal Clique found: Size ",TERMINAL_CLIQUE_SIZE) } } newList.append(adjList[minVal]) DEGREE_WHEN_DELETED.append(referenceList[minVal].1) referenceList[minVal].1 = -1 let nodeList = referenceList[minVal].0 ORIGINAL_DEGREE.append(nodeList.count) for id in nodeList { if referenceList[id].1 >= 0 { subtractBucket(value: id, buckets: &buckets, referenceList: &referenceList) } } if minIndex > 0 { minIndex -= 1 } if shouldPrint { print("\nRemoving node: ",minVal) print(buckets) } } colorStats.append( ("Min Degree",String(DEGREE_WHEN_DELETED[0])) ) colorStats.append( ("Avg Degree",String( round( Double( totalDegree ) / Double( newList.count ) * 1000 ) / 1000 ) ) ) colorStats.append( ("Max Degree",String(maxDegree)) ) colorStats.append( ( "Max Degree when Deleted",String( DEGREE_WHEN_DELETED.max()! ) ) ) print("STATS",colorStats) newList.reverse() ORIGINAL_DEGREE.reverse() DEGREE_WHEN_DELETED.reverse() print("SETUP TIME: ",midTimeFaster.timeIntervalSince(startTimeFaster)) return newList } func colorGraph(adjList: [[Node]],shouldPrint:Bool=false) -> [Int] { COLORS = [] var colorsAssigned:[Int] = [Int](repeating: -1, count: adjList.count) for list in adjList { if shouldPrint { print("\nCOLORING NODE ",list[0].id) } var colorsTaken:[Int] = [] for node in list { if shouldPrint && colorsAssigned[node.id] != -1 { print("Color",colorsAssigned[node.id],"taken by adjacent node",node.id) } colorsTaken.append(colorsAssigned[node.id]) } var k = 0 while k < COLORS.count { if colorsTaken.contains(COLORS[k]) { k += 1 } else { colorsAssigned[list[0].id] = COLORS[k] list[0].color = COLORS[k] if shouldPrint { print("Assigning node",list[0].id,"the color:",list[0].color) } break } } if k == COLORS.count { colorsAssigned[list[0].id] = COLORS.count list[0].color = COLORS.count if shouldPrint { print("Assigning node",list[0].id,"the color:",list[0].color) } COLORS.append(COLORS.count) } } var newNodes:[Node] = [] for k in adjList { newNodes.append((k[0])) } drawView.nodes = newNodes return colorsAssigned } func sortColors() { CURRENT_COLOR_FREQUENCIES = [:] for num in CURRENT_COLORS_ASSIGNED { if CURRENT_COLOR_FREQUENCIES[num] != nil { CURRENT_COLOR_FREQUENCIES[num] = CURRENT_COLOR_FREQUENCIES[num]! + 1 } else { CURRENT_COLOR_FREQUENCIES[num] = 1 } } CURRENT_COLOR_FREQUENCIES_PAIRED = [] for (k,v) in CURRENT_COLOR_FREQUENCIES { CURRENT_COLOR_FREQUENCIES_PAIRED.append((k,v)) } CURRENT_COLOR_FREQUENCIES_PAIRED.sort { ($0.1) > ($1.1) } } @IBAction func pressedColorGraphButton(_ sender: Any) { resetSphereNetwork() let startTimeFaster = Date() let sorted = sortBySmallestLastDegreeFast(adjList: self.graphAdjList,shouldPrint: VERIFICATION_WALKTHROUGH) let midTimeFaster = Date() let midTime = Date() CURRENT_COLORS_ASSIGNED = colorGraph(adjList: sorted,shouldPrint:VERIFICATION_WALKTHROUGH ) let endTime = Date() print("TIME TO SORT FAST: ",midTimeFaster.timeIntervalSince(startTimeFaster)) TIME_TO_COLOR_GRAPH = endTime.timeIntervalSince(midTime) TIME_FOR_SMALLEST_LAST_ORDERING = midTimeFaster.timeIntervalSince(startTimeFaster) sortColors() colorStats.append( ("Number of Colors",String(COLORS.count)) ) colorStats.append( ("Terminal Clique Size",String(TERMINAL_CLIQUE_SIZE)) ) colorStats.append( ("Max Color Class Size",String(CURRENT_COLOR_FREQUENCIES_PAIRED[0].1)) ) if VERIFICATION_WALKTHROUGH { let elements = getNodesAndEdgesFromBipartiteGraph(with: COLORS[0], secondColor: COLORS[1],shouldPrint: true) let parts = getComponents(edges: elements.1,shouldPrint: VERIFICATION_WALKTHROUGH) print("\nBackbone:") print(parts[0]) } let beforeBipartite = Date() let maxEdges = getMaxBipartiteEdges() colorStats.append(("Max Edges in a Bipartite Subgraph",String(maxEdges))) bipartiteStats = [] let maxMajorComponent = getMaxBipartiteGraphElements() let afterBipartite = Date() bipartiteStats.append(("Max Backbone Vertices",String(maxMajorComponent.1))) bipartiteStats.append(("Max Backbone Edges",String(maxMajorComponent.0))) bipartiteStats.append(("Max Backbone Domination Percentage",String(round(maxMajorComponent.2*10000)/100))) if networkModel == "Sphere" { bipartiteStats.append(("Max Backbone Faces",String(maxMajorComponent.0-maxMajorComponent.1+2))) } bipartiteStats.append(("2nd Max Backbone Vertices",String(maxMajorComponent.5))) bipartiteStats.append(("2nd Max Backbone Edges",String(maxMajorComponent.4))) bipartiteStats.append(("2nd Max Backbone Domination Percentage",String(round(maxMajorComponent.6*10000)/100))) if networkModel == "Sphere" { bipartiteStats.append(("2nd Max Backbone Faces",String(maxMajorComponent.4-maxMajorComponent.5+2))) } bipartiteStats.append(("Max Backbone Colors",String(maxMajorComponent.3.0)+" and "+String(maxMajorComponent.3.1))) bipartiteStats.append(("2nd Max Backbone Colors",String(maxMajorComponent.7.0)+" and "+String(maxMajorComponent.7.1))) TIME_FOR_BIPARTITE = afterBipartite.timeIntervalSince(beforeBipartite) generateColorValues() if networkModel == "Sphere" { displaySphereNetwork() } else { drawView.setNeedsDisplay() } } @IBAction func showValueChanged(_ sender: Any) { self.shouldShowNodes = self.showNodesSwitch.isOn self.shouldShowEdges = self.showEdgesSwitch.isOn drawView.shouldShowNodes = self.shouldShowNodes drawView.shouldShowEdges = self.shouldShowEdges if networkModel == "Sphere" { displaySphereNetwork() } else { drawView.setNeedsDisplay() } } @IBAction func unwindToDisplay(segue: UIStoryboardSegue) { print("Back at display") } // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. if segue.identifier == "showStatsSegue" { let vc = (segue.destination as! UINavigationController).topViewController as! StatsTableViewController var statistics:[(String,String)] = [] statistics.append(("Generate Graph (Time)",String(round(1000*TIME_TO_CREATE_GRAPH)/1000))) statistics.append(("Smallest Last Ordering (Time)",String(round(1000*TIME_FOR_SMALLEST_LAST_ORDERING)/1000))) statistics.append(("Color Graph (Time)",String(round(1000*TIME_TO_COLOR_GRAPH)/1000))) statistics.append(("Bipartite Stats (Time)",String(round(1000*TIME_FOR_BIPARTITE)/1000))) var colorStatistics:[(String,String)] = [] colorStatistics.append(("Model",networkModel)) colorStatistics.append(("Node Count (N)",String(CURRENT_NODES.count))) colorStatistics.append(("Connection Distance (R)",String(round(1000*CURRENT_CONNECTION_DISTANCE)/1000))) colorStatistics.append(("Edge Count (M)",String(CURRENT_EDGES.count))) for val in colorStats { colorStatistics.append(val) } vc.bipartiteStats = self.bipartiteStats vc.statistics = statistics vc.colorStats = colorStatistics vc.title = self.title! + " Stats" } } @IBOutlet weak var color2Button: UIButton! @IBOutlet weak var color1Button: UIButton! var color1:Int = -1 var color2:Int = -1 @IBOutlet weak var colorPicker: UIPickerView! var selecting1 = false // returns the number of 'columns' to display. func numberOfComponents(in pickerView: UIPickerView) -> Int{ return 1 } // returns the # of rows in each component.. func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int{ return COLORS.count } func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { return String(COLORS[row]) } func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { if selecting1 { color1 = COLORS[row] self.color1Button.setTitle("Color "+String(COLORS[row]), for: .normal) } else { color2 = COLORS[row] self.color2Button.setTitle("Color "+String(COLORS[row]), for: .normal) } self.showBipartiteSwitch.isEnabled = color1 != color2 && color1 != -1 && color2 != -1 if self.showBipartiteSwitch.isOn && !self.showBipartiteSwitch.isEnabled { self.showBipartiteSwitch.isOn = false } colorPicker.isHidden = true displayBipartiteGraph() } func getNodesAndEdgesFromBipartiteGraph(with firstColor:Int,secondColor:Int,shouldPrint:Bool=false) -> ([Node],[Edge]) { var bipartiteNodes:[Node] = [] var bipartiteEdges:[Edge] = [] var nodeIds:[Int] = [] if shouldPrint { print("Nodes for Bipartite Graph, in order:") } for edge in CURRENT_EDGES { if (edge.node1.color == firstColor && edge.node2.color == secondColor) || (edge.node1.color == secondColor && edge.node2.color == firstColor) { bipartiteEdges.append(edge) if !nodeIds.contains(edge.node1.id) { nodeIds.append(edge.node1.id) bipartiteNodes.append(edge.node1) if shouldPrint { print(edge.node1) } } if !nodeIds.contains(edge.node2.id) { nodeIds.append(edge.node2.id) bipartiteNodes.append(edge.node2) if shouldPrint { print(edge.node2) } } } } if shouldPrint { print() } return (bipartiteNodes,bipartiteEdges) } @IBAction func showBipartiteSwitchChanged(_ sender: Any) { displayBipartiteGraph() } func displayBipartiteGraph() { if self.showBipartiteSwitch.isOn && color1 != color2 && color1 != -1 && color2 != -1 { resetSphereNetwork() let bipartiteGraph = getNodesAndEdgesFromBipartiteGraph(with: color1, secondColor: color2) if networkModel == "Sphere" { sphereNodes = bipartiteGraph.0 sphereEdges = bipartiteGraph.1 displaySphereNetwork() } else { self.drawView.nodes = bipartiteGraph.0 self.drawView.edges = bipartiteGraph.1 self.drawView.shouldShowExtremeEdges = false drawView.setNeedsDisplay() } } else { if networkModel == "Sphere" { sphereNodes = CURRENT_NODES sphereEdges = CURRENT_EDGES displaySphereNetwork() } else { self.drawView.nodes = CURRENT_NODES self.drawView.edges = CURRENT_EDGES self.drawView.shouldShowExtremeEdges = true drawView.setNeedsDisplay() } } } func getDominationPercentage(nodeIds:[Int]) -> Double { //calculate the domination percentage of the backbones var ids:Set<Int> = Set.init() //add all ids to the set for id in nodeIds { for connected in graphAdjList[id] { ids.insert(connected.id) } } return Double(ids.count)/Double(CURRENT_NODES.count) } func getMaxBipartiteGraphElements() -> (Int,Int,Double,(Int,Int),Int,Int,Double,(Int,Int)) { var maxIndex = (-1,-1) var maxMajorCompSize = -1 var numberOfNodes = -1 var maxDominationPercentage:Double = 0.0 var secondMaxIndex = (-1,-1) var secondMaxSize = -1 var secondNumberOfNodes = -1 var secondDominationPercentage:Double = 0.0 //find the top bipartite graphs for i in 0..<min(COLORS.count-1,3) { for j in (i+1)..<min(COLORS.count,4) { let elements = getNodesAndEdgesFromBipartiteGraph(with: CURRENT_COLOR_FREQUENCIES_PAIRED[i].0, secondColor: CURRENT_COLOR_FREQUENCIES_PAIRED[j].0) let parts = getComponents(edges: elements.1) if parts[0].1 > maxMajorCompSize { secondMaxSize = maxMajorCompSize secondMaxIndex = maxIndex secondNumberOfNodes = numberOfNodes secondDominationPercentage = maxDominationPercentage maxMajorCompSize = parts[0].1 maxIndex = (i,j) numberOfNodes = parts[0].0.count maxDominationPercentage = getDominationPercentage(nodeIds: parts[0].0) } else if parts[0].1 > secondMaxSize { secondMaxSize = parts[0].1 secondMaxIndex = (i,j) secondNumberOfNodes = parts[0].0.count secondDominationPercentage = getDominationPercentage(nodeIds: parts[0].0) } } } return (maxMajorCompSize,numberOfNodes,maxDominationPercentage,maxIndex,secondMaxSize,secondNumberOfNodes,secondDominationPercentage,secondMaxIndex) } func getMaxBipartiteEdges() -> Int { var bipartiteEdges:[[Int]] = [[Int]](repeating: [Int](repeating: 0, count: COLORS.count ),count: COLORS.count) for edge in CURRENT_EDGES { bipartiteEdges[edge.node1.color][edge.node2.color] += 1 bipartiteEdges[edge.node2.color][edge.node1.color] += 1 } var maxEdgeCount = 0 for i in 0..<COLORS.count { for j in i..<COLORS.count { if bipartiteEdges[i][j] > maxEdgeCount { maxEdgeCount = bipartiteEdges[i][j] } } } return maxEdgeCount } func getComponents(edges:[Edge],shouldPrint:Bool=false) -> [([Int],Int)] { var components:[([Int],Int)] = [] if shouldPrint { print("Making Components") print(components) } //find the components using the edges for edge in edges { //used for node1 and node2 var component1 = -1 var component2 = -1 for i in 0..<components.count { if components[i].0.contains(edge.node1.id) { component1 = i } if components[i].0.contains(edge.node2.id) { component2 = i } } //check which of the nodes are in a component already if component1 != -1 && component2 != -1 { if component1 != component2 { let smallIndex = min(component1,component2) let bigIndex = max(component1,component2) let removed = components.remove(at: bigIndex) //combine the two components components[smallIndex].0.append(contentsOf: removed.0) components[smallIndex].1 += removed.1 + 1 } else { components[component1].1 += 1 } } else if component1 != -1 { components[component1].0.append(edge.node2.id) components[component1].1 += 1 } else if component2 != -1 { components[component2].0.append(edge.node1.id) components[component2].1 += 1 } else { //make new component components.append( ([edge.node1.id,edge.node2.id],1) ) } if shouldPrint { print(components) } } //sort by largest component first return components.sorted { ($0.1) > ($1.1) } } func findMinAndMaxDegreeNodes() -> (Int,Int) { var ids = (0,0) var min = 100000 var max = 0 for list in graphAdjList { if list.count > max { max = list.count ids.1 = list[0].id } else if list.count < min { min = list.count ids.0 = list[0].id } } return ids } @IBAction func color1ButtonPressed(_ sender: Any) { selecting1 = true self.colorPicker.dataSource = self self.colorPicker.delegate = self colorPicker.isHidden = COLORS.count == 0 } @IBAction func color2ButtonPressed(_ sender: Any) { selecting1 = false self.colorPicker.dataSource = self self.colorPicker.delegate = self colorPicker.isHidden = COLORS.count == 0 } }
[ -1 ]
ae494d7f058e7168b043add30f86666e4c05a26c
41edcd4730edbb016468c92a5d93f558b392049e
/kindOfNotesApp/DataModels/CollectionViewCell.swift
26d408f5065f0803c74aa139ef357d7f1e8c7d45
[]
no_license
JakubSlawecki/kindOfNotesApp
05afea95105923649396c974fc6aac3fe491f7a4
1e089d7ce5e3c6d6340878bb9ffaffdc13cbac60
refs/heads/master
2020-04-27T00:06:27.478358
2019-03-06T09:58:58
2019-03-06T09:58:58
173,924,282
0
0
null
null
null
null
UTF-8
Swift
false
false
360
swift
// // CollectionViewCell.swift // kindOfNotesApp // // Created by Jakub Slawecki on 27/02/2019. // Copyright © 2019 Jakub Slawecki. All rights reserved. // import UIKit class CollectionViewCell: UICollectionViewCell { @IBOutlet var noteImage : UIImageView! func displayContent(image: UIImage) { noteImage.image = image } }
[ -1 ]
11860b2681147f9bf838923939e6af1151dc6ffb
45c3b48c6d36ca798c05dc241cf27752f5b66d66
/NewsReader/SubscribedCategory+CoreDataProperties.swift
a2ce2da18b51c60cffc9af9208e044d67fd628e2
[]
no_license
richmondwatkins/AlienGo-iOS
57f8f7943e888b7b4b259644e0c7e862ff446d27
c643e09152d15565bab94174e4624b710c5c1987
refs/heads/master
2020-04-06T06:28:07.143269
2017-03-27T03:28:24
2017-03-27T03:28:24
70,122,988
0
0
null
null
null
null
UTF-8
Swift
false
false
400
swift
// // SubscribedCategory+CoreDataProperties.swift // // // Created by Richmond Watkins on 11/14/16. // // import Foundation import CoreData extension SubscribedCategory { @nonobjc public class func fetchRequest() -> NSFetchRequest<SubscribedCategory> { return NSFetchRequest<SubscribedCategory>(entityName: "SubscribedCategory"); } @NSManaged public var name: String? }
[ -1 ]
3a1e11a4a7ddb1360d974a8b0e31c539bc70c222
477ae14d5e921070e3a53c2218ffdcfb68049707
/Pods/CoreStore/Sources/NSPersistentStoreCoordinator+Setup.swift
13aa5380068e656b7780af483a27e9725a5dcb24
[ "MIT" ]
permissive
paterik/udacity-ios-aqoo
9bf06b0e93ed25055159c14758e6af121bede75a
a28b7db0673f5e7ac9900a0132bb79b6f2d3507e
refs/heads/master
2021-07-13T05:56:49.822732
2018-12-15T14:24:37
2018-12-15T14:24:37
103,947,684
6
2
null
null
null
null
UTF-8
Swift
false
false
2,931
swift
// // NSPersistentStoreCoordinator+Setup.swift // CoreStore // // Copyright © 2016 John Rommel Estropia. 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 import CoreData // MARK: - NSPersistentStoreCoordinator internal extension NSPersistentStoreCoordinator { @nonobjc internal func performAsynchronously(_ closure: @escaping () -> Void) { self.perform(closure) } @nonobjc internal func performSynchronously<T>(_ closure: @escaping () -> T) -> T { var result: T? self.performAndWait { result = closure() } return result! } @nonobjc internal func performSynchronously<T>(_ closure: @escaping () throws -> T) throws -> T { var closureError: Error? var result: T? self.performAndWait { do { result = try closure() } catch { closureError = error } } if let closureError = closureError { throw closureError } return result! } @nonobjc internal func addPersistentStoreSynchronously(_ storeType: String, configuration: ModelConfiguration, URL storeURL: URL?, options: [AnyHashable: Any]?) throws -> NSPersistentStore { return try self.performSynchronously { do { return try self.addPersistentStore( ofType: storeType, configurationName: configuration, at: storeURL, options: options ) } catch { throw CoreStoreError(error) } } } }
[ 437355, 141219, 313101 ]
7cf34f554fd7ea7bb4738f31f7086c35d989ceb5
b9f892b230c8d9e7fe3e8c764407121b47c46f6a
/ConsultaOpenLibraryISBNConPortada/ViewController.swift
9f4eafe6537adbae9d660a68450743df4e8f5170
[]
no_license
FAMAAlmonte/ConsultaISBNConPortada
b2e47dd17666b9d6daa7bd07cde9e3929ecdddb5
f358d75df945e7c1df4305f17ae9b3fc6facbbaa
refs/heads/master
2020-07-28T20:46:04.813752
2016-09-04T19:18:28
2016-09-04T19:18:28
67,297,239
0
0
null
null
null
null
UTF-8
Swift
false
false
4,812
swift
// // ViewController.swift // ConsultaOpenLibraryISBNConPortada // // Created by Mauro Alberto Flores Almonte on 03/09/16. // Copyright © 2016 Mauro Alberto Flores Almonte. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var isbnTextField : UITextField! @IBOutlet weak var autores : UILabel! @IBOutlet weak var titulo : UILabel! @IBOutlet weak var portada : UIImageView! let url = "https://openlibrary.org/api/books?jscmd=data&format=json&bibkeys=ISBN:" override func viewDidLoad() { super.viewDidLoad() } override func viewWillAppear(animated: Bool) { asigVariables() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } func asigVariables () { autores.text = "Autor" titulo.text = "Título" portada.image = nil } func datosJson (isbnCode: String, completionHandler: (data: NSData?) -> Void) { if !isbnCode.isEmpty { NSURLSession.sharedSession().dataTaskWithURL(NSURL(string: url + isbnCode)!, completionHandler: {(data, response, error) in if error != nil { dispatch_async(dispatch_get_main_queue(), { self.presentViewController(self.alerta("Error", mensaje: error!.localizedDescription), animated: true, completion: nil) }) return } completionHandler(data: data) }).resume() } else { } } func procesarJSON (isbn: String, data: NSData) { do { if let json = try NSJSONSerialization.JSONObjectWithData(data, options: []) as? [String : AnyObject] { if let isbnJSON = json["ISBN:" + isbn] as? [String : AnyObject] { dispatch_async(dispatch_get_main_queue(), { self.autores.text = String() if let autores = isbnJSON["authors"] as? [AnyObject] { var prefix = "" for autor in autores { self.autores.text = self.autores.text! + prefix + (autor["name"] as! String) prefix = ", " } } else { self.autores.text = "Autor no definido" } if let tituloIsbn = isbnJSON["title"] as? String { self.titulo.text = tituloIsbn } else { self.titulo.text = "Título no definido" } if let isbnPortada = isbnJSON["cover"]?["medium"] as? String, let imagen = UIImage(data: NSData(contentsOfURL: NSURL(string: isbnPortada)!)!) { self.portada.image = self.tamañoImagen(imagen, size: self.portada.frame.size) } }) } } } catch { print("¡Error!") } } func tamañoImagen (imagen: UIImage, size: CGSize) -> UIImage? { var imageContext : UIImage? UIGraphicsBeginImageContextWithOptions(size, false, CGFloat(0.0)) imagen.drawInRect(CGRect(origin: CGPointZero, size: size)) imageContext = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return imageContext } func alerta (titulo: String, mensaje: String) -> UIAlertController { let alerta = UIAlertController(title: titulo, message: mensaje, preferredStyle: .Alert) alerta.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil)) return alerta } @IBAction func buscarISBN (sender: UITextField) { asigVariables() datosJson(isbnTextField.text!) { data in self.procesarJSON(self.isbnTextField.text!, data: data!) } } }
[ -1 ]
28f572d63448f2d9640ce90d8a9d592c7d842191
8cfd0b6a6f769ba1b4902dd51b6d012b97fa8cb2
/GachaTechUITests/GachaTechUITests.swift
5d5ae7015a62d1c6bc5f6ed7b5d9f615dc32db11
[]
no_license
c-izumi/GachaTech
638e8d6c0e9c4be4544309b434c1ca8a009037c3
2cd93d01c7f3b71ff309d3f52ba054fcd4adc525
refs/heads/master
2022-07-18T14:06:21.629720
2020-05-14T18:17:47
2020-05-14T18:17:47
263,988,993
0
0
null
null
null
null
UTF-8
Swift
false
false
1,486
swift
// // GachaTechUITests.swift // GachaTechUITests // // Created by 泉 千種 on 2020/05/15. // Copyright © 2020 Izumi zu-mi-. All rights reserved. // import XCTest class GachaTechUITests: XCTestCase { override func setUpWithError() throws { // 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 // 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 tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // UI tests must launch the application that they test. let app = XCUIApplication() app.launch() // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testLaunchPerformance() throws { if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { // This measures how long it takes to launch your application. measure(metrics: [XCTOSSignpostMetric.applicationLaunch]) { XCUIApplication().launch() } } } }
[ 360463, 376853, 344106, 253996, 385078, 163894, 352314, 376892, 32829, 352324, 352327, 385095, 393291, 163916, 368717, 254039, 426074, 368732, 180317, 32871, 352359, 221292, 385135, 376945, 385147, 426124, 196758, 49308, 65698, 49317, 377008, 377010, 377025, 377033, 164043, 417996, 254157, 368849, 368850, 139478, 385240, 254171, 147679, 147680, 205034, 254189, 254193, 344312, 336121, 262403, 147716, 368908, 180494, 262419, 368915, 254228, 377116, 254250, 131374, 418095, 336177, 180534, 155968, 270663, 319816, 368969, 254285, 180559, 377168, 344402, 368982, 270703, 385407, 385409, 270733, 106893, 385423, 385433, 213402, 385437, 254373, 385448, 385449, 115116, 385463, 336319, 336323, 188870, 262619, 377309, 377310, 369121, 369124, 270823, 213486, 360945, 139766, 393719, 377337, 254459, 410108, 410109, 262657, 377346, 410126, 262673, 385554, 393745, 254487, 410138, 188957, 377374, 385569, 385578, 377388, 197166, 393775, 418352, 33339, 352831, 33344, 385603, 385612, 426575, 385620, 369236, 270938, 352885, 352886, 344697, 385669, 369285, 344714, 377487, 180886, 426646, 352921, 377499, 344737, 352938, 418479, 164532, 336565, 377531, 377534, 377536, 385737, 385745, 369365, 369366, 385751, 361178, 352989, 352990, 418529, 295649, 385763, 369383, 361194, 418550, 344829, 197377, 434956, 418579, 426772, 197398, 426777, 344864, 197412, 336678, 189229, 197424, 197428, 336693, 377656, 426809, 197433, 377669, 197451, 369488, 385878, 385880, 197467, 435038, 385895, 197479, 385901, 197489, 164730, 254851, 369541, 172936, 426894, 377754, 172971, 377778, 189362, 189365, 377789, 345034, 418774, 386007, 386009, 418781, 386016, 123880, 418793, 222193, 435185, 271351, 435195, 328701, 386049, 328705, 418819, 410629, 377863, 189448, 361487, 435216, 386068, 254997, 336928, 336930, 410665, 345137, 361522, 386108, 410687, 377927, 361547, 156763, 361570, 214116, 214119, 402538, 173168, 377974, 66684, 402568, 140426, 386191, 410772, 222364, 418975, 124073, 402618, 402632, 402641, 419028, 222441, 386288, 66802, 271607, 369912, 386296, 369913, 419066, 386300, 386304, 369929, 419097, 115997, 222496, 369964, 353581, 116014, 66863, 345397, 345398, 386363, 337226, 353611, 337228, 345418, 353612, 378186, 353617, 378201, 230772, 337280, 353672, 263561, 370066, 9618, 411028, 370072, 148900, 361928, 337359, 329168, 329170, 353751, 320997, 361958, 271850, 271853, 329198, 411119, 116209, 386551, 271880, 198155, 329231, 370200, 157219, 157220, 394793, 353875, 345697, 271980, 206447, 42616, 337533, 370307, 419462, 149127, 149128, 419464, 411275, 214667, 345753, 255651, 337590, 370359, 403149, 345813, 370390, 272087, 345817, 337638, 181992, 345832, 345835, 141037, 34547, 173828, 395018, 395019, 395026, 435993, 345882, 411417, 255781, 362281, 378666, 403248, 378673, 182070, 182071, 345910, 436029, 337734, 272207, 272208, 337746, 395092, 362326, 345942, 370526, 345950, 362336, 255844, 214894, 362351, 214896, 182145, 337816, 329627, 354210, 436130, 436135, 10153, 362411, 370604, 362418, 411587, 362442, 346066, 354268, 436189, 403421, 329696, 354273, 403425, 354279, 436199, 174058, 337899, 354283, 247787, 329707, 247786, 436209, 182277, 346117, 354310, 43016, 354312, 354311, 403463, 436235, 419857, 436248, 346153, 272432, 403507, 378933, 378934, 436283, 403524, 436293, 436304, 329812, 411738, 272477, 321632, 395373, 346237, 436372, 362658, 436388, 133313, 395458, 338118, 436429, 346319, 379102, 387299, 18661, 379110, 149743, 379120, 436466, 411892, 436471, 395511, 436480, 272644, 338187, 338188, 395536, 338196, 272661, 379157, 157973, 338217, 362809, 379193, 395591, 272730, 436570, 215395, 362864, 354672, 272755, 354678, 436609, 436613, 395653, 395660, 264591, 272784, 420241, 43416, 436644, 272815, 436659, 338359, 436677, 256476, 420326, 166403, 420374, 330291, 191065, 436831, 420461, 346739, 346741, 420473, 166533, 363155, 346771, 264855, 363161, 436897, 355006, 363228, 436957, 436960, 264929, 338658, 346859, 330476, 35584, 133889, 346889, 207639, 363295, 355117, 191285, 273209, 355129, 273211, 355136, 355138, 420680, 355147, 355148, 355153, 387927, 363353, 363354, 420702, 363361, 363362, 412516, 355173, 355174, 207724, 355182, 207728, 420722, 330627, 265094, 387977, 396171, 355216, 224146, 224149, 256918, 256919, 256920, 256934, 273336, 273341, 330688, 379845, 363462, 273353, 207839, 347104, 134124, 412653, 248815, 257007, 347122, 437245, 257023, 125953, 396292, 330759, 347150, 330766, 412692, 330789, 248871, 412725, 257093, 404550, 339031, 404582, 257126, 265318, 265323, 396395, 404589, 273523, 363643, 248960, 363658, 404622, 224400, 265366, 347286, 429209, 339101, 429216, 380069, 265381, 421050, 339131, 265410, 183492, 273616, 421081, 339167, 421102, 290030, 363769, 52473, 52476, 412926, 437504, 388369, 380178, 429332, 412963, 257323, 437550, 273713, 208179, 159033, 347451, 257353, 257354, 109899, 437585, 331091, 150868, 372064, 429410, 437602, 388458, 265579, 421240, 388488, 396697, 396709, 380335, 355761, 421302, 134586, 380348, 216510, 216511, 380350, 200136, 273865, 339403, 372172, 413138, 421338, 437726, 429540, 3557, 3559, 265720, 216575, 372226, 437766, 208397, 413202, 413206, 388630, 175640, 216610, 372261, 347693, 323120, 396850, 200245, 323126, 134715, 421437, 396865, 413255, 273992, 265800, 421452, 265809, 396885, 265816, 396889, 388699, 396896, 388712, 388713, 339579, 396927, 224907, 396942, 405140, 274071, 208547, 208548, 405157, 388775, 364202, 421556, 224951, 224952, 224985, 159462, 372458, 397040, 12017, 274170, 175874, 249606, 372497, 397076, 421657, 339746, 257831, 167720, 421680, 421686, 274234, 241471, 339782, 339799, 274276, 274288, 372592, 274296, 372625, 118693, 438186, 151492, 380874, 380910, 380922, 380923, 274432, 372736, 315431, 430120, 430127, 405552, 249912, 225347, 421958, 176209, 381013, 53334, 200795, 356446, 438374, 176231, 438378, 422000, 249976, 266361, 422020, 168069, 381061, 168070, 381071, 430231, 200856, 422044, 192670, 192671, 258213, 430263, 266427, 372943, 266447, 258263, 356575, 438512, 372979, 389364, 381173, 135416, 356603, 266504, 61720, 381210, 389406, 438575, 266547, 397620, 332084, 438583, 127292, 438592, 397650, 348499, 250196, 348501, 389465, 332128, 110955, 160111, 250227, 438653, 340356, 266628, 225684, 373141, 373144, 389534, 397732, 373196, 184799, 201195, 324098, 340489, 397841, 258584, 397855, 348709, 348710, 397872, 340539, 266812, 438850, 348741, 381515, 348748, 430681, 332379, 184938, 373357, 184942, 176751, 389744, 356983, 356984, 209529, 356990, 373377, 422529, 201348, 152196, 356998, 348807, 356999, 275102, 176805, 340645, 422567, 176810, 160441, 422591, 135888, 373485, 373486, 21239, 275193, 348921, 430853, 430860, 62222, 430880, 283431, 152372, 160569, 430909, 160576, 348999, 439118, 381791, 127840, 357219, 439145, 381811, 201590, 398205, 340865, 349066, 349068, 381840, 390034, 373653, 430999, 381856, 398244, 185252, 422825, 381872, 398268, 349122, 398275, 127945, 373705, 340960, 398305, 340967, 398313, 127990, 349176, 201721, 349179, 357380, 398370, 357413, 357420, 398405, 218187, 250955, 250965, 439391, 250982, 398444, 62574, 357487, 119925, 349304, 349315, 349317, 373902, 324761, 373937, 373939, 324790, 218301, 259275, 259285, 357594, 414956, 251124, 439550, 439563, 414989, 259346, 349458, 382243, 382246, 382257, 382264, 333115, 193853, 251212, 406862, 259408, 374110, 259449, 382329, 357758, 357763, 112019, 398740, 333224, 374189, 251314, 259513, 54719, 259569, 251379, 398844, 210429, 366081, 153115, 431646, 349727, 431662, 374327, 210489, 235069, 128589, 333389, 333394, 349780, 415334, 54895, 366198, 210558, 210559, 415360, 415369, 210569, 431754, 267916, 415376, 259741, 153252, 399014, 210601, 202413, 415419, 259780, 333508, 267978, 333522, 325345, 333543, 325357, 431861, 366358, 169751, 431901, 341791, 399148, 202541, 431918, 153392, 431935, 415555, 325444, 325449, 341837, 415566, 431955, 325460, 341846, 259937, 382820, 415592, 325491, 341878, 276343, 350072, 333687, 112510, 325508, 333700, 243590, 350091, 350092, 350102, 350108, 333727, 128955, 219102, 6116, 432114, 415740, 268286, 415744, 399372, 153618, 358418, 292901, 178215, 358455, 399433, 333902, 104534, 260206, 432241, 374913, 374914, 415883, 333968, 284827, 333990, 104633, 260285, 268479, 374984, 334049, 268515, 383208, 260337, 260338, 432373, 375040, 432387, 260355, 375052, 194832, 325904, 391448, 268570, 178459, 186660, 268581, 334121, 358698, 325930, 260396, 432435, 358707, 178485, 358710, 14654, 268609, 383309, 383327, 366948, 416101, 383338, 432503, 432511, 252309, 39323, 375211, 334259, 129461, 342454, 358844, 326083, 416201, 129484, 154061, 416206, 432608, 391654, 432616, 334315, 375281, 334345, 432650, 342549, 342560, 416288, 350758, 350759, 358951, 358952, 219694, 219695, 375345, 432694, 375369, 375373, 416334, 416340, 244311, 260705, 416353, 375396, 268901, 244345, 375438, 326288, 383668, 342714, 39616, 383708, 269036, 432883, 203511, 342775, 383740, 416509, 359166, 162559, 375552, 432894, 383755, 326413, 326428, 342827, 391980, 416577, 293702, 244569, 375644, 252766, 351078, 342888, 392057, 211835, 392065, 260995, 400262, 392071, 424842, 236427, 252812, 400271, 392080, 400282, 211871, 359332, 359333, 326571, 252848, 326580, 261045, 261046, 326586, 359365, 211913, 326602, 252878, 342990, 433104, 359380, 433112, 433116, 359391, 343020, 187372, 383980, 383994, 171009, 384004, 433166, 384015, 433173, 326684, 252959, 384031, 375848, 261191, 375902, 375903, 392288, 253028, 318571, 351343, 187505, 138354, 384120, 392317, 343166, 384127, 392320, 253074, 326803, 359574, 351389, 253098, 367791, 367792, 367798, 343230, 367809, 253124, 113863, 351445, 195809, 228587, 253168, 351475, 351489, 367897, 367898, 245018, 130347, 261426, 212282, 359747, 359748, 146760, 146763, 114022, 253288, 425327, 425331, 163190, 327030, 384379, 253316, 384391, 253339, 253340, 343457, 245160, 359860, 359861, 343480, 425417, 327122, 425434, 253431, 359931, 187900, 343552, 409095, 359949, 253456, 253462, 146976, 245290, 245291, 343606, 163385, 425534, 138817, 147011, 147020, 179800, 196184, 343646, 155238, 204394, 138862, 188021, 425624, 245413, 384693, 376502, 409277, 409289, 425682, 245471, 212721, 163575, 360194, 409355, 155408, 417556, 204600, 384826, 409404, 360253, 409416, 376661, 368471, 425820, 368486, 409446, 425832, 368489, 40809, 384871, 417648, 417658, 360315, 253828, 425875, 376733, 204702, 253868, 204722, 343993, 188349, 212947, 212953, 360416, 253930, 385011 ]
17355c432e5751a6b567c4873611cd6243db7004
4ebdf4504021ea24e5c6ae8bc5e6e2cf4b0ca884
/Example/Tests/Tests.swift
412cd3cc8e976889420b39c53eae73075a4414a4
[ "MIT" ]
permissive
ahad11/ooo
408a4b30ca84fe084656a12595d0ff84b8fefd20
299bc1fdada869f30b4aa7aad9302fdcc54378a1
refs/heads/master
2021-07-21T01:20:04.407972
2017-10-31T07:11:55
2017-10-31T07:11:55
108,951,201
0
0
null
null
null
null
UTF-8
Swift
false
false
753
swift
import UIKit import XCTest import ooo class Tests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. XCTAssert(true, "Pass") } func testPerformanceExample() { // This is an example of a performance test case. self.measure() { // Put the code you want to measure the time of here. } } }
[ 276481, 276484, 276489, 276492, 278541, 278544, 276509, 360491, 276533, 159807, 276543, 280649, 223318, 288857, 278618, 227417, 194652, 194653, 276577, 276581, 276582, 43109, 276585, 223340, 276589, 227439, 276592, 227446, 276603, 276606, 141450, 311435, 276627, 276631, 276632, 184475, 227492, 196773, 129203, 176314, 227528, 276684, 276687, 278742, 278746, 155867, 276709, 276710, 276715, 233715, 157944, 211193, 227576, 168188, 227585, 276744, 227592, 276753, 129301, 276760, 278810, 276764, 276774, 262450, 276787, 276792, 278846, 164162, 278856, 276813, 278862, 278863, 276821, 276835, 276847, 278898, 280961, 178571, 278954, 278965, 276920, 278969, 278985, 111056, 279002, 227813, 279019, 279022, 186893, 279054, 223767, 223769, 277017, 277029, 277048, 277049, 301634, 369220, 277066, 166507, 189036, 189037, 277101, 189043, 277118, 184962, 225933, 133774, 225936, 277138, 277141, 277142, 164512, 225956, 225962, 209581, 154291, 166580, 154294, 199366, 225997, 164563, 277204, 119513, 363231, 201442, 226043, 209660, 234241, 226051, 277254, 209670, 203529, 226058, 234256, 234263, 369432, 234268, 105246, 228129, 234280, 277289, 234283, 277294, 234286, 226097, 162621, 234301, 234304, 162626, 277316, 234311, 234312, 234317, 277327, 234323, 234326, 277339, 297822, 234335, 297826, 234340, 174949, 234343, 234346, 234349, 277360, 213876, 277366, 234361, 277370, 226170, 234367, 234372, 226181, 213894, 226184, 234377, 226189, 234381, 226194, 234387, 234392, 279456, 277410, 234404, 234409, 234412, 226222, 234419, 226227, 277435, 287677, 234430, 226241, 275397, 234438, 226249, 234450, 234451, 234454, 234457, 275418, 234463, 234466, 277480, 179176, 234482, 234492, 277505, 234498, 277510, 234503, 234506, 234509, 277517, 197647, 277518, 295953, 234517, 281625, 234530, 234534, 275495, 234539, 275500, 310317, 277550, 275505, 234548, 277563, 7229, 277566, 230463, 7230, 7231, 207938, 156733, 234560, 234565, 277574, 234569, 207953, 277585, 296018, 234583, 234584, 275547, 277596, 234594, 277603, 234603, 281707, 275571, 234612, 300150, 398457, 234622, 275590, 275591, 234631, 253063, 277640, 302217, 226451, 226452, 277651, 275607, 119963, 234652, 277665, 275625, 208043, 275628, 226479, 277690, 203989, 363744, 195811, 285929, 204022, 120055, 204041, 199971, 259363, 277800, 113962, 277803, 277806, 113966, 226608, 277809, 226609, 277814, 277815, 277821, 277824, 277825, 277831, 226632, 142669, 277838, 277841, 222548, 277845, 277844, 224605, 218462, 224606, 277856, 142689, 277862, 281962, 173420, 277868, 277871, 279919, 277878, 275831, 277882, 142716, 275838, 275839, 277890, 277891, 226694, 275847, 277896, 277897, 277900, 230799, 296338, 277907, 206228, 226711, 226712, 277919, 277920, 277925, 277927, 370091, 277936, 277939, 296375, 277943, 277946, 277949, 277952, 296387, 163269, 277957, 296391, 277962, 282060, 277965, 277974, 228823, 228824, 277977, 277980, 226781, 277983, 277988, 277993, 296425, 277994, 277997, 278002, 278005, 278008, 153095, 175625, 192010, 280077, 65041, 204313, 278056, 278060, 228917, 226875, 128583, 226888, 276040, 366154, 276046, 276050, 226906, 243292, 298590, 370271, 276085, 276088, 278140, 188031, 276097, 276100, 276101, 312972, 278160, 278162, 276116, 276117, 276120, 278170, 280220, 276126, 276129, 278191, 278195, 276148, 296628, 278201, 276156, 276165, 278214, 323276, 9936, 9937, 276179, 276180, 216795, 216796, 276195, 313065, 419569, 276210, 276219, 171776, 278285, 276238, 227091, 184086, 278299, 276253, 276257, 278307, 288547, 165677, 276279, 276282, 276283, 276287, 276294, 276298, 276311, 276318, 276325, 276332, 173936, 110452, 276344, 227199, 255872, 40850, 40853, 44952, 247712, 227238, 276394, 276401, 276408, 161722, 276413, 276421, 276422, 276430, 153552, 276444, 276450, 276451, 276459, 276462, 276463, 276468, 276469, 278518, 276475, 276478 ]
1fd4bb02df6510d434c2b3a9846802fa7e5f2427
d60a089093e646e92f94f899a186a1f77669eadf
/Example/OscletonSDK/Home/Receiver/ReceiverViewController.swift
edf9af78803177c59c48a36d69d9176d0fd8b857
[ "Apache-2.0" ]
permissive
ArthurVimond/oscleton-ios-sdk
9a1c5590d813aeea8b75045bc9506a87d9d657ec
69f04a1b7f27bddba47f6a5656ed002960a5eaff
refs/heads/master
2020-03-31T13:12:53.706998
2018-12-03T16:46:38
2018-12-03T16:46:38
152,246,165
0
0
null
null
null
null
UTF-8
Swift
false
false
2,235
swift
// // ReceiverViewController.swift // OscletonSDK_Example // // Created by Arthur Vimond on 19/10/2018. // Copyright © 2018 CocoaPods. All rights reserved. // import UIKit import Foundation import OscletonSDK import RxSwift import RxCocoa class ReceiverViewController : UIViewController { // UI @IBOutlet weak var trackNameValueLabel: UILabel! @IBOutlet weak var deviceNameValueLabel: UILabel! @IBOutlet weak var parameterNameValueLabel: UILabel! @IBOutlet weak var displayValueValueLabel: UILabel! @IBOutlet weak var valueValueLabel: UILabel! @IBOutlet weak var minValueLabel: UILabel! @IBOutlet weak var maxValueLabel: UILabel! private let bag = DisposeBag() private let viewModel = ReceiverViewModel() override func viewDidLoad() { super.viewDidLoad() clearDesignTimeTexts() bindProperties() } private func clearDesignTimeTexts() { trackNameValueLabel.text = "" deviceNameValueLabel.text = "" parameterNameValueLabel.text = "" displayValueValueLabel.text = "" valueValueLabel.text = "" minValueLabel.text = "" maxValueLabel.text = "" } private func bindProperties() { // Track name viewModel.trackName .bind(to: trackNameValueLabel.rx.text) .disposed(by: bag) // Device name viewModel.deviceName .bind(to: deviceNameValueLabel.rx.text) .disposed(by: bag) // Parameter name viewModel.paramName .bind(to: parameterNameValueLabel.rx.text) .disposed(by: bag) // Display value viewModel.displayValue .bind(to: displayValueValueLabel.rx.text) .disposed(by: bag) // Value viewModel.value .bind(to: valueValueLabel.rx.text) .disposed(by: bag) // Min viewModel.min .bind(to: minValueLabel.rx.text) .disposed(by: bag) // Max viewModel.max .bind(to: maxValueLabel.rx.text) .disposed(by: bag) } }
[ -1 ]
51e37a4d24ee5ebd5bdf6444196567b4013b9584
182bfa36e1d5616d12f58659895c825f7602a465
/IndexableTableView/DataProvider.swift
ad70db65312a738429a656a1562ac11ea646ac81
[]
no_license
omranaleid/IndexableTableView
23c8b71012c67a822ca4f01b2451fd51852230d6
ff872e97dc6ca7d9e68d689e8fdd0433de551e07
refs/heads/master
2023-01-02T01:08:09.801114
2020-10-23T15:38:57
2020-10-23T15:38:57
306,677,640
0
0
null
null
null
null
UTF-8
Swift
false
false
15,029
swift
// // DataProvider.swift // IndexableTableView // // Created by Omran Aleid on 2020-10-21. // Copyright © 2020 Omran Aleid. All rights reserved. // import UIKit protocol IndexableSection { var index: String { get } } struct TableSection: IndexableSection { var index: String var title: String var rows: [FoodItem] } struct FoodItem { var name: String var image: UIImage var price: Double var desc: String } class DataProvider { static var IndexableData: [TableSection] { return [ TableSection(index: "Drinks", title: "Drinks", rows: [ FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum") ]), TableSection(index: "Vegetables", title: "Vegetables", rows: [ FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum") ]), TableSection(index: "Fruits", title: "Fruits", rows: [ FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum") ]), TableSection(index: "Dairy Foods", title: "Dairy Foods", rows: [ FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum") ]), TableSection(index: "Meat and Poultry", title: "Meat and Poultry", rows: [ FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"), FoodItem(name: "Item one", image: UIImage(named: "item")!, price: 14.90, desc: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum") ]) ] } }
[ -1 ]
9710ec03d45746f570433cd6a16aa1be67b18c8c
330662ef92b43afa36f09c906426db324e18784c
/hello-world/hello-world/AppDelegate.swift
4ec0288206f3809cc8fe68b092918a68735250ed
[]
no_license
mrstevenaweiss/swift-practice
731fc8cee4aed895c078e7bfbef476c68545b1a0
c304c969d938734d783c20b366d0be780da64bb0
refs/heads/master
2020-09-15T18:23:56.080834
2020-07-08T02:32:04
2020-07-08T02:32:04
223,526,433
0
0
null
null
null
null
UTF-8
Swift
false
false
1,425
swift
// // AppDelegate.swift // hello-world // // Created by steven weiss on 5/24/20. // Copyright © 2020 Mr Steven A Weiss. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 213048, 385081, 376889, 393275, 376905, 327756, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 286831, 368752, 286844, 262283, 286879, 286888, 377012, 327871, 377036, 180431, 377046, 377060, 327914, 205036, 393456, 393460, 418043, 336123, 336128, 385280, 262404, 180490, 368911, 262416, 262422, 377117, 262436, 336180, 262454, 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, 410128, 393747, 254490, 188958, 385570, 33316, 197159, 377383, 352821, 188987, 418363, 369223, 385609, 385616, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 148105, 377484, 352918, 98968, 344744, 361129, 336555, 385713, 434867, 164534, 336567, 164538, 328378, 328386, 352968, 344776, 418507, 352971, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 336643, 344835, 344841, 361230, 336659, 418580, 418585, 434970, 369435, 418589, 262942, 418593, 336675, 328484, 418598, 418605, 336696, 361273, 328515, 336708, 328519, 336711, 361288, 328522, 336714, 426841, 254812, 361309, 197468, 361315, 361322, 328573, 377729, 369542, 361360, 222128, 345035, 345043, 386003, 386011, 386018, 386022, 435187, 328702, 328714, 361489, 386069, 336921, 386073, 336925, 345118, 377887, 345133, 345138, 386101, 361536, 197707, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 361598, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 386258, 328924, 66782, 222437, 386285, 328941, 386291, 345376, 353570, 345379, 410917, 345382, 345399, 378169, 369978, 337222, 337229, 337234, 263508, 402791, 345448, 271730, 378227, 271745, 181638, 353673, 181643, 181649, 181654, 230809, 181670, 181673, 181678, 181681, 337329, 181684, 181690, 361917, 181696, 337349, 181703, 337365, 271839, 329191, 361960, 329194, 116210, 337398, 337415, 329226, 419339, 419343, 419349, 345625, 419355, 370205, 419359, 394786, 419362, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 419410, 345701, 394853, 222830, 370297, 403070, 403075, 345736, 198280, 345749, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 419512, 337592, 419517, 337599, 419527, 419530, 419535, 272081, 419542, 394966, 419544, 181977, 345818, 419547, 419550, 419559, 337642, 419563, 337645, 370415, 337659, 141051, 337668, 362247, 395021, 362255, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 345930, 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, 379233, 354673, 321910, 248186, 420236, 379278, 354727, 338352, 330189, 338381, 338386, 338403, 338409, 248308, 199164, 330252, 199186, 420376, 330267, 354855, 10828, 199249, 346721, 174695, 248425, 191084, 338543, 191092, 346742, 330383, 354974, 150183, 174774, 248504, 174777, 223934, 355024, 273108, 355028, 264918, 183005, 256734, 436962, 338660, 338664, 264941, 363251, 207619, 264964, 338700, 256786, 199452, 363293, 396066, 346916, 396069, 215853, 355122, 355131, 355140, 355143, 338763, 355150, 330580, 355166, 265055, 265058, 355175, 387944, 355179, 330610, 330642, 355218, 412599, 207808, 379848, 396245, 330710, 248792, 248798, 347105, 257008, 183282, 265207, 330748, 265214, 330760, 330768, 248862, 396328, 158761, 199728, 396336, 330800, 396339, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 183383, 339036, 412764, 257120, 265320, 248951, 420984, 330889, 347287, 339097, 248985, 44197, 380070, 339112, 249014, 126144, 330958, 330965, 265432, 265436, 388319, 388347, 175375, 159005, 175396, 208166, 273708, 372015, 347441, 372018, 199988, 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, 388542, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 249308, 339420, 339424, 249312, 339428, 339434, 249328, 69113, 372228, 208398, 380432, 175635, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 224897, 372353, 216707, 126596, 421508, 224904, 224909, 11918, 159374, 224913, 126610, 339601, 224916, 224919, 126616, 224922, 208538, 224926, 224929, 224932, 224936, 257704, 224942, 257712, 224947, 257716, 257720, 224953, 257724, 224959, 257732, 224965, 224969, 339662, 224975, 257747, 224981, 224986, 257761, 224993, 257764, 224999, 339695, 225012, 257787, 225020, 339710, 257790, 225025, 257794, 339721, 257801, 257804, 225038, 257807, 225043, 372499, 167700, 225048, 257819, 225053, 184094, 225058, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 225079, 397112, 225082, 397115, 225087, 225092, 225096, 323402, 257868, 225103, 257871, 397139, 225108, 225112, 257883, 257886, 225119, 257890, 339814, 225127, 257896, 274280, 257901, 225137, 339826, 257908, 225141, 257912, 225148, 257916, 257920, 225155, 339844, 225165, 397200, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 405533, 430129, 266294, 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, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 225597, 332097, 201028, 348488, 332106, 332117, 348502, 250199, 250202, 332125, 250210, 348522, 348525, 348527, 332152, 389502, 250238, 332161, 356740, 332172, 373145, 340379, 389550, 324030, 266687, 160234, 127471, 340472, 324094, 266754, 324099, 324102, 324111, 340500, 324117, 324131, 332324, 381481, 324139, 356907, 324142, 356916, 324149, 324155, 348733, 324164, 356934, 348743, 381512, 324170, 324173, 324176, 389723, 332380, 373343, 381545, 340627, 184982, 373398, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 373449, 332493, 357069, 357073, 332511, 332520, 340718, 332533, 348924, 389892, 373510, 389926, 152370, 348978, 340789, 348982, 398139, 127814, 357201, 357206, 389978, 430939, 357211, 357214, 201579, 201582, 349040, 340849, 201588, 430965, 381813, 324472, 398201, 119674, 340858, 324475, 430972, 340861, 324478, 324481, 373634, 398211, 324484, 324487, 381833, 324492, 324495, 324498, 430995, 324501, 324510, 422816, 324513, 398245, 201637, 324524, 340909, 324533, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 209895, 201711, 349172, 381946, 349180, 439294, 431106, 209943, 209946, 250914, 357410, 185380, 357418, 209965, 209968, 209971, 209975, 209979, 209987, 209990, 341071, 349267, 250967, 210010, 341091, 210025, 210027, 210030, 210036, 210039, 349308, 210044, 349311, 160895, 152703, 210052, 349319, 210055, 210067, 210071, 210077, 210080, 251044, 210084, 185511, 210088, 210095, 210098, 210107, 210115, 332997, 210127, 333009, 210131, 333014, 210138, 210143, 218354, 218360, 251128, 275706, 275712, 275715, 275721, 349459, 333078, 251160, 349484, 349491, 251189, 415033, 251210, 357708, 210260, 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, 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, 333498, 210631, 333511, 358099, 153302, 333534, 366307, 366311, 431851, 366318, 210672, 366321, 366325, 210695, 268041, 210698, 366348, 210706, 399128, 333594, 210719, 358191, 366387, 399159, 358200, 325440, 366401, 341829, 325446, 46920, 341834, 341838, 341843, 415573, 358234, 341851, 350045, 399199, 259938, 399206, 268143, 358255, 399215, 358259, 341876, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 333774, 358371, 350189, 350193, 333818, 350202, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350240, 350244, 350248, 178218, 350251, 350256, 350259, 350271, 243781, 350285, 374864, 342111, 342133, 374902, 432271, 333997, 334011, 260289, 260298, 350410, 350416, 350422, 211160, 350425, 268507, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 325891, 350467, 350475, 375053, 268559, 350480, 432405, 350486, 325914, 350490, 325917, 350493, 350498, 350504, 358700, 350509, 391468, 358704, 358713, 358716, 383306, 334161, 383321, 383330, 383333, 391530, 383341, 334203, 268668, 194941, 391563, 366990, 416157, 342430, 268701, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 195039, 334304, 334311, 375277, 334321, 350723, 186897, 342545, 334358, 342550, 342554, 334363, 350761, 252461, 334384, 383536, 358961, 334394, 252482, 219718, 334407, 334420, 350822, 375400, 334465, 334468, 162445, 326290, 342679, 342683, 260766, 342710, 244409, 260797, 260801, 350917, 154317, 391894, 154328, 416473, 64230, 113388, 342766, 375535, 203506, 342776, 391937, 391948, 375568, 326416, 375571, 375574, 162591, 326441, 326451, 326454, 326460, 244540, 375612, 260924, 326467, 244551, 326473, 326477, 326485, 416597, 326490, 342874, 326502, 375656, 433000, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 342915, 400259, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 326598, 359366, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 384107, 367723, 187502, 384114, 343154, 212094, 351364, 384135, 384139, 384143, 351381, 384160, 384168, 367794, 384181, 367800, 384191, 351423, 326855, 244937, 253130, 343244, 146642, 359649, 343270, 351466, 351479, 343306, 261389, 359694, 261393, 384275, 245020, 245029, 171302, 351534, 376110, 245040, 425276, 384323, 212291, 343365, 212303, 367965, 343393, 343398, 367980, 425328, 343409, 253303, 154999, 343417, 327034, 245127, 384397, 245136, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327110, 327115, 327117, 359886, 359890, 343507, 368092, 343534, 343539, 368119, 343544, 368122, 409091, 359947, 359955, 359983, 343630, 327275, 245357, 138864, 155254, 155273, 368288, 245409, 425638, 425649, 155322, 425662, 155327, 253943, 155351, 155354, 212699, 155363, 245475, 245483, 155371, 409335, 155393, 155403, 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, 376714, 155531, 262027, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 393169, 384977, 155611, 155619, 253923, 155621, 253926, 327654, 204784, 393203, 360438, 393206, 393212, 155646 ]
ad6f005e3543f7d8cbc933e1fb0efe2d170a9719
b3340d0225b9a3ba7eae49c86aed8631e379d4eb
/Raykea/FurnitureSettings.swift
570c48d80e1b2a3d1f041b476b2bb442a9b069b3
[]
no_license
isaacthedeveloper/MockIkeaApp
bc154b420abf59faebdf594004d318c629c23888
28c4f457374276e53a2862814164f5496e9ec8c1
refs/heads/master
2020-05-20T08:37:40.377633
2019-09-27T16:11:14
2019-09-27T16:11:14
185,478,364
0
0
null
null
null
null
UTF-8
Swift
false
false
2,091
swift
import Foundation import UIKit import ARKit class FurnitureSettings { let furniturePictures = [ UIImage(named: "bookshelf-pic"), UIImage(named: "chair-pic"), UIImage(named: "couch-pic"), UIImage(named: "table-pic"), ] let furnitureNames = [ "BIBLIOTEK", "BÜTTPLAIZE", "DERP", "TEBBEL", ] let furnitureDescriptions = [ "Do you have a thing called...books? Do you have a place to put them? No? You need this.", "Standing is for suckers. Sitting is the new standing. Park your butt in...BÜTTPLAIZE!", "Need a place to eat chips and binge-watch Netflix for hours? You need DERP.", "Free your hands by putting your plate and glass on TEBBEL.", ] let furnitureOffsets = [ SCNVector3(0, 0, 0), SCNVector3(0, 0.32, 0), SCNVector3(0, 0, 0), SCNVector3(0, 0, 0), ] var furniture = 0 func currentFurniturePiece() -> SCNNode { switch furniture { case 0: return createBookshelf() case 1: return createChair() case 2: return createCouch() case 3: return createTable() default: return createBookshelf() } } func currentFurnitureOffset() -> SCNVector3 { return furnitureOffsets[furniture] } func createBookshelf() -> SCNNode { let scene = SCNScene(named: "SceneAssets.scnassets/furniture.scn") let node = (scene?.rootNode.childNode(withName: "bookcase", recursively: false))! return node } func createChair() -> SCNNode { let scene = SCNScene(named: "SceneAssets.scnassets/furniture.scn") let node = (scene?.rootNode.childNode(withName: "chair", recursively: false))! return node } func createCouch() -> SCNNode { let scene = SCNScene(named: "SceneAssets.scnassets/furniture.scn") let node = (scene?.rootNode.childNode(withName: "couch", recursively: false))! return node } func createTable() -> SCNNode { let scene = SCNScene(named: "SceneAssets.scnassets/furniture.scn") let node = (scene?.rootNode.childNode(withName: "table", recursively: false))! return node } }
[ -1 ]
53964f14b6d08bc796031d1d96def937f4ed5fd7
485c6007b0ded50288201da2b1b924b2522509e4
/TodoApp/Controllers/Task/TaskManagementController.swift
61c00ac413cc39df41cf5470b5fe14a8f2d43295
[]
no_license
maithanhtung/TodoApp
9f302cb6e3e3a00195e47b8adeec12bce15e3a4b
b17db3567586da13af56c75de2107c914f2cbe72
refs/heads/master
2023-06-15T08:39:24.310618
2021-07-18T06:41:20
2021-07-18T06:41:20
384,777,067
0
0
null
2021-07-10T19:50:28
2021-07-10T19:42:37
Swift
UTF-8
Swift
false
false
9,516
swift
// // TaskManagementController.swift // TodoApp // // Created by Mai Thanh Tung on 15.7.2021. // import Foundation import UserNotifications // MARK: - TaskFormViewController implementation class TaskManagementController: NSObject { private let taskListKey: String = "Task list" let userDefault: UserDefaults = UserDefaults.standard private func loadTaskList(from jsonString: String) -> TaskList? { if let dataFromJsonString = jsonString.data(using: .utf8) { return try? JSONDecoder().decode(TaskList.self, from: dataFromJsonString) } return nil } private func encodedData(with taskList: TaskList) -> String? { if let encodedData = try? JSONEncoder().encode(taskList) { return String(data: encodedData, encoding: .utf8) } return nil } private func createNotification(with task: Task) { if task.taskStatus == .active { // create notification content let content = UNMutableNotificationContent() content.title = NSString.localizedUserNotificationString(forKey: task.title, arguments: nil) content.body = NSString.localizedUserNotificationString(forKey: task.reminderText, arguments: nil) content.sound = UNNotificationSound.default // create date component let calendar: Calendar = Calendar.current var dateComponents: DateComponents = DateComponents() dateComponents.hour = calendar.component(.hour, from: task.dueDate) dateComponents.minute = calendar.component(.minute, from: task.dueDate) dateComponents.timeZone = TimeZone.current let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: false) // create notification request let request = UNNotificationRequest(identifier: task.id ?? "", content: content, trigger: trigger) // schedule the request with system UNUserNotificationCenter.current().add(request) { (error) in if let error = error { print("adding notification error: \(error)") } else { print("successfully added notification") } } } } private func deletePendingNotification(with taskId: String) { // remove pending notification let centre = UNUserNotificationCenter.current() centre.removePendingNotificationRequests(withIdentifiers: [taskId]) } // use when adding a new Task private func newTaskList(from oldTasks: [Task]?, with newTask: Task) -> TaskList { var task: Task = newTask var taskArray: [Task] = [] if let tasks = oldTasks, let lastItemId = tasks.last?.id { // if there is existing tasks, append new task with id = last task id + 1. task.id = String((Int(lastItemId) ?? 0).advanced(by: 1)) taskArray = tasks } else { // start with 0 task.id = String(0) } taskArray.append(task) createNotification(with: task) return TaskList(tasks: taskArray) } func fetchTaskList(onSuccess: @escaping (TaskList) -> Void, onFail: (TDError) -> Void) { // get Task List Json string from local guard let taskListString = userDefault.string(forKey: taskListKey) else { // return empty taskList if there is nothing saved let taskList: TaskList = TaskList(tasks: []) onSuccess(taskList) return } // decode Json string to Object guard let list = loadTaskList(from: taskListString) else { onFail(TDError(errorString: "Unable to unarchived task list Json string")) return } // if dueDate <= Date() && taskStatus == .active -> over due var newList: TaskList = list newList.tasks = list.tasks.map({$0.dueDate > Date() || $0.taskStatus == .done ? $0 : Task(id: $0.id, title: $0.title, description: $0.description, dueDate: $0.dueDate, reminderText: $0.reminderText, taskStatus: .overdue)}) onSuccess(newList) } func fetchTask(taskId: String, onSuccess: @escaping (Task) -> Void, onFail: (TDError) -> Void) { guard let taskListString = userDefault.string(forKey: taskListKey) else { onFail(TDError(errorString: "Fail to fetch task list")) return } // decode Json string to Object guard let list = loadTaskList(from: taskListString) else { onFail(TDError(errorString: "Unable to unarchived task list Json string")) return } guard let task = list.tasks.first(where: { $0.id == taskId }) else { onFail(TDError(errorString: "Task not found!")) return } var updatedTask: Task = task updatedTask.updateTaskStatus() onSuccess(updatedTask) } func addTask(with newTask: Task, onSuccess: () -> Void, onFail: (TDError) -> Void) { // get Task List Json string from local guard let taskListData = userDefault.string(forKey: taskListKey) else { // first time - create new Task List let newTaskList: TaskList = newTaskList(from: nil, with: newTask) // encode to Json String with new TaskList guard let newTaskListEncodeString = encodedData(with: newTaskList) else { onFail(TDError(errorString: "Unable to encode")) return } // set value to user default userDefault.setValue(newTaskListEncodeString, forKey: taskListKey) onSuccess() return } // decode Json string to Object guard let oldList = loadTaskList(from: taskListData) else { onFail(TDError(errorString: "Unable to decode task list Json string")) return } // create new taskList base on old Task list with new Task let newTaskList: TaskList = newTaskList(from: oldList.tasks, with: newTask) // encode to Json String with new TaskList guard let newTaskListEncodeString = encodedData(with: newTaskList) else { onFail(TDError(errorString: "Unable to archived")) return } // set value to user default userDefault.setValue(newTaskListEncodeString, forKey: taskListKey) onSuccess() } func editTask(with task: Task, onSuccess: () -> Void, onFail: (TDError) -> Void) { // get Task List Json string from local guard let taskListString = userDefault.string(forKey: taskListKey) else { onFail(TDError(errorString: "TaskList not created yet to be edit")) return } // decode Json string to Object guard let oldList = loadTaskList(from: taskListString) else { onFail(TDError(errorString: "Unable to encode")) return } // find task need to be edit var tasks = oldList.tasks guard let index = tasks.firstIndex(where: {$0.id == task.id}) else { onFail(TDError(errorString: "Task not found")) return } // remove pending notification deletePendingNotification(with: tasks[index].id ?? "") // remove the old task from list tasks.remove(at: index) createNotification(with: task) // insert the new task tasks.insert(task, at: index) // encode to Json String with new TaskList guard let newTaskListEncodeString = encodedData(with: TaskList(tasks: tasks)) else { onFail(TDError(errorString: "Unable to encode")) return } // set value to user default userDefault.setValue(newTaskListEncodeString, forKey: taskListKey) onSuccess() } func deleteTask(with taskId: String, onSuccess: () -> Void, onFail: (TDError) -> Void) { deletePendingNotification(with: taskId) guard let taskListData = userDefault.string(forKey: taskListKey) else { onFail(TDError(errorString: "TaskList not created yet to be edit")) return } guard let oldList = loadTaskList(from: taskListData) else { onFail(TDError(errorString: "Unable to encode")) return } var tasks = oldList.tasks guard let index = tasks.firstIndex(where: {$0.id == taskId}) else { onFail(TDError(errorString: "Task not found")) return } tasks.remove(at: index) guard let newTaskListEncodeString = encodedData(with: TaskList(tasks: tasks)) else { onFail(TDError(errorString: "Unable to encode")) return } // set value userDefault.setValue(newTaskListEncodeString, forKey: taskListKey) onSuccess() } // clear everything func resetUserDefaults() { userDefault.removePersistentDomain(forName: Bundle.main.bundleIdentifier ?? "") userDefault.synchronize() } }
[ -1 ]
527ca1d0122b16e0148a4481b29f58b49721f378
4bebd7cbc404d12b1dd5353a6a85e8c89a4c2d25
/MotoGP21-MVVM/Presentation/RiderssList/RidersListView.swift
a79ee3d53723adca43a0aaa0c4b57762cb7ed1cf
[]
no_license
yarmolchuk/MotoGP21
0ee73b88165bc3740c6b9c42e4da5d7582434d6e
b805d2636e596d9c85980ff2fda2ff27e5542ad3
refs/heads/main
2023-03-11T05:16:10.666195
2021-02-24T11:05:57
2021-02-24T11:05:57
341,872,124
0
0
null
null
null
null
UTF-8
Swift
false
false
1,328
swift
// // RidersListView.swift // MotoGP21-MVVM // // Created by Dima Yarmolchuk on 24.02.2021. // import Combine import SwiftUI struct RidersListView: View { @ObservedObject var viewModel: RidersListViewModel var body: some View { NavigationView { content.navigationBarTitle("MotoGP 2021") } .onAppear { viewModel.send(event: .onAppear) } } private var content: some View { switch viewModel.state { case .idle: return Color.clear.eraseToAnyView() case .loading: return Spinner(isAnimating: true, style: .large).eraseToAnyView() case .error(let error): return Text(error.localizedDescription).eraseToAnyView() case .loaded(let riders): return list(of: riders).eraseToAnyView() } } private func list(of riders: [RidersListViewModel.ListItem]) -> some View { return List(riders) { rider in NavigationLink( destination: details(rider: rider.name), label: { RiderListItemView(rider: rider) } ) } } func details(rider: String) -> some View { return Text(rider) } } extension View { func eraseToAnyView() -> AnyView { AnyView(self) } }
[ -1 ]
044e70bbdfc7a9c20371da76675d622c1d41444c
3f0ecfd9831543bfa3c21299ac7cb263a6cd488a
/segment/segment/ThirdViewController.swift
6f3f64b6983d4318457130bc953429a498eaf671
[]
no_license
realRk/work
4676e96178e6b63bf430a2634afb8072814a7246
d4dea866521b6dbc0647736546a431811872dc92
refs/heads/master
2021-04-26T22:17:19.128214
2018-05-17T04:18:08
2018-05-17T04:18:08
124,061,340
0
0
null
null
null
null
UTF-8
Swift
false
false
2,006
swift
// // ThirdViewController.swift // segment // // Created by Rk on 07/03/18. // Copyright © 2018 Rk. All rights reserved. // import UIKit class ThirdViewController: UIViewController { @IBOutlet weak var sWitch: UISwitch! @IBOutlet weak var segmentMain: UISegmentedControl! @IBOutlet weak var thirdContainer: UIView! @IBOutlet weak var secondContainer: UIView! @IBOutlet weak var firstContainer: UIView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } @IBAction func segmentOnClick(_ sender: Any) { switch segmentMain.selectedSegmentIndex { case 0: firstContainer.isHidden = false secondContainer.isHidden = true thirdContainer.isHidden = true case 1: secondContainer.isHidden = false firstContainer.isHidden = true thirdContainer.isHidden = true case 2: firstContainer.isHidden = true secondContainer.isHidden = true thirdContainer.isHidden = false default: firstContainer.isHidden = false secondContainer.isHidden = true thirdContainer.isHidden = true } } @IBAction func onSwitch(_ sender: UISwitch) { if(sWitch.isOn){ sWitch.isOn = false } else{ sWitch.isOn = true } } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
eb30e42e9c8b42b37cb7f334e0061852812d49bc
a38ca4051160fe5d98f6956fb5b6009f6cae8ef1
/letianAppSwift/XYGenericFramework/oldCode/MerchantManager/MerchantSystemSetting/Viewcontroller/MerchantOrderVibrateSettingVC.swift
b790dda3c80ae9ce4c9043d4c81eb254665aa80c
[]
no_license
xx52lw/wuhan_school
e03d62c6f50d279598326eb61ce6f54f1c56b3cc
15ac0ab8a858d774f652174e45217614f10e443a
refs/heads/master
2020-04-01T22:05:33.656630
2018-10-18T21:48:17
2018-10-18T21:48:17
153,691,269
0
0
null
null
null
null
UTF-8
Swift
false
false
6,008
swift
// // MerchantOrderVibrateSettingVC.swift // XYGenericFramework // // Created by xiaoyi on 2018/2/28. // Copyright © 2018年 xiaoyi. All rights reserved. // import UIKit class MerchantOrderVibrateSettingVC: UIViewController { let toside = cmSizeFloat(20) let chooseStrArr = ["开启","关闭"] let useVibrateImage = #imageLiteral(resourceName: "genderSelected") let unuseVibrateImage = #imageLiteral(resourceName: "genderUnselected") var topView:XYTopView! var headerTitleLabel:UILabel! var chooseImageViewArr:[UIImageView] = Array() var useVibrate:Bool! override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = .white if isOrderUseVibrate() == true { useVibrate = true }else{ useVibrate = false } creatNavTopView() createSubViews() // Do any additional setup after loading the view. } //MARK: - 创建navigationView func creatNavTopView(){ topView = XYTopView.creatCustomTopView() self.view.addSubview(topView.navigationTitleItem().createLeftBackBtn(target: self, action: nil)) topView.titleLabel.text = "接单铃声设置" topView.backgroundColor = cmColorWithString(colorName: MAIN_BLUE_STR) } //MARK: - 创建子View func createSubViews(){ let subViewHeight = cmSizeFloat(50) headerTitleLabel = UILabel(frame: CGRect(x: toside, y: topView.bottom, width: SCREEN_WIDTH, height: subViewHeight)) headerTitleLabel.font = cmSystemFontWithSize(14) headerTitleLabel.textColor = MAIN_BLACK headerTitleLabel.textAlignment = .left headerTitleLabel.text = "接单铃声设置" self.view.addSubview(headerTitleLabel) self.view.addSubview(XYCommonViews.creatCommonSeperateLine(pointY: headerTitleLabel.bottom - cmSizeFloat(1))) for index in 0..<chooseStrArr.count { let chooseView = UIView(frame: CGRect(x: 0, y: headerTitleLabel.bottom + CGFloat(index)*subViewHeight, width: SCREEN_WIDTH, height: subViewHeight)) chooseView.backgroundColor = .white let selectImageView = UIImageView(frame: CGRect(x: toside, y: subViewHeight/2 - unuseVibrateImage.size.height/2, width: unuseVibrateImage.size.width, height: unuseVibrateImage.size.height)) selectImageView.image = unuseVibrateImage chooseView.addSubview(selectImageView) chooseImageViewArr.append(selectImageView) let selectTitle = UILabel(frame: CGRect(x: selectImageView.right + toside, y: 0, width: SCREEN_WIDTH - toside*3 - unuseVibrateImage.size.width, height: subViewHeight)) selectTitle.font = cmSystemFontWithSize(14) selectTitle.textColor = MAIN_BLACK selectTitle.textAlignment = .left selectTitle.text = chooseStrArr[index] chooseView.addSubview(selectTitle) chooseView.isUserInteractionEnabled = true let chooseViewTapgesture = UITapGestureRecognizer(target: self, action: #selector(chooseViewTapgesture(sender:))) chooseView.addGestureRecognizer(chooseViewTapgesture) chooseView.tag = 200 + index self.view.addSubview(chooseView) } //提交按钮 let btnHeight = cmSizeFloat(36) let saveBtn = UIButton(frame: CGRect(x: toside, y: cmSizeFloat(12) + headerTitleLabel.bottom + CGFloat(2)*subViewHeight, width: SCREEN_WIDTH - toside*2, height: btnHeight)) saveBtn.setTitle("保存", for: .normal) saveBtn.setTitleColor(MAIN_WHITE, for: .normal) saveBtn.titleLabel?.font = cmSystemFontWithSize(15) saveBtn.layer.cornerRadius = cmSizeFloat(4) saveBtn.clipsToBounds = true saveBtn.backgroundColor = MAIN_GREEN saveBtn.addTarget(self, action: #selector(saveBtnAct), for: .touchUpInside) self.view.addSubview(saveBtn) if useVibrate == true { chooseImageViewArr[0].image = useVibrateImage }else{ chooseImageViewArr[1].image = useVibrateImage } } //MARK: - 铃声设置选择响应 @objc func chooseViewTapgesture(sender:UITapGestureRecognizer) { for index in 0..<chooseImageViewArr.count { if (sender.view!.tag - 200) == index { chooseImageViewArr[index].image = useVibrateImage }else{ chooseImageViewArr[index].image = unuseVibrateImage } } if (sender.view!.tag - 200) == 0 { self.useVibrate = true }else{ self.useVibrate = false } } //MARK: - 保存按钮响应 @objc func saveBtnAct(){ saveVibrateSettingInfo(isUseVibrate: useVibrate) self.navigationController?.popViewController(animated: true) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.navigationController?.navigationBar.isHidden = true self.automaticallyAdjustsScrollViewInsets = false tabBarController?.tabBar.isHidden = true } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
339cbf4ce47d8a4e866f2f62912b8d3a515c48e4
cf55c37cf7bb42c6534e1354275ebdfe20fe5e87
/SilentMoon/Sources/Modules/Components/CollectionViewCell/SleepMusicCollectionViewCell.swift
dc33548fc3348f80fb65e5507a7ebfc4419f1717
[]
no_license
clmct/SilentMoon
6f240cf3baeff91e9c8701579766dcc60007c495
5f8a15c253e111273831a8b09131e2f3e382d336
refs/heads/master
2023-08-01T22:54:16.889812
2021-09-25T05:11:36
2021-09-25T05:11:36
405,801,509
0
0
null
null
null
null
UTF-8
Swift
false
false
2,047
swift
// // SleepMusicCollectionViewCell.swift // SilentMoon // import UIKit enum CellType { case music case home } class SleepMusicCollectionViewCell: UICollectionViewCell { static let identifier = "SleepMusicCollectionViewCell" private let imageView = UIImageView() private let titleLabel = UILabel() private let descriptionLabel = UILabel() override init(frame: CGRect) { super.init(frame: frame) setupLayout() } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } private func setupLayout() { contentView.addSubview(imageView) contentView.addSubview(titleLabel) contentView.addSubview(descriptionLabel) imageView.snp.makeConstraints { make in make.top.leading.trailing.equalToSuperview() make.bottom.equalTo(titleLabel.snp.top).offset(-10) } titleLabel.snp.makeConstraints { make in make.leading.trailing.equalToSuperview() make.bottom.equalTo(descriptionLabel.snp.top) make.height.equalTo(20) } descriptionLabel.snp.makeConstraints { make in make.leading.trailing.equalToSuperview() make.bottom.equalToSuperview() make.height.equalTo(20) } setupImageView() setupTitleLabel() setupDescriptionLabel() } private func setupImageView() { imageView.contentMode = .scaleAspectFill imageView.layer.cornerRadius = 10 imageView.layer.masksToBounds = true } private func setupTitleLabel() { titleLabel.textColor = .basic7 titleLabel.font = .basic9 } private func setupDescriptionLabel() { descriptionLabel.textColor = .basic8 descriptionLabel.font = .basic10 } func configure(data: CellData, cellType: CellType) { imageView.image = data.image titleLabel.text = data.title descriptionLabel.text = data.description switch cellType { case .home: titleLabel.textColor = .basic5 descriptionLabel.textColor = .basic9 case .music: break } } }
[ -1 ]
0b36796a5a7718ce1185bc9996bd453c2238003f
65496946c3ab4f1f82984684fb69faf5d5b7599c
/AppBannerView/AppBannerView/Constant.swift
a366225d647452a15282e73f38bcf7e9ed891d73
[]
no_license
candRabbit/AppBannerView
9f9a013fa6c58968b2115c5b20c6e27d03531b77
f64454c41c04d313575b43eca4d10088b9bcb9ea
refs/heads/master
2018-01-08T16:49:58.690423
2015-10-15T07:14:11
2015-10-15T07:14:11
43,884,129
2
0
null
null
null
null
UTF-8
Swift
false
false
482
swift
// // Constant.swift // AppBannerView // // Created by lvlinqing on 15/10/10. // Copyright © 2015年 lv. All rights reserved. // import Foundation let bannerPhotos = ["http://p1.meituan.net/movie/f1e42208897d8674bb7aab89fb078baf487236.jpg", "http://p1.meituan.net/movie/aa3c2bac8f9aaa557e63e20d56e214dc192471.jpg", "http://p0.meituan.net/movie/07b7f22e2ca1820f8b240f50ee6aa269481512.jpg" ,"http://p1.meituan.net/movie/395266f5f470b027ed1ac87110b03b88149862.jpg"]
[ -1 ]
7d060fbc87387c1b734538bb61114e96dfcd6da0
c913b876368499f92852c0b4683e7356d771a077
/foodie_ios/AppDelegate.swift
6168440417b60da284e65ce703da23118423223a
[]
no_license
mattdizon/foodie_ios
28d5862db3d500df1a7404736708c2a98879c82a
3c62001abdb285f0c788e333a6b155dfa6a2d3cc
refs/heads/master
2020-04-19T11:25:00.641970
2019-01-29T14:20:48
2019-01-29T14:20:48
168,166,750
0
0
null
null
null
null
UTF-8
Swift
false
false
4,591
swift
// // AppDelegate.swift // foodie_ios // // Created by Matthew Dizon on 1/6/19. // Copyright © 2019 dizon. All rights reserved. // import UIKit import CoreData @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:. // Saves changes in the application's managed object context before the application terminates. self.saveContext() } // MARK: - Core Data stack lazy var persistentContainer: NSPersistentContainer = { /* The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. */ let container = NSPersistentContainer(name: "foodie_ios") container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. /* Typical reasons for an error here include: * The parent directory does not exist, cannot be created, or disallows writing. * The persistent store is not accessible, due to permissions or data protection when the device is locked. * The device is out of space. * The store could not be migrated to the current model version. Check the error message to determine what the actual problem was. */ fatalError("Unresolved error \(error), \(error.userInfo)") } }) return container }() // MARK: - Core Data Saving support func saveContext () { let context = persistentContainer.viewContext if context.hasChanges { do { try context.save() } catch { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. let nserror = error as NSError fatalError("Unresolved error \(nserror), \(nserror.userInfo)") } } } }
[ 294405, 243717, 163848, 313353, 320008, 320014, 313360, 288275, 289300, 322580, 290326, 329747, 139803, 322080, 306721, 229411, 322083, 296483, 306726, 309287, 308266, 292907, 217132, 322092, 40495, 316465, 288306, 322102, 324663, 164408, 308281, 322109, 286783, 313409, 315457, 313413, 349765, 320582, 309832, 288329, 242250, 215117, 196177, 241746, 344661, 231000, 212571, 300124, 287323, 309342, 325220, 306790, 290409, 311914, 296043, 310378, 152685, 239726, 307310, 334446, 322666, 292466, 307315, 314995, 314487, 291450, 314491, 222846, 288383, 318599, 312970, 311444, 239252, 294038, 311449, 323739, 300194, 233638, 298662, 233644, 286896, 300208, 286389, 294070, 125111, 321212, 309439, 235200, 284352, 296641, 242371, 302787, 284360, 321228, 319181, 298709, 284374, 189654, 182486, 320730, 241371, 311516, 357083, 179420, 322272, 317665, 298210, 165091, 311525, 288489, 290025, 229098, 307436, 304365, 323310, 125167, 313073, 286455, 306424, 322299, 302332, 319228, 319231, 184576, 309505, 241410, 311043, 366339, 309509, 318728, 125194, 234763, 321806, 125201, 296218, 313116, 326434, 237858, 300836, 313125, 295716, 289577, 125226, 133421, 317233, 241971, 316726, 318264, 201530, 313660, 159549, 287038, 218943, 292159, 182079, 288578, 301893, 234828, 292172, 379218, 300882, 321364, 243032, 201051, 230748, 258397, 298844, 294238, 300380, 291169, 199020, 293741, 319342, 316788, 313205, 244598, 292212, 124796, 317821, 305022, 303999, 313215, 314241, 196988, 242050, 243072, 325509, 293767, 316300, 306576, 322448, 308114, 319900, 298910, 313250, 308132, 316327, 306605, 316334, 324015, 324017, 200625, 316339, 300979, 322998, 67000, 296888, 316345, 300987, 319932, 310718, 292288, 317888, 323520, 312772, 214980, 298950, 306632, 310733, 289744, 310740, 235994, 286174, 315359, 240098, 323555, 236008, 319465, 248299, 311789, 326640, 203761, 320498, 188913, 314357, 288246, 309243, 300540, 310782 ]
7bdaa6af5475028cf0388f5a8fbc4669acee1855
22b0f862362e15f642570312ba2e1ff006d8f69d
/EdCons/main.swift
dae22b5d4cadf954da141e7aceb41a3b95508ea5
[]
no_license
vernplum/EdCons
9ef25d41044905b4ac32bf9d685b79ce6b6e6ec6
b1efb8376d9830d5c263e7a2a0df0551778968ce
refs/heads/master
2021-04-26T14:51:52.876265
2018-02-12T08:34:34
2018-02-12T08:34:34
121,220,660
0
0
null
null
null
null
UTF-8
Swift
false
false
210
swift
// // main.swift // EdCons // // Created by Edmund Quek on 2/12/18. // Copyright © 2018 Edmund Quek. All rights reserved. // import Foundation let myObj = MyClass() print(myObj.splitWord("TOOTSIE"))
[ -1 ]
64d27882a576e115d009db9509de0128504e94ec
f1d63b6cef3876a9782df02eaade9e56110d444a
/SKUAD/protocols/EndPointType.swift
4fc2d4af810479f87aeb3431074e7caffd790a46
[]
no_license
virendall/skuad_ios_assessment
89595818c2a47831f652a42a2faec3d59a6da98e
d0388145622a29fd90aa0a313f4668fd1b700651
refs/heads/main
2023-01-01T16:00:16.208475
2020-10-31T09:13:40
2020-10-31T09:13:40
308,701,106
0
0
null
null
null
null
UTF-8
Swift
false
false
389
swift
// // EndPointType.swift // SKUAD // // Created by Virender Dall on 30/10/20. // Copyright © 2020 Virender Dall. All rights reserved. // import Foundation import Alamofire public typealias Headers = [String : String] public protocol EndPointType { var baseURL: String { get } var url: String { get } var httpMethod: HTTPMethod { get } var headers: Headers { get } }
[ -1 ]
d6af7ddca05206ea165383edb9f27a3c452097d5
1aed865ab2310a189cee2758b78e1023f37534a4
/MAMA/ViewController.swift
cef4f5a7dbcf691d41d6616ae72cccb13e5d0bfe
[]
no_license
xionghx/MAMA_fundation
a03ce27c377dc5dae4309f0674825093d6c7b0fd
97f98c413288fbc77a03da0301074374f61d892f
refs/heads/master
2020-04-02T03:15:58.162260
2016-07-06T14:12:05
2016-07-06T14:12:05
62,726,309
0
0
null
null
null
null
UTF-8
Swift
false
false
268
swift
// // ViewController.swift // MAMA // // Created by xionghuanxin on 7/6/16. // Copyright © 2016 xionghuanxin. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } }
[ 287572 ]
62d0f8eac117170e195bfaf082dac6fcdfd522a1
a0ea8c0f259cf980d82278ec1636671483dfd125
/learnit/CardDetailViewController.swift
35eea259e09378ac5072d80c85fc70d4e49cdc20
[]
no_license
MatthewMcguire/LearnIt
d5b0c418092b1c2741c8e800ae67c6c501f9964e
cc43f0c4f544ff7a63d121b004388a6223ed7e56
refs/heads/master
2020-12-02T06:15:13.478572
2017-09-04T20:18:16
2017-09-04T20:18:16
96,806,140
1
0
null
null
null
null
UTF-8
Swift
false
false
2,959
swift
// // CardDetailViewController.swift // learnit // // Created by Matthew McGuire on 7/10/17. // Copyright © 2017 Matthew McGuire. All rights reserved. // import UIKit class CardDetailViewController: UIViewController { var selectedIndexPath : IndexPath? var currentCard : CardObject? var hasChangesToSave : Bool = false @IBOutlet weak var faceOneField: UITextField! @IBOutlet weak var faceTwoField: UITextField! @IBOutlet weak var tagsField: UITextField! @IBOutlet weak var isActiveSwitch: UISwitch! @IBOutlet weak var isKnownSwitch: UISwitch! @IBOutlet weak var studyTodaySwitch: UISwitch! @IBOutlet weak var difficultyField: UILabel! @IBOutlet weak var idealIntervalField: UILabel! @IBOutlet weak var correctTimesField: UILabel! @IBOutlet weak var incorrectTimesFields: UILabel! @IBOutlet weak var forgottenTimesField: UILabel! @IBOutlet weak var lastCorrectField: UILabel! override func viewDidLoad() { super.viewDidLoad() navigationController?.setNavigationBarHidden(false, animated: true) self.navigationItem.title = "Update" populateFields() } func populateFields() { guard let cc = currentCard else { return } faceOneField.text = cc.cardInfo.faceOne faceTwoField.text = cc.cardInfo.faceTwo tagsField.text = cc.cardInfo.tags isActiveSwitch.isOn = cc.cardInfo.isActive isKnownSwitch.isOn = cc.cardInfo.isKnown studyTodaySwitch.isOn = cc.cardInfo.studyToday showProgressDetails(cc) } override func viewWillDisappear(_ animated: Bool) { if hasChangesToSave == true { if let cc = currentCard { updateItem(indexPath: selectedIndexPath!, withValues: cc) } } } func showProgressDetails(_ cc: CardObject) { let dateFormatter = mediumDateFormat() difficultyField.text = String(format:"%.2f", cc.cardInfo.diffRating!) correctTimesField.text = "\(cc.cardInfo.numCorr)" incorrectTimesFields.text = "\(cc.cardInfo.numIncorr)" forgottenTimesField.text = "\(cc.cardInfo.numForgot)" idealIntervalField.text = String(format:"%.2f", cc.cardInfo.idealInterval!) if let ccLastCorrect = cc.cardInfo.lastAnswerCorrect { lastCorrectField.text = dateFormatter.string(from: ccLastCorrect as Date) } else { lastCorrectField.text = "---" } } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
1145e6018ef11b195cf4c2c304a832447bf48d47
ffc38ace0b63af3099c93578efc3a424fe833237
/AirQuality/City List/CityListViewModel.swift
91df9b76550844eaaedd3995c2fe773fedf7a2b0
[]
no_license
amycheong19/AirQuality
4f837e6933dce49d6585ba9fa9cb722dd72234ce
1e77376a9774a5e76872a87f17e9f47df1488847
refs/heads/master
2020-04-10T21:28:12.551776
2018-12-12T03:29:25
2018-12-12T03:29:25
161,297,273
0
0
null
null
null
null
UTF-8
Swift
false
false
1,364
swift
// // CityListViewModel.swift // AirQuality // // Created by Amy Cheong on 18/11/18. // Copyright © 2018 Amy Cheong. All rights reserved. // import Foundation import Moya final class CityListViewModel: ViewModel<CityListViewDependency> { struct DataSourceContext: ViewContext { var airQualityArray: [AirQuality] = [] var filteredAirQualityArray: [AirQuality] = [] } var stateChanged: ((ViewState, DataSourceContext?) -> Void)? func fetchDataSource(){ dependency?.airQualityServiceProvider().request(.getCurrentAirQuality) { result in switch result { case .success(let response): do { let results = try JSONDecoder().decode(AirQuality.self, from: response.data) self.stateChanged?(.ideal, .init(airQualityArray: [results], filteredAirQualityArray: [results])) } catch let error { debugPrint(error) } case .failure(let error): debugPrint(error) } } } func filter(airQualityArray: [AirQuality], query: String) { let filteredCities = airQualityArray.filteredBySearchText(query) stateChanged?(.ideal, .init(airQualityArray: airQualityArray, filteredAirQualityArray: filteredCities)) } }
[ -1 ]
8e16f3cb3a268c4483535866d80a9a99f3ddd237
06db39f1b04beb45d5b173cee18cc9177189b579
/Yelp/CheckBox.swift
28f12e51434654f5bc7938ad93f3fda0af3760cd
[ "Apache-2.0" ]
permissive
ngominhtrint/yelp
15c13007bf30c9f0293e1c9e8bba46c10aff7c99
398a18bb39be5cf0941989c5d0a73cb455bead1e
refs/heads/master
2021-01-10T07:07:38.113774
2016-03-22T04:47:25
2016-03-22T04:47:25
54,329,173
0
0
null
null
null
null
UTF-8
Swift
false
false
1,248
swift
// // CheckBox.swift // Yelp // // Created by TriNgo on 3/20/16. // Copyright © 2016 Timothy Lee. All rights reserved. // import UIKit class CheckBox: UIButton { // Images let checkedImage = UIImage(named: "is_check")! as UIImage let uncheckedImage = UIImage(named: "is_uncheck")! as UIImage // Bool property var isChecked: Bool = false { didSet{ if isChecked == true { self.setImage(checkedImage, forState: .Normal) } else { self.setImage(uncheckedImage, forState: .Normal) } } } override func awakeFromNib() { self.addTarget(self, action: "buttonClicked:", forControlEvents: UIControlEvents.TouchUpInside) self.isChecked = false } func buttonClicked(sender: UIButton) { if sender == self { if isChecked == true { isChecked = false } else { isChecked = true } } } /* // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. override func drawRect(rect: CGRect) { // Drawing code } */ }
[ -1 ]
1e641077f33acd77ab0b3424dca3b45f6b42d91f
8cc56b65aedd18b9cb5276ed1da0dc9eb68fa9f4
/Jet2Travel/AppDelegate.swift
775cbe456772549e2e43e149390613eaa72779a4
[]
no_license
VijayMasal/Jet2Travel
1fad12c82c6181642c4027bd93982df60fc5b0c3
9d632366cff1f688efa8c30d0f2198db5a1a413e
refs/heads/master
2021-02-18T15:34:22.197921
2020-03-08T09:47:15
2020-03-08T09:47:15
245,207,472
0
0
null
null
null
null
UTF-8
Swift
false
false
1,418
swift
// // AppDelegate.swift // Jet2Travel // // Created by Vijay Masal on 05/03/20. // Copyright © 2020 Vijay Masal. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 163891, 213048, 376889, 385081, 393275, 376905, 327756, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 368752, 417924, 262283, 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, 377383, 197159, 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, 164538, 328378, 328386, 352968, 344776, 352971, 418507, 352973, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 336643, 344835, 344841, 361230, 336659, 418580, 418585, 434970, 369435, 418589, 262942, 418593, 336675, 328484, 418598, 418605, 336696, 361273, 328515, 336708, 328519, 336711, 361288, 328522, 336714, 426841, 197468, 361309, 361315, 361322, 328573, 377729, 369542, 361360, 222128, 345035, 345043, 386003, 386011, 386018, 386022, 435187, 328702, 328714, 361489, 386069, 336921, 386073, 336925, 345118, 377887, 345133, 345138, 386101, 197707, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 361598, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 345267, 386258, 328924, 66782, 222437, 328941, 386285, 386291, 345376, 353570, 345379, 410917, 345382, 337205, 345399, 378169, 369978, 337222, 337229, 337234, 263508, 402791, 345448, 271730, 378227, 271745, 181638, 353673, 181643, 181654, 230809, 181670, 181673, 337329, 181681, 181684, 181690, 361917, 181696, 337349, 181703, 337365, 271839, 329191, 361960, 329194, 116210, 337398, 329226, 419339, 419343, 419349, 345625, 419355, 370205, 419359, 419362, 394786, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 214610, 419410, 345701, 394853, 222830, 370297, 403070, 353919, 403075, 198280, 345736, 403091, 345749, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 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, 345930, 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, 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, 420376, 330267, 354855, 10828, 199249, 174695, 248425, 191084, 338543, 191092, 346742, 330383, 354974, 150183, 174774, 248504, 174777, 223934, 355024, 273108, 355028, 264918, 183005, 436962, 338660, 338664, 264941, 207619, 264964, 338700, 256786, 199452, 363293, 396066, 346916, 396069, 215853, 355122, 355131, 355140, 355143, 338763, 355150, 330580, 355166, 265055, 355175, 387944, 355179, 330610, 330642, 355218, 412599, 207808, 379848, 396245, 330710, 248792, 248798, 347105, 257008, 183282, 265207, 330748, 265214, 330760, 330768, 248862, 396328, 158761, 199728, 330800, 396336, 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, 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, 249214, 175486, 175489, 249218, 249227, 249234, 175513, 175516, 396705, 175522, 355748, 396722, 208311, 388542, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 249308, 339420, 339424, 339428, 339434, 249328, 69113, 372228, 339461, 208398, 380432, 175635, 339503, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 372353, 224897, 216707, 339588, 126596, 421508, 224904, 224909, 159374, 11918, 339601, 126610, 224913, 224916, 224919, 126616, 208538, 224922, 224926, 224929, 224932, 257704, 224936, 224942, 257712, 224947, 257716, 257720, 224953, 257724, 224959, 257732, 224965, 224969, 339662, 224975, 257747, 224981, 224986, 224993, 257761, 257764, 224999, 339695, 225012, 257787, 225020, 339710, 257790, 225025, 257794, 339721, 257801, 257804, 225038, 257807, 225043, 167700, 372499, 225048, 257819, 225053, 225058, 339747, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 225079, 397112, 225082, 397115, 225087, 225092, 225096, 323402, 257868, 225103, 257871, 397139, 225108, 225112, 257883, 257886, 225119, 257890, 339814, 225127, 257896, 274280, 257901, 225137, 339826, 257908, 225141, 257912, 257916, 225148, 257920, 225155, 339844, 225165, 397200, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 405533, 430129, 266294, 266297, 217157, 421960, 356439, 421990, 266350, 356466, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 225444, 438436, 225447, 225450, 258222, 225455, 430256, 225458, 225461, 225466, 389307, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 225493, 266453, 225496, 225499, 225502, 225505, 356578, 217318, 225510, 225514, 225518, 372976, 381176, 389380, 61722, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 225597, 332097, 201028, 348488, 332106, 332117, 348502, 250199, 250202, 332125, 250210, 348525, 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, 348743, 381512, 324170, 324173, 324176, 389723, 332380, 381545, 340627, 184982, 373398, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 373449, 332493, 357069, 357073, 332511, 332520, 340718, 332533, 348924, 373510, 389926, 152370, 348978, 340789, 348982, 398139, 127814, 357206, 389978, 430939, 357211, 357214, 201579, 201582, 349040, 340849, 201588, 430965, 381813, 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, 381946, 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, 349319, 210055, 210067, 210071, 210077, 210080, 210084, 251044, 185511, 210088, 210095, 210098, 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, 259421, 365921, 333154, 251235, 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, 153302, 333534, 366307, 366311, 431851, 366318, 210672, 366321, 366325, 210695, 268041, 210698, 366348, 210706, 399128, 333594, 358191, 210739, 366387, 399159, 358200, 325440, 366401, 341829, 325446, 46920, 341834, 341838, 341843, 415573, 358234, 341851, 350045, 399199, 259938, 399206, 268143, 358255, 399215, 358259, 341876, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 358339, 333774, 358371, 350189, 350193, 333818, 350202, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350240, 350244, 350248, 178218, 350251, 350256, 350259, 350271, 243781, 350285, 374864, 342111, 342133, 374902, 432271, 333997, 334011, 260289, 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, 268701, 342430, 416157, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 195039, 334304, 334311, 375277, 334321, 350723, 186897, 342545, 334358, 342550, 342554, 334363, 358941, 350761, 252461, 334384, 358961, 383536, 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, 260924, 326467, 244551, 326473, 326477, 326485, 326490, 342874, 326502, 375656, 433000, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 342915, 400259, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 326598, 359366, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 367723, 384107, 187502, 343154, 384114, 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, 425845, 262005, 147317, 262008, 262011, 155516, 155521, 155525, 360326, 376714, 262027, 155531, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 384977, 393169, 155611, 155619, 253923, 155621, 327654, 253926, 393203, 360438, 253943, 393206, 393212, 155646 ]
e53f5f1c0df738fb42261b850bd7910adb7d85a0
e84a5de8490bf2aff8052a3b5f9b8a29d7080b9d
/blac_a06/blac_a06/GameMenuScene.swift
2362f95d2400ea2adad4790c6bc1258af8380354
[]
no_license
Qblack/CP469
77a5483f3a3740e5e668a0b6401c4e98f0d126c5
05404ff5637f8d977c9d7aa749f07dbdf9daaffa
refs/heads/master
2021-05-01T00:29:10.029104
2015-03-30T21:24:04
2015-03-30T21:24:04
29,488,338
0
1
null
null
null
null
UTF-8
Swift
false
false
3,205
swift
// // GameMenuScene.swift // blac_a06 // // Created by Quinton Black on 2015-03-11. // Copyright (c) 2015 Quinton Black. All rights reserved. // import Foundation import SpriteKit class GameMenuScene : SKScene { var playButton: SKSpriteNode? var musicOffButton: SKSpriteNode? var musicOnButton: SKSpriteNode? var instructionButton: SKSpriteNode? override init(size: CGSize) { super.init(size: size) backgroundColor = SKColor.whiteColor() let label = SKLabelNode(fontNamed: "Chalkduster") label.text = "Super Mario Shooter" label.fontSize = 40 label.fontColor = SKColor.blackColor() label.position = CGPoint(x: size.width/2, y: size.height/8*7) self.addChild(label) instructionButton = SKSpriteNode(imageNamed: "InstructionButton.png") instructionButton!.name="instructionButton" instructionButton!.position = CGPoint(x:CGRectGetMidX(self.frame), y:size.height/8*5); self.addChild(instructionButton!) playButton = SKSpriteNode(imageNamed: "PlayButton.png") playButton!.name="playButton" playButton!.position = CGPoint(x:CGRectGetMidX(self.frame), y:size.height/8*4); self.addChild(playButton!) musicOffButton = SKSpriteNode(imageNamed: "StopMusic.png") musicOffButton!.name="musicOffButton" musicOffButton!.position = CGPoint(x:CGRectGetMidX(self.frame), y:size.height/8*3); self.addChild(musicOffButton!) musicOnButton = SKSpriteNode(imageNamed: "PlayMusic.png") musicOnButton!.name="musicOnButton" musicOnButton!.position = CGPoint(x:CGRectGetMidX(self.frame), y:size.height/8*2); self.addChild(musicOnButton!) } required init(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func touchesBegan(touches: NSSet, withEvent event: UIEvent) { /* Called when a touch begins */ for touch: AnyObject in touches { let location = touch.locationInNode(self) let theNode = self.nodeAtPoint(location) if theNode.name == playButton!.name { let touchScene = GameScene(size: self.size) let transition = SKTransition.crossFadeWithDuration(1) self.view?.presentScene(touchScene, transition: transition) } else if theNode.name == musicOffButton!.name{ if(nil != backgroundMusicPlayer){ backgroundMusicPlayer.stop() } }else if theNode.name == musicOnButton!.name{ playBackgroundMusic("background-music-aac.caf") }else if theNode.name == instructionButton!.name{ let noTouchScene = InstructionScene(size: self.size) let transition = SKTransition.flipHorizontalWithDuration(1) self.view?.presentScene(noTouchScene, transition: transition) } } // for touches } // touchesBegan }
[ -1 ]
ccd2559f66deadb044e9088c23ff75f1daf3bcd8
3c22e88d53ab7a5a4fbfb6a6dbaaeb86e9507f6f
/DhawaAlkhreej/DhawaAlkhreej/DataLayer/Models/WeightedAverage+Model.swift
881fd63882a86a8dcbd1ea3bedb242b082a5835c
[ "MIT" ]
permissive
cs4alhaider/DhawaAlkhreej
0b3df80314d70bbd03f978650da982a968d8ac76
c36e4cf9dece0f578da92c9aad8fd2ba4c159de4
refs/heads/master
2020-05-24T12:51:04.910588
2020-02-04T20:13:12
2020-02-04T20:13:12
187,277,038
1
5
MIT
2020-02-04T20:13:14
2019-05-17T20:22:57
Swift
UTF-8
Swift
false
false
377
swift
// // WeightedAverage+Model.swift // DhawaAlkhreej // // Created by Abdullah Alhaider on 20/06/2019. // Copyright © 2019 DhawaAlkhreej. All rights reserved. // import Foundation enum WeightedAverageModel: String, Codable { case female case male enum CodingKeys: String, CodingKey { case female = "Female" case male = "male" } }
[ -1 ]
e77e1ecb91f45bd2d50e65b95aad41ebbb76ae4d
5ad314bdb17f600b96caf209929efb0f276780af
/Betterest/Models/Extensions.swift
93f73cc52aae5790b92719171fdc5389389b7f84
[]
no_license
umarqattan/BetterestBeta
4e26e81fa2cbaa9f141926f4576f4596e0a675a7
cbb6afdce0a18ce3294c945a0fcc431035b77464
refs/heads/master
2021-07-05T14:49:38.212149
2017-09-19T05:04:18
2017-09-19T05:04:18
null
0
0
null
null
null
null
UTF-8
Swift
false
false
848
swift
// // Extensions.swift // Betterest // // Created by Umar Qattan on 9/18/17. // Copyright © 2017 Umar Qattan. All rights reserved. // import Foundation import UIKit extension NSAttributedString { func height(withConstrainedWidth width: CGFloat) -> CGFloat { let constraintRect = CGSize(width: width, height: .greatestFiniteMagnitude) let boundingBox = boundingRect(with: constraintRect, options: .usesLineFragmentOrigin, context: nil) return ceil(boundingBox.height) } func width(withConstrainedHeight height: CGFloat) -> CGFloat { let constraintRect = CGSize(width: .greatestFiniteMagnitude, height: height) let boundingBox = boundingRect(with: constraintRect, options: .usesLineFragmentOrigin, context: nil) return ceil(boundingBox.width) } }
[ 413063, 416810, 27755, 12210, 290010, 316251, 164478, 153119 ]
3510fdcb82af24df6058eea6e23ef726a735c689
ad19ab426b391a1d905c642889a914be23ccbe77
/NUTEE/Global/Models/SignIn.swift
e69d926dab447a1936c3a55f230b9651219fe12e
[]
no_license
team-nutee/NUTEE_iOS
ec043ca289dc05eb4f0c84bc2b4b437e5aaca630
f657094998bd8b66b69cacb83d8c9b4da5ee694b
refs/heads/master
2023-08-24T20:14:31.902282
2021-03-31T11:49:27
2021-03-31T11:49:27
281,335,285
3
0
null
null
null
null
UTF-8
Swift
false
false
1,246
swift
// // SignIn.swift // Nutee // // Created by Junhyeon on 2020/02/13. // Copyright © 2020 S.OWL. All rights reserved. // import Foundation // MARK: - SignIn struct SignIn: Codable { let code: Int let message: String let body: SignInBody let links: Links enum CodingKeys: String, CodingKey { case code, message, body case links = "_links" } init(from decoder: Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) code = (try? values.decode(Int.self, forKey: .code)) ?? 0 message = (try? values.decode(String.self, forKey: .message)) ?? "" body = (try? values.decode(SignInBody.self, forKey: .body)) ?? SignInBody.init(memberId: 0, accessToken: "", refreshToken: "") links = (try? values.decode(Links.self, forKey: .links)) ?? Links.init(linksSelf: SelfClass.init(href: "")) } } // MARK: - SignInBody struct SignInBody: Codable { let memberId: Int let accessToken, refreshToken: String } // MARK: - Links struct Links: Codable { let linksSelf: SelfClass enum CodingKeys: String, CodingKey { case linksSelf = "self" } } // MARK: - SelfClass struct SelfClass: Codable { let href: String }
[ -1 ]
5b1d2dca2afeaf5b03c3414b4a79b47d3d749daf
2a73023b48b6cb3a0eeae221cbb0d1e4c40f018c
/comp228ass 2/comp228ass/pinsCollection.swift
4709711ddb0fcf7b0d4ef33f965ae99bd1f066ed
[]
no_license
ZhouzheWu/Artworks-on-Campus
bf19ad06c06ef2586063b1b6581cbd223da32b80
91f41a6e9c9b66f6069beb0436baac23e05d1e04
refs/heads/master
2020-12-05T05:49:03.847395
2020-01-06T05:15:20
2020-01-06T05:15:20
232,026,135
0
0
null
null
null
null
UTF-8
Swift
false
false
724
swift
// // pinsCollection.swift // comp228ass // // Created by 舟喆 吴 on 07/05/2019. // Copyright © 2019 Zhouzhe Wu. All rights reserved. // import UIKit import MapKit import CoreData class pinsCollection: NSObject,MKAnnotation{ let title: String? let coordinate: CLLocationCoordinate2D let location: String let subtitle: String? var artworks = [artworkOne]() init( location: String, coordinate: CLLocationCoordinate2D, artworks: [artworkOne]) { self.title = location self.location = location self.coordinate = coordinate self.subtitle = "Click here to glance over artworks inside" self.artworks = artworks super.init() } }
[ -1 ]
82f0a0a3bf0fbd587ab693ac2763f52d80726a63
870199dd1056fe03a89b3b09afffb86cbaf0151b
/OnTheMapProject/OnTheMapProject/UdacityAPI.swift
52f4f1d1d439f22ea5a27dfc6783ce233bc2e1c6
[]
no_license
abdullah-alomayri/On-The-Map
29fd24a4728c50f9d88420a80fc3e19906f640a6
29677045d821d735afdde92c8e305c0a511d98d7
refs/heads/master
2020-06-12T02:25:34.243701
2019-06-27T21:52:43
2019-06-27T21:52:43
194,166,913
0
0
null
null
null
null
UTF-8
Swift
false
false
4,971
swift
// // UdacityAPI.swift // OnTheMapProject // // Created by xXxXx on 22/06/2019. // Copyright © 2019 abdullah. All rights reserved. // import Foundation import UIKit import MapKit class UdacityAPI { static func postSession(with email: String, password: String, completion: @escaping ([String:Any]?, Error?) -> ()) { var request = URLRequest(url: URL(string: "https://onthemap-api.udacity.com/v1/session")!) request.httpMethod = "POST" request.addValue("application/json", forHTTPHeaderField: "Accept") request.addValue("application/json", forHTTPHeaderField: "Content-Type") // encoding a JSON body from a string, can also use a Codable struct request.httpBody = "{\"udacity\": {\"username\": \"\(email)\", \"password\": \"\(password)\"}}".data(using: .utf8) let session = URLSession.shared let task = session.dataTask(with: request) { data, response, error in if error != nil { // Handle error… completion(nil, error) return } let range = 5..<data!.count let newData = data?.subdata(in: range) /* subset response data! */ print(String(data: newData!, encoding: .utf8)!) let result = try! JSONSerialization.jsonObject(with: newData!, options: JSONSerialization.ReadingOptions.allowFragments) as! [String:Any] completion(result, nil) } task.resume() } static func deleteSession(completion: @escaping (Error?) -> ()) { var request = URLRequest(url: URL(string: "https://onthemap-api.udacity.com/v1/session")!) request.httpMethod = "DELETE" var xsrfCookie: HTTPCookie? = nil let sharedCookieStorage = HTTPCookieStorage.shared for cookie in sharedCookieStorage.cookies! { if cookie.name == "XSRF-TOKEN" { xsrfCookie = cookie } } if let xsrfCookie = xsrfCookie { request.setValue(xsrfCookie.value, forHTTPHeaderField: "X-XSRF-TOKEN") } let session = URLSession.shared let task = session.dataTask(with: request) { data, response, error in if error != nil { // Handle error… completion(error) return } let range = 5..<data!.count let newData = data?.subdata(in: range) /* subset response data! */ print(String(data: newData!, encoding: .utf8)!) completion(nil) } task.resume() } class Parse { static func postStudentLocation(link: String, locationCoordinate: CLLocationCoordinate2D, locationName: String, completion: @escaping (Error?) -> ()) { var request = URLRequest(url: URL(string: "https://onthemap-api.udacity.com/v1/StudentLocation")!) request.httpMethod = "POST" request.addValue("application/json", forHTTPHeaderField: "Content-Type") request.httpBody = "{\"uniqueKey\": \"1234\", \"firstName\": \"John\", \"lastName\": \"Doe\",\"mapString\": \"Mountain View, CA\", \"mediaURL\": \"\(link)\",\"latitude\": \(locationCoordinate.latitude), \"longitude\": \(locationCoordinate.longitude)}".data(using: .utf8) let session = URLSession.shared let task = session.dataTask(with: request) { data, response, error in if error != nil { // Handle error… completion(error) return } print(String(data: data!, encoding: .utf8)!) completion(nil) } task.resume() } static func getStudentsLocations(completion: @escaping ([StudentLocation]?, Error?) -> ()) { var request = URLRequest(url: URL(string: "https://onthemap-api.udacity.com/v1/StudentLocation?order=-updatedAt&limit=100")!) let session = URLSession.shared let task = session.dataTask(with: request) { data, response, error in if error != nil { // Handle error... completion(nil, error) return } print(String(data: data!, encoding: .utf8)!) let dict = try! JSONSerialization.jsonObject(with: data!, options: JSONSerialization.ReadingOptions.mutableLeaves) as! [String:Any] guard let results = dict["results"] as? [[String:Any]] else {return} let resultsData = try! JSONSerialization.data(withJSONObject: results, options: .prettyPrinted) let studentsLocations = try! JSONDecoder().decode([StudentLocation].self, from: resultsData) Global.shared.studentsLocations = studentsLocations completion(studentsLocations,nil) } task.resume() } } }
[ -1 ]
ad82bb650218bc48ec79fbe6d214e64762d056df
79be1da5d9f8027ad0012bdf376713e8745deffc
/Chapter 11 - Chat App/ChatAppFinished/ChatAppFinished/ChatController.swift
f6193868a41ecd5ff57a9de9c8686441672df73e
[]
no_license
promildtech/MasteringSwiftUIResources
257738ea782b5ee51a2a2784046850bf6e0b31e2
19797fcf3a5a7fcffe8bb59ed7a0f23024a81e64
refs/heads/master
2023-03-19T01:52:26.263563
2020-09-18T14:22:12
2020-09-18T14:22:12
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,398
swift
// // ChatController.swift // ChatAppFinished // // Created by Andreas Schultz on 07.10.19. // Copyright © 2019 Andreas Schultz. All rights reserved. // import Foundation import SwiftUI import Combine class ChatController: ObservableObject { var messages = [ChatMessage]() let objectWillChange = PassthroughSubject<ChatController,Never>() func sendMessage(messageText: String) { let newChat = databaseChats.childByAutoId() let messageToSend = ["username": UserDefaults.standard.string(forKey: "username") ?? "Unknown user", "messageText": messageText] newChat.setValue(messageToSend) } func receiveMessages() { let query = databaseChats.queryLimited(toLast: 100) _ = query.observe(.childAdded, with: { [weak self] snapshot in if let data = snapshot.value as? [String: String], let retrievedUsername = data["username"], let retrievedMessageText = data["messageText"], !retrievedMessageText.isEmpty { let retrievedMessage = ChatMessage(messageText: retrievedMessageText, username: retrievedUsername) self?.messages.append(retrievedMessage) self?.objectWillChange.send(self!) } }) } }
[ -1 ]
fe6b1720dac1c0fbf0f9c916582b5553cf04642e
b9e9b4843e99de70700cc7e741e1a96c461f1533
/Projects 7-9/Projects 7-9UITests/Projects_7_9UITests.swift
2ee8bcbb0ace19556976c830cdd3be0c481435a0
[]
no_license
manuelteixeira/100_days_swiftUI
6b197946d0755ce630bc4d32ae55a05250d29cfb
c8792f40eb8b48301d22c8a4dab66a09d0d8d69a
refs/heads/master
2023-03-22T18:05:11.017741
2021-03-11T08:15:15
2021-03-11T08:15:15
295,805,627
0
1
null
null
null
null
UTF-8
Swift
false
false
1,434
swift
// // Projects_7_9UITests.swift // Projects 7-9UITests // // Created by Manuel Teixeira on 13/11/2020. // import XCTest class Projects_7_9UITests: XCTestCase { override func setUpWithError() throws { // 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 // 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 tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // UI tests must launch the application that they test. let app = XCUIApplication() app.launch() // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testLaunchPerformance() throws { if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { // This measures how long it takes to launch your application. measure(metrics: [XCTApplicationLaunchMetric()]) { XCUIApplication().launch() } } } }
[ 360463, 376853, 344106, 253996, 385078, 163894, 319543, 352314, 376892, 32829, 352324, 352327, 385095, 393291, 163916, 368717, 196687, 254039, 426074, 368732, 180317, 32871, 352359, 221292, 385135, 376945, 385147, 426124, 196758, 49308, 65698, 49317, 377008, 377010, 377025, 377033, 164043, 417996, 254157, 368849, 368850, 139478, 385240, 254171, 147679, 147680, 205034, 254189, 254193, 344312, 262403, 147716, 385291, 368908, 180494, 262419, 368915, 254228, 377116, 254250, 131374, 418095, 336177, 368949, 180534, 155968, 270663, 319816, 368969, 254285, 180559, 377168, 344402, 368982, 270703, 139641, 385407, 385409, 270733, 106893, 385423, 385433, 213402, 385437, 254373, 385448, 385449, 311723, 115116, 385463, 336319, 336323, 188870, 262619, 377309, 377310, 369121, 369124, 270823, 213486, 360945, 139766, 393719, 377337, 254459, 410108, 410109, 262657, 377346, 410126, 262673, 385554, 393745, 254487, 410138, 188957, 377374, 385569, 385578, 377388, 197166, 393775, 418352, 33339, 352831, 33344, 385603, 385612, 426575, 385620, 369236, 270938, 352885, 352886, 344697, 385669, 369285, 344714, 377487, 180886, 426646, 352921, 377499, 344737, 352938, 418479, 164532, 336565, 377531, 377534, 377536, 385737, 385745, 369365, 369366, 385751, 361178, 352989, 352990, 418529, 295649, 385763, 369383, 361194, 418550, 344829, 197377, 434956, 418579, 426772, 197398, 426777, 344864, 197412, 336678, 189229, 197424, 197428, 336693, 377656, 426809, 197433, 222017, 377669, 197451, 369488, 385878, 385880, 197467, 435038, 385895, 197479, 385901, 197489, 164730, 254851, 369541, 172936, 189327, 377754, 172971, 140203, 377778, 189365, 377789, 345034, 418774, 386007, 386009, 418781, 386016, 123880, 418793, 222193, 435185, 271351, 435195, 328701, 386049, 328705, 418819, 410629, 377863, 189448, 320526, 361487, 435216, 386068, 254997, 336928, 336930, 410665, 345137, 361522, 386108, 410687, 377927, 361547, 205911, 156763, 361570, 214116, 214119, 402538, 173168, 377974, 66684, 377986, 402568, 140426, 337037, 386191, 410772, 222364, 418975, 124073, 402618, 402632, 148687, 402641, 419028, 222441, 386288, 66802, 271607, 369912, 386296, 369913, 419066, 386300, 386304, 320769, 369929, 320795, 115997, 222496, 369964, 353581, 116014, 66863, 312628, 345397, 345398, 386363, 345418, 353611, 337226, 353612, 378186, 353617, 378201, 312688, 337280, 353672, 263561, 304523, 370066, 9618, 411028, 370072, 148900, 361928, 337359, 329168, 329170, 353751, 329181, 320997, 361958, 271850, 271853, 329198, 411119, 116209, 386551, 312830, 271880, 198155, 329231, 370200, 157219, 157220, 394793, 353875, 99937, 345697, 271980, 206447, 403057, 42616, 337533, 370307, 419462, 149127, 149128, 419464, 411275, 214667, 345753, 255651, 337590, 370359, 403149, 345813, 370390, 272087, 337638, 181992, 345832, 345835, 141037, 173828, 395018, 395019, 395026, 124691, 435993, 345882, 321308, 255781, 362281, 378666, 403248, 378673, 345910, 182070, 182071, 436029, 337734, 272207, 272208, 337746, 362326, 345942, 370526, 345950, 362336, 255844, 214894, 362351, 214896, 124795, 182145, 337816, 124826, 329627, 354210, 436130, 436135, 10153, 362411, 370604, 362418, 362442, 346066, 354268, 436189, 403421, 329696, 354273, 403425, 190437, 354279, 436199, 174058, 337899, 354283, 247787, 329707, 247786, 313322, 436209, 124912, 182277, 346117, 403463, 43016, 354312, 354311, 354310, 436235, 419857, 436248, 346153, 124974, 272432, 403507, 378933, 378934, 436283, 403524, 436293, 436304, 329812, 411738, 272477, 395373, 346237, 436372, 362658, 436388, 125108, 133313, 395458, 338118, 436429, 346319, 321744, 379102, 387299, 18661, 379110, 125166, 149743, 379120, 436466, 125170, 411892, 436471, 395511, 436480, 125184, 272644, 125192, 338187, 338188, 125197, 395536, 125200, 338196, 272661, 379157, 125204, 125215, 125216, 338217, 125225, 125236, 362809, 379193, 395591, 272730, 436570, 215395, 362864, 354672, 272755, 354678, 248188, 313726, 436609, 240003, 436613, 395653, 395660, 264591, 420241, 43416, 436644, 272815, 436659, 338359, 436677, 256476, 420326, 166403, 322057, 420374, 322077, 330291, 191065, 436831, 420461, 313970, 346739, 346741, 420473, 166533, 363155, 346771, 264855, 363161, 436897, 355006, 363228, 436957, 436960, 264929, 338658, 346859, 330476, 35584, 133889, 346889, 264971, 322320, 207639, 363295, 355117, 191285, 273209, 355129, 273211, 355136, 355138, 420680, 355147, 355148, 355153, 387927, 363353, 363354, 322396, 420702, 363361, 363362, 412516, 355173, 355174, 207724, 355182, 207728, 420722, 330627, 387977, 396171, 355216, 224146, 224149, 256918, 256919, 256920, 256934, 273336, 273341, 330688, 379845, 363462, 273353, 207839, 347104, 412653, 248815, 257007, 347122, 437245, 257023, 125953, 396292, 330759, 347150, 330766, 412692, 330789, 248871, 412725, 257093, 404550, 314437, 339031, 404582, 257126, 265323, 396395, 404589, 273523, 363643, 248960, 150656, 363658, 404622, 224400, 265366, 347286, 429209, 339101, 429216, 339106, 380069, 265381, 421050, 339131, 265410, 183492, 421081, 339167, 421102, 363769, 52473, 52476, 412926, 437504, 388369, 380178, 429332, 126229, 412963, 257323, 437550, 273713, 208179, 159033, 347451, 216387, 257353, 257354, 109899, 437585, 331091, 150868, 372064, 429410, 437602, 388458, 265579, 314734, 314740, 314742, 421240, 314745, 388488, 314776, 396697, 396709, 380335, 355761, 421302, 134586, 380348, 216510, 380350, 216511, 200136, 273865, 339403, 372172, 413138, 421338, 437726, 429540, 3557, 3559, 191980, 191991, 216575, 372226, 208397, 323088, 413202, 413206, 388630, 175640, 216610, 372261, 347693, 323120, 396850, 200245, 323126, 134715, 421437, 396865, 413255, 273992, 265800, 421452, 265809, 396885, 265816, 396889, 388699, 396896, 323171, 388712, 388713, 339579, 396927, 224907, 405140, 274071, 208547, 208548, 405157, 388775, 364202, 421556, 224951, 224952, 323262, 323265, 241360, 241366, 224985, 159462, 372458, 397040, 12017, 274170, 175874, 249606, 323335, 372497, 397076, 421657, 339746, 257831, 167720, 241447, 421680, 274234, 241471, 339782, 315209, 241494, 339799, 274276, 274288, 372592, 274296, 339840, 315265, 372625, 118693, 438186, 151492, 380874, 372699, 380910, 380922, 380923, 274432, 372736, 241695, 315431, 430120, 315433, 430127, 405552, 249912, 225347, 421958, 176209, 381013, 53334, 200795, 356446, 438374, 176231, 438378, 217194, 422000, 249976, 266361, 422020, 168069, 381061, 168070, 381071, 323730, 430231, 200856, 422044, 192670, 192671, 258213, 323761, 266427, 356550, 372943, 266447, 258263, 356575, 438512, 372979, 389364, 381173, 135416, 356603, 266504, 61720, 381210, 315674, 389406, 438575, 266547, 397620, 332084, 438583, 127292, 438592, 332100, 348499, 250196, 348501, 389465, 332128, 110955, 242027, 160111, 250227, 438653, 266628, 340356, 225684, 373141, 373144, 389534, 397732, 373196, 242138, 184799, 201195, 324098, 340489, 397841, 258584, 348709, 348710, 397872, 340539, 266812, 438850, 348741, 381515, 348748, 430681, 332379, 184938, 373357, 184942, 176751, 389744, 356983, 356984, 209529, 356990, 373377, 422529, 201348, 152196, 356998, 348807, 356999, 316050, 275102, 176805, 340645, 422567, 176810, 160441, 422591, 135888, 242385, 373485, 373486, 21239, 275193, 348921, 430853, 430860, 62222, 430880, 152372, 160569, 430909, 160576, 348999, 275294, 381791, 127840, 357219, 439145, 242540, 242542, 381811, 201590, 398205, 340865, 349066, 316299, 349068, 381840, 390034, 373653, 430999, 209820, 381856, 398244, 185252, 422825, 381872, 398268, 349122, 398275, 373705, 127945, 340960, 398305, 340967, 398313, 127990, 349176, 201721, 349179, 357380, 398370, 357413, 357420, 21567, 398405, 218187, 250955, 250965, 439391, 250982, 398444, 62574, 357487, 119925, 349304, 349315, 349317, 373902, 177297, 324761, 373937, 373939, 324790, 218301, 259275, 259285, 357594, 414956, 251124, 439550, 439563, 242955, 414989, 259346, 349458, 259347, 382243, 382246, 382257, 382264, 333115, 193853, 251212, 406862, 259408, 316764, 374110, 259449, 382329, 357758, 243073, 357763, 112019, 398740, 374189, 251314, 259513, 54719, 259569, 251379, 398844, 210429, 366081, 431646, 349727, 431662, 374327, 210489, 235069, 349764, 128589, 333389, 333394, 349780, 415334, 54895, 366198, 210558, 210559, 415360, 333438, 415369, 431754, 210569, 267916, 415376, 259741, 153252, 399014, 210601, 202413, 317102, 415419, 259780, 333508, 267978, 333522, 325345, 333543, 431861, 161539, 366358, 169751, 431901, 341791, 325411, 333609, 399148, 202541, 431918, 153392, 431935, 415555, 325444, 325449, 341837, 415566, 431955, 325460, 317268, 341846, 259937, 382820, 415592, 325491, 341878, 276343, 350072, 333687, 317305, 112510, 325508, 333700, 243590, 350091, 350092, 350102, 350108, 333727, 219046, 128955, 219102, 6116, 432114, 415740, 268286, 415744, 333827, 243720, 399372, 153618, 358418, 178215, 325675, 243763, 358455, 325695, 399433, 333902, 104534, 432241, 374913, 374914, 415883, 333968, 333990, 104633, 260285, 268479, 374984, 334049, 325857, 268515, 383208, 317676, 260337, 260338, 375040, 260355, 375052, 194832, 325904, 391448, 334104, 178459, 186660, 268581, 334121, 358698, 325930, 260396, 432435, 358707, 178485, 358710, 14654, 268609, 383309, 383327, 391521, 366948, 416101, 383338, 432503, 432511, 252309, 39323, 317851, 375211, 334259, 129461, 342454, 358844, 317889, 326083, 416201, 129484, 154061, 432608, 195044, 391654, 432616, 334315, 375281, 334345, 432650, 342549, 342560, 416288, 350758, 350759, 358951, 358952, 219694, 219695, 375345, 375373, 416334, 416340, 244311, 416353, 260705, 375396, 268901, 244326, 244345, 375438, 326288, 383668, 342714, 39616, 383708, 269036, 432883, 203511, 342775, 383740, 416509, 432894, 359166, 375552, 162559, 383755, 326413, 326428, 318247, 342827, 318251, 375610, 342846, 416577, 416591, 244569, 375644, 252766, 351078, 342888, 392057, 211835, 269179, 260995, 400262, 392071, 424842, 236427, 252812, 400271, 392080, 400282, 7070, 211871, 359332, 359333, 326571, 252848, 326580, 261045, 261046, 326586, 359365, 211913, 326602, 342990, 252878, 433104, 359380, 433112, 433116, 359391, 187372, 343020, 383980, 383994, 171009, 384004, 433166, 384015, 433173, 326684, 252959, 384031, 375848, 261191, 375902, 375903, 392288, 253028, 351343, 187505, 138354, 392317, 343166, 384127, 392320, 253074, 326803, 359574, 351389, 253098, 367791, 367792, 367798, 343230, 367809, 253124, 113863, 351445, 195809, 253168, 351475, 351489, 367897, 367898, 245018, 130347, 212282, 359747, 359748, 146760, 146763, 114022, 253288, 425327, 163190, 327030, 384379, 253316, 384391, 253339, 253340, 343457, 245160, 359860, 359861, 343480, 425417, 327122, 425434, 310747, 253431, 359931, 187900, 343552, 359949, 253456, 253462, 146976, 245290, 245291, 343606, 163385, 425534, 138817, 147011, 147020, 179800, 196184, 343646, 155238, 204394, 138862, 188021, 425624, 245413, 384693, 376502, 409277, 319176, 409289, 425682, 245471, 155360, 212721, 163575, 319232, 360194, 409355, 155408, 417556, 319289, 384826, 409404, 360253, 409416, 376661, 368471, 425820, 368486, 384871, 409446, 368489, 40809, 425832, 417648, 417658, 360315, 253828, 327556, 425875, 253851, 376733, 204702, 253868, 204722, 188349, 212947, 212953, 360416, 253930, 385011 ]
de4c66d592abc153d784c7b456d9368c2e322c95
e60c7849828c5f0f031c76fe1212f50265fbbf4c
/ValueTableViewController.swift
311c4e960289f1173437bce31b2877a65d18008d
[]
no_license
BUIVER/Eth-wallet
b632a58ee7dbb716038db27a4c54f21036d84be3
3541eba5f9cc4af767b65bdd355c77457138db7c
refs/heads/master
2020-06-12T19:19:22.396267
2019-06-29T11:46:40
2019-06-29T11:46:40
194,399,552
0
0
null
null
null
null
UTF-8
Swift
false
false
2,891
swift
// // ValueTableViewController.swift // Eth wallet // // Created by Ivan Ermak on 5/17/19. // Copyright © 2019 Ivan Ermak. All rights reserved. // import UIKit class ValueViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource { var array = ["ETH", "XRP", "MKR", "JHT"] func numberOfComponents(in pickerView: UIPickerView) -> Int { return 1 } func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { return array.count } func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { return array[row] } @IBOutlet weak var picker: UIPickerView! @IBOutlet weak var table: UITableView! @IBOutlet weak var segment: UISegmentedControl! var classTrans = ["Sales revenue"] var classAmount = ["14.94 $"] var gasAmount = ["0.34 $"] var gasFee = ["Transfer fee"] override func viewDidLoad() { super.viewDidLoad() table.dataSource = self table.delegate = self picker.dataSource = self picker.delegate = self // Do any additional setup after loading the view. } @IBAction func refreshTables(_ sender: Any) { table.reloadData() } /* // 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. } */ } extension ValueViewController: UITableViewDataSource, UITableViewDelegate { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if (segment.selectedSegmentIndex == 0){ return classTrans.count } else {return gasFee.count} } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { debugPrint(segment.selectedSegmentIndex) if (segment.selectedSegmentIndex == 0) { if let cell = tableView.dequeueReusableCell(withIdentifier: "classTrans", for: indexPath) as? TransTableViewCell { cell.amount.text = classAmount[indexPath.row] cell.classes.text = classTrans[indexPath.row] return cell } else {return UITableViewCell()} } else { if let cell = tableView.dequeueReusableCell(withIdentifier: "gasFee", for: indexPath) as? FeeTableViewCell { cell.gasFee.text = gasFee[indexPath.row] cell.sumAmount.text = gasAmount[indexPath.row] return cell } } return UITableViewCell() } }
[ -1 ]
a12398a9a9641191e3bb861e580147552a25374c
77149afb574201bece014b0e57752336c7d6f438
/Tests/Common.swift
b41f7053b6c9b3facafcdc513f3d8127f51e9e8a
[ "MIT" ]
permissive
fhaoquan/SwiftyParse
c677fa23a75a1544c3e470a309d5ca825a4b8118
73c60ebf942ffb1b621ef321febbd95c0db0b718
refs/heads/master
2020-06-20T13:30:22.961749
2019-06-01T08:36:20
2019-06-01T08:36:20
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,746
swift
// // Tests.swift // Tests // // Created by LZephyr on 2017/12/30. // Copyright © 2017年 LZephyr. All rights reserved. // import XCTest @testable import SwiftyParse extension Array where Element: Equatable { public static func == (_ lhs: Array<String>, _ rhs: Array<String>) -> Bool { guard lhs.count == rhs.count else { return false } for index in 0..<lhs.count { if lhs[index] != rhs[index] { return false } } return true } } extension Parser where Result: Equatable, Stream: Equatable { /// 断言parse结果为.success /// /// - Parameters: /// - input: 输入 /// - value: 期望的结果 /// - remain: 期望剩余的输入 func assertSuccess(input: Stream, value: Result, remain: Stream, message: String = "") { switch self.parse(input) { case .success(let (r, rest)): XCTAssert(value == r, message) XCTAssert(rest == remain, message) case .failure(_): XCTAssert(false, message) } } /// 断言解析结果为.failure /// /// - Parameter input: 输入 func assertFailure(input: Stream, message: String = "") { switch self.parse(input) { case .success(_): XCTAssert(false, message) case .failure(_): XCTAssert(true, message) } } } // MARK: - StringParser extension Parser where Result: Equatable, Stream == InputString { func assertSuccess(input: [Character], value: Result, remain: [Character], message: String = "") { switch self.parse(input) { case .success(let (r, rest)): XCTAssert(value == r, "结果: \(r), \(message)") XCTAssert(rest.characters == remain, "剩余: \(rest)") // NOTE: 先不考虑位置的对比 case .failure(_): XCTAssert(false, "输入: \(input), \(message)") } } func assertFailure(input: [Character], message: String = "") { switch self.parse(input) { case .success(_): XCTAssert(false, "输入: \(input), \(message)") case .failure(_): XCTAssert(true, "输入: \(input), \(message)") } } } // MARK: - Test Parser Type typealias TestParser = Parser<String, [String]> func match(_ s: String) -> TestParser { return TestParser(parse: { (strings) -> ParseResult<(String, [String])> in guard let first = strings.first, first == s else { return .failure(ParseError.unkown) } return .success((s, Array(strings.dropFirst()))) }) } extension String { func toChars() -> [Character] { return Array(self) } }
[ -1 ]
126941a3e311c96e88497ed8efacb2d0837fa8f4
621f2669957ddeda91b30af776517823330a9adf
/Connect/AdminFirstViewController.swift
2deef0a8808b1b8a7235577f555cfa24c293631e
[]
no_license
chpalesha/connect
ac254d70e1ba401351d87af90ae1c2ace8f08d45
97c30c72e7d8a3e7cae5eebad4ca7a23312b3e6e
refs/heads/master
2020-05-21T09:42:10.114920
2017-03-11T00:52:41
2017-03-11T00:52:41
84,613,126
0
0
null
null
null
null
UTF-8
Swift
false
false
6,313
swift
// // AdminFirstViewController.swift // Connect // // Created by Chirag Palesha on 12/4/16. // Copyright © 2016 Chirag Palesha. All rights reserved. // import UIKit import FirebaseDatabase import FirebaseStorage import QuartzCore class AdminFirstViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { @IBOutlet weak var tvListOfComplain: UITableView! var complains = [Complain]() var complainsImage = [UIImage]() var complainID = [String]() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. fetchComplainID() //uiTable init tvListOfComplain.dataSource = self tvListOfComplain.delegate = self tvListOfComplain.rowHeight = UITableViewAutomaticDimension tvListOfComplain.estimatedRowHeight = 44 } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } //fetch complain id of all complains func fetchComplainID(){ //get firebase refernce and adds observer to complains (.childAddess -> updates data on when child is added) let url = "" FIRDatabase.database().reference(fromURL: url).child("complain").observe( .childAdded, with: { (snapshot) in //appends complainID array self.complainID.append(snapshot.key) let complain = Complain() //appends dummy complain to complains array self.complains.append(complain) //appends dummy cimage to complainsImage array self.complainsImage.append(#imageLiteral(resourceName: "app")) self.fetchComplain(id: snapshot.key) }) } //fetch complain from id func fetchComplain(id: String){ //add observer to complain (.value -> gets real-time update) let url = "" FIRDatabase.database().reference(fromURL: url ).child("complain").child(id).observe( .value, with: { (snapshot) in //unwrapps snapshot to dictionary if let snap = snapshot.value as? [String: AnyObject] { let complain = Complain() complain.setValuesForKeys(snap) let loc = self.complainID.index(of: id)! //assign complain details according to location of complain id same with image array self.complains[loc] = complain self.requestImage(from: complain.image, loc: loc) DispatchQueue.main.async { //updates table view self.tvListOfComplain.reloadData() } } }) } //search complain in complain id and return location func search(cid: String) -> Int{ var loc = 0 guard complainID.count == 0 else { return -1 } for c in complainID{ if c == cid{ return loc } loc += 1 } return -1 } func maskRoundedImage(image: UIImage) -> UIImage { let square = CGSize(width: min(image.size.width, image.size.height), height: min(image.size.width, image.size.height)) let imageView = UIImageView(frame: CGRect(origin: .zero, size: square)) imageView.contentMode = .scaleAspectFill imageView.image = image imageView.layer.cornerRadius = square.width/2 imageView.layer.masksToBounds = true UIGraphicsBeginImageContextWithOptions(imageView.bounds.size, false, image.scale) guard let context = UIGraphicsGetCurrentContext() else { return image } imageView.layer.render(in: context) let result = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return result! } //request image of complain func requestImage(from url: String, loc: Int){ let imageURL = URL(string: url) if let realImageURL = imageURL{ //request url let request = URLRequest(url: realImageURL) URLSession.shared.dataTask(with: request, completionHandler: { (data, response, error) in if error != nil { return } //if successful converts data to image let uiImage = UIImage(data: data!) if let realUIImage = uiImage{ //updates uiimage to image fetched self.complainsImage[loc] = self.maskRoundedImage(image: realUIImage) } DispatchQueue.main.async { //updtes table view self.tvListOfComplain.reloadData() } }).resume() } } //UITableView Functions func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! CustomTableViewCell cell.lCategory.text = complains[indexPath.row].category cell.lDescription.text = complains[indexPath.row].desc cell.lStatus.text = complains[indexPath.row].status if indexPath.row < complainsImage.count{ cell.leftImage.image = complainsImage[indexPath.row] } return cell } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return complains.count } func numberOfSections(in tableView: UITableView) -> Int { return 1 } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { performSegue(withIdentifier: "segueAdminComplain", sender: self) } //detail view if complain selected override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "segueAdminComplain" { let i = (tvListOfComplain.indexPathForSelectedRow?.row)! let vc = segue.destination as! DetailComplainViewController vc.userID = complains[i].uid vc.complainID = complainID[i] } } }
[ -1 ]
92934ebb0cd8ba70709f96e5ed83fba9aa6a0d6c
b52d739f3a1142e1e62e8f823387d05eb7a3a5bd
/Framework/Presentation Layer/ViewControllers/Abstractions/PopUpWindowViewController.swift
a85700bd1e9d57530322d4c595bc30226e14cbde
[]
no_license
thirtified/identhub-ios
811957f2d3814bffdb16a4ea0e1140a3d3abb704
a3e36e73b21c84da3e20069c1931ef66fe8e266d
refs/heads/main
2023-08-18T21:20:33.417997
2021-09-23T15:12:07
2021-09-23T15:12:07
407,494,966
0
0
null
2021-09-17T10:13:00
2021-09-17T10:12:59
null
UTF-8
Swift
false
false
4,883
swift
// // PopUpWindowViewController.swift // IdentHubSDK // import UIKit /// UIViewController which displays pop up window. internal class PopUpWindowViewController: UIViewController { private enum Constants { enum FontSize { static let big: CGFloat = 20 static let normal: CGFloat = 14 } enum Constraints { static let sides: CGFloat = 16 static let sidesExtended: CGFloat = 24 } static let cornerRadius: CGFloat = 8 } private lazy var popUpWindowView: UIView = { let view = UIView() view.backgroundColor = .sdkColor(.black0) let layer = view.layer layer.cornerRadius = Constants.cornerRadius return view }() private lazy var titleLabel: UILabel = { let label = UILabel() label.font = UIFont.systemFont(ofSize: Constants.FontSize.big) label.numberOfLines = 0 label.textAlignment = .center return label }() private lazy var descriptionLabel: UILabel = { let label = UILabel() label.font = UIFont.systemFont(ofSize: Constants.FontSize.normal) label.textColor = .sdkColor(.base75) label.numberOfLines = 0 return label }() private lazy var buttonsStackView: UIStackView = { let stackView = UIStackView() stackView.distribution = .fillEqually stackView.spacing = Constants.Constraints.sides stackView.axis = .horizontal return stackView }() private lazy var primaryButton: UIButton = { let button = ActionRoundedButton() button.currentAppearance = .dimmed return button }() private var primaryButtonAction: (() -> Void)? private lazy var secondaryButton: UIButton = { let button = ActionRoundedButton() button.currentAppearance = .orange return button }() private var secondaryButtonAction: (() -> Void)? override func viewDidLoad() { super.viewDidLoad() configureUI() } private func configureUI() { view.backgroundColor = UIColor.black.withAlphaComponent(0.5) view.addSubview(popUpWindowView) popUpWindowView.addConstraints { [ $0.equal(.centerY), $0.equal(.leading, constant: Constants.Constraints.sides), $0.equal(.trailing, constant: -Constants.Constraints.sides) ] } popUpWindowView.addSubviews([ titleLabel, descriptionLabel, buttonsStackView ]) titleLabel.addConstraints { [ $0.equal(.top, constant: Constants.Constraints.sidesExtended), $0.equal(.leading, constant: Constants.Constraints.sidesExtended), $0.equal(.trailing, constant: -Constants.Constraints.sidesExtended) ] } descriptionLabel.addConstraints { [ $0.equalTo(titleLabel, .top, .bottom, constant: Constants.Constraints.sidesExtended), $0.equal(.leading, constant: Constants.Constraints.sides), $0.equal(.trailing, constant: -Constants.Constraints.sides) ] } buttonsStackView.addConstraints { [ $0.equalTo(descriptionLabel, .top, .bottom, constant: Constants.Constraints.sidesExtended), $0.equal(.leading, constant: Constants.Constraints.sides), $0.equal(.trailing, constant: -Constants.Constraints.sides), $0.equal(.bottom, constant: -Constants.Constraints.sidesExtended) ] } buttonsStackView.addArrangedSubview(primaryButton) buttonsStackView.addArrangedSubview(secondaryButton) primaryButton.addTarget(self, action: #selector(primaryAction), for: .touchUpInside) secondaryButton.addTarget(self, action: #selector(secondaryAction), for: .touchUpInside) } @objc private func primaryAction() { primaryButtonAction?() } @objc private func secondaryAction() { secondaryButtonAction?() } /// Set title. func setTitle(_ title: String) { titleLabel.text = title } /// Set description. func setDescription(_ description: String) { descriptionLabel.text = description } /// Set title for the button on the left. func setPrimaryButtonTitle(_ title: String) { primaryButton.setTitle(title, for: .normal) } /// Set title for the button on the right. func setSecondaryButtonTitle(_ title: String) { secondaryButton.setTitle(title, for: .normal) } /// Set action for the primary button. func setPrimaryButtonAction(_ action: (() -> Void)?) { primaryButtonAction = action } /// Set action for the secondary button. func setSecondaryButtonAction(_ action: (() -> Void)?) { secondaryButtonAction = action } }
[ -1 ]
0f06d4c4f6458dae4be4d424c2e5fffb908a0fbe
078ce2ae6fc89139de2b6a4d763069255e258af3
/fave/Home Scene/HomeFaveInformationTableViewCellViewModel.swift
97174c768394d51de4981b1d9eab9f18a435f73a
[]
no_license
TechThings/JohnTest
358f5f50541f37e12c3d7b51051c57cff36a0ef9
a4ad6d86bcc4a3de9ef4372013a6ab31444b7f81
refs/heads/master
2021-01-11T14:18:52.384334
2016-11-28T08:00:44
2016-11-28T08:00:44
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,056
swift
// // HomeFaveInformationTableViewCellViewModel.swift // FAVE // // Created by Thanh KFit on 9/11/16. // Copyright © 2016 kfit. All rights reserved. // import UIKit import RxSwift import RxCocoa /** * @author Thanh KFit * * HomeFaveInformationTableViewCellViewModel State */ struct HomeFaveInformationTableViewCellViewModelState { // MARK:- Constant init ( ) { } } /** * @author Thanh KFit * * HomeFaveInformationTableViewCellViewModel */ final class HomeFaveInformationTableViewCellViewModel: ViewModel { // MARK:- State let state: Variable<HomeFaveInformationTableViewCellViewModelState> let version = Variable("") let stagingMode = Variable("") let userProvider: UserProviderDefault init(state: HomeFaveInformationTableViewCellViewModelState = HomeFaveInformationTableViewCellViewModelState() , userProvider: UserProviderDefault = userProviderDefault ) { self.state = Variable(state) self.userProvider = userProvider super.init() self.version.value = "Version \(app.appVersion) (\(app.buildNumber))" self.stagingMode.value = "End point: \(app.mode.name)" } func goToOnBoarding() { if !userProvider.currentUser.value.isGuest { app.logoutSignal.onNext(()) } lightHouseService.navigate .onNext { (viewController) in if let viewController = viewController as? HomeViewController { let vm = OnboardingViewModel() let vc = OnboardingViewController.build(vm) let nvc = RootNavigationController.build(RootNavigationViewModel()) nvc.setViewControllers([vc], animated: true) viewController.view.window?.rootViewController = nvc } } } } // MARK:- Refreshable extension HomeFaveInformationTableViewCellViewModel: Refreshable { func refresh() { } } // MARK:- Statful extension HomeFaveInformationTableViewCellViewModel: Statful {}
[ -1 ]
53cd54fabbc4065880f02fdd097c954a73c2e3b4
574730a511d3e8fce528d81da5744fe295b22865
/IntelligentBasket/IntelligentBasket/Classes/Register/RegisterViewController.swift
3e2050fae1a4d370c62064a5fbde3b522aad20d1
[ "MIT" ]
permissive
lzhseu/IntelligentBasket
ab6423d5cab9a9529e5c60c5ef6ff00bc729f9d4
9a0765287535669fda9e2c55fc158da1b0b50dd2
refs/heads/master
2020-07-05T15:50:28.674189
2019-11-02T11:26:28
2019-11-02T11:26:28
202,690,101
0
1
null
null
null
null
UTF-8
Swift
false
false
5,257
swift
// // RegisterViewController.swift // IntelligentBasket // // Created by 卢卓桓 on 2019/8/17. // Copyright © 2019 zhineng. All rights reserved. // import UIKit import SnapKit private let kButtonW: CGFloat = kScreenW * 2 / 5 private let kButtonEdgeSpace: CGFloat = 20 private let kLabelY: CGFloat = 0.22 * kScreenH class RegisterViewController: BaseViewController { // MARK: - 懒加载属性 private lazy var tipLable: UILabel = { let title = "请选择您想要注册的角色:" return CommonViewFactory.createLabel(title: title, font: UIFont.systemFont(ofSize: 20), textColor: UIColor.black, backColor: UIColor.white) }() private lazy var workerBtn: UIButton = { [weak self] in let btn = CommonViewFactory.createCustomButton(title: "施工人员", font: UIFont.systemFont(ofSize: 18), textColor: UIColor.white, backColor: primaryColor, action: #selector(workerBtnClick), sender: self) btn.layer.cornerRadius = kButtonCornerRadius btn.addTarget(self, action: #selector(btnChangeColor(btn:)), for: .touchDown) return btn }() private lazy var renterBtn: UIButton = { [weak self] in let btn = CommonViewFactory.createCustomButton(title: "租方管理员", font: UIFont.systemFont(ofSize: 18), textColor: UIColor.white, backColor: primaryColor, action: #selector(renterBtnClick), sender: self) btn.layer.cornerRadius = kButtonCornerRadius btn.addTarget(self, action: #selector(btnChangeColor(btn:)), for: .touchDown) return btn }() private lazy var regionBtn: UIButton = { [weak self] in let btn = CommonViewFactory.createCustomButton(title: "区域管理员", font: UIFont.systemFont(ofSize: 18), textColor: UIColor.white, backColor: primaryColor, action: #selector(regionBtnClick), sender: self) btn.layer.cornerRadius = kButtonCornerRadius btn.addTarget(self, action: #selector(btnChangeColor(btn:)), for: .touchDown) return btn }() private lazy var inspectorBtn: UIButton = { [weak self] in let btn = CommonViewFactory.createCustomButton(title: "巡检人员", font: UIFont.systemFont(ofSize: 18), textColor: UIColor.white, backColor: primaryColor, action: #selector(inspectorBtnClick), sender: self) btn.layer.cornerRadius = kButtonCornerRadius btn.addTarget(self, action: #selector(btnChangeColor(btn:)), for: .touchDown) return btn }() // MARK: - 系统回调函数 override func viewDidLoad() { super.viewDidLoad() setUI() makeConstraints() } // MARK: - 重写父类方法 override func setUI() { view.backgroundColor = UIColor.white super.setNavigationBarTitle(title: "注册-选择角色") view.addSubview(tipLable) view.addSubview(workerBtn) view.addSubview(renterBtn) view.addSubview(regionBtn) view.addSubview(inspectorBtn) } override func makeConstraints() { tipLable.snp.makeConstraints { (make) in make.centerX.equalToSuperview() make.top.equalToSuperview().offset(kLabelY) } workerBtn.snp.makeConstraints { (make) in make.centerX.equalToSuperview() make.top.equalTo(tipLable.snp_bottom).offset(30) make.width.equalTo(kButtonW) } renterBtn.snp.makeConstraints { (make) in make.centerX.equalToSuperview() make.top.equalTo(workerBtn.snp_bottom).offset(kButtonEdgeSpace) make.width.equalTo(kButtonW) } regionBtn.snp.makeConstraints { (make) in make.centerX.equalToSuperview() make.top.equalTo(renterBtn.snp_bottom).offset(kButtonEdgeSpace) make.width.equalTo(kButtonW) } inspectorBtn.snp.makeConstraints { (make) in make.centerX.equalToSuperview() make.top.equalTo(regionBtn.snp_bottom).offset(kButtonEdgeSpace) make.width.equalTo(kButtonW) } } } // MARK: - 事件监听函数 extension RegisterViewController { @objc func workerBtnClick(){ normalViewColor(view: workerBtn) pushViewController(viewController: RegisterWorkerViewController(role: UserRole.Worker.rawValue, navTitle: "注册-施工人员"), animated: true) } @objc func renterBtnClick(){ normalViewColor(view: renterBtn) pushViewController(viewController: RegisterBaseViewController(role: UserRole.RentAdmin.rawValue, navTitle: "注册-租方管理员"), animated: true) } @objc func regionBtnClick(){ normalViewColor(view: regionBtn) pushViewController(viewController: RegisterBaseViewController(role: UserRole.AreaAdmin.rawValue, navTitle: "注册-区域管理员"), animated: true) } @objc func inspectorBtnClick(){ normalViewColor(view: inspectorBtn) pushViewController(viewController: RegisterBaseViewController(role: UserRole.Inspector.rawValue, navTitle: "注册-巡检人员"), animated: true) } /// 按下按钮时改变按钮背景颜色 @objc private func btnChangeColor(btn: UIButton){ clickViewColor(view: btn) } }
[ -1 ]
57cde25356a88d37bbfff257aaa454cd525822c7
07875f88ab95ec2bd92eb0ed7f98417e979da69a
/weather/Classes/BusinessLogicLayer/Services/ConcreteServices/WeatherService/WeatherRepositoryService.swift
bfc928e94c5d689df04c6bb4255e70b33b9bd415
[ "MIT" ]
permissive
ipBill/Swift-Viper-Weather-App
fc94cc80b809b74bee36d067cf4eb1a6071ed018
d302cc230b5937aabf1c01622061246d8ca9cc24
refs/heads/master
2020-03-15T03:59:17.876829
2018-04-08T14:51:11
2018-04-08T14:51:11
null
0
0
null
null
null
null
UTF-8
Swift
false
false
884
swift
// // Created by Юрий Трыков on 27.08.17. // Copyright (c) 2017 trykov. All rights reserved. // import Foundation import RealmSwift public protocol WeatherRepositoryService { func queryCities() -> [CityPlainObject] func saveCities(_ cities: [CityPlainObject], completion: @escaping () -> Void) } class WeatherRepositoryServiceImpl: WeatherRepositoryService { func queryCities() -> [CityPlainObject] { let repository = RealmRepository<CityModelObject>() return repository.fetchAll() } func saveCities(_ cities: [CityPlainObject], completion: @escaping () -> Void) { do { let repository = RealmRepository<CityModelObject>() try repository.save(items: cities) completion() } catch let error { print(error.localizedDescription) completion() } } }
[ -1 ]
40dcf55f2b9bd0a0f2ec63063f0eafaf6f2f44d6
bc6f5463cebd2266290556761c3cbcf953db70bd
/Github Lookup/Generic views/Classes/HistoryTableViewCell.swift
be6ba9d27d1002641e3408eb1219c5776186f06b
[]
no_license
Nilesh-Jha-14/Github-Lookup
f726c2f3295cb57c4221fd6111922a62acc05ee1
b8c9230c46f1d0d88074472d50a2411e99bd424e
refs/heads/master
2021-08-26T08:12:50.253412
2017-11-22T12:03:32
2017-11-22T12:09:33
null
0
0
null
null
null
null
UTF-8
Swift
false
false
295
swift
// // HistoryTableViewCell.swift // Github Lookup // // Created by Sumit on 11/20/17. // Copyright © 2017 Sumit Mukhija. All rights reserved. // import UIKit class HistoryTableViewCell: UITableViewCell { @IBOutlet weak var lblName: UILabel! @IBOutlet weak var lblDate: UILabel! }
[ -1 ]
0b1284538bafef4817ba830512c80abb2aa03448
96a0164033a9f1951a9f7c96bfe21f8b46c24166
/Flix/MovieGridCell.swift
ffe96999d7ed64ba0d23b0e9246f8643fb668caf
[]
no_license
yingying18/Flix
e4a4abed79b6b66dffb19a6e0d323204d1e944bd
26a3c1d6e403e29a2f8cf961d316d93b075766ea
refs/heads/master
2020-04-21T05:16:31.851636
2019-02-14T05:06:55
2019-02-14T05:06:55
169,335,687
0
0
null
null
null
null
UTF-8
Swift
false
false
254
swift
// // MovieGridCell.swift // Flix // // Created by Yingying Chen on 2/6/19. // Copyright © 2019 Yingying Chen. All rights reserved. // import UIKit class MovieGridCell: UICollectionViewCell { @IBOutlet weak var posterView: UIImageView! }
[ -1 ]
013d597777e22d1f1c36d1fa539cbb11254dd9d5
4ca98c79ac684766b771555c32b63a9f2d960e68
/SixViewController.swift
5d065f21592a38b44315a40b303255b936009b74
[]
no_license
ryzer19/Kode4Kids
3d62bc99ce8ae2007830948371e2109b1865ad49
1453b8eae99aa9538f8d23fc50ae9f539e2e8fca
refs/heads/master
2022-11-13T01:43:54.849996
2020-07-12T14:46:04
2020-07-12T14:46:04
263,358,657
0
0
null
null
null
null
UTF-8
Swift
false
false
635
swift
// // SixViewController.swift // // // Created by Caleb Clegg on 04/07/2020. // import UIKit class SixViewController: 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. } */ }
[ 275714, 147332, 148999, 354315, 358929, 361495, 361496, 345751, 361498, 361499, 420381, 354729, 380334, 349487, 351536, 372017, 355124, 383797, 185524, 185525, 328514, 327032, 355145, 209998, 224855, 224856, 357209, 257882, 159355, 357725, 359390, 362847, 354144, 347111, 317931, 257900, 432243, 345972, 321399, 360440, 204411, 147324, 351485, 351486 ]
1222e7e0e1efc991db7a34d30beab3d053e5095a
ae1ce2930c23862a734920152dfb704a1b616afc
/verzity/DetailUniversityViewController.swift
140df44d720f73a2ed8e251e96d443b9ced99881
[]
no_license
jbetancourtlopez/verzity_2
c664ddd78680efdd1962958810e8ae1558589a2c
32581fcb31823bf61ed777a45ae12a8a881d2b79
refs/heads/master
2020-04-04T18:31:05.041500
2019-03-15T02:43:14
2019-03-15T02:43:14
156,166,895
0
0
null
null
null
null
UTF-8
Swift
false
false
19,079
swift
// // DetailUniversityViewController.swift // verzity // // Created by Jossue Betancourt on 26/06/18. // Copyright © 2018 Jossue Betancourt. All rights reserved. // import UIKit import SwiftyJSON import Kingfisher import SwiftyUserDefaults class DetailUniversityViewController: BaseViewController { @IBOutlet var contentBottomView: UIView! @IBOutlet var scrollView: UIScrollView! @IBOutlet var description_university: UILabel! @IBOutlet var name_universitity: UILabel! // Favorito @IBOutlet var button_favorit: UIButton! // Direccion @IBOutlet var image_address: UIImageView! @IBOutlet var label_address: UITextView! @IBOutlet var button_address: UIButton! // Telefono @IBOutlet var image_phone: UIImageView! @IBOutlet var label_phone: UITextView! // Web @IBOutlet var image_web: UIImageView! @IBOutlet var label_web: UITextView! // Email @IBOutlet var image_email: UIImageView! @IBOutlet var label_email: UITextView! // Video @IBOutlet var image_video: UIImageView! @IBOutlet var label_video: UITextView! @IBOutlet var button_video: UIButton! // Beca @IBOutlet var image_beca: UIImageView! @IBOutlet var label_beca: UITextView! @IBOutlet var button_beca: UIButton! // Financiamiento @IBOutlet var image_financing: UIImageView! @IBOutlet var label_financing: UITextView! @IBOutlet var button_financing: UIButton! @IBOutlet var image_financing_top_contrain: NSLayoutConstraint! @IBOutlet var button_financing_top_contrains: NSLayoutConstraint! @IBOutlet var label_financing_top_constrains: NSLayoutConstraint! var swipeGesture = UISwipeGestureRecognizer() var webServiceController = WebServiceController() var list_images: NSArray = [] var list_licenciaturas: NSArray = [] var count_current = 0 var idUniversidad: Int! var detail_data: AnyObject! var selected_postulate: String = "" var actionButton : ActionButton! var usuario = Usuario() @IBOutlet var page_control: UIPageControl! @IBOutlet var image_slider: UIImageView! @IBOutlet var button_postulate: UIButton! override func viewDidLoad() { super.viewDidLoad() self.usuario = get_user() idUniversidad = idUniversidad as Int setup_ux() load_data() //Gestos count_current = 0 let directions: [UISwipeGestureRecognizerDirection] = [.up, .down, .right, .left] for direction in directions { swipeGesture = UISwipeGestureRecognizer(target: self, action: #selector(self.swipwView(_:))) image_slider.addGestureRecognizer(swipeGesture) swipeGesture.direction = direction image_slider.isUserInteractionEnabled = true image_slider.isMultipleTouchEnabled = true } } func load_data(){ // Cargamos los datos showGifIndicator(view: self.view) let array_parameter = ["idUniversidad": idUniversidad] let parameter_json = JSON(array_parameter) let parameter_json_string = parameter_json.rawString() webServiceController.GetDetallesUniversidad(parameters: parameter_json_string!, doneFunction: GetDetallesUniversidad) } func GetDetallesUniversidad(status: Int, response: AnyObject){ var json = JSON(response) hiddenGifIndicator(view: self.view) if status == 1{ self.detail_data = JSON(json["Data"]) as AnyObject let data = JSON(json["Data"]) self.list_images = data["FotosUniversidades"].arrayValue as NSArray self.list_licenciaturas = data["Licenciaturas"].arrayValue as NSArray self.page_control.numberOfPages = self.list_images.count set_image_slider() set_data() }else{ // Mensaje de Error } } // FotosUniversidades @objc func swipwView(_ sender : UISwipeGestureRecognizer){ UIView.animate(withDuration: 1.0) { if sender.direction == .left { if (self.count_current >= (self.list_images.count - 1)){ self.count_current = 0; }else{ self.count_current = self.count_current + 1 } }else if sender.direction == .right{ if (self.count_current <= 0){ self.count_current = self.list_images.count - 1 }else{ self.count_current = self.count_current - 1 } } self.page_control.currentPage = self.count_current self.set_image_slider() self.image_slider.layoutIfNeeded() self.image_slider.setNeedsDisplay() } } func set_image_slider(){ if self.list_images.count > 0 { let image_item = self.list_images[self.count_current] var image = JSON(image_item) var pathImage = image["desRutaFoto"].stringValue pathImage = pathImage.replacingOccurrences(of: "~", with: "") pathImage = pathImage.replacingOccurrences(of: "\\", with: "") let desRutaMultimedia = Defaults[.desRutaMultimedia]! let url = "\(desRutaMultimedia)\(pathImage)" let URL = Foundation.URL(string: url) let image_default = UIImage(named: "default.png") self.image_slider.kf.setImage(with: URL, placeholder: image_default) } } @IBAction func on_click_financing(_ sender: Any) { print("Financing") let vc = storyboard?.instantiateViewController(withIdentifier: "CardViewControllerID") as! CardViewController vc.idUniversidad = idUniversidad vc.type = "financing" self.show(vc, sender: nil) } @IBAction func on_click_beca(_ sender: Any) { print("beca") let vc = storyboard?.instantiateViewController(withIdentifier: "CardViewControllerID") as! CardViewController vc.idUniversidad = idUniversidad vc.type = "becas" self.show(vc, sender: nil) } @IBAction func on_click_video(_ sender: Any) { print("video") var university_json = JSON(self.detail_data) let vc = storyboard?.instantiateViewController(withIdentifier: "VideoViewControllerID") as! VideoViewController vc.idUniversidad = university_json["idUniversidad"].intValue self.show(vc, sender: nil) } @IBAction func on_click_map(_ sender: Any) { print("mapa") let university_json = JSON(self.detail_data) let vc = storyboard?.instantiateViewController(withIdentifier: "DetailMapViewControllerID") as! DetailMapViewController vc.info = university_json as AnyObject self.show(vc, sender: nil) } @IBAction func on_click_postulate(_ sender: Any) { print("Postulado") let alert = UIAlertController(title: "Seleccione programa académico de interés.", message: nil, preferredStyle: .actionSheet) if (list_licenciaturas.count > 0){ for i in 0 ..< list_licenciaturas.count { let item = JSON(self.list_licenciaturas[i]) let nbLicenciatura = item["nbLicenciatura"].stringValue let idLicenciatura = item["idLicenciatura"].intValue let action = UIAlertAction(title: nbLicenciatura, style: .default, handler: {(action) in self.selected_postulate(name:nbLicenciatura, idLicenciatura: idLicenciatura ) }) alert.addAction(action) } alert.addAction(UIAlertAction(title: "Cancelar", style: .cancel, handler: nil)) self.present(alert, animated: true, completion: nil) } else { showMessage(title: "No se cuenta con programas académicos para postularse", automatic: true) } } func selected_postulate(name: String, idLicenciatura: Int){ print("Postulado Metodo: \(name)") let idPersona = Defaults[.academic_idPersona]! let have_name = Defaults[.academic_name] != "" let have_email = Defaults[.academic_email] != "" //if (false){ if (idPersona > 0 && have_name && have_email){ showGifIndicator(view: self.view) let array_parameter = [ "idPostuladoUniversidad": 0, "idUniversidad": idUniversidad, "idPersona": idPersona, "idLicenciatura": idLicenciatura ] as [String : Any] let parameter_json = JSON(array_parameter) let parameter_json_string = parameter_json.rawString() webServiceController.PostularseUniversidad(parameters: parameter_json_string!, doneFunction: PostularseLicenciatura) }else{ let vc = storyboard?.instantiateViewController(withIdentifier: "ProfileAcademicViewControllerID") as! ProfileAcademicViewController vc.is_postulate = 1 self.show(vc, sender: nil) } } func PostularseLicenciatura(status: Int, response: AnyObject){ var json = JSON(response) if status == 1{ showMessage(title: json["Mensaje"].stringValue, automatic: true) }else{ showMessage(title: response as! String, automatic: true) } hiddenGifIndicator(view: self.view) } @IBAction func on_click_favorit(_ sender: Any) { print("Favorit") showGifIndicator(view: self.view) let array_parameter = [ "idUniversidad": idUniversidad, "idPersona": Defaults[.academic_idPersona]! ] as [String : Any] let parameter_json = JSON(array_parameter) let parameter_json_string = parameter_json.rawString() webServiceController.SetFavorito(parameters: parameter_json_string!, doneFunction: SetFavorito) } func SetFavorito(status: Int, response: AnyObject){ var json = JSON(response) var data = JSON(json["Data"]) debugPrint(json) if status == 1{ if data["idFavoritos"].intValue == 0{ let image = UIImage(named: "ic_action_star_border")?.withRenderingMode(.alwaysTemplate) button_favorit.setImage(image, for: .normal) }else{ let image = UIImage(named: "ic_action_star")?.withRenderingMode(.alwaysTemplate) button_favorit.setImage(image, for: .normal) } }else{ let image = UIImage(named: "ic_action_star_border")?.withRenderingMode(.alwaysTemplate) button_favorit.setImage(image, for: .normal) } hiddenGifIndicator(view: self.view) } func VerificarFavorito(status: Int, response: AnyObject){ var json = JSON(response) var data = JSON(json["Data"]) debugPrint(json) if status == 1{ let image = UIImage(named: "ic_action_star")?.withRenderingMode(.alwaysTemplate) button_favorit.setImage(image, for: .normal) }else{ let image = UIImage(named: "ic_action_star_border")?.withRenderingMode(.alwaysTemplate) button_favorit.setImage(image, for: .normal) } hiddenGifIndicator(view: self.view) } func setup_ux(){ let image_visitar_web = UIImage(named: "ic_visitar_web")?.withRenderingMode(.alwaysTemplate) // Favorito let image = UIImage(named: "ic_action_star_border")?.withRenderingMode(.alwaysTemplate) button_favorit.setImage(image, for: .normal) button_favorit.tintColor = hexStringToUIColor(hex: "#F7BF25") // DIreccion image_address.image = image_address.image?.withRenderingMode(.alwaysTemplate) image_address.tintColor = hexStringToUIColor(hex: "#ff0106") // Phone image_phone.image = image_phone.image?.withRenderingMode(.alwaysTemplate) image_phone.tintColor = Colors.gray // Web image_web.image = image_web.image?.withRenderingMode(.alwaysTemplate) image_web.tintColor = hexStringToUIColor(hex: "#1d47f1") // Beca image_beca.image = image_beca.image?.withRenderingMode(.alwaysTemplate) image_beca.tintColor = hexStringToUIColor(hex: "#32cb00") button_beca.setImage(image_visitar_web, for: .normal) button_beca.tintColor = Colors.gray // Email image_email.image = image_email.image?.withRenderingMode(.alwaysTemplate) image_email.tintColor = hexStringToUIColor(hex: "#1d47f1") //Video image_video.image = image_video.image?.withRenderingMode(.alwaysTemplate) image_video.tintColor = hexStringToUIColor(hex: "#ff0106") button_video.setImage(image_visitar_web, for: .normal) button_video.tintColor = Colors.gray // FInancimaineto image_financing.image = image_financing.image?.withRenderingMode(.alwaysTemplate) image_financing.tintColor = hexStringToUIColor(hex: "#ff7b25") button_financing.setImage(image_visitar_web, for: .normal) button_financing.tintColor = Colors.gray //Botones Flotantes let postularse = ActionButtonItem(title: "Postularse", image: #imageLiteral(resourceName: "ic_notification_green")) postularse.action = { item in self.self.on_click_postulate_() } actionButton = ActionButton(attachedToView: self.view, items: [postularse]) actionButton.setTitle("+", forState: UIControlState()) actionButton.backgroundColor = UIColor(red: 57.0/255.0, green: 142.0/255.0, blue: 49.0/255.0, alpha: 1) actionButton.action = { button in button.toggleMenu()} } func on_click_postulate_(){ print("Postulacion") } func set_data(){ var university_json = JSON(self.detail_data) var address = JSON(university_json["Direcciones"]) var paquete_array = university_json["VentasPaquetes"].arrayValue var fgAplicaBecas = false var fgAplicaFinanciamiento = false var fgAplicaPostulacion = false if paquete_array.count > 0 { var paquete_json = JSON(paquete_array[0]) var paquete = JSON(paquete_json["Paquete"]) debugPrint(paquete) fgAplicaBecas = paquete["fgAplicaBecas"].boolValue fgAplicaFinanciamiento = paquete["fgAplicaFinanciamiento"].boolValue fgAplicaPostulacion = paquete["fgAplicaPostulacion"].boolValue } var name_uniersity_text = university_json["nbUniversidad"].stringValue if name_uniersity_text.isEmpty{ name_uniersity_text = StringsLabel.no_university_name } var label_address_text = "" if !(address["desDireccion"].stringValue).isEmpty { label_address_text += address["desDireccion"].stringValue } if label_address_text.count > 0 && !(address["nbCiudad"].stringValue).isEmpty { label_address_text += ", " + address["nbCiudad"].stringValue } if label_address_text.count > 0 && !(address["nbEstado"].stringValue).isEmpty { label_address_text += ", " + address["nbEstado"].stringValue } if label_address_text.count > 0 && !(address["nbPais"].stringValue).isEmpty { label_address_text += ", " + address["nbPais"].stringValue } var label_web_text = university_json["desSitioWeb"].stringValue if label_web_text.isEmpty{ label_web_text = StringsLabel.no_website } var label_email_text = university_json["desCorreo"].stringValue if label_email_text.isEmpty{ label_email_text = StringsLabel.no_email } var label_phone_text = university_json["desTelefono"].stringValue if label_phone_text.isEmpty{ label_phone_text = StringsLabel.no_phone } self.title = "Univ"//name_uniersity_text name_universitity.text = name_uniersity_text description_university.text = university_json["desUniversidad"].stringValue description_university.translatesAutoresizingMaskIntoConstraints = true description_university.sizeToFit() let height = description_university.frame.height scrollView.contentSize = CGSize(width: self.view.frame.size.width, height: 700 + height) let h = scrollView.frame.height print(height) print(h) contentBottomView.sizeToFit() contentBottomView.autoresizesSubviews = true contentBottomView.layoutIfNeeded() contentBottomView.frame = CGRect(x:0, y:232, width:self.view.frame.width, height:5000) label_address.text = label_address_text label_web.text = label_web_text label_email.text = label_email_text label_phone.text = label_phone_text label_video.text = "Ver videos" label_beca.text = "Ver becas" label_financing.text = "Ver financiamientos" // Establecemos permisos if !fgAplicaBecas{ image_beca.isHidden = true label_beca.isHidden = true button_beca.isHidden = true } if !fgAplicaFinanciamiento{ image_financing.isHidden = true label_financing.isHidden = true button_financing.isHidden = true } if !fgAplicaPostulacion{ button_postulate.isHidden = true } if !fgAplicaBecas && fgAplicaFinanciamiento{ /* image_beca.frame = CGRect(x: 0, y: 0, width: 50, height: 0) button_beca.frame = CGRect(x: 0, y: 0, width: 50, height: 0) label_beca.frame = CGRect(x: 0, y: 0, width: 50, height: 0) */ image_financing_top_contrain.constant = -35 button_financing_top_contrains.constant = -35 label_financing_top_constrains.constant = -35 } // Set Favorito print("Print Persona") print(self.usuario) var idPersona = self.usuario.Persona?.idPersona let array_parameter = [ "idUniversidad": idUniversidad!, "idPersona":idPersona ] as [String : Any] debugPrint(array_parameter) let parameter_json = JSON(array_parameter) let parameter_json_string = parameter_json.rawString() webServiceController.VerificarFavorito(parameters: parameter_json_string!, doneFunction: VerificarFavorito) } }
[ -1 ]
6fcfc37d0c5241a25d8268b0123231c234d9c421
a94cb27c5c75a39b45326e358ca6a358901bad43
/Baazar/ViewController.swift
c4026982f33699b248a12b8cb58152a48d1ef7ec
[ "Apache-2.0" ]
permissive
dakin4/Baazar
a84159715a2555dbc579518522da316a0ccbe92a
75719270df00183690aea550b0c5b914248f5da9
refs/heads/master
2021-04-06T05:31:33.211697
2018-03-14T19:37:08
2018-03-14T19:37:08
125,264,071
2
0
null
null
null
null
UTF-8
Swift
false
false
501
swift
// // ViewController.swift // Baazar // // Created by David King on 3/14/18. // Copyright © 2018 David King. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ 279046, 215562, 275466, 277006, 282128, 293909, 277527, 286234, 317473, 295460, 284197, 286257, 300086, 286775, 279096, 288827, 226878, 159812, 228932, 226887, 300107, 288331, 288332, 226896, 284240, 280146, 200802, 292451, 276580, 281701, 277602, 309347, 309349, 311913, 277612, 205935, 307311, 284275, 284277, 284279, 276087, 284287, 284289, 285321, 303242, 226447, 227984, 278675, 349332, 282262, 117399, 278693, 276150, 282301, 277696, 227523, 280772, 228551, 276167, 280777, 279754, 284361, 230604, 298189, 302286, 229585, 290006, 302295, 226009, 298202, 298204, 280797, 298207, 363743, 282338, 298211, 290020, 199402, 294636, 234223, 289524, 280821, 288501, 226038, 280824, 358137, 286456, 358139, 282368, 280832, 276736, 230147, 226055, 282377, 288251, 278298, 329499, 295711, 228127, 287007, 282403, 277796, 277797, 282917, 283433, 282411, 289596, 283453, 288577, 288579, 300358, 234829, 296272, 279380, 279386, 188253, 308064, 289120, 293742, 277364, 292730, 291709, 290175, 275842, 311684, 183173, 313222, 234380, 226705, 310673, 226196, 227740, 294812, 277406, 285087, 289187, 283556, 284586, 276396, 305582, 277935, 282035, 230323, 234423, 278968, 127418, 281530, 278973, 291774, 295874, 10179, 289224, 311761, 281042, 163289, 279011, 231405, 286189, 277487, 293874, 227315, 290299, 277502 ]
88f1177c6abc1ee110dc4d18dc2c2a0133066f06
a241d50989416c0716bfc719fd27f16f38b5334f
/MVVM/ViewModel/UsersListViewModel.swift
77afd5539facdef740b2677008afd7189bd1a03c
[]
no_license
devxris/MVVM
da4b7368c38d74ca9b76b7e8d94b5377b0fb8ef8
c95df8a89bbcc6acd2995a3d85cf14c60ca3e5f0
refs/heads/master
2021-05-05T07:45:43.065661
2018-01-28T05:52:25
2018-01-28T05:52:25
118,879,511
0
0
null
null
null
null
UTF-8
Swift
false
false
487
swift
// // UsersListViewModel.swift // MVVM // // Created by Chris Huang on 25/01/2018. // Copyright © 2018 Chris Huang. All rights reserved. // import Foundation struct UsersListViewModel { // represent the whole UITableView var userViewModels = [UserViewModel]() private var userViewModelsChanged: ((String) -> ())? init() { // get all Users from DataAccess and convert to UserViewModel userViewModels = DataAccess.shared.allUsers.flatMap { UserViewModel(user: $0) } } }
[ -1 ]
f67e394c4de831e90035a07b94b0f081f9ca5bb6
c829e20a478a57f8607f9e9d5f3fbda7a2802200
/cateringproject/Global.swift
843c7f1c2695cb2161a5968fb5756b929c4a8dde
[]
no_license
amithkumar507/cateringapplication
fa94151651320b4a32356fc9d06e8c4ca70f69b5
6be87418c7930136eec43ffa6c65e6dfc4964ab0
refs/heads/master
2021-01-01T16:38:13.180481
2017-07-20T21:37:15
2017-07-20T21:37:15
97,880,136
0
0
null
null
null
null
UTF-8
Swift
false
false
384
swift
// // Global.swift // cateringprojectTests // // Created by Amith Kumar Aellanki and Jadhav Amarnath on 6/10/16. // Copyright © 2016 Amith Kumar Aellanki. All rights reserved. // // Authors: Amit Kumar Aellanki and Jadhav Amarnath import Foundation class Main { var items: [String] init(itemList:[String]) { self.items = itemList } } var mainInstance = Main(itemList:[])
[ -1 ]