blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
625
content_id
stringlengths
40
40
detected_licenses
sequencelengths
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
sequencelengths
1
9.02k
bf44b041cf7548f37a64c8bc476d5bf4801c8249
51d4f434f24887b216e2313c9458a11dec0d97c2
/mockAPI/SceneDelegate.swift
73f2074308f4d5e97bf817a18ef13b453523dfb8
[]
no_license
DhrubojyotiBis1/mockingDemo
14f634cd757b004fb51fd2a82f367cf49ad43608
808807ba9d3788c8bf60bba4237c4d50c72ca634
refs/heads/master
2021-05-18T21:51:39.731159
2020-03-30T22:10:33
2020-03-30T22:10:33
251,439,930
0
0
null
null
null
null
UTF-8
Swift
false
false
2,346
swift
// // SceneDelegate.swift // mockAPI // // Created by Dhrubojyoti on 31/03/20. // Copyright © 2020 Dhrubojyoti. All rights reserved. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 352294, 344103, 393260, 393269, 213049, 376890, 385082, 16444, 393277, 376906, 327757, 254032, 286804, 368728, 254045, 368736, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 286889, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 180432, 377047, 418008, 385243, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 336124, 385281, 336129, 262405, 180491, 336140, 164107, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 270687, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 336326, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 98819, 164362, 328207, 410129, 393748, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 385610, 270922, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 336513, 377473, 336517, 344710, 385671, 148106, 377485, 352919, 98969, 336549, 344745, 361130, 336556, 385714, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 418508, 385743, 385749, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 271154, 328498, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 328523, 336715, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 361361, 222129, 345036, 115661, 386004, 345046, 386012, 386019, 386023, 328690, 435188, 328703, 328710, 418822, 377867, 328715, 361490, 386070, 271382, 336922, 345119, 377888, 328747, 214060, 345134, 345139, 361525, 361537, 377931, 197708, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 386168, 361594, 410746, 214150, 345224, 386187, 337048, 345247, 361645, 337072, 345268, 337076, 402615, 361657, 402636, 328925, 165086, 165092, 328933, 222438, 328942, 386286, 386292, 206084, 115973, 328967, 345377, 345380, 353572, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337224, 337230, 337235, 263509, 353634, 337252, 402792, 345449, 99692, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 337330, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 419360, 370208, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 206397, 214594, 419401, 353868, 419404, 173648, 419408, 214611, 419412, 403040, 345702, 222831, 370298, 353920, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 419543, 419545, 345819, 419548, 181982, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 141052, 337661, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 116512, 362274, 378664, 354107, 345916, 354112, 247618, 370504, 329545, 345932, 354124, 370510, 247639, 337751, 370520, 313181, 182110, 354143, 354157, 345965, 345968, 345971, 345975, 182136, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 247760, 346064, 346069, 329699, 354275, 190440, 247790, 354314, 346140, 337980, 436290, 395340, 378956, 436307, 338005, 329816, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 387250, 379067, 387261, 256193, 395467, 346317, 411862, 256214, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 436474, 321787, 379135, 411905, 411917, 43279, 379154, 395539, 387350, 387353, 338201, 182559, 338212, 395567, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 182642, 321911, 420237, 379279, 272787, 354728, 338353, 338363, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 330225, 248309, 199165, 248332, 330254, 199182, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 191085, 338544, 191093, 346743, 330384, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 264919, 256735, 338661, 338665, 264942, 330479, 363252, 338680, 207620, 264965, 191240, 338701, 256787, 363294, 199455, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 330581, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 355185, 330612, 330643, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 330750, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 330830, 248915, 183384, 339037, 412765, 257121, 322660, 265321, 330869, 248952, 420985, 330886, 330890, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 322763, 330959, 330966, 265433, 265438, 388320, 363757, 388348, 339199, 396552, 175376, 175397, 208167, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 437576, 437584, 331089, 437588, 396634, 175451, 437596, 429408, 175458, 208228, 175461, 175464, 265581, 331124, 175478, 249210, 175484, 175487, 249215, 175491, 249219, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 339401, 380364, 339406, 372177, 339414, 249303, 413143, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 339464, 249355, 208399, 380433, 175637, 405017, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 339572, 224885, 224888, 224891, 224895, 372354, 126597, 421509, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 339696, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 397089, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 323404, 257869, 257872, 225105, 339795, 397140, 225109, 225113, 257881, 257884, 257887, 225120, 257891, 413539, 225128, 257897, 225138, 339827, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 184245, 372698, 372704, 372707, 356336, 380919, 393215, 372739, 405534, 266295, 266298, 217158, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 192640, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 250012, 225439, 135328, 192674, 225442, 438434, 225445, 438438, 225448, 438441, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 430275, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 356580, 225511, 217319, 225515, 225519, 381177, 397572, 389381, 356631, 356638, 356641, 356644, 356647, 266537, 389417, 356650, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 332098, 201030, 348489, 332107, 151884, 430422, 348503, 332118, 250201, 250203, 332130, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 332162, 389507, 348548, 356741, 250239, 332175, 160152, 373146, 373149, 70048, 356783, 266688, 324032, 201158, 340452, 127473, 217590, 340473, 324095, 324100, 324103, 324112, 340501, 324118, 324122, 340512, 332325, 324134, 381483, 356908, 324141, 324143, 356917, 324150, 324156, 168509, 348734, 324161, 324165, 356935, 348745, 381513, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 348777, 381546, 119432, 340628, 184983, 373399, 340639, 258723, 332455, 332460, 389806, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 373499, 348926, 389927, 348979, 152371, 398141, 127815, 357202, 389971, 357208, 136024, 389979, 430940, 357212, 357215, 439138, 201580, 201583, 349041, 340850, 201589, 381815, 430967, 324473, 398202, 119675, 340859, 324476, 430973, 324479, 340863, 324482, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 398246, 373672, 324525, 5040, 111539, 324534, 5047, 324539, 324542, 398280, 349129, 340940, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 349173, 381947, 201724, 349181, 431100, 431107, 349203, 209944, 209948, 250915, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 431180, 209996, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 349313, 160896, 210053, 210056, 349320, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 333010, 210132, 333016, 210139, 210144, 218355, 251123, 218361, 275709, 128254, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 251211, 210261, 365912, 259423, 374113, 251236, 374118, 234867, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 210357, 259516, 415168, 366035, 415187, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 415271, 382503, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 333387, 333396, 333400, 366173, 333415, 423529, 423533, 333423, 210547, 415354, 333440, 267910, 267929, 333472, 333512, 259789, 358100, 366301, 333535, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333593, 333595, 210720, 366384, 358192, 210740, 366388, 358201, 399166, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 268144, 358256, 358260, 399222, 325494, 186233, 333690, 243584, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 382898, 333767, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 268299, 333838, 350225, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 252021, 342134, 374904, 268435, 333989, 333998, 334012, 260299, 350411, 350417, 350423, 211161, 350426, 334047, 350449, 375027, 358645, 350454, 350459, 350462, 350465, 350469, 325895, 268553, 194829, 350477, 268560, 350481, 432406, 350487, 350491, 350494, 325920, 350500, 350505, 358701, 391469, 350510, 358705, 358714, 358717, 383307, 358738, 334162, 383331, 383334, 391531, 383342, 334204, 268669, 194942, 391564, 366991, 334224, 342431, 375209, 326059, 375220, 342453, 334263, 326087, 358857, 195041, 334306, 334312, 104940, 375279, 162289, 350724, 186898, 342546, 350740, 342551, 334359, 342555, 334364, 416294, 350762, 252463, 358962, 334386, 334397, 358973, 252483, 219719, 399957, 244309, 334425, 326240, 375401, 334466, 334469, 391813, 162446, 326291, 342680, 342685, 260767, 342711, 244410, 260798, 334530, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 342769, 203508, 375541, 342777, 391938, 391949, 375569, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 260925, 375616, 326468, 244552, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 326503, 433001, 326508, 400238, 326511, 211826, 211832, 392061, 351102, 252801, 260993, 400260, 211846, 342921, 342931, 252823, 400279, 392092, 400286, 359335, 211885, 400307, 351169, 359362, 351172, 170950, 187335, 326599, 359367, 359383, 359389, 383968, 343018, 359411, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 261166, 359471, 375868, 384099, 384102, 384108, 367724, 326764, 187503, 343155, 384115, 212095, 384136, 384140, 384144, 351382, 384152, 384158, 384161, 351399, 384169, 367795, 244917, 384182, 384189, 384192, 351424, 343232, 244934, 367817, 244938, 384202, 253132, 326858, 343246, 384209, 146644, 351450, 384225, 359650, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 359695, 261391, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 343399, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 343453, 245152, 245155, 155045, 245158, 40358, 245163, 114093, 327090, 343478, 359867, 384444, 146878, 327108, 327112, 384457, 327118, 359887, 359891, 343509, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 359948, 359951, 245295, 359984, 400977, 400982, 179803, 155241, 138865, 155255, 155274, 368289, 245410, 425639, 245415, 425652, 425663, 155328, 245463, 155352, 155356, 212700, 155364, 245477, 155372, 245487, 212723, 245495, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 155488, 376672, 155492, 327532, 261997, 376686, 262000, 262003, 425846, 262006, 147319, 262009, 327542, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 311244, 212945, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 155647 ]
f233eff675882ba44d371ab1428b8e76ecc3e269
40b3e8195796822b523de4b4cd3518b845c7a09e
/News/Extensions/NSObjectExtensions.swift
1733fdfccbb04ec4aa31213c93d340569f3ba5af
[]
no_license
musatrtr/newsApp
e8cece732de631824eaa870a5a558c0ad4c0cecd
51564d6e362db7cb8bfcac288b276613914541f7
refs/heads/master
2023-04-13T15:11:56.976585
2021-04-23T11:35:03
2021-04-23T11:35:03
360,851,897
0
0
null
null
null
null
UTF-8
Swift
false
false
300
swift
// // NSObjectExtension.swift // News // // Created by Musa Kokcen on 14.03.2021. // import Foundation extension NSObject { public var className: String { return type(of: self).className } public static var className: String { return String(describing: self) } }
[ -1 ]
9e1ea2a87d98ef71f69d61455cb765b21bd93fb9
b54a7082f62a1f32f4c87096d3dbbf51cb61074e
/HW3_Mustafa_Gorgun/SceneModules/Main/MainViewModel.swift
7fc309f38940dd77025de8acbe8675ce643022e5
[]
no_license
Hepsiburada-mobil-iOS-Bootcamp/HW3_Mustafa_Gorgun
1cbf0bd3a7fad034f307762c04a7ea1f7f84ba30
0499c6545c2733b65af0935a8c0fee89a57d5fad
refs/heads/main
2023-08-15T19:22:16.505596
2021-10-11T04:52:07
2021-10-11T04:52:07
415,782,978
0
0
null
null
null
null
UTF-8
Swift
false
false
143
swift
// // MainViewModel.swift // HW3_Mustafa_Gorgun // // Created by MstfGrgn on 10.10.2021. // import Foundation class MainViewModel{ }
[ -1 ]
b468acf1f4015db1ae973d446c4cf6a6cefbf23a
24c980f3639a22b426228f8c7d3380633d7f623b
/Project/Ruby/Ruby/AppDelegate.swift
7aafb92c3bd494086e93a1fe0c6a399ee674b414
[]
no_license
KonoLv1/Swift
a7255eb53aac34091ac1e1fa5db1eb2ec8f72c7f
b67abd54e165df7b86f8d7145fdf42bfd067763c
refs/heads/master
2020-05-26T21:39:38.413631
2019-11-18T03:08:13
2019-11-18T03:08:13
188,383,454
0
0
null
2019-06-08T12:03:44
2019-05-24T08:26:53
Swift
UTF-8
Swift
false
false
4,231
swift
// // AppDelegate.swift // // ここでは、「ビュー間でやり取りする変数の宣言」「初回起動かどうかの確認」「初回起動であればチュートリアルに移動」を行なっています。 // // Here, "declaring variables to be exchanged between views", "confirming whether it is the first start," and // "Go to tutorial for the first start" are performed. // // Ruby // // Created by 小山順一 on 2019/05/26. // Copyright © 2019 小山順一. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? var userMode:Int = 0 // ひらがなに変換するかカタカナに変換するかを判断する用(Hiragana or Katakana) var userText:String? // 変換したい文字列(Character to convert) let dict = ["firstLaunch": true] // 初回判定用 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { let userDefault = UserDefaults.standard let dict = ["firstLaunch": true] userDefault.register(defaults: dict) // 初回起動ならチュートリアル画面を表示する(Start the tutorial for the first launch) if userDefault.bool(forKey: "firstLaunch") { userDefault.set(false, forKey: "firstLaunch") print("初回起動") // windowを生成 self.window = UIWindow(frame: UIScreen.main.bounds) // Storyboardを指定 let storyboard = UIStoryboard(name: "Main", bundle: nil) // Viewcontrollerを指定 let initialViewController = storyboard.instantiateViewController(withIdentifier: "Tutorial") // rootViewControllerに入れる self.window?.rootViewController = initialViewController // 表示 self.window?.makeKeyAndVisible() } print("2回目以降の起動") // windowを生成 self.window = UIWindow(frame: UIScreen.main.bounds) // Storyboardを指定 let storyboard = UIStoryboard(name: "Main", bundle: nil) // Viewcontrollerを指定 let initialViewController = storyboard.instantiateViewController(withIdentifier: "Tutorial") // rootViewControllerに入れる self.window?.rootViewController = initialViewController // 表示 self.window?.makeKeyAndVisible() return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ -1 ]
dcd2726765adb1855b50048bac8db6b93f2bdf84
3261b54287009dc625ab4adfd7dd82210d0542a1
/BuildSourced/Controller/common/Encode/String-Base64.swift
3f0155ac787ff64a9b17c2a0ae806525958f24ff
[]
no_license
WadeTheEng/Inventory-Register-QrcodeReader-iOS
53531d00885e0e2ccc6f48ab43f4c1210793efc2
3cb50a2cbd94e49218f94b5150cd769744dd8801
refs/heads/master
2020-06-26T00:39:42.185019
2019-07-29T14:38:40
2019-07-29T14:38:40
199,404,892
0
0
null
null
null
null
UTF-8
Swift
false
false
311
swift
import UIKit extension String { func fromBase64() -> String? { guard let data = Data(base64Encoded: self) else { return nil } return String(data: data, encoding: .utf8) } func toBase64() -> String { return Data(self.utf8).base64EncodedString() } }
[ 150067, 230873, 211163, 168195 ]
b1668c9ad602839f4089c1cb10f3030b7561a17e
296866b3f6b9247705a367478f66ca2339b1fe1f
/SecondProject/SceneDelegate.swift
d6eb7af4d455549077a99ad4d78f551e12aede25
[]
no_license
Gelserkirchen/SecondProject
6f47938def2a562203136d29d49c6e81b378d32f
c38a3ad20030eac5d184327f6da2497a665fc4a0
refs/heads/master
2020-11-28T03:18:54.836756
2019-12-23T05:49:56
2019-12-23T05:49:56
229,691,497
0
0
null
null
null
null
UTF-8
Swift
false
false
2,386
swift
// // SceneDelegate.swift // SecondProject // // Created by Андрей Толстых on 23.12.2019. // Copyright © 2019 Андрей Толстых. All rights reserved. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 352294, 344103, 393260, 393269, 213049, 376890, 385082, 16444, 393277, 376906, 327757, 254032, 286804, 368728, 180314, 254045, 368736, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 286889, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 180432, 377047, 418008, 385243, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 336124, 385281, 336129, 262405, 164107, 180491, 336140, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 270687, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 336326, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 98819, 164362, 328207, 410129, 393748, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 385610, 270922, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 336513, 377473, 336517, 344710, 385671, 148106, 377485, 352919, 98969, 336549, 344745, 361130, 336556, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 385743, 385749, 139998, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 271154, 328498, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 328523, 336715, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 361361, 222129, 345036, 115661, 386004, 345046, 386012, 386019, 328690, 435188, 328703, 328710, 418822, 328715, 377867, 386070, 271382, 336922, 345119, 377888, 328747, 345134, 345139, 361525, 386102, 361537, 377931, 197708, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 386168, 410746, 361594, 214150, 345224, 386187, 337048, 345247, 361645, 345268, 337076, 402615, 361657, 337093, 402636, 328925, 165086, 165092, 222438, 386286, 328942, 386292, 206084, 115973, 328967, 345377, 353572, 345380, 345383, 263464, 337207, 345400, 378170, 369979, 337224, 337230, 337235, 353634, 337252, 402792, 345449, 99692, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 337330, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 370208, 419360, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 206397, 214594, 419401, 419404, 353868, 419408, 214611, 419412, 403040, 345702, 222831, 370298, 353920, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 337601, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 419545, 345819, 419548, 181982, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 141052, 337661, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 116512, 362274, 378664, 354107, 354112, 247618, 370504, 329545, 345932, 354124, 370510, 354132, 337751, 247639, 370520, 313181, 182110, 354143, 345965, 354157, 345968, 345971, 345975, 182136, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 346059, 346064, 247760, 346069, 419810, 329699, 354275, 190440, 247790, 354314, 346140, 337980, 436290, 378956, 395340, 436307, 338005, 329816, 100454, 329833, 329853, 329857, 329868, 329886, 411806, 346273, 362661, 100525, 379067, 387261, 256193, 395467, 411862, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 436474, 321787, 379135, 411905, 411917, 43279, 379154, 395539, 387350, 387353, 338201, 182559, 338212, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 182642, 321911, 420237, 379279, 354728, 338353, 338363, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 330225, 248309, 199165, 248332, 330254, 199182, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 191085, 338544, 191093, 346743, 330384, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 355029, 264919, 256735, 338661, 264942, 330479, 363252, 338680, 207620, 264965, 191240, 338701, 256787, 363294, 199455, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 355151, 330581, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 355185, 330612, 330643, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 330750, 265215, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 330830, 248915, 183384, 339037, 412765, 257121, 322660, 265321, 330869, 248952, 420985, 330886, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 322763, 330959, 330966, 265433, 265438, 388320, 363757, 339199, 396552, 175376, 175397, 208167, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 126279, 437576, 437584, 331089, 331094, 396634, 175451, 437596, 429408, 175458, 208228, 175461, 175464, 265581, 331124, 175478, 249210, 175484, 249215, 175487, 249219, 175491, 249225, 249228, 249235, 175514, 175517, 396703, 175523, 355749, 396723, 388543, 380353, 216518, 339401, 380364, 339406, 372177, 339414, 413143, 249303, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 339464, 249355, 208399, 380433, 175637, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 339572, 224885, 224888, 224891, 224895, 421509, 126597, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 339664, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 339696, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 323404, 257869, 257872, 225105, 339795, 397140, 225109, 225113, 257881, 257884, 257887, 225120, 257891, 413539, 225128, 257897, 339818, 225138, 339827, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 372698, 372704, 372707, 356336, 380919, 372739, 405534, 266295, 266298, 217158, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 192640, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 250012, 225439, 135328, 225442, 192674, 438434, 225445, 225448, 438441, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 389322, 225485, 225488, 225491, 225494, 266454, 225497, 225500, 225503, 225506, 356580, 225511, 217319, 225515, 225519, 381177, 356631, 356638, 356641, 356644, 356647, 266537, 356650, 389417, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 332098, 201030, 348489, 332107, 151884, 430422, 348503, 332118, 250203, 332130, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 250239, 332162, 348548, 356741, 332175, 160152, 373146, 340380, 373149, 70048, 356783, 373169, 324032, 201158, 340452, 127473, 217590, 340473, 324095, 324100, 324103, 324112, 340501, 324118, 324122, 340512, 332325, 324134, 381483, 356908, 324141, 324143, 356917, 324150, 324156, 168509, 348734, 324161, 324165, 356935, 381513, 348745, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 348777, 381546, 119432, 340628, 184983, 373399, 340639, 258723, 332460, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 155647, 373499, 348926, 389927, 348979, 152371, 340792, 398141, 127815, 357202, 389971, 357208, 136024, 389979, 430940, 357212, 357215, 439138, 201580, 201583, 349041, 340850, 201589, 430967, 324473, 398202, 119675, 324476, 430973, 340859, 324479, 340863, 324482, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 373672, 324525, 5040, 111539, 324534, 5047, 324539, 324542, 398280, 349129, 340940, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 381947, 201724, 431100, 349181, 431107, 349203, 209944, 209948, 250915, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 209996, 431180, 341072, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 160896, 349313, 210053, 210056, 349320, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 333010, 210132, 333016, 210139, 210144, 218355, 251123, 218361, 275709, 128254, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 251211, 210261, 365912, 259423, 374113, 251236, 374118, 333164, 234867, 390518, 357756, 374161, 112021, 349591, 333222, 210357, 259516, 415168, 366035, 415187, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 415271, 382503, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 333387, 333396, 333400, 366173, 333415, 423529, 423533, 333423, 210547, 415354, 333440, 267910, 267929, 333472, 333512, 259789, 358100, 366301, 333535, 153311, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333593, 333595, 366384, 358192, 210740, 366388, 358201, 399166, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 358256, 268144, 358260, 341877, 325494, 399222, 186233, 333690, 243584, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 333767, 350153, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 268299, 333838, 350225, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 342113, 252021, 342134, 374904, 333989, 333998, 334012, 260299, 350411, 350417, 350423, 350426, 334047, 350449, 358645, 350454, 350459, 350462, 350465, 350469, 325895, 268553, 194829, 350477, 268560, 350481, 432406, 350487, 350491, 325915, 350494, 325918, 325920, 350500, 350505, 358701, 391469, 350510, 358705, 358714, 358717, 383307, 358738, 334162, 383331, 383334, 391531, 383342, 334204, 268669, 391564, 366991, 334224, 268702, 342431, 375209, 326059, 375220, 342453, 334263, 326087, 358857, 195041, 334312, 104940, 375279, 350724, 186898, 342546, 350740, 342551, 334359, 342555, 334364, 416294, 350762, 252463, 358962, 334386, 334397, 358973, 252483, 219719, 399957, 244309, 334425, 326240, 334466, 334469, 391813, 162446, 326291, 342680, 342685, 260767, 342711, 244410, 260798, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 342769, 203508, 375541, 342777, 391938, 391949, 375569, 326417, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 260925, 375616, 326463, 326468, 244552, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 326503, 433001, 326508, 400238, 326511, 211826, 211832, 392061, 351102, 359296, 260993, 351105, 400260, 211846, 342931, 400279, 252823, 392092, 400286, 252838, 359335, 211885, 400307, 351169, 359362, 351172, 170950, 359367, 326599, 187335, 359383, 359389, 383968, 359411, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 261166, 359471, 375868, 343132, 384099, 384102, 367724, 384108, 326764, 343155, 384115, 212095, 384136, 384140, 384144, 384152, 384158, 384161, 351399, 384169, 367795, 244917, 384182, 367801, 384189, 351424, 384192, 343232, 244934, 367817, 244938, 384202, 253132, 326858, 343246, 384209, 146644, 351450, 384225, 359650, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 261391, 359695, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 376111, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 343399, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 343453, 245152, 245155, 155045, 245158, 40358, 245163, 114093, 327090, 343478, 359867, 384444, 146878, 327108, 327112, 384457, 327118, 359887, 359891, 343509, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 359948, 359951, 245295, 359984, 400977, 400982, 179803, 155241, 245358, 138865, 155255, 155274, 368289, 245410, 245415, 425652, 425663, 155328, 245463, 155352, 155356, 212700, 155364, 245477, 155372, 245487, 212723, 245495, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 384831, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 376672, 155488, 155492, 327532, 261997, 376686, 262000, 262003, 425846, 147319, 262006, 262009, 327542, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 311244, 212945, 393170, 155604, 155620, 253924, 155622, 327655, 253927, 360432, 393204, 360439, 253944, 393209, 393215 ]
c7a1cfb3607b4564b9fc14541323260b70dbe8ea
f03d774d1d4ad978d322670a5657f2d9892f00ef
/testTable/VehiculoTableViewCell.swift
149903efae93d9dcf00a67d7f192dc55d41d73c7
[]
no_license
olgamillan/testTable_final
8275f0f6859ea675916c53c5f53e338cfe669807
8433a10f5d3bdd3a5e78ab6aa77d2ee6ed35bba9
refs/heads/master
2022-03-14T17:27:03.417154
2019-11-16T08:34:58
2019-11-16T08:34:58
null
0
0
null
null
null
null
UTF-8
Swift
false
false
662
swift
// // VehiculoTableViewCell.swift // testTable // // Created by Mati on 14/11/2019. // Copyright © 2019 Swiftland Training. All rights reserved. // import UIKit class VehiculoTableViewCell: UITableViewCell { @IBOutlet weak var vehiculoTitleLabel: UILabel! @IBOutlet weak var vehiculoImageView: UIImageView! @IBOutlet weak var vehiculoTextLabel: UILabel! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } }
[ 100480, 317952, 431104, 211843, 337412, 271112, 271117, 373908, 196119, 334231, 305202, 320818, 289336, 320827, 306623, 306625, 306626, 323530, 323532, 323536, 327248, 358868, 384982, 180695, 180696, 287066, 358875, 358876, 384988, 287071, 37215, 265569, 339039, 270691, 317283, 350049, 340582, 302183, 355170, 384995, 302573, 340589, 271088, 271089, 308081, 302195, 317296, 262518, 340599, 244602, 305661 ]
1de672a8d2af085b7879f105f3b7c0f66960a6d8
cf1f4d52c26951913c343e6fe05faf6ccb657ec4
/TechMonster/AppDelegate.swift
7e40bcda2d181d9d8173a819811fda944fde14d2
[]
no_license
2y-3o/TechMonster_swift
ab5dacdc1c1af13366547698581df6455aaf9304
489aa421d820947712f84b382e2ebdcac837d5df
refs/heads/master
2021-01-19T08:37:26.659166
2015-04-17T11:32:48
2015-04-17T11:32:48
34,112,490
0
0
null
null
null
null
UTF-8
Swift
false
false
2,151
swift
// // AppDelegate.swift // TechMonster // // Created by Ayano Ohya on 2015/04/03. // Copyright (c) 2015年 Ayano Ohya. 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, 278564, 229415, 229417, 327722, 237613, 360496, 229426, 237618, 229428, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 286797, 311375, 163920, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 278648, 131192, 237693, 327814, 131209, 417930, 303241, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 286916, 286922, 286924, 286926, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 278760, 237807, 303345, 286962, 229622, 327930, 278781, 278783, 278785, 237826, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 155966, 278849, 319809, 319810, 319814, 311623, 319818, 311628, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 278983, 319945, 278986, 278990, 278994, 311767, 279003, 279006, 188895, 279010, 287202, 279015, 172520, 279020, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 287238, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 303773, 295583, 172702, 230045, 287394, 287390, 303780, 172705, 287398, 172707, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 328381, 279231, 287423, 328384, 287427, 107208, 279241, 172748, 287436, 287440, 295633, 172755, 303827, 279255, 279258, 303835, 213724, 189149, 303838, 287450, 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, 222018, 295755, 377676, 148302, 287569, 303959, 279383, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 213895, 320391, 304007, 304009, 304011, 304013, 213902, 279438, 295822, 189329, 295825, 304019, 279445, 58262, 279452, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 304063, 238528, 304065, 189378, 213954, 156612, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 295945, 295949, 197645, 230413, 320528, 140312, 295961, 238620, 304164, 189479, 304170, 238641, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 279661, 164973, 205934, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 350308, 230592, 279750, 312518, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 279788, 320748, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 296259, 378181, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 304506, 304505, 181626, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 337306, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 280014, 312783, 288208, 230865, 370130, 288210, 288212, 280021, 288214, 222676, 239064, 288217, 288218, 280027, 329177, 288220, 239070, 288224, 280034, 370146, 280036, 288226, 280038, 288229, 288230, 288232, 288234, 288236, 288238, 288240, 291754, 288242, 296435, 288244, 296439, 288250, 402942, 148990, 296446, 206336, 296450, 230916, 230919, 370187, 304651, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 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, 313176, 42842, 280419, 321381, 280426, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280458, 280464, 124817, 280468, 239510, 280473, 124827, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 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, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 223303, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 223327, 280671, 149599, 321634, 149601, 149603, 313451, 223341, 280687, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141455, 141459, 313498, 288936, 100520, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 280819, 157940, 125171, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 280835, 125187, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 280919, 354653, 313700, 280937, 313705, 280940, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 281084, 240124, 305662, 305664, 240129, 305666, 305668, 240132, 223749, 281095, 338440, 150025, 223752, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 199262, 338532, 281190, 199273, 281196, 158317, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 314029, 314033, 240309, 133817, 314047, 314051, 199364, 297671, 199367, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 281401, 289593, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207737, 183172, 240519, 322440, 338823, 314249, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 281581, 183277, 322550, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 281708, 281711, 289912, 248995, 306341, 306347, 306354, 142531, 199877, 289991, 306377, 289997, 363742, 363745, 298216, 330988, 216303, 322801, 388350, 363802, 199976, 199978, 314671, 298292, 298294, 216376, 298306, 380226, 281923, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 298365, 290174, 306555, 224641, 281987, 298372, 314756, 281990, 224647, 298377, 314763, 224657, 306581, 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, 282111, 290305, 175621, 192008, 323084, 282127, 290321, 282130, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 257658, 315016, 282249, 290445, 324757, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 306904, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 282410, 241450, 306988, 306991, 315184, 315190, 241464, 282425, 159545, 298811, 307009, 413506, 307012, 315211, 307027, 315221, 282454, 315223, 241496, 241498, 307035, 307040, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 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, 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, 323700, 299126, 233591, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 184486, 307370, 307372, 307374, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 307394, 307396, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 282881, 282893, 291089, 282906, 291104, 233766, 282931, 307508, 315701, 307510, 332086, 307512, 151864, 307515, 282942, 307518, 151874, 282947, 282957, 323917, 110926, 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, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127431, 283080, 176592, 315856, 315860, 176597, 127447, 283095, 299481, 176605, 242143, 291299, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 127497, 233994, 135689, 233998, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 291378, 234038, 152118, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 135839, 299680, 225954, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 119509, 226005, 226008, 201444, 299750, 283368, 234219, 283372, 381677, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 234248, 226056, 291593, 242443, 234252, 242445, 234254, 291601, 242450, 234258, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 201603, 234373, 226182, 234375, 226185, 308105, 234379, 234384, 234388, 234390, 226200, 234393, 324504, 209818, 308123, 324508, 234398, 234396, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 234414, 324527, 291760, 234417, 201650, 324531, 234422, 226230, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 234437, 226245, 234439, 234434, 234443, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 300628, 234585, 275545, 242777, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 234607, 160879, 275569, 234610, 300148, 234614, 398455, 234618, 275579, 144506, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 275594, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 234648, 308379, 234653, 283805, 324766, 119967, 234657, 300189, 324768, 242852, 283813, 234661, 300197, 234664, 275626, 234667, 316596, 308414, 234687, 300226, 308418, 226500, 234692, 300229, 308420, 283844, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 283904, 300289, 292097, 300292, 300294, 275719, 300299, 177419, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 283963, 243003, 226628, 283973, 300357, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 284010, 136562, 324978, 275834, 275836, 275840, 316803, 316806, 316811, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 284076, 144812, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 284099, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 226802, 316917, 308727, 292343, 300537, 316947, 308757, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 284215, 194103, 284218, 226877, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 276052, 276053, 284245, 284247, 317015, 235097, 284249, 284251, 243290, 284253, 300638, 284255, 284258, 292452, 292454, 284263, 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, 276122, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 317158, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 358135, 276216, 358140, 284413, 358142, 284418, 358146, 317187, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 325408, 284449, 300834, 300832, 227109, 317221, 358183, 276268, 300845, 194351, 243504, 300850, 284469, 276280, 325436, 276291, 366406, 276295, 153417, 276308, 284502, 317271, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 292729, 317306, 284540, 292734, 325512, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 227314, 276466, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 276539, 235579, 235581, 325692, 178238, 276544, 284739, 292934, 276553, 243785, 350293, 350295, 194649, 227418, 309337, 350302, 227423, 194654, 194657, 178273, 276579, 227426, 194660, 227430, 276583, 309346, 309348, 276586, 309350, 309352, 309354, 276590, 350313, 350316, 350321, 284786, 276595, 227440, 301167, 350325, 350328, 292985, 301178, 292989, 292993, 301185, 350339, 317570, 317573, 350342, 227463, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 309462, 301272, 309468, 309471, 301283, 317672, 276713, 317674, 325867, 227571, 309491, 276725, 309494, 243960, 276735, 227583, 227587, 276739, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 325937, 276789, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 285051, 211324, 227709, 285061, 317833, 178572, 285070, 178575, 285077, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 236043, 342541, 113167, 277011, 317971, 309781, 309779, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 277054, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 277106, 121458, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 318132, 285368, 277177, 277181, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 228069, 277223, 342760, 285417, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 285453, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 301884, 310080, 293696, 277314, 277317, 277322, 277329, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 310134, 277368, 15224, 236408, 416639, 416640, 113538, 416648, 277385, 39817, 187274, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293820, 203715, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 121850, 302075, 244731, 293882, 293887, 277504, 277507, 138246, 277511, 277519, 293908, 277526, 293917, 293939, 277561, 277564, 310336, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 277608, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 253064, 302218, 285835, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 277671, 302248, 64682, 277678, 294063, 228526, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 204023, 228601, 228606, 64768, 310531, 285958, 228617, 138505, 318742, 277798, 130345, 113964, 285997, 285999, 113969, 277811, 318773, 318776, 277816, 286010, 417086, 277822, 286016, 294211, 302403, 384328, 277832, 277836, 294221, 326991, 294223, 277839, 277850, 179547, 277853, 146784, 277857, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 277888, 310657, 351619, 294276, 310659, 277892, 327046, 253320, 310665, 318858, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 277923, 130468, 228776, 277932, 310703, 277937, 310710, 130486, 310712, 310715, 302526, 228799, 277953, 64966, 245191, 163272, 302534, 310727, 277959, 292968, 302541, 277966, 302543, 310737, 277975, 228825, 163290, 310749, 277981, 310755, 277989, 187880, 286188, 310764, 278003, 310772, 40440, 278009, 212472, 40443, 286203, 228864, 40448, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 146977, 187939, 294435, 286246, 294439, 286248, 278057, 294440, 294443, 40486, 294445, 40488, 310831, 40499, 40502, 212538, 40507, 40511, 228933, 40521, 286283, 40525, 40527, 228944, 212560, 400976, 147032, 40537, 40539, 278109, 40541, 40550, 286312, 286313, 40554, 40552, 310892, 40557, 294521, 343679, 278150, 310925, 286354, 278163, 122517, 278168, 327333, 229030, 278188, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 278227, 229076, 286420, 319187, 286425, 319194, 278235, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 188252, 237409, 294776, 294785, 327554, 40851, 294811, 319390, 237470, 294817, 319394, 40865, 311209, 180142, 294831, 188340, 40886, 294844, 294847, 393177, 294876, 294879, 294883, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
2022e59f7499b331a178bc0405def74260c7a4cb
dd38e227ee814937e1fa6edb00b209cd19085a98
/FashionTests/iOS/FashionTests.swift
d1b7d762cd2b96d61af3893065f607be58f35ef2
[ "MIT" ]
permissive
dmaulikr/Fashion
c4c858daca7315713e8758199abb20aa51d432ae
3008d6be5bbee0fd236809b8838f82c746fdfd05
refs/heads/master
2021-01-16T17:49:29.394679
2017-05-02T10:23:14
2017-05-02T10:23:14
null
0
0
null
null
null
null
UTF-8
Swift
false
false
489
swift
import XCTest import UIKit @testable import Fashion class FashionTests: XCTestCase { override func setUp() { super.setUp() } override func tearDown() { Stylist.master.styles.removeAll() Stylist.master.sharedStyles.removeAll() super.tearDown() } func testRegister() { let stylesheet = TestStylesheet() Fashion.register(stylesheets: [stylesheet]) // It registers passed stylesheets XCTAssertNotNil(Stylist.master.styles[stylesheet.style]) } }
[ -1 ]
57ad4d31233b761a2d2a5abd93725c8107f52ee7
2e43d58028dfa6df7daffc7253ce459adb40edac
/Bookworm/Bookworm/SceneDelegate.swift
a8a41961c465f44429cccebde60c8f3f9fe89797
[]
no_license
44gimm/swiftui-by-example-study
f24c1e07e9a1af645d07a62151a39164aa9acb51
774b0b09831e55ce70276cb9378414d8edebd0e4
refs/heads/master
2023-04-01T04:40:18.630513
2021-04-12T14:16:02
2021-04-12T14:16:02
289,238,639
0
0
null
null
null
null
UTF-8
Swift
false
false
2,625
swift
// // SceneDelegate.swift // Bookworm // // Created by 44gimm on 2020/09/29. // Copyright © 2020 44gimm. 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, 321787, 336124, 350459, 350462, 336129, 350465, 350469, 389381, 325895, 194829, 350477, 43279, 350481, 350487, 356631, 338201, 325915, 350491, 381212, 325918, 182559, 350494, 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, 324161, 324165, 219719, 324171, 324174, 324177, 244309, 334425, 326240, 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, 338665, 332521, 418540, 330479, 342769, 340724, 332534, 338680, 342777, 418555, 344832, 207620, 191240, 328462, 326417, 336660, 338712, 199455, 336676, 336681, 334633, 326444, 215854, 328498, 152371, 326452, 271154, 326455, 340792, 348983, 244542, 326463, 326468, 328516, 336709, 127815, 244552, 328520, 326474, 328523, 336712, 342857, 326479, 355151, 330581, 326486, 136024, 330585, 326494, 439138, 326503, 375657, 201580, 326508, 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, 252846, 324525, 5040, 5047, 324539, 324542, 187335, 398280, 347082, 340940, 345046, 330711, 248794, 340958, 248799, 340964, 386023, 338928, 328690, 359411, 244728, 330750, 265215, 328703, 199681, 328710, 330761, 328715, 326669, 330769, 361490, 349203, 209944, 336922, 209948, 248863, 345119, 250915, 357411, 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, 351366, 330886, 384136, 384140, 351382, 337048, 210072, 248986, 384152, 210078, 384158, 210081, 384161, 251045, 210085, 210089, 339118, 337072, 337076, 210100, 345268, 249015, 324792, 367801, 339133, 384189, 343232, 384192, 210116, 244934, 326858, 322763, 333003, 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, 331094, 365922, 175458, 208228, 343394, 175461, 343399, 337252, 345449, 175464, 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, 339401, 327112, 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, 333423, 222831, 138865, 339572, 372354, 126597, 339593, 159375, 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, 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, 323404, 354124, 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, 333819 ]
b2b573ce670e6507f90e6f8561834994250fae85
65dac42466827ee8c14b73acebc1fa2a4b9452a3
/HappinessTests/HappinessTests.swift
1831c41a00035e98ac168513644d50131fe38661
[]
no_license
cappypopp/Happiness
0082c719e38d2646d202d5e05b1db97285687e48
0186035ace3149a13ff98a2b47221576eaa53def
refs/heads/master
2016-08-07T17:38:11.746933
2015-04-28T18:30:48
2015-04-28T18:30:48
34,744,591
0
0
null
null
null
null
UTF-8
Swift
false
false
904
swift
// // HappinessTests.swift // HappinessTests // // Created by Cappy Popp on 4/22/15. // Copyright (c) 2015 Cappy Popp. All rights reserved. // import UIKit import XCTest class HappinessTests: 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. } } }
[ 276484, 276489, 278541, 278544, 305179, 276509, 278558, 307231, 313375, 102437, 227370, 360491, 276534, 276543, 159807, 286788, 280649, 223316, 315476, 223318, 227417, 278618, 288857, 194653, 194656, 309345, 227428, 276581, 276582, 276589, 278638, 227439, 276592, 131189, 227446, 223350, 292992, 141450, 215178, 311435, 311438, 276627, 276632, 227492, 196773, 129203, 299187, 131256, 176314, 280762, 223419, 299198, 309444, 276682, 276684, 278742, 155867, 280802, 276709, 276710, 276715, 233715, 157944, 211193, 168188, 227585, 227592, 276748, 276753, 309529, 278810, 276764, 299293, 276774, 282919, 262450, 276787, 276792, 315706, 164162, 311621, 280902, 227658, 276813, 278863, 6481, 6482, 276821, 6489, 276831, 323935, 276835, 321894, 276839, 416104, 276847, 285040, 278908, 280961, 227725, 178578, 190871, 293274, 61857, 61859, 278954, 278961, 278965, 293303, 276920, 278969, 33211, 276925, 278978, 278985, 278993, 276958, 287198, 227809, 358882, 227813, 279013, 279019, 279022, 281072, 279039, 276998, 287241, 279050, 186893, 303631, 223767, 277017, 223769, 291358, 277029, 293419, 277048, 277066, 295519, 66150, 277094, 277101, 287346, 277111, 279164, 277118, 291454, 184962, 303746, 152203, 225933, 277133, 133774, 230040, 164512, 225956, 285353, 209581, 205487, 285361, 303793, 299699, 293556, 342706, 285371, 199366, 225997, 164563, 277204, 226004, 203477, 279252, 226007, 226019, 285415, 342762, 277227, 230134, 234234, 279294, 234241, 226051, 277254, 209670, 226058, 234250, 234253, 234263, 234268, 105246, 228129, 234277, 279336, 277289, 289576, 234283, 234286, 234289, 234294, 230199, 162621, 234301, 289598, 277312, 281408, 293693, 162626, 277316, 234311, 234312, 299849, 234317, 277325, 293711, 234323, 234326, 234331, 301918, 279392, 349026, 234340, 174949, 234343, 277354, 234346, 234355, 277366, 234360, 279417, 226170, 209785, 177019, 234361, 277370, 234366, 234367, 158593, 234372, 226181, 113542, 213894, 226184, 234377, 277381, 228234, 226189, 295824, 226194, 234386, 234387, 234392, 324507, 234400, 279456, 277410, 234404, 289703, 234409, 275371, 236461, 234419, 234425, 277435, 234427, 287677, 234430, 226241, 234436, 234438, 52172, 234444, 234445, 183248, 275410, 234451, 234454, 234457, 234463, 234466, 277479, 277480, 234472, 234473, 234477, 234482, 287731, 277492, 314355, 277505, 234498, 234500, 277509, 277510, 230410, 234506, 275469, 277518, 197647, 295953, 277523, 230423, 197657, 281625, 281626, 175132, 234531, 234534, 275495, 310317, 234542, 275505, 275506, 234548, 277563, 234555, 238651, 277566, 230463, 234560, 207938, 234565, 234569, 300111, 207953, 277585, 296018, 234577, 296019, 234583, 234584, 277603, 230499, 281700, 300135, 275565, 156785, 312434, 275571, 300151, 234616, 398457, 234622, 300158, 285828, 302213, 253063, 234632, 275591, 234642, 226452, 308372, 119963, 234656, 330913, 306338, 234659, 234663, 275625, 300201, 275628, 238769, 226481, 277690, 208058, 230588, 277694, 283840, 279747, 279760, 290000, 189652, 203989, 363744, 195811, 298212, 304356, 285929, 279792, 298228, 204022, 120055, 234742, 228600, 208124, 204041, 292107, 277792, 339234, 259363, 199971, 304421, 277800, 113962, 277803, 113966, 226608, 226609, 277815, 300343, 277821, 226624, 15686, 226632, 277834, 294218, 177484, 222541, 296273, 277845, 314709, 283991, 357719, 218462, 224606, 142689, 230756, 163175, 277866, 281962, 284014, 277871, 275831, 181625, 275839, 277890, 277891, 226694, 277896, 277897, 281992, 230799, 112017, 296338, 306579, 277919, 277920, 310692, 279974, 282024, 277936, 279989, 296375, 277949, 296387, 415171, 277957, 163269, 296391, 300487, 277965, 280013, 312782, 284116, 228823, 228824, 226781, 277988, 310757, 316902, 277993, 277994, 296425, 278005, 306677, 278008, 300542, 306693, 175625, 192010, 149007, 65041, 282136, 204313, 278060, 286254, 228917, 226875, 194110, 276040, 366154, 276045, 276046, 286288, 276050, 280147, 300630, 147036, 243292, 282213, 317032, 222832, 276085, 276088, 188031, 192131, 276100, 276101, 229001, 310923, 312972, 278160, 278162, 282259, 276120, 280220, 276126, 276129, 282273, 282276, 278191, 276146, 198324, 286388, 296628, 278214, 276173, 302797, 212688, 302802, 276179, 276180, 286423, 216795, 276195, 153319, 313065, 280300, 419569, 276210, 276211, 276219, 194303, 171776, 288512, 311042, 288516, 278285, 276238, 227091, 294678, 284442, 278299, 276253, 159533, 276282, 276283, 276287, 345919, 276294, 282438, 276298, 296779, 216918, 276311, 307031, 237408, 276325, 282474, 288619, 276332, 276344, 194429, 227199, 40853, 44952, 247712, 227238, 294823, 276401, 276408, 290746, 276413, 276421, 276430, 231375, 153554, 276444, 280541, 276450, 276451, 276454, 276459, 296941, 276468, 276469 ]
cdf7726c6c8e3fe92f4b04b17a952001a1768dec
23d47361ebcfbc558e608681bcc42ff7c291f456
/KofktuSDK/Classes/Extensions/Extensions.swift
9a52387499f165f02012c8331545d8351a6cfccb
[ "MIT" ]
permissive
magi82/KofktuSDK
7f80bc1cce2fbe11c3fc7fee97d9cb06ba8822c9
7da368c8f8bf0d10b806e496525340a4947750e7
refs/heads/master
2020-04-22T20:39:15.770925
2019-01-30T09:20:14
2019-01-30T09:20:14
null
0
0
null
null
null
null
UTF-8
Swift
false
false
11,725
swift
// // Extensions.swift // KofktuSDK // // Created by kofktu on 2016. 7. 7.. // Copyright © 2016년 Kofktu. All rights reserved. // import Foundation import ObjectMapper public extension IntegerLiteralType { public var f: CGFloat { return CGFloat(self) } public var formatted: String { let numberFormatter = NumberFormatter() numberFormatter.numberStyle = .decimal return numberFormatter.string(for: self) ?? String(self) } public func formatted(fractionDigits: Int = 2) -> String { let numberFormatter = NumberFormatter() numberFormatter.numberStyle = .decimal numberFormatter.minimumFractionDigits = 1 numberFormatter.maximumFractionDigits = fractionDigits return numberFormatter.string(for: self) ?? String(self) } } public extension FloatLiteralType { public var f: CGFloat { return CGFloat(self) } public var formatted: String { let numberFormatter = NumberFormatter() numberFormatter.numberStyle = .decimal return numberFormatter.string(for: self) ?? String(self) } public func formatted(fractionDigits: Int = 2) -> String { let numberFormatter = NumberFormatter() numberFormatter.numberStyle = .decimal numberFormatter.minimumFractionDigits = 1 numberFormatter.maximumFractionDigits = fractionDigits return numberFormatter.string(for: self) ?? String(self) } } public extension Array { func filter(duplicates includeElement: (_ lhs:Element, _ rhs:Element) -> Bool) -> [Element] { var results = [Element]() forEach { (element) in let existingElements = results.filter { return includeElement(element, $0) } if existingElements.count == 0 { results.append(element) } } return results } @discardableResult public mutating func remove<T: Equatable>(object: T) -> Bool { for (index, obj) in enumerated() { if let to = obj as? T, to == object { remove(at: index) return true } } return false } public mutating func suffle() { guard count > 1 else { return } for i in 0 ..< (count - 1) { let j = Int(arc4random_uniform(UInt32(count - i))) + i guard i != j else { continue } swapAt(i, j) } } public func join(with separator: String, toString: (Element) -> String?) -> String { var stringArray = Array<String>() for element in self { if let string = toString(element) { stringArray.append(string) } } return stringArray.joined(separator: separator) } } public extension Dictionary { public mutating func merge(dict: [Key: Value]) { for (key, value) in dict { updateValue(value, forKey: key) } } } public extension String { public var urlEncoded: String? { let characterSet = NSCharacterSet(charactersIn: "\n ;:\\@&=+$,/?%#[]|\"<>").inverted return addingPercentEncoding(withAllowedCharacters: characterSet) } public var urlDecoded: String? { return removingPercentEncoding } public var base64Encoded: String? { return data(using: .utf8, allowLossyConversion: true)?.base64EncodedString(options: []) } public var base64Decoded: String? { guard let data = Data(base64Encoded: self, options: []) else { return nil } return String(data: data, encoding: .utf8) } public var localized: String { return NSLocalizedString(self, comment: "") } public func localized(args: CVarArg...) -> String { let format = NSLocalizedString(self, comment: "") return NSString(format: format, arguments: getVaList(args)) as String } public var ns: NSString { return self as NSString } public func indexOf(string: String) -> Int? { guard let range = range(of: string) else { return nil } return distance(from: startIndex, to: range.lowerBound) } public subscript (i: Int) -> Character { return self[self.index(self.startIndex, offsetBy: i)] } // for convenience we should include String return public subscript (i: Int) -> String { return String(self[i] as Character) } public subscript (r: Range<Int>) -> String { let start = self.index(self.startIndex, offsetBy: r.lowerBound) let end = self.index(self.startIndex, offsetBy: r.upperBound) return String(self[start...end]) } public func substring(from: Int) -> String { let start = index(startIndex, offsetBy: from) return String(self[start...]) } public func substring(to: Int) -> String { let end = index(startIndex, offsetBy: to) return String(self[..<end]) } public func substring(from: Int, to: Int) -> String { guard from < to else { return "" } let start = index(startIndex, offsetBy: from) let end = index(startIndex, offsetBy: to) return String(self[start..<end]) } public subscript (range: Range<Int>) -> String? { //Check for out of boundary condition if count < range.upperBound || count < range.lowerBound { return nil } let start = index(startIndex, offsetBy: range.lowerBound) let end = index(startIndex, offsetBy: range.upperBound) return String(self[start..<end]) } public func substring(nsRange range: NSRange) -> String { return (self as NSString).substring(with: range) } public func nsRangeOf(string: String) -> NSRange { return (self as NSString).range(of: string) } public func trim() -> String { return trimmingCharacters(in: CharacterSet.whitespaces) } public func queryTokenizing() -> [String: String] { var result: [String:String] = [:] let tokens = split(separator: "&").map(String.init) for token in tokens { if let index = token.index(of: "=") { let key = String(token[..<index]) let value = String(token[token.index(index, offsetBy: 1)...]) result[key] = value } } return result } public func numberOfLines(size: CGSize, font: UIFont) -> Int { let storage = NSTextStorage(string: self, attributes: [NSAttributedString.Key.font: font]) let container = NSTextContainer(size: size) container.lineBreakMode = .byWordWrapping container.maximumNumberOfLines = 0 container.lineFragmentPadding = 0 let manager = NSLayoutManager() manager.textStorage = storage manager.addTextContainer(container) var numberOfLines = 0 var index = 0 var lineRange = NSRange(location: 0, length: 0) while index < manager.numberOfGlyphs { manager.lineFragmentRect(forGlyphAt: index, effectiveRange: &lineRange) index = NSMaxRange(lineRange) numberOfLines += 1 } return numberOfLines } public func boundingRect(with size: CGSize, attributes: [NSAttributedString.Key: Any]) -> CGRect { let options: NSStringDrawingOptions = [.usesLineFragmentOrigin, .usesFontLeading] let rect = self.boundingRect(with: size, options: options, attributes: attributes, context: nil) return snap(rect) } public func size(thatFits size: CGSize, font: UIFont, maximumNumberOfLines: Int = 0) -> CGSize { let attributes: [NSAttributedString.Key: Any] = [.font: font] var size = self.boundingRect(with: size, attributes: attributes).size if maximumNumberOfLines > 0 { size.height = min(size.height, CGFloat(maximumNumberOfLines) * font.lineHeight) } return size } public func width(with font: UIFont, maximumNumberOfLines: Int = 0) -> CGFloat { let size = CGSize(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude) return self.size(thatFits: size, font: font, maximumNumberOfLines: maximumNumberOfLines).width } public func height(thatFitsWidth width: CGFloat, font: UIFont, maximumNumberOfLines: Int = 0) -> CGFloat { let size = CGSize(width: width, height: CGFloat.greatestFiniteMagnitude) return self.size(thatFits: size, font: font, maximumNumberOfLines: maximumNumberOfLines).height } } public extension Data { public var hexString: String { let bytes = UnsafeBufferPointer<UInt8>(start: (self as NSData).bytes.bindMemory(to: UInt8.self, capacity: count), count:count) return bytes .map { String(format: "%02hhx", $0) } .reduce("", { $0 + $1 }) } } public extension Date { public var betweenNow: (year: Int, month: Int, day: Int, hour: Int, minute: Int, second: Int)? { let components = Calendar.kr_calendar.dateComponents([.year, .month, .day, .hour, .minute, .second], from: self, to: Date()) guard let year = components.year, let month = components.month, let day = components.day, let hour = components.hour, let minute = components.minute, let second = components.second else { return nil } return (year: year, month: month, day: day, hour: hour, minute: minute, second: second) } public static func date(kr_formatted string: String?, dateFormat: String = "yyyy-MM-dd HH:mm:ss") -> Date? { guard let string = string else { return nil } let dateFormatter = DateFormatter.kr_dateFormatter dateFormatter.dateFormat = dateFormat return dateFormatter.date(from: string) } } public extension DateFormatter { public static var kr_dateFormatter: DateFormatter { let dateFormatter = DateFormatter() dateFormatter.locale = Locale(identifier: "ko_KR") dateFormatter.timeZone = TimeZone(secondsFromGMT: 60 * 60 * 9) return dateFormatter } } public extension Calendar { public static var kr_calendar: Calendar { var calendar = Calendar.current let dateFormatter = DateFormatter.kr_dateFormatter calendar.locale = dateFormatter.locale return calendar } } public extension UserDefaults { public static func disableLayoutConstraintLog() { UserDefaults.standard.setValue(false, forKey: "_UIConstraintBasedLayoutLogUnsatisfiable") } public func set<T: BaseMappable>(object: T?, forKey key: String) { set(object?.toJSONString(), forKey: key) } public func object<T: BaseMappable>(forKey key: String) -> T? { return string(forKey: key).flatMap { Mapper<T>().map(JSONString: $0) } } } public extension Bundle { public static var appVersion: String? { return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String } public static var buildVersion: String? { return Bundle.main.object(forInfoDictionaryKey: kCFBundleVersionKey as String) as? String } }
[ -1 ]
0631f5ab5e8596a40e9d818a73d86c683c07f083
867491e3ff3b1c0d35b19d882311447a22bd4937
/rural/ruralareaapp/ruralareaapp/AppDelegate.swift
9d4257c82397b0bcd7e152a6b0bd3e2eb0a2b38a
[]
no_license
ruralkh/ruralarea
468ea758d0e1a5efcb5e1dc0144f088be4c39343
cf88fc886510d7e43fd1f90bf5c080606b1585a8
refs/heads/master
2020-03-12T08:00:41.571740
2018-04-21T23:32:33
2018-04-21T23:32:33
130,518,666
0
0
null
null
null
null
UTF-8
Swift
false
false
4,593
swift
// // AppDelegate.swift // ruralareaapp // // Created by Ron Rith on 4/22/18. // Copyright © 2018 Ron Rith. All rights reserved. // import UIKit import CoreData @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:. // Saves changes in the application's managed object context before the application terminates. self.saveContext() } // MARK: - Core Data stack lazy var persistentContainer: NSPersistentContainer = { /* The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. */ let container = NSPersistentContainer(name: "ruralareaapp") container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. /* Typical reasons for an error here include: * The parent directory does not exist, cannot be created, or disallows writing. * The persistent store is not accessible, due to permissions or data protection when the device is locked. * The device is out of space. * The store could not be migrated to the current model version. Check the error message to determine what the actual problem was. */ fatalError("Unresolved error \(error), \(error.userInfo)") } }) return container }() // MARK: - Core Data Saving support func saveContext () { let context = persistentContainer.viewContext if context.hasChanges { do { try context.save() } catch { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. let nserror = error as NSError fatalError("Unresolved error \(nserror), \(nserror.userInfo)") } } } }
[ 294405, 243717, 163848, 313353, 320008, 320014, 313360, 288275, 322580, 289300, 290326, 329747, 139803, 103964, 322080, 306721, 229408, 296483, 322083, 229411, 306726, 309287, 308266, 292907, 217132, 322092, 40495, 316465, 288306, 322102, 324663, 164408, 308281, 322109, 286783, 315457, 313409, 313413, 349765, 320582, 309832, 288329, 242250, 215117, 196177, 241746, 344661, 231000, 212571, 300124, 287323, 309342, 325220, 306790, 290409, 310378, 296043, 311914, 152685, 334446, 239726, 307310, 322666, 292466, 314995, 307315, 314487, 291450, 314491, 222846, 288383, 318599, 312970, 239252, 311444, 294038, 311449, 323739, 300194, 298662, 233638, 233644, 313005, 286896, 295600, 300208, 286389, 294070, 125111, 234677, 309439, 235200, 284352, 296641, 242371, 302787, 284360, 321228, 319181, 298709, 284374, 189654, 182486, 320730, 241371, 311516, 357083, 179420, 322272, 317665, 298210, 165091, 311525, 288489, 290025, 229098, 307436, 304365, 323310, 125167, 313073, 286455, 306424, 322299, 319228, 302332, 319231, 184576, 309505, 241410, 311043, 366339, 309509, 318728, 125194, 234763, 321806, 125201, 296218, 313116, 237858, 326434, 295716, 313125, 300836, 289577, 125226, 133421, 317233, 241971, 316726, 318264, 201530, 313660, 159549, 287038, 292159, 218943, 182079, 288578, 301893, 234828, 292172, 300882, 379218, 321364, 243032, 201051, 230748, 258397, 294238, 298844, 291169, 199020, 293741, 266606, 319342, 292212, 313205, 244598, 316788, 124796, 196988, 305022, 317821, 243072, 314241, 303999, 313215, 242050, 325509, 293767, 316300, 306576, 322448, 308114, 319900, 298910, 313250, 308132, 316327, 306605, 316334, 324015, 324017, 200625, 300979, 316339, 322998, 67000, 316345, 296888, 300987, 319932, 310718, 292288, 317888, 323520, 312772, 214980, 298950, 306632, 310733, 289744, 310740, 235994, 286174, 315359, 240098, 323555, 236008, 319465, 248299, 311789, 326640, 188913, 203761, 320498, 314357, 288246, 309243, 300540, 310782 ]
4e708de0e05d23287343f0ee52cc79135afdfbff
1b0f9b0eacd9ea0d0a19254818b52150c31d36a5
/Sources/Controllers/Stream/Calculators/StreamTextCellSizeCalculator.swift
5f6d464a64c2b0b85a6a1b3e6ed5a0c943905946
[ "MIT" ]
permissive
mrmign/ello-ios
4c0ff81ab1462f87e829cb4ffa7128d1730a1cee
e4759e9ddb69f8b9a9c201e8ca3d6696c505877a
refs/heads/master
2021-06-28T04:15:08.188819
2017-09-12T19:10:57
2017-09-12T20:43:46
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,393
swift
//// /// StreamTextCellSizeCalculator.swift // class StreamTextCellSizeCalculator: NSObject, UIWebViewDelegate { let webView: UIWebView fileprivate typealias CellJob = (cellItems: [StreamCellItem], width: CGFloat, columnCount: Int, completion: Block) fileprivate var cellJobs: [CellJob] = [] fileprivate var cellItems: [StreamCellItem] = [] fileprivate var maxWidth: CGFloat fileprivate var completion: Block = {} init(webView: UIWebView = UIWebView()) { self.webView = webView self.maxWidth = 0 super.init() self.webView.delegate = self } // MARK: Public func processCells(_ cellItems: [StreamCellItem], withWidth width: CGFloat, columnCount: Int, completion: @escaping Block) { guard cellItems.count > 0 else { completion() return } let job: CellJob = (cellItems: cellItems, width: width, columnCount: columnCount, completion: completion) cellJobs.append(job) if cellJobs.count == 1 { processJob(job) } } // MARK: Private fileprivate func processJob(_ job: CellJob) { self.completion = { if self.cellJobs.count > 0 { self.cellJobs.remove(at: 0) } job.completion() if let nextJob = self.cellJobs.safeValue(0) { self.processJob(nextJob) } } self.cellItems = job.cellItems if job.columnCount == 1 { self.maxWidth = job.width } else { self.maxWidth = floor(job.width / CGFloat(job.columnCount) - StreamKind.following.columnSpacing * CGFloat(job.columnCount - 1)) } loadNext() } fileprivate func loadNext() { guard !self.cellItems.isEmpty else { completion() return } let item = cellItems[0] if item.jsonable is ElloComment { // need to add back in the postMargin (15) since the maxWidth should already // account for 15 on the left that is part of the commentMargin (60) self.webView.frame = self.webView.frame.with(width: maxWidth - StreamTextCell.Size.commentMargin + StreamTextCell.Size.postMargin) } else { self.webView.frame = self.webView.frame.with(width: maxWidth) } if let textElement = item.type.data as? TextRegion { let content = textElement.content let strippedContent = content.stripHtmlImgSrc() let html = StreamTextCellHTML.postHTML(strippedContent) // needs to use the same width as the post text region self.webView.loadHTMLString(html, baseURL: URL(string: "/")) } else { self.cellItems.remove(at: 0) loadNext() } } func webViewDidFinishLoad(_ webView: UIWebView) { let textHeight = self.webView.windowContentSize()?.height assignCellHeight(textHeight ?? 0) } fileprivate func assignCellHeight(_ height: CGFloat) { if let cellItem = self.cellItems.safeValue(0) { self.cellItems.remove(at: 0) cellItem.calculatedCellHeights.webContent = height cellItem.calculatedCellHeights.oneColumn = height cellItem.calculatedCellHeights.multiColumn = height } loadNext() } }
[ -1 ]
501623297b1b301c40b3637380341c4ab2ed9c1d
809afbcc07e0cb723d62bba6b0e7be25c984ad4f
/2020-spring/Kungurov_Kirill/hw2/News/News/Controllers/Cell/ArticleTableViewCell.swift
5826d15ea7b44354f907849ffc5d5460a7151f71
[]
no_license
GladunVladimir/ios
bc74c35492e323d80c3d0c6291106e866e67e740
c0e4542cb907103d3f5535e32d13825b9017cb78
refs/heads/master
2021-02-25T00:43:55.417539
2020-05-04T16:43:36
2020-05-04T16:43:36
245,445,048
1
0
null
2020-03-06T14:48:50
2020-03-06T14:48:50
null
UTF-8
Swift
false
false
755
swift
// // ArticleTableViewCell.swift // News // // Created by Kirill Kungurov on 14.03.2020. // Copyright © 2020 Kirill Kungurov. All rights reserved. // import Kingfisher import UIKit final class ArticleTableViewCell: UITableViewCell { @IBOutlet private var dateLabel: UILabel! @IBOutlet private var articleTitleLabel: UILabel! @IBOutlet private var articalImageView: UIImageView! override func prepareForReuse() { super.prepareForReuse() articalImageView.image = nil articalImageView.kf.cancelDownloadTask() } func setUp(with article: Article) { dateLabel.text = article.date articleTitleLabel.text = article.title articalImageView.kf.setImage(with: article.imageUrl) } }
[ -1 ]
80c76a0860ff1f2e62b811c61b38591ec36ecbc7
4520af61db6c2c455a4013e5d9acd6f742bd82dc
/pushView_Login/AppDelegate.swift
7fb0c1bb8aea50bf8c7969fd85a4dd3112406565
[]
no_license
lehuudungle/Push_pop_c-c-view
4b372385045aa42bdaeefbd678a9871f1f146b30
9888d95e5b25d03f6ae03c505670b1bd3415bd21
refs/heads/master
2020-09-21T04:51:53.185704
2016-08-31T09:47:24
2016-08-31T09:47:24
67,024,896
0
0
null
null
null
null
UTF-8
Swift
false
false
2,137
swift
// // AppDelegate.swift // pushView_Login // // Created by Admin on 8/31/16. // Copyright © 2016 Admin. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 352284, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 229426, 237618, 229428, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 286797, 311375, 237646, 163920, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 278648, 131192, 237693, 327814, 131209, 417930, 303241, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 278760, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 278849, 319809, 319810, 319814, 311623, 319818, 311628, 229709, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 319978, 279020, 172526, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 287238, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 303773, 295583, 172702, 230045, 287394, 287390, 303780, 172705, 287398, 172707, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 279231, 287423, 328384, 287427, 312006, 107208, 279241, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 312035, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 222018, 295755, 377676, 148302, 287569, 303959, 279383, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 213895, 320391, 304007, 304009, 304011, 230284, 304013, 213902, 279438, 295822, 189329, 295825, 304019, 189331, 279445, 58262, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 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, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 279661, 205934, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 350308, 230592, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 279788, 320748, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 230718, 296259, 378181, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 304506, 304505, 181626, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 173488, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 280014, 312783, 288208, 230865, 370130, 288210, 288212, 280021, 288214, 222676, 239064, 288217, 288218, 280027, 329177, 288220, 239070, 288224, 370146, 280034, 280036, 288226, 280038, 288229, 288230, 288232, 288234, 320998, 288236, 288238, 288240, 291754, 288242, 296435, 288244, 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, 206536, 280264, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 304968, 280393, 280402, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280458, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 223303, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 223327, 280671, 149599, 321634, 149601, 149603, 329830, 280681, 313451, 223341, 280687, 313458, 280691, 215154, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 288936, 100520, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 280819, 157940, 125171, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 280835, 125187, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 354653, 313700, 280937, 313705, 280940, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 281084, 240124, 305662, 305664, 240129, 305666, 305668, 240132, 223749, 281095, 338440, 150025, 223752, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 199262, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 199367, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 281401, 289593, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 240519, 322440, 338823, 314249, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 281581, 183277, 322550, 134142, 322563, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 281923, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 298365, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 224657, 306581, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 282410, 241450, 306988, 306991, 315184, 323376, 315190, 241464, 282425, 159545, 298811, 307009, 413506, 241475, 307012, 148946, 315211, 282446, 307027, 315221, 282454, 315223, 241496, 323414, 241498, 307035, 307040, 282465, 110433, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 315483, 217179, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 282931, 307508, 315701, 307510, 332086, 307512, 151864, 176435, 307515, 168245, 282942, 307518, 151874, 282947, 282957, 323917, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 283080, 176592, 315856, 315860, 176597, 127447, 283095, 299481, 176605, 242143, 291299, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 127497, 233994, 135689, 291341, 233998, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 381677, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 201603, 291714, 234373, 226182, 234375, 291716, 226185, 308105, 234379, 234384, 234388, 234390, 226200, 324504, 234393, 209818, 308123, 324508, 234398, 234396, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 234414, 324527, 291760, 234417, 201650, 324531, 226230, 234422, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 226245, 234437, 234439, 234434, 234443, 291788, 275406, 234446, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 275545, 242777, 234585, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 234607, 160879, 275569, 234610, 300148, 234614, 398455, 144506, 275579, 234618, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 275594, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 234648, 308379, 283805, 234653, 324766, 119967, 234657, 300189, 324768, 242852, 283813, 234661, 300197, 234664, 275626, 234667, 316596, 308414, 234687, 300226, 308418, 226500, 234692, 300229, 308420, 283844, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 283904, 300289, 292097, 300292, 300294, 275719, 300299, 177419, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 283963, 243003, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 284076, 144812, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 284099, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 259567, 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, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 276052, 276053, 284245, 284247, 317015, 284249, 243290, 284251, 300628, 284253, 235097, 284255, 300638, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 276098, 284290, 325250, 284292, 292479, 292485, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 317158, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 284418, 358146, 317187, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 186139, 300828, 300830, 276255, 325408, 284449, 300834, 300832, 227109, 317221, 358183, 186151, 276268, 300845, 194351, 243504, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 227314, 276466, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 276539, 235579, 235581, 325692, 178238, 276544, 284739, 292934, 276553, 243785, 350293, 350295, 194649, 227418, 309337, 350302, 227423, 194654, 194657, 178273, 276579, 227426, 194660, 227430, 276583, 309346, 309348, 276586, 309350, 309352, 309354, 276590, 350313, 350316, 350321, 284786, 276595, 227440, 301167, 350325, 350328, 292985, 301178, 292989, 292993, 301185, 350339, 317570, 317573, 350342, 227463, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 227540, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 276713, 317674, 325867, 243948, 194801, 227571, 309491, 276725, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 211241, 325937, 276789, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 285051, 211324, 227709, 285061, 317833, 178572, 285070, 178575, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 277011, 317971, 309781, 309779, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 277106, 121458, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 318132, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 285453, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277314, 277317, 277322, 277329, 162643, 310100, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 326514, 310134, 277368, 15224, 236408, 416639, 416640, 113538, 310147, 416648, 277385, 39817, 187274, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 121850, 302075, 244731, 293882, 293887, 277504, 277507, 277511, 277519, 293908, 277526, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 277608, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 253064, 302218, 285835, 294026, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 285862, 277671, 302248, 64682, 277678, 228526, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 204023, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 294211, 302403, 277832, 384328, 277836, 294221, 326991, 294223, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 277892, 327046, 253320, 310665, 318858, 277898, 277894, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 277923, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 64966, 245191, 163272, 302534, 310727, 277959, 292968, 302541, 277966, 302543, 277963, 310737, 277971, 277975, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 286188, 310764, 278000, 278003, 310772, 228851, 278006, 212472, 278009, 40440, 40443, 286203, 228864, 40448, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187939, 294435, 40484, 286246, 294439, 286248, 278057, 294440, 294443, 40486, 294445, 40488, 310831, 40491, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 228944, 212560, 400976, 40533, 147032, 40537, 40539, 278109, 40541, 40544, 40548, 40550, 286312, 286313, 40554, 40552, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 278150, 310925, 286354, 278163, 302740, 122517, 278168, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 278227, 229076, 286420, 319187, 286425, 319194, 278235, 301163, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 171774, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 237409, 294776, 360317, 294785, 327554, 40840, 40851, 294803, 188312, 294811, 319390, 294817, 319394, 40865, 294821, 311209, 180142, 294831, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
5e4a9abce80378359cd41a491a365a8fb77fb1ea
1969069c2bb77582401e540dfb785f1f2282824b
/Swell/LogLocation.swift
7d2ca040dcc366c16575de667987e629885f7b47
[ "Apache-2.0" ]
permissive
emmerson/Swell
15f9ca62689ce8f17d53ec8bdd56a00c2900796e
59a574a3117061427dfbb677d5608c212362106e
refs/heads/master
2021-01-17T21:31:42.544269
2014-08-05T06:28:42
2014-08-05T06:28:42
null
0
0
null
null
null
null
UTF-8
Swift
false
false
4,114
swift
// // LogLocation.swift // Swell // // Created by Hubert Rabago on 6/26/14. // Copyright (c) 2014 Minute Apps LLC. All rights reserved. // import Foundation public protocol LogLocation { //class func getInstance(param: AnyObject? = nil) -> LogLocation func log(message: @autoclosure() -> String); func enable(); func disable(); func description() -> String } public class ConsoleLocation: LogLocation { var enabled = true // Use the static-inside-class-var approach to getting a class var instance class var instance: ConsoleLocation { struct Static { static let internalInstance = ConsoleLocation() } return Static.internalInstance } public class func getInstance() -> LogLocation { return instance } public func log(message: @autoclosure() -> String) { if enabled { println(message()) } } public func enable() { enabled = true } public func disable() { enabled = false } public func description() -> String { return "ConsoleLocation" } } // Use the globally-defined-var approach to getting a class var dictionary var internalFileLocationDictionary = Dictionary<String, FileLocation>() public class FileLocation: LogLocation { var enabled = true var filename: String var fileHandle: NSFileHandle? public class func getInstance(filename: String) -> LogLocation { var temp = internalFileLocationDictionary[filename] if let result = temp { return result } else { let result: FileLocation = FileLocation(filename: filename) internalFileLocationDictionary[filename] = result return result } } init(filename: String) { self.filename = filename self.setDirectory() fileHandle = nil openFile() } deinit { closeFile() } public func log(message: @autoclosure() -> String) { //message.writeToFile(filename, atomically: false, encoding: NSUTF8StringEncoding, error: nil); if (!enabled) { return } let output = message() + "\n" if let handle = fileHandle { handle.seekToEndOfFile() handle.writeData(output.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)) } } func setDirectory() { let temp: NSString = self.filename if temp.rangeOfString("/").location != Foundation.NSNotFound { // "/" was found in the filename, so we use whatever path is already there if (self.filename.hasPrefix("~/")) { self.filename = self.filename.stringByExpandingTildeInPath } return } let dirs : [String]? = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.AllDomainsMask, true) as? [String] if let directories:[String] = dirs { let dir = directories[0]; //documents directory let path = dir.stringByAppendingPathComponent(self.filename); self.filename = path; } } func openFile() { // open our file //Swell.info("Opening \(self.filename)") if !NSFileManager.defaultManager().fileExistsAtPath(self.filename) { NSFileManager.defaultManager().createFileAtPath(self.filename, contents: nil, attributes: nil) } fileHandle = NSFileHandle(forWritingAtPath:self.filename); //Swell.debug("fileHandle is now \(fileHandle)") } func closeFile() { // close the file, if it's open if let handle = fileHandle { handle.closeFile() } fileHandle = nil } public func enable() { enabled = true } public func disable() { enabled = false } public func description() -> String { return "FileLocation filename=\(filename)" } }
[ -1 ]
0d14c96a5ec26e0f657b25b6acea59e6bb105f1e
a37f3977eca6bb33de4bc018db149f39d2c3d195
/Tank_Calculator/Custom Attributes/Reachability.swift
76a9548a9b077001570bada862f5b30c6bdc161e
[]
no_license
Manibasto/Tank_Calculator
2075f54cec68fd9e8cc1123d7906e80a75632d9a
571e4e171bbb7e10e0d053fddaabd7d88eea7616
refs/heads/master
2020-06-16T06:09:17.740040
2019-07-06T04:44:49
2019-07-06T04:44:49
195,497,984
1
0
null
null
null
null
UTF-8
Swift
false
false
1,421
swift
import Foundation import SystemConfiguration public class Reachability { class func isConnectedToNetwork() -> Bool { var zeroAddress = sockaddr_in(sin_len: 0, sin_family: 0, sin_port: 0, sin_addr: in_addr(s_addr: 0), sin_zero: (0, 0, 0, 0, 0, 0, 0, 0)) zeroAddress.sin_len = UInt8(MemoryLayout.size(ofValue: zeroAddress)) zeroAddress.sin_family = sa_family_t(AF_INET) let defaultRouteReachability = withUnsafePointer(to: &zeroAddress) { $0.withMemoryRebound(to: sockaddr.self, capacity: 1) {zeroSockAddress in SCNetworkReachabilityCreateWithAddress(nil, zeroSockAddress) } } var flags: SCNetworkReachabilityFlags = SCNetworkReachabilityFlags(rawValue: 0) if SCNetworkReachabilityGetFlags(defaultRouteReachability!, &flags) == false { return false } /* Only Working for WIFI let isReachable = flags == .reachable let needsConnection = flags == .connectionRequired return isReachable && !needsConnection */ // Working for Cellular and WIFI let isReachable = (flags.rawValue & UInt32(kSCNetworkFlagsReachable)) != 0 let needsConnection = (flags.rawValue & UInt32(kSCNetworkFlagsConnectionRequired)) != 0 let ret = (isReachable && !needsConnection) return ret } }
[ 243718, 317578, 132365, 258319, 303249, 333465, 237596, 210845, 317216, 252071, 341929, 215082, 300203, 178355, 140084, 340280, 316987, 198205, 361279, 369729, 391623, 334024, 348243, 330972, 430429, 195946, 301433 ]
36d766b58682653cc191d21f028aed425eb29acd
77d6d6850d41cc6990dd2c9b8788dda91ea0157d
/AcceloCrimeAPI/API/HttpClient.swift
183a5dbf5561fb74cf9237430499f9e1e1921dd3
[]
no_license
jaysalvador/accelo
d1e21a8807b8b466ed5287b2a786a67bd2b14f39
06d678cdb43a0fe48213c554e26122042e1a45dd
refs/heads/master
2022-07-02T16:13:11.429563
2020-05-18T02:50:37
2020-05-18T02:50:37
264,675,696
0
0
null
null
null
null
UTF-8
Swift
false
false
5,349
swift
// // HttpClient.swift // Accelo // // Created by Jay Salvador on 17/5/20. // Copyright © 2020 Jay Salvador. All rights reserved. // import Foundation /// function type for the return value /// `T` can be any model object to represent the response from JSON /// `HTTPError` returns as the error type public typealias HttpCompletionClosure<T> = ((Result<T, HttpError>) -> Void) /// Protocol to define function signatures for `HttpClient` public protocol HttpClientProtocol { func request<T>(_ type: T.Type, endpoint: String, httpMethod: HttpMethod, headers: Dictionary<String, String>?, onCompletion: HttpCompletionClosure<T>?) where T: Decodable } /// Class that helps retrieve JSON data and decodes into the specified response object public class HttpClient: HttpClientProtocol { private let baseUrl: String private let urlSession: URLSessionProtocol /// Convenience init with the pre-assigned `baseUrl` and `urlSession` public convenience init?() { self.init( baseUrl: "https://data.police.uk/api", urlSession: URLSession.shared) } /// Creates a custom instance of `HttpClient` /// - Parameter _baseUrl: path of the API /// - Parameter _urlSession: `URLSession` Object init(baseUrl _baseUrl: String, urlSession _urlSession: URLSessionProtocol) { self.baseUrl = _baseUrl self.urlSession = _urlSession } /// Creates an HTTP request to a particular service endpoint /// - Parameter type: The class type you want to bind the response to /// - Parameter endpoint: API service enpoint path /// - Parameter httpMethod: HTTP Method (get, post, put, delete) /// - Parameter headers: additional HTTP headers /// - Parameter onCompletion: completion closure with `Result` containing the binded model or error states public func request<T>(_ type: T.Type, endpoint: String, httpMethod: HttpMethod, headers: Dictionary<String, String>?, onCompletion: HttpCompletionClosure<T>?) where T: Decodable { DispatchQueue.background.async { if let url = URL(string: self.baseUrl + endpoint) { var request = URLRequest(url: url) request.httpMethod = httpMethod.rawValue request.addValue("application/json", forHTTPHeaderField: "Accept") if let headers = headers { for (key, value) in headers { request.addValue(value, forHTTPHeaderField: key) } } self.send(request, returnType: type, onCompletion: onCompletion) } } } /// Sends requests to the API service /// - Parameter request: `URLRequest` object /// - Parameter returnType: class type your response would be binded to /// - Parameter onCompletion: completion closure with `Result` containing the binded model or error states private func send<T>(_ request: URLRequest?, returnType: T.Type, onCompletion: HttpCompletionClosure<T>?) where T: Decodable { guard let request = request, let url = request.url else { onCompletion?(.failure(HttpError.nilRequest)) return } let start = Date() let task = urlSession.dataTask(with: request) { (data, urlResponse, error) -> Void in let interval = Date().timeIntervalSince(start) print("HttpClient request time: \(ceil(interval * 1000.0)) ms (\(url))") if let httpUrlResponse = urlResponse as? HTTPURLResponse, httpUrlResponse.statusCode < 400 { if let data = data { do { let decoder = JSONDecoder() let decoded = try decoder.decode(returnType, from: data) decoder.dateDecodingStrategy = .formatted(.dateMonth) DispatchQueue.main.async { onCompletion?(.success(decoded)) } } catch { DispatchQueue.main.async { onCompletion?(.failure(HttpError.decoding(error))) } } return } } var statusCode: Int? if let httpUrlResponse = urlResponse as? HTTPURLResponse { statusCode = httpUrlResponse.statusCode } DispatchQueue.main.async { onCompletion?(.failure(HttpError.unknown(statusCode: statusCode, data: data))) } } task.resume() } }
[ -1 ]
66b8f25c733e50b364a4b2c9e063bbda8fde6f8a
5a25976c450daae2642b4dec881324661ee527c1
/WeatherApp/WeatherApp/Scenes/Flight/Entity/FlightModels.swift
d28cdc25b3d53bf8a078552309ea40b6dcee8897
[]
no_license
dpliushchaiwork/WeatherApp
0ead9d2b815f080ff0887079a5c91a527117a921
1968e222bae98fc6cf4815a5c16e3a5dcea69d04
refs/heads/master
2022-12-26T11:03:55.012422
2020-09-24T07:47:41
2020-09-24T07:47:41
298,206,006
0
0
null
null
null
null
UTF-8
Swift
false
false
1,339
swift
import UIKit enum FlightModels { enum Popular { struct Request { } struct Response { struct Item { let identifier: Int let origin: String let destination: String let airlineName: String let airlineLogo: URL? let departureDate: Date? let returnDate: Date? let price: Double let transfers: Int } let flights: [Item] let currency: String } struct ViewModel { struct Item { let identifier: Int let origin: String let destination: String let airlineName: String let airlineLogo: URL? let departureDate: String? let returnDate: String? let price: String let transfers: String } let flights: [Item] } } enum SelectFlight { struct Request { let identifier: Int } } enum Failure { struct Response { let error: Error } struct ViewModel { let errorMessage: String } } }
[ -1 ]
386ad8aadc37ba6a54b87ce165be9e348f5d99a4
b0c2eb9262fca86c1f58152d80c12084844f17a1
/HW1_KMH/AppDelegate.swift
8403c669e72a126d04c0d7c31d1c6b52e7e193c5
[]
no_license
munii11/Drawing-Lot-Application
99a318a92e284b95d47e97dc450598525e43b3e3
4507bdd9f7d7c7ee369e1d24ef2bcd7b1ad77eff
refs/heads/master
2020-03-12T10:04:20.000081
2018-04-22T12:46:14
2018-04-22T12:46:14
130,565,601
0
0
null
null
null
null
UTF-8
Swift
false
false
2,179
swift
// // AppDelegate.swift // HW1_KMH // // Created by SWUCOMPUTER on 2018. 4. 14.. // Copyright © 2018년 SWUCOMPUTER. 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, 237646, 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, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 320007, 287238, 172552, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 189039, 295538, 172660, 189040, 189044, 287349, 287355, 287360, 295553, 295557, 311942, 303751, 287365, 352905, 311946, 279178, 287371, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 287390, 303773, 164509, 172705, 287394, 172702, 303780, 172707, 287398, 205479, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 279231, 287427, 312005, 312006, 107208, 107212, 172748, 287436, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 279267, 312035, 295654, 279272, 312048, 230128, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 304007, 320391, 213895, 304009, 304011, 230284, 304013, 279438, 295822, 189329, 295825, 189331, 304019, 58262, 304023, 279452, 234648, 410526, 279461, 279462, 304042, 213931, 304055, 230327, 287675, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 295949, 230413, 197645, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 296004, 132165, 336964, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 361576, 296040, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 165038, 238766, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 296264, 238919, 320840, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 148843, 230763, 230768, 296305, 312692, 230773, 304505, 181626, 304506, 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, 214535, 304651, 370187, 304653, 230923, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 190118, 198310, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 206536, 280264, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 18140, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 419570, 288499, 321266, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 304968, 280393, 280402, 173907, 313176, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 313340, 239612, 288764, 239617, 313347, 288773, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 215154, 313458, 280691, 149618, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 321740, 313548, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 354653, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 240011, 199051, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 281095, 223752, 338440, 150025, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 297594, 281210, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 338823, 322440, 314249, 240519, 183184, 240535, 289687, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 306555, 314747, 298365, 290171, 290174, 224641, 281987, 314756, 298372, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 306694, 192008, 323084, 257550, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282261, 298651, 323229, 282269, 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, 307009, 413506, 241475, 307012, 298822, 148946, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 44948, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 290739, 241588, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 217179, 315483, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 307307, 45163, 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, 307388, 176316, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 127407, 291247, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 315856, 176592, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 127457, 291299, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 135672, 233979, 291323, 127485, 291330, 127490, 283142, 127494, 127497, 233994, 135689, 291341, 233998, 127506, 234003, 127509, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 135844, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 242450, 234258, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 201557, 185173, 234329, 234333, 308063, 234336, 234338, 349027, 242530, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 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, 234414, 234422, 226230, 324536, 275384, 234428, 291773, 234431, 242623, 324544, 324546, 234434, 324548, 234437, 226245, 234439, 226239, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 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, 226433, 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, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 283917, 300301, 177424, 275725, 349464, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 284010, 324978, 136562, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 226802, 292338, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 308790, 284215, 316983, 194103, 284218, 194101, 226877, 292414, 284223, 284226, 284228, 292421, 226886, 284231, 128584, 243268, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 292433, 284243, 300628, 284245, 194130, 284247, 317015, 235097, 243290, 276053, 284249, 284251, 300638, 284253, 284255, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 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, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 292681, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 358292, 284564, 317332, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 292843, 276460, 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, 292934, 243785, 276553, 350293, 350295, 309337, 194649, 227418, 350299, 350302, 227423, 194654, 178273, 309346, 194657, 309348, 350308, 309350, 227426, 309352, 350313, 309354, 301163, 350316, 194660, 227430, 276583, 276590, 350321, 284786, 276595, 301167, 350325, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 309455, 276689, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 227571, 309491, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 342707, 318132, 154292, 293555, 277173, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 277322, 277329, 162643, 310100, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 326514, 310134, 15224, 236408, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 276579, 293811, 293817, 293820, 203715, 326603, 276586, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 326638, 277486, 318450, 293876, 293877, 285686, 302073, 285690, 293882, 302075, 121850, 244731, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 302205, 285821, 392326, 285831, 253064, 302218, 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, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 326991, 294223, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 310659, 351619, 294276, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 245191, 310727, 64966, 163272, 277959, 292968, 302541, 277963, 302543, 277966, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 302617, 286233, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 40488, 278057, 294439, 40491, 294440, 294443, 294445, 310831, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 400976, 212560, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 302793, 294601, 343757, 212690, 278227, 286420, 319187, 229076, 286425, 319194, 278235, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 311048, 294664, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 188252, 237409, 294776, 360317, 294785, 327554, 40840, 40851, 294803, 188312, 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 ]
53298b90a36cdf8e33ccb60623cd2a63f6d5e0e5
dc870827db224b1c0e3fda46c135921e0d77b7f8
/CopyableLabel/CopyableLabel.swift
0abcf0cae6c94147a7c7069d35a2a4194efa0a10
[]
no_license
Nonnus/CopyableLabel
995a7aa82132a01d00529546fb29f9dccb38987c
965a2f7657bcecbb0711c3f98aeb95f5d95a7594
refs/heads/master
2020-03-28T07:09:23.926808
2018-09-28T22:39:54
2018-09-28T22:39:54
147,884,014
0
0
null
2018-09-08T02:46:03
2018-09-07T23:31:14
Swift
UTF-8
Swift
false
false
1,590
swift
// // CopyableLabel.swift // // Created by Nonnus on 03.09.18. // Copyright © 2018 Silicon Studios. All rights reserved. // import Foundation import UIKit public class CopyableLabel: UILabel { var menuController = UIMenuController.shared var pasteboard = UIPasteboard.general @IBInspectable var isCopyable: Bool = true { didSet { updateGestureRecognizer() } } override public var canBecomeFirstResponder: Bool { return isCopyable } override init(frame: CGRect) { super.init(frame: frame) updateGestureRecognizer() } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) updateGestureRecognizer() } private func updateGestureRecognizer() { isUserInteractionEnabled = isCopyable let gestureRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(showMenu(sender:))) isCopyable ? addGestureRecognizer(gestureRecognizer) : removeGestureRecognizer(gestureRecognizer) } @objc private func showMenu(sender: AnyObject?) { becomeFirstResponder() if !menuController.isMenuVisible { menuController.setTargetRect(bounds, in: self) menuController.setMenuVisible(true, animated: true) } } override public func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool { return action == #selector(copy(_:)) } override public func copy(_ sender: Any?) { pasteboard.string = text menuController.setMenuVisible(false, animated: true) } }
[ -1 ]
2e6f8787b0d44bbf3375857f29169b190cdd9645
dfe8e548f6bbc438bf65496c8575ce787aad230c
/Wrike API Tool/View Controllers/FoldersNavigationController.swift
3004970e1e2647b5ffe2dbfc556442ec26550176
[]
no_license
mdtaps/WrikeFolderId
874a21e6e151cb17f11e57deb8825eb52a0b4609
4868122d9c8a4046245b6f6b6fbaecc66c7c6dc1
refs/heads/master
2021-06-20T05:59:24.370656
2021-06-16T06:38:20
2021-06-16T06:38:20
197,235,534
0
0
null
null
null
null
UTF-8
Swift
false
false
629
swift
// // FoldersNavigationController.swift // Wrike API Tool // // Created by Mark Tapia on 1/12/20. // Copyright © 2020 Mark Tapia. All rights reserved. // import UIKit class FoldersNavigationController: UINavigationController { override func viewDidLoad() { super.viewDidLoad() self.modalPresentationStyle = .fullScreen } func resetNavController(to newRootViewController: AccountElementsViewController) { self.viewControllers.removeAll() self.pushViewController(newRootViewController, animated: false) self.popToRootViewController(animated: false) } }
[ -1 ]
2dc1ff7d864c1cafec8e413d83b4e855463c3ffc
aecc993eabac8568dd680ca9aebe25098ac9cc62
/05_booleans.playground/Contents.swift
c905644089991be16e28aabebe7c0785bf778189
[]
no_license
miguelzabalaf/swift-introduction
5d0ceaf3aed33c75e1b65a1248f81c2f0594b6c5
caa51b73730423982b241efaa35257155449fbea
refs/heads/main
2023-06-03T00:47:34.867078
2021-06-12T19:34:44
2021-06-12T19:34:44
376,370,024
0
0
null
null
null
null
UTF-8
Swift
false
false
212
swift
import UIKit let orangersAreOrange = true let foodIsDelicious = false var isAged : Bool isAged = false if isAged { print("You can entry to a party") } else { print("You can't entry to a party :(") }
[ -1 ]
15031b0d4617be8dd88c4539665d97291f4c2d20
93531fef0ff2aee5dd93607717ca18ce4f97961a
/BMI calculator/BMI Calculator/Controllers/CalculateViewController.swift
d74e0ddeeda6e1455c7453c23b6b2d507c5c140d
[]
no_license
ostapyshyn/Angela-Yu-iOS-Bootcamp
5047d12aae7b6ed2b3e6afb1333127db9c21df63
88fddd1920b178fec885b2bcb6c7208487e35f57
refs/heads/master
2021-01-09T03:48:40.690417
2020-06-19T14:55:32
2020-06-19T14:55:32
242,235,456
1
0
null
null
null
null
UTF-8
Swift
false
false
1,785
swift
// // ViewController.swift // BMI Calculator // // Created by Angela Yu on 21/08/2019. // Copyright © 2019 Angela Yu. All rights reserved. // import UIKit class CalculateViewController: UIViewController { @IBOutlet var heightLabel: UILabel! @IBOutlet var weightLabel: UILabel! @IBOutlet var heightSlider: UISlider! @IBOutlet var weightSlider: UISlider! //var bmi: Float! var calculatorBrain = CalculatorBrain() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } @IBAction func heightSliderChanged(_ sender: UISlider) { print(String(format: "%.2f", sender.value)) heightLabel.text = String(format: "%.2f", sender.value) + "m" } @IBAction func weightSliderChanged(_ sender: UISlider) { print(String(format: "%.0f", sender.value)) weightLabel.text = String(format: "%.0f", sender.value) + "Kg" } @IBAction func calculatePressed(_ sender: UIButton) { let weight = weightSlider.value let height = heightSlider.value // bmi = weight / (height * height) // print(bmi!) calculatorBrain.calculateBMI(height: height, weight: weight) performSegue(withIdentifier: "goToResult", sender: self) } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "goToResult" { let destinationVC = segue.destination as! ResultViewController destinationVC.bmiValue = calculatorBrain.getBMIvalue() destinationVC.advice = calculatorBrain.getAdvice() destinationVC.color = calculatorBrain.getColor() } } }
[ 328944 ]
64f89423518c5e844f3da428b798d16e08bc2cbc
c60fdac0ca73b26d4f44d430c2a6e9745cc3d07b
/vox.ForceTests/array_samplers_GPU_tests.swift
4e5c8c9829167b26d00e5b14f50f426a24dcf62d
[ "MIT" ]
permissive
yangfengzzz/fluid-engine-Swift
17c91c54c3f9481fafa71fb9cd3c78718139a49d
812669b56125602ed80c1212a5fb1d705861cac5
refs/heads/master
2022-12-23T02:13:12.395456
2020-09-21T02:56:06
2020-09-21T02:56:06
295,703,139
31
4
null
null
null
null
UTF-8
Swift
false
false
1,150
swift
// // array_samplers_GPU_tests.swift // vox.ForceTests // // Created by Feng Yang on 2020/9/10. // Copyright © 2020 Feng Yang. All rights reserved. // import XCTest @testable import vox_Force class array_samplers_GPU_tests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testNearestArraySampler1() throws { var grid = Array1<Float>(lst: [ 1.0, 2.0, 3.0, 4.0 ]) let output = Array1<Float>(lst: [ 10.0, 20.0, 30.0, 40.0 ]) grid.parallelForEachIndex(name: "testNearestArraySampler1") { (encoder: inout MTLComputeCommandEncoder, _:inout Int) in encoder.setBuffer(output._data, offset: 0, index: 1) } XCTAssertLessThan(abs(output[0] - 1.0), 1e-9) XCTAssertLessThan(abs(output[1] - 3.0), 1e-9) XCTAssertLessThan(abs(output[2] - 4.0), 1e-9) } }
[ -1 ]
d76d0a754c945cb69d7ae9f5942a254642fa482d
1da79dc54ed341e857a0789f23daa47d74885dce
/Swift Language Guide Playgrounds/Homework-Week3.playground/Contents.swift
5cd9fc97badc003e412ff82e29c9fcbeebd7558e
[ "MIT" ]
permissive
samburnstone/SwiftStudyGroup
536dcf434ea4f334bf93644772c46bb24a1c0e24
7d56409df659eb197a9ea4e12a620049eac12b88
refs/heads/master
2021-01-17T10:46:13.637248
2016-05-12T11:31:23
2016-05-12T11:31:23
37,033,677
3
0
null
null
null
null
UTF-8
Swift
false
false
7,515
swift
//: Tennis import Foundation class Player { // Enum time enum PlayingStyle { case LeftHanded case RightHanded case AmbiDextrous } // Boring boring stored properties let name: String let dateOfBirth: NSDate let playingStyle: PlayingStyle // Let's try a computed property var age: Int { get { let calendar = NSCalendar(calendarIdentifier: NSCalendarIdentifierGregorian)! return calendar.components(.Year, fromDate: dateOfBirth, toDate: NSDate(), options: .MatchFirst).year } } init(name: String, dateOfBirth: NSDate, playingStyle: PlayingStyle = .RightHanded) { self.name = name self.dateOfBirth = dateOfBirth self.playingStyle = playingStyle } // Convenience initialiser that may return nil if date cannot be extracted from string convenience init?(name: String, dateOfBirth: String, playingStyle: PlayingStyle = .RightHanded) { let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "yyyy-MM-dd" if let birthDate = dateFormatter.dateFromString(dateOfBirth) { self.init(name: name, dateOfBirth: birthDate, playingStyle: playingStyle) } else { return nil } } } //: It's recommended to use extensions to separate protocol implementations - below we have *Hashable* and *CustomStringConvertible* extension Player: Hashable { // Implement Hashable protocol so we can use Player in Dictionary var hashValue: Int { get { return self.name.hashValue } } } extension Player: CustomStringConvertible { var description: String { get { return name } } } //: We need to implement the **Equatable** protocol so we can use Player as a key in a Dictionary later on func ==(lhs: Player, rhs: Player) -> Bool { return lhs.name == rhs.name } //: Let's create a few Tennis Players let grumpyScot = Player(name: "Andy Murray", dateOfBirth: "1987-05-15") grumpyScot?.age let swissWithAHeadband = Player(name: "Roger Federer", dateOfBirth: "1981-08-08")! swissWithAHeadband.age let mysteryPlayer = Player(name: "Un Known", dateOfBirth: "") == nil let superSerb = Player(name: "Novak Djokovic", dateOfBirth: "1987-05-22")! let bigRafa = Player(name: "Rafael Nadal", dateOfBirth: "1986-06-03", playingStyle: .LeftHanded) bigRafa?.age //: Tennis Match class Game { enum Point: Equatable { case Numeric(value: Int) case Advantage } enum GameState { case InProgress case Won(winningPlayer: Player) case Error } typealias PlayerScores = [Player: Point] // Create an empty score dictionary var playerScores = PlayerScores() var state: GameState init(players: [Player]) { state = .InProgress players.map({ playerScores[$0] = .Numeric(value: 0) }) } func awardPointTo(player: Player) -> GameState { // Check a score exists for the given player guard var currentPlayerScore = playerScores[player] else { return .Error } // Stupid tennis scoring system switch currentPlayerScore { case .Numeric(value: let value) where value <= 15: currentPlayerScore = .Numeric(value: value + 15) case .Numeric(value: 30): currentPlayerScore = .Numeric(value: 40) case .Numeric(value: 40): guard let opponent = retrieveOpponent(to: player) else { return .Error } // In a real life application, these would probably be thrown as errors guard let opponentScore = playerScores[opponent] else { return .Error } // Slightly tricky bit - we need to work out if the player's opponent is currently on 'advantage' switch opponentScore { case .Numeric(value: 40): currentPlayerScore = .Advantage case .Advantage: playerScores[opponent] = .Numeric(value: 40) // Opponent was on advantage, therefore reduce default: state = .Won(winningPlayer: player); return state } case .Advantage: state = .Won(winningPlayer: player); return state default: break } playerScores[player] = currentPlayerScore return .InProgress } // Search through playerScores' keys to retrieve other player func retrieveOpponent(to player: Player) -> Player? { return playerScores.keys.array.filter({ $0 != player }).first } } //: Swift doesn't automatically generate the enum equalities for us, so we'll cover those here func ==(lhs: Game.Point, rhs: Game.Point) -> Bool { switch (lhs, rhs) { case (.Numeric(let a), .Numeric(let b)) where a == b: return true case (.Advantage, .Advantage): return true default: return false } } class Match { let players: [Player] var games = [Game]() init(players: [Player]) { self.players = players games.append(Game(players: players)) } func awardPointTo(player: Player) { guard let game = currentGame() else { return } let gameState = game.awardPointTo(player) switch gameState { case .Won(let winningPlayer): print("\(winningPlayer.name) won the game!") let newGame = Game(players: players) games.append(newGame) default: break } } /// Returns the current game in progress func currentGame() -> Game? { return games.last } } extension Match: CustomStringConvertible { var description: String { get { // TODO: This counts all games won - count games won by each player and return nicely formatted string var outputString = "" for player in players { let gameCount = games.reduce(0) { (numGames, game) in switch game.state { case .Won(player): return numGames + 1 default: return numGames } } outputString += "\(player) \(gameCount)\n" } return outputString } } } let wimbledonFinal = Match(players: [superSerb, swissWithAHeadband]) //: First Game wimbledonFinal.awardPointTo(superSerb) wimbledonFinal.awardPointTo(superSerb) wimbledonFinal.awardPointTo(superSerb) // What a beast! wimbledonFinal.awardPointTo(swissWithAHeadband) wimbledonFinal.awardPointTo(swissWithAHeadband) wimbledonFinal.awardPointTo(swissWithAHeadband) // Nice comeback Roger! wimbledonFinal.awardPointTo(superSerb) wimbledonFinal.currentGame()?.playerScores wimbledonFinal.awardPointTo(swissWithAHeadband) // On a knife-edge! wimbledonFinal.currentGame()?.playerScores wimbledonFinal.awardPointTo(superSerb) wimbledonFinal.awardPointTo(superSerb) wimbledonFinal.currentGame()?.playerScores // Game has been reset // What's the current score, Sue Barker? print(wimbledonFinal) //: Let's have another game wimbledonFinal.awardPointTo(swissWithAHeadband) wimbledonFinal.awardPointTo(swissWithAHeadband) wimbledonFinal.awardPointTo(swissWithAHeadband) wimbledonFinal.awardPointTo(swissWithAHeadband) print(wimbledonFinal)
[ -1 ]
f787cc48dbdd591a5d6a01ddbd8d058dc88f22a8
f1086b11345908236c3d7fbff22ab10c92d2c21b
/FirstSwiftProgram/ViewController.swift
e2614dcf787fbe9365d76d9fd98af6b6c5c821c6
[]
no_license
PintuVasani/FirstSwiftProgram
e05ce7c30dd59623c14083be47478afc773fd420
b6130a4ccde4dea4a0b0e8a85c10277af1edadda
refs/heads/master
2020-06-06T13:37:03.270427
2015-02-26T06:21:33
2015-02-26T06:21:33
31,365,205
0
0
null
null
null
null
UTF-8
Swift
false
false
523
swift
// // ViewController.swift // FirstSwiftProgram // // Created by Paras Chodavadiya on 26/02/15. // Copyright (c) 2015 Pintu Vasani. 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, 275466, 234511, 278543, 236057, 286234, 282145, 284197, 296487, 286249, 237616, 360501, 234551, 237624, 288827, 238653, 226878, 277057, 286786, 129604, 284740, 226887, 243786, 300107, 158285, 226896, 212561, 228945, 284240, 300116, 284242, 292435, 237655, 307288, 212573, 276580, 284261, 281701, 281703, 306791, 286314, 356460, 277612, 307311, 281202, 300149, 287350, 276597, 284289, 303242, 284298, 285837, 311437, 226447, 234641, 278675, 282262, 280219, 284315, 284317, 299165, 285855, 302235, 228000, 225955, 282275, 278693, 287399, 280231, 100521, 234665, 284328, 284336, 307379, 276150, 286390, 280760, 282301, 283839, 285377, 280770, 228548, 280772, 228551, 276167, 284361, 280775, 287437, 313550, 229585, 307410, 284373, 189655, 226009, 280797, 363743, 298211, 284391, 277224, 228585, 280808, 312049, 289524, 288501, 226038, 234232, 204027, 286462, 276736, 280832, 278786, 358147, 226055, 299786, 312586, 295696, 296216, 329499, 281373, 228127, 276256, 278304, 282917, 234279, 283433, 312107, 293682, 289596, 278845, 279360, 289600, 288579, 300358, 238920, 234829, 287055, 276309, 295766, 307029, 188253, 323933, 308064, 303977, 306540, 293742, 299374, 199024, 278897, 310649, 207738, 313733, 324491, 234380, 304015, 310673, 306578, 227740, 285087, 234402, 284586, 144811, 291755, 277935, 324528, 230323, 282548, 292277, 296374, 130487, 234423, 281530, 165832, 289224, 306633, 288205, 286158, 301012, 276959, 286175, 276965, 168936, 294889, 286189, 183278, 277487, 282095, 298989, 308721, 227315, 237556, 296436, 310773, 286204, 287231 ]
d9915400d32a4eba64c13da6c6242c1f230204f5
6834d6c77942f41a386a54ffe9c283313851b3be
/nMessenger/Source/MessageNodes/MessageCell/MessageGroup.swift
1e0752abc04e3d4b16b1489c59e0d943aa09adab
[ "MIT" ]
permissive
Empatika/NMessenger
3d0fd7c4aa10844d63516aaa18bf64bd5f20b490
792bc4e6d90027d605c6eca3127958f200b222f8
refs/heads/master
2021-01-21T13:21:50.791860
2017-02-06T13:04:37
2017-02-06T13:04:37
66,559,597
0
0
null
2016-08-25T13:20:58
2016-08-25T13:20:58
null
UTF-8
Swift
false
false
19,954
swift
// // Copyright (c) 2016 eBay Software Foundation // // 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 AsyncDisplayKit //MARK: MessageGroup /** Holds a group of messages. Extends GeneralMessengerCell. */ public class MessageGroup: GeneralMessengerCell { /** Used for current state of new/old messages*/ public enum MessageGroupState { case Added case Removed case Replaced case None } // MARK: Public Variables public var delegate: MessageCellProtocol? /** Holds a table of GeneralMessengerCells*/ public private(set) var messageTable = ASTableNode(style: .Plain) /** Set to true when the after the component has laid out for the first time*/ public private(set) var hasLaidOut = false /** Data set for messages in the group */ public private(set) var messages = [GeneralMessengerCell]() /** Delay before add/remove animation begins*/ public var animationDelay: NSTimeInterval = 0 /** Avatar new message animation speed */ public var avatarAnimationSpeed: NSTimeInterval = 0.15 /** Spacing around the avatar */ public var avatarInsets: UIEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 10) { didSet { self.setNeedsLayout() } } /** Message offset spacing from the edge (avatar or messenger bounds) */ public var messageOffset: CGFloat = 10 { didSet { self.setNeedsLayout() } } /** ASDisplayNode as the avatar of the cell*/ public var avatarNode: ASDisplayNode? { willSet{ if let avatarNode = newValue { if let oldAvatar = self.avatarNode { self.insertSubnode(avatarNode, aboveSubnode: oldAvatar) self.insertSubnode(self.avatarButtonNode, aboveSubnode: avatarNode) oldAvatar.removeFromSupernode() self.avatarButtonNode.removeFromSupernode() } else { self.addSubnode(avatarNode) self.addSubnode(self.avatarButtonNode) } } } didSet { self.setNeedsLayout() } } /** Bool if the cell is an incoming or out going message cell*/ public override var isIncomingMessage:Bool { didSet { for message in messages { if let message = message as? MessageNode { message.isIncomingMessage = isIncomingMessage } } } } //MARK: Private variables /** Layout completion block for adding/removing messages*/ private var layoutCompletionBlock: (()->Void)? /** Current state of new/old messages*/ private var state: MessageGroupState? /** Default animation delay time for ASTableView*/ private let tableviewAnimationDelay:NSTimeInterval = 0.3 /** Button node to handle avatar click*/ private var avatarButtonNode: ASControlNode = ASControlNode() //MARK: Initializers public override init() { super.init() self.setupTable() self.setupAvatarButton() } /** Initializes the ASTableNode for a group of messages*/ private func setupTable() { self.messageTable.delegate = self self.messageTable.dataSource = self self.messageTable.view.separatorStyle = .None self.messageTable.view.scrollEnabled = false self.messageTable.view.showsVerticalScrollIndicator = false self.addSubnode(self.messageTable) } /** Creates a listener for the avatar button */ private func setupAvatarButton() { self.avatarButtonNode.addTarget(self, action: #selector(MessageGroup.avatarClicked), forControlEvents: .TouchUpInside) self.avatarButtonNode.exclusiveTouch = true } // MARK: Override AsycDisaplyKit Methods /** Overriding layoutSpecThatFits to specifiy relatiohsips between elements in the cell */ override public func layoutSpecThatFits(constrainedSize: ASSizeRange) -> ASLayoutSpec { var tableWidth:CGFloat = 0 let justifyLocation = isIncomingMessage ? ASStackLayoutJustifyContent.Start : ASStackLayoutJustifyContent.End //make a space for the avatar if needed if let avatarNode = self.avatarNode { let size = avatarNode.layoutThatFits(ASSizeRange(min: CGSize.zero, max: constrainedSize.max)).size tableWidth = constrainedSize.max.width - size.width - self.avatarInsets.left - self.avatarInsets.right - self.cellPadding.left - self.cellPadding.right - messageOffset } else { tableWidth = constrainedSize.max.width - self.cellPadding.left - self.cellPadding.right - self.messageOffset } var elementHeight:CGFloat = 0 //get the size of every message in the group to calculate height for message in messages { let newSize = ASSizeRange(min: constrainedSize.min, max: CGSizeMake(tableWidth, constrainedSize.max.height)) let size = message.layoutThatFits(newSize).size elementHeight += size.height } self.messageTable.style.preferredSize = CGSizeMake(tableWidth, elementHeight) var retLayout:ASLayoutSpec = ASAbsoluteLayoutSpec(children: [self.messageTable]) var stackLayout: ASStackLayoutSpec? var insetLayout: ASInsetLayoutSpec? let spacer = ASLayoutSpec() //add the avatar to the layout if let avatarNode = self.avatarNode { let avatarSizeLayout = ASAbsoluteLayoutSpec(children: [avatarNode]) //create avatar button self.avatarButtonNode.style.preferredSize = avatarNode.layoutThatFits(ASSizeRange(min: CGSize.zero, max: constrainedSize.max)).size let avatarButtonSizeLayout = ASAbsoluteLayoutSpec(children: [self.avatarButtonNode]) let avatarBackStack = ASBackgroundLayoutSpec(child: avatarButtonSizeLayout, background: avatarSizeLayout) let ins = ASInsetLayoutSpec(insets: self.avatarInsets, child: avatarBackStack) //layout horizontal stack let cellOrientation = self.isIncomingMessage ? [ins, retLayout] : [retLayout, ins] stackLayout = ASStackLayoutSpec(direction: .Horizontal, spacing: 0, justifyContent: justifyLocation, alignItems: .End, children: cellOrientation) retLayout = stackLayout! } let cellOrientation = self.isIncomingMessage ? [spacer, retLayout] : [retLayout, spacer] stackLayout = ASStackLayoutSpec(direction: .Horizontal, spacing: self.messageOffset, justifyContent: justifyLocation, alignItems: .End, children: cellOrientation) insetLayout = ASInsetLayoutSpec(insets: self.cellPadding, child: stackLayout!) return insetLayout! } /** Overriding animateLayoutTransition to animate add/remove transitions */ override public func animateLayoutTransition(context: ASContextTransitioning) { if let state = self.state { switch(state) { case .Added: if let _ = self.avatarNode { self.avatarNode?.frame = context.initialFrameForNode(self.avatarNode!) } UIView.animateWithDuration(self.avatarAnimationSpeed, delay: self.tableviewAnimationDelay + self.animationDelay, options: [], animations: { if let _ = self.avatarNode { self.avatarNode?.frame = context.finalFrameForNode(self.avatarNode!) } }) { (finished) in //complete transition context.completeTransition(finished) } //wait for layout animation dispatch_after(dispatch_time(dispatch_time_t(DISPATCH_TIME_NOW), Int64(self.animationDelay)*1000 * Int64(NSEC_PER_MSEC)), dispatch_get_main_queue()) { //layout to reflect changes self.setNeedsLayout() let time = dispatch_time(dispatch_time_t(DISPATCH_TIME_NOW), Int64(self.tableviewAnimationDelay)*1000 * Int64(NSEC_PER_MSEC)) dispatch_after(time, dispatch_get_main_queue()) { let tableView = self.messageTable.view tableView.endUpdates() self.callLayoutCompletionBlock() } } break case .Removed: if let _ = self.avatarNode { self.avatarNode?.frame = context.initialFrameForNode(self.avatarNode!) } UIView.animateWithDuration(self.tableviewAnimationDelay, delay: 0, options: [], animations: { if let _ = self.avatarNode { self.avatarNode?.frame = context.finalFrameForNode(self.avatarNode!) } }) { (finished) in //call completion block and reset self.callLayoutCompletionBlock() //finish the transition context.completeTransition(finished) } break case .Replaced: if let _ = self.avatarNode { self.avatarNode?.frame = context.initialFrameForNode(self.avatarNode!) } UIView.animateWithDuration(self.avatarAnimationSpeed, delay: self.tableviewAnimationDelay, options: [], animations: { if let _ = self.avatarNode { self.avatarNode?.frame = context.finalFrameForNode(self.avatarNode!) } }) { (finished) in //complete transition context.completeTransition(finished) } //layout to reflect changes self.setNeedsLayout() let time = dispatch_time(dispatch_time_t(DISPATCH_TIME_NOW), Int64(self.tableviewAnimationDelay)*1000 * Int64(NSEC_PER_MSEC)) dispatch_after(time, dispatch_get_main_queue()) { let tableView = self.messageTable.view tableView.endUpdates() self.callLayoutCompletionBlock() } break default: //no animation context.completeTransition(true) } } } /** Overriding layoutDidFinish to flag first layout */ override public func layoutDidFinish() { super.layoutDidFinish() self.hasLaidOut = true } //MARk: Public functions /** Add a message to this group - parameter message: the message to add - parameter layoutCompletionBlock: The block to be called once the new node has been added */ public func addMessageToGroup(message: GeneralMessengerCell, completion: (()->Void)?) { self.updateMessage(message) self.layoutCompletionBlock = completion //if the component is already on the screen if self.hasLaidOut { //set state self.state = .Added //update table let tableView = self.messageTable.view tableView.beginUpdates() let indexPath = NSIndexPath(forRow: self.messages.count, inSection:0) self.messages.append(message) tableView.insertRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) //transition avatar + tableview cells self.transitionLayoutWithAnimation(true, shouldMeasureAsync: false, measurementCompletion: nil) } else { self.messages.append(message) } } /** If the message exists in the group, it will be replaced with the new message. **Unimplemented** - parameter message: The message to replace - parameter withMessage: The message that will replace the old one - parameter layoutCompletionBlock: The block to be called once the old node has been replaced */ public func replaceMessage(message: GeneralMessengerCell, withMessage newMessage: GeneralMessengerCell, completion: (()->Void)?) { if self.messages.contains(message) { if let index = self.messages.indexOf(message) { self.updateMessage(newMessage) self.layoutCompletionBlock = completion message.currentTableNode = nil //make sure the group has been laid out so that animations will work if self.hasLaidOut { //set state self.state = .Replaced //update table let tableView = self.messageTable.view tableView.beginUpdates() self.messages[index] = newMessage let indexPath = NSIndexPath(forRow: index, inSection:0) tableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) let time = dispatch_time(dispatch_time_t(DISPATCH_TIME_NOW), Int64(self.animationDelay)*1000 * Int64(NSEC_PER_MSEC)) dispatch_after(time, dispatch_get_main_queue()) { tableView.endUpdatesAnimated(true, completion: { (done) in self.transitionLayoutWithAnimation(true, shouldMeasureAsync: false, measurementCompletion:nil) }) } } else { //replace message self.messages[index] = newMessage } } } } /** Remove a message from this group - parameter message: the message to remove - parameter layoutCompletionBlock: The block to be called once the new node has been removed */ public func removeMessageFromGroup(message: GeneralMessengerCell, completion: (()->Void)?) { if self.messages.contains(message) { if let index = self.messages.indexOf(message) { let isLastMessage = self.messages.last == message self.layoutCompletionBlock = completion message.currentTableNode = nil //make sure the group has been laid out so that animations will work if self.hasLaidOut { //set state self.state = .Removed //update table let tableView = self.messageTable.view tableView.beginUpdates() self.messages.removeAtIndex(index) let indexPath = NSIndexPath(forRow: index, inSection:0) tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) //use a special animation if it is the last message if isLastMessage && self.avatarNode != nil { UIView.animateWithDuration(self.avatarAnimationSpeed, delay: self.animationDelay, options: [], animations: { if let avatarNode = self.avatarNode { avatarNode.frame.origin.y = self.messageTable.view.rectForRowAtIndexPath(NSIndexPath(forItem: index-1, inSection: 0)).maxY - avatarNode.frame.height + self.cellPadding.top } }, completion: nil) } let extraDelay = isLastMessage && self.avatarNode != nil ? self.avatarAnimationSpeed : 0 let time = dispatch_time(dispatch_time_t(DISPATCH_TIME_NOW), Int64(extraDelay + self.animationDelay)*1000 * Int64(NSEC_PER_MSEC)) dispatch_after(time, dispatch_get_main_queue()) { tableView.endUpdatesAnimated(true, completion: { (done) in self.transitionLayoutWithAnimation(true, shouldMeasureAsync: false, measurementCompletion:nil) }) } } else { //message shouldn't be in this group self.messages.removeAtIndex(index) } } } } //MARK: helper methods /** Updates message UI features to reflect sender. These features are pulled from the message configuration. Also updates *currentTableNode* property to the message group's table - parameter message: the message to update */ private func updateMessage(message: GeneralMessengerCell) { message.currentTableNode = self.messageTable //message specific UI if messages.first == nil { //will be the first message message.cellPadding = UIEdgeInsetsZero if let message = message as? MessageNode { message.contentNode?.backgroundBubble = message.contentNode?.bubbleConfiguration.getBubble() message.isIncomingMessage = self.isIncomingMessage //set the offset to 0 to prevent spacing issues message.messageOffset = 0 } } else { message.cellPadding = UIEdgeInsets(top: 4, left: 0, bottom: 0, right: 0) if let message = message as? MessageNode { message.contentNode?.backgroundBubble = message.contentNode?.bubbleConfiguration.getSecondaryBubble() message.isIncomingMessage = self.isIncomingMessage //set the offset to 0 to prevent spacing issues message.messageOffset = 0 } } } /** Calls and resets the layout completion block */ private func callLayoutCompletionBlock() { self.state = .None self.layoutCompletionBlock?() self.layoutCompletionBlock = nil } } /** Delegate functions extension */ extension MessageGroup { /** Notifies the delegate that the avatar was clicked */ public func avatarClicked() { self.delegate?.avatarClicked?(self) } } /** TableView functions extension */ extension MessageGroup: ASTableDelegate, ASTableDataSource { public func numberOfSectionsInTableView(tableView: UITableView) -> Int { return 1 } public func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return messages.count } public func tableView(tableView: ASTableView, nodeForRowAtIndexPath indexPath: NSIndexPath) -> ASCellNode { return messages[indexPath.row] } }
[ -1 ]
808add8dfc1e1d9fa1e2a7b352886143e6e5a38a
3c336b702904007011c7d566df362b74b05a77cd
/iwidget/widgetDemo/widgetDemo.swift
645681b534365affae89340d037f963d31e9bc39
[]
no_license
yeniugo/swiftUITest
aa0f84a1214ae7a01e38c740db78d4c18b4c3765
7af3b2cf176a9c8f8c0b38dd68ab5ec81a6b3e9f
refs/heads/master
2022-12-25T08:36:09.643356
2020-10-09T07:54:00
2020-10-09T07:54:00
302,570,886
0
0
null
null
null
null
UTF-8
Swift
false
false
2,802
swift
// // widgetDemo.swift // widgetDemo // // Created by 胡凯 on 2020/9/25. // import WidgetKit import SwiftUI import Intents struct Provider: IntentTimelineProvider { func placeholder(in context: Context) -> SimpleEntry { SimpleEntry(date: Date(), configuration: ConfigurationIntent()) } func getSnapshot(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (SimpleEntry) -> ()) { let entry = SimpleEntry(date: Date(), configuration: configuration) completion(entry) } func getTimeline(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (Timeline<Entry>) -> ()) { var entries: [SimpleEntry] = [] // Generate a timeline consisting of five entries an hour apart, starting from the current date. let currentDate = Date() for hourOffset in 0 ..< 60 { let entryDate = Calendar.current.date(byAdding: .second, value: hourOffset, to: currentDate)! let entry = SimpleEntry(date: entryDate, configuration: configuration) entries.append(entry) } let timeline = Timeline(entries: entries, policy: .atEnd) completion(timeline) } } struct SimpleEntry: TimelineEntry { let date: Date let configuration: ConfigurationIntent } struct widgetDemoEntryView : View { var entry: Provider.Entry var body: some View { Text(date2String(entry.date)) } } func date2String(_ date:Date, dateFormat:String = "yyyy-MM-dd HH:mm:ss") -> String { let formatter = DateFormatter() formatter.locale = Locale.init(identifier: "zh_CN") formatter.dateFormat = dateFormat let date = formatter.string(from: date) return date } @main struct widgetDemo: Widget { let kind: String = "widgetDemo" var body: some WidgetConfiguration { IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in widgetDemoEntryView(entry: entry) } .configurationDisplayName("桌面时钟") .description("可以在桌面显示的实时时钟") } } struct widgetDemo_Previews: PreviewProvider { static var previews: some View { widgetDemoEntryView(entry: SimpleEntry(date: Date(), configuration: ConfigurationIntent())) .previewContext(WidgetPreviewContext(family: .systemSmall)) widgetDemoEntryView(entry: SimpleEntry(date: Date(), configuration: ConfigurationIntent())) .previewContext(WidgetPreviewContext(family: .systemMedium)) widgetDemoEntryView(entry: SimpleEntry(date: Date(), configuration: ConfigurationIntent())) .previewContext(WidgetPreviewContext(family: .systemLarge)) } }
[ 369290, 377570, 348805, 267975 ]
7d575f350e97c507881ee842b143c0f9cf1677fe
cbf934f3c5afb6468087880de3e7df32a5b36793
/WeatherWithCombine/Data/OpenWeatherAPI/Errors.swift
1a527ed3a402e8c4297041b5746dad1bcccb361c
[]
no_license
earGO/OpenWeatherWithCombine
524d2b6de8f1624e4a0b0fb9b09a7479bc584a7b
afa59218ca05d61971edbafc8fda3ae39d726b54
refs/heads/master
2023-03-19T17:47:28.776096
2021-03-02T14:57:08
2021-03-02T14:57:08
343,588,609
0
0
null
2021-03-02T14:57:09
2021-03-01T23:41:37
Swift
UTF-8
Swift
false
false
139
swift
import Foundation import Foundation enum WeatherError: Error { case parsing(description: String) case network(description: String) }
[ -1 ]
8acf416f1c205bdd703c4c37efaf037d3b98402c
74bbfd4110da59ce6cc04e341390bafa79e2422a
/Landmarks/LandmarkDetail.swift
ea117b6cea6864b3203ff909c0c2db02cf27b119
[]
no_license
usk-lab/Landmarks
a0f827f7ff953f46b0e0703ce937dbd19b1a55ee
1f34c61c48488f41eb40337b2b71055f3507c379
refs/heads/master
2022-10-24T06:30:48.401588
2020-06-21T02:16:45
2020-06-21T02:16:45
273,481,930
0
0
null
null
null
null
UTF-8
Swift
false
false
2,105
swift
// // LandmarkDetail.swift // Landmarks // // Created by hasegawa-yusuke on 2020/06/17. // Copyright © 2020 usk2000. All rights reserved. // import SwiftUI struct LandmarkDetail: View { @EnvironmentObject var userData: UserData var landmark: Landmark var landmarkIndex: Int { userData.landmarks.firstIndex(where: { $0.id == landmark.id })! } var body: some View { VStack { MapView(coordinate: landmark.locationCoordinate) .edgesIgnoringSafeArea(.top) .frame(height: 300) CircleImage(image: landmark.image) .offset(y: -130) .padding(.bottom, -130) VStack(alignment: .leading) { HStack { Text(landmark.name) .font(.title) Button.init(action: { self.userData.landmarks[self.landmarkIndex].isFavorite.toggle() }) { if self.userData.landmarks[self.landmarkIndex].isFavorite { Image(systemName: "star.fill") .foregroundColor(Color.yellow) } else { Image(systemName: "star") .foregroundColor(Color.gray) } } } HStack(alignment: .top) { Text(landmark.park) .font(.subheadline) Spacer() Text(landmark.state) .font(.subheadline) } } .padding() Spacer() } .navigationBarTitle(Text(landmark.name), displayMode: .inline) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { LandmarkDetail(landmark: .sample).environmentObject(UserData.init(landmarks: [ .sample(favorite: true), .sample(favorite: false) ])) } }
[ 286807 ]
65f7d074745e65e13c3955a4f475edc712ddd1be
aefb2d15666c90bc8bdedfea0e6369addc1cd608
/Swoosh/Controller/LeagueVC.swift
0d0626d9c2be5e07cb7a9acfddd8380d2ca0cc46
[]
no_license
azarovalex/Swoosh-App
cebbb35e5c87d8fcef18820db422bc5e194e6932
f20e3e76c622e678d36aa6e5979a2c6acc40e6ae
refs/heads/master
2021-05-05T18:55:56.218462
2018-01-17T13:40:59
2018-01-17T13:40:59
117,745,724
0
0
null
null
null
null
UTF-8
Swift
false
false
823
swift
// // LeagueVC.swift // Swoosh // // Created by Alex Azarov on 17/01/2018. // Copyright © 2018 Alex Azarov. All rights reserved. // import UIKit class LeagueVC: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } @IBAction func onNextTapped(_ sender: Any) { performSegue(withIdentifier: "skillVCSegue", sender: self) } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ 317307, 325939, 321399, 333177, 319291, 315740 ]
b932a6cc9cdc9a237d92b47d2b052a91fdfc0440
7c49bd21c1a9651d49b793244ea24d4feef9f8c6
/General/Extensions.swift
02e0980b902c0c95019165159ab82cc8b3cb73df
[]
no_license
broandon/kocinarteRepartidor
02140c59f8762eeec97cf3a602d82d11d2048d48
0a7b70bb73bee884ba1dacbb27b865698e575493
refs/heads/main
2023-04-08T01:16:22.069915
2021-03-22T04:35:41
2021-03-22T04:35:41
304,758,021
0
0
null
null
null
null
UTF-8
Swift
false
false
1,575
swift
// // Extensions.swift // kocinarteRepartidor // // Created by Brandon Gonzalez on 16/10/20. // import Foundation import UIKit //MARK: BOTTOM LINE EXTENSION enum LINE_POSITION { case LINE_POSITION_TOP case LINE_POSITION_BOTTOM } extension UIView { func addLine(position : LINE_POSITION, color: UIColor, width: Double) { let lineView = UIView() lineView.backgroundColor = color lineView.translatesAutoresizingMaskIntoConstraints = false // This is important! self.addSubview(lineView) let metrics = ["width" : NSNumber(value: width)] let views = ["lineView" : lineView] self.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[lineView]|", options:NSLayoutConstraint.FormatOptions(rawValue: 0), metrics:metrics, views:views)) switch position { case .LINE_POSITION_TOP: self.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[lineView(width)]", options:NSLayoutConstraint.FormatOptions(rawValue: 0), metrics:metrics, views:views)) break case .LINE_POSITION_BOTTOM: self.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:[lineView(width)]|", options:NSLayoutConstraint.FormatOptions(rawValue: 0), metrics:metrics, views:views)) break } } } extension UIImageView { func makeRounded() { self.layer.borderWidth = 1 self.layer.masksToBounds = false self.layer.cornerRadius = self.frame.height / 2 self.clipsToBounds = true } }
[ -1 ]
2177926adf39f721be97ca3a50df200681ec4dfb
296c14e67931cda19476bc14b5dfedca6523bd83
/老师分享代码/AnimationDemo/AnimationDemo/ViewController.swift
3b6ae89052145db0219e92cf2de27093efcef448
[]
no_license
yudidayeye/ios
59fe4e452e32e9917349d04039116f195a542f3d
b759d4afb77eb6e7ce6408f1b14e52a21ad41963
refs/heads/master
2023-07-21T01:46:14.688254
2019-12-28T07:51:40
2019-12-28T07:51:40
219,891,868
0
0
null
null
null
null
UTF-8
Swift
false
false
13,169
swift
// // ViewController.swift // AnimationDemo // // Created by liguiyang on 2016/11/12. // Copyright © 2016年 sicnu. All rights reserved. // import UIKit extension UIButton { func setup() { self.layer.borderColor = UIColor.black.cgColor self.layer.borderWidth = 1 self.backgroundColor = UIColor.yellow self.addTarget(self, action: #selector(springUp(_:)), for: .touchUpInside) self.addTarget(self, action: #selector(springDown(_:)), for: .touchDown) } open override func awakeFromNib() { super.awakeFromNib() setup() } @objc func springUp(_ sender: UIButton) { UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 0.1, initialSpringVelocity: 50, options: .allowUserInteraction, animations: { sender.bounds.size.width -= 10 sender.bounds.size.height -= 10 }, completion: nil) } @objc func springDown(_ sender: UIButton) { UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 0.1, initialSpringVelocity: 50, options: .allowUserInteraction, animations: { sender.bounds.size.width += 10 sender.bounds.size.height += 10 }, completion: nil) } } class ViewController: UIViewController{ @IBOutlet weak var testLabel: UILabel! @IBOutlet weak var testview: UIView! @IBAction func transformanim(_ sender: AnyObject) { UIView.animate(withDuration: 2) { var trans = CGAffineTransform(scaleX: 2, y: 2) trans = trans.rotated(by: CGFloat(Double.pi)) trans = trans.translatedBy(x: 100, y: 100) self.testview.transform = trans self.testview.transform = CGAffineTransform.identity } // testview.transform = CGAffineTransform.identity UIView.animate(withDuration: 2, delay: 0, options: .curveEaseInOut, animations: { self.testLabel.transform = CGAffineTransform(rotationAngle: CGFloat(Double.pi)) self.testLabel.transform = CGAffineTransform.identity self.testLabel.transform = CGAffineTransform(rotationAngle: CGFloat(Double.pi)) self.testLabel.transform = CGAffineTransform.identity }, completion: { _ in // self.testLabel.transform = CGAffineTransform(rotationAngle: CGFloat(0)) }) testLabel.transform = CGAffineTransform.identity } @IBAction func animate(_ sender: AnyObject) { UIView.animate(withDuration: 1, animations: { self.testview.center.x += 200.0 },completion: { _ in UIView.animate(withDuration: 1, animations: { self.testview.center.x -= 200.0 }, completion:nil) }) } @IBAction func keyframes(_ sender: AnyObject) { UIView.animateKeyframes(withDuration: 2, delay: 0, options: [], animations: { UIView.addKeyframe(withRelativeStartTime: 0, relativeDuration: 0.25, animations: { self.testview.center.x += 200.0 }) UIView.addKeyframe(withRelativeStartTime: 0.25, relativeDuration: 0.25, animations: { self.testview.center.y += 100.0 }) UIView.addKeyframe(withRelativeStartTime: 0.5, relativeDuration: 0.25, animations: { self.testview.center.x -= 200.0 }) UIView.addKeyframe(withRelativeStartTime: 0.75, relativeDuration: 0.25, animations: { self.testview.center.y -= 100.0 }) }, completion: nil) } @IBAction func layertransform(_ sender: AnyObject) { UIView.animate(withDuration: 2, animations: { var trans3d = CATransform3DIdentity trans3d.m34 = -1.0 / 200 trans3d = CATransform3DRotate(trans3d, CGFloat(Double.pi), 0, 1, 0) self.testview.layer.transform = trans3d }){ (_) in UIView.animate(withDuration: 2) { self.testview.layer.transform = CATransform3DIdentity } } } @IBAction func basicanim(_ sender: AnyObject) { let shapeLayer = CAShapeLayer() shapeLayer.frame = self.testview.bounds shapeLayer.strokeStart = 0 shapeLayer.strokeEnd = 0.5 let path = UIBezierPath(ovalIn: testview.bounds) shapeLayer.path = path.cgPath shapeLayer.fillColor = UIColor.clear.cgColor shapeLayer.strokeColor = UIColor.red.cgColor shapeLayer.lineWidth = 2 testview.layer.addSublayer(shapeLayer) let anim = CABasicAnimation(keyPath: "strokeEnd") anim.duration = 3 anim.fromValue = 0 anim.toValue = 1 anim.isRemovedOnCompletion = false anim.fillMode = kCAFillModeForwards anim.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) shapeLayer.add(anim, forKey: "") } func animateCircleLayer(frame: CGRect, duration: CFTimeInterval) ->CAShapeLayer { let shapeLayer = CAShapeLayer() shapeLayer.frame = frame shapeLayer.strokeStart = 0 shapeLayer.strokeEnd = 0.5 let path = UIBezierPath(ovalIn: frame) shapeLayer.path = path.cgPath shapeLayer.fillColor = UIColor.clear.cgColor shapeLayer.strokeColor = UIColor.red.cgColor shapeLayer.lineWidth = 10 let anim = CABasicAnimation(keyPath: "strokeEnd") anim.duration = duration anim.fromValue = 0 anim.repeatCount = Float.greatestFiniteMagnitude anim.toValue = 1 anim.isRemovedOnCompletion = false anim.fillMode = kCAFillModeForwards anim.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) shapeLayer.add(anim, forKey: "") return shapeLayer } @IBAction func clear(_ sender: AnyObject) { testview.layer.removeAllAnimations() for layer in testview.layer.sublayers! { if layer is CATransformLayer || layer is CAShapeLayer { layer.removeFromSuperlayer() } } for layer in view.layer.sublayers! { if layer is CAShapeLayer { layer.removeFromSuperlayer() } } testLabel.layer.removeAllAnimations() } @IBAction func layer3danim(_ sender: AnyObject) { clear(sender) let layer1 = CAShapeLayer() layer1.frame = self.testview.bounds layer1.backgroundColor = UIColor.green.cgColor layer1.opacity = 0.5 let layer2 = CAShapeLayer() layer2.frame = self.testview.bounds layer2.backgroundColor = UIColor.blue.cgColor layer2.opacity = 0.5 let containlayer = CATransformLayer() containlayer.frame = self.testview.bounds containlayer.backgroundColor = UIColor.clear.cgColor self.testview.layer.addSublayer(containlayer) let trans1 = CATransform3DIdentity layer1.transform = CATransform3DTranslate(trans1, 0, 0, -30) let trans2 = CATransform3DIdentity layer2.transform = CATransform3DTranslate(trans2, 0, 0, 30) containlayer.addSublayer(layer2) containlayer.addSublayer(layer1) let faceLayer = animateCircleLayer(frame: self.testview.bounds, duration: 3) faceLayer.transform = CATransform3DTranslate(trans2, 0, 0, -10) let littlefaceLayer1 = animateCircleLayer(frame: CGRect(x:10,y:10,width:40,height:40), duration: 1) littlefaceLayer1.transform = CATransform3DTranslate(trans2, 0, 0, 10) let littlefaceLayer2 = animateCircleLayer(frame: CGRect(x:50,y:10,width:40,height:40), duration: 1) littlefaceLayer2.transform = CATransform3DTranslate(trans2, 0, 0, 10) let littlefaceLayer3 = animateCircleLayer(frame: CGRect(x:30,y:40,width:40,height:40), duration: 1) littlefaceLayer3.transform = CATransform3DTranslate(trans2, 0, 0, 20) containlayer.addSublayer(faceLayer) containlayer.addSublayer(littlefaceLayer1) containlayer.addSublayer(littlefaceLayer2) containlayer.addSublayer(littlefaceLayer3) var degree: CGFloat = 0.0 let timer = Timer(timeInterval: 2, repeats: true) { (_) in var trans2 = CATransform3DIdentity trans2.m34 = -1.0 / 500 let anim = CABasicAnimation(keyPath: "transform") anim.duration = 1 anim.fromValue = CATransform3DRotate(trans2, degree, 0, 1, 0) degree += CGFloat(Double.pi/2) anim.toValue = CATransform3DRotate(trans2, degree, 0, 1, 0) containlayer.transform = CATransform3DRotate(trans2, degree, 0, 1, 0) containlayer.add(anim, forKey: "transform3D") } RunLoop.main.add(timer, forMode: .defaultRunLoopMode) timer.fire() } @IBAction func cakeyframeanim(_ sender: AnyObject) { //draw keypath let path1 = UIBezierPath() path1.move(to: CGPoint(x: 0, y: view.bounds.size.height)) path1.addQuadCurve(to: CGPoint(x: view.bounds.size.width, y: view.bounds.size.height), controlPoint: view.center) let shapeLayer1 = CAShapeLayer() shapeLayer1.path = path1.cgPath shapeLayer1.fillColor = UIColor.clear.cgColor shapeLayer1.strokeColor = UIColor.red.cgColor shapeLayer1.lineWidth = 4 self.view.layer.addSublayer(shapeLayer1) let path2 = UIBezierPath() path2.move(to: CGPoint(x: 0, y: view.bounds.size.height/2)) path2.addCurve(to: CGPoint(x: view.bounds.size.width, y: view.bounds.size.height/2), controlPoint1: CGPoint(x: view.bounds.size.width/2, y: 100), controlPoint2: CGPoint(x: view.bounds.size.width/2, y: view.bounds.size.height - 100)) let shapeLayer2 = CAShapeLayer() shapeLayer2.path = path2.cgPath shapeLayer2.fillColor = UIColor.clear.cgColor shapeLayer2.strokeColor = UIColor.red.cgColor shapeLayer2.lineWidth = 4 self.view.layer.addSublayer(shapeLayer2) let path3 = UIBezierPath(ovalIn: self.testview.frame) let shapeLayer3 = CAShapeLayer() shapeLayer3.path = path3.cgPath shapeLayer3.fillColor = UIColor.clear.cgColor shapeLayer3.strokeColor = UIColor.red.cgColor shapeLayer3.lineWidth = 1 self.view.layer.addSublayer(shapeLayer3) //move circle with the path let anim1 = CAKeyframeAnimation(keyPath: "position") anim1.path = path1.cgPath anim1.duration = 2 anim1.autoreverses = true anim1.repeatCount = Float.greatestFiniteMagnitude self.testview.layer.add(anim1, forKey: "") let anim2 = CAKeyframeAnimation(keyPath: "position") anim2.path = path2.cgPath anim2.duration = 2 anim2.autoreverses = true anim2.repeatCount = Float.greatestFiniteMagnitude self.testLabel.layer.add(anim2, forKey: "") let anim3 = CAKeyframeAnimation(keyPath: "position") anim3.path = path3.cgPath anim3.duration = 6 anim3.repeatCount = Float.greatestFiniteMagnitude anim3.isRemovedOnCompletion = false anim3.fillMode = kCAFillModeForwards let circle = CAShapeLayer() circle.frame = CGRect(x: 0, y: 0, width: 20, height: 20) circle.path = UIBezierPath(ovalIn: circle.frame).cgPath circle.anchorPoint = CGPoint(x: 0.5, y: 0.5) circle.fillColor = UIColor.blue.cgColor self.view.layer.addSublayer(circle) circle.add(anim3, forKey: "") let circle2 = CAShapeLayer() circle2.frame = CGRect(x: 0, y: 0, width: 10, height: 10) circle2.path = UIBezierPath(ovalIn: circle2.frame).cgPath circle2.anchorPoint = CGPoint(x: 0.5, y: 0.5) circle2.fillColor = UIColor.orange.cgColor view.layer.addSublayer(circle2) circle2.add(anim3, forKey: "") } override func viewDidLoad() { super.viewDidLoad() self.testview.layer.shadowColor = UIColor.black.cgColor self.testview.layer.shadowOffset = CGSize(width: 10, height: 10) self.testview.layer.shadowOpacity = 0.5 self.testview.layer.shadowRadius = 5 testview.layer.cornerRadius = 5 // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ -1 ]
5d205e3aa55e4286a96a74b66f7f4900deea7a44
53c1397368938518a94169d00c3cfcca27430ec4
/DiaBLE Watch/MainDelegate.swift
d053478331855ec3e221a223874338b264bd8cba
[ "MIT" ]
permissive
gui-dos/DiaBLE
693d6973225c0b49b090e76719913b929ec732a8
3d06e96dd55dd5c249527f7c2fa4e7fe43c334c2
refs/heads/dev
2023-08-05T00:19:51.878309
2023-07-18T10:31:04
2023-07-18T10:34:51
481,504,454
120
27
MIT
2023-03-02T12:45:38
2022-04-14T07:15:14
Swift
UTF-8
Swift
false
false
13,059
swift
import SwiftUI import CoreBluetooth import AVFoundation import os.log public class MainDelegate: NSObject, WKApplicationDelegate, WKExtendedRuntimeSessionDelegate { var app: AppState var logger: Logger var log: Log var history: History var settings: Settings var extendedSession: WKExtendedRuntimeSession! // TODO var centralManager: CBCentralManager var bluetoothDelegate: BluetoothDelegate var healthKit: HealthKit? var libreLinkUp: LibreLinkUp? var nightscout: Nightscout? override init() { UserDefaults.standard.register(defaults: Settings.defaults) app = AppState() logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "Debug") log = Log() history = History() settings = Settings() extendedSession = WKExtendedRuntimeSession() bluetoothDelegate = BluetoothDelegate() centralManager = CBCentralManager(delegate: bluetoothDelegate, queue: nil, options: [CBCentralManagerOptionRestoreIdentifierKey: "DiaBLE"]) healthKit = HealthKit() super.init() log.entries = [LogEntry(message: "Welcome to DiaBLE!"), LogEntry(message: "\(settings.logging ? "Log started" : "Log stopped") \(Date().local)")] debugLog("User defaults: \(Settings.defaults.keys.map { [$0, UserDefaults.standard.dictionaryRepresentation()[$0]!] }.sorted{($0[0] as! String) < ($1[0] as! String) })") app.main = self extendedSession.delegate = self bluetoothDelegate.main = self if let healthKit { healthKit.main = self healthKit.authorize { self.log("HealthKit: \( $0 ? "" : "not ")authorized") if healthKit.isAuthorized { healthKit.read { [self] in debugLog("HealthKit last 12 stored values: \($0[..<(min(12, $0.count))])") } } } } else { self.log("HealthKit: not available") } libreLinkUp = LibreLinkUp(main: self) nightscout = Nightscout(main: self) nightscout!.read() let numberFormatter = NumberFormatter() numberFormatter.minimumFractionDigits = 8 settings.numberFormatter = numberFormatter // features currently in beta testing if settings.userLevel >= .test { Libre3.testAESCCM() // app.sensor = LibrePro.test(main: self) } } public func log(_ msg: String, level: LogLevel = .info, label: String = "") { if settings.logging || msg.hasPrefix("Log") { DispatchQueue.main.async { let entry = LogEntry(message: msg, level: level, label: label) if self.settings.reversedLog { self.log.entries.insert(entry, at: 0) } else { self.log.entries.append(entry) } print(msg) if self.settings.userLevel > .basic { self.logger.log("\(msg)") } if !entry.label.isEmpty { self.log.labels.insert(entry.label) } } } } public func debugLog(_ msg: String) { if settings.userLevel > .basic { log(msg, level: .debug) } } public func status(_ text: String) { DispatchQueue.main.async { self.app.status = text } } public func errorStatus(_ text: String) { if !self.app.status.contains(text) { DispatchQueue.main.async { self.app.status.append("\n\(text)") } } } public func handle(_ backgroundTasks: Set<WKRefreshBackgroundTask>) { log("TODO: handling background tasks") } public func rescan() { if let device = app.device { centralManager.cancelPeripheralConnection(device.peripheral!) } if centralManager.state == .poweredOn { settings.stoppedBluetooth = false if let peripheral = centralManager.retrieveConnectedPeripherals(withServices: [CBUUID(string: Libre3.UUID.data.rawValue)]).first { bluetoothDelegate.centralManager(centralManager, didDiscover: peripheral, advertisementData: [CBAdvertisementDataServiceUUIDsKey: [CBUUID(string: Libre3.UUID.data.rawValue)]], rssi: 0) } else { centralManager.scanForPeripherals(withServices: nil, options: nil) status("Scanning...") } } healthKit?.read() nightscout?.read() } public func playAlarm() { let currentGlucose = app.currentGlucose if !settings.mutedAudio { do { try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, options: [.duckOthers]) try AVAudioSession.sharedInstance().setActive(true) } catch { log("Audio Session error: \(error)") } let soundName = currentGlucose > Int(settings.alarmHigh) ? "alarm_high" : "alarm_low" let audioPlayer = try! AVAudioPlayer(contentsOf: URL(fileURLWithPath: Bundle.main.path(forResource: soundName, ofType: "mp3")!), fileTypeHint: "mp3") audioPlayer.play() _ = Timer.scheduledTimer(withTimeInterval: 4, repeats: false) { _ in audioPlayer.stop() do { try AVAudioSession.sharedInstance().setActive(false) } catch { } } } if !settings.disabledNotifications { let hapticDirection: WKHapticType = currentGlucose > Int(settings.alarmHigh) ? .directionUp : .directionDown WKInterfaceDevice.current().play(hapticDirection) let times = currentGlucose > Int(settings.alarmHigh) ? 3 : 4 let pause = times == 3 ? 1.0 : 5.0 / 6 for s in 0 ..< times { DispatchQueue.main.asyncAfter(deadline: .now() + Double(s) * pause) { WKInterfaceDevice.current().play(.notification) } } } } func parseSensorData(_ sensor: Sensor) { sensor.detailFRAM() if sensor.history.count > 0 || sensor.trend.count > 0 { let calibrationInfo = sensor.calibrationInfo if sensor.serial == settings.activeSensorSerial { settings.activeSensorCalibrationInfo = calibrationInfo } history.rawTrend = sensor.trend log("Raw trend: \(sensor.trend.map(\.rawValue))") debugLog("Raw trend temperatures: \(sensor.trend.map(\.rawTemperature))") let factoryTrend = sensor.factoryTrend history.factoryTrend = factoryTrend log("Factory trend: \(factoryTrend.map(\.value))") log("Trend temperatures: \(factoryTrend.map { Double(String(format: "%.1f", $0.temperature))! }))") history.rawValues = sensor.history log("Raw history: \(sensor.history.map(\.rawValue))") debugLog("Raw historic temperatures: \(sensor.history.map(\.rawTemperature))") let factoryHistory = sensor.factoryHistory history.factoryValues = factoryHistory log("Factory history: \(factoryHistory.map(\.value))") log("Historic temperatures: \(factoryHistory.map { Double(String(format: "%.1f", $0.temperature))! })") // TODO debugLog("Trend has errors: \(sensor.trend.map(\.hasError))") debugLog("Trend data quality: [\n\(sensor.trend.map(\.dataQuality.description).joined(separator: ",\n"))\n]") debugLog("Trend quality flags: [\(sensor.trend.map { "0" + String($0.dataQualityFlags,radix: 2).suffix(2) }.joined(separator: ", "))]") debugLog("History has errors: \(sensor.history.map(\.hasError))") debugLog("History data quality: [\n\(sensor.history.map(\.dataQuality.description).joined(separator: ",\n"))\n]") debugLog("History quality flags: [\(sensor.history.map { "0" + String($0.dataQualityFlags,radix: 2).suffix(2) }.joined(separator: ", "))]") } debugLog("Sensor uid: \(sensor.uid.hex), saved uid: \(settings.patchUid.hex), patch info: \(sensor.patchInfo.hex.count > 0 ? sensor.patchInfo.hex : "<nil>"), saved patch info: \(settings.patchInfo.hex)") if sensor.uid.count > 0 && sensor.patchInfo.count > 0 { settings.patchUid = sensor.uid settings.patchInfo = sensor.patchInfo } if sensor.uid.count == 0 || settings.patchUid.count > 0 { if sensor.uid.count == 0 { sensor.uid = settings.patchUid } if sensor.uid == settings.patchUid { sensor.patchInfo = settings.patchInfo } } Task { didParseSensor(sensor) } } func didParseSensor(_ sensor: Sensor?) { guard let sensor else { extendedSession.start(at: max(app.lastReadingDate, app.lastConnectionDate) + Double(settings.readingInterval * 60) - 5.0) log("Watch: extended session to be started in \(Double(settings.readingInterval * 60) - 5.0) seconds") return } if history.factoryTrend.count > 0 { app.currentGlucose = history.factoryTrend[0].value } let currentGlucose = app.currentGlucose // TODO: delete mirrored implementation from Abbott Device // TODO: compute accurate delta and update trend arrow if history.factoryTrend.count > 6 { let deltaMinutes = history.factoryTrend[5].value > 0 ? 5 : 6 let delta = (history.factoryTrend[0].value > 0 ? history.factoryTrend[0].value : (history.factoryTrend[1].value > 0 ? history.factoryTrend[1].value : history.factoryTrend[2].value)) - history.factoryTrend[deltaMinutes].value app.trendDeltaMinutes = deltaMinutes app.trendDelta = delta } // var title = currentGlucose > 0 ? currentGlucose.units : "---" let snoozed = settings.lastAlarmDate.timeIntervalSinceNow >= -Double(settings.alarmSnoozeInterval * 60) && settings.disabledNotifications if currentGlucose > 0 && (currentGlucose > Int(settings.alarmHigh) || currentGlucose < Int(settings.alarmLow)) { log("ALARM: current glucose: \(currentGlucose.units) (settings: high: \(settings.alarmHigh.units), low: \(settings.alarmLow.units), muted audio: \(settings.mutedAudio ? "yes" : "no")), \(snoozed ? "" : "not ")snoozed") if !snoozed { playAlarm() } } if !snoozed { settings.lastAlarmDate = Date.now } if history.values.count > 0 || history.factoryValues.count > 0 || currentGlucose > 0 { var entries = [Glucose]() if history.values.count > 0 { entries += history.values } else { entries += history.factoryValues } entries += history.factoryTrend.dropFirst() + [Glucose(currentGlucose, date: sensor.lastReadingDate)] entries = entries.filter { $0.value > 0 && $0.id > -1 } // TODO let newEntries = (entries.filter { $0.date > healthKit?.lastDate ?? Calendar.current.date(byAdding: .hour, value: -8, to: Date())! }) if newEntries.count > 0 { healthKit?.write(newEntries) healthKit?.read() } nightscout?.read { values in let newEntries = values.count > 0 ? entries.filter { $0.date > values[0].date } : entries if newEntries.count > 0 { self.nightscout?.post(entries: newEntries) { data, response, error in self.nightscout?.read() } } } } // TODO: extendedSession.start(at: max(app.lastReadingDate, app.lastConnectionDate) + Double(settings.readingInterval * 60) - 5.0) log("Watch: extended session to be started in \(Double(settings.readingInterval * 60) - 5.0) seconds") } public func extendedRuntimeSessionDidStart(_ extendedRuntimeSession: WKExtendedRuntimeSession) { debugLog("Watch: extended session did start") } public func extendedRuntimeSessionWillExpire(_ extendedRuntimeSession: WKExtendedRuntimeSession) { debugLog("Watch: extended session wiil expire") } public func extendedRuntimeSession(_ extendedRuntimeSession: WKExtendedRuntimeSession, didInvalidateWith reason: WKExtendedRuntimeSessionInvalidationReason, error: Error?) { let errorDescription = error != nil ? error!.localizedDescription : "undefined" debugLog("Watch: extended session did invalidate: reason: \(reason), error: \(errorDescription)") } }
[ -1 ]
228e64cda826fd67401bd9c1294b4a19b4f9f328
651a0f387fd554320781ec44947da46e7f8d0550
/xcode/bucketList/bucketList/AddItemTableViewController.swift
83ea4a897ab6032b66bf0c48540e4a676b0f35ed
[]
no_license
soodorama/CodingDojo
7c74bf0baaf1eb299d40c18ad85fb2dcd44109d8
2006200876697f87f5ce50819db8900eb9ad8cbc
refs/heads/master
2020-03-23T08:53:29.141927
2018-10-16T08:28:18
2018-10-16T08:28:18
141,354,087
0
0
null
null
null
null
UTF-8
Swift
false
false
960
swift
// // AddItemTableTableViewController.swift // bucketList // // Created by Neil Sood on 9/11/18. // Copyright © 2018 Neil Sood. All rights reserved. // import UIKit class AddItemTableViewController: UITableViewController { weak var delegate: CancelButtonDelegate? @IBAction func cancelButtonPressed(_ sender: UIBarButtonItem) { delegate?.cancelButtonPressed(by: self) } override func viewDidLoad() { super.viewDidLoad() // Uncomment the following line to preserve selection between presentations // self.clearsSelectionOnViewWillAppear = false // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ 316735 ]
72e38b2e8132c6a3ba2af46d6131e55e0af7a57e
92059b19cf008a04d81a6311bf784568072c8d47
/Post.swift
bc1a614503d1226857cf0ec74bd62b6042339f9f
[]
no_license
hellofoobar/disMyHood
574e01e9162f892cca9549392886bc859673b717
c4d3deaa573c87fc7963064024326146436616b3
refs/heads/master
2021-01-10T11:38:31.214997
2015-12-28T05:48:22
2015-12-28T05:48:22
48,676,244
0
0
null
null
null
null
UTF-8
Swift
false
false
421
swift
// // Post.swift // disMyHood // // Created by yolo on 2015-12-27. // Copyright © 2015 foobar. All rights reserved. // import Foundation class Post { private var imagePath: String private var title: String private var postDesc: String init(imagePath: String, title: String, postDesc: String) { self.imagePath = imagePath self.title = title self.title = postDesc } }
[ -1 ]
11a47c993e81bddf97101c09ce9776a344380020
4366d46ef75c7cdd7d3a4f44a51ab463d79fdc8f
/inviko capstone/Frontend/iOS/InViKo/InViKo/DashboardController.swift
5f04e9bfb516493bccf04f7a16b4c77925ecd58a
[]
no_license
Harshu1909/Projects
21e89aacffcd9bb9fafdd26e83eb0daf280af039
93581a7c93dec693d49fa922084c69e9f2344e62
refs/heads/master
2020-05-27T02:54:43.711300
2019-05-24T16:55:45
2019-05-24T16:55:45
188,457,870
0
0
null
null
null
null
UTF-8
Swift
false
false
8,498
swift
// // DashboardController.swift // InViKo // // Created by Student on 2019-03-11. // Copyright © 2019 Student. All rights reserved. // import UIKit class DashboardController: UIViewController, UITableViewDelegate, UITableViewDataSource { @IBOutlet weak var tvAppoinments: UITableView! @IBOutlet weak var lbUser: UILabel! @IBOutlet weak var lbNumOfApps: UILabel! var user: String = "User" var appointments = [Appointment]() func colorForIndex(_ index: Int) -> UIColor { if (index % 2 == 0) { return UIColor(red: 0, green: 0.588, blue: 1.0, alpha: 1.0) } else { return UIColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) } } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return appointments.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cellIdentifier = "AppointmentTableViewCell" guard let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) as? AppointmentTableViewCell else { fatalError("The dequeued cell is not an instance of AppointmentTableViewCell.") } let appointment = appointments[indexPath.row] let doctorText = appointment.doctor.firstName + " " + appointment.doctor.lastName let patientText = appointment.patient.fName + " " + appointment.patient.lName let patientLength = patientText.count let doctorLength = doctorText.count cell.lbTime.text = appointment.time cell.lbDate.text = appointment.date cell.lbDoctor.text = doctorLength > 10 ? String(doctorText.prefix(10)) + ".." : doctorText cell.lbPatient.text = patientLength > 10 ? subString(patientText, 0 , 10) + ".." : patientText cell.backgroundColor = colorForIndex(indexPath.row) return cell } func subString(_ string: String, _ lowerBound: Int, _ upperBound: Int) -> String { let lowerBound = string.index(string.startIndex, offsetBy: lowerBound) let upperBound = string.index(string.startIndex, offsetBy: upperBound) let subString = string[lowerBound..<upperBound] return String(subString) } func numberOfSections(in tableView: UITableView) -> Int { return 1 } override func viewDidLoad() { super.viewDidLoad() tvAppoinments.dataSource = self loadAppointments() let defaults = UserDefaults.standard user = defaults.string(forKey: "username")! lbUser.text = user // Do any additional setup after loading the view. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ @IBAction func unwindFromAddNewAppointment(_ sender: UIStoryboardSegue) { } @IBAction func unwindWhenAppointmentIsAdded(_ sender: UIStoryboardSegue) { if (sender.source is AppointmentOptionsController) { if let senderVC = sender.source as? AppointmentOptionsController { appointments.append(senderVC.appointment) } tvAppoinments.reloadData() lbNumOfApps.text = String(appointments.count) } } public func loadAppointments() { /* call API to get Json list -> parse to Appointments Add appointments to array */ guard let url = URL(string:"http://localhost:5000/api/list_appointment") else { return } var request = URLRequest(url: url) request.httpMethod = "GET" request.addValue("application/json", forHTTPHeaderField: "Content-Type") guard let httpbody = try? JSONSerialization.data(withJSONObject: [], options:[]) else { return } request.httpBody = httpbody let session = URLSession.shared session.dataTask(with: request){(data,response,error) in DispatchQueue.main.async { if let data = data { do { //create json object from data if let json = try JSONSerialization.jsonObject(with: data) as? [String: Any] { if let status = json["status"] as? Int, status == 200 { guard let appList = json["List_Appointment"] as? [[String: Any]] else { return } for app in appList { guard let time = app["availablity_time"] as? String else {return} guard let date = app["availablity_date"] as? String else {return} guard let patientFirstName = app["patient_firstname"] as? String else {return} guard let patientLastName = app["patient_lastname"] as? String else {return} let patient = Patient() patient.fName = patientFirstName patient.lName = patientLastName guard let doctorFirstName = app["doctor_firstname"] as? String else {return} guard let doctorLastName = app["doctor_lastname"] as? String else {return} let doctor = Doctor() doctor.firstName = doctorFirstName doctor.lastName = doctorLastName let appointment = Appointment(time, date, patient, doctor) self.appointments.append(appointment) } self.tvAppoinments.reloadData() self.lbNumOfApps.text = String(self.appointments.count) } else { let alertController = UIAlertController(title: "Alert", message: "Load appointments failed!", preferredStyle: UIAlertController.Style.alert) alertController.addAction(UIAlertAction(title: "Dismiss", style: UIAlertAction.Style.default,handler: nil)) self.present(alertController, animated: true, completion: nil) } } } catch let error { print(error.localizedDescription) } } } }.resume() // var app1 = Appointment("1:30","04/13/2019",Patient("John", "Seko", "[email protected]", 1995, "123 Old Carriage", "Male"), "John Reko") // var app2 = Appointment("2:21","04/14/2019",Patient("John", "Seko", "[email protected]", 1995, "123 Old Carriage", "Male"),"Josh Joshua") // var app3 = Appointment("3:21","05/13/2019",Patient("Remy", "Laine", "[email protected]", 1984, "1223 Old Carriage", "Female"),"John Reko") // var app4 = Appointment("5:32","06/11/2019",Patient("John", "Seko", "[email protected]", 1995, "123 Old Carriage", "Male"),"Rock Le") // var app5 = Appointment("2:21","09/13/2019",Patient("Remy", "Laine", "[email protected]", 1984, "1223 Old Carriage", "Female"),"Josh Joshua") // var app6 = Appointment("6:24","10/13/2019",Patient("John", "Seko", "[email protected]", 1995, "123 Old Carriage", "Male"),"John Reko") // var app7 = Appointment("7:12","11/13/2019",Patient("John", "Seko", "[email protected]", 1995, "123 Old Carriage", "Male"),"Rock Le") // var app8 = Appointment("6:11","12/13/2019",Patient("Remy", "Laine", "[email protected]", 1984, "1223 Old Carriage", "Female"),"Josh Joshua") // var app9 = Appointment("2:54","02/13/2020",Patient("John", "Seko", "[email protected]", 1995, "123 Old Carriage", "Male"),"John Reko") // var app10 = Appointment("9:52","04/13/2020",Patient("John", "Seko", "[email protected]", 1995, "123 Old Carriage", "Male"),"Josh Joshua") // appointments += [app1,app2,app3,app4,app5,app6,app7,app8,app9,app10] } }
[ -1 ]
50d81ca05621d842214746861e46a8d28c29a1d6
971965666e363fbea28e9c32848284360e82b543
/RundezvousS4/RundezvousS4/Controllers/HostController.swift
a9993875279b494075d566aec1411c85eb7c0541
[]
no_license
MobiluxBC/Rundezvous
6e1915cc2477530595c2587bfb3dbe0e2363584c
088c43498f74662d2a4cb8c69bf394e1eb332a10
refs/heads/develop
2021-05-16T12:48:30.439031
2017-12-08T21:17:19
2017-12-08T21:17:19
105,316,939
1
4
null
2017-12-08T21:17:20
2017-09-29T21:03:38
Objective-C
UTF-8
Swift
false
false
3,115
swift
// // HostController.swift // RundezvousS4 // // Created by Niko Arellano on 2017-09-29. // Copyright © 2017 Mobilux. All rights reserved. // import UIKit class HostController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() // Uncomment the following line to preserve selection between presentations // self.clearsSelectionOnViewWillAppear = false // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem } 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 { // #warning Incomplete implementation, return the number of sections return 0 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return 0 } /* override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath) // Configure the cell... return cell } */ /* // Override to support conditional editing of the table view. override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { // Return false if you do not want the specified item to be editable. return true } */ /* // Override to support editing the table view. override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == .delete { // Delete the row from the data source tableView.deleteRows(at: [indexPath], with: .fade) } else if editingStyle == .insert { // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view } } */ /* // Override to support rearranging the table view. override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { } */ /* // Override to support conditional rearranging of the table view. override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { // Return false if you do not want the item to be re-orderable. return true } */ /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ 294401, 253315, 278662, 318729, 318730, 374286, 312591, 374289, 336148, 290330, 125175, 319773, 248990, 279327, 332323, 282918, 292141, 124670, 281139, 281140, 316725, 303542, 125110, 343225, 285243, 292155, 288190, 176710, 283465, 285437, 322635, 302924, 180690, 253140, 207957, 253309, 167390, 312673, 311652, 295784, 340712, 292333, 290158, 292334, 290159, 292337, 290162, 290163, 290164, 290165, 228206, 290167, 290168, 294525, 123646 ]
7c8d01fecc329c2ea33b96617826f9e545922b26
f989749d59c58fae39eab8c09950322cdf9480a5
/Tests/UIKitTests/UISwitchExtensionsTests.swift
f3c95a0d3db9cf2903379c46783b9a996407c66e
[ "MIT" ]
permissive
virajpsimformsolutions/SwifterSwift
6b747b26e9484596b931d83cd09ce067719654d6
c3c0925942e16673464042b9ecd30249c615378f
refs/heads/master
2021-05-07T14:14:11.094645
2017-11-05T16:53:08
2017-11-05T16:53:08
null
0
0
null
null
null
null
UTF-8
Swift
false
false
486
swift
// // UISwitchExtensionsTests.swift // SwifterSwift // // Created by Omar Albeik on 2/15/17. // Copyright © 2017 omaralbeik. All rights reserved. // import XCTest @testable import SwifterSwift #if os(iOS) final class UISwitchExtensionsTests: XCTestCase { func testToggle() { let frame = CGRect(x: 0, y: 0, width: 100, height: 30) let aSwitch = UISwitch(frame: frame) XCTAssertFalse(aSwitch.isOn) aSwitch.toggle(animated: false) XCTAssert(aSwitch.isOn) } } #endif
[ -1 ]
371dc429ff9e9f527da3ccba898113a270c6d756
f8142ccfba6e196ecbaacd8b1d2f8cc86269702b
/LitFactoryTests/LitFactoryTests.swift
b8011f6bdfd8b0f2e7ed67a726501795affae6a3
[]
no_license
isaacwang4076/LitFactory
e2c9fd76abc8089e6e95db6b0c00836c54df4911
4ae4cea75de0bcef01570e70291bb43b5a03a2c2
refs/heads/master
2021-01-18T20:08:22.053874
2016-10-17T20:43:41
2016-10-17T20:43:41
69,769,429
1
0
null
null
null
null
UTF-8
Swift
false
false
978
swift
// // LitFactoryTests.swift // LitFactoryTests // // Created by Isaac Wang on 10/1/16. // Copyright © 2016 DankMemrs. All rights reserved. // import XCTest @testable import LitFactory class LitFactoryTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 360462, 98333, 278558, 16419, 229413, 204840, 278570, 344107, 360491, 155694, 253999, 229424, 229430, 319542, 163896, 180280, 213052, 376894, 286788, 352326, 311372, 196691, 278615, 385116, 237663, 254048, 319591, 221290, 278634, 278638, 319598, 352368, 204916, 131189, 131191, 237689, 131198, 278655, 311435, 311438, 278677, 196760, 426138, 278685, 311458, 278691, 49316, 196773, 278699, 32941, 278704, 377009, 278708, 131256, 295098, 139479, 254170, 229597, 311519, 205035, 286958, 327929, 344313, 147717, 368905, 278797, 180493, 254226, 319763, 368916, 262421, 377114, 278810, 237856, 237857, 278816, 311597, 98610, 262450, 180535, 336183, 278842, 287041, 319813, 311621, 319821, 254286, 344401, 377169, 368981, 155990, 368984, 106847, 98657, 270701, 246127, 270706, 246136, 139640, 246137, 311681, 311685, 106888, 385417, 385422, 213403, 246178, 385454, 311727, 377264, 278961, 278965, 319930, 311738, 33211, 278970, 336317, 336320, 311745, 278978, 254406, 188871, 278989, 278993, 278999, 328152, 369116, 287198, 279008, 279013, 279018, 311786, 319981, 279022, 319987, 279029, 254456, 279032, 377338, 279039, 377343, 254465, 287241, 279050, 303631, 139792, 303636, 393751, 279065, 377376, 180771, 377386, 197167, 385588, 352829, 115270, 385615, 426576, 369235, 295519, 139872, 66150, 344680, 279146, 287346, 139892, 287352, 344696, 279164, 189057, 303746, 311941, 336518, 311945, 369289, 344715, 279177, 311949, 287374, 377489, 311954, 352917, 230040, 271000, 377497, 303771, 377500, 205471, 344738, 139939, 279206, 295590, 287404, 295599, 205487, 303793, 336564, 164533, 230072, 287417, 287422, 66242, 377539, 164560, 385747, 279252, 361176, 418520, 287452, 295652, 279269, 246503, 369385, 279280, 312052, 230134, 172792, 344827, 221948, 279294, 205568, 295682, 197386, 434957, 426774, 197399, 426775, 336671, 344865, 197411, 279336, 295724, 312108, 197422, 353070, 164656, 295729, 353069, 328499, 353078, 197431, 230199, 353079, 336702, 279362, 353094, 353095, 353109, 377686, 230234, 189275, 435039, 295776, 279392, 303972, 385893, 246641, 246643, 295798, 246648, 361337, 279417, 254850, 369538, 213894, 287622, 58253, 295824, 279456, 189348, 353195, 140204, 377772, 353197, 304051, 230332, 287677, 377790, 353215, 353216, 213957, 213960, 345033, 279498, 386006, 418776, 50143, 123881, 304110, 320494, 287731, 271350, 295927, 304122, 320507, 328700, 328706, 410627, 320516, 295942, 386056, 353290, 230410, 377869, 320527, 238610, 418837, 140310, 230423, 197657, 336929, 189474, 369701, 345132, 238639, 312373, 238651, 230463, 377926, 238664, 296019, 353367, 156764, 156765, 304222, 230499, 279660, 173166, 156785, 312434, 377972, 353397, 279672, 337017, 377983, 402565, 279685, 222343, 386189, 296086, 238743, 296092, 238765, 279728, 238769, 402613, 230588, 279747, 353479, 353481, 402634, 353482, 279760, 189652, 189653, 419029, 148696, 296153, 279774, 304351, 304356, 222440, 328940, 279792, 353523, 386294, 386301, 320770, 386306, 279814, 312587, 328971, 353551, 320796, 222494, 304421, 279854, 353584, 345396, 386359, 116026, 378172, 222524, 279875, 312648, 337225, 304456, 230729, 222541, 238927, 353616, 296273, 222559, 378209, 230756, 386412, 230765, 296303, 279920, 312689, 296307, 116084, 181625, 337281, 148867, 378244, 296329, 296335, 230799, 9619, 370071, 279974, 279984, 173491, 304564, 279989, 353719, 296375, 296387, 361927, 296392, 296391, 280010, 370123, 148940, 280013, 312782, 222675, 353750, 239068, 280032, 271843, 280041, 296425, 361963, 329197, 329200, 296433, 321009, 280055, 288249, 230921, 329225, 296461, 149007, 304656, 329232, 370197, 402985, 394794, 230959, 312880, 288309, 312889, 288318, 280130, 124485, 288326, 288327, 280147, 239198, 99938, 312940, 222832, 247416, 288378, 337534, 337535, 263809, 288392, 239250, 419478, 345752, 255649, 206504, 321199, 198324, 296628, 337591, 321207, 296632, 280251, 280257, 321219, 280267, 403148, 9936, 313041, 9937, 370388, 272085, 345814, 280278, 280280, 18138, 345821, 321247, 321249, 345833, 345834, 313065, 280300, 239341, 419569, 67315, 173814, 313081, 124669, 288512, 288516, 280327, 280329, 321302, 345879, 116505, 321310, 255776, 247590, 362283, 378668, 280366, 296755, 280372, 321337, 280380, 345919, 436031, 403267, 280390, 345929, 18262, 362327, 280410, 370522, 345951, 362337, 345955, 296806, 288619, 288620, 280430, 214895, 313199, 362352, 313203, 124798, 182144, 305026, 67463, 329622, 337815, 124824, 214937, 247712, 436131, 354212, 436137, 362417, 124852, 288697, 362431, 214977, 280514, 214984, 362443, 247757, 231375, 280541, 329695, 436191, 313319, 337895, 247785, 296941, 436205, 329712, 362480, 313339, 43014, 354316, 313357, 182296, 305179, 313375, 239650, 354343, 354345, 223274, 124975, 346162, 124984, 288828, 436285, 288833, 288834, 436292, 403525, 313416, 280649, 436301, 354385, 338001, 338003, 223316, 280661, 329814, 223318, 338007, 354393, 288857, 280675, 280677, 43110, 321637, 313447, 436329, 288879, 223350, 280694, 288889, 215164, 313469, 215166, 280712, 141450, 215178, 346271, 436383, 362659, 239793, 125109, 182456, 280762, 223419, 379071, 280768, 149703, 338119, 346314, 321745, 387296, 280802, 379106, 338150, 346346, 321772, 125169, 338164, 436470, 157944, 125183, 149760, 411906, 125188, 313608, 125193, 125198, 272658, 125203, 125208, 305440, 125217, 338218, 321840, 379186, 125235, 280887, 125240, 321860, 280902, 182598, 289110, 215385, 272729, 379225, 354655, 321894, 280939, 354676, 436608, 362881, 248194, 240002, 436611, 280961, 395659, 395661, 240016, 108944, 190871, 149916, 420253, 141728, 289189, 108972, 272813, 338356, 436661, 289232, 281040, 256477, 281072, 174593, 420369, 223767, 289304, 223769, 207393, 182817, 289332, 174648, 338489, 338490, 322120, 281166, 297560, 354911, 436832, 436834, 191082, 313966, 420463, 281199, 346737, 313971, 346740, 420471, 330379, 133774, 330387, 117396, 346772, 330388, 264856, 289434, 346779, 338613, 166582, 314040, 158394, 199366, 363211, 363230, 289502, 264928, 338662, 330474, 346858, 289518, 199414, 35583, 363263, 191235, 322313, 322316, 117517, 322319, 166676, 207640, 281377, 289576, 191283, 273207, 289598, 281408, 420677, 281427, 281433, 322395, 330609, 207732, 158593, 240518, 224145, 355217, 256922, 289690, 289698, 420773, 289703, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 52172, 183248, 338899, 248796, 248797, 207838, 347103, 314342, 289774, 183279, 347123, 314355, 240630, 314362, 257024, 330754, 134150, 330763, 322582, 281625, 281626, 175132, 248872, 322612, 207938, 314448, 339030, 314467, 281700, 257125, 322663, 273515, 207979, 404593, 363641, 363644, 150657, 248961, 330888, 363669, 339100, 380061, 339102, 199839, 429214, 330913, 306338, 265379, 249002, 306346, 3246, 421048, 208058, 339130, 265412, 290000, 298208, 363744, 298212, 298213, 290022, 330984, 298221, 298228, 216315, 208124, 388349, 363771, 437505, 322824, 257305, 126237, 339234, 199971, 372009, 412971, 306494, 216386, 224586, 372043, 331090, 314709, 314710, 372054, 159066, 224606, 314720, 142689, 281957, 281962, 380271, 314739, 208244, 249204, 290173, 306559, 224640, 314751, 314758, 298374, 314760, 142729, 388487, 281992, 314766, 306579, 282007, 290207, 314783, 314789, 282022, 314791, 396711, 396712, 282024, 241066, 314798, 380337, 380338, 150965, 380357, 339398, 306639, 413137, 429542, 191981, 282096, 306673, 306677, 191990, 290301, 282114, 372227, 306693, 323080, 192010, 323087, 175639, 388632, 282136, 396827, 282141, 134686, 282146, 306723, 347694, 290358, 265798, 282183, 265804, 396882, 290390, 44635, 396895, 323172, 282213, 323178, 224883, 314998, 323196, 175741, 339584, 192131, 282245, 224901, 282246, 290443, 323217, 282259, 282271, 282273, 282276, 298661, 323236, 290471, 282280, 298667, 224946, 110268, 224958, 323263, 282303, 274115, 306890, 241361, 298712, 216795, 298720, 12010, 282348, 282358, 175873, 323331, 323332, 339715, 216839, 339720, 372496, 323346, 249626, 282400, 339745, 241441, 257830, 421672, 159533, 282417, 282427, 315202, 282434, 307011, 282438, 216918, 241495, 307031, 282474, 241528, 315264, 339841, 282504, 315273, 315274, 372626, 380821, 282518, 282519, 44952, 298909, 118685, 200627, 323507, 282549, 290745, 290746, 274371, 151497, 372701, 298980, 380908, 282612, 290811, 282633, 241692, 307231, 102437, 315432, 102445, 233517, 176175, 241716, 159807, 225351, 315465, 315476, 307289, 200794, 315487, 356447, 307299, 315497, 315498, 438377, 299121, 233589, 266357, 422019, 241808, 323729, 381073, 233636, 299174, 299187, 405687, 184505, 299198, 258239, 389313, 299203, 299209, 372941, 282831, 266449, 356576, 176362, 307435, 438511, 233715, 381172, 184570, 168188, 184575, 381208, 299293, 151839, 233762, 217380, 282919, 151847, 332083, 332085, 332089, 315706, 282939, 241986, 438596, 332101, 323913, 348492, 323916, 323920, 250192, 348500, 168281, 332123, 332127, 323935, 242023, 242029, 160110, 242033, 291192, 340357, 225670, 242058, 373134, 291224, 242078, 283038, 61857, 315810, 315811, 381347, 61859, 340398, 61873, 61880, 283064, 127427, 127428, 283075, 324039, 373197, 176601, 242139, 160225, 242148, 291311, 233978, 291333, 340490, 283153, 258581, 291358, 283182, 283184, 234036, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 381517, 332378, 201308, 111208, 184940, 373358, 389745, 209530, 291454, 373375, 184962, 152195, 348806, 152203, 184973, 316049, 111253, 316053, 111258, 111259, 176808, 299699, 299700, 422596, 422599, 291530, 225995, 225997, 242386, 226004, 226007, 422617, 422626, 226019, 234217, 299759, 234234, 299776, 291585, 430849, 234241, 209670, 291592, 226058, 234250, 62220, 234253, 422673, 430865, 291604, 234263, 422680, 283419, 234268, 234277, 234283, 152365, 234286, 422703, 234289, 422709, 152374, 234294, 242485, 160571, 234301, 430910, 160575, 160580, 234311, 234312, 299849, 283467, 381773, 234317, 201551, 234323, 234326, 234331, 242529, 349026, 357218, 234340, 234343, 275303, 201577, 234346, 308076, 242541, 234355, 234360, 209785, 234361, 177019, 185211, 308092, 398206, 234366, 291712, 234367, 234372, 381829, 226181, 226184, 316298, 308107, 308112, 349072, 234386, 234387, 234392, 209817, 324506, 324507, 390045, 234400, 185250, 234404, 324517, 185254, 283558, 234409, 275371, 234419, 373687, 234425, 234427, 234430, 349121, 234436, 234438, 373706, 316364, 234444, 234445, 234451, 234454, 234457, 340955, 234463, 340961, 234466, 234472, 234473, 324586, 234477, 340974, 234482, 316405, 349175, 201720, 127992, 234498, 357379, 234500, 234506, 324625, 234514, 308243, 316437, 201755, 234531, 300068, 357414, 234534, 234542, 300084, 234548, 324666, 234555, 308287, 234560, 21569, 234565, 234569, 218186, 300111, 341073, 234577, 234583, 439384, 234584, 234587, 250981, 300135, 300136, 316520, 275565, 357486, 316526, 144496, 300146, 275571, 300150, 291959, 300151, 234616, 398457, 160891, 341115, 300158, 234622, 349316, 349318, 275591, 234632, 234638, 373903, 169104, 177296, 234642, 308372, 185493, 119962, 300187, 300188, 119963, 234656, 234659, 234663, 300201, 300202, 275625, 226481, 373945, 283840, 259268, 283847, 62665, 283852, 283853, 259280, 316627, 333011, 357595, 234733, 234742, 128251, 316669, 234755, 439562, 292107, 242954, 414990, 251153, 177428, 349462, 226608, 382258, 300343, 382269, 226624, 193859, 226632, 177484, 406861, 259406, 234831, 251213, 120148, 283991, 357719, 374109, 218462, 292195, 333160, 284014, 243056, 316787, 111993, 357762, 112017, 234898, 259475, 275859, 112018, 357786, 251298, 333220, 316842, 374191, 210358, 284089, 292283, 415171, 292292, 300487, 300489, 284107, 284116, 366037, 210390, 210391, 210393, 226781, 144867, 316902, 54765, 251378, 308723, 300536, 300542, 210433, 366083, 259599, 316946, 308756, 398869, 374296, 374299, 308764, 349726, 431649, 349741, 169518, 431663, 194110, 235070, 349763, 218696, 292425, 276040, 128587, 333388, 366154, 276045, 243274, 333393, 300630, 128599, 235095, 243292, 333408, 300644, 374372, 317032, 415338, 243307, 54893, 325231, 276085, 366203, 325245, 235135, 194180, 415375, 276120, 276126, 153251, 300714, 210603, 415420, 333503, 218819, 259781, 333517, 276173, 333520, 333521, 333523, 325346, 276195, 153319, 325352, 284401, 276210, 325371, 276219, 194303, 284429, 276238, 243472, 366360, 284442, 325404, 276253, 325410, 341796, 399147, 431916, 300848, 317232, 276282, 259899, 276283, 325439, 276287, 276294, 153415, 276298, 341836, 415567, 325457, 317269, 341847, 350044, 128862, 300894, 284514, 292712, 325484, 423789, 292720, 325492, 276341, 341879, 317304, 333688, 276344, 112509, 194429, 55167, 325503, 333701, 243591, 243597, 325518, 333722, 350109, 292771, 415655, 333735, 284587, 292782, 243637, 276408, 276421, 276430, 301008, 153554, 276444, 219101, 292836, 292837, 276454, 317415, 276459, 325619, 432116, 333817, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 292902, 325674, 227370, 309295, 129076, 276534, 243767, 358456, 227417, 194656, 309345, 227428, 276582, 194666, 276589, 260207, 432240, 227439, 333940, 284788, 292988, 292992, 194691, 227460, 333955, 415881, 104587, 235662, 325776, 276627, 317587, 276632, 284826, 333991, 333992, 284842, 129203, 301251, 309444, 276682, 194782, 301279, 317664, 211193, 243962, 375039, 309503, 194820, 375051, 325905, 325912, 309529, 211235, 432421, 211238, 358703, 358709, 260418, 227658, 276813, 325968, 6481, 366930, 6482, 366929, 6489, 391520, 276835, 383332, 383336, 416104, 276847, 285040, 317820, 211326, 317831, 227725, 227726, 178578, 252308, 293274, 317852, 121245, 285090, 375207, 342450, 293303, 276920, 276925, 293310, 416197, 129483, 342476, 317901, 326100, 285150, 227809, 358882, 342498, 334309, 227813, 391655, 195045, 432618, 375276, 301571, 276998, 342536, 186893, 342553, 416286, 375333, 293419, 244269, 375343, 236081, 23092, 375351, 277048, 244281, 301638, 309830, 293448, 55881, 416341, 309846, 244310, 416351, 268899, 277094, 39530, 277101, 277111, 301689, 244347, 277133, 326287, 375440, 334481, 227990, 318106, 318107, 342682, 285353, 285361, 318130, 383667, 293556, 342706, 342713, 285371, 285373, 39614, 334547, 203477, 318173, 375526, 285415, 342762, 342763, 293612, 129773, 277227, 154359, 228088, 432893, 162561, 285444, 383754, 285458, 310036, 285466, 326429, 293664, 326433, 400166, 293672, 318250, 318252, 375609, 293693, 162621, 162626, 277316, 252741, 277325, 293711, 244568, 244570, 301918, 293730, 351077, 342887, 277366, 228215, 277370, 269178, 400252, 359298, 359299, 260996, 277381, 113542, 228233, 392074, 228234, 56208, 318364, 310176, 310178, 293800, 236461, 326581, 326587, 326601, 359381, 433115, 343005, 130016, 64485, 277479, 326635, 187374, 383983, 277492, 318461, 293886, 293893, 277509, 277510, 433165, 384016, 146448, 277523, 433174, 252958, 310317, 252980, 203830, 359478, 302139, 277563, 359495, 277597, 113760, 392290, 253029, 285798, 228458, 15471, 351344, 187506, 285814, 285820, 392318, 187521, 384131, 285828, 302213, 253063, 302216, 228491, 228493, 285838, 162961, 326804, 187544, 351390, 302240, 343203, 253099, 253100, 318639, 367799, 113850, 294074, 64700, 277690, 302274, 367810, 343234, 244940, 228563, 195808, 310497, 195811, 228588, 253167, 302325, 204022, 228600, 228609, 261377, 245019, 253216, 277792, 130338, 130343, 277800, 113966, 261425, 351537, 286013, 286018, 113987, 15686, 146762, 294218, 294219, 318805, 425304, 294243, 163175, 327024, 327025, 327031, 318848, 179587, 253317, 384393, 368011, 318864, 318868, 318875, 310692, 245161, 286129, 286132, 228795, 425405, 302529, 302531, 163268, 163269, 425418, 302540, 310732, 64975, 327121, 228827, 286172, 310757, 187878, 343542, 343543, 286202, 359930, 228861, 302590, 286205, 228867, 253451, 253452, 359950, 65041, 146964, 253463, 204313, 286244, 245287, 245292, 278060, 286254, 196164, 56902, 286288, 179801, 196187, 147036, 343647, 286306, 310889, 204397, 138863, 188016, 188031, 294529, 229001, 310923, 188048, 425626, 229020, 302754, 245412, 229029, 40614, 40613, 40615, 278191, 286388, 384695, 319162, 327358, 286399, 212685, 302797, 384720, 212688, 302802, 245457, 286423, 278233, 278234, 294622, 278240, 229088, 212716, 212717, 360177, 229113, 286459, 278272, 319233, 311042, 360195, 278291, 294678, 278299, 286494, 294700, 409394, 319292, 360252, 360264, 188251, 376669, 245599, 237408, 425825, 302946, 425833, 417654, 188292, 253829, 40853, 294807, 376732, 294814, 311199, 319392, 294823, 327596, 294843, 188348, 237504, 294850, 384964, 163781, 344013, 212942, 212946, 24532, 294886, 253929, 327661, 311281, 311282 ]
8e816dcfea29600c7f1c4cf53070cf19529915e1
922c3945920b01db50e35088e86adc22cb546e86
/AdventOfCode2020/Day_14/Day_14.swift
15d91010616be3e3ed89b1a8a411647de8f276da
[]
no_license
hassfers/AdventOfCode2020
287ddd4818035376f1810416a7efd2ce55307558
ee9f5e236f6afe0a8947b7350e64ccc6bb38cdab
refs/heads/master
2023-01-24T06:16:46.938463
2020-12-09T14:08:01
2020-12-09T14:08:01
317,475,358
3
1
null
null
null
null
UTF-8
Swift
false
false
297
swift
// https://adventofcode.com/2020/day/14 enum Day_14:Day { static var day: Input.Day = .Day_14 static func solvePart1(input: [String]) -> String { return "add some code here" } static func solvePart2(input: [String]) -> String { return "add some code here" } }
[ 208711 ]
69a9699d613e6f409e74031a7bb42c9299afe2a2
dcb07b524e81ad26161535f98c510d5d9513642c
/ClassRoom/StudentsData/Profile.swift
d5b27a91dd5cb6422ac5872246d3213637943a44
[]
no_license
IProvorov/-walletProject
249b2a81ef30b81cb6a3bd7b581ebf1d4805dd59
2aeae7abcb306106f0a5ee6f4b5d26b46b381fca
refs/heads/master
2021-05-19T07:43:05.581056
2020-03-31T12:06:14
2020-03-31T12:06:14
251,590,478
0
0
null
null
null
null
UTF-8
Swift
false
false
264
swift
// // Profile.swift // ClassRoom // // Created by Igor Provorov on 2/18/20. // Copyright © 2020 Vadim Zhuk. All rights reserved. // import Foundation struct Profile { var name: String var surname: String var age: String var gender: String }
[ -1 ]
800f4377ad0ff8c822a66bce0ff704582341a75b
488f3d9377e36021cebdfe25faf20f25a33c6834
/HotelCrete/Helpers/Contstants/StyleGuideManager.swift
21ea44096a985e6945e57a765d9f76d28e4b2e45
[]
no_license
CodeExpert135/Hotel-Crete
ca46af36d402d95692d1a4dc7d55497e31d63d0a
1c2042864066abe736cc954cda288a8b868d95aa
refs/heads/master
2022-11-10T12:24:01.189615
2020-06-20T06:18:47
2020-06-20T06:18:47
273,650,494
0
0
null
null
null
null
UTF-8
Swift
false
false
762
swift
// // StyleGuideManager.swift // InstaChain // // Created by John Nik on 2/1/18. // Copyright © 2018 johnik703. All rights reserved. // import UIKit public class StyleGuideManager { //default static let defaultBackgroundColor = UIColor(r: 63, g: 197, b: 206) static let mainGreenBackgroundColor = UIColor(r: 179, g: 226, b: 25) static let mainLightBlueBackgroundColor = UIColor(r: 0, g: 165, b: 235) static let townsTableViewBackgroundColor = UIColor(r: 217, g: 217, b: 217) static let loginPageBackgroundColor = UIColor(r: 243, g: 243, b: 243) static let messageTextViewBackgroundLightColor = UIColor(r: 240, g: 241, b: 243) static let generalBackgroundColorForTextView = UIColor(r: 245, g: 245, b: 245) }
[ -1 ]
9d5ff9b2c135ad45a9fde34a721a1832acc9bea8
db5779597eda3df815a37fd2552ee87e57525c58
/Week2/QuizUp/QuizUpTests/QuizUpTests.swift
c897a5a9aceb390a039b27f12af9187d3c095f2c
[]
no_license
darigas/MADSwift_2019
987d0befafbd51608cc7bcc81667aefe1bc396e6
822a998f2e5fe22e06a6d07282e8f975f71b6dcc
refs/heads/master
2022-01-11T10:51:45.545296
2019-05-31T08:05:46
2019-05-31T08:05:46
170,162,402
0
0
null
null
null
null
UTF-8
Swift
false
false
908
swift
// // QuizUpTests.swift // QuizUpTests // // Created by Dariga Akhmetova on 2/17/19. // Copyright © 2019 Dariga Akhmetova. All rights reserved. // import XCTest @testable import QuizUp class QuizUpTests: XCTestCase { override func setUp() { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 357379, 342536, 329225, 348682, 253451, 253452, 354316, 359950, 320527, 323089, 330772, 398869, 293910, 418837, 254488, 201755, 317467, 241692, 322078, 252958, 349726, 207393, 187938, 16419, 375333, 245287, 315432, 315434, 325674, 345132, 377386, 347694, 176175, 197167, 243759, 321583, 241716, 319542, 359478, 124984, 241720, 324666, 324667, 348732, 352315, 325694, 352829, 425535, 349763, 361543, 333393, 341073, 44635, 354911, 254048, 356447, 436832, 314467, 323172, 242277, 253029, 319591, 329829, 374372, 313971, 333940, 333430, 247416, 363641, 175741, 325245, 150657, 333955, 224901, 349318, 344715, 325776, 323729, 317587, 346772, 316053, 352917, 345752, 363163, 339100, 255649, 344738, 343203, 253099, 333996, 321199, 364207, 224946, 224958, 323264, 343234, 259268, 333509, 319177, 346314, 353481, 353482, 363211, 241361, 242386, 333011, 241365, 181975, 148696, 357595, 194782, 359647, 325346, 338662, 222440, 345833, 321772, 328940, 294638, 385262, 360177, 418546, 356602, 344827, 319233, 320770, 191235, 194820, 323331, 264968, 242954, 328971, 322316, 125199, 322319, 251153, 323346, 321302, 334103, 325912, 315673, 349462, 245019, 320796, 126237, 237856, 125217, 255776, 341796, 109861, 247590, 151847, 369956, 333610, 338218, 130348, 116026, 259899, 355130, 342847, 216386, 355139, 252741, 339783, 355146, 323916, 319821, 348492, 337745, 355154, 241495, 362327, 215385, 272729, 322395, 316765, 355165, 106847, 351077, 242023, 342887, 326505, 355178, 242541, 160110, 312689, 314739, 314741, 246648, 361337, 139640, 246137, 106874, 269178, 317304, 124798, 55167, 313727, 314751, 248194, 325503, 359299, 327557, 362881, 332167, 388487, 242058, 316298, 325515, 349067, 426895, 355217, 9619, 39324, 118685, 314783, 253856, 354212, 256935, 353195, 140204, 252847, 311727, 188348, 336317, 330689, 342466, 254406, 321480, 317901, 6606, 212942, 334290, 330708, 210390, 210391, 210392, 212951, 242139, 248796, 248797, 256477, 360417, 64485, 195045, 245223, 52200, 123881, 313319, 337895, 361963, 54765, 319981, 383982, 362480, 321009, 251378, 319987, 349175, 254456, 333817 ]
fbf263fa9b024006bc1a523393bea338a44d0282
f1c0b9cbb97266aab5446f34110fac2a5b6f60d1
/day10/MyFirebase/MyFirebase/AppDelegate.swift
ff9dd5c4d93253833953b3559d8030719c9f8fc7
[]
no_license
bom2zzang/swift_basic
6095cdb1e8aa2633ddd84d50adf87e1bb5b40c16
19c7714db9efc6dd82daa6db044a3a91180ba7a4
refs/heads/master
2020-08-06T09:57:52.048201
2019-11-03T07:19:58
2019-11-03T07:19:58
212,934,732
1
0
null
null
null
null
UTF-8
Swift
false
false
767
swift
import UIKit import Firebase @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { FirebaseApp.configure() return true } func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { } }
[ 369281, 338690, 375047, 33290, 370442, 256015, 223257, 253852, 333471, 177953, 48680, 389290, 187060, 264501, 389436, 159039, 321728, 153409, 235074, 257090, 360388, 243277, 180309, 126552, 396251, 438757, 345959, 391656, 214633, 375017, 142188, 382828, 383724, 263923, 360564, 345463, 198266, 266747, 169597 ]
d96f568dd685b24f1fc5d4a0cca5a1b2c41e0cdb
9ece3052d33e79459b2402d79815f4b7ec580c33
/DictionaryIteration/DictionaryIteration.swift
e1bf851a4bb6d3504f5d4eb96bbed0150372c3b7
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
alexislexi/swift-dictIteration-lab-swift-intro-000
afa772b699c7b4314cb2afc0d2d45445fd6f73c1
ea28d31855ebdaa6649dcd9d879efb9d91a613f0
refs/heads/master
2020-12-31T05:25:21.036240
2017-03-29T03:09:35
2017-03-29T03:09:35
86,519,077
0
0
null
2017-03-28T23:59:31
2017-03-28T23:59:30
null
UTF-8
Swift
false
false
1,805
swift
// // DictionaryIteration.swift // DictionaryIteration // // Created by Jim Campagno on 12/28/16. // Copyright © 2016 Jim Campagno. All rights reserved. // import Foundation class DictionaryIteration { var bands = ["Nirvana" : "Nevermind", "Blondie" : "Parallel Lines", "The Kinks" : "Low Budget", "The Beatles" : "Sgt. Pepper's Lonely Hearts Club Band"] func addPixie() { bands["Pixie"] = "Doolittle" } func removeKinks() { bands.removeValue(forKey: "The Kinks") } // Question #4 func nirvanaBestSeller() -> String { let bandName = "Nirvana" if let bandAlbum = bands[bandName] { return "\(bandName)'s top-selling album was \(bandAlbum)." } else{ return "error" } } // Question #5 func bestSellers() -> String{ var sentence = "" for (bandName, bandAlbum) in bands{ sentence += "\(bandName)'s top-selling album was \(bandAlbum)." } return sentence } // Question #6 func typeOfDataStructure() -> String{ return "Tuple" } // Question #7 func typeOfDataStructureForSchool() -> String{ return "B" } // Question #8 func highestGrade(_ grades: [Int:String]) -> Int{ var max = 0 var highestScore = "F" for (grade, score) in grades{ if score < highestScore { highestScore = score max = grade } } return max } }
[ -1 ]
7799a585ccba910086e62693d3fc25be7c0f0b60
68b9bbd7a6a41f7add604296dcbe27135320c243
/SuperHeroList/Domain/Entries/Series/SeriesResponse.swift
56ee195330ef7c8e89424e107b0e3f79d0c5e82f
[]
no_license
TiagoPereiraDev/super-hero-list
9e8f6c162ddb816a99bf928527ea833d2938d9d2
68e9c4f9ec2747f448b6179fea319789656996d7
refs/heads/master
2022-12-22T09:35:05.551022
2020-10-04T20:22:20
2020-10-04T20:22:20
299,400,162
0
0
null
null
null
null
UTF-8
Swift
false
false
327
swift
// // SerieResponse.swift // Domain // // Created by Tiago Pereira on 02/10/2020. // Copyright © 2020 Tiago Pereira. All rights reserved. // import Foundation public struct SeriesResponseData: Codable { public let results: [Serie] } public struct SeriesResponse: Codable { public let data: SeriesResponseData }
[ -1 ]
a3b74fb0169c7084eb9c8f4b4de68032823db6d1
95c76b2637bb65c60cc8bf1bd4ed941955afbe5a
/GroupApp/MainViewController.swift
c47f82b4b796c88d667649b48e8f4c2759d3b4f4
[ "Apache-2.0" ]
permissive
495TacoTuesday/taco-tuesday
73183f4ad39bc5793f57ad1b51134c19da05c54b
270e12b43a206b90953385ab414644a010bc6f97
refs/heads/master
2021-04-27T21:37:01.823373
2018-05-01T01:24:38
2018-05-01T01:24:38
122,403,885
2
0
null
2018-04-30T23:28:59
2018-02-21T22:50:50
Swift
UTF-8
Swift
false
false
876
swift
// // MainViewController.swift // GroupApp // // Created by Joe Antongiovanni on 3/14/18. // Copyright © 2018 Joe Antongiovanni. All rights reserved. // import UIKit class MainViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ 279041, 279046, 287243, 281107, 300057, 295460, 296489, 286249, 281142, 286775, 300089, 238653, 286786, 129604, 228932, 293961, 228945, 203858, 280146, 212561, 237655, 212573, 309347, 309349, 309351, 309353, 286314, 296042, 277612, 311913, 164974, 284275, 277108, 284277, 284279, 292478, 284289, 280710, 284298, 278675, 349332, 284315, 280219, 284317, 299165, 282275, 284323, 225955, 326311, 313007, 284336, 302256, 276150, 280760, 299709, 296638, 283839, 277696, 280770, 280772, 280775, 284361, 230604, 298189, 302286, 230608, 317137, 307410, 290004, 284373, 290006, 189655, 302295, 298202, 278749, 280797, 298206, 363743, 278752, 290020, 301284, 291556, 277224, 280808, 199402, 280810, 289524, 120054, 226038, 280826, 276736, 280832, 230147, 312586, 278298, 329499, 287004, 281373, 369434, 315170, 281380, 304933, 233767, 283433, 289578, 278845, 279360, 288579, 293700, 296272, 289112, 298842, 241499, 298843, 188253, 292701, 311645, 227688, 296813, 276849, 315250, 277364, 207738, 290175, 275842, 224643, 183173, 313733, 233869, 304015, 306577, 279442, 306578, 226196, 284570, 284574, 275358, 284577, 289187, 288165, 289190, 289191, 305577, 291755, 289196, 370093, 279982, 286126, 297903, 305582, 282548, 289204, 293816, 298936, 127418, 293308, 278973, 291774, 299973, 286158, 280015, 301012, 301016, 280028, 280029, 280030, 279011, 294889, 289771, 282095, 277487, 308721, 227315, 302580, 296436, 236022, 288251, 287231 ]
8b0bedfb3e0f0b9f4caeddd744959f2a6f67e312
ad59908fccd80f07ad703fd92cc058b564a3e8d1
/SliderMenu/Views/ChatroomMenuCell.swift
44d0d4085382a37f0368291da0a397d9e129a837
[]
no_license
ChangVictor/SliderMenu
c45ffe13561a014fc6235aa78f51ac7265d8c286
00d12dcf95e1b3a4b3addda3c6414fb7ab85d685
refs/heads/master
2020-04-06T20:06:47.972922
2018-11-20T20:51:40
2018-11-20T20:51:40
157,761,375
0
0
null
null
null
null
UTF-8
Swift
false
false
1,179
swift
// // ChatroomMenuCell.swift // SliderMenu // // Created by Victor Chang on 19/11/2018. // Copyright © 2018 Victor Chang. All rights reserved. // import UIKit class ChatroomMenuCell: UITableViewCell { let backgrounView: UIView = { let view = UIView() view.backgroundColor = #colorLiteral(red: 0.2941176471, green: 0.6, blue: 0.5411764706, alpha: 1) view.layer.cornerRadius = 5 return view }() override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) selectionStyle = .none addSubview(backgrounView) backgrounView.fillSuperview(padding: .init(top: 0, left: 8, bottom: 0, right: 8)) sendSubviewToBack(backgrounView) } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) backgrounView.isHidden = !selected // backgroundColor = selected ? .orange : .clear } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } }
[ -1 ]
188b6c06cef308031597e78991cd3f2dbfd8ae51
1d945ad51f0f0b2b55f8ae6a5fa8d4af801e02ac
/音频视频/音频视频/Tool/OSS/OSSClientMgr.swift
ad9266909aee3ea5bd2177794ddf3e5de511aaff
[]
no_license
huafeng1992/audio_video
fe2debccd1875113ecdb848c457425f96cb84699
9f7122bcc8566eb34cf03ea60b6a16a4bfde562b
refs/heads/master
2020-03-18T19:17:46.946732
2018-06-08T16:33:46
2018-06-08T16:33:46
135,145,963
0
0
null
null
null
null
UTF-8
Swift
false
false
1,368
swift
// // OSSClientMgr.swift // 音频视频 // // Created by 华峰 on 2018/6/6. // Copyright © 2018年 hf. All rights reserved. // import Foundation import AliyunOSSiOS //RoleArn: acs:ram::1626597922695968:role/aliyunosstokengeneratorrole //AccessKeyID:LTAI6t9KJ0Hp7rES //AccessKeySecret:mlypYKR8z0hUgAlLwmppzQ2YKgNVUH //let OSS_STSTOKEN_URL: String = "http://192.168.1.72:7080" let OSS_STSTOKEN_URL: String = "https://apiaixiaofz.xiaohe.com/ali_index.php" let ENDPOINT = "oss-cn-beijing.aliyuncs.com" let BUCKET_NAME = "xiaohe-online" let OBJECTKEY_FIX = "offline" class OSSClientMgr { // 已更改信息 class func client() -> OSSClient { //直接访问鉴权服务器(推荐,token过期后可以自动更新) let credential = OSSAuthCredentialProvider.init(authServerUrl: OSS_STSTOKEN_URL) // 开启日志记录 // OSSLog.enable() let config = OSSClientConfiguration() config.maxRetryCount = 0 // 网络请求遇到异常失败后的重试次数 config.timeoutIntervalForRequest = 30 // 网络请求的超时时间 config.timeoutIntervalForResource = 24*60*60 // 允许资源传输的最长时间 let client = OSSClient.init(endpoint: ENDPOINT, credentialProvider: credential, clientConfiguration: config) return client } }
[ -1 ]
9b0ae03aea0d32f2bada210536cde8b62cca5675
cd23b10c0dcb3964db481d62dfc452b98a2698c5
/kewt/ViewController.swift
47dd0fa6e1003283c441d12586abedd85d7d4c2b
[]
no_license
armul/kewt
caad000582bf37b6d6107f72f899aa143f5f13d8
698c509ceb219a8b3e2e80c83e67057fc595270c
refs/heads/master
2020-03-20T16:59:47.894429
2018-06-16T03:33:45
2018-06-16T03:33:45
137,550,277
0
0
null
null
null
null
UTF-8
Swift
false
false
451
swift
// // ViewController.swift // kewt // // Created by Arif Mulya on 16/06/18. // Copyright © 2018 Arif Mulya. All rights reserved. // import Cocoa class ViewController: NSViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override var representedObject: Any? { didSet { // Update the view, if already loaded. } } }
[ 40609, 402567, 273351, 293226, 99020, 329711, 349589, 228793, 180730, 138494, 157759 ]
589918b61a150a8f49446e5a9aac3981c10a42ee
9de1a3f147b9b50ffc30a614883d561577cfb110
/Clima/WeatherViewController.swift
f8395a8ba040f260057d1f094aee588553a2ebb8
[]
no_license
Hzza3/Clima
df19b91d890ea38952233dbbab89ec5fb60e5339
7b74fdc0d495e3e1ad652fd52ada7bca05cd64bb
refs/heads/master
2021-04-15T17:18:45.263768
2018-03-21T08:45:30
2018-03-21T08:45:30
126,149,071
0
0
null
null
null
null
UTF-8
Swift
false
false
4,950
swift
// // ViewController.swift // WeatherApp // // Created by Angela Yu on 23/08/2015. // Copyright (c) 2015 London App Brewery. All rights reserved. // import UIKit import CoreLocation import Alamofire import SwiftyJSON class WeatherViewController: UIViewController, CLLocationManagerDelegate, ChangeCityDelegate { //Constants let WEATHER_URL = "http://api.openweathermap.org/data/2.5/weather" let APP_ID = "5dbf96f3507e165b93a680bd7b899619" //TODO: Declare instance variables here let locationManager = CLLocationManager() let weatherDataModel = WeatherDataModel() //Pre-linked IBOutlets @IBOutlet weak var weatherIcon: UIImageView! @IBOutlet weak var cityLabel: UILabel! @IBOutlet weak var temperatureLabel: UILabel! override func viewDidLoad() { super.viewDidLoad() //TODO:Set up the location manager here. locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters locationManager.requestWhenInUseAuthorization() locationManager.startUpdatingLocation() } //MARK: - Networking /***************************************************************/ //Write the getWeatherData method here: func getWeatherData(url: String, parameters: [String : String] ){ Alamofire.request(url ,method: .get, parameters: parameters).responseJSON { response in if response.result.isSuccess { print("Success , got the weather data") let weatherJSON : JSON = JSON(response.result.value) //print(weatherJSON) self.updateWeatherData(json: weatherJSON) } else{ print("Error \(response.result.error)") self.cityLabel.text = "Connection Error" } } } //MARK: - JSON Parsing /***************************************************************/ //Write the updateWeatherData method here: func updateWeatherData(json: JSON){ if let tempResult = json["main"]["temp"].double { weatherDataModel.temperature = Int(tempResult - 273.15) weatherDataModel.city = json["name"].stringValue weatherDataModel.conditions = json["weather"][0]["id"].intValue weatherDataModel.weatherIconName = weatherDataModel.updateWeatherIcon(condition: weatherDataModel.conditions) updateUIWithWeatherData() } else{ cityLabel.text = "Weather Unavailable" } } //MARK: - UI Updates /***************************************************************/ //Write the updateUIWithWeatherData method here: func updateUIWithWeatherData(){ cityLabel.text = weatherDataModel.city temperatureLabel.text = "\(weatherDataModel.temperature)°" weatherIcon.image = UIImage(named : weatherDataModel.weatherIconName) } //MARK: - Location Manager Delegate Methods /***************************************************************/ //Write the didUpdateLocations method here: func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { let location = locations[locations.count - 1] if location.horizontalAccuracy > 0 { locationManager.stopUpdatingLocation() locationManager.delegate = nil print("longutude : \(location.coordinate.longitude) , latitude : \(location.coordinate.latitude)") let longitude = String(location.coordinate.longitude) let latitude = String(location.coordinate.latitude) let params : [ String : String] = ["lat" : latitude, "lon" : longitude, "appid" : APP_ID] getWeatherData(url: WEATHER_URL, parameters: params) } } //Write the didFailWithError method here: func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) { print(error) cityLabel.text = "Location unavailable" } //MARK: - Change City Delegate methods /***************************************************************/ //Write the userEnteredANewCityName Delegate method here: func userInteredNewCityName(city: String) { let params : [String : String] = ["q" : city, "appid" : APP_ID] getWeatherData(url: WEATHER_URL, parameters: params) } //Write the PrepareForSegue Method here override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "changeCityName"{ let segueDestination = segue.destination as! ChangeCityViewController segueDestination.delegate = self } } }
[ -1 ]
f64338fa77486d11a173ea04ecd1c2bc3b2a3a8d
746c0cbd4354226957d7a998048d821f0b8050b6
/Sources/Core/Activity/Client+Activity.swift
3776092b18e4396ea3e8a60230975dc6deb859b3
[ "BSD-3-Clause" ]
permissive
BikersDelight/stream-swift
b908632642cd1298d883e93e61b8e9020f472985
6d889777293ac24c001ac81fd343a9c1c8afc76d
refs/heads/master
2020-06-23T00:40:58.872970
2019-07-16T12:39:50
2019-07-16T12:39:50
198,448,111
0
0
null
2019-07-23T14:32:41
2019-07-23T14:32:40
null
UTF-8
Swift
false
false
6,603
swift
// // Client+Activity.swift // GetStream // // Created by Alexey Bukhtin on 16/11/2018. // Copyright © 2018 Stream.io Inc. All rights reserved. // import Foundation import Result /// An activity completion block. public typealias ActivityCompletion<T: Decodable> = (_ result: Result<T, ClientError>) -> Void /// An activities completion block. public typealias ActivitiesCompletion<T: Decodable> = (_ result: Result<Response<T>, ClientError>) -> Void // MARK: - Client Activities extension Client { /// Receive activities by activity ids with a custom activity type. /// /// - Note: A maximum length of list of activityIds is 100. @discardableResult public func get<T: ActivityProtocol>(enrich: Bool = true, typeOf type: T.Type, activityIds: [String], completion: @escaping ActivitiesCompletion<T>) -> Cancellable { return request(endpoint: ActivityEndpoint<T>.getByIds(enrich, activityIds)) { [weak self] result in if let self = self { result.parse(self.callbackQueue, completion) } } } /// Receive activities by pairs of `foreignId` and `time` with a custom activity type. /// /// - Note: A maximum length of list of foreignIds and times is 100. @discardableResult public func get<T: ActivityProtocol>(enrich: Bool = true, typeOf type: T.Type, foreignIds: [String], times: [Date], completion: @escaping ActivitiesCompletion<T>) -> Cancellable { return request(endpoint: ActivityEndpoint<T>.get(enrich, foreignIds: foreignIds, times: times)) { [weak self] result in if let self = self { result.parse(self.callbackQueue, completion) } } } /// Update activities data. /// /// - Note: When you update an activity, you must include the following fields both when adding and updating the activity: /// - time /// - foreignId /// - Note: It is not possible to update more than 100 activities per request with this method. /// - Note: When updating an activity any changes to the `feedIds` property are ignored. @discardableResult public func update<T: ActivityProtocol>(activities: [T], completion: @escaping StatusCodeCompletion) -> Cancellable { return request(endpoint: ActivityEndpoint<T>.update(activities)) { [weak self] result in if let self = self { result.parseStatusCode(self.callbackQueue, completion) } } } /// Update an activity fields by `activityId`. /// It is possible to update only a part of an activity with the partial update request. /// You can think of it as a quick "patching operation". /// /// - Note: Note: it is not possible to include the following reserved fields in a partial update request (set or unset): /// - id /// - actor /// - verb /// - object /// - time /// - target /// - foreign_id /// - to /// - origin /// - Note: Note: the size of an activity's payload must be less than 10KB after all set and unset operations are applied. /// The size is based on the size of the JSON-encoded activity. @discardableResult public func updateActivity<T: ActivityProtocol>(typeOf type: T.Type, setProperties properties: Properties? = nil, unsetPropertiesNames names: [String]? = nil, activityId: String, completion: @escaping ActivityCompletion<T>) -> Cancellable { return request(endpoint: ActivityEndpoint<T>.updateActivityById(setProperties: properties, unsetPropertiesNames: names, activityId: activityId)) { [weak self] result in if let self = self { result.parse(self.callbackQueue, completion) } } } /// Update an activity fields by `foreignId` and `time`. /// It is possible to update only a part of an activity with the partial update request. /// You can think of it as a quick "patching operation". /// /// - Note: Note: it is not possible to include the following reserved fields in a partial update request (set or unset): /// - id /// - actor /// - verb /// - object /// - time /// - target /// - foreign_id /// - to /// - origin /// - Note: Note: the size of an activity's payload must be less than 10KB after all set and unset operations are applied. /// The size is based on the size of the JSON-encoded activity. @discardableResult public func updateActivity<T: ActivityProtocol>(typeOf type: T.Type, setProperties properties: Properties? = nil, unsetPropertiesNames names: [String]? = nil, foreignId: String, time: Date, completion: @escaping ActivityCompletion<T>) -> Cancellable { return request(endpoint: ActivityEndpoint<T>.updateActivity(setProperties: properties, unsetPropertiesNames: names, foreignId: foreignId, time: time)) { [weak self] result in if let self = self { result.parse(self.callbackQueue, completion) } } } }
[ -1 ]
641e7f8d7ec10554810ba8c3c3f42f4b990803d9
7cd0bb7cc9a1d78c512eddfe0f17e2e5e729a199
/VISPER-UIViewController/Classes/swift/DefaultControllerContainer.swift
ac378848348da38afc34f15d4f575a0987d20aa0
[ "MIT" ]
permissive
undeaDD/VISPER
a43023db15c80d2f9d352c6fc4b5ae86dd24f446
c79be07cc5f4f13ec1ab872a1455831cd011a265
refs/heads/master
2020-03-29T19:32:33.388841
2018-10-01T09:03:19
2018-10-01T09:03:19
150,268,327
0
0
MIT
2018-10-01T09:01:21
2018-09-25T13:18:21
Swift
UTF-8
Swift
false
false
1,656
swift
// // DefaultViewControllerContainer.swift // VISPER-UIViewController // // Created by bartel on 15.12.17. // import Foundation import UIKit import VISPER_Core open class DefaultControllerContainer: ControllerContainer { var controllers = [ControllerWrapper]() public init(){ } open func add(controller: UIViewController) { self.clean() let wrapper = ControllerWrapper(controller: controller) self.controllers.append(wrapper) } open func remove(controller: UIViewController) { var indexes = [Int]() for (i,wrapper) in self.controllers.enumerated() { if wrapper.controller == nil || wrapper.controller == controller { indexes.append(i) } } for index in indexes.reversed() { self.controllers.remove(at: index) } } public func getController(matches: (UIViewController?) -> Bool) -> UIViewController? { self.clean() for wrapper in self.controllers.reversed() { if matches(wrapper.controller) { return wrapper.controller } } return nil } func clean() { var indexes = [Int]() for (i,wrapper) in self.controllers.enumerated() { if wrapper.controller == nil { indexes.append(i) } } for index in indexes.reversed() { self.controllers.remove(at: index) } } struct ControllerWrapper { weak var controller: UIViewController? } }
[ -1 ]
e0667b8ac06733f99ac27d6f8a454d7d77fc0461
b499ac64f6836196cd74b73f95ba98615b06bee1
/testGyro/AppDelegate.swift
5b3181515ee591b449e044d595d16d54772e57ae
[]
no_license
Gia5Antonio/AccGyroDeg
f423bf9c5db7e7486acd0b14f38b306ae7921f53
9ded8748413eb7dcb934648af43c267c747fcb56
refs/heads/master
2020-03-16T22:43:09.710677
2018-05-11T14:24:35
2018-05-11T14:24:35
133,049,836
0
0
null
null
null
null
UTF-8
Swift
false
false
4,492
swift
// // AppDelegate.swift // testGyro // // Created by Antonio Giaquinto on 18/04/2018. // Copyright © 2018 Antonio Giaquinto. All rights reserved. // import UIKit import CoreData @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:. } // MARK: - Core Data stack lazy var persistentContainer: NSPersistentContainer = { /* The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. */ let container = NSPersistentContainer(name: "AppToYou") container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. /* Typical reasons for an error here include: * The parent directory does not exist, cannot be created, or disallows writing. * The persistent store is not accessible, due to permissions or data protection when the device is locked. * The device is out of space. * The store could not be migrated to the current model version. Check the error message to determine what the actual problem was. */ fatalError("Unresolved error \(error), \(error.userInfo)") } }) return container }() // MARK: - Core Data Saving support func saveContext () { let context = persistentContainer.viewContext if context.hasChanges { do { try context.save() } catch { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. let nserror = error as NSError fatalError("Unresolved error \(nserror), \(nserror.userInfo)") } } } }
[ 294405, 243717, 163848, 313353, 320008, 320014, 313360, 288275, 322580, 289300, 290326, 329747, 139803, 322080, 306721, 296483, 322083, 229411, 306726, 309287, 308266, 292907, 217132, 322092, 40495, 316465, 288306, 322102, 324663, 164408, 308281, 322109, 286783, 315457, 313409, 313413, 320582, 349765, 309832, 288329, 242250, 215117, 196177, 241746, 344661, 231000, 212571, 287323, 300124, 309342, 325220, 306790, 310378, 296043, 311914, 322666, 334446, 307310, 292466, 314995, 307315, 314487, 291450, 314491, 288383, 318599, 312970, 239252, 311444, 294038, 311449, 323739, 300194, 298662, 233638, 233644, 286896, 295600, 300208, 286389, 294070, 125111, 309439, 235200, 284352, 296641, 242371, 302787, 284360, 321228, 319181, 298709, 284374, 189654, 182486, 320730, 241371, 311516, 357083, 179420, 317665, 298210, 311525, 288489, 290025, 229098, 307436, 304365, 323310, 125167, 286455, 306424, 322299, 319228, 302332, 319231, 184576, 309505, 241410, 311043, 366339, 309509, 318728, 125194, 234763, 321806, 125201, 296218, 313116, 237858, 326434, 295716, 313125, 300836, 289577, 125226, 133421, 317233, 241971, 316726, 318264, 201530, 313660, 159549, 287038, 292159, 218943, 288578, 301893, 234828, 292172, 300882, 321364, 243032, 201051, 230748, 258397, 294238, 298844, 291169, 199020, 293741, 266606, 319342, 292212, 313205, 244598, 316788, 124796, 196988, 305022, 317821, 243072, 314241, 313215, 303999, 242050, 325509, 293767, 316300, 306576, 322448, 308114, 319900, 298910, 313250, 308132, 316327, 306605, 316334, 324015, 324017, 200625, 300979, 316339, 322998, 67000, 316345, 296888, 300987, 319932, 310718, 292288, 317888, 323520, 312772, 298950, 306632, 310733, 289744, 298960, 310740, 235994, 286174, 315359, 240098, 323555, 236008, 319465, 248299, 311789, 326640, 188913, 203761, 320498, 314357, 288246, 309243, 300540, 310782 ]
600065c5dcc4ed1c3830bf5c4418d3de877c5aee
81a4ce136865b1a99f83cca00cf3997d1c595a0d
/SwiftUI-MVVM-C/SwiftUI-MVVM-C/ContentView.swift
270ba8dc3cfa94f64e11224c0905068bc69ceb48
[ "MIT" ]
permissive
RockingTriangle/SwiftUI-MVVM-C
4336ede423ae6e491dd8c72cdea4f58ba0b97e7b
205f6ca4f1a8d30dbfa2c15ad03b3a9492161d35
refs/heads/main
2023-05-11T23:12:33.011334
2021-05-20T05:33:42
2021-05-20T05:33:42
null
0
0
null
null
null
null
UTF-8
Swift
false
false
243
swift
// // ContentView.swift // SwiftUI-MVVM-C // // Created by Nguyen Cong Huy on 5/17/21. // import SwiftUI struct ContentView: View { var body: some View { NavigationView { RepoListCoordinator() } } }
[ -1 ]
a8580a099f5baa674676e6e86d9346db2a6f57db
60b1999b893f480d809715db78402d73261f1092
/Frontend/Geocap/Server.swift
1bb631a937c9eb7e460eb1125b001555e6037720
[]
no_license
uu-os-2019/Iyokan
a48ef56ec14616fd6f8dc63ecf5c34c00a9dedc5
40f7ec07b7b77c399948ae6684884ccf8343ca9b
refs/heads/master
2020-05-04T15:33:19.229816
2019-05-23T09:55:04
2019-05-23T09:55:04
null
0
0
null
null
null
null
UTF-8
Swift
false
false
15,164
swift
// // Server.swift // Geocap // // Created by Benjamin Angeria on 2019-04-15. // Copyright © 2019 Iyokan. All rights reserved. // import Foundation struct jsonLocations: Codable { let locations: [Location] let type: String } struct Location: Codable { let owner: Owner? let identifier, name, description: String let position: Position let radius: Int } struct Owner: Codable { let id, name: String } struct Position: Codable { let lng, lat: Double } struct Quiz: Codable { let question: String? let success: Bool let reason: String? let alternatives: [String]? let type: String } struct QuizAnswer: Codable { let newAlternatives: [String]? let correct: Bool? let success: Bool let type: String let reason: String? let points: Int? let newQuestion: String? let correctAnswer: String? } struct Register: Codable { let type: String let success: Bool let user: ProfileInfo? let token: String? let reason: String? } struct HighscoreObject: Codable { let index: Int let id: String let name: String let exp_rate: Int let exp: Int? let exp_to_level: Int? let level: Int? } struct Leaderboard: Codable { let type: String let success: Bool let users: [HighscoreObject] } struct LastQuizAnswer: Codable { let correct, success: Bool let type: String let points: Int let reason: String? let newQuestion: String? let correctAnswer: String? let successfulTakeover: Bool } struct MyProfile: Codable { let type: String let locations: [String]? let user: ProfileInfo? } struct ProfileInfo: Codable { let id: String? let name: String? let locations_taken: [String]? let level: Int? let exp: Int? let exp_rate: Int? let exp_to_level: Int? } class Server { var token: String! init() { setToken() } func setToken() { token = UserDefaults.standard.string(forKey: "token") } private func handleClientError(_ error: Error) { print(error.localizedDescription) } private func handleServerError(_ response: URLResponse?) { if let responseURL = response?.url { print("Server error: request to \(responseURL) failed") } else { print("Unknown server error") } } func fetchLocations(completionHandler: @escaping () -> ()) { let url = URL(string: "http://13.53.140.24/location/get-all")! URLSession.shared.dataTask(with: url) {(data, response, error) in do { if let error = error { self.handleClientError(error) return } guard let httpResponse = response as? HTTPURLResponse, (200...299).contains(httpResponse.statusCode) else { self.handleServerError(response) return } if let data = data { let parsedJSON = try JSONDecoder().decode(jsonLocations.self, from: data) geoCap.locations = parsedJSON.locations DispatchQueue.main.async { completionHandler() } } } catch { print("getLocations() failed") print(error) } }.resume() } func getQuiz(for location: String) -> Quiz? { let url = URL(string: "http://13.53.140.24/quiz/start")! var request = URLRequest(url: url) request.addValue(token, forHTTPHeaderField: "Authorization") request.httpMethod = "POST" let location = ["location": location] var quiz: Quiz? do { let json = try JSONSerialization.data(withJSONObject: location, options: []) request.httpBody = json } catch { print("Location couldn't be parsed to JSON in getQuiz()") return nil } // semaphore used for forcing dataTask to finish before returning let semaphore = DispatchSemaphore(value: 0) URLSession.shared.dataTask(with: request) {(data, response, error) in do { if let error = error { self.handleClientError(error) semaphore.signal() return } guard let httpResponse = response as? HTTPURLResponse, (200...299).contains(httpResponse.statusCode) else { self.handleServerError(response) semaphore.signal() return } let decoder = JSONDecoder() decoder.keyDecodingStrategy = .convertFromSnakeCase quiz = try decoder.decode(Quiz.self, from: data!) } catch { print("getQuiz() failed") print(error) } semaphore.signal() }.resume() semaphore.wait() if let quiz = quiz, !quiz.success { print("getQuiz() failed with error: \(quiz.reason!)") return nil } return quiz } func sendQuizAnswer(answer: String) -> QuizAnswer? { let url = URL(string: "http://13.53.140.24/quiz/answer")! var request = URLRequest(url: url) request.addValue(token, forHTTPHeaderField: "Authorization") request.httpMethod = "POST" let answer = ["answer": answer] var quizAnswer: QuizAnswer? do { let json = try JSONSerialization.data(withJSONObject: answer, options: []) request.httpBody = json } catch { print("Answer couldn't be parsed to JSON in sendQuizAnswer()") return nil } let semaphore = DispatchSemaphore(value: 0) URLSession.shared.dataTask(with: request) {(data, response, error) in do { if let error = error { self.handleClientError(error) semaphore.signal() return } guard let httpResponse = response as? HTTPURLResponse, (200...299).contains(httpResponse.statusCode) else { self.handleServerError(response) semaphore.signal() return } let decoder = JSONDecoder() decoder.keyDecodingStrategy = .convertFromSnakeCase quizAnswer = try decoder.decode(QuizAnswer.self, from: data!) } catch { print("Error in sendQuizAnswer()") print(error) } semaphore.signal() }.resume() semaphore.wait() if let quizAnswer = quizAnswer, !quizAnswer.success { print("getQuizAnswer() failed with error: \(quizAnswer.reason!)") return nil } return quizAnswer } func sendLastQuizAnswer(answer: String) -> LastQuizAnswer? { let url = URL(string: "http://13.53.140.24/quiz/answer")! var request = URLRequest(url: url) request.addValue(token, forHTTPHeaderField: "Authorization") request.httpMethod = "POST" let answer = ["answer": answer] var lastQuizAnswer: LastQuizAnswer? do { let json = try JSONSerialization.data(withJSONObject: answer, options: []) request.httpBody = json } catch { print("Answer couldn't be parsed to JSON in sendLastQuizAnswer()") return nil } let semaphore = DispatchSemaphore(value: 0) URLSession.shared.dataTask(with: request) {(data, response, error) in do { if let error = error { self.handleClientError(error) semaphore.signal() return } guard let httpResponse = response as? HTTPURLResponse, (200...299).contains(httpResponse.statusCode) else { self.handleServerError(response) semaphore.signal() return } let decoder = JSONDecoder() decoder.keyDecodingStrategy = .convertFromSnakeCase lastQuizAnswer = try decoder.decode(LastQuizAnswer.self, from: data!) } catch { print("Error in sendLastQuizAnswer()") print(error) } semaphore.signal() }.resume() semaphore.wait() if let lastQuizAnswer = lastQuizAnswer, !lastQuizAnswer.success { print("getLastQuizAnswer() failed with error: \(lastQuizAnswer.reason!)") return nil } return lastQuizAnswer } func register(userName: String) -> String? { let url = URL(string: "http://13.53.140.24/register")! var request = URLRequest(url: url) request.addValue(userName, forHTTPHeaderField: "Authorization") request.httpMethod = "POST" var register: Register? let userName = ["username": userName] let json = try? JSONSerialization.data(withJSONObject: userName, options: []) request.httpBody = json do { let json = try JSONSerialization.data(withJSONObject: userName, options: []) request.httpBody = json } catch { print("Username couldn't be parsed to JSON in register()") return nil } let semaphore = DispatchSemaphore(value: 0) URLSession.shared.dataTask(with: request) {(data, response, error) in do { if let error = error { self.handleClientError(error) semaphore.signal() return } guard let httpResponse = response as? HTTPURLResponse, (200...299).contains(httpResponse.statusCode) else { self.handleServerError(response) semaphore.signal() return } register = try JSONDecoder().decode(Register.self, from: data!) } catch { print("Error in register()") print(error) } semaphore.signal() }.resume() semaphore.wait() guard let registerUnwrapped = register else { return nil } if !registerUnwrapped.success { return registerUnwrapped.reason! } UserDefaults.standard.set(registerUnwrapped.user!.name, forKey: "username") UserDefaults.standard.set(registerUnwrapped.user!.id, forKey: "guid") UserDefaults.standard.set(registerUnwrapped.token, forKey: "token") setToken() return "success" } func fetchProfileInfo(completionHandler: @escaping () -> ()) { let url = URL(string: "http://13.53.140.24/my-profile")! var request = URLRequest(url: url) request.addValue(token, forHTTPHeaderField: "Authorization") request.httpMethod = "POST" var myProfile: MyProfile? URLSession.shared.dataTask(with: request) {(data, response, error) in do { if let error = error { self.handleClientError(error) return } guard let httpResponse = response as? HTTPURLResponse, (200...299).contains(httpResponse.statusCode) else { self.handleServerError(response) return } myProfile = try JSONDecoder().decode(MyProfile.self, from: data!) geoCap.profileInfo = myProfile?.user DispatchQueue.main.async { completionHandler() } } catch { print("Error in getProfileInfo()") print(error) } }.resume() /* if let profileInfo = profileInfo, let _ = profileInfo.success, !profileInfo.success! { print("getProfileInfo() failed with error: \(profileInfo.reason!)") } */ } func getLeaderboardCurrent() -> Leaderboard? { let url = URL(string: "http://13.53.140.24/leaderboard/current")! var leaderboard: Leaderboard? let semaphore = DispatchSemaphore(value: 0) URLSession.shared.dataTask(with: url) {(data, response, error) in do { if let error = error { self.handleClientError(error) semaphore.signal() return } guard let httpResponse = response as? HTTPURLResponse, (200...299).contains(httpResponse.statusCode) else { self.handleServerError(response) semaphore.signal() return } leaderboard = try JSONDecoder().decode(Leaderboard.self, from: data!) } catch { print("Error in getLeaderboardCurrent()") print(error) } semaphore.signal() }.resume() semaphore.wait() return leaderboard } func getLeaderboardTotal() -> Leaderboard? { let url = URL(string: "http://13.53.140.24/leaderboard/total")! var leaderboard: Leaderboard? let semaphore = DispatchSemaphore(value: 0) URLSession.shared.dataTask(with: url) {(data, response, error) in do { if let error = error { self.handleClientError(error) semaphore.signal() return } guard let httpResponse = response as? HTTPURLResponse, (200...299).contains(httpResponse.statusCode) else { self.handleServerError(response) semaphore.signal() return } leaderboard = try JSONDecoder().decode(Leaderboard.self, from: data!) } catch { print("Error in getLeaderboardTotal()") print(error) } semaphore.signal() }.resume() semaphore.wait() return leaderboard } }
[ -1 ]
267c5f1818960a61618e2d22be906eac8c75e600
4157518dc44cde715003d4ea6ce76573c15c78ab
/Examples/WalletWithAPI/WalletWithAPI/HomeViewController.swift
697505a479c031b3ae5263213f49a24496b1649e
[ "MIT" ]
permissive
BitcoinCashKit/BitcoinCashKit
bb69b5aa5014cb37555ac43350eea7f13797d4e6
e49adb8f002c4678e4752e04ca7c2df494174ade
refs/heads/master
2020-03-23T06:34:32.070740
2018-08-28T07:15:46
2018-08-28T07:15:46
141,216,909
69
6
MIT
2018-08-28T07:15:46
2018-07-17T01:56:25
Swift
UTF-8
Swift
false
false
4,824
swift
// // HomeViewController.swift // SampleWallet // // Created by Akifumi Fujita on 2018/08/06. // Copyright © 2018年 Akifumi Fujita. All rights reserved. // import UIKit import BitcoinKit class HomeViewController: UITableViewController { var wallet: Wallet? var transactions = [CodableTx]() @IBOutlet weak var qrCodeImageView: UIImageView! @IBOutlet weak var addressLabel: UILabel! @IBOutlet weak var balanceLabel: UILabel! @IBOutlet weak var sendButton: UIButton! @IBAction func sendButtonTapped(_ sender: Any) { let sendViewController = storyboard?.instantiateViewController(withIdentifier: "SendViewController") as! SendViewController navigationController?.pushViewController(sendViewController, animated: true) } override func viewDidLoad() { super.viewDidLoad() guard let _ = AppController.shared.wallet else { createWallet() return } } override func viewWillAppear(_ animated: Bool) { updateUI() } override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { return "Transactions" } override func numberOfSections(in tableView: UITableView) -> Int { return 1 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return transactions.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "TransactionCell", for: indexPath) let transaction = transactions[indexPath.row] let cashaddr = AppController.shared.wallet!.publicKey.toCashaddr().cashaddr let address = cashaddr.components(separatedBy: ":")[1] let value = transaction.amount(addresses: [address]) let direction = transaction.direction(addresses: [address]) switch direction { case .sent: cell.textLabel?.text = "- \(value)" case .received: cell.textLabel?.text = "+ \(value)" } cell.textLabel?.textColor = direction == .sent ? #colorLiteral(red: 0.7529411765, green: 0.09803921569, blue: 0.09803921569, alpha: 1) : #colorLiteral(red: 0.3882352941, green: 0.7843137255, blue: 0.07843137255, alpha: 1) return cell } private func createWallet() { let privateKey = PrivateKey(network: .testnet) let wif = privateKey.toWIF() AppController.shared.importWallet(wif: wif) } private func updateUI() { getAddress() getTxHistory() } private func updateBalance() { let cashaddr = AppController.shared.wallet!.publicKey.toCashaddr().cashaddr let address = cashaddr.components(separatedBy: ":")[1] let addition = transactions.filter { $0.direction(addresses: [address]) == .received }.reduce(0) { $0 + $1.amount(addresses: [address]) } let subtraction = transactions.filter { $0.direction(addresses: [address]) == .sent }.reduce(0) { $0 + $1.amount(addresses: [address]) } let balance = addition - subtraction balanceLabel.text = "\(balance) tBCH" } private func getTxHistory() { APIClient().getTransaction(withAddresses: AppController.shared.wallet!.publicKey.toLegacy().description, completionHandler: { [weak self] (transactrions:[CodableTx]) in self?.transactions = transactrions DispatchQueue.main.async { self?.updateBalance() } DispatchQueue.main.async { self?.tableView.reloadData() } }) } private func getAddress() { let pubkey = AppController.shared.wallet!.publicKey let base58Address = pubkey.toLegacy() print(base58Address) let cashAddr = pubkey.toCashaddr().cashaddr print(cashAddr) qrCodeImageView.image = generateVisualCode(address: cashAddr) addressLabel.text = cashAddr } private func generateVisualCode(address: String) -> UIImage? { let parameters: [String : Any] = [ "inputMessage": address.data(using: .utf8)!, "inputCorrectionLevel": "L" ] let filter = CIFilter(name: "CIQRCodeGenerator", withInputParameters: parameters) guard let outputImage = filter?.outputImage else { return nil } let scaledImage = outputImage.transformed(by: CGAffineTransform(scaleX: 6, y: 6)) guard let cgImage = CIContext().createCGImage(scaledImage, from: scaledImage.extent) else { return nil } return UIImage(cgImage: cgImage) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ -1 ]
3859d22d85beff36e4a839554f81ddc54a885bba
a3d86f38b84663643b642b4362678ca5416e7e04
/Pong/GameScene.swift
695dd176b9f1ce4a846156c3418d71e1a62e7049
[]
no_license
MarkusEson/Pong
87fa01de73af61dc4f7ed52efaed5ad5ca86bf9a
748f2d12cbf1eb671c94aa4996579b53a93b8740
refs/heads/master
2020-03-09T02:14:22.163065
2018-04-07T14:19:24
2018-04-07T14:19:24
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,644
swift
// // GameScene.swift // Pong // // Created by Markus Eriksson on 2018-04-07. // Copyright © 2018 Markus Eriksson. All rights reserved. // import SpriteKit import GameplayKit class GameScene: SKScene { // konstruktor var ball = SKSpriteNode() var enemyPaddle = SKSpriteNode() var playerPaddle = SKSpriteNode() var playerScore = SKLabelNode() var enemyScore = SKLabelNode() var score = [Int]() override func didMove(to view: SKView) { enemyScore = self.childNode(withName: "enemyScore") as! SKLabelNode playerScore = self.childNode(withName: "playerScore") as! SKLabelNode ball = self.childNode(withName: "ball") as! SKSpriteNode enemyPaddle = self.childNode(withName: "enemyPaddle") as! SKSpriteNode enemyPaddle.position.y = (self.frame.height / 2) - 30 playerPaddle = self.childNode(withName: "playerPaddle") as! SKSpriteNode playerPaddle.position.y = (-self.frame.height / 2) + 30 let border = SKPhysicsBody(edgeLoopFrom: self.frame) border.friction = 0 border.restitution = 0 self.physicsBody = border startGame() } func startGame() { score = [0,0] enemyScore.text = "\(score[1])" playerScore.text = "\(score[0])" ball.physicsBody?.applyImpulse(CGVector(dx: -7, dy: 7)) // gives ball force, speed. } func addScore(playerWhoScored : SKSpriteNode) { ball.position = CGPoint(x: 0, y: 0) ball.physicsBody?.velocity = CGVector(dx: 0, dy: 0) if playerWhoScored == playerPaddle { score[0] += 1 ball.physicsBody?.applyImpulse(CGVector(dx: -7, dy: 7)) // speed at which ball flies } else if playerWhoScored == enemyPaddle { score[1] += 1 ball.physicsBody?.applyImpulse(CGVector(dx: 7, dy: -7)) // speed at which ball flies } enemyScore.text = "\(score[1])" playerScore.text = "\(score[0])" } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { // moves player paddle when touching screen for touch in touches { let location = touch.location(in: self) // grabs location of finger in view playerPaddle.run(SKAction.moveTo(x: location.x, duration: 0.2)) } } override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) { // moves player paddle when dragging finger over screen for touch in touches { let location = touch.location(in: self) // grabs location of finger in view playerPaddle.run(SKAction.moveTo(x: location.x, duration: 0.2)) } } override func update(_ currentTime: TimeInterval) { // Called before each frame is rendered switch currentGameType { case .easy: enemyPaddle.run(SKAction.moveTo(x: ball.position.x, duration: 1.0)) // enemy paddle moves break case .hard: enemyPaddle.run(SKAction.moveTo(x: ball.position.x, duration: 0.5)) // enemy paddle moves break } if ball.position.y <= playerPaddle.position.y - 10 { // "-30" is where ball scores addScore(playerWhoScored: enemyPaddle) } else if ball.position.y >= enemyPaddle.position.y + 10 { addScore(playerWhoScored: playerPaddle) } } }
[ -1 ]
248c1e968243a465ddafef6e78c5e1d677b0d656
c8c01fe64a9a5efba2082a50d6978e432d4c90ec
/Elements/Elements/ElementCell.swift
06403608b3db8ac3bfc46622420a971b3937d514
[ "MIT" ]
permissive
adam-diaz/Pursuit-Core-iOS-Unit3-Final
539d4477d73a415ca5340df0494c7544566b7d30
2c384a1e65f30ae973abab14d8e42d1b9bbc41ad
refs/heads/master
2020-11-26T13:30:09.445332
2020-01-10T19:02:01
2020-01-10T19:02:01
229,086,568
0
0
MIT
2019-12-19T15:42:49
2019-12-19T15:42:48
null
UTF-8
Swift
false
false
1,373
swift
// // ElementCell.swift // Elements // // Created by Adam Diaz on 12/19/19. // Copyright © 2019 Pursuit. All rights reserved. // import UIKit class ElementCell: UITableViewCell { @IBOutlet weak var elementImage: UIImageView! @IBOutlet weak var nameLabel: UILabel! @IBOutlet weak var detailLabel: UILabel! var elements: Element? func configureCell(for element: Element) { nameLabel.text = element.name detailLabel.text = " \(element.symbol)(\(element.number)) \(element.atomicMass)" elementImage.getImage(with: periodicImage(num: element.number ?? 1)) { [weak self](result) in switch result { case .failure: DispatchQueue.main.async { self?.elementImage.image = nil } case .success(let image): DispatchQueue.main.async { self?.elementImage.image = image } } } } func periodicImage(num: Int) -> String { switch num { case 1...9: return "http://www.theodoregray.com/periodictable/Tiles/00\(num)/s7.JPG" case 10...99: return "http://www.theodoregray.com/periodictable/Tiles/0\(num)/s7.JPG" default: return "there are 18 other elements missing." } } }
[ -1 ]
e8e4df7efe4ead1a7409704babe0b33f6ec93adf
dea4e2f43a239fc9f8e1782101ce565ca3dd96e5
/iOS/IssueTracker/IssueTracker/Model/ValueObject/FilterConditions/Label.swift
d841c263d4b26fd6154822fbfacfc05d4c4e811b
[ "MIT" ]
permissive
boostcamp-2020/IssueTracker-7
6a43c0051c1bdd536d4745c9d171e5560d77e2b4
1961807fd4e7da9ad668adbf90a56577b7c838a2
refs/heads/master
2023-01-10T22:39:01.095471
2020-11-13T09:58:23
2020-11-13T09:58:23
307,246,817
11
3
MIT
2020-11-13T09:26:23
2020-10-26T02:58:33
JavaScript
UTF-8
Swift
false
false
499
swift
// // LabelInfo.swift // IssueTracker // // Created by a1111 on 2020/11/02. // import Foundation //{ // "labels": [ // { // "id": 1, // "name": "frontend", // "color": "#000000", // "description": "" // } // ] //} // MARK: - Welcome struct LabelsInfo: Codable { let labels: [Label] } // MARK: - Label struct Label: Codable { let id: Int let name, color, description: String var isSelected: Bool? = false }
[ -1 ]
f84c059487c073df8687d719896194950ac41aa6
695d0dc7694cc3fbdb5c4f980b30fe8549560cae
/Swiftris/JShape.swift
4114dcdeef2b2f62e97a63e2effbf5affa532acb
[]
no_license
edd426/BlocksOnBlock
7860ff7a8b89abac3eb4e541ea9ac713bc16e88e
c3be03c6c2c5990e02c4f97e680c981881893eb4
refs/heads/master
2020-12-03T00:35:40.193870
2017-11-12T18:38:33
2017-11-12T18:38:33
96,045,935
0
0
null
null
null
null
UTF-8
Swift
false
false
1,423
swift
// // JShape.swift // Swiftris // // Created by EvanDeLord on 7/8/17. // Copyright © 2017 Bloc. All rights reserved. // class JShape:Shape { /* //Orientation 0 |0*| |1 | |3 ||2 | //Orientation 90 |3*| |2 |1 |0 | //Orientation 180 |2 |3*| |1 | |0 | //Orientation 270 |0*|1 |2 | |3 | * marks the row/column indicator for the shape */ // Pivots about '1' override var blockRowColumnPositions: [Orientation: Array<(columnDiff: Int, rowDiff: Int)>] { return [ Orientation.Zero: [(1, 0), (1, 1), (1, 2), (0, 2)], Orientation.Ninety: [(2, 1), (1, 1), (0, 1), (0, 0)], Orientation.OneEighty: [(0, 2), (0, 1), (0, 0), (1, 0)], Orientation.TwoSeventy: [(0, 0), (1, 0), (2, 0), (2, 1)] ] } override var bottomBlocksForOrientations: [Orientation: Array<Block>] { return [ Orientation.Zero: [blocks[ThirdBlockIdx], blocks[FourthBlockIdx]], Orientation.Ninety: [blocks[FirstBlockIdx], blocks[SecondBlockIdx], blocks[ThirdBlockIdx]], Orientation.OneEighty: [blocks[FirstBlockIdx], blocks[FourthBlockIdx]], Orientation.TwoSeventy: [blocks[FirstBlockIdx], blocks[SecondBlockIdx], blocks[FourthBlockIdx]] ] } }
[ 282675, 276131, 281685 ]
7226c1b1d254af18e903cb53890911f71667ad6d
1f37deb54b29fefb8b4821e1814b4af3bd8179d5
/TVShows/Base/Protocols/ReusableView.swift
dee2f7687654ce4035f20637fc75541770c6cace
[]
no_license
chirag-fullstack/TVShows
224bdaa2b90ee2fa2251c046dc3a727e618c19f1
ec14769a343c288fc763df4bedec89c93d731d4e
refs/heads/master
2022-12-07T18:17:07.403702
2020-08-28T12:11:10
2020-08-28T12:11:10
291,026,930
0
0
null
null
null
null
UTF-8
Swift
false
false
87
swift
import UIKit protocol ReusableView { static func getReuseIdentifier() -> String }
[ -1 ]
b705eb8b96ff29fa0471314ea13ee0d279741038
5cbd17b4fa8a47bac4f6e366b2872d508a85bd5d
/ButtonAnimationWithLayouts/ButtonAnimationWithLayoutsUITests/ButtonAnimationWithLayoutsUITests.swift
31b22328e338e8ceaaf80d07157ae9663feb2813
[]
no_license
sudarshanderangula/ButtonAnimationWithAutolayouts
54f0c3b56c1cbb231942672cd0d0b93a14a446fa
c417468e1b036dbae94a3b84254276e8db7ce7eb
refs/heads/master
2020-03-18T03:20:53.512698
2018-05-21T07:47:54
2018-05-21T07:47:54
134,235,999
0
0
null
null
null
null
UTF-8
Swift
false
false
1,306
swift
// // ButtonAnimationWithLayoutsUITests.swift // ButtonAnimationWithLayoutsUITests // // Created by Sundir Talari on 20/05/18. // Copyright © 2018 Sundir Talari. All rights reserved. // import XCTest class ButtonAnimationWithLayoutsUITests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. XCUIApplication().launch() // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } }
[ 155665, 237599, 229414, 278571, 229425, 180279, 229431, 319543, 213051, 286787, 237638, 311373, 196687, 278607, 311377, 368732, 180317, 278637, 319599, 278642, 131190, 131199, 278669, 278676, 311447, 327834, 278690, 311459, 278698, 278703, 278707, 180409, 278713, 295099, 139459, 131270, 229591, 147679, 311520, 147680, 319719, 295147, 286957, 319764, 278805, 311582, 278817, 311596, 336177, 98611, 278843, 287040, 319812, 311622, 319816, 229716, 278895, 287089, 139641, 311679, 311692, 106893, 156069, 311723, 377265, 319931, 311739, 278974, 336319, 311744, 278979, 336323, 278988, 278992, 279000, 369121, 279009, 188899, 279014, 319976, 279017, 311787, 319986, 279030, 311800, 279033, 279042, 287237, 377352, 279053, 303634, 303635, 279060, 279061, 279066, 188954, 279092, 377419, 303693, 115287, 189016, 295518, 287327, 279143, 279150, 287345, 287348, 189054, 287359, 303743, 164487, 279176, 311944, 344714, 311948, 311950, 311953, 336531, 287379, 295575, 303772, 221853, 205469, 279207, 295591, 295598, 279215, 279218, 287412, 164532, 287418, 303802, 66243, 287434, 287438, 279249, 303826, 369365, 369366, 279253, 230105, 295653, 230120, 312046, 279278, 230133, 279293, 205566, 295688, 312076, 295698, 221980, 336678, 262952, 262953, 279337, 262957, 164655, 328495, 303921, 230198, 222017, 295745, 279379, 295769, 230238, 230239, 279393, 303973, 279398, 295797, 295799, 279418, 336765, 287623, 279434, 320394, 189327, 279465, 304050, 189373, 213956, 345030, 213961, 279499, 304086, 123880, 304104, 320492, 320495, 287730, 320504, 214009, 312313, 312315, 312317, 418819, 230411, 320526, 238611, 140311, 238617, 197658, 336930, 132140, 189487, 312372, 238646, 238650, 320571, 336962, 238663, 205911, 296023, 156763, 230500, 279659, 230514, 238706, 279666, 312435, 279686, 222344, 337037, 296091, 238764, 148674, 312519, 279752, 148687, 189651, 279766, 189656, 279775, 304352, 304353, 279780, 279789, 279803, 320769, 312588, 320795, 320802, 304422, 312628, 345398, 222523, 181568, 279872, 279874, 304457, 345418, 230730, 337228, 296269, 222542, 238928, 296274, 230757, 296304, 312688, 230772, 337280, 296328, 296330, 304523, 9618, 279955, 148899, 279979, 279980, 173492, 279988, 280003, 370122, 280011, 337359, 329168, 312785, 222674, 329170, 280020, 280025, 239069, 320997, 280042, 280043, 329198, 337391, 296434, 288252, 312830, 230922, 329231, 304655, 230933, 222754, 312879, 230960, 288305, 239159, 157246, 288319, 288322, 280131, 124486, 288328, 239192, 99937, 345697, 312937, 312941, 206447, 288377, 337533, 280193, 239238, 288391, 239251, 280217, 198304, 337590, 280252, 280253, 296636, 321217, 280259, 296649, 239305, 280266, 9935, 313042, 280279, 18139, 280285, 321250, 337638, 181992, 288492, 34547, 67316, 313082, 288508, 288515, 280326, 116491, 280333, 124691, 116502, 321308, 321309, 280367, 280373, 280377, 321338, 280381, 345918, 280386, 280391, 280396, 337746, 370526, 296807, 296815, 313200, 313204, 124795, 182145, 280451, 67464, 305032, 214936, 337816, 329627, 239515, 214943, 313257, 288698, 214978, 280517, 280518, 214983, 231382, 329696, 190437, 313322, 329707, 174058, 296942, 124912, 313338, 239610, 182277, 313356, 305173, 223269, 354342, 354346, 313388, 124974, 321589, 215095, 288829, 288835, 313415, 239689, 354386, 223317, 321632, 280676, 313446, 215144, 288878, 288890, 215165, 329884, 215204, 125108, 280761, 223418, 280767, 338118, 280779, 321744, 280792, 280803, 182503, 338151, 125166, 125170, 395511, 313595, 125184, 125192, 125197, 125200, 125204, 338196, 125215, 125225, 338217, 321839, 125236, 280903, 289109, 379224, 239973, 313703, 280938, 321901, 354671, 354672, 199030, 223611, 313726, 158087, 313736, 240020, 190870, 190872, 289185, 305572, 289195, 338359, 289229, 281038, 281039, 281071, 322057, 182802, 322077, 289328, 338491, 322119, 281165, 281170, 281200, 297600, 289435, 314020, 248494, 166581, 314043, 363212, 158424, 322269, 338658, 289511, 330473, 330476, 289517, 215790, 125683, 199415, 289534, 322302, 35584, 322312, 346889, 166677, 207639, 281378, 281407, 289599, 281426, 281434, 322396, 281444, 207735, 314240, 158594, 330627, 240517, 289691, 240543, 289699, 289704, 289720, 289723, 281541, 19398, 191445, 183254, 207839, 314343, 183276, 289773, 248815, 240631, 330759, 322571, 330766, 330789, 248871, 281647, 322609, 314437, 207954, 339031, 314458, 281698, 281699, 322664, 314493, 150656, 347286, 330912, 339106, 306339, 249003, 208044, 3243, 322733, 339131, 290001, 339167, 298209, 290030, 208123, 322826, 126229, 298290, 208179, 159033, 372039, 224591, 331091, 314708, 150868, 314711, 314721, 281958, 314727, 134504, 306541, 314734, 314740, 314742, 314745, 290170, 224637, 306558, 314752, 306561, 290176, 298378, 314771, 306580, 224662, 282008, 282013, 290206, 314788, 314790, 282023, 298406, 241067, 314797, 306630, 306634, 339403, 191980, 282097, 306678, 191991, 290304, 323083, 323088, 282132, 282135, 175640, 306730, 290359, 323132, 282182, 224848, 224852, 290391, 306777, 323171, 282214, 224874, 314997, 290425, 339579, 282244, 323208, 282248, 323226, 282272, 282279, 298664, 298666, 306875, 282302, 323262, 323265, 282309, 306891, 241360, 282321, 241366, 282330, 282336, 12009, 282347, 282349, 323315, 200444, 282366, 249606, 323335, 282375, 282379, 216844, 118549, 282390, 282399, 241440, 282401, 339746, 216868, 315172, 241447, 282418, 282424, 282428, 413500, 241471, 315209, 159563, 307024, 307030, 241494, 307038, 282471, 282476, 339840, 315265, 282503, 315272, 315275, 184207, 282517, 298912, 118693, 298921, 126896, 282572, 282573, 323554, 298987, 282634, 241695, 315431, 102441, 315433, 102446, 282671, 241717, 307269, 233548, 315468, 315477, 323678, 315488, 315489, 45154, 217194, 233578, 307306, 249976, 241809, 323730, 299166, 233635, 299176, 184489, 323761, 184498, 258233, 299197, 299202, 176325, 299208, 233678, 282832, 356575, 307431, 184574, 217352, 315674, 282908, 299294, 282912, 233761, 282920, 315698, 282938, 168251, 127292, 307514, 323914, 201037, 282959, 250196, 168280, 323934, 381286, 242027, 242028, 250227, 315768, 315769, 291193, 291194, 291200, 242059, 315798, 291225, 242079, 299449, 291266, 373196, 283088, 283089, 242138, 176602, 160224, 291297, 283138, 233987, 324098, 340489, 283154, 291359, 283185, 234037, 340539, 234044, 332379, 111197, 242274, 291455, 316044, 184974, 316048, 340645, 176810, 299698, 291529, 225996, 135888, 242385, 299737, 234216, 234233, 242428, 291584, 299777, 291591, 291605, 283418, 234276, 283431, 234290, 201534, 283466, 234330, 201562, 275294, 349025, 357219, 177002, 308075, 242540, 242542, 201590, 177018, 308093, 291713, 340865, 299912, 316299, 234382, 308111, 308113, 209820, 283551, 177074, 127945, 340960, 234469, 340967, 324587, 234476, 201721, 234499, 234513, 316441, 300087, 21567, 308288, 160834, 349254, 300109, 234578, 250965, 250982, 234606, 300145, 300147, 234626, 234635, 177297, 308375, 324761, 119965, 234655, 300192, 234662, 300200, 324790, 300215, 283841, 283846, 283849, 316628, 251124, 316661, 283894, 292092, 234756, 242955, 177420, 292145, 300342, 193858, 300355, 300354, 234830, 283990, 357720, 300378, 300379, 316764, 292194, 284015, 234864, 316786, 243073, 292242, 112019, 234902, 333224, 284086, 259513, 284090, 54719, 415170, 292291, 300488, 300490, 144862, 300526, 308722, 300539, 210429, 292359, 218632, 316951, 374297, 235069, 349764, 194118, 292424, 292426, 333389, 349780, 128600, 235096, 300643, 300645, 243306, 325246, 333438, 235136, 317102, 300725, 333508, 333522, 325345, 153318, 333543, 284410, 284425, 300810, 300812, 284430, 161553, 284436, 341791, 186148, 186149, 333609, 284460, 300849, 325444, 153416, 325449, 317268, 325460, 341846, 284508, 300893, 284515, 276326, 292713, 292719, 325491, 317305, 317308, 325508, 333700, 243590, 243592, 325514, 350091, 350092, 350102, 333727, 219046, 333734, 284584, 292783, 300983, 153553, 292835, 292838, 317416, 325620, 333827, 243720, 292901, 325675, 243763, 325695, 194667, 284789, 292987, 235661, 333968, 153752, 284827, 333990, 284840, 284843, 227517, 309443, 227525, 301255, 227536, 301270, 301271, 325857, 317676, 309504, 194832, 227601, 325904, 334104, 211239, 334121, 317738, 325930, 227655, 383309, 391521, 285031, 416103, 227702, 211327, 227721, 285074, 227730, 285083, 293275, 317851, 285089, 293281, 301482, 375211, 334259, 293309, 317889, 129484, 326093, 285152, 195044, 334315, 236020, 293368, 317949, 334345, 309770, 342537, 342560, 227881, 293420, 236080, 23093, 244279, 244280, 301635, 309831, 55880, 301647, 326229, 244311, 309847, 244326, 301688, 301702, 334473, 326288, 227991, 285348, 318127, 293552, 342705, 285362, 285360, 154295, 342757, 285419, 170735, 342775, 375552, 228099, 285443, 285450, 326413, 285457, 285467, 318247, 293673, 318251, 301872, 285493, 285496, 301883, 342846, 293702, 318279, 244569, 301919, 293729, 351078, 310132, 228214, 269179, 228232, 416649, 236427, 252812, 293780, 310166, 310177, 293801, 326571, 326580, 326586, 359365, 211913, 326602, 56270, 203758, 293894, 293911, 326684, 113710, 318515, 203829, 285795, 228457, 318571, 187508, 302202, 285819, 285823, 285833, 318602, 285834, 228492, 162962, 187539, 285850, 302239, 302251, 294069, 294075, 64699, 228541, 343230, 310496, 228587, 302319, 228608, 318732, 245018, 318746, 130342, 130344, 130347, 286012, 294210, 294220, 318804, 294236, 327023, 327030, 310650, 179586, 294278, 318860, 368012, 318876, 343457, 245160, 286128, 286133, 310714, 302523, 228796, 302530, 228804, 310725, 310731, 302539, 310735, 327122, 310747, 286176, 187877, 310758, 40439, 286201, 359931, 245249, 228868, 302602, 294413, 359949, 302613, 302620, 310853, 286281, 196184, 212574, 204386, 204394, 138862, 310896, 294517, 286344, 179853, 286351, 188049, 229011, 179868, 229021, 302751, 245413, 212649, 286387, 286392, 302778, 286400, 212684, 302798, 286419, 294621, 294629, 286457, 286463, 319232, 278292, 278294, 294699, 286507, 319289, 237397, 188250, 327556, 188293, 311183, 294806, 294808, 319393, 294820, 294824, 343993, 98240, 294849, 24531, 294887, 278507, 311277, 327666, 278515 ]
99ae02f89dec61932c3e6ed39085dfdc5aa2f00a
8177437559419f697eef57b38c1b9c6ba125cb87
/SDSample_UIKit002/SDSample_UIKit002/ViewController.swift
3d1513b4a21999a694d471aba98ada5a8984e409
[]
no_license
makopy1980/Swift-Study-UIKit002
f71dba7432ee72a9b3d8a5f9a07ee418e8c8b989
41f352b90e064f92cc2230c93af2ea2c02c8c2e8
refs/heads/master
2021-01-19T20:54:38.485895
2017-04-19T02:49:11
2017-04-19T02:49:11
88,575,564
0
0
null
null
null
null
UTF-8
Swift
false
false
2,165
swift
// // ViewController.swift // import UIKit class ViewController: UIViewController { private var button: UIButton! // MARK: - View Lifecycle Methods override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. // Viewの設定 self.setupView() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // MARK: - Internal Methods // Viewの設定 internal func setupView() { // ボタンの設定 self.setupButton() } // ボタンの設定 internal func setupButton() { // ボタンのサイズ let buttonSize = CGSize(width: 200.0, height: 50.0) // ボタンの座標 let buttonPoint = CGPoint(x: self.view.frame.width / 2 - buttonSize.width / 2, y: self.view.frame.height / 2 - buttonSize.height / 2) button = UIButton(frame: CGRect(origin: buttonPoint, size: buttonSize)) button.tag = 1 button.backgroundColor = UIColor.red // 通常時タイトル設定 button.setTitle("ボタン(通常)", for: .normal) button.setTitleColor(.white, for: .normal) // ハイライト時設定 button.setTitle("ボタン(ハイライト時)", for: .highlighted) button.setTitleColor(.black, for: .highlighted) // 角丸設定 button.layer.masksToBounds = true button.layer.cornerRadius = 20.0 // イベント追加 button.addTarget(self, action: #selector(onButtonTapped(sender:)), for: .touchUpInside) self.view.addSubview(button) } internal func onButtonTapped(sender: UIButton) { print(#function) print("sender.currentTitle: \(String(describing: sender.currentTitle))") print("sender.tag: \(sender.tag)") } }
[ -1 ]
922146622094458c7bd768811a0c6222520d0e60
9e80b29fef95943af89e90d47e5e509da7e767fc
/InstagramClient/DataStorage/WebsiteDataManager.swift
a7b79a0aa2d706b6e792aa0761f050f6ce4dfa5c
[]
no_license
PlayRhyba/PhotoPicker
1a09338155561d71a11006b096e0a7b598277449
18c962c778ffcf6428b3cc909031b9333ee30b7d
refs/heads/master
2022-12-09T11:50:41.938578
2020-09-18T12:55:59
2020-09-18T12:55:59
295,453,736
0
0
null
null
null
null
UTF-8
Swift
false
false
1,512
swift
// // WebsiteDataManager.swift // InstagramClient // // Created by Oleksandr Snigurskyi on 08.09.20. // Copyright © 2020 Oleksandr Snigursky. All rights reserved. // import WebKit protocol WebsiteDataManagerProtocol { func clearData() func clearInstagramData() } final class WebsiteDataManager {} // MARK: - WebsiteDataManagerProtocol extension WebsiteDataManager: WebsiteDataManagerProtocol { func clearData() { HTTPCookieStorage.shared.removeCookies(since: Date.distantPast) clearData(filter: { _ in true }) } func clearInstagramData() { clearData(filter: { let displayName = $0.displayName.lowercased() return displayName.contains("instagram") || displayName.contains("facebook") || displayName.contains("fbcdn") }) } } // MARK: - Private private extension WebsiteDataManager { func clearData(filter: @escaping (WKWebsiteDataRecord) -> Bool) { WKWebsiteDataStore.default().fetchDataRecords(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes()) { records in records.forEach { record in if filter(record) { WKWebsiteDataStore.default().removeData(ofTypes: record.dataTypes, for: [record], completionHandler: {}) } } } } }
[ -1 ]
e42286bbf189cef86dc1566ec426bde92ec05cc1
70d586abb5e29ee96a99bb9b6eb5f18ec0c1115b
/Lab - Operators fr.playground/Pages/7. Exercise - Numeric Type Conversion.xcplaygroundpage/Contents.swift
1e04c71f07e662f952a919b6a55e3594d4104b2f
[]
no_license
louniddam/exercices_formation
520d04258a3909a23516c956b4f25b54dded824d
ac31217f2eb0329df2a2854a41f4ecc97dfcb991
refs/heads/master
2020-09-26T22:48:31.423903
2019-12-10T08:57:16
2019-12-10T08:57:16
226,359,932
0
0
null
null
null
null
UTF-8
Swift
false
false
823
swift
/*: ## Exercise - Numeric Type Conversion Créez une constante entière `x` avec une valeur de 10, et une constante double `y` avec une valeur de 3.2. Créez une constante `multipliedAsIntegers` égale à `x` fois `y`. Est-ce que cela compile ? Si ce n'est pas le cas, corrigez-le en convertissant votre `Double` en un `Int` dans l'expression mathématique. Affichez le résultat. */ /*: Créez une constante `multipliedAsDoubles` égale à `x` fois `y`, mais cette fois convertissez le `Int` en un `Double` dans l'expression. Affichez le résultat. */ /*: Les valeurs de `multipliedAsIntegers` et `multipliedAsDoubles` sont-elles différentes ? Affichez une déclaration à la console expliquant pourquoi. */ //: [Précédent](@previous) | Page 7 sur 8 | [Suivant: App Exercise - Converting Types](@next)
[ -1 ]
775e476fc196c1da7164be9684da27e605505265
00d127fd64c3f5c15724fb0c42a847764109e564
/Charts/Classes/Renderers/ChartYAxisRenderer.swift
e9fcfd791ce49e1a27cdf86708b0b617c196af97
[]
no_license
prbs/monitorEletrico
de7aaec81b7d485c329268ceee1750dcbe24ff3f
f0990a1b1df1e1e14f9ffdb2243b1293c5e56f59
refs/heads/master
2021-08-23T02:23:49.734080
2017-12-02T13:41:35
2017-12-02T13:41:35
112,843,171
0
0
null
null
null
null
UTF-8
Swift
false
false
14,027
swift
// // ChartYAxisRenderer.swift // Charts // // Created by Daniel Cohen Gindi on 3/3/15. // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda // A port of MPAndroidChart for iOS // Licensed under Apache License 2.0 // // https://github.com/danielgindi/ios-charts // import Foundation import CoreGraphics import UIKit open class ChartYAxisRenderer: ChartAxisRendererBase { internal var _yAxis: ChartYAxis! public init(viewPortHandler: ChartViewPortHandler, yAxis: ChartYAxis, transformer: ChartTransformer!) { super.init(viewPortHandler: viewPortHandler, transformer: transformer) _yAxis = yAxis } /// Computes the axis values. public func computeAxis(yMin: Double, yMax: Double) { var yMin = yMin, yMax = yMax // calculate the starting and entry point of the y-labels (depending on // zoom / contentrect bounds) if (viewPortHandler.contentWidth > 10.0 && !viewPortHandler.isFullyZoomedOutY) { let p1 = transformer.getValueByTouchPoint(CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentTop)) let p2 = transformer.getValueByTouchPoint(CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentBottom)) if (!_yAxis.isInverted) { yMin = Double(p2.y) yMax = Double(p1.y) } else { yMin = Double(p1.y) yMax = Double(p2.y) } } computeAxisValues(min: yMin, max: yMax) } /// Sets up the y-axis labels. Computes the desired number of labels between /// the two given extremes. Unlike the papareXLabels() method, this method /// needs to be called upon every refresh of the view. internal func computeAxisValues(min: Double, max: Double) { let yMin = min let yMax = max let labelCount = _yAxis.labelCount let range = abs(yMax - yMin) if (labelCount == 0 || range <= 0) { _yAxis.entries = [Double]() return } let rawInterval = range / Double(labelCount) var interval = ChartUtils.roundToNextSignificant(number: Double(rawInterval)) let intervalMagnitude = pow(10.0, round(log10(interval))) let intervalSigDigit = (interval / intervalMagnitude) if (intervalSigDigit > 5) { // Use one order of magnitude higher, to avoid intervals like 0.9 or 90 interval = floor(10.0 * intervalMagnitude) } // force label count if _yAxis.isForceLabelsEnabled { let step = Double(range) / Double(labelCount - 1) if _yAxis.entries.count < labelCount { // Ensure stops contains at least numStops elements. _yAxis.entries.removeAll(keepingCapacity: true) } else { _yAxis.entries = [Double]() _yAxis.entries.reserveCapacity(labelCount) } var v = yMin for (i in 0 ..< labelCount) { _yAxis.entries.append(v) v += step } } else { // no forced count // if the labels should only show min and max if (_yAxis.isShowOnlyMinMaxEnabled) { _yAxis.entries = [yMin, yMax] } else { let first = ceil(Double(yMin) / interval) * interval let last = ChartUtils.nextUp(floor(Double(yMax) / interval) * interval) var f: Double var i: Int var n = 0 for (f = first; f <= last; f += interval) { n += 1 } if (_yAxis.entries.count < n) { // Ensure stops contains at least numStops elements. _yAxis.entries = [Double](repeating: 0.0, count: n) } else if (_yAxis.entries.count > n) { _yAxis.entries.removeSubrange(n..<_yAxis.entries.count) } for (f = first, i = 0; i < n; f += interval, ++i) { _yAxis.entries[i] = Double(f) } } } } /// draws the y-axis labels to the screen open override func renderAxisLabels(context: CGContext) { if (!_yAxis.isEnabled || !_yAxis.isDrawLabelsEnabled) { return } let xoffset = _yAxis.xOffset let yoffset = _yAxis.labelFont.lineHeight / 2.5 + _yAxis.yOffset let dependency = _yAxis.axisDependency let labelPosition = _yAxis.labelPosition var xPos = CGFloat(0.0) var textAlign: NSTextAlignment if (dependency == .left) { if (labelPosition == .outsideChart) { textAlign = .right xPos = viewPortHandler.offsetLeft - xoffset } else { textAlign = .left xPos = viewPortHandler.offsetLeft + xoffset } } else { if (labelPosition == .outsideChart) { textAlign = .left xPos = viewPortHandler.contentRight + xoffset } else { textAlign = .right xPos = viewPortHandler.contentRight - xoffset } } drawYLabels(context: context, fixedPosition: xPos, offset: yoffset - _yAxis.labelFont.lineHeight, textAlign: textAlign) } fileprivate var _axisLineSegmentsBuffer = [CGPoint](repeating: CGPoint(), count: 2) open override func renderAxisLine(context: CGContext) { if (!_yAxis.isEnabled || !_yAxis.drawAxisLineEnabled) { return } context.saveGState() context.setStrokeColor(_yAxis.axisLineColor.cgColor) context.setLineWidth(_yAxis.axisLineWidth) if (_yAxis.axisLineDashLengths != nil) { CGContextSetLineDash(context, _yAxis.axisLineDashPhase, _yAxis.axisLineDashLengths, _yAxis.axisLineDashLengths.count) } else { CGContextSetLineDash(context, 0.0, nil, 0) } if (_yAxis.axisDependency == .left) { _axisLineSegmentsBuffer[0].x = viewPortHandler.contentLeft _axisLineSegmentsBuffer[0].y = viewPortHandler.contentTop _axisLineSegmentsBuffer[1].x = viewPortHandler.contentLeft _axisLineSegmentsBuffer[1].y = viewPortHandler.contentBottom CGContextStrokeLineSegments(context, _axisLineSegmentsBuffer, 2) } else { _axisLineSegmentsBuffer[0].x = viewPortHandler.contentRight _axisLineSegmentsBuffer[0].y = viewPortHandler.contentTop _axisLineSegmentsBuffer[1].x = viewPortHandler.contentRight _axisLineSegmentsBuffer[1].y = viewPortHandler.contentBottom CGContextStrokeLineSegments(context, _axisLineSegmentsBuffer, 2) } context.restoreGState() } /// draws the y-labels on the specified x-position internal func drawYLabels(context: CGContext, fixedPosition: CGFloat, offset: CGFloat, textAlign: NSTextAlignment) { let labelFont = _yAxis.labelFont let labelTextColor = _yAxis.labelTextColor let valueToPixelMatrix = transformer.valueToPixelMatrix var pt = CGPoint() for (i in 0 ..< _yAxis.entryCount) { let text = _yAxis.getFormattedLabel(i) if (!_yAxis.isDrawTopYLabelEntryEnabled && i >= _yAxis.entryCount - 1) { break } pt.x = 0 pt.y = CGFloat(_yAxis.entries[i]) pt = pt.applying(valueToPixelMatrix) pt.x = fixedPosition pt.y += offset ChartUtils.drawText(context: context, text: text, point: pt, align: textAlign, attributes: [NSFontAttributeName: labelFont, NSForegroundColorAttributeName: labelTextColor]) } } fileprivate var _gridLineBuffer = [CGPoint](repeating: CGPoint(), count: 2) open override func renderGridLines(context: CGContext) { if (!_yAxis.isDrawGridLinesEnabled || !_yAxis.isEnabled) { return } context.saveGState() context.setStrokeColor(_yAxis.gridColor.cgColor) context.setLineWidth(_yAxis.gridLineWidth) if (_yAxis.gridLineDashLengths != nil) { CGContextSetLineDash(context, _yAxis.gridLineDashPhase, _yAxis.gridLineDashLengths, _yAxis.gridLineDashLengths.count) } else { CGContextSetLineDash(context, 0.0, nil, 0) } let valueToPixelMatrix = transformer.valueToPixelMatrix var position = CGPoint(x: 0.0, y: 0.0) // draw the horizontal grid for (var i = 0, count = _yAxis.entryCount; i < count; i += 1) { position.x = 0.0 position.y = CGFloat(_yAxis.entries[i]) position = position.applying(valueToPixelMatrix) _gridLineBuffer[0].x = viewPortHandler.contentLeft _gridLineBuffer[0].y = position.y _gridLineBuffer[1].x = viewPortHandler.contentRight _gridLineBuffer[1].y = position.y CGContextStrokeLineSegments(context, _gridLineBuffer, 2) } context.restoreGState() } fileprivate var _limitLineSegmentsBuffer = [CGPoint](repeating: CGPoint(), count: 2) open override func renderLimitLines(context: CGContext) { var limitLines = _yAxis.limitLines if (limitLines.count == 0) { return } context.saveGState() let trans = transformer.valueToPixelMatrix var position = CGPoint(x: 0.0, y: 0.0) for (i in 0 ..< limitLines.count) { let l = limitLines[i] if !l.isEnabled { continue } position.x = 0.0 position.y = CGFloat(l.limit) position = position.applying(trans) _limitLineSegmentsBuffer[0].x = viewPortHandler.contentLeft _limitLineSegmentsBuffer[0].y = position.y _limitLineSegmentsBuffer[1].x = viewPortHandler.contentRight _limitLineSegmentsBuffer[1].y = position.y context.setStrokeColor(l.lineColor.cgColor) context.setLineWidth(l.lineWidth) if (l.lineDashLengths != nil) { CGContextSetLineDash(context, l.lineDashPhase, l.lineDashLengths!, l.lineDashLengths!.count) } else { CGContextSetLineDash(context, 0.0, nil, 0) } CGContextStrokeLineSegments(context, _limitLineSegmentsBuffer, 2) let label = l.label // if drawing the limit-value label is enabled if (label.characters.count > 0) { let labelLineHeight = l.valueFont.lineHeight let xOffset: CGFloat = 4.0 + l.xOffset let yOffset: CGFloat = l.lineWidth + labelLineHeight + l.yOffset if (l.labelPosition == .rightTop) { ChartUtils.drawText(context: context, text: label, point: CGPoint( x: viewPortHandler.contentRight - xOffset, y: position.y - yOffset), align: .right, attributes: [NSFontAttributeName: l.valueFont, NSForegroundColorAttributeName: l.valueTextColor]) } else if (l.labelPosition == .rightBottom) { ChartUtils.drawText(context: context, text: label, point: CGPoint( x: viewPortHandler.contentRight - xOffset, y: position.y + yOffset - labelLineHeight), align: .right, attributes: [NSFontAttributeName: l.valueFont, NSForegroundColorAttributeName: l.valueTextColor]) } else if (l.labelPosition == .leftTop) { ChartUtils.drawText(context: context, text: label, point: CGPoint( x: viewPortHandler.contentLeft + xOffset, y: position.y - yOffset), align: .left, attributes: [NSFontAttributeName: l.valueFont, NSForegroundColorAttributeName: l.valueTextColor]) } else { ChartUtils.drawText(context: context, text: label, point: CGPoint( x: viewPortHandler.contentLeft + xOffset, y: position.y + yOffset - labelLineHeight), align: .left, attributes: [NSFontAttributeName: l.valueFont, NSForegroundColorAttributeName: l.valueTextColor]) } } } context.restoreGState() } }
[ 283294 ]
e54abbf342c6672ad1e0d43bfc953e4d1dd2067b
5cf44531c9263b93ee30c12edb6b98058f14903c
/Desktop copy/StemLearn/FoodTracker/FoodTracker/AppDelegate.swift
0bc555f5c887239ce6d97c3ec0d65258ea089731
[]
no_license
whartig/Career-
ef31d91d68cc70c1265d80483f8c501b54941436
a6b1a20eee1de8a26ff1994dc67cb362b2b426f8
refs/heads/master
2020-06-04T10:57:10.720061
2019-06-14T19:10:42
2019-06-14T19:10:42
191,993,334
0
0
null
null
null
null
UTF-8
Swift
false
false
2,174
swift
// // AppDelegate.swift // FoodTracker // // Created by Will Hartig on 2/7/19. // Copyright © 2019 Will Hartig. 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, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 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, 287309, 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, 295583, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 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, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 213895, 304007, 304009, 304011, 230284, 304013, 295822, 279438, 213902, 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, 295949, 197645, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 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, 279929, 181626, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 279991, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 222676, 288214, 280021, 239064, 288217, 329177, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 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, 280388, 304968, 280393, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 354653, 313700, 280937, 313705, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 281095, 223752, 150025, 338440, 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, 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, 240519, 322440, 314249, 338823, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 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, 290174, 298365, 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, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 298822, 148946, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 44948, 298901, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 184503, 176311, 299191, 307385, 307386, 307388, 258235, 307390, 176316, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 323854, 291089, 282906, 291104, 233766, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 194654, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 127434, 315856, 176592, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 291299, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 283142, 127497, 233994, 135689, 127500, 291341, 233998, 127506, 234003, 127509, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 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, 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, 226200, 234396, 234398, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 324522, 234410, 291756, 226220, 291754, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 275384, 324536, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 226245, 234437, 234439, 226239, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 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, 234648, 308379, 300189, 324766, 119967, 234653, 283805, 234657, 324768, 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, 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, 275725, 349451, 349464, 415009, 283939, 259367, 283951, 292143, 300344, 226617, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 227440, 316917, 308727, 292343, 300537, 316933, 316947, 308757, 308762, 284191, 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, 276052, 284253, 235097, 284255, 300638, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 284290, 325250, 284292, 292485, 292479, 276098, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 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, 276410, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 292843, 276460, 276464, 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, 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, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 309491, 227571, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 301636, 318020, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 342707, 154292, 318132, 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, 310080, 293696, 277317, 277322, 293706, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 244731, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 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, 64966, 245191, 163272, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 278057, 310831, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286313, 40554, 286312, 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, 278227, 286420, 229076, 286425, 319194, 278235, 301163, 278238, 229086, 286432, 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, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
d9181f949585097b56f9b0d7ae6f65cd6bb23e8f
bebef78180b88f493dfb06cc09a583b04404d407
/MyPlayground.playground/Contents.swift
ee168b5eb82e432c657268f385b2d51e43fb1b02
[]
no_license
CaliforniaSoil/BottlesOfBeer
cb386b9e1b806f2a96e51b618e7051995de5b4e0
ce950db9fd62d0dc76cf7ff08133d587f5fba979
refs/heads/master
2021-05-02T11:54:24.858307
2018-02-08T08:26:46
2018-02-08T08:26:46
120,732,676
0
0
null
null
null
null
UTF-8
Swift
false
false
868
swift
//: Playground - noun: a place where people can play import UIKit func beerSong(beers: Int) -> String { var lyrics: String = "" for number in (1...beers).reversed() { if number != 1 { let newLine: String = "\n\(number) bottles of beer on the wall. \(number) bottles of beer. \nTake one down and pass it around, \(number - 1) bottles of beer on the wall\n " lyrics += newLine } else { let newLine: String = "\n\(number) bottle of beer on the wall. \(number) bottle of beer. \n Take one down and pass it around, no more bottles of beer on the wall\n " lyrics += newLine } } lyrics += "\nNo more bottles of beer on the wall, no more bottles of beer. \nGo to the store and buy some more, \(beers) bottles of beer on the wall.\n" return lyrics } print(beerSong(beers: 99))
[ -1 ]
751c7a0887f360129ee32ced2b5649b0ca156ecb
c88d908e0b4dbff864c3c86670644fbab7167aa2
/Projects/OtherClassProjects/AnotherTableView_KL/AnotherTableView_KL_Class/AnotherTableView_KL_Class/ViewController.swift
425db605cd7f83092b0b26bd0dbd0cd4b15d724d
[]
no_license
rafaiq/introToSwift2018
d1930949db51cd3cf029b71d5194112ff64b775f
dd8fa8dd26de8bef1dc3bc81e1284fe70bc9a35b
refs/heads/master
2020-03-12T18:58:53.887596
2018-06-27T22:01:22
2018-06-27T22:01:22
130,774,330
0
0
null
2018-04-24T00:43:47
2018-04-24T00:43:46
null
UTF-8
Swift
false
false
4,040
swift
// // ViewController.swift // AnotherTableView_KL_Class // // Created by Kevin Lopez on 4/19/18. // Copyright © 2018 io.ricoLabs. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var tableView: UITableView! var viewModels = [DetailViewModel]() override func viewDidLoad() { super.viewDidLoad() title = "Another Table View" viewModels = DetailViewModel.defaultData } } extension ViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return viewModels.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let viewModel = viewModels[indexPath.row] let cell = tableView.dequeueReusableCell(withIdentifier: "detailCell", for: indexPath) as? DetailTableViewCell cell?.configureWith(viewModel) return cell ?? UITableViewCell() } } extension ViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let viewModel = viewModels[indexPath.row] tableView.deselectRow(at: indexPath, animated: true) presentActionSheetWith(viewModel) } private func presentActionSheetWith(_ viewModel: DetailViewModel) { let actionSheetController = UIAlertController(title: "Select Action", message: "Select action for view model", preferredStyle: .actionSheet) let modalAction = UIAlertAction(title: "Modal", style: .default) { [weak self] (_) in self?.presentModal(viewModel) } let pushAction = UIAlertAction(title: "Push", style: .default) { [weak self] (_) in self?.pushView(viewModel) } let deleteAction = UIAlertAction(title: "Delete", style: .destructive) { (_) in self.delete(viewModel) } let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil) actionSheetController.addAction(modalAction) actionSheetController.addAction(pushAction) actionSheetController.addAction(deleteAction) actionSheetController.addAction(cancelAction) navigationController?.present(actionSheetController, animated: true, completion: nil) // every object referenced inside a completion block receives a strong reference by the function/object owning the completion block // navController >s viewController // navController >s alertController } private func presentModal(_ viewModel: DetailViewModel) { let modalVC = storyboard?.instantiateViewController(withIdentifier: "modal") as! ModalViewController <<<<<<< HEAD self.definesPresentationContext = true modalVC.modalPresentationStyle = .overCurrentContext modalVC.viewModel = viewModel navigationController?.present(modalVC, animated: true, completion: nil) ======= >>>>>>> upstream/master self.definesPresentationContext = true modalVC.modalPresentationStyle = .overCurrentContext modalVC.viewModel = viewModel navigationController?.present(modalVC, animated: true, completion: nil) } private func pushView(_ viewModel: DetailViewModel) { let pushedVC = storyboard?.instantiateViewController(withIdentifier: "pushed") as! PushedViewController <<<<<<< HEAD pushedVC.viewModel = viewModel navigationController?.pushViewController(pushedVC, animated: true) ======= pushedVC.viewModel = viewModel navigationController?.pushViewController(pushedVC, animated: true) >>>>>>> upstream/master } private func delete(_ viewModel: DetailViewModel) { viewModels = viewModels.filter({ $0.imageName != viewModel.imageName }) tableView.reloadData() } }
[ -1 ]
aa2faffa112e74de93847163d7d0def6d5f4dcee
b86acab33f090c761e88ed82f29cd9a7564584ce
/MVP/Scense/Users/ViewController/UserVC+Tableview.swift
40a7d7b60cfab379baf06b7b71bfeaf59a843643
[]
no_license
mazen93/MVP-Demo
2a11b9f26e2d69d8944de58d85e3dc09e9a67d6c
6932119fe1df0e34e07403961f17d8b90ae14f15
refs/heads/master
2020-04-22T10:31:20.523454
2019-02-14T11:26:11
2019-02-14T11:26:11
170,308,450
0
0
null
null
null
null
UTF-8
Swift
false
false
1,078
swift
// // UserVC+Tableview.swift // MVP // // Created by mac on 2/12/19. // Copyright © 2019 mac. All rights reserved. // import UIKit extension UserVC:UITableViewDelegate,UITableViewDataSource{ func SetUpTableView() { table.delegate=self table.dataSource=self table.register(UINib(nibName: "UserVCCell", bundle: nil), forCellReuseIdentifier: "UserVCCell") } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return presenter?.getUsersCount() ?? 0 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell=table.dequeueReusableCell(withIdentifier: "UserVCCell", for: indexPath) as! UserVCCell presenter?.configration(cell: cell, for: indexPath.row) return cell } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { presenter?.didSelectRow(index: indexPath.row) } }
[ 213851 ]
ba8033aa36b9068ad255766c5e9079ee2ac0ec38
a6165002251a36cef25603f51e4f9fafaa289255
/PinMusubi/PinMusubi/API/Ekispert/Error/EkispertClientError.swift
728a211e025aafce2bf7c76c9d35b566ca892650
[]
no_license
8secz-johndpope/PinMusubi-iOS
6b21c747e812378e6f1410abd3a2106747fa3598
5322c322554d5969514401ee857fca88b4b81cc2
refs/heads/master
2022-09-11T22:16:12.572773
2020-03-26T02:31:34
2020-03-26T02:31:34
268,226,307
1
0
null
2020-05-31T06:56:55
2020-05-31T06:56:54
null
UTF-8
Swift
false
false
309
swift
// // EkispertClientError.swift // PinMusubi // // Created by rMac on 2020/02/24. // Copyright © 2020 naipaka. All rights reserved. // enum EkispertClientError: Error { // 通信に失敗 case connectionError(Error) // レスポンスの解釈に失敗 case responseParseError(Error) }
[ -1 ]
0eaba3c96012f7abada17db1d6aafa4529e95ddc
e6486377548450d4836602c26110097211895739
/CustomFont/ViewController.swift
e40ee30f56628c09e7b1c3199355356b5f1c7c7b
[]
no_license
nostradouglass/CustomFont
8ddccd5efd2a2f3499519aae99c9f3f41d8bfd12
a6a3f307e3f670e2a43186b7a4da46c53cafffcd
refs/heads/master
2020-04-09T19:59:25.131310
2018-12-05T17:05:47
2018-12-05T17:05:47
160,551,891
0
0
null
null
null
null
UTF-8
Swift
false
false
799
swift
// // ViewController.swift // CustomFont // // Created by Kelly Douglass on 12/5/18. // Copyright © 2018 Kelly Douglass. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var text: UITextView! @IBOutlet weak var button: UIButton! var fontSwitch = true override func viewDidLoad() { super.viewDidLoad() button.layer.cornerRadius = 50 text.font = UIFont(name: "Arial", size: 20.0) } @IBAction func changeFont(_ sender: Any) { if fontSwitch == true { text.font = UIFont(name: "Didot", size: 30.0) fontSwitch = false } else { text.font = UIFont(name: "Helvetica", size: 30.0) fontSwitch = true } } }
[ -1 ]
0a310c2d55856fb21ac55d9d6e027a3d725ba395
9b9f2ef4f75b39b6b569cd8e9efc0ce69177078d
/PlayingWithLayersSession/AppDelegate.swift
c5a411d0a25e68a6afaf039591f4c7743d1723fe
[]
no_license
craiggrummitt/BorderedView
c5a5db39d2f279b9610cef3d6e1da250d8497d8d
bf5e8d3f55cb92f7ebd51f9b12c63419abc116c8
refs/heads/master
2021-01-01T04:34:57.904273
2016-05-13T17:21:14
2016-05-13T17:21:14
58,759,139
0
0
null
null
null
null
UTF-8
Swift
false
false
2,168
swift
// // AppDelegate.swift // PlayingWithLayersSession // // Created by Craig Grummitt on 13/05/2016. // Copyright © 2016 Craig Grummitt. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 352284, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 286797, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 327814, 131209, 303241, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 278760, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 319978, 279020, 172526, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 287238, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 172655, 172656, 189039, 295538, 189040, 172660, 189044, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 303773, 295583, 172702, 230045, 287394, 287390, 303780, 172705, 287398, 172707, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 279231, 287427, 312006, 107208, 279241, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 312035, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 222018, 295755, 377676, 148302, 287569, 279383, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 213895, 320391, 304007, 304009, 304011, 230284, 304013, 279438, 213902, 295822, 189329, 295825, 304019, 189331, 279445, 58262, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 295949, 197645, 230413, 320528, 140312, 295961, 238620, 197663, 304164, 189479, 304170, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 279750, 312518, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 230718, 296259, 378181, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 304506, 304505, 181626, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 173488, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 280014, 312783, 288208, 230865, 288210, 370130, 288212, 280021, 288214, 222676, 239064, 288217, 329177, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 291754, 288242, 296435, 288244, 296439, 288250, 402942, 148990, 296446, 206336, 296450, 321022, 230916, 230919, 214535, 304651, 370187, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 206536, 280264, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 304968, 280393, 280402, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280458, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 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, 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, 379218, 280919, 354653, 313700, 280937, 313705, 280940, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 240132, 223749, 281095, 338440, 150025, 223752, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 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, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 240519, 322440, 338823, 314249, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 281923, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 298365, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 224657, 306581, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 307009, 413506, 241475, 307012, 148946, 315211, 282446, 307027, 315221, 282454, 315223, 241496, 323414, 241498, 307035, 307040, 282465, 110433, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 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, 307512, 151864, 176435, 307515, 168245, 282942, 307518, 151874, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 283080, 176592, 315856, 315860, 176597, 127447, 283095, 299481, 176605, 242143, 291299, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 127497, 233994, 135689, 291341, 233998, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 381677, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 201603, 291714, 234373, 226182, 234375, 291716, 226185, 308105, 234379, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 226200, 234398, 234396, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 234414, 324527, 291760, 234417, 201650, 324531, 234422, 226230, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 226245, 234437, 234439, 234434, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 300148, 234614, 398455, 144506, 234618, 275579, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 275594, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 234648, 308379, 234653, 324766, 119967, 283805, 234657, 300189, 324768, 242852, 234661, 283813, 300197, 234664, 275626, 234667, 316596, 308414, 234687, 300226, 308418, 226500, 234692, 300229, 308420, 283844, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 283904, 300289, 292097, 300292, 300294, 275719, 300299, 177419, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 243003, 283963, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 284099, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 226802, 316917, 308727, 292343, 300537, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194101, 284215, 194103, 284218, 226877, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 276052, 284245, 276053, 284247, 317015, 284249, 243290, 284251, 300628, 284253, 235097, 284255, 300638, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 284290, 325250, 284292, 276098, 292479, 292485, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 317158, 358119, 284392, 325353, 284394, 358122, 284397, 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, 284449, 300834, 300832, 317221, 227109, 358183, 186151, 276268, 300845, 194351, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 227314, 276466, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 276539, 235581, 325692, 178238, 276544, 284739, 292934, 243785, 276553, 350293, 350295, 194649, 227418, 309337, 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, 301178, 292989, 292993, 301185, 350339, 317570, 317573, 350342, 227463, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 276713, 317674, 325867, 243948, 194801, 227571, 309491, 276725, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 211241, 325937, 276789, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 285051, 211324, 227709, 285061, 317833, 178572, 285070, 178575, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 317971, 309779, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 318132, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 285453, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277314, 277317, 277322, 277329, 162643, 310100, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 326514, 310134, 15224, 236408, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 276586, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 121850, 302075, 244731, 293882, 293887, 277504, 277507, 277511, 277519, 293908, 277526, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 277608, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 253064, 302218, 285835, 294026, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 285862, 277671, 302248, 64682, 277678, 228526, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 204023, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 228617, 138505, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 294211, 302403, 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, 327046, 253320, 310665, 318858, 277898, 277894, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 277923, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 64966, 245191, 163272, 302534, 310727, 277959, 292968, 302541, 277966, 302543, 277963, 310737, 277971, 277975, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 278003, 310772, 228851, 278006, 40440, 278009, 212472, 40443, 286203, 40448, 228864, 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, 212560, 228944, 400976, 40533, 147032, 40537, 40539, 278109, 40541, 40544, 40548, 40550, 286312, 286313, 40554, 40552, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 278150, 310925, 286354, 278163, 302740, 122517, 278168, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 278227, 286420, 319187, 229076, 286425, 319194, 278235, 301163, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 171774, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 237409, 294776, 360317, 294785, 327554, 40840, 40851, 294803, 188312, 294811, 319390, 294817, 319394, 40865, 294821, 311209, 180142, 294831, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
0b6d3645921ac6b029d77ef2a27eadfa26e89345
13d15c0a27c520f2bee87445137228763e9d20c8
/SFGraphics/SFGraphics/Helpers/ImageHelper.swift
08e96f863b6f3bdcf1b66dfe364209ca419c77b3
[]
no_license
dshartley/Smart.Foundation.Swift.iOS
d12048e9fa94e3ce5af73ae3572cfdcf25d7881d
cc7f97d087d96822963460ceaecd23c98370cc65
refs/heads/main
2023-02-12T18:11:19.151086
2021-01-05T12:30:47
2021-01-05T12:30:47
326,993,053
0
0
null
null
null
null
UTF-8
Swift
false
false
2,103
swift
// // ImageHelper.swift // SFGraphics // // Created by David on 16/11/2017. // Copyright © 2017 com.smartfoundation. All rights reserved. // import UIKit /// A helper for handling images public struct ImageHelper { // MARK: - Initializers private init () {} // MARK: - Public Static Methods public static func resize(image: UIImage, targetSize: CGSize) -> UIImage { let size: CGSize = image.size let widthRatio: CGFloat = targetSize.width / size.width let heightRatio: CGFloat = targetSize.height / size.height // Figure out what our orientation is, and use that to form the rectangle var newSize: CGSize if (widthRatio > heightRatio) { newSize = CGSize(width: size.width * heightRatio, height: size.height * heightRatio) } else { newSize = CGSize(width: size.width * widthRatio, height: size.height * widthRatio) } // This is the rect that we've calculated out and this is what is actually used below let rect: CGRect = CGRect(x: 0, y: 0, width: newSize.width, height: newSize.height) // Actually do the resizing to the rect using the ImageContext UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0) image.draw(in: rect) let newImage: UIImage? = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return newImage! } public static func toJPEGData(image: UIImage) -> Data { var result: Data? = nil result = UIImageJPEGRepresentation(image, 1.0) return result! } public static func toPNGData(image: UIImage) -> Data { var result: Data? = nil result = UIImagePNGRepresentation(image) return result! } public static func imageofColor(color: UIColor) -> UIImage { // Create rect let rect: CGRect = CGRect(x: 0, y: 0, width: 1, height: 1) UIGraphicsBeginImageContextWithOptions(CGSize(width: 1, height: 1), false, 0) color.setFill() UIRectFill(rect) // Create image let image: UIImage = UIGraphicsGetImageFromCurrentImageContext()! UIGraphicsEndImageContext() return image } }
[ -1 ]
8596a85d76105ec4448763ba22c0d2f6da71daca
2c31577b72c5bc17957dc6e4c8847bcad2a5856a
/SLNewsReader/ViewController.swift
02eaebb9f0903b26c1013d56d750e7856d2351ed
[ "MIT" ]
permissive
sakshi235/SLNewsReader
6ce062ac5f23f95f20bb86616279be66d2d8b7f4
6df9c60cc3580a10f420a4f7ddd02d52d740a00c
refs/heads/master
2020-03-27T19:28:03.967349
2018-09-01T13:01:35
2018-09-01T13:01:35
146,990,873
0
0
null
null
null
null
UTF-8
Swift
false
false
560
swift
// // ViewController.swift // SLNewsReader // // Created by SAKSHI TIWARI on 30/08/18. // Copyright © 2018 SAKSHI TIWARI. All rights reserved. // import UIKit import CoreData class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() print("run") } // 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. } }
[ 281924, 279268, 326311, 296811, 292787, 328564, 175832 ]
2cbedb10745df7d43a863a263faa6eafb64ec0e5
c333fcd3cf5ebeb3b033dbe8b5069da9acb8bf47
/Sources/v1/ApiModels/ApiCallbacks.swift
17de19bc7e84bd34e5608fe0e4173f4f1f4f7a3a
[ "Apache-2.0" ]
permissive
tokend/ios-sdk
11303690b01ea59da69034ed1879cd3730408c18
6aff90d20474dcfcac8536a74d7e49e7ff28afb2
refs/heads/master
2023-06-25T10:14:57.218808
2022-03-10T16:59:04
2022-03-10T16:59:04
153,674,582
13
2
Apache-2.0
2022-09-26T14:03:56
2018-10-18T19:09:29
Swift
UTF-8
Swift
false
false
1,216
swift
import Foundation public typealias TFARequiredHandler = ((_ tfaInput: ApiCallbacks.TFAInput, _ cancel: @escaping () -> Void) -> Void) public struct ApiCallbacks { public let onTFARequired: TFARequiredHandler public let onUnathorizedRequest: (_ error: ApiErrors) -> Void // MARK: - public init( onTFARequired: @escaping TFARequiredHandler, onUnathorizedRequest: @escaping (_ error: ApiErrors) -> Void ) { self.onTFARequired = onTFARequired self.onUnathorizedRequest = onUnathorizedRequest } } extension ApiCallbacks { public struct TokenSignData { public let walletId: String public let keychainData: Data public let salt: Data public let token: String public let factorId: Int } public enum TFAInput { case password( tokenSignData: TokenSignData, inputCallback: (_ signedToken: String, _ completion: @escaping () -> Void) -> Void ) case code( type: TFAMetaResponse.CodeBasedType, inputCallback: (_ code: String, _ completion: @escaping () -> Void) -> Void ) } }
[ -1 ]
0629106ea7c32497cae7ceb13e80342c49aa4341
410874101346970f40e1b9398afe3561fa398740
/Gallery/Helpers/DeviceData.swift
1937fcd2a6922072165b5f85cf434276bec58d16
[]
no_license
dimbeard01/Gallery
b0daa25ce0e5819d259989e95179461d1f1c6ae7
2f9a5ac49b79198a72b233cb5356fb0ed3cfbd1d
refs/heads/master
2020-12-07T06:08:13.527997
2020-02-03T18:43:22
2020-02-03T18:43:22
232,654,613
0
0
null
null
null
null
UTF-8
Swift
false
false
3,065
swift
// // DeviceData.swift // Gallery // // Created by Dima Surkov on 08.01.2020. // Copyright © 2020 Dima Surkov. All rights reserved. // import UIKit final class DeviceData { static let shared = DeviceData() func saveImageDocumentDirectory(image: UIImage, imageName: String) { let fileManager = FileManager.default let path = (NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as NSString).appendingPathComponent("galleryImages") if !fileManager.fileExists(atPath: path) { do { try fileManager.createDirectory(atPath: path, withIntermediateDirectories: true, attributes: nil) } catch { print("error of creating Dirctory") } } let url = NSURL(string: path) let imagePath = url!.appendingPathComponent(imageName) let urlString: String = imagePath!.absoluteString guard let imageData = image.jpegData(compressionQuality: 1) else { return } fileManager.createFile(atPath: urlString as String, contents: imageData, attributes: nil) } func getDataDocumentDirectory() -> [[String: UIImage]]? { let fileManager = FileManager.default var contentList: [String] = [] var dataList = [[String: UIImage]]() guard let directoryPath = getDirectoryPath() as NSURL? else { return nil } guard let path = directoryPath.absoluteString else { return nil } do { let content = try fileManager.contentsOfDirectory(atPath: path) contentList = content } catch { print("error of getting content") } contentList.forEach { (key) in guard let imagePath = directoryPath.appendingPathComponent(key) else { return } let urlString: String = imagePath.absoluteString if fileManager.fileExists(atPath: urlString) { guard let image = UIImage(contentsOfFile: urlString) else { return } dataList.append([key: image]) } else { return } } return dataList } func removeImageFromDirectory(with imageName: String) { let fileManager = FileManager.default let yourProjectImagesPath = (NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as NSString).appendingPathComponent("galleryImages/\(imageName)") if fileManager.fileExists(atPath: yourProjectImagesPath) { do { try fileManager.removeItem(atPath: yourProjectImagesPath) } catch { print("error of removing") } } } private func getDirectoryPath() -> NSURL { let path = (NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as NSString).appendingPathComponent("galleryImages") guard let url = NSURL(string: path) else { return NSURL() } return url } }
[ -1 ]
092f3bb5ac9ab84c207c8b751528337f5fe38659
baa4aab4fa2472f4d50cfa90567522cfb56d7a03
/NYTCodeTest/Controllers/ViewController.swift
1d79b7a85a46ec45cf3a27bc6c147d8b748e0d4a
[]
no_license
Olimpia1988/NYTimesCC
2b3dbdfc0ba368764e8d6f77f35cb2c3f5de6917
af10b4fe3f4b0dd4768e4e0f7efd7303b958097d
refs/heads/master
2022-11-18T03:57:00.046767
2020-07-01T00:48:39
2020-07-01T00:48:39
238,266,389
0
0
null
null
null
null
UTF-8
Swift
false
false
131
swift
import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } }
[ 333256, 303917, 315508, 315509, 8028 ]
4f0a4ef1432fbf4e25fb25223f23d4492c15408c
c3062c7353f42ace400d0e2640b38ef1f375149a
/Tests/EnergyKitTests/EnergyKitTests.swift
3b9db49770e380729f62f27495f98c223d188d70
[ "MIT" ]
permissive
MillerTechnologyPeru/EnergyKit
ea2b95ff052e206db5b0001a48b3d926e27ac56f
afed23f1f097e5de6d021ae8392b9ca8aaede53d
refs/heads/master
2021-06-21T16:08:33.105206
2020-07-29T00:58:10
2020-07-29T00:58:10
254,500,802
7
0
null
null
null
null
UTF-8
Swift
false
false
225
swift
import Foundation import XCTest @testable import EnergyKit final class EnergyKitTests: XCTestCase { static let allTests = [ ("testExample", testExample), ] func testExample() { } }
[ -1 ]
179911951a6728d32a4a9990dae6168a2715c5c4
cfe9fc2d7e7de6788c3ed19b99b8ed14bc470da9
/CarouselVu/InitialViewController.swift
f1fe29661d2877e7745ceb12795dd899d50e37c8
[]
no_license
vphamz/CarouselVu
43ad36733003a304909ebb6d6068e631cdfda470
34184ec85d919453aa38008869ff21fb2b4a9913
refs/heads/master
2020-04-10T15:20:03.952307
2015-02-16T04:26:20
2015-02-16T04:26:20
30,853,656
0
0
null
null
null
null
UTF-8
Swift
false
false
5,706
swift
// // InitialViewController.swift // CarouselVu // // Created by Vuhuan Pham on 2/13/15. // Copyright (c) 2015 Vuhuan Pham. All rights reserved. // import UIKit class InitialViewController: UIViewController, UIScrollViewDelegate, UIActionSheetDelegate { @IBOutlet weak var initialScrollView: UIScrollView! @IBOutlet weak var introImage: UIImageView! @IBOutlet weak var intro_tile1: UIImageView! @IBOutlet weak var intro_tile2: UIImageView! @IBOutlet weak var intro_tile3: UIImageView! @IBOutlet weak var intro_tile4: UIImageView! @IBOutlet weak var intro_tile5: UIImageView! @IBOutlet weak var intro_tile6: UIImageView! var scale: CGFloat! = 1.0 var rotate: CGFloat! = 0.0 override func viewDidLoad() { super.viewDidLoad() initialScrollView.delegate = self initialScrollView.contentSize = introImage.frame.size rotateAndMove() // Do any additional setup after loading the view. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // func rotateAndScale() { // var scaleTransform = CGAffineTransformMakeScale(scale, scale) // var rotateTransform = CGAffineTransformMakeDegreeRotation(rotate) // var combinedTransform = CGAffineTransformConcat (scaleTransform, rotateTransform) // bunnyRabbit.transform = combinedTransform // } func scrollViewDidScroll(initialScrollView: UIScrollView) { rotateAndMove() } func rotateAndMove() { rotateAndMove1() rotateAndMove2() rotateAndMove3() rotateAndMove4() rotateAndMove5() rotateAndMove6() } func rotateAndMove1() { var rotateTransform = CGAffineTransformMakeRotation((introImage.frame.size.height/2 - (initialScrollView.contentOffset.y))/(introImage.frame.size.height/2) * 0.3) var moveTransform = CGAffineTransformMakeTranslation(170 - ((170-45)/(introImage.frame.size.height/2)*initialScrollView.contentOffset.y), 400 - ((400-748)/(introImage.frame.size.height/2)*initialScrollView.contentOffset.y)) var combinedTransform = CGAffineTransformConcat(rotateTransform, moveTransform) intro_tile1.transform = combinedTransform } func rotateAndMove2() { var rotateTransform = CGAffineTransformMakeRotation((introImage.frame.size.height/2 - (initialScrollView.contentOffset.y))/(introImage.frame.size.height/2) * 0.6) var moveTransform = CGAffineTransformMakeTranslation(70 - ((70-201)/(introImage.frame.size.height/2)*initialScrollView.contentOffset.y), 500 - ((500-748)/(introImage.frame.size.height/2)*initialScrollView.contentOffset.y)) var combinedTransform = CGAffineTransformConcat(rotateTransform, moveTransform) intro_tile2.transform = combinedTransform } func rotateAndMove3() { var rotateTransform = CGAffineTransformMakeRotation((introImage.frame.size.height/2 - (initialScrollView.contentOffset.y))/(introImage.frame.size.height/2) * -0.5) var moveTransform = CGAffineTransformMakeTranslation(50 - ((50-201)/(introImage.frame.size.height/2)*initialScrollView.contentOffset.y), 470 - ((470-826)/(introImage.frame.size.height/2)*initialScrollView.contentOffset.y)) var combinedTransform = CGAffineTransformConcat(rotateTransform, moveTransform) intro_tile3.transform = combinedTransform } func rotateAndMove4() { var rotateTransform = CGAffineTransformMakeRotation((introImage.frame.size.height/2 - (initialScrollView.contentOffset.y))/(introImage.frame.size.height/2) * 1.2) var moveTransform = CGAffineTransformMakeTranslation(200 - ((200-45)/(introImage.frame.size.height/2)*initialScrollView.contentOffset.y), 380 - ((380-902)/(introImage.frame.size.height/2)*initialScrollView.contentOffset.y)) var combinedTransform = CGAffineTransformConcat(rotateTransform, moveTransform) intro_tile4.transform = combinedTransform } func rotateAndMove5() { var rotateTransform = CGAffineTransformMakeRotation((introImage.frame.size.height/2 - (initialScrollView.contentOffset.y))/(introImage.frame.size.height/2) * 0.8) var moveTransform = CGAffineTransformMakeTranslation(20 - ((20-123)/(introImage.frame.size.height/2)*initialScrollView.contentOffset.y), 390 - ((390-902)/(introImage.frame.size.height/2)*initialScrollView.contentOffset.y)) var combinedTransform = CGAffineTransformConcat(rotateTransform, moveTransform) intro_tile5.transform = combinedTransform } func rotateAndMove6() { var rotateTransform = CGAffineTransformMakeRotation((introImage.frame.size.height/2 - (initialScrollView.contentOffset.y))/(introImage.frame.size.height/2) * -0.2) var moveTransform = CGAffineTransformMakeTranslation(120 - ((120-201)/(introImage.frame.size.height/2)*initialScrollView.contentOffset.y), 450 - ((450-902)/(introImage.frame.size.height/2)*initialScrollView.contentOffset.y)) var combinedTransform = CGAffineTransformConcat(rotateTransform, moveTransform) intro_tile6.transform = combinedTransform } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
2db1d88ee772a024e72361bb87b4d3c71e4a3f36
2d36a02161c8f968f1d83dff8bc7ee95d3e344a6
/iUtility/ModelNumeriCasuali.swift
4d9722bdf83268f9a1e3076c0aaf659e0dc66269
[]
no_license
danXNU/DonBoscoStudents
e041f142a46475233c742fc982a1affba83a0e85
cddd910a0621c2179fe4fd0a07f234a5aa7ffcb5
refs/heads/master
2021-08-30T20:09:02.230255
2017-12-19T08:37:01
2017-12-19T08:37:01
null
0
0
null
null
null
null
UTF-8
Swift
false
false
603
swift
// // ModelNumeriCasuali.swift // iUtility // // Created by Dani Tox on 17/03/17. // Copyright © 2017 Dani Tox. All rights reserved. // import Foundation class NumeriCasualiClass : NSObject { func generaNumero(nMin: UInt32, nMax: UInt32) -> Int { let numeroMinimo = UInt32(nMin) let numeroMassimo = UInt32(nMax) + 1 if numeroMassimo > numeroMinimo { let result = arc4random_uniform((numeroMassimo - numeroMinimo)) + numeroMinimo return Int(result) } else { return -1 } } }
[ -1 ]
835ec5e62b1415a152c303d97ccea336b6c2f506
5d2524ebe6a83362a4ba1edf91c44bcc8336f65f
/Movies/App/Services/Entities/Movie/Entities/Movie.swift
1e7d37a5c2e501ee93223938258bd088f9c93f68
[]
no_license
OmarHuchin/Movies-iOS
6ff7493065cad7c83633414e872e80bb91c266d3
b25b55534a505154a4cc15072728d0c84ef847df
refs/heads/main
2023-01-30T12:48:32.913212
2020-12-07T20:39:47
2020-12-07T20:39:47
319,435,598
0
0
null
null
null
null
UTF-8
Swift
false
false
976
swift
// // PlayMovie.swift // Movies // // Created by Omar Huchin on 05/12/20. // Copyright © 2020 Omar.Huchin. All rights reserved. // import Foundation public struct Movie: Codable{ let adult: Bool? let backdropPath: String? let genreIDS: [Int]? let id: Int? let originalLanguage, originalTitle, overview: String? let popularity: Double? let posterPath, releaseDate, title: String? let video: Bool? let voteAverage: Double? let voteCount: Int? enum CodingKeys: String, CodingKey { case adult case backdropPath = "backdrop_path" case genreIDS = "genre_ids" case id case originalLanguage = "original_language" case originalTitle = "original_title" case overview, popularity case posterPath = "poster_path" case releaseDate = "release_date" case title, video case voteAverage = "vote_average" case voteCount = "vote_count" } }
[ -1 ]
284ba1b6bb6d49c7bd4f50410b76a1ce7748f94f
70a0cd59439d9566c4f5dedd13fc9701b1556b44
/SwiftyBase/Classes/Extensions/UIColorExtension.swift
8415bd9aadb8040c2c1d1dec7d07febebbebcc20
[ "MIT" ]
permissive
mspvirajpatel/SwiftyBase
7249e614df5c9850fe7394ee3434bad315a1b5aa
29d3cbd1bfbdbc0baa2f3f876069a4d686840ac2
refs/heads/master
2023-08-19T00:53:00.735024
2023-05-12T17:11:16
2023-05-12T17:11:16
101,853,218
38
23
MIT
2023-08-23T21:44:40
2017-08-30T07:52:10
Swift
UTF-8
Swift
false
false
2,701
swift
// // UiColor.swift // Pods // // Created by MacMini-2 on 30/08/17. // // import Foundation #if os(macOS) import Cocoa #else import UIKit #endif public extension UIColor { convenience init(rgbValue: Int, alpha: CGFloat) { self.init(red: CGFloat( (rgbValue & 0xFF0000) >> 16 ) / 255.0, green: CGFloat( (rgbValue & 0x00FF00) >> 8 ) / 255.0, blue: CGFloat( (rgbValue & 0x0000FF) >> 0 ) / 255.0, alpha: alpha) } convenience init(rgbValue: Int) { self.init(rgbValue: rgbValue, alpha: 1.0) } func lighterColorForColor() -> UIColor? { var r: CGFloat = 0 var g: CGFloat = 0 var b: CGFloat = 0 var a: CGFloat = 0 if self.getRed(&r, green: &g, blue: &b, alpha: &a) { return UIColor(red: min(r + 0.2, 1.0), green: min(g + 0.2, 1.0), blue: min(b + 0.2, 1.0), alpha: a) } return nil } func darkerColorForColor() -> UIColor? { var r: CGFloat = 0 var g: CGFloat = 0 var b: CGFloat = 0 var a: CGFloat = 0 if self.getRed(&r, green: &g, blue: &b, alpha: &a) { return UIColor(red: max(r - 0.15, 0.0), green: max(g - 0.15, 0.0), blue: max(b - 0.15, 0.0), alpha: a) } return nil } //**************************************/ // Functions //**************************************/ func lighter(by percentage: CGFloat = 30.0) -> UIColor { return self.adjust(by: abs(percentage)) ?? .white } func darker(by percentage: CGFloat = 30.0) -> UIColor { return self.adjust(by: -1 * abs(percentage)) ?? .black } /// Performs an equivalent to the .map({}) function, adjusting the current r, g, b value by the percentage /// /// - Parameter percentage: CGFloat /// - Returns: UIColor or nil if there was an error func adjust(by percentage: CGFloat = 30.0) -> UIColor? { var r:CGFloat=0, g:CGFloat=0, b:CGFloat=0, a:CGFloat=0; if (self.getRed(&r, green: &g, blue: &b, alpha: &a)){ return UIColor(red: min(r + percentage/100, 1.0), green: min(g + percentage/100, 1.0), blue: min(b + percentage/100, 1.0), alpha: a) } else{ return nil } } }
[ -1 ]
817ecd5a9dd43ca373aa411c2fff8aa48c46b3d9
ef92ca707c50295ef0a21428a4f55f59a22ee77b
/ObjectMapper/Core/Map.swift
fda5650f0945fa70427b363e4d2ffb6d17230616
[ "MIT" ]
permissive
Schaltfehler/ObjectMapper
e0df9699c8c15701046ff77af6f44466eab8c173
821f85e790f70f23237e6002dcba4929217f8a7a
refs/heads/master
2020-12-29T00:42:29.118597
2016-03-18T09:41:14
2016-03-18T09:41:14
54,190,198
0
0
MIT
2021-01-04T14:45:08
2016-03-18T09:36:50
Swift
UTF-8
Swift
false
false
5,211
swift
// // Map.swift // ObjectMapper // // Created by Tristan Himmelman on 2015-10-09. // // The MIT License (MIT) // // Copyright (c) 2014-2015 Hearst // // 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 class used for holding mapping data public final class Map { public let mappingType: MappingType public internal(set) var JSONDictionary: [String : AnyObject] = [:] public var currentValue: AnyObject? var currentKey: String? var keyIsNested = false let toObject: Bool // indicates whether the mapping is being applied to an existing object /// Counter for failing cases of deserializing values to `let` properties. private var failedCount: Int = 0 public init(mappingType: MappingType, JSONDictionary: [String : AnyObject], toObject: Bool = false) { self.mappingType = mappingType self.JSONDictionary = JSONDictionary self.toObject = toObject } /// Sets the current mapper value and key. /// The Key paramater can be a period separated string (ex. "distance.value") to access sub objects. public subscript(key: String) -> Map { // save key and value associated to it let nested = key.containsString(".") return self[key, nested: nested] } public subscript(key: String, nested nested: Bool) -> Map { // save key and value associated to it currentKey = key keyIsNested = nested // check if a value exists for the current key if nested == false { currentValue = JSONDictionary[key] } else { // break down the components of the key that are separated by . currentValue = valueFor(ArraySlice(key.componentsSeparatedByString(".")), dictionary: JSONDictionary) } return self } // MARK: Immutable Mapping public func value<T>() -> T? { return currentValue as? T } public func valueOr<T>(@autoclosure defaultValue: () -> T) -> T { return value() ?? defaultValue() } /// Returns current JSON value of type `T` if it is existing, or returns a /// unusable proxy value for `T` and collects failed count. public func valueOrFail<T>() -> T { if let value: T = value() { return value } else { // Collects failed count failedCount += 1 // Returns dummy memory as a proxy for type `T` let pointer = UnsafeMutablePointer<T>.alloc(0) pointer.dealloc(0) return pointer.memory } } /// Returns whether the receiver is success or failure. public var isValid: Bool { return failedCount == 0 } } /// Fetch value from JSON dictionary, loop through keyPathComponents until we reach the desired object private func valueFor(keyPathComponents: ArraySlice<String>, dictionary: [String: AnyObject]) -> AnyObject? { // Implement it as a tail recursive function. if keyPathComponents.isEmpty { return nil } if let keyPath = keyPathComponents.first { let object = dictionary[keyPath] if object is NSNull { return nil } else if let dict = object as? [String : AnyObject] where keyPathComponents.count > 1 { let tail = keyPathComponents.dropFirst() return valueFor(tail, dictionary: dict) } else if let array = object as? [AnyObject] where keyPathComponents.count > 1 { let tail = keyPathComponents.dropFirst() return valueFor(tail, array: array) } else { return object } } return nil } /// Fetch value from JSON Array, loop through keyPathComponents them until we reach the desired object private func valueFor(keyPathComponents: ArraySlice<String>, array: [AnyObject]) -> AnyObject? { // Implement it as a tail recursive function. if keyPathComponents.isEmpty { return nil } //Try to convert keypath to Int as index if let keyPath = keyPathComponents.first, let index = Int(keyPath) where index >= 0 && index < array.count { let object = array[index] if object is NSNull { return nil } else if let array = object as? [AnyObject] where keyPathComponents.count > 1 { let tail = keyPathComponents.dropFirst() return valueFor(tail, array: array) } else if let dict = object as? [String : AnyObject] where keyPathComponents.count > 1 { let tail = keyPathComponents.dropFirst() return valueFor(tail, dictionary: dict) } else { return object } } return nil }
[ 296417, 286375, 115433, 153010, 296371, 282965, 227605, 208118, 141209, 319099 ]
86892aba4975c032fb186d8299dc7b5cfc789c1c
4db6b9e0db2b78a97f57b20271fedf1d9f26fb07
/auth/User+Extensions.swift
afa25fe5fbcf3320e6c03e565205868de0c8257a
[]
no_license
rochabr/muster-point-location
788e49d27cfe0307226ed7e13a19955e086bfd33
d7adaf8b172c29adcb8082ad3d53407970a2100c
refs/heads/main
2023-05-13T11:45:26.158711
2021-05-24T20:02:43
2021-05-24T20:02:43
366,852,105
0
0
null
null
null
null
UTF-8
Swift
false
false
163
swift
// // User+Extensions.swift // muster-point-client // // Created by Rocha Silva, Fernando on 2021-05-13. // import Foundation extension User: Identifiable {}
[ -1 ]
1c7f6ea2b3e92734c76022389ac8b31ea7919e19
30ecaa5387017aceabb1ba099df2f17f8c02a09c
/VoiceRecorderApp/RecordSoundsViewController.swift
c87bb7e048608ddfbd8e311778ba0241a3e31dea
[]
no_license
byRamon/MtwIOS-VoiceRecorderApp
f7ecc07d4282013401289ff0b2822df6932015b6
64e3f391f7caa4c5a7854b1a04bb8ac220beca90
refs/heads/master
2020-12-31T21:20:50.097744
2020-02-13T22:42:57
2020-02-13T22:42:57
239,025,968
1
0
null
null
null
null
UTF-8
Swift
false
false
3,017
swift
// // RecordSoundsViewController.swift // VoiceRecorderApp // // Created by ByRamon on 2/1/20. // Copyright © 2020 ByRamon. All rights reserved. // import UIKit import AVFoundation class RecordSoundsViewController: UIViewController, AVAudioRecorderDelegate { //MARK: Oulets @IBOutlet weak var lblRecording: UILabel! @IBOutlet weak var btnRecord: UIButton! @IBOutlet weak var btnStopRecord: UIButton! var audioRecorder: AVAudioRecorder! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. btnStopRecord.isEnabled = false } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "stopRecording" { let playSoundsVC = segue.destination as! PlaySoundsViewController let recorderAudioUrl = sender as! URL playSoundsVC.recordedAudioURL = recorderAudioUrl } } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) } @IBAction func recordAudio(_ sender: Any) { btnStopRecord.isEnabled = true btnRecord.isEnabled = !btnStopRecord.isEnabled let text = "Recording in progress" lblRecording.text = text let dirPath = NSSearchPathForDirectoriesInDomains(.documentDirectory,.userDomainMask, true)[0] as String let recordingName = "recordedVoice.wav" let pathArray = [dirPath, recordingName] let filePath = URL(string: pathArray.joined(separator: "/")) let session = AVAudioSession.sharedInstance() try! session.setCategory(AVAudioSession.Category.playAndRecord, mode: AVAudioSession.Mode.default, options: AVAudioSession.CategoryOptions.defaultToSpeaker) try! audioRecorder = AVAudioRecorder(url: filePath!, settings: [:]) audioRecorder.delegate = self audioRecorder.isMeteringEnabled = true audioRecorder.prepareToRecord() audioRecorder.record() } @IBAction func stopRecording(_ sender: Any) { btnRecord.isEnabled = true btnStopRecord.isEnabled = !btnRecord.isEnabled let text = "Tap to Record" lblRecording.text = text audioRecorder.stop() let audioSession = AVAudioSession.sharedInstance() try! audioSession.setActive(false) } func audioRecorderDidFinishRecording(_ recorder: AVAudioRecorder, successfully flag: Bool) { if flag{ print(audioRecorder.url) performSegue(withIdentifier: "stopRecording", sender: audioRecorder.url) } else{ print("Recording was not successfull") } } }
[ 336706 ]
7ad6b854c81adeb79810ed79395a6c6f1829ad04
982e65f305fa1d6a80f995c6d578eecd80164aac
/Swift/Reconstruct-Binary-Tree/Tests/Reconstruct-Binary-TreeTests/Reconstruct_Binary_TreeTests.swift
6ad7ec1e00b3bdb459c659851aa38ed1074259fa
[]
no_license
DominatorVbN/VbNCodePlay
9acbeaeab062e86fceeb15848ba0ac2895b62c4f
37c68544c0c5aefdb371997ca03d923e880aa421
refs/heads/master
2022-06-02T09:05:43.114192
2022-05-21T09:03:40
2022-05-21T09:03:40
217,107,616
0
1
null
2022-05-21T09:03:41
2019-10-23T16:48:56
Swift
UTF-8
Swift
false
false
1,477
swift
import XCTest import class Foundation.Bundle final class Reconstruct_Binary_TreeTests: XCTestCase { func testExample() throws { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct // results. // Some of the APIs that we use below are available in macOS 10.13 and above. guard #available(macOS 10.13, *) else { return } // Mac Catalyst won't have `Process`, but it is supported for executables. #if !targetEnvironment(macCatalyst) let fooBinary = productsDirectory.appendingPathComponent("Reconstruct-Binary-Tree") let process = Process() process.executableURL = fooBinary let pipe = Pipe() process.standardOutput = pipe try process.run() process.waitUntilExit() let data = pipe.fileHandleForReading.readDataToEndOfFile() let output = String(data: data, encoding: .utf8) XCTAssertEqual(output, "Hello, world!\n") #endif } /// Returns path to the built products directory. var productsDirectory: URL { #if os(macOS) for bundle in Bundle.allBundles where bundle.bundlePath.hasSuffix(".xctest") { return bundle.bundleURL.deletingLastPathComponent() } fatalError("couldn't find the products directory") #else return Bundle.main.bundleURL #endif } }
[ 315136, 319237, 201351, 222727, 317064, 255884, 245391, 319640, 212380, 323615, 254369, 325414, 333351, 35243, 396343, 315577, 344506, 240316, 372029, 315581, 56640, 377409, 44612, 358469, 165701, 381641, 315593, 370275, 6123, 313325, 316781, 353016, 312945, 211189, 315126, 240503, 343160, 65274, 377340 ]
ccbfed5ca8b55ddebc05f9ee7e0216e0c2e8f620
7febe72b5c0d63e2febf807572b9c6a5702ae7f9
/Aircall/Aircall/AppCoordinator.swift
b81dabeab7f03e906ca56f098d89df48fca92510
[]
no_license
yanisinho/ios-test
bfc9cbb72664436c0b222d9438709398184652eb
c489d48331e136ddda7dca7e61da6eab3c0c89a0
refs/heads/master
2020-06-20T09:03:58.867384
2019-07-16T21:04:11
2019-07-16T21:04:11
197,070,497
0
0
null
2019-07-15T20:49:54
2019-07-15T20:49:54
null
UTF-8
Swift
false
false
4,001
swift
// // AppCoordinator.swift // Aircall // // Created by Yanis SIDAHMED on 16/07/2019. // Copyright © 2019 Yanis SG. All rights reserved. // import Foundation import UIKit import CoreData import Moya /// Application main coordinator. final class AppCoordinator: NSObject, Coordinator { // MARK: - Coordinator /// An array of coordinators that are children of the current coordinator. var childCoordinators = [Coordinator]() /// Current navigation controller. var navigationController: UINavigationController /// Start the current app coordinator. func start() { navigationController.delegate = self navigationController.navigationBar.prefersLargeTitles = true // Configure MoyaProvider. let provider = MoyaProvider<Aircall>( plugins: [NetworkLoggerPlugin(verbose: true)] ) // Configure JSONDecoder let decoder = JSONDecoder() decoder.dateDecodingStrategy = .iso8601 decoder.keyDecodingStrategy = .convertFromSnakeCase let child = CallListCoordinator( navigationController: navigationController, managedObjectContext: managedObjectContext, managedObjectModel: managedObjectModel, provider: provider, decoder: decoder ) child.parentCoordinator = self childCoordinators.append(child) child.start() } // MARK: - CoreData stack /// CoreData managed object context. var managedObjectContext: NSManagedObjectContext /// CoreData managed object model. var managedObjectModel: NSManagedObjectModel // MARK: - Initialization init( navigationController: UINavigationController, managedObjectContext: NSManagedObjectContext, managedObjectModel: NSManagedObjectModel ) { self.navigationController = navigationController self.managedObjectContext = managedObjectContext self.managedObjectModel = managedObjectModel } func childDidFinish(_ child: Coordinator?) { for (index, coordinator) in childCoordinators.enumerated() { if coordinator === child { childCoordinators.remove(at: index) break } } print("💚 [Navigation] AppCoordinators contains \(childCoordinators.count) childs.") } } // MARK: - UINavigationControllerDelegate extension AppCoordinator: UINavigationControllerDelegate { /** Called just before the navigation controller displays a view controller’s view and navigation item properties. - Parameters: - navigationController: The navigation controller that is showing the view and properties of a view controller. - viewController: The view controller whose view and navigation item properties are being shown. - animated: true to animate the transition; otherwise, false. */ func navigationController( _ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool ) { switch viewController { case is CallListViewController: print("CallListViewController") case is CallDetailsViewController: print("CallDetailsViewController") default: print("Unknown view controller") } } /** Called just after the navigation controller displays a view controller’s view and navigation item properties. - Parameters: - navigationController: The navigation controller that is showing the view and properties of a view controller. - viewController: The view controller whose view and navigation item properties are being shown. - animated: true to animate the transition; otherwise, false. */ func navigationController( _ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool ) { guard let fromViewController = navigationController.transitionCoordinator?.viewController(forKey: .from) else { print("didShow from") return } if navigationController.viewControllers.contains(fromViewController) { return } if let activityDetailsViewController = fromViewController as? CallDetailsViewController { print("didShow CallDetailsViewController finished") childDidFinish(activityDetailsViewController.coordinator) } } }
[ -1 ]
846961c34e37c0a2e68c80e3c91b8729439ddd75
acc776eb8323181de75d775d44670b55940c64e6
/Sources/AVWXKit/Models/Translations.swift
71d35f0053e51ebb866b737a74296c46afddf388
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
JanC/AVWXKit
bb825d7fc654898c51ca7bccf0fb960d95776cf8
ef5017dac359c8fb5eafa40a44542bf5b5de7787
refs/heads/master
2023-06-09T14:42:01.260344
2023-06-02T06:41:58
2023-06-02T06:43:08
121,490,692
0
1
MIT
2023-05-21T07:39:53
2018-02-14T09:07:15
Swift
UTF-8
Swift
false
false
664
swift
// // This file is part of AeroNav SDK. // See the file LICENSE.txt for copying permission. // import Foundation public struct Translations: Codable { public let altimeter: String public let clouds: String public let dewpoint: String public let wxCodes: String public let remarks: [String: String] public let temperature: String public let visibility: String public let wind: String private enum CodingKeys: String, CodingKey { case altimeter case clouds case dewpoint case wxCodes = "wx_codes" case remarks case temperature case visibility case wind } }
[ -1 ]
732108c77708be5d401b1d2e8490921d95369d7d
b62728869d67e2670d6da313a7fb9f9ea8a65c94
/TextDetectionStarter/Text Detection Starter Project/ViewController.swift
b5d315f17319303d538b081f386196b00e2f2cd5
[]
no_license
y-okudera/iOS-Vision-AVCapture
87830109140c266806c58a53c42e9758d4123cb4
4cf9aa6c91b05e7eba133258d09fc925b0eb35bf
refs/heads/master
2020-04-05T10:24:23.151690
2018-11-07T15:28:28
2018-11-07T15:28:28
null
0
0
null
null
null
null
UTF-8
Swift
false
false
10,361
swift
// // ViewController.swift // Text Detection Starter Project // // import UIKit import AVFoundation import Vision class ViewController: UIViewController { @IBOutlet weak var imageView: UIImageView! private var session = AVCaptureSession() private let stillImageOutput = AVCapturePhotoOutput() private var request = [VNRequest]() private var lastObservation: VNRectangleObservation? private var sequenceHandler = VNSequenceRequestHandler() private var rectangleLayer: CAShapeLayer? private var pathLayer: CALayer? private lazy var cameraButton: UIButton = { let button = UIButton() button.layer.cornerRadius = 10.0 let x = imageView.bounds.width / 2 - 25 let y = imageView.bounds.height + 25 button.frame = CGRect(x: x, y: y, width: 100, height: 50) button.setTitle("Capture", for: .normal) button.setTitleColor(UIColor.blue, for: .normal) button.addTarget(self, action: #selector(capturePhoto), for: .touchUpInside) return button }() override func viewDidLoad() { super.viewDidLoad() startLiveVideo() stillImageSetting() startTextDetection() view.addSubview(cameraButton) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) } override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() imageView.layer.sublayers?[0].frame = imageView.bounds } @objc private func capturePhoto() { print("Capture Capture") let photoSettings = AVCapturePhotoSettings() photoSettings.isAutoStillImageStabilizationEnabled = true photoSettings.isHighResolutionPhotoEnabled = true photoSettings.flashMode = .auto stillImageOutput.capturePhoto(with: photoSettings, delegate: self) } } // MARK: - AVCapturePhotoCaptureDelegate extension ViewController: AVCapturePhotoCaptureDelegate { func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) { let imageData = photo.fileDataRepresentation() guard let data = imageData, let photo = UIImage(data: data) else { return } let handleVC = HandlePhotoViewController.make(photo: photo) navigationController?.pushViewController(handleVC, animated: true) } @objc private func processVision() { print("Do Vision and Cut busniess card") } } extension ViewController: AVCaptureVideoDataOutputSampleBufferDelegate { private func stillImageSetting() { stillImageOutput.isHighResolutionCaptureEnabled = true session.addOutput(stillImageOutput) } private func startLiveVideo() { session.sessionPreset = AVCaptureSession.Preset.photo let captureDevice = AVCaptureDevice.default(for: .video) let deviceInput = try! AVCaptureDeviceInput(device: captureDevice!) let deviceOutput = AVCaptureVideoDataOutput() deviceOutput.videoSettings = [kCVPixelBufferPixelFormatTypeKey as String: Int(kCVPixelFormatType_32BGRA)] deviceOutput.setSampleBufferDelegate(self, queue: DispatchQueue.global(qos: DispatchQoS.QoSClass.default)) session.addInput(deviceInput) session.addOutput(deviceOutput) let imageLayer = AVCaptureVideoPreviewLayer(session: session) imageLayer.frame = imageView.bounds imageView.layer.addSublayer(imageLayer) session.startRunning() } private func startTextDetection() { let objectRequest = VNDetectRectanglesRequest(completionHandler: self.detectObjectHandler) // let textRequest = VNDetectTextRectanglesRequest(completionHandler: self.detectTextHandler) // textRequest.reportCharacterBoxes = true objectRequest.maximumObservations = 4 objectRequest.minimumConfidence = 0.6 objectRequest.minimumAspectRatio = 0.3 self.request = [objectRequest] } private func detectObjectHandler(request:VNRequest, error: Error?) { guard let req = request.results else { print("no result") return } let result = req.map({ $0 as? VNRectangleObservation}) DispatchQueue.main.async { if result.isEmpty { self.cameraButton.setTitle("looking", for: .normal) self.cameraButton.setTitleColor(UIColor.lightGray, for: .normal) self.cameraButton.isEnabled = false } else { self.cameraButton.setTitle("Capture", for: .normal) self.cameraButton.setTitleColor(UIColor.blue, for: .normal) self.cameraButton.isEnabled = true } self.imageView.layer.sublayers?.removeSubrange(1...) let drawLayer = self.imageView.layer self.draw(rectangles: result as! [VNRectangleObservation], onImageWithBounds: drawLayer.bounds) drawLayer.setNeedsDisplay() } } private func detectTextHandler(request: VNRequest, error: Error?) { guard let observation = request.results else { print("no result") return } let result = observation.map({$0 as? VNTextObservation}) DispatchQueue.main.async { self.imageView.layer.sublayers?.removeSubrange(1...) for region in result { guard let myRegion = region else { continue } self.highlightWord(box: myRegion) if let boxes = region?.characterBoxes { for characterBox in boxes { self.highlightLetters(box: characterBox) } } } } } private func highlightWord(box: VNTextObservation) { guard let boxes = box.characterBoxes else { return } var maxX: CGFloat = 9999.0 var minX: CGFloat = 0.0 var maxY: CGFloat = 9999.0 var minY: CGFloat = 0.0 for char in boxes { if char.bottomLeft.x < maxX { maxX = char.bottomLeft.x } if char.bottomRight.x > minX { minX = char.bottomRight.x } if char.bottomRight.y < maxY { maxY = char.bottomRight.y } if char.topRight.y > minY { minY = char.topRight.y } } } private func highlightLetters(box: VNRectangleObservation) { let xCord = box.topLeft.x * imageView.frame.size.width let yCord = (1 - box.topLeft.y) * imageView.frame.size.height let width = (box.topRight.x - box.bottomLeft.x) * imageView.frame.size.width let height = (box.topLeft.y - box.bottomLeft.y) * imageView.frame.size.height let outline = CALayer() outline.frame = CGRect(x: xCord, y: yCord, width: width, height: height) outline.borderWidth = 1.0 outline.borderColor = UIColor.blue.cgColor imageView.layer.addSublayer(outline) } func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) { guard let pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) else { return } var requestOptions: [VNImageOption : Any] = [:] if let cameraIntrinsicData = CMGetAttachment(sampleBuffer, kCMSampleBufferAttachmentKey_CameraIntrinsicMatrix, nil) { requestOptions = [.cameraIntrinsics: cameraIntrinsicData] } let imageRequestHandler = VNImageRequestHandler(cvPixelBuffer: pixelBuffer, orientation: CGImagePropertyOrientation(rawValue: 6)!, options: requestOptions) do { try imageRequestHandler.perform(self.request) } catch { print(error) } } } // MARK: - Helper Method extension ViewController { // Rectangles are RED. private func draw(rectangles: [VNRectangleObservation], onImageWithBounds bounds: CGRect) { CATransaction.begin() for observation in rectangles { let rectBox = boundingBox(forRegionOfInterest: observation.boundingBox, withinImageBounds: bounds) let rectLayer = shapeLayer(color: .red, frame: rectBox) // Add to pathLayer on top of image. self.imageView.layer.addSublayer(rectLayer) } CATransaction.commit() } private func boundingBox(forRegionOfInterest: CGRect, withinImageBounds bounds: CGRect) -> CGRect { let imageWidth = bounds.width let imageHeight = bounds.height // Begin with input rect. var rect = forRegionOfInterest // Reposition origin. rect.origin.x *= imageWidth rect.origin.x += bounds.origin.x rect.origin.y = (1 - rect.origin.y) * imageHeight + bounds.origin.y // Rescale normalized coordinates. rect.size.width *= imageWidth rect.size.height *= imageHeight return rect } private func shapeLayer(color: UIColor, frame: CGRect) -> CAShapeLayer { // Create a new layer. let layer = CAShapeLayer() // Configure layer's appearance. layer.fillColor = nil // No fill to show boxed object layer.shadowOpacity = 0 layer.shadowRadius = 0 layer.borderWidth = 2 // Vary the line color according to input. layer.borderColor = color.cgColor // Locate the layer. layer.anchorPoint = .zero layer.frame = frame layer.masksToBounds = true // Transform the layer to have same coordinate system as the imageView underneath it. layer.transform = CATransform3DMakeScale(1, -1, 1) return layer } } extension CGPoint { func scaled(to size: CGSize) -> CGPoint { return CGPoint(x: self.x * size.width, y: self.y * size.height) } }
[ -1 ]
46ee27875025d5d1d2b9e28c2eb16b0b54a0fcc3
4a7fa683528295ee0d8efa543affd94c47666270
/The Set Game v1/SetGame.swift
8952b49f4c0d1973b724612f73de9d7e1d1cf6c2
[]
no_license
z0ltrik/The-Set-Game-v1
d2ea2fc9ddf2ef10a0522978e102355326360518
98191e099ab8fe1bbd122d065611cd6e202b1e20
refs/heads/master
2021-05-12T18:49:02.583593
2018-01-11T08:57:56
2018-01-11T08:57:56
117,075,042
0
0
null
null
null
null
UTF-8
Swift
false
false
8,622
swift
// // SetGame.swift // The Set Game v1 // // Created by sealucky on 26.12.2017. // Copyright © 2017 sealucky. All rights reserved. // import Foundation struct Game{ // Колода для игры - 81 карта в нашем случае private var allGameCards = [Card]() // Карты, с которыми игрок взаимодействует на экране var cardsInGame = [Card]() // Минимальное количество карт на экране, при условии, что в колоде есть неиспользованные карты private let minCardsOnTheScreen = 12 // Карты, выбранные играком private var selectedCards = [Card]() // Геттер для получения индексов, выбранных карт var selectedCardsIndeces: [Int] { var array = [Int]() for card in selectedCards{ array.append(cardsInGame.index(of: card)!) } return array } // Индекс следующей карты из колоды private var indexOfNextCard = 0 // Индекс последней карты в колоде private var lastCardIndex: Int { return allGameCards.count-1 } // Признак, что мы угадали Сет private(set) var itIsSet: Bool?{ didSet{ if itIsSet != nil { if itIsSet!{ gameScore += GamePoints.defaultPointsForMatching setsFoundQuantity += 1 } else { gameScore += GamePoints.pointsForMissMatch } } } } private(set) var gameScore = 0 private(set) var iPhoneScore = 0 private(set) var setsFoundQuantity = 0 var cardsLeftInDeck: Int { get{ return allGameCards.count - indexOfNextCard } } struct GamePoints{ static let defaultPointsForMatching = 3 static let pointsForMissMatch = -5 static let pointsForFindSetPressingOrDeal3MoreCardsIfSetExists = -10 } init() { // Создадим колоду for shape in 1...3{ for color in 1...3{ for texture in 1...3{ for number in 1...3{ let newCard = Card(shape: shape, color: color, texture: texture, number: number) allGameCards.append(newCard) } } } } // Перемешаем, чтобы игра была интереснее allGameCards.shuffle() } // Инициализация новой игры mutating func startNewGame(){ allGameCards.shuffle() indexOfNextCard = 0 gameScore = 0 iPhoneScore = 0 setsFoundQuantity = 0 cardsInGame.removeAll() addCards(quantity: 12) selectedCards.removeAll() } // Добавление карт в игру mutating func addCards(quantity: Int){ for _ in 1...quantity{ if let newCard = getNewCard(){ cardsInGame.append(newCard) } } } mutating func addMoreCards(quantity: Int){ findTheSet() selectedCards.removeAll() addCards(quantity: quantity) } // Получение очередной карты из колоды mutating func getNewCard() -> Card?{ // Если все карты из колоды уже использованы, то добавлять нечего if indexOfNextCard > lastCardIndex { return nil } // Возьмем следующую карту let newCard = allGameCards[indexOfNextCard] // Сдвинем индекс последней использованной карты колоды indexOfNextCard += 1 return newCard } // Обработка карт из угаданного Сета mutating func replaceSelectedCardsWithNewCards(){ // Пройдемся по выделеннным картам, они же и составляют Сет for selectedCard in selectedCards { // Получим индекс карты из выбранных карт if var indexOfSelectedCard = cardsInGame.index(of: selectedCard){ // Брать новые карты из колоды, нужно только, если на экране не более 12 карт if cardsInGame.count <= minCardsOnTheScreen{ // Получим новую карту if let newCard = getNewCard(){ // Вставим новую карту по тому же индексу, что и удаленная cardsInGame.insert(newCard, at: indexOfSelectedCard) // Старая карта теперь сдвинулась на 1 позицию дальше indexOfSelectedCard+=1 } } // Удалим выделенную и попавшую в Сет карту из карт в игре cardsInGame.remove(at: indexOfSelectedCard) } } // очистим выделенные карты selectedCards.removeAll() } // Обработка выбора карты на экране mutating func chooseCardAndCheckSet(at index: Int){ // Сбросим флаг угаданного Сета itIsSet = nil // Если до этого уже было выделено 3 карты, сбросим их выделение, т.к. по услвоию игры выделить можно только 3 карты if selectedCards.count == 3 { selectedCards.removeAll() } let touchedCard = cardsInGame[index] // Если выбранная на экране карта ранее не была выделена, то добавим ее в выделенные if !selectedCards.contains(touchedCard){ selectedCards.append(touchedCard) } else { // тут мы точно знаем, что карта touchedCard есть в массиве, поэтому получим ее индекс, чтобы удалить - сделать невыделенной карту let indexOfTouchedCard = selectedCards.index(of: touchedCard)! selectedCards.remove(at: indexOfTouchedCard) } // если выбрано 3 карты, необходимо проверить Сет if selectedCards.count == 3{ itIsSet = selectedCards[0].isInSet(with: selectedCards[1], and: selectedCards[2]) } } // Поиск первого попавшегося Сета из карт на экране mutating func findTheSet(){ itIsSet = nil selectedCards.removeAll() var setIsFound = false gameLoop: for firstCardIndex in 0..<cardsInGame.count-2{ for secondCardIndex in firstCardIndex+1..<cardsInGame.count-1{ for thirdCardIndex in secondCardIndex+1..<cardsInGame.count{ setIsFound = cardsInGame[firstCardIndex].isInSet(with: cardsInGame[secondCardIndex], and: cardsInGame[thirdCardIndex]) if setIsFound { gameScore += GamePoints.pointsForFindSetPressingOrDeal3MoreCardsIfSetExists // Добавим карты найденного Сета в выделенные карты selectedCards.append(cardsInGame[firstCardIndex]) selectedCards.append(cardsInGame[secondCardIndex]) selectedCards.append(cardsInGame[thirdCardIndex]) break gameLoop } } } } } } extension Int { var randomInt: Int { if self > 0 { return Int(arc4random_uniform(UInt32(self))) }else if self < 0 { return Int(arc4random_uniform(UInt32(abs(self)))) }else{ return 0 } } } extension Array{ mutating func shuffle(){ if count < 2 {return} var last = count-1 while last > 0 { let randomIndex = last.randomInt swapAt(last, randomIndex) last -= 1 } } }
[ -1 ]
bb5bf7bc66f780635d0e9b1877504573691cf326
1854a0b2202792a26cc74088dd5187133328b895
/RemindersViewController.swift
cdacc3ced57b16de7ae7ef9202e44ae4afd1d9bb
[]
no_license
ericlove02/PreMD-App
8047cdf3830db268a882bbc45c43917802899973
6c2818c9c6909bda65e500c8c0a1146cd80277f3
refs/heads/main
2023-06-30T11:21:55.859841
2021-08-05T02:01:07
2021-08-05T02:01:07
392,864,733
0
0
null
null
null
null
UTF-8
Swift
false
false
1,296
swift
// // RemindersViewController.swift // PreMD // // Created by Eric Love on 8/2/19. // Copyright © 2019 Eric Love. All rights reserved. // import Foundation import UIKit var list = ["Swipe Left To Delete Items"] class RemindersViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { @IBOutlet weak var ReminderTable: UITableView! public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return (list.count) } public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = UITableViewCell(style: UITableViewCell.CellStyle.default, reuseIdentifier: "cell") cell.textLabel?.text = list[indexPath.row] return(cell) } func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == UITableViewCell.EditingStyle.delete { list.remove(at: indexPath.row) ReminderTable.reloadData() } } override func viewDidAppear(_ animated: Bool){ ReminderTable.reloadData() } override func viewDidLoad() { super.viewDidLoad() } }
[ -1 ]
d7572d0fad709459c55ba7c6500a0b93d3481b9e
7cf40076efefc3a05c32cb00e2cfe993159cc59c
/catan/CommentBodyView.swift
938f4831706ea9ea2c43c933d9b4fae865a5c46d
[]
no_license
parti-coop/catan-ios-app
669edf48f0a4afa36ba3f624d0a8684ea6115fed
6acb9a247ffa9c8042208928d44d9bd336018715
refs/heads/master
2021-08-24T00:57:37.237626
2017-12-07T10:26:04
2017-12-07T10:26:04
null
0
0
null
null
null
null
UTF-8
Swift
false
false
5,174
swift
// // PostTitleAndBodyView.swift // catan // // Created by Youngmin Kim on 2017. 8. 25.. // Copyright © 2017년 Parti. All rights reserved. // import UIKit import BonMot class CommentBodyView: UITextView { static let heightCache = HeightCache() var forceWidth = CGFloat(0) { didSet { if comment != nil { fatalError("데이터가 지정되기 전에 폭을 설정해야 합니다") } } } static let bodyFontPointSize = Style.font.defaultNormal.pointSize var comment: Comment? { didSet { if let comment = comment, let attributedText = comment.bodyAttributedText { self.attributedText = attributedText } else{ self.attributedText = nil } setNeedsLayout() } } static func buildBodyText(_ comment: Comment) -> NSAttributedString? { let commentBodyHtml = buildSmartHtmlString(comment.body, fontSize: CommentView.bodyFontPointSize) ?? "" if let commentBodyData = commentBodyHtml.data(using: String.Encoding.unicode, allowLossyConversion: true) { if let commentBodyText = try? NSMutableAttributedString(data: commentBodyData, options: [ .documentType: NSAttributedString.DocumentType.html ], documentAttributes: nil) { let result = buildUserNicknameText(comment) + commentBodyText let textRange = NSMakeRange(0, result.length) let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineSpacing = 2 paragraphStyle.paragraphSpacing = 0 paragraphStyle.paragraphSpacingBefore = 14 result.addAttribute(NSAttributedStringKey.paragraphStyle, value: paragraphStyle, range: textRange) return result.trimText() } } return nil } static fileprivate func buildUserNicknameText(_ comment: Comment) -> NSAttributedString { return (comment.user.nickname + " ").styled( with: Style.string.defaultBold, .color(.brand_primary)) } static fileprivate func buildSmartHtmlString(_ text: String, fontSize: CGFloat) -> String? { var parsedText = text.trimmingCharacters(in: .whitespacesAndNewlines) if parsedText.isEmpty { return nil } // 맨 마지막에 공백 라인을 방지하기 위해 맨 끝에 더미로 빈 라인을 둔다 let pTag = "</p>" let lastToken = String(parsedText.suffix(pTag.count)) if lastToken == pTag { let start = parsedText.index(parsedText.endIndex, offsetBy: -1 * (pTag.count)) let end = parsedText.endIndex parsedText.replaceSubrange(start..<end, with: "<br></p>") } return "<div style=\"font-family: '-apple-system', 'HelveticaNeue'; font-size: \(fontSize)px;\">\(parsedText)</div>" } public init() { super.init(frame: .zero, textContainer: nil) backgroundColor = .clear isEditable = false isScrollEnabled = false textContainerInset = .zero textContainer.lineFragmentPadding = 0 linkTextAttributes = [ NSAttributedStringKey.foregroundColor.rawValue: UIColor.app_link, NSAttributedStringKey.underlineColor.rawValue: UIColor.clear ] } required public init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func layoutSubviews() { super.layoutSubviews() invalidateIntrinsicContentSize() } override var intrinsicContentSize: CGSize { if comment == nil || forceWidth <= 0 { return super.intrinsicContentSize } let height = estimateIntrinsicContentHeight() return CGSize(width: forceWidth, height: height) } fileprivate func estimateIntrinsicContentHeight() -> CGFloat { let height = CommentBodyView.estimateHeight(comment: self.comment, width: forceWidth) return height > 0 ? height + 1: CGFloat(0) } static fileprivate func redundantBottomPaddingHeight(comment: Comment?) -> CGFloat { guard let comment = comment, !comment.body.isBlank() else { return 0 } return CommentBodyView.bodyFontPointSize } static func estimateHeight(comment: Comment?, width: CGFloat) -> CGFloat { guard let comment = comment else { return CGFloat(0) } if let cached = heightCache.height(for: comment, onWidth: width) { return cached } guard let bodyAttributedText = comment.bodyAttributedText else { return CGFloat(0) } let textHeight = bodyAttributedText.heightWithConstrainedWidth(width: width) let height = max(textHeight - redundantBottomPaddingHeight(comment: comment) + 1, CGFloat(0)) heightCache.setHeight(height, for: comment, onWidth: width) return height } }
[ -1 ]
db2a0214351d55ac5972b5c0722e4d1d42250d9b
9e1821f260f101e0404442c765f33c5a91739afc
/ChatroomUITests/ChatroomUITests.swift
decb4ec8a2247dbd6b0aca9e8dc15aa96a407eaa
[]
no_license
Skyced/mobile_chatroom
5372545cdcbaa7ac8a013e158c03219ad54486f4
8ad069728e54d08519deb3cf90b1423b6528fa68
refs/heads/master
2021-01-10T15:42:21.381799
2015-11-23T16:33:18
2015-11-23T16:33:18
46,733,374
0
0
null
null
null
null
UTF-8
Swift
false
false
1,244
swift
// // ChatroomUITests.swift // ChatroomUITests // // Created by cedric jo on 11/12/15. // Copyright © 2015 cedric jo. All rights reserved. // import XCTest class ChatroomUITests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. XCUIApplication().launch() // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } }
[ 155665, 237599, 229414, 278571, 229425, 229431, 180279, 319543, 213051, 286787, 237638, 311373, 278607, 196687, 311377, 368732, 180317, 278637, 319599, 278642, 131190, 131199, 278669, 278676, 311447, 327834, 278684, 278690, 311459, 278698, 278707, 278713, 180409, 295099, 139459, 131270, 229591, 147679, 311520, 147680, 319719, 295147, 286957, 319764, 278805, 311582, 278817, 311596, 336177, 98611, 278843, 287040, 319812, 311622, 319816, 229716, 278895, 287089, 139641, 311679, 311692, 106893, 156069, 311723, 377265, 311739, 319931, 278974, 336319, 311744, 278979, 336323, 278988, 278992, 279000, 279009, 369121, 188899, 279014, 319976, 279017, 311787, 319986, 279030, 311800, 279033, 279042, 287237, 377352, 279053, 303634, 303635, 279060, 279061, 279066, 279092, 377419, 303693, 115287, 189016, 287319, 295518, 287327, 279143, 279150, 287345, 287348, 189054, 303743, 287359, 164487, 279176, 311944, 344714, 311948, 311950, 311953, 287379, 336531, 295575, 303772, 205469, 221853, 279207, 295591, 295598, 279215, 279218, 164532, 287412, 287418, 303802, 66243, 287434, 287438, 279249, 303826, 369365, 369366, 279253, 230105, 295653, 230120, 279278, 312046, 230133, 279293, 205566, 295688, 312076, 295698, 221980, 336678, 262952, 279337, 262953, 262957, 164655, 328495, 303921, 230198, 295745, 222017, 279379, 295769, 230238, 230239, 279393, 303973, 279398, 295797, 295799, 279418, 336765, 287623, 279434, 320394, 189327, 189349, 279465, 304050, 189373, 213956, 345030, 213961, 279499, 304086, 304104, 123880, 320492, 320495, 287730, 320504, 214009, 312313, 312315, 312317, 328701, 328705, 418819, 320520, 230411, 320526, 238611, 140311, 238617, 197658, 336930, 132140, 189487, 312372, 238646, 238650, 320571, 336962, 238663, 296023, 205911, 156763, 214116, 230500, 279659, 238706, 230514, 312435, 279666, 279686, 222344, 337037, 296091, 238764, 279729, 148674, 312519, 279752, 148687, 189651, 279766, 189656, 279775, 304352, 304353, 279780, 279789, 279803, 320769, 312588, 320795, 320802, 304422, 312628, 345398, 222523, 181568, 279872, 279874, 304457, 230730, 345418, 337228, 296269, 222542, 238928, 296274, 230757, 296304, 312688, 230772, 337280, 296328, 296330, 304523, 9618, 279955, 148899, 279979, 279980, 173492, 279988, 280003, 370122, 280011, 337359, 329168, 312785, 222674, 329170, 280020, 280025, 239069, 320997, 280042, 280043, 329198, 337391, 296434, 288248, 288252, 312830, 230922, 304655, 329231, 230933, 222754, 312879, 230960, 288305, 239159, 157246, 288319, 288322, 280131, 124486, 288328, 239192, 345697, 312937, 312941, 206447, 288377, 337533, 280193, 239238, 288391, 239251, 280217, 198304, 337590, 280252, 296636, 280253, 321217, 280259, 321220, 239305, 280266, 296649, 9935, 313042, 280279, 18139, 280285, 321250, 337638, 181992, 288492, 34547, 67316, 313082, 288508, 288515, 280326, 116491, 280333, 124691, 116502, 321308, 321309, 280367, 280373, 280377, 321338, 280381, 345918, 280386, 280391, 280396, 18263, 370526, 296807, 296815, 313200, 313204, 124795, 280451, 67464, 305032, 124816, 214936, 337816, 239515, 214943, 313257, 288698, 214978, 280517, 280518, 214983, 231382, 329696, 190437, 313322, 329707, 174058, 296942, 124912, 313338, 239610, 182277, 313356, 305173, 223269, 354342, 354346, 313388, 124974, 215095, 288829, 288835, 313415, 239689, 354386, 329812, 223317, 354394, 321632, 280676, 313446, 215144, 288878, 288890, 215165, 329884, 215204, 125108, 280761, 223418, 280767, 338118, 280779, 321744, 280792, 280803, 182503, 338151, 125166, 125170, 395511, 313595, 125180, 125184, 125192, 125197, 125200, 125204, 338196, 125215, 125225, 338217, 321839, 125236, 280903, 289109, 379224, 239973, 313703, 280938, 321901, 354671, 199030, 223611, 248188, 313726, 240003, 158087, 313736, 240020, 190870, 190872, 289185, 305572, 289195, 338359, 289229, 281038, 281039, 281071, 322057, 182802, 322077, 289328, 338491, 322119, 281165, 281170, 281200, 313970, 297600, 289435, 314020, 248494, 166581, 314043, 363212, 158424, 322269, 338658, 289511, 330473, 330476, 289517, 215790, 125683, 199415, 289534, 322302, 35584, 322312, 346889, 264971, 322320, 166677, 207639, 281378, 289580, 289599, 281407, 281426, 281434, 322396, 281444, 207735, 314240, 158594, 330627, 240517, 289691, 240543, 289699, 289704, 289720, 289723, 281541, 19398, 191445, 183254, 183258, 207839, 314343, 183276, 289773, 248815, 240631, 330759, 322571, 330766, 281647, 322609, 314437, 207954, 339031, 314458, 281698, 281699, 322664, 314493, 150656, 347286, 330912, 339106, 306339, 249003, 208044, 322733, 3243, 339131, 290001, 339167, 298209, 290030, 208123, 322826, 126229, 298290, 208179, 159033, 216387, 372039, 224591, 331091, 314708, 150868, 314711, 314721, 281958, 314727, 134504, 306541, 314740, 314742, 290170, 224637, 306558, 290176, 306561, 314752, 314759, 298378, 314765, 314771, 306580, 224662, 282008, 314776, 282013, 290206, 314788, 298406, 282023, 314790, 241067, 314797, 306630, 306634, 339403, 191980, 282097, 306678, 191991, 290304, 323079, 323083, 323088, 282132, 282135, 175640, 282147, 306730, 290359, 323132, 282182, 224848, 224852, 290391, 306777, 282214, 224874, 314997, 290425, 339579, 282244, 282248, 323208, 323226, 282272, 282279, 298664, 298666, 306875, 282302, 323262, 323265, 282309, 306891, 241360, 282321, 241366, 282330, 282336, 12009, 282347, 282349, 323315, 200444, 282366, 249606, 282375, 323335, 282379, 216844, 118549, 282390, 282399, 241440, 282401, 339746, 315172, 216868, 241447, 282418, 282424, 282428, 413500, 241471, 315209, 159563, 307024, 307030, 241494, 307038, 282471, 282476, 339840, 315265, 282503, 315272, 315275, 184207, 282517, 298912, 118693, 298921, 126896, 200628, 282572, 282573, 323554, 298987, 282634, 241695, 315431, 102441, 315433, 102446, 282671, 241717, 307269, 233548, 315468, 315477, 200795, 323678, 315488, 315489, 45154, 307306, 233578, 241809, 323730, 299166, 233635, 299176, 184489, 323761, 184498, 258233, 299197, 299202, 176325, 299208, 282832, 356575, 307431, 184574, 217352, 282908, 299294, 282912, 233761, 282920, 315698, 332084, 282938, 307514, 127292, 168251, 323914, 201037, 282959, 250196, 168280, 323934, 381286, 242027, 242028, 250227, 315768, 291193, 291194, 315769, 291200, 242059, 315798, 291225, 242079, 283039, 299449, 291266, 283088, 283089, 176602, 242138, 160224, 291297, 242150, 283138, 233987, 324098, 340489, 283154, 291359, 283185, 234037, 340539, 332379, 111197, 242274, 291455, 316044, 184974, 316048, 316050, 340645, 176810, 299698, 291529, 225996, 135888, 242385, 299737, 234216, 234233, 242428, 291584, 299777, 291591, 291605, 283418, 234276, 283431, 242481, 234290, 201534, 283466, 201562, 234330, 275294, 349025, 357219, 177002, 308075, 242540, 201590, 177018, 308093, 291713, 340865, 299912, 316299, 234382, 308111, 308113, 209820, 283551, 177074, 127945, 340960, 234469, 340967, 324587, 234476, 201721, 234499, 234513, 316441, 300087, 21567, 308288, 160834, 349254, 300109, 234578, 250965, 250982, 234606, 300145, 300147, 234626, 234635, 177297, 308375, 324761, 119965, 234655, 300192, 234662, 300200, 324790, 300215, 283841, 283846, 283849, 316628, 251124, 234741, 283894, 316661, 292092, 234756, 242955, 177420, 292145, 300342, 333114, 333115, 193858, 300355, 300354, 234830, 283990, 357720, 300378, 300379, 316764, 292194, 284015, 234864, 316786, 243073, 292242, 112019, 234902, 333224, 284086, 259513, 284090, 54719, 415170, 292291, 300488, 300490, 234957, 144862, 300526, 308722, 300539, 210429, 292359, 218632, 316951, 374297, 235069, 349764, 194118, 292424, 292426, 333389, 349780, 128600, 235096, 300643, 300645, 243306, 325246, 333438, 235136, 317102, 300725, 300729, 333508, 333522, 325345, 153318, 333543, 284410, 284425, 300810, 300812, 284430, 161553, 284436, 325403, 341791, 325411, 186148, 186149, 333609, 284460, 300849, 325444, 153416, 325449, 317268, 325460, 341846, 284508, 300893, 284515, 276326, 292713, 292719, 325491, 333687, 317305, 317308, 333700, 325508, 243590, 243592, 325514, 350091, 350092, 350102, 333727, 333734, 219046, 284584, 292783, 300983, 153553, 292835, 6116, 292838, 317416, 325620, 333827, 243720, 292901, 325675, 243763, 325695, 333902, 227432, 194667, 284789, 284790, 292987, 227459, 194692, 235661, 333968, 153752, 284827, 333990, 284840, 284843, 227517, 309443, 227525, 301255, 227536, 301270, 301271, 325857, 334049, 317676, 309504, 194832, 227601, 325904, 334104, 211239, 334121, 317738, 325930, 227655, 383309, 391521, 285031, 416103, 227702, 211327, 227721, 227730, 285074, 317851, 293275, 285083, 227743, 285089, 293281, 301482, 375211, 334259, 293309, 317889, 326083, 129484, 326093, 285152, 195044, 334315, 236020, 293368, 317949, 342537, 309770, 334345, 342560, 293420, 236080, 23093, 244279, 244280, 301635, 309831, 55880, 301647, 326229, 309847, 244311, 244326, 301688, 244345, 301702, 334473, 326288, 227991, 285348, 318127, 285360, 293552, 285362, 342705, 154295, 342757, 285419, 170735, 342775, 375552, 228099, 285443, 285450, 326413, 285457, 285467, 326428, 318247, 203560, 293673, 318251, 301872, 285493, 285496, 301883, 342846, 293702, 318279, 244569, 301919, 293729, 351078, 310132, 228214, 269179, 228232, 416649, 252812, 293780, 310166, 277404, 310177, 293801, 326571, 326580, 326586, 359365, 211913, 56270, 203758, 277493, 293894, 293911, 326684, 113710, 318515, 203829, 277600, 285795, 228457, 318571, 187508, 302202, 285819, 285823, 285833, 285834, 318602, 228492, 162962, 187539, 326803, 285850, 302239, 302251, 294069, 294075, 64699, 228541, 343230, 310496, 228587, 302319, 228608, 318732, 318746, 245018, 130342, 130344, 130347, 286012, 294210, 286019, 294220, 318804, 294236, 327023, 327030, 310650, 179586, 294278, 368012, 318860, 318876, 343457, 245160, 286128, 286133, 310714, 302523, 228796, 302530, 228804, 310725, 302539, 310731, 310735, 327122, 310747, 286176, 187877, 310758, 40439, 286201, 359931, 286208, 245249, 228868, 302602, 294413, 359949, 302613, 302620, 245291, 310853, 286281, 196184, 212574, 204386, 204394, 138862, 310896, 294517, 286344, 179853, 286351, 188049, 229011, 179868, 229021, 302751, 245413, 212649, 286387, 286392, 302778, 286400, 212684, 302798, 286419, 294621, 294629, 286457, 286463, 319232, 278273, 278292, 278294, 286507, 294699, 319289, 237397, 188250, 237411, 327556, 188293, 311183, 294806, 294808, 319393, 294820, 294824, 343993, 98240, 294849, 24531, 294887, 278507, 311277, 327666, 278515 ]
95d08b78536ebfc2e88ea3603f8d1d5db628f17d
df6581b140a558850bbf1d180d4181ae2e679664
/Pitch Perfect/PlaySoundsViewController.swift
908a591709405ad66d2dd571e5b9fb4e5c1a6296
[]
no_license
sknutti/nd-ios-pitch-perfect
aaf0c9509362334a793687b1326131803595b2e0
256c30201188f6259fa1cbf7ccd8a2b7303f4f80
refs/heads/master
2021-01-10T03:21:36.110959
2017-01-19T18:18:21
2017-01-19T18:18:21
46,528,182
0
0
null
null
null
null
UTF-8
Swift
false
false
4,462
swift
// // PlaySoundsViewController.swift // Pitch Perfect // // Created by Scott Knutti on 11/19/15. // Copyright © 2015 Scott Knutti. All rights reserved. // import UIKit import AVFoundation class PlaySoundsViewController: UIViewController { var audioPlayer: AVAudioPlayer! var receivedAudio: RecordedAudio! var audioEngine:AVAudioEngine! var audioFile:AVAudioFile! override func viewDidLoad() { super.viewDidLoad() do { try audioPlayer = AVAudioPlayer(contentsOf: receivedAudio.filePathUrl as URL) } catch let error as NSError { showAlert("\(error.localizedDescription)") } audioPlayer.enableRate = true audioEngine = AVAudioEngine() do { try audioFile = AVAudioFile(forReading: receivedAudio.filePathUrl as URL) } catch let error as NSError { showAlert("\(error.localizedDescription)") } } @IBAction func playSlowAudio(_ sender: UIButton) { playAudio(0.5) } @IBAction func playFastAudio(_ sender: UIButton) { playAudio(2.0) } @IBAction func playChipmunkAudio(_ sender: UIButton) { playAudioWithVariablePitch(1000) } @IBAction func playDarthVaderAudio(_ sender: UIButton) { playAudioWithVariablePitch(-1000) } @IBAction func stopAudio(_ sender: UIButton) { stopAllAudio() } @IBAction func playEchoAudio(_ sender: UIButton) { stopAllAudio() let audioPlayerNode = AVAudioPlayerNode() audioEngine.attach(audioPlayerNode) let echoEffect = AVAudioUnitDelay() echoEffect.delayTime = TimeInterval(0.3) audioEngine.attach(echoEffect) audioEngine.connect(audioPlayerNode, to: echoEffect, format: nil) audioEngine.connect(echoEffect, to: audioEngine.outputNode, format: nil) audioPlayerNode.scheduleFile(audioFile, at: nil, completionHandler: nil) do { try audioEngine.start() } catch let error as NSError { showAlert("\(error.localizedDescription)") } audioPlayerNode.play() } @IBAction func playReverbAudio(_ sender: UIButton) { stopAllAudio() let audioPlayerNode = AVAudioPlayerNode() audioEngine.attach(audioPlayerNode) let reverbEffect = AVAudioUnitReverb() reverbEffect.loadFactoryPreset(.cathedral) reverbEffect.wetDryMix = 50 audioEngine.attach(reverbEffect) audioEngine.connect(audioPlayerNode, to: reverbEffect, format: nil) audioEngine.connect(reverbEffect, to: audioEngine.outputNode, format: nil) audioPlayerNode.scheduleFile(audioFile, at: nil, completionHandler: nil) do { try audioEngine.start() } catch let error as NSError { showAlert("\(error.localizedDescription)") } audioPlayerNode.play() } func stopAllAudio() { audioPlayer.stop() audioEngine.stop() audioEngine.reset() } func playAudio(_ playRate: Float) { stopAllAudio() audioPlayer.rate = playRate audioPlayer.currentTime = 0.0 audioPlayer.play() } func playAudioWithVariablePitch(_ pitch: Float) { stopAllAudio() let audioPlayerNode = AVAudioPlayerNode() audioEngine.attach(audioPlayerNode) let changePitchEffect = AVAudioUnitTimePitch() changePitchEffect.pitch = pitch audioEngine.attach(changePitchEffect) audioEngine.connect(audioPlayerNode, to: changePitchEffect, format: nil) audioEngine.connect(changePitchEffect, to: audioEngine.outputNode, format: nil) audioPlayerNode.scheduleFile(audioFile, at: nil, completionHandler: nil) do { try audioEngine.start() } catch let error as NSError { showAlert("\(error.localizedDescription)") } audioPlayerNode.play() } func showAlert(_ message: String) { let alert = UIAlertController(title: "Alert", message: message, preferredStyle: UIAlertControllerStyle.alert) alert.addAction(UIAlertAction(title: "Click", style: UIAlertActionStyle.default, handler: nil)) self.present(alert, animated: true, completion: nil) } }
[ -1 ]
8175b9054354c09897f06b5b58548b6ee60ea2f6
b7de779ec5ad814e7fd4cf4e7f5abf459c4468c8
/orlando-red-light-cameras/Services/DataService.swift
19f3c3af9e795686f840803af14402a068fb19a7
[ "MIT" ]
permissive
WERUreo/orlando-red-light-cameras
f192391e70a52028b0b3c0149ee2ab94607aa810
17817fee3e7edf5d58ad268647c265115ec64c59
refs/heads/master
2021-01-20T22:31:39.576418
2016-05-31T22:26:21
2016-05-31T22:26:21
60,090,759
0
0
null
null
null
null
UTF-8
Swift
false
false
1,160
swift
// // DataService.swift // orlando-red-light-cameras // // Created by Keli'i Martin on 5/31/16. // Copyright © 2016 Code for Orlando. All rights reserved. // import Foundation import Alamofire import SwiftyJSON struct DataService { static let sharedInstance = DataService() func getRedLightCameras(completion: (cameras: [RedLightCamera]) -> Void) { let camerasUrlString = "https://brigades.opendatanetwork.com/resource/5gyy-dfem.json" var cameras = [RedLightCamera]() Alamofire.request(.GET, camerasUrlString).validate().responseJSON { response in switch response.result { case .Success: if let value = response.result.value { let json = JSON(value) for (_, subJson) in json { let camera = RedLightCamera(json: subJson) cameras.append(camera) } completion(cameras: cameras) } case .Failure(let error): print(error) } } } }
[ -1 ]