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
ab70af42643fcd5b502381517d9eef8e9fe684fc
0a862e0e44741b385be306724f88b1ab8317f1e7
/Collection View Flow LayoutTests/Collection_View_Flow_LayoutTests.swift
f0ed7029d8f3651bdee90f32469813aa1a904ad3
[]
no_license
nhhuy1804/Collection-View-Flow-Layout
b672d8a20011fc3a6b8c24377065ba49307516eb
d5cf9b16fb7f3ac03e826ebda56d0104383b9f07
refs/heads/master
2021-01-20T03:57:00.753330
2017-04-27T15:02:58
2017-04-27T15:02:58
89,579,203
0
0
null
null
null
null
UTF-8
Swift
false
false
1,037
swift
// // Collection_View_Flow_LayoutTests.swift // Collection View Flow LayoutTests // // Created by MrDummy on 4/27/17. // Copyright © 2017 Huy. All rights reserved. // import XCTest @testable import Collection_View_Flow_Layout class Collection_View_Flow_LayoutTests: 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. } } }
[ 230913, 296461, 140310, 291358, 230943, 102437, 293419, 293448, 311374, 296019, 227428, 300136, 295536, 233589, 288889, 294529, 300535, 235662, 296086, 289434, 298654, 300201, 205487, 295599, 303793, 299700, 294068, 131256, 294074, 230588, 212688, 189652, 280802, 298212, 298213, 234733, 289518, 299759, 234742, 184570, 291585, 295682, 184584, 291592, 295697, 291604, 294678, 289576, 294700, 295729, 296755, 230199, 300343, 293693, 295746, 307011, 304456, 230729, 294218, 234831, 230234, 222559, 234850, 296806, 230765, 296307, 111993, 148867, 179587, 295824, 234898, 190871, 291224, 289698, 300963, 381347, 289194, 310701, 299441, 289727, 299456, 214977, 163781, 344013, 24532, 227809, 183279, 293367, 300536, 290300, 290301 ]
485914c50300806be244ba21a6a932a1cc880e93
26330d98c66eadeaa52ad29ebce8cf92b0ca9066
/MessageFilter/AppDelegate.swift
f2c623b2af6dcfe7e34a1d629467784acfdbffdc
[]
no_license
cerafeeq/MessageFilter
c70b69159b6577d892a455c2f159500683ede7c3
75e3069796bb8ec776837e1d09eb9c1d7155caa0
refs/heads/master
2020-07-25T09:09:45.412132
2019-09-13T10:18:45
2019-09-13T10:18:45
208,241,744
0
1
null
null
null
null
UTF-8
Swift
false
false
2,185
swift
// // AppDelegate.swift // MessageFilter // // Created by Rafeeq Ebrahim on 03/01/19. // Copyright © 2019 Rafeeq Ebrahim. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 229415, 229417, 327722, 237613, 229422, 229426, 237618, 229428, 286774, 286776, 319544, 286778, 204856, 229432, 352318, 286791, 237640, 286797, 278605, 311375, 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, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 278983, 319945, 278986, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 320007, 287238, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 303696, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 189039, 172660, 287349, 189040, 189044, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 279178, 287371, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 287390, 303773, 172705, 287394, 172707, 303780, 164509, 287398, 295583, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 328381, 287423, 328384, 172737, 279231, 287427, 312005, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 189169, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 303987, 328563, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 304007, 213895, 304009, 304011, 304013, 295822, 279438, 189325, 189329, 295825, 304019, 189331, 213902, 58262, 304023, 304027, 279452, 234648, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 295945, 230413, 295949, 197645, 320528, 140312, 295961, 238620, 304164, 304170, 238641, 238652, 238655, 230465, 238658, 336964, 132165, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 66690, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 279929, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 222676, 148946, 288214, 239064, 329177, 288217, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 230923, 304651, 304653, 370187, 402969, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 239202, 370279, 312938, 280183, 280185, 280191, 116354, 280194, 280208, 280211, 288408, 280222, 419489, 190118, 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, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 337732, 304968, 280393, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 288895, 321670, 215175, 288909, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 280919, 248153, 215387, 354653, 354656, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289227, 436684, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 330244, 281095, 223752, 150025, 338440, 240132, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 182929, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 256716, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 240519, 183184, 289687, 240535, 224151, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 420829, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 322563, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 216376, 380226, 298306, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 298365, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 298377, 314763, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 290305, 306694, 192008, 323084, 282127, 290321, 282130, 290325, 282133, 241175, 290328, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282255, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 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, 307027, 315221, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 315253, 315255, 339838, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 44948, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 241581, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 184486, 307370, 307372, 307374, 307376, 299185, 323763, 184503, 176311, 299191, 307386, 258235, 307388, 307385, 307390, 176316, 299200, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 299225, 233701, 307432, 282881, 282893, 291089, 282906, 291104, 233766, 307508, 315701, 332086, 307510, 307512, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 276052, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 194654, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 291269, 127431, 127434, 315856, 176592, 127440, 315860, 176597, 127447, 283095, 299481, 127449, 176605, 242143, 127455, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 283142, 127494, 127497, 233994, 135689, 127500, 233998, 127506, 234003, 127509, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 299740, 201444, 299750, 283368, 234219, 283372, 185074, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 316294, 201603, 226182, 308105, 234375, 226185, 234379, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 234396, 291742, 226200, 234398, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 324522, 234410, 291756, 291754, 226220, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 234437, 226245, 234439, 226239, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 275606, 275608, 234650, 308379, 324757, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 177318, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 226500, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 283917, 177424, 349451, 275725, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 316811, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 227426, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 284223, 284226, 284228, 292421, 226886, 284231, 128584, 243268, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 276053, 284249, 284251, 300638, 284253, 284255, 284258, 292452, 292454, 284263, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 325251, 276095, 276098, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 292681, 153417, 358224, 276308, 284502, 317271, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 292729, 317306, 284540, 292734, 325512, 276365, 317332, 358292, 284564, 399252, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292784, 358326, 161718, 358330, 276410, 276411, 276418, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 350186, 292843, 276460, 276464, 178161, 227314, 276466, 325624, 350200, 276472, 317435, 276476, 276479, 276482, 350210, 276485, 317446, 178181, 276490, 350218, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 178224, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 243779, 325700, 284739, 292934, 243785, 276553, 350293, 350295, 309337, 194649, 227418, 350299, 350302, 227423, 350304, 178273, 309346, 194657, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 301163, 350313, 350316, 227430, 301167, 276583, 350321, 276590, 284786, 276595, 350325, 252022, 227440, 350328, 292985, 301178, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 194708, 350357, 350359, 350362, 350366, 276638, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 227571, 309491, 309494, 243960, 276735, 227583, 227587, 276739, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 129486, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 113167, 309779, 317971, 309781, 277011, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 23094, 277054, 219714, 129603, 301636, 318020, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170619, 309885, 309888, 277122, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 318132, 342707, 154292, 277173, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 228069, 277223, 342760, 285417, 56043, 56045, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 301884, 310080, 293696, 277317, 277322, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 276579, 293811, 293817, 293820, 203715, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 244731, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 293917, 293939, 318516, 277561, 277564, 310336, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 64768, 310531, 285958, 138505, 228617, 318742, 277798, 130345, 113964, 285997, 384302, 285999, 113969, 318773, 318776, 286010, 417086, 286016, 302403, 294211, 384328, 294221, 146765, 294223, 326991, 179547, 146784, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 310657, 351619, 294276, 310659, 327046, 253320, 310665, 318858, 310672, 351633, 310689, 130468, 228776, 277932, 310703, 310710, 130486, 310712, 310715, 302526, 228799, 302534, 310727, 245191, 64966, 163272, 302541, 302543, 310737, 228825, 163290, 310749, 310755, 187880, 310764, 286188, 310772, 40440, 212472, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 302617, 286233, 302621, 286240, 146977, 187936, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 278057, 310831, 245288, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 319163, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 278238, 229086, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 280021, 188252, 237409, 294776, 294785, 327554, 360322, 40851, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
348bfd3551ce5b69527a94dcea3a1035d9cdc15c
4ac731d6c930592e508b10fef5e3401e985e49c9
/HackingWithSwiftPorject2/HackingWithSwiftPorject2/AppDelegate.swift
168ce83af3d7af10da86be3cecde8804feb97384
[]
no_license
YouJCheng/Swift30
60ea60ec9eee97db750b018e6a07f6013d813280
0ad468bd4b2c14576ff1a861a606dd1944ef41cd
refs/heads/master
2021-01-23T19:58:39.262008
2017-09-30T03:42:02
2017-09-30T03:42:02
102,839,671
0
0
null
null
null
null
UTF-8
Swift
false
false
2,193
swift
// // AppDelegate.swift // HackingWithSwiftPorject2 // // Created by Yu-J.Cheng on 2017/9/13. // Copyright © 2017年 YuChienCheng. 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, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 319544, 204856, 229432, 286776, 286778, 286791, 237640, 278605, 286797, 311375, 163920, 196692, 319573, 311383, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 327814, 131209, 303241, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 286916, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 295220, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 278983, 319945, 278986, 278990, 278994, 311767, 279003, 279006, 188895, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 320007, 287238, 172552, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 303696, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 189039, 295538, 172660, 189040, 189044, 287349, 287355, 287360, 295553, 295557, 311942, 303751, 287365, 352905, 311946, 279178, 287371, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 287390, 303773, 164509, 172705, 287394, 172702, 303780, 172707, 287398, 205479, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 328381, 287423, 328384, 279231, 287427, 312005, 312006, 107208, 107212, 172748, 287436, 172751, 287440, 295633, 172755, 303827, 279255, 287450, 303835, 279258, 189149, 303838, 213724, 279267, 312035, 295654, 279272, 312048, 230128, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 303987, 328563, 303991, 303997, 295806, 295808, 304005, 295813, 304007, 320391, 213895, 304009, 304011, 304013, 279438, 295822, 189329, 295825, 189331, 304019, 58262, 304023, 279452, 234648, 279461, 279462, 304042, 213931, 304055, 230327, 287675, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 295945, 295949, 230413, 197645, 320528, 140312, 295961, 238620, 304164, 304170, 304175, 238641, 238652, 238655, 230465, 238658, 296004, 132165, 336964, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 361576, 296040, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 165038, 238766, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 296259, 378181, 296262, 230727, 296264, 238919, 320840, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 148843, 230763, 230768, 296305, 312692, 230773, 304505, 181626, 304506, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 222676, 288214, 280021, 239064, 329177, 288217, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 320998, 288234, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 148990, 321022, 206336, 402942, 296450, 296446, 230916, 230919, 304651, 370187, 304653, 230923, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280208, 280211, 288408, 280218, 280222, 190118, 198310, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 206536, 280264, 206539, 206541, 206543, 280276, 321239, 280283, 18140, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 313073, 419570, 288499, 321266, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 288576, 345921, 280388, 337732, 304968, 280393, 280402, 173907, 313176, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 124817, 280468, 239510, 280473, 124827, 247709, 214944, 313258, 321458, 296883, 124853, 10170, 296890, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 313340, 239612, 288764, 239617, 313347, 288773, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 313451, 223341, 280687, 215154, 313458, 280691, 149618, 313464, 329850, 321659, 288895, 321670, 215175, 288909, 141455, 141459, 313498, 100520, 288936, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 321740, 313548, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 280919, 354653, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 240011, 199051, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 281095, 223752, 338440, 150025, 330244, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 297594, 281210, 158347, 182926, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 314029, 314033, 240309, 133817, 314047, 314051, 199364, 297671, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 338823, 322440, 314249, 240519, 183184, 142226, 240535, 289687, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 216376, 298306, 380226, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 306549, 298358, 314743, 306552, 306555, 314747, 298365, 290171, 290174, 224641, 281987, 314756, 298372, 281990, 224647, 298377, 314763, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 282101, 241142, 191992, 290298, 151036, 290302, 290305, 306694, 192008, 323084, 257550, 290321, 282130, 282133, 290325, 241175, 290328, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282261, 175770, 298651, 323229, 282269, 298655, 323231, 61092, 282277, 196133, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 307009, 413506, 241475, 307012, 298822, 315211, 307027, 315221, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 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, 241581, 241583, 323504, 241586, 282547, 290739, 241588, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 282645, 241693, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 307287, 315482, 217179, 315483, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 307307, 45163, 315502, 192624, 307314, 323700, 299126, 233591, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 184486, 307370, 307372, 307374, 307376, 299185, 323763, 176311, 299191, 307385, 307386, 258235, 307388, 176316, 307390, 184503, 299200, 307394, 307396, 299204, 184518, 307399, 323784, 233679, 307409, 307411, 299225, 233701, 307432, 282881, 282893, 291089, 282906, 291104, 233766, 295583, 307508, 315701, 332086, 307510, 307512, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 127407, 291247, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 315856, 176592, 315860, 176597, 127447, 283095, 299481, 176605, 242143, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 135672, 291323, 233979, 127485, 291330, 127490, 283142, 127494, 127497, 233994, 135689, 233998, 127506, 234003, 127509, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 135839, 299680, 225954, 135844, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 242450, 234258, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 234309, 316233, 234313, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 201557, 185173, 234329, 234333, 308063, 234336, 234338, 349027, 242530, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 234364, 291711, 234368, 234370, 201603, 291714, 234373, 316294, 226182, 234375, 308105, 291716, 324490, 226185, 234379, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 234396, 291742, 226200, 234398, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 234410, 291754, 291756, 324522, 226220, 324527, 291760, 234417, 201650, 324531, 234422, 226230, 324536, 275384, 234428, 291773, 234431, 242623, 324544, 324546, 234434, 324548, 234437, 226245, 234439, 226239, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 308226, 234501, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 308291, 316483, 160835, 234563, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 275579, 234620, 234623, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 275606, 275608, 234650, 308379, 324757, 234653, 300189, 119967, 324766, 324768, 234657, 283805, 242852, 234661, 283813, 300197, 234664, 275626, 234667, 316596, 308414, 300223, 234687, 300226, 308418, 283844, 300229, 308420, 308422, 226500, 234692, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 300289, 292097, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 283917, 300301, 177424, 275725, 349464, 283939, 259367, 292143, 283951, 300344, 243003, 283963, 283973, 300357, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 218473, 284010, 324978, 136562, 275834, 275836, 275840, 316803, 316806, 316811, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 226802, 292338, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 308790, 284215, 194103, 284218, 226877, 292414, 284223, 284226, 284228, 292421, 226886, 284231, 128584, 243268, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 292433, 284243, 300628, 284245, 194130, 284247, 317015, 235097, 243290, 276053, 284249, 284251, 300638, 284253, 284255, 284258, 292452, 292454, 284263, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 276095, 276098, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 276166, 284358, 358089, 284362, 276170, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 276206, 358128, 284399, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 325408, 300832, 300834, 317221, 227109, 358183, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 153417, 292681, 276308, 284502, 317271, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 292729, 317306, 284540, 292734, 325512, 276365, 358292, 284564, 317332, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292784, 358326, 161718, 276410, 276411, 358330, 276418, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 292843, 276460, 292845, 276464, 178161, 227314, 276466, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 284739, 243779, 292934, 243785, 276553, 350293, 350295, 309337, 194649, 227418, 350299, 350302, 227423, 194654, 178273, 309346, 194657, 309348, 350308, 309350, 227426, 309352, 350313, 309354, 301163, 350316, 194660, 227430, 276583, 276590, 350321, 284786, 276595, 301167, 350325, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 284837, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 309455, 276689, 309462, 301272, 309468, 194780, 309471, 301283, 317672, 317674, 325867, 243948, 227571, 309491, 309494, 243960, 276735, 227583, 227587, 276739, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 317833, 178572, 285070, 285077, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 236043, 342541, 113167, 309779, 317971, 309781, 277011, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 23094, 277054, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170619, 309885, 309888, 277122, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 342707, 318132, 154292, 293555, 277173, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 228069, 277223, 342760, 285417, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 301884, 310080, 293696, 277317, 277322, 162643, 310100, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 310134, 15224, 236408, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 276579, 293811, 293820, 203715, 326603, 276586, 293849, 293861, 228327, 228330, 318442, 228332, 326638, 277486, 318450, 293876, 293877, 285686, 302073, 285690, 293882, 302075, 121850, 244731, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 310336, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 302205, 285821, 392326, 285831, 253064, 302218, 294026, 285835, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 64768, 310531, 285958, 138505, 228617, 318742, 277798, 130345, 113964, 285997, 285999, 113969, 318773, 318776, 286010, 417086, 286016, 302403, 294211, 384328, 294221, 326991, 294223, 179547, 146784, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 310657, 310659, 351619, 294276, 327046, 253320, 310665, 318858, 310672, 351633, 310689, 130468, 228776, 277932, 310703, 310710, 130486, 310712, 310715, 302526, 228799, 302534, 245191, 310727, 64966, 163272, 292968, 302541, 302543, 310737, 228825, 163290, 310749, 310755, 187880, 310764, 286188, 310772, 40440, 212472, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 302617, 286233, 302621, 146977, 187939, 40484, 294435, 40486, 286246, 40488, 278057, 294439, 40491, 294440, 294443, 294445, 310831, 245288, 40499, 40502, 212538, 40507, 40511, 228933, 327240, 40521, 286283, 40525, 40527, 400976, 212560, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 278188, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 302793, 294601, 343757, 212690, 278227, 286420, 319187, 229076, 286425, 319194, 278235, 278238, 229086, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 311048, 294664, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 188252, 237409, 229233, 294776, 294785, 327554, 40851, 294811, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
13950fc942c6f93aa32cca84e4ea23ea9a3f5fcd
3a4f15e78ecdd3a6817284ce2daf45ea34c70b92
/TestTaskMedvedev/SightsScreen/View/SightsScreenViewController.swift
70ac7bfe1d68de817da88b60651ac7f1c7d55e55
[]
no_license
Simon-developer/TestTaskMedvedev
9343ba89ff720165bd9b8774eecc504e3d2198cf
8757c765efd0509542fc494a4d5472e4e873bec7
refs/heads/main
2023-03-22T19:38:16.850298
2021-03-14T08:48:35
2021-03-14T08:48:35
311,294,814
0
0
null
null
null
null
UTF-8
Swift
false
false
6,571
swift
// // SightsScreenViewController.swift // TestTaskMedvedev // // Created by Semyon on 08.11.2020. // import Foundation import UIKit protocol SightsScreenViewProtocol: class { func layoutNavigationBar() func layoutWebSights(preloaded: [Sight]) func layoutHardTypedSights(preloaded: [SightCD]) } class SightsScreenViewController: UIViewController, UINavigationControllerDelegate, UIGestureRecognizerDelegate { var presenter: SightsScreenPresenterProtocol! var tableView: UITableView! var preloadedPlaces: [Any]! var sightType: GoSightseeingButtonType! override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = .white self.presenter.startConfigure() self.navigationController?.interactivePopGestureRecognizer?.delegate = self self.navigationController?.interactivePopGestureRecognizer?.isEnabled = true } @objc func backButtonTapHandler(_ sender: UIBarButtonItem) { self.presenter.goBackToCityWeatherView() } func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) -> Bool { return true } } extension SightsScreenViewController: SightsScreenViewProtocol { func layoutNavigationBar() { title = "Достопримечательности" let navBarAppearance = UINavigationBarAppearance() //navBarAppearance.configureWithOpaqueBackground() // Цвет текста навбара navBarAppearance.titleTextAttributes = [.foregroundColor: UIColor.white] navBarAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white] // Фоновый цвет navBarAppearance.backgroundColor = AppConstants.skyColor // В обоих форматах один и тот же вид навбара navigationController?.navigationBar.standardAppearance = navBarAppearance navigationController?.navigationBar.scrollEdgeAppearance = navBarAppearance // Цвет статус бара на белый self.navigationController?.navigationBar.barStyle = .black // Большой заголовок self.navigationController?.navigationBar.prefersLargeTitles = false let backBarButton = UIBarButtonItem(image: UIImage(systemName: "arrow.left"), style: .plain, target: self, action: #selector(backButtonTapHandler(_:))) backBarButton.tintColor = .white backBarButton.image?.withTintColor(.white) navigationItem.leftBarButtonItem = backBarButton } func layoutWebSights(preloaded: [Sight]) { self.preloadedPlaces = preloaded self.sightType = .webSights layoutTable() } func layoutHardTypedSights(preloaded: [SightCD]) { self.preloadedPlaces = preloaded self.sightType = .hardTypedSights layoutTable() } func layoutTable() { self.tableView = UITableView() tableView.backgroundColor = .white tableView.bounces = true tableView.delegate = self tableView.dataSource = self tableView.separatorColor = .clear switch self.sightType { case .hardTypedSights: tableView.register(HardSightTableViewCell.self, forCellReuseIdentifier: "hardSightCell") tableView.rowHeight = 270 case .webSights: tableView.register(WebSightTableViewCell.self, forCellReuseIdentifier: "webSightCell") tableView.rowHeight = 150 default: print("ERROR: sightType.noSights has reached, or sightType was nil.") } view.addSubview(tableView) tableView.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ tableView.topAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.topAnchor), tableView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor), tableView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor), tableView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor) ]) } } extension SightsScreenViewController: UITableViewDataSource, UITableViewDelegate { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return self.preloadedPlaces.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { switch self.sightType { case .hardTypedSights: let cell = tableView.dequeueReusableCell(withIdentifier: "hardSightCell", for: indexPath) as! HardSightTableViewCell if let sightCoerced = preloadedPlaces[indexPath.row] as? SightCD { cell.sightName = sightCoerced.name cell.desc = sightCoerced.desc if let geoCoerced = sightCoerced.geo { cell.longitude = geoCoerced["lng"] cell.latitude = geoCoerced["lat"] } else { fatalError("ERROR cell configure") } if let imageLink = sightCoerced.images { cell.imageURL = imageLink[0] } else { fatalError("ERROR cell configure") } cell.loadImage() cell.layoutName() } return cell case .webSights: let cell = tableView.dequeueReusableCell(withIdentifier: "webSightCell", for: indexPath) as! WebSightTableViewCell if let sightCoerced = preloadedPlaces[indexPath.row] as? Sight { cell.sightName = sightCoerced.name cell.longitude = sightCoerced.geo.lng cell.latitude = sightCoerced.geo.lat cell.loadImage() cell.layoutName() } return cell default: fatalError("ERROR") } } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { switch self.sightType { case .hardTypedSights: tableView.deselectRow(at: indexPath, animated: true) let sight = preloadedPlaces[indexPath.row] as! SightCD self.presenter.openSoloSightScreen(sight: sight) case .webSights: tableView.deselectRow(at: indexPath, animated: true) default: fatalError("ERROR") } } }
[ -1 ]
4a47e017427213e91a0af3e634bc916bb4058248
d55c35fff732275050ed0ab1845ee06e076c5fad
/LCApp/ViewController.swift
cc205dbac8ac3686815bbfa11e990fd8d36e0143
[]
no_license
iGoLDeNZz/LCApp
590c53f29057a98daa5f69e2613dc4f9abda6cc4
d2b9bdacded650321192b3a6089e2183776f9c61
refs/heads/master
2020-04-01T05:56:51.974957
2018-10-14T00:50:31
2018-10-14T00:50:31
152,923,623
0
0
null
null
null
null
UTF-8
Swift
false
false
376
swift
// // ViewController.swift // LCApp // // Created by Yousef At-tamimi on 10/14/18. // Copyright © 2018 Law Club. All rights reserved. // //just added a comment import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } }
[ -1 ]
ba5fc632dcc7b55f294c945167cad59773e78a8a
1bb0742f019c85fd58559fe511b29227c1445e27
/pokedex/ViewController.swift
1a900b45d53f4bd888b3905091246d3dca8f5b55
[]
no_license
sapovnela/pokedex
0473e8df09f7240f7ee3d7a36db045f69128d3b5
7516b90c1706a9d7fdb57e557d255a170de9d1e8
refs/heads/master
2021-01-20T01:11:29.433554
2017-05-23T18:47:44
2017-05-23T18:47:44
89,233,746
0
0
null
null
null
null
UTF-8
Swift
false
false
4,672
swift
// // ViewController.swift // pokedex // // Created by Emre Yavuz on 24/04/2017. // Copyright © 2017 Emre yavuz. All rights reserved. // import UIKit import AVFoundation class ViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UISearchBarDelegate { @IBOutlet weak var collection: UICollectionView! @IBOutlet weak var searchBar: UISearchBar! var pokemon = [Pokemon] () var filteredPokemon = [Pokemon]() var musicPlayer: AVAudioPlayer! var inSearchMode = false override func viewDidLoad() { super.viewDidLoad() collection.delegate = self collection.dataSource = self searchBar.delegate = self searchBar.returnKeyType = UIReturnKeyType.done initAudio() parsePokemonCSV() } func initAudio() { let path = Bundle.main.path(forResource: "music", ofType: "mp3") do { musicPlayer = try AVAudioPlayer(contentsOf: NSURL(string: path!)! as URL) musicPlayer.prepareToPlay() musicPlayer.numberOfLoops = -1 musicPlayer.play() } catch let err as NSError { print(err.debugDescription) } } func parsePokemonCSV() { let path = Bundle.main.path(forResource: "pokemon", ofType: "csv")! do { let csv = try CSV(contentsOfURL: path) let rows = csv.rows for row in rows { let pokeId = Int(row["id"]!)! let name = row["identifier"]! let poke = Pokemon(name: name, pokedexId: pokeId) pokemon.append(poke) } } catch let err as NSError { print(err.debugDescription) } } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { if let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "PokeCell", for: indexPath) as? PokeCell { let poke: Pokemon! if inSearchMode { poke = filteredPokemon[indexPath.row] } else { poke = pokemon[indexPath.row] } cell.configureCell(pokemon: poke) return cell } else { return UICollectionViewCell() } } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let poke: Pokemon! if inSearchMode { poke = filteredPokemon[indexPath.row] } else { poke = pokemon[indexPath.row] } performSegue(withIdentifier: "PokemonDetailVC", sender: poke) } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { if inSearchMode { return filteredPokemon.count } return pokemon.count } func numberOfSections(in collectionView: UICollectionView) -> Int { return 1 } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { return CGSize (width: 105, height: 105) } @IBAction func musicBtnPressed(_ sender: UIButton!) { if musicPlayer.isPlaying { musicPlayer.stop() sender.alpha = 0.2 } else { musicPlayer.play() sender.alpha = 1.0 } } func searchBarSearchButtonClicked(_ searchBar: UISearchBar) { view.endEditing(true) } func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { if searchBar.text == nil || searchBar.text == "" { inSearchMode = false view.endEditing(true) collection.reloadData() } else { inSearchMode = true let lower = searchBar.text!.lowercased() filteredPokemon = pokemon.filter({$0.name.range(of: lower) != nil}) collection.reloadData() } } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "PokemonDetailVC" { if let detailsVC = segue.destination as? PokemonDetailVC { if let poke = sender as? Pokemon { detailsVC.pokemon = poke } } } } }
[ 291252 ]
1cae73b7846143b70e223089244c0ed4d8c4bab4
ef0f22ea1ebf21a1e53f531f47ba2a0ee0f374c0
/hoemeworkSwipeJestureUITests/hoemeworkSwipeJestureUITests.swift
857f7ca51738da548448afb86b889b25d192f5c9
[]
no_license
Takahiro0303/homeworkSwipeGesuture
e05939053d11edeca39a6ca7264bd778bbf6df5f
8978fe806867934f6130d344a6f998ae2f6caf9c
refs/heads/master
2021-05-16T18:03:39.840785
2017-09-11T07:55:15
2017-09-11T07:55:15
103,106,306
0
0
null
null
null
null
UTF-8
Swift
false
false
1,306
swift
// // hoemeworkSwipeJestureUITests.swift // hoemeworkSwipeJestureUITests // // Created by takahiro tshuchida on 2017/09/11. // Copyright © 2017年 Takahiro Tshuchida. All rights reserved. // import XCTest class hoemeworkSwipeJestureUITests: 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, 182277, 243720, 282634, 313356, 155665, 305173, 237599, 241695, 223269, 229414, 292901, 354342, 102441, 315433, 278571, 313388, 325675, 354346, 282671, 102446, 229425, 124974, 243763, 241717, 180279, 229431, 215095, 319543, 213051, 288829, 325695, 288835, 286787, 307269, 237638, 313415, 239689, 233548, 311373, 315468, 278607, 196687, 311377, 354386, 223317, 315477, 368732, 180317, 323678, 315488, 321632, 45154, 280676, 313446, 215144, 307306, 194667, 233578, 278637, 288878, 319599, 278642, 284789, 131190, 288890, 215165, 131199, 194692, 278669, 235661, 333968, 241809, 323730, 278676, 311447, 153752, 327834, 284827, 278684, 329884, 299166, 278690, 311459, 215204, 233635, 333990, 284840, 299176, 284843, 278703, 323761, 184498, 278707, 278713, 223418, 280761, 180409, 295099, 227517, 299197, 258233, 280767, 299202, 139459, 309443, 176325, 338118, 227525, 299208, 131270, 301255, 280779, 282832, 227536, 301270, 229591, 301271, 280792, 147679, 311520, 147680, 325857, 356575, 280803, 307431, 338151, 182503, 319719, 317676, 286957, 125166, 125170, 395511, 313595, 184574, 309504, 125184, 217352, 125192, 125197, 194832, 227601, 125200, 319764, 278805, 338196, 125204, 334104, 282908, 311582, 299294, 282912, 233761, 278817, 125215, 211239, 282920, 334121, 317738, 325930, 311596, 338217, 125225, 321839, 336177, 315698, 98611, 125236, 282938, 307514, 278843, 127292, 168251, 287040, 319812, 311622, 280903, 227655, 323914, 201037, 383309, 282959, 229716, 250196, 289109, 168280, 323934, 391521, 239973, 381286, 285031, 313703, 416103, 280938, 242027, 242028, 321901, 354671, 278895, 287089, 250227, 199030, 227702, 315768, 291193, 139641, 223611, 291194, 313726, 311679, 211327, 291200, 158087, 313736, 227721, 242059, 311692, 106893, 227730, 285074, 240020, 190870, 315798, 190872, 291225, 285083, 317851, 293275, 242079, 283039, 285089, 293281, 289185, 305572, 156069, 227743, 301482, 289195, 375211, 334259, 338359, 299449, 319931, 311739, 293309, 278974, 336319, 311744, 317889, 291266, 278979, 336323, 278988, 129484, 281038, 281039, 278992, 283089, 289229, 326093, 283088, 279000, 176602, 242138, 160224, 279009, 291297, 285152, 369121, 188899, 279014, 195044, 319976, 279017, 302539, 311787, 334315, 281071, 319986, 236020, 279030, 311800, 293368, 279033, 317949, 322396, 279042, 283138, 233987, 287237, 324098, 334345, 309770, 340489, 342537, 279053, 322057, 283154, 303634, 279060, 279061, 303635, 182802, 279066, 188954, 322077, 291359, 342560, 293420, 236080, 289328, 283185, 279092, 23093, 234037, 244279, 244280, 338491, 340539, 301635, 309831, 55880, 322119, 377419, 303693, 281165, 301647, 281170, 326229, 309847, 189016, 115287, 244311, 332379, 287319, 111197, 295518, 287327, 242274, 244326, 279143, 279150, 281200, 287345, 287348, 301688, 189054, 303743, 297600, 287359, 291455, 301702, 279176, 311944, 334473, 344714, 316044, 311950, 326288, 311953, 316048, 287379, 336531, 295575, 227991, 289435, 303772, 205469, 221853, 323335, 285348, 340645, 279207, 295591, 176810, 248494, 279215, 285360, 293552, 285362, 299698, 287412, 166581, 295598, 154295, 279218, 164532, 303802, 314043, 287418, 66243, 291529, 287434, 225996, 363212, 287438, 135888, 279249, 242385, 303826, 279253, 369365, 369366, 158424, 230105, 299737, 322269, 338658, 342757, 295653, 289511, 230120, 234216, 330473, 285419, 330476, 289517, 279278, 312046, 215790, 170735, 125683, 230133, 199415, 342775, 234233, 242428, 279293, 205566, 289534, 35584, 299777, 322302, 228099, 285443, 375552, 291591, 295688, 322312, 346889, 285450, 312076, 326413, 295698, 291605, 166677, 207639, 283418, 285467, 221980, 281378, 234276, 336678, 283431, 203560, 279337, 262952, 262953, 293673, 289580, 262957, 164655, 301872, 242481, 234290, 303921, 318251, 285493, 230198, 328495, 285496, 301883, 201534, 289599, 281407, 342846, 222017, 295745, 293702, 318279, 283466, 281426, 279379, 244569, 234330, 201562, 281434, 295769, 230238, 230239, 301919, 279393, 293729, 275294, 281444, 357219, 279398, 303973, 351078, 349025, 177002, 308075, 242540, 310132, 295797, 228214, 207735, 201590, 295799, 279418, 177018, 269179, 308093, 336765, 314240, 291713, 158594, 330627, 340865, 240517, 287623, 228232, 299912, 279434, 320394, 316299, 252812, 234382, 308111, 416649, 308113, 293780, 310166, 289691, 209820, 240543, 283551, 310177, 289699, 189349, 289704, 279465, 293801, 326571, 304050, 177074, 326580, 289720, 326586, 289723, 189373, 213956, 359365, 19398, 345030, 213961, 127945, 279499, 211913, 56270, 191445, 304086, 183254, 207839, 340960, 234469, 314343, 304104, 123880, 340967, 324587, 234476, 183276, 289773, 320492, 203758, 248815, 287730, 320495, 240631, 214009, 201721, 312313, 312317, 234499, 418819, 293894, 330759, 322571, 230411, 330766, 320526, 234513, 238611, 140311, 293911, 238617, 197658, 316441, 326684, 336930, 132140, 113710, 189487, 281647, 322609, 318515, 312372, 203829, 238646, 300087, 238650, 320571, 21567, 308288, 336962, 160834, 314437, 349254, 238663, 300109, 234578, 207954, 250965, 296023, 205911, 339031, 314458, 156763, 281698, 281699, 230500, 285795, 250982, 322664, 228457, 279659, 318571, 234606, 300145, 230514, 238706, 187508, 312435, 279666, 300147, 302202, 285819, 314493, 285823, 150656, 234626, 279686, 222344, 285833, 285834, 234635, 228492, 318602, 337037, 177297, 162962, 187539, 347286, 308375, 324761, 285850, 296091, 119965, 234655, 300192, 302239, 330912, 306339, 339106, 234662, 300200, 302251, 208044, 238764, 249003, 3243, 322733, 294069, 324790, 300215, 64699, 294075, 228541, 339131, 343230, 283841, 148674, 283846, 312519, 279752, 283849, 148687, 290001, 189651, 316628, 279766, 189656, 279775, 304352, 298209, 304353, 339167, 279780, 310496, 228587, 279789, 290030, 302319, 316661, 234741, 208123, 292092, 279803, 228608, 234756, 322826, 242955, 312588, 177420, 318732, 126229, 318746, 320795, 320802, 130342, 304422, 130344, 130347, 292145, 298290, 208179, 312628, 345398, 300342, 159033, 222523, 286012, 181568, 279872, 279874, 300355, 193858, 294210, 300354, 372039, 304457, 230730, 345418, 337228, 296269, 222542, 224591, 234830, 238928, 296274, 331091, 150868, 314708, 283990, 357720, 300378, 300379, 294236, 316764, 292194, 230757, 281958, 134504, 306541, 284015, 296304, 234864, 312688, 327030, 314742, 310650, 224637, 306558, 290176, 306561, 179586, 337280, 243073, 314752, 294278, 296328, 296330, 298378, 368012, 318860, 304523, 9618, 279955, 306580, 112019, 224662, 234902, 282008, 314771, 318876, 282013, 290206, 343457, 148899, 298406, 282023, 245160, 279979, 279980, 241067, 314797, 286128, 173492, 279988, 286133, 284086, 259513, 310714, 284090, 228796, 302523, 54719, 302530, 280003, 228804, 292291, 306630, 415170, 300488, 310725, 306634, 370122, 310731, 280011, 300490, 310735, 339403, 337359, 329168, 312785, 280020, 222674, 329170, 280025, 310747, 239069, 144862, 286176, 187877, 310758, 320997, 280042, 280043, 191980, 300526, 329198, 337391, 282097, 308722, 296434, 306678, 191991, 288248, 40439, 286201, 300539, 288252, 210429, 359931, 290304, 245249, 228868, 292359, 218632, 302602, 323083, 230922, 294413, 359949, 304655, 323088, 329231, 282132, 302613, 230933, 282135, 316951, 175640, 374297, 302620, 222754, 306730, 312879, 230960, 288305, 239159, 290359, 323132, 235069, 157246, 288319, 288322, 280131, 349764, 310853, 282182, 194118, 288328, 292424, 292426, 286281, 124486, 333389, 224848, 349780, 290391, 128600, 235096, 239192, 196184, 306777, 212574, 345697, 204386, 300643, 300645, 282214, 312937, 204394, 224874, 243306, 312941, 138862, 206447, 310896, 314997, 294517, 290425, 288377, 339579, 337533, 325246, 333438, 235136, 280193, 282244, 239238, 288391, 282248, 286344, 323208, 179853, 286351, 188049, 229011, 239251, 323226, 179868, 229021, 318247, 302751, 282272, 198304, 245413, 282279, 298664, 298666, 317102, 286387, 300725, 286392, 300729, 302778, 306875, 280252, 280253, 282302, 323262, 286400, 321217, 296636, 280259, 323265, 282309, 239305, 280266, 306891, 296649, 212684, 302798, 241360, 282321, 313042, 286419, 333522, 241366, 280279, 282330, 18139, 280285, 294621, 282336, 325345, 294629, 153318, 337638, 333543, 12009, 181992, 288492, 282349, 34547, 67316, 323315, 286457, 284410, 313082, 200444, 288508, 282366, 286463, 319232, 288515, 280326, 282375, 249606, 284425, 300810, 282379, 216844, 116491, 284430, 280333, 300812, 161553, 124691, 284436, 118549, 278294, 282390, 116502, 321308, 321309, 282399, 341791, 282401, 339746, 241440, 186148, 186149, 216868, 241447, 315172, 333609, 286507, 294699, 284460, 280367, 282418, 280373, 280377, 319289, 321338, 282428, 280381, 345918, 413500, 241471, 280386, 325444, 280391, 153416, 315209, 325449, 342705, 280396, 159563, 307024, 325460, 237397, 307030, 18263, 341846, 317268, 241494, 284508, 300893, 307038, 370526, 237411, 284515, 276326, 282471, 296807, 292713, 282476, 292719, 313200, 296815, 325491, 313204, 317305, 317308, 339840, 315265, 280451, 325508, 327556, 333700, 282503, 67464, 305032, 325514, 350091, 350092, 243592, 188293, 311183, 184207, 315272, 315275, 282517, 294806, 350102, 214936, 294808, 337816, 239515, 333727, 298912, 319393, 214943, 294820, 118693, 219046, 333734, 284584, 294824, 298921, 313257, 292783, 126896, 300983, 343993, 288698, 98240, 294849, 214978, 280517, 280518, 214983, 282572, 282573, 153553, 24531, 231382, 323554, 292835, 190437, 292838, 294887, 317416, 174058, 278507, 298987, 311277, 296942, 124912, 327666, 278515, 325620, 239610 ]
d6c366ce2426ea87b37c120651088a8de8eee273
8fd6661d37e31f1e0c040cec76930f5cca1afc57
/Swift/01 Swift基础学习/889 代码/MJ课程代码/TestiOS/Pods/RxCocoa/RxCocoa/Traits/Signal/PublishRelay+Signal.swift
ad9d07a5dd3b38bc1e7ac9a884b36de9600dc76f
[ "Apache-2.0", "MIT" ]
permissive
lionsom/XiOS
f7d0182e73693f949e9f24bbc9caaed7d86b05fe
df6b127a156ad6da50f582213fdbcea18f23a0f7
refs/heads/master
2023-07-06T01:04:35.379824
2023-06-29T17:29:30
2023-06-29T17:29:30
192,576,052
20
3
null
null
null
null
UTF-8
Swift
false
false
491
swift
// // PublishRelay+Signal.swift // RxCocoa // // Created by Krunoslav Zaher on 12/28/15. // Copyright © 2017 Krunoslav Zaher. All rights reserved. // import RxRelay import RxSwift public extension PublishRelay { /// Converts `PublishRelay` to `Signal`. /// /// - returns: Observable sequence. func asSignal() -> Signal<Element> { let source = asObservable() .observeOn(SignalSharingStrategy.scheduler) return SharedSequence(source) } }
[ 15529, 112205, 309 ]
a611eb67af8f2c56543f3307de3368a7bbff6f64
5be46004a6b9b3881fb06a18a03e6fee04842ff4
/Komposku/Core/CoreDataManager.swift
4a29cf544e1ee2b54da3ee928d5b04b18b77d92d
[]
no_license
Carpathianoo/MC3-Project
71563854e8feb433eae1928a48a25c8bfbeee0fa
28c714806807b8ba119a479b448a8faef42fc233
refs/heads/main
2023-07-07T19:58:48.048366
2021-09-01T03:23:41
2021-09-01T03:23:41
389,376,648
0
0
null
2021-09-01T03:23:42
2021-07-25T15:13:43
Swift
UTF-8
Swift
false
false
4,818
swift
// // CoreDataManager.swift // Komposku // // Created by Clara Anggraini on 27/07/21. // import UIKit import CoreData enum processType{ case create case extend } class CoreDataManager{ static let shared = CoreDataManager() let persistentContainer: NSPersistentContainer let notificationPublisher = NotificationPublisher() var viewContext: NSManagedObjectContext{ return persistentContainer.viewContext } private init(){ persistentContainer = NSPersistentContainer(name: "Komposku") persistentContainer.loadPersistentStores{ (description, error) in if let error = error{ fatalError("Unable to initialize Core Data \(error)") } } } func save(){ if viewContext.hasChanges{ do{ try viewContext.save() }catch{ viewContext.rollback() fatalError("Unable to save \(error)") } } } func createCompost(name: String, photo: String, moisture: Double){ let compostsCount = getAllCompost().count let compost = Compost(context: viewContext) let processes = createProcess(compost: compost, name: name) var index = 0 if compostsCount != 0{ index = compostsCount-1 } compost.identifier = Int64(index+1) compost.name = name compost.photo = photo compost.estimated_date = Calendar.current.date(byAdding: .day, value: 15, to: Date()) compost.moisture = moisture compost.process = processes as NSSet save() } func createProcess(compost: Compost, name: String)-> Set<Process>{ var processArr: Set<Process> = compost.process as! Set<Process> let detailArr = ["Aduk dan cek kondisi", "Aduk dan cek kondisi", "Aduk dan cek kondisi", "Aduk dan cek kondisi", "Panen"] var index = 1 if processArr.isEmpty{ let process = Process(context: viewContext) process.identifier = Int64(index) process.detail = "Kompos dibuat" process.date = Date() process.isDone = true processArr.insert(process) }else{ index = processArr.count } for i in 0...4{ let process = Process(context: viewContext) index += 1 process.identifier = Int64(index) process.detail = detailArr[i] process.isDone = false process.date = Calendar.current.date(byAdding: .day, value: 3*(i+1), to: Date()) notificationPublisher.sendNotification(title: name, body: process.detail!, badge: 1, date: process.date!) processArr.insert(process) } return processArr } func extendProcess(from compost: Compost, date: Date){ var processes = getAllProcess(from: compost) guard let process = processes.last else{ return} process.detail = "Perpanjang" process.date = date process.isDone = true processes.append(process) compost.process = NSSet(array: processes) compost.process = createProcess(compost: compost, name: compost.name!) as NSSet compost.estimated_date = Calendar.current.date(byAdding: .day, value: 15, to: Date()) save() } func getAllCompost() -> [Compost]{ let request: NSFetchRequest<Compost> = Compost.fetchRequest() do{ return try viewContext.fetch(request) }catch{ return [] } } func getAllProcess(from compost: Compost) -> [Process]{ var processes: [Process] = [] if let procs = compost.process as? Set<Process>{ for p in procs{ processes.append(p) } processes = processes.sorted{procA, procB in procA.identifier < procB.identifier} } return processes } //update process kalo udah selesai func updateProcessStatus(process: Process){ process.isDone = true save() } func scheduleNotification(process: Process) { guard let unwrappedDetail = process.detail else {return} guard let unwrappedDate = process.date else {return} guard let unwrappedCompost = process.compost?.name else {return} notificationPublisher.sendNotification(title: unwrappedCompost, body: "Waktunya \(unwrappedDetail) kompos kamu.", badge: 1, date: unwrappedDate) } func deleteCompost(compost: Compost){ viewContext.delete(compost) save() } }
[ -1 ]
405f711cf6806b81f368328c335bd5d12a20d6de
9cb6ab9f7ef2b3859acb57cebc949dc101ce6801
/PostalDemo/PostalDemo/LoginTableViewController.swift
6ee89838ebbdf16375c8eda29f34f45b0ba1f328
[ "MIT" ]
permissive
honguyenbinh/Postal
75f073bbfac4740d08aa2e0438d6a02e46a11c53
c01cf1ec6d2582e54190f393c31c8c5f360d561b
refs/heads/master
2021-01-11T06:23:11.561929
2016-09-19T09:09:41
2016-09-19T09:09:41
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,325
swift
// // LoginTableViewController.swift // PostalDemo // // Created by Kevin Lefevre on 24/05/2016. // Copyright © 2016 Snips. All rights reserved. // import UIKit import Postal enum LoginError: ErrorType { case badEmail case badPassword case badHostname case badPort } extension LoginError: CustomStringConvertible { var description: String { switch self { case .badEmail: return "Bad mail" case .badPassword: return "Bad password" case .badHostname: return "Bad hostname" case .badPort: return "Bad port" } } } final class LoginTableViewController: UITableViewController { private let mailsSegueIdentifier = "mailsSegue" @IBOutlet weak var emailTextField: UITextField! @IBOutlet weak var passwordTextField: UITextField! @IBOutlet weak var hostnameTextField: UITextField! @IBOutlet weak var portTextField: UITextField! var provider: MailProvider? } // MARK: - View lifecycle extension LoginTableViewController { override func viewDidLoad() { super.viewDidLoad() if let provider = provider, configuration = provider.preConfiguration { emailTextField.placeholder = "exemple@\(provider.hostname)" hostnameTextField.userInteractionEnabled = false hostnameTextField.text = configuration.hostname portTextField.userInteractionEnabled = false portTextField.text = "\(configuration.port)" } } } // MARK: - Navigation management extension LoginTableViewController { override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { switch (segue.identifier, segue.destinationViewController) { case (.Some(mailsSegueIdentifier), let vc as MailsTableViewController): do { vc.configuration = try createConfiguration() } catch let error as LoginError { showAlertError("Error login", message: (error as NSError).localizedDescription) } catch { fatalError() } break default: break } } } // MARK: - Helpers private extension LoginTableViewController { func createConfiguration() throws -> Configuration { guard let email = emailTextField.text where !email.isEmpty else { throw LoginError.badEmail } guard let password = passwordTextField.text where !password.isEmpty else { throw LoginError.badPassword } if let configuration = provider?.preConfiguration { return Configuration(hostname: configuration.hostname, port: configuration.port, login: email, password: .plain(password), connectionType: configuration.connectionType, checkCertificateEnabled: configuration.checkCertificateEnabled) } else { guard let hostname = hostnameTextField.text where !hostname.isEmpty else { throw LoginError.badHostname } guard let portText = portTextField.text where !portText.isEmpty else { throw LoginError.badPort } guard let port = UInt16(portText) else { throw LoginError.badPort } return Configuration(hostname: hostname, port: port, login: email, password: .plain(""), connectionType: .tls, checkCertificateEnabled: true) } } }
[ -1 ]
350b60d5e8845aaf9141e7ba647dcd5d6a791368
da437ab54b9e7bc3537a5e1d0d87e309ac06699b
/commands/system/copy-last-screenshot.swift
e532603a2023361cd0cf3427838c9c1fed7bd5d9
[ "MIT" ]
permissive
jacc/script-commands
00f1f9bf0efda5543b75f61a75e87b468db2f45e
0654e01f347ce12cc88ee0db744b2e0a4ff7cc47
refs/heads/master
2023-01-13T07:51:39.121789
2020-11-19T23:26:35
2020-11-19T23:26:35
312,122,744
0
0
MIT
2020-11-12T01:02:24
2020-11-12T00:14:52
Swift
UTF-8
Swift
false
false
1,220
swift
#!/usr/bin/swift // Required parameters: // @raycast.schemaVersion 1 // @raycast.title Copy Last Screenshot // @raycast.mode silent // Optional parameters: // @raycast.icon 📸 import Cocoa // MARK: - Main let query = NSMetadataQuery() guard let lastScreenshot = query.searchScreenshots()?.first, let path = lastScreenshot.value(forAttribute: "kMDItemPath") as? String else { print("Cannot find screenshot") exit(1) } let fileURL = URL(fileURLWithPath: path) NSPasteboard.general.clearContents() NSPasteboard.general.writeObjects([fileURL as NSPasteboardWriting]) print("Copied last screenshot") // MARK: - Convenience extension NSMetadataQuery { func searchScreenshots() -> [NSMetadataItem]? { predicate = NSPredicate(format: "kMDItemIsScreenCapture = 1") sortDescriptors = [NSSortDescriptor(key: "kMDItemFSCreationDate", ascending: false)] NotificationCenter.default.addObserver(forName: .NSMetadataQueryDidFinishGathering, object: nil, queue: nil) { [weak self] _ in self?.disableUpdates() self?.stop() CFRunLoopStop(CFRunLoopGetCurrent()); } guard start() else { return nil } CFRunLoopRun() return results.compactMap { $0 as? NSMetadataItem } } }
[ -1 ]
ed91119477742c6bb76b379f3e41611782d50f60
e5b6d5a6711f7c59c38e592dd22e1f047970dc04
/BreinifyApi/api/BreinActivity.swift
b41b80248f345a4c370bdc2aee8bbbde56eb754c
[ "MIT" ]
permissive
Breinify/brein-api-library-ios
07caa90ba7fb638af94e72ad044ef17c42863955
2fb8cdeba1987a20366b3f0e174759c54bc4adbc
refs/heads/master
2022-09-27T09:55:53.991083
2022-09-15T02:01:30
2022-09-15T02:01:30
66,325,462
3
1
null
null
null
null
UTF-8
Swift
false
false
7,448
swift
// // Created by Marco Recchioni // Copyright (c) 2020 Breinify. All rights reserved. // import Foundation /** Sends an activity to the engine utilizing the API. The call is done asynchronously as a POST request. It is important, that a valid API-key is configured prior to use this. */ open class BreinActivity: BreinBase, ISecretStrategy { /// ActivityType of the activity var activityType: String? /// Category of the activity var category: String? /// Description of the activity var desc: String? /// tags dictionary var tagsDic: [String: Any]? /// activity dictionary var activityDic: [String: Any]? /// returns activity type /// /// - Returns: the BreinActivity itself public func getActivityType() -> String! { activityType } /// sets the activity type /// /// - Parameter activityType: an activityType as String /// - Returns: the BreinActivity itself @discardableResult @objc public func setActivityType(_ activityType: String?) -> BreinActivity { self.activityType = activityType return self } /// Provides the category /// /// - Returns: the category as String @discardableResult public func getCategory() -> String! { category } /// Sets the category. /// /// - Parameter category: /// - Returns: the BreinActivity itself @discardableResult @objc public func setCategory(_ category: String?) -> BreinActivity { self.category = category return self } /// Provides the description of the activity /// /// - Returns: the description as String public func getDescription() -> String! { desc } @discardableResult @objc public func setDescription(_ description: String!) -> BreinActivity { desc = description return self } /// Provides the Activity Endpoint for HTTP requests to the Breinify Engine /// /// - Returns: the HTTP endpoint as String override public func getEndPoint() -> String! { getConfig()?.getActivityEndpoint() } @discardableResult @objc public func setTagsDic(_ tagsDic: [String: Any]?) -> BreinActivity { self.tagsDic = tagsDic return self } public func getTagsDic() -> [String: Any]? { tagsDic } @discardableResult @objc public func setTag(_ key: String, _ value: AnyObject) -> BreinActivity { if tagsDic == nil { tagsDic = [String: Any]() } tagsDic?[key] = value return self } @discardableResult public func setActivityDic(_ activityDic: [String: Any]) -> BreinActivity { self.activityDic = activityDic return self } public func getActivityDic() -> [String: Any]? { activityDic } /// Sends an activity to the Breinify server. /// /// - Parameters: /// - breinUser: the user-information /// - breinActivityType: the type of activity /// - breinCategoryType: the category (can be null or undefined) /// - description: the description for the activity /// - success: a callback function that is invoked in case of success. /// - failure: a callback function that is invoked in case of an error. /// - Throws: BreinRuntimeError public func activity(_ breinUser: BreinUser!, breinActivityType: String!, _ breinCategoryType: String! = nil, _ description: String! = nil, _ success: @escaping BreinEngine.apiSuccess = { _ in }, _ failure: @escaping BreinEngine.apiFailure = { _ in }) throws { // set the values for further usage setUser(breinUser) setActivityType(breinActivityType) setCategory(breinCategoryType) setDescription(description) // invoke the request, "self" has all necessary information if nil == getBreinEngine() { throw BreinError.BreinRuntimeError("Rest engine not initialized. You have to configure BreinConfig with a valid engine.") } do { try getBreinEngine()?.sendActivity(self, success: success, failure: failure) } catch { BreinLogger.shared.log(error.localizedDescription) } } /// Creates a dictionary that will be used for the request. /// /// - Returns: Dictionary override public func prepareJsonRequest() -> [String: Any]! { // call base class super.prepareJsonRequest() var requestData = [String: Any]() if let breinUser = getUser() { var userData = [String: Any]() breinUser.prepareUserRequest(&userData, breinConfig: getConfig()) requestData["user"] = userData as Any? } // activity data var activityData = [String: Any]() if let activityType = getActivityType() { activityData["type"] = activityType as Any? } if let description = getDescription() { activityData["description"] = description as Any? } if let category = getCategory() { activityData["category"] = category as Any? } // add tags if tagsDic?.isEmpty == false { activityData["tags"] = tagsDic as Any? } // activity dic if let aActivityDic = getActivityDic() { if aActivityDic.count > 0 { BreinMapUtil.fillMap(aActivityDic, requestStructure: &activityData) } } // add all to the activity dictionary requestData["activity"] = activityData as Any? // add base stuff prepareBaseRequestData(&requestData) return requestData } /// Used to create a clone of an activity. This is important in order to prevent /// concurrency issues. /// /// - Returns: the clone of the activity object public func clone() -> BreinActivity { // create a new activity object let clonedBreinActivity = BreinActivity() .setActivityType(getActivityType()) .setCategory(getCategory()) .setDescription(getDescription()) // clone dictionaries => simple copy is enough if let clonedActivityDic = getActivityDic() { clonedBreinActivity.setActivityDic(clonedActivityDic) } if let clonedTagsDic = getTagsDic() { clonedBreinActivity.setTagsDic(clonedTagsDic) } // clone from base class clonedBreinActivity.cloneBase(self) return clonedBreinActivity } override public func clear() { super.clear() activityDic?.removeAll() tagsDic?.removeAll() category = "" desc = "" activityType = "" } /// Generates the signature for the request /// /// - Returns: full signature /// - Throws: BreinRuntimeError public override func createSignature() throws -> String! { let breinActivityType = getActivityType() ?? "" let unixTimestamp = getUnixTimestamp() let message = breinActivityType + String(unixTimestamp) + "1" return try BreinUtil.generateSignature(message, secret: getConfig()?.getSecret()) } }
[ -1 ]
6528da5104172aa552adb59542cf2decdabdb983
20ac3d16a365e80d13f4aa41c63cb44de57eac45
/WeatherForecast/WeatherForecast/ViewController.swift
a81018d103f84ce25ad3a9883ccd583fe18e2bc9
[]
no_license
haider0324/WeatherForecast
3cbc870d44b334847ea16484092da958c2b83933
cc4b5212d40c22b38653858e68282d146ad017a3
refs/heads/master
2021-01-17T18:33:51.415610
2016-10-21T09:13:29
2016-10-21T09:13:29
71,531,189
0
0
null
null
null
null
UTF-8
Swift
false
false
5,106
swift
// // ViewController.swift // WeatherForecast // // Created by Haider Abbas on 20/10/16. // Copyright © 2016 Haider Abbas. All rights reserved. // import UIKit class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { // MARK: - IBOutlets @IBOutlet weak var weatherTable: UITableView! @IBOutlet weak var lblLocation: UILabel! // MARK: - Properties let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate private var arrWeathers: [[String: AnyObject]]! let gpaViewController = GooglePlacesAutocomplete( apiKey: "AIzaSyCYdqBv8I0EXSDAraCCDWqHLGT0rlPoFIQ", placeType: .Address ) // MARK: - Initializers methods func setInitialParams(){ self.navigationItem.title = "Weather" gpaViewController.placeDelegate = self gpaViewController.navigationBar.barStyle = UIBarStyle.Black gpaViewController.navigationBar.translucent = false gpaViewController.navigationBar.barTintColor = Colors.navigationBarColor gpaViewController.navigationBar.tintColor = UIColor.whiteColor() gpaViewController.navigationBar.titleTextAttributes = [NSFontAttributeName: SearchControllerFont!] arrWeathers = [] } // MARK: - Lifecycle methods override func viewDidLoad() { super.viewDidLoad() setInitialParams() // 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. } // MARK: - Navigation // MARK: - Lifetime // MARK: - Private methods // MARK: - Public methods // MARK: - Public methods // MARK: - Getter & setter methods // MARK: - IBActions @IBAction func changeLocation(sender: AnyObject) { if appDelegate.isInternetActive == true { presentViewController(gpaViewController, animated: true, completion: nil) } else { appDelegate.displayAlertWithTitle("Oops!", message: "Please check your Internet Connectivity") } } // MARK: - Target-Action methods // MARK: - Notification handler methods // MARK: - Datasource methods func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return arrWeathers.count //return 10 } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let weather = arrWeathers[indexPath.row] let cell = tableView.dequeueReusableCellWithIdentifier("WeatherForecastTableViewCell") as! WeatherTableViewCell //cell.configure() cell.config(withWeathers: weather) return cell } // MARK: - Delegate methods func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { return 80 } } //MARK: ViewController Extension extension ViewController: GooglePlacesAutocompleteDelegate { func placeSelected(place: Place) { print(place.description) self.dismissViewControllerAnimated(true, completion: nil) place.getDetails { details in print(details) self.lblLocation.text = place.description // A querystring param. CPProgressView.shared.showProgressView() WEATHERAPI.FORECAST.get(["lat": "\(details.latitude)", "lon":"\(details.longitude)", "APPID": WEATHERAPIKEY]) { response in CPProgressView.shared.hideProgressView() guard response.error == nil else { return self.appDelegate.displayAlertWithTitle("Error \((response.error?.code)!)", message: (response.error?.localizedDescription)!) } guard let jsonDict = response.responseJSON as? JSONDictionary else { return self.appDelegate.displayAlertWithTitle("Error", message: "Error: couldn't parse JSON from data") } //print("\(jsonDict)") guard let weatherList = jsonDict["list"] as? [[String: AnyObject]] where (weatherList.count > 0) else { return self.appDelegate.displayAlertWithTitle("Oops", message: "No weather data found of your location") } print("\(weatherList.count)") if weatherList.count > 0 { self.arrWeathers = weatherList } else { self.arrWeathers = [[String: AnyObject]]() } self.weatherTable.reloadData() } } } func placeViewClosed() { dismissViewControllerAnimated(true, completion: nil) } }
[ -1 ]
ac8b89730289bd40b908f60fafe0689b82e7701a
896be2a6829142d47dd5a20639310d5a09687736
/Carthage/Checkouts/RxSwift/RxTests/RxSwiftTests/TestImplementations/Schedulers/TestScheduler.swift
86b563029d2b2010404a0b60a83a840b7b8938b4
[ "Apache-2.0", "MIT" ]
permissive
fnazarios/weather-app
be4eae33433ca63adbc6ff90a5b17aaf07461dbc
4b9c58743f333fddfa0ff9db12df71b3efbed07d
refs/heads/master
2021-01-10T11:29:05.866022
2015-11-18T20:26:16
2015-11-18T20:26:16
46,445,263
2
0
null
null
null
null
UTF-8
Swift
false
false
2,955
swift
// // TestScheduler.swift // Rx // // Created by Krunoslav Zaher on 2/8/15. // Copyright (c) 2015 Krunoslav Zaher. All rights reserved. // import Foundation import RxSwift func createHotObservable<Element>(scheduler: TestScheduler, events: [Recorded<Element>]) -> HotObservable<Element> { return HotObservable(testScheduler: scheduler, recordedEvents: events) } func createColdObservable<Element>(scheduler: TestScheduler, events: [Recorded<Element>]) -> ColdObservable<Element> { return ColdObservable(testScheduler: scheduler, recordedEvents: events) } func createObserver<E>(scheduler: TestScheduler) -> MockObserver<E> { return MockObserver(scheduler: scheduler) } class TestScheduler : VirtualTimeSchedulerBase { override init(initialClock: Time) { super.init(initialClock: initialClock) } func createHotObservable<Element>(events: [Recorded<Element>]) -> HotObservable<Element> { return HotObservable(testScheduler: self as AnyObject as! TestScheduler, recordedEvents: events) } func createColdObservable<Element>(events: [Recorded<Element>]) -> ColdObservable<Element> { return ColdObservable(testScheduler: self as AnyObject as! TestScheduler, recordedEvents: events) } func createObserver<E>() -> MockObserver<E> { return MockObserver(scheduler: self as AnyObject as! TestScheduler) } func scheduleAt(time: Time, action: () -> Void) { self.schedule((), time: time) { _ in action() return NopDisposable.instance } } func start<Element : Equatable>(created: Time, subscribed: Time, disposed: Time, create: () -> Observable<Element>) -> MockObserver<Element> { var source : Observable<Element>? = nil var subscription : Disposable? = nil let observer: MockObserver<Element> = createObserver() let state : Void = () self.schedule(state, time: created) { (state) in source = create() return NopDisposable.instance } self.schedule(state, time: subscribed) { (state) in subscription = source!.subscribe(observer) return NopDisposable.instance } self.schedule(state, time: disposed) { (state) in subscription!.dispose() return NopDisposable.instance } start() return observer } func start<Element : Equatable>(disposed: Time, create: () -> Observable<Element>) -> MockObserver<Element> { return start(RxTest.Defaults.created, subscribed: RxTest.Defaults.subscribed, disposed: disposed, create: create) } func start<Element : Equatable>(create: () -> Observable<Element>) -> MockObserver<Element> { return start(RxTest.Defaults.created, subscribed: RxTest.Defaults.subscribed, disposed: RxTest.Defaults.disposed, create: create) } }
[ -1 ]
0f57616f7df99a523fa33901429c80200e13aad6
87dee01d798148673156f8aff01bf7cf7a98fa5b
/NC1/animoji/VideoManager.swift
e58c5022531d0252890ff2ea3f7b93f29f53fa8c
[]
no_license
pastre/pocket-pastre
f4a6f5eee9eb3be7a6b7d629f8ca09791056b609
be867e1b233622aae2db99722de884220e2339b1
refs/heads/master
2020-12-31T10:47:14.458646
2020-02-04T19:22:03
2020-02-04T19:22:03
239,007,686
0
0
null
null
null
null
UTF-8
Swift
false
false
2,204
swift
// // VideoManager.swift // NC1 // // Created by Bruno Pastre on 30/01/20. // Copyright © 2020 Bruno Pastre. All rights reserved. // import AVFoundation class VideoManager { var players: [Expression : AVPlayer]! = [Expression: AVPlayer]() var currentPlayer: AVPlayer? init() { Expression.allCases.forEach { (c) in guard let url = Bundle.main.url(forResource: c.rawValue, withExtension:"mov") else { return } let player = AVPlayer(url: url) players[c] = player } } var isSetup: Bool! = false func setup() { if self.isSetup { return } NotificationCenter.default.addObserver( self, selector: #selector(fileComplete), name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: nil) DispatchQueue.main.async { self.configureAnimator() } self.playVideo() self.isSetup = true } func configureAnimator() { // Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { (_) in // if !self.canPlay { return } // // self.playVideo() // // } } @objc func fileComplete(_ notification: NSNotification) { self.currentPlayer?.pause() self.currentPlayer = nil self.isPlaying = false self.playVideo() } var isIdle: Bool = false var isPlaying: Bool = false func playVideo() { if self.isPlaying { return } self.isPlaying = true guard let animoji = isIdle ? .idle : Expression.allCases.filter ({ (e) -> Bool in return e != .idle }).randomElement() else { return } guard let url = Bundle.main.url(forResource: animoji.rawValue, withExtension:"mov") else { return } let player = AVPlayer(url: url) player.isMuted = true self.currentPlayer = player AnimojiViewManager.instance.getAnimojiView().play(self.currentPlayer!) self.isIdle = !self.isIdle } }
[ -1 ]
407ee991c6c24386a3a2fab835bcd7c34fff9511
aa73ce9bc11481e839b39ada680bb4e06ccb6d9f
/Tests/MySQLTests/MySQLConnectionTests.swift
24f8ad1669b27cc8be07f30deff97d9e501a62ba
[ "MIT" ]
permissive
nicholasjackson/swift-mysql
4dbfd182e538c692a988e93c71bd891b3fb7750d
c5c378d33f67788d11bba8e226c00732a45bb949
refs/heads/master
2021-01-22T23:27:13.277910
2017-10-04T15:24:58
2017-10-04T15:24:58
85,643,651
6
5
MIT
2019-07-27T00:36:28
2017-03-21T01:09:04
Swift
UTF-8
Swift
false
false
5,177
swift
import Foundation import XCTest @testable import MySQL public class MySQLConnectionTests: XCTestCase { var mockConnection:MockMySQLInternalConnection? var connection: MySQLConnection? public override func setUp() { mockConnection = MockMySQLInternalConnection() connection = MySQLConnection(connection: mockConnection!) } public func testClientInfoReturnsClientInfo() { mockConnection!.clientInfo = "testinfo" let info = connection!.info() XCTAssertEqual(mockConnection!.clientInfo, info, "Correct connection info should have been returned") } public func testClientVersionReturnsClientVersion() { mockConnection!.clientVersion = 100 let version = connection!.version() XCTAssertEqual(mockConnection!.clientVersion, version, "Correct connection version should have been returned") } public func testClientExecutesQuery() throws { let _ = try connection!.execute(query: "something") XCTAssertEqual(mockConnection!.executeStatement, "something", "Query sent to connection not correct") XCTAssertTrue(mockConnection!.executeCalled, "Query should have been executed") } public func testClientExecutesQueryWithBuilder() throws { let builder = MySQLQueryBuilder() .select(statement: "SELECT * FROM") .wheres(statement: "abc=?", parameters: "bcd") let _ = try connection!.execute(builder: builder) XCTAssertEqual(mockConnection!.executeStatement, "SELECT * FROM WHERE abc='bcd';", "Query sent to connection not correct") XCTAssertTrue(mockConnection!.executeCalled, "Query should have been executed") } public func testClientQueryReturnsMySQLResultWhenResultPresent() throws { mockConnection!.executeReturnResult = CMySQLResult(bitPattern: 12) mockConnection!.executeReturnHeaders = [CMySQLField]() let result = try connection!.execute(query: "something") XCTAssertNotNil(result, "Query should have returned results") } public func testClientQuerySetsAffectedRowsWhenNoResult() throws { mockConnection!.executeReturnRows = 0 let result = try connection!.execute(query: "something") XCTAssertEqual(0, result.affectedRows, "Affected rows should be 0 when no result") } public func testClientQueryReturnsErrorWhenError() throws { mockConnection!.executeReturnError = MySQLError.UnableToExecuteQuery(message: "boom") var err: Error? do { let _ = try connection!.execute(query: "something") }catch { err = error } XCTAssertNotNil(err, "Query should have returned an error") } public func testClientNextResultSetReturnsMySQLResultWhenResultPresent() throws { mockConnection!.nextResultReturnResult = CMySQLResult(bitPattern: 12) mockConnection!.nextResultReturnHeaders = [CMySQLField]() let result = try connection!.nextResultSet() XCTAssertNotNil(result, "Query should have returned results") } public func testClientNextResultSetReturnsNilWhenNoResultPresent() { mockConnection!.nextResultSetErrorReturn = MySQLError.NoMoreResults var err: Error? var result: MySQLResultProtocol? do { result = try connection!.nextResultSet() } catch { err = error } XCTAssertNil(result, "Query should not have returned results") XCTAssertNotNil(err, "Query should have returned error") } public func testStartCallsStartTransaction() throws { connection!.startTransaction() XCTAssertTrue(mockConnection!.startTransactionCalled) } public func testCommitCallsCommitTransaction() throws { try connection!.commitTransaction() XCTAssertTrue(mockConnection!.commitTransactionCalled) } public func testRollbackCallsRollbackTransaction() throws { try connection!.rollbackTransaction() XCTAssertTrue(mockConnection!.rollbackTransactionCalled) } } extension MySQLConnectionTests { static var allTests: [(String, (MySQLConnectionTests) -> () throws -> Void)] { return [ ("testClientInfoReturnsClientInfo", testClientInfoReturnsClientInfo), ("testClientVersionReturnsClientVersion", testClientVersionReturnsClientVersion), ("testClientExecutesQuery", testClientExecutesQuery), ("testClientExecutesQueryWithBuilder", testClientExecutesQueryWithBuilder), ("testClientQueryReturnsMySQLResultWhenResultPresent", testClientQueryReturnsMySQLResultWhenResultPresent), ("testClientQuerySetsAffectedRowsWhenNoResult", testClientQuerySetsAffectedRowsWhenNoResult), ("testClientQueryReturnsErrorWhenError", testClientQueryReturnsErrorWhenError), ("testClientNextResultSetReturnsMySQLResultWhenResultPresent", testClientNextResultSetReturnsMySQLResultWhenResultPresent), ("testClientNextResultSetReturnsNilWhenNoResultPresent", testClientNextResultSetReturnsNilWhenNoResultPresent), ("testStartCallsStartTransaction", testStartCallsStartTransaction), ("testCommitCallsCommitTransaction", testCommitCallsCommitTransaction), ("testRollbackCallsRollbackTransaction", testRollbackCallsRollbackTransaction) ] } }
[ -1 ]
b4f8c69c3ecc1668d600c207aceb250e9c77ffa4
cd3ac3a75c7ad35ee42c74889254d03c72c441b2
/TreeHollow/TreeHollow/Keys.swift
d1dbc28583756c0524243dbfd2d638d0b74c7835
[]
no_license
al996/Tree-Hollow
13294b62a0ff63e0b34906f83864ad1c419e2aaa
8009ddef6d36435960d797f270f18af88bb78032
refs/heads/master
2022-12-12T09:18:35.538658
2019-05-06T03:46:10
2019-05-06T03:46:10
182,320,133
0
1
null
2022-12-08T05:02:06
2019-04-19T20:12:12
Swift
UTF-8
Swift
false
false
600
swift
// // Keys.swift // TreeHollow // // Created by Rachel Deng on 5/4/19. // Copyright © 2019 Rachel Deng. All rights reserved. // import Foundation enum Keys: String { case googleClientIdKey = "GOOGLE_CLIENT_ID" /// The string value of the key var value: String { return Keys.keyDict[rawValue] as? String ?? "" } private static let keyDict: NSDictionary = { guard let path = Bundle.main.path(forResource: "Keys", ofType: "plist"), let dict = NSDictionary(contentsOfFile: path) else { return [:] } return dict }() }
[ -1 ]
847863b393830c20a8ee519349a779763e64219b
3dde46470b155216485f6116a7451ae37e1fe792
/Game/GameTests/GameTests.swift
f4a7d4d3b98155b7a10b2256d09ab785fbe356bc
[]
no_license
OSLL/edu-mindwave
ab869e7411b5c82b13a4c0fb31e0741045a81d06
95795a3f628ae4e8329294134ec26af852872648
refs/heads/master
2016-09-05T10:15:19.933342
2015-05-25T13:03:15
2015-05-25T13:03:15
32,333,880
3
0
null
2015-05-18T12:21:29
2015-03-16T15:19:50
Objective-C
UTF-8
Swift
false
false
894
swift
// // GameTests.swift // GameTests // // Created by Yuriy Rebryk on 06/04/15. // Copyright (c) 2015 Yuriy Rebryk. All rights reserved. // import Cocoa import XCTest class GameTests: 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, 276489, 276492, 276509, 278570, 159807, 276543, 280649, 276555, 223318, 278615, 288857, 227417, 194652, 276577, 43109, 276582, 276581, 276585, 223340, 276589, 227439, 276592, 284788, 276603, 276606, 276613, 141450, 311435, 276627, 276631, 184475, 227492, 196773, 227495, 129203, 176314, 227528, 276684, 282831, 278742, 278746, 278753, 196834, 276709, 276710, 276715, 157944, 227576, 276744, 276748, 276753, 157970, 276760, 278810, 276764, 276774, 262450, 278846, 164162, 278856, 276813, 278862, 278863, 276821, 276822, 276831, 276835, 276847, 278898, 278908, 178571, 278951, 278954, 278965, 276919, 276920, 278969, 127427, 127428, 278985, 279002, 276958, 276962, 276963, 227813, 279018, 279019, 279022, 276998, 186893, 279054, 223767, 289304, 223769, 277017, 279065, 277029, 277048, 301634, 369220, 277066, 166507, 189036, 189037, 277101, 189042, 189043, 277118, 184962, 277133, 225933, 225936, 277138, 277141, 277142, 225943, 225944, 164512, 225956, 285353, 225962, 209581, 154291, 154294, 303803, 199366, 225997, 226001, 164563, 277203, 277204, 203478, 226004, 119513, 201442, 226033, 226035, 209660, 234238, 234241, 226051, 234245, 209670, 277254, 234250, 234253, 234256, 234263, 369432, 234268, 105246, 228129, 281377, 234280, 293672, 277289, 234283, 152365, 277294, 234286, 226097, 234289, 234301, 234304, 295744, 162626, 234305, 234311, 234312, 234317, 277327, 234323, 234326, 277339, 297822, 234335, 234340, 174949, 234343, 234346, 277354, 234349, 400239, 277360, 213876, 277366, 234361, 234366, 234367, 234372, 226181, 213894, 277381, 234377, 234381, 226194, 234387, 234392, 234395, 279456, 277410, 234404, 226214, 256937, 234409, 275371, 234412, 226222, 226223, 234419, 226227, 234425, 277435, 287677, 234430, 275397, 234438, 226249, 234445, 234450, 234451, 234454, 234457, 275418, 234463, 234466, 179176, 234477, 183279, 234482, 234492, 234495, 277505, 234498, 277510, 234503, 277513, 234506, 234509, 277517, 197647, 277518, 295953, 275469, 234517, 281625, 234530, 234531, 234534, 275495, 234539, 275500, 310317, 277550, 275505, 234548, 203830, 277563, 234555, 7229, 7230, 7231, 156733, 234560, 277566, 207938, 281666, 234565, 277574, 234569, 207953, 296018, 277585, 234583, 234584, 275547, 277596, 234594, 277603, 281707, 234603, 275565, 156785, 275571, 234612, 285814, 398457, 234622, 275590, 234631, 253063, 277640, 302217, 234632, 234642, 226451, 226452, 275607, 119963, 234652, 277665, 275620, 275625, 208043, 226476, 275628, 226479, 226481, 277686, 277690, 277694, 275671, 195811, 285929, 120055, 120056, 204041, 277792, 199971, 259363, 277800, 277803, 277806, 113966, 226608, 226609, 277809, 277815, 277821, 277824, 277825, 15686, 277831, 226632, 277838, 277841, 222548, 277845, 277844, 277852, 224605, 218462, 224606, 142689, 302438, 277862, 281962, 277868, 173420, 277871, 279919, 277878, 275831, 275832, 277882, 277883, 142716, 275838, 275839, 277890, 277891, 148867, 275847, 277896, 277897, 281992, 277900, 230799, 296338, 277907, 206228, 277911, 226711, 226712, 277919, 277920, 277925, 277927, 370091, 277936, 277939, 277940, 173491, 277943, 296375, 277946, 277949, 277952, 296387, 277957, 296391, 277962, 282060, 277965, 306639, 277969, 277974, 228823, 228824, 277977, 277980, 226781, 277983, 277988, 277993, 277994, 296425, 277997, 306673, 278002, 278005, 278008, 153095, 192010, 280077, 149007, 65041, 204313, 278060, 288326, 282183, 226888, 128583, 276046, 226897, 226906, 243292, 226910, 239198, 370271, 276085, 276088, 278140, 276097, 276100, 276101, 312972, 278160, 239250, 278162, 276116, 276117, 276120, 278170, 280220, 276126, 278191, 276146, 278195, 296628, 276148, 278201, 276156, 278214, 280267, 323276, 276179, 276180, 18138, 216795, 216796, 276195, 313065, 12010, 276210, 276219, 278285, 227091, 184086, 278299, 276257, 278307, 288547, 278316, 159533, 200498, 276279, 276282, 276283, 288574, 276287, 307011, 276298, 188246, 276311, 280410, 276325, 292712, 276332, 173936, 313203, 110452, 276344, 276350, 1923, 40850, 40853, 282518, 44952, 247712, 276385, 276394, 276400, 276401, 276408, 161722, 276413, 237504, 276422, 284619, 276430, 153552, 276443, 153566, 276450, 276454, 317415, 276462, 276463, 276468, 276469, 278518, 276475, 276478 ]
5f89842650dc319163ef44d5301bc5c19938432b
457ecd71494e63e2345630ab87b62179aae41d93
/Smack/Smack/Controller/AvatarPickerVC.swift
814515d91418efa0c414b12780f2fafee197e895
[]
no_license
MoKotb/Smack
a42b1098e0b2d1bfcd2686d736d840a4cb1fa779
7296968fea7fde1a1682397fa2affdb753a715de
refs/heads/master
2022-01-29T20:12:17.018135
2019-07-27T02:59:45
2019-07-27T02:59:45
198,057,411
0
0
null
null
null
null
UTF-8
Swift
false
false
2,413
swift
import UIKit class AvatarPickerVC: UIViewController , UICollectionViewDelegate , UICollectionViewDataSource , UICollectionViewDelegateFlowLayout { @IBOutlet weak var avatarType: UISegmentedControl! @IBOutlet weak var avatarCollection: UICollectionView! var type:AvatarType = AvatarType.Dark override func viewDidLoad() { super.viewDidLoad() avatarCollection.delegate = self avatarCollection.dataSource = self } func numberOfSections(in collectionView: UICollectionView) -> Int { return 1 } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return 28 } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { if let cell = collectionView.dequeueReusableCell(withReuseIdentifier: AVATAR_CELL, for: indexPath) as? AvatarCell{ cell.ConfigureCell(index: indexPath.item, type: type) return cell } return AvatarCell() } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { if type == .Dark{ UserDataService.instance.setAvatarImage(avatarImage: "dark\(indexPath.item)") }else{ UserDataService.instance.setAvatarImage(avatarImage: "light\(indexPath.item)") } dismiss(animated: true, completion: nil) } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { var numberOfColumns : CGFloat = 3 if UIScreen.main.bounds.width > 320 { numberOfColumns = 4 } let spaceBetweenCells : CGFloat = 10 let padding : CGFloat = 40 let CellDimension = ((avatarCollection.bounds.width - padding) - (numberOfColumns - 1) * spaceBetweenCells) / numberOfColumns return CGSize(width: CellDimension, height: CellDimension) } @IBAction func ChangeAvatarType(_ sender: Any) { if avatarType.selectedSegmentIndex == 0{ type = AvatarType.Dark }else{ type = AvatarType.Light } avatarCollection.reloadData() } @IBAction func BackPressed(_ sender: Any) { dismiss(animated: true, completion: nil) } }
[ -1 ]
4578e8e25d0e16df30238fd4f77dbcaba197d923
02477f48f4a65653ccdc75bf8ee7e4f8841f6bc5
/RepairMyCar/RepairMyCar/Shared/Network/WebService.swift
3b31d6407e7cf53c2f6d7eae13675880bd29e3b1
[]
no_license
Viniciuscarvalho/Repairmycar
fb1975bb9f142d6737e8fcf39bf6084ccf01d085
651f753c80b0a26ab13e20e5e2d2ee3b84d6c355
refs/heads/master
2021-04-28T15:51:25.785450
2018-03-05T18:14:43
2018-03-05T18:14:43
122,000,331
0
0
null
null
null
null
UTF-8
Swift
false
false
529
swift
import Foundation public protocol WebService { func load<T: Codable>(resource: Resource<T>, completion: @escaping (T?, Error?) -> Void) } final class WebServiceSession: WebService { func load<T: Codable>(resource: Resource<T>, completion: @escaping (T?, Error?) -> Void) { URLSession.shared.dataTask(with: resource.url as URL) { data, _, error in guard let data = data else { completion(nil, error); return } completion(resource.parse(data), error) }.resume() } }
[ -1 ]
0107c526b8c37be2c8d804bf60cd1839021b88aa
b3c4adef9942e1066ea35272056416eda46abaf0
/TumblrTests/TumblrTests.swift
9efad817f24b2334f15062ced26fef2b323b6a36
[]
no_license
yl335/Week4-HW-Tumblr
2c55c7d881f1bd13f6f7789bceee30e843c44ab6
f122e91cf07cc84519b1a5dfac940749cfe1177a
refs/heads/master
2021-01-10T01:15:35.258388
2015-05-31T01:36:05
2015-05-31T01:36:05
36,351,456
0
0
null
null
null
null
UTF-8
Swift
false
false
891
swift
// // TumblrTests.swift // TumblrTests // // Created by Sara Lin on 5/26/15. // Copyright (c) 2015 Sara Lin. All rights reserved. // import UIKit import XCTest class TumblrTests: 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, 276489, 276492, 278541, 278544, 278550, 305179, 276509, 278558, 307231, 313375, 278561, 102437, 227370, 360491, 276533, 276534, 159807, 276543, 286788, 280649, 276555, 223316, 315476, 223318, 288857, 278618, 227417, 194652, 194653, 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, 155867, 278753, 196834, 280802, 276709, 276710, 276715, 233715, 157944, 227576, 211193, 168188, 227585, 276744, 227592, 276748, 276753, 157970, 276760, 309529, 278810, 276764, 299293, 276774, 282919, 262450, 276792, 315706, 278846, 164162, 311621, 280902, 278856, 227658, 276813, 278862, 278863, 6481, 6482, 276821, 276822, 6489, 276831, 323935, 276835, 321894, 416104, 276847, 285040, 278898, 278908, 280961, 178571, 227725, 178578, 190871, 293274, 276891, 61857, 61859, 278951, 278954, 278961, 278965, 276919, 276920, 278969, 293303, 33211, 276925, 278978, 278985, 111056, 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, 277048, 277049, 301634, 369220, 277066, 295519, 66150, 277094, 166507, 189036, 189037, 277101, 287346, 189043, 189042, 277111, 279164, 277118, 291454, 303746, 184962, 152203, 277133, 225933, 133774, 225936, 277138, 277141, 277142, 225943, 225944, 230040, 164512, 225956, 285353, 225962, 209581, 205487, 285361, 303793, 154291, 299699, 293556, 154294, 342706, 277175, 277176, 166580, 285371, 277182, 199366, 277190, 225997, 277198, 226001, 164563, 277203, 277204, 226004, 203477, 279252, 119513, 226007, 201442, 226019, 285415, 342762, 277227, 226033, 226035, 230134, 234234, 226043, 209660, 279294, 234238, 234241, 226051, 234245, 209670, 277254, 226058, 234250, 234253, 234256, 234263, 369432, 234268, 105246, 228129, 234277, 234280, 277289, 279336, 234283, 289576, 277294, 234286, 277295, 226097, 234289, 234294, 230199, 162621, 234301, 289598, 234304, 281408, 162626, 293693, 277316, 234305, 234311, 234312, 299849, 234317, 277325, 277327, 293711, 234323, 234326, 277339, 234331, 297822, 234335, 301918, 279392, 349026, 297826, 234340, 174949, 234343, 234346, 277354, 234349, 277360, 234355, 213876, 277366, 234360, 234361, 226170, 279417, 209785, 177019, 277370, 234367, 234366, 158593, 234372, 226181, 113542, 213894, 226184, 234377, 277381, 228234, 234381, 226189, 295824, 226194, 234387, 234386, 234392, 324507, 234395, 279456, 234400, 277410, 234404, 226214, 289703, 256937, 234409, 275371, 234412, 236461, 226222, 226223, 234419, 226227, 234425, 277435, 234427, 287677, 234430, 226241, 234436, 275397, 234438, 226249, 52172, 234444, 234445, 183248, 234450, 234451, 234454, 234457, 275418, 234463, 234466, 277479, 277480, 179176, 234472, 234473, 234477, 234482, 287731, 277492, 314355, 234492, 234495, 277505, 234498, 234500, 277509, 277510, 234503, 234506, 230410, 234509, 277517, 197647, 277518, 295953, 275469, 277523, 234517, 230423, 281625, 197657, 281626, 175132, 234530, 234531, 234534, 275495, 234539, 275500, 310317, 277550, 234542, 275505, 234548, 277563, 234555, 7229, 7230, 7231, 277566, 156733, 234560, 238651, 230463, 234565, 207938, 281666, 234569, 300111, 207953, 296018, 277585, 234577, 296019, 234583, 234584, 275547, 277596, 234594, 277603, 230499, 281700, 300135, 234603, 281707, 275565, 156785, 312434, 275571, 234612, 300151, 234616, 398457, 234622, 300158, 285828, 302213, 275590, 234631, 253063, 277640, 302217, 234632, 275591, 234642, 226451, 308372, 226452, 275607, 119963, 234652, 234656, 330913, 306338, 234659, 277665, 234663, 275625, 300201, 208043, 275628, 226476, 226479, 238769, 226481, 277686, 277690, 208058, 230588, 277694, 283840, 279747, 279760, 290000, 189652, 203989, 275671, 363744, 195811, 298212, 304356, 285929, 279792, 298228, 204022, 120055, 120056, 234742, 228600, 208124, 204041, 292107, 277792, 339234, 199971, 259363, 304421, 277800, 113962, 277803, 277806, 113966, 226608, 226609, 277809, 277814, 300343, 277815, 277821, 277824, 277825, 226624, 15686, 277831, 226632, 294218, 177484, 222541, 277838, 277841, 296273, 277844, 222548, 277845, 314709, 283991, 357719, 277852, 224605, 218462, 224606, 142689, 230756, 302438, 277862, 163175, 281962, 277868, 173420, 284014, 277871, 279919, 277878, 275831, 275832, 181625, 277882, 277883, 142716, 275838, 275839, 277890, 277891, 226694, 275847, 277896, 277897, 281992, 277900, 230799, 112017, 296338, 277907, 206228, 306579, 277911, 226711, 226712, 277919, 277920, 310692, 277925, 279974, 277927, 282024, 370091, 277936, 277939, 277940, 279989, 277943, 296375, 277946, 277949, 277952, 296387, 415171, 163269, 277957, 296391, 300487, 277962, 282060, 277965, 280013, 312782, 277969, 284116, 277974, 228823, 228824, 277977, 277980, 226781, 277983, 277988, 310757, 316902, 277993, 277994, 296425, 277997, 278002, 306677, 226805, 278005, 278008, 300542, 306693, 153095, 175625, 192010, 280077, 149007, 65041, 282136, 204313, 278056, 278060, 286254, 228917, 194110, 128583, 226888, 276040, 366154, 276045, 276046, 286288, 226897, 276050, 280147, 300630, 226906, 243292, 147036, 226910, 370271, 282213, 317032, 222832, 276085, 276088, 278140, 188031, 276097, 192131, 276100, 276101, 229001, 310923, 312972, 278160, 278162, 282259, 276116, 276117, 276120, 278170, 280220, 276126, 276129, 282273, 282276, 278191, 276146, 278195, 296628, 276148, 198324, 286388, 278201, 276156, 278214, 323276, 276173, 302797, 212688, 302802, 276179, 276180, 286423, 216795, 216796, 276195, 153319, 313065, 280300, 419569, 276210, 276219, 194303, 171776, 288512, 311042, 288516, 278285, 276238, 227091, 184086, 294678, 284442, 278299, 276253, 276257, 278307, 288547, 278316, 159533, 165677, 276279, 276282, 276283, 288574, 276287, 345919, 276294, 282438, 276298, 216918, 276311, 307031, 188246, 276318, 237408, 276325, 282474, 288619, 276332, 173936, 110452, 276344, 194429, 276350, 227199, 1923, 40850, 40853, 44952, 247712, 276385, 227238, 294823, 276394, 276400, 276401, 276408, 161722, 290746, 276413, 276421, 276422, 276430, 231375, 153552, 153554, 276444, 280541, 153566, 276450, 276454, 276459, 296941, 276462, 276463, 276468, 276469, 278518, 276475, 276478 ]
3342d36447dcd66923961b0c5b8a1aedff6fde00
95bc5dd26299ce88d5711936bc96ab44e2520a61
/AppShared/RootView/LevelSelectorDataSource.swift
fd561ea7efd3ccdb839265b898e0303572edb738
[ "MIT" ]
permissive
neoneye/SwiftSnakeEngine
0ba4f19453a000a92c967392d5d557e2b94684e4
cc42b99a6b4a5ae1b98f16f9b06dc76ce4f7da61
refs/heads/develop
2023-06-10T16:44:19.582429
2020-12-22T21:27:37
2020-12-22T21:27:37
237,633,117
16
1
MIT
2023-06-06T11:53:13
2020-02-01T15:16:03
Swift
UTF-8
Swift
false
false
1,642
swift
// MIT license. Copyright (c) 2020 Simon Strandgaard. All rights reserved. import SwiftUI import Combine #if os(iOS) import EngineIOS #elseif os(macOS) import EngineMac #else #error("Unknown OS") #endif struct LevelSelectorDataSource { let role1: SnakePlayerRole let role2: SnakePlayerRole static func createWithUserDefaults() -> LevelSelectorDataSource { let role1: SnakePlayerRole let role2: SnakePlayerRole #if os(macOS) role1 = SettingPlayer1Role().value role2 = SettingPlayer2Role().value #else role1 = SnakePlayerRole.human let playerMode: SettingPlayerModeValue = SettingPlayerMode().value switch playerMode { case .twoPlayer_humanBot: let snakeBotType: SnakeBot.Type = SnakeBotFactory.smartestBotType() role2 = SnakePlayerRole.bot(snakeBotType: snakeBotType) case .singlePlayer_human: role2 = SnakePlayerRole.none } #endif return LevelSelectorDataSource(role1: role1, role2: role2) } func createGameStates() -> [SnakeGameState] { let levelNames: [String] = SnakeLevelManager.shared.levelNames return levelNames.map { SnakeGameState.create(player1: role1, player2: role2, levelName: $0) } } } extension LevelSelectorDataSource: Equatable { public static func == (lhs: LevelSelectorDataSource, rhs: LevelSelectorDataSource) -> Bool { guard lhs.role1 == rhs.role1 else { return false } guard lhs.role2 == rhs.role2 else { return false } return true } }
[ -1 ]
c128bbc2759fc1aacacdaa5b870a06bea9debce7
eb7a5b4d56ed55b155807a520e945758c5bf236e
/ShutterstockAPIApp/Network/ReachabilityManager.swift
64aef28d35a6745145f20d7ecb32e3966029f87e
[]
no_license
creativeportfolio-ios/ShutterStockDemo
31d4ccf8a48d1cddc78a103f9478c7ec9f2461d4
858d455dec03695eea1904ea37d2e63a1da0dd41
refs/heads/master
2020-06-15T23:59:30.795282
2019-07-12T15:02:38
2019-07-12T15:02:38
195,426,716
0
0
null
null
null
null
UTF-8
Swift
false
false
1,280
swift
// // ReachabilityManager.swift // ShutterstockAPIApp // // Created by Nishant on 05/07/19. // Copyright © 2019 Nishant. All rights reserved. // import Foundation import Reachability class ReachabilityManager: NSObject { private let reachability = Reachability() static let shared = ReachabilityManager() var isConnected: Bool = true override init() { super.init() startMonitoring() } func startMonitoring() { NotificationCenter.default.addObserver(self, selector: #selector(reachabilityChanged(note:)), name: .reachabilityChanged, object: reachability) do{ try reachability?.startNotifier() }catch{ print("could not start reachability notifier") } } @objc func reachabilityChanged(note: Notification) { if let reachability = note.object as? Reachability { switch reachability.connection { case .wifi, .cellular: isConnected = true case .none: isConnected = false } } } func removeNotifire() { reachability?.stopNotifier() NotificationCenter.default.removeObserver(self, name: .reachabilityChanged, object: reachability) } }
[ -1 ]
f2609c7c962de1893663453f152cef407dd755fe
f20965032087303da01fdeb0fcff823f2ffa62e5
/FavoriteSuperhero/Controller/View Controllers/SearchCollectionViewController.swift
cfdfa35ab3b231608dbae631711a3e319dc68f25
[]
no_license
froggomad/FavoriteSuperhero
b5a9dd3f08980b8c5b887e9b05fc14cd47019f5e
b27685c90c48af064b91033e37a434f74a4d1129
refs/heads/master
2020-12-24T03:01:51.635457
2020-02-03T14:28:29
2020-02-03T14:28:29
237,358,874
0
0
null
null
null
null
UTF-8
Swift
false
false
2,187
swift
// // SearchCollectionViewController.swift // FavoriteSuperhero // // Created by Kenny on 2/2/20. // Copyright © 2020 Hazy Studios. All rights reserved. // import UIKit class SearchCollectionViewController: UIViewController { //MARK: IBOutlets @IBOutlet weak var searchBar: UISearchBar! @IBOutlet weak var collectionView: UICollectionView! //MARK: Properties let heroController = HeroController() var heroes = [Hero]() override func viewDidLoad() { super.viewDidLoad() collectionView.delegate = self collectionView.dataSource = self heroController.getHero(name: "Batman") { (_) in for rep in self.heroController.heroReps { guard let hero = Hero(representation: rep) else {return} self.heroes.append(hero) } DispatchQueue.main.async { self.collectionView.reloadData() } } // Do any additional setup after loading the view. } // MARK: - Navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { } } extension SearchCollectionViewController: UICollectionViewDelegate { } extension SearchCollectionViewController: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return heroes.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "HeroCell", for: indexPath) as? HeroSearchCollectionViewCell else {return UICollectionViewCell()} cell.hero = heroes[indexPath.item] cell.backgroundColor = .red return cell } } extension SearchCollectionViewController: UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { return CGSize(width: self.collectionView.frame.width / 3 - 20, height: 50) } }
[ -1 ]
057f5800c52fabe471c273347e2733faddf28fa3
26f63babd1e660f28d707fdaac926cadddfc6370
/azChat/Utilities/NSColor.swift
9d4ab9a4da668dd1c595184a5d89fb07451f651c
[]
no_license
azarovalex/azChat-macOS
4af3088947950413dbe24886e282e7c986de4b3f
0ea7db206fa2b1899af8afb5b3302d85415f1ea1
refs/heads/master
2021-09-04T04:28:22.235558
2018-01-15T20:39:48
2018-01-15T20:39:48
113,618,031
5
1
null
null
null
null
UTF-8
Swift
false
false
453
swift
// // NSColor.swift // azChat // // Created by Alex Azarov on 11/12/2017. // Copyright © 2017 Alex Azarov. All rights reserved. // import Cocoa public extension NSColor { public class func hexColor(rgbValue: Int, alpha: CGFloat = 1.0) -> NSColor { return NSColor(red: ((CGFloat)((rgbValue & 0xFF0000) >> 16))/255.0, green:((CGFloat)((rgbValue & 0xFF00) >> 8))/255.0, blue:((CGFloat)(rgbValue & 0xFF))/255.0, alpha:alpha) } }
[ -1 ]
62e8e6fe0a024b346254d0185307dd6cc873084e
df7534daed1973df0398f1ea3daaa43612c76fc7
/GHActionsTest/Pods/PubNubSwift/Sources/PubNub/Events/Session/SessionStream.swift
2fc42ea7cf0f3aeacffd58a25e65d852564123e6
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
estebansotoara/GHActionsTest
52416ae6f5e959b3d77d6286dd018f40204edf93
3f48884be4cdfff329b8627e1076b5400b557c5b
refs/heads/Develop
2023-03-07T05:23:32.946782
2021-02-19T00:08:19
2021-02-19T00:08:19
337,876,790
0
0
MIT
2021-02-19T00:08:20
2021-02-10T22:58:01
Swift
UTF-8
Swift
false
false
13,020
swift
// // SessionStream.swift // // PubNub Real-time Cloud-Hosted Push API and Push Notification Client Frameworks // Copyright © 2019 PubNub Inc. // https://www.pubnub.com/ // https://www.pubnub.com/terms // // 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 /// A stream of `Session` events public protocol SessionStream: EventStreamReceiver { // URLRequest Building func emitRequest(_ request: RequestReplaceable, didCreate urlRequest: URLRequest) func emitRequest(_ request: RequestReplaceable, didFailToCreateURLRequestWith error: Error) // URLSessionTask States func emitRequest(_ request: RequestReplaceable, didCreate task: URLSessionTask) func emitRequest(_ request: RequestReplaceable, didResume task: URLSessionTask) func emitRequest(_ request: RequestReplaceable, didCancel task: URLSessionTask) func emitRequest(_ request: RequestReplaceable, didComplete task: URLSessionTask) func emitRequest(_ request: RequestReplaceable, didComplete task: URLSessionTask, with error: Error) // Request States func emitRequestDidResume(_ request: RequestReplaceable) func emitRequestDidFinish(_ request: RequestReplaceable) func emitRequestDidCancel(_ request: RequestReplaceable) func emitRequestIsRetrying(_ request: RequestReplaceable) // Request Mutator func emitRequest( _ request: RequestReplaceable, didMutate initialURLRequest: URLRequest, to mutatedURLRequest: URLRequest ) func emitRequest(_ request: RequestReplaceable, didFailToMutate initialURLRequest: URLRequest, with error: Error) // URLSessionDelegate func emitURLSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) func emitURLSession(_ session: URLSession, task: URLSessionTask, didCompleteWith error: Error?) func emitURLSession(_ session: URLSession, didBecomeInvalidWith error: Error?) func emitURLSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge) } public extension SessionStream { // no-op body allows protocol methods to be `optional` without using @objc func emitRequest(_: RequestReplaceable, didCreate _: URLRequest) { /* no-op */ } func emitRequest(_: RequestReplaceable, didFailToCreateURLRequestWith _: Error) { /* no-op */ } func emitRequest(_: RequestReplaceable, didCreate _: URLSessionTask) { /* no-op */ } func emitRequest(_: RequestReplaceable, didResume _: URLSessionTask) { /* no-op */ } func emitRequest(_: RequestReplaceable, didCancel _: URLSessionTask) { /* no-op */ } func emitRequest(_: RequestReplaceable, didComplete _: URLSessionTask) { /* no-op */ } func emitRequest(_: RequestReplaceable, didComplete _: URLSessionTask, with _: Error) { /* no-op */ } func emitRequestDidResume(_: RequestReplaceable) { /* no-op */ } func emitRequestDidFinish(_: RequestReplaceable) { /* no-op */ } func emitRequestDidCancel(_: RequestReplaceable) { /* no-op */ } func emitRequestIsRetrying(_: RequestReplaceable) { /* no-op */ } func emitRequest(_: RequestReplaceable, didMutate _: URLRequest, to _: URLRequest) { /* no-op */ } func emitRequest(_: RequestReplaceable, didFailToMutate _: URLRequest, with _: Error) { /* no-op */ } // func emitDidDecode(_: Response<Data>) { /* no-op */ } // func emitFailedToDecode(_: Response<Data>, with _: Error) { /* no-op */ } // URLSessionDelegate func emitURLSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: Data) { /* no-op */ } func emitURLSession(_: URLSession, task _: URLSessionTask, didCompleteWith _: Error?) { /* no-op */ } func emitURLSession(_: URLSession, didBecomeInvalidWith _: Error?) { /* no-op */ } } public final class MultiplexSessionStream: SessionStream, Hashable { public let queue: DispatchQueue public let uuid: UUID public let streams: [SessionStream] public init(_ streams: [SessionStream], queue: DispatchQueue? = nil) { uuid = UUID() self.streams = streams self.queue = queue ?? DispatchQueue(label: "org.pubnub.complexSessionStream", qos: .default) } func performEvent(_ closure: @escaping (SessionStream) -> Void) { queue.async { [weak self] in for stream in self?.streams ?? [] { stream.queue.async { closure(stream) } } } } // Hashable public static func == (lhs: MultiplexSessionStream, rhs: MultiplexSessionStream) -> Bool { return lhs.uuid == rhs.uuid } public func emitRequest(_ request: RequestReplaceable, didCreate urlRequest: URLRequest) { performEvent { $0.emitRequest(request, didCreate: urlRequest) } } public func emitRequest(_ request: RequestReplaceable, didFailToCreateURLRequestWith error: Error) { performEvent { $0.emitRequest(request, didFailToCreateURLRequestWith: error) } } public func emitRequest(_ request: RequestReplaceable, didCreate task: URLSessionTask) { performEvent { $0.emitRequest(request, didCreate: task) } } public func emitRequest(_ request: RequestReplaceable, didResume task: URLSessionTask) { performEvent { $0.emitRequest(request, didResume: task) } } public func emitRequest(_ request: RequestReplaceable, didCancel task: URLSessionTask) { performEvent { $0.emitRequest(request, didCancel: task) } } public func emitRequest(_ request: RequestReplaceable, didComplete task: URLSessionTask) { performEvent { $0.emitRequest(request, didComplete: task) } } public func emitRequest(_ request: RequestReplaceable, didComplete task: URLSessionTask, with error: Error) { performEvent { $0.emitRequest(request, didComplete: task, with: error) } } public func emitRequestDidResume(_ request: RequestReplaceable) { performEvent { $0.emitRequestDidResume(request) } } public func emitRequestDidFinish(_ request: RequestReplaceable) { performEvent { $0.emitRequestDidFinish(request) } } public func emitRequestDidCancel(_ request: RequestReplaceable) { performEvent { $0.emitRequestDidCancel(request) } } public func emitRequestIsRetrying(_ request: RequestReplaceable) { performEvent { $0.emitRequestIsRetrying(request) } } public func emitRequest( _ request: RequestReplaceable, didMutate initialURLRequest: URLRequest, to mutatedURLRequest: URLRequest ) { performEvent { $0.emitRequest(request, didMutate: initialURLRequest, to: mutatedURLRequest) } } public func emitRequest( _ request: RequestReplaceable, didFailToMutate initialURLRequest: URLRequest, with error: Error ) { performEvent { $0.emitRequest(request, didFailToMutate: initialURLRequest, with: error) } } public func emitURLSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { performEvent { $0.emitURLSession(session, dataTask: dataTask, didReceive: data) } } public func emitURLSession(_ session: URLSession, task: URLSessionTask, didCompleteWith error: Error?) { performEvent { $0.emitURLSession(session, task: task, didCompleteWith: error) } } public func emitURLSession(_ session: URLSession, didBecomeInvalidWith error: Error?) { performEvent { $0.emitURLSession(session, didBecomeInvalidWith: error) } } public func emitURLSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge) { performEvent { $0.emitURLSession(session, didReceive: challenge) } } } final class SessionListener: SessionStream, Hashable { public let uuid: UUID public let queue: DispatchQueue public init(queue: DispatchQueue = .main) { uuid = UUID() self.queue = queue } public static func == (lhs: SessionListener, rhs: SessionListener) -> Bool { return lhs.uuid == rhs.uuid } // Closures var didCreateURLRequest: ((RequestReplaceable, URLRequest) -> Void)? var didFailToCreateURLRequestWithError: ((RequestReplaceable, Error) -> Void)? var didCreateTask: ((RequestReplaceable, URLSessionTask) -> Void)? var didResumeTask: ((RequestReplaceable, URLSessionTask) -> Void)? var didCancelTask: ((RequestReplaceable, URLSessionTask) -> Void)? var didCompleteTask: ((RequestReplaceable, URLSessionTask) -> Void)? var didCompleteTaskWithError: ((RequestReplaceable, URLSessionTask, Error) -> Void)? var didResumeRequest: ((RequestReplaceable) -> Void)? var didFinishRequest: ((RequestReplaceable) -> Void)? var didCancelRequest: ((RequestReplaceable) -> Void)? var didRetryRequest: ((RequestReplaceable) -> Void)? var didMutateRequest: ((RequestReplaceable, URLRequest, URLRequest) -> Void)? var didFailToMutateRequest: ((RequestReplaceable, URLRequest, Error) -> Void)? var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> Void)? var sessionTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)? var sessionTaskDidComplete: ((URLSession, URLSessionTask, Error?) -> Void)? var sessionDidBecomeInvalidated: ((URLSession, Error?) -> Void)? // URLRequest Building func emitRequest(_ request: RequestReplaceable, didCreate urlRequest: URLRequest) { queue.async { [weak self] in self?.didCreateURLRequest?(request, urlRequest) } } func emitRequest(_ request: RequestReplaceable, didFailToCreateURLRequestWith error: Error) { queue.async { [weak self] in self?.didFailToCreateURLRequestWithError?(request, error) } } // URLSessionTask States func emitRequest(_ request: RequestReplaceable, didCreate task: URLSessionTask) { queue.async { [weak self] in self?.didCreateTask?(request, task) } } func emitRequest(_ request: RequestReplaceable, didResume task: URLSessionTask) { queue.async { [weak self] in self?.didResumeTask?(request, task) } } func emitRequest(_ request: RequestReplaceable, didCancel task: URLSessionTask) { queue.async { [weak self] in self?.didCancelTask?(request, task) } } func emitRequest(_ request: RequestReplaceable, didComplete task: URLSessionTask) { queue.async { [weak self] in self?.didCompleteTask?(request, task) } } func emitRequest(_ request: RequestReplaceable, didComplete task: URLSessionTask, with error: Error) { queue.async { [weak self] in self?.didCompleteTaskWithError?(request, task, error) } } // Request States func emitRequestDidResume(_ request: RequestReplaceable) { queue.async { [weak self] in self?.didResumeRequest?(request) } } func emitRequestDidFinish(_ request: RequestReplaceable) { queue.async { [weak self] in self?.didFinishRequest?(request) } } func emitRequestDidCancel(_ request: RequestReplaceable) { queue.async { [weak self] in self?.didCancelRequest?(request) } } func emitRequestIsRetrying(_ request: RequestReplaceable) { queue.async { [weak self] in self?.didRetryRequest?(request) } } // Request Mutator func emitRequest( _ request: RequestReplaceable, didMutate initialURLRequest: URLRequest, to mutatedURLRequest: URLRequest ) { queue.async { [weak self] in self?.didMutateRequest?(request, initialURLRequest, mutatedURLRequest) } } func emitRequest(_ request: RequestReplaceable, didFailToMutate initialURLRequest: URLRequest, with error: Error) { queue.async { [weak self] in self?.didFailToMutateRequest?(request, initialURLRequest, error) } } // URLSessionDelegate func emitURLSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge) { queue.async { [weak self] in self?.sessionDidReceiveChallenge?(session, challenge) } } func emitURLSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { queue.async { [weak self] in self?.sessionTaskDidReceiveData?(session, dataTask, data) } } func emitURLSession(_ session: URLSession, task: URLSessionTask, didCompleteWith error: Error?) { queue.async { [weak self] in self?.sessionTaskDidComplete?(session, task, error) } } func emitURLSession(_ session: URLSession, didBecomeInvalidWith error: Error?) { queue.async { [weak self] in self?.sessionDidBecomeInvalidated?(session, error) } } }
[ -1 ]
c68b383ba78229ba8b0cc699f467760608a87239
d34b8ead305ee8eb9c0427736ae71a2d0bde7900
/src/TulsiGeneratorIntegrationTests/EndToEndIntegrationTestCase.swift
ca3fc501432297742a3b471c1dce80d9e9e9d2dd
[ "Apache-2.0" ]
permissive
endpress/tulsi
30683fb24484f4cbeed07be6d9068e304141a46c
56309eeda37312a65d2a534b0533f330e642a836
refs/heads/master
2020-12-03T09:38:48.342885
2017-06-21T17:54:23
2017-06-21T18:36:00
null
0
0
null
null
null
null
UTF-8
Swift
false
false
6,429
swift
// Copyright 2016 The Tulsi Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import XCTest @testable import TulsiGenerator // Base class for end-to-end tests that generate xcodeproj bundles and validate them against golden // versions. class EndToEndIntegrationTestCase : BazelIntegrationTestCase { let fakeBazelURL = URL(fileURLWithPath: "/fake/tulsi_test_bazel", isDirectory: false) let testTulsiVersion = "9.99.999.9999" // For the sake of simplicity in maintaining the golden data, copied Tulsi artifacts are // assumed to have been installed correctly. private let copiedTulsiArtifactRegex = try! NSRegularExpression(pattern: "^Only in .*?\\.xcodeproj/\\.tulsi.+$", options: []) final func validateDiff(_ diffLines: [String], file: StaticString = #file, line: UInt = #line) { for diff in diffLines { let range = NSMakeRange(0, (diff as NSString).length) if copiedTulsiArtifactRegex.firstMatch(in: diff, options: NSRegularExpression.MatchingOptions.anchored, range: range) != nil { continue } XCTFail(diff, file: file, line: line) } } final func diffProjectAt(_ projectURL: URL, againstGoldenProject resourceName: String, file: StaticString = #file, line: UInt = #line) -> [String] { let bundle = Bundle(for: type(of: self)) guard let goldenProjectURL = bundle.url(forResource: resourceName, withExtension: "xcodeproj", subdirectory: "GoldenProjects") else { assertionFailure("Missing required test resource file \(resourceName).xcodeproj") XCTFail("Missing required test resource file \(resourceName).xcodeproj", file: file, line: line) return [] } var diffOutput = [String]() let semaphore = DispatchSemaphore(value: 0) let task = TaskRunner.createTask("/usr/bin/diff", arguments: ["-rq", projectURL.path, goldenProjectURL.path]) { completionInfo in defer { semaphore.signal() } if let stdout = NSString(data: completionInfo.stdout, encoding: String.Encoding.utf8.rawValue) { diffOutput = stdout.components(separatedBy: "\n").filter({ !$0.isEmpty }) } else { XCTFail("No output received for diff command", file: file, line: line) } } task.currentDirectoryPath = workspaceRootURL.path task.launch() _ = semaphore.wait(timeout: DispatchTime.distantFuture) return diffOutput } final func generateProjectNamed(_ projectName: String, buildTargets: [RuleInfo], pathFilters: [String], additionalFilePaths: [String] = [], outputDir: String, options: TulsiOptionSet = TulsiOptionSet()) -> URL? { if !bazelStartupOptions.isEmpty { options[.BazelBuildStartupOptionsDebug].projectValue = bazelStartupOptions.joined(separator: " ") } let debugBuildOptions = ["--define=TULSI_TEST=dbg"] + bazelBuildOptions let releaseBuildOptions = ["--define=TULSI_TEST=rel"] + bazelBuildOptions options[.BazelBuildOptionsDebug].projectValue = debugBuildOptions.joined(separator: " ") options[.BazelBuildOptionsRelease].projectValue = releaseBuildOptions.joined(separator: " ") let config = TulsiGeneratorConfig(projectName: projectName, buildTargets: buildTargets, pathFilters: Set<String>(pathFilters), additionalFilePaths: additionalFilePaths, options: options, bazelURL: fakeBazelURL) guard let outputFolderURL = makeTestSubdirectory(outputDir) else { XCTFail("Failed to create output folder, aborting test.") return nil } let projectGenerator = TulsiXcodeProjectGenerator(workspaceRootURL: workspaceRootURL, config: config, extractorBazelURL: bazelURL, tulsiVersion: testTulsiVersion) // Bazel built-in preprocessor defines are suppressed in order to prevent any // environment-dependent variables from mismatching the golden data. projectGenerator.xcodeProjectGenerator.suppressCompilerDefines = true // Output directory generation is suppressed in order to prevent having to whitelist diffs of // empty directories. projectGenerator.xcodeProjectGenerator.suppressGeneratedArtifactFolderCreation = true // The username is forced to a known value. projectGenerator.xcodeProjectGenerator.usernameFetcher = { "_TEST_USER_" } // The workspace symlink is forced to a known value. projectGenerator.xcodeProjectGenerator.redactWorkspaceSymlink = true let errorInfo: String do { return try projectGenerator.generateXcodeProjectInFolder(outputFolderURL) } catch TulsiXcodeProjectGenerator.GeneratorError.unsupportedTargetType(let targetType) { errorInfo = "Unsupported target type: \(targetType)" } catch TulsiXcodeProjectGenerator.GeneratorError.serializationFailed(let details) { errorInfo = "General failure: \(details)" } catch _ { errorInfo = "Unexpected failure" } XCTFail(errorInfo) return nil } }
[ -1 ]
b998cc2a305e5f8414b0b7f3cc3ea001d1472c11
bc572b633b2f9818894080a23762810e81fc0875
/Chapter04/0404/BookTable/BookTable/Models/BookCell.swift
9e86fcda58f01192bcaae41dd025deec1d2dc60e
[ "MIT" ]
permissive
CoderDream/iOS_Kaifa_Shizhan
4471d41feb01bc6cd0dc55fab0a6ca4ca43ffeca
519f820d3bfa34615f40b3665669a38f1951c0ce
refs/heads/master
2020-04-10T11:33:12.861976
2020-01-06T12:22:58
2020-01-06T12:22:58
160,997,215
0
0
null
null
null
null
UTF-8
Swift
false
false
872
swift
// // BookCell.swift // BookTable // // Created by CoderDream on 2018/12/10. // Copyright © 2018 CoderDream. All rights reserved. // import UIKit class BookCell: UITableViewCell { @IBOutlet weak var nameLabel: UILabel! @IBOutlet weak var priceLabel: UILabel! @IBOutlet weak var introduceLabel: UILabel! // 从模型中取出数据,更新 view 内容 func configWithBookModel(bookModel: BookModel) { nameLabel.text = bookModel.name priceLabel.text = bookModel.price introduceLabel.text = bookModel.introduce } override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } }
[ -1 ]
0a46e3fa0a5fdb573a4668fdfafc43479e77ad22
f3807f6513a00d9e85b0d5fd0116ceaacbd27b0c
/KeyboardKit/KeyboardDatePicker.swift
c66cfe85274251fc1991a48aad3f030f609df4f0
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
TimothyRLaMora734/KeyboardKit
d59688208020832fbccabc39f2c8a444d48639ba
8e90bfd742af87994cfd2b6f3dea49a120e7ab6b
refs/heads/main
2023-09-01T06:38:09.610653
2021-10-19T07:18:52
2021-10-21T07:42:01
null
0
0
null
null
null
null
UTF-8
Swift
false
false
8,411
swift
// Douglas Hill, December 2020 import UIKit /// A date picker that supports using hardware keyboard arrow keys to change the date. /// /// The only supported style and mode combinations are: /// /// - `UIDatePickerStyle.inline` and `UIDatePicker.Mode.date` /// - `UIDatePickerStyle.inline` and `UIDatePicker.Mode.dateAndTime` /// /// Key commands will not be available with any other style and mode combinations /// such as using the `.wheels` style. /// /// In these supported configurations, users can use the following key inputs when /// the date picker is focused or is the first responder: /// /// - Arrow keys to spatially change the selected day. /// - Option + left/right arrow to change the month. /// - Option + up/down arrow to change the year. /// - Command + T to jump to today. /// /// Actions that would set the date outside the range of `minimumDate` to `maximumDate` /// will not be handled, leaving these key inputs able to be handled by objects /// further along the responder chain. /// /// All calendars with identifiers provided by Foundation are supported, including /// Gregorian, Buddhist, Chinese etc. Inputs are flipped for right-to-left layouts. /// /// In a supported configurations, `KeyboardDatePicker` will be focusable as part of the /// tab loop. Since it uses arrow key inputs, it gives itself a unique focus group /// identifier. The `focusEffect` is set to a rounded `UIFocusHaloEffect` by default. @available(iOS 14.0, *) open class KeyboardDatePicker: UIDatePicker { public override init(frame: CGRect) { super.init(frame: frame) sharedInit() } public required init?(coder: NSCoder) { super.init(coder: coder) sharedInit() } private func sharedInit() { // Create a unique focus group because if the date picker is focusable then arrow keys should change the selected date within the picker. focusGroupIdentifier = "<\(type(of: self)): \(Unmanaged.passUnretained(self).toOpaque())>" } open override var canBecomeFirstResponder: Bool { true } open override var canBecomeFocused: Bool { isInSupportedStyleAndMode ? true : super.canBecomeFocused } /// Backing store for `customFocusEffect` because stored properties can’t have availability conditions. private var customFocusEffectStorage: NSObject?? /// Backing property for if `focusEffect` is changed from its default. /// /// This is deliberately double optional: /// - `.none` means the property hasn’t been set so use the default value. /// - `.some(.none)` means the property has been explicitly set to nil so don’t show a focus effect. @available(iOS 15.0, *) private var customFocusEffect: UIFocusEffect?? { get { customFocusEffectStorage as! UIFocusEffect?? } set { customFocusEffectStorage = newValue } } /// The focus effect on `KeyboardDatePicker` defaults to a halo with rounded corners that tracks the view bounds. @available(iOS 15.0, *) open override var focusEffect: UIFocusEffect? { // It’s easiest to have this be a computed getter so it can track the bounds. // The empty initialiser does track the bounds but has no corner radius. get { customFocusEffect ?? UIFocusHaloEffect(roundedRect: bounds, cornerRadius: 8, curve: .continuous) } set { customFocusEffect = .some(newValue) } } private lazy var adjustmentCommands: [UIKeyCommand] = [ // Want priority over focus system because KeyboardDatePicker defines its own focus group so arrow keys wouldn’t do anything in the focus system anyway. UIKeyCommand(.leftArrow, action: #selector(kbd_adjustDate), wantsPriorityOverSystemBehavior: true, allowsAutomaticMirroring: false), UIKeyCommand(.rightArrow, action: #selector(kbd_adjustDate), wantsPriorityOverSystemBehavior: true, allowsAutomaticMirroring: false), UIKeyCommand(.upArrow, action: #selector(kbd_adjustDate), wantsPriorityOverSystemBehavior: true, allowsAutomaticMirroring: false), UIKeyCommand(.downArrow, action: #selector(kbd_adjustDate), wantsPriorityOverSystemBehavior: true, allowsAutomaticMirroring: false), UIKeyCommand((.alternate, .leftArrow), action: #selector(kbd_adjustDate), wantsPriorityOverSystemBehavior: true, allowsAutomaticMirroring: false), UIKeyCommand((.alternate, .rightArrow), action: #selector(kbd_adjustDate), wantsPriorityOverSystemBehavior: true, allowsAutomaticMirroring: false), UIKeyCommand((.alternate, .upArrow), action: #selector(kbd_adjustDate), wantsPriorityOverSystemBehavior: true, allowsAutomaticMirroring: false), UIKeyCommand((.alternate, .downArrow), action: #selector(kbd_adjustDate), wantsPriorityOverSystemBehavior: true, allowsAutomaticMirroring: false), UIKeyCommand((.command, "t"), action: #selector(kbd_adjustDate)), ] open override var keyCommands: [UIKeyCommand]? { var commands = super.keyCommands ?? [] if isInSupportedStyleAndMode { commands += adjustmentCommands } return commands } private var isInSupportedStyleAndMode: Bool { switch (datePickerStyle, datePickerMode) { case (.inline, .date), (.inline, .dateAndTime): return true case (.inline, .time), (.inline, .countDownTimer), (.wheels, _), (.compact, _), (.automatic, _): fallthrough @unknown default: return false } } open override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool { guard action == #selector(kbd_adjustDate), let keyCommand = sender as? UIKeyCommand else { return super.canPerformAction(action, withSender: sender) } guard isInSupportedStyleAndMode, let targetDate = targetDateForKeyCommand(keyCommand) else { return false } if let minimumDate = self.minimumDate, targetDate < minimumDate { return false } if let maximumDate = self.maximumDate, targetDate > maximumDate { return false } return true } @objc private func kbd_adjustDate(_ sender: UIKeyCommand) { if let targetDate = targetDateForKeyCommand(sender) { setDate(targetDate, animated: true) } } private func targetDateForKeyCommand(_ keyCommand: UIKeyCommand) -> Date? { precondition(keyCommand.action == #selector(kbd_adjustDate)) if keyCommand.modifierFlags == .command && keyCommand.input == "t" { return Date() } var isRtL: Bool { effectiveUserInterfaceLayoutDirection == .rightToLeft } let value: Int let component: Calendar.Component if keyCommand.modifierFlags == .alternate { switch keyCommand.input! { case .upArrow: value = -1; component = .year case .downArrow: value = +1; component = .year case .leftArrow: value = isRtL ? +1 : -1; component = .month case .rightArrow: value = isRtL ? -1 : +1; component = .month default: preconditionFailure("Unexpected input on key command for adjusting date.") } } else { switch keyCommand.input! { case .upArrow: value = -1; component = .weekOfMonth case .downArrow: value = +1; component = .weekOfMonth case .leftArrow: value = isRtL ? +1 : -1; component = .day case .rightArrow: value = isRtL ? -1 : +1; component = .day default: preconditionFailure("Unexpected input on key command for adjusting date.") } } return calendar.date(byAdding: component, value: value, to: date) } // There is a problem on Big Sur where if you press tab while focused on the date picker // the focus moves to nothing visible (?) but first responder stays on the date picker. // This leads to an incorrect extra focus ring being visible on the date picker // Overriding shouldUpdateFocusInContext to return false can break the focus system // and this is not a problem on iOS 15 on iPad, so this problem is not being addressed. }
[ -1 ]
099f175e07cff2b18d2fd0dfa94247f7100c5a52
726e014f0f52f7fbbdd128c19e800aec3c74c26a
/ARMeasuring/AppDelegate.swift
082715add2d5e0f00f893e1d730a45e07642e528
[]
no_license
giovannipds/xcode-armeasuring
e13c0e7aceac676c664ac3cf304182c46743e131
ac614249cf2936d12a34e55ae464dcf447b2ce0a
refs/heads/master
2020-03-22T02:23:23.749512
2018-07-02T07:24:01
2018-07-02T07:24:01
139,367,637
0
0
null
null
null
null
UTF-8
Swift
false
false
2,184
swift
// // AppDelegate.swift // ARMeasuring // // Created by Giovanni Pires da Silva on 01/07/2018. // Copyright © 2018 Ezoom. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 286776, 319544, 286778, 229432, 204856, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 286987, 319757, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 278983, 319945, 278986, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 287238, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 303696, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 189039, 172660, 287349, 189040, 189044, 287355, 287360, 295553, 172675, 295557, 287365, 311942, 303751, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 164509, 303773, 172705, 287394, 172707, 303780, 287390, 287398, 205479, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 287427, 312005, 312006, 172748, 287436, 172751, 287440, 295633, 172755, 303827, 279255, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 189169, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303981, 303985, 328563, 303987, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 213895, 304007, 304009, 304011, 304013, 295822, 279438, 189325, 189329, 295825, 304019, 213902, 189331, 58262, 304023, 304027, 279452, 234648, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 230334, 304063, 304065, 213954, 189378, 156612, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 295945, 230413, 295949, 197645, 320528, 140312, 295961, 238620, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 279661, 205934, 164973, 312432, 279669, 337018, 279679, 66690, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 279929, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 337306, 288154, 288160, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 279991, 288185, 337335, 222652, 312766, 173507, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 222676, 148946, 288214, 239064, 288217, 329177, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 230916, 230919, 230923, 304651, 304653, 370187, 402969, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 239202, 370279, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 198310, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 321266, 288499, 419570, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 337732, 304968, 280393, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 305028, 280454, 247688, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 239612, 313340, 288764, 239617, 313347, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 288895, 321670, 215175, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 280919, 248153, 215387, 354653, 354656, 313700, 280937, 313705, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 436684, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 305662, 305664, 240129, 305666, 305668, 223749, 330244, 281095, 223752, 150025, 338440, 240132, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 182929, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 314045, 314047, 314051, 297671, 158409, 256716, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 240519, 322440, 314249, 338823, 183184, 289687, 224151, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 420829, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 216376, 380226, 298306, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 298365, 290174, 306555, 224641, 281987, 298372, 314756, 281990, 224647, 298377, 314763, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 290305, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 290325, 282133, 241175, 290328, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282255, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 323330, 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, 307027, 315221, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 44948, 298901, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 241581, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 307374, 307376, 299185, 323763, 184503, 176311, 299191, 307385, 307386, 307388, 258235, 307390, 176316, 299200, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 299225, 233701, 307432, 282881, 282893, 323854, 291089, 282906, 291104, 233766, 307508, 315701, 332086, 307510, 307512, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 276052, 315739, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 194654, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 291269, 127434, 315856, 176592, 127440, 315860, 176597, 283095, 127447, 299481, 127449, 176605, 242143, 127455, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 283142, 127494, 127497, 233994, 135689, 127500, 233998, 127506, 234003, 127509, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 299740, 201444, 299750, 283368, 234219, 283372, 185074, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 292433, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 201603, 226182, 234375, 308105, 226185, 234379, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 234396, 291742, 226200, 234398, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 324522, 234410, 291756, 226220, 291754, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 275384, 324536, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 226245, 234437, 234439, 226239, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 308226, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 275606, 275608, 234650, 324757, 308379, 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, 226500, 283844, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 283917, 177424, 349451, 275725, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 292197, 316774, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 316811, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 144814, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 300527, 308720, 292338, 226802, 316917, 308727, 292343, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 284223, 284226, 284228, 292421, 226886, 284231, 128584, 243268, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 276053, 284247, 317015, 284249, 243290, 284251, 235097, 284253, 300638, 284255, 284258, 292452, 292454, 284263, 284265, 292458, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 325251, 276095, 276098, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 292681, 153417, 358224, 276308, 284502, 317271, 178006, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 292729, 317306, 284540, 292734, 325512, 276365, 317332, 358292, 284564, 399252, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292784, 358326, 358330, 276410, 276411, 276418, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 350186, 292843, 276460, 276464, 178161, 227314, 276466, 325624, 350200, 276472, 317435, 276476, 276479, 276482, 350210, 276485, 317446, 178181, 276490, 350218, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 178224, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 243779, 325700, 284739, 292934, 243785, 276553, 350293, 350295, 309337, 194649, 227418, 350299, 350302, 227423, 350304, 178273, 309346, 194657, 194660, 350308, 309350, 309348, 292968, 309352, 227426, 276579, 227430, 276583, 309354, 301167, 276590, 350321, 350313, 350316, 284786, 350325, 252022, 276595, 350328, 292985, 301178, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 284837, 153765, 350375, 350379, 350381, 350383, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 309491, 309494, 243960, 276735, 227583, 227587, 276739, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276811, 235853, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 129486, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 113167, 309779, 317971, 309781, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 23094, 277054, 219714, 129603, 301636, 318020, 301639, 301643, 277071, 285265, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170619, 309885, 309888, 277122, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 342707, 154292, 318132, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 228069, 277223, 342760, 285417, 56043, 56045, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 301884, 310080, 293696, 277317, 277322, 293706, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 342994, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 244731, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 293917, 293939, 318516, 277561, 277564, 310336, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 64768, 310531, 285958, 138505, 228617, 318742, 277798, 130345, 113964, 384302, 285999, 113969, 318773, 318776, 286010, 417086, 286016, 302403, 294211, 384328, 294221, 146765, 294223, 326991, 179547, 146784, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 310657, 351619, 294276, 310659, 327046, 253320, 310665, 318858, 310672, 351633, 310689, 130468, 277932, 310703, 310710, 130486, 310712, 310715, 302526, 228799, 302534, 310727, 64966, 245191, 163272, 302541, 302543, 310737, 228825, 310749, 310755, 187880, 310764, 286188, 310772, 40440, 212472, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187936, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 278057, 310831, 245288, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286313, 40554, 286312, 310892, 40557, 40560, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 278227, 286420, 286425, 319194, 278235, 301163, 278238, 229086, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 188252, 237409, 294776, 360317, 294785, 327554, 360322, 40851, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 188340, 40886, 294844, 294847, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
4f241271b0b51c1b08d8b448f64202e0ac820722
01b780bacde86a24c902062e3d9e9728cd1c8dd3
/Tests/IoGInfrastructureTests/Test Business Objects/TestFlightDetails.swift
a83f4196dba7560c4c7d8bb04a66b21b3a6677aa
[ "Apache-2.0" ]
permissive
ecrichlow/IoGInfrastructure-iOS
2a41b455a4fdc542ae29d6c80adf4aebefb7eb6f
d01947ee7ead1876f5ce1b4c25e49368ced03ae5
refs/heads/master
2023-05-12T23:53:17.299093
2023-05-01T20:01:23
2023-05-01T20:01:23
157,268,145
3
1
null
null
null
null
UTF-8
Swift
false
false
1,641
swift
/* ******************************************************************************** * TestFlightDetails.swift * * Title: IoG Infrastructure * Description: IoG Mobile App Infrastructure Framework * This file contains the sample GQL Flight Details object * Author: Eric Crichlow * Version: 3.0 * Copyright: (c) 2022 Infusions of Grandeur. All rights reserved. ******************************************************************************** * 06/27/22 * EGC * File creation date ******************************************************************************** */ import Foundation @testable import IoGInfrastructure class FlightDetails : IoGGQLDataObject { var flightID: String? = "" var seats: NSNumber? = 0 var route: Route? = Route.init() var passenger: [Passenger] = [Passenger.init()] var pilot: String? = "" // MARK: Instance Methods required public init() { super.init() var pilotParameter = GQLMutationParameterFields() pilotParameter["pilotName"] = [.Alias: "pilot"] mutations = ["mutationChangePilot": [pilotParameter]] } // MARK: Business Logic override public func setProperty(propertyName: String, value: Any?) { switch propertyName { case "flightID": flightID = value as? String case "seats": seats = value as? NSNumber case "route": route = value as? Route case "passenger": passenger = value as! [Passenger] case "pilot": pilot = value as? String default: break } } override public func clearArray(propertyName: String) { switch propertyName { case "passenger": self.passenger.removeAll() default: break } } }
[ -1 ]
693939a3adef1a1b5ffce1fcc21d10e504481337
7fd2bff30d66feaf44d996032447ebadd24e735a
/PLUTrainer/PLUTrainer/AppDelegate.swift
90853f079e6a43aed661ab5bbfe46053a41b4fed
[ "MIT" ]
permissive
MondaleFelix/PLUTrainer
3000d0d233275b139e0ffb4d344d3780dcac3b9b
24b89c90126366d6ee0248627de9e646c5a5c3c8
refs/heads/master
2020-12-05T17:46:30.078610
2020-08-02T23:09:31
2020-08-02T23:09:31
232,193,705
0
0
null
null
null
null
UTF-8
Swift
false
false
1,408
swift
// // AppDelegate.swift // PLUTrainer // // Created by Mondale on 1/6/20. // Copyright © 2020 Mondale. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 163891, 213048, 385081, 376889, 393275, 376905, 327756, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 286831, 368752, 286844, 262283, 286879, 286888, 377012, 327871, 180416, 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, 328206, 410128, 393747, 254490, 188958, 385570, 33316, 197159, 377383, 352821, 188987, 418363, 369223, 385609, 385616, 352856, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 336512, 148105, 377484, 352918, 98968, 344744, 361129, 336555, 385713, 434867, 164534, 336567, 328378, 164538, 328386, 352968, 344776, 418507, 352971, 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, 328522, 336714, 426841, 254812, 361309, 197468, 361315, 361322, 328573, 377729, 369542, 222128, 345035, 345043, 386003, 386011, 386018, 386022, 435187, 328702, 328714, 361489, 386069, 336921, 386073, 336925, 345118, 377887, 345133, 345138, 386101, 361536, 197707, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 361598, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 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, 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, 214610, 419410, 345701, 394853, 222830, 370297, 403075, 345736, 198280, 345749, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 419512, 337592, 337599, 419527, 419530, 419535, 272081, 419542, 394966, 419544, 181977, 345818, 419547, 419550, 419559, 337642, 419563, 337645, 337659, 141051, 337668, 362247, 395021, 362255, 321299, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 370509, 354130, 247637, 337750, 370519, 313180, 354142, 345967, 345970, 345974, 403320, 354172, 247691, 337808, 247700, 329623, 436126, 436132, 337833, 362413, 337844, 346057, 247759, 346063, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329832, 329855, 329867, 329885, 411805, 346272, 362660, 100524, 387249, 379066, 387260, 256191, 395466, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 346343, 338152, 387306, 387312, 346355, 436473, 321786, 379134, 411903, 411916, 379152, 395538, 387349, 338199, 387352, 182558, 338211, 395566, 248111, 362822, 436555, 190796, 321879, 354673, 321910, 248186, 420236, 379278, 354727, 338352, 330189, 338381, 338386, 338403, 338409, 248308, 199164, 330252, 199186, 330267, 354855, 10828, 199249, 346721, 174695, 248425, 191084, 338543, 191092, 346742, 330383, 354974, 150183, 174774, 248504, 174777, 223934, 355024, 273108, 355028, 264918, 183005, 256734, 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, 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, 248985, 339097, 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, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 249308, 339420, 339424, 249312, 339428, 339434, 249328, 69113, 372228, 339461, 208398, 380432, 175635, 339503, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 224897, 372353, 216707, 126596, 339588, 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, 339721, 257801, 257804, 225038, 257807, 225043, 372499, 167700, 225048, 257819, 225053, 184094, 225058, 339747, 339749, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 225079, 397112, 225082, 397115, 225087, 225092, 225096, 323402, 257868, 225103, 257871, 397139, 225108, 225112, 257883, 257886, 225119, 257890, 339814, 225127, 257896, 274280, 257901, 225137, 339826, 257908, 225141, 257912, 225148, 257916, 257920, 225155, 339844, 225165, 397200, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 405533, 430129, 266294, 217157, 421960, 356439, 430180, 421990, 266350, 356466, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 225444, 438436, 225447, 438440, 225450, 258222, 225455, 430256, 225458, 225461, 225466, 389307, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 266453, 225493, 225496, 225499, 225502, 225505, 356578, 225510, 217318, 225514, 225518, 372976, 381176, 397571, 389380, 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, 389502, 250238, 332161, 356740, 332172, 373145, 340379, 389550, 324030, 340451, 160234, 127471, 340472, 324094, 266754, 324099, 324102, 324111, 340500, 324117, 324131, 332324, 381481, 324139, 356907, 324142, 356916, 324149, 324155, 348733, 324160, 324164, 356934, 348743, 381512, 324170, 324173, 324176, 389723, 332380, 373343, 381545, 340627, 184982, 373398, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 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, 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, 5046, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 209895, 201711, 349172, 349180, 439294, 431106, 209943, 209946, 250914, 357410, 185380, 357418, 209965, 209968, 209971, 209975, 209979, 209987, 209990, 341071, 349267, 250967, 210010, 341091, 210025, 210027, 210030, 210039, 341113, 349308, 210044, 349311, 152703, 160895, 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, 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, 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, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 358339, 333774, 358371, 350189, 350193, 350202, 333818, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350240, 350244, 350248, 178218, 350251, 350256, 350259, 350271, 243781, 350285, 374864, 342111, 342133, 374902, 432271, 333997, 334011, 260289, 260298, 350410, 350416, 350422, 211160, 350425, 268507, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 325891, 350467, 350475, 268559, 350480, 432405, 350486, 350490, 325914, 325917, 350493, 350498, 350504, 358700, 350509, 391468, 358704, 358713, 358716, 383306, 334161, 383321, 383330, 383333, 391530, 383341, 334203, 268668, 194941, 391563, 366990, 416157, 342430, 268701, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 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, 334528, 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, 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, 384151, 384160, 384168, 367794, 244916, 384181, 384188, 384191, 351423, 326855, 244937, 384201, 253130, 343244, 384208, 146642, 384224, 359649, 343270, 351466, 384246, 351479, 343306, 261389, 359694, 261393, 384275, 384283, 245020, 384288, 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, 245460, 155351, 155354, 212699, 245475, 155363, 245483, 155371, 409335, 155393, 155403, 245525, 155422, 360223, 155438, 155442, 155447, 155461, 376663, 155482, 261981, 425822, 155487, 376671, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 262005, 147317, 425845, 262008, 262011, 155516, 155521, 155525, 360326, 155531, 262027, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 393169, 384977, 155611, 155619, 253923, 155621, 253926, 327654, 204784, 393203, 360438, 393206, 393212, 155646 ]
9ed85abecdc41ca820be8a2c5eba86a30b4a6e91
a56e7a0ce097b8da6ae95f750b5bf1a6bbb251c5
/swift4/OpenAPIClient/Classes/OpenAPIs/Models/AddressBookItem.swift
d91f333c77bccd83c7ecf1298ef257b08cfe30ef
[]
no_license
harshabakku/deribit_options
d08f7a61386f6a047ec0c4726d882fead8fbb7a7
4f344f2fbf0b761cc5378d852a38d33849223b53
refs/heads/master
2022-12-08T20:58:47.873520
2020-09-01T16:38:04
2020-09-01T16:38:04
292,051,793
0
1
null
null
null
null
UTF-8
Swift
false
false
1,194
swift
// // AddressBookItem.swift // // Generated by openapi-generator // https://openapi-generator.tech // import Foundation public struct AddressBookItem: Codable { public enum Currency: String, Codable { case btc = "BTC" case eth = "ETH" } public enum ModelType: String, Codable { case transfer = "transfer" case withdrawal = "withdrawal" } /** Currency, i.e &#x60;\&quot;BTC\&quot;&#x60;, &#x60;\&quot;ETH\&quot;&#x60; */ public var currency: Currency /** Address in proper format for currency */ public var address: String /** Address book type */ public var type: ModelType? /** The timestamp (seconds since the Unix epoch, with millisecond precision) */ public var creationTimestamp: Int public init(currency: Currency, address: String, type: ModelType?, creationTimestamp: Int) { self.currency = currency self.address = address self.type = type self.creationTimestamp = creationTimestamp } public enum CodingKeys: String, CodingKey { case currency case address case type case creationTimestamp = "creation_timestamp" } }
[ -1 ]
24e92916efe000c451b60e2a3fd5bd26facd0f72
24e6c808c0b565cc88ca250e4e3e5a436f993a4c
/Search Book/AppDelegate.swift
3f44089f1fbf88ca082cc390b70e54f42388ec2d
[ "MIT" ]
permissive
hoc081098/search-book-MVVM-MVI-RxSwift
7b0e60ea0a21f46079db3878f54c4991ef310cce
5ed601596a6c602cc8d6332da92738ec5d24aabe
refs/heads/master
2023-08-04T23:01:19.576208
2023-01-11T10:19:09
2023-01-11T10:19:09
196,153,530
10
3
MIT
2023-01-17T13:48:33
2019-07-10T07:21:23
Swift
UTF-8
Swift
false
false
4,620
swift
// // AppDelegate.swift // Search Book // // Created by Petrus on 7/8/19. // Copyright © 2019 Petrus Nguyễn Thái Học. All rights reserved. // import UIKit import SwinjectStoryboard import SwinjectAutoregistration extension SwinjectStoryboard { @objc class func setup() { let container = self.defaultContainer // MARK: - ViewController container.storyboardInitCompleted(HomeVC.self) { resolver, controller in controller.homeVM = resolver ~> HomeVM.self } container.storyboardInitCompleted(DetailVC.self) { resolver, controller in controller.detailVM = resolver ~> DetailVM.self } container.storyboardInitCompleted(FavoritesVC.self) { resolver, controller in controller.favoritesVM = resolver ~> FavoritesVM.self } // MARK: - Domain container .register(BookRepository.self) { resolver in BookRepositoryImpl(bookApi: resolver ~> BookApi.self) } .inObjectScope(.container) container .register(FavoritedBooksRepository.self) { resolver in FavoritedBooksRepositoryImpl(userDefaults: resolver ~> UserDefaults.self) } .inObjectScope(.container) // MARK: - Data container .autoregister(BookApi.self, initializer: BookApi.init) .inObjectScope(.container) container .register(UserDefaults.self) { _ in UserDefaults.standard } .inObjectScope(.container) // MARK: - ViewModels container .register(HomeInteractor.self) { resolver in HomeInteractorImpl( bookRepository: resolver ~> BookRepository.self, favoritedBooksRepository: resolver ~> FavoritedBooksRepository.self ) } .inObjectScope(.transient) container .autoregister(HomeVM.self, initializer: HomeVM.init(homeInteractor:)) .inObjectScope(.transient) container .register(DetailInteractor.self) { resolver in DetailInteractorImpl( bookRepository: resolver ~> BookRepository.self, favBookRepo: resolver ~> FavoritedBooksRepository.self ) } .inObjectScope(.transient) container .autoregister(DetailVM.self, initializer: DetailVM.init(detailInteractor:)) .inObjectScope(.transient) container .register(FavoritesInteractor.self) { resolver in FavoritesInteractorImpl( favBooksRepo: resolver ~> FavoritedBooksRepository.self, booksRepo: resolver ~> BookRepository.self ) } .inObjectScope(.transient) container .autoregister(FavoritesVM.self, initializer: FavoritesVM.init(detailInteractor:)) .inObjectScope(.transient) } } @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. 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:. } }
[ -1 ]
e24fa1c285279659add12ff115d41b8e9d00ee6b
9c11cbfa89ecc3bbffb3371b556b0314b5b23f6b
/SwiftApp/ViewController.swift
a78183064b9dc376febb60ba4d68dda005c65b8b
[]
no_license
andrewpage/shipio-swift
22bfe91a537cf5c0520019454a7b55315270a502
bb72edbbb4a8397c31313d62309745a5d02c446d
refs/heads/master
2016-09-06T14:49:33.061323
2014-09-11T23:34:56
2014-09-11T23:34:56
null
0
0
null
null
null
null
UTF-8
Swift
false
false
528
swift
// // ViewController.swift // SwiftApp // // Created by Andrew Page on 8/4/14. // Copyright (c) 2014 ShipIO. 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. } }
[ 215562, 294411, 282128, 293909, 277527, 282143, 286775, 279096, 300089, 277057, 278606, 284242, 280146, 300116, 276054, 212573, 277602, 309347, 276580, 309351, 309353, 311913, 356458, 277612, 284275, 276597, 276099, 279684, 276612, 253066, 225955, 277696, 282311, 294600, 313550, 302295, 278752, 282338, 277224, 282346, 234223, 312049, 282365, 300288, 282389, 369434, 276256, 315170, 277796, 304933, 282917, 315177, 283433, 319291, 276309, 295766, 308064, 313704, 313706, 313708, 277364, 207738, 306578, 289697, 283556, 288165, 277420, 370093, 285103, 277935, 277430, 277432, 278968, 281530, 298951, 288205, 301012, 280028, 279011, 281073, 296436, 237556, 281078, 236022 ]
cb26d8599729cab1a1806653d40cbe9e1cc8910a
025a26cb64edf9e77352be6bcfac80f26ef0e0a1
/ImageGuyDemo/ImageGuyDemo/AppDelegate.swift
dfe7df4dd6c163e4ba4e050cc3b9f4715d9cf5b4
[ "MIT" ]
permissive
EastblueOkay/ImageGuy
c3f665290804d3d89bde28acd7457188ffcb74c5
9cc10bcf0ebd979a1042fe51cac9d2494cef6e17
refs/heads/master
2021-01-12T17:45:47.867887
2016-10-22T13:27:07
2016-10-22T13:27:07
71,639,861
4
0
null
null
null
null
UTF-8
Swift
false
false
2,178
swift
// // AppDelegate.swift // ImageGuyDemo // // Created by 兰轩轩 on 2016/10/21. // Copyright © 2016年 兰轩轩. 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, 278556, 229405, 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, 213895, 304009, 304011, 230284, 304013, 295822, 213902, 279438, 189329, 295825, 304019, 189331, 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, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 279929, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 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, 288230, 288232, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 198310, 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, 305464, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 354653, 354656, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 281045, 281047, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 330244, 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, 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, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 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, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 298822, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 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, 307211, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 184503, 299191, 176311, 307386, 258235, 307388, 176316, 307390, 307385, 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, 283033, 242075, 291226, 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, 127447, 283095, 299481, 127449, 176605, 242143, 127455, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 127494, 283142, 135689, 233994, 127497, 127500, 291341, 233998, 127506, 234003, 127509, 234006, 127511, 152087, 283161, 234010, 135707, 242202, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 299740, 242396, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 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, 324508, 291742, 324504, 234398, 234401, 291747, 291748, 234405, 291750, 324518, 324520, 234407, 324522, 234410, 291756, 291754, 226220, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 234437, 226239, 226245, 234439, 234443, 291788, 234446, 193486, 193488, 234449, 316370, 275406, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 308226, 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, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 234648, 275608, 234650, 308379, 324757, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 177318, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 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, 275725, 177424, 283917, 349451, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 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, 292421, 243268, 284231, 226886, 128584, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 276052, 276053, 284249, 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, 284566, 399252, 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, 276448, 153568, 276452, 292839, 276455, 292843, 276460, 292845, 178161, 227314, 276466, 325624, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 350218, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 284739, 325700, 243779, 292934, 243785, 276553, 350293, 350295, 309337, 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, 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, 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, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 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, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 196133, 310831, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 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 ]
ddd824506494397e883f729af221b27e8d689fed
cdba820945ed7520e894b35843e701e2f0160f76
/WanAndroidSwift/Extensions/UIImage+Iconfont.swift
b12127bd855f22b991f9c95dbc298e6453f91a31
[]
no_license
ONECATYU/WanAndroidSwift
22ccf741aca3efd061b71272f5a2e923da3cd2aa
8ce16e5af5d65bc877248a44dad34574f1c9da8c
refs/heads/master
2021-03-25T10:51:02.729335
2020-04-08T09:20:08
2020-04-08T09:20:08
247,610,898
4
0
null
null
null
null
UTF-8
Swift
false
false
1,329
swift
// // UIImage+Iconfont.swift // WanAndroidSwift // // Created by 余汪送 on 2020/3/9. // Copyright © 2020 余汪送. All rights reserved. // import UIKit extension UIImage { class func fromIconfont( content: String, size: CGFloat, fontName: String, color: UIColor = .black, backgroundColor: UIColor = .clear ) -> UIImage { let drawSize = CGSize(width: size, height: size) UIGraphicsBeginImageContextWithOptions(drawSize, false, UIScreen.main.scale) let rect = CGRect(origin: .zero, size: drawSize) let path = UIBezierPath(rect: rect) backgroundColor.setFill() path.fill() color.setFill() let style = NSMutableParagraphStyle() style.alignment = NSTextAlignment.center let string = content as NSString string.draw(in: rect, withAttributes: [ NSAttributedString.Key.font: UIFont(name: fontName, size: size)!, NSAttributedString.Key.backgroundColor: backgroundColor, NSAttributedString.Key.foregroundColor: color, NSAttributedString.Key.paragraphStyle: style ]) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return image! } }
[ -1 ]
47ea6b4f3a57ecd0d56fc7d28ea7af85562358ae
9bb88412061a24103e9899eae1931479cdd6bf65
/Pods/MongoSwift/Sources/MongoSwift/BSON/BSONValue.swift
be5ebaf35fb8306781c21e8647c4e355a934ee1f
[ "Apache-2.0" ]
permissive
DIYWealth/diyw-xcode
b3c6b5c7c6a25eb0c99cdd9a6822666a0a468b19
dc07ba7c3ff8f5e9ad9178995e761c7a29be8cce
refs/heads/master
2020-12-08T04:10:48.747962
2020-01-13T23:24:59
2020-01-13T23:24:59
232,880,558
0
0
null
null
null
null
UTF-8
Swift
false
false
36,208
swift
import bson import Foundation /// The possible types of BSON values and their corresponding integer values. public enum BSONType: UInt32 { /// An invalid type case invalid = 0x00, /// 64-bit binary floating point double = 0x01, /// UTF-8 string string = 0x02, /// BSON document document = 0x03, /// Array array = 0x04, /// Binary data binary = 0x05, /// Undefined value - deprecated undefined = 0x06, /// A MongoDB ObjectId. /// - SeeAlso: https://docs.mongodb.com/manual/reference/method/ObjectId/ objectId = 0x07, /// A boolean boolean = 0x08, /// UTC datetime, stored as UTC milliseconds since the Unix epoch dateTime = 0x09, /// Null value null = 0x0a, /// A regular expression regularExpression = 0x0b, /// A database pointer - deprecated dbPointer = 0x0c, /// Javascript code javascript = 0x0d, /// A symbol - deprecated symbol = 0x0e, /// JavaScript code w/ scope javascriptWithScope = 0x0f, /// 32-bit integer int32 = 0x10, /// Special internal type used by MongoDB replication and sharding timestamp = 0x11, /// 64-bit integer int64 = 0x12, /// 128-bit decimal floating point decimal128 = 0x13, /// Special type which compares lower than all other possible BSON element values minKey = 0xff, /// Special type which compares higher than all other possible BSON element values maxKey = 0x7f } /// A protocol all types representing `BSONType`s must implement. public protocol BSONValue { /// The `BSONType` of this value. var bsonType: BSONType { get } /** * Given the `DocumentStorage` backing a `Document`, appends this `BSONValue` to the end. * * - Parameters: * - storage: A `DocumentStorage` to write to. * - key: A `String`, the key under which to store the value. */ func encode(to storage: DocumentStorage, forKey key: String) throws /** * Given a `DocumentIterator` known to have a next value of this type, * initializes the value. */ static func from(iterator iter: DocumentIterator) throws -> Self } /// An extension of `Array` to represent the BSON array type. extension Array: BSONValue { public var bsonType: BSONType { return .array } public static func from(iterator iter: DocumentIterator) throws -> Array { var length: UInt32 = 0 let array = UnsafeMutablePointer<UnsafePointer<UInt8>?>.allocate(capacity: 1) defer { array.deinitialize(count: 1) array.deallocate() } bson_iter_array(&iter.iter, &length, array) // since an array is a nested object with keys '0', '1', etc., // create a new Document using the array data so we can recursively parse guard let arrayData = bson_new_from_data(array.pointee, Int(length)) else { throw MongoError.bsonDecodeError(message: "Failed to create a bson_t from array data") } let arrDoc = Document(fromPointer: arrayData) guard let arr = arrDoc.values as? Array else { preconditionFailure("Failed to cast values for document \(arrDoc) to array") } return arr } public func encode(to storage: DocumentStorage, forKey key: String) throws { var arr = Document() for (i, v) in self.enumerated() { guard let val = v as? BSONValue else { throw MongoError.invalidArgument( message: "Cannot encode a non-BSONValue array element: \(String(describing: v)) " + "with type: \(type(of: v)) " + "at index: \(i)" ) } try arr.setValue(for: String(i), to: val) } guard bson_append_array(storage.pointer, key, Int32(key.count), arr.data) else { throw bsonEncodeError(value: self, forKey: key) } } } /// A struct to represent the BSON null type. public struct BSONNull: BSONValue, Codable, Equatable { public var bsonType: BSONType { return .null } public static func from(iterator iter: DocumentIterator) throws -> BSONNull { return BSONNull() } /// Initializes a new `BSONNull` instance. public init() { } public func encode(to storage: DocumentStorage, forKey key: String) throws { guard bson_append_null(storage.pointer, key, Int32(key.count)) else { throw bsonEncodeError(value: self, forKey: key) } } public static func == (lhs: BSONNull, rhs: BSONNull) -> Bool { return true } } /// A struct to represent the BSON Binary type. public struct Binary: BSONValue, Equatable, Codable { public var bsonType: BSONType { return .binary } /// The binary data. public let data: Data /// The binary subtype for this data. public let subtype: UInt8 /// Subtypes for BSON Binary values. public enum Subtype: UInt8 { /// Generic binary subtype case generic, /// A function function, /// Binary (old) binaryDeprecated, /// UUID (old) uuidDeprecated, /// UUID (RFC 4122) uuid, /// MD5 md5, /// User defined userDefined = 0x80 } /// Initializes a `Binary` instance from a `UUID`. public init(from uuid: UUID) throws { let uuidt = uuid.uuid let uuidData = Data(bytes: [ uuidt.0, uuidt.1, uuidt.2, uuidt.3, uuidt.4, uuidt.5, uuidt.6, uuidt.7, uuidt.8, uuidt.9, uuidt.10, uuidt.11, uuidt.12, uuidt.13, uuidt.14, uuidt.15 ]) try self.init(data: uuidData, subtype: Binary.Subtype.uuid) } /// Initializes a `Binary` instance from a `Data` object and a `UInt8` subtype. /// Throws an error if the provided data is incompatible with the specified subtype. public init(data: Data, subtype: UInt8) throws { if [Subtype.uuid.rawValue, Subtype.uuidDeprecated.rawValue].contains(subtype) && data.count != 16 { throw MongoError.invalidArgument(message: "Binary data with UUID subtype must be 16 bytes, but data has \(data.count) bytes") } self.subtype = subtype self.data = data } /// Initializes a `Binary` instance from a `Data` object and a `Subtype`. /// Throws an error if the provided data is incompatible with the specified subtype. public init(data: Data, subtype: Subtype) throws { try self.init(data: data, subtype: subtype.rawValue) } /// Initializes a `Binary` instance from a base64 `String` and a `UInt8` subtype. /// Throws an error if the base64 `String` is invalid or if the provided data is /// incompatible with the specified subtype. public init(base64: String, subtype: UInt8) throws { guard let dataObj = Data(base64Encoded: base64) else { throw MongoError.invalidArgument(message: "failed to create Data object from invalid base64 string \(base64)") } try self.init(data: dataObj, subtype: subtype) } /// Initializes a `Binary` instance from a base64 `String` and a `Subtype`. /// Throws an error if the base64 `String` is invalid or if the provided data is /// incompatible with the specified subtype. public init(base64: String, subtype: Subtype) throws { try self.init(base64: base64, subtype: subtype.rawValue) } public func encode(to storage: DocumentStorage, forKey key: String) throws { let subtype = bson_subtype_t(UInt32(self.subtype)) let length = self.data.count let byteArray = [UInt8](self.data) guard bson_append_binary(storage.pointer, key, Int32(key.count), subtype, byteArray, UInt32(length)) else { throw bsonEncodeError(value: self, forKey: key) } } public static func from(iterator iter: DocumentIterator) throws -> Binary { var subtype = bson_subtype_t(rawValue: 0) var length: UInt32 = 0 let dataPointer = UnsafeMutablePointer<UnsafePointer<UInt8>?>.allocate(capacity: 1) defer { dataPointer.deinitialize(count: 1) dataPointer.deallocate() } bson_iter_binary(&iter.iter, &subtype, &length, dataPointer) guard let data = dataPointer.pointee else { throw MongoError.bsonDecodeError(message: "failed to retrieve data stored for binary BSON value") } let dataObj = Data(bytes: data, count: Int(length)) return try self.init(data: dataObj, subtype: UInt8(subtype.rawValue)) } public static func == (lhs: Binary, rhs: Binary) -> Bool { return lhs.data == rhs.data && lhs.subtype == rhs.subtype } } /// An extension of `Bool` to represent the BSON Boolean type. extension Bool: BSONValue { public var bsonType: BSONType { return .boolean } public func encode(to storage: DocumentStorage, forKey key: String) throws { guard bson_append_bool(storage.pointer, key, Int32(key.count), self) else { throw bsonEncodeError(value: self, forKey: key) } } public static func from(iterator iter: DocumentIterator) throws -> Bool { return self.init(bson_iter_bool(&iter.iter)) } } /// An extension of `Date` to represent the BSON Datetime type. Supports millisecond level precision. extension Date: BSONValue { public var bsonType: BSONType { return .dateTime } /// Initializes a new `Date` representing the instance `msSinceEpoch` milliseconds /// since the Unix epoch. public init(msSinceEpoch: Int64) { self.init(timeIntervalSince1970: TimeInterval(msSinceEpoch) / 1000.0) } /// The number of milliseconds after the Unix epoch that this `Date` occurs. public var msSinceEpoch: Int64 { return Int64((self.timeIntervalSince1970 * 1000.0).rounded()) } public func encode(to storage: DocumentStorage, forKey key: String) throws { guard bson_append_date_time(storage.pointer, key, Int32(key.count), self.msSinceEpoch) else { throw bsonEncodeError(value: self, forKey: key) } } public static func from(iterator iter: DocumentIterator) throws -> Date { return self.init(msSinceEpoch: bson_iter_date_time(&iter.iter)) } } /// An internal struct to represent the deprecated DBPointer type. While DBPointers cannot /// be created, we may need to parse them into `Document`s, and this provides a place for that logic. internal struct DBPointer: BSONValue { public var bsonType: BSONType { return .dbPointer } public func encode(to storage: DocumentStorage, forKey key: String) throws { throw MongoError.bsonEncodeError(message: "`DBPointer`s are deprecated; use a DBRef document instead") } public static func from(iterator iter: DocumentIterator) throws -> DBPointer { throw MongoError.bsonDecodeError(message: "`DBPointer`s are deprecated; use `DBPointer.asDocument` to create a DBRef document instead") } /// Reads DBPointer data from `iter` and converts it to DBRef format internal static func asDocument(from iter: DocumentIterator) throws -> Document { var length: UInt32 = 0 let collectionPP = UnsafeMutablePointer<UnsafePointer<Int8>?>.allocate(capacity: 1) defer { collectionPP.deinitialize(count: 1) collectionPP.deallocate() } let oidPP = UnsafeMutablePointer<UnsafePointer<bson_oid_t>?>.allocate(capacity: 1) defer { oidPP.deinitialize(count: 1) oidPP.deallocate() } bson_iter_dbpointer(&iter.iter, &length, collectionPP, oidPP) guard let oidP = oidPP.pointee else { throw MongoError.bsonDecodeError(message: retrieveErrorMsg(type: "DBPointer ObjectId", key: iter.currentKey)) } guard let collectionP = collectionPP.pointee else { throw MongoError.bsonDecodeError(message: retrieveErrorMsg(type: "DBPointer collection name", key: iter.currentKey)) } return [ "$ref": String(cString: collectionP), "$id": ObjectId(fromPointer: oidP) ] } } /// A struct to represent the BSON Decimal128 type. public struct Decimal128: BSONValue, Equatable, Codable { /// This number, represented as a `String`. public let data: String public var bsonType: BSONType { return .decimal128 } /// Initializes a `Decimal128` value from the provided `String`. Assumes that the input string is correctly /// formatted. /// - SeeAlso: https://github.com/mongodb/specifications/blob/master/source/bson-decimal128/decimal128.rst public init(_ data: String) { self.data = data } /// Initializes a `Decimal128` value from the provided `String`. Returns `nil` if the input is not a valid /// Decimal128 string. Note that this initializer is less performant than the non-failable initializer `init(_:)`. /// - SeeAlso: https://github.com/mongodb/specifications/blob/master/source/bson-decimal128/decimal128.rst public init?(ifValid data: String) { do { _ = try Decimal128.toLibBSONType(data) self.init(data) } catch { return nil } } /// Returns the provided string as a `bson_decimal128_t`, or throws an error if initialization fails due an /// invalid string. internal static func toLibBSONType(_ str: String) throws -> bson_decimal128_t { var value = bson_decimal128_t() guard bson_decimal128_from_string(str, &value) else { throw MongoError.bsonEncodeError(message: "Invalid Decimal128 string \(str)") } return value } public static func == (lhs: Decimal128, rhs: Decimal128) -> Bool { return lhs.data == rhs.data } public func encode(to storage: DocumentStorage, forKey key: String) throws { var value = try Decimal128.toLibBSONType(self.data) guard bson_append_decimal128(storage.pointer, key, Int32(key.count), &value) else { throw bsonEncodeError(value: self, forKey: key) } } public static func from(iterator iter: DocumentIterator) throws -> Decimal128 { var value = bson_decimal128_t() guard bson_iter_decimal128(&iter.iter, &value) else { throw MongoError.bsonDecodeError(message: "Failed to retrieve Decimal128 value from iterator") } var str = Data(count: Int(BSON_DECIMAL128_STRING)) return self.init(str.withUnsafeMutableBytes { (bytes: UnsafeMutablePointer<Int8>) in bson_decimal128_to_string(&value, bytes) return String(cString: bytes) }) } } /// An extension of `Double` to represent the BSON Double type. extension Double: BSONValue { public var bsonType: BSONType { return .double } public func encode(to storage: DocumentStorage, forKey key: String) throws { guard bson_append_double(storage.pointer, key, Int32(key.count), self) else { throw bsonEncodeError(value: self, forKey: key) } } public static func from(iterator iter: DocumentIterator) throws -> Double { return self.init(bson_iter_double(&iter.iter)) } } /// An extension of `Int` to represent the BSON Int32 or Int64 type. /// The `Int` will be encoded as an Int32 if possible, or an Int64 if necessary. extension Int: BSONValue { public var bsonType: BSONType { return self.int32Value != nil ? .int32 : .int64 } internal var int32Value: Int32? { return Int32(exactly: self) } internal var int64Value: Int64? { return Int64(exactly: self) } public func encode(to storage: DocumentStorage, forKey key: String) throws { if let int32 = self.int32Value { return try int32.encode(to: storage, forKey: key) } if let int64 = self.int64Value { return try int64.encode(to: storage, forKey: key) } throw MongoError.bsonEncodeError(message: "`Int` value \(self) could not be encoded as `Int32` or `Int64`") } public static func from(iterator iter: DocumentIterator) throws -> Int { return self.init(Int(bson_iter_int32(&iter.iter))) } } /// An extension of `Int32` to represent the BSON Int32 type. extension Int32: BSONValue { public var bsonType: BSONType { return .int32 } public func encode(to storage: DocumentStorage, forKey key: String) throws { guard bson_append_int32(storage.pointer, key, Int32(key.count), self) else { throw bsonEncodeError(value: self, forKey: key) } } public static func from(iterator iter: DocumentIterator) throws -> Int32 { return self.init(bson_iter_int32(&iter.iter)) } } /// An extension of `Int64` to represent the BSON Int64 type. extension Int64: BSONValue { public var bsonType: BSONType { return .int64 } public func encode(to storage: DocumentStorage, forKey key: String) throws { guard bson_append_int64(storage.pointer, key, Int32(key.count), self) else { throw bsonEncodeError(value: self, forKey: key) } } public static func from(iterator iter: DocumentIterator) throws -> Int64 { return self.init(bson_iter_int64(&iter.iter)) } } /// A struct to represent the BSON Code and CodeWithScope types. public struct CodeWithScope: BSONValue, Equatable, Codable { /// A string containing Javascript code. public let code: String /// An optional scope `Document` containing a mapping of identifiers to values, /// representing the context in which `code` should be evaluated. public let scope: Document? public var bsonType: BSONType { return self.scope == nil ? .javascript : .javascriptWithScope } /// Initializes a `CodeWithScope` with an optional scope value. public init(code: String, scope: Document? = nil) { self.code = code self.scope = scope } public func encode(to storage: DocumentStorage, forKey key: String) throws { if let s = self.scope { guard bson_append_code_with_scope(storage.pointer, key, Int32(key.count), self.code, s.data) else { throw bsonEncodeError(value: self, forKey: key) } } else { guard bson_append_code(storage.pointer, key, Int32(key.count), self.code) else { throw bsonEncodeError(value: self, forKey: key) } } } public static func from(iterator iter: DocumentIterator) throws -> CodeWithScope { var length: UInt32 = 0 if iter.currentType.rawValue == BSONType.javascript.rawValue { let code = String(cString: bson_iter_code(&iter.iter, &length)) return self.init(code: code) } var scopeLength: UInt32 = 0 let scopePointer = UnsafeMutablePointer<UnsafePointer<UInt8>?>.allocate(capacity: 1) defer { scopePointer.deinitialize(count: 1) scopePointer.deallocate() } let code = String(cString: bson_iter_codewscope(&iter.iter, &length, &scopeLength, scopePointer)) guard let scopeData = bson_new_from_data(scopePointer.pointee, Int(scopeLength)) else { throw MongoError.bsonDecodeError(message: "Failed to create a bson_t from scope data") } let scopeDoc = Document(fromPointer: scopeData) return self.init(code: code, scope: scopeDoc) } public static func == (lhs: CodeWithScope, rhs: CodeWithScope) -> Bool { return lhs.code == rhs.code && lhs.scope == rhs.scope } } /// A struct to represent the BSON MaxKey type. public struct MaxKey: BSONValue, Equatable, Codable { private var maxKey = 1 public var bsonType: BSONType { return .maxKey } public func encode(to storage: DocumentStorage, forKey key: String) throws { guard bson_append_maxkey(storage.pointer, key, Int32(key.count)) else { throw bsonEncodeError(value: self, forKey: key) } } /// Initializes a new `MaxKey` instance. public init() {} public static func from(iterator iter: DocumentIterator) -> MaxKey { return self.init() } public static func == (lhs: MaxKey, rhs: MaxKey) -> Bool { return true } } /// A struct to represent the BSON MinKey type. public struct MinKey: BSONValue, Equatable, Codable { private var minKey = 1 public var bsonType: BSONType { return .minKey } public func encode(to storage: DocumentStorage, forKey key: String) throws { guard bson_append_minkey(storage.pointer, key, Int32(key.count)) else { throw bsonEncodeError(value: self, forKey: key) } } /// Initializes a new `MinKey` instance. public init() {} public static func from(iterator iter: DocumentIterator) -> MinKey { return self.init() } public static func == (lhs: MinKey, rhs: MinKey) -> Bool { return true } } /// A struct to represent the BSON ObjectId type. public struct ObjectId: BSONValue, Equatable, CustomStringConvertible, Codable { public var bsonType: BSONType { return .objectId } /// This `ObjectId`'s data represented as a `String`. public let oid: String /// The timestamp used to create this `ObjectId` public let timestamp: UInt32 /// Initializes a new `ObjectId`. public init() { var oid_t = bson_oid_t() bson_oid_init(&oid_t, nil) self.init(fromPointer: &oid_t) } /// Initializes an `ObjectId` from the provided `String`. Assumes that the given string is a valid ObjectId. /// - SeeAlso: https://github.com/mongodb/specifications/blob/master/source/objectid.rst public init(fromString oid: String) { self.oid = oid var oid_t = bson_oid_t() bson_oid_init_from_string(&oid_t, oid) self.timestamp = UInt32(bson_oid_get_time_t(&oid_t)) } /// Initializes an `ObjectId` from the provided `String`. Returns `nil` if the string is not a valid /// ObjectId. /// - SeeAlso: https://github.com/mongodb/specifications/blob/master/source/objectid.rst public init?(ifValid oid: String) { if !bson_oid_is_valid(oid, oid.count) { return nil } else { self.init(fromString: oid) } } /// Initializes an `ObjectId` from an `UnsafePointer<bson_oid_t>` by copying the data /// from it to a `String` internal init(fromPointer oid_t: UnsafePointer<bson_oid_t>) { var str = Data(count: 25) self.oid = str.withUnsafeMutableBytes { (bytes: UnsafeMutablePointer<Int8>) in bson_oid_to_string(oid_t, bytes) return String(cString: bytes) } self.timestamp = UInt32(bson_oid_get_time_t(oid_t)) } /// Returns the provided string as a `bson_oid_t`. internal static func toLibBSONType(_ str: String) throws -> bson_oid_t { var value = bson_oid_t() if !bson_oid_is_valid(str, str.count) { throw MongoError.invalidArgument(message: "ObjectId string is invalid") } bson_oid_init_from_string(&value, str) return value } public func encode(to storage: DocumentStorage, forKey key: String) throws { // create a new bson_oid_t with self.oid var oid = try ObjectId.toLibBSONType(self.oid) // encode the bson_oid_t to the bson_t guard bson_append_oid(storage.pointer, key, Int32(key.count), &oid) else { throw bsonEncodeError(value: self, forKey: key) } } public static func from(iterator iter: DocumentIterator) throws -> ObjectId { guard let oid = bson_iter_oid(&iter.iter) else { throw MongoError.bsonDecodeError(message: "Failed to retrieve ObjectID value") } return self.init(fromPointer: oid) } public var description: String { return self.oid } public static func == (lhs: ObjectId, rhs: ObjectId) -> Bool { return lhs.oid == rhs.oid } } /// Extension to allow a `UUID` to be initialized from a `Binary` `BSONValue`. extension UUID { /// Initializes a `UUID` instance from a `Binary` `BSONValue`. public init(from binary: Binary) throws { guard binary.subtype != Binary.Subtype.uuidDeprecated.rawValue else { throw MongoError.bsonDecodeError(message: "Binary subtype \(binary.subtype) is deprecated, " + "use \(Binary.Subtype.uuid) instead.") } guard binary.subtype == Binary.Subtype.uuid.rawValue else { throw MongoError.bsonDecodeError(message: "Expected a UUID binary type " + "(\(Binary.Subtype.uuid)), got \(binary.subtype) instead.") } let data = binary.data let uuid: uuid_t = ( data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8], data[9], data[10], data[11], data[12], data[13], data[14], data[15] ) self.init(uuid: uuid) } } // A mapping of regex option characters to their equivalent `NSRegularExpression` option. // note that there is a BSON regexp option 'l' that `NSRegularExpression` // doesn't support. The flag will be dropped if BSON containing it is parsed, // and it will be ignored if passed into `optionsFromString`. private let regexOptsMap: [Character: NSRegularExpression.Options] = [ "i": .caseInsensitive, "m": .anchorsMatchLines, "s": .dotMatchesLineSeparators, "u": .useUnicodeWordBoundaries, "x": .allowCommentsAndWhitespace ] /// An extension of `NSRegularExpression` to support converting options to and from strings. extension NSRegularExpression { /// Convert a string of options flags into an equivalent `NSRegularExpression.Options` internal static func optionsFromString(_ stringOptions: String) -> NSRegularExpression.Options { var optsObj: NSRegularExpression.Options = [] for o in stringOptions { if let value = regexOptsMap[o] { optsObj.update(with: value) } } return optsObj } /// Convert this instance's options object into an alphabetically-sorted string of characters internal var stringOptions: String { var optsString = "" for (char, o) in regexOptsMap { if options.contains(o) { optsString += String(char) } } return String(optsString.sorted()) } } /// A struct to represent a BSON regular expression. public struct RegularExpression: BSONValue, Equatable, Codable { public var bsonType: BSONType { return .regularExpression } /// The pattern for this regular expression. public let pattern: String /// A string containing options for this regular expression. /// - SeeAlso: https://docs.mongodb.com/manual/reference/operator/query/regex/#op public let options: String /// Initializes a new `RegularExpression` with the provided pattern and options. public init(pattern: String, options: String) { self.pattern = pattern self.options = String(options.sorted()) } /// Initializes a new `RegularExpression` with the pattern and options of the provided `NSRegularExpression`. public init(from regex: NSRegularExpression) { self.pattern = regex.pattern self.options = regex.stringOptions } public func encode(to storage: DocumentStorage, forKey key: String) throws { guard bson_append_regex(storage.pointer, key, Int32(key.count), self.pattern, self.options) else { throw bsonEncodeError(value: self, forKey: key) } } public static func from(iterator iter: DocumentIterator) throws -> RegularExpression { let options = UnsafeMutablePointer<UnsafePointer<Int8>?>.allocate(capacity: 1) defer { options.deinitialize(count: 1) options.deallocate() } guard let pattern = bson_iter_regex(&iter.iter, options) else { throw MongoError.bsonDecodeError(message: "Failed to retrieve regular expression pattern") } let patternString = String(cString: pattern) guard let stringOptions = options.pointee else { throw MongoError.bsonDecodeError(message: "Failed to retrieve regular expression options") } let optionsString = String(cString: stringOptions) return self.init(pattern: patternString, options: optionsString) } /// Creates an `NSRegularExpression` with the pattern and options of this `RegularExpression`. /// Note: `NSRegularExpression` does not support the `l` locale dependence option, so it will /// be omitted if set on this `RegularExpression`. public var nsRegularExpression: NSRegularExpression { let opts = NSRegularExpression.optionsFromString(self.options) do { return try NSRegularExpression(pattern: self.pattern, options: opts) } catch { preconditionFailure("Failed to initialize NSRegularExpression with " + "pattern '\(self.pattern)'' and options '\(self.options)'") } } /// Returns `true` if the two `RegularExpression`s have matching patterns and options, and `false` otherwise. public static func == (lhs: RegularExpression, rhs: RegularExpression) -> Bool { return lhs.pattern == rhs.pattern && lhs.options == rhs.options } } /// An extension of String to represent the BSON string type. extension String: BSONValue { public var bsonType: BSONType { return .string } public func encode(to storage: DocumentStorage, forKey key: String) throws { guard bson_append_utf8(storage.pointer, key, Int32(key.count), self, Int32(self.count)) else { throw bsonEncodeError(value: self, forKey: key) } } public static func from(iterator iter: DocumentIterator) throws -> String { var length: UInt32 = 0 guard let strValue = bson_iter_utf8(&iter.iter, &length) else { throw MongoError.bsonDecodeError(message: retrieveErrorMsg(type: "UTF-8", key: iter.currentKey)) } return self.init(cString: strValue) } } /// An internal struct to represent the deprecated Symbol type. While Symbols cannot be /// created, we may need to parse them into `String`s, and this provides a place for that logic. internal struct Symbol: BSONValue { public var bsonType: BSONType { return .symbol } public func encode(to storage: DocumentStorage, forKey key: String) throws { throw MongoError.bsonEncodeError(message: "Symbols are deprecated; use a string instead") } public static func from(iterator iter: DocumentIterator) throws -> Symbol { throw MongoError.bsonDecodeError(message: "`Symbol`s are deprecated; use `Symbol.asString` to parse as a string instead") } internal static func asString(from iter: DocumentIterator) throws -> String { var length: UInt32 = 0 guard let strValue = bson_iter_symbol(&iter.iter, &length) else { throw MongoError.bsonDecodeError(message: retrieveErrorMsg(type: "Symbol", key: iter.currentKey)) } return String(cString: strValue) } } /// A struct to represent the BSON Timestamp type. public struct Timestamp: BSONValue, Equatable, Codable { public var bsonType: BSONType { return .timestamp } /// A timestamp representing seconds since the Unix epoch. public let timestamp: UInt32 /// An incrementing ordinal for operations within a given second. public let increment: UInt32 /// Initializes a new `Timestamp` with the provided `timestamp` and `increment` values. public init(timestamp: UInt32, inc: UInt32) { self.timestamp = timestamp self.increment = inc } /// Initializes a new `Timestamp` with the provided `timestamp` and `increment` values. Assumes /// the values can successfully be converted to `UInt32`s without loss of precision. public init(timestamp: Int, inc: Int) { self.timestamp = UInt32(timestamp) self.increment = UInt32(inc) } public func encode(to storage: DocumentStorage, forKey key: String) throws { guard bson_append_timestamp(storage.pointer, key, Int32(key.count), self.timestamp, self.increment) else { throw bsonEncodeError(value: self, forKey: key) } } public static func from(iterator iter: DocumentIterator) throws -> Timestamp { var t: UInt32 = 0 var i: UInt32 = 0 bson_iter_timestamp(&iter.iter, &t, &i) return self.init(timestamp: t, inc: i) } public static func == (lhs: Timestamp, rhs: Timestamp) -> Bool { return lhs.timestamp == rhs.timestamp && lhs.increment == rhs.increment } } // See https://github.com/realm/SwiftLint/issues/461 // swiftlint:disable cyclomatic_complexity /** * A helper function to test equality between two `BSONValue`s. This function tests for exact BSON equality. * This means that differing types with equivalent value are not equivalent. * * e.g. * 4.0 (Double) != 4 (Int) * * NOTE: This function will always return `false` if it is used with two arrays that are not of the type `[BSONValue]`, * because only arrays composed of solely `BSONValue`s are valid BSON arrays. * * * - Parameters: * - lhs: The left-hand-side `BSONValue` to compare. * - rhs: The right-hand-side `BSONValue` to compare. * * - Returns: `true` if `lhs` is equal to `rhs`, `false` otherwise. */ public func bsonEquals(_ lhs: BSONValue, _ rhs: BSONValue) -> Bool { validateBSONTypes(lhs, rhs) switch (lhs, rhs) { case let (l as Int, r as Int): return l == r case let (l as Int32, r as Int32): return l == r case let (l as Int64, r as Int64): return l == r case let (l as Double, r as Double): return l == r case let (l as Decimal128, r as Decimal128): return l == r case let (l as Bool, r as Bool): return l == r case let (l as String, r as String): return l == r case let (l as RegularExpression, r as RegularExpression): return l == r case let (l as Timestamp, r as Timestamp): return l == r case let (l as Date, r as Date): return l == r case (_ as MinKey, _ as MinKey): return true case (_ as MaxKey, _ as MaxKey): return true case let (l as ObjectId, r as ObjectId): return l == r case let (l as CodeWithScope, r as CodeWithScope): return l == r case let (l as Binary, r as Binary): return l == r case (_ as BSONNull, _ as BSONNull): return true case let (l as Document, r as Document): return l == r case let (l as [BSONValue], r as [BSONValue]): // TODO: SWIFT-242 return l.count == r.count && zip(l, r).reduce(true, { prev, next in prev && bsonEquals(next.0, next.1) }) case (_ as [Any], _ as [Any]): return false default: return false } } /** * A helper function to test equality between two BSONValue?s. See bsonEquals for BSONValues (non-optional) for more * information. * * * - Parameters: * - lhs: The left-hand-side BSONValue? to compare. * - rhs: The right-hand-side BSONValue? to compare. * * - Returns: True if lhs is equal to rhs, false otherwise. */ public func bsonEquals(_ lhs: BSONValue?, _ rhs: BSONValue?) -> Bool { guard let left = lhs, let right = rhs else { return lhs == nil && rhs == nil } return bsonEquals(left, right) } /// A function for catching invalid BSONTypes that should not ever arise, and triggering a preconditionFailure when it /// finds such types. private func validateBSONTypes(_ lhs: BSONValue, _ rhs: BSONValue) { let invalidTypes: [BSONType] = [.symbol, .dbPointer, .invalid, .undefined] guard !invalidTypes.contains(lhs.bsonType) else { preconditionFailure("\(lhs.bsonType) should not be used") } guard !invalidTypes.contains(rhs.bsonType) else { preconditionFailure("\(rhs.bsonType) should not be used") } } private func retrieveErrorMsg(type: String, key: String) -> String { return "Failed to retrieve the \(type) value for key '\(key)'" }
[ -1 ]
9aeb825f9b7f2570179ef61b897b4c4e81c54715
8369263bc047dc70dd6b57dc3f57e96256299f58
/Swift/Practice/FeedExample/FeedExample/ViewController.swift
bb605ca8903f82ecdd9ed221f2e74c17f0c9781b
[ "MIT" ]
permissive
WiSeoungHwan/TIL
12a8d90307faaca7b592400dbfe3e1ff4788f230
702a56a7c23de94062e14c20f6c1d86ad50ff089
refs/heads/master
2020-03-28T01:22:00.102462
2019-10-21T13:53:37
2019-10-21T13:53:37
147,498,679
3
0
null
null
null
null
UTF-8
Swift
false
false
353
swift
// // ViewController.swift // FeedExample // // Created by Wi on 31/10/2018. // Copyright © 2018 Wi. All rights reserved. // import UIKit class ViewController: UIViewController { var provider: FeedProvider = FeedProvider.shared var feeds: [Feed] = [] override func viewDidLoad() { super.viewDidLoad() } }
[ -1 ]
1fdf6e5ba048ad3efc593be98aea9079325e299a
f3bf033cbe2d169d30d0c67013cfd84cd10e8b2e
/100DaysOfSwift/Project3/Project1/DetailViewController.swift
5bade84e6034e2a576c13165a66afb5e38d883d2
[]
no_license
eukurapov/HackingWithSwift
da9cd8f74446aac76d2c5e8d7134c5aaa58a4e05
096b3fcc2d394d8314df398d2e42a163b8dc2e3a
refs/heads/master
2022-12-24T13:45:07.121582
2020-10-12T10:15:42
2020-10-12T10:15:42
290,531,883
0
0
null
2020-09-11T10:26:10
2020-08-26T15:17:58
Swift
UTF-8
Swift
false
false
2,665
swift
// // DetailViewController.swift // Project1 // // Created by Evgeniy Kurapov on 06.10.2019. // Copyright © 2019 Evgeniy Kurapov. All rights reserved. // import UIKit class DetailViewController: UIViewController { @IBOutlet var imageView: UIImageView! var selectedImage: String? var imageTitle: String? override func viewDidLoad() { super.viewDidLoad() title = imageTitle navigationItem.largeTitleDisplayMode = .never navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(shareTapped)) if let imageToLoad = selectedImage { imageView.image = UIImage(named: imageToLoad) } } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) navigationController?.hidesBarsOnTap = true } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) navigationController?.hidesBarsOnTap = false } @objc func shareTapped() { guard let image = watermarkedImage?.jpegData(compressionQuality: 0.8) else { return } let vc = UIActivityViewController(activityItems: [image, imageTitle!], applicationActivities: []) // to show it attached to bar button on iPad vc.popoverPresentationController?.barButtonItem = navigationItem.rightBarButtonItem present(vc, animated: true) } private var watermarkedImage: UIImage? { guard let image = imageView.image else { return nil } let rect = CGRect(origin: CGPoint(x: 0, y: 0), size: image.size) let renderer = UIGraphicsImageRenderer(size: image.size) let img = renderer.image { context in image.draw(in: rect) let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.alignment = .right let text = "From Storm Viewer" let attributes: [NSAttributedString.Key: Any] = [ .font: UIFont.systemFont(ofSize: 48), .paragraphStyle: paragraphStyle, .foregroundColor: UIColor.black, .strokeColor: UIColor.white, .strokeWidth: -3 ] let attrString = NSAttributedString(string: text, attributes: attributes) let textSize = attrString.size() attrString.draw( with: CGRect(origin: CGPoint(x: rect.maxX - textSize.width, y: rect.maxY - textSize.height), size: textSize), options: .usesLineFragmentOrigin, context: nil) } return img } }
[ -1 ]
297b93bfa7413839417c1ec14485633e63d6c8c0
4cd7c717c1f6ef2476464586bdca6f1e9ffc9cee
/Lecture-3/Lecture-1/Controller/ViewController.swift
3e6952beb631b9c7a4b7556fff723b5496a4baa8
[]
no_license
1990jiang/Stanford-CS193p-iOS11
ded86145701482bb327dc6f4c501bc0f1860dc3b
b9f474213339ee5b211e57b67e1939d5042098b4
refs/heads/master
2020-04-11T08:47:33.846489
2017-12-11T17:16:02
2017-12-11T17:16:02
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,725
swift
// // ViewController.swift // Lecture-1 // // Created by Pala on 2017/11/17. // Copyright © 2017年 Pala. All rights reserved. // import UIKit class ViewController: UIViewController { // Lazy properties may not have observers // an odd number should be round up private lazy var game = Concentration(numberOfPairsOfCards: numberOfPairsOfCards) // read only var numberOfPairsOfCards: Int { return (cardButtons.count + 1) / 2 } private(set) var flipCount = 0 { didSet { flipCountLabel.text = "Filps: \(flipCount)" } } @IBOutlet private weak var flipCountLabel: UILabel! @IBOutlet private var cardButtons: [UIButton]! @IBAction private func touchCard(_ sender: UIButton) { flipCount += 1 if let cardNumber = cardButtons.index(of: sender) { game.chooseCard(at: cardNumber) updateViewFromModel() } else { print("chosen card was not in cardbuttons") } } func updateViewFromModel() { // 'cardButtons.indices' is same result as '0..<cardButtons.count' // The indices that are valid for subscripting the collection, in ascending order. for index in cardButtons.indices { let button = cardButtons[index] let card = game.cards[index] if card.isFaceUp { button.setTitle(emoji(for: card), for: .normal) button.backgroundColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) } else { button.setTitle("", for: .normal) button.backgroundColor = card.isMatched ? #colorLiteral(red: 1, green: 1, blue: 1, alpha: 0) : #colorLiteral(red: 0.8795758929, green: 0.4431372583, blue: 0.4745098054, alpha: 1) } } } private var emojiChoices = ["🐧", "🐹", "🐼", "🦊", "🐤"] private var emoji = [Int: String]() private func emoji(for card: Card) -> String { if emoji[card.identifier] == nil, emojiChoices.count > 0 { // use extension down below, compare with the old one // let randomIndex = Int(arc4random_uniform(UInt32(emojiChoices.count))) emoji[card.identifier] = emojiChoices.remove(at: emojiChoices.count.arc4random) } return emoji[card.identifier] ?? "?" } } // more readable extension Int { var arc4random: Int { if self > 0 { return Int(arc4random_uniform(UInt32(self))) } else if self < 0 { return -Int(arc4random_uniform(UInt32(abs(self)))) } else { return 0 } } }
[ -1 ]
f5d27dac7278ecbdb70df30148edcaaccc54bc14
0da80fe270c3081e3d2f3c09072e68671bce939f
/SplitSpending/SupportigFiles/Extentions.swift
7958e53cd418603d7f2baf12ec8fbe843d66f9f1
[]
no_license
harryhole13/SplitSpending
f3f5df5ebf14e62e5cdf34286dab156f2d8f5748
0fc5c9bea1a7b94c9233bfb5e3f202299247af93
refs/heads/main
2023-08-27T18:04:23.322900
2021-10-22T16:37:23
2021-10-22T16:37:23
null
0
0
null
null
null
null
UTF-8
Swift
false
false
6,083
swift
// // Extentions.swift // SplitSpending // // Created by Sergey Volkov on 16/08/2019. // Copyright © 2019 Sergey Volkov. All rights reserved. // import UIKit //extension String { // // private func allNumsToDouble() -> String { // // let symbolsCharSet = ".," // let fullCharSet = "0123456789" + symbolsCharSet // var i = 0 // var result = "" // let chars = Array(self) // while i < chars.count { // if fullCharSet.contains(chars[i]) { // var numString = String(chars[i]) // i += 1 // loop: while i < chars.count { // if fullCharSet.contains(chars[i]) { // numString += String(chars[i]) // i += 1 // } else { // break loop // } // } // if let num = Double(numString) { // result += "\(num)" // } else { // result += numString // } // } else { // result += String(chars[i]) // i += 1 // } // } // return result // } // // func calculate() -> Double? { // let transformedString = allNumsToDouble() // let expr = NSExpression(format: transformedString) // return expr.expressionValue(with: nil, context: nil) as? Double // } //} // //extension NSExpression { // // func toFloatingPoint() -> NSExpression { // switch expressionType { // case .constantValue: // if let value = constantValue as? NSNumber { // return NSExpression(forConstantValue: NSNumber(value: value.doubleValue)) // } // case .function: // let newArgs = arguments.map { $0.map { $0.toFloatingPoint() } } // return NSExpression(forFunction: operand, selectorName: function, arguments: newArgs) // case .conditional: // return NSExpression(forConditional: predicate, trueExpression: self.true.toFloatingPoint(), falseExpression: self.false.toFloatingPoint()) // case .unionSet: // return NSExpression(forUnionSet: left.toFloatingPoint(), with: right.toFloatingPoint()) // case .intersectSet: // return NSExpression(forIntersectSet: left.toFloatingPoint(), with: right.toFloatingPoint()) // case .minusSet: // return NSExpression(forMinusSet: left.toFloatingPoint(), with: right.toFloatingPoint()) // case .subquery: // if let subQuery = collection as? NSExpression { // return NSExpression(forSubquery: subQuery.toFloatingPoint(), usingIteratorVariable: variable, predicate: predicate) // } // case .aggregate: // if let subExpressions = collection as? [NSExpression] { // return NSExpression(forAggregate: subExpressions.map { $0.toFloatingPoint() }) // } // case .anyKey: // print("anyKey not yet implemented") // case .block: // print("block not yet implemented") // case .evaluatedObject, .variable, .keyPath: // break // Nothing to do here // @unknown default: // break // } // return self // } //} //extension UIImageView { // // func setBlur(value: Int) { // // let inputImage = CIImage(cgImage: (self.image?.cgImage)!) // let filter = CIFilter(name: "CIGaussianBlur") // filter?.setValue(inputImage, forKey: "inputImage") // filter?.setValue(value, forKey: "inputRadius") // let blurred = filter?.outputImage // // var newImageSize: CGRect = (blurred?.extent)! // newImageSize.origin.x += (newImageSize.size.width - (self.image?.size.width)!) / 2 // newImageSize.origin.y += (newImageSize.size.height - (self.image?.size.height)!) / 2 // newImageSize.size = (self.image?.size)! // // let resultImage: CIImage = filter?.value(forKey: "outputImage") as! CIImage // let context: CIContext = CIContext.init(options: nil) // let cgimg: CGImage = context.createCGImage(resultImage, from: newImageSize)! // let blurredImage: UIImage = UIImage.init(cgImage: cgimg) // // self.image = blurredImage // } // //} extension UIViewController { // func addTapGestureToHideKeyboard() { // let tapGesture = UITapGestureRecognizer(target: view, action: #selector(view.endEditing(_:))) // view.addGestureRecognizer(tapGesture) // } override open func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesBegan(touches, with: event) self.view.endEditing(true) } func setupKeyboardObservers(heightCorrection: CGFloat) { UserDefaults.standard.set(heightCorrection, forKey: "heightCorrection") UserDefaults.standard.synchronize() NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardShow), name: UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardShow), name: UIResponder.keyboardWillHideNotification, object: nil) } @objc func handleKeyboardShow(notification: Notification) { guard let userInfo = notification.userInfo as? [String: Any], let keyboardFrame = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue else {return} var heightCorrection: CGFloat = 0 heightCorrection = CGFloat(UserDefaults.standard.float(forKey: "heightCorrection")) let keyboardHeight = keyboardFrame.height - heightCorrection if notification.name == UIResponder.keyboardWillShowNotification { if self.view.frame.origin.y == 0 { self.view.frame.origin.y -= keyboardHeight } } else { if self.view.frame.origin.y != 0 { self.view.frame.origin.y = 0 } } } }
[ -1 ]
88f8a567e0a4edf53aaa62cc7d6bfdee08efc057
2aaf2fc9a3146fcc116d50c3ca672168e4c810d1
/SwiftificationTests/SequenceTypeTests.swift
808167e063ade900ed063e0b174cbc0025bf9007
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
skytan4/Swiftification
43256a3843f8b9327225c34ed13fe9ae81bf4a29
08d8babb122667a360b9073d401f56b1de1974dc
refs/heads/master
2021-01-17T18:22:36.676086
2016-07-07T15:12:36
2016-07-07T15:12:36
67,643,010
0
0
null
2016-09-07T20:55:47
2016-09-07T20:55:47
null
UTF-8
Swift
false
false
3,904
swift
// // Copyright (c) 2016 Hilton Campbell // // 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 XCTest import Swiftification struct EquatableButNotHashable: Equatable { let value: Int } func == (lhs: EquatableButNotHashable, rhs: EquatableButNotHashable) -> Bool { return lhs.value == rhs.value } class SequenceTypeTests: XCTestCase { func testTakeFirst() { let array = [1, 2, 3] let expected = 3 let actual = array.takeFirst { $0 > 2 } XCTAssertEqual(expected, actual) } func testTakeWhile1() { let array = [1, 2, 3] let expected = [1, 2] let actual = array.takeWhile { $0 < 3 } XCTAssertEqual(expected, actual) } func testTakeWhile2() { let array = [1, 2, 3] let expected = [] let actual = array.takeWhile { _ in false } XCTAssertEqual(expected, actual) } func testTakeWhile3() { let array = [1, 2, 3] let expected = array let actual = array.takeWhile { _ in true } XCTAssertEqual(expected, actual) } func testUnique1() { let array = [1, 1, 2, 2, 3, 4] XCTAssertEqual(array.unique(), [1, 2, 3, 4]) } func testUnique2() { let array = ["happy", "sad", "mad", "glad", "bad", "mad", "bad", "happy", "sad", "mad"] XCTAssertEqual(array.unique(), ["happy", "sad", "mad", "glad", "bad"]) } func testUnique3() { let array = [EquatableButNotHashable(value: 1), EquatableButNotHashable(value: 2), EquatableButNotHashable(value: 1)] XCTAssertEqual(array.unique(), [EquatableButNotHashable(value: 1), EquatableButNotHashable(value: 2)]) } func testUniqueBy() { let array = [(a: 1, b: 1), (a: 1, b: 2), (a: 2, b: 2)] let unique = array.uniqueBy { $0.a } XCTAssertTrue(array.count == 3) XCTAssertTrue(unique.count == 2) } func testUniqueByOrder1() { let array = [1, 1, 2, 2, 3, 4] XCTAssertEqual(array.uniqueBy { $0 }, [1, 2, 3, 4]) } func testUniqueByOrder2() { let array = ["happy", "sad", "mad", "glad", "bad", "mad", "bad", "happy", "sad", "mad"] XCTAssertEqual(array.uniqueBy { $0 }, ["happy", "sad", "mad", "glad", "bad"]) } func testUniqueByOrder3() { let array = [ ["man": "Bob"], ["man": "Fred"], ["woman": "Sally"], ["woman": "Bertha"], ["woman": "Jill"] ] let actual = array.uniqueBy { $0.keys.first! } let expected = [ ["man": "Bob"], ["woman": "Sally"] ] XCTAssertEqual(actual, expected) } func testAny() { let array = [1, 2, 3] XCTAssertTrue(array.any({ $0 == 1 })) XCTAssertFalse(array.any({ $0 == 4 })) } }
[ 395267, 196612, 395271, 395274, 395278, 395280, 395281, 395282, 395283, 395286, 395287, 395289, 395290, 196638, 395295, 395296, 196641, 98341, 61478, 98344, 98345, 98349, 124987, 174139, 354364, 229438, 229440, 229441, 395328, 174148, 229444, 395332, 327751, 174152, 395333, 395334, 174159, 229456, 112721, 106580, 106582, 106585, 106586, 106587, 112730, 174171, 235658, 229524, 303255, 303256, 125087, 215205, 215211, 215212, 241846, 241852, 241859, 241862, 241864, 317640, 241866, 241870, 241877, 241894, 241897, 241901, 241903, 241904, 241907, 241908, 241910, 260342, 241916, 141565, 141569, 241923, 241928, 141577, 141578, 241930, 241934, 241936, 241937, 141586, 141588, 12565, 227604, 241944, 227608, 12569, 141593, 141594, 141595, 141596, 141597, 141598, 141599, 141600, 227610, 141603, 241952, 241957, 141606, 141607, 141608, 289062, 241962, 289067, 141612, 289068, 12592, 289074, 289078, 141627, 141629, 141632, 241989, 213319, 141640, 141641, 141642, 141643, 213320, 241992, 241996, 241998, 241999, 242002, 141651, 242006, 141655, 215384, 282967, 141660, 168285, 141663, 141664, 141670, 141677, 141681, 190840, 190841, 430456, 190843, 190844, 430458, 375168, 141700, 141702, 141707, 430476, 141711, 430483, 217492, 217494, 197018, 197019, 197021, 295330, 295331, 197029, 430502, 168359, 303550, 160205, 381398, 305638, 223741, 61971, 191006, 191007, 57893, 57896, 328232, 57899, 57900, 295467, 57905, 57906, 336445, 336446, 336450, 336451, 336454, 336455, 336457, 336460, 336465, 336469, 336471, 336472, 336473, 336474, 336478, 336479, 336480, 336482, 336483, 336489, 297620, 297636, 135861, 242361, 244419, 66247, 244427, 248524, 127693, 244430, 66261, 127702, 127703, 334562, 127716, 334564, 62183, 127727, 127729, 318199, 318200, 142073, 164601, 334590, 318207, 244480, 334591, 334596, 334600, 318218, 334603, 318220, 334602, 334606, 318223, 334607, 318231, 318233, 318234, 318236, 318237, 318241, 187174, 187175, 318246, 187177, 187179, 187180, 314167, 316216, 396088, 396089, 396091, 396092, 396094, 148287, 316224, 396098, 314179, 279367, 396104, 396110, 396112, 396114, 396115, 396118, 396119, 396120, 396122, 396123, 396125, 396126, 396127, 396128, 396129, 299880, 396137, 162668, 299884, 187248, 396147, 396151, 248696, 396153, 187258, 187259, 322430, 185258, 185259, 23469, 185262, 23470, 23472, 23473, 23474, 23475, 23476, 185267, 23479, 287674, 23483, 23487, 281539, 23492, 23494, 228306, 23508, 23515, 23517, 23523, 23531, 23533, 152560, 23552, 171008, 23559, 23561, 23572, 23574, 23575, 23580, 23581, 23585, 23590, 23591, 23594, 23596, 23599, 189488, 97327, 187442, 189490, 187444, 189492, 189493, 187447, 189491, 23601, 97329, 144435, 23607, 144437, 144438, 144441, 97339, 23612, 144442, 144443, 144444, 23616, 144445, 341057, 341060, 222278, 341062, 341063, 341066, 341068, 203862, 285782, 285785, 115805, 115806, 115807, 293982, 115809, 115810, 185446, 115817, 242794, 115819, 115820, 185452, 185454, 115823, 185455, 115825, 115827, 242803, 115829, 242807, 294016, 205959, 40088, 312473, 189594, 208026, 40092, 208027, 189598, 40095, 208029, 208033, 27810, 228512, 228513, 312476, 312478, 189607, 312479, 189609, 189610, 312482, 189612, 312489, 312493, 189617, 312497, 189619, 312498, 189621, 312501, 189623, 189626, 322751, 292041, 292042, 181455, 292049, 152789, 152821, 152825, 294137, 294138, 206094, 206097, 206098, 294162, 206102, 206104, 206108, 206109, 181533, 294181, 27943, 181544, 294183, 27948, 181553, 173368, 206138, 173379, 312480, 152906, 152907, 152908, 152909, 152910, 290123, 290125, 290126, 290127, 290130, 312483, 290135, 290136, 245081, 290137, 290139, 378208, 222562, 222563, 222566, 228717, 228721, 222587, 222590, 222591, 222596, 177543, 222599, 222601, 222603, 222604, 54669, 222605, 222606, 222607, 54673, 54692, 152998, 54698, 54701, 54703, 298431, 370118, 157151, 222689, 222692, 222693, 112111, 112115, 112120, 362020, 362022, 116267, 282156, 34362, 173634, 173635, 316995, 316997, 106085, 319081, 319085, 319088, 300660, 300661, 300662, 300663, 394905, 394908, 394910, 394912, 339622, 147115, 292544, 108230, 341052, 108240, 108245, 212694, 34531, 192230, 192231, 192232, 296681, 34538, 34540, 34541, 216812, 216814, 216815, 216816, 216818, 216819, 296684, 296687, 216822, 296688, 296691, 296692, 216826, 296698, 216828, 216829, 296699, 296700, 216832, 216833, 216834, 296703, 216836, 216837, 216838, 296707, 296708, 296710, 296712, 296713, 313101, 313104, 313108, 313111, 313112, 149274, 149275, 149280, 159523, 321342, 210755, 210756, 210757, 210758, 321353, 218959, 218963, 218964, 223065, 180058, 229209, 223069, 229213, 169824, 229217, 169826, 237413, 169830, 292709, 128873, 169835, 128876, 169837, 128878, 223086, 223087, 128881, 128882, 128883, 128884, 141181, 327550, 108419, 141198, 108431, 108432, 219033, 108448, 219040, 141219, 219043, 219044, 141223, 141228, 141229, 108460, 108462, 229294, 229295, 141235, 141264, 40931, 40932, 141284, 141290, 40940, 40941, 141293, 141295, 174063, 231406, 174066, 174067, 237559, 174074 ]
594e8d360f4b657f89d48a1ff1a712d7a13c3cfd
d335d98c7af948b4d0520f626af54fa5f0f56925
/Diff.playground/Sources/Reference.swift
38c9e53fbd482382510e12c03e2145ca69af474b
[]
no_license
AndrewSB/Diff
64d6289b630ea6f986eedf2c03de1173e18fae8a
3b2037d90f2685d23c0413657142adc3478595bc
refs/heads/master
2021-01-11T01:13:16.304921
2019-04-16T18:34:14
2019-04-16T18:34:14
71,070,613
7
0
null
null
null
null
UTF-8
Swift
false
false
813
swift
import Foundation /// TODO: When this is moved out of the playground, this should be an internal type for the Diff module, NOT PUBLIC /** A reference either points to: 1. An element on the symbol table 2. An index of the other collection */ public enum Reference<T: Collection> where T.Iterator.Element: Equatable, T.IndexDistance == Int { public typealias Index = Int case table(T.Iterator.Element) case otherCollection(Index) } extension Reference: Equatable { public static func == (lhs: Reference, rhs: Reference) -> Bool { switch (lhs, rhs) { case (.table(let l), .table(let r)): return l == r case (.otherCollection(let l), .otherCollection(let r)): return l == r default: return false } } }
[ -1 ]
8bf01e13333ac0372ff5c69eb14751078ca131f4
362431a8ece946132093e9ac25a960e953bee389
/Jumper/FlowerNode.swift
90aba6d18a0ac99c11e8e81aeff1ea7b3c816364
[]
no_license
parhim/Jumper
7c6e4efe0b4791b36e3a4fb0b2740d7012cf75f6
aecc0abd38515f6a169661988ee1bce324114a04
refs/heads/master
2021-08-26T08:38:08.462899
2017-11-22T16:37:05
2017-11-22T16:37:05
111,659,129
0
0
null
null
null
null
UTF-8
Swift
false
false
678
swift
// // FlowerNode.swift // Jumper // // Created by Semen Parhimchik on 2016-08-11. // Copyright © 2016 Parhim. All rights reserved. // import SpriteKit enum FlowerType:Int{ case normalFlower = 0 case specialFlower = 1 } class FlowerNode: GenericNode { var flowerType:FlowerType! override func collisionWithPlayer(_ player: SKNode) -> Bool { if flowerType == FlowerType.normalFlower{ player.physicsBody?.velocity = CGVector(dx: player.physicsBody!.velocity.dx, dy: 400)} else{player.physicsBody?.velocity = CGVector(dx: player.physicsBody!.velocity.dx, dy: 500)} self.removeFromParent() return true } }
[ -1 ]
e609330cd8b79c78bfedcd65e90e427db41a9fb2
b5f5e1478f9aca4e5615ca9f36994f728c7d8db1
/Landmarks/Landmarks/LandmarkList.swift
f469d1c4df5d2e2c7ce070a99951205ab00d3ddb
[]
no_license
NSMobileApps/SwiftUI-Tutorials-Handling-User-Input
3dc60a806bffb6aecd7941473e1838fcd633ec1b
b7e281182205df2bcd62357973abdd0a6a4c6a34
refs/heads/master
2023-01-06T18:40:06.271942
2020-11-10T02:07:58
2020-11-10T02:07:58
311,517,494
0
0
null
null
null
null
UTF-8
Swift
false
false
1,740
swift
/* See LICENSE folder for this sample’s licensing information. Abstract: A view showing a list of landmarks. */ import SwiftUI struct LandmarkList: View { // @State property `showFavoritesOnly` を追加し、初期値を false に // @State var showFavoritesOnly = false // `showFavoritesOnly` を `@EnvironmentObject` property に置き換え @EnvironmentObject var userData: UserData var body: some View { NavigationView { List { // List の first child として Toggle を追加 // 引数に showFavoritesOnly を指定し `$` を付与することで binding する Toggle(isOn: $userData.showFavoritesOnly) { Text("Favorites only") } // ForEach group を作成 ForEach(userData.landmarks) { landmark in // Filter を追加 if !self.userData.showFavoritesOnly || landmark.isFavorite { NavigationLink(destination: LandmarkDetail(landmark: landmark)) { LandmarkRow(landmark: landmark) } } } } .navigationBarTitle(Text("Landmarks")) } } } struct LandmarkList_Previews: PreviewProvider { static var previews: some View { ForEach(["iPhone SE", "iPhone XS Max"], id: \.self) { deviceName in LandmarkList() // .previewDevice(PreviewDevice(rawValue: deviceName)) // .previewDisplayName(deviceName) // こちらも environmentObject(_:) modifier に置き換え .environmentObject(UserData()) } } }
[ -1 ]
d66f38b1503251062266ff7eaf0723b4e3c46b4d
e0573d9823ee2748b376c88be6b1e47714332987
/213-icon-badging-with-fastlane/SimpleClock/SimpleClock/ViewController.swift
c4a7810f7e31c393d7ad06e649b3bc5a676f4866
[ "MIT" ]
permissive
parthjdabhi/nsscreencast
9d1d69677b6141bcca06751483b0504c49355293
318695174a11bf23412b712fae2e1c9cea6ed18d
refs/heads/master
2021-01-20T07:42:06.901240
2017-04-24T22:27:13
2017-04-24T22:27:13
90,031,757
1
0
null
2017-05-02T12:37:30
2017-05-02T12:37:30
null
UTF-8
Swift
false
false
1,818
swift
// // ViewController.swift // SimpleClock // // Created by Ben Scheirman on 3/7/16. // Copyright © 2016 NSScreencast. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var label: UILabel! var timer: NSTimer! var dateFormatter = NSDateFormatter() var bgColor: BackgroundColor = .Lavender enum BackgroundColor { case Red case Lavender var color: UIColor { switch self { case .Red: return UIColor(red:0.84, green:0.06, blue:0.04, alpha:1) case .Lavender: return UIColor(red:0.77, green:0.51, blue:0.99, alpha:1) } } var nextColor: BackgroundColor { switch self { case .Red: return .Lavender case .Lavender: return .Red } } } override func viewDidLoad() { super.viewDidLoad() dateFormatter.dateFormat = "hh:mm:ss a" updateTime() timer = NSTimer.scheduledTimerWithTimeInterval(0.5, target: self, selector: Selector("updateTime"), userInfo: nil, repeats: true) view.backgroundColor = bgColor.color label.textColor = UIColor.whiteColor() label.userInteractionEnabled = true } func updateTime() { let date = NSDate() label.text = dateFormatter.stringFromDate(date) } @IBAction func timeTapped(sender: AnyObject) { if dateFormatter.dateFormat.hasPrefix("HH") { dateFormatter.dateFormat = "hh:mm:ss a" } else { dateFormatter.dateFormat = "HH:mm:ss" } updateTime() } @IBAction func backgroundTapped(sender: AnyObject) { bgColor = bgColor.nextColor view.backgroundColor = bgColor.color } }
[ -1 ]
1ec7f5f2f6716d91234f1c41125182c3818cd4b1
f5974d7c6d12ebcec0f096c7dea44707953622aa
/ToneGen/AppDelegate.swift
70aa4c0fde7aff869d933717906dc4ab58e20dd9
[]
no_license
rnapier/ToneGen
a090330e0b651dd3d50bace5afe6d0a8cc6a8e78
ee8e846c249ce7297ee8ac15b8538f38c00f1a87
refs/heads/master
2021-01-02T22:51:50.421424
2020-11-30T16:50:00
2020-11-30T16:50:00
30,472,822
3
1
null
null
null
null
UTF-8
Swift
false
false
2,150
swift
// // AppDelegate.swift // ToneGen // // Created by Rob Napier on 6/30/14. // Copyright (c) 2014 Rob Napier. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? // func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool { // // Override point for customization after application launch. // return true // } // // func applicationWillResignActive(application: UIApplication) { // // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. // } // // func applicationDidEnterBackground(application: UIApplication) { // // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. // } // // func applicationWillEnterForeground(application: UIApplication) { // // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. // } // // func applicationDidBecomeActive(application: UIApplication) { // // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. // } // // func applicationWillTerminate(application: UIApplication) { // // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. // } }
[ 229380, 229383, 229385, 229388, 229391, 327695, 229394, 229397, 229399, 229402, 278556, 229405, 278564, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 286797, 311375, 196692, 319573, 311383, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 131209, 303241, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 286916, 286922, 286924, 286926, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 229622, 327930, 278781, 278783, 278785, 237826, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 287054, 319822, 278865, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 278983, 319945, 278986, 278990, 278994, 311767, 279003, 279006, 188895, 279010, 287202, 279015, 172520, 319978, 279020, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 287238, 172552, 303623, 320007, 279051, 172558, 279055, 279058, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 279124, 172634, 262752, 172644, 311911, 189034, 172655, 172656, 189039, 295538, 189040, 172660, 189044, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 303773, 295583, 230045, 172702, 287394, 172705, 303780, 172707, 287398, 287390, 279208, 287400, 172714, 279212, 230061, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 279231, 287427, 312006, 107208, 172748, 287436, 172751, 287440, 295633, 172755, 303827, 279255, 279258, 303835, 213724, 189149, 303838, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 230175, 303914, 279340, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 279383, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303981, 303985, 328563, 303987, 303991, 303997, 295808, 304005, 213895, 320391, 304007, 304009, 304011, 304013, 279438, 213902, 295822, 295825, 189331, 304019, 58262, 304023, 279452, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 304063, 238528, 304065, 213954, 189378, 156612, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 295945, 295949, 197645, 230413, 320528, 140312, 295961, 238620, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 230497, 296036, 296040, 361576, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 279750, 230600, 230607, 148690, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 214294, 296213, 296215, 320792, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 312639, 296255, 296259, 378181, 230727, 238919, 320840, 222545, 230739, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 337306, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 173488, 279985, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 230865, 288210, 370130, 288212, 280021, 288214, 222676, 239064, 288217, 329177, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 402942, 321022, 206336, 296450, 230916, 230919, 304651, 370187, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 288408, 280218, 280222, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 206536, 280264, 206539, 206541, 206543, 280276, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 288576, 345921, 280388, 304968, 280393, 280402, 173907, 313176, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280458, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 313258, 321458, 296883, 124853, 10170, 296890, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 280671, 149599, 149601, 321634, 223327, 149603, 280681, 313451, 223341, 280687, 313458, 280691, 215154, 313464, 329850, 321659, 288895, 321670, 215175, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 280919, 354653, 313700, 280937, 313705, 190832, 280946, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 240132, 223749, 281095, 338440, 150025, 223752, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 289317, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 338532, 281190, 199273, 281196, 158317, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 314047, 314051, 199364, 297671, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 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, 207737, 183172, 158596, 240519, 322440, 338823, 314249, 183184, 289687, 240535, 297883, 289694, 289700, 289712, 281529, 289724, 52163, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 207949, 322642, 281691, 314461, 281702, 281704, 314474, 281711, 289912, 248995, 306341, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 363742, 363745, 298216, 330988, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 216376, 298306, 380226, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 306549, 298358, 314743, 306552, 290171, 314747, 298365, 290174, 306555, 224641, 281987, 314756, 298372, 281990, 224647, 298377, 314763, 314768, 224657, 306581, 314773, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 282101, 241142, 191992, 290298, 151036, 290302, 290305, 192008, 323084, 282127, 290321, 282130, 282133, 290325, 241175, 290328, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282201, 306778, 159324, 159330, 314979, 298598, 224875, 241260, 257658, 315016, 282249, 290445, 282255, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 315184, 315190, 241464, 159545, 282425, 298811, 307009, 413506, 307012, 298822, 315211, 307027, 315221, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 241581, 241583, 323504, 241586, 282547, 241588, 241590, 241592, 241598, 290751, 241600, 241605, 241610, 298975, 241632, 298984, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 282645, 241693, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 307287, 315482, 217179, 315483, 192605, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 299126, 233591, 315524, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 315557, 307370, 307372, 307374, 307376, 299185, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 233701, 307432, 282881, 282893, 323854, 291089, 282906, 291104, 233766, 307508, 315701, 307510, 332086, 307512, 307515, 282942, 307518, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 315739, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127431, 127434, 176592, 315856, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 291299, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 291323, 233979, 291330, 283142, 135689, 233994, 127497, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 135717, 291378, 234038, 152118, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 135839, 299680, 225954, 135844, 242343, 209576, 242345, 373421, 299706, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 201444, 283368, 234219, 283372, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 275275, 242511, 234319, 234321, 234324, 185173, 201557, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 234356, 234358, 234362, 234364, 234368, 234370, 201603, 234373, 226182, 234375, 226185, 308105, 234379, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 226200, 234396, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 291754, 324527, 291760, 234417, 201650, 324531, 234422, 226230, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 234434, 324548, 226245, 234437, 234439, 234443, 291788, 234446, 275406, 234449, 316370, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 300148, 234614, 398455, 144506, 234618, 275579, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 324757, 308379, 234653, 324766, 119967, 324768, 234648, 283805, 300189, 242852, 234661, 283813, 234657, 234664, 300197, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 226500, 234692, 300229, 308420, 283844, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 300289, 292097, 300292, 300294, 275719, 177419, 300299, 283917, 300301, 275725, 177424, 242957, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 243003, 283963, 283973, 300357, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 218473, 284010, 136562, 324978, 275834, 275836, 275840, 316803, 316806, 316811, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 218597, 292329, 300523, 259565, 300527, 259567, 308720, 226802, 292338, 316917, 308727, 300537, 316947, 308757, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 308790, 284215, 316983, 194103, 284218, 226877, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 276043, 366155, 317004, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 276053, 284247, 317015, 284249, 243290, 284251, 235097, 284253, 300638, 284255, 284258, 292452, 292454, 284263, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 284290, 325250, 284292, 292485, 292479, 276098, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 276144, 284337, 284339, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 317158, 358119, 284392, 325353, 284394, 358122, 284397, 358126, 276206, 358128, 284399, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 186139, 300828, 300830, 276255, 325408, 300832, 300834, 317221, 227109, 358183, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 153417, 358224, 284499, 276308, 178006, 317271, 284502, 276315, 292700, 284511, 317279, 227175, 292715, 300912, 284529, 292721, 300915, 292729, 317306, 284540, 292734, 325512, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 292776, 317353, 276395, 292784, 358326, 161718, 276410, 276411, 358330, 276418, 301009, 276433, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 227314, 276466, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 276496, 317456, 317458, 243733, 317468, 243740, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 276539, 235581, 325692, 178238, 276544, 284739, 325700, 292934, 243785, 276553, 350293, 350295, 194649, 227418, 309337, 350299, 350302, 227423, 194654, 178273, 194657, 227426, 194660, 276579, 227430, 276583, 309346, 309348, 309350, 309352, 309354, 350308, 276590, 350313, 350316, 350321, 284786, 276595, 227440, 301167, 350325, 350328, 292985, 292989, 292993, 301185, 350339, 317570, 317573, 350342, 350345, 276617, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 227522, 350402, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 309462, 301272, 309468, 309471, 301283, 317672, 317674, 325867, 227571, 309491, 309494, 243960, 276735, 227583, 227587, 276739, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 276789, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 317833, 178572, 285070, 285077, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 317910, 293336, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 301562, 317951, 309764, 301575, 121352, 236043, 342541, 113167, 317971, 309779, 309781, 277011, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 277054, 219714, 129603, 318020, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 121458, 277106, 170619, 309885, 309888, 277122, 146052, 277128, 285320, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 318132, 293555, 277177, 277181, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 228069, 277223, 342760, 285417, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 301884, 310080, 293696, 277314, 277317, 277322, 293706, 310100, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 310134, 15224, 236408, 277368, 416639, 416640, 113538, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 276586, 293849, 293861, 228327, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 56313, 285690, 302073, 244731, 293882, 302075, 293887, 277504, 277507, 277511, 293899, 277519, 302105, 293917, 293939, 318516, 277561, 310336, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 392326, 285831, 253064, 302218, 285835, 162964, 384148, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 228526, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 228606, 64768, 310531, 285958, 228617, 138505, 318742, 277798, 130345, 113964, 285997, 285999, 113969, 318773, 318776, 286010, 417086, 286016, 294211, 302403, 384328, 326991, 179547, 146784, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 310657, 351619, 294276, 310659, 327046, 253320, 310665, 318858, 310672, 351633, 310689, 130468, 228776, 277932, 310703, 310710, 130486, 310712, 310715, 302526, 228799, 64966, 245191, 163272, 310727, 302534, 292968, 302541, 302543, 310737, 228825, 163290, 310749, 310755, 187880, 310764, 286188, 310772, 40440, 212472, 40443, 286203, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 146977, 187939, 40484, 294435, 286246, 40486, 294439, 278057, 294440, 40491, 294443, 294445, 310831, 40499, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 212560, 228944, 400976, 40533, 147032, 40537, 40539, 278109, 40541, 40544, 40548, 40550, 286312, 286313, 40554, 310892, 40557, 40560, 294521, 343679, 294537, 310925, 286354, 278163, 122517, 278168, 179870, 327333, 229030, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 294601, 302793, 343757, 212690, 278227, 286420, 319187, 229076, 286425, 319194, 278235, 301163, 278238, 229086, 294625, 294634, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 311053, 302862, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 188252, 237409, 294776, 360317, 294785, 327554, 294803, 40851, 294811, 237470, 319390, 294817, 319394, 40865, 311209, 180142, 294831, 188340, 40886, 294844, 294847, 393177, 294876, 294879, 311279, 278513, 237555, 278516, 311283, 237562 ]
6e183e97ef4e47e53cc8fb1e7c4e704be769c6a8
87c66ac109b49970b2ac7e94b742b8261b2f6ac2
/FinalAssessment/ImageTableViewController.swift
b20b40586532692bc675796564df5542e7d6b9bd
[]
no_license
alextsai0227/Final-Assessment
c7f2bc325f4df9ac541e49c608182561e12a053a
625e336edadaf4ee961798fdda948448d1a3c2e1
refs/heads/master
2021-01-17T05:26:23.130086
2016-08-05T10:02:23
2016-08-05T10:02:23
65,004,682
0
0
null
null
null
null
UTF-8
Swift
false
false
3,462
swift
// // ImageTableViewController.swift // FinalAssessment // // Created by 蔡舜珵 on 2016/8/4. // Copyright © 2016年 蔡舜珵. All rights reserved. // import UIKit class ImageTableViewController: UIViewController,UITableViewDelegate,UITableViewDataSource{ @IBOutlet weak var imageTableView: UITableView! var imageList = [Image]() var tryimageList = [Image]() var selectedImage = Image() let userDefault = NSUserDefaults.standardUserDefaults() override func viewDidLoad() { super.viewDidLoad() self.imageTableView.dataSource = self self.imageTableView.delegate = self self.imageTableView.registerNib(UINib(nibName: "ImageTableViewCell",bundle: nil), forCellReuseIdentifier: "ImageTableViewCell") } override func viewWillAppear(animated: Bool) { if let imageData = userDefault.objectForKey("ImageList") as? NSData { if let image = NSKeyedUnarchiver.unarchiveObjectWithData(imageData) as? [Image] { imageList = image ImageList.shareInstance.allImages = image } } // imageList = ImageList.shareInstance.allImages self.imageTableView.reloadData() } func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { return UITableViewAutomaticDimension } func tableView(tableView: UITableView, estimatedHeightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { return 100 } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } func numberOfSectionsInTableView(tableView: UITableView) -> Int { return 1 } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return self.imageList.count } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = self.imageTableView.dequeueReusableCellWithIdentifier("ImageTableViewCell") as! ImageTableViewCell cell.tableImageView.image = imageList[indexPath.row].image cell.imageLabel.text = imageList[indexPath.row].imageDescription return cell } func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { selectedImage = self.imageList[indexPath.row] performSegueWithIdentifier("showImageScrollVC", sender: nil) } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showImageScrollVC" { let vc = segue.destinationViewController as! ImageViewController vc.myimage = selectedImage } } func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool { return true } func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { if editingStyle == .Delete { ImageList.shareInstance.allImages.removeAtIndex(indexPath.row) let data = NSKeyedArchiver.archivedDataWithRootObject(ImageList.shareInstance.allImages) userDefault.setObject(data, forKey: "ImageList") userDefault.synchronize() imageList.removeAtIndex(indexPath.row) tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) } } }
[ -1 ]
19faf142ffb378cd139c79f4490e1bf86412f4cb
086a016025464f3268d5f184fc4899bba457d611
/MyNetflix/MyNetflix/RecommendListViewController.swift
0b11e699a96b440e7d81e98d047e6a67efd8557b
[]
no_license
Odyflame/FastCampus_iOS
faed82dd1ac77140152aa04c56e1d8a1035cdb3d
bc7253ba5e867d7b895c461c1fa906160574d92b
refs/heads/master
2022-11-14T23:15:15.632087
2020-07-07T10:03:09
2020-07-07T10:03:09
256,707,561
0
0
null
null
null
null
UTF-8
Swift
false
false
3,204
swift
// // RecommendListViewController.swift // MyNetflix // // Created by joonwon lee on 2020/04/02. // Copyright © 2020 com.joonwon. All rights reserved. // import UIKit class RecommendListViewController: UIViewController { @IBOutlet weak var sectionTitle: UILabel! let viewModel = RecommentListViewModel() override func viewDidLoad() { super.viewDidLoad() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) updateUI() } func updateUI() { sectionTitle.text = viewModel.type.title } } extension RecommendListViewController: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return viewModel.numOfItems } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "RecommendCell", for: indexPath) as? RecommendCell else { return UICollectionViewCell() } let movie = viewModel.item(at: indexPath.item) cell.updateUI(movie: movie) return cell } } extension RecommendListViewController: UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { return CGSize(width: 120, height: 160) } } class RecommentListViewModel { enum RecommendingType { case award case hot case my var title: String { switch self { case .award: return "아카데미 호평 영황" case .hot: return "취한저격 HOT 콘텐츠" case .my: return "내가 찜한 콘텐츠" } } } private (set) var type: RecommendingType = .my private var items: [DummyItem] = [] var numOfItems: Int { return items.count } func item(at index: Int) -> DummyItem { return items[index] } func updateType(_ type: RecommendingType) { self.type = type } func fetchItems() { self.items = MovieFetcher.fetch(type) } } class RecommendCell: UICollectionViewCell { @IBOutlet weak var thumbnailImage: UIImageView! func updateUI(movie: DummyItem) { thumbnailImage.image = movie.thumbnail } } class MovieFetcher { static func fetch(_ type: RecommentListViewModel.RecommendingType) -> [DummyItem] { switch type { case .award: let movies = (1..<10).map { DummyItem(thumbnail: UIImage(named: "img_movie_\($0)")!) } return movies case .hot: let movies = (10..<19).map { DummyItem(thumbnail: UIImage(named: "img_movie_\($0)")!) } return movies case .my: let movies = (1..<10).map { $0 * 2 }.map { DummyItem(thumbnail: UIImage(named: "img_movie_\($0)")!) } return movies } } } struct DummyItem { let thumbnail: UIImage }
[ -1 ]
756350a0dab87a809676bd3bdce964229669c131
ed62a49dfcc49c133a9e549eb5899c3f922da5d3
/Posts/Scenes/PostsList/PostsListModels.swift
1fb48c4a8f9f8869933a12b7c631d2c6420c8fca
[]
no_license
spelaez/Posts
3031ec36704b4eb9f8d15135546fc4c3e50ecc80
ccaf5c88ad4eaf9eae829b18097ea16da9ce4f27
refs/heads/master
2020-08-09T05:58:03.308048
2019-10-11T18:34:09
2019-10-11T18:34:09
214,014,634
0
0
null
null
null
null
UTF-8
Swift
false
false
1,263
swift
// // PostsListModels.swift // Posts // // Created by Santiago Pelaez Rua on 10/9/19. // Copyright (c) 2019 Santiago Pelaez Rua. All rights reserved. // // This file was generated by the Clean Swift Xcode Templates so // you can apply clean architecture to your iOS and Mac projects, // see http://clean-swift.com // import UIKit enum PostsList { // MARK: Use cases enum FetchPosts { struct Request { } struct Response { let posts: [Post] } struct ViewModel { var posts: [Post] } } enum DeletePost { struct Request { var post: Post } struct Response { let posts: [Post] } struct ViewModel { var posts: [Post] } } enum DeleteAllPosts { struct Request { } struct Response { } struct ViewModel { } } enum FilterPosts { enum Filter { case all case favorites } struct Request { var filter: Filter } struct Response { let posts: [Post] } struct ViewModel { let posts: [Post] } } }
[ -1 ]
33be606600bedbb688c32cd8d4aa9295d2fadad7
38f562833f0e195df2852f7ea5566e87155c35bc
/PhotoDownload/PhotoOperations.swift
0d664d8bfaa468af125ef394eeb67804a146f260
[]
no_license
davidshore/PhotoDownload
cfc6b759130516925ee464e9b1dd125cba78b9c2
155de6b0465dfad4efb6d7fcfb4344e748ec87a2
refs/heads/master
2021-01-17T20:15:33.338031
2016-06-07T07:57:58
2016-06-07T07:57:58
60,593,587
0
0
null
null
null
null
UTF-8
Swift
false
false
3,032
swift
// // PhotoOperations.swift // PhotoDownload // // Created by David Shore on 2016-06-06. // Copyright © 2016 Foggy Media. All rights reserved. // import UIKit // This enum contains all the possible states a photo record can be in enum PhotoRecordState { case New, Downloaded, Failed } class PhotoRecord { let index:Int let url:NSURL var state = PhotoRecordState.New var image = UIImage(named: "Placeholder") init(index:Int, url:NSURL) { self.index = index self.url = url } } class PendingOperations { lazy var downloadsInProgress = [NSIndexPath:NSOperation]() lazy var downloadQueue:NSOperationQueue = { var queue = NSOperationQueue() queue.name = "Download queue" queue.maxConcurrentOperationCount = 1 return queue }() lazy var filtrationsInProgress = [NSIndexPath:NSOperation]() lazy var filtrationQueue:NSOperationQueue = { var queue = NSOperationQueue() queue.name = "Image Filtration queue" queue.maxConcurrentOperationCount = 1 return queue }() } class ImageDownloader: NSOperation { let defaultSession = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration()) var dataTask: NSURLSessionDataTask? let photoRecord: PhotoRecord let completion: () -> Void init(photoRecord: PhotoRecord, completion: () -> Void) { self.photoRecord = photoRecord self.completion = completion } override func main() { if self.cancelled { return } dataTask = defaultSession.dataTaskWithURL(self.photoRecord.url) { data, response, error in dispatch_async(dispatch_get_main_queue()) { UIApplication.sharedApplication().networkActivityIndicatorVisible = false } var imageData:NSData = NSData() if let error = error { print(error.localizedDescription) self.photoRecord.image = UIImage(named: "Failed") self.photoRecord.state = .Failed self.completion() } else if (response as? NSHTTPURLResponse) != nil { if self.cancelled { self.dataTask?.cancel() return } imageData = NSData(data: data!) if imageData.length > 0 { self.photoRecord.image = UIImage(data:imageData) self.photoRecord.state = .Downloaded } else { self.photoRecord.image = UIImage(named: "Failed") self.photoRecord.state = .Failed } self.completion() } } dataTask?.resume() if self.cancelled { dataTask?.cancel() return } } }
[ -1 ]
d5e0fa93d3e1d8c36537d4f29295154fd96e7c32
82c4141ffa67759f251d9ade73a4f5e4e44c2900
/JsonPlaceHolderUsers/JsonPlaceHolderUsers/Model Controller/UsersController.swift
08ebb99d8a55baab4a1ad9b1d628d51c79bcd0f0
[]
no_license
nelglez/JSON-Placeholder-UsersAPI-App
32001705b448a55fefe50b1c0288e53a9b8d6d8d
4c7144ee5074761e1870cd1049fa94ca2879d93e
refs/heads/master
2020-04-26T14:37:06.172125
2019-03-03T19:33:55
2019-03-03T19:33:55
173,620,561
0
0
null
null
null
null
UTF-8
Swift
false
false
1,299
swift
// // UsersController.swift // JsonPlaceHolderUsers // // Created by Nelson Gonzalez on 3/3/19. // Copyright © 2019 Nelson Gonzalez. All rights reserved. // import Foundation class UsersController { private(set) var users: [Users] = [] private let baseUrl = URL(string: "https://jsonplaceholder.typicode.com/users/")! func fetchUsers(completion: @escaping(Error?)-> Void) { let request = baseUrl URLSession.shared.dataTask(with: request) { (data, _, error) in if let error = error { print("Error with dataTask: \(error)") completion(error) } guard let data = data else { print("No data returned from the data task") completion(NSError()) return } let decoder = JSONDecoder() do { let usersDecoded = try decoder.decode([Users].self, from: data) self.users.append(contentsOf: usersDecoded) completion(nil) } catch { self.users = [] print("Error decoding and getting data: \(error)") completion(error) } }.resume() } }
[ -1 ]
4677fac6a41fc9c212575dae5d5c92a6223e4fdb
9c91567bcd0d5a91c6ea162545ef734f4253bc16
/TheSoundOfNumbers.playgroundbook/Contents/Chapters/Chapter2.playgroundchapter/Pages/ThisIsMe.playgroundpage/Contents.swift
22935e546d87b656fa18c038c1d4dbdf8a84ae2d
[]
no_license
liakassardjian/LiaPlaygroundWWDC19
ff57b1f41ff801e65342e21d8f33e165fbf78a3e
6c6de60aa3448279338d3942f95b0bc8a57f3698
refs/heads/master
2020-05-06T15:44:05.599643
2019-04-11T17:31:50
2019-04-11T17:31:50
180,205,826
0
0
null
null
null
null
UTF-8
Swift
false
false
1,619
swift
/*: [Previous](@previous) # This is me My name is Lia Kassardjian, I'm from São Paulo, Brazil, and I'm currently studying Computer Science. Also, I'm a student at Apple Developer Academy | Mackenzie. I've been surrounded by music my hole life, from my grandmother's piano lessons to performing in a musical. Because of that, I've decided to make a playground based on music. I believe that music is essencial for a child's development and that it can be very effective in learning. I've decided, then, to use music as an educational method by connecting it to mathematical concepts. Music teaches us how learning can be fun. */ //#-hidden-code import Foundation import UIKit import PlaygroundSupport class ViewController : UIViewController, UITextViewDelegate { let auto = AutoLayout() let set = ViewSet() override func loadView() { let view = UIView() view.backgroundColor = #colorLiteral(red: 0.9689446092, green: 0.9900891185, blue: 0.997474134, alpha: 1) let label = set.createDefaultLabel(position: (0,0), outText: "This is me!", fontSize: 50) view.addSubview(label) auto.setAutoLayout(subView: label, view: view, topC: 70, centerC: 0, widthC: nil, heightC: nil) let picture = set.setImageView(position: (0,0), size: (30,30), imgName: "picture") view.addSubview(picture) auto.setAutoLayout(subView: picture, view: view, topC: 200, centerC: 0, widthC: 300, heightC: 300) self.view = view } } //#end-hidden-code PlaygroundPage.current.liveView = ViewController()
[ -1 ]
73a6429038d67ea2c8586394702aa3fd8ae38995
dec31240d861da3d033340ba9431475fbdb760b7
/my_own_pokedex/ViewController.swift
5073b8a919a88f39e6ddd468f683d54da2120236
[]
no_license
ayon1911/my_own_pokedex
66f0b83c07c8495b82c5cd74404e205ff10e9fa7
806f44faaa5367f1ef9940afa4d65e5bcec0c287
refs/heads/master
2021-01-20T22:20:03.671970
2017-03-05T09:52:23
2017-03-05T09:52:23
65,296,430
0
0
null
null
null
null
UTF-8
Swift
false
false
4,885
swift
// // ViewController.swift // my_own_pokedex // // Created by Khaled Rahman Ayon on 09/08/16. // Copyright © 2016 iosApp. All rights reserved. // import UIKit import AVFoundation class ViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UISearchBarDelegate { @IBOutlet weak var collectionView: UICollectionView! @IBOutlet var searchBar: UISearchBar! var pokemon = [Pokemon]() var filteredPokeMon = [Pokemon]() var musicPlayer: AVAudioPlayer! var inSearchMode = false override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. collectionView.delegate = self collectionView.dataSource = self searchBar.delegate = self searchBar.returnKeyType = UIReturnKeyType.Done parsePokemonCSV() initAudio() } func initAudio() { let path = NSBundle.mainBundle().pathForResource("music", ofType: "mp3") do { musicPlayer = try AVAudioPlayer(contentsOfURL: NSURL(string: path!)!) musicPlayer.prepareToPlay() musicPlayer.numberOfLoops = -1 musicPlayer.play() }catch let err as NSError { print(err.debugDescription) } } func parsePokemonCSV (){ let path = NSBundle.mainBundle().pathForResource("pokemon", ofType: "csv")! do { let csv = try CSV(contentsOfURL: path) let rows = csv.rows for row in rows { let pokeID = Int(row["id"]!)! let name = row["identifier"]! let poke = Pokemon(name: name, pokedexID: pokeID) pokemon.append(poke) } }catch let err as NSError{ print(err.debugDescription) } } func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { if let cell = collectionView.dequeueReusableCellWithReuseIdentifier("PokeCell", forIndexPath: indexPath) as? PokeCell { let poke : Pokemon if inSearchMode { poke = filteredPokeMon[indexPath.row] }else { poke = pokemon[indexPath.row] } cell.configureCell(poke) return cell }else { return UICollectionViewCell() } } func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { var poke: Pokemon if inSearchMode{ poke = filteredPokeMon[indexPath.row] }else { poke = pokemon[indexPath.row] } performSegueWithIdentifier("PokemonDetailVC", sender: poke) } func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { if inSearchMode { return filteredPokeMon.count } return pokemon.count } func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int { return 1 } func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize { return CGSizeMake(105, 105) } func searchBarSearchButtonClicked(searchBar: UISearchBar) { view.endEditing(true) } func searchBar(searchBar: UISearchBar, textDidChange searchText: String) { if searchBar.text == nil || searchBar.text == "" { inSearchMode = false view.endEditing(true) collectionView.reloadData() }else { inSearchMode = true let lower = searchBar.text!.lowercaseString filteredPokeMon = pokemon.filter({$0.name.rangeOfString(lower) != nil}) collectionView.reloadData() } } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "PokemonDetailVC" { if let detailVC = segue.destinationViewController as? PokemonDetailVC{ if let poke = sender as? Pokemon { detailVC.pokemon = poke } } } } @IBAction func musicBtnPressed(sender: UIButton!) { if musicPlayer.playing { musicPlayer.stop() sender.alpha = 0.2 }else { musicPlayer.play() sender.alpha = 1.06 } } }
[ -1 ]
245510b0be9c64e1e9b15ea780c1d837277be901
725f5d87eaa7d7add31fb942e2357b352760c187
/_Lectures/FriendTableViewProject/MainPageProject/AppDelegate.swift
2d1f42791136a5982b28690e6a0f7e28e7217df2
[]
no_license
amywork/tastySwift
a5a6c8a48fce03b08c3b20d3d6fbbd74574b2c90
bb270285e534c62386f65c16e82bdb2f0f155f39
refs/heads/master
2021-08-31T11:18:50.933755
2017-12-21T05:19:07
2017-12-21T05:19:07
103,228,599
3
3
null
null
null
null
UTF-8
Swift
false
false
2,190
swift
// // AppDelegate.swift // MainPageProject // // Created by youngmin joo on 2017. 10. 20.. // Copyright © 2017년 WingsCompany. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 229391, 327695, 229394, 278548, 229397, 229399, 229402, 352284, 278556, 229405, 278559, 229408, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 286776, 319544, 286778, 204856, 229432, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 286916, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 278983, 319945, 278986, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 320007, 287238, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 311850, 279082, 279084, 172591, 172598, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 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, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 189169, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 303976, 336744, 303981, 303985, 303987, 328563, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 304007, 213895, 304009, 304011, 304013, 295822, 213902, 279438, 189329, 295825, 304019, 189331, 58262, 304023, 304027, 279452, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 197580, 312272, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 295945, 230413, 197645, 295949, 320528, 140312, 295961, 238620, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 132165, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 312432, 337018, 189562, 279679, 66690, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 304348, 304354, 296163, 320740, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 214294, 296215, 320792, 230681, 296213, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 279929, 181631, 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, 288210, 370130, 222676, 288212, 288214, 280021, 239064, 329177, 288217, 288218, 280027, 288220, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 230923, 304651, 304653, 370187, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 239202, 312938, 280183, 280191, 116354, 280194, 280208, 280211, 288408, 280222, 419489, 190118, 198310, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 337732, 280388, 304968, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 288895, 321670, 215175, 288909, 141455, 275606, 280725, 313498, 100520, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 280811, 280817, 125171, 280819, 157940, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 280919, 248153, 354653, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289227, 281047, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 330244, 223752, 150025, 338440, 281095, 223757, 281102, 223763, 223765, 322074, 281116, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 338528, 338532, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 256716, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 183184, 142226, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 183260, 289762, 322534, 297961, 183277, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 216376, 380226, 298306, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 298365, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 298377, 314763, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 290305, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 290325, 282133, 241175, 290328, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 323260, 282300, 323266, 282310, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 298822, 148946, 315211, 307027, 315221, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 315253, 315255, 339838, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 241581, 241583, 323504, 241586, 290739, 241588, 282547, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 307374, 307376, 299185, 323763, 184503, 176311, 307385, 307386, 258235, 307388, 176316, 307390, 299200, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 299225, 233701, 307432, 282881, 282893, 323854, 291089, 282906, 291104, 233766, 295583, 307508, 315701, 332086, 307510, 307512, 307515, 307518, 282942, 282947, 323917, 282957, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 291254, 283062, 127417, 291260, 127421, 127424, 299457, 127429, 127431, 127434, 315856, 176592, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 283142, 127497, 233994, 135689, 127500, 233998, 127506, 234003, 127509, 234006, 127511, 152087, 283161, 234010, 135707, 242202, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 299740, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 316294, 226182, 234375, 308105, 226185, 234379, 234384, 234390, 226200, 234393, 209818, 308123, 234396, 324508, 291742, 324504, 234398, 234401, 291747, 291748, 234405, 291750, 324518, 324520, 234407, 324522, 234410, 291756, 291754, 226220, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 234437, 226239, 226245, 234439, 234443, 291788, 234446, 275406, 234449, 316370, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 308226, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 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, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 234648, 275608, 234650, 308379, 324757, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 177318, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 275725, 177424, 283917, 349451, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 243003, 283963, 226628, 300357, 283973, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 218473, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 316811, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 300448, 144807, 144810, 144812, 284076, 144814, 227426, 144820, 374196, 284084, 292279, 284087, 144826, 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, 284223, 284226, 284228, 292421, 243268, 284231, 226886, 128584, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 276052, 276053, 284249, 300638, 284251, 284253, 284255, 284258, 292452, 292454, 284263, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 276095, 284288, 292479, 284290, 325250, 284292, 292485, 276098, 292481, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 276166, 358089, 284362, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 284379, 284381, 284384, 358114, 284386, 358116, 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, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 366406, 276295, 292681, 153417, 358224, 276308, 178006, 317271, 284502, 276315, 292700, 317279, 284511, 292715, 300912, 292721, 284529, 300915, 292729, 317306, 284540, 292734, 325512, 317332, 358292, 284564, 284566, 399252, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292784, 358326, 161718, 358330, 276411, 276418, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 292839, 276455, 292843, 276460, 292845, 178161, 227314, 276466, 325624, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 350218, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 284739, 325700, 243779, 292934, 243785, 276553, 350293, 350295, 309337, 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, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 309491, 227571, 309494, 243960, 227583, 276735, 227587, 276739, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 235858, 276829, 276833, 391523, 276836, 293227, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 227738, 317853, 276896, 317858, 342434, 317864, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 293346, 227810, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 113167, 309779, 317971, 309781, 277011, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 23094, 277054, 219714, 129603, 301636, 318020, 301639, 301643, 285265, 399955, 309844, 277080, 309849, 285282, 326244, 318055, 277100, 309871, 121458, 170619, 309885, 309888, 277122, 277128, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 318132, 342707, 154292, 277173, 277177, 277181, 318144, 277187, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 228069, 277223, 342760, 285417, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 301884, 293696, 310080, 277317, 293706, 277322, 310100, 301911, 301913, 277337, 301921, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 276579, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 244731, 293887, 277504, 277507, 277511, 293899, 293908, 293917, 293939, 318516, 277561, 277564, 310336, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 228592, 294132, 138485, 228601, 204026, 228606, 64768, 310531, 138505, 228617, 318742, 277798, 130345, 113964, 285997, 285999, 113969, 318773, 318776, 286010, 417086, 286016, 302403, 294211, 384328, 294221, 294223, 326991, 179547, 146784, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 310657, 351619, 294276, 310659, 327046, 253320, 310665, 318858, 310672, 351633, 310689, 130468, 228776, 277932, 310703, 310710, 130486, 310712, 310715, 302526, 228799, 302534, 310727, 245191, 64966, 302541, 302543, 310737, 228825, 163290, 310749, 310755, 187880, 310764, 286188, 310772, 40440, 212472, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 302614, 302617, 286233, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 196133, 310831, 245288, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 40557, 40560, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 229086, 278238, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 360322, 40851, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278519, 237562 ]
b284c7ee169123e0dffbd0f2b6ac574161043f9a
5ad18fce967c57edf24163065c5cdafbeb3d91b0
/Chat App/ChatLogController.swift
bb847ec309c0d1c00f3add4c43630391e0586b37
[]
no_license
JKCodes/Chat-App
611419a07074237700754b80f0a1768f9c292818
3eb5af9cdbb5dea4741755156772f7e74be394c1
refs/heads/master
2021-01-19T11:16:27.299341
2017-11-15T21:08:44
2017-11-15T21:08:44
87,949,827
0
0
null
null
null
null
UTF-8
Swift
false
false
8,423
swift
// // ChatLogController.swift // Chat App // // Created by Joseph Kim on 4/26/17. // Copyright © 2017 Joseph Kim. All rights reserved. // import UIKit class ChatLogController: UICollectionViewController, Alerter { fileprivate let cellId = "cellId" fileprivate var cellHeight: CGFloat = 80 fileprivate let containerViewHeight: CGFloat = 50 fileprivate let contentOffset: CGFloat = 8 fileprivate let messageImageWidth: CGFloat = 200 fileprivate var containerViewBottomConstraint: NSLayoutConstraint? var user: User? { didSet { guard let firstName = user?.firstName, let lastName = user?.lastName, let username = user?.username else { return } navigationItem.title = "\(firstName) \(lastName) (@\(username))" observeMessages() } } var messages = [Message]() lazy var inputContainerView: ChatInputContainerView = { [weak self] in guard let this = self else { return ChatInputContainerView() } let chatInputContainerView = ChatInputContainerView(frame: CGRect(x: 0, y: 0, width: this.view.frame.width, height: this.containerViewHeight)) chatInputContainerView.delegate = this return chatInputContainerView }() override var inputAccessoryView: UIView? { get { return inputContainerView } } override var canBecomeFirstResponder: Bool { return true } override func viewDidLoad() { super.viewDidLoad() setupCollectionView() setupKeyboardObservers() } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) NotificationCenter.default.removeObserver(self) } } // MARK: - CollectionView related extension ChatLogController: UICollectionViewDelegateFlowLayout { override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return messages.count } override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, for: indexPath) as! ChatMessageCell let message = messages[indexPath.item] cell.message = message cell.textView.text = message.text setupCell(cell: cell, message: message) if let text = message.text { cell.bubbleWidthConstraint?.constant = estimateFrame(text: text).width + contentOffset * 3 } return cell } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let message = messages[indexPath.item] if let text = message.text { cellHeight = estimateFrame(text: text).height + contentOffset * 2 } let width = UIScreen.main.bounds.width return CGSize(width: width, height: cellHeight) } fileprivate func estimateFrame(text: String) -> CGRect { let size = CGSize(width: ChatMessageCell.cellWidth, height: 1000) let options = NSStringDrawingOptions.usesFontLeading.union(.usesLineFragmentOrigin) let attributes = [NSAttributedStringKey.font: UIFont.avenirNextFont(size: ChatMessageCell.textViewFontSize, bold: false)] return NSString(string: text).boundingRect(with: size, options: options, attributes: attributes, context: nil) } } // MARK: - Delegate for ChatInputContainerView extension ChatLogController: ChatInputContainerViewDelegate { func handleSend() { guard let text = inputContainerView.inputTextField.text else { return } if text.characters.count < 1 { return } let properties: [String: AnyObject] = ["text": text as AnyObject] sendMessage(properties: properties) } } // MARK: - Setup extension ChatLogController { fileprivate func setupCollectionView() { collectionView?.contentInset = UIEdgeInsets(top: contentOffset, left: 0, bottom: contentOffset, right: 0) collectionView?.alwaysBounceVertical = true collectionView?.backgroundColor = .white collectionView?.keyboardDismissMode = .interactive collectionView?.register(ChatMessageCell.self, forCellWithReuseIdentifier: cellId) } fileprivate func setupKeyboardObservers() { NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardDidShow), name: .UIKeyboardDidShow, object: nil) } fileprivate func setupCell(cell: ChatMessageCell, message: Message) { guard let urlSting = user?.profileImageUrl else { return } cell.profileImageView.loadImage(urlString: urlSting) if message.fromId == AuthenticationService.shared.currentId() { cell.bubbleView.backgroundColor = ChatMessageCell.blueColor cell.textView.textColor = .white cell.profileImageView.isHidden = true cell.bubbleRightConstraint?.isActive = true cell.bubbleLeftConstraint?.isActive = false } else { cell.bubbleView.backgroundColor = .rgb(r: 240, g: 240, b: 240) cell.textView.textColor = .black cell.profileImageView.isHidden = false cell.bubbleRightConstraint?.isActive = false cell.bubbleLeftConstraint?.isActive = true } } } // MARK: - Handlers extension ChatLogController { @objc func handleKeyboardDidShow() { if messages.count > 0 { let indexPath = IndexPath(item: messages.count - 1, section: 0) collectionView?.scrollToItem(at: indexPath, at: .top, animated: true) } } } // MARK: - Others extension ChatLogController { fileprivate func observeMessages() { guard let fromId = AuthenticationService.shared.currentId(), let toId = user?.uid else { return } DatabaseService.shared.retrieve(type: .userMessages, eventType: .childAdded, firstChild: fromId, secondChild: toId, propagate: nil, sortBy: nil) { (snapshot) in let messageId = snapshot.key DatabaseService.shared.retrieveOnce(type: .message, eventType: .value, firstChild: messageId, secondChild: nil, propagate: nil, sortBy: nil, onComplete: { [weak self] (snapshot) in guard let this = self, let dictionary = snapshot.value as? [String: AnyObject] else { return } this.messages.append(Message(dictionary: dictionary)) DispatchQueue.main.async { let indexPath = IndexPath(item: this.messages.count - 1, section: 0) this.collectionView?.reloadData() this.collectionView?.scrollToItem(at: indexPath, at: .bottom, animated: true) } }) } } fileprivate func sendMessage(properties: [String: AnyObject]) { guard let toId = user?.uid, let fromId = AuthenticationService.shared.currentId() else { return } var values = ["toId": toId, "fromId": fromId, "timestamp": "\(Date().timeIntervalSince1970)"] as [String: AnyObject] properties.forEach({values[$0] = $1 }) DatabaseService.shared.saveData(type: .message, data: values, firstChild: nil, secondChild: nil, appendAutoId: true) { [weak self] (error, ref) in guard let this = self, let ref = ref else { return } if let error = error { this.present(this.alertVC(title: "Error saving to database", message: error), animated: true, completion: nil) } values = [ref.key: 1] as [String: AnyObject] DatabaseService.shared.saveData(type: .userMessages, data: values, firstChild: fromId, secondChild: toId, appendAutoId: false, fan: true, onComplete: { (error, _) in if let error = error { this.present(this.alertVC(title: "Error saving to database", message: error), animated: true, completion: nil) } this.inputContainerView.inputTextField.text = nil }) } } }
[ -1 ]
b16efabe8a613a278edae08ac2744786a616ca87
87ac427d259441d0ac053b87afad2b347fd9953c
/01_Tutorials/CollectionView_Repeat_Park/CollectionView_Repeat_Park/ViewController.swift
cae65cea6d80bb81c7624d84259379427850733a
[]
no_license
Dynamic39/Swift_Learning
976ae26a6976c419e77b747228b7e52db6a17d2a
c87f9c669a3d91f370a52a977eaff7a7c25f9f59
refs/heads/master
2021-09-13T02:48:43.301531
2018-04-24T03:08:39
2018-04-24T03:08:39
113,547,135
0
0
null
null
null
null
UTF-8
Swift
false
false
501
swift
// // ViewController.swift // CollectionView_Repeat_Park // // Created by Samuel K on 2018. 3. 24.. // Copyright © 2018년 Samuel K. 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. } }
[ 293888, 277508, 279046, 324528, 278543, 309264, 234511, 279064, 236057, 286234, 282145, 295460, 296487, 286249, 197677, 234551, 237624, 300089, 288827, 226878, 277057, 288321, 286786, 129604, 284740, 226887, 243786, 300107, 288332, 158285, 278606, 226896, 212561, 228945, 300116, 300629, 276054, 237655, 307288, 212573, 200802, 284261, 286314, 356460, 164974, 307311, 281202, 284276, 284277, 294518, 314996, 300149, 287350, 284287, 278657, 281218, 284289, 281221, 284293, 284298, 303242, 311437, 285837, 227984, 303760, 234641, 278675, 349332, 226454, 226455, 226456, 282262, 226458, 280219, 284315, 284317, 278686, 299165, 285855, 302235, 284323, 278693, 287399, 284328, 100521, 234665, 284336, 307379, 276150, 280760, 277180, 282301, 283839, 285377, 280772, 228551, 280775, 284361, 298189, 287437, 313550, 229585, 307410, 290004, 284373, 290006, 189655, 226009, 298202, 298204, 280797, 298207, 278752, 290016, 363743, 298211, 290020, 284391, 280808, 277224, 228585, 234223, 358127, 312049, 286963, 289524, 280821, 226038, 286965, 333048, 288501, 234232, 358139, 286462, 280832, 276736, 230147, 358147, 278791, 299786, 312586, 287231, 295696, 300817, 296216, 278298, 329499, 287005, 281373, 287007, 295711, 228127, 281380, 282917, 234279, 315177, 130346, 282922, 289578, 312107, 282926, 283433, 234423, 293682, 113972, 159541, 289596, 283453, 289600, 279360, 288579, 283461, 238920, 234829, 298830, 287055, 296272, 279380, 295766, 279386, 298843, 188253, 308064, 200549, 227688, 293742, 299374, 199024, 216433, 290166, 292730, 333179, 290175, 224643, 313733, 324491, 304012, 234380, 304015, 300432, 310673, 227740, 275358, 285087, 289697, 234402, 284586, 144811, 276396, 277420, 277422, 279982, 286126, 297903, 305582, 230323, 291755, 277429, 277430, 277935, 277432, 277433, 277434, 282548, 292277, 278973, 291774, 296374, 130487, 281530, 10179, 298951, 165832, 289224, 306633, 288205, 280015, 311761, 301012, 280029, 286175, 168936, 286189, 183278, 298989, 277487, 282095, 308721, 227315, 237556, 292341, 296436, 290299, 286204, 290303 ]
4694442c892a2958f42d353ffc15ae4b5af40692
5c6753396c876de89d0204bd777b710aaaf2cbc9
/Sources/AppKit/extensions/NSMutableAttributedString+add.swift
a0543e03d508ac218659312c5f4851cd07b75cbe
[ "MIT" ]
permissive
Ligr/AppKit
5107b439acef3ff62f6e10853c66ed0875348780
ce148d3e61de30dc10fa54f6e6eeeb95db926bb6
refs/heads/master
2020-05-31T16:01:36.721096
2019-06-05T12:01:04
2019-06-05T12:01:04
190,371,307
1
0
null
null
null
null
UTF-8
Swift
false
false
593
swift
// // NSMutableAttributedString+add.swift // // Created by Alex on 12/30/18. // Copyright © 2018 NA. All rights reserved. // import Foundation public extension NSMutableAttributedString { func addAttributes(_ attributes: [NSAttributedString.Key : Any], to str: String) { guard let range = self.string.range(of: str) else { return } self.addAttributes(attributes, range: NSRange.init(range, in: self.string)) } func addAttributes(_ attributes: [NSAttributedString.Key : Any]) { addAttributes(attributes, to: self.string) } }
[ -1 ]
5aad1a6cd96b35466ccdae93e4d97edb0a62821a
e0f1772c1716e7edf8676085c8bcb67e3b82e973
/Tests/SwiftParserTest/translated/ConflictMarkersTests.swift
f1851cd0971f79029e9e1d8b2f23d4960802bc72
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "Swift-exception" ]
permissive
jpsim/swift-syntax
a4bcfbfdf39d6300384256597afefd60212ff9e5
a5cdfe827d903fb372111a9bb2eab5e6230b76e0
refs/heads/main
2022-12-07T18:24:24.827488
2022-09-27T23:42:18
2022-09-27T23:42:18
159,000,928
2
0
null
null
null
null
UTF-8
Swift
false
false
5,519
swift
// This test file has been translated from swift/test/Parse/conflict_markers.swift import XCTest final class ConflictMarkersTests: XCTestCase { func testConflictMarkers1() { AssertParse( """ // Conflict marker parsing should never conflict with operator parsing. """ ) } func testConflictMarkers2() { AssertParse( """ prefix operator <<<<<<< infix operator <<<<<<< """ ) } func testConflictMarkers3() { AssertParse( """ prefix func <<<<<<< (x : String) {} func <<<<<<< (x : String, y : String) {} """ ) } func testConflictMarkers4() { AssertParse( """ prefix operator >>>>>>> infix operator >>>>>>> """ ) } func testConflictMarkers5() { AssertParse( """ prefix func >>>>>>> (x : String) {} func >>>>>>> (x : String, y : String) {} """ ) } func testConflictMarkers6() { AssertParse( """ // diff3-style conflict markers """ ) } func testConflictMarkers7() { AssertParse( #""" #^DIAG_1^#<<<<<<< HEAD:conflict_markers.swift var a : String = "A" var b : String = "b" =======#^DIAG_2^# var a : String = "a" var b : String = "B" >>>>>>> #^DIAG_3^#18844bc65229786b96b89a9fc7739c0fc897905e:conflict_markers.swift print(a + b) """#, diagnostics: [ // TODO: Old parser expected error on line 1: source control conflict marker in source file DiagnosticSpec(locationMarker: "DIAG_1", message: "unexpected text '<<<<<<< HEAD:conflict_markers.swift' before variable"), DiagnosticSpec(locationMarker: "DIAG_2", message: "expected expression in variable"), DiagnosticSpec(locationMarker: "DIAG_3", message: "expected expression in variable"), DiagnosticSpec(locationMarker: "DIAG_3", message: "extraneous code at top level"), ] ) } func testConflictMarkers8() { AssertParse( #""" #^DIAG_1^#<<<<<<< HEAD:conflict_markers.swift ======= var d : String = "D" >>>>>>> #^DIAG_2^#18844bc65229786b96b89a9fc7739c0fc897905e:conflict_markers.swift print(d) """#, diagnostics: [ // TODO: Old parser expected error on line 1: source control conflict marker in source file DiagnosticSpec(locationMarker: "DIAG_1", message: "unexpected text before variable"), DiagnosticSpec(locationMarker: "DIAG_2", message: "expected expression in variable"), DiagnosticSpec(locationMarker: "DIAG_2", message: "extraneous code at top level"), ] ) } func testConflictMarkers9() { AssertParse( #""" <<<<<<<"HEAD:fake_conflict_markers.swift" // No error >>>>>>>"18844bc65229786b96b89a9fc7739c0fc897905e:fake_conflict_markers.swift" // No error """# ) } func testConflictMarkers10() { AssertParse( #""" #^DIAG_1^#<<<<<<< HEAD:conflict_markers.swift <<<<<<<"HEAD:fake_conflict_markers.swift" var fake_b : String = "a" >>>>>>>"18844bc65229786b96b89a9fc7739c0fc897905e:fake_conflict_markers.swift" ======= <<<<<<<"HEAD:fake_conflict_markers.swift" var fake_c : String = "a" >>>>>>>"18844bc65229786b96b89a9fc7739c0fc897905e:fake_conflict_markers.swift" >>>>>>> #^DIAG_2^#18844bc65229786b96b89a9fc7739c0fc897905e:conflict_markers.swift print(fake_b + fake_c) """#, diagnostics: [ // TODO: Old parser expected error on line 1: source control conflict marker in source file DiagnosticSpec(locationMarker: "DIAG_1", message: "unexpected text before variable"), DiagnosticSpec(locationMarker: "DIAG_2", message: "expected expression"), DiagnosticSpec(locationMarker: "DIAG_2", message: "extraneous code at top level"), ] ) } func testConflictMarkers11() { AssertParse( """ // Disambiguating conflict markers from operator applications. """ ) } func testConflictMarkers12() { AssertParse( #""" _ = { // Conflict marker. let a = "a", b = "b" a <<<<<<< b a >>>>>>> b // Not a conflict marker. a <<<<<<< b a >>>>>>> b }() """#, diagnostics: [ // TODO: Old parser expected error on line 5: source control conflict marker in source file ] ) } func testConflictMarkers13() { AssertParse( """ // Perforce-style conflict markers """ ) } func testConflictMarkers14() { AssertParse( #""" #^DIAG^#>>>> ORIGINAL var a : String = "A" var b : String = "B" ==== THEIRS var a : String = "A" var b : String = "b" ==== YOURS var a : String = "a" var b : String = "B" <<<< print(a + b) """#, diagnostics: [ // TODO: Old parser expected error on line 1: source control conflict marker in source file DiagnosticSpec(message: "unexpected text '>>>> ORIGINAL' before variable"), ] ) } func testConflictMarkers15() { AssertParse( #""" #^DIAG^#>>>> ORIGINAL ==== THEIRS ==== YOURS var d : String = "D" <<<< print(d) """#, diagnostics: [ // TODO: Old parser expected error on line 1: source control conflict marker in source file DiagnosticSpec(message: "unexpected text before variable"), ] ) } }
[ -1 ]
cb77fc12f72554293fe65206e44a10680ee8ba9e
69764f3ee0c11f3c937e6f0fe9b14fefbd4be634
/Mini Assignments/Meaning Generator/TableView/TableView/TableViewController.swift
f8f5fcde2d0500d8247859930c3d78061f3d4802
[]
no_license
SanathKumarMS/My-Documents
8822918f25f6d52a9d7f42465c31e646a6e2c3c6
d16abfe316c3ba7c1290cef2932db0888ad891fc
refs/heads/master
2020-07-21T07:59:26.233489
2019-09-06T12:17:27
2019-09-06T12:17:27
206,786,911
0
0
null
null
null
null
UTF-8
Swift
false
false
4,073
swift
// // TableViewController.swift // TableView // // Created by Sanath Kumar M S on 19/08/19. // Copyright © 2019 YML. All rights reserved. // import UIKit class TableViewController: UITableViewController { // let contacts:[[String]] = [ // ["Elon Musk", "+1-201-3141-5926"], // ["Bill Gates", "+1-202-5358-9793"], // ["Tim Cook", "+1-203-2384-6264"], // ["Richard Branson", "+1-204-3383-2795"], // ["Jeff Bezos", "+1-205-0288-4197"], // ["Warren Buffet", "+1-206-1693-9937"], // ["The Zuck", "+1-207-5105-8209"], // ["Carlos Slim", "+1-208-7494-4592"], // ["Bill Gates", "+1-209-3078-1640"], // ["Larry Page", "+1-210-6286-2089"], // ["Harold Finch", "+1-211-9862-8034"], // ["Sergey Brin", "+1-212-8253-4211"], // ["Jack Ma", "+1-213-7067-9821"], // ["Steve Ballmer", "+1-214-4808-6513"], // ["Phil Knight", "+1-215-2823-0664"], // ["Paul Allen", "+1-216-7093-8446"], // ["Woz", "+1-217-0955-0582"] // ] let contacts = ["a", "b", "c"] override func viewDidLoad() { super.viewDidLoad() tableView.register(UITableView.self, forCellReuseIdentifier: "cellIdentifier") // Uncomment the following line to preserve selection between presentations // self.clearsSelectionOnViewWillAppear = false // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem } // MARK: - Table view data source override func numberOfSections(in tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections return 1 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return contacts.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cellIdentifier", for: indexPath) cell.textLabel?.text = contacts[indexPath.row] // Configure the cell... return cell } /* // Override to support conditional editing of the table view. override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { // Return false if you do not want the specified item to be editable. return true } */ /* // Override to support editing the table view. override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == .delete { // Delete the row from the data source tableView.deleteRows(at: [indexPath], with: .fade) } else if editingStyle == .insert { // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view } } */ /* // Override to support rearranging the table view. override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { } */ /* // Override to support conditional rearranging of the table view. override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { // Return false if you do not want the item to be re-orderable. return true } */ /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }
[ -1 ]
bf8de58326f824adc1e0450376ebfe1d1fcddec1
3b5e7aeb5c92c887f4f7d3c5e51cc05572c836ec
/SampleProject/SampleProject/Views/PostCell.swift
4cc7a47e3a0aec586234ee10dad27afaca250f90
[ "MIT" ]
permissive
skladek/SKWebServiceController
ed5a53bc3e382cb4d97e856644817787e8fd1cf1
424cbec759a94cfadc4509f694a2757bc008f423
refs/heads/develop
2018-12-20T14:56:54.331879
2018-09-17T20:12:00
2018-09-17T20:28:11
92,102,414
0
0
MIT
2018-09-17T20:43:02
2017-05-22T21:48:54
Swift
UTF-8
Swift
false
false
262
swift
import UIKit class PostCell: UITableViewCell { @IBOutlet weak var body: UILabel! @IBOutlet weak var title: UILabel! func setViewModel(viewModel: PostViewModel) { body.text = viewModel.body() title.text = viewModel.title() } }
[ -1 ]
fdab18d351177da70813212200538411f76f13cc
e16445e0b3fe6c55e32b8eb11336e0eb87400078
/SwiftProblemSet.playground/Pages/Variables.xcplaygroundpage/Contents.swift
28ff0a534f3b1e2d58f67588be7040b317a53840
[]
no_license
shenyq328/udacity_swift_problem_set
9c6f4983ee83bc102878d4c4fbf84e97fa7c08b5
d49672ace25b8d181195556a8d84beaeb0349ef7
refs/heads/master
2020-06-30T23:47:05.046310
2016-11-24T13:22:25
2016-11-24T13:22:25
74,562,132
0
0
null
null
null
null
UTF-8
Swift
false
false
1,889
swift
/*: [Table of Contents](Table%20of%20Contents) | [Previous](@previous) | [Next](@next) **** */ //: ## Variables /*: ### Exercise 1 For each of the following names and types, create a variable or constant that best represents it: - gallonsRemainingInTank (`Double`) - ageOfSpecimenInWeeks (`Int`) - birthplace (`String`) - myFirstProgrammingLanguage (`String`) */ var gallonsRemainingInTank: Double var ageOfSpecimenInWeeks: Int let birthplace: String let myFirstProgrammingLanguage: String //: ### Exercise 2 //: Make the minimal changes necessary to fix the following compiler errors related to assignment, variables, and constants. var favoriteLanguage: String = "Swift" gallonsRemainingInTank = 2.0 ageOfSpecimenInWeeks = 32 myFirstProgrammingLanguage = "C" let bestProgrammingLanguage: String = myFirstProgrammingLanguage //: ### Exercise 3 //: Below is some code to reverse a string. We've declared `stringToReverse` and `arrayOfCharacters` as variables. Rewrite this code to reverse a string using only constants declared with `let`, no variables. **Note**: In the new version you may use as many constants as you'd like. let stringToReverse = "Mutable or Immutable? That is the question." let arrayOfCharacters = stringToReverse.characters.reversed() let stringReversed = String(arrayOfCharacters) /*: ### Exercise 4 For the following descriptions, create a variable or constant that best represents it: - an `Int` value representing the hunger level of an animal over time. - an `Int` value representing the score always required to win a game. - a `String` value representing a student’s birthday. - a `String` value representing what a user types into the status update area. */ var hungerLevel: Int let scoreToWin: Int let birthday: String var status: String /*: **** [Table of Contents](Table%20of%20Contents) | [Previous](@previous) | [Next](@next) */
[ -1 ]
6bc54447c345d0b66bcc8fe862a9c4d92b50554d
7d6b87cc3d4bc69871689fecb00fb6d3e872b143
/TravelPal/StoriesTableViewCell.swift
5cb05428150c9e143aadfe7f34a2174f24ac9753
[]
no_license
cran-io/travelpal-ios
e04f883490aadf53a61cecc0df65feb12f6daab7
8161eec23e7ba55bd22da770caccbf44c8e755ca
refs/heads/master
2021-01-14T11:17:38.962740
2016-05-09T19:53:15
2016-05-09T19:53:15
57,979,111
0
0
null
null
null
null
UTF-8
Swift
false
false
438
swift
// // StoriesTableViewCell.swift // TravelPal // // Created by Totti on 5/6/16. // Copyright © 2016 Totti. All rights reserved. // import UIKit class StoriesTableViewCell: UITableViewCell { @IBOutlet weak var storyPicture: UIImageView! @IBOutlet weak var storyTitle: UILabel! @IBOutlet weak var storySubtitle: UILabel! @IBOutlet weak var storyCategory: UIButton! @IBOutlet weak var storyAuthor: UIButton! }
[ -1 ]
8afbcf3a159e9977f023214685a21efc5fa2fb47
8dff5e59423506a1b854c6805fa22aa5f6a280df
/GestureRecognizerClosures/UIControl+Closures.swift
6bbefe95949e95522eeab9e6d0a46f5603b44bb9
[ "MIT" ]
permissive
iAugux/GestureRecognizerClosures
cf0e2d6b3372b4018d019ebe515ac45ce73e28d2
90e7d45032db25147183564e27cf9690a6bad2ec
refs/heads/master
2021-01-25T06:10:28.478320
2017-06-06T16:12:39
2017-06-06T16:12:39
93,536,839
0
0
null
2017-06-06T15:55:46
2017-06-06T15:55:45
null
UTF-8
Swift
false
false
1,339
swift
import UIKit public extension UIControl { /// Adds a handler that will be invoked for the specified control events @discardableResult public func on(_ controlEvents: UIControlEvents, invokeHandler handler: @escaping (UIControl) -> Void) -> AnyObject { let closureHandler = ClosureHandler(handler: handler, control: self) addTarget(closureHandler, action: ClosureHandlerSelector, for: controlEvents) var handlers = self.handlers ?? Set<ClosureHandler<UIControl>>() handlers.insert(closureHandler) self.handlers = handlers return closureHandler } /// Removes a handler from the control public func removeHandler(_ handler: AnyObject) { guard let handler = handler as? ClosureHandler<UIControl> else { return } removeTarget(handler, action: ClosureHandlerSelector, for: .allEvents) if var handlers = self.handlers { handlers.remove(handler) self.handlers = handlers } } } private var HandlerKey: UInt8 = 0 private extension UIControl { var handlers: Set<ClosureHandler<UIControl>>? { get { return objc_getAssociatedObject(self, &HandlerKey) as? Set<ClosureHandler<UIControl>> } set { objc_setAssociatedObject(self, &HandlerKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) } } }
[ -1 ]
19d302a0f03a433d103a4f56dff2fb8efa8f4a6b
16aa95a4027257004e26e230c7ba7c5e732fbe3c
/localizationSwift/Pods/YoutubeSourceParserKit/YoutubeSourceParserKit/Youtube.swift
943be939c04e56fa787fcae04fd962b9489773de
[ "MIT" ]
permissive
Ibrahimhass/playgrounds
5295bb14b030cbfb8066e1ebb56c31b3be2f6a83
eec26d5a3e781384a7716512101d290d5a79a942
refs/heads/master
2021-01-19T03:54:17.872872
2017-08-22T19:45:43
2017-08-22T19:45:43
87,341,451
2
1
null
null
null
null
UTF-8
Swift
false
false
6,214
swift
// // Youtube.swift // youtube-parser // // Created by Toygar Dündaralp on 7/5/15. // Copyright (c) 2015 Toygar Dündaralp. All rights reserved. // import UIKit public extension NSURL { /** Parses a query string of an NSURL @return key value dictionary with each parameter as an array */ func dictionaryForQueryString() -> [String: AnyObject]? { if let query = self.query { return query.dictionaryFromQueryStringComponents() } // Note: find youtube ID in m.youtube.com "https://m.youtube.com/#/watch?v=1hZ98an9wjo" let result = absoluteString?.components(separatedBy: "?") if (result?.count)! > 1 { return result?.last?.dictionaryFromQueryStringComponents() } return nil } } public extension NSString { /** Convenient method for decoding a html encoded string */ func stringByDecodingURLFormat() -> String { let result = self.replacingOccurrences(of: "+", with:" ") return result.removingPercentEncoding! } /** Parses a query string @return key value dictionary with each parameter as an array */ func dictionaryFromQueryStringComponents() -> [String: AnyObject] { var parameters = [String: AnyObject]() for keyValue in components(separatedBy: "&") { let keyValueArray = keyValue.components(separatedBy: "=") if keyValueArray.count < 2 { continue } let key = keyValueArray[0].stringByDecodingURLFormat() let value = keyValueArray[1].stringByDecodingURLFormat() parameters[key] = value as AnyObject? } return parameters } } public class Youtube: NSObject { static let infoURL = "http://www.youtube.com/get_video_info?video_id=" static var userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4" /** Method for retrieving the youtube ID from a youtube URL @param youtubeURL the the complete youtube video url, either youtu.be or youtube.com @return string with desired youtube id */ public static func youtubeIDFromYoutubeURL(youtubeURL: NSURL) -> String? { if let youtubeHost = youtubeURL.host, let youtubePathComponents = youtubeURL.pathComponents { let youtubeAbsoluteString = youtubeURL.absoluteString if youtubeHost == "youtu.be" as String? { return youtubePathComponents[1] } else if youtubeAbsoluteString.rangeOfString("www.youtube.com/embed") != nil { return youtubePathComponents[2] } else if youtubeHost == "youtube.googleapis.com" || youtubeURL.pathComponents!.first == "www.youtube.com" as String? { return youtubePathComponents[2] } else if let queryString = youtubeURL.dictionaryForQueryString(), let searchParam = queryString["v"] as? String { return searchParam } } return nil } /** Method for retreiving a iOS supported video link @param youtubeURL the the complete youtube video url @return dictionary with the available formats for the selected video */ public static func h264videosWithYoutubeID(youtubeID: String) -> [String: AnyObject]? { let urlString = String(format: "%@%@", infoURL, youtubeID) as String let url = NSURL(string: urlString)! let request = NSMutableURLRequest(url: url as URL) request.timeoutInterval = 5.0 request.setValue(userAgent, forHTTPHeaderField: "User-Agent") request.httpMethod = "GET" var responseString = NSString() let session = URLSession(configuration: URLSessionConfiguration.default) let group = DispatchGroup() group.enter() session.dataTask(with: request as URLRequest, completionHandler: { (data, response, _) -> Void in if let data = data as NSData? { responseString = NSString(data: data as Data, encoding: String.Encoding.utf8.rawValue)! } group.leave() }).resume() group.wait(timeout: dispatch_time_t(DispatchTime.distantFuture)) let parts = responseString.dictionaryFromQueryStringComponents() if parts.count > 0 { var videoTitle: String = "" var streamImage: String = "" if let title = parts["title"] as? String { videoTitle = title } if let image = parts["iurl"] as? String { streamImage = image } if let fmtStreamMap = parts["url_encoded_fmt_stream_map"] as? String { // Live Stream if let _: AnyObject = parts["live_playback"]{ if let hlsvp = parts["hlsvp"] as? String { return [ "url": "\(hlsvp)" as AnyObject, "title": "\(videoTitle)" as AnyObject, "image": "\(streamImage)", "isStream": true ] } } else { let fmtStreamMapArray = fmtStreamMap.componentsSeparatedByString(",") for videoEncodedString in fmtStreamMapArray { var videoComponents = videoEncodedString.dictionaryFromQueryStringComponents() videoComponents["title"] = videoTitle videoComponents["isStream"] = false return videoComponents as [String: AnyObject] } } } } return nil } /** Block based method for retreiving a iOS supported video link @param youtubeURL the the complete youtube video url @param completeBlock the block which is called on completion */ public static func h264videosWithYoutubeURL(youtubeURL: NSURL,completion: (( _ videoInfo: [String: AnyObject]?, _ error: NSError?) -> Void)?) { let priority = DispatchQueue.GlobalQueuePriority.background dispatch_get_global_queue(priority, 0).asynchronously() { if let youtubeID = self.youtubeIDFromYoutubeURL(youtubeURL: youtubeURL), let videoInformation = self.h264videosWithYoutubeID(youtubeID) { dispatch_async(dispatch_get_main_queue()) { completion?(videoInfo: videoInformation, error: nil) } }else{ dispatch_async(dispatch_get_main_queue()) { completion?(videoInfo: nil, error: NSError(domain: "com.player.youtube.backgroundqueue", code: 1001, userInfo: ["error": "Invalid YouTube URL"])) } } } } }
[ -1 ]
31daea1f682fabf08377e5fe6cd23b7906dced11
17082988993e1c999e8d7dabddb72dcb89767e49
/Trivia.swift
5ebc04b6b0235c60f0d8d56cdeee54fe208ab482
[]
no_license
ekinsilahlioglu/Marvel-IOS-Project
2e7ea79d1ba8899fcf730f167ddf0402b23a42b0
7d507a2583f6b11fd3e084a49e01a9495b4c347c
refs/heads/master
2020-04-16T04:24:02.445853
2020-03-24T17:59:19
2020-03-24T17:59:19
165,265,410
0
0
null
null
null
null
UTF-8
Swift
false
false
327
swift
// // Trivia.swift // LASTPROJECT // // Created by Ekin Silahlioglu,Selin Yesilselve on 17.05.2018. // Copyright © 2018 Ekin Silahlioglu,Selin Yesilselve. All rights reserved. // import Foundation struct Trivia{ var testQ:String var answerQ1: String var answerQ2: String var quenumber: Int32 }
[ -1 ]
ce4cc2b761175f5bbb5248f72dcafbd45b205271
b077a02ccbe231e7328999f89b824e0b5458b7d8
/Demo/Demo/AppDelegate.swift
77d1978e79f99e6845d17ece42804da3155009f8
[ "MIT" ]
permissive
wddwycc/DDTableViewController
cc8daab014c86bd91127cd125c60e39dd4af4150
4520025214c7d82dd477bf71a889ac2f1927b5f0
refs/heads/master
2020-04-05T23:07:19.133901
2016-07-14T10:42:07
2016-07-14T10:42:07
56,560,645
0
0
null
null
null
null
UTF-8
Swift
false
false
2,136
swift
// // AppDelegate.swift // Demo // // Created by Carrl on 16/4/18. // Copyright © 2016年 monk-studio. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 352284, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 237646, 311375, 163920, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 278648, 131192, 237693, 327814, 131209, 417930, 303241, 311436, 303244, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 278760, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 278849, 319809, 319810, 319814, 311623, 319818, 311628, 229709, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 319978, 279020, 172526, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 287238, 172550, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 287390, 295583, 303773, 172702, 287394, 230045, 303780, 172705, 287398, 172707, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 279231, 287423, 328384, 287427, 312006, 107212, 172748, 287436, 172751, 295633, 172755, 303827, 279255, 172760, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 312035, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 303914, 279340, 205613, 279353, 230202, 312124, 222018, 295755, 377676, 148302, 287569, 303959, 279383, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 320391, 213895, 304007, 304009, 304011, 230284, 304013, 213902, 279438, 295822, 189329, 304019, 189331, 279445, 58262, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 304063, 238528, 304065, 189378, 213954, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 197645, 295949, 230413, 320528, 140312, 295961, 238620, 197663, 304164, 189479, 304170, 238641, 312374, 238652, 238655, 230465, 238658, 296004, 336964, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 164973, 205934, 279661, 312432, 279669, 337018, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 165038, 238766, 230576, 238770, 304311, 350308, 230592, 279750, 312518, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 279788, 320748, 279790, 296189, 320771, 312585, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 230718, 296259, 378181, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 181626, 304506, 304505, 181631, 312711, 312712, 296331, 288140, 230800, 288144, 304533, 337306, 288154, 288160, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 173488, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 280021, 288214, 222676, 239064, 288217, 288218, 280027, 288220, 329177, 239070, 288224, 288226, 370146, 280036, 288229, 280038, 288230, 288232, 280034, 288234, 320998, 288236, 288238, 288240, 291754, 288242, 296435, 288244, 296439, 288250, 402942, 148990, 296446, 206336, 296450, 321022, 230916, 230919, 214535, 370187, 304651, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 280264, 206536, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 419570, 321266, 288499, 288502, 280314, 288510, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 345921, 280388, 304968, 280393, 280402, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280458, 280464, 124817, 280468, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 223303, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 280671, 223327, 149599, 321634, 149601, 149603, 329830, 280681, 313451, 223341, 280687, 313458, 280691, 215154, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 288936, 100520, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 280819, 157940, 125171, 280823, 280825, 280827, 280830, 280831, 280833, 280835, 125187, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 354653, 313700, 280937, 280940, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 190868, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 281084, 240124, 305662, 305664, 240129, 305666, 305668, 240132, 223749, 281095, 338440, 150025, 223752, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 199262, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 199367, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 207661, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 240519, 322440, 338823, 314249, 289687, 240535, 297883, 289694, 289696, 289700, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 281581, 183277, 322550, 134142, 322563, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 298306, 380226, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 298365, 224641, 281987, 298372, 265604, 281990, 298377, 314763, 142733, 298381, 224657, 306581, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 282410, 241450, 306988, 306991, 315184, 323376, 315190, 241464, 282425, 159545, 307009, 241475, 307012, 148946, 315211, 282446, 307027, 315221, 282454, 315223, 241496, 323414, 241498, 307035, 307040, 282465, 110433, 241509, 110438, 298860, 110445, 282478, 282481, 110450, 315251, 315249, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 282514, 298898, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 217179, 315483, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 282931, 307508, 315701, 307510, 332086, 151864, 307512, 176435, 307515, 168245, 282942, 307518, 151874, 282947, 282957, 323917, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 283080, 176592, 315856, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 291299, 127463, 242152, 291305, 176620, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 127497, 233994, 135689, 291341, 233998, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 381677, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 201496, 234264, 234266, 283421, 234269, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 201603, 291714, 234373, 226182, 234375, 291716, 226185, 308105, 234379, 234384, 234388, 234390, 226200, 324504, 234393, 209818, 308123, 324508, 234398, 234396, 291742, 234401, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 234414, 324527, 291760, 234417, 201650, 324531, 226230, 234422, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 226245, 234437, 234439, 234434, 234443, 291788, 193486, 275406, 193488, 234446, 234449, 316370, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 275545, 242777, 234585, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 234607, 160879, 275569, 234610, 300148, 234614, 398455, 144506, 275579, 234618, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 234648, 308379, 283805, 234653, 324766, 119967, 234657, 300189, 324768, 242852, 283813, 234661, 300197, 234664, 275626, 234667, 316596, 234687, 316610, 300226, 226500, 234692, 300229, 308420, 283844, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 283904, 300289, 292097, 300292, 300294, 275719, 300299, 177419, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 283963, 243003, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 284076, 144812, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 284099, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 259567, 300527, 308720, 226802, 316917, 308727, 292343, 300537, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194101, 284215, 194103, 284218, 226877, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 366155, 276043, 317004, 284238, 226895, 284241, 194130, 284243, 276052, 276053, 284245, 284247, 317015, 284249, 243290, 284251, 300628, 284253, 235097, 284255, 300638, 243293, 284258, 292452, 177766, 284263, 292454, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 276098, 284290, 325250, 284292, 292479, 292485, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 284418, 358146, 317187, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 186139, 300828, 300830, 276255, 325408, 284449, 300834, 300832, 227109, 317221, 358183, 186151, 276268, 194351, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 292715, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 276466, 227314, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 276539, 235579, 235581, 325692, 178238, 276544, 284739, 276553, 243785, 350293, 350295, 194649, 227418, 309337, 194654, 227423, 350302, 194657, 227426, 276579, 178273, 194660, 227430, 276583, 309346, 309348, 276586, 309350, 309352, 309354, 276590, 350313, 227440, 350316, 284786, 350321, 276595, 301167, 350325, 350328, 292985, 301178, 292989, 292993, 301185, 350339, 317573, 350342, 227463, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 153765, 350375, 350379, 350381, 350383, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 227540, 309462, 301272, 276699, 309468, 194780, 301283, 317672, 276713, 317674, 325867, 243948, 194801, 227571, 276725, 309494, 243960, 227583, 276735, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 276775, 211241, 325937, 276789, 325943, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 285051, 211324, 227709, 285061, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 317951, 309764, 121352, 236043, 317963, 342541, 55822, 113167, 277011, 317971, 309781, 309779, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 309844, 277080, 309849, 285277, 285282, 326244, 277100, 277106, 121458, 170618, 170619, 309885, 309888, 277122, 227975, 285320, 277128, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 326430, 228128, 293666, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 277368, 15224, 236408, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 244731, 121850, 302075, 293882, 293887, 277504, 277507, 277511, 277519, 293908, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 302218, 285835, 294026, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 285862, 277671, 302248, 64682, 277678, 228526, 294063, 294065, 302258, 277687, 294072, 318651, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 204023, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 228617, 138505, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 294211, 302403, 384328, 277832, 277836, 294221, 326991, 294223, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 277892, 277894, 253320, 310665, 318858, 277898, 327046, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 277923, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 64966, 245191, 163272, 302534, 310727, 277959, 292968, 302541, 277966, 302543, 277963, 310737, 277971, 277975, 286169, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 286188, 310764, 278000, 278003, 310772, 228851, 278006, 40440, 278009, 212472, 40443, 286203, 228864, 40448, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187939, 294435, 40484, 286246, 294439, 286248, 278057, 294440, 294443, 40486, 294445, 40488, 310831, 40491, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 228944, 212560, 400976, 40533, 147032, 40537, 40539, 278109, 40541, 40544, 40548, 40550, 286312, 286313, 40554, 40552, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 310925, 286354, 278163, 302740, 122517, 278168, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 343757, 212690, 278227, 229076, 286420, 319187, 286425, 319194, 278235, 301163, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 171774, 278274, 302852, 278277, 302854, 294664, 311048, 319243, 311053, 302862, 319251, 294682, 278306, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 237409, 360317, 327554, 40840, 40851, 294803, 188312, 294811, 319390, 294817, 319394, 40865, 294821, 311209, 180142, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
790097998073c88abfc64c71da6fcdbd0ba135c0
244cdbb80b1c1684f278ea74965823e97025cd17
/YandexAppEventsValidator/AEVControllerState.swift
aa064a4df871b57d90d6ae6e83305790a5471a96
[]
no_license
sanllier/YandexAppEventsValidator
6f6236315fcce5bddb8c4f04c30b712f910112ba
2bce26f634ef7431319359651a2fff1b685f37ed
refs/heads/master
2021-01-25T08:14:04.692304
2017-06-09T11:25:40
2017-06-09T11:32:31
93,740,344
0
0
null
null
null
null
UTF-8
Swift
false
false
1,474
swift
// // AEVControllerState.swift // YandexMaps // // Created by Alexander Goremykin on 24.05.17. // Copyright © 2017 Yandex LLC. All rights reserved. // import Foundation extension AEVController { enum State: Equatable { case idle case recording(info: AEVTestCaseInfo) case completion(info: AEVTestCaseInfo) case completionError(info: AEVTestCaseInfo) // MARK: - Internal Methods static func ==(lhs: State, rhs: State) -> Bool { switch (lhs, rhs) { case (.idle, .idle): return true case (.recording(let lInfo), .recording(let rInfo)): return lInfo == rInfo case (.completion(let lInfo), .completion(let rInfo)): return lInfo == rInfo case (.completionError(let lInfo), .completionError(let rInfo)): return lInfo == rInfo default: return false } } // MARK: - Internal Properties var isIdle: Bool { guard case .idle = self else { return false } return true } var isRecording: Bool { guard case .recording = self else { return false } return true } var isCompletion: Bool { guard case .completion = self else { return false } return true } var isCompletionError: Bool { guard case .completionError = self else { return false } return true } } }
[ -1 ]
194438466fe88f659e1809ce765ed1b6dbfce150
c1e0b026b7ff57fe3f5eeba976e10a94482ef175
/UISwift/UISwift/Model/Data.swift
33cecba50da68644b998f30f0bde009d767395b2
[]
no_license
zjam9333/SwiftUIStudy
61b0ef0e09c6da3899dada569d90c5f65a55eba4
21e4d412be0990d0718f4a02db0da67f72dad29f
refs/heads/master
2022-04-10T02:38:54.546877
2020-03-06T08:16:16
2020-03-06T08:16:16
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,090
swift
// // Data.swift // UISwift // // Created by zjj on 2020/3/5. // Copyright © 2020 zjj. All rights reserved. // import UIKit final class UserData: ObservableObject { @Published var showFavoritesOnly = false @Published var landmarks = landmarkData @Published var profile = Profile.default } let landmarkData: [Landmark] = load("landmarkData.json") let hikeData: [Hike] = load("hikeData.json") let features = landmarkData.filter { (lan) -> Bool in return lan.isFeatured } func load<T: Decodable>(_ filename: String) -> T { let data: Data guard let file = Bundle.main.url(forResource: filename, withExtension: nil) else { fatalError("Couldn't find \(filename) in main bundle.") } do { data = try Data(contentsOf: file) } catch { fatalError("Couldn't load \(filename) from main bundle:\n\(error)") } do { let decoder = JSONDecoder() return try decoder.decode(T.self, from: data) } catch { fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") } }
[ -1 ]
23ee019866bf46b8f60f3a72a2b5cf9e422b8ad4
5a10baba5c70e3e6b5d961e8777aed6be0302bbd
/Alarm/Service/NearByPrivilegeService.swift
52825ad96e94c61a82a8fcc07108b14f289529e4
[]
no_license
Saran-J/Alarm
0f726b55a3411739f510b3d3e81571ab2050608a
f1f153054f0c87006f85fff76c9aec56ff57b965
refs/heads/master
2023-06-12T02:55:19.898762
2021-07-07T14:41:51
2021-07-07T14:41:51
372,040,837
0
0
null
null
null
null
UTF-8
Swift
false
false
712
swift
import Foundation import RxSwift struct NearByPrivilegeResponse: Codable { var docId: String var id: String var name: String var category: String var latitude: Double var longitude: Double var description: String var tel: String var distance: Double } class NearByPrivilegeService: BaseService<PrivilegeProvider, [NearByPrivilegeResponse]> { func executeService(category: PrivilegeType, lat: Double, lon: Double) -> Observable<[NearByPrivilegeResponse]> { return super.callService( target: PrivilegeProvider.getPrivilege( category: category.rawValue, lat: lat, lon: lon ) ) } }
[ -1 ]
609c2e60f0f9bf2c84469daa6499e837e364c7ca
165cc4e28d4ee593962f9ac35c8eaee782faf0ce
/WalletKit/Wallet.swift
00280ef4299e2aaff9ff409bae4f6e0d51ada704
[ "MIT" ]
permissive
paulyc/HDWalletKit
ee72430e411c241518760eb9a9f94abb31241f93
c17ca3f205209f058a33622579b5fb18799f97da
refs/heads/master
2020-05-31T08:56:33.768867
2018-05-28T15:12:31
2018-05-28T15:12:31
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,898
swift
// // Wallet.swift // WalletKit // // Created by yuzushioh on 2018/01/01. // Copyright © 2018 yuzushioh. All rights reserved. // public final class Wallet { public let privateKey: PrivateKey public let publicKey: PublicKey public let network: Network public init(seed: Data, network: Network) { self.network = network privateKey = PrivateKey(seed: seed, network: network) publicKey = privateKey.publicKey } private var receivePrivateKey: PrivateKey { let purpose = privateKey.derived(at: 44, hardens: true) let coinType = purpose.derived(at: network.coinType, hardens: true) let account = coinType.derived(at: 0, hardens: true) let receive = account.derived(at: 0) return receive } private var changePrivateKey: PrivateKey { let purpose = privateKey.derived(at: 44, hardens: true) let coinType = purpose.derived(at: network.coinType, hardens: true) let account = coinType.derived(at: 0, hardens: true) let change = account.derived(at: 1) return change } private var receiveBIP49PrivateKey: PrivateKey { let purpose = privateKey.derived(at: 49, hardens: true) let coinType = purpose.derived(at: network.coinType, hardens: true) let account = coinType.derived(at: 0, hardens: true) let receive = account.derived(at: 0) return receive } private var changeBIP49PrivateKey: PrivateKey { let purpose = privateKey.derived(at: 49, hardens: true) let coinType = purpose.derived(at: network.coinType, hardens: true) let account = coinType.derived(at: 0, hardens: true) let change = account.derived(at: 1) return change } private var receiveBIP84PrivateKey: PrivateKey { let purpose = privateKey.derived(at: 84, hardens: true) let coinType = purpose.derived(at: network.coinType, hardens: true) let account = coinType.derived(at: 0, hardens: true) let receive = account.derived(at: 0) return receive } private var changeBIP84PrivateKey: PrivateKey { let purpose = privateKey.derived(at: 84, hardens: true) let coinType = purpose.derived(at: network.coinType, hardens: true) let account = coinType.derived(at: 0, hardens: true) let change = account.derived(at: 1) return change } public func generateAddress(at index: UInt32) -> String { return receivePrivateKey.derived(at: index).publicKey.address } public func generateAddressBIP49(at index: UInt32) -> String { return receiveBIP49PrivateKey.derived(at: index).publicKey.addressBIP49 } public func generateAddressBIP84(at index: UInt32) -> String { return receiveBIP84PrivateKey.derived(at: index).publicKey.addressBIP84 } }
[ -1 ]
2084c609c4838053ba33e2eaa92fdd9d28ec519e
0de9f0384d3a68710c3c735b7c2be8bdec3eb1c6
/library/swift/src/GRPCRequestBuilder.swift
29ee0b9b964ed2d89520c70b9954c0f90ae26fb8
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
alashow/envoy-mobile
93ece46515c971a38fb7a32e7f0a03a469e60e33
9c7a1839f8196211af20f7f86cdb80872f719856
refs/heads/master
2020-08-19T03:07:47.581837
2019-10-17T18:35:12
2019-10-17T18:35:12
215,869,809
0
2
Apache-2.0
2019-10-17T19:25:35
2019-10-17T19:25:35
null
UTF-8
Swift
false
false
2,611
swift
import Foundation /// Builder used for creating new gRPC `Request` instances. @objcMembers public final class GRPCRequestBuilder: NSObject { private let underlyingBuilder: RequestBuilder /// Initialize a new builder. /// /// - parameter path: Path of the RPC (i.e., `/pb.api.v1.Foo/GetBar`). /// - parameter authority: Authority to use for the RPC (i.e., `api.foo.com`). /// - parameter useHTTPS: Whether to use HTTPS (or HTTP). public init(path: String, authority: String, useHTTPS: Bool = true) { self.underlyingBuilder = RequestBuilder(method: .post, scheme: useHTTPS ? "https" : "http", authority: authority, path: path) self.underlyingBuilder.addHeader(name: "content-type", value: "application/grpc") } /// Append a value to the header key. /// /// - parameter name: The header key. /// - parameter value: Value the value associated to the header key. /// /// - returns: This builder. @discardableResult public func addHeader(name: String, value: String) -> GRPCRequestBuilder { self.underlyingBuilder.addHeader(name: name, value: value) return self } /// Remove all headers with this name. /// /// - parameter name: The header key to remove. /// /// - returns: This builder. @discardableResult public func removeHeaders(name: String) -> GRPCRequestBuilder { self.underlyingBuilder.removeHeaders(name: name) return self } /// Remove the value in the specified header. /// /// - parameter name: The header key to remove. /// - parameter value: The value to be removed. /// /// - returns: This builder. @discardableResult public func removeHeader(name: String, value: String) -> GRPCRequestBuilder { self.underlyingBuilder.removeHeader(name: name, value: value) return self } /// Add a specific timeout for the gRPC request. This will be sent in the `grpc-timeout` header. /// /// - parameter timeoutMS: Timeout, in milliseconds. /// /// - returns: This builder. @discardableResult public func addTimeoutMS(_ timeoutMS: UInt?) -> GRPCRequestBuilder { let headerName = "grpc-timeout" if let timeoutMS = timeoutMS { self.addHeader(name: headerName, value: "\(timeoutMS)m") } else { self.removeHeaders(name: headerName) } return self } /// Creates a request object from the builder. /// /// - returns: The new request object. public func build() -> Request { return self.underlyingBuilder.build() } }
[ -1 ]
c28fb53cb6b1241e41b82da2b36a4e2f87299b3d
bb89edef29abea807852253c67c2a88b0375c7b0
/LetEmKnow/LEKExample/MasterViewController.swift
edf392a745123e9ee4415579a07efedf8efe85aa
[ "MIT" ]
permissive
mrkeithelliott/LetEmKnow
25bb6784e4544995b2dcc9f3b5d6c16a0349a649
a5242af84d57afeac1cde5ab2d72e98581638e4d
refs/heads/master
2021-01-10T06:48:48.695651
2016-01-25T19:14:49
2016-01-25T19:14:49
49,435,995
0
0
null
null
null
null
UTF-8
Swift
false
false
3,571
swift
// // MasterViewController.swift // LEKExample // // Created by Keith Elliott on 1/11/16. // Copyright © 2016 GittieLabs. All rights reserved. // import UIKit class MasterViewController: UITableViewController { var detailViewController: DetailViewController? = nil var objects = [AnyObject]() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. self.navigationItem.leftBarButtonItem = self.editButtonItem() let addButton = UIBarButtonItem(barButtonSystemItem: .Add, target: self, action: "insertNewObject:") self.navigationItem.rightBarButtonItem = addButton if let split = self.splitViewController { let controllers = split.viewControllers self.detailViewController = (controllers[controllers.count-1] as! UINavigationController).topViewController as? DetailViewController } } override func viewWillAppear(animated: Bool) { self.clearsSelectionOnViewWillAppear = self.splitViewController!.collapsed super.viewWillAppear(animated) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func insertNewObject(sender: AnyObject) { objects.insert(NSDate(), atIndex: 0) let indexPath = NSIndexPath(forRow: 0, inSection: 0) self.tableView.insertRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic) } // MARK: - Segues override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showDetail" { if let indexPath = self.tableView.indexPathForSelectedRow { let object = objects[indexPath.row] as! NSDate let controller = (segue.destinationViewController as! UINavigationController).topViewController as! DetailViewController controller.detailItem = object controller.navigationItem.leftBarButtonItem = self.splitViewController?.displayModeButtonItem() controller.navigationItem.leftItemsSupplementBackButton = true } } } // MARK: - Table View override func numberOfSectionsInTableView(tableView: UITableView) -> Int { return 1 } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return objects.count } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) let object = objects[indexPath.row] as! NSDate cell.textLabel!.text = object.description return cell } override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool { // Return false if you do not want the specified item to be editable. return true } override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { if editingStyle == .Delete { objects.removeAtIndex(indexPath.row) tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) } else if editingStyle == .Insert { // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view. } } }
[ 281546, 277691, 289168, 278962, 228211, 283415, 339096, 287449, 226907 ]
9bac663f57d771c60fa48b349c09e09d61526981
5d6639bcef82f00da35147ec58449f9f52831ee9
/Sources/App/Admin/Database/Preparations/v0/CreateEventProblem.swift
4e20a5ef3e1a165f720f37ffff78b5ad32913886
[ "MIT" ]
permissive
antonyharfield/grader
42f2f908c4e9b4222241367d0c212808319e62f3
d22d43b9e6cba30d2ba1d0bd992eb16e24c2b920
refs/heads/master
2021-07-04T02:50:24.457428
2021-05-27T04:44:31
2021-05-27T04:44:31
99,318,248
3
0
null
null
null
null
UTF-8
Swift
false
false
483
swift
import Foundation import FluentProvider extension EventProblem: Preparation { static func prepare(_ database: Database) throws { try database.create(self) { builder in builder.id() builder.parent(Event.self, optional: false) builder.parent(Problem.self, optional: false) builder.int("sequence") } } static func revert(_ database: Database) throws { try database.delete(self) } }
[ -1 ]
456a354a1b344173357caa2c8ac108f561908b70
2475a151198d75570af2bc511875c0d3b58433d5
/Stackview Calculator/ViewController.swift
739ea063a1a3acd0b3ab72ef2aa2b407d456f392
[]
no_license
balub513/CalculatorUI
f887b6fddd5f2f47956f2a5adf352253bb10f018
26cf9e108b714c3ca8b1cbbf7666a08e70ca4550
refs/heads/master
2021-10-25T20:40:28.164339
2019-01-28T15:47:49
2019-01-28T15:47:49
null
0
0
null
null
null
null
UTF-8
Swift
false
false
366
swift
// // ViewController.swift // Stackview Calculator // // Created by Balakrishna on 28/01/19. // Copyright © 2019 Balakrishna. 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. } }
[ -1 ]
5e8aaafecf71332b735f410a4918d5cc81ae29bd
78aa908a9d6b1ee917c3a1f4b7f6c37e8c8a9a33
/TemplateProject/ViewControllers/LocationEditViewController.swift
7845595508f5e1f83a8c802c9869300efc79dd2a
[]
no_license
caitlynachen/Recipesimport
5916cce2081b1c61888e6ad36c8800b04a4fac0b
c9c1f2244f3f7058f15a957b316cfa5297fe7ad7
refs/heads/master
2021-01-10T20:55:28.734620
2015-08-15T02:21:36
2015-08-15T02:21:36
38,839,833
1
0
null
null
null
null
UTF-8
Swift
false
false
6,705
swift
//// //// ViewController.swift //// AutocompleteTextfieldSwift //// //// Created by Mylene Bayan on 2/21/15. //// Copyright (c) 2015 MaiLin. All rights reserved. //// // //import UIKit //import MapKit //import Parse // //class ViewController: UIViewController, NSURLConnectionDataDelegate{ // // var anno: PinAnnotation? // // @IBOutlet weak var mapView: MKMapView! // @IBOutlet weak var autocompleteTextfield: AutoCompleteTextField! // // private var responseData:NSMutableData? // private var selectedPointAnnotation:MKPointAnnotation? // private var connection:NSURLConnection? // // private let googleMapsKey = "AIzaSyD8-OfZ21X2QLS1xLzu1CLCfPVmGtch7lo" // private let baseURLString = "https://maps.googleapis.com/maps/api/place/autocomplete/json" // // override func viewDidLoad() { // super.viewDidLoad() // // Do any additional setup after loading the view, typically from a nib. // configureTextField() // handleTextFieldInterfaces() // } // // override func didReceiveMemoryWarning() { // super.didReceiveMemoryWarning() // // Dispose of any resources that can be recreated. // } // // override func shouldPerformSegueWithIdentifier(identifier: String?, sender: AnyObject?) -> Bool { // if let ident = identifier { // if ident == "toPostDisplayWithInfo" { // return true // } else if ident == "unwindToPostDisplayFromEditLoc"{ // return true // } // } // return false // // } // // private func configureTextField(){ // autocompleteTextfield.autoCompleteTextColor = UIColor(red: 128.0/255.0, green: 128.0/255.0, blue: 128.0/255.0, alpha: 1.0) // autocompleteTextfield.autoCompleteTextFont = UIFont(name: "HelveticaNeue-Light", size: 12.0) // autocompleteTextfield.autoCompleteCellHeight = 35.0 // autocompleteTextfield.maximumAutoCompleteCount = 20 // autocompleteTextfield.hidesWhenSelected = true // autocompleteTextfield.hidesWhenEmpty = true // autocompleteTextfield.enableAttributedText = true // var attributes = [String:AnyObject]() // attributes[NSForegroundColorAttributeName] = UIColor.blackColor() // attributes[NSFontAttributeName] = UIFont(name: "HelveticaNeue-Bold", size: 12.0) // autocompleteTextfield.autoCompleteAttributes = attributes // } // // var coordinateToPostDisplay: PFGeoPoint? // // private func handleTextFieldInterfaces(){ // autocompleteTextfield.onTextChange = {[weak self] text in // if !text.isEmpty{ // if self!.connection != nil{ // self!.connection!.cancel() // self!.connection = nil // } // let urlString = "\(self!.baseURLString)?key=\(self!.googleMapsKey)&input=\(text)" // let url = NSURL(string: urlString.stringByAddingPercentEscapesUsingEncoding(NSASCIIStringEncoding)!) // if url != nil{ // let urlRequest = NSURLRequest(URL: url!) // self!.connection = NSURLConnection(request: urlRequest, delegate: self) // } // } // } // // autocompleteTextfield.onSelect = {[weak self] text, indexpath in // Location.geocodeAddressString(text, completion: { (placemark, error) -> Void in // if placemark != nil{ // let coordinate = placemark!.location.coordinate // self!.coordinateToPostDisplay = PFGeoPoint(latitude: coordinate.latitude, longitude: coordinate.longitude) // self?.autocompleteTextfield.text = text // self!.addAnnotation(coordinate, address: text) // self!.mapView.setCenterCoordinate(coordinate,animated: true) // } // }) // } // } // // // //MARK: NSURLConnectionDelegate // func connection(connection: NSURLConnection, didReceiveResponse response: NSURLResponse) { // responseData = NSMutableData() // } // // func connection(connection: NSURLConnection, didReceiveData data: NSData) { // responseData?.appendData(data) // } // // func connectionDidFinishLoading(connection: NSURLConnection) { // if responseData != nil{ // var error:NSError? // if let result = NSJSONSerialization.JSONObjectWithData(responseData!, options: nil, error: &error) as? NSDictionary{ // let status = result["status"] as? String // if status == "OK"{ // if let predictions = result["predictions"] as? NSArray{ // var locations = [String]() // for dict in predictions as! [NSDictionary]{ // locations.append(dict["description"] as! String) // } // self.autocompleteTextfield.autoCompleteStrings = locations // } // } // else{ // self.autocompleteTextfield.autoCompleteStrings = nil // } // } // } // } // // func connection(connection: NSURLConnection, didFailWithError error: NSError) { // println("Error: \(error.localizedDescription)") // } // // //MARK: Map Utilities // private func addAnnotation(coordinate:CLLocationCoordinate2D, address:String?){ // if selectedPointAnnotation != nil{ // mapView.removeAnnotation(selectedPointAnnotation) // } // // selectedPointAnnotation = MKPointAnnotation() // selectedPointAnnotation?.coordinate = coordinate // selectedPointAnnotation?.title = address // mapView.addAnnotation(selectedPointAnnotation) // } // // override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // if (segue.identifier == "toPostDisplayWithInfo") { // var svc = segue.destinationViewController as! PostDisplayViewController; // svc.pfgeopoint = coordinateToPostDisplay // svc.locationLabelFromPostDisplay = autocompleteTextfield.text // svc.annotation = anno // self.dismissViewControllerAnimated(true, completion: nil) // } else if (segue.identifier == "unwindToPostDisplayFromEditLoc"){ // var svc = segue.destinationViewController as! PostDisplayViewController; // svc.annotation = anno // self.dismissViewControllerAnimated(true, completion: nil) // } // // } //} //
[ -1 ]
dbf6e59cf04f819f35a25ce3b1a2725da6785501
00d951fc44923131291c839b34639ba20eb9fbfa
/Pods/ZLPhotoBrowser/Sources/Extensions/UIImage+ZLPhotoBrowser.swift
5320a6e42b51c5ad1b4e1d9598e7fdf84654f5b5
[ "MIT" ]
permissive
acBool/FakeWeChat
046770ad3ca193fc169c7f582561c773531a76b1
0b61670f83aa94db53a4861978f8e971765bfec6
refs/heads/master
2023-08-15T14:10:33.777894
2021-09-30T02:46:49
2021-09-30T02:46:49
405,268,646
1
0
MIT
2021-09-30T02:46:50
2021-09-11T03:01:00
Swift
UTF-8
Swift
false
false
16,765
swift
// // UIImage+ZLPhotoBrowser.swift // ZLPhotoBrowser // // Created by long on 2020/8/22. // // Copyright (c) 2020 Long Zhang <[email protected]> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import UIKit import Accelerate /// https://github.com/kiritmodi2702/GIF-Swift // MARK: data 转 gif image extension UIImage { class func zl_animateGifImage(data: Data) -> UIImage? { guard let source = CGImageSourceCreateWithData(data as CFData, nil) else { return nil } let count = CGImageSourceGetCount(source) let animateImage: UIImage? if count <= 1 { animateImage = UIImage(data: data) } else { // var images: [UIImage] = [] // var duration: Double = 0 // // for i in 0..<count { // if let image = CGImageSourceCreateImageAtIndex(source, i, nil) { // images.append(UIImage(cgImage: image, scale: UIScreen.main.scale, orientation: .up)) // } // duration += UIImage.zl_delayForImageAtIndex(i, source: source) // } // if duration == 0 { // duration = (1.0 / 10.0) * Double(count) // } // animateImage = UIImage.animatedImage(with: images, duration: duration) var images = [CGImage]() var delays = [Int]() for i in 0..<count { if let image = CGImageSourceCreateImageAtIndex(source, i, nil) { images.append(image) } let delaySeconds = UIImage.zl_delayForImageAtIndex(Int(i), source: source) delays.append(Int(delaySeconds * 1000.0)) // Seconds to ms } let duration: Int = { var sum = 0 for val: Int in delays { sum += val } return sum }() let gcd = zl_gcdForArray(delays) var frames = [UIImage]() var frame: UIImage var frameCount: Int for i in 0..<count { frame = UIImage(cgImage: images[Int(i)]) frameCount = Int(delays[Int(i)] / gcd) for _ in 0..<frameCount { frames.append(frame) } } animateImage = UIImage.animatedImage(with: frames, duration: Double(duration) / 1000.0) } return animateImage } class func zl_delayForImageAtIndex(_ index: Int, source: CGImageSource!) -> Double { var delay = 0.1 let cfProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil) let gifProperties: CFDictionary? = unsafeBitCast( CFDictionaryGetValue(cfProperties, Unmanaged.passUnretained(kCGImagePropertyGIFDictionary).toOpaque()), to: CFDictionary.self) guard let _ = gifProperties else { return 0.1 } var delayObject: AnyObject = unsafeBitCast( CFDictionaryGetValue(gifProperties!, Unmanaged.passUnretained(kCGImagePropertyGIFUnclampedDelayTime).toOpaque()), to: AnyObject.self) if delayObject.doubleValue == 0 { delayObject = unsafeBitCast(CFDictionaryGetValue(gifProperties, Unmanaged.passUnretained(kCGImagePropertyGIFDelayTime).toOpaque()), to: AnyObject.self) } delay = delayObject as! Double if delay < 0.011 { delay = 0.1 } return delay } class func zl_gcdForArray(_ array: Array<Int>) -> Int { if array.isEmpty { return 1 } var gcd = array[0] for val in array { gcd = UIImage.zl_gcdForPair(val, gcd) } return gcd } class func zl_gcdForPair(_ a1: Int?, _ b1: Int?) -> Int { var a = a1 var b = b1 if b == nil || a == nil { if b != nil { return b! } else if a != nil { return a! } else { return 0 } } if a! < b! { let c = a a = b b = c } var rest: Int while true { rest = a! % b! if rest == 0 { return b! } else { a = b b = rest } } } } extension UIImage { // 修复转向 func fixOrientation() -> UIImage { if self.imageOrientation == .up { return self } var transform = CGAffineTransform.identity switch self.imageOrientation { case .down, .downMirrored: transform = CGAffineTransform(translationX: self.size.width, y: self.size.height) transform = transform.rotated(by: .pi) case .left, .leftMirrored: transform = CGAffineTransform(translationX: self.size.width, y: 0) transform = transform.rotated(by: CGFloat.pi / 2) case .right, .rightMirrored: transform = CGAffineTransform(translationX: 0, y: self.size.height) transform = transform.rotated(by: -CGFloat.pi / 2) default: break } switch self.imageOrientation { case .upMirrored, .downMirrored: transform = transform.translatedBy(x: self.size.width, y: 0) transform = transform.scaledBy(x: -1, y: 1) case .leftMirrored, .rightMirrored: transform = transform.translatedBy(x: self.size.height, y: 0) transform = transform.scaledBy(x: -1, y: 1) default: break } guard let ci = self.cgImage, let colorSpace = ci.colorSpace else { return self } let context = CGContext(data: nil, width: Int(self.size.width), height: Int(self.size.height), bitsPerComponent: ci.bitsPerComponent, bytesPerRow: 0, space: colorSpace, bitmapInfo: ci.bitmapInfo.rawValue) context?.concatenate(transform) switch self.imageOrientation { case .left, .leftMirrored, .right, .rightMirrored: context?.draw(ci, in: CGRect(x: 0, y: 0, width: self.size.height, height: self.size.width)) default: context?.draw(ci, in: CGRect(x: 0, y: 0, width: self.size.width, height: self.size.height)) } guard let newCgimg = context?.makeImage() else { return self } return UIImage(cgImage: newCgimg) } // 旋转方向 func rotate(orientation: UIImage.Orientation) -> UIImage { guard let imagRef = self.cgImage else { return self } let rect = CGRect(origin: .zero, size: CGSize(width: CGFloat(imagRef.width), height: CGFloat(imagRef.height))) var bnds = rect var transform = CGAffineTransform.identity switch orientation { case .up: return self case .upMirrored: transform = transform.translatedBy(x: rect.width, y: 0) transform = transform.scaledBy(x: -1, y: 1) case .down: transform = transform.translatedBy(x: rect.width, y: rect.height) transform = transform.rotated(by: .pi) case .downMirrored: transform = transform.translatedBy(x: 0, y: rect.height) transform = transform.scaledBy(x: 1, y: -1) case .left: bnds = swapRectWidthAndHeight(bnds) transform = transform.translatedBy(x: 0, y: rect.width) transform = transform.rotated(by: CGFloat.pi * 3 / 2) case .leftMirrored: bnds = swapRectWidthAndHeight(bnds) transform = transform.translatedBy(x: rect.height, y: rect.width) transform = transform.scaledBy(x: -1, y: 1) transform = transform.rotated(by: CGFloat.pi * 3 / 2) case .right: bnds = swapRectWidthAndHeight(bnds) transform = transform.translatedBy(x: rect.height, y: 0) transform = transform.rotated(by: CGFloat.pi / 2) case .rightMirrored: bnds = swapRectWidthAndHeight(bnds) transform = transform.scaledBy(x: -1, y: 1) transform = transform.rotated(by: CGFloat.pi / 2) @unknown default: return self } UIGraphicsBeginImageContext(bnds.size) let context = UIGraphicsGetCurrentContext() switch orientation { case .left, .leftMirrored, .right, .rightMirrored: context?.scaleBy(x: -1, y: 1) context?.translateBy(x: -rect.height, y: 0) default: context?.scaleBy(x: 1, y: -1) context?.translateBy(x: 0, y: -rect.height) } context?.concatenate(transform) context?.draw(imagRef, in: rect) let newImage = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return newImage ?? self } func swapRectWidthAndHeight(_ rect: CGRect) -> CGRect { var r = rect r.size.width = rect.height r.size.height = rect.width return r } func rotate(degress: CGFloat) -> UIImage { guard let cgImg = self.cgImage else { return self } let rotatedViewBox = UIView(frame: CGRect(x: 0, y: 0, width: self.size.width, height: self.size.height)) let t = CGAffineTransform(rotationAngle: degress) rotatedViewBox.transform = t let rotatedSize = rotatedViewBox.frame.size UIGraphicsBeginImageContext(rotatedSize) let bitmap = UIGraphicsGetCurrentContext() bitmap?.translateBy(x: rotatedSize.width / 2, y: rotatedSize.height / 2) bitmap?.rotate(by: degress) bitmap?.scaleBy(x: 1.0, y: -1.0) bitmap?.draw(cgImg, in: CGRect(x: -self.size.width/2, y: -self.size.height/2, width: self.size.width, height: self.size.height)) let newImage = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return newImage ?? self } // 加马赛克 func mosaicImage() -> UIImage? { guard let currCgImage = self.cgImage else { return nil } let currCiImage = CIImage(cgImage: currCgImage) let filter = CIFilter(name: "CIPixellate") filter?.setValue(currCiImage, forKey: kCIInputImageKey) filter?.setValue(20, forKey: kCIInputScaleKey) guard let outputImage = filter?.outputImage else { return nil } let context = CIContext() if let cgImg = context.createCGImage(outputImage, from: CGRect(origin: .zero, size: self.size)) { return UIImage(cgImage: cgImg) } else { return nil } } func resize(_ size: CGSize) -> UIImage? { if size.width <= 0 || size.height <= 0 { return nil } UIGraphicsBeginImageContextWithOptions(size, false, self.scale) self.draw(in: CGRect(origin: .zero, size: size)) let temp = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return temp } /// Processing speed is better than resize(:) method func resize_vI(_ size: CGSize) -> UIImage? { guard let cgImage = self.cgImage else { return nil } var format = vImage_CGImageFormat(bitsPerComponent: 8, bitsPerPixel: 32, colorSpace: nil, bitmapInfo: CGBitmapInfo(rawValue: CGImageAlphaInfo.first.rawValue), version: 0, decode: nil, renderingIntent: .defaultIntent) var sourceBuffer = vImage_Buffer() defer { if #available(iOS 13.0, *) { sourceBuffer.free() } else { sourceBuffer.data.deallocate() } } var error = vImageBuffer_InitWithCGImage(&sourceBuffer, &format, nil, cgImage, numericCast(kvImageNoFlags)) guard error == kvImageNoError else { return nil } let destWidth = Int(size.width) let destHeight = Int(size.height) let bytesPerPixel = cgImage.bitsPerPixel / 8 let destBytesPerRow = destWidth * bytesPerPixel let destData = UnsafeMutablePointer<UInt8>.allocate(capacity: destHeight * destBytesPerRow) defer { destData.deallocate() } var destBuffer = vImage_Buffer(data: destData, height: vImagePixelCount(destHeight), width: vImagePixelCount(destWidth), rowBytes: destBytesPerRow) // scale the image error = vImageScale_ARGB8888(&sourceBuffer, &destBuffer, nil, numericCast(kvImageHighQualityResampling)) guard error == kvImageNoError else { return nil } // create a CGImage from vImage_Buffer guard let destCGImage = vImageCreateCGImageFromBuffer(&destBuffer, &format, nil, nil, numericCast(kvImageNoFlags), &error)?.takeRetainedValue() else { return nil } guard error == kvImageNoError else { return nil } // create a UIImage return UIImage(cgImage: destCGImage, scale: self.scale, orientation: self.imageOrientation) } func toCIImage() -> CIImage? { var ci = self.ciImage if ci == nil, let cg = self.cgImage { ci = CIImage(cgImage: cg) } return ci } func clipImage(_ angle: CGFloat, _ editRect: CGRect) -> UIImage? { let a = ((Int(angle) % 360) - 360) % 360 var newImage = self if a == -90 { newImage = self.rotate(orientation: .left) } else if a == -180 { newImage = self.rotate(orientation: .down) } else if a == -270 { newImage = self.rotate(orientation: .right) } guard editRect.size != newImage.size else { return newImage } let origin = CGPoint(x: -editRect.minX, y: -editRect.minY) UIGraphicsBeginImageContextWithOptions(editRect.size, false, newImage.scale) newImage.draw(at: origin) let temp = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() guard let cgi = temp?.cgImage else { return temp } let clipImage = UIImage(cgImage: cgi, scale: newImage.scale, orientation: .up) return clipImage } func blurImage(level: CGFloat) -> UIImage? { guard let ciImage = self.toCIImage() else { return nil } let blurFilter = CIFilter(name: "CIGaussianBlur") blurFilter?.setValue(ciImage, forKey: "inputImage") blurFilter?.setValue(level, forKey: "inputRadius") guard let outputImage = blurFilter?.outputImage else { return nil } let context = CIContext() guard let cgImage = context.createCGImage(outputImage, from: ciImage.extent) else { return nil } return UIImage(cgImage: cgImage) } } extension CIImage { func toUIImage() -> UIImage? { let context = CIContext() guard let cgImage = context.createCGImage(self, from: self.extent) else { return nil } return UIImage(cgImage: cgImage) } }
[ -1 ]
e224e14223504c420591aac19b73c8cdff9a8d23
523ac047256b5346e610bff8070eda44912d5121
/Sources/SharkWeb/httpd/Proc.swift
3a5151a97471352d31b7f43d0931ebfc42102a8d
[]
no_license
editfmah/SharkWeb
72b87e8f4cb4bcd712ab232fdd03a73c6f11b490
d83a4e23180f3ce8f1bb29b15e39cc53d997cc3f
refs/heads/main
2023-07-16T02:46:01.571263
2021-09-03T10:39:57
2021-09-03T10:39:57
391,257,743
0
0
null
null
null
null
UTF-8
Swift
false
false
986
swift
// // Process // Swifter // // Copyright (c) 2014-2016 Damian Kołakowski. All rights reserved. // import Foundation public class Proc { public static var pid: Int { return Int(getpid()) } public static var tid: UInt64 { #if os(Linux) return UInt64(pthread_self()) #else var tid: __uint64_t = 0 pthread_threadid_np(nil, &tid) return UInt64(tid) #endif } private static var signalsWatchers = [(Int32) -> Void]() private static var signalsObserved = false public static func watchSignals(_ callback: @escaping (Int32) -> Void) { if !signalsObserved { [SIGTERM, SIGHUP, SIGSTOP, SIGINT].forEach { item in signal(item) { signum in Proc.signalsWatchers.forEach { $0(signum) } } } signalsObserved = true } signalsWatchers.append(callback) } }
[ 27968 ]
70327549070e8e98b2849ffa4c2d8e4b394ba9ba
86092baabec8175e483d8c3b1d5060427f96558c
/WikiGOT/WikiGOT/Domain/Season.swift
89a2d64dc01a4f32dd0f2abe6cdcb8dcc0bd5d61
[]
no_license
nasli/Westeros
42efbddf7035bca44704caa0a4ea38f51abb140f
d8d278fce8d0afa37ccd20b2bf0ba9c15c58ef07
refs/heads/master
2020-03-30T08:16:24.017802
2018-09-30T21:59:37
2018-10-01T04:05:23
151,002,579
0
0
null
null
null
null
UTF-8
Swift
false
false
1,663
swift
// // Season.swift // WikiGOT // // Created by Noelia Alvarez on 28/09/2018. // Copyright © 2018 Noelia Alvarez. All rights reserved. // import Foundation typealias Episodes = Set<Episode> final class Season { // MARK: - Properties let name: String let firstAiredDate: Date private var _episodes: Episodes var sortedEpisodes: [Episode] { return _episodes.sorted() } // MARK: - Initialization init(name: String, firstAiredDate: Date) { self.name = name self.firstAiredDate = firstAiredDate self._episodes = Episodes() } } extension Season { var count: Int { return _episodes.count } func add(episode: Episode) { _episodes.insert(episode) } func add(episodes: Episode...) { episodes.forEach { add(episode: $0) } } } extension Season: CustomStringConvertible { var description: String { return "\(name), First Aired date: \(firstAiredDate.toString())" } } extension Season { var proxyForEquality: String { return "\(name)\(firstAiredDate.toString(style: .short))\(self.count)" } var proxyForComparison: Date { return firstAiredDate } } extension Season: Equatable { static func ==(lhs:Season, rhs:Season) -> Bool { return lhs.proxyForEquality == rhs.proxyForEquality } } extension Season: Hashable { var hashValue: Int { return proxyForEquality.hashValue } } extension Season: Comparable { static func <(lhs: Season, rhs:Season) -> Bool { // Alphabetic order return (lhs.proxyForComparison < rhs.proxyForComparison) } }
[ -1 ]
a43623774fd6509cb59ce371b0ef497a48828f40
d71c509e18834d4545d613823f28f6b5a7651be8
/projects/ios/Sample/Sample/Extensions/FadeViewExtension.swift
2e5ff649ea0b95c3b7b6d3242ba8d9d42714e046
[ "MIT" ]
permissive
ezored/ezored
4cb75ecddccef0cf2576edc28912f96878b09d70
c6fd66f06c0f9a5694160f76d254a318fa7d1762
refs/heads/main
2022-07-12T05:07:52.897937
2022-07-01T08:29:30
2022-07-01T08:29:30
175,111,647
124
21
MIT
2022-07-01T08:29:31
2019-03-12T01:28:12
C++
UTF-8
Swift
false
false
611
swift
import Foundation import UIKit public extension UIView { /** Fade in a view with a duration - parameter duration: custom animation duration */ func fadeIn(withDuration duration: TimeInterval = 1.0) { UIView.animate(withDuration: duration, animations: { self.alpha = 1.0 }) } /** Fade out a view with a duration - parameter duration: custom animation duration */ func fadeOut(withDuration duration: TimeInterval = 1.0) { UIView.animate(withDuration: duration, animations: { self.alpha = 0.0 }) } }
[ -1 ]
3782fad198ab2ea8b168470d14f6cb76ace53ebf
f730b6d546d0a16a7b90a3585d1aee4a216ed653
/PHDemo/PHDemo/AppDelegate.swift
993afbe9cd8dbb85bb9dea268ff4213fe17669fd
[ "MIT" ]
permissive
xaoxuu/ProHUD
28f63c2328063958b8714dffcdc32796f8063041
17b46e7ed9e5955cf3aaaef985a931cdea246280
refs/heads/main
2023-08-31T17:14:30.284521
2023-08-29T06:03:32
2023-08-29T06:03:32
198,419,857
91
7
null
null
null
null
UTF-8
Swift
false
false
1,339
swift
// // AppDelegate.swift // PHDemo // // Created by xaoxuu on 2022/8/29. // import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 213048, 385081, 376889, 393275, 376905, 327756, 254030, 368727, 180313, 368735, 180320, 376931, 368752, 417924, 262283, 377012, 164028, 327871, 180416, 377036, 377046, 418007, 418010, 377060, 327914, 205036, 393456, 393460, 418043, 336123, 385280, 336128, 262404, 164106, 180490, 368911, 262416, 262422, 377117, 262436, 336180, 262454, 393538, 262472, 344403, 213332, 65880, 262496, 418144, 262499, 213352, 246123, 262507, 262510, 213372, 385419, 393612, 262550, 262552, 385440, 385443, 262566, 385451, 262573, 393647, 385458, 262586, 344511, 262592, 360916, 369118, 328177, 328179, 328182, 328189, 328192, 164361, 410128, 393747, 254490, 188958, 385570, 33316, 377383, 197159, 352821, 197177, 418363, 188987, 369223, 385609, 385616, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 148105, 377484, 352918, 98968, 344744, 361129, 336555, 385713, 434867, 164534, 336567, 328378, 164538, 328386, 344776, 352968, 352971, 418507, 352973, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 344835, 336643, 344841, 361230, 336659, 418580, 418585, 434970, 369435, 418589, 262942, 418593, 336675, 328484, 418598, 418605, 336696, 361273, 328515, 336708, 328519, 361288, 336711, 328522, 336714, 426841, 197468, 254812, 361309, 361315, 361322, 328573, 377729, 369542, 361360, 222128, 345035, 386003, 345043, 386011, 386018, 386022, 435187, 328714, 361489, 386069, 386073, 336921, 336925, 345118, 377887, 345133, 345138, 386101, 361536, 197707, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 361598, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 345267, 386258, 328924, 66782, 222437, 386285, 328941, 386291, 345376, 353570, 345379, 410917, 345382, 337205, 345399, 378169, 369978, 337222, 337229, 337234, 263508, 402791, 345448, 271730, 378227, 271745, 181638, 353673, 181643, 181654, 230809, 181673, 181681, 337329, 181684, 361917, 181696, 337349, 271839, 329191, 361960, 116210, 337398, 329226, 419339, 419343, 419349, 419355, 370205, 419359, 394786, 419362, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 419410, 394853, 345701, 222830, 370297, 403070, 353919, 403075, 345736, 198280, 403091, 345749, 419483, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 419512, 337592, 419517, 337599, 419527, 419530, 419535, 272081, 394966, 419542, 419544, 181977, 345818, 419547, 419550, 419559, 337642, 419563, 337645, 370415, 141051, 337659, 337668, 362247, 395021, 362255, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 345930, 370509, 354130, 247637, 337750, 370519, 313180, 354142, 354150, 354156, 345964, 345967, 345970, 345974, 403320, 354172, 247691, 337808, 247700, 329623, 436126, 436132, 337833, 362413, 337844, 346057, 346063, 247759, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329832, 329855, 329885, 411805, 346272, 362660, 100524, 387249, 379066, 387260, 256191, 395466, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 346343, 338152, 387306, 387312, 346355, 436473, 379134, 411903, 411916, 379152, 395538, 387349, 338199, 387352, 182558, 395566, 248111, 362822, 436555, 190796, 379233, 354673, 248186, 420236, 379278, 272786, 354727, 338352, 338381, 330189, 338386, 256472, 338403, 338409, 248308, 199164, 330252, 199186, 420376, 330267, 354855, 10828, 199249, 346721, 174695, 248425, 191084, 338543, 191092, 346742, 330383, 354974, 150183, 174774, 248504, 174777, 223934, 355024, 273108, 355028, 264918, 183005, 256734, 436962, 338660, 338664, 264941, 363251, 207619, 264964, 338700, 256786, 199452, 363293, 396066, 346916, 396069, 215853, 355122, 355131, 355140, 355143, 338763, 355150, 330580, 355166, 265055, 265058, 355175, 387944, 355179, 330610, 355218, 330642, 412599, 207808, 379848, 396245, 248792, 248798, 347105, 257008, 183282, 265207, 330748, 265214, 330760, 330768, 248862, 347176, 158761, 396328, 199728, 396336, 330800, 396339, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 412764, 339036, 257120, 265320, 248951, 420984, 330889, 347287, 248985, 339097, 44197, 380070, 339112, 249014, 126144, 330958, 330965, 265432, 265436, 388319, 388347, 175375, 159005, 175396, 208166, 273708, 347437, 372015, 347441, 372018, 199988, 44342, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 175450, 437595, 175457, 208227, 175460, 175463, 265580, 437620, 175477, 249208, 175483, 249214, 175486, 175489, 249218, 249227, 175513, 175516, 396705, 175522, 355748, 380332, 396722, 208311, 388542, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 339420, 249308, 339424, 339428, 339434, 249328, 69113, 372228, 208398, 380432, 175635, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 372353, 224897, 216707, 421508, 126596, 224904, 224909, 11918, 159374, 224913, 126610, 224916, 224919, 126616, 208538, 224922, 224926, 224929, 224932, 257704, 224936, 224942, 257712, 224947, 257716, 257720, 224953, 257724, 224959, 257732, 224965, 224969, 339662, 224975, 257747, 224981, 224986, 257761, 224993, 257764, 224999, 339695, 225012, 257787, 225020, 257790, 339710, 225025, 257794, 339721, 257801, 257804, 225038, 257807, 225043, 372499, 167700, 225048, 257819, 225053, 225058, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 225079, 397112, 225082, 397115, 225087, 225092, 225096, 323402, 257868, 225103, 257871, 397139, 225108, 225112, 257883, 257886, 225119, 257890, 339814, 225127, 274280, 257896, 257901, 225137, 339826, 257908, 225141, 257912, 225148, 257916, 257920, 225155, 339844, 225165, 397200, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 372738, 405533, 430129, 266294, 266297, 421960, 356439, 421990, 266350, 356466, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 225444, 438436, 225447, 225450, 258222, 225455, 225458, 225461, 225466, 389307, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 225493, 266453, 225496, 225499, 225502, 225505, 356578, 225510, 217318, 225514, 225518, 372976, 381176, 389380, 61722, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 225597, 332097, 201028, 348488, 332106, 332117, 348502, 250199, 332125, 250210, 332152, 389502, 250238, 332161, 356740, 332172, 373145, 340379, 389550, 324030, 266687, 160234, 127471, 340472, 381436, 324094, 266754, 324099, 324102, 324111, 340500, 324117, 324131, 332324, 381481, 356907, 324139, 324142, 356916, 324149, 324155, 348733, 324164, 348743, 381512, 324170, 324173, 324176, 389723, 332380, 373343, 381545, 340627, 373398, 184982, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 373449, 357069, 332493, 357073, 332511, 332520, 340718, 332533, 348924, 373510, 389926, 348978, 152370, 340789, 348982, 398139, 127814, 357201, 357206, 389978, 430939, 357211, 357214, 201579, 201582, 349040, 340849, 430965, 381813, 324472, 398201, 119674, 324475, 430972, 340858, 340861, 324478, 324481, 373634, 398211, 324484, 324487, 381833, 324492, 324495, 324498, 430995, 324501, 324510, 422816, 324513, 398245, 201637, 324524, 340909, 324533, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 209895, 201711, 349172, 381946, 349180, 439294, 431106, 209943, 357410, 250914, 185380, 357418, 209965, 209971, 209975, 209979, 209987, 209990, 209995, 341071, 349267, 250967, 210010, 341091, 210025, 210030, 210036, 210039, 349308, 210044, 349311, 160895, 152703, 210052, 210055, 349319, 218247, 210067, 210077, 210080, 251044, 210084, 185511, 210095, 210098, 210107, 210115, 332997, 210127, 333009, 210131, 333014, 210138, 210143, 218354, 218360, 251128, 275712, 275715, 275721, 349459, 333078, 251160, 349484, 349491, 251189, 415033, 251210, 357708, 210260, 365911, 259421, 365921, 333154, 333162, 234866, 390516, 333175, 357755, 251271, 374160, 112020, 349590, 357792, 259515, 415166, 415185, 366034, 366038, 415191, 415193, 415196, 415199, 423392, 333284, 415207, 366056, 366061, 415216, 210420, 415224, 423423, 415257, 415263, 366117, 415270, 144939, 415278, 415281, 415285, 210487, 415290, 415293, 349761, 415300, 333386, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 267909, 153227, 333498, 210631, 333511, 259788, 358099, 153302, 333534, 366307, 366311, 431851, 366318, 210672, 366321, 366325, 210695, 268041, 210698, 366348, 210706, 399128, 333594, 210719, 358191, 366387, 210739, 399159, 358200, 325440, 366401, 341829, 325446, 46920, 341834, 341838, 341843, 415573, 341851, 350045, 399199, 259938, 399206, 358255, 268143, 399215, 358259, 341876, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 358371, 350189, 350193, 350202, 333818, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350240, 350244, 350248, 178218, 350251, 350256, 350259, 350271, 243781, 350285, 374864, 342111, 342133, 374902, 432271, 333997, 334011, 260289, 260298, 350410, 350416, 350422, 211160, 350425, 268507, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 350467, 325891, 350475, 375053, 268559, 350480, 432405, 350486, 325914, 350490, 325917, 350493, 325919, 350498, 194852, 350504, 358700, 391468, 350509, 358704, 358713, 358716, 383306, 383321, 383330, 383333, 391530, 383341, 334203, 268668, 194941, 391563, 366990, 416157, 268701, 342430, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 195039, 334304, 334311, 375277, 334321, 350723, 186897, 342545, 334358, 342550, 342554, 334363, 358941, 350761, 252461, 334384, 358961, 383536, 334394, 252482, 219718, 334407, 334420, 350822, 375400, 334465, 334468, 162445, 326290, 342679, 342683, 260766, 342710, 244409, 260797, 260801, 350917, 154317, 391894, 154328, 416473, 64230, 113388, 342766, 375535, 203506, 342776, 391937, 391948, 375568, 326416, 375571, 375574, 162591, 326441, 383793, 326451, 326454, 260924, 375612, 244540, 326460, 326467, 244551, 326473, 326477, 416597, 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, 359366, 326598, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 261147, 359451, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 367723, 384107, 187502, 343154, 384114, 212094, 351364, 384135, 384139, 384143, 351381, 384160, 384168, 367794, 384181, 367800, 351423, 384191, 384198, 326855, 244937, 253130, 343244, 146642, 359649, 343270, 351466, 351479, 384249, 343306, 261389, 359694, 384269, 253200, 261393, 384275, 245020, 245029, 171302, 351534, 376110, 245040, 384314, 425276, 212291, 384323, 343365, 212303, 367965, 343393, 343398, 367980, 425328, 343409, 253303, 154999, 343417, 327034, 245127, 384397, 245136, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327110, 327115, 327117, 359886, 359890, 343507, 368092, 343534, 343539, 368119, 343544, 368122, 409091, 359947, 359955, 359983, 343630, 179802, 155239, 327275, 245357, 138864, 155254, 155273, 368288, 245409, 425638, 425649, 155322, 425662, 155327, 155351, 155354, 212699, 155363, 245475, 155371, 245483, 409335, 155393, 155403, 155422, 360223, 155438, 155442, 155447, 417595, 360261, 155461, 376663, 155482, 261981, 425822, 376671, 155487, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 147317, 262005, 425845, 262008, 262011, 155516, 155521, 155525, 360326, 376714, 155531, 262027, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 393169, 384977, 155611, 155619, 253923, 155621, 253926, 327654, 204784, 393203, 360438, 253943, 393206, 393212, 155646 ]
fc82445e821ce08a3232593528641096f155d7ee
b6146ebcbd3431f38b56ecc15a80a1a7afd5f7a9
/Magazine/ViewController.swift
b9c2094d5ae07a49321090256a40cb2c81a69ac2
[]
no_license
hellorichardpham/iOS
e667ac504b6f627508e3320e1ac7fa5aabc934ca
d392316b2fcb04d57b73c19f967fcfec39002667
refs/heads/master
2021-01-17T08:32:09.527235
2016-08-03T18:10:42
2016-08-03T18:10:42
62,903,395
0
0
null
null
null
null
UTF-8
Swift
false
false
2,626
swift
// // ViewController.swift // MapTest // // Created by MBPro on 7/18/16. // Copyright © 2016 MBPro. All rights reserved. // import UIKit import MapKit import WebImage class ViewController: UIViewController { @IBOutlet weak var map: MKMapView! @IBOutlet weak var leftBottomButton: UIButton! var cityArray = [City]() override func viewDidLoad() { super.viewDidLoad() map.delegate = self let initialLocation = CLLocation(latitude: 12.9, longitude: 77.6) retrieveCityInformation() centerMapOnLocation(initialLocation) for i in 0...cityArray.count-1 { map.addAnnotation(cityArray[i]) } } func retrieveCityInformation() { let connectionString = "user=labs2025 password=engrRgr8 dbname=iOSDatabase port=5432 host=labs2025ios.clygqyctjtg6.us-west-2.rds.amazonaws.com" let connection = PQconnectdb(connectionString) if(PQstatus(connection) != CONNECTION_OK) { print("Error: Couldn't connect to the database") } var result = PQexec(connection, "begin") if(PQresultStatus(result) != PGRES_COMMAND_OK) { print("Begin command failed") } PQclear(result) result = PQexec(connection, "SELECT * FROM cities ORDER BY title") if(PQresultStatus(result) != PGRES_TUPLES_OK) { print("Couldn't fetch anything") } for i in 0...PQntuples(result)-1 { let title = String.fromCString(PQgetvalue(result, i, 0)) let latitude = String.fromCString(PQgetvalue(result, i, 1)) let longitude = String.fromCString(PQgetvalue(result, i, 2)) let country = String.fromCString(PQgetvalue(result, i, 3)) let image = String.fromCString(PQgetvalue(result, i, 4)) let information = String.fromCString(PQgetvalue(result, i, 5)) let imageFilePath = String.fromCString(PQgetvalue(result, i, 6)) let newCity = City(title: title!, coordinate: CLLocationCoordinate2DMake(Double(latitude!)!, Double(longitude!)!), country: country!, image: image!, information: information!, imageFilePath: imageFilePath!) cityArray.append(newCity) } } func centerMapOnLocation(location: CLLocation) { let regionRadius: CLLocationDistance = 5000000 let coordinateRegion = MKCoordinateRegionMakeWithDistance(location.coordinate, regionRadius * 2.0, regionRadius * 2.0) map.setRegion(coordinateRegion, animated:true) } }
[ -1 ]
e0bf7858cc322650a21ab95ed678aaeaea74edd4
7b120cbfd3ceb0f8a284ee917a93a9a294a20218
/swift/Animal.swift
a8345c09fe6cc16caa774a67d9ab0ef85db92919
[]
no_license
10alswhd/BlueHouseProject
e4779bf5c2d2b9bab3e83f642f538541aef51c38
c12b43624f7163322c310eda0c70c7479f340579
refs/heads/master
2020-04-15T05:47:35.156089
2016-12-13T15:01:02
2016-12-13T15:01:02
68,073,531
12
13
null
2022-07-17T07:01:45
2016-09-13T04:14:18
C
UTF-8
Swift
false
false
189
swift
class Animal { var name: String var age: Int var image: UIImage init(name: String, age: Int, image: UIImage) { self.name = name self.age = age self.image = image } }
[ -1 ]
7294b69611784360e7685c7d66b0aaae3179e55d
740f9f7fc72ff49aa4ca4fe46a101315cae114c2
/Touchdown/View/Home/FooterView.swift
6718cc3314f88cf619a3e048a714914caa45ea14
[]
no_license
sadikcoban/iOS-shopping-app
bc8fcf3d0629a59233d312f0e098c1d444795198
600af5cf61b202ffe7b253ae74eb236b6578125d
refs/heads/main
2023-07-29T06:39:32.435293
2021-09-08T18:02:41
2021-09-08T18:02:41
404,441,214
0
0
null
null
null
null
UTF-8
Swift
false
false
1,218
swift
// // FooterView.swift // FooterView // // Created by Sadık Çoban on 7.09.2021. // import SwiftUI struct FooterView: View { var body: some View { VStack(alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/, spacing: 10, content: { Text("We offer the most cutting edge, comfortable, lightweight and durable football helmets in the market at affordable prices.") .foregroundColor(.gray) .multilineTextAlignment(.center) .layoutPriority(2) Image("logo-lineal") .renderingMode(/*@START_MENU_TOKEN@*/.template/*@END_MENU_TOKEN@*/) .foregroundColor(.gray) .layoutPriority(0) Text("Copyright a Robert Petras\nAll right reserved") .font(.footnote) .bold() .foregroundColor(.gray) .multilineTextAlignment(.center) .layoutPriority(1) }) } } struct FooterView_Previews: PreviewProvider { static var previews: some View { FooterView() .previewLayout(.sizeThatFits) .background(colorBackground) } }
[ 358609, 358548, 358630 ]
8a4bae4254b43e95b7543230bc83b8013e3f50b6
d3d511f9d180ba3dceaab9273c77e95697715f36
/Meme 1.0 2/Meme 1.0/MemesCollectionViewCell.swift
b8bbe791574c3bb5e8b67541aeacb04ee7f1c767
[]
no_license
AzzaAj/MemeMe
f7771ce0fe6ddcf4d6a19429b677ca1b821424f9
458dc2526c01a0315ca307d061cd187db7b90381
refs/heads/master
2020-06-08T13:30:41.798868
2019-06-22T13:14:14
2019-06-22T13:14:14
193,234,931
0
0
null
null
null
null
UTF-8
Swift
false
false
272
swift
// // MemesCollectionViewCell.swift // Meme 1.0 // // Created by Azza on 5/7/19. // Copyright © 2019 Azza. All rights reserved. // import UIKit class MemesCollectionViewCell: UICollectionViewCell { @IBOutlet weak var sentMemeImage: UIImageView! }
[ -1 ]
06d7fa0126b926bc6db4e06c6fdc7c194583f376
1ca51285fa76876ba925f2a7fae852898ade8126
/SampleTapsyrApp/Managers/NetworkManager/CustomError.swift
48a395525d2e68e52d1e16788a7c4fb2ebd64343
[]
no_license
Abay99/TapsyrApp
abc935c034a0777143df7da04feb1d0bd42acab9
52c1e859a4f6703928d88979c5c17dc124486c6c
refs/heads/master
2021-04-04T09:46:42.342387
2020-03-20T08:36:06
2020-03-20T08:36:06
248,446,249
0
0
null
null
null
null
UTF-8
Swift
false
false
754
swift
// // CustomError.swift // SampleTapsyrApp // // Created by Abai Kalikov on 3/20/20. // Copyright © 2020 Abai Kalikov. All rights reserved. // import Foundation enum CustomError: Error { case informationalError case redirectionError case notFoundError case serverError case unknownError } extension CustomError: LocalizedError { var errorDescription: String? { switch self { case .informationalError: return "Informational error" case .redirectionError: return "Redirected" case .notFoundError: return "Not found" case .serverError: return "Internal server error" default: return "Unknown error" } } }
[ -1 ]
98617bb4855222059e1c24d67b64dad0de4bab06
54f62b66b7cbb6e5e8a275778a7cdb5a1ff11486
/PackageA/Sources/TargetA1/TargetA1.swift
2d72de171050f77b5fc0cef1893db80c3efb20cd
[]
no_license
YOCKOW/SwiftPMUncycledCycle
9eead7005f20dcf54a72fc2f1a5663af838ed1b2
af352f8a0ca2285acab70d6a87bceae323f7100a
refs/heads/master
2020-06-26T06:57:33.902302
2019-07-30T03:44:27
2019-07-30T03:44:27
199,565,297
0
0
null
null
null
null
UTF-8
Swift
false
false
77
swift
public struct TargetA1 { public var text = "TargetA1" public init() {} }
[ -1 ]
c8e3798ff32ade1114972c1527c9ad18d22f42c0
e48771340f6684ff27ad332013226864d69fea43
/WordScrambleSwiftUI/SceneDelegate.swift
4a16081840bdf1442f2d3087d871b97ac5a81853
[]
no_license
sagunraj/WordScrambleSwiftUI
be132a586e4dfc5a61ce97d4388c09522499c045
d09d11d6d6d3efde2f4914c7c583db3eaa743b06
refs/heads/master
2020-12-03T04:55:59.504552
2020-01-01T12:16:29
2020-01-01T12:16:29
231,210,650
0
0
null
null
null
null
UTF-8
Swift
false
false
2,774
swift
// // SceneDelegate.swift // WordScrambleSwiftUI // // Created by Sagun Raj Lage on 1/1/20. // Copyright © 2020 Sagun Raj Lage. All rights reserved. // import UIKit import SwiftUI class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Create the SwiftUI view that provides the window contents. let contentView = ContentView() // Use a UIHostingController as window root view controller. if let windowScene = scene as? UIWindowScene { let window = UIWindow(windowScene: windowScene) window.rootViewController = UIHostingController(rootView: contentView) self.window = window window.makeKeyAndVisible() } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 325633, 325637, 163849, 268299, 333838, 346140, 352294, 163892, 16444, 337980, 254020, 217158, 243782, 395340, 327757, 200786, 286804, 329816, 217180, 368736, 342113, 180322, 329833, 286833, 368753, 252021, 342134, 286845, 192640, 286851, 329868, 268435, 250008, 329886, 286880, 135328, 192674, 333989, 286889, 430257, 180418, 350411, 346317, 180432, 350417, 368854, 350423, 350426, 385243, 334047, 356580, 346344, 327915, 350449, 387314, 375027, 338161, 350454, 350459, 321787, 336124, 350462, 350465, 336129, 350469, 389381, 325895, 350477, 194829, 43279, 350481, 350487, 356631, 338201, 325915, 350491, 381212, 325918, 350494, 182559, 258333, 325920, 350500, 194854, 350505, 350510, 395567, 248112, 332081, 307507, 340276, 336181, 356662, 264502, 332091, 332098, 201030, 332107, 190797, 334162, 332118, 418135, 321880, 250201, 332126, 332130, 250211, 340328, 250217, 348523, 348528, 182642, 321911, 332153, 334204, 268669, 194942, 250239, 332158, 332162, 389507, 348548, 393613, 383375, 332175, 160152, 340380, 268702, 416159, 326059, 373169, 342453, 334263, 338363, 266688, 324032, 336326, 338387, 248279, 369119, 334306, 338404, 334312, 338411, 104940, 375279, 162289, 328178, 328180, 248309, 328183, 340473, 199165, 328190, 324095, 328193, 98819, 324100, 266757, 324103, 164362, 248332, 199182, 328207, 324112, 330254, 186898, 342546, 340501, 324118, 334359, 342551, 324122, 334364, 330268, 340512, 191012, 332325, 324134, 197160, 381483, 324141, 324143, 334386, 324156, 334397, 188990, 324161, 324165, 219719, 324171, 324174, 324177, 244309, 334425, 326240, 340580, 174696, 375401, 248427, 191085, 346736, 338544, 268922, 334466, 336517, 344710, 119432, 213642, 148106, 162446, 330384, 326291, 340628, 342685, 340639, 336549, 332455, 271018, 332460, 336556, 389806, 332464, 385714, 164535, 336568, 174775, 248505, 174778, 244410, 328379, 332473, 223936, 328387, 332484, 332487, 373450, 418508, 154318, 332494, 342737, 154329, 183006, 139998, 189154, 338661, 332521, 338665, 418540, 330479, 342769, 340724, 332534, 338680, 342777, 418555, 344832, 207620, 336644, 191240, 328462, 326417, 336660, 338712, 199455, 336676, 334633, 326444, 215854, 271154, 152371, 326452, 328498, 326455, 340792, 348983, 244542, 326463, 326468, 328516, 336709, 127815, 244552, 328520, 326474, 328523, 336712, 342857, 355151, 326479, 330581, 326486, 136024, 330585, 326494, 439138, 326503, 375657, 326508, 201580, 201583, 326511, 355185, 211826, 340850, 330612, 201589, 340859, 324476, 328574, 340863, 359296, 351105, 252801, 373635, 324482, 324488, 342921, 236432, 361361, 324496, 330643, 324502, 252823, 324511, 324514, 252838, 201638, 211885, 324525, 5040, 5047, 324539, 324542, 187335, 398280, 347082, 340940, 345046, 330711, 248794, 340958, 248799, 340964, 386023, 328690, 359411, 244728, 330750, 265215, 328703, 199681, 328710, 338951, 330761, 328715, 326669, 330769, 361490, 349203, 209944, 336922, 209948, 248863, 345119, 357411, 250915, 250917, 158759, 347178, 328747, 209966, 209969, 330803, 209973, 386102, 209976, 339002, 339010, 209988, 209991, 347208, 248905, 330827, 197708, 330830, 341072, 248915, 345172, 183384, 156762, 343132, 339037, 322660, 326764, 210028, 326767, 187503, 345200, 330869, 361591, 386168, 210042, 210045, 361599, 152704, 160896, 330886, 351366, 384136, 384140, 351382, 337048, 210072, 248986, 384152, 210078, 384158, 210081, 384161, 251045, 210085, 210089, 339118, 337072, 210096, 337076, 210100, 345268, 249015, 324792, 367801, 339133, 384189, 343232, 384192, 210116, 244934, 326858, 333003, 322763, 384202, 343246, 384209, 333010, 146644, 330966, 210139, 328925, 66783, 384225, 328933, 343272, 351467, 328942, 251123, 384247, 384250, 388348, 242947, 206084, 115973, 343307, 384270, 333075, 384276, 333079, 251161, 384284, 245021, 384290, 208167, 263464, 171304, 245032, 245042, 251190, 44343, 345400, 208189, 386366, 343366, 126279, 337224, 251211, 357710, 337230, 331089, 337235, 437588, 263509, 331094, 175458, 343394, 208228, 175461, 337252, 343399, 175464, 345449, 197987, 333164, 99692, 343410, 234867, 331124, 175478, 155000, 378232, 249210, 175484, 337278, 249215, 245121, 249219, 245128, 249225, 181644, 361869, 249228, 136591, 245137, 181650, 249235, 112021, 181655, 245143, 175514, 245146, 343453, 245149, 245152, 263585, 396706, 245155, 355749, 40358, 181671, 245158, 333222, 245163, 181679, 337330, 327090, 210357, 146878, 181697, 361922, 54724, 327108, 181704, 327112, 339401, 384457, 327116, 327118, 208338, 366035, 343509, 181717, 337366, 249310, 249313, 333285, 329195, 343540, 343545, 423424, 253445, 339464, 337416, 249355, 329227, 175637, 405017, 345626, 366118, 339504, 349748, 206397, 214594, 333387, 214611, 333400, 366173, 339553, 343650, 333415, 327276, 245358, 222831, 333423, 138865, 339572, 372354, 126597, 339593, 159375, 339602, 126611, 333472, 245410, 345763, 345766, 425639, 245415, 337588, 155323, 333499, 337601, 337607, 333512, 210632, 339664, 358100, 419543, 245463, 212700, 181982, 153311, 333535, 225000, 337643, 245487, 339696, 337647, 245495, 141052, 337661, 333566, 339711, 225027, 337671, 339722, 366349, 249617, 321300, 245528, 333593, 116512, 210720, 362274, 184096, 339748, 358192, 372533, 345916, 399166, 384831, 325441, 247618, 325447, 341831, 329545, 341835, 354124, 323404, 337743, 339795, 354132, 341844, 247639, 337751, 358235, 341852, 313181, 413539, 399208, 339818, 327532, 339827, 358260, 341877, 399222, 325494, 182136, 186233, 1914, 333690, 243584, 325505, 333699, 339845, 247692, 333709, 247701, 329625, 327590, 333737, 382898, 184245, 337845, 190393, 327613, 333767, 350153, 346059, 311244, 358348, 247760, 212945, 333777, 219094, 419810, 329699, 358372, 327655, 247790, 204785, 380919, 333819 ]
9f269a351bb0c441db145222cf59efe85dd9d42f
0c52da7ca0ccd5302cb7d10248e35ed1d715629d
/TTPChallenge/ChatScreenViewController.swift
01fd6d72f9706951c171700f8cb786d0defde935
[]
no_license
compilesandruns/TTPChallenge
32e85ebcf7bfead705b051a916d9e89a3bd4b39c
43e7d25810ac8e2981b6e44f7c43d36f77690490
refs/heads/master
2021-06-12T09:37:29.694574
2017-02-21T23:06:23
2017-02-21T23:06:23
null
0
0
null
null
null
null
UTF-8
Swift
false
false
14,867
swift
// // ChatScreenViewController.swift // TTPChallenge // // Created by Stephanie on 2/15/17. // Copyright © 2017 TeamMDC. All rights reserved. // import FirebaseStorage import Photos import JSQMessagesViewController import SwiftGifOrigin final class ChatViewController: JSQMessagesViewController { var messages = [JSQMessage]() private var photoMessageMap = [String: JSQPhotoMediaItem]() private let imageURLNotSetKey = "NOTSET" private lazy var messageRef: FIRDatabaseReference = self.channelRef!.child("messages") lazy var storageRef: FIRStorageReference = FIRStorage.storage().reference(forURL: "gs://ttpchallenge-d88a9.appspot.com") private var newMessageRefHandle: FIRDatabaseHandle? private var updatedMessageRefHandle: FIRDatabaseHandle? lazy var outgoingBubbleImageView: JSQMessagesBubbleImage = self.setupOutgoingBubble() lazy var incomingBubbleImageView: JSQMessagesBubbleImage = self.setupIncomingBubble() var channelRef: FIRDatabaseReference? var channel: Channel? { didSet { title = channel?.name } } private lazy var userIsTypingRef: FIRDatabaseReference = self.channelRef!.child("typingIndicator").child(self.senderId) private var localTyping = false var isTyping: Bool { get { return localTyping } set { localTyping = newValue userIsTypingRef.setValue(newValue) } } private lazy var usersTypingQuery: FIRDatabaseQuery = self.channelRef!.child("typingIndicator").queryOrderedByValue().queryEqual(toValue: true) override func viewDidLoad() { super.viewDidLoad() collectionView!.collectionViewLayout.incomingAvatarViewSize = CGSize.zero collectionView!.collectionViewLayout.outgoingAvatarViewSize = CGSize.zero navigationController?.navigationBar.tintColor = .black navigationController?.navigationBar.titleTextAttributes = [NSFontAttributeName: UIFont(name: "Helvetica Neue", size: 18)!, NSForegroundColorAttributeName: UIColor.black] inputToolbar.contentView.tintColor = .black inputToolbar.contentView.leftBarButtonItem.tintColor = .black observeMessages() self.senderId = FIRAuth.auth()?.currentUser?.uid } deinit { if let refHandle = newMessageRefHandle { messageRef.removeObserver(withHandle: refHandle) } if let refHandle = updatedMessageRefHandle { messageRef.removeObserver(withHandle: refHandle) } } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) observeTyping() } func didTapBackButton(sender: UIBarButtonItem) { if let navController = self.navigationController { navController.popViewController(animated: true) } } //MARK: Message UI private func setupOutgoingBubble() -> JSQMessagesBubbleImage { let bubbleImageFactory = JSQMessagesBubbleImageFactory() return bubbleImageFactory!.outgoingMessagesBubbleImage(with: Colors.ttpPurple) } private func setupIncomingBubble() -> JSQMessagesBubbleImage { let bubbleImageFactory = JSQMessagesBubbleImageFactory() return bubbleImageFactory!.incomingMessagesBubbleImage(with: UIColor.jsq_messageBubbleLightGray()) } //Sending messages override func didPressSend(_ button: UIButton!, withMessageText text: String!, senderId: String!, senderDisplayName: String!, date: Date!) { let itemRef = messageRef.childByAutoId() let messageItem = [ "senderId": senderId!, "senderName": senderDisplayName!, "text": text!, ] itemRef.setValue(messageItem) JSQSystemSoundPlayer.jsq_playMessageSentSound() finishSendingMessage() isTyping = false } private func addMessage(withId id: String, name: String, text: String) { if let message = JSQMessage(senderId: id, senderDisplayName: name, date: Date(), text: text) { messages.append(message) } } private func observeMessages() { messageRef = channelRef!.child("messages") let messageQuery = messageRef.queryLimited(toLast:25) newMessageRefHandle = messageQuery.observe(.childAdded, with: { (snapshot) -> Void in let messageData = snapshot.value as! Dictionary<String, String> if let id = messageData["senderId"] as String!, let name = messageData["senderName"] as String!, let text = messageData["text"] as String!, text.characters.count > 0 { self.addMessage(withId: id, name: name, text: text) self.finishReceivingMessage() } else if let id = messageData["senderId"] as String!, let photoURL = messageData["photoURL"] as String! { if let mediaItem = JSQPhotoMediaItem(maskAsOutgoing: id == self.senderId) { self.addPhotoMessage(withId: id, key: snapshot.key, mediaItem: mediaItem) if photoURL.hasPrefix("gs://") { self.fetchImageDataAtURL(photoURL, forMediaItem: mediaItem, clearsPhotoMessageMapOnSuccessForKey: nil) } } } else { print("Error! Could not decode message data") } }) updatedMessageRefHandle = messageRef.observe(.childChanged, with: { (snapshot) in let key = snapshot.key let messageData = snapshot.value as! Dictionary<String, String> if let photoURL = messageData["photoURL"] as String! { if let mediaItem = self.photoMessageMap[key] { self.fetchImageDataAtURL(photoURL, forMediaItem: mediaItem, clearsPhotoMessageMapOnSuccessForKey: key) } } }) } private func observeTyping() { let typingIndicatorRef = channelRef!.child("typingIndicator") userIsTypingRef = typingIndicatorRef.child(senderId) userIsTypingRef.onDisconnectRemoveValue() usersTypingQuery.observe(.value) { (data: FIRDataSnapshot) in if data.childrenCount == 1 && self.isTyping { return } self.showTypingIndicator = data.childrenCount > 0 self.scrollToBottom(animated: true) } } override func textViewDidChange(_ textView: UITextView) { super.textViewDidChange(textView) isTyping = textView.text != "" } //Sending photos override func didPressAccessoryButton(_ sender: UIButton) { let picker = UIImagePickerController() picker.delegate = self if (UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.camera)) { picker.sourceType = UIImagePickerControllerSourceType.camera } else { picker.sourceType = UIImagePickerControllerSourceType.photoLibrary } present(picker, animated: true, completion:nil) } private func addPhotoMessage(withId id: String, key: String, mediaItem: JSQPhotoMediaItem) { if let message = JSQMessage(senderId: id, displayName: "", media: mediaItem) { messages.append(message) if (mediaItem.image == nil) { photoMessageMap[key] = mediaItem } collectionView.reloadData() } } func sendPhotoMessage() -> String? { let itemRef = messageRef.childByAutoId() let messageItem = [ "photoURL": imageURLNotSetKey, "senderId": senderId!, ] itemRef.setValue(messageItem) JSQSystemSoundPlayer.jsq_playMessageSentSound() finishSendingMessage() return itemRef.key } func setImageURL(_ url: String, forPhotoMessageWithKey key: String) { let itemRef = messageRef.child(key) itemRef.updateChildValues(["photoURL": url]) } private func fetchImageDataAtURL(_ photoURL: String, forMediaItem mediaItem: JSQPhotoMediaItem, clearsPhotoMessageMapOnSuccessForKey key: String?) { let storageRef = FIRStorage.storage().reference(forURL: photoURL) storageRef.data(withMaxSize: INT64_MAX){ (data, error) in if let error = error { print("Error downloading image data: \(error)") return } storageRef.metadata(completion: { (metadata, metadataErr) in if let error = metadataErr { print("Error downloading metadata: \(error)") return } if (metadata?.contentType == "image/gif") { mediaItem.image = UIImage.gif(data:data!) } else { mediaItem.image = UIImage.init(data: data!) } self.collectionView.reloadData() guard key != nil else { return } self.photoMessageMap.removeValue(forKey: key!) }) } } } // MARK: Image Picker Delegate extension ChatViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate { func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { picker.dismiss(animated: true, completion:nil) if let photoReferenceUrl = info[UIImagePickerControllerReferenceURL] as? URL { let assets = PHAsset.fetchAssets(withALAssetURLs: [photoReferenceUrl], options: nil) let asset = assets.firstObject if let key = sendPhotoMessage() { asset?.requestContentEditingInput(with: nil, completionHandler: { (contentEditingInput, info) in let imageFileURL = contentEditingInput?.fullSizeImageURL let path = "\(FIRAuth.auth()?.currentUser?.uid)/\(Int(Date.timeIntervalSinceReferenceDate * 1000))/\(photoReferenceUrl.lastPathComponent)" self.storageRef.child(path).putFile(imageFileURL!, metadata: nil) { (metadata, error) in if let error = error { print("Error uploading photo: \(error.localizedDescription)") return } self.setImageURL(self.storageRef.child((metadata?.path)!).description, forPhotoMessageWithKey: key) } }) } } else { let image = info[UIImagePickerControllerOriginalImage] as! UIImage if let key = sendPhotoMessage() { let imageData = UIImageJPEGRepresentation(image, 1.0) let imagePath = FIRAuth.auth()!.currentUser!.uid + "/\(Int(Date.timeIntervalSinceReferenceDate * 1000)).jpg" let metadata = FIRStorageMetadata() metadata.contentType = "image/jpeg" storageRef.child(imagePath).put(imageData!, metadata: metadata) { (metadata, error) in if let error = error { print("Error uploading photo: \(error)") return } self.setImageURL(self.storageRef.child((metadata?.path)!).description, forPhotoMessageWithKey: key) } } } } func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { picker.dismiss(animated: true, completion:nil) } } //Collection view extension ChatViewController { override func collectionView(_ collectionView: JSQMessagesCollectionView!, messageDataForItemAt indexPath: IndexPath!) -> JSQMessageData! { return messages[indexPath.item] } override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return messages.count } override func collectionView(_ collectionView: JSQMessagesCollectionView!, messageBubbleImageDataForItemAt indexPath: IndexPath!) -> JSQMessageBubbleImageDataSource! { let message = messages[indexPath.item] if message.senderId == senderId { return outgoingBubbleImageView } else { return incomingBubbleImageView } } override func collectionView(_ collectionView: JSQMessagesCollectionView!, avatarImageDataForItemAt indexPath: IndexPath!) -> JSQMessageAvatarImageDataSource! { return nil } override func collectionView(_ collectionView: JSQMessagesCollectionView!, attributedTextForCellTopLabelAt indexPath: IndexPath!) -> NSAttributedString! { let message = messages[indexPath.item] guard let date = message.date else { return NSAttributedString(string: "") } return JSQMessagesTimestampFormatter.shared().attributedTimestamp(for: date) } override func collectionView(_ collectionView: JSQMessagesCollectionView!, attributedTextForMessageBubbleTopLabelAt indexPath: IndexPath!) -> NSAttributedString! { let message = messages[indexPath.item] guard let senderDisplayName = message.senderDisplayName else { return NSAttributedString(string: "Anonymous user") } return NSAttributedString(string: senderDisplayName) } override func collectionView(_ collectionView: JSQMessagesCollectionView!, layout collectionViewLayout: JSQMessagesCollectionViewFlowLayout!, heightForCellTopLabelAt indexPath: IndexPath!) -> CGFloat { return 20 } override func collectionView(_ collectionView: JSQMessagesCollectionView!, layout collectionViewLayout: JSQMessagesCollectionViewFlowLayout!, heightForMessageBubbleTopLabelAt indexPath: IndexPath!) -> CGFloat { return 20 } override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = super.collectionView(collectionView, cellForItemAt: indexPath) as! JSQMessagesCollectionViewCell let message = messages[indexPath.item] if message.senderId == senderId { cell.textView?.textColor = UIColor.white } else { cell.textView?.textColor = UIColor.black } return cell } }
[ -1 ]
bcaece06160f3b9787f738503d61a9885650b64e
516542a79ea25d10c8a244eb2530d6177a58cd05
/week4/game/game/game/GameViews.swift
33590523e95e9fbcfd9b2d13ed2b557eeff6ec70
[]
no_license
bluelocate/boostcamp_iOS_kwonbyungsoo
ee9d6ecf8015335094814de8f8a1659043b0527f
54dfae1b7dfef72496546edae0112d3a2418c11e
refs/heads/master
2020-12-03T03:49:21.794061
2017-08-03T12:24:13
2017-08-03T12:24:13
95,776,608
3
1
null
2017-08-03T12:24:22
2017-06-29T12:45:07
Swift
UTF-8
Swift
false
false
1,658
swift
// // GameViews.swift // game // // Created by byung-soo kwon on 2017. 7. 24.. // Copyright © 2017년 BlackStoneTeam. All rights reserved. // import UIKit import GameplayKit struct GameViews { let superView: UIView let width: CGFloat let height: CGFloat // 버튼 초기화하자 var boardButtons: [UIButton] = [] init(superView: UIView, width: CGFloat, height: CGFloat) { self.superView = superView self.width = width / 5 self.height = height / 5 var temporaryBoard: [UIButton] = [] print("view is created") let numberSet = [Int](1...25) guard let shuffleNumber = GKRandomSource.sharedRandom().arrayByShufflingObjects(in: numberSet) as? [Int] else { return } var index = 0 for i in 0 ... 4 { for j in 0 ... 4 { let gameButton = UIButton() gameButton.isUserInteractionEnabled = true gameButton.backgroundColor = UIColor.gray gameButton.frame = CGRect(x: CGFloat(i) * self.width + 5, y: CGFloat(j) * self.height, width: self.width-10, height: self.height-10) gameButton.setTitle("\(shuffleNumber[index])", for: .normal) gameButton.setTitleColor(UIColor.black, for: .highlighted) temporaryBoard.append(gameButton) index += 1 } } print("\(temporaryBoard.count)") boardButtons = temporaryBoard } }
[ -1 ]
f70526b4be45b1f21873ebbd1a293030d7ba8ac7
ae3a4cf76e3fd14b6eaf2c5c60dc0aceebcd9186
/Poketrader/Poketrader/Views/AddPokemonViewController.swift
0be069a3661d988dc74e74d6c06d2c55123bcc80
[]
no_license
PoketraderApp/poketrader
203cbd606e67162f08c2b99bc35335befc272f0b
ad9ef82bf055ea207935c95d4ef4f7936a84de91
refs/heads/main
2023-03-02T17:13:31.393548
2021-02-10T23:15:22
2021-02-10T23:15:22
309,030,618
0
0
null
2021-02-12T05:03:52
2020-11-01T05:33:21
Swift
UTF-8
Swift
false
false
7,943
swift
// // ViewController.swift // Poketrader // // Created by Paulo Vieira on 01/11/20. // import UIKit import Firebase import SCLAlertView class AddPokemonViewController: UIViewController, SelecionarPokemonVCDelegate, UITextViewDelegate { @IBOutlet weak var nvTextField: UITextField! @IBOutlet weak var hpTextField: UITextField! @IBOutlet weak var defTextField: UITextField! @IBOutlet weak var ataTextField: UITextField! @IBOutlet weak var velTextField: UITextField! @IBOutlet weak var ataSpTextField: UITextField! @IBOutlet weak var defSpTextField: UITextField! @IBOutlet weak var descriptionTextView: UITextView! @IBOutlet weak var gameTitleTextField: UITextField! @IBOutlet weak var pokemonImage: UIImageView! @IBOutlet weak var searchPokemon: UISearchBar! @IBOutlet weak var statusView: UIView! @IBOutlet weak var saveButton: UIButton! var namePokemon: String? @IBOutlet weak var cancelButton: UIButton! var phoneNumber: String? private var controller: AddPokemonController? override func viewDidLoad() { super.viewDidLoad() let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.dismissKeyboard)) self.navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil) self.view.addGestureRecognizer(tap) self.pokemonImage.contentMode = .scaleToFill self.controller = AddPokemonController() self.gameTitleTextField.delegate = self self.descriptionTextView.delegate = self self.saveButton.layer.cornerRadius = 4 self.saveButton.clipsToBounds = true self.cancelButton.layer.cornerRadius = 4 self.cancelButton.clipsToBounds = true self.nvTextField.keyboardType = .numberPad self.hpTextField.keyboardType = .numberPad self.defTextField.keyboardType = .numberPad self.ataTextField.keyboardType = .numberPad self.velTextField.keyboardType = .numberPad self.ataSpTextField.keyboardType = .numberPad self.defSpTextField.keyboardType = .numberPad self.nvTextField.delegate = self self.hpTextField.delegate = self self.defTextField.delegate = self self.ataTextField.delegate = self self.velTextField.delegate = self self.ataSpTextField.delegate = self self.defSpTextField.delegate = self self.descriptionTextView.layer.cornerRadius = 4 self.statusView.layer.cornerRadius = 4 self.getTelephone() } @objc func dismissKeyboard() { self.view.endEditing(true); } func sendDataToCadastroVC(nomePokemon: String) { print("cliquei no >>>>>>>>\(nomePokemon)") self.controller?.getPokemonData(nomePokemon: nomePokemon){ (result, erro) in if(result){ let url = URL(string: self.controller?.pokemonURLImage ?? "") if let _url = url { // self.helpMessageView.isHidden = true self.pokemonImage.load(url: _url) self.namePokemon = nomePokemon } } else{ print("deu erro") } } } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if(segue.identifier == "CadastrarVC.SelecionarPokemonVC"){ let selecionarPokemonVC: SelecionarPokemonVC = segue.destination as! SelecionarPokemonVC selecionarPokemonVC.delegate = self } } @IBAction func searchAction(_ sender: UIButton) { self.performSegue(withIdentifier: "CadastrarVC.SelecionarPokemonVC", sender: nil) } @IBAction func addPokemon(_ sender: UIButton) { let isValid = self.validateFields(textFields: [ self.gameTitleTextField ]) if isValid { controller?.savePokemon(name: namePokemon, telefone: self.phoneNumber, url: self.controller?.pokemonURLImage, game: self.gameTitleTextField.text, nv: self.nvTextField.text, hp: self.hpTextField.text, def: self.defTextField.text, ata: self.ataSpTextField.text, vel: self.velTextField.text, defSp: self.defSpTextField.text, ataSp: self.ataSpTextField.text, obs: self.descriptionTextView.text) let appearance = SCLAlertView.SCLAppearance( showCloseButton: false ) let alertView = SCLAlertView(appearance: appearance) alertView.addButton("OK") {} alertView.showSuccess("Confirmação", subTitle: "Pokémon adicionado com sucesso!") } else { let appearance = SCLAlertView.SCLAppearance( showCloseButton: false ) let alertView = SCLAlertView(appearance: appearance) alertView.addButton("OK") {} alertView.showError("Alerta", subTitle: "Preencha todos os campos!") } self.gameTitleTextField.text = "" self.descriptionTextView.text = "" self.nvTextField.text = "" self.hpTextField.text = "" self.defTextField.text = "" self.ataTextField.text = "" self.velTextField.text = "" self.ataSpTextField.text = "" self.defSpTextField.text = "" } @IBAction func cancelPokemon(_ sender: UIButton) { //self.dismiss(animated: true, completion: nil) self.navigationController?.popViewController(animated: true) } private func getTelephone() { if let uid = (Auth.auth().currentUser?.uid){ let db = Firestore.firestore() db.collection("telefones").document(uid).getDocument { (document, error) in if let document = document, document.exists { if let teamInfo = document.data()?["telefone"] { let telefone = teamInfo as? String ?? "" self.phoneNumber = telefone } } else { print("Document does not exist") } } } } } extension AddPokemonViewController: UITextFieldDelegate { func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { var maxLength: Int = 10 var newString: NSString = "" if textField != self.gameTitleTextField { maxLength = 3 let currentString: NSString = textField.text! as NSString newString = currentString.replacingCharacters(in: range, with: string) as NSString return newString.length <= maxLength } else { return newString.length <= maxLength } } func textFieldShouldReturn(_ textField: UITextField) -> Bool { switch textField { case self.gameTitleTextField: self.descriptionTextView.becomeFirstResponder() break; default: self.descriptionTextView.becomeFirstResponder() } return true } } extension AddPokemonViewController { func validateFields(textFields: [UITextField]) -> Bool { for field in textFields { guard let fieldText = field.text?.trimmingCharacters(in: .whitespacesAndNewlines) else { return false } if (fieldText.isEmpty) { return false } } return true } } extension UIImageView { func load(url: URL) { DispatchQueue.global().async { [weak self] in if let data = try? Data(contentsOf: url) { if let image = UIImage(data: data) { DispatchQueue.main.async { self?.image = image } } } } } }
[ -1 ]
2daaf4802d920865c9d023a41682acbfd685a6ec
b5dcf57b42c8e67db1d9c2908caeb6d1d0ee11b3
/Mastering-iOS-master/xcode12+/ViewController/Segue/Segue/CustomSegue/HalfEmbedingUnwindSegue.swift
637c1ec06c270c054e8eabeaccfd4f61cfde6d86
[ "MIT" ]
permissive
frozenxnow/SwiftMasteringiOS
0fad6cc117b5c8190f5c98149c3cf8e3256977b7
4cb69844c66d18463a948a7d25394a89344b6901
refs/heads/master
2023-07-11T18:05:32.772835
2021-08-15T14:58:10
2021-08-15T14:58:10
345,336,540
1
0
null
null
null
null
UTF-8
Swift
false
false
885
swift
// // HalfEmbedingUnwindSegue.swift // Segue // // Created by 지원 on 2021/07/23. // Copyright © 2021 Keun young Kim. All rights reserved. // import UIKit class HalfEmbedingUnwindSegue: UIStoryboardSegue { // Custom한 VC 내부에서 unwind로 연결되어있던 segue는 동작하지 않는다 // 직접 unwind segue를 custom해주어야 한다 override func perform() { // 최종 애니메이션 프레임 생성 var frame = source.view.frame frame = frame.offsetBy(dx: 0, dy: frame.height) UIView.animate(withDuration: 0.3) { // frame, 알파 값 설정 self.source.view.frame = frame self.source.view.alpha = 0.0 } completion: { finished in self.source.view.removeFromSuperview() self.source.removeFromParentViewController() } } }
[ -1 ]
c33d90bf31b701763eca81eb9a60b465878c5562
c8450af22ee0010612817a3c5a92a6a5a6062892
/Trees/Longest Increasing Path in a Matrix/Tests/Longest Increasing Path in a MatrixTests/XCTestManifests.swift
7bad2a44365df735fe95474eb64a359c9f298f85
[]
no_license
roanacla/leetCode
556600fc9c18c0435881d81dfbd258694d1a19f0
94c769fa0307d3e2798cea0e645a103ca4c4b956
refs/heads/master
2023-06-15T23:19:43.423617
2021-07-15T06:23:23
2021-07-15T06:23:23
292,359,601
0
0
null
null
null
null
UTF-8
Swift
false
false
185
swift
import XCTest #if !canImport(ObjectiveC) public func allTests() -> [XCTestCaseEntry] { return [ testCase(Longest_Increasing_Path_in_a_MatrixTests.allTests), ] } #endif
[ 340971, 253804, 325453, 253807, 328501, 338390 ]
ba6b0fdea996690c77cbb04ff3d500aed61a386c
a67d8450e014d63061dd324c57cca9288e21111d
/Play.playground/Contents.swift
5ab53a47f8e5d8bf71543e6c8e8581703066096f
[]
no_license
tbajis/NetworkingPrototype
3adc569c7359548dc881b03fb70bee84a9cf73eb
5cafb692ec1ed4510c85daed9345c8377c1f3245
refs/heads/master
2022-11-14T23:32:46.747260
2020-06-30T03:59:25
2020-06-30T03:59:25
275,992,940
0
0
null
null
null
null
UTF-8
Swift
false
false
875
swift
import Foundation import PlaygroundSupport import Networking import Combine PlaygroundPage.current.needsIndefiniteExecution = false func getMemberId() -> AnyPublisher<Int, ClientError> { return Future { completion in sleep(2) completion(.success(1)) } .eraseToAnyPublisher() } func runRequest() { let request = DarkSkyRequest() let client = Client() let semaphore = DispatchSemaphore(value: 0) getMemberId() .flatMap { _ in return client.send(request) } .sink(receiveCompletion: { completion in if case .failure(let error) = completion { print(error) } semaphore.signal() }, receiveValue: { response in print(response.response.latitude) semaphore.signal() }) semaphore.wait() } runRequest()
[ -1 ]
71243660e9cb740070b7dfbda7f09abdd52b2e41
b1bff5fd6e5e334d66e9a6a41154bb288576440e
/RWPickFlavor/PickFlavorViewController.swift
a09e010c61cd1e85e338ce74898d00a5caf91dc6
[ "MIT" ]
permissive
tpoche/RWPickFlavor
6d70b5b47ec4aef1f824ee4da324e543ef6535e6
35020c2a07c58de8a564500a8551a00c50227c12
refs/heads/master
2021-01-02T22:51:26.606216
2015-07-01T18:16:48
2015-07-01T18:16:48
38,326,333
0
0
null
null
null
null
UTF-8
Swift
false
false
2,465
swift
// // ViewController.swift // IceCreamShop // // Created by Joshua Greene on 2/8/15. // Copyright (c) 2015 Razeware, LLC. All rights reserved. // import UIKit import Alamofire import MBProgressHUD import BetterBaseClasses public class PickFlavorViewController: BaseViewController, UICollectionViewDelegate { // MARK: Instance Variables var flavors: [Flavor] = [] { didSet { pickFlavorDataSource?.flavors = flavors } } private var pickFlavorDataSource: PickFlavorDataSource? { return collectionView?.dataSource as! PickFlavorDataSource? } private let flavorFactory = FlavorFactory() // MARK: Outlets @IBOutlet var contentView: UIView! @IBOutlet var collectionView: UICollectionView! @IBOutlet var iceCreamView: IceCreamView! @IBOutlet var label: UILabel! // MARK: View Lifecycle public override func viewDidLoad() { super.viewDidLoad() loadFlavors() } private func loadFlavors() { let urlString = "http://www.raywenderlich.com/downloads/Flavors.plist" showLoadingHUD() Alamofire.request(.GET, urlString, encoding: .PropertyList(.XMLFormat_v1_0, 0)) .responsePropertyList { request, response, array, error in self.hideLoadingHUD() if let error = error { println("Error: \(error)") } else if let array = array as? [[String: String]] { if array.isEmpty { println("No flavors were found!") } else { self.flavors = self.flavorFactory.flavorsFromDictionaryArray(array) self.collectionView.reloadData() self.selectFirstFlavor() } } } } private func showLoadingHUD() { let hud = MBProgressHUD.showHUDAddedTo(contentView, animated: true) hud.labelText = "Loading..." } private func hideLoadingHUD() { MBProgressHUD.hideAllHUDsForView(contentView, animated: true) } private func selectFirstFlavor() { if let flavor = flavors.first { updateWithFlavor(flavor) } } // MARK: UICollectionViewDelegate public func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { let flavor = flavors[indexPath.row] updateWithFlavor(flavor) } // MARK: Internal private func updateWithFlavor(flavor: Flavor) { iceCreamView.updateWithFlavor(flavor) label.text = flavor.name } }
[ -1 ]
9315c65744bd8c51dc8b6adbd0f6a500beb790ed
ec6718d8eb36c4f3a61c77812fbe3af037429b34
/Notewall/ConfirmView.swift
63e3a1c11bb3e058e49085e913db0cb8c1f89030
[]
no_license
slysid/Notewall
2d69874361c372c406c40c2da67b2d31e3a742bf
4f4a69b0cce8c75e013185adbd42e9abcc13f048
refs/heads/master
2021-01-21T13:18:01.358961
2016-05-29T21:22:36
2016-05-29T21:22:36
51,617,888
0
0
null
null
null
null
UTF-8
Swift
false
false
3,570
swift
// // ConfirmView.swift // Pinwall // // Created by Bharath on 24/02/16. // Copyright © 2016 Bharath. All rights reserved. // import Foundation import UIKit protocol ConfirmProtocolDelegate { func okTapped(sender:ConfirmView, requester:AnyObject?) func cancelTapped(sender:ConfirmView, requester:AnyObject?) } class ConfirmView:UIView { var confirmDelegate:ConfirmProtocolDelegate? var requester:AnyObject? init(frame: CGRect, requester:AnyObject?) { super.init(frame:frame) self.userInteractionEnabled = true self.requester = requester self.backgroundColor = UIColor.clearColor() self.autoresizingMask = UIViewAutoresizing.FlexibleBottomMargin.union(.FlexibleTopMargin).union(.FlexibleLeftMargin).union(.FlexibleRightMargin) let textLabel = UILabel(frame: CGRectMake(0,0,self.bounds.size.width,self.bounds.size.height * 0.70)) textLabel.font = UIFont(name: "chalkduster", size: 40.0) textLabel.textAlignment = NSTextAlignment.Center textLabel.textColor = UIColor.whiteColor() textLabel.text = "Delete Note" self.addSubview(textLabel) let okBoundry = UIView(frame: CGRectMake(0,textLabel.bounds.size.height,self.bounds.size.width * 0.5,self.bounds.size.height * 0.30)) okBoundry.userInteractionEnabled = true self.addSubview(okBoundry) let okTap = UITapGestureRecognizer(target: self, action: #selector(ConfirmView.okTapped)) okBoundry.addGestureRecognizer(okTap) let okImage = UIImageView(frame: CGRectMake(0,0,self.bounds.size.height * 0.30,self.bounds.size.height * 0.30)) okImage.center = CGPointMake(self.bounds.size.width * 0.25, textLabel.frame.size.height + okImage.frame.size.height * 0.5) okImage.image = UIImage(named: "ok.png") self.addSubview(okImage) let cancelBoundry = UIView(frame: CGRectMake(okBoundry.bounds.size.width,okBoundry.frame.origin.y,self.bounds.size.width * 0.5,self.bounds.size.height * 0.30)) cancelBoundry.userInteractionEnabled = true self.addSubview(cancelBoundry) let cancelTap = UITapGestureRecognizer(target: self, action: #selector(ConfirmView.cancelTapped)) cancelBoundry.addGestureRecognizer(cancelTap) let cancelImage = UIImageView(frame: CGRectMake(0,0,okImage.frame.size.width,okImage.frame.size.height)) cancelImage.center = CGPointMake(self.bounds.size.width * 0.75, okImage.center.y) cancelImage.image = UIImage(named: "cancel.png") self.addSubview(cancelImage) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } func removeSelf() { UIView.animateWithDuration(0.5, delay: 0.0, options: UIViewAnimationOptions.BeginFromCurrentState, animations: { () -> Void in self.alpha = 0.0 }) { (Bool) -> Void in self.removeFromSuperview() } } func cancelTapped() { self.removeSelf() if (self.confirmDelegate != nil) { self.confirmDelegate?.cancelTapped(self,requester: self.requester) } } func okTapped() { self.removeSelf() if (self.confirmDelegate != nil) { self.confirmDelegate?.okTapped(self, requester: self.requester) } } }
[ -1 ]
760d7ecedf4cf503f39086abb3ecc6809a0e4571
5b79ca70068ade6038fb7de4c8dca141c4fc2044
/MacroTacker/ViewControllers/ViewController4.swift
77c0c82b7b12b28ad2c12e5cd6ac62134d5a23e5
[]
no_license
hechttrevor/MacroTracker
45b65f2e2fdc598c7ef6057986b8b8acac1ace3a
feb012267e6488c64a653b2e7fc4f9475d819caa
refs/heads/master
2020-04-23T04:51:06.033839
2019-02-20T20:30:29
2019-02-20T20:30:29
170,921,707
0
0
null
null
null
null
UTF-8
Swift
false
false
5,163
swift
// // ViewController4.swift // MacroTacker // // Created by Trevor Hecht on 2/15/19. // Copyright © 2019 Trevor Hecht. All rights reserved. // import UIKit import Charts import FirebaseDatabase class ViewController4: UIViewController { @IBOutlet weak var pieChart: PieChartView! @IBOutlet weak var remainingCalories: UILabel! var ref : DatabaseReference! let backgroundImageView = UIImageView() var totalCalories = 0.0 var totalProtein = 0.0 var totalCarbs = 0.0 var totalFat = 0.0 let goalCalories = 2000.0 let goalProtein = 232.0 let goalCarbs = 200.0 let goalFat = 70.0 var proteinDataEntry = PieChartDataEntry(value: 0) var carbsDataEntry = PieChartDataEntry(value: 0) var fatDataEntry = PieChartDataEntry(value: 0) var totalMacro = [PieChartDataEntry]() override func viewDidLoad() { super.viewDidLoad() setBackground() ref = Database.database().reference() setChart() updateChartData() } func setChart(/*completed: FinishedDownload*/){ pieChart.chartDescription?.text = "Percentage Breakdown" ref.child("Consumed").observeSingleEvent(of: .value, with: { (snapshot) in for child in snapshot.children { let snap = child as! DataSnapshot self.ref.child("Consumed/\(snap.key)").observeSingleEvent(of: .value, with: { (snapshot) in let value = snap.value as? NSDictionary self.totalCalories += value?["calories"] as? Double ?? 0 self.totalProtein += value?["protein"] as? Double ?? 0 self.totalCarbs += value?["carbs"] as? Double ?? 0 self.totalFat += value?["fat"] as? Double ?? 0 let total = self.totalProtein + self.totalCarbs + self.totalFat self.updateChartData() }) { (error) in print(error.localizedDescription) } } }) { (error) in print(error.localizedDescription) } } func updateChartData(){ if ((goalCalories - totalCalories) < 0){ remainingCalories.text = "Have gone over by: \( totalCalories - goalCalories) calories" } else if ((goalCalories - totalCalories) > 0){ remainingCalories.text = "Remaining calories: \((goalCalories - totalCalories))" } else if ((goalCalories - totalCalories) == 0){ remainingCalories.text = "0 calories left for today's goal" } if ((goalProtein - totalProtein) <= 0){ proteinDataEntry.value = 0 proteinDataEntry.label = "No more protein needed" } else if ((goalProtein - totalProtein) > 0){ proteinDataEntry.value = goalProtein - totalProtein proteinDataEntry.label = "g's protein" } if ((goalCarbs - totalCarbs) <= 0){ carbsDataEntry.value = 0 carbsDataEntry.label = "No more carbs needed" } else if ((goalCarbs - totalCarbs) > 0){ carbsDataEntry.value = goalCarbs - totalCarbs carbsDataEntry.label = "g's carbs" } if ((goalFat - totalFat) <= 0){ fatDataEntry.value = 0 fatDataEntry.label = "No more fat needed" } else if ((goalFat - totalFat) > 0){ fatDataEntry.value = goalFat - totalFat fatDataEntry.label = "g fat" } totalMacro = [proteinDataEntry,carbsDataEntry,fatDataEntry] let chartDataSet = PieChartDataSet(values: totalMacro, label: "") let chartData = PieChartData(dataSet: chartDataSet) let greenColor = UIColor(red: 0, green: 165/255, blue: 0, alpha: 1) let colors = [greenColor, UIColor.orange, UIColor.blue] chartDataSet.colors = colors pieChart.data = chartData } func showAlert(title : String, message: String){ let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) alertController.addAction(UIAlertAction(title: "Dismiss", style: .default)) self.present(alertController, animated: true, completion: nil) } func setBackground(){ view.addSubview(backgroundImageView) backgroundImageView.translatesAutoresizingMaskIntoConstraints = false //basiaclly lets you auto layout backgroundImageView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true backgroundImageView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true backgroundImageView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true backgroundImageView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true backgroundImageView.image = UIImage(named: "background1") view.sendSubviewToBack(backgroundImageView) } }
[ -1 ]
81209e1d25a290358b0a0df22c508b3c515b8b7b
2d26f1be84fcaa8bcd594cb33473e2ac5b3c6bb2
/22_SlideDownMenu24/SlideDownMenu/MenuTableViewController.swift
7538766c270c097ab809f36ec432972fe84032b8
[]
no_license
crazyboomegg/Swift_learing
c9b2b6fa3ddc3c991987b41125fb36e79c82a08b
83a40350fecd64e824b49c6115d0a2344f531e18
refs/heads/master
2023-03-08T11:39:51.553121
2021-02-19T06:47:00
2021-02-19T06:47:00
145,397,986
0
0
null
null
null
null
UTF-8
Swift
false
false
1,719
swift
// // MenuTableViewController.swift // SlideDownMenu // // Created by Simon Ng on 27/10/2016. // Copyright © 2016 AppCoda. All rights reserved. // import UIKit class MenuTableViewController: UITableViewController { var menuItems = ["Home", "News", "Tech", "Finance", "Reviews"] var currentItem = "Home" override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // MARK: - Table view data source override func numberOfSections(in tableView: UITableView) -> Int { // Return the number of sections return 1 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // Return the number of rows return menuItems.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! MenuTableViewCell // Configure the cell... cell.titleLabel.text = menuItems[indexPath.row] cell.titleLabel.textColor = (menuItems[indexPath.row] == currentItem) ? UIColor.white : UIColor.gray return cell } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { let menuTableViewController = segue.source as! MenuTableViewController if let selectedIndexPath = menuTableViewController.tableView.indexPathForSelectedRow { currentItem = menuItems[selectedIndexPath.row] } } }
[ -1 ]
cd53811272a49eaa2b86259e96f845f139967ca4
7347ab81324a4135e9c5555ada2d5a307c9c00b9
/HooqAssignment/HooqAssignment/Presentation/Details/MovieDetailsViewController.swift
879d21e040c8ecc7ae4cf8fb4d80947887664a0c
[]
no_license
sudheerpalchuri/HooqAssignment
61a5ffe0f98aa90886ce129bbb09c3f0e5fc5ef7
80586a128b99cefec163a3e8a3e4589430075e4f
refs/heads/master
2020-10-02T09:44:54.627492
2019-12-13T06:25:02
2019-12-13T06:25:02
227,750,156
0
0
null
null
null
null
UTF-8
Swift
false
false
1,543
swift
// // MovieDetailsViewController.swift // HooqAssignment // // Created by Sudheer Palchuri on 11/12/19. // Copyright © 2019 Sudheer Palchuri. All rights reserved. // import UIKit import Nuke /// This view controller is static, which means it only represents one state /// and never changes class MovieDetailsViewController: UIViewController { @IBOutlet var posterImageView: UIImageView! @IBOutlet var nameLabel: UILabel! @IBOutlet var overviewLabel: UILabel! @IBOutlet var releaseYearLabel: UILabel! var viewModel: MovieDetailsViewModel! override func viewDidLoad() { super.viewDidLoad() if let movie = viewModel.movie { render(movie: movie) } } private func render(movie: Movie) { nameLabel.text = movie.name overviewLabel.text = movie.overview let year = Calendar.current.component(.year, from: movie.released) releaseYearLabel.text = String(year) if let imageURL = movie.poster { Nuke.loadImage( with: imageURL, options: ImageLoadingOptions( transition: .fadeIn(duration: 0.33) ), into: posterImageView ) } } } extension MovieDetailsViewController { static func instantiate() -> MovieDetailsViewController { let vc = UIStoryboard(name: "MovieDetails", bundle: nil) .instantiateInitialViewController() as! MovieDetailsViewController return vc } }
[ -1 ]