blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
625
content_id
stringlengths
40
40
detected_licenses
listlengths
0
47
license_type
stringclasses
2 values
repo_name
stringlengths
5
116
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
643 values
visit_date
timestamp[ns]
revision_date
timestamp[ns]
committer_date
timestamp[ns]
github_id
int64
80.4k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
16 values
gha_event_created_at
timestamp[ns]
gha_created_at
timestamp[ns]
gha_language
stringclasses
85 values
src_encoding
stringclasses
7 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
1 class
length_bytes
int64
4
6.44M
extension
stringclasses
17 values
content
stringlengths
4
6.44M
duplicates
listlengths
1
9.02k
41b4c2a4965878032a5f520fb5aedafc46510a6c
b252359c3bcb592ee383ea8dc5467da5076d113f
/Smack/Service/UserSessionManager.swift
0e37d250dbb2561083cf6ff0b74402a94ec0112a
[]
no_license
jlheriniaina/Smack
952c459c38bd6e8edac3f7f070b3eb22bd51d5f8
665d7f304e7c232aad24c72d4d361fc36c724061
refs/heads/master
2020-04-16T09:38:03.248897
2019-01-19T20:10:03
2019-01-19T20:10:03
165,471,306
0
0
null
null
null
null
UTF-8
Swift
false
false
1,948
swift
// // UserSessionManager.swift // Smack // // Created by lucas on 15/01/2019. // Copyright © 2019 lucas. All rights reserved. // import Foundation class UserSessionManager { private var KEY_USER_EMAIL = "email" private var KEY_USER_LOGIN = "loginIn" private var KEY_USER_TOKEN = "token" private var KEY_AVATAR_IMAGE = "avatar" private var userDefault = UserDefaults.standard private var KEY_USER = "user" static var instance = UserSessionManager() func getToken() -> String { return userDefault.value(forKey: KEY_USER_TOKEN) as! String } func getIslogin() -> Bool { return userDefault.bool(forKey: KEY_USER_LOGIN) } func getEmail() -> String { return userDefault.value(forKey: KEY_USER_EMAIL) as! String } func setIsLogin(isLogin: Bool) { userDefault.set(isLogin, forKey: KEY_USER_LOGIN) } func setEmail(email: String) { userDefault.set(email, forKey: KEY_USER_EMAIL) } func setToken(token: String) { userDefault.set(token, forKey: KEY_USER_TOKEN) } func setAvatar(avatar: String) { userDefault.set(avatar, forKey: KEY_AVATAR_IMAGE) } func getAvatar() -> String? { return userDefault.value(forKey: KEY_AVATAR_IMAGE) as? String } func isLoginUser(data : [String: AnyObject]){ userDefault.set(data, forKey: KEY_USER) } func getIsLoginUser() -> [String: AnyObject] { return userDefault.value(forKey: KEY_USER) as! [String: AnyObject] } func logout() { userDefault.removeObject(forKey: KEY_USER) userDefault.removeObject(forKey: KEY_AVATAR_IMAGE) userDefault.removeObject(forKey: KEY_USER_EMAIL) userDefault.removeObject(forKey: KEY_USER_TOKEN) setIsLogin(isLogin: false) MessageService.instance.clearChannel() MessageService.instance.clearMessage() } }
[ -1 ]
b2417b6323327be53296c472e6d89be76f159797
aa780dbd749fdd1bceb78c67b482988924b5dc1a
/iOS/Code/Swift/bugTrap/bugTrapKit/Trackers/DoneDone/UI/DoneDoneLoginViewController.swift
d38f744d4795473ca6a1f0b12b12a96602d9433b
[ "MIT" ]
permissive
colbylwilliams/bugtrap
a4828658bb7e3a71be5dc9c8ff267f83ba751993
0903b64530868c31e8faef64a081229b0543b2e4
refs/heads/master
2020-04-14T04:35:46.644729
2015-09-29T03:24:20
2015-09-29T03:24:20
40,223,618
2
0
null
null
null
null
UTF-8
Swift
false
false
3,954
swift
// // BtSettingsLoginViewController.swift // bugTrap // // Created by Colby L Williams on 6/30/14. // Copyright (c) 2014 bugTrap. All rights reserved. // import UIKit class DoneDoneLoginViewController: TrackerLoginController { @IBOutlet var SubdomainField: UITextField! @IBOutlet var UsernameField: UITextField! @IBOutlet var PasswordField: UITextField! @IBOutlet var ActivityIndicator: UIActivityIndicatorView! override var trackerType : TrackerType { get { return TrackerType.DoneDone } } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) SubdomainField.becomeFirstResponder() } override func populatePlaceholderLabels(showPlaceholders: Bool) { SubdomainField.placeholder = showPlaceholders ? DataKeys.Subdomain.string : "" UsernameField.placeholder = showPlaceholders ? DataKeys.UserName.string : "" PasswordField.placeholder = showPlaceholders ? DataKeys.Password.string : "" } override func keychainDataLoaded(storedData: Dictionary<DataKeys, String>) { if let subdomain = storedData[DataKeys.Subdomain] { SubdomainField.text = subdomain } if let username = storedData[DataKeys.UserName] { UsernameField.text = username } if let password = storedData[DataKeys.Password] { PasswordField.text = password } } func textFieldShouldReturn(textField: UITextField!) -> Bool { if textField == SubdomainField { UsernameField.becomeFirstResponder() } if textField == UsernameField { PasswordField.becomeFirstResponder() } if textField == PasswordField { PasswordField.resignFirstResponder() validateValuesAndLogin() } return false } func validateValuesAndLogin() { if !SubdomainField.hasText() { SubdomainField.becomeFirstResponder() return } if !UsernameField.hasText() { UsernameField.becomeFirstResponder() return } if !PasswordField.hasText() { PasswordField.becomeFirstResponder() return } ActivityIndicator.startAnimating() ActivityIndicator.hidden = false let trackerData = [DataKeys.Subdomain: SubdomainField.text!, DataKeys.UserName: UsernameField.text!, DataKeys.Password: PasswordField.text!] // store the data in the keychain keychain.StoreKeyValues(trackerData) let dataValid = TrackerService.Shared.setCurrentTrackerType(.DoneDone) if !dataValid { Log.error("DoneDoneLoginViewController invalid data", trackerData) return } //var tracker = TrackerService.Shared.getTrackerInstance(TrackerType.DoneDone) TrackerService.Shared.currentTracker?.authenticate(data: trackerData) { authResult in switch authResult { case let .Error(error): // failure if error.domain == HttpStatus.type { let message = "Unable to login to DoneDone with the information provided\n" + ((error.code == HttpStatus.Unauthorized.rawValue || error.code == HttpStatus.PaymentRequired.rawValue) ? "\nReview Username & Password\nthen try again" : error.code == HttpStatus.NotFound.rawValue ? "\nReview Subdomain then try again" : "") let errorDialog = UIAlertController(title: "Error", message: message, preferredStyle: UIAlertControllerStyle.Alert) errorDialog.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Cancel, handler: nil)) self.presentViewController(errorDialog, animated: true) { let trackerData = [DataKeys.Subdomain: "", DataKeys.UserName: "", DataKeys.Password: ""] // clear the data in the keychain self.keychain.StoreKeyValues(trackerData) } } case .Value(_): // This isn't right self.presentingViewController?.dismissViewControllerAnimated(true, completion: nil) } self.ActivityIndicator.stopAnimating() } } }
[ -1 ]
a15dd7690233570cc3cbc159a19f42122b565e7e
3485f762097c8a8c5c7302f24705085a508455ae
/RxSwiftLesson/Views/VideoRecord/PreviewView.swift
42ce5798c5b47334d2faa133764dd59a09032303
[]
no_license
bcsgarcia/RxSwiftLesson
86ff67f742cf812574ff8e82bd9454bc9ad8a17b
9d3251ecba9272493d3dbc80dd9e30c7f9927a53
refs/heads/master
2020-09-08T23:31:58.612527
2019-11-19T17:41:38
2019-11-19T17:41:38
221,276,452
0
0
null
null
null
null
UTF-8
Swift
false
false
954
swift
// // PreviewView.swift // RxSwiftLesson // // Created by ctw00701 on 19/11/2019. // Copyright © 2019 Bruno Garcia. All rights reserved. // import UIKit import AVFoundation class PreviewView: UIView { var videoPreviewLayer: AVCaptureVideoPreviewLayer { guard let layer = layer as? AVCaptureVideoPreviewLayer else { fatalError("Expected `AVCaptureVideoPreviewLayer` type for layer. Check PreviewView.layerClass implementation.") } return layer } override class var layerClass: AnyClass { return AVCaptureVideoPreviewLayer.self } } extension Bundle { var applicationName: String { if let name = object(forInfoDictionaryKey: "CFBundleDisplayName") as? String { return name } else if let name = object(forInfoDictionaryKey: "CFBundleName") as? String { return name } return "-" } }
[ -1 ]
86c59c7fab6eaaae167a244fdf87276b4a95e54b
2116be83185b8ff62b9adf792e3972a8a2eb9586
/Magic 8 Ball/AppDelegate.swift
1b776e53182849dafcdf84482e75368d53e4dc36
[]
no_license
theador0691/Magic-8-Ball
e78ab3647db964a700c120c7597d868056351779
2fd731f8e24d8783227c993e9f7c8bbb801e8b51
refs/heads/master
2021-09-05T13:59:29.400264
2018-01-28T14:11:20
2018-01-28T14:11:20
119,262,768
0
0
null
null
null
null
UTF-8
Swift
false
false
2,183
swift
// // AppDelegate.swift // Magic 8 Ball // // Created by Andrew Taylor on 28/01/2018. // Copyright © 2018 Andrew Taylor. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 327695, 229391, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 204856, 229432, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 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, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 320007, 287238, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 311850, 279082, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 189040, 172660, 287349, 189044, 189039, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 287371, 279178, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 287390, 303773, 172705, 287394, 172707, 303780, 164509, 287398, 205479, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303981, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 304007, 304009, 213895, 304011, 230284, 304013, 295822, 189325, 213902, 189329, 295825, 304019, 189331, 279438, 58262, 304023, 304027, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 230413, 197645, 295949, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 132165, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 230679, 320792, 230681, 296215, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 279929, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 288154, 337306, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 148946, 222676, 288212, 288214, 370130, 280021, 329177, 288217, 288218, 280027, 288220, 239070, 239064, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 402969, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 370279, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 337732, 280388, 304968, 280393, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 275606, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 280819, 157940, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 215387, 354653, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 436684, 281045, 281047, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 330244, 240132, 223752, 150025, 338440, 281095, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 182929, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 240519, 183184, 289687, 240535, 224151, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 420829, 281567, 289762, 322534, 297961, 183277, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 380226, 298306, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 298365, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 290325, 282133, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282255, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 323330, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 298822, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 282481, 110450, 315251, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 44948, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 290739, 241588, 282547, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 323763, 184503, 176311, 307385, 307386, 258235, 307388, 176316, 307390, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 323854, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 282957, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 291226, 242075, 283033, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 291254, 283062, 127417, 291260, 127421, 127424, 299457, 127429, 127431, 127434, 315856, 176592, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 127494, 283142, 127497, 233994, 135689, 127500, 291341, 233998, 127506, 234003, 127509, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 299740, 242396, 201444, 299750, 283368, 234219, 283372, 185074, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 234246, 226056, 291593, 234248, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 316294, 201603, 226182, 308105, 234375, 226185, 234379, 324490, 234384, 234388, 234390, 226200, 234393, 209818, 308123, 234396, 324504, 324508, 234398, 291742, 234401, 291747, 291748, 234405, 291750, 324518, 324520, 234407, 324522, 234410, 291756, 291754, 226220, 324527, 234414, 234417, 201650, 324531, 291760, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 234437, 226239, 226245, 234439, 234443, 291788, 234446, 193486, 193488, 234449, 275406, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 234585, 275545, 242777, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 324757, 234647, 226453, 234648, 234650, 308379, 275608, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 349451, 177424, 275725, 283917, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 136562, 324978, 333178, 275834, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 300448, 144807, 144810, 144812, 284076, 144814, 227426, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 292414, 284223, 284226, 284228, 243268, 292421, 284231, 226886, 128584, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 284249, 276052, 276053, 300638, 284251, 284255, 284253, 284258, 243293, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 276095, 284288, 292479, 284290, 325250, 284292, 292485, 276098, 292481, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 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, 178006, 317271, 284502, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 317332, 358292, 284564, 399252, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 276402, 358326, 161718, 358330, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 292839, 276455, 350186, 292843, 276460, 178161, 227314, 276466, 325624, 350200, 276472, 317435, 276476, 276479, 350210, 276482, 178181, 317446, 276485, 350218, 276490, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 178224, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 243779, 325700, 284739, 292934, 243785, 276553, 350293, 350295, 309337, 227418, 350299, 194649, 350302, 194654, 350304, 178273, 309346, 227423, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 301163, 350313, 350316, 227430, 301167, 276583, 350321, 276590, 284786, 276595, 350325, 252022, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 194708, 350357, 350359, 350362, 350366, 276638, 153765, 284837, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 309491, 227571, 309494, 243960, 227583, 276735, 227587, 276739, 211204, 276742, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 129486, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 293346, 227810, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 301636, 318020, 301639, 301643, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 318132, 342707, 154292, 277173, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 56045, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 293696, 310080, 277317, 293706, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 276579, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 244731, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 384302, 285999, 277804, 113969, 277807, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 146765, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 245191, 64966, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 302614, 302617, 286233, 302621, 286240, 146977, 187936, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 245288, 310831, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 302764, 278188, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 188252, 237409, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
6cefeb02a9edef7489af1ffcfeece930396f5d2c
ef824a4e61a4e297dfc669cbefaacc696aaa3299
/GithubSearch/Skeleton/UILayer/TableAndCollectionHelpers.swift
381209e688f6c1a3ab12121f8a4940c05208c914
[]
no_license
MKorchak/GithubSearch
5dc32d0dda63338180ec4617d5287bef0e3dcc38
65e2333f45978096fa2964874205e864a1745b68
refs/heads/master
2020-04-18T18:39:16.394256
2019-01-28T08:04:31
2019-01-28T08:04:31
167,690,783
0
0
null
null
null
null
UTF-8
Swift
false
false
6,128
swift
// // ReusableProtocol.swift // lico // // Created by Krizhanovskii on 9/22/16. // Copyright © 2016 k.krizhanovskii. All rights reserved. // import Foundation import UIKit /// This protocols and extension helps to fastes work with TableView and collcetionView /// For fast setup cell design /// - no need to add cell in storyboard or xib. /// - need register from code ///EXAMPLE: /* // registe cell func registerCells() { self.tableView.register(SWPartnersLinksCell.self) } // get cell let cell = tableView.dequeueReusableCell(forIndexPath: indexPath) as SWPartnersLinksCell */ /// RegisterCellProtocol view protocol helps to resiter cell for table view or colection view public protocol RegisterCellProtocol { func configure() // optional. } /// optional func configure public extension RegisterCellProtocol { public func configure() {} } /// return String ident fron self name public extension RegisterCellProtocol where Self: UIView { public static var reuseIdentifier: String { return String(describing: self) } public static var nibName: String { return String(describing: self) } } public protocol RegisterHeaderFooterViewProtocol: RegisterCellProtocol {} /// Register and dequeue cell from table public extension UITableView { /// reload table with saving content position public func reloadDataWithSaveContentOffset() { let contentOffset = self.contentOffset self.reloadData() self.layoutIfNeeded() self.setContentOffset(contentOffset, animated: false) } /// Register cell /// /// - Parameter _: UITableViewCell.Type that conform RegisterCellProtocol public func register<T: UITableViewCell>(_: T.Type) where T: RegisterCellProtocol { self.register(T.self, forCellReuseIdentifier: T.reuseIdentifier) } /// Register several cell /// /// - Parameter _: UITableViewCell.Type that conform RegisterCellProtocol public func register<T: UITableViewCell>(_ cells : [T.Type]) where T: RegisterCellProtocol { cells.forEach { (cell) in self.register(cell) } } /// Register cell with NIB name. Nib name must be equal to ClassName. /// /// - Parameter _: UITableViewCell.Type that conform RegisterCellProtocol public func registerNib<T: UITableViewCell>(_: T.Type) where T: RegisterCellProtocol { let bundle = Bundle(for: T.self) guard (bundle.path(forResource: T.nibName, ofType: "nib") != nil) else { fatalError("Could not find xib with name: \(T.nibName)") } self.register(UINib(nibName:T.nibName, bundle: bundle), forCellReuseIdentifier: T.reuseIdentifier) } public func register<T: UITableViewCell, Z: UITableViewCell>(_: T.Type, withNib:Z.Type) where T: RegisterCellProtocol, Z: RegisterCellProtocol { let bundle = Bundle(for: T.self) guard (bundle.path(forResource: Z.nibName, ofType: "nib") != nil) else { fatalError("Could not find xib with name: \(T.nibName)") } Log.info.log("REGISTER WITH IDENT \(T.reuseIdentifier)") self.register(UINib(nibName:Z.nibName, bundle: bundle), forCellReuseIdentifier: T.reuseIdentifier) } /// Dequeue cell. CellClass must confrom RegisterCellProtocol /// /// - Parameter indexPath: indexPath /// - Returns: UITableViewCell type public func dequeueReusableCell<T: UITableViewCell>(forIndexPath indexPath: IndexPath) -> T where T: RegisterCellProtocol { guard let cell = dequeueReusableCell(withIdentifier: T.reuseIdentifier, for: indexPath) as? T else { Log.error.log(dequeueReusableCell(withIdentifier: T.reuseIdentifier, for: indexPath)) fatalError("Could not dequeue cell with identifier: \(T.reuseIdentifier)") } return cell } public func register<T: UITableViewHeaderFooterView>(_: T.Type) where T: RegisterHeaderFooterViewProtocol { self.register(T.self, forHeaderFooterViewReuseIdentifier: T.reuseIdentifier) } public func register<T: UITableViewHeaderFooterView>(_ views : [T.Type]) where T: RegisterHeaderFooterViewProtocol { views.forEach { (view) in self.register(view) } } public func registerNib<T: UITableViewHeaderFooterView>(_: T.Type) where T: RegisterHeaderFooterViewProtocol { let bundle = Bundle(for: T.self) guard (bundle.path(forResource: T.nibName, ofType: "nib") != nil) else { fatalError("Could not find xib with name: \(T.nibName)") } self.register(UINib(nibName: T.nibName, bundle: bundle), forHeaderFooterViewReuseIdentifier: T.reuseIdentifier) } public func dequeueReusableHeaderFooterView<T: UITableViewHeaderFooterView>() -> T where T: RegisterHeaderFooterViewProtocol { guard let view = dequeueReusableHeaderFooterView(withIdentifier: T.reuseIdentifier) as? T else { fatalError("Could not dequeue headerFooter with identifier: \(T.reuseIdentifier)") } return view } } /// Register and dequeue cell from colection public extension UICollectionView { public func register<T: UICollectionViewCell>(_: T.Type) where T: RegisterCellProtocol { self.register(T.self, forCellWithReuseIdentifier: T.reuseIdentifier) } public func registerNib<T: UICollectionViewCell>(_: T.Type) where T: RegisterCellProtocol { let bundle = Bundle(for: T.self) guard (bundle.path(forResource: T.nibName, ofType: "nib") != nil) else { fatalError("Could not find xib with name: \(T.nibName)") } self.register(UINib(nibName: T.nibName, bundle: bundle), forCellWithReuseIdentifier: T.reuseIdentifier) } public func dequeueReusableCell<T: UICollectionViewCell>(forIndexPath indexPath: IndexPath) -> T where T: RegisterCellProtocol { guard let cell = dequeueReusableCell(withReuseIdentifier: T.reuseIdentifier, for: indexPath) as? T else { fatalError("Could not dequeue cell with identifier: \(T.reuseIdentifier)") } return cell } }
[ -1 ]
0f65d8adf7e110038b280fe85b5b573dcbc8657c
b1fa6830daf3929400883b600651549609521aa8
/Register/Model/DataService.swift
b510935e273d69e39805a434b0b3d83673aee150
[]
no_license
dangduycuong/Register
373657e7a295279c34e6c111a6fcffc3944d793b
adc730cea67c0c6fdfb7c2f06edffa467f4a032b
refs/heads/master
2020-05-16T03:27:05.778109
2019-04-22T14:44:40
2019-04-22T14:44:40
182,717,978
0
0
null
null
null
null
UTF-8
Swift
false
false
2,303
swift
// // DataService.swift // Register // // Created by duycuong on 4/22/19. // Copyright © 2019 duycuong. All rights reserved. // import UIKit typealias JSON = Dictionary<AnyHashable, Any> class DataService { static var shared = DataService() var _dataCities: [City]? var dataCities: [City] { get { if _dataCities == nil { getDataCity(fileName: "Cities") } return _dataCities ?? [] } set { _dataCities = newValue } } //Get data city func getDataCity(fileName: String) -> [City] { _dataCities = [] guard let pathCity = Bundle.main.path(forResource: fileName, ofType: "plist") else { return [] } guard let dictCity = NSDictionary.init(contentsOfFile: pathCity) else { return [] } guard let citiesJon = dictCity["Cities"] as? [JSON] else { return [] } for cityDictionary in citiesJon { if let city = City(dictionary: cityDictionary) { print(city.name, city.cityCode) _dataCities?.append(city) } } return _dataCities ?? [] } private var _dataDistrits: [District]? var dataDistrict: [District] { get { if _dataDistrits == nil { getDataCity(fileName: "Districts") } return _dataDistrits ?? [] } set { _dataDistrits = newValue } } // Get data District func getDataDistrict(fileName: String) -> [District] { _dataDistrits = [] guard let pathDistrict = Bundle.main.path(forResource: fileName, ofType: "plist") else { return [] } guard let dictDistrict = NSDictionary.init(contentsOfFile: pathDistrict) as? JSON else { return [] } guard let districtJson = dictDistrict["Districts"] as? [JSON] else { return [] } for districtDictionary in districtJson { if let district = District(dictionary: districtDictionary) { print(district.name, district.cityCode, district.districtCode) _dataDistrits?.append(district) } } return _dataDistrits ?? [] } }
[ -1 ]
0b98ea915454220bce487ff07bbb08bcaee7fcc1
606013b1b46985722e652c77139c73909d145754
/TMDb Movies/Model/Remind.swift
48ea2ec15f288e75bee8c26d7484ba65922fd4f2
[]
no_license
YanXian73/TMDb_Movies
2c480ce7d905d374947e86a70a49801616cc513e
eb5e5c4f5fb087f32678c3ddff263a8ae0996ee1
refs/heads/master
2023-08-12T23:01:11.989044
2021-09-12T15:42:03
2021-09-12T15:42:03
399,709,646
0
0
null
null
null
null
UTF-8
Swift
false
false
227
swift
// // Remind.swift // MyTicketStub // // Created by 吳彥賢 on 2021/8/9. // import Foundation import CoreData class Remind : NSManagedObject { @NSManaged var remind : String? @NSManaged var movieName: String? }
[ -1 ]
29a4bb91e566f168a32856dbfb7b861eb7045738
c560e1b5321ef902688b7262a3f633c8cc8d782e
/Todoey/Controller/TodoListViewController.swift
6574ec6a6c9870b1cbd88e96f45d2c7c5c8bd901
[]
no_license
FadyMagdySamy/ToDoey
4ac66b84e77ee329a69706cbb7d941a5f6c983a8
00108a7be1c51a1be1ccd93d2998e9a073a65053
refs/heads/master
2023-03-05T11:44:04.333695
2021-02-20T23:02:01
2021-02-20T23:02:01
340,771,316
0
0
null
null
null
null
UTF-8
Swift
false
false
6,437
swift
// // ViewController.swift // Todoey // // Created by Fady Magdy on 2/14/21. // Copyright © 2021 App Brewery. All rights reserved. // import UIKit import CoreData import ChameleonFramework class TodoListViewController: swipeTableViewController { @IBOutlet weak var searchBar: UISearchBar! var itemArray = [Item]() var selectedCategory : Category?{ didSet{ loadItems() } } let dataFilePath = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. tableView.separatorStyle = .none searchBar.delegate = self } override func viewDidAppear(_ animated: Bool) { if let hexColour = selectedCategory?.color{ title = selectedCategory!.name guard let navBar = navigationController?.navigationBar else {fatalError("navigation Bar doesn't exist") } if let navBarColour = UIColor(hexString: hexColour){ navBar.backgroundColor = navBarColour navBar.tintColor = ContrastColorOf(navBarColour, returnFlat: true) // searchBar.barTintColor = navBarColour navBar.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor: ContrastColorOf(navBarColour, returnFlat: true)] } } } //MARK: - tableView DataSource Methods override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return itemArray.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = super.tableView(tableView, cellForRowAt: indexPath) let item = itemArray[indexPath.row] cell.textLabel?.text = item.title if let colour = UIColor(hexString: selectedCategory!.color!)?.darken(byPercentage: CGFloat(indexPath.row) / CGFloat(itemArray.count)) { cell.backgroundColor = colour cell.textLabel?.textColor = ContrastColorOf(colour, returnFlat: true) } cell.accessoryType = item.done ? .checkmark : .none return cell } //MARK: - tableView Delegate Methods override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { itemArray[indexPath.row].done = !itemArray[indexPath.row].done //delete items /* context.delete(itemArray[indexPath.row]) self.itemArray.remove(at: indexPath.row) */ self.saveItems() //updating title // itemArray[indexPath.row].setValue("completed", forKey: "title") // self.saveItems() tableView.reloadData() tableView.deselectRow(at: indexPath, animated: true) } //MARK: - delete from swipe override func updateModel(at indexPath : IndexPath){ context.delete(itemArray[indexPath.row]) itemArray.remove(at: indexPath.row) self.saveItems() tableView.reloadData() } //MARK: - save items @IBAction func addButtonPressed(_ sender: UIBarButtonItem) { var textField = UITextField() let alert = UIAlertController(title: "add new todoey item", message: "", preferredStyle: .alert) let action = UIAlertAction(title: "add item", style: .default) { (action) in if let t = textField.text { let newItem = Item(context: self.context) newItem.title = t newItem.done = false newItem.parentCategory = self.selectedCategory self.itemArray.append(newItem) self.saveItems() self.tableView.reloadData() } } alert.addAction(action) alert.addTextField { (textFieldItem) in textFieldItem.placeholder = "create new item" textField = textFieldItem } present(alert, animated: true, completion: nil) } func saveItems(){ do { try context.save() } catch{ print("error in saving context \(error)") } } //MARK: - load items func loadItems(with request:NSFetchRequest<Item> = Item.fetchRequest() , predicate : NSPredicate?=nil) { let categoryPredicate = NSPredicate(format: "parentCategory.name matches %@",selectedCategory!.name!) if let additionalPredicate = predicate{ request.predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [categoryPredicate,additionalPredicate]) }else { request.predicate = categoryPredicate } do{ itemArray = try context.fetch(request) } catch{ print("error in fetching request\(error)") } tableView.reloadData() } } //MARK: - SEARCH BAR METHODS extension TodoListViewController: UISearchBarDelegate{ func searchBarSearchButtonClicked(_ searchBar: UISearchBar) { let request:NSFetchRequest<Item> = Item.fetchRequest() let searchPredicate = NSPredicate(format: "title contains[cd] %@",searchBar.text!) request.sortDescriptors = [NSSortDescriptor(key: "title", ascending: true)] loadItems(with: request, predicate: searchPredicate) } func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { if searchBar.text?.count == 0 { loadItems() DispatchQueue.main.async { searchBar.resignFirstResponder() } } } }
[ -1 ]
4b99efb16504d376d24d04224efa8872ba3dcf9a
d6545ade8fd0305630f2cf921438e83e585e00dc
/ShakeItBaby/ViewController.swift
a951f23b50be963a30c666c0891aa1a41eaf44fa
[]
no_license
stopsac/ShakeItBaby
ac36e4ebf63b1ccb4e25f360517a9b5d8cbc7ff2
dd2c9ecc1ee3c46b2290f772db6295672153ba6c
refs/heads/master
2021-01-19T01:02:25.265714
2016-06-02T00:55:46
2016-06-02T00:55:46
60,221,064
0
0
null
null
null
null
UTF-8
Swift
false
false
1,111
swift
// // ViewController.swift // ShakeItBaby // // Created by Bono Kim on 6/2/16. // Copyright © 2016 Engene. All rights reserved. // import UIKit import AVFoundation class ViewController: UIViewController { var player: AVAudioPlayer! var sounds = ["bean", "belch", "giggle", "pew", "pig", "snore", "static", "uuu"] override func viewDidLoad() { super.viewDidLoad() } override func motionEnded(motion: UIEventSubtype, withEvent event: UIEvent?) { if event?.subtype == UIEventSubtype.MotionShake { let randomNum = Int(arc4random_uniform(UInt32(sounds.count))) let audioPath = NSBundle.mainBundle().pathForResource(sounds[randomNum], ofType: "mp3") do { try player = AVAudioPlayer(contentsOfURL: NSURL(fileURLWithPath: audioPath!)) player.play() } catch { print("An error has occurred!") } } } }
[ -1 ]
25bbc12696f1fc035fc2e99727d12e7e4973eeec
6438d8bda80ad1552edcca0e585c942fb3ce8758
/ChatingAppTests/ChatingAppTests.swift
ecd775e5f2e259e8c95fcdf803a25ac471a821c7
[]
no_license
Atinder1989/ChatingApp
9694b4fbfd40bb054cb8a1194e0abb385efef8de
feee35acb5b81bb8dabed13e9129cb3a2c2641a6
refs/heads/master
2021-08-19T12:27:19.037172
2017-11-26T08:12:29
2017-11-26T08:12:29
112,021,894
0
0
null
null
null
null
UTF-8
Swift
false
false
979
swift
// // ChatingAppTests.swift // ChatingAppTests // // Created by Atinderpal Singh on 25/11/17. // Copyright © 2017 Abc. All rights reserved. // import XCTest @testable import ChatingApp class ChatingAppTests: 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. } } }
[ 98333, 278558, 16419, 229413, 204840, 278570, 360491, 344107, 155694, 253999, 229424, 229430, 319542, 385084, 286788, 352326, 311372, 311374, 196691, 278615, 237663, 278634, 131178, 385133, 278638, 319598, 352368, 204916, 131189, 131191, 237689, 131198, 278655, 311435, 319629, 311438, 278677, 278685, 311458, 278691, 49316, 196773, 32941, 278704, 278708, 131256, 180408, 278714, 295098, 377035, 417999, 254170, 229597, 327904, 286958, 327929, 180493, 278797, 254226, 319763, 278810, 278816, 262450, 278842, 287041, 139589, 319813, 311621, 319821, 254286, 344401, 155990, 106847, 246127, 139640, 246136, 246137, 311681, 311691, 377264, 278961, 278965, 278970, 319930, 33211, 336317, 311738, 311745, 278978, 188871, 278989, 278993, 278999, 328152, 369116, 188894, 287198, 279008, 279013, 279018, 311786, 279022, 319987, 279029, 279032, 279039, 287241, 279050, 303631, 279062, 254488, 410136, 279065, 180771, 377386, 279094, 352829, 115270, 377418, 295519, 66150, 344680, 279146, 295536, 287346, 287352, 279164, 189057, 303746, 311941, 279177, 369289, 344715, 311949, 352917, 230040, 271000, 295576, 303771, 295590, 279206, 352937, 287404, 205487, 295599, 303793, 164533, 287417, 287422, 66242, 287439, 279252, 385761, 295652, 279280, 230134, 221948, 279294, 205568, 295682, 312079, 295697, 336671, 344865, 279336, 262954, 295724, 353069, 312108, 164656, 295729, 303920, 262962, 328499, 353078, 230199, 353079, 336702, 295746, 353094, 353095, 353109, 230234, 295776, 279392, 303972, 230248, 246641, 246648, 279417, 361337, 254850, 287622, 213894, 426895, 295824, 189328, 279456, 189348, 279464, 353195, 140204, 353197, 304051, 230332, 287677, 189374, 353215, 353216, 213960, 279498, 50143, 123881, 304110, 320494, 287731, 295927, 304122, 320507, 328700, 312314, 328706, 320516, 230410, 320527, 238610, 418837, 140310, 230423, 197657, 336929, 345132, 410670, 238639, 238651, 230463, 214086, 238664, 296019, 353367, 156764, 156765, 304222, 230499, 279660, 156785, 312434, 353397, 337017, 279685, 222343, 337039, 296086, 238743, 296092, 238765, 279728, 238769, 230588, 279747, 140486, 353479, 353481, 353482, 279760, 189652, 279765, 189653, 148696, 296153, 279774, 304351, 304356, 279785, 279792, 353523, 320770, 279814, 312587, 328971, 173334, 320796, 115998, 304421, 279854, 345396, 312634, 312635, 116026, 222524, 279875, 304456, 230729, 312648, 222541, 296270, 238927, 296273, 222559, 230756, 230765, 296303, 279920, 312689, 296307, 116084, 181625, 148867, 378244, 304524, 230799, 296335, 279974, 173491, 279989, 296375, 296387, 280004, 296391, 361927, 280010, 370123, 148940, 280013, 312782, 222675, 353750, 280032, 280041, 296425, 361963, 329200, 321009, 280055, 288249, 230913, 230921, 296461, 149007, 304656, 329232, 230943, 230959, 288309, 288318, 280130, 124485, 288326, 288327, 280147, 239198, 157281, 312940, 222832, 247416, 337535, 239237, 312965, 288392, 239250, 345752, 255649, 321199, 198324, 296628, 321207, 296632, 337591, 280251, 280257, 321219, 280267, 9936, 9937, 280278, 280280, 18138, 67292, 321247, 321249, 313065, 280300, 239341, 419569, 313081, 124669, 288512, 288516, 280327, 280329, 321295, 321302, 116505, 321310, 313120, 247590, 296755, 321337, 345919, 280392, 345929, 304977, 18262, 280410, 370522, 345951, 362337, 345955, 296806, 288619, 288620, 296814, 362352, 313203, 124798, 182144, 305026, 67463, 329622, 124824, 214937, 214938, 247712, 354212, 313254, 124852, 288697, 214977, 280514, 280519, 321480, 214984, 247757, 231375, 280541, 337895, 247785, 296941, 362480, 223218, 313339, 313357, 182296, 305179, 313375, 239650, 329765, 354343, 354345, 223274, 124975, 346162, 124984, 288828, 288833, 288834, 280649, 354385, 223316, 280661, 223318, 329814, 338007, 288857, 354393, 280675, 280677, 43110, 313447, 321637, 329829, 288879, 223350, 280694, 288889, 215164, 313469, 215166, 280712, 215178, 141450, 346271, 239793, 125109, 182456, 280762, 223419, 379071, 280768, 338119, 280778, 321745, 280795, 280802, 338150, 346346, 125169, 338164, 157944, 125183, 125188, 313608, 125193, 321800, 125198, 125203, 272660, 338197, 125208, 305440, 125217, 125235, 280887, 125240, 182597, 280902, 182598, 289110, 272729, 379225, 354655, 321894, 280939, 313713, 354676, 280961, 362881, 248194, 395659, 395661, 240016, 108944, 190871, 141728, 289189, 289194, 108972, 281037, 281040, 289232, 330218, 281072, 109042, 223767, 289304, 223769, 182817, 338490, 322120, 281166, 281171, 354911, 436832, 191082, 313966, 281199, 330379, 133774, 330387, 330388, 289434, 338613, 166582, 289462, 314040, 109241, 158394, 248517, 199366, 363211, 289502, 363230, 338662, 346858, 289518, 199414, 363263, 35583, 322313, 322319, 166676, 207640, 281377, 289576, 289598, 281408, 420677, 281427, 281433, 322395, 109409, 330609, 174963, 207732, 109428, 158593, 240518, 109447, 289690, 289698, 289703, 240552, 289722, 289727, 363458, 52172, 183248, 338899, 248797, 207838, 437221, 314342, 52200, 289774, 183279, 314355, 240630, 314362, 134150, 322570, 330763, 281625, 281626, 175132, 248872, 322612, 207938, 314448, 339030, 281697, 314467, 281700, 322663, 281706, 207979, 363644, 150657, 248961, 339102, 330913, 306338, 306346, 208058, 339130, 290000, 363744, 298212, 298213, 290022, 330984, 298228, 216315, 208124, 363771, 388349, 322824, 126237, 339234, 199971, 298291, 347453, 224586, 372043, 331090, 314709, 314710, 134491, 224606, 314720, 142689, 281962, 306542, 314739, 249204, 249205, 290169, 290173, 306559, 224640, 306560, 298374, 314758, 281992, 314760, 388487, 314766, 306579, 224661, 282007, 290207, 314783, 314789, 282024, 241066, 314798, 380357, 306631, 191981, 282096, 306673, 306677, 191990, 290300, 290301, 282114, 306692, 306693, 323080, 192010, 323087, 282129, 323089, 413204, 282136, 282141, 282146, 306723, 355876, 290358, 282183, 224847, 118353, 290390, 44635, 282213, 323178, 396915, 224883, 314998, 396922, 175741, 192131, 224901, 282245, 282246, 290443, 323217, 282259, 298654, 282271, 282273, 257699, 282276, 298661, 323236, 290471, 282280, 298667, 61101, 282303, 323264, 306890, 241361, 298712, 216795, 298720, 12010, 282348, 282358, 175873, 323331, 323332, 216839, 323346, 249626, 282400, 241441, 339745, 315171, 257830, 159533, 282417, 200498, 282427, 315202, 307011, 282438, 307025, 413521, 216918, 307031, 282474, 282480, 241528, 315264, 241540, 315273, 315274, 110480, 184208, 282518, 282519, 44952, 118685, 298909, 298920, 290746, 380881, 298980, 282633, 241692, 307231, 102437, 315434, 233517, 282672, 241716, 159807, 315465, 315476, 307289, 200794, 315487, 176232, 315498, 299121, 233589, 233590, 241808, 422033, 323729, 233636, 233642, 299187, 184505, 299198, 258239, 299203, 282831, 356576, 176362, 233715, 184570, 168188, 184584, 299293, 233762, 217380, 282919, 151847, 332083, 332085, 332089, 315706, 282939, 307517, 389439, 241986, 332101, 323916, 348492, 250192, 323920, 282960, 348500, 168281, 332123, 323935, 332127, 242029, 242033, 291192, 315773, 291198, 225670, 332167, 242058, 291224, 283038, 242078, 61857, 315810, 381347, 61859, 315811, 340398, 299441, 61873, 283064, 61880, 299456, 291265, 127427, 127428, 283075, 291267, 324039, 176601, 242139, 160225, 242148, 340453, 127465, 291311, 233978, 291333, 340490, 283153, 291358, 283182, 283184, 234036, 315960, 438849, 348742, 348749, 111208, 184941, 291454, 184962, 348806, 152203, 184973, 316049, 111253, 111258, 299699, 299700, 225997, 242386, 226004, 226007, 299746, 226019, 299759, 299770, 234234, 299776, 291585, 242433, 234241, 209670, 291592, 226058, 234250, 234253, 291604, 234263, 234268, 291612, 234277, 283430, 234283, 152365, 234286, 234289, 242485, 234294, 234301, 234311, 234312, 299849, 283467, 234317, 201549, 201551, 234323, 234326, 234331, 349026, 234340, 234343, 275303, 177001, 234346, 201577, 308076, 242541, 234355, 209783, 234360, 209785, 234361, 177019, 234366, 234367, 234372, 226181, 226184, 316298, 349067, 308107, 308112, 234386, 234387, 234392, 209817, 324506, 324507, 127902, 234400, 234404, 324517, 283558, 234409, 275371, 316333, 234419, 316343, 234425, 234427, 234430, 349121, 234436, 234438, 316364, 234444, 234445, 234451, 234454, 234457, 340955, 234463, 340961, 234466, 234472, 234473, 324586, 234477, 340974, 234482, 316405, 201720, 234498, 234500, 234506, 324625, 234514, 308243, 316437, 201755, 234531, 300068, 234534, 357414, 234542, 300084, 234548, 324666, 234555, 308287, 234560, 21569, 234565, 234569, 300111, 234577, 341073, 234583, 234584, 234587, 250981, 300135, 300136, 316520, 275565, 316526, 357486, 275571, 300150, 300151, 234616, 398457, 341115, 160891, 300158, 234622, 349316, 349318, 275591, 234632, 169104, 177296, 234642, 308372, 185493, 119962, 119963, 300187, 300188, 283802, 234656, 234659, 234663, 300201, 275625, 300202, 226481, 283840, 259268, 283847, 62665, 283852, 283853, 357595, 333022, 234733, 234742, 292091, 316669, 242954, 292107, 251153, 177428, 333090, 226608, 300343, 333117, 226624, 193859, 300359, 226632, 234827, 177484, 251213, 234831, 120148, 283991, 357719, 316765, 218462, 234850, 292195, 333160, 284014, 243056, 111993, 112017, 234898, 112018, 357786, 333220, 316842, 210358, 284089, 292283, 415171, 300487, 300489, 284107, 284116, 366037, 210390, 210391, 210393, 226781, 144867, 103909, 316902, 54765, 251378, 300535, 300536, 300542, 210433, 366083, 292356, 316946, 308756, 398869, 308764, 349726, 349741, 169518, 194110, 235070, 349763, 292423, 218696, 276040, 366154, 292425, 243274, 276045, 128587, 333388, 333393, 300630, 235095, 128599, 243292, 333408, 374372, 317032, 54893, 276085, 333430, 366203, 415374, 276120, 276126, 218819, 333509, 276173, 333517, 333520, 333521, 333523, 276195, 153319, 284401, 276210, 276219, 325371, 194303, 194304, 300811, 284429, 276238, 284431, 243472, 161554, 366360, 284442, 325404, 276253, 325410, 341796, 284459, 317232, 276282, 276283, 276287, 325439, 325445, 276294, 153415, 276298, 341836, 325457, 317269, 284507, 300894, 284512, 284514, 276327, 292712, 325484, 292720, 325492, 300918, 276344, 194429, 325503, 333701, 243591, 325515, 243597, 325518, 300963, 292771, 333735, 284587, 292782, 317360, 243637, 276408, 276421, 284619, 276430, 301008, 153554, 194515, 276444, 219101, 292836, 292837, 276454, 317415, 276459, 325619, 333817, 292858, 268288, 145435, 317467, 292902, 227370, 325674, 399405, 309295, 276534, 358456, 227417, 194656, 309345, 227428, 276582, 276589, 227439, 284788, 333940, 292992, 194691, 227460, 333955, 235662, 325776, 276627, 317587, 276632, 284826, 333991, 333992, 284842, 153776, 129203, 227513, 301251, 309444, 227524, 276682, 227548, 194782, 301279, 211193, 227578, 243962, 309503, 194820, 375051, 325905, 325912, 260377, 309529, 227616, 211235, 260418, 227658, 276813, 325968, 6481, 6482, 366929, 366930, 6489, 334171, 391520, 276835, 416104, 276847, 285040, 211326, 227725, 178578, 178582, 293274, 317852, 285084, 285090, 375207, 293303, 276920, 276925, 293310, 317901, 326100, 285150, 227809, 358882, 342498, 227813, 195045, 293367, 301571, 276998, 342536, 186893, 342553, 375333, 293419, 244269, 236081, 23092, 277048, 301638, 293448, 55881, 244310, 277094, 244327, 277101, 277111, 301689, 244347, 277133, 227990, 342682, 285353, 285361, 342706, 293556, 342713, 285371, 285373, 154316, 203477, 96984, 318173, 285415, 342762, 277227, 154359, 162561, 285444, 326414, 326429, 293664, 326433, 293672, 318250, 318252, 301871, 285487, 293693, 162621, 162626, 277316, 318278, 277325, 293711, 301918, 293730, 351077, 342887, 400239, 310131, 277366, 277370, 269178, 359298, 277381, 113542, 416646, 228233, 228234, 236428, 56208, 293781, 318364, 310176, 310178, 310182, 293800, 236461, 293806, 130016, 64485, 277479, 203757, 277492, 277509, 277510, 293893, 146448, 277523, 326685, 310317, 252980, 359478, 277563, 302139, 359495, 228458, 318572, 15471, 187506, 285814, 285820, 187521, 285828, 302213, 253063, 302216, 228491, 228493, 285838, 162961, 326804, 285851, 302240, 343203, 253099, 367799, 294074, 277690, 64700, 228540, 228542, 343234, 367810, 113861, 244940, 228563, 195811, 228588, 253167, 302325, 204022, 228600, 228609, 245019, 277792, 130338, 130343, 277800, 113966, 351537, 171317, 318775, 286013, 286018, 15686, 294218, 318805, 294243, 163175, 327025, 327031, 179587, 294275, 368011, 318875, 310692, 310701, 286129, 228795, 302529, 302531, 163268, 163269, 310732, 302540, 64975, 310736, 327121, 228827, 286172, 310757, 187878, 245223, 343542, 343543, 286202, 286205, 302590, 294400, 228867, 253452, 65041, 146964, 204313, 187938, 286244, 245287, 278060, 245292, 286254, 56902, 228943, 286288, 196187, 147036, 343647, 286306, 204397, 138863, 188031, 294529, 286343, 229001, 310923, 188048, 302739, 229020, 245412, 40613, 40614, 40615, 229029, 278191, 286388, 286391, 319162, 327358, 286399, 302797, 212685, 212688, 245457, 302802, 286423, 278233, 278234, 294622, 278240, 229088, 212716, 212717, 229113, 286459, 278272, 319233, 311042, 278291, 294678, 278299, 286494, 294700, 360252, 204605, 319292, 188251, 245599, 237408, 302946, 188292, 253829, 327557, 40853, 294807, 294809, 294814, 311199, 253856, 319392, 294823, 294843, 98239, 163781, 344013, 212946, 24532, 212951, 294886, 253929, 327661, 278512, 311281, 311282 ]
51f93578d63b0c9adba8296fc83aafe22e34f52d
f63ba196b7e53491d6f231407ed452a1c1c29452
/VideoAnalyzer/Record/CustomImagePickerViewController.swift
b19240e5b0c03f62dc7668a619e21373e5bc47f9
[]
no_license
nguyenductho89/Video
18ef87f3830708c68dca7db10ba2693b2e1b087e
52659555363663cd305bf849df777cb1a280866a
refs/heads/master
2020-04-04T18:01:59.559388
2018-11-14T13:52:29
2018-11-14T13:52:29
156,147,069
0
1
null
2018-11-14T13:52:30
2018-11-05T02:05:21
Swift
UTF-8
Swift
false
false
3,538
swift
// // CustomImagePickerViewController.swift // VideoAnalyzer // // Created by Nguyễn Đức Thọ on 11/5/18. // Copyright © 2018 Nguyễn Đức Thọ. All rights reserved. // import UIKit import MobileCoreServices class CustomImagePickerViewController: UIImagePickerController { lazy var mainImageView : UIImageView = { let imgView = UIImageView() imgView.center = self.view.center imgView.bounds.size = self.view.bounds.size imgView.backgroundColor = .clear return imgView }() lazy var tempImageView : UIImageView = { let imgView = UIImageView() imgView.center = self.view.center imgView.bounds.size = self.view.bounds.size imgView.backgroundColor = .clear return imgView }() var lastPoint = CGPoint.zero var color = UIColor.green var brushWidth: CGFloat = 10.0 var opacity: CGFloat = 1.0 var swiped = false override func viewDidLoad() { super.viewDidLoad() //self.hideDefaultVideoControls() let label = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: 30)) label.backgroundColor = .red label.text = "Video Analysis" self.view.addSubview(label) self.view.addSubview(mainImageView) self.view.addSubview(tempImageView) // Do any additional setup after loading the view. } private func hideDefaultVideoControls(){ self.showsCameraControls = false } func drawLine(from fromPoint: CGPoint, to toPoint: CGPoint) { UIGraphicsBeginImageContext(view.frame.size) guard let context = UIGraphicsGetCurrentContext() else { return } tempImageView.image?.draw(in: view.bounds) context.move(to: fromPoint) context.addLine(to: toPoint) context.setLineCap(.round) context.setBlendMode(.normal) context.setLineWidth(brushWidth) context.setStrokeColor(color.cgColor) context.strokePath() tempImageView.image = UIGraphicsGetImageFromCurrentImageContext() tempImageView.alpha = opacity UIGraphicsEndImageContext() } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { guard let touch = touches.first else { return } swiped = false lastPoint = touch.location(in: view) } override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) { guard let touch = touches.first else { return } swiped = true let currentPoint = touch.location(in: view) drawLine(from: lastPoint, to: currentPoint) lastPoint = currentPoint } override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { if !swiped { // draw a single point drawLine(from: lastPoint, to: lastPoint) } // Merge tempImageView into mainImageView UIGraphicsBeginImageContext(mainImageView.frame.size) mainImageView.image?.draw(in: view.bounds, blendMode: .normal, alpha: 1.0) tempImageView.image?.draw(in: view.bounds, blendMode: .normal, alpha: opacity) mainImageView.image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() tempImageView.image = nil } } extension CustomImagePickerViewController : UIImagePickerControllerDelegate { }
[ -1 ]
948835ac6e8dec1015fb74584180c067c26d5850
31f8ac0eab0ad2f338bc85e5f7f59586871c485d
/MercadoPagoSDK/MercadoPagoSDK/CardTypeTableViewCell.swift
dd63a8b075c14afe43782a94db1f0f41c459da65
[ "MIT" ]
permissive
fnazrala/px-ios
69c8b7f4dc8616e6bb5efa65e6fab870260bcac0
bbcfaaa370a91eed5b7de7bdb135413165782dcf
refs/heads/development
2021-01-19T22:17:17.364573
2017-04-19T14:30:59
2017-04-19T14:30:59
88,787,131
0
0
null
2017-04-19T20:19:09
2017-04-19T20:19:09
null
UTF-8
Swift
false
false
1,435
swift
// // CardTypeTableViewCell.swift // MercadoPagoSDK // // Created by Eden Torres on 10/18/16. // Copyright © 2016 MercadoPago. All rights reserved. // import UIKit class CardTypeTableViewCell: UITableViewCell { @IBOutlet weak var cardTypeLable: UILabel! var paymentMethod: PaymentMethod! override func awakeFromNib() { super.awakeFromNib() // Initialization code } func setText(text: String){ cardTypeLable.text = text } func setPaymentMethod(paymentMethod: PaymentMethod){ self.paymentMethod = paymentMethod fillCell() } func getPaymentMethod() -> PaymentMethod{ return self.paymentMethod } func fillCell(){ if paymentMethod.paymentTypeId == "credit_card"{ cardTypeLable.text = "Crédito".localized } else { cardTypeLable.text = "Débito".localized } } func addSeparatorLineToBottom(width: Double, height: Double){ let lineFrame = CGRect(origin: CGPoint(x: 0,y :Int(height)), size: CGSize(width: width, height: 0.5)) let line = UIView(frame: lineFrame) line.alpha = 0.6 line.backgroundColor = UIColor.px_grayLight() addSubview(line) } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } }
[ -1 ]
223a605894ee636437a7b09a73c0c1c6b0770af3
ad2905222499d16ba54ba8f15c84cff930a103fe
/DateSwap/DBget/GetProductID.swift
b7aefc5c42457da2ec235492616bee7b8a4e5bb9
[]
no_license
fungeki/DateSwap
65d2614d0f2114c1ccb7fde70f316121223a953f
04c243d23a3e6d397b0cee7599b635d6c70f950c
refs/heads/master
2020-03-21T09:42:05.901851
2018-10-05T20:22:01
2018-10-05T20:22:01
137,730,936
0
0
null
null
null
null
UTF-8
Swift
false
false
1,570
swift
// // GetProductID.swift // DateSwap // // Created by Ran Loock on 21/09/2018. // Copyright © 2018 Trisk Quality. All rights reserved. // import Foundation struct IDs: Decodable { var id: Int } func getProductID(userid: Int, title: String, controller: EditMyProductsViewController){ let strToUp = "http://dateswap.herokuapp.com/prodid?userid=\(userid)&title=\(title)" guard let escapedStr = strToUp.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else { print("failed encoding string") return} guard let objURL = URL(string: escapedStr) else { print("bad string url") return } URLSession.shared.dataTask(with: objURL) { (data, res, err) in DispatchQueue.main.async { do{ guard let data = data else { print("retrieving data from server fail at ID") controller.backToMyStall() return} let mIDs = try JSONDecoder().decode([IDs].self, from: data) let lastIDplace = mIDs.count - 1 gOnlineUserProducts[0].ID = mIDs[lastIDplace].id // print("my id is:") // print(gOnlineUserProducts[0].ID) // print(gOnlineUserProducts[0].ID) // print(gOnlineUserProducts[0].ID) // print(gOnlineUserProducts[0].ID) controller.backToMyStall() }catch { guard let err = err else {return} print(err) } } } }
[ -1 ]
c5cd776e6917b50c60ec17a522ea68c373478e56
1d60ab260c15df2dda9eb8d2bc96f7bd50963eb1
/iMovies/AppDelegate.swift
15e4c93c4ca9a651c871ca5bcede367da9cecccc
[]
no_license
mshall/iMovies
e5b237ba6615ec71a047e2b65e8c4606df2942cb
a750be66ce7ba0a990d6e63ef0ff9567275c14b2
refs/heads/master
2021-04-12T08:26:52.587113
2018-03-20T17:04:05
2018-03-20T17:04:05
126,052,672
0
0
null
null
null
null
UTF-8
Swift
false
false
2,187
swift
// // AppDelegate.swift // iMovies // // Created by Mohamed S. El-Shall on 3/20/18. // Copyright © 2018 Mohamed S. El-Shall. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 319544, 204856, 229432, 286776, 286778, 352318, 286791, 237640, 278605, 286797, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 131209, 303241, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 320007, 287238, 172552, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 287309, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 189039, 295538, 172660, 189040, 189044, 287349, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 279178, 287371, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 287390, 303773, 164509, 172705, 287394, 172702, 303780, 172707, 287398, 205479, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 279231, 287427, 312005, 312006, 107208, 107212, 172748, 287436, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 279267, 312035, 295654, 279272, 312048, 230128, 312050, 230131, 189169, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303981, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 304007, 320391, 213895, 304009, 304011, 230284, 304013, 279438, 295822, 213902, 189329, 295825, 189331, 304019, 58262, 304023, 279452, 410526, 279461, 279462, 304042, 213931, 304055, 230327, 287675, 197564, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 295949, 230413, 197645, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 296004, 132165, 336964, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 361576, 296040, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 66690, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 165038, 238766, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 291714, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 296264, 238919, 320840, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 148843, 230768, 296305, 312692, 230773, 304505, 181626, 304506, 279929, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 148946, 222676, 288214, 239064, 329177, 288217, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 148990, 321022, 206336, 402942, 296446, 296450, 230916, 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, 419489, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 280276, 313044, 321239, 280283, 18140, 313052, 288478, 313055, 419555, 321252, 313066, 280302, 288494, 280304, 313073, 419570, 288499, 321266, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 304968, 280393, 280402, 173907, 313176, 42842, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 313340, 239612, 288764, 239617, 313347, 288773, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 215154, 313458, 280691, 149618, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 321740, 313548, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 289111, 248153, 354653, 354656, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 240011, 199051, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 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, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 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, 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, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 306555, 314747, 298365, 290171, 290174, 224641, 281987, 314756, 298372, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282261, 175770, 298651, 323229, 282269, 298655, 323231, 61092, 282277, 306856, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 307009, 413506, 241475, 307012, 298822, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 44948, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 217179, 315483, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 307307, 45163, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 241821, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 176311, 299191, 307385, 307386, 258235, 307388, 176316, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 323854, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 276052, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 127407, 291247, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 315856, 176592, 127440, 315860, 176597, 283095, 127447, 299481, 127449, 176605, 242143, 127455, 127457, 291299, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 135672, 127480, 233979, 291323, 127485, 291330, 283142, 127494, 135689, 233994, 127497, 127500, 291341, 233998, 127506, 234003, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 135844, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 242450, 234258, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 201557, 185173, 234329, 234333, 308063, 234336, 234338, 349027, 242530, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 201603, 291716, 234373, 316294, 226182, 234375, 308105, 226185, 234379, 324490, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 226200, 291742, 234396, 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, 226239, 324548, 234437, 226245, 234439, 234434, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 308291, 316483, 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, 234648, 234653, 300189, 119967, 324766, 324768, 283805, 234657, 242852, 234661, 283813, 300197, 234664, 177318, 275626, 234667, 316596, 308414, 300223, 234687, 300226, 308418, 283844, 300229, 308420, 308422, 226500, 234692, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 300289, 292097, 161027, 300292, 300294, 275719, 234760, 300299, 177419, 242957, 283917, 300301, 177424, 275725, 349451, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 284010, 324978, 136562, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 226802, 292338, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 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, 325251, 276095, 276098, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 276166, 284358, 358089, 284362, 276170, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 325408, 300832, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 292681, 358224, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 317279, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 358292, 284564, 317332, 284566, 399252, 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, 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, 194654, 178273, 309346, 194657, 309348, 350308, 309350, 227426, 309352, 350313, 309354, 301163, 350316, 194660, 227430, 276583, 276590, 350321, 284786, 276595, 301167, 350325, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 309455, 276689, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 309491, 227571, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 342707, 318132, 154292, 293555, 277173, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 277322, 293706, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 15224, 236408, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 276579, 293811, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 285690, 293882, 244731, 121850, 302075, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 302205, 285821, 392326, 285831, 253064, 302218, 285835, 294026, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 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, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 400976, 212560, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 302793, 294601, 343757, 212690, 278227, 286420, 319187, 229076, 286425, 319194, 278235, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 311048, 294664, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 280021, 188252, 237409, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 319390, 237470, 40865, 319394, 294817, 294821, 311209, 180142, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
dc20c0f385d8c1b8025834e13e5b85fae88bac54
fd7eaa9ecaea0b6b65997d9170447e0a04a2de98
/ClassifiedAds/Helpers/Result.swift
42471a6a4556477f41fdc367ebd87a9e9f5536fc
[]
no_license
mrgthspn/ClassifiedAds
a1249255912edc66a40fb9170dc244849ce41a32
b7be9156959498a3d2e2da2e838eeb13d8b6bce3
refs/heads/master
2020-11-28T01:55:18.982349
2019-12-23T04:06:39
2019-12-23T04:06:39
229,673,083
1
0
null
null
null
null
UTF-8
Swift
false
false
300
swift
// // Result.swift // ClassifiedAds // // Created by Maria Agatha España on 12/20/19. // Copyright © 2019 Maria Agatha España. All rights reserved. // enum Result<T, U: Error> { case success(payload: T) case failure(U?) } enum EmptyResult<U: Error> { case success case failure(U?) }
[ -1 ]
df9ea378eb9d9acb240536d7e777ba961db05fe8
556cfbc4ac12049d5b4ab60e9154b31c0046cf90
/MyPlayground.playground/Sources/TreeNode.swift
8dd6dbcd969aa3074f08317b635954cc430b0eb2
[]
no_license
hieu-trac/swift-data-structures
5df05436de423e4bb87e528908d4962e77dc1a52
de3c9ccc7ae21cfc01bb53e64a08d86f3d39f395
refs/heads/main
2023-03-30T21:55:43.116846
2021-04-05T20:16:28
2021-04-05T20:16:28
336,907,392
0
0
null
null
null
null
UTF-8
Swift
false
false
1,652
swift
import Foundation public class TreeNode<T> { public var value: T public weak var parent: TreeNode? public var children: [TreeNode] = [] public init(_ value: T) { self.value = value } public func add(_ child: TreeNode) { children.append(child) } } extension TreeNode { public func forEachDepthFirst(visit: (TreeNode) -> Void) { visit(self) children.forEach { $0.forEachDepthFirst(visit: visit) } } } extension TreeNode { public func forEachLevelOrder(visit: (TreeNode) -> Void) { visit(self) var queue = QueueArray<TreeNode>() children.forEach { queue.enqueue($0) } while let node = queue.dequeue() { visit(node) node.children.forEach { queue.enqueue($0) } } } } extension TreeNode where T: Equatable { public func search(_ value: T) -> TreeNode? { var result: TreeNode? forEachLevelOrder { node in if node.value == value { result = node } } return result } } extension TreeNode where T: CustomStringConvertible { public func printEachLevelOrder() { print(value) var queue = QueueArray<[TreeNode<T>]>() queue.enqueue(children) while let level = queue.dequeue() { print(level.map { $0.value.description }.joined(separator: " ") ) var newLevel = [TreeNode<T>]() newLevel.append(contentsOf: level.flatMap { $0.children }) if !newLevel.isEmpty { queue.enqueue(newLevel) } } } }
[ 210299, 210308 ]
8113c3eb90242e537050d68b88e2553cdd20a78e
427ea33e263262cc4383aab0cc43ffd0d5be0a05
/iOS/IssueTracker/IssueTracker/IssueListScene/Views/IssueLabelCollectionViewCell.swift
9412df6e75c7821d0e1f43ab657137ea30e808f6
[ "MIT" ]
permissive
boostcamp-2020/IssueTracker-16
4a690f8f0de285f1663c25a7755ab03ccf76d23b
ef4587a5d4288590ebfb468df317e3a3ff9b0eab
refs/heads/dev
2023-04-26T21:15:55.513337
2021-06-01T14:41:24
2021-06-01T14:41:24
307,257,345
11
6
null
2020-11-15T12:00:38
2020-10-26T04:03:01
JavaScript
UTF-8
Swift
false
false
410
swift
// // IssueLabelCollectionViewCell.swift // IssueTracker // // Created by woong on 2020/11/12. // import UIKit class IssueLabelCollectionViewCell: UICollectionViewCell { static let identifier = "IssueLabelCollectionViewCell" @IBOutlet weak private var githubLabel: GithubLabel! var label: Label? { didSet { githubLabel.label = label } } }
[ -1 ]
620706c4e665517c6fdb656104b64b5ce6050762
7f4037f891e6461eab425873aa1a8ae9ff82841a
/Calendar/View Controllers/MonthViewController.swift
6cb593cc7e7ec40b487b0d72dab97bcdefcaaf18
[]
no_license
avianate/iOS-Calendar-Control
c8266ca92e85452ca40dd8bd55de3b525c5b445a
0d67ea58767128ce29b6b3e7e58b870524ad435b
refs/heads/master
2021-07-22T16:13:20.320724
2018-12-01T23:24:54
2018-12-01T23:24:54
144,637,685
0
0
null
2018-10-04T21:57:47
2018-08-13T21:54:01
Swift
UTF-8
Swift
false
false
17,590
swift
// // CalendarViewController.swift // Calendar // // Created by Nate Graham on 8/13/18. // Copyright © 2018 Nate Graham. All rights reserved. // import UIKit import CoreData // MARK: - PROTOCOLS protocol MonthViewDelegate: class { func backButtonDidChange(title: String) // optional func yearToDisplay(_ year: Int) func update(year: Int, month: Int) } // MARK: - VIEW CONTROLLER class MonthViewController: UIViewController, GigDelegate { // MARK: - OUTLETS @IBOutlet weak var calendarView: UICollectionView! @IBOutlet weak var tableView: UITableView! @IBOutlet weak var calendarHeightConstraint: NSLayoutConstraint! // MARK: - PROPERTIES var calendars = [Calendar]() var months = [Month]() var numberOfYearsToShow = 3 var selectedYear: Int? var selectedMonth: Int? var selectedDate: Date? var previouslySelectedCellIndex: IndexPath? var gigForDate: Gig? var cellWidth: CGFloat = 40 var marginWidth: CGFloat = 30 var finishedInitialLayout = false // tableViewData: dataType // MARK: - DELEGATES weak var delegate: MonthViewDelegate? // MARK: - VIEW LIFECYCEL METHODS override func viewDidLoad() { super.viewDidLoad() if let selectedMonth = selectedMonth, let selectedYear = selectedYear, months.count > 0 { let monthIndex = (selectedYear * 12) + selectedMonth let month = months[monthIndex] let buttonTitle = "\(month.name)" delegate?.backButtonDidChange(title: buttonTitle) } self.dismiss(animated: true, completion: nil) // Layout cells let frameWidth = view.frame.size.width let width = (frameWidth - (cellWidth * 7) - marginWidth) / 7 let layout = calendarView.collectionViewLayout as! UICollectionViewFlowLayout layout.minimumInteritemSpacing = width layout.sectionHeadersPinToVisibleBounds = false if calendars.count > 0 { for calendar in calendars.enumerated() { months.append(contentsOf: calendar.element.months) } } tableView.estimatedSectionHeaderHeight = 100.0 tableView.estimatedRowHeight = 75.0 } override func viewWillAppear(_ animated: Bool) { guard let indexPath = calendarView.indexPathsForSelectedItems?.first else { return } let cell = calendarView.cellForItem(at: indexPath) as! DateCollectionViewCell let day = getDay(fromCell: cell) loadMeetingDataForDate(fromSection: indexPath.section, andDay: day) updateCalendarViewCell() tableView.reloadData() } override func viewWillDisappear(_ animated: Bool) { // get the year view to go back to let year = getVisibleYear() let month = getVisibleMonth() // delegate?.yearToDisplay(year) delegate?.update(year: year, month: month) } override func viewDidLayoutSubviews() { // if this is the first time month view is loaded // set the scroll offset to the month that was tapped if !finishedInitialLayout { if selectedYear != nil && selectedMonth != nil { setScrollOffset() if calendarView.contentOffset.y > 0 { finishedInitialLayout = true; } } } } func createOrUpdateGig(type: GigType, data: AnyObject) { guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { return } let context = appDelegate.persistentContainer.viewContext // context.reset() // check if gig already exists if let indexPath = calendarView.indexPathsForSelectedItems?.first, let date = selectedDate { let month = months[indexPath.section] let dateString = date.toString() if let existingGig = month.getData(forDate: date) { existingGig.setValue(data, forKey: type.key) if type == GigType.Venue { existingGig.setValue(dateString, forKey: "date") } else { update(datePlayed: date, forGigType: type, andGig: existingGig, withContext: context) } do { try context.save() } catch { let error = error as NSError print("Couldn't update gig: \(error) \(error.userInfo)") } return } } if let selectedDate = selectedDate { // create new gig let gigEntity = NSEntityDescription.entity(forEntityName: "Gig", in: context)! let newGig = NSManagedObject(entity: gigEntity, insertInto: context) as! Gig // add data to gigType property of gig data.setValue([selectedDate.toString()], forKey: "datesPlayed") newGig.setValue(data, forKey: type.key) // set selectedDate to gigType datePlayed property newGig.setValue(selectedDate.toString(), forKey: "date") // save the context } do { try context.save() } catch { let error = error as NSError print("Couldn't save gig: \(error) \(error.userInfo)") } } private func update(datePlayed date: Date, forGigType type: GigType, andGig gig: Gig, withContext context: NSManagedObjectContext) { var song: Song? switch type { case .ClosingSong: song = gig.closingSong case .EncoreSong: song = gig.encoreSong case .OpeningSong: song = gig.openingSong case .Venue: break } if var datesPlayed = song?.datesPlayed { datesPlayed.append(date.toString()) let temp = Set(datesPlayed) datesPlayed = Array(temp) song?.setValue(datesPlayed, forKey: "datesPlayed") } do { try context.save() } catch { let error = error as NSError print("Couldn't update gig: \(error) \(error.userInfo)") } } private func remove(type: GigType, fromGig gig: Gig, completion: (_ result: Bool) -> Void) { guard let dateString = selectedDate?.toString() else { return } let appDelegate = UIApplication.shared.delegate as! AppDelegate let context = appDelegate.persistentContainer.viewContext var datesPlayed = [String]() var newDatesPlayed = [String]() let isVenue = type == GigType.Venue if isVenue { if let venue = gig.venue, let played = venue.datesPlayed { datesPlayed = played newDatesPlayed = datesPlayed.filter {$0 != dateString} venue.setValue(newDatesPlayed, forKey: "datesPlayed") venue.setValue(nil, forKey: "gig") gig.setValue(nil, forKey: "venue") } } else if !isVenue, let song = gig.value(forKey: type.key) as? Song, let played = song.datesPlayed { datesPlayed = played newDatesPlayed = datesPlayed.filter {$0 != dateString } song.setValue(newDatesPlayed, forKey: "datesPlayed") gig.setValue(nil, forKey: type.key) } if gigIsEmpty(gig) { context.delete(gig) } do { try context.save() completion(true) } catch { let error = error as NSError print("Can't remove datePlayed: \(error) \(error.userInfo)") completion(false) } } private func gigIsEmpty(_ gig: Gig) -> Bool { return gig.venue == nil && gig.openingSong == nil && gig.closingSong == nil && gig.encoreSong == nil } private func updateCalendarViewCell() { guard let indexPath = calendarView.indexPathsForSelectedItems?.first else { return } guard let cell = calendarView.cellForItem(at: indexPath) as? DateCollectionViewCell else { return } guard let date = selectedDate else { return } setGigAccessory(forCell: cell, ofDate: date) } } // MARK: - COLLECTION VIEW extension MonthViewController: UICollectionViewDataSource, UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { let view = calendarView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "SectionHeader", for: indexPath) as! SectionHeader let section = Section() section.name = titleForSectionAt(indexPath: indexPath) let isCurrentMonth = months[indexPath.section].isCurrentMonth view.isActive = isCurrentMonth view.section = section return view } func titleForSectionAt(indexPath: IndexPath) -> String { let month = months[indexPath.section] return month.name } func scrollViewDidScroll(_ scrollView: UIScrollView) { updateMonthLabel() } func numberOfSections(in collectionView: UICollectionView) -> Int { return months.count } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return 42 } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = calendarView.dequeueReusableCell(withReuseIdentifier: "CalendarDayCell", for: indexPath) as! DateCollectionViewCell let item = indexPath.item let section = indexPath.section let month = months[section] let year = getYear(forSection: section) let offset = getOffsetDays(forMonth: month) let day = item - offset cell.dateLabel.text = getCellDayNumber(forMonth: month, withIndexPath: indexPath) setTextColorAndSelection(forCell: cell, withMonth: month, day: item, offset: offset, andIndex: indexPath) let dateComponents = DateComponents(year: year, month: month.month, day: day) if day > 0, let date = month.getDateFrom(components: dateComponents) { setGigAccessory(forCell: cell, ofDate: date) } return cell } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let selectedCell = collectionView.cellForItem(at: indexPath) as! DateCollectionViewCell let day = selectedCell.dateLabel.text if day == nil || day == "" { return } let month = months[indexPath.section] let dayNumber = getDay(fromCell: selectedCell) let calendarMonth = getMonthInYear(fromSection: indexPath.section) let year = getYear(forSection: indexPath.section) let dateComponents = DateComponents(year: year, month: calendarMonth, day: dayNumber) selectedDate = month.getDateFrom(components: dateComponents) // set the cell accessory to show it as selected setTextColorAndSelection(forCell: selectedCell, withMonth: month, day: dayNumber, andIndex: indexPath, isSelected: true) if let date = month.getDateFrom(components: dateComponents) { setGigAccessory(forCell: selectedCell, ofDate: date) } previouslySelectedCellIndex = indexPath // fetches meeting data for selected day and updates the tableView loadMeetingDataForDate(fromSection: indexPath.section, andDay: dayNumber) } } // MARK: - TABLE VIEW DELEGATE extension MonthViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if selectedDate == nil { tableView.deselectRow(at: indexPath, animated: true) return } performSegue(withIdentifier: "DetailSegue", sender: nil) } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "DetailSegue" { let destinationVC = segue.destination as! GigDetailsViewController if let indexPath = self.tableView.indexPathForSelectedRow { let type = GigType(rawValue: indexPath.section) destinationVC.gigType = type destinationVC.delegate = self } } } func tableView(_ tableView: UITableView, didEndEditingRowAt indexPath: IndexPath?) { tableView.reloadData() } func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { // *Note: There's a known bug where deleting multiple rows quickly back-to-back will throw an error // This bug still exists as of iOS 12. See this link for more information: https://forums.developer.apple.com/thread/88190 let cell = tableView.cellForRow(at: indexPath) let deleteHandler: UIContextualAction.Handler = { [weak self] action, view, callback in // if cell is empty, return if cell?.textLabel?.text == "" || cell == nil { return callback(false) } // get gigType if let gig = self?.gigForDate, let gigType = GigType(rawValue: indexPath.section) { tableView.beginUpdates() self?.remove(type: gigType, fromGig: gig, completion: { success in if success { UIView.animate(withDuration: 0.5, animations: { cell?.alpha = 0 cell?.textLabel?.text = "" }, completion: { success in if self?.gigHasPropertiesToRemove() ?? false { self?.gigForDate?.setValue(nil, forKey: gigType.key) } }) } }) tableView.endUpdates() } self?.updateCalendarViewCell() callback(true) } let deleteAction = UIContextualAction(style: .normal, title: "Delete", handler: deleteHandler) deleteAction.backgroundColor = UIColor.red let actions = [deleteAction] let config = UISwipeActionsConfiguration(actions: actions) return config } private func gigHasPropertiesToRemove() -> Bool { guard let gig = self.gigForDate else { return false } return gig.closingSong != nil || gig.encoreSong != nil || gig.openingSong != nil || gig.venue != nil } } // MARK: - TABLE VIEW DATA SOURCE extension MonthViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { return 50.0 } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 50.0 } func numberOfSections(in tableView: UITableView) -> Int { return 4 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 1 } func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { let type = GigType(rawValue: section) return type?.description } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "Cell") let section = indexPath.section // get the selected date if let meeting = gigForDate { // get Gigs for selected date let numberAndTitle = getSongTitle(forSection: section, forMeeting: meeting) cell?.textLabel?.text = numberAndTitle // display Gig for selected date and section } else { cell?.textLabel?.text = "" } return cell! } private func getSongTitle(forSection section: Int, forMeeting meeting: Gig) -> String { let type = GigType(rawValue: section) var song: Song? if let type = type { switch type { case .OpeningSong: song = meeting.openingSong case .ClosingSong: song = meeting.closingSong case .Venue: guard let venue = meeting.venue else { return "" } return "\(venue.name ?? ""): \(venue.city ?? ""), \(venue.stateProvince ?? "") \(venue.country ?? "")" default: song = meeting.encoreSong } } return song?.title ?? "" } }
[ -1 ]
ca69cf1649ecd7ff42dae95632f2a6162d1315f8
7063b39da7ddd7b49de1dd41535949ce48347e70
/Intel KTWD/Controllers/QuestionVC/QuestionVC.swift
f6a8a8271d4c701aa321de120a3e579182fa5acc
[]
no_license
melaniecooray/Intel-KTWD
3731c1a7f2d3e61b426e91a332daa390b52adc90
0a3c268ef093d6845efe975864b336593e0e78ea
refs/heads/master
2020-06-16T20:38:56.599738
2019-07-07T21:11:05
2019-07-07T21:11:05
195,697,307
0
0
null
null
null
null
UTF-8
Swift
false
false
689
swift
// // QuestionVC.swift // Intel KTWD // // Created by Melanie Cooray on 7/7/19. // Copyright © 2019 Melanie Cooray. All rights reserved. // import UIKit class QuestionVC: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }
[ 327555, 398203, 356742, 384145, 391441, 375576, 384153, 399130, 258589, 254494, 254495, 436128, 254497, 155551, 397091, 351400, 356652, 319284, 383797, 396725, 402616, 397114, 111292, 384447, 266816, 360903, 359368, 437582, 330960, 146645, 399958, 402524, 362845, 332513, 399201, 384103, 374122, 352876, 349297, 210674, 320506, 361595 ]
5045681390387e463e84079cfcf7ebb1a391f4dc
0db3e7a29666f86588e18a87b6bfacd64298a424
/count item array.playground/section-1.swift
aeb28cde12bbc947e8a1400cc04cd1e4b62ec0b0
[]
no_license
jaruk55011212147/55011212147mot
734c4cd2523afa062e4db78263c6f0b76e251d9b
6368c6ff6096e82015f0e615e47a5b5b9962be4e
refs/heads/master
2021-01-10T20:26:44.458746
2015-03-27T10:41:08
2015-03-27T10:41:08
29,337,234
0
0
null
null
null
null
UTF-8
Swift
false
false
107
swift
// Playground - noun: a place where people can play import UIKit var str = "Hello, playground" let possi
[ 236672, 226858, 278301 ]
b8672c807c5a34c8ae19e4bf49079a27c0d4a679
ce5d56c4583024e9bade3c267b3b3ed37c122ce9
/sharing-ios-analytic/SceneDelegate.swift
b6130bc4daa7c2cefd332e87a927e740762d5ce3
[]
no_license
ios-dev-bdg/firebase-analytic-sample
a11cade149329da2f81faac008bf4cf731d63ad7
37974c30faebe229adae82425c3a63a68d5e4e40
refs/heads/main
2023-01-29T16:12:31.966503
2020-12-10T09:46:48
2020-12-10T09:46:48
320,226,152
0
0
null
null
null
null
UTF-8
Swift
false
false
2,308
swift
// // SceneDelegate.swift // sharing-ios-analytic // // Created by Zamaludin Abdulah on 10/12/20. // 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 necessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 352294, 344103, 393260, 393269, 213049, 376890, 385082, 393277, 376906, 327757, 254032, 368728, 180314, 254045, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 377047, 418008, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 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, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 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, 385671, 148106, 377485, 352919, 98969, 344745, 361130, 336556, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 418508, 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, 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, 386004, 345046, 386012, 386019, 386023, 328690, 435188, 328703, 328710, 418822, 377867, 328715, 361490, 386070, 336922, 345119, 377888, 214060, 345134, 345139, 361525, 386102, 361537, 377931, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 386168, 361594, 410746, 214150, 345224, 386187, 345247, 361645, 345268, 402615, 361657, 337093, 402636, 328925, 165086, 165092, 328933, 222438, 328942, 386286, 386292, 206084, 328967, 345377, 345380, 353572, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337224, 337230, 337235, 263509, 353634, 337252, 402792, 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, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 337601, 403139, 337607, 419528, 419531, 272083, 394967, 419543, 419545, 345819, 419548, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 362274, 378664, 354107, 354112, 370504, 329545, 345932, 370510, 354132, 247639, 337751, 370520, 313181, 182110, 354143, 354157, 345965, 345968, 345971, 345975, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 346059, 247760, 346064, 346069, 419810, 329699, 354275, 190440, 354314, 346140, 436290, 395340, 378956, 436307, 338005, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 387250, 379067, 387261, 256193, 395467, 346317, 411862, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 436474, 321787, 379135, 411905, 411917, 379154, 395539, 387350, 387353, 338201, 182559, 338212, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 321911, 420237, 379279, 272787, 354728, 338353, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 330225, 248309, 330254, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 191085, 338544, 191093, 346743, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 355029, 264919, 338661, 264942, 363252, 338680, 264965, 338701, 256787, 363294, 199455, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 355151, 330581, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 355185, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 265215, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 248915, 183384, 339037, 412765, 257121, 322660, 265321, 248952, 420985, 330886, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 322763, 330959, 330966, 265433, 265438, 388320, 363757, 388348, 339199, 396552, 175376, 175397, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 126279, 437576, 437584, 331089, 331094, 396634, 175451, 437596, 429408, 175458, 175461, 175464, 265581, 331124, 175478, 249210, 175484, 175487, 249215, 175491, 249219, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 380364, 339406, 372177, 339414, 249303, 413143, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 208399, 175637, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 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, 339664, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 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, 257869, 257872, 225105, 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, 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, 356638, 356641, 356644, 356647, 266537, 389417, 356650, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 201030, 348489, 332107, 151884, 430422, 348503, 250201, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 250239, 389507, 348548, 356741, 332175, 160152, 373146, 340380, 373149, 70048, 356783, 373169, 266688, 324032, 201158, 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, 258723, 332455, 332460, 389806, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 348926, 389927, 348979, 152371, 340792, 398141, 357202, 389971, 357208, 389979, 430940, 357212, 357215, 439138, 201580, 201583, 349041, 340850, 381815, 430967, 324473, 398202, 119675, 340859, 324476, 430973, 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, 349173, 381947, 201724, 349181, 431100, 431107, 349203, 209944, 209948, 250915, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 431180, 209996, 341072, 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, 210132, 333016, 210139, 210144, 218355, 218361, 275709, 128254, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 210261, 365912, 259423, 374113, 251236, 374118, 333164, 234867, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 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, 333396, 333400, 366173, 423529, 423533, 210547, 415354, 333440, 267910, 267929, 333512, 259789, 366301, 333535, 153311, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333595, 210720, 366384, 358192, 210740, 366388, 358201, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 268144, 358256, 358260, 341877, 399222, 325494, 333690, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 382898, 350153, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 333838, 350225, 350232, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 342113, 252021, 342134, 374904, 268435, 333998, 334012, 260299, 350411, 350417, 350423, 350426, 350449, 375027, 358645, 350459, 350462, 350465, 350469, 268553, 350477, 268560, 350481, 432406, 350487, 325915, 350491, 325918, 350494, 325920, 350500, 350505, 358701, 391469, 350510, 358705, 358714, 358717, 383307, 358738, 334162, 383331, 383334, 391531, 383342, 334204, 268669, 194942, 391564, 366991, 334224, 268702, 342431, 375209, 375220, 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, 334425, 326240, 375401, 334466, 334469, 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, 326417, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 326463, 375616, 326468, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 433001, 400238, 326511, 211826, 211832, 392061, 351102, 359296, 252801, 260993, 351105, 400260, 211846, 342921, 342931, 252823, 400279, 392092, 400286, 252838, 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, 343132, 384099, 384102, 384108, 367724, 187503, 343155, 384115, 212095, 384136, 384140, 384144, 384152, 384158, 384161, 351399, 384169, 367795, 384182, 367801, 384189, 384192, 351424, 343232, 367817, 244938, 384202, 253132, 326858, 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, 376111, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 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, 359887, 359891, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 359948, 359951, 245295, 359984, 400977, 400982, 179803, 245358, 155255, 155274, 368289, 245410, 425639, 425652, 425663, 155328, 245463, 155352, 155356, 212700, 155364, 245477, 155372, 245487, 212723, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 384831, 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, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 155647 ]
551a1731b4613e112c3b910e7b8138d34b5d8fd6
0ab990f66ab27dcb8fe3614929a9e3a50a9060f5
/TutorialPageVC/TutorialStep.swift
4564260c55f05e53feff4d69bae17791f0f704c6
[]
no_license
juanmjimenezs/TutorialPageVC
7fc39bd27c8f492bf1342efe69a1a610bfd4b544
7f50bf2cc5788c5021576d37f696ff850eb75c7b
refs/heads/master
2021-01-22T22:24:15.018730
2017-03-20T05:57:16
2017-03-20T05:57:16
85,539,743
0
0
null
null
null
null
UTF-8
Swift
false
false
564
swift
// // TutorialStep.swift // TutorialPageVC // // Created by Juan Manuel Jimenez Sanchez on 19/03/17. // Copyright © 2017 Juan Manuel Jimenez Sanchez. All rights reserved. // import Foundation import UIKit class TutorialStep { var index = 0//This is to know the page order var title = "" var image: UIImage! var description = "" init(index: Int, title: String, image: UIImage, description: String) { self.index = index self.title = title self.image = image self.description = description } }
[ -1 ]
5175bbb738962e531202ff33ce203dbad827f7e0
84462b9f4a80922556cc69bcd50989f78d2aec24
/CouponApp/CouponApp/Module/CouponList/Component/View/CouponDrawView.swift
fe7c6ad729e86f92e8363742514d48c0a41a31f6
[]
no_license
ksc89kim/CouponApp
a1e90033a245aa51e0ca78a75f534ede68fa52ee
7b95e3adf6285513077cf5be5d9be2850d9fc15c
refs/heads/master
2023-06-25T06:06:15.014818
2023-06-24T13:34:05
2023-06-24T13:34:05
110,834,470
0
1
null
null
null
null
UTF-8
Swift
false
false
3,648
swift
// // CouponView.swift // CouponApp // // Created by kim sunchul on 2017. 8. 15.. // Copyright © 2017년 kim sunchul. All rights reserved. // import UIKit /// 쿠폰 그리기 뷰 /// - Draw를 통해 쿠폰을 그림, 원형 형태의 쿠폰. final class CouponDrawView: UIView, CouponViewType { // MARK: - Define private enum AnimationKey { static let line = "line" static let strokeEnd = "strokeEnd" } // MARK: - UI Component private let backgroundCircleLayer = CAShapeLayer() private let ringThicknessLayer = CAShapeLayer() private let checkLayer = CAShapeLayer() // MARK: - Property var uiData: CouponUIType? { didSet { self.updateUI() } } // MARK: - Life Cycle override func awakeFromNib() { super.awakeFromNib() } // MARK: - Draw & Update func updateUI() { self.setNeedsDisplay() } override func draw(_ rect: CGRect) { self.drawBackgroundCircle(rect) self.drawRingThickness(rect) self.drawCheck(rect) } private func drawBackgroundCircle(_ rect: CGRect) { guard let drawCoupon = uiData as? DrawCoupon else { return } self.backgroundCircleLayer.removeFromSuperlayer() self.backgroundCircleLayer.path = self.getBackgroundCirclePath(rect) self.backgroundCircleLayer.fillColor = UIColor.hexStringToUIColor(hex: drawCoupon.circleColor).cgColor self.layer.addSublayer(self.backgroundCircleLayer) } private func drawRingThickness(_ rect: CGRect) { guard let drawCoupon = uiData as? DrawCoupon else { return } guard drawCoupon.isRing else { self.ringThicknessLayer.removeFromSuperlayer(); return } self.ringThicknessLayer.path = self.getRingThicknessPath(rect, drawCoupon.ringThickness/2) self.ringThicknessLayer.fillColor = UIColor.clear.cgColor self.ringThicknessLayer.strokeColor = UIColor.hexStringToUIColor(hex: drawCoupon.ringColor).cgColor self.ringThicknessLayer.lineWidth = drawCoupon.ringThickness self.layer.addSublayer(self.ringThicknessLayer) } private func drawCheck(_ rect:CGRect) { guard let drawCoupon = uiData as? DrawCoupon else { return } guard drawCoupon.isUseCoupon else { self.checkLayer.removeFromSuperlayer(); return } self.checkLayer.path = getCheckPath(rect) self.checkLayer.strokeColor = UIColor.hexStringToUIColor(hex: drawCoupon.checkLineColor).cgColor self.checkLayer.lineWidth = drawCoupon.checkLineWidth self.checkLayer.lineCap = .round if drawCoupon.isAnimation{ self.checkLayer.add(getCheckAnimation(), forKey: AnimationKey.line) drawCoupon.isAnimation = false } self.layer.addSublayer(self.checkLayer) } // MARK: - Get Method private func getBackgroundCirclePath(_ rect: CGRect) -> CGPath { return UIBezierPath(ovalIn: rect).cgPath } private func getRingThicknessPath(_ rect: CGRect, _ hw:CGFloat) -> CGPath { return UIBezierPath(ovalIn: rect.insetBy(dx: hw,dy: hw)).cgPath } private func getCheckPath(_ rect: CGRect) -> CGPath { var start:CGPoint = CGPoint(x: rect.maxX * 0.25, y: rect.maxY * 0.45) var end:CGPoint = CGPoint(x: rect.maxX * 0.5, y: rect.maxY * 0.65) let path = UIBezierPath() path.move(to: start) path.addLine(to: end) start = CGPoint(x: end.x, y: end.y) end = CGPoint(x: rect.maxX * 0.75, y: rect.maxY * 0.35) path.move(to: start) path.addLine(to: end) return path.cgPath } private func getCheckAnimation() -> CABasicAnimation { let animation = CABasicAnimation(keyPath: AnimationKey.strokeEnd) animation.fromValue = 0 animation.toValue = 1 animation.duration = 0.3 return animation } }
[ -1 ]
063a147fe6bd9146c6e4a4fce74b7219a016017f
a68f05b2e90637d556e15b89c2e32267432c4969
/OSXPassGen/Constants.swift
3f2edee1679fb66e5fdad71bfc87032dab90a82d
[ "MIT" ]
permissive
ggu/OSXPassGen
4d8b682e8a8f14763a423a83f2c1e8f853b98bb3
f258d10e132241fc7f29a910f2264bcbab995585
refs/heads/master
2020-12-27T12:02:40.139502
2018-08-26T03:28:45
2018-08-26T03:28:45
47,863,184
9
1
null
null
null
null
UTF-8
Swift
false
false
169
swift
// // Constants.swift // OSXPassGen // // Created by Gabriel Uribe on 12/11/15. // import Foundation let statusToolTip = "Password generator" let statusTitle = "P"
[ -1 ]
fd4d906999a1c64afd28c5febfe14e356b532dd3
4240dba556984bd7851ffa64ec9bd05e5973e4a3
/MapKit_PageController_Notification/MapKit/Map/MapViewController.swift
38deab73e395776f11de1d45f20c564d637d3480
[]
no_license
dogukanberkozer/Yemeksepeti_iOS_Bootcamp
6929cd446cd958d91673e62720c710cc6e45f758
d966391a4bb876eb9615b45137892596b322a900
refs/heads/main
2023-06-29T17:03:23.916224
2021-08-04T11:17:11
2021-08-04T11:17:11
380,830,277
2
0
null
null
null
null
UTF-8
Swift
false
false
3,611
swift
// // MapViewController.swift // Map // // Created by Dogukan Berk Ozer on 11.07.2021. // import UIKit import MapKit class MapViewController: UIViewController { @IBOutlet weak var addressLabel: UILabel! @IBOutlet weak var mapView: MKMapView! let locationManager = CLLocationManager() var lastLocation: CLLocation? override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. checkLocationServices() } func setupLocationManager() { locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest } func showUserLocationCenterMap() { if let location = locationManager.location?.coordinate { let region = MKCoordinateRegion.init(center: location, latitudinalMeters: 100, longitudinalMeters: 100) mapView.setRegion(region, animated: true) } } func checkLocationServices() { if CLLocationManager.locationServicesEnabled() { setupLocationManager() checkLocationAuthorization() } else {} } func checkLocationAuthorization() { switch locationManager.authorizationStatus { case .authorizedWhenInUse: trackingLocation() case .denied: break case .notDetermined: locationManager.requestWhenInUseAuthorization() case .authorizedAlways: break case .restricted: break @unknown default: fatalError("fatal error") } } // location of the pin func trackingLocation() { mapView.showsUserLocation = true showUserLocationCenterMap() locationManager.startUpdatingLocation() lastLocation = getCenterLocation(mapView: mapView) } func getCenterLocation(mapView: MKMapView) -> CLLocation { let latitude = mapView.centerCoordinate.latitude let longitude = mapView.centerCoordinate.longitude return CLLocation(latitude: latitude, longitude: longitude) } } extension MapViewController: CLLocationManagerDelegate { func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) { checkLocationAuthorization() } } extension MapViewController: MKMapViewDelegate { func mapView(_ mapView: MKMapView, regionDidChangeAnimated animated: Bool) { let center = getCenterLocation(mapView: mapView) let geoCoder = CLGeocoder() guard let lastLocation = lastLocation else { return } guard center.distance(from: lastLocation) > 30 else { return } self.lastLocation = center geoCoder.reverseGeocodeLocation(center) { [weak self] (placemarks, error) in guard let self = self else { return } if let error = error { print(error) return } guard let placemark = placemarks?.first else { return } let name = placemark.name ?? "Name" let iso = placemark.isoCountryCode ?? "Iso" let postalCode = placemark.postalCode ?? "PostalCode" let subLocality = placemark.subLocality ?? "" let city = placemark.locality ?? "City" let street = placemark.thoroughfare ?? "Street" self.addressLabel.text = "\(name), \(street), \(subLocality), \(city) \(postalCode), \(iso)" } } }
[ -1 ]
21679b7c6747d4caec6eb08bea1b7bc546c8e07d
05bafef09cc46ac6e40060b42041dbef25278610
/Smack Chat/Model/Message.swift
97fd7ac1a1c765f948430682ed0d5f961f8d68ed
[]
no_license
Baranseli/Smack-Chat
4788b0fa4b643c0c35da1cc8c32bca0f5d4f5227
e685be5954979c30612b44e1f878be980c587475
refs/heads/master
2020-05-21T21:12:29.463930
2019-05-15T15:32:24
2019-05-15T15:32:24
186,148,048
0
0
null
null
null
null
UTF-8
Swift
false
false
509
swift
// // Message.swift // Smack Chat // // Created by Kafkas Baranseli on 15/05/2019. // Copyright © 2019 Baranseli. All rights reserved. // import Foundation struct Message { public private(set) var message : String public private(set) var userName : String public private(set) var channelId : String public private(set) var userAvatar : String public private(set) var userAvatarColour : String public private(set) var id : String public private(set) var timeStamp : String }
[ 325650 ]
331043ff84a73d8e1cc539b5bd78ed5a0d70041c
373faf0f6935182bc036ce42a87311912bfe49bd
/CocoaHeadsAppTests/Models/PodcastEpisodeTest.swift
d8d22ca7b93cc169cf398c021e38ebbf8c488fad
[ "MIT" ]
permissive
ronanrodrigo/CocoaHeadsApp
11b9305da6fb84bfe2172bf9affd5a4712a6ab80
a84c7a90790028d32112a34cbaa71014db6d05b9
refs/heads/master
2020-08-30T10:16:24.453072
2019-10-29T19:44:48
2019-10-29T19:44:48
218,347,525
0
0
MIT
2019-10-29T17:43:28
2019-10-29T17:43:27
null
UTF-8
Swift
false
false
749
swift
import XCTest @testable import CocoaHeadsApp class PodcastEpisodeTest: XCTestCase { func testInitializerWithDictionary() { let episode = PodcastEpisode.withJSON(jsonObjectWithName("podcast_episode"))! XCTAssertEqual(15, episode.id) XCTAssertEqual("S02E03 - Entrevista: OLX", episode.title) XCTAssertEqual("Mais uma semana com entrevistas sobre desenvolvimento iOS no podcast da CocoaHeads!", episode.description) XCTAssertEqual("247347819", episode.soundcloudId) XCTAssertEqual("http://soundcloud.com/cocoaheadsbr/s02e03-entrevista-olx", episode.soundcloudURL?.absoluteString) XCTAssertEqual(["OLX", "iPhone", "Xcode", "Apple", "Swift", "Cocoaheads"], episode.tags) } }
[ -1 ]
f96f07d169e92e0428085d45a29ae19c8217c57b
ed4b50ee6de4dde87b243036db5f65261973a360
/BaseProject/BaseProject/Model/Strain/Strain.swift
dc54ec659c54548ff19fc2af7ab57babfaeb5e24
[ "Apache-2.0" ]
permissive
HEALINGBUDZ/healingbudzios
449d0459c60cfb2f0e1442278bdb55c053b47701
7167240dbd7e042a887795c84167fd66500f622e
refs/heads/master
2020-04-05T19:59:14.478691
2019-02-01T07:50:58
2019-02-01T07:50:58
157,159,890
1
0
null
null
null
null
UTF-8
Swift
false
false
4,078
swift
// // Strain.swift // BaseProject // // Copyright © 2018 Wave. All rights reserved. // import UIKit import ObjectMapper class Strain:NSObject, Mappable { var strainID: NSNumber? var type_id: NSNumber? var title: String? var overview:String? = kEmptyString var approved:NSNumber? var created_at:String? var updated_at:String? var get_review_count:NSNumber? var get_likes_count: NSNumber? var get_dislikes_count: NSNumber? var get_user_like_count: NSNumber? var get_user_dislike_count:NSNumber? var get_user_flag_count:NSNumber? var is_saved_count:NSNumber? var strain_id:NSNumber? var type_sub_id : NSNumber? var get_user_review_count: Int? var strainType:StrainType? var rating:StrainRating? var images:[StrainImage]? var get_strain_survey_user_count : NSNumber? var madical_conditions : [StrainSurvey]? var negative_effects : [StrainSurvey]? var preventions : [StrainSurvey]? var sensations : [StrainSurvey]? var survey_flavors : [StrainSurvey]? var strainReview : [StrainReview]? var ans_Madical_conditions : [StrainSurveyAnswers]? var ans_Negative_effects : [StrainSurveyAnswers]? var ans_Preventions : [StrainSurveyAnswers]? var ans_Sensations : [StrainSurveyAnswers]? var ans_Survey_flavors : [StrainSurveyAnswers]? var matched : Int? var survey_budz_count : NSNumber? var strain :Strain? required init?(map: Map){ } override init() { } func mapping(map: Map){ print(map.JSON) strainID <- map["id"] type_id <- map["type_id"] type_sub_id <- map["type_sub_id"] title <- map["title"] overview <- map["overview"] approved <- map["approved"] created_at <- map["created_at"] updated_at <- map["updated_at"] get_review_count <- map["get_review_count"] get_strain_survey_user_count <- map["get_strain_survey_user_count"] get_user_review_count<-map["get_user_review_count"] if get_review_count == nil { var newValue : String? newValue <- map["get_review_count"] if newValue != nil { get_review_count = Int(newValue!)! as? NSNumber }else { get_review_count = 0 } } survey_budz_count <- map["survey_budz_count"] get_likes_count <- map["get_likes_count"] get_dislikes_count <- map["get_dislikes_count"] if get_likes_count == nil { get_likes_count = 0 } if get_dislikes_count == nil { get_dislikes_count = 0 } if get_user_review_count == nil { get_user_review_count = 0 } get_user_like_count <- map["get_user_like_count"] get_user_dislike_count <- map["get_user_dislike_count"] get_user_flag_count <- map["get_user_flag_count"] is_saved_count <- map["is_saved_count"] strainType <- map["get_type"] rating <- map["rating_sum"] images <- map["get_images"] strainReview <- map["get_review"] madical_conditions <- map["madical_conditions"] negative_effects <- map["negative_effects"] preventions <- map["preventions"] sensations <- map["sensations"] survey_flavors <- map["survey_flavors"] ans_Sensations <- map["sensation_answers"] ans_Preventions <- map["prevention_answers"] ans_Survey_flavors <- map["survey_flavor_answers"] ans_Negative_effects <- map["negative_effect_answers"] ans_Madical_conditions <- map["madical_condition_answers"] strain <- map["strain"] if strain?.strainID != nil { }else { strain <- map["get_strain"] } } }
[ -1 ]
65cede01852f89881c8bb7deba3cbbba78935cee
96c9b4427942d2081ae802755bf9196aeedf5bba
/DesignPatternsExample/DesignPatternsExample/Sources/Utils/Extensions/UIView+addArrangedSubviews.swift
f426e56b60e92d793f75beae56cc37a5ee240d1e
[]
no_license
pcugogo/DesignPatternsExample
9c1809042c2ccd8ad3744ad0fc4ad50fef40ad5f
b5b1b0a2b3eddefacb41b4b4c0bc652bc50b7716
refs/heads/main
2023-02-02T20:18:41.696034
2020-12-20T04:27:12
2020-12-20T04:27:12
319,958,544
0
0
null
null
null
null
UTF-8
Swift
false
false
298
swift
// // UIView+addArrangedSubviews.swift // DesignPatternsExample // // Created by ChanWook Park on 2020/12/09. // import UIKit extension UIStackView { func addArrangedSubviews(_ views: [UIView]) { for view in views { self.addArrangedSubview(view) } } }
[ -1 ]
d088293b6ea504b1177c26bb4eb1aa44be47b286
14836be331bf8f62d92178853d8aa98136da1d77
/AllTimeNBA/Controller/ViewController.swift
5b9061007e2a5e73292e3460ff7d11a86707c37e
[]
no_license
yamamotorei/All-timeNBAPlayers
c03a0d839c47b3e221b98ec114b921df6d6da8e6
060d60f08751641cdd6b95b723ff495dd8574b4b
refs/heads/master
2023-01-23T13:36:52.750378
2020-12-08T02:10:12
2020-12-08T02:10:12
null
0
0
null
null
null
null
UTF-8
Swift
false
false
5,301
swift
import UIKit class Player { var name: String var image: UIImage var url: URL init (name: String, image: UIImage, url: URL) { self.name = name self.image = image self.url = url } } class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { private let players = [ [Player(name: "Michael Jordan", image: #imageLiteral(resourceName: "jordan"), url: URL(string:"https://www.youtube.com/watch?v=LAr6oAKieHk&t=32s")!), Player(name: "Dennis Rodman", image: #imageLiteral(resourceName: "rodman"), url: URL(string: "https://www.youtube.com/watch?v=SezmOAEnBPI")! ), Player(name: "Scottie Pippen", image: #imageLiteral(resourceName: "pippen"), url: URL(string: "https://www.youtube.com/watch?v=T8_GiznzWbk")!), Player(name: "Anfernee Hardaway", image: #imageLiteral(resourceName: "penny"), url: URL(string: "https://www.youtube.com/watch?v=PNUto6iLaMM")!), Player(name: "Karl Malone", image: #imageLiteral(resourceName: "malone"), url: URL(string: "https://www.youtube.com/watch?v=Jv6vD1iKOU4")!) ], [Player(name: "Kobe Bryant", image: #imageLiteral(resourceName: "kobe"), url: URL(string: "https://www.youtube.com/watch?v=OTTWedyp37o")!), Player(name: "Allen Iverson", image: #imageLiteral(resourceName: "iverson"), url: URL(string: "https://www.youtube.com/watch?v=2REkZG-dhHc")!), Player(name: "Tracy McGrady", image: #imageLiteral(resourceName: "tmc"), url: URL(string: "https://m.youtube.com/watch?v=Y0kcm4LTE8E")!), Player(name: "Kevin Garnett", image: #imageLiteral(resourceName: "garnet"), url: URL(string: "https://m.youtube.com/watch?v=0mhUlZl3tyU")!), Player(name: "Sgaquille O'Neal", image: #imageLiteral(resourceName: "shaq"), url: URL(string: "https://m.youtube.com/watch?v=M9PAMJiuOao")!) ], [Player(name: "LeBron James", image: #imageLiteral(resourceName: "king"), url: URL(string: "https://m.youtube.com/watch?v=b117a8_jALE")!), Player(name: "Giannis Antetokounmpo", image: #imageLiteral(resourceName: " Giannis"), url: URL(string: "https://m.youtube.com/watch?v=0rMxWWsG4CQ")!), Player(name: "Stephen Curry", image: #imageLiteral(resourceName: "curry"), url: URL(string: "https://m.youtube.com/watch?v=2hIrbnVx4k4")!), Player(name: "James Harden", image: #imageLiteral(resourceName: "harden"), url: URL(string: "https://m.youtube.com/watch?v=_RqteZDjDmQ")!), Player(name: "Kawhi Leonard",image: #imageLiteral(resourceName: "Kawhi"), url: URL(string: "https://m.youtube.com/watch?v=5JWAx19dmbk")!) ] ] @IBOutlet weak var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() tableView.delegate = self tableView.dataSource = self } } //MARK: - tableviewの設定 extension ViewController { //セルのセクションの数を決める func numberOfSections(in tableView: UITableView) -> Int { return players.count } //1セクションに入るセルの数を決める func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return players[section].count } //セルの外枠を生成 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath ) cell.textLabel?.text = players[indexPath.section][indexPath.row].name return cell } //セルの高さを設定 func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 70 } //セクションのヘッダーを生成 func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { let label = UILabel() label.backgroundColor = .systemIndigo label.textAlignment = .center label.textColor = .white switch section { case 0: label.text = "1990s" case 1: label.text = "2000s" case 2: label.text = "2010s" default: break } return label } //セクションのヘッダーの高さを設定 func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { return 50 } //セルがタップされた時の動作を設定 func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let nextVC = storyboard?.instantiateViewController(identifier: "next") as! NextViewController nextVC.player = players[indexPath.section][indexPath.row] navigationController?.pushViewController(nextVC, animated: true) } }
[ -1 ]
a5639617c07c6b0f6742cb2b8d8cc5d14d867e04
070707d7acae50b4b6c324d0131c31ae50e4bc77
/Saitama/ConnectionAPI/Request.swift
de5700aac8506959005aebbfe4599334376ad2b3
[ "MIT" ]
permissive
kenankarakecili/CrossoveriOSProject_Swift
9866a565b10e2cfecdba0a3e41b303ec62d9d2b0
bc7bfab50930e77c88a344eea5c69b2e490d3a6e
refs/heads/master
2021-06-01T03:39:23.216753
2016-07-16T08:33:34
2016-07-16T08:33:34
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,068
swift
// // Request.swift // Saitama // // Created by Kenan Karakecili on 2/07/2016. // Copyright © 2016 Kenan Karakecili. All rights reserved. // import Foundation enum MethodType: String { case POST case GET } class Request: NSMutableURLRequest { convenience init(urlString: String, body: [String: AnyObject], methodType: MethodType) { self.init() timeoutInterval = 60 HTTPMethod = methodType.rawValue URL = NSURL(string: urlString) addValue("application/json; charset=utf-8", forHTTPHeaderField: "Content-Type") addValue(User.getPersistentToken(), forHTTPHeaderField: "Authorization") print("Headers:\(allHTTPHeaderFields!)") if methodType == .POST { let tempBody: NSMutableDictionary = NSMutableDictionary(dictionary: body) HTTPBody = dataFromObject(tempBody) print("Request: \(NSString(data: HTTPBody!, encoding: NSUTF8StringEncoding)!)") } } func dataFromObject(object: AnyObject) -> NSData { return try! NSJSONSerialization.dataWithJSONObject(object, options: .PrettyPrinted) } }
[ -1 ]
eadbcbab92f3773ec6c3cb2a100d7c1ebdb99b2f
e2c44d186ce05406da957e9570a3427df9564cfd
/Sources/PhotoBrowser/PhotoBrowserUIKit/PhotoTool/PBPhotoPreviewAnimatedTransition.swift
107a3d69cf07130b92d2ca7568f3b9fd58f7f922
[]
no_license
LGQ123/SwiftPhotoBrowser
4822b363a2dd0f678dd278b6c561624d3c503ed5
20ceb29b0c343e3347b8ef58dceed9b1ac7fd1ef
refs/heads/main
2023-06-09T20:02:15.372194
2021-02-03T06:48:57
2021-02-03T06:48:57
332,182,279
0
0
null
null
null
null
UTF-8
Swift
false
false
470
swift
// // PBPhotoPreviewAnimatedTransition.swift // LGQPhotos // // Created by 刘广庆 on 2021/1/10. // import UIKit class PBPhotoPreviewAnimatedTransition: NSObject, UIViewControllerAnimatedTransitioning { func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { return 0.25 } func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { } }
[ 171085 ]
4ca05fe9716bf4d3df56cce93ff927fc9e2afe32
2d56e955179b0f1ddae1b668ce1a6fa808861b4a
/ItineraryAppTests/ItineraryAppTests.swift
9cd8e193d96a7ff4a90970b8e5ed593f1513b94a
[]
no_license
224apps/ItineraryApp
2f32003abdc0a372f04d2e1df3f75a80ff689110
7acc6b7eff112828e48661ab64f671bc41dcc4fb
refs/heads/master
2020-04-26T20:37:02.103434
2019-03-19T22:23:43
2019-03-19T22:23:43
173,813,123
0
0
null
null
null
null
UTF-8
Swift
false
false
1,023
swift
// // ItineraryAppTests.swift // ItineraryAppTests // // Created by Abdoulaye Diallo on 3/4/19. // Copyright © 2019 Abdoulaye Diallo. All rights reserved. // import XCTest @testable import ItineraryApp class ItineraryAppTests: 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. } } }
[ 268288, 313357, 182296, 145435, 317467, 98333, 241692, 239650, 16419, 223268, 102437, 292902, 329765, 204840, 354345, 227370, 354343, 223274, 233517, 155694, 102445, 229424, 282672, 399405, 309295, 241716, 229430, 180280, 352315, 385084, 288828, 288833, 288834, 286788, 352326, 315465, 311372, 311374, 354385, 196691, 223316, 280661, 315476, 329814, 307289, 354393, 200794, 237663, 315487, 309345, 45153, 280675, 227428, 280677, 43110, 313447, 319591, 176232, 278634, 194666, 321637, 385133, 278638, 288879, 131178, 319598, 284788, 204916, 223350, 233590, 280694, 131191, 288889, 281706, 215166, 131198, 292992, 194691, 227460, 280712, 215178, 319629, 235662, 311438, 325776, 422033, 325674, 278677, 284826, 278691, 233636, 299174, 233642, 284842, 153776, 239793, 299187, 180408, 184505, 278714, 223419, 227513, 295098, 299198, 258239, 280768, 301251, 309444, 227524, 280778, 377035, 282831, 417999, 321745, 280795, 227548, 229597, 194782, 301279, 311519, 327904, 280802, 356576, 346346, 286958, 125169, 327929, 184570, 227578, 184575, 194820, 321800, 278797, 319763, 272660, 338197, 260377, 282909, 278816, 237857, 282913, 233762, 217380, 227616, 305440, 151847, 211235, 282919, 311597, 98610, 332083, 332085, 280887, 332089, 278842, 315706, 282939, 307517, 389439, 287041, 287043, 139589, 280902, 319813, 182598, 227654, 182597, 348492, 282960, 6481, 325968, 366929, 289110, 6489, 168281, 332123, 272729, 334171, 323935, 106847, 332127, 354655, 321894, 416104, 280939, 160110, 285040, 313713, 242033, 199029, 291192, 106874, 315773, 211326, 291198, 311681, 225670, 332167, 242058, 311691, 227725, 240016, 108944, 190871, 291224, 293274, 39324, 317852, 285084, 242078, 141728, 61857, 285090, 61859, 315810, 289189, 315811, 381347, 164533, 108972, 299441, 334260, 283064, 278970, 293306, 319930, 311738, 293310, 291265, 278978, 127427, 127428, 291267, 283075, 311745, 278989, 281037, 317901, 281040, 278993, 289232, 326100, 278999, 328152, 176601, 369116, 188894, 287198, 279008, 160225, 285150, 279013, 340453, 127465, 279018, 311786, 330218, 291311, 309744, 109042, 319987, 279029, 293367, 254456, 233978, 301571, 291333, 342536, 287241, 279050, 283153, 303636, 279062, 254488, 410136, 289304, 279065, 299700, 291358, 180771, 375333, 293419, 244269, 283182, 283184, 236081, 234036, 289332, 279094, 234040, 338490, 329829, 438849, 115270, 322120, 293448, 377418, 55881, 340558, 281166, 281171, 309846, 295519, 66150, 244327, 111208, 279146, 184941, 281199, 295536, 287346, 287352, 301689, 344696, 244347, 279164, 291454, 189057, 348806, 369289, 152203, 330379, 311949, 316049, 330387, 330388, 316053, 352917, 117397, 230040, 314009, 289434, 303771, 221852, 111253, 295576, 111258, 279206, 295590, 352937, 295599, 285361, 303793, 299699, 342706, 336564, 166582, 289462, 314040, 342713, 158394, 285371, 285372, 285373, 287422, 285374, 303803, 109241, 66242, 248517, 287433, 363211, 154316, 287439, 164560, 242386, 279252, 96984, 363230, 289502, 385761, 299746, 295652, 234217, 342762, 330474, 230125, 289518, 312047, 279280, 299759, 125684, 199414, 154359, 230134, 228088, 299770, 221948, 279294, 363263, 205568, 242433, 295682, 299776, 285444, 291592, 322313, 322316, 326414, 312079, 322319, 295697, 291604, 310036, 166676, 207640, 291612, 293664, 281377, 326433, 234277, 283430, 262951, 279336, 289576, 262954, 295724, 353069, 312108, 301871, 164656, 303920, 262962, 285487, 318252, 152365, 353079, 230199, 293693, 336702, 281408, 295746, 318278, 355146, 201549, 201551, 355152, 355154, 281427, 353109, 281433, 230234, 322395, 355165, 301918, 295776, 242529, 293730, 279392, 303972, 109409, 275303, 230248, 177001, 355178, 201577, 308076, 242541, 400239, 330609, 174963, 207732, 211829, 295798, 209783, 109428, 209785, 279417, 361337, 211836, 177019, 291712, 260996, 113542, 287622, 416646, 228233, 228234, 308107, 349067, 109447, 316298, 426895, 56208, 308112, 234386, 189328, 236428, 293781, 209817, 289690, 324507, 400283, 127902, 310176, 310178, 289698, 283558, 289703, 279464, 293800, 310182, 240552, 353195, 236461, 293806, 316333, 353197, 252847, 304051, 316343, 289722, 230332, 189374, 289727, 353215, 330689, 349121, 213960, 279498, 316364, 330708, 343005, 248797, 50143, 340961, 437221, 52200, 326635, 203757, 289774, 183279, 320493, 320494, 304110, 287731, 340974, 316405, 240630, 295927, 277492, 304122, 312314, 314362, 328700, 328706, 234500, 277509, 293893, 134150, 322570, 230410, 330763, 320527, 234514, 238610, 277524, 316437, 140310, 418837, 293910, 197657, 281626, 308243, 175132, 326685, 300068, 410670, 238639, 300084, 252980, 312373, 322612, 238651, 302139, 308287, 21569, 214086, 300111, 234577, 296019, 339030, 353367, 234587, 156765, 304222, 277597, 281697, 230499, 281700, 253029, 314467, 300135, 322663, 228458, 207979, 279660, 318572, 316526, 15471, 144496, 351344, 300146, 312434, 353397, 285814, 300151, 291959, 300150, 337017, 341115, 363644, 285820, 300158, 150657, 285828, 279685, 349318, 222343, 302216, 285830, 302213, 228491, 228493, 337039, 177296, 326804, 185493, 296086, 238743, 187544, 119962, 283802, 296092, 285851, 339102, 300188, 330913, 306338, 249002, 300202, 306346, 279728, 238769, 294068, 339130, 294074, 228540, 230588, 228542, 283840, 302274, 279747, 113861, 140486, 283847, 353479, 62665, 353481, 353482, 283852, 279760, 290000, 189652, 279765, 189653, 148696, 279774, 304351, 333022, 310497, 298212, 304356, 298213, 290022, 279785, 228588, 234733, 298221, 279792, 353523, 298228, 302325, 234742, 292085, 228600, 216315, 292091, 316669, 388349, 208124, 228609, 320770, 292107, 251153, 177428, 173334, 349462, 245019, 126237, 115998, 339234, 130338, 333090, 109861, 304421, 130343, 279854, 298291, 171317, 318775, 312634, 312635, 347453, 286013, 333117, 286018, 113987, 300359, 312648, 230729, 294218, 234827, 224586, 177484, 296270, 234831, 238927, 222541, 331090, 296273, 120148, 318805, 314709, 357719, 314710, 134491, 316765, 222559, 292195, 294243, 230756, 281957, 163175, 314728, 333160, 230765, 284014, 306542, 296303, 327025, 296307, 249204, 314741, 249205, 181625, 111993, 290169, 290173, 306559, 224640, 306560, 357762, 148867, 294275, 298374, 142729, 368011, 304524, 296335, 112017, 112018, 306579, 9619, 234898, 224661, 282007, 318875, 251298, 310692, 282022, 282024, 316842, 241066, 310701, 314798, 286129, 279989, 228795, 292283, 292292, 380357, 339398, 300487, 306631, 300489, 280010, 296392, 310732, 302540, 312782, 64975, 310736, 284107, 327121, 222675, 366037, 210392, 228827, 286172, 280032, 144867, 310757, 187878, 103909, 316902, 280041, 245223, 191981, 282096, 306673, 296433, 321009, 329200, 306677, 191990, 300535, 280055, 288249, 286202, 300536, 290300, 286205, 302590, 290301, 294400, 296448, 282114, 300542, 306692, 306693, 230913, 210433, 323080, 230921, 292356, 253452, 296461, 323087, 282129, 316946, 323089, 308756, 413204, 282136, 282141, 230943, 187938, 286244, 355876, 329622, 245292, 230959, 288309, 290358, 288318, 194110, 425535, 280130, 196164, 288326, 282183, 218696, 288327, 56902, 292423, 243274, 333388, 228943, 286288, 224847, 118353, 280147, 349781, 290390, 300630, 128599, 235095, 306776, 44635, 239198, 333408, 157281, 286306, 374372, 282213, 300644, 317032, 312940, 54893, 204397, 222832, 396915, 224883, 314998, 333430, 396922, 366203, 325245, 175741, 337535, 294529, 239237, 224901, 286343, 288392, 229001, 312965, 290443, 310923, 282246, 415374, 188048, 323217, 282259, 302739, 345752, 229020, 298654, 282271, 282273, 302754, 257699, 282276, 40613, 40614, 40615, 282280, 290471, 229029, 298667, 298661, 61101, 321199, 286388, 286391, 337591, 306874, 280251, 327358, 282303, 286399, 280257, 323264, 321219, 218819, 333509, 306890, 280267, 212688, 241361, 302802, 9936, 9937, 282327, 298712, 278233, 278234, 18138, 67292, 286423, 294622, 278240, 229088, 298720, 321249, 153319, 12010, 288491, 280300, 239341, 284401, 323316, 313081, 229113, 325371, 286459, 194303, 194304, 288512, 319233, 339715, 288516, 175873, 280004, 280327, 216839, 280329, 282378, 300811, 321295, 284431, 243472, 161554, 323346, 321302, 116505, 284442, 249626, 310131, 286494, 313120, 241441, 315171, 284459, 294700, 317232, 282417, 200498, 296755, 319292, 204605, 345919, 315202, 307011, 325445, 282438, 153415, 280392, 304977, 307025, 413521, 315434, 255829, 18262, 216918, 307031, 325457, 280410, 284507, 370522, 317269, 300894, 245599, 237408, 284512, 284514, 362337, 302946, 296806, 276327, 282474, 288619, 288620, 325484, 280430, 296814, 282480, 292720, 313203, 325492, 300918, 241528, 194429, 325503, 315264, 305026, 188292, 241540, 327557, 67463, 243591, 315273, 315274, 325515, 350093, 243597, 110480, 184208, 282518, 282519, 294807, 214937, 214938, 294809, 239514, 298909, 294814, 311199, 253856, 300963, 292771, 313254, 294823, 298920, 333735, 284587, 292782, 317360, 323507, 290746, 294843, 98239, 214977, 280514, 280519, 214984, 151497, 321480, 284619, 344013, 231375, 301008, 380881, 153554, 194515, 212946, 346067, 212951, 219101, 292837, 294886, 317415, 296941, 329712, 362480, 311282, 278512, 311281, 223218, 333817, 292858, 290811 ]
b3a802d58506679e0a95f295164f5230c1b1fa49
3594538011790ee4e7b53fa9453f99cc6a766720
/Sources/Networking/Calls/NetworkingClient+Requests.swift
e99480f63ca8b2370b64fdf94d4ae8f59cd0c4fa
[ "MIT" ]
permissive
linsyorozuya/Networking
b5c84f94be575601c89b7037cd8ae4f33c08b7fb
a821d40fd05b1318ca034d7fa30c6eef5b9f5905
refs/heads/master
2023-01-06T11:06:55.345585
2020-11-05T07:44:57
2020-11-05T07:44:57
310,224,041
0
0
MIT
2020-11-05T07:44:59
2020-11-05T07:41:59
null
UTF-8
Swift
false
false
1,279
swift
// // NetworkingClient+Requests.swift // // // Created by Sacha on 13/03/2020. // import Foundation import Combine public extension NetworkingClient { func getRequest(_ route: String, params: Params = Params()) -> NetworkingRequest { request(.get, route, params: params) } func postRequest(_ route: String, params: Params = Params()) -> NetworkingRequest { request(.post, route, params: params) } func putRequest(_ route: String, params: Params = Params()) -> NetworkingRequest { request(.put, route, params: params) } func patchRequest(_ route: String, params: Params = Params()) -> NetworkingRequest { request(.patch, route, params: params) } func deleteRequest(_ route: String, params: Params = Params()) -> NetworkingRequest { request(.delete, route, params: params) } internal func request(_ httpVerb: HTTPVerb, _ route: String, params: Params = Params()) -> NetworkingRequest { let req = NetworkingRequest() req.baseURL = baseURL req.logLevels = logLevels req.headers = headers req.httpVerb = httpVerb req.route = route req.params = params req.parameterEncoding = parameterEncoding return req } }
[ -1 ]
39b4f1f8bbf5d18c4a7bc02d9cb1ba469b8a7108
02fa93d8d52052e189dc16cc37b02e494ff41f9a
/D-Help/D-Help/CellBukuTableViewCell.swift
3d835094872b999ef037191e54f59f437f0c895d
[]
no_license
rizkipm/D-Helps
e054cb7c1248fd63dec1dc4f66fc7b6e56236356
765b2f5bdf6fdb1b1b4dd430561b416c0ce45b01
refs/heads/master
2021-08-18T18:39:03.331759
2017-11-23T14:39:07
2017-11-23T14:39:07
111,629,079
0
0
null
null
null
null
UTF-8
Swift
false
false
600
swift
// // CellBukuTableViewCell.swift // D-Help // // Created by Rizki Syaputra on 11/22/17. // Copyright © 2017 Rizki Syaputra. All rights reserved. // import UIKit class CellBukuTableViewCell: UITableViewCell { @IBOutlet weak var labelKategori: UILabel! @IBOutlet weak var imgCoverKat: UIImageView! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } }
[ -1 ]
390833647e831e4f3b29f389378c6a79cb3138d6
df1325fe2779e815778708c285f487a728e492e4
/NatalieExample/NatalieExample/Storyboards.swift
78012772f33c57fd13c724abb586de233baa1356
[ "MIT" ]
permissive
jai/Natalie
bf1ce2dde324f98ddc79a56d067f9a8e9d6a735c
f1066f23fe2074e160e3f1e104ed233ddc200a78
refs/heads/master
2021-01-14T11:30:41.594417
2015-05-09T14:06:54
2015-05-09T14:06:54
35,026,332
0
0
null
2015-05-04T09:34:17
2015-05-04T09:34:17
null
UTF-8
Swift
false
false
3,642
swift
// // Autogenerated by Natalie - Storyboard Generator Script. // http://blog.krzyzanowskim.com // import UIKit //MARK: - Storyboards enum Storyboards: String { case Main = "Main" private var instance:UIStoryboard { return UIStoryboard(name: self.rawValue, bundle: nil) } func instantiateInitialViewController() -> UIViewController? { switch (self) { case Main: return self.instance.instantiateInitialViewController() as! UINavigationController default: return self.instance.instantiateInitialViewController() as? UIViewController } } func instantiateViewControllerWithIdentifier(identifier: String) -> UIViewController { return self.instance.instantiateViewControllerWithIdentifier(identifier) as! UIViewController } } //MARK: - SegueKind enum SegueKind: String, Printable { case Relationship = "relationship" case Show = "show" case Presentation = "presentation" case Embed = "embed" case Unwind = "unwind" var description: String { return self.rawValue } } //MARK: - SegueProtocol protocol SegueProtocol { var identifier: String { get } } //MARK: - UIViewController extension extension UIViewController { class var storyboardIdentifier:String? { return nil } func performSegue(segue: SegueProtocol, sender: AnyObject?) { performSegueWithIdentifier(segue.identifier, sender: sender) } } extension UIStoryboardSegue { func selection() -> MainViewController.Segue? { if let identifier = self.identifier { return MainViewController.Segue(rawValue: identifier) } return nil } } //MARK: - MainViewController extension MainViewController { override class var storyboardIdentifier:String? { return "MainViewController" } class func instantiateFromStoryboard(storyboard: Storyboards) -> MainViewController! { return storyboard.instantiateViewControllerWithIdentifier(self.storyboardIdentifier!) as? MainViewController } } extension MainViewController { enum Segue: String, Printable, SegueProtocol { case ScreenOneSegueButton = "ScreenOneSegueButton" case ScreenOneSegue = "ScreenOneSegue" case ScreenTwoSegue = "ScreenTwoSegue" case SceneOneGestureRecognizerSegue = "SceneOneGestureRecognizerSegue" var kind: SegueKind? { switch (self) { case ScreenOneSegueButton: return SegueKind(rawValue: "push") case ScreenOneSegue: return SegueKind(rawValue: "push") case ScreenTwoSegue: return SegueKind(rawValue: "push") case SceneOneGestureRecognizerSegue: return SegueKind(rawValue: "push") default: preconditionFailure("Invalid value") break } } var destination: UIViewController.Type? { switch (self) { case ScreenOneSegueButton: return ScreenOneViewController.self case ScreenOneSegue: return ScreenOneViewController.self case ScreenTwoSegue: return ScreenTwoViewController.self case SceneOneGestureRecognizerSegue: return ScreenOneViewController.self default: assertionFailure("Unknown destination") return nil } } var identifier: String { return self.description } var description: String { return self.rawValue } } }
[ -1 ]
d945f8be532f29c807cb37fe12c30316b41599dc
3255ad422e33f1fdb586a9f215d2cdd4574ac4fa
/EHireConcurrancyProject/EHire/CoreDataEntityClasses/CandidateDocuments.swift
d9ce5f7d61b13dbc4f65556176019f8df0f139e8
[]
no_license
srilatha-sriram/eHire
770fa6f195b8ccd77107c2e1ba1250fd1ea74c42
3d42d547364ea34c332aa9963254f8d12272a311
refs/heads/master
2021-01-16T19:22:31.184756
2016-04-14T07:22:14
2016-04-14T07:22:14
48,106,516
0
0
null
null
null
null
UTF-8
Swift
false
false
319
swift
// // CandidateDocuments.swift // EHire // // Created by ajaybabu singineedi on 23/12/15. // Copyright © 2015 Exilant Technologies. All rights reserved. // import Foundation import CoreData class CandidateDocuments: NSManagedObject { // Insert code here to add functionality to your managed object subclass }
[ -1 ]
2845b0cac9760d7e6bfc4d35124c75be0d6b1df2
03263851dffd54fd328bd9159265ba9b81fe5677
/TheBlogTests/Scenes/PostDetails/PostDetailsWorkerTests.swift
198b290861a7acb45ae976612d0845b8e1960a52
[ "MIT" ]
permissive
marcio-garcia/TheBlog
c1bbe63e03e57d2c38024b980d94eb44da5223d9
77b02c0e963e8d918b9390687a5a466e5a2ec499
refs/heads/master
2022-12-08T08:03:59.137781
2020-09-03T22:00:31
2020-09-03T22:00:31
270,022,979
0
0
null
null
null
null
UTF-8
Swift
false
false
1,199
swift
// // PostDetailsWorkerTests.swift // TheBlog // // Created by Marcio Garcia on 07/06/20. // Copyright (c) 2020 Oxl Tech. All rights reserved. // // This file was generated by the Clean Swift Xcode Templates so // you can apply clean architecture to your iOS and Mac projects, // see http://clean-swift.com // @testable import TheBlog import XCTest class PostDetailsWorkerTests: XCTestCase { // MARK: Subject under test var sut: PostDetailsWorker! // MARK: Tests func testRequestAuthors(){ // Given let service = BlogServiceMock() sut = PostDetailsWorker(service: service) // When sut.requestComments(postId: 10, page: 1, commentsPerPage: 4, orderBy: .date, direction: .asc) { (comments, error) in let comment = comments!.first! // Then XCTAssertTrue(service.requestCommentsCalled, "requestComments should call the service requestComments method") XCTAssertEqual(comments?.count, 4, "The comments object returned is not correct") XCTAssertEqual(comment.id, 100, "The Comment object returned is not correct") } } }
[ -1 ]
ad1b6791c5eea8bcada8c95546d7cac0d7e913e2
e504d443d3fcfb70c3521e0a9393965acd75acbf
/ShiftyCalendar 2.0/EventsListVC.swift
ec1c09df9c6ca2147150cd8bb3e84f19eb5670a0
[]
no_license
antoxapa/ShiftyCalendar
c2857dd57990715adf575729c7e8f3e96a56ecba
5e980027faf93cc6424acf31fa7f12e111f308c5
refs/heads/master
2020-07-28T08:03:54.180721
2019-10-24T19:41:09
2019-10-24T19:41:09
209,359,168
0
0
null
null
null
null
UTF-8
Swift
false
false
1,937
swift
// // EventsListVC.swift // ShiftyCalendar 2.0 // // Created by Антон Потапчик on 10/13/19. // Copyright © 2019 TonyPo Production. All rights reserved. // import UIKit class EventsListVC: UIViewController { @IBOutlet weak var eventTableVIew: UITableView! private var cellID = "cell" var eventNames: [String] = [] var eventFirstDay: Date? var eventColor: UIColor? var eventRepeat: String? override func viewDidLoad() { super.viewDidLoad() DispatchQueue.main.async { self.getPlist() self.eventTableVIew.reloadData() } } func getPlist() { do { let eventInfo = try loadPropertyList() guard let firstDay = eventInfo["eventDay"] as? Date else { return } self.eventFirstDay = firstDay guard let name = eventInfo["eventName"] as? String else { return } self.eventNames.append(name) guard let color = eventInfo["eventColor"] as? String else { return } self.eventColor = UIColor(hexString: color) guard let repeating = eventInfo["repeating"] as? String else { return } self.eventRepeat = repeating } catch { print("error") } } } extension EventsListVC: UITableViewDelegate, UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return eventNames.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let cell = tableView.dequeueReusableCell(withIdentifier: cellID, for: indexPath) as? EventsListCell else { return UITableViewCell() } cell.eventNameLabel.text = eventNames[indexPath.item] return cell } }
[ -1 ]
62ddccd38a9c708ffd3d6d7c04e4904478066c60
67d1f6a1068171fd898caa650a6ebc3dd394bde9
/RosyTests/RosyTests.swift
84de3701a799e05c41d5c65171dc38eb45249d98
[]
no_license
Mrjaygreene/Romo
bc740ae83bce47a647db8eb7ba3c0cf609ac78ff
bbbb3369fd8bdb0c19e62075c3607c92368861ce
refs/heads/master
2021-01-20T22:54:45.931016
2015-08-05T00:46:08
2015-08-05T00:46:08
40,215,333
0
0
null
2015-08-05T00:14:03
2015-08-05T00:14:03
null
UTF-8
Swift
false
false
889
swift
// // RosyTests.swift // RosyTests // // Created by Jay Greene on 5/30/15. // Copyright (c) 2015 Jay Greene. All rights reserved. // import Cocoa import XCTest class RosyTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. XCTAssert(true, "Pass") } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock() { // Put the code you want to measure the time of here. } } }
[ 276481, 276489, 276509, 241720, 276555, 223318, 278618, 276577, 43109, 276581, 276582, 276585, 276589, 227439, 276592, 131189, 276606, 276613, 276627, 276631, 184475, 227492, 196773, 227495, 176314, 227528, 276684, 276687, 278742, 278746, 278753, 196834, 276709, 276715, 157944, 211193, 227576, 276737, 276744, 276748, 276753, 157970, 276760, 278810, 276764, 276774, 164162, 278856, 227658, 276813, 278862, 278863, 6482, 276822, 276831, 276835, 276847, 278898, 278908, 178571, 178578, 276900, 278951, 278954, 278961, 278965, 276919, 276925, 278985, 281037, 279002, 276958, 227813, 279019, 279022, 276998, 186893, 279054, 223769, 277048, 301634, 277066, 277094, 166507, 189036, 189037, 277101, 295535, 189042, 189043, 277133, 133774, 277138, 277141, 225943, 225944, 225956, 285353, 225962, 209581, 154291, 154294, 285372, 285374, 225997, 226001, 164563, 277203, 277204, 226004, 203478, 201442, 279269, 226033, 226035, 234238, 234241, 234245, 209670, 277254, 234250, 234253, 234256, 234263, 369432, 105246, 228129, 234280, 277289, 234283, 277294, 226097, 234289, 234301, 234304, 234305, 162626, 277316, 234311, 277325, 277327, 234323, 234326, 277339, 297822, 174949, 234343, 234346, 277354, 277360, 213876, 277366, 234361, 234366, 234367, 226181, 213894, 277381, 234381, 234395, 279456, 234404, 226214, 256937, 234409, 275371, 226222, 226223, 226227, 234419, 234425, 277435, 287677, 234430, 275397, 234445, 234450, 234451, 234454, 234457, 234466, 234477, 234492, 234495, 277505, 234498, 234503, 234506, 275468, 275469, 197647, 234517, 234530, 234531, 234534, 234539, 275500, 310317, 277550, 275505, 234555, 277563, 7229, 7230, 7231, 234560, 207938, 281666, 277585, 296018, 234583, 234584, 275547, 234594, 277603, 234603, 281707, 156785, 275571, 234622, 275590, 275591, 234632, 302217, 277640, 234642, 226451, 226452, 275607, 119963, 234652, 277665, 275620, 275625, 226476, 275628, 226481, 277686, 277690, 277694, 275671, 285929, 120055, 120056, 204041, 277792, 199971, 259363, 277800, 277806, 113966, 226609, 277809, 277815, 277821, 226624, 277825, 15686, 277831, 142669, 277838, 222548, 277845, 277852, 218462, 224606, 179552, 142689, 302438, 277862, 281962, 277868, 277871, 279919, 226675, 277878, 275831, 275832, 277882, 277883, 142716, 275839, 275847, 277896, 281992, 277900, 318864, 277907, 206228, 277911, 226711, 226712, 277919, 277920, 277925, 277927, 370091, 277936, 277939, 277940, 277943, 277946, 277952, 277957, 296391, 277962, 277965, 277969, 228823, 228824, 277977, 277980, 226781, 277983, 277988, 277993, 278002, 226805, 278005, 278008, 153095, 192010, 280077, 149007, 204313, 228917, 128583, 226888, 276040, 276045, 276046, 226897, 276050, 226906, 147036, 226910, 370271, 276085, 276088, 278140, 276097, 192131, 276100, 276101, 312972, 276116, 276117, 276120, 278170, 280220, 276126, 276146, 278195, 296628, 276156, 278214, 276211, 278285, 184086, 278299, 276257, 278316, 159533, 276279, 276282, 288574, 276287, 276298, 188246, 173936, 276344, 276350, 227199, 1923, 40850, 40853, 44952, 276385, 276394, 276400, 276401, 276408, 161722, 276422, 276430, 276438, 153566, 276450, 276454, 276462, 276463, 276468, 276469, 276475, 276478 ]
b772c84ad607c98dbcf6aa3b5b8cdf9ecec63727
5594fb29e647fcfad4f98a42718e1346cbe52124
/ContactsUISample/ViewController.swift
789cd0412d0be110697d31ca54cadfa6ad7888b7
[]
no_license
koogawa/ContactsUISample
91f8a9d9d005e335126d76968f86b02cc3e3b867
b14e0cb925fe172cb5b7e64dbdd865c6a0d5c82b
refs/heads/master
2021-01-10T08:32:39.695797
2015-09-27T14:35:41
2015-09-27T14:35:41
43,244,720
2
1
null
null
null
null
UTF-8
Swift
false
false
2,177
swift
// // ViewController.swift // ContactsUISample // // Created by koogawa on 2015/09/27. // Copyright © 2015 Kosuke Ogawa. All rights reserved. // import UIKit import Contacts import ContactsUI class ViewController: UIViewController, CNContactPickerDelegate { 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. } // MARK: Private methods @IBAction func showContactPickerController() { let pickerViewController = CNContactPickerViewController() pickerViewController.delegate = self // Display only a person's phone, email, and postal address let displayedItems = [CNContactPhoneNumbersKey, CNContactEmailAddressesKey, CNContactPostalAddressesKey] pickerViewController.displayedPropertyKeys = displayedItems // Show the picker self.presentViewController(pickerViewController, animated: true, completion: nil) } // MARK: CNContactPickerDelegate methods // Called when a property of the contact has been selected by the user. func contactPicker(picker: CNContactPickerViewController, didSelectContactProperty contactProperty: CNContactProperty) { let contact = contactProperty.contact let contactName = CNContactFormatter.stringFromContact(contact, style: .FullName) ?? "" let propertyName = CNContact.localizedStringForKey(contactProperty.key) let title = "\(contactName)'s \(propertyName)" dispatch_async(dispatch_get_main_queue()) { let alert = UIAlertController(title: title, message: contactProperty.value?.description, preferredStyle: .Alert) alert.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil)) self.presentViewController(alert, animated: true, completion: nil) } } // Called when the user taps Cancel. func contactPickerDidCancel(picker: CNContactPickerViewController) { } }
[ -1 ]
c06de0fe57e32d9003563249d05a23eeaa58723c
6556094a425cbf65261b257fdeee3b78f1922a8c
/iMusic/MultimediaDataHelper.swift
3ef77a26e0cc66281be1ca99ada975b2962b9a2a
[]
no_license
OussamaBentalha/iMusic
466eb32ae65e5d43d501cd823a6cca706cb37590
03fe5c824e441a6b12eeab5b64b3d652a6593cbf
refs/heads/master
2021-05-01T03:29:59.623300
2017-01-08T22:32:24
2017-01-08T22:32:24
73,277,995
0
0
null
null
null
null
UTF-8
Swift
false
false
3,532
swift
// // MultimediaDataHelper.swift // iMusic // // Created by Akiro on 28/11/2016. // Copyright © 2016 Esgi. All rights reserved. // import UIKit import Foundation class MultimediaDataHelper: NSObject { static let sharedInstance = MultimediaDataHelper() let urlPathMusic :String = "http://localhost:8080/api/musics/" let urlPathVideo :String = "http://localhost:8080/api/videos/" override init() { } func musics(_ completion: @escaping (_ result: [Music]) -> Void){ var musics : [Music] = [] let url: URL = URL(string: urlPathMusic)! let session = URLSession.shared let task = session.dataTask( with: url, completionHandler: { data, response, error -> Void in if error != nil { // Erreur dans la requete : Affiche directement dans la console print(error!.localizedDescription) } do{ let jsonResult = try JSONSerialization.jsonObject(with: data!, options: .allowFragments) as! NSArray musics = self.musicParser(jsonResult) completion(musics) } catch{ print("Erreur lors de la récuperation des musiques") } } ) task.resume() } func videos(_ completion: @escaping (_ result: [Video]) -> Void){ var videos : [Video] = [] let url: URL = URL(string: urlPathVideo)! let session = URLSession.shared let task = session.dataTask( with: url, completionHandler: { data, response, error -> Void in if error != nil { // Erreur dans la requete : Affiche directement dans la console print(error!.localizedDescription) } do{ let jsonResult = try JSONSerialization.jsonObject(with: data!, options: .allowFragments) as! NSArray videos = self.videoParser(jsonResult) completion(videos) } catch{ print("Erreur lors de la récuperation des musiques") } } ) task.resume() } func musicParser(_ json : NSArray) -> [Music]{ var musics : [Music] = [] for object in json{ let title = (object as AnyObject).object(forKey: "title") as! String let author = (object as AnyObject).object(forKey: "author") as! String let id = (object as AnyObject).object(forKey: "_id") as! String musics.append( Music(id : id, title : title, author : author) ); } return musics; } func videoParser(_ json : NSArray) -> [Video]{ var videos : [Video] = [] for object in json{ let title = (object as AnyObject).object(forKey: "title") as! String let author = (object as AnyObject).object(forKey: "author") as! String let id = (object as AnyObject).object(forKey: "_id") as! String videos.append( Video(id : id, title : title, author : author) ); } return videos; } }
[ -1 ]
d3fa74483c5ee90da01e3b11c97e4d26a3b51554
1ee9d1935afef8d57b69413d556f1d6f04d2c8aa
/DesignPattern/Interpreter.swift
9349732ab4c777fbfa5307738be55c943d321cfb
[ "Apache-2.0" ]
permissive
CHENJC2013/DesignPatternSwift
f17c0108c3f9c1c54acd8e671efeafb7506ff74a
bd251fe5405bc2e14b50d0c95e66bb3a65405642
refs/heads/master
2020-04-10T15:48:26.461537
2019-04-15T02:24:10
2019-04-15T02:24:10
161,123,536
0
0
null
null
null
null
UTF-8
Swift
false
false
2,102
swift
// // Interpreter.swift // DesignPattern // // Created by ChenJiCai on 2018/12/19. // Copyright © 2018年 CJC. All rights reserved. // import Foundation //AbstractExpression(抽象表达式):在抽象表达式中声明了抽象的解释操作,它是所有终结符表达式和非终结符表达式的公共父类。 protocol AbstractExpression { func interpret(ctx: Context) } //TerminalExpression(终结符表达式):终结符表达式是抽象表达式的子类,它实现了与文法中的终结符相关联的解释操作,在句子中的每一个终结符都是该类的一个实例。通常在一个解释器模式中只有少数几个终结符表达式类,它们的实例可以通过非终结符表达式组成较为复杂的句子。 class TerminalExpression: AbstractExpression { func interpret(ctx: Context) { //终结符表达式的解释操作 } } //NonterminalExpression(非终结符表达式):非终结符表达式也是抽象表达式的子类,它实现了文法中非终结符的解释操作,由于在非终结符表达式中可以包含终结符表达式,也可以继续包含非终结符表达式,因此其解释操作一般通过递归的方式来完成。 class NonterminalExpression: AbstractExpression { var letf: AbstractExpression? var right: AbstractExpression? func interpret(ctx: Context) { //递归调用每一个组成部分的interpret()方法 //在递归调用时指定组成部分的连接方式,即非终结符的功能 } } // Context(环境类):环境类又称为上下文类,它用于存储解释器之外的一些全局信息,通常它临时存储了需要解释的语句。 // 当系统无须提供全局公共信息时可以省略环境类,可根据实际情况决定是否需要环境类。 class Context { let dic = Dictionary<String, Any>() func assign(key: String, value: String) { //往环境类中设值 } func lookup(key: String) -> String { //获取存储在环境类中的值 return "" } }
[ -1 ]
dba4f01f4f8209d0a44b86760d515e048d4ed032
b159f031ebde10d6d0147a3eaf605cb1b10ff06b
/CocoaPodsProjTest/AppDelegate.swift
e401d5d588e6ae4aa449254f093ae037a9039a67
[]
no_license
HenL/AlamofireExample
43b1166ba3e6b0e6886e029bc9cfeaf6134e3ecb
9bde0b5e7643784099c437926cd7ed052bfd28e1
refs/heads/master
2021-01-10T17:50:12.444650
2015-10-25T09:48:35
2015-10-25T09:48:35
44,179,673
0
0
null
null
null
null
UTF-8
Swift
false
false
2,149
swift
// // AppDelegate.swift // CocoaPodsProjTest // // Created by Hen Levy on 07/10/2015. // Copyright © 2015 Hen Levy. 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, 303241, 417930, 311436, 303244, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 278760, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 278849, 319809, 319810, 319814, 311623, 319818, 311628, 229709, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 319978, 279020, 172526, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 287238, 172550, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 287390, 295583, 303773, 172702, 287394, 230045, 303780, 172705, 287398, 172707, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 279231, 287423, 328384, 287427, 312006, 107208, 279241, 107212, 172748, 287436, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 312035, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 222018, 295755, 377676, 148302, 287569, 279383, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 213895, 320391, 304007, 304009, 304011, 230284, 304013, 213902, 279438, 295822, 189329, 295825, 304019, 189331, 279445, 58262, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 304063, 238528, 304065, 189378, 213954, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 295949, 197645, 230413, 320528, 140312, 295961, 238620, 197663, 304164, 189479, 304170, 238641, 312374, 238652, 238655, 230465, 238658, 296004, 336964, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 279661, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 165038, 238766, 230576, 238770, 304311, 230592, 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, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 230718, 296259, 378181, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 181626, 304506, 304505, 181631, 312711, 312712, 296331, 288140, 230800, 288144, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 173488, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 280014, 312783, 288208, 230865, 288210, 370130, 288212, 280021, 288214, 222676, 239064, 288217, 288218, 280027, 288220, 329177, 239070, 288224, 288226, 370146, 280036, 288229, 280038, 288230, 288232, 280034, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 296439, 288250, 402942, 148990, 296446, 206336, 296450, 321022, 230916, 230919, 214535, 370187, 304651, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 280264, 206536, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 419570, 321266, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 304968, 280393, 280402, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280458, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 223303, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 280671, 223327, 149599, 321634, 149601, 149603, 329830, 280681, 313451, 223341, 280687, 313458, 280691, 215154, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 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, 281084, 240124, 305662, 305664, 240129, 305666, 305668, 240132, 223749, 281095, 338440, 150025, 223752, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 199262, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 199367, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 207661, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 240519, 322440, 338823, 314249, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 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, 282481, 110450, 315251, 315249, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 282514, 298898, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 217179, 315483, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 282931, 307508, 315701, 307510, 332086, 151864, 307512, 176435, 307515, 168245, 282942, 307518, 151874, 282947, 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, 283095, 127447, 299481, 176605, 242143, 291299, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 127497, 233994, 135689, 291341, 233998, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 381677, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 283421, 234269, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 201603, 291714, 234373, 226182, 234375, 291716, 226185, 308105, 234379, 234384, 234388, 234390, 226200, 324504, 234393, 209818, 308123, 324508, 234398, 234396, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 291754, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 226245, 234437, 234439, 234434, 234443, 291788, 193486, 234446, 193488, 275406, 234449, 316370, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 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, 283805, 234653, 324766, 119967, 234657, 300189, 324768, 242852, 283813, 234661, 300197, 234664, 275626, 234667, 316596, 308414, 234687, 316610, 300226, 226500, 234692, 300229, 308420, 283844, 308418, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 283904, 300289, 292097, 300292, 300294, 275719, 300299, 177419, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 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, 284099, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 259567, 300527, 308720, 226802, 316917, 308727, 292343, 300537, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194101, 284215, 194103, 284218, 226877, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 366155, 276043, 317004, 284238, 226895, 284241, 194130, 284243, 276052, 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, 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, 317221, 227109, 358183, 186151, 276268, 300845, 194351, 243504, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 276466, 227314, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 276539, 235581, 325692, 178238, 276544, 284739, 292934, 243785, 276553, 350293, 350295, 194649, 227418, 309337, 194654, 227423, 350302, 178273, 227426, 194657, 194660, 276579, 227430, 276583, 309346, 309348, 309350, 309352, 309354, 350308, 276590, 350313, 227440, 350316, 284786, 350321, 276595, 301167, 350325, 350328, 292985, 301178, 292989, 292993, 301185, 350339, 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, 227583, 276735, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 211241, 325937, 276789, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 285051, 211324, 227709, 285061, 317833, 178572, 285070, 178575, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 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, 285320, 277128, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 318132, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 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, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 277368, 15224, 236408, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 276586, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 244731, 121850, 302075, 293882, 293887, 277504, 277507, 277511, 277519, 293908, 277526, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 277608, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 253064, 302218, 285835, 294026, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 285862, 277671, 302248, 64682, 277678, 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, 277832, 384328, 277836, 294221, 326991, 294223, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 277892, 327046, 253320, 310665, 318858, 277898, 277894, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 277923, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 64966, 245191, 163272, 302534, 310727, 277959, 292968, 302541, 277966, 302543, 277963, 310737, 277971, 277975, 286169, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 278003, 310772, 228851, 278006, 212472, 278009, 40440, 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, 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, 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 ]
7ac622c91c9d0759bcfee3ecd51858c7fcb90c80
65240f1946709072ab17b04f0c53f1ba3153e00f
/Bekitzur/AppDelegate.swift
edffdfc5b3e4e0d27244f90b82515a52417ecfd5
[]
no_license
Ulanmax/WordRegions
3a2943fad6340b13aadb5048a81c588bcc4941e4
2b69dee367bab682eb56c92bd1442e59b4dc0eb4
refs/heads/master
2022-10-07T05:35:03.448164
2020-06-05T08:55:04
2020-06-05T08:55:04
269,574,314
0
0
null
null
null
null
UTF-8
Swift
false
false
740
swift
// // AppDelegate.swift // Bekitzur // // Created by Maks Niagolov on 2020/06/05. // Copyright © 2020 Maksim Niagolov. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. let window = UIWindow(frame: UIScreen.main.bounds) Application.shared.configureMainInterface(in: window) Log.initializeLogging() self.window = window return true } }
[ 103936, 214915, 128651, 241551, 317202, 346773, 190873, 124057, 361886, 245023, 130472, 362284, 205756, 130494, 340801, 270920, 310217, 360156, 334300, 253030, 314478, 302448, 361590, 194940 ]
7ca483b9d28384dfaa47aa41b2e15ea4d25f0228
a60639cb8d4ab563b649c7cfb57b2203ac651387
/ViewSample/ContentView.swift
186cc89f40a1880929e0a4f09f7c6423514c6b89
[]
no_license
hokuron/swiftui-view-components
d672284102e82d8231d88b6f4f92b8d934d75d2b
e69ad11fce767875ed1fcf23cc673cc907572814
refs/heads/master
2020-12-08T16:46:06.823892
2020-03-01T15:31:33
2020-03-01T15:31:33
233,037,413
0
0
null
null
null
null
UTF-8
Swift
false
false
2,873
swift
// // ContentView.swift // ViewSample // // Created by SHIMIZU Takuma on 2020/01/10. // import SwiftUI private struct LoginView: View { @State private var username = "" @State private var password = "" @State private var isUsernameFieldFocused = false @State private var isPasswordFieldFocused = false var body: some View { VStack(spacing: 24) { UnderlineTextField(title: "Username", text: $username, isFocused: $isUsernameFieldFocused, onEditingChanged: { isChanged in if isChanged { self.isPasswordFieldFocused = !self.password.isEmpty } return !self.username.isEmpty }) UnderlineSecureField(title: "Password", text: $password, isFocused: $isPasswordFieldFocused) { !self.password.isEmpty } } .padding(.horizontal) } } private struct CircularSliderSampleView: View { @State private var value = 26.0 @State private var step = 0.0 private let numberFormatter: NumberFormatter = { let formatter = NumberFormatter() formatter.minimumFractionDigits = 1 formatter.maximumFractionDigits = 1 return formatter }() var body: some View { ZStack(alignment: .circularSliderCenter) { CircularSlider(value: $value, range: 1...100, step: step) VStack(spacing: 24) { Text(formatted(value)) .font(.system(size: 80, design: .monospaced)) Stepper("Step: \(formatted(step))", value: $step, in: 0...100, step: 0.1) .padding(.horizontal, 96) } .alignmentGuide(VerticalAlignment.circularSliderCenter) { $0[VerticalAlignment.center] } } .padding(.horizontal) } private func formatted(_ value: Double) -> String { return numberFormatter.string(from: NSNumber(value: value))! } } struct ContentView: View { private let components = [ "UnderLineTextField": AnyView(LoginView()), "HalfCircleSlider": AnyView(CircularSliderSampleView()), ] @State private var selection: Int = 4 var body: some View { return ListPicker(selection: $selection) NavigationView { List(components.keys.sorted(), id: \.self) { key in NavigationLink(key, destination: self.components[key]!) } .listStyle(GroupedListStyle()) .navigationBarTitle("Components", displayMode: .inline) } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
[ -1 ]
cf8c9ccafce75e5597bf60c9c7704a27247e6516
1b3ea588594fd01b46167a0dfabb269df82f97fc
/My Counter/CommonView/MainTextFiled.swift
f209e3088f6c99e249777f1645c833a272c81be9
[]
no_license
hosituan/my-counter-iOS
e3ee422007638fdd4fd5967ebd04e2008e32c11d
3d13a9720bdf91c859958cf15677f306844d34c0
refs/heads/master
2023-06-28T19:36:56.384240
2021-07-28T02:40:39
2021-07-28T02:40:39
350,661,939
1
0
null
null
null
null
UTF-8
Swift
false
false
1,610
swift
// // MainTextFiled.swift // My Counter // // Created by Hồ Sĩ Tuấn on 30/03/2021. // import Foundation import SwiftUI struct MainTextField: View { var title = "" var subTitle: String? var placeHolder = "" var isSecure = false var isEmail = false @Binding var value: String var body: some View { VStack(alignment: .leading, spacing: 0) { Text(title) .modifier(TextSize14Bold()) .padding(.bottom, 3) if let sub = subTitle { Text(sub) .foregroundColor(Color(UIColor(hexString: "59648f"))) .font(.system(size: 10, weight: .regular, design: .default)) } ZStack { if isSecure { SecureField(placeHolder, text: $value) .textFieldStyle(PlainTextFieldStyle()) .padding([.leading, .trailing], 16) .frame(height: 56) .border(Color.Count.PrimaryColor, width: 1) } else { TextField(placeHolder, text: $value) .textFieldStyle(PlainTextFieldStyle()) .autocapitalization(.none) .keyboardType(isEmail ? .emailAddress : .default) .padding([.leading, .trailing], 16) .frame(height: 56) .border(Color.Count.PrimaryColor, width: 1) } }.padding(.top, 8) } } }
[ -1 ]
5733f1bb3445ed70d0099cfe97eb7c586477af3d
e19fc853fc3d55575801b20ed26aa9bdfd2eac9a
/SuperSenha/ViewController.swift
c4a34f6fbdc3061feae846a091098f58c071ef48
[]
no_license
viniciustsalomao/passwordGenerator
9ee9382bdd6ebbcd1ab8b564f3de13acad9316c1
24dab15f4da7f9f809e41969ffe4945ef0ddea16
refs/heads/master
2022-12-08T14:04:26.391458
2020-08-21T01:51:20
2020-08-21T01:51:20
289,149,446
0
0
null
null
null
null
UTF-8
Swift
false
false
1,494
swift
// // ViewController.swift // SuperSenha // // Created by Vinícius Tinajero Salomão on 20/08/20. // Copyright © 2020 Vinícius Tinajero Salomão. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var tfTotalPasswords: UITextField! @IBOutlet weak var tfNumberOfCharacters: UITextField! @IBOutlet weak var swLetters: UISwitch! @IBOutlet weak var swNumbers: UISwitch! @IBOutlet weak var swCapitalLetters: UISwitch! @IBOutlet weak var swSpecialCharacters: UISwitch! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { let passwordsViewController = segue.destination as! PasswordsViewController if let numberOfPasswords = Int(tfTotalPasswords.text!) { passwordsViewController.numberOfPasswords = numberOfPasswords } if let numberOfCharacters = Int(tfNumberOfCharacters.text!) { passwordsViewController.numberOfCharacters = numberOfCharacters } passwordsViewController.useLetters = swLetters.isOn passwordsViewController.useNumbers = swNumbers.isOn passwordsViewController.useCapitalLetters = swCapitalLetters.isOn passwordsViewController.useSpecialCharacters = swSpecialCharacters.isOn view.endEditing(true) } }
[ -1 ]
9088e5347731b7935b60b8695c7092cbbaf76d30
861f5c09e806124e4344e8438c442af4b01d2199
/BSToastDemo/BSToastDemo/ViewController.swift
64c0a12ecbd8bf8807f9a9c2123e0c9487e8c211
[ "MIT" ]
permissive
SlayterDev/BSToast
0e66ef0d345d94f35d2bd956d5effba3dc8dfdb3
26fa33c94aac75a9e3b1b472f19008f9ae4999eb
refs/heads/master
2021-01-22T09:12:49.176733
2016-02-25T14:20:30
2016-02-25T14:20:30
42,747,902
4
0
null
null
null
null
UTF-8
Swift
false
false
1,160
swift
// // ViewController.swift // BSToastDemo // // Created by Bradley Slayter on 9/18/15. // Copyright © 2015 Flipped Bit. All rights reserved. // import UIKit class ViewController: UIViewController { let toastWidth = UIScreen.mainScreen().bounds.width * 0.4 let toastHeight: CGFloat = 90.0 override func viewDidLoad() { super.viewDidLoad() // Create a button and add it to the screen let btn = UIButton(type: .System) btn.setTitle("Show", forState: .Normal) btn.addTarget(self, action: "showToast:", forControlEvents: .PrimaryActionTriggered) btn.frame = CGRectMake(0, 0, 200, 65) btn.center = CGPointMake(self.view.center.x, self.view.center.y - (self.view.center.y/2)) self.view.addSubview(btn) } func showToast(sender: AnyObject) { // Create a toast notification and show it let toast = BSToast(frame: CGRectMake(0, 0, toastWidth, toastHeight), text: "Here's a toast notification") toast.center = self.view.center toast.showInViewWithDuration(1.75, view: self.view) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ -1 ]
cf52c3d25a07304226b614cc1f5fd8131b8384f4
365b5f692bdd407845a09e9fea33ef51dd6b8b5f
/RiseApp/Controller/AddPhoto/Dec_SharePhotoController.swift
a0b2b8e2638a693d2c644a142d9756a2beb880ac
[]
no_license
denizmersinlioglu/instagram_clone
13b667922e19392e6b388f88b31a9b93445f5029
28cb7f3f1aaafe35655b8a5e282535a5e60ed201
refs/heads/master
2020-04-07T14:40:43.559439
2018-07-27T19:21:51
2018-07-27T19:21:51
158,456,287
0
0
null
null
null
null
UTF-8
Swift
false
false
768
swift
// // SharePhotoControllerUI.swift // RiseApp // // Created by Deniz Mersinlioğlu on 11.07.2018. // Copyright © 2018 ArcheTech. All rights reserved. // import UIKit import Firebase class SharePhotoController: UIViewController { let textView: UITextView = { let tv = UITextView() tv.font = UIFont.systemFont(ofSize: 14) return tv }() let imageView: UIImageView = { let iv = UIImageView() iv.backgroundColor = .red iv.contentMode = .scaleAspectFill iv.clipsToBounds = true return iv }() var selectedImage: UIImage?{ didSet{ guard let selectedImage = selectedImage else {return} imageView.image = selectedImage } } }
[ -1 ]
a6073dbfa3d763eb69bf3adb4f44f1dec95c7589
ac54432fcdc841bcfad726cd1314859c79e5dd0b
/SequencesCollectionsAndIteratorsTests/CollatzTest.swift
f5d3015342f02518b2e31a6216f96c9b07bac88e
[]
no_license
amyroberson/Sequences
e41af49adc0742e6431a24282080448f74bcdbd7
6ab630ec82b88af0aeb3a8ddd25de9f829521139
refs/heads/master
2021-01-12T08:10:33.589309
2016-12-15T01:25:12
2016-12-15T01:25:12
76,495,778
0
0
null
null
null
null
UTF-8
Swift
false
false
883
swift
// // CollatzTest.swift // SequencesCollectionsAndIterators // // Created by Amy Roberson on 12/14/16. // Copyright © 2016 Amy Roberson. All rights reserved. // import XCTest @testable import SequencesCollectionsAndIterators class CollatzTest: XCTestCase { func testCollatz1(){ let n = Collatz(n:3) let expected: [Int] = [10, 5, 16, 8, 4, 2, 1] let result = n.collatzConjecture() XCTAssertEqual(result, expected) } func testCollatz2(){ let n = Collatz(n:7) let expected: [Int] = [22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1] let result = n.collatzConjecture() XCTAssertEqual(result, expected) } func testCollatz3(){ let n = Collatz(n:2) let expected: [Int] = [1] let result = n.collatzConjecture() XCTAssertEqual(result, expected) } }
[ -1 ]
c1a8a7bd7cf9ca335ffa7d82d916d7e3be5b56e7
3ebf091381faee19c3d9b5a897f5cb29ea201491
/Commons/Sources/Commons/FoundationCommons.swift
5c8c3b9ebddac7f58824ec685cba92018758abb1
[ "MIT" ]
permissive
qvacua/vimr
8bfb23f7df78386c68b31bda1655e700d663a985
e34d9765d269ea823b526c3e4e250f9dc7271d17
refs/heads/master
2023-06-28T10:12:22.515577
2023-01-03T17:14:18
2023-01-03T17:14:18
17,300,388
5,800
259
MIT
2023-03-20T03:26:42
2014-02-28T21:31:38
Swift
UTF-8
Swift
false
false
4,145
swift
/** * Tae Won Ha - http://taewon.de - @hataewon * See LICENSE */ import Foundation import os public extension Array where Element: Hashable { // From https://stackoverflow.com/a/46354989 func uniqued() -> [Element] { var seen = Set<Element>() return self.filter { seen.insert($0).inserted } } } public extension Array { func data() -> Data { self.withUnsafeBufferPointer(Data.init) } } public extension RandomAccessCollection where Index == Int { func parallelMap<T>(chunkSize: Int = 1, _ transform: @escaping (Element) -> T) -> [T] { let count = self.count guard count > chunkSize else { return self.map(transform) } var result = [T?](repeating: nil, count: count) // If we don't use Array.withUnsafeMutableBufferPointer, // then we get crashes. result.withUnsafeMutableBufferPointer { pointer in if chunkSize == 1 { DispatchQueue.concurrentPerform(iterations: count) { i in pointer[i] = transform(self[i]) } } else { let chunkCount = Int(ceil(Double(self.count) / Double(chunkSize))) DispatchQueue.concurrentPerform(iterations: chunkCount) { chunkIndex in let start = Swift.min(chunkIndex * chunkSize, count) let end = Swift.min(start + chunkSize, count) (start..<end).forEach { i in pointer[i] = transform(self[i]) } } } } return result.map { $0! } } func groupedRanges<T: Equatable>(with marker: (Element) -> T) -> [ClosedRange<Index>] { if self.isEmpty { return [] } if self.count == 1 { return [self.startIndex...self.startIndex] } var result = [ClosedRange<Index>]() result.reserveCapacity(self.count / 2) let inclusiveEndIndex = self.endIndex - 1 var lastStartIndex = self.startIndex var lastEndIndex = self.startIndex var lastMarker = marker(self.first!) // self is not empty! for i in self.startIndex..<self.endIndex { let currentMarker = marker(self[i]) if lastMarker == currentMarker { if i == inclusiveEndIndex { result.append(lastStartIndex...i) } } else { result.append(lastStartIndex...lastEndIndex) lastMarker = currentMarker lastStartIndex = i if i == inclusiveEndIndex { result.append(i...i) } } lastEndIndex = i } return result } } public extension NSRange { static let notFound = NSRange(location: NSNotFound, length: 0) var inclusiveEndIndex: Int { self.location + self.length - 1 } } public extension URL { func isParent(of url: URL) -> Bool { guard self.isFileURL, url.isFileURL else { return false } let myPathComps = self.pathComponents let targetPathComps = url.pathComponents guard targetPathComps.count == myPathComps.count + 1 else { return false } return Array(targetPathComps[0..<myPathComps.count]) == myPathComps } func isAncestor(of url: URL) -> Bool { guard self.isFileURL, url.isFileURL else { return false } let myPathComps = self.pathComponents let targetPathComps = url.pathComponents guard targetPathComps.count > myPathComps.count else { return false } return Array(targetPathComps[0..<myPathComps.count]) == myPathComps } func isContained(in parentUrl: URL) -> Bool { if parentUrl == self { return false } let pathComps = self.pathComponents let parentPathComps = parentUrl.pathComponents guard pathComps.count > parentPathComps.count else { return false } guard Array(pathComps[0..<parentPathComps.endIndex]) == parentPathComps else { return false } return true } var parent: URL { if self.path == "/" { return self } return self.deletingLastPathComponent() } var shellEscapedPath: String { self.path.shellEscapedPath } var isRegularFile: Bool { (try? self.resourceValues(forKeys: [.isRegularFileKey]))?.isRegularFile ?? false } var isHidden: Bool { (try? self.resourceValues(forKeys: [.isHiddenKey]))?.isHidden ?? false } var isPackage: Bool { (try? self.resourceValues(forKeys: [.isPackageKey]))?.isPackage ?? false } } private let log = OSLog(subsystem: "com.qvacua.vimr.commons", category: "general")
[ -1 ]
00230855bd18826c22b886f28e461aa783c767c2
416bea267cccb09bf6f9bf96cb820cbf2eb344fb
/Tests/Core/AWSClientRuntimeTests/Config/FieldResolverTests.swift
3a9b3063af885a7cc9c4f7fab4f7d9cd84ca6a83
[ "LicenseRef-scancode-unknown-license-reference", "Swift-exception", "MIT", "Apache-2.0" ]
permissive
awslabs/aws-sdk-swift
7489f07780e10e35791e87021dc346e689b3c48b
93a2e5bb2553e96a0f78e8fee312c47841ed9af9
refs/heads/main
2023-09-01T17:52:42.404070
2023-08-30T20:48:14
2023-08-30T20:48:14
278,475,105
302
50
Apache-2.0
2023-09-14T21:59:27
2020-07-09T21:31:12
Swift
UTF-8
Swift
false
false
2,852
swift
// // Copyright Amazon.com Inc. or its affiliates. // All Rights Reserved. // // SPDX-License-Identifier: Apache-2.0 // import Foundation import XCTest @testable @_spi(FileBasedConfig) import AWSClientRuntime class FieldResolverTests: XCTestCase { let envVarName = "TEST_ENV_VAR_NAME" let configFieldName = "config_field_name" var fileBasedConfig: FileBasedConfiguration = try! CRTFileBasedConfiguration( configFilePath: Bundle.module.path(forResource: "field_resolver_tests", ofType: nil)!, credentialsFilePath: nil ) func test_value_itReturnsTheConfigValue() { let expected = Int.random(in: 1...Int.max) let subject = FieldResolver(configValue: expected, envVarName: envVarName, configFieldName: configFieldName, fileBasedConfig: fileBasedConfig, profileName: nil, converter: { Int($0) }) XCTAssertEqual(subject.value, expected) } func test_value_itReturnsTheEnvironmentValueWhenNoConfigValueIsSet() { let expected = Int.random(in: Int.min...Int.max) setenv(envVarName, "\(expected)", 1) let subject = FieldResolver(configValue: nil, envVarName: envVarName, configFieldName: configFieldName, fileBasedConfig: fileBasedConfig, profileName: nil, converter: { Int($0) }) XCTAssertEqual(subject.value, expected) unsetenv(envVarName) } func test_value_itReturnsTheConfigFileValueFromTheDefaultProfileWhenNoConfigProfileOrEnvProfileIsSet() { let expected = 123 let subject = FieldResolver(configValue: nil, envVarName: envVarName, configFieldName: configFieldName, fileBasedConfig: fileBasedConfig, profileName: nil, converter: { Int($0) }) XCTAssertEqual(subject.value, expected) } func test_value_itReturnsTheConfigFileValueFromAltProfile1WhenProfileSpecifiedInParam() { let expected = 456 let subject = FieldResolver(configValue: nil, envVarName: envVarName, configFieldName: configFieldName, fileBasedConfig: fileBasedConfig, profileName: "alt-profile-1", converter: { Int($0) }) XCTAssertEqual(subject.value, expected) } func test_value_itReturnsTheConfigFileValueFromAltProfile2WhenProfileSpecifiedInEnvVar() { let expected = 789 setenv("AWS_PROFILE", "alt-profile-2", 1) let subject = FieldResolver(configValue: nil, envVarName: envVarName, configFieldName: configFieldName, fileBasedConfig: fileBasedConfig, profileName: nil, converter: { Int($0) }) XCTAssertEqual(subject.value, expected) unsetenv("AWS_PROFILE") } func test_value_itReturnsNilWhenNoSourceIsSet() { let subject = FieldResolver(configValue: nil, envVarName: envVarName, configFieldName: configFieldName, fileBasedConfig: fileBasedConfig, profileName: "no-such-profile", converter: { Int($0) }) XCTAssertNil(subject.value) } }
[ -1 ]
a63a40d7ebad8d4a5993cbd3f9766633cc2993e7
6c45092d53203ec8ccc94d355fa6a8af94de00f8
/testAPI/PlaceRequest.swift
10efdf651b58f1d8c42c45c0624069459b1db5e5
[]
no_license
buixuanhuy5798/DemoRX
9b5c78123007f5eb18b8ea44e8e778ef29ba0c43
8ebcbdd32f7a78620352e317a43599654c0e7ffb
refs/heads/master
2020-08-05T21:57:32.478693
2019-10-04T03:04:29
2019-10-04T03:04:29
212,725,798
0
1
null
null
null
null
UTF-8
Swift
false
false
755
swift
// // PlaceService.swift // TestRx // // Created by Bùi Xuân Huy on 10/1/19. // Copyright © 2019 huy. All rights reserved. // import Alamofire import ObjectMapper import AlamofireObjectMapper import RxSwift class PlaceRequest { static func getPlace() -> Observable<[Place]> { return Observable.create({ observable -> Disposable in let request = Alamofire.request(APIUrl.placeUrl).responseObject { (reponse: DataResponse<AllPlace>) in if let places = reponse.value { observable.onNext(places.places!) observable.onCompleted() } } return Disposables.create { request.cancel() } }) } }
[ -1 ]
c2007e86680473cc973b4935595040ba4cf4780e
93d39bbd32e70e1a44fcb53f44bd1cd9270c8df0
/DemoLocalNotification/AppDelegate.swift
0377f578863cf4c908c860459158197295e78787
[]
no_license
jerbeers/DemoLocalNotification
5552b878cb4be7c78901e7e86828a36f4f38d468
8fb553888283e6ec02fc4420bed13edaed988e24
refs/heads/master
2021-05-03T05:24:56.724547
2016-10-29T18:13:41
2016-10-29T18:13:41
72,301,649
2
0
null
null
null
null
UTF-8
Swift
false
false
1,042
swift
// // AppDelegate.swift // DemoLocalNotification // // Created by Jerry Beers on 10/29/16. // Copyright © 2016 Five Pack Creative, Inc. All rights reserved. // import UIKit import UserNotifications @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { if #available(iOS 10.0, *) { let center = UNUserNotificationCenter.current() center.delegate = self center.requestAuthorization(options: [.alert, .badge, .sound]) { (granted, error) in } } return true } @available(iOS 10.0, *) func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { completionHandler(.alert) } }
[ 319547 ]
5655873fef7d8b1537c0eca184e7b41b4690faa7
d0280f41da8d9f0dba676fadd277e6bdf741149d
/validation-test/compiler_crashers_fixed/01796-swift-modulefile-getdecl.swift
cb4cd0ac07af90f2fce0f0f5d644a8bfb23eda45
[ "Apache-2.0", "Swift-exception" ]
permissive
zhongaiyemaozi/swift
310a5867a3f797986ddaa3769589c5cc484ee47a
ca165e5c4afae294ae386c2ca4593e5f22c416f0
refs/heads/master
2021-01-12T10:05:08.416860
2016-12-13T09:00:12
2016-12-13T09:00:12
76,355,607
4
0
null
2016-12-13T12:11:21
2016-12-13T12:11:21
null
UTF-8
Swift
false
false
515
swift
// This source file is part of the Swift.org open source project // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // RUN: not %target-swift-frontend %s -typecheck func b(b: Hashable> A { A<T : [1](") class a { deinit { func f: A { } init(T: Any, let a { } protocol e : a { func a
[ 94532, 91316, 91317, 74943, 74947, 74949, 74951, 74952, 74953, 74954, 74956, 74958, 74959, 74962, 74964, 91351, 74970, 74974, 74975, 74976, 74977, 74978, 74979, 74981, 74982, 74983, 74984, 74985, 74987, 74988, 74991, 74993, 74997, 75011, 75012, 75016, 75017, 75020, 75021, 75025, 75026, 75035, 75036, 75037, 75040, 75043, 75045, 75047, 75049, 75050, 75051, 75053, 75055, 75056, 75066, 75068, 75071, 75075, 75076, 75077, 75079, 75082, 75092, 75097, 75098, 75102, 75103, 75110, 75117, 75120, 75125, 75127, 75133, 75135, 75139, 75140, 75142, 75145, 75147, 75148, 75153, 75154, 75155, 75164, 75166, 75168, 75172, 75173, 75174, 75176, 75180, 75185, 75186, 75187, 75190, 75192, 75193, 75194, 75196, 75200, 75201, 75205, 75206, 75218, 75219, 75222, 75223, 75225, 75230, 75236, 75237, 75239, 75242, 75245, 75250, 75258, 75260, 91645, 75261, 91647, 91648, 75265, 75266, 91650, 75268, 91651, 91656, 75274, 91660, 91662, 91665, 91674, 91675, 75293, 75295, 75296, 91679, 91684, 75304, 91688, 75306, 75310, 75312, 75315, 91702, 91703, 75320, 75321, 75322, 91707, 91708, 75325, 91711, 91712, 75329, 91716, 75333, 91717, 75335, 75337, 75340, 75342, 75343, 91726, 91728, 91729, 91731, 75350, 75351, 91734, 91736, 91738, 75356, 75357, 75358, 91740, 75360, 91741, 75362, 91742, 75364, 75365, 91746, 91747, 75368, 91744, 75370, 75373, 91757, 91759, 75377, 91761, 91765, 91766, 91767, 75384, 75388, 91772, 75394, 75396, 75400, 91784, 75402, 91785, 75404, 75410, 75411, 91794, 75416, 75417, 75418, 91800, 75420, 91803, 75422, 91808, 75425, 75426, 91810, 75428, 75430, 75431, 91817, 91818, 75439, 75440, 91825, 91827, 91828, 75445, 75446, 91831, 75449, 91833, 91834, 75454, 91840, 75458, 91843, 91844, 75461, 75462, 91846, 75464, 75465, 91848, 91852, 75469, 75470, 91853, 75472, 75473, 75474, 91854, 75476, 91856, 75478, 91860, 91865, 75481, 91867, 91866, 91869, 75486, 91870, 91872, 91873, 91874, 91876, 75495, 91880, 75497, 91881, 91883, 91884, 91885, 75503, 75504, 75505, 75507, 91897, 75514, 75515, 75516, 91898, 91901, 75519, 91902, 75521, 91904, 91909, 75528, 75529, 75530, 75531, 91915, 75533, 91917, 75535, 75536, 75537, 75540, 91927, 75544, 75545, 91936, 75553, 75554, 91937, 91940, 91941, 75557, 91943, 75560, 91947, 75564, 75565, 75568, 75570, 75571, 75572, 91956, 75575, 91960, 75579, 75581, 91965, 91966, 75585, 75586, 75590, 91974, 91976, 75594, 91978, 75599, 75603, 75604, 75605, 75606, 75607, 91987, 91988, 75610, 91989, 91995, 91997, 75614, 91999, 75616, 92002, 75619, 92004, 92005, 75623, 75628, 92012, 92013, 75633, 92017, 92018, 75636, 92019, 75638, 92021, 92023, 92025, 75642, 92028, 75645, 92030, 75648, 92033, 92036, 75656, 75657, 92043, 75662, 92047, 92053, 75670, 75671, 92055, 75674, 92059, 75677, 92061, 92063, 75681, 92066, 75684, 92069, 92071, 92074, 92075, 75694, 92079, 92082, 75699, 75700, 92083, 92085, 92087, 75704, 92091, 92095, 92096, 75714, 75715, 92100, 75717, 92101, 75719, 75721, 92108, 92109, 92115, 92116, 75733, 75734, 75736, 75737, 75738, 75739, 75740, 75741, 92120, 92121, 75744, 75745, 75746, 92123, 92124, 92126, 92128, 92131, 75753, 75754, 75755, 92142, 75760, 92144, 75762, 92147, 75766, 92151, 92150, 92154, 75772, 75773, 75775, 92159, 92161, 75778, 92164, 92165, 75786, 92171, 92172, 92173, 92174, 92176, 75793, 75794, 75795, 92178, 92179, 92180, 92183, 75800, 75801, 75802, 92187, 92188, 92189, 75807, 92193, 75810, 75811, 75812, 75813, 92196, 92197, 75816, 92200, 92203, 92204, 75823, 92207, 75825, 92208, 92210, 92212, 75829, 92213, 75831, 92214, 92217, 75835, 92221, 92223, 75840, 75842, 75843, 92227, 92228, 92229, 75848, 75849, 92232, 75851, 75852, 92236, 75854, 75855, 75856, 92241, 75858, 75859, 92244, 92245, 92246, 75863, 92247, 75865, 92250, 75868, 75869, 92254, 75872, 75873, 92256, 92261, 92262, 75879, 75882, 92267, 75885, 75888, 92272, 75890, 92275, 75892, 75897, 75898, 92281, 92285, 75903, 75905, 75906, 75909, 92293, 92294, 75912, 75913, 75914, 75915, 75916, 75917, 92297, 92299, 92300, 92308, 75925, 75927, 75928, 75929, 75930, 92311, 92314, 75933, 75934, 92315, 92318, 92321, 75939, 75941, 92330, 75948, 75949, 75950, 92335, 75953, 75955, 92339, 75958, 75961, 75963, 75964, 92347, 92348, 75967, 92350, 92352, 75970, 92354, 75972, 75975, 75981, 92366, 92367, 92369, 92370, 75987, 92371, 92373, 92372, 75991, 92376, 92377, 75994, 75995, 92378, 75997, 92385, 92386, 76003, 92387, 92388, 76007, 92391, 92393, 76010, 92395, 92401, 76018, 76019, 92403, 76021, 76022, 92406, 92408, 76026, 76027, 76029, 92413, 92414, 76036, 92421, 76038, 76039, 76040, 76041, 76042, 76043, 92422, 76045, 92423, 76047, 92425, 76049, 92428, 76051, 76052, 92429, 92430, 92437, 92438, 92439, 76058, 92440, 76060, 76061, 92443, 92450, 92454, 92456, 76075, 76076, 76077, 92460, 92465, 76082, 92467, 92468, 76089, 92473, 92474, 92475, 92476, 76094, 92477, 92479, 92480, 76097, 76098, 92481, 92483, 76101, 92484, 92487, 76104, 92490, 76109, 76110, 92493, 92494, 92497, 92498, 76117, 76120, 92504, 76123, 92509, 92510, 76127, 92511, 76129, 76130, 76131, 92513, 92515, 92518, 76134, 76135, 76136, 92519, 76139, 92524, 76142, 92526, 76146, 92530, 76149, 76150, 76151, 92533, 92534, 92535, 92536, 92537, 76156, 76158, 92542, 92546, 92548, 76165, 92549, 92550, 92551, 92553, 76170, 76171, 92554, 92557, 76174, 76175, 92560, 92565, 92566, 92567, 76185, 76186, 92570, 92572, 92575, 76192, 76193, 76194, 92577, 76196, 92580, 92581, 76199, 92583, 76201, 76202, 92584, 92587, 76208, 92592, 76210, 92593, 76214, 76215, 92599, 92600, 92603, 76220, 76221, 92604, 92606, 92610, 76227, 92611, 92615, 92616, 76234, 76235, 92618, 76237, 76238, 76239, 76240, 76241, 76242, 76243, 76244, 92620, 92626, 76247, 92629, 92630, 76250, 92633, 92635, 76254, 76255, 76257, 92641, 92642, 92644, 76261, 76262, 92645, 92647, 92648, 92651, 76268, 92653, 76270, 92655, 92656, 92657, 92659, 76275, 92663, 76281, 92670, 76288, 76290, 92675, 92676, 92677, 92678, 76295, 76296, 76297, 92679, 92681, 76300, 76301, 76304, 92688, 76307, 76308, 76309, 92694, 92695, 76313, 92698, 76316, 92701, 76318, 76322, 92706, 76323, 92707, 76328, 76329, 76330, 76331, 76332, 92712, 92715, 76337, 92721, 76339, 92723, 76341, 76342, 92724, 76344, 92726, 92727, 76347, 92728, 92729, 92732, 92734, 76352, 92736, 92739, 92740, 76357, 76362, 92746, 92748, 92749, 76365, 76368, 92755, 76375, 92760, 92761, 92763, 92764, 92765, 76383, 76386, 92770, 92773, 92775, 76393, 92781, 76398, 76399, 92782, 92784, 92786, 76403, 76404, 92788, 92789, 92790, 76411, 76412, 92797, 92795, 76414, 92801, 76420, 76422, 92807, 76424, 76425, 76426, 92813, 92820, 76438, 92822, 92823, 92824, 76442, 92825, 92827, 76445, 76446, 92828, 92831, 92826, 76451, 76452, 76453, 92836, 92837, 92839, 76462, 76463, 92848, 92850, 76468, 92855, 76475, 92860, 76480, 76482, 92868, 76485, 92869, 92873, 76490, 92876, 92877, 76495, 92880, 92883, 76500, 92884, 92885, 76501, 76504, 92888, 76506, 76507, 92892, 76509, 76513, 92897, 92902, 92903, 92904, 92905, 92906, 76527, 92911, 76529, 92913, 76531, 76532, 92915, 92918, 76533, 76539, 76540, 92923, 92927, 76544, 92928, 76546, 76548, 92932, 92935, 76552, 76554, 76555, 92938, 76557, 76558, 76560, 76561, 92945, 76566, 76568, 92952, 92953, 92954, 76572, 76573, 92956, 76577, 76578, 92963, 92968, 92969, 92973, 76590, 92975, 76597, 76598, 76599, 76600, 76601, 92981, 92983, 76605, 92989, 76607, 92991, 92993, 92994, 92995, 76612, 76613, 76614, 92997, 76621, 76623, 76624, 93007, 93010, 76628, 93013, 93014, 76631, 93017, 93019, 93020, 76637, 93021, 93023, 93024, 76643, 76645, 93030, 93031, 93036, 76657, 93043, 76659, 93047, 93049, 76668, 93052, 76670, 76672, 93057, 76674, 76676, 93062, 76683, 93067, 93070, 93072, 76690, 93074, 76692, 76695, 76697, 76705, 76706, 76707, 76708, 93091, 93093, 76711, 93094, 76713, 93095, 76715, 93100, 93101, 76718, 93105, 76723, 93107, 76725, 93109, 76727, 76728, 76729, 93110, 76731, 93112, 93114, 76734, 93115, 93116, 93117, 93119, 76740, 76743, 76745, 76746, 93129, 76748, 76749, 93130, 93134, 76752, 76753, 93142, 76759, 93145, 76764, 76766, 76768, 93153, 93154, 93155, 76772, 76773, 93158, 93160, 76778, 76780, 93165, 93166, 76788, 76789, 93173, 93175, 93176, 76794, 76795, 93180, 76797, 93183, 76804, 93189, 76806, 93192, 76809, 93194, 76811, 76812, 76815, 76816, 76817, 93199, 76820, 76821, 76822, 76823, 76824, 76825, 93205, 93207, 76829, 76831, 76832, 76833, 93217, 76835, 93219, 93221, 76838, 93223, 76834, 93230, 93232, 76849, 93235, 93237, 93238, 93239, 76856, 76859, 76862, 76863, 93246, 93247, 76866, 93248, 93249, 93252, 93254, 76872, 76873, 76874, 93258, 76876, 76878, 93263, 93265, 93267, 76884, 93268, 93269, 93270, 76888, 76889, 93271, 76891, 93274, 76895, 93281, 76898, 93283, 93284, 93286, 93287, 93289, 93290, 76907, 93291, 76909, 76910, 93295, 76911, 93293, 93294, 93297, 76915, 93301, 76918, 76919, 93302, 76921, 76922, 93307, 76923, 93303, 93310, 76925, 93305, 76927, 76928, 93309, 76930, 76934, 93321, 93325, 93326, 76943, 76944, 76945, 93328, 76947, 93332, 76949, 93335, 76952, 76953, 93337, 76955, 76956, 93339, 93340, 76959, 76960, 93342, 76962, 93343, 76964, 93346, 76966, 93347, 93348, 93350, 76970, 76971, 76972, 93351, 93352, 93353, 76976, 93354, 93355, 93356, 93360, 93362, 93363, 93364, 76984, 93368, 76991, 76992, 76994, 93378, 76999, 77000, 93385, 77003, 93388, 93389, 77006, 93391, 77007, 77010, 77011, 93394, 93399, 93400, 93402, 93404, 77021, 77022, 77023, 93412, 93413, 93415, 77033, 77034, 93419, 77036, 77038, 93422, 77042, 77043, 77044, 93428, 93429, 93430, 77048, 93432, 93433, 77051, 93434, 77054, 77055, 77056, 93438, 93441, 93442, 93444, 77061, 93445, 77063, 77064, 93446, 77066, 93449, 77068, 93450, 93452, 77071, 93456, 77076, 93464, 93465, 93466, 77084, 93468, 93469, 77087, 93474, 93475, 93479, 93481, 77098, 93483, 77100, 93484, 93485, 77103, 93489, 77106, 93490, 93491, 93495, 77112, 77116, 93500, 93503, 77121, 77124, 93510, 93511, 93513, 93514, 77131, 77132, 93521, 93522, 93524, 77141, 77143, 93527, 77147, 77150, 93537, 93538, 93539, 77158, 77159, 77160, 77161, 77162, 77164, 93549, 93550, 93552, 77169, 93554, 77172, 77173, 93556, 77175, 93558, 93559, 93560, 77180, 93564, 93567, 77184, 93569, 77186, 93570, 93571, 77192, 93577, 93578, 93579, 93580, 77198, 93582, 77200, 77201, 77202, 77203, 93585, 77208, 77209, 77211, 93596, 77214, 93599, 77221, 77225, 93610, 93612, 93613, 77231, 77232, 93615, 93618, 77237, 77239, 77240, 77241, 77242, 93624, 77244, 93628, 77248, 93633, 93635, 93642, 93643, 77267, 77268, 93652, 77270, 93654, 77272, 77273, 93655, 77275, 93660, 93661, 77278, 93667, 93668, 93670, 77287, 93671, 93672, 93673, 77293, 77294, 77295, 93678, 77297, 77298, 93681, 77300, 93682, 77302, 77303, 93684, 93689, 77306, 93693, 93700, 77317, 77321, 93705, 93707, 93708, 77325, 93709, 77328, 77329, 77330, 77331, 93715, 93716, 77334, 93718, 77339, 93725, 77344, 93729, 93735, 93736, 77355, 93739, 93740, 77358, 93742, 93743, 93744, 77362, 77363, 93745, 93747, 77366, 93750, 93751, 77369, 77370, 77375, 77380, 77381, 93766, 77384, 77385, 77386, 93768, 93770, 77389, 93771, 93772, 93775, 93778, 77395, 93779, 77394, 93787, 93788, 77405, 93789, 93791, 77408, 77409, 93792, 93794, 93796, 93797, 77416, 93800, 77419, 77420, 93811, 77428, 93814, 93815, 77433, 77434, 77435, 77436, 93818, 93821, 77439, 93822, 93823, 77442, 77443, 77444, 93824, 77446, 77447, 93827, 93831, 77451, 93835, 77455, 77457, 93844, 77461, 77462, 93846, 77464, 93849, 77466, 93852, 93854, 93855, 77472, 93856, 77476, 93861, 77478, 77479, 77480, 93866, 77483, 77484, 93867, 77486, 93870, 77488, 93871, 77490, 93872, 77492, 93875, 77494, 93880, 93881, 93889, 93890, 77508, 93892, 77509, 93894, 77511, 93896, 93899, 77517, 77524, 93909, 93913, 77530, 93914, 93915, 93916, 77535, 93919, 93921, 77538, 93922, 77540, 93923, 93926, 77544, 77546, 77547, 93930, 77549, 93935, 93936, 93938, 93940, 77557, 93942, 77562, 93947, 77564, 77567, 77568, 93951, 93953, 93954, 77572, 93957, 77575, 93960, 77578, 77579, 93962, 77581, 77582, 93964, 77584, 93966, 77590, 77592, 93980, 93982, 77601, 93988, 93992, 77610, 77611, 77612, 93995, 77621, 94005, 77623, 77624, 77626, 77627, 94010, 94015, 77632, 77633, 77634, 94016, 77636, 94019, 94021, 94025, 77642, 77645, 94029, 94030, 77648, 77650, 77651, 94034, 94035, 94036, 77655, 94039, 94042, 77659, 94045, 77662, 77663, 94046, 94048, 94049, 77667, 94051, 77670, 77673, 77676, 77678, 94063, 77681, 77688, 94072, 94074, 77693, 77694, 94082, 94083, 94085, 77702, 94086, 94088, 94089, 94090, 77708, 77709, 77710, 94094, 94095, 94097, 77714, 94103, 77720, 77721, 77722, 94106, 94109, 94111, 77728, 77730, 94114, 77731, 94116, 77734, 77737, 77738, 94122, 94123, 77741, 94127, 94130, 77747, 77749, 94133, 77751, 94136, 77753, 94138, 77755, 77758, 94142, 77761, 77763, 94149, 94150, 77767, 77770, 77773, 77774, 77775, 77778, 94164, 77783, 94168, 77785, 77786, 77789, 94174, 77794, 94179, 94184, 94187, 77805, 77806, 77807, 77810, 94195, 94197, 77815, 94199, 94201, 94203, 94206, 94209, 77826, 94211, 94212, 77829, 77831, 94218, 77835, 77836, 94221, 77838, 94222, 77840, 94229, 94231, 77848, 94232, 94234, 77854, 94239, 77860, 77863, 77864, 94250, 94251, 94252, 77869, 77870, 94253, 94255, 77876, 94260, 77878, 94262, 94265, 77883, 77885, 77886, 94271, 94274, 77891, 77892, 77894, 94278, 77896, 94279, 94281, 77899, 77900, 94282, 94283, 94286, 77910, 94295, 77913, 77915, 94303, 94304, 77921, 77922, 94308, 94309, 77926, 94310, 94316, 94318, 77936, 77938, 77939, 94323, 77941, 77942, 77943, 77944, 77945, 94325, 94326, 94331, 94332, 77950, 77951, 94334, 94336, 77954, 77955, 77956, 94337, 77958, 94338, 77960, 94339, 94340, 77965, 77966, 94349, 94352, 77969, 94354, 94356, 77974, 77975, 77976, 77977, 77978, 77979, 77980, 94360, 94363, 77983, 77984, 77988, 94372, 94374, 94375, 77404, 77993, 94378, 77995, 94379, 94380, 94385, 78002, 94386, 78005, 94389, 94390, 94391, 94393, 78011, 94395, 94396, 78014, 78015, 94400, 94401, 78019, 94404, 78021, 78022, 78024, 94408, 94409, 94410, 78028, 94411, 94412, 78031, 94413, 94414, 78034, 78035, 94415, 78037, 78038, 94417, 78040, 94420, 78042, 94421, 94424, 78045, 94426, 78047, 94433, 94435, 78054, 78055, 94441, 78058, 94444, 78061, 94445, 94448, 78066, 78067, 78068, 94450, 78070, 94451, 94453, 94455, 78074, 94458, 78076, 94461, 78078, 78079, 78080, 94462, 94466, 94464, 78084, 78085, 78086, 94468, 94471, 94473, 94475, 78092, 78095, 94480, 94481, 94486, 78104, 94491, 78112, 94496, 78114, 94498, 78116, 94500, 94501, 78119, 94502, 78113, 78122, 94506, 78126, 78127, 94512, 94515, 78133, 94519, 78136, 94521, 78137, 94524, 78143, 78144, 78145, 78146, 78147, 78148, 78149, 78150, 94531, 94533, 94537, 78154, 78155, 94539, 94540, 78158, 94543, 78162, 78163, 94548, 94549, 94551, 94552, 78171, 78172, 94558, 94559, 94560, 78177, 94561, 78179, 94562, 94563, 94567, 78184, 94568, 94570, 78190, 94574, 78192, 94575, 78195, 78198, 94583, 78200, 94584, 78202, 78204, 78205, 94589, 94591, 78208, 78212, 94596, 94598, 78214, 78217, 78218, 94602, 78220, 94604, 78223, 94607, 94609, 94611, 78228, 94613, 94615, 78232, 94618, 78236, 78237, 94622, 78239, 94624, 78242, 78243, 78244, 94628, 94630, 78247, 78249, 78250, 78251, 94633, 78253, 78254, 78255, 94638, 78257, 94642, 78259, 94646, 78263, 94649, 78266, 78267, 78268, 94653, 78269, 94656, 94658, 94659, 94660, 78277, 94662, 78279, 94663, 78281, 78282, 94666, 78285, 78286, 94670, 78288, 94673, 94674, 94676, 78295, 94680, 78297, 78298, 78299, 94683, 94685, 94687, 94688, 94691, 94692, 94693, 78310, 78311, 78315, 94700, 78318, 94702, 94703, 78322, 78326, 78327, 94714, 94715, 78333, 78335, 94719, 94722, 78339, 78342, 78343, 78344, 94729, 78346, 94730, 94731, 78352, 94736, 94738, 78356, 78357, 78358, 78359, 78360, 94742, 94745, 94746, 94748, 94749, 78366, 78367, 78370, 94754, 94756, 94757, 94758, 94759, 78376, 94760, 94761, 94762, 78380, 94768, 94769, 78387, 94772, 94778, 94785, 78404, 78405, 94789, 78414, 78415, 78418, 94802, 78422, 78423, 94808, 78425, 94810, 94811, 78429, 94813, 94814, 94818, 78435, 94819, 78437, 94821, 78440, 78441, 94825, 78447, 78448, 94831, 78451, 94835, 94836, 94839, 78458, 94842, 78460, 94843, 78462, 94845, 94846, 94853, 94855, 94857, 78476, 78478, 78482, 78485, 78486, 94870, 78490, 78491, 78493, 94878, 94879, 78499, 94883, 78501, 94884, 94886, 78504, 94890, 94892, 78510, 78511, 78513, 78516, 94900, 94901, 94903, 78521, 94906, 78524, 78526, 78527, 78528, 78529, 94911, 78531, 94914, 78533, 78534, 94916, 94917, 94918, 94919, 94921, 94923, 78541, 94929, 78548, 78549, 94935, 94936, 78553, 78554, 94937, 78556, 78557, 94941, 94942, 94944, 94945, 78564, 78566, 94952, 78569, 94956, 78581, 94968, 78591, 78594, 94978, 78598, 78600, 94984, 78602, 78603, 94986, 78606, 94990, 78608, 94992, 78610, 94994, 78612, 78613, 94995, 94998, 78616, 78617, 94999, 78619, 78620, 95001, 95002, 95006, 78624, 78625, 95007, 78627, 78628, 78629, 78630, 95009, 95010, 95011, 78634, 95015, 95020, 95022, 78640, 78641, 95024, 95028, 78646, 78647, 95030, 95033, 78650, 95034, 78652, 95035, 95036, 78655, 78656, 78657, 78658, 95044, 95045, 78662, 95048, 78667, 78668, 95052, 78671, 95055, 78675, 95059, 78678, 78683, 95069, 95073, 95074, 78691, 95076, 95077, 78694, 78697, 78701, 95086, 78703, 78704, 95087, 95088, 95091, 95092, 95093, 95095, 78713, 78714, 78715, 78716, 95100, 95101, 78719, 78720, 78721, 95102, 78723, 95106, 95108, 95110, 78728, 78729, 78730, 95116, 78734, 78736, 95120, 78738, 95121, 95126, 95127, 78744, 95128, 95130, 95131, 95132, 78749, 78750, 95134, 95135, 95138, 95139, 78755, 78756, 78757, 95142, 78759, 95143, 78761, 78762, 78764, 95151, 78768, 78769, 95153, 95154, 95156, 78774, 95159, 95160, 78777, 95161, 95163, 78780, 95164, 95165, 78783, 95166, 95167, 78786, 95170, 95171, 78789, 95175, 78792, 78793, 78794, 78795, 78796, 78797, 78798, 95177, 78800, 95182, 95184, 95187, 78803, 95188, 78806, 78807, 78811, 95195, 78813, 95198, 95199, 78818, 95203, 95204, 95207, 78824, 95209, 95210, 95211, 95214, 95215, 78832, 95219, 78836, 95220, 95221, 95223, 78840, 78841, 95224, 95226, 78844, 78845, 95229, 78846, 78847, 78848, 95231, 95232, 78851, 78852, 95235, 78856, 78857, 95242, 78860, 95245, 78863, 78866, 78868, 95252, 78872, 95256, 95258, 95261, 95262, 78879, 95265, 95266, 78883, 95267, 95271, 95273, 78890, 78892, 95278, 78895, 95280, 78897, 95282, 78901, 95287, 78904, 78905, 78906, 95289, 78910, 95294, 78912, 95301, 78918, 95302, 95303, 95310, 78928, 78930, 78936, 95321, 95323, 78941, 95326, 95327, 78944, 78945, 78946, 78947, 78948, 95329, 95332, 95336, 95337, 95341, 95345, 78962, 95347, 95349, 78966, 78972, 78974, 95360, 95361, 95363, 95364, 78982, 78983, 95367, 78985, 95368, 78987, 95369, 95371, 78992, 78994, 95378, 78996, 95379, 95381, 78999, 95383, 95388, 95390, 79007, 95392, 79010, 79011, 95394, 95395, 79014, 79015, 79016, 95397, 79018, 95400, 95402, 95405, 95406, 95408, 79025, 79026, 95410, 79028, 95411, 79030, 95414, 95415, 79034, 95419, 79036, 95420, 79038, 95421, 79040, 95425, 79042, 79043, 79044, 79045, 95427, 95428, 79048, 95432, 79050, 79051, 95433, 95435, 79054, 79055, 95436, 79057, 95440, 79059, 95442, 95444, 79063, 79065, 95449, 79067, 95452, 79069, 79070, 79071, 95454, 79075, 95459, 79077, 79078, 95462, 79080, 95465, 79083, 79084, 95467, 79086, 95469, 95473, 79091, 79093, 79097, 95481, 79100, 95487, 79110, 95494, 79112, 79114, 95500, 79117, 95501, 79119, 95503, 79121, 95504, 95505, 95508, 79125, 95512, 79133, 95517, 95519, 79139, 95523, 95524, 95525, 95526, 95528, 79146, 95531, 95532, 95533, 79152, 79153, 95536, 79155, 79156, 79157, 79158, 95539, 95540, 79161, 95552, 95553, 79170, 95555, 79172, 79175, 95559, 95561, 79178, 79179, 79180, 79181, 95563, 79183, 79185, 79187, 79188, 79189, 95571, 79191, 95576, 95579, 79196, 79197, 79198, 95582, 95583, 95586, 95588, 95590, 95593, 95601, 95602, 79222, 79223, 95608, 79225, 95609, 95611, 95614, 79233, 95620, 79238, 95623, 95624, 95625, 95626, 79245, 95630, 79248, 79249, 79250, 95636, 79253, 95637, 95639, 79257, 95642, 95644, 95645, 95646, 95647, 95649, 79268, 79269, 79275, 79276, 95660, 79278, 95662, 79281, 95667, 79287, 95672, 95673, 95674, 79291, 79293, 79294, 79295, 95681, 95682, 79299, 95685, 79305, 79306, 79308, 95693, 79311, 95695, 79313, 79314, 95696, 79316, 95697, 79319, 95707, 95709, 95711, 95713, 79330, 95714, 79332, 95715, 79334, 95717, 95719, 95720, 79339, 79340, 95725, 95726, 79346, 79347, 95733, 95735, 95736, 95737, 79356, 79357, 79358, 95744, 79361, 95745, 95746, 79369, 95753, 79371, 79372, 79373, 79374, 95755, 95757, 79377, 95762, 95764, 79383, 95767, 79385, 95770, 79388, 95772, 79390, 79391, 95774, 79394, 79395, 95778, 95780, 95782, 79399, 79397, 95785, 79402, 79403, 95789, 95790, 95791, 79409, 79410, 95793, 95795, 95797, 79417, 95801, 79419, 79420, 95803, 95804, 95805, 95806, 95808, 79426, 95811, 79429, 79431, 79432, 95817, 95819, 79439, 95825, 79442, 79444, 95828, 95829, 95830, 95832, 79449, 95834, 79451, 95835, 79454, 95839, 79457, 95842, 79459, 95843, 79461, 79462, 95845, 95848, 95850, 79467, 95852, 79469, 79472, 95857, 79474, 95859, 95858, 79477, 79478, 79479, 95860, 79481, 95861, 79483, 95864, 79485, 95867, 95870, 95871, 95872, 79492, 79493, 79494, 95877, 79496, 95879, 79498, 95880, 79500, 95881, 95884, 95885, 95888, 79506, 79508, 79509, 95893, 79514, 95899, 95900, 79515, 79518, 79519, 95902, 79522, 95906, 79524, 79525, 95909, 79527, 95910, 79529, 95914, 79533, 79535, 95919, 95921, 79538, 95922, 79540, 95923, 79542, 95924, 79544, 95925, 95926, 79547, 79548, 79549, 79550, 79551, 79552, 95931, 95934, 79555, 95935, 95936, 79558, 95938, 95939, 79561, 79562, 79563, 79564, 95940, 95942, 95945, 95949, 79569, 95951, 95955, 79572, 79573, 79574, 95960, 79577, 79578, 95962, 95963, 79582, 95968, 79585, 95970, 79588, 95975, 95976, 95977, 79594, 79595, 95981, 79598, 95985, 95986, 79605, 79606, 95991, 79610, 95996, 95997, 95998, 79616, 96001, 79618, 96002, 96003, 79621, 79622, 79623, 79624, 96004, 96005, 96009, 79628, 96013, 79633, 79634, 96018, 79636, 96019, 79638, 79639, 96021, 96022, 79642, 96024, 79644, 79645, 96027, 96028, 96029, 79651, 96035, 96036, 96038, 79655, 79660, 96045, 79662, 79668, 79670, 96054, 96056, 96057, 79675, 79676, 79677, 79678, 96059, 79680, 96060, 96062, 79683, 96064, 96067, 79687, 79688, 96072, 79693, 96081, 79698, 79700, 96084, 79704, 79705, 79706, 79707, 79708, 96088, 96089, 79713, 79717, 79719, 96106, 79723, 79724, 96107, 79726, 79727, 96109, 79729, 96111, 79732, 79733, 96121, 79743, 96129, 96131, 96132, 96133, 79750, 96141, 79759, 79761, 79762, 96147, 79764, 79765, 79766, 79767, 96150, 79769, 79770, 96151, 79772, 96157, 96158, 79775, 79781, 96165, 96166, 96168, 96173, 79790, 96174, 96175, 79793, 96176, 96177, 96180, 79791, 79798, 79799, 96184, 79801, 96185, 96187, 96189, 96191, 96193, 96194, 79814, 96201, 79818, 96202, 96203, 79821, 79822, 96205, 79824, 96208, 96210, 96216, 79835, 96221, 96224, 96225, 96226, 79843, 79845, 79846, 79847, 96233, 96238, 79855, 96241, 96242, 96243, 96244, 79861, 96246, 96247, 79864, 96248, 79867, 96256, 79873, 79874, 96257, 96260, 96261, 96263, 96264, 79882, 79883, 79885, 96269, 96271, 79888, 79891, 79892, 79893, 79894, 79895, 79896, 96278, 96279, 96284, 79901, 96285, 96286, 79904, 79905, 96287, 79907, 96292, 96288, 79909, 96289, 79911, 96290, 79913, 79914, 96296, 96297, 96298, 79922, 79923, 79924, 88115, 79926, 79930, 96314, 79932, 96318, 96319, 79936, 79939, 96325, 96326, 96327, 79944, 79947, 96332, 79949, 96334, 96337, 96338, 79957, 79958, 96341, 96344, 96345, 79962, 96343, 79966, 79967, 79968, 79969, 79971, 79972, 79973, 96357, 96359, 79982, 96368, 96369, 79986, 79987, 79988, 79990, 79991, 96374, 96376, 96377, 96380, 79997, 96381, 79999, 80000, 96382, 96385, 80003, 96386, 80007, 96392, 96393, 96394, 96395, 96396, 96397, 80015, 80016, 80017, 96400, 80019, 80020, 80021, 80022, 96407, 80024, 96409, 96410, 80028, 80029, 96413, 80031, 96414, 96416, 96419, 96420, 92434, 96424, 96425, 96428, 96429, 80048, 96433, 80050, 96434, 96436, 80056, 80057, 80062, 96446, 88256, 80065, 80066, 80067, 96449, 96450, 96452, 80072, 96456, 80074, 96457, 96458, 80077, 80078, 96459, 80080, 96461, 80082, 96467, 80084, 96468, 80085, 80086, 96473, 80093, 96480, 96481, 80100, 96485, 96488, 80109, 80110, 80114, 96499, 96501, 80119, 80120, 80121, 96506, 80124, 80125, 80126, 96510, 96512, 80129, 80130, 96514, 96516, 80134, 96519, 80136, 80137, 80138, 80139, 80140, 80141, 96524, 96527, 80144, 96528, 96533, 96535, 96537, 80154, 80157, 80159, 80160, 96543, 80162, 96544, 96546, 80165, 80166, 96554, 96556, 96557, 80174, 80175, 96561, 80179, 80180, 96563, 80182, 96564, 96570, 96571, 80192, 96576, 96578, 80195, 96579, 80197, 96581, 80199, 80200, 96583, 80203, 96587, 80205, 80206, 96591, 80208, 96592, 80210, 80212, 80213, 96596, 80218, 96602, 80220, 96603, 96606, 96607, 80225, 96609, 96611, 96613, 96614, 80231, 96615, 80234, 80235, 96618, 96620, 96621, 80239, 96622, 80242, 96627, 96632, 96635, 96636, 80253, 96637, 96639, 80255, 96640, 96645, 80263, 96648, 80266, 96650, 80268, 96651, 80270, 96657, 80275, 96662, 80280, 96664, 80282, 96667, 96668, 80285, 96669, 96672, 96673, 80290, 80292, 96676, 80294, 80295, 80301, 96686, 80303, 96687, 96691, 96692, 80311, 80313, 80314, 80315, 96699, 96700, 96702, 80319, 96704, 80322, 80324, 96711, 80329, 80330, 96714, 96718, 80335, 96720, 80337, 80338, 96723, 80340, 80342, 145878, 96729, 80346, 80348, 96733, 80350, 80351, 96735, 96736, 96737, 96739, 80355, 96738, 96740, 80363, 80364, 80367, 80368, 96752, 80370, 80372, 96756, 80374, 80375, 80376, 80377, 96757, 96759, 80380, 96761, 80382, 80383, 80384, 96765, 96766, 80389, 96777, 80394, 96779, 80397, 96783, 80401, 96785, 96787, 80402, 96791, 80408, 80409, 96793, 80412, 80414, 80415, 96798, 96799, 96801, 96803, 80422, 96807, 96809, 80426, 80427, 96812, 80429, 96813, 96815, 80432, 80433, 80434, 96818, 80437, 80438, 88631, 96821, 80441, 96824, 96825, 96826, 96831, 80451, 80452, 80456, 80457, 80467, 80471, 80478, 80481, 80485, 80487, 80489, 80490, 80497, 80498, 80502, 80504, 80505, 80507, 80508, 80522, 80527, 80529, 80531, 80532, 80536, 80548, 80550, 80554, 80556, 80558, 80559, 80563, 80565, 80570, 80571, 80573, 80575, 80579, 80585, 80586, 80588, 80591, 80594, 80598, 80599, 80600, 80603, 80606, 80607, 88856, 88858, 88862, 88867, 88868, 88870, 88873, 88875, 88876, 88877, 88878, 88880, 88882, 88883, 88888, 88890, 88891, 88893, 88894, 88895, 88902, 88906, 88907, 88908, 88909, 88911, 88912, 88914, 88917, 88919, 88921, 88922, 88924, 95927 ]
1ef8a2325aa0bbae4ecb44f11c178646c13138d9
da716852947d7a16bd21f92db2abe193746d397e
/Mobiquity Test/Library/DequeueInitializable.swift
7f69260c18ffb1b6cc374f4eb9e4b38ee58a4d4e
[]
no_license
afzalshk/Mobiquity-Test-Project
2c8249bec72df26f6291397d7df9c936d910da85
67713972725b526953bca0247c11a74a40c6b512
refs/heads/master
2021-08-29T02:51:54.365700
2021-08-02T13:00:00
2021-08-02T13:00:00
249,390,798
0
0
null
null
null
null
UTF-8
Swift
false
false
1,140
swift
// // DequeueInitializable.swift // Mobiquity Test // // Created by Afzal Murtaza on 22/03/2020. // Copyright © 2020 Afzal Murtaza. All rights reserved. // import Foundation import UIKit protocol DequeueInitializable { static var reuseableIdentifier: String { get } } extension DequeueInitializable where Self: UITableViewCell { static var reuseableIdentifier: String { return String(describing: Self.self) } static func dequeue(tableView: UITableView) -> Self { guard let cell = tableView.dequeueReusableCell(withIdentifier: self.reuseableIdentifier) else { return UITableViewCell() as! Self } return cell as! Self } } extension DequeueInitializable where Self: UICollectionViewCell { static var reuseableIdentifier: String { return String(describing: Self.self) } static func dequeue(collectionView: UICollectionView,indexPath: IndexPath) -> Self { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: self.reuseableIdentifier, for: indexPath) return cell as! Self } }
[ -1 ]
4c490241c3717a90b42be8de7b7e473efc1f688b
f3ef9d5e2637f0d9c5c86441c732e9615e667232
/PhoneType.swift
179e0eacc1458a5dae2c4e9ea7adcb9ca8f9ba20
[]
no_license
kimhyeri/BaekJoon
d5402e0e20ad074a3fd7c2c6a65d15a45461ba80
12e53cff78ca4c9a489c9a415fdc79d4ad1741c7
refs/heads/master
2021-06-10T07:58:15.672836
2020-01-04T12:14:01
2020-01-04T12:14:01
143,634,490
1
0
null
null
null
null
UTF-8
Swift
false
false
1,149
swift
// // PhoneType.swift // Testing // // Created by hyeri kim on 07/10/2019. // Copyright © 2019 hyeri kim. All rights reserved. // import Foundation enum PhoneType: Int { case Type1 = 1 case Type2 = 2 case Type3 = 3 case Type4 = -1 } func validCount(_ phone_number: String) -> Bool { if phone_number.count == 11 { return true } else { return false } } func solution(_ phone_number: String) -> Int { var answer: PhoneType = .Type4 if !phone_number.contains("-"), validCount(phone_number) { answer = .Type2 } else { var phoneNumberString = phone_number.replacingOccurrences(of: "-", with: "") if phoneNumberString.hasPrefix("+82"){ phoneNumberString.insert("0", at: phoneNumberString.startIndex) answer = .Type3 } if validCount(phoneNumberString) { answer = .Type1 } else { return answer.rawValue } } return answer.rawValue } let example = ["01012345678","010-1212-333","+82-10-1111-2222","010111111111","010-1212-3333"] example.forEach({ print(solution($0)) })
[ -1 ]
12aa9eb9ae3607a159b7f81f96b1b402135604e5
9c72d7053beda23a4c3ca17bf39bb27882b17c1e
/Broadcast/Utilities/Extensions/Int+Extensions.swift
ae9570001ca036056740669f2f08799818c6d127
[]
no_license
realityworks/broadcast-app
7c591ddcda0937fe48ccb12175d627b2ef76461a
b2030b38c7818758026e495a3c521a4f13efe009
refs/heads/main
2023-06-10T12:34:22.715676
2021-04-26T11:19:10
2021-04-26T11:19:10
380,119,633
0
0
null
null
null
null
UTF-8
Swift
false
false
1,131
swift
// // Int.swift // Broadcast // // Created by Piotr Suwara on 31/12/20. // import Foundation extension Int { /// Convert an int to a currency string with a specified currency code. The currency decimal count is defined by /// a specified number of digits. So an int value of 1200 with a `decimals` value of 2, the resulting /// value will be 12.00 /// - Parameters: /// - currencyCode: The currency code that provides a /// - decimals: Decimal places to use in the string /// - Returns: A string with the currency symbol at the front, the value and the code at the end. /// eg. $10.00 USD func asCurrencyString(withCurrencyCode currencyCode: CurrencyCode, decimals: Int = 2) -> String { let multiple = pow(10.0, Float(decimals)) let total: Float = (Float(self) / multiple) let currencyAmount = String(format: "%.2f", total) let uppercasedCurrencyCode = currencyCode.rawValue.uppercased() return "\(Locale.currencySymbol(from: currencyCode) ?? "") \(currencyAmount) \(uppercasedCurrencyCode)" } }
[ -1 ]
9bd3600c640c515e564026c5fbcc175cdbbf08ef
718f58af044a060ce654d80c3c3568325fea501a
/Relative Bible/Read/Book/BookVC+Info.swift
9cf84122ff863907d88667395b21c08448295111
[]
no_license
ChuckMo1019/Relative_Bible
52dda42a97860143a23cd1e95157bab457244005
7816bb109780f3be241fe8f92b17cf2c093c5a0c
refs/heads/master
2022-03-29T10:05:22.212369
2020-01-17T19:22:59
2020-01-17T19:22:59
null
0
0
null
null
null
null
UTF-8
Swift
false
false
4,473
swift
// // BookVC+Info.swift // Bible // // Created by Jun Ke on 7/31/19. // Copyright © 2019 Pierre Beasley. All rights reserved. // import UIKit extension BookInfoViewController { func layoutInfo() { infoSectionControl = JKSegmentedControl.init(frame: .init(x: 0, y: 0, width: self.view.bounds.width - 32, height: JKSegmentedControl.standardHeight), items: ["Book", "Writer"]) infoSectionControl.addTarget(self, action: #selector(self.infoControlValueChanged)) infoView.addSubview(infoSectionControl) infoSectionControl.translatesAutoresizingMaskIntoConstraints = false infoSectionControl.leadingAnchor.constraint(equalTo: infoView.leadingAnchor, constant: 16).isActive = true infoSectionControl.trailingAnchor.constraint(equalTo: infoView.trailingAnchor, constant: -16).isActive = true infoSectionControl.topAnchor.constraint(equalTo: infoView.topAnchor, constant: 11).isActive = true infoSectionControl.heightAnchor.constraint(equalToConstant: infoSectionControl.bounds.height).isActive = true bookInfoView = BookInfoView.init(frame: self.view.bounds, book: book) infoView.addSubview(bookInfoView) bookInfoView.translatesAutoresizingMaskIntoConstraints = false bookInfoViewLeadingConstraint = bookInfoView.leadingAnchor.constraint(equalTo: infoView.leadingAnchor) bookInfoViewLeadingConstraint.isActive = true bookInfoView.widthAnchor.constraint(equalTo: infoView.widthAnchor).isActive = true bookInfoView.topAnchor.constraint(equalTo: infoSectionControl.bottomAnchor, constant: 13).isActive = true bookInfoView.bottomAnchor.constraint(equalTo: infoView.bottomAnchor).isActive = true writerInfoView = WriterInfoView.init(frame: self.view.bounds) infoView.addSubview(writerInfoView) writerInfoView.translatesAutoresizingMaskIntoConstraints = false writerInfoView.leadingAnchor.constraint(equalTo: bookInfoView.trailingAnchor).isActive = true writerInfoView.widthAnchor.constraint(equalTo: bookInfoView.widthAnchor).isActive = true writerInfoView.topAnchor.constraint(equalTo: bookInfoView.topAnchor).isActive = true writerInfoView.bottomAnchor.constraint(equalTo: bookInfoView.bottomAnchor).isActive = true if let osisRef = BibleData.bookOsisRefs[book] { GraphQL_Book.findWriters(osisRef: osisRef) { (valid, people) in if valid { DispatchQueue.main.async { self.bookInfoView.infoBasicTableView.views[1].removeActivityIndicator() self.bookInfoView.writers = people self.bookInfoView.infoBasicTableView.reload() self.writerInfoView.writerID = people.count == 0 ? "nil" : people.first!.id! self.writerInfoView.fetchAndUpdate() } } } } } } extension BookInfoViewController: StaticTableViewDelegate { func staticTableView(_ staticTableView: StaticTableView, populateView view: UIView, ofIndex index: Int) { let primaryLabel = UILabel.init() primaryLabel.font = UIFont.systemFont(ofSize: 17, weight: .regular) let secondaryLabel = UILabel.init() secondaryLabel.font = UIFont.systemFont(ofSize: 14, weight: .regular) if index == 0 { primaryLabel.text = "Number of chapters:" secondaryLabel.text = "\(BibleData.numChaptersDict[book] ?? 0)" } else if index == 1 { primaryLabel.text = "Writer:" secondaryLabel.text = "Moses" } else { primaryLabel.text = "Division:" secondaryLabel.text = BibleData.division(book: book) ?? "Not Found" } view.addSubview(primaryLabel) primaryLabel.translatesAutoresizingMaskIntoConstraints = false primaryLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 16).isActive = true primaryLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true view.addSubview(secondaryLabel) secondaryLabel.translatesAutoresizingMaskIntoConstraints = false secondaryLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20).isActive = true secondaryLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true } }
[ -1 ]
95842cf85bcd67748bb3e3743a37415e3292d7b7
52e30b0e9660d80dfcf8f309802386ead0a260c3
/Udder/AppDelegate.swift
9d1d3c33f05b84bd0cacebeb5fd5a0b6cbdf891f
[]
no_license
samonthenetuk/Udder
809e13efb0d4fd12d63bd62764d975c98ff28ba7
83809f60d6ba7a1c6448ed3d5c8250487a2ccc48
refs/heads/master
2020-07-01T16:34:13.394423
2019-08-08T10:31:15
2019-08-08T10:32:02
201,227,064
0
0
null
null
null
null
UTF-8
Swift
false
false
2,163
swift
// // AppDelegate.swift // Udder // // Created by Sam Bates on 08/08/2019. // Copyright © 2019 PPM. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 278556, 229405, 278559, 229408, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 286776, 319544, 286778, 204856, 229432, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 286916, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 278983, 319945, 278986, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 320007, 287238, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 311850, 279082, 279084, 172591, 172598, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 303696, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 189040, 172660, 287349, 189044, 189039, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 287371, 279178, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 287390, 303773, 172705, 287394, 172707, 303780, 164509, 287398, 295583, 287400, 279208, 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, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 189169, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 303976, 336744, 303981, 303985, 303987, 328563, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 304007, 213895, 304009, 304011, 304013, 295822, 213902, 279438, 189329, 295825, 304019, 189331, 58262, 304023, 304027, 279452, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 230334, 304063, 238528, 304065, 189378, 213954, 156612, 197580, 312272, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 295945, 230413, 197645, 295949, 320528, 140312, 295961, 238620, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 132165, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 312432, 337018, 189562, 279679, 66690, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 304348, 304354, 296163, 320740, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 214294, 296215, 320792, 230681, 296213, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 279929, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 288154, 337306, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 222676, 288212, 288214, 280021, 239064, 329177, 288217, 288218, 280027, 288220, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 230923, 304651, 304653, 370187, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 239202, 312938, 280183, 280191, 116354, 280194, 280208, 280211, 280222, 419489, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 337732, 280388, 304968, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 288895, 321670, 215175, 288909, 141455, 275606, 280725, 313498, 100520, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 280811, 280817, 125171, 280819, 157940, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 280919, 248153, 354653, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289227, 281047, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 330244, 223752, 150025, 338440, 281095, 223757, 281102, 223763, 223765, 322074, 281116, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 338528, 338532, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 256716, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 183184, 142226, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 183260, 289762, 322534, 297961, 183277, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 216376, 380226, 298306, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 298365, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 298377, 314763, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 290305, 306694, 192008, 323084, 282127, 290321, 282130, 290325, 282133, 241175, 290328, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 323260, 282300, 323266, 282310, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 298822, 148946, 315211, 307027, 315221, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 315253, 315255, 339838, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 241581, 241583, 323504, 241586, 290739, 241588, 282547, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 307374, 307376, 299185, 323763, 184503, 176311, 307385, 307386, 258235, 307388, 176316, 307390, 299200, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 299225, 233701, 307432, 282881, 282893, 323854, 291089, 282906, 291104, 233766, 307508, 315701, 332086, 307510, 307512, 307515, 307518, 282942, 282947, 323917, 282957, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 291254, 283062, 127417, 291260, 127421, 127424, 299457, 127429, 291269, 127431, 127434, 315856, 176592, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 283142, 127497, 233994, 135689, 127500, 233998, 127506, 234003, 127509, 234006, 127511, 152087, 283161, 234010, 135707, 242202, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 299740, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 316294, 226182, 234375, 308105, 226185, 234379, 234384, 234390, 226200, 234393, 209818, 308123, 324504, 234396, 324508, 234398, 291742, 234401, 291747, 291748, 234405, 291750, 324518, 324520, 234407, 324522, 234410, 291756, 291754, 226220, 324527, 234414, 234417, 201650, 324531, 291760, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 234437, 226239, 226245, 234439, 234443, 291788, 234446, 275406, 234449, 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, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 234585, 275545, 242777, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 324757, 234647, 226453, 234648, 234650, 308379, 275608, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 177318, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 275725, 283917, 177424, 349451, 349464, 415009, 283939, 259367, 283951, 292143, 300344, 243003, 283963, 226628, 300357, 283973, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 316811, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 300448, 144807, 144810, 144812, 284076, 144814, 227426, 144820, 374196, 284084, 292279, 284087, 144826, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 316959, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 284223, 284226, 284228, 243268, 226886, 284231, 128584, 292421, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 276052, 276053, 284249, 300638, 284251, 284253, 284255, 284258, 292452, 292454, 284263, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 276095, 284288, 292479, 284290, 325250, 284292, 292485, 276098, 292481, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 276166, 358089, 284362, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 284379, 284381, 284384, 358114, 284386, 358116, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 366406, 276295, 292681, 153417, 358224, 276308, 178006, 317271, 284502, 276315, 292700, 317279, 284511, 292715, 300912, 292721, 284529, 300915, 292729, 317306, 284540, 292734, 325512, 317332, 358292, 284564, 284566, 399252, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292784, 358326, 161718, 358330, 276411, 276418, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 292843, 276460, 292845, 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, 227418, 350299, 194649, 350302, 194654, 350304, 178273, 309346, 227423, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 301163, 350313, 350316, 227430, 301167, 276583, 350321, 276590, 284786, 276595, 350325, 252022, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 309491, 227571, 309494, 243960, 227583, 276735, 227587, 276739, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 235858, 276829, 276833, 391523, 276836, 293227, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 227738, 317853, 276896, 317858, 342434, 317864, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 113167, 309779, 317971, 309781, 277011, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 23094, 277054, 219714, 129603, 301636, 318020, 301639, 301643, 285265, 399955, 309844, 277080, 309849, 285282, 326244, 318055, 277100, 309871, 121458, 170619, 309885, 309888, 277122, 277128, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 318132, 342707, 154292, 277173, 277177, 277181, 318144, 277187, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 228069, 277223, 342760, 285417, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 301884, 293696, 310080, 277317, 293706, 277322, 310100, 301911, 301913, 277337, 301921, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 276579, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 244731, 293887, 277504, 277507, 277511, 293899, 293908, 293917, 293939, 318516, 277561, 277564, 310336, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 228592, 294132, 138485, 228601, 204026, 228606, 64768, 310531, 138505, 228617, 318742, 277798, 130345, 113964, 285997, 285999, 113969, 318773, 318776, 286010, 417086, 286016, 302403, 294211, 384328, 294221, 294223, 326991, 179547, 146784, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 310657, 351619, 294276, 310659, 327046, 253320, 310665, 318858, 310672, 351633, 310689, 130468, 228776, 277932, 310703, 310710, 130486, 310712, 310715, 302526, 228799, 302534, 310727, 245191, 64966, 163272, 302541, 302543, 310737, 228825, 163290, 310749, 310755, 187880, 310764, 286188, 310772, 40440, 212472, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 302614, 302617, 286233, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 196133, 310831, 245288, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 40557, 40560, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 278188, 302764, 278192, 319153, 278196, 319163, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 229086, 278238, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 360322, 40851, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278519, 237562 ]
9f7eee09a16529579d1a8fa1bad241f2cc61f086
beb661e80aacf635a2fb10213a519ea4e2efcfbe
/phantomText/ViewTwo.swift
f801ce5765db91f69f34e72ac2f8bd6282f47fff
[]
no_license
szilardinho/phantomChat
4c39d5ada5ed005431dbdab9721690412a6d0e57
6f0f827148fdcb95b3e7d9b7de95aee6244bef62
refs/heads/master
2021-01-10T03:15:51.688717
2016-03-26T04:11:57
2016-03-26T04:11:57
54,762,111
0
0
null
null
null
null
UTF-8
Swift
false
false
3,930
swift
// // ViewTwo.swift // phantomText // // Created by Szi Gabor on 3/8/16. // Copyright © 2016 nuSyntax. All rights reserved. // import UIKit import AVFoundation class ViewTwo: UIViewController,UIImagePickerControllerDelegate,UINavigationControllerDelegate{ var captureSession : AVCaptureSession? var stillImageOutput : AVCaptureStillImageOutput? var previewLayer : AVCaptureVideoPreviewLayer? @IBOutlet weak var cameraView: UIView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) previewLayer?.frame = cameraView.bounds } override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) captureSession = AVCaptureSession() captureSession?.sessionPreset = AVCaptureSessionPreset1920x1080 let backCamera = AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeVideo) let error = NSError?() do { let input = try AVCaptureDeviceInput(device: backCamera) if (error == nil && captureSession?.canAddInput(input) != nil){ captureSession?.addInput(input) stillImageOutput = AVCaptureStillImageOutput() stillImageOutput?.outputSettings = [AVVideoCodecKey : AVVideoCodecJPEG] if ((captureSession?.canAddOutput(stillImageOutput)) != nil){ captureSession?.addOutput(stillImageOutput) previewLayer = AVCaptureVideoPreviewLayer(session: captureSession) previewLayer?.videoGravity = AVLayerVideoGravityResizeAspect previewLayer?.connection.videoOrientation = AVCaptureVideoOrientation.Portrait cameraView.layer.addSublayer(previewLayer!) captureSession?.startRunning() } } } catch { } } @IBOutlet weak var tempImageView: UIImageView! func didPressTakePhoto(){ if let videoConnection = stillImageOutput?.connectionWithMediaType(AVMediaTypeVideo){ videoConnection.videoOrientation = AVCaptureVideoOrientation.Portrait stillImageOutput?.captureStillImageAsynchronouslyFromConnection(videoConnection, completionHandler: { (sampleBuffer, error) in if sampleBuffer != nil{ let imageData = AVCaptureStillImageOutput.jpegStillImageNSDataRepresentation(sampleBuffer) let dataProvider = CGDataProviderCreateWithCFData(imageData) let cgImageRef = CGImageCreateWithJPEGDataProvider(dataProvider, nil, true, .RenderingIntentDefault) let image = UIImage(CGImage: cgImageRef!, scale: 1.0, orientation: UIImageOrientation.Right) self.tempImageView.image = image self.tempImageView.hidden = false } }) } } var didTakePhoto = Bool() func didPressTakeAnother() { if didTakePhoto == true { tempImageView.hidden = true didTakePhoto = false } else { captureSession?.startRunning() didTakePhoto = true didPressTakePhoto() } } override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) { didPressTakeAnother() } }
[ -1 ]
68dfd644474d72a335875cfe9ae3f53c430e8111
bf0bbd705d1330a02b35e80241b6953789b17261
/Source/InputMask/InputMask/Classes/View/MaskedTextFieldDelegate.swift
97ef2d7833900a6e10e6d33cea55750dfad51611
[ "MIT" ]
permissive
NRokudaime/input-mask-ios
08041f0546d7f5ba3c555df72d55618f78808c2a
7bd08b28a667a53d026ce00f706f6ce295048221
refs/heads/master
2020-03-22T09:27:21.066887
2018-07-05T11:22:54
2018-07-05T11:22:54
null
0
0
null
null
null
null
UTF-8
Swift
false
false
11,578
swift
// // Project «InputMask» // Created by Jeorge Taflanidi // import Foundation import UIKit /** ### MaskedTextFieldDelegateListener Allows clients to obtain value extracted by the mask from user input. Provides callbacks from listened UITextField. */ @objc public protocol MaskedTextFieldDelegateListener: UITextFieldDelegate { /** Callback to return extracted value and to signal whether the user has complete input. */ @objc optional func textField( _ textField: UITextField, didFillMandatoryCharacters complete: Bool, didExtractValue value: String ) } /** ### MaskedTextFieldDelegate UITextFieldDelegate, which applies masking to the user input. Might be used as a decorator, which forwards UITextFieldDelegate calls to its own listener. */ @IBDesignable open class MaskedTextFieldDelegate: NSObject, UITextFieldDelegate { private var _maskFormat: String private var _autocomplete: Bool private var _autocompleteOnFocus: Bool public var customNotations: [Notation] public var mask: Mask { return try! Mask.getOrCreate(withFormat: _maskFormat, customNotations: customNotations) } @IBInspectable public var maskFormat: String { get { return self._maskFormat } set(newFormat) { self._maskFormat = newFormat } } @IBInspectable public var autocomplete: Bool { get { return self._autocomplete } set(newAutocomplete) { self._autocomplete = newAutocomplete } } @IBInspectable public var autocompleteOnFocus: Bool { get { return self._autocompleteOnFocus } set(newAutocompleteOnFocus) { self._autocompleteOnFocus = newAutocompleteOnFocus } } open weak var listener: MaskedTextFieldDelegateListener? public init(format: String) { self._maskFormat = format self._autocomplete = false self._autocompleteOnFocus = false self.customNotations = [] super.init() } public override convenience init() { self.init(format: "") } open func put(text: String, into field: UITextField) { let result: Mask.Result = self.mask.apply( toText: CaretString( string: text, caretPosition: text.endIndex ), autocomplete: self._autocomplete ) field.text = result.formattedText.string let position: Int = result.formattedText.string.distance(from: result.formattedText.string.startIndex, to: result.formattedText.caretPosition) self.setCaretPosition(position, inField: field) self.listener?.textField?( field, didFillMandatoryCharacters: result.complete, didExtractValue: result.extractedValue ) } /** Maximal length of the text inside the field. - returns: Total available count of mandatory and optional characters inside the text field. */ open func placeholder() -> String { return self.mask.placeholder } /** Minimal length of the text inside the field to fill all mandatory characters in the mask. - returns: Minimal satisfying count of characters inside the text field. */ open func acceptableTextLength() -> Int { return self.mask.acceptableTextLength } /** Maximal length of the text inside the field. - returns: Total available count of mandatory and optional characters inside the text field. */ open func totalTextLength() -> Int { return self.mask.totalTextLength } /** Minimal length of the extracted value with all mandatory characters filled. - returns: Minimal satisfying count of characters in extracted value. */ open func acceptableValueLength() -> Int { return self.mask.acceptableValueLength } /** Maximal length of the extracted value. - returns: Total available count of mandatory and optional characters for extracted value. */ open func totalValueLength() -> Int { return self.mask.totalValueLength } // MARK: - UITextFieldDelegate open func textField( _ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String ) -> Bool { let extractedValue: String let complete: Bool if isDeletion( inRange: range, string: string ) { (extractedValue, complete) = self.deleteText(inRange: range, inField: textField) } else { (extractedValue, complete) = self.modifyText(inRange: range, inField: textField, withText: string) } self.listener?.textField?( textField, didFillMandatoryCharacters: complete, didExtractValue: extractedValue ) let _ = self.listener?.textField?(textField, shouldChangeCharactersIn: range, replacementString: string) return false } open func deleteText( inRange range: NSRange, inField field: UITextField ) -> (String, Bool) { let text: String = self.replaceCharacters( inText: field.text, range: range, withCharacters: "" ) let result: Mask.Result = self.mask.apply( toText: CaretString( string: text, caretPosition: text.index(text.startIndex, offsetBy: range.location) ), autocomplete: false ) field.text = result.formattedText.string self.setCaretPosition(range.location, inField: field) return (result.extractedValue, result.complete) } open func modifyText( inRange range: NSRange, inField field: UITextField, withText text: String ) -> (String, Bool) { let updatedText: String = self.replaceCharacters( inText: field.text, range: range, withCharacters: text ) let result: Mask.Result = self.mask.apply( toText: CaretString( string: updatedText, caretPosition: updatedText.index(updatedText.startIndex, offsetBy: self.caretPosition(inField: field) + text.count) ), autocomplete: self.autocomplete ) field.text = result.formattedText.string let position: Int = result.formattedText.string.distance(from: result.formattedText.string.startIndex, to: result.formattedText.caretPosition) self.setCaretPosition(position, inField: field) return (result.extractedValue, result.complete) } open func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool { return self.listener?.textFieldShouldBeginEditing?(textField) ?? true } open func textFieldDidBeginEditing(_ textField: UITextField) { if self._autocompleteOnFocus && textField.text!.isEmpty { let _ = self.textField( textField, shouldChangeCharactersIn: NSMakeRange(0, 0), replacementString: "" ) } self.listener?.textFieldDidBeginEditing?(textField) } open func textFieldShouldEndEditing(_ textField: UITextField) -> Bool { return self.listener?.textFieldShouldEndEditing?(textField) ?? true } open func textFieldDidEndEditing(_ textField: UITextField) { self.listener?.textFieldDidEndEditing?(textField) } open func textFieldShouldClear(_ textField: UITextField) -> Bool { let shouldClear: Bool = self.listener?.textFieldShouldClear?(textField) ?? true if shouldClear { let result: Mask.Result = self.mask.apply( toText: CaretString( string: "", caretPosition: "".endIndex ), autocomplete: self.autocomplete ) self.listener?.textField?( textField, didFillMandatoryCharacters: result.complete, didExtractValue: result.extractedValue ) } return shouldClear } open func textFieldShouldReturn(_ textField: UITextField) -> Bool { return self.listener?.textFieldShouldReturn?(textField) ?? true } open override var debugDescription: String { get { return self.mask.debugDescription } } open override var description: String { get { return self.debugDescription } } } internal extension MaskedTextFieldDelegate { func isDeletion(inRange range: NSRange, string: String) -> Bool { return 0 < range.length && 0 == string.count } func replaceCharacters(inText text: String?, range: NSRange, withCharacters newText: String) -> String { if let text = text { if 0 < range.length { let result = NSMutableString(string: text) result.replaceCharacters(in: range, with: newText) return result as String } else { let result = NSMutableString(string: text) result.insert(newText, at: range.location) return result as String } } else { return "" } } func caretPosition(inField field: UITextField) -> Int { // Workaround for non-optional `field.beginningOfDocument`, which could actually be nil if field doesn't have focus guard field.isFirstResponder else { return field.text?.count ?? 0 } if let range: UITextRange = field.selectedTextRange { let selectedTextLocation: UITextPosition = range.start return field.offset(from: field.beginningOfDocument, to: selectedTextLocation) } else { return 0 } } func setCaretPosition(_ position: Int, inField field: UITextField) { // Workaround for non-optional `field.beginningOfDocument`, which could actually be nil if field doesn't have focus guard field.isFirstResponder else { return } if position > field.text?.count ?? 0 { return } let from: UITextPosition = field.position(from: field.beginningOfDocument, offset: position)! let to: UITextPosition = field.position(from: from, offset: 0)! /** Shortly after new text is being pasted from the clipboard, UITextField receives a new value for its `selectedTextRange` property from the system. This new range is not consistent to the formatted text and calculated caret position most of the time, yet it's being assigned just after setCaretPosition call. To insure correct caret position is set, `selectedTextRange` is assigned asynchronously. (presumably after a vanishingly small delay) */ DispatchQueue.main.asyncAfter(deadline: DispatchTime.now()) { field.selectedTextRange = field.textRange(from: from, to: to) } } }
[ -1 ]
3dd149be775bd77041ea4f5af8ea7e01c8caa555
c895f5f558af5f3b18165746135de26d3fab3199
/PersianCalendarMac/PersianCalendarMac/ViewController.swift
f139cbf228081c632b9ad70909d93e9c5f757620
[ "MIT" ]
permissive
maniramezan/PersianCalendar
69a42407ea4db108b85d9a95aba34e9c127f9bf3
e442431b353108305ae9fd07e79e3221adb9e69f
refs/heads/master
2021-01-19T18:58:39.363254
2019-10-12T05:37:09
2020-06-26T23:55:05
88,390,778
1
0
null
null
null
null
UTF-8
Swift
false
false
1,516
swift
// // ViewController.swift // PersianCalendarMac // // Created by Mani Ramezan on 10/12/19. // Copyright © 2019 Mani Ramezan. All rights reserved. // import Cocoa import SafariServices.SFSafariApplication import SwiftUI class ViewController: NSViewController { @IBOutlet var calendarPlaceholder: NSView! private var theme = CalendarView.Theme() private let calendarView = CalendarView(currentCalendar: Calendar(identifier: .persian)) override func viewDidLoad() { super.viewDidLoad() let calendarContainerView = NSHostingView(rootView: calendarView.environmentObject(theme)) calendarPlaceholder.addSubview(calendarContainerView) calendarContainerView.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ calendarContainerView.topAnchor.constraint(equalTo: calendarPlaceholder.topAnchor), calendarContainerView.bottomAnchor.constraint(equalTo: calendarPlaceholder.bottomAnchor), calendarContainerView.leftAnchor.constraint(equalTo: calendarPlaceholder.leftAnchor), calendarContainerView.rightAnchor.constraint(equalTo: calendarPlaceholder.rightAnchor), ]) } @IBAction func openSafariExtensionPreferences(_ sender: AnyObject?) { SFSafariApplication.showPreferencesForExtension(withIdentifier: "com.manman.PersianCalendarMacExtension") { error in if let _ = error { } } } }
[ -1 ]
c688e642f660f42582fda90be44a94ff728984e7
c2f66ad221b0fd15eeba2220494f63ed8e20bc38
/DoXSw/src/managed/DocContentMO+CoreDataProperties.swift
468e3684e4ce951b75bd7683a9668ebd3adafec0
[]
no_license
NickUtenkov/DoXLogic
8ed06f5ce03db969ca7b5bb15beeec7d8ae995d8
5c5a62122918e1d77001a11c5dadcac25a9b0d94
refs/heads/master
2019-07-08T21:25:26.434407
2017-11-20T06:37:29
2017-11-20T06:37:29
89,463,407
0
0
null
null
null
null
UTF-8
Swift
false
false
2,835
swift
// // DocContentMO+CoreDataProperties.swift // DoXSw // // Created by nick on 19/12/16. // Copyright © 2016 nick. All rights reserved. // import Foundation import CoreData extension DocContentMO { @nonobjc public class func fetchRequest() -> NSFetchRequest<DocContentMO> { return NSFetchRequest<DocContentMO>(entityName: "DocContent"); } @NSManaged public var fileHash: String? @NSManaged public var rotation: Float @NSManaged public var fileName: String? @NSManaged public var fileSize: UInt64 @NSManaged public var mime: String? @NSManaged public var nOrder: Int @NSManaged public var fileId: Int @NSManaged public var scrollPos: Float @NSManaged public var isSelected: Bool @NSManaged public var docFiles: NSSet? @NSManaged public var childReportFiles: NSSet? @NSManaged public var docLinkedFiles: NSSet? @NSManaged public var childOutputFiles: NSSet? } // MARK: Generated accessors for docFiles extension DocContentMO { @objc(addDocFilesObject:) @NSManaged public func addToDocFiles(_ value: DocMO) @objc(removeDocFilesObject:) @NSManaged public func removeFromDocFiles(_ value: DocMO) @objc(addDocFiles:) @NSManaged public func addToDocFiles(_ values: NSSet) @objc(removeDocFiles:) @NSManaged public func removeFromDocFiles(_ values: NSSet) } // MARK: Generated accessors for childReportFiles extension DocContentMO { @objc(addChildReportFilesObject:) @NSManaged public func addToChildReportFiles(_ value: ChildTaskMO) @objc(removeChildReportFilesObject:) @NSManaged public func removeFromChildReportFiles(_ value: ChildTaskMO) @objc(addChildReportFiles:) @NSManaged public func addToChildReportFiles(_ values: NSSet) @objc(removeChildReportFiles:) @NSManaged public func removeFromChildReportFiles(_ values: NSSet) } // MARK: Generated accessors for docLinkedFiles extension DocContentMO { @objc(addDocLinkedFilesObject:) @NSManaged public func addToDocLinkedFiles(_ value: DocLinkedMO) @objc(removeDocLinkedFilesObject:) @NSManaged public func removeFromDocLinkedFiles(_ value: DocLinkedMO) @objc(addDocLinkedFiles:) @NSManaged public func addToDocLinkedFiles(_ values: NSSet) @objc(removeDocLinkedFiles:) @NSManaged public func removeFromDocLinkedFiles(_ values: NSSet) } // MARK: Generated accessors for childOutputFiles extension DocContentMO { @objc(addChildOutputFilesObject:) @NSManaged public func addToChildOutputFiles(_ value: ChildTaskMO) @objc(removeChildOutputFilesObject:) @NSManaged public func removeFromChildOutputFiles(_ value: ChildTaskMO) @objc(addChildOutputFiles:) @NSManaged public func addToChildOutputFiles(_ values: NSSet) @objc(removeChildOutputFiles:) @NSManaged public func removeFromChildOutputFiles(_ values: NSSet) }
[ -1 ]
947d1bb83f9ae0f7067b3019bb51e9287b58da5c
55f105083d3fea0a93a424c63ef341ad2738e191
/Hangman/GameViewController.swift
4a30646d0d86cf717dd4f6a973cb400c00704adb
[]
no_license
juliafriberg/hangman
52a826ca6729132b83a8ac595de8c6dbaba90f79
aa98e30f6d89f1d21b91b918fce6b2e0b7af504e
refs/heads/master
2020-12-03T01:58:53.235144
2017-07-06T10:42:04
2017-07-06T10:42:04
95,889,964
0
0
null
null
null
null
UTF-8
Swift
false
false
2,250
swift
import UIKit class GameViewController: UIViewController, GameDelegate { @IBOutlet weak var hangmanView: HangmanDrawingView! @IBOutlet weak var guessedWordView: GuessedWordView! @IBOutlet weak var letterButtonsView: LetterButtonsView! @IBOutlet weak var gameInformationLabel: UILabel! var gameViewModel: GameViewModel? override func viewDidLoad() { super.viewDidLoad() letterButtonsView.createButtons(letters: "abcdefghijklmnopqrstuvwxyz", actionTarget: self) guard let unwrappedGameViewModel = gameViewModel else { print("no game started") return } unwrappedGameViewModel.startGame() } func guessLetter(_ letter: Character) { guard let unwrappedGameViewModel = gameViewModel else { print("no game started") return } unwrappedGameViewModel.guess(letter) if unwrappedGameViewModel.gameIsOver() { unwrappedGameViewModel.showGameOverDialog() } } func resetUI() { hangmanView.clear() letterButtonsView.resetButtons() updateUI() } func updateUI() { updateGuessedWordLabel() updateGameInfoLabel() drawHangman() } func updateGuessedWordLabel() { guard let unwrappedGameViewModel = gameViewModel else { print("no game started") return } guessedWordView.setText(word: unwrappedGameViewModel.getGuessedWord().uppercased()) } func updateGameInfoLabel() { guard let unwrappedGameViewModel = gameViewModel else { print("no game started") return } gameInformationLabel.text = unwrappedGameViewModel.getGameInfoToDisplay() } func drawHangman() { guard let unwrappedGameViewModel = gameViewModel else { print("no game started") return } for part in unwrappedGameViewModel.partsToDraw() { hangmanView.add(part: part) } } func show(_ alertController: UIAlertController) { present(alertController, animated: true) } }
[ -1 ]
7967199daef15b69759560b29671be5648ed5b4e
f10b681c28d714b4baa81a69d64fbdca51218b6f
/MVVM/Classes/Services/NetworkService.swift
48f87d30dbd014723438093ed9c8396535098a05
[ "MIT" ]
permissive
thachnd-2069/mvvm
9a218b3a41ae244668d5555d7bd7f1077eae64ec
39621fc8b602b1cf3c42b375dd7fe4135f035ee3
refs/heads/master
2023-04-05T10:40:52.202340
2021-04-22T04:16:45
2021-04-22T04:16:45
null
0
0
null
null
null
null
UTF-8
Swift
false
false
6,238
swift
// // NetworkService.swift // MVVM // import Foundation import Alamofire import ObjectMapper import RxSwift /// Base network service, using SessionManager from Alamofire open class BaseNetworkService: SessionDelegate { public static var shared = BaseNetworkService() public let sessionManager: Session private let sessionConfiguration: URLSessionConfiguration = .default public var timeout: TimeInterval = 30 { didSet { sessionConfiguration.timeoutIntervalForRequest = timeout } } var defaultHeaders: HTTPHeaders = [:] // Disables all evaluation which in turn will always consider any server trust as valid. /* Example: "domain.com": DisabledEvaluator() */ let manager = ServerTrustManager(evaluators: [:]) public init() { sessionConfiguration.timeoutIntervalForRequest = timeout sessionManager = Session(configuration: sessionConfiguration) } public func callRequest(urlString: String, method: HTTPMethod, params: [String: Any]? = nil, parameterEncoding encoding: ParameterEncoding = URLEncoding.default, additionalHeaders: HTTPHeaders? = nil) -> Single<String> { return Single.create { single in let headers = self.makeHeaders(additionalHeaders) let request = self.sessionManager.request(urlString, method: method, parameters: params, encoding: encoding, headers: headers) request.responseString { response in /// set status code /// Check result switch response.result { case .success(let result): /// Implement the completion block with parameters single(.success(result)) case .failure(let error): single(.failure(error)) } } return Disposables.create { request.cancel() } } } public func request(urlString: String, method: HTTPMethod, params: [String: Any]? = nil, parameterEncoding encoding: ParameterEncoding = URLEncoding.default, additionalHeaders: HTTPHeaders? = nil) -> Single<APIResponse> { return Single.create { single in let headers = self.makeHeaders(additionalHeaders) let result = APIResponse() result.request = self.sessionManager.request(urlString, method: method, parameters: params, encoding: encoding, headers: headers) result.completeBlock { _, _ in single(.success(result)) } result.errorBlock { error in single(.failure(error)) } return Disposables.create {} } } private func makeHeaders(_ additionalHeaders: HTTPHeaders?) -> HTTPHeaders { var headers = defaultHeaders if let additionalHeaders = additionalHeaders { additionalHeaders.forEach { pair in headers[pair.name] = pair.value } } return headers } } public enum HttpStatusCode: Int { case ok = 200 case badRequest = 400 case unauthorized = 401 case dataNotFound = 404 case unAcceptable = 406 case serviceUnavailable = 503 case requestTimeOut = 408 init?(statusCode: Int?) { guard let _statusCode = statusCode else { return nil } self.init(rawValue: _statusCode) } var message: String { switch self { case .ok: return "The request has succeeded" case .badRequest: return "Bad Request." case .unauthorized: return "Unauthorized." case .dataNotFound: return "Not Found" case .unAcceptable: return "Not Acceptable" case .serviceUnavailable: return "Service Unavailable" case .requestTimeOut: return "Request timeout" } } } typealias CompletionBlock = (_ result: AnyObject?, _ usingCache: Bool) -> Void typealias ErrorBlock = (_ error: Error) -> Void open class APIResponse { var rq: DataRequest? public var result: AnyObject? public var statusCode: HttpStatusCode? public var _usingCache: Bool = false public var params: [String: Any]? var _onComplete: CompletionBlock? var _onError: ErrorBlock? func completeBlock(onComplete:@escaping CompletionBlock) { _onComplete = onComplete if self._usingCache { self.getDataFromCache() } } func errorBlock(onError:@escaping ErrorBlock) { _onError = onError } var request: DataRequest { get { return rq! } set (newVal) { newVal.responseJSON { response in self.statusCode = HttpStatusCode(statusCode: response.response?.statusCode) switch response.result { case .success(let result): self.result = result as AnyObject self._onComplete?(self.result, false) case .failure(let error): self._onError?(error) } } rq = newVal } } public func cURLString() -> String { if let request = self.rq { return request.cURLDescription() } return "" } func cacheAPI(_ object: AnyObject) {} func getDataFromCache() {} }
[ -1 ]
16864605e31003c304e42fff1e49e2a004b6e853
6f0cd225b1f2e4dba6606c09df3d04534a6e330c
/OnlineStore/App/Entity/Model/IsSuccess.swift
3085e3f17968005b6e63e944f486f869af1dbab9
[]
no_license
AlexanderPLv/OnlineStore
f2c834754c36a954b05d867e6ff27ddc226fc5cd
196e2dc7cadce0590d07e0ad97aac68bf4dea9ac
refs/heads/master
2023-04-25T14:56:23.384184
2021-05-10T22:41:54
2021-05-10T22:41:54
337,409,866
0
0
null
null
null
null
UTF-8
Swift
false
false
188
swift
// // File.swift // OnlineStore // // Created by Alexander Pelevinov on 18.02.2021. // import Foundation struct IsSuccess: Codable { let result: Int let userMessage: String }
[ -1 ]
4e1a5b1a0fae9045fbfef469bade1f315cec092c
f648a6d9029905347de7ee6070c03c3287551fcd
/tumblr_lab/PhotoDetailsViewController.swift
101d039b1494eea999198768a32400998fe76832
[ "Apache-2.0" ]
permissive
FFrancois98/tumblr_lab
8947fb9b64cdf2de4ef147cea0a94f1cb7022dfa
8303f863e31417bb5f485ad6331f6a9df64f7675
refs/heads/master
2020-03-28T10:11:20.479535
2018-09-11T18:00:48
2018-09-11T18:00:48
148,089,451
0
0
null
null
null
null
UTF-8
Swift
false
false
1,333
swift
// // PhotoDetailsViewController.swift // tumblr_lab // // Created by user144860 on 9/11/18. // Copyright © 2018 Fleurevca Francois. All rights reserved. // import UIKit class PhotoDetailsViewController: UIViewController { @IBOutlet weak var posterDetailView: UIImageView! var post: [String: Any]? override func viewDidLoad() { super.viewDidLoad() if let post = post { let photos = post["photos"] as? [[String: Any]] let photo = photos![0] let originalSize = photo["original_size"] as! [String: Any] let urlString = originalSize["url"] as! String let url = URL(string: urlString) posterDetailView.af_setImage(withURL: url!) } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
b5e2fdf14e49f65db512b69bf803fd3b45cae7ca
662f1ce527d11850e152c5c6f57442b8d2231750
/Hun_weatherApp/Hun_weatherApp/WeatherCell/WeatherTableViewCell.swift
4ba430506d5234e3b3f84819b3335cb41d447e13
[]
no_license
jdr4343/weatherApp
b501b53f1c9bbb2aaffe120acd9832a69cb687a3
2d485d830c064f08a3f43acfcec2a36273f6e44c
refs/heads/main
2023-08-02T09:59:05.709079
2021-10-01T06:49:54
2021-10-01T06:49:54
391,007,372
0
0
null
null
null
null
UTF-8
Swift
false
false
609
swift
// // WeatherTableViewCell.swift // Hun_weatherApp // // Created by 신지훈 on 2021/07/30. // import UIKit class WeatherTableViewCell: UITableViewCell { 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 } static let identifier = "WeatherTableViewCell" static func nib() -> UINib { return UINib(nibName: "WeatherTableViewCell", bundle: nil) } }
[ 325967 ]
3032c449080d2a845c48251b47b28305381f3095
6e1650af921713e7aaab4701df523b73d9a24d1a
/controller/IklanController.swift
51d1f9a339146c626d86b93a5a09fe2b8ccdd996
[]
no_license
handydannu/mybisnisapps-ios
14241d93c69a3e94dacf5566971c61befd9d8bc9
3414f1c246c4abe879c036c26ee57b29be10048f
refs/heads/master
2020-08-07T19:51:39.486581
2020-02-04T08:04:21
2020-02-04T08:04:21
213,570,307
0
0
null
null
null
null
UTF-8
Swift
false
false
3,706
swift
// // IklanController.swift // mybisnis // // Created by Wildan Angga Rahman on 7/2/18. // Copyright © 2018 Wildan Angga Rahman. All rights reserved. // import UIKit import ImageSlideshow class IklanController:BaseViewController{ let headerImage:UIImageView = { let image = UIImageView(image: #imageLiteral(resourceName: "header_bg_produk")) return image }() let judul:UIImageView = { let image = UIImageView(image: #imageLiteral(resourceName: "produk_iklan")) return image }() let tombolCetak: UIButton = { let button = UIButton() button.setImage(#imageLiteral(resourceName: "iklan_cetak"), for: .normal) button.addTarget(self, action: #selector(iklanCetakAction), for: .touchUpInside) return button }() let tombolWeb: UIButton = { let button = UIButton() button.setImage(#imageLiteral(resourceName: "iklan_web"), for: .normal) return button }() let iklan: UIImageView = { let image = UIImageView(image: #imageLiteral(resourceName: "iklan")) return image }() override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .white setupNavigation() setupHeader() setupMenu() } func setupMenu(){ [tombolCetak, tombolWeb, ].forEach(view.addSubview(_:)) let buttonSize = tombolCetak.currentImage?.aspectRatio(multiplier: 0.7, of: view) tombolCetak.anchor(top: headerImage.bottomAnchor, leading: nil, bottom: nil, trailing: nil, padding: .init(top: 32, left: 0, bottom: 0, right: 0), size: buttonSize!) tombolCetak.anchorCenter(horizontal: view.centerXAnchor, vertical: nil) tombolWeb.anchorBottom(to: tombolCetak, padding: .init(top: 16, left: 0, bottom: 0, right: 0), size: buttonSize!) let iklanSize = iklan.image?.aspectRatio(multiplier: 1, of: view) let slideShow = ImageSlideshow() NetworkUtils().fetchData(endPoint: "advert", completion: { (response: BaseResponse<[String]>) in let image = response.data.map({ (url) -> AlamofireSource in AlamofireSource(urlString: url)! }) slideShow.setImageInputs(image) }) { (error) in print("fetch iklan error") } view.addSubview(slideShow) slideShow.anchor(top: tombolWeb.bottomAnchor, leading: view.leadingAnchor, bottom: nil, trailing: view.trailingAnchor, padding: .init(top: 32, left: 16, bottom: 0, right: 16), size: iklanSize!) } func setupHeader(){ view.addSubview(headerImage) let headerImageSize = headerImage.image?.aspectRatio(multiplier: 1,of: view) headerImage.anchor(top: view.safeAreaLayoutGuide.topAnchor, leading: view.leadingAnchor, bottom: nil, trailing: view.trailingAnchor,size:headerImageSize!) headerImage.addSubview(judul) let judulSize = judul.image?.aspectRatio(multiplier: 0.20,of: headerImage) judul.anchor(top: headerImage.topAnchor, leading: headerImage.leadingAnchor, bottom: nil, trailing: nil, padding: .init(top: ((headerImageSize?.height)! - (judulSize?.height)!) * 0.5, left: 16, bottom: 0, right: 0), size: judulSize!) } @objc func iklanCetakAction(){ let iklanCetakController = IklanCetakController(collectionViewLayout: UICollectionViewFlowLayout()) self.navigationController?.pushViewController(iklanCetakController, animated: true) } }
[ -1 ]
cf636d5c897ce7952979adfd51c4e4a26584b2dd
0a6d74888fc8ef0021ca3b7d3dae0605bdecf206
/BreakOut/Settings.swift
a6fb5a1be196fe08500dca402ca5894e304b39b7
[]
no_license
bradengray/Breakout
ca1a4ff6b9845908d55531d194b70e0e8811cc22
eb9d7ac7799373b122a1d5063c118387b8fcf25f
refs/heads/master
2021-01-11T23:32:27.519220
2017-01-25T01:11:39
2017-01-25T01:11:39
78,597,721
0
0
null
null
null
null
UTF-8
Swift
false
false
4,046
swift
// // Settings.swift // BreakOut // // Created by Braden Gray on 12/21/16. // Copyright © 2016 Graycode. All rights reserved. // import UIKit protocol SettingsDelegate { func settingsChanged() } struct Settings { //MARK: - Public static var shared = Settings() var delegate: SettingsDelegate? var specialBricks: SpecialBricks { get { let value = getDefault(key: Constants.SpecialBricksKey) as? NSNumber.IntegerLiteralType ?? 1 return SpecialBricks(rawValue: value) ?? .Yes } set { setDefault(value: NSNumber.init(integerLiteral: newValue.rawValue) as AnyObject, key: Constants.SpecialBricksKey) } } var ballSpeed: BallSpeed { get { let value = getDefault(key: Constants.BallSpeedKey) as? NSNumber.IntegerLiteralType ?? 0 return BallSpeed(rawValue: value) ?? .Slow } set { setDefault(value: NSNumber.init(integerLiteral: newValue.rawValue) as AnyObject, key: Constants.BallSpeedKey) } } var bricksPerRow: Int { get { return getDefault(key: Constants.BricksPerRowKey) as? NSNumber.IntegerLiteralType ?? 2 } set { setDefault(value: NSNumber.init(integerLiteral: newValue) as AnyObject, key: Constants.BricksPerRowKey) } } var numberOfRows: Int { get { return getDefault(key: Constants.NumberOfRowsKey) as? NSNumber.IntegerLiteralType ?? 1 } set { setDefault(value: NSNumber.init(integerLiteral: newValue) as AnyObject, key: Constants.NumberOfRowsKey) } } var brickColor: Item { get { let value = getDefault(key: Constants.BrickColorKey) as? NSNumber.IntegerLiteralType ?? 0 return colors[value % colors.count] } set { var index: Int = 0 if let arrIndex = colors.index(where: { $0.color == newValue.color } ) { index = arrIndex.hashValue } setDefault(value: NSNumber.init(integerLiteral: index) as AnyObject, key: Constants.BrickColorKey) } } enum SpecialBricks: Int { case No case Yes } enum BallSpeed: Int { case Slow case Medium case Fast } enum Item { case Brick(UIColor) var color: (UIColor) { switch self { case .Brick(let val): return val } } } let colors: [Item] = [ .Brick(.green), .Brick(.blue), .Brick(.orange), .Brick(.red), .Brick(.purple), .Brick(.black), .Brick(.brown) ] //Mark: - Constants private struct Constants { static let UserDefaultsKey = "User Defaults Key" static let SpecialBricksKey = "Special Bricks Key" static let BallSpeedKey = "Ball Speed Key" static let NumberOfRowsKey = "Number Of Rows Key" static let BricksPerRowKey = "Bricks Per Row Key" static let BrickColorKey = "Brick Color Key" } //Mark: - User Defaults private func getDefault(key: String) -> AnyObject? { let defaults = UserDefaults.standard if let dictionary = defaults.dictionary(forKey: Constants.UserDefaultsKey) { if let value = dictionary[key] { return value as AnyObject } } return nil } private func setDefault(value: AnyObject, key: String) { let defaults = UserDefaults.standard var dictionary = defaults.dictionary(forKey: Constants.UserDefaultsKey) if dictionary == nil { dictionary = [:] } dictionary?[key] = value defaults.setValue(dictionary, forKey: Constants.UserDefaultsKey) defaults.synchronize() changedSomeSetting() } func changedSomeSetting() { delegate?.settingsChanged() } }
[ -1 ]
03d3d1be12cc0d52dc422e435f3318f260cc3a6d
ed262f68e216e9dd784b65fc86a33a20ce71f0d8
/HelloWorld/AppDelegate.swift
1c7988308088b4b2bd2a6d56b0dd39add7ba8cbb
[]
no_license
wadayutaka/HelloWorld
ce9e59b15985d4549ef1dd5b993fe79e45da1fa0
ed4c0844d8b3a2d816cc6d601a3b503b86f0a599
refs/heads/master
2020-03-30T06:02:41.227247
2018-09-29T07:00:25
2018-09-29T07:00:25
150,835,315
0
0
null
null
null
null
UTF-8
Swift
false
false
2,176
swift
// // AppDelegate.swift // HelloWorld // // Created by 和田裕 on 2018/09/29. // Copyright © 2018 wada.yutaka. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 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, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 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, 205479, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312005, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 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, 189325, 189329, 295825, 304019, 213902, 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, 304258, 279683, 222340, 66690, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 279929, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 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, 402969, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 370279, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 198310, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 288499, 419570, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 337732, 304968, 280393, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 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, 215387, 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, 436684, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 330244, 281095, 223752, 150025, 338440, 240132, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 182929, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 256716, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 240519, 322440, 314249, 338823, 183184, 289687, 224151, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 420829, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 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, 298365, 290174, 306555, 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, 282255, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 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, 295583, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 276052, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 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, 127447, 283095, 299481, 176605, 242143, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 283142, 127494, 127497, 233994, 135689, 127500, 291341, 233998, 127506, 234003, 127509, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 299740, 242396, 201444, 299750, 283368, 234219, 283372, 185074, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 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, 324490, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 234396, 291742, 226200, 234398, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 324522, 234410, 291756, 226220, 291754, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 275384, 324536, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 226245, 234437, 234439, 226239, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 308226, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 275606, 275608, 234650, 324757, 308379, 300189, 324766, 119967, 234653, 234648, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 324768, 275626, 234667, 177318, 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, 349451, 275725, 349464, 415009, 283939, 259367, 292143, 283951, 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, 292414, 284223, 284226, 284228, 292421, 226886, 284231, 128584, 243268, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 276053, 284247, 317015, 284249, 243290, 284251, 235097, 284253, 300638, 284255, 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, 399252, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 276402, 358326, 161718, 358330, 276410, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 350186, 292843, 276460, 276464, 178161, 227314, 276466, 325624, 350200, 276472, 317435, 276476, 276479, 276482, 350210, 276485, 317446, 178181, 276490, 350218, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 178224, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 243779, 325700, 284739, 292934, 243785, 276553, 350293, 350295, 309337, 194649, 227418, 350299, 350302, 227423, 350304, 178273, 309346, 194657, 194660, 350308, 309350, 309348, 292968, 309352, 227426, 276579, 227430, 276583, 309354, 301167, 276590, 350321, 350313, 350316, 284786, 350325, 252022, 276595, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 309491, 227571, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 129486, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 301636, 318020, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 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, 56045, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 277322, 293706, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 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, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 384302, 285999, 277804, 113969, 277807, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 146765, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 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, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187936, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 278057, 310831, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 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 ]
20fc3d0ab5ff6418bf6984507302d908a3a4477e
09fe22a2f4a9815a6ac27e11ae20d817b5ab398b
/oneheart-ios/oneheart/oneheart/AppDelegate.swift
f3631e94079bbd3c89b9fee7da901bac1211bcc4
[]
no_license
fomjar/oneheart
fe142e62cbb5f43d51827580a86f247c1844bc78
a5d23e88fad2713cb2d28e11c004499dc30a7d88
refs/heads/master
2021-03-24T10:03:40.855501
2018-10-24T12:01:38
2018-10-24T12:01:38
109,913,695
0
0
null
null
null
null
UTF-8
Swift
false
false
2,235
swift
// // AppDelegate.swift // oneheart // // Created by fomjar on 2017/11/16. // Copyright © 2017年 fomjar. All rights reserved. // import UIKit import fcore @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. fnet.server(host: "api.oneheart.fomjar.com") 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, 294924, 229388, 327695, 229391, 229394, 229397, 229399, 229402, 278556, 229405, 229408, 294950, 229415, 229417, 327722, 237613, 229422, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 229432, 204856, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 319590, 311400, 278635, 303212, 278639, 131192, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 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, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 320007, 287238, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 311850, 279082, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 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, 311942, 303751, 287365, 352905, 311946, 287371, 279178, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 287390, 303773, 172705, 287394, 172707, 303780, 164509, 287398, 205479, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312005, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 189169, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 304007, 304009, 213895, 304011, 230284, 304013, 295822, 189325, 279438, 189329, 295825, 304019, 189331, 58262, 304023, 304027, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 230413, 197645, 295949, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 66690, 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, 230679, 320792, 230681, 296215, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 181631, 148865, 312711, 296331, 288140, 288144, 230800, 304533, 288154, 337306, 173472, 288160, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 279991, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 148946, 370130, 222676, 288210, 280021, 288212, 288214, 329177, 239064, 288217, 288218, 280027, 239070, 288220, 288224, 370146, 288226, 280036, 288229, 320998, 280038, 288232, 288230, 288234, 280034, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 206336, 296450, 148990, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 402969, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 370279, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 198310, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 288499, 419570, 288502, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 337732, 280388, 304968, 280393, 280402, 173907, 313171, 313176, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 275608, 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, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 305464, 280888, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 215387, 354653, 354656, 313700, 280937, 313705, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 436684, 281045, 281047, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 330244, 240132, 223752, 150025, 338440, 281095, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 182929, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 256716, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 240519, 183184, 289687, 224151, 240535, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 420829, 281567, 289762, 322534, 297961, 183277, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 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, 298365, 290174, 306555, 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, 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, 282255, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 282337, 216801, 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, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 282481, 110450, 315251, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 44948, 298901, 241560, 282520, 241563, 241565, 241567, 241569, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 290739, 241588, 282547, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 282654, 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, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 184503, 299191, 307385, 176311, 258235, 307388, 176316, 307390, 307386, 299200, 184512, 307394, 299204, 307396, 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, 282957, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 276053, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 291226, 242075, 283033, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 291254, 283062, 127417, 291260, 127421, 127424, 299457, 127429, 127431, 127434, 315856, 127440, 176592, 315860, 176597, 127447, 299481, 127449, 176605, 242143, 127455, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 127494, 283142, 127497, 233994, 135689, 127500, 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, 299655, 373383, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 299740, 242396, 201444, 299750, 283368, 234219, 283372, 185074, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 234246, 226056, 291593, 234248, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 291711, 234368, 291714, 234370, 291716, 234373, 201603, 226182, 234375, 308105, 324490, 226185, 234379, 234384, 234388, 234390, 324504, 226200, 209818, 308123, 234396, 324508, 291742, 234393, 234401, 291747, 291748, 234405, 291750, 324518, 324520, 234407, 324522, 234410, 291756, 291754, 226220, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 226245, 234437, 226239, 234439, 234443, 291788, 193486, 234446, 193488, 234449, 316370, 275406, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 308226, 234501, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 234585, 275545, 242777, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 324757, 234647, 234648, 226453, 234650, 308379, 275606, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 177318, 283813, 234661, 234664, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 349451, 177424, 275725, 283917, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 300357, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 136562, 324978, 333178, 275834, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 300448, 144807, 144810, 144812, 284076, 144814, 227426, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 227430, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 292414, 284223, 284226, 284228, 243268, 292421, 284231, 226886, 128584, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 284249, 284251, 284253, 300638, 284255, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 325251, 276095, 276098, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 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, 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, 317332, 358292, 399252, 284564, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 276402, 358326, 161718, 358330, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 276448, 153568, 292839, 276455, 350186, 292843, 276460, 178161, 227314, 276466, 325624, 350200, 276472, 317435, 276476, 276479, 350210, 276482, 178181, 317446, 276485, 350218, 276490, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 178224, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 243779, 325700, 284739, 292934, 243785, 350293, 350295, 309337, 194649, 350299, 227418, 350302, 194654, 350304, 178273, 309346, 227423, 194660, 350308, 309350, 309348, 292968, 309352, 350313, 309354, 350316, 301163, 276583, 301167, 276586, 350321, 276590, 227440, 284786, 350325, 252022, 276595, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 153765, 284837, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 227571, 309491, 309494, 243960, 227583, 276735, 276739, 211204, 276742, 227596, 325910, 309530, 342298, 211232, 317729, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 129486, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 301636, 318020, 301639, 301643, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 318132, 154292, 277173, 342707, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 56045, 277232, 228081, 56059, 310015, 285441, 310020, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 293696, 310080, 277317, 277322, 277329, 162643, 310100, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 277368, 15224, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 276579, 293817, 293820, 203715, 326603, 342994, 293849, 293861, 228327, 228328, 318442, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 244731, 285690, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 384302, 285999, 277804, 113969, 277807, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 302403, 294211, 384328, 277832, 277836, 294221, 146765, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 245191, 64966, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 40448, 228864, 286214, 228871, 302603, 302614, 302617, 286233, 302621, 286240, 187936, 146977, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 245288, 310831, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 302764, 278188, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 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, 311283, 278516, 237562 ]
a57cf3fae6979315d3506407c4f64d5705a30322
86d634394c5bfc81daa99ca7d3fe8a2702226e64
/testyTests/testyTests.swift
1df963e26a6cd016fb137d5c7eb7dc75a0308e38
[]
no_license
buliam/testy
e5939053e248d738ec34fed5b67e4cd9e88f0022
c0e046cf830237588deee8392d15f6b22d5efac6
refs/heads/master
2020-04-05T01:44:47.261704
2018-11-06T20:47:08
2018-11-06T20:47:08
156,448,106
0
0
null
null
null
null
UTF-8
Swift
false
false
894
swift
// // testyTests.swift // testyTests // // Created by Liam Birtles on 06/11/2018. // Copyright © 2018 dmdtest. All rights reserved. // import XCTest @testable import testy class testyTests: XCTestCase { override func setUp() { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 360462, 16419, 229413, 204840, 344107, 155694, 229424, 319542, 229430, 163896, 180280, 352315, 376894, 352326, 196691, 385116, 237663, 254048, 319591, 221290, 319598, 204916, 131191, 131198, 311438, 278677, 196760, 426138, 278691, 173, 377009, 278708, 295098, 417988, 417994, 139479, 229597, 311519, 205035, 385262, 327929, 344313, 147717, 368905, 180493, 254226, 319763, 368916, 262421, 377114, 237856, 237857, 311597, 98610, 180535, 336183, 287041, 319813, 319821, 344401, 377169, 368981, 155990, 368984, 106847, 98657, 270701, 270706, 246136, 246137, 106874, 139640, 311681, 311685, 106888, 385417, 311691, 385422, 213403, 246178, 385454, 311727, 377264, 319930, 311738, 33211, 336317, 336320, 311745, 254406, 188871, 278993, 278999, 328152, 369116, 287198, 279018, 319981, 319987, 279029, 254456, 377338, 279039, 377343, 254465, 279050, 139792, 303636, 393751, 254488, 279065, 377376, 377386, 197167, 385588, 352829, 115270, 385615, 426576, 369235, 295519, 139872, 66150, 139892, 344696, 287352, 311941, 336518, 369289, 311945, 344715, 311949, 287374, 377489, 311954, 352917, 230040, 271000, 377497, 303771, 377500, 205471, 344738, 139939, 295599, 205487, 303793, 336564, 230072, 287417, 287422, 377539, 164560, 385747, 361176, 418520, 287452, 279269, 246503, 369385, 312047, 418546, 312052, 172792, 344827, 221948, 205568, 295682, 197386, 434957, 426774, 197399, 426775, 197411, 295724, 353069, 197422, 353070, 164656, 295729, 353078, 353079, 197431, 336702, 279362, 353095, 353109, 377686, 230234, 189275, 435039, 295776, 303972, 385893, 246641, 246643, 295798, 246648, 361337, 254850, 369538, 287622, 58253, 426895, 295824, 353195, 140204, 353197, 377772, 304051, 230332, 377790, 353215, 353216, 213957, 345033, 279498, 386006, 418776, 50143, 123881, 320493, 320494, 271350, 295927, 320507, 328700, 328706, 410627, 320516, 295942, 386056, 353290, 377869, 320527, 238610, 418837, 140310, 320536, 369701, 345132, 238639, 312373, 238651, 361535, 214086, 377926, 238664, 361543, 353367, 156765, 361566, 304222, 173166, 377972, 337017, 377983, 402565, 386189, 296086, 238743, 296092, 238765, 238769, 402613, 230588, 279747, 353479, 353480, 353481, 353482, 402634, 189653, 419029, 148696, 296153, 304351, 222440, 328940, 353523, 353524, 386294, 386301, 320770, 386306, 312587, 328971, 353551, 320796, 222494, 369956, 353584, 345396, 386359, 116026, 378172, 279875, 345415, 312648, 337225, 304456, 230729, 238927, 353616, 378209, 386412, 230765, 312689, 296307, 116084, 337281, 148867, 296329, 304524, 296335, 9619, 370071, 173491, 304564, 353719, 361927, 296392, 280010, 280013, 329173, 239068, 280032, 271843, 361963, 329197, 329200, 296433, 321009, 288249, 296448, 329225, 230921, 296461, 304656, 329232, 370197, 402985, 394794, 312880, 288309, 312889, 280130, 288327, 239198, 99938, 345700, 312940, 222832, 247416, 370296, 288378, 337534, 337535, 263809, 312965, 239237, 288392, 239250, 419478, 345752, 255649, 206504, 321199, 337591, 280251, 321219, 403148, 9936, 313041, 9937, 370388, 272085, 345814, 181975, 18138, 345821, 321247, 321249, 345833, 345834, 280300, 239341, 67315, 173814, 313081, 288512, 288516, 280327, 321302, 345879, 321310, 255776, 247590, 362283, 378668, 296755, 321337, 345919, 436031, 403267, 345929, 337745, 255829, 18262, 362327, 280410, 345951, 362337, 345955, 296806, 280430, 313199, 214895, 362352, 313203, 124798, 182144, 305026, 329622, 337815, 239514, 436131, 354212, 313254, 436137, 362417, 362431, 280514, 174019, 214984, 321480, 362443, 346067, 329695, 436191, 313319, 354280, 247785, 337895, 296941, 436205, 329712, 362480, 43014, 354316, 313357, 239650, 223268, 354343, 354345, 223274, 321583, 346162, 124984, 288828, 436285, 288833, 288834, 436292, 403525, 313416, 436301, 354385, 338001, 338003, 280661, 329814, 354393, 280675, 321637, 329829, 280677, 43110, 436329, 288879, 288889, 215164, 313469, 215166, 280712, 346271, 436383, 362659, 239793, 182456, 280762, 379071, 280768, 149703, 346314, 321745, 387296, 280802, 379106, 346346, 321772, 436470, 149760, 411906, 313608, 321800, 125199, 272658, 125217, 338218, 321840, 379186, 321860, 182598, 280902, 289110, 215385, 272729, 354655, 354676, 199029, 313727, 436608, 362881, 240002, 248194, 436611, 395659, 240016, 108944, 190871, 149916, 420253, 141728, 289189, 108972, 272813, 338356, 436661, 289232, 256477, 330218, 281072, 109042, 174593, 420369, 322078, 207393, 289332, 174648, 338489, 338490, 322120, 297560, 354911, 436832, 436834, 420463, 346737, 313971, 346740, 420471, 330379, 117396, 346772, 264856, 314009, 289434, 346779, 363163, 166582, 314040, 109241, 363211, 363230, 264928, 338662, 330474, 289518, 322291, 125684, 363263, 191235, 264968, 322316, 117517, 322319, 166676, 207640, 281377, 289576, 191283, 273207, 355130, 289598, 355139, 355146, 355152, 355154, 322395, 355165, 109409, 355178, 207727, 330609, 207732, 158593, 240518, 109447, 224145, 355217, 256922, 289690, 240544, 289698, 420773, 289703, 256935, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 330708, 248796, 248797, 347103, 52200, 183279, 347123, 240630, 257024, 330754, 134150, 330763, 330772, 322582, 248872, 322612, 314436, 314448, 339030, 314467, 257125, 273515, 404593, 363641, 363644, 150657, 248961, 330888, 363669, 339100, 380061, 339102, 199839, 429214, 265379, 249002, 306346, 3246, 421048, 339130, 208058, 265412, 290000, 298208, 298212, 298213, 290022, 330984, 298221, 298228, 216315, 388349, 437505, 322824, 257305, 126237, 339234, 208164, 109861, 372009, 412971, 306494, 216386, 224586, 331090, 314710, 372054, 159066, 314720, 314728, 380271, 314739, 208244, 314741, 249204, 290173, 306559, 224640, 314751, 314758, 388487, 314760, 298374, 142729, 314766, 306579, 224661, 282007, 290207, 314783, 314789, 282022, 314791, 396711, 396712, 314798, 380337, 380338, 150965, 380357, 339398, 306639, 413137, 429542, 282096, 306673, 191990, 290301, 372227, 323080, 323087, 323089, 175639, 388632, 396827, 282141, 134686, 355876, 347694, 290358, 265798, 282183, 265804, 396882, 44635, 396895, 323172, 323178, 224883, 314998, 323196, 175741, 339584, 282245, 224901, 323217, 298654, 282271, 282276, 298661, 282280, 298667, 61101, 364207, 224946, 110268, 224958, 323263, 323264, 274115, 306890, 241361, 241365, 298712, 298720, 323331, 339715, 323332, 216839, 339720, 372496, 323346, 241441, 241442, 339745, 257830, 421672, 315202, 339783, 216918, 241495, 307031, 241528, 315264, 339841, 282504, 315273, 315274, 184208, 372626, 380821, 118685, 298909, 323507, 200627, 290745, 290746, 274371, 151497, 372701, 298980, 380908, 282612, 290811, 241692, 102437, 315432, 315434, 102445, 233517, 176175, 241716, 241720, 225351, 315465, 315476, 307289, 200794, 315487, 356447, 45153, 307301, 315497, 315498, 438377, 233589, 266357, 422019, 241808, 323729, 381073, 299174, 241843, 405687, 258239, 389313, 299203, 299209, 372941, 282831, 266449, 307435, 438511, 381172, 356602, 184575, 381208, 315673, 151839, 233762, 217380, 151847, 282919, 332083, 332085, 332089, 241986, 438596, 332101, 323913, 323916, 348492, 323920, 348500, 168281, 332123, 332127, 242023, 160110, 242033, 291192, 315770, 340357, 225670, 332167, 242058, 373134, 291224, 242078, 315810, 315811, 381347, 340398, 127427, 324039, 373197, 242139, 160225, 242148, 242149, 291311, 291333, 340490, 348682, 283153, 258581, 234036, 234040, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 340558, 381517, 332378, 201308, 242277, 111208, 184940, 373358, 389745, 209530, 356989, 373375, 152195, 348806, 316049, 316053, 111253, 111258, 111259, 176808, 299699, 422596, 422599, 291530, 225995, 242386, 422617, 422626, 234217, 299759, 299776, 291585, 430849, 291592, 62220, 422673, 430865, 291604, 422680, 283419, 152365, 422703, 422709, 152374, 160571, 430910, 160575, 160580, 381773, 201551, 242529, 349026, 357218, 275303, 201577, 308076, 242541, 177019, 185211, 308092, 398206, 291712, 381829, 316298, 349067, 349072, 308112, 390045, 127902, 185250, 185254, 283558, 316333, 316343, 373687, 373706, 316364, 324586, 316405, 349175, 201720, 127992, 357379, 308243, 316437, 201755, 357414, 300084, 324666, 324667, 308287, 21569, 218186, 341073, 439384, 300135, 300136, 316520, 316526, 357486, 144496, 300146, 300150, 291959, 300151, 160891, 300158, 349316, 349318, 373903, 177296, 169104, 185493, 119962, 300187, 300188, 300201, 300202, 373945, 259268, 62665, 283852, 283853, 259280, 316627, 333011, 357595, 292085, 234742, 128251, 316669, 242954, 439562, 292107, 414990, 251153, 177428, 349462, 382258, 300343, 382269, 193859, 177484, 406861, 259406, 234831, 120148, 283991, 374109, 316765, 333160, 316787, 357762, 112017, 234898, 259475, 275859, 357786, 251298, 333220, 316842, 374191, 292292, 300487, 300489, 366037, 210390, 210391, 210392, 210393, 144867, 54765, 251378, 308723, 300536, 300542, 259599, 316946, 308756, 398869, 374296, 374299, 308764, 349726, 431649, 169518, 431663, 194110, 349763, 218696, 292425, 128587, 333388, 333393, 349781, 128599, 333408, 374372, 300644, 415338, 243307, 54893, 325231, 333430, 325245, 235135, 194180, 415375, 153251, 300714, 210603, 415420, 333503, 259781, 333509, 333517, 333520, 325346, 153319, 325352, 284401, 300794, 325371, 243472, 366360, 325404, 325410, 341796, 333610, 399147, 431916, 317232, 300848, 259899, 325439, 325445, 153415, 341836, 415567, 325457, 317269, 341847, 350044, 128862, 276327, 292712, 423789, 292720, 325492, 276341, 341879, 317304, 333688, 112509, 325503, 55167, 333701, 243591, 325515, 317323, 350093, 325518, 333722, 350109, 300963, 292771, 333735, 415655, 284587, 292782, 317360, 243637, 301008, 153554, 292836, 292837, 317415, 325619, 432116, 333817, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 292902, 325674, 243759, 309295, 129076, 243767, 358456, 325694, 227428, 194666, 260207, 432240, 333940, 292988, 333955, 194691, 415881, 104587, 235662, 325776, 317587, 284826, 333991, 333996, 194782, 301279, 317664, 243962, 375039, 194820, 325905, 334103, 325912, 309529, 211235, 432421, 211238, 358703, 358709, 325968, 366930, 6489, 391520, 383332, 383336, 317820, 211326, 317831, 252308, 293274, 39324, 121245, 342450, 334260, 293303, 293310, 342466, 416197, 129483, 342476, 317901, 6606, 334290, 358882, 342498, 334309, 195045, 391655, 432618, 375276, 301571, 342536, 416286, 375333, 244269, 375343, 236081, 23092, 375351, 244281, 301638, 309830, 293448, 55881, 416341, 309846, 416351, 268899, 244327, 39530, 244347, 326287, 375440, 334481, 318106, 318107, 342682, 318130, 383667, 293556, 342713, 39614, 334547, 318173, 375526, 342762, 342763, 293612, 129773, 154359, 228088, 432893, 162561, 383754, 310036, 285466, 326429, 293664, 326433, 400166, 293672, 318250, 318252, 301871, 375609, 293693, 342847, 252741, 293711, 244568, 244570, 351077, 342887, 326505, 211829, 228215, 269178, 211836, 400252, 359298, 359299, 260996, 113542, 416646, 392074, 236428, 56208, 400283, 318364, 310176, 310178, 293800, 236461, 252847, 326581, 326587, 326601, 359381, 433115, 343005, 64485, 326635, 203757, 187374, 383983, 383982, 318461, 293886, 293893, 433165, 384016, 433174, 326685, 252958, 252980, 359478, 203830, 359495, 277597, 113760, 392290, 253029, 285798, 318572, 15471, 351344, 285814, 285820, 392318, 384131, 302216, 326804, 187544, 351390, 343203, 253099, 253100, 318639, 294068, 367799, 113850, 294074, 302274, 367810, 343234, 244940, 359647, 195808, 310497, 302325, 228600, 261377, 228609, 318733, 245019, 253216, 130338, 130348, 261425, 351537, 286013, 146762, 294218, 294219, 318805, 425304, 163175, 327024, 327025, 318848, 179587, 253317, 384393, 368011, 318864, 318868, 212375, 318875, 310692, 245161, 286129, 286132, 228795, 425405, 302531, 425418, 302540, 310736, 286172, 187878, 245223, 359930, 286202, 302590, 294400, 253451, 253452, 359950, 146964, 253463, 187938, 286244, 245287, 245292, 425535, 196164, 286288, 179801, 196187, 343647, 310889, 204397, 138863, 188016, 294529, 229001, 188048, 425626, 302754, 229029, 40614, 286391, 384695, 327358, 286399, 319177, 212685, 384720, 302802, 278233, 278240, 212716, 212717, 294638, 360177, 229113, 278272, 319233, 360195, 286494, 294700, 409394, 319292, 360252, 360264, 376669, 245599, 425825, 425833, 417654, 188292, 327557, 253829, 294807, 376732, 311199, 319392, 253856, 294823, 327596, 294843, 188348, 237504, 294850, 384964, 344013, 212942, 212946, 24532, 212951, 360417, 294886, 311281, 311282 ]
4fad28253d4a3e1a3d532a54e8f3eca1b14d723e
99755051b8b2d7a226af721bdccc725a7c3f38b0
/Public/Category/System/UIBarButtonItemFixSpace.swift
a7c8082a4220971cb11417a056f7d726b3af9d20
[]
no_license
luuuuuuuyouli/swift-tools
90e786a4f36bef818f10b8a98082c7122e9e39c5
f0d58e7f90ee5dacccc7218ad4531449d96893ff
refs/heads/master
2020-04-25T14:59:02.022491
2019-02-27T07:04:36
2019-02-27T07:04:36
172,862,018
0
0
null
null
null
null
UTF-8
Swift
false
false
7,638
swift
// UIBarButtonItemFixSpace.swift // UINavigation-SXFixSpace-Swift // // Created by charles on 2017/11/2. // Copyright © 2017年 charles. All rights reserved. // import Foundation import UIKit extension NSObject { static func swizzleMethod(_ cls: AnyClass, originalSelector: Selector, swizzleSelector: Selector){ let originalMethod = class_getInstanceMethod(cls, originalSelector)! let swizzledMethod = class_getInstanceMethod(cls, swizzleSelector)! let didAddMethod = class_addMethod(cls, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)) if didAddMethod { class_replaceMethod(cls, swizzleSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)) } else { method_exchangeImplementations(originalMethod, swizzledMethod) } } } extension UIApplication { private static let classSwizzedMethod: Void = { UINavigationController.sx_initialize if #available(iOS 11.0, *) { UINavigationBar.sx_initialize } }() open override var next: UIResponder? { UIApplication.classSwizzedMethod return super.next } } public var sx_defultFixSpace: CGFloat = 0 public var sx_disableFixSpace: Bool = false extension UINavigationController { private struct AssociatedKeys { static var tempDisableFixSpace = "tempDisableFixSpace" static var tempBehavor = "tempBehavor" } static let sx_initialize: Void = { DispatchQueue.once(UUID().uuidString) { swizzleMethod(UINavigationController.self, originalSelector: #selector(UINavigationController.viewDidLoad), swizzleSelector: #selector(UINavigationController.sx_viewDidLoad)) swizzleMethod(UINavigationController.self, originalSelector: #selector(UINavigationController.viewWillAppear(_:)), swizzleSelector: #selector(UINavigationController.sx_viewWillAppear(_:))) swizzleMethod(UINavigationController.self, originalSelector: #selector(UINavigationController.viewWillDisappear(_:)), swizzleSelector: #selector(UINavigationController.sx_viewWillDisappear(_:))) } }() private var tempDisableFixSpace: Bool { get { return objc_getAssociatedObject(self, &AssociatedKeys.tempDisableFixSpace) as? Bool ?? false } set { objc_setAssociatedObject(self, &AssociatedKeys.tempDisableFixSpace, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) } } @available(iOS 11.0, *) private var tempBehavor: UIScrollView.ContentInsetAdjustmentBehavior { get { return objc_getAssociatedObject(self, &AssociatedKeys.tempBehavor) as? UIScrollView.ContentInsetAdjustmentBehavior ?? .automatic } set { objc_setAssociatedObject(self, &AssociatedKeys.tempBehavor, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) } } @objc private func sx_viewDidLoad() { disableFixSpace(true, with: true) sx_viewDidLoad() } @objc private func sx_viewWillAppear(_ animated: Bool) { disableFixSpace(true, with: false) sx_viewWillAppear(animated) } @objc private func sx_viewWillDisappear(_ animated: Bool) { disableFixSpace(false, with: true) sx_viewWillDisappear(animated) } private func disableFixSpace(_ disable: Bool, with temp: Bool) { if type(of: self) == UIImagePickerController.self { if disable == true { if temp { tempDisableFixSpace = sx_disableFixSpace } sx_disableFixSpace = true if #available(iOS 11.0, *) { tempBehavor = UIScrollView.appearance().contentInsetAdjustmentBehavior UIScrollView.appearance().contentInsetAdjustmentBehavior = .automatic } } else { sx_disableFixSpace = tempDisableFixSpace if #available(iOS 11.0, *) { UIScrollView.appearance().contentInsetAdjustmentBehavior = tempBehavor } } } } } @available(iOS 11.0, *) extension UINavigationBar { static let sx_initialize: Void = { DispatchQueue.once(UUID().uuidString) { swizzleMethod(UINavigationBar.self, originalSelector: #selector(UINavigationBar.layoutSubviews), swizzleSelector: #selector(UINavigationBar.sx_layoutSubviews)) } }() @objc func sx_layoutSubviews() { sx_layoutSubviews() if sx_disableFixSpace == false { layoutMargins = .zero let space = sx_defultFixSpace for view in subviews { if NSStringFromClass(view.classForCoder).contains("ContentView") { view.layoutMargins = UIEdgeInsets(top: 0, left: space, bottom: 0, right: space) } } } } } extension UINavigationItem { private enum BarButtonItem: String { case left = "_leftBarButtonItem" case right = "_rightBarButtonItem" } open override func setValue(_ value: Any?, forKey key: String) { if #available(iOS 11.0, *) { super.setValue(value, forKey: key) } else { if sx_disableFixSpace == false && (key == BarButtonItem.left.rawValue || key == BarButtonItem.right.rawValue) { guard let item = value as? UIBarButtonItem else { super.setValue(value, forKey: key) return } let space = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil) space.width = sx_defultFixSpace - 16 if key == BarButtonItem.left.rawValue { leftBarButtonItems = [space, item] } else { rightBarButtonItems = [space, item] } } else { super.setValue(value, forKey: key) } } } } extension DispatchQueue { static var `default`: DispatchQueue { return DispatchQueue.global(qos: .`default`) } static var userInteractive: DispatchQueue { return DispatchQueue.global(qos: .userInteractive) } static var userInitiated: DispatchQueue { return DispatchQueue.global(qos: .userInitiated) } static var utility: DispatchQueue { return DispatchQueue.global(qos: .utility) } static var background: DispatchQueue { return DispatchQueue.global(qos: .background) } func after(_ delay: TimeInterval, execute closure: @escaping () -> Void) { asyncAfter(deadline: .now() + delay, execute: closure) } private static var _onceTracker = [String]() public class func once(_ token: String, block:()->Void) { objc_sync_enter(self) defer { objc_sync_exit(self) } if _onceTracker.contains(token) { return } _onceTracker.append(token) block() } }
[ -1 ]
da87982b5868c5cc65764c0ab62ca67270648f96
e786286f3cb21954fa9efe3950e7ae40e8761f34
/ejerciciosIntroduccion/ejerciciosIntroduccion/AppDelegate.swift
811323fd12275ee2caf747c529d065a0c6238351
[]
no_license
viktorHbenitez/Ejercicio1MovilesIOS
46c754936f7342d919de50ea9121cb1f10f6eb7a
b9c8968ada6d18e84501224cfb8edbe16945fe90
refs/heads/master
2021-01-10T01:27:44.354367
2016-01-26T19:52:39
2016-01-26T19:52:39
50,446,846
0
0
null
null
null
null
UTF-8
Swift
false
false
2,147
swift
// // AppDelegate.swift // ejerciciosIntroduccion // // Created by Mac26 on 26/01/16. // Copyright © 2016 viktor. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 352284, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 229426, 237618, 229428, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 286797, 311375, 237646, 163920, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 278648, 131192, 237693, 327814, 131209, 417930, 303241, 311436, 303244, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 278760, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 278849, 319809, 319810, 319814, 311623, 319818, 311628, 229709, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 319978, 279020, 172526, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 287238, 172550, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 287390, 295583, 303773, 172702, 287394, 230045, 303780, 172705, 287398, 172707, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 279231, 287423, 328384, 287427, 312006, 107208, 107212, 172748, 287436, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 312035, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 222018, 295755, 377676, 148302, 287569, 279383, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 320391, 213895, 304007, 304009, 304011, 230284, 304013, 213902, 279438, 295822, 189329, 295825, 304019, 189331, 279445, 58262, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 304063, 238528, 304065, 189378, 213954, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 197645, 295949, 230413, 320528, 140312, 295961, 238620, 197663, 304164, 189479, 304170, 238641, 312374, 238652, 238655, 230465, 238658, 296004, 336964, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 279661, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 165038, 238766, 230576, 238770, 304311, 350308, 230592, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 279788, 320748, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 230718, 296259, 378181, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 181626, 304506, 304505, 181631, 312711, 312712, 296331, 288140, 230800, 288144, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 173488, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 280014, 312783, 288208, 230865, 288210, 370130, 288212, 280021, 288214, 222676, 239064, 288217, 288218, 280027, 288220, 329177, 239070, 288224, 288226, 370146, 280036, 288229, 280038, 288230, 288232, 280034, 288234, 320998, 288236, 288238, 288240, 291754, 288242, 296435, 288244, 288250, 402942, 148990, 296446, 206336, 296450, 321022, 230916, 230919, 214535, 370187, 304651, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 280264, 206536, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 419570, 321266, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 304968, 280393, 280402, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 280671, 223327, 149599, 321634, 149601, 149603, 329830, 280681, 313451, 223341, 280687, 313458, 280691, 215154, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 288936, 100520, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 280819, 157940, 125171, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 280835, 125187, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 354653, 313700, 280937, 313705, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 281084, 240124, 305662, 305664, 240129, 305666, 305668, 240132, 223749, 281095, 338440, 150025, 223752, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 199262, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 199367, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 207661, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 240519, 322440, 338823, 314249, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 281581, 183277, 322550, 134142, 322563, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 281923, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 298365, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 224657, 306581, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 282410, 241450, 306988, 306991, 315184, 323376, 315190, 241464, 282425, 159545, 298811, 307009, 413506, 241475, 307012, 148946, 315211, 282446, 307027, 315221, 282454, 315223, 241496, 323414, 241498, 307035, 307040, 282465, 110433, 241509, 110438, 298860, 110445, 282478, 282481, 110450, 315251, 315249, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 282514, 298898, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 217179, 315483, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 282931, 307508, 315701, 307510, 332086, 151864, 307512, 176435, 307515, 168245, 282942, 307518, 151874, 282947, 282957, 323917, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 283080, 176592, 315856, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 291299, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 127497, 233994, 135689, 291341, 233998, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 381677, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 283421, 234269, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 201603, 291714, 234373, 226182, 234375, 291716, 226185, 308105, 234379, 234384, 234388, 234390, 226200, 324504, 234393, 209818, 308123, 324508, 234398, 234396, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 234414, 324527, 291760, 234417, 201650, 324531, 226230, 234422, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 226245, 234437, 234439, 234434, 234443, 291788, 193486, 275406, 193488, 234446, 234449, 316370, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 275545, 242777, 234585, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 234607, 160879, 275569, 234610, 300148, 234614, 398455, 144506, 275579, 234618, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 275594, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 234648, 308379, 283805, 234653, 324766, 119967, 234657, 300189, 324768, 242852, 283813, 234661, 300197, 234664, 275626, 234667, 316596, 308414, 234687, 316610, 300226, 226500, 234692, 300229, 308420, 283844, 308418, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 283904, 300289, 292097, 300292, 300294, 275719, 300299, 177419, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 283963, 243003, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 284076, 144812, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 284099, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 259567, 300527, 308720, 226802, 316917, 308727, 292343, 300537, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194101, 284215, 194103, 284218, 226877, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 366155, 276043, 317004, 284238, 226895, 284241, 194130, 284243, 276052, 276053, 284245, 284247, 317015, 284249, 243290, 284251, 300628, 284253, 235097, 284255, 300638, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 276098, 284290, 325250, 284292, 292479, 292485, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 317158, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 284418, 358146, 317187, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 186139, 300828, 300830, 276255, 325408, 284449, 300834, 300832, 227109, 317221, 358183, 186151, 276268, 300845, 194351, 243504, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 276466, 227314, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 276539, 235579, 235581, 325692, 178238, 276544, 284739, 292934, 276553, 243785, 350293, 350295, 194649, 227418, 309337, 194654, 227423, 350302, 194657, 227426, 276579, 178273, 194660, 227430, 276583, 309346, 309348, 276586, 309350, 309352, 309354, 276590, 350313, 227440, 350316, 284786, 350321, 276595, 301167, 350325, 350328, 292985, 301178, 292989, 292993, 301185, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 227540, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 276713, 317674, 325867, 243948, 194801, 227571, 309491, 309494, 243960, 227583, 276735, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 211241, 325937, 276789, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 317833, 178572, 285070, 178575, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 277011, 317971, 309781, 309779, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 277106, 121458, 170618, 170619, 309885, 309888, 277122, 227975, 285320, 277128, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 318132, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277314, 277317, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 277368, 15224, 236408, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 244731, 121850, 302075, 293882, 293887, 277504, 277507, 277511, 277519, 293908, 277526, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 277608, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 253064, 302218, 285835, 294026, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 285862, 277671, 302248, 64682, 277678, 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, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 64966, 245191, 163272, 302534, 310727, 277959, 292968, 302541, 277963, 302543, 277966, 310737, 277971, 286169, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 286188, 310764, 278000, 228851, 310772, 278003, 278006, 212472, 40440, 278009, 40443, 286203, 228864, 40448, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187939, 294435, 40484, 286246, 294439, 286248, 278057, 294440, 294443, 40486, 294445, 40488, 310831, 40491, 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 ]
9da0c7b839aad8b0cb607082d3cd02a6bccff3c0
74e53e8fa45a79bdd94c4c1ce0ef8d562eb06a86
/Swift开发基础/Swift 新元素/3 Sequence.playground/Contents.swift
beb6a8cf5aa9aa3120ce6e359cd6685ef71f9d87
[]
no_license
RITL/Swifter
762f746acaeb7e075ef741ffc310d8385b8eebfc
28097eb02f6db8b0bc94f4272a43b662619e5712
refs/heads/master
2021-06-03T05:50:49.672101
2020-07-03T08:53:33
2020-07-03T08:53:33
140,785,943
1
0
null
null
null
null
UTF-8
Swift
false
false
409
swift
//: Playground - noun: a place where people can play import UIKit // Swift 的 for...in 可以用在所有实现了 Sequence 的类型上 // 首先实现 InteratorProtocol // 实现反向的 iterator 和 sequence //let index = 1 let arr = [0,1,2,3,4] //print("111") for i in ReverseSequence(array: arr) { print("Index \(i) is \(arr[i])") } let map = ReverseSequence(array: arr).map { $0 + 1 }
[ -1 ]
a8992bbb77d4f8f4cf18f6c9cf1ea3d6909a8412
0ddbe304586d7a6d14242fd825966a1ca9e487d3
/ParstagramTests/ParstagramTests.swift
132b1b5f922661fd59bb3c434566bad65e8fec42
[]
no_license
kellyvonborstel/Parstagram
12e15cea3e0015f919f407c9a48835a8c83bfccb
3f7b8c2ddac67b94636b1c479c51325b5c4c9467
refs/heads/master
2020-09-10T07:36:49.973709
2019-11-20T13:27:36
2019-11-20T13:27:36
221,686,916
0
0
null
null
null
null
UTF-8
Swift
false
false
935
swift
// // ParstagramTests.swift // ParstagramTests // // Created by Kelly von Borstel on 11/14/19. // Copyright © 2019 [email protected]. All rights reserved. // import XCTest @testable import Parstagram class ParstagramTests: 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. } } }
[ 354316, 317467, 241692, 145435, 239650, 16419, 223268, 329765, 292902, 354343, 315432, 315434, 325674, 223274, 321583, 176175, 243759, 282672, 241716, 319542, 243767, 124984, 241720, 352315, 288828, 325694, 288833, 288834, 315465, 311372, 311374, 354385, 196691, 329814, 338007, 354393, 200794, 356447, 254048, 309345, 280675, 329829, 321637, 319591, 280677, 315497, 315498, 43110, 131178, 319598, 288879, 333940, 204916, 223350, 131191, 233590, 288889, 280694, 131198, 333955, 319629, 235662, 311438, 325776, 323729, 317587, 333991, 333992, 333996, 239793, 180408, 227513, 295098, 258239, 280768, 301251, 227524, 309444, 338119, 346314, 321745, 334042, 280795, 194782, 356576, 338150, 346346, 321772, 385262, 125169, 327929, 356602, 12542, 194820, 313608, 321800, 278797, 125199, 338197, 334103, 325912, 315673, 237856, 125217, 227616, 278816, 305440, 211235, 151847, 282919, 338218, 325931, 321840, 332083, 127284, 332085, 336183, 332089, 282939, 287041, 139589, 182597, 280902, 323916, 319821, 348492, 282960, 325968, 366929, 289110, 215385, 272729, 168281, 332123, 334171, 354655, 106847, 323935, 332127, 321894, 242023, 160110, 246127, 313713, 250226, 242033, 246136, 139640, 246137, 106874, 291192, 315773, 211326, 313727, 291198, 362881, 248194, 332167, 242058, 311691, 227725, 108944, 291224, 317852, 121245, 39324, 285084, 242078, 141728, 246178, 315810, 315811, 381347, 289189, 108972, 311727, 299441, 334260, 283064, 319930, 311738, 336317, 293310, 291265, 342466, 291267, 278978, 127427, 254406, 324039, 127428, 283075, 311745, 129483, 317901, 6606, 278989, 281037, 281040, 334290, 278993, 289232, 242139, 369116, 256477, 285150, 279008, 160225, 195045, 279013, 127465, 311786, 330218, 279018, 319981, 109042, 319987, 279029, 254456, 233978, 324097, 301571, 342536, 348682, 279050, 279062, 254488, 289304, 279065, 322078, 291358, 207393, 375333, 377386, 293419, 244269, 197167, 234036, 338490, 348732, 242237, 352829, 115270, 322120, 55881, 377418, 340558, 244310, 332378, 354911, 436832, 242277, 244327, 344680, 295536, 287346, 313971, 301689, 244347, 279164, 291454, 311941, 344715, 330379, 311949, 334481, 316049, 330387, 346772, 111253, 316053, 352917, 330388, 295576, 111258, 318107, 363163, 344738, 279206, 295599, 342706, 299699, 299700, 164533, 289462, 109241, 248517, 363211, 154316, 242386, 334547, 279252, 289502, 299746, 295652, 338662, 330474, 299759, 418546, 322291, 312052, 312053, 199414, 344827, 221948, 279294, 299776, 295682, 191235, 336648, 264968, 291592, 322313, 322316, 326414, 312079, 322319, 295697, 291604, 207640, 291612, 336671, 293664, 281377, 326433, 279336, 295724, 353069, 152365, 312108, 285487, 301871, 318252, 353078, 230199, 355130, 293693, 342847, 295746, 355139, 252741, 353094, 353095, 318278, 355146, 201549, 355154, 281427, 353109, 244568, 230234, 322395, 355165, 109409, 351077, 342887, 326505, 355178, 177001, 201577, 242541, 400239, 246641, 330609, 174963, 109428, 207732, 310131, 209783, 246648, 361337, 269178, 359299, 240518, 109447, 113542, 416646, 316298, 349067, 228233, 236428, 426895, 56208, 355217, 308112, 326553, 209817, 289690, 318364, 127902, 310182, 256935, 240552, 353195, 140204, 236461, 293806, 347055, 252847, 316333, 326581, 316343, 289722, 230332, 353215, 330689, 279498, 330708, 248796, 248797, 340961, 64485, 314342, 52200, 123881, 203757, 340974, 383982, 289774, 314355, 287731, 316405, 277492, 349175, 240630, 312314, 320507, 314362, 328700, 330754, 357379, 328706, 293893, 134150, 330763, 320527, 324625, 238610, 308243, 330772, 418837, 322582, 316437, 320536, 197657, 281626, 201755, 175132, 326685, 252958, 336929, 300068, 345132, 322612, 359478, 324666, 324667, 238651, 302139, 336960, 21569, 214086, 361543, 250956, 341073, 296019, 339030, 353367, 156764, 281697, 314467, 230499, 250981, 253029, 228458, 207979, 318572, 281706, 316526, 15471, 312434, 353397, 300150, 300151, 337017, 363641, 285820, 300158, 150657, 302213, 349318, 228491, 228493, 177296, 326804, 324760, 119962, 285851, 339100, 283802, 296092, 300188, 343203, 300202, 253099, 306346, 3246, 228540, 230588, 228542, 343234, 259268, 353479, 353481, 353482, 283853, 333011, 189652, 189653, 148696, 357595, 333022, 359647, 304351, 304356, 290022, 330984, 222440, 328940, 234733, 279792, 353523, 298228, 128251, 216315, 208124, 292091, 228609, 320770, 322824, 242954, 328971, 292107, 353551, 251153, 177428, 349462, 245019, 320796, 126237, 115998, 333090, 208164, 109861, 369956, 130348, 279854, 298291, 171317, 318775, 312634, 116026, 286013, 333117, 216386, 300359, 312648, 294218, 296273, 331090, 120148, 314709, 314710, 357719, 134491, 316765, 222559, 163175, 333160, 306542, 296303, 243056, 312689, 327025, 314739, 116084, 314741, 249204, 249205, 181625, 111993, 290169, 314751, 318848, 224640, 306560, 294275, 298374, 388487, 368011, 304524, 296335, 112017, 112018, 9619, 234898, 224661, 318875, 314783, 310692, 245161, 241066, 316842, 314798, 286129, 279989, 210358, 228795, 292283, 280004, 306631, 300487, 284107, 302540, 310732, 312782, 64975, 310736, 327121, 366037, 210390, 210391, 210392, 310748, 286172, 144867, 103909, 316902, 245223, 361963, 54765, 191981, 282096, 321009, 251378, 329200, 191990, 280055, 300536, 290301, 286205, 300542, 230913, 292356, 329225, 253451, 253452, 359950, 323087, 323089, 316946, 398869, 374296, 282141, 349726, 187938, 245287, 245292, 347694, 230959, 312880, 288309, 290358, 312889, 194110, 425535, 288318, 349763, 56902, 282183, 288327, 292423, 243274, 333388, 224847, 228943, 333393, 118353, 280147, 290390, 128599, 235095, 196187, 44635, 333408, 157281, 286306, 345700, 323172, 374372, 120427, 312940, 204397, 138863, 224883, 333430, 247416, 325245, 175741, 337535, 339584, 294529, 224901, 312965, 323207, 282246, 229001, 290443, 188048, 282259, 302739, 345752, 229020, 255649, 257699, 245412, 323236, 40613, 40614, 40615, 298661, 61101, 321199, 364207, 224946, 337591, 370363, 280251, 224958, 323263, 323264, 327358, 282303, 321219, 333509, 319177, 9936, 245457, 241361, 9937, 302802, 241365, 181975, 229088, 298720, 325346, 321249, 333542, 153319, 345833, 12010, 280300, 294638, 360177, 325371, 194303, 194304, 319233, 323331, 216839, 284431, 243472, 321295, 323346, 161554, 321302, 116505, 255776, 339745, 241442, 313120, 341796, 241441, 247590, 315171, 333610, 284459, 294700, 200498, 259899, 319292, 315202, 307011, 325445, 282438, 153415, 339783, 280392, 159562, 325457, 337745, 413521, 317269, 18262, 241495, 362327, 284507, 300894, 245599, 237408, 302946, 345955, 276327, 325484, 296814, 282480, 292720, 325492, 317304, 241528, 194429, 124798, 325503, 55167, 315264, 188292, 327557, 247686, 241540, 67463, 243591, 315273, 325515, 315274, 243597, 325518, 329622, 337815, 294807, 118685, 311199, 319392, 253856, 292771, 354212, 300963, 313254, 294823, 292782, 317360, 294843, 188348, 214977, 280514, 174019, 321480, 214984, 284619, 344013, 212942, 231375, 212951, 360417, 294886, 313319, 337895, 174057, 317415, 327661, 296941, 362480, 278512, 311281, 223218, 311282, 333817, 292858 ]
e80e9cf7ab2b3f18812f3115b27ccf8f144081ac
6db3c5f5bd7cb5a6300a57a06b9a9ef7c92678d6
/PlatziTest/Modules/MovieDetail/MovieDetailViewController.swift
995b6023b7556e095b0eb3a0644af913eb651bc3
[]
no_license
JoseG95/PlatziTest
4f77d8d80b9a8cd7ed011378c0dddb84b6f4f2b7
dbc45d234f10b0cf4ebdc2d41493355d23e71a4d
refs/heads/main
2023-03-16T04:01:47.673567
2021-03-09T00:27:32
2021-03-09T00:27:32
344,980,490
0
0
null
null
null
null
UTF-8
Swift
false
false
8,475
swift
// // MovieDetailViewController.swift // PlatziTest // // Created by Jose Gutierrez on 08/03/21. // import UIKit final class MovieDetailViewController: UIViewController { private var viewModel: MovieDetailViewModelProtocol private let recommendationsCollectionView: UICollectionView = { let layout = UICollectionViewFlowLayout() layout.scrollDirection = .horizontal layout.minimumLineSpacing = 0 let collection = UICollectionView(frame: CGRect(), collectionViewLayout: layout) collection.register(RecommendedMovieViewCell.self, forCellWithReuseIdentifier: RecommendedMovieViewCell.identifier) collection.backgroundColor = .clear collection.showsHorizontalScrollIndicator = false collection.translatesAutoresizingMaskIntoConstraints = false return collection }() private let movieImage: UIImageView = { let image = UIImageView() image.contentMode = .scaleAspectFit image.layer.borderWidth = 2.0 image.layer.borderColor = Colors.border.cgColor image.translatesAutoresizingMaskIntoConstraints = false return image }() private let titleLabel: UILabel = { let label = UILabel() label.textAlignment = .left label.numberOfLines = 0 label.font = Fonts.captionOne label.textColor = Colors.primaryWhite label.translatesAutoresizingMaskIntoConstraints = false return label }() private let releaseDateLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.textAlignment = .center label.font = Fonts.captionTwo label.textColor = Colors.primaryWhite return label }() private let overviewTitleLabel: UILabel = { let label = UILabel() label.text = "Overview" label.font = Fonts.captionOne label.textColor = Colors.primaryWhite label.translatesAutoresizingMaskIntoConstraints = false return label }() private let overviewTextView: UITextView = { let textView = UITextView() textView.font = Fonts.bodyOne textView.textColor = Colors.primaryWhite textView.backgroundColor = .clear textView.isEditable = false textView.isScrollEnabled = true textView.showsVerticalScrollIndicator = false textView.showsHorizontalScrollIndicator = false textView.translatesAutoresizingMaskIntoConstraints = false return textView }() private let recommendedMoviesLabel: UILabel = { let label = UILabel() label.text = "Recommended movies" label.font = Fonts.captionOne label.textColor = Colors.primaryWhite label.translatesAutoresizingMaskIntoConstraints = false return label }() private let closeButton: UIButton = { let button = UIButton() button.setImage(UIImage(named: "cancel"), for: .normal) button.addTarget(self, action: #selector(closeVC(_:)), for: .touchUpInside) button.translatesAutoresizingMaskIntoConstraints = false return button }() override func viewDidLoad() { super.viewDidLoad() recommendationsCollectionView.dataSource = self recommendationsCollectionView.delegate = self view.backgroundColor = Colors.backgroundFaded viewModelDidLoad() } override func viewDidLayoutSubviews() { setupUI() } init(with cellViewModel: PopularMoviesCellViewModelProtocol) { viewModel = MovieDetailViewModel(cellViewModel) super.init(nibName: nil, bundle: nil) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } } extension MovieDetailViewController: UICollectionViewDataSource, UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { viewModel.numberOfCells } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: RecommendedMovieViewCell.identifier, for: indexPath) as? RecommendedMovieViewCell else { return UICollectionViewCell() } let cellViewModel = viewModel.getCellViewModel(at: indexPath) cell.configure(with: cellViewModel) return cell } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { return CGSize(width: 106, height: 160) } } private extension MovieDetailViewController { func viewModelDidLoad() { viewModel.onMoviesFetched = { [weak self] in guard let self = self else { return } DispatchQueue.main.async { self.recommendationsCollectionView.reloadData() } } viewModel.didLoad() } @objc private func closeVC(_: UIButton!) { self.dismiss(animated: true, completion: nil) } func setupUI() { movieImage.image = UIImage(data: viewModel.imageData) titleLabel.text = viewModel.title releaseDateLabel.text = viewModel.releaseDate overviewTextView.text = viewModel.overview addSubviews() setupConstraints() } func addSubviews() { view.addSubview(movieImage) view.addSubview(titleLabel) view.addSubview(releaseDateLabel) view.addSubview(overviewTitleLabel) view.addSubview(overviewTextView) view.addSubview(closeButton) view.addSubview(recommendationsCollectionView) view.addSubview(recommendedMoviesLabel) } func setupConstraints() { NSLayoutConstraint.activate([ recommendedMoviesLabel.topAnchor.constraint(equalTo: closeButton.bottomAnchor), recommendedMoviesLabel.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor), recommendationsCollectionView.topAnchor.constraint(equalTo: recommendedMoviesLabel.bottomAnchor, constant: 10), recommendationsCollectionView.widthAnchor.constraint(equalTo: view.widthAnchor), recommendationsCollectionView.heightAnchor.constraint(equalToConstant: 160), recommendationsCollectionView.centerXAnchor.constraint(equalTo: view.layoutMarginsGuide.centerXAnchor), movieImage.centerXAnchor.constraint(equalTo: view.layoutMarginsGuide.centerXAnchor), movieImage.topAnchor.constraint(equalTo: titleLabel.bottomAnchor, constant: 10), movieImage.heightAnchor.constraint(equalToConstant: 200), movieImage.widthAnchor.constraint(equalToConstant: 135), titleLabel.topAnchor.constraint(equalTo: recommendationsCollectionView.bottomAnchor, constant: 15), titleLabel.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor), titleLabel.trailingAnchor.constraint(equalTo: view.layoutMarginsGuide.trailingAnchor), releaseDateLabel.topAnchor.constraint(equalTo: movieImage.bottomAnchor, constant: 2), releaseDateLabel.widthAnchor.constraint(equalTo: view.widthAnchor), overviewTitleLabel.topAnchor.constraint(equalTo: releaseDateLabel.bottomAnchor, constant: 5), overviewTitleLabel.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor, constant: 15), overviewTextView.topAnchor.constraint(equalTo: overviewTitleLabel.bottomAnchor), overviewTextView.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor, constant: 12), overviewTextView.trailingAnchor.constraint(equalTo: view.layoutMarginsGuide.trailingAnchor, constant: -12), overviewTextView.bottomAnchor.constraint(equalTo: view.layoutMarginsGuide.bottomAnchor, constant: 10), closeButton.widthAnchor.constraint(equalToConstant: 22), closeButton.heightAnchor.constraint(equalToConstant: 22), closeButton.topAnchor.constraint(equalTo: view.layoutMarginsGuide.topAnchor, constant: 20), closeButton.trailingAnchor.constraint(equalTo: view.layoutMarginsGuide.trailingAnchor, constant: -20) ]) } }
[ -1 ]
7ee83cd6cb3effa21b7dc2153432d15bc2f95c9d
dff6d4ac0dd4d1e177eb2967234319cd06d3b4e5
/Client/R&D Inventory/Validator.swift
8b975af0791c607b7e78f1f34131964b43953f2b
[]
no_license
sandmman/R-D-Inventory
94c6c600778956fa4184525c70b67e21ae27d114
c9898a2950e330c05fa2561cda6bad13789b28d0
refs/heads/master
2021-01-13T12:18:57.540570
2017-02-08T19:13:19
2017-02-08T19:13:19
77,957,312
0
0
null
2017-02-08T19:13:19
2017-01-03T22:04:21
Swift
UTF-8
Swift
false
false
2,442
swift
// // Validator.swift // R&D Inventory // // Created by Aaron Liberatore on 1/2/17. // Copyright © 2017 Aaron Liberatore. All rights reserved. // import Foundation import Eureka public class Validator { public static func checkPartIDFormat(field: UITextField, string: String?, str: String?) -> Bool { if string == "" { return true } else if str!.characters.count == 4 { field.text = field.text! + "-" } else if str!.characters.count == 10 { field.text = field.text! + "-" } else if str!.characters.count > 12 { return false } return true } public static func onValidationChanged(cell: PartIDCell, row: PartIDRow) { let rowIndex = row.indexPath!.row while row.section!.count > rowIndex + 1 && row.section?[rowIndex + 1] is LabelRow { row.section?.remove(at: rowIndex + 1) } if !row.isValid { for (index, validationMsg) in row.validationErrors.map({ $0.msg }).enumerated() { let labelRow = LabelRow() { $0.title = validationMsg $0.cell.height = { 30 } } row.section?.insert(labelRow, at: row.indexPath!.row + index + 1) } } } public static func onValidationChanged(cell: TextCell, row: TextRow) { if !row.isValid { for (_, validationMsg) in row.validationErrors.map({ $0.msg }).enumerated() { row.placeholder = validationMsg row.placeholderColor = UIColor.red } } } public static func onValidationChanged(cell: IntCell, row: IntRow) { let rowIndex = row.indexPath!.row while row.section!.count > rowIndex + 1 && row.section?[rowIndex + 1] is LabelRow { row.section?.remove(at: rowIndex + 1) } if !row.isValid { for (index, validationMsg) in row.validationErrors.map({ $0.msg }).enumerated() { let labelRow = LabelRow() { $0.title = validationMsg $0.cell.height = { 30 } } row.section?.insert(labelRow, at: row.indexPath!.row + index + 1) } } } }
[ -1 ]
84fff3b9b352629f58f7d4c64068ab1515efe400
c047473bbc00d87066c098fcf7fb676989c29be6
/Sources/BadgeKit/badgekit.swift
5558c59ff898be79625b1e18c38f82386c44e1c4
[ "MIT" ]
permissive
phatblat/badger
af6bd7d2e863d62d3fd025c15f6252f21bf68db8
caff19c7f96049b7551a3c156c31f3049f894381
refs/heads/master
2022-11-07T04:16:53.318281
2022-10-25T15:27:16
2022-10-25T15:27:16
127,472,752
0
1
MIT
2022-10-25T15:27:18
2018-03-30T21:01:52
Kotlin
UTF-8
Swift
false
false
294
swift
import Foundation public final class CommandLineTool { let message = "Hello, World!" private let arguments: [String] public init(arguments: [String] = CommandLine.arguments) { self.arguments = arguments } public func run() throws { print(message) } }
[ -1 ]
afd4da0a6abfb4e814cda214c90ce78b83ee9dcf
6da87563c3f75e3a6b353443d1140c0f85bbe7d3
/DAM_IOS_AR_Planos/ViewController.swift
c8cadba3e4ddba280e906d6566eea91156e9534e
[]
no_license
raulrp3/DAM_IOS_AR_Planos
4a5b8a855778fa70b27e4fbdb3c5d8fbc08e4866
8eb1e4a956abdf6492184e32687cca0cdae51167
refs/heads/master
2021-01-05T20:41:16.552076
2020-02-17T15:44:54
2020-02-17T15:44:54
241,132,000
0
0
null
null
null
null
UTF-8
Swift
false
false
2,439
swift
// // ViewController.swift // DAM_IOS_AR_Planos // // Created by raul.ramirez on 17/02/2020. // Copyright © 2020 Raul Ramirez. All rights reserved. // import UIKit import ARKit class ViewController: UIViewController, ARSCNViewDelegate { @IBOutlet weak var mSceneview: ARSCNView! let configuration = ARWorldTrackingConfiguration() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. self.mSceneview.debugOptions = [.showWorldOrigin, .showFeaturePoints] self.configuration.planeDetection = .horizontal self.mSceneview.session.run(configuration) self.mSceneview.delegate = self } func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) { //Detecta el plano horizontal. guard let planeAnchor = anchor as? ARPlaneAnchor else { return } let lava = self.createLava(anchor: planeAnchor) node.addChildNode(lava) } func renderer(_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor) { //Actualiza el plano en caso de que ya haya sido detectado. guard let planeAnchor = anchor as? ARPlaneAnchor else { return } node.enumerateChildNodes{ (node, _) in node.removeFromParentNode() } let lava = self.createLava(anchor: planeAnchor) node.addChildNode(lava) } func renderer(_ renderer: SCNSceneRenderer, didRemove node: SCNNode, for anchor: ARAnchor) { //Eliminar planos. guard let _ = anchor as? ARPlaneAnchor else { return } node.enumerateChildNodes{ (node, _) in node.removeFromParentNode() } } func createLava(anchor: ARPlaneAnchor) -> SCNNode{ let node = SCNNode(geometry: SCNPlane(width: CGFloat(anchor.extent.x), height: CGFloat(anchor.extent.z))) //Como el plano será girado, la altura la mide el eje z. node.geometry?.firstMaterial?.diffuse.contents = UIImage(named: "lava") node.geometry?.firstMaterial?.isDoubleSided = true node.position = SCNVector3(anchor.center.x, anchor.center.y, anchor.center.z) node.eulerAngles = SCNVector3(90.degreesToRadians, 0, 0) return node } } extension Int{ var degreesToRadians: Double { return Double(self) * .pi/180 } }
[ -1 ]
a66dd6fcf5612e60fbf003ed7ea5e8d3ba2dea29
f90ff08039b479621d4c4bb3fcd6c33beac08926
/Tests/ComponentMetaTests.swift
98b359f1530d8d6037c225572ebf01dd417e8889
[ "MIT" ]
permissive
carabina/Matrioska
276723234650d328262d309ec289fd19ab2ec69d
312652a2e26fc21d66ea19a6d10b7eb621af72de
refs/heads/master
2021-01-12T08:30:37.164005
2016-12-15T19:39:48
2016-12-15T19:39:48
null
0
0
null
null
null
null
UTF-8
Swift
false
false
5,146
swift
// // ComponentMetaTests.swift // Matrioska // // Created by Alex Manzella on 17/11/16. // Copyright © 2016 runtastic. All rights reserved. // import XCTest import Quick import Nimble import Nimble_Snapshots import FBSnapshotTestCase import Matrioska class ComponentMetaTests: QuickSpec { override func spec() { describe("ComponentMeta") { context("when it doesn't provides a custom subscript") { it("should by default return the value of its properties") { let meta = DummyMeta(value: "foo") expect(meta["property1"] as? String) == "foo" expect(meta["property1"] is String).to(beTrue()) expect(meta["property2"] as? String) == "notMaterialized" expect(meta["property3"] as? String) == "notMaterialized" } it("should return nil for optional properties of ComponentMeta") { // Mirror might return a Optional<Optional<T>> let meta = DoubleOptionalRisk(title: nil) expect(meta["title"]).to(beNil()) } it("should return nil if the property is not found") { let meta = DummyMeta(value: "foo") expect(meta["foo"]).to(beNil()) } } context("when it provides a custom subscript") { it("should not use the default implementation") { let meta = AnyMeta() expect(meta["whateverIWant"] as? String) == "whateverIWant" } } context("when is Materializable") { it("shold not materialize the meta if it's already materialized") { let meta: ComponentMeta = DummyMeta(value: "test") expect(DummyMeta.materialize(meta)).to(be(meta)) } it("shold not materialize the meta if is nil") { let meta: ComponentMeta? = nil expect(DummyMeta.materialize(meta)).to(beNil()) } it("shold materialize the meta if the content is correct") { let metaRepresentation = ["property1": "foo"] let meta = DummyMeta.materialize(metaRepresentation) expect(meta?["property1"] as? String) == "foo" expect(meta?["property2"] as? String) == "materialized" expect(meta?["property3"] as? String) == "materialized" } } } describe("Dictioanry") { it("should get the values from the provided dictionary") { let meta = ["foo1": "bar1", "foo2": "bar2"] expect(meta["foo1"]) == "bar1" expect(meta["foo2"]) == "bar2" } it("should return always nil if the key is not the same type of the dictionary Key") { let meta: [Int: String] = [1: "bar1"] expect(meta["foo"]).to(beNil()) } } describe("ZipMeta") { it("should join multiple metas and allow you to retreive their content") { let meta1 = ["foo1": "bar1"] let meta2 = ["foo2": "bar2"] let meta3 = ["foo3": "bar3"] let zip = ZipMeta(meta1, meta2, meta3) expect(zip["foo1"] as? String) == "bar1" expect(zip["foo2"] as? String) == "bar2" expect(zip["foo3"] as? String) == "bar3" } it("should respect the order of the metas if the keys are overllapping") { let meta1 = ["foo": "bar1"] let meta2 = ["foo": "bar2"] let meta3 = ["foo": "bar3"] let zip = ZipMeta(meta1, meta2, meta3) expect(zip["foo"] as? String) == "bar1" } it("should return nil when key is not matched in any meta") { let meta1 = ["foo1": "bar1"] let meta2 = ["foo2": "bar2"] let zip = ZipMeta(meta1, meta2) expect(zip["foo"] as? String).to(beNil()) } } } } public class DummyMeta: MaterializableComponentMeta { public let property1: String? internal let property2: String fileprivate let property3: String public required init?(meta: ComponentMeta) { self.property1 = meta["property1"] as? String self.property2 = "materialized" self.property3 = "materialized" } public required init(value: String?) { self.property1 = value self.property2 = "notMaterialized" self.property3 = "notMaterialized" } } struct AnyMeta: ComponentMeta { subscript(key: String) -> Any? { return key } } struct DoubleOptionalRisk: ComponentMeta { let title: String? }
[ -1 ]
8e661fc3ff881d790afe5e0473625fc87ef9e675
8a60fd59428a6ae6ebbf4743c04bf97acb22f842
/Ruidai/MineOrderDetailTableHeaderView.swift
35790095f79cfd54da329ee3861b0d6da8a321f3
[]
no_license
WatermelonPrince/rdaikuan
0174fb6df71d88a079622c62d9771f55345b8c7a
708e6dd8a7ed962be175f0eda4fb6649e3fc54bc
refs/heads/master
2021-04-15T12:59:54.194521
2018-03-22T11:50:47
2018-03-22T11:50:47
126,327,629
0
0
null
null
null
null
UTF-8
Swift
false
false
9,095
swift
// // MineOrderDetailTableHeaderView.swift // Lottery // // Created by DTY on 2017/4/1. // Copyright © 2017年 caipiao. All rights reserved. // import UIKit class MineOrderDetailTableHeaderView: UIView { let kHeight: CGFloat = 20; var lotteryImageView: UIImageView!; var lotteryNameTermLabel: UILabel!; var orderAmountNumberLabel: UILabel!; var prizeAmountNumberLabel: UILabel!; var rightImageView: UIImageView!; override init(frame: CGRect) { super.init(frame: frame); self.backgroundColor = COLOR_WHITE; //图 self.lotteryImageView = UIImageView(frame: CGRect(x: 15, y: 15, width: 40, height: 40)); self.addSubview(self.lotteryImageView); //彩种名称期数 self.lotteryNameTermLabel = UILabel(frame: CGRect(x: self.lotteryImageView.frame.maxX + 10, y: self.lotteryImageView.frame.minY + 10, width: self.frame.width/2, height: kHeight)); self.lotteryNameTermLabel.textColor = COLOR_FONT_TEXT; self.addSubview(self.lotteryNameTermLabel); //订单金额数 self.orderAmountNumberLabel = UILabel(frame: CGRect(x: self.lotteryImageView.frame.minX, y: self.lotteryImageView.frame.maxY + 10, width: 120, height: 30)); self.orderAmountNumberLabel.textColor = COLOR_FONT_SECONDARY; self.addSubview(self.orderAmountNumberLabel); //订单金额 let orderAmountLabel = UILabel(frame: CGRect(x: self.lotteryImageView.frame.minX, y: self.orderAmountNumberLabel.frame.maxY, width: self.orderAmountNumberLabel.frame.width, height: kHeight)); orderAmountLabel.font = UIFont.systemFont(ofSize: 13); orderAmountLabel.textColor = COLOR_FONT_SECONDARY; self.addSubview(orderAmountLabel); orderAmountLabel.text = "订单金额"; //中奖金额数 self.prizeAmountNumberLabel = UILabel(frame: CGRect(x: orderAmountLabel.frame.maxX, y: self.orderAmountNumberLabel.frame.minY, width: SCREEN_WIDTH-self.orderAmountNumberLabel.frame.maxX, height: 30)); self.prizeAmountNumberLabel.font = UIFont.boldSystemFont(ofSize: 17); self.prizeAmountNumberLabel.textColor = COLOR_FONT_SECONDARY; self.addSubview(self.prizeAmountNumberLabel); self.prizeAmountNumberLabel.text = "--"; //中奖金额 let prizeAmountLabel = UILabel(frame: CGRect(x: self.orderAmountNumberLabel.frame.maxX, y: orderAmountLabel.frame.minY, width: self.prizeAmountNumberLabel.frame.width, height: kHeight)); prizeAmountLabel.font = UIFont.systemFont(ofSize: 13); prizeAmountLabel.textColor = COLOR_FONT_SECONDARY; self.addSubview(prizeAmountLabel); prizeAmountLabel.text = "中奖金额"; //右侧图片 let rightImageHeight = self.lotteryImageView.frame.height; let rightImageWidth = rightImageHeight * 282/183; self.rightImageView = UIImageView(frame: CGRect(x: self.frame.width-rightImageWidth, y: self.lotteryImageView.frame.minY, width: rightImageWidth, height: rightImageHeight)); self.addSubview(self.rightImageView); } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } func setData(orderDetail: OrderDetail) { //图 self.lotteryImageView.sd_setImage(with: CommonUtil.getURL(orderDetail.gameImageUrl)); //彩种名称期数 let nameAttString = NSMutableAttributedString(string: "\(orderDetail.gameName!) ", attributes: [NSFontAttributeName: UIFont.boldSystemFont(ofSize: 18)]); let termAttString = NSMutableAttributedString(string: "\(orderDetail.periodId!)期", attributes: [NSFontAttributeName: UIFont.systemFont(ofSize: 15)]); let lotteryNameTermAttString = NSMutableAttributedString(); lotteryNameTermAttString.append(nameAttString); lotteryNameTermAttString.append(termAttString); self.lotteryNameTermLabel.attributedText = lotteryNameTermAttString; //订单金额数 let orderAmountAttString = NSMutableAttributedString(string: "\(CommonUtil.formatDoubleString(double: orderDetail.orderAmount!))", attributes: [NSFontAttributeName: UIFont.boldSystemFont(ofSize: 17)]); let yuanAttString = NSMutableAttributedString(string: "元", attributes: [NSFontAttributeName: UIFont.systemFont(ofSize: 13)]); let orderAmountNumberAttString = NSMutableAttributedString(); orderAmountNumberAttString.append(orderAmountAttString); orderAmountNumberAttString.append(yuanAttString); self.orderAmountNumberLabel.attributedText = orderAmountNumberAttString; var isDraw: Bool; if (orderDetail.prizeStatus == nil || orderDetail.prizeStatus == 0) { isDraw = false; } else { isDraw = true; } var amount = orderDetail.bonus; if (amount == nil) { amount = 0.00 } //中奖金额数 if (isDraw == true && amount! > 0.00) { let prizeAmountAttString = NSMutableAttributedString(string: String(describing: amount!), attributes: [NSForegroundColorAttributeName: COLOR_BLUE, NSFontAttributeName: UIFont.boldSystemFont(ofSize: 24)]); let yuanAttString = NSMutableAttributedString(string: "元", attributes: [NSForegroundColorAttributeName: COLOR_BLUE, NSFontAttributeName: UIFont.systemFont(ofSize: K_FONT_SIZE*1.3)]); let prizeAmountNumberAttString = NSMutableAttributedString(); prizeAmountNumberAttString.append(prizeAmountAttString); prizeAmountNumberAttString.append(yuanAttString); self.prizeAmountNumberLabel.attributedText = prizeAmountNumberAttString; self.rightImageView.image = #imageLiteral(resourceName: "icon_right_prize"); } else if (isDraw == true && amount! == 0) { self.rightImageView.image = #imageLiteral(resourceName: "icon_right_noprize"); } else if (isDraw == false) { self.rightImageView.image = #imageLiteral(resourceName: "icon_right_wait"); } } func setData(followDetail: FollowDetail) { //图 self.lotteryImageView.sd_setImage(with: CommonUtil.getURL(followDetail.gameImageUrl)); //彩种名称期数 let nameAttString = NSMutableAttributedString(string: "\(followDetail.gameName!) ", attributes: [NSFontAttributeName: UIFont.boldSystemFont(ofSize: 18)]); let termAttString = NSMutableAttributedString(string: "追号共\((followDetail.followOrderVos?.count)!)期", attributes: [NSFontAttributeName: UIFont.systemFont(ofSize: 15)]); let lotteryNameTermAttString = NSMutableAttributedString(); lotteryNameTermAttString.append(nameAttString); lotteryNameTermAttString.append(termAttString); self.lotteryNameTermLabel.attributedText = lotteryNameTermAttString; //订单金额数 let orderAmountAttString = NSMutableAttributedString(string: "\(CommonUtil.formatDoubleString(double: followDetail.amount!))", attributes: [NSFontAttributeName: UIFont.boldSystemFont(ofSize: 17)]); let yuanAttString = NSMutableAttributedString(string: "元", attributes: [NSFontAttributeName: UIFont.systemFont(ofSize: 13)]); let orderAmountNumberAttString = NSMutableAttributedString(); orderAmountNumberAttString.append(orderAmountAttString); orderAmountNumberAttString.append(yuanAttString); self.orderAmountNumberLabel.attributedText = orderAmountNumberAttString; var isDraw: Bool; if (followDetail.prizeStatus == nil || followDetail.prizeStatus == 0) { isDraw = false; } else { isDraw = true; } var amount = followDetail.bonus; if (amount == nil) { amount = 0.00; } //中奖金额数 if (isDraw == true && amount! > 0.00) { let prizeAmountAttString = NSMutableAttributedString(string: String(describing: amount), attributes: [NSForegroundColorAttributeName: COLOR_BLUE, NSFontAttributeName: UIFont.boldSystemFont(ofSize: 24)]); let yuanAttString = NSMutableAttributedString(string: "元", attributes: [NSForegroundColorAttributeName: COLOR_BLUE, NSFontAttributeName: UIFont.systemFont(ofSize: K_FONT_SIZE*1.3)]); let prizeAmountNumberAttString = NSMutableAttributedString(); prizeAmountNumberAttString.append(prizeAmountAttString); prizeAmountNumberAttString.append(yuanAttString); self.prizeAmountNumberLabel.attributedText = prizeAmountNumberAttString; self.rightImageView.image = #imageLiteral(resourceName: "icon_right_prize"); } else if (isDraw == true && amount! == 0) { self.rightImageView.image = #imageLiteral(resourceName: "icon_right_noprize"); } else if (isDraw == false) { self.rightImageView.image = #imageLiteral(resourceName: "icon_right_wait"); } } }
[ -1 ]
0b36d24e1512600b310e47fd52c0829e30b3bb4a
4cc9819971be87f16f304e2a321e262c0693fcdc
/Frameworks/Account/ReaderAPI/ReaderAPIAccountDelegate.swift
4b895b0ed59507654bd4bcbe159a2ba4e5dd1e48
[ "MIT" ]
permissive
olofhellman/NetNewsWire
997c4671aaa46dc58ef2860d3113226a7a81e71a
3ed71efe41859c1f28781094fd1a6dca608d4acb
refs/heads/master
2022-05-30T14:18:34.124838
2019-10-02T02:32:42
2019-10-02T02:32:42
195,949,173
0
0
MIT
2019-07-31T04:29:49
2019-07-09T06:46:33
Swift
UTF-8
Swift
false
false
31,118
swift
// // ReaderAPIAccountDelegate.swift // Account // // Created by Jeremy Beker on 5/28/19. // Copyright © 2019 Ranchero Software, LLC. All rights reserved. // import Articles import RSCore import RSParser import RSWeb import SyncDatabase import os.log public enum ReaderAPIAccountDelegateError: String, Error { case invalidParameter = "There was an invalid parameter passed." case invalidResponse = "There was an invalid response from the server." } final class ReaderAPIAccountDelegate: AccountDelegate { private let database: SyncDatabase private let caller: ReaderAPICaller private var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "ReaderAPI") var behaviors: AccountBehaviors = [.disallowFeedInRootFolder, .disallowOPMLImports] var server: String? { get { return caller.server } } var isOPMLImportInProgress = false var credentials: Credentials? { didSet { caller.credentials = credentials } } weak var accountMetadata: AccountMetadata? { didSet { caller.accountMetadata = accountMetadata } } init(dataFolder: String, transport: Transport?) { let databaseFilePath = (dataFolder as NSString).appendingPathComponent("Sync.sqlite3") database = SyncDatabase(databaseFilePath: databaseFilePath) if transport != nil { caller = ReaderAPICaller(transport: transport!) } else { let sessionConfiguration = URLSessionConfiguration.default sessionConfiguration.requestCachePolicy = .reloadIgnoringLocalCacheData sessionConfiguration.timeoutIntervalForRequest = 60.0 sessionConfiguration.httpShouldSetCookies = false sessionConfiguration.httpCookieAcceptPolicy = .never sessionConfiguration.httpMaximumConnectionsPerHost = 1 sessionConfiguration.httpCookieStorage = nil sessionConfiguration.urlCache = nil if let userAgentHeaders = UserAgent.headers() { sessionConfiguration.httpAdditionalHeaders = userAgentHeaders } caller = ReaderAPICaller(transport: URLSession(configuration: sessionConfiguration)) } } var refreshProgress = DownloadProgress(numberOfTasks: 0) func refreshAll(for account: Account, completion: @escaping (Result<Void, Error>) -> Void) { refreshProgress.addToNumberOfTasksAndRemaining(6) refreshAccount(account) { result in switch result { case .success(): self.sendArticleStatus(for: account) { self.refreshArticleStatus(for: account) { self.refreshArticles(account) { self.refreshMissingArticles(account) { self.refreshProgress.clear() DispatchQueue.main.async { completion(.success(())) } } } } } case .failure(let error): DispatchQueue.main.async { self.refreshProgress.clear() let wrappedError = AccountError.wrappedError(error: error, account: account) completion(.failure(wrappedError)) } } } } func sendArticleStatus(for account: Account, completion: @escaping (() -> Void)) { os_log(.debug, log: log, "Sending article statuses...") let syncStatuses = database.selectForProcessing() let createUnreadStatuses = syncStatuses.filter { $0.key == ArticleStatus.Key.read && $0.flag == false } let deleteUnreadStatuses = syncStatuses.filter { $0.key == ArticleStatus.Key.read && $0.flag == true } let createStarredStatuses = syncStatuses.filter { $0.key == ArticleStatus.Key.starred && $0.flag == true } let deleteStarredStatuses = syncStatuses.filter { $0.key == ArticleStatus.Key.starred && $0.flag == false } let group = DispatchGroup() group.enter() sendArticleStatuses(createUnreadStatuses, apiCall: caller.createUnreadEntries) { group.leave() } group.enter() sendArticleStatuses(deleteUnreadStatuses, apiCall: caller.deleteUnreadEntries) { group.leave() } group.enter() sendArticleStatuses(createStarredStatuses, apiCall: caller.createStarredEntries) { group.leave() } group.enter() sendArticleStatuses(deleteStarredStatuses, apiCall: caller.deleteStarredEntries) { group.leave() } group.notify(queue: DispatchQueue.main) { os_log(.debug, log: self.log, "Done sending article statuses.") completion() } } func refreshArticleStatus(for account: Account, completion: @escaping (() -> Void)) { os_log(.debug, log: log, "Refreshing article statuses...") let group = DispatchGroup() group.enter() caller.retrieveUnreadEntries() { result in switch result { case .success(let articleIDs): self.syncArticleReadState(account: account, articleIDs: articleIDs) group.leave() case .failure(let error): os_log(.info, log: self.log, "Retrieving unread entries failed: %@.", error.localizedDescription) group.leave() } } group.enter() caller.retrieveStarredEntries() { result in switch result { case .success(let articleIDs): self.syncArticleStarredState(account: account, articleIDs: articleIDs) group.leave() case .failure(let error): os_log(.info, log: self.log, "Retrieving starred entries failed: %@.", error.localizedDescription) group.leave() } } group.notify(queue: DispatchQueue.main) { os_log(.debug, log: self.log, "Done refreshing article statuses.") completion() } } func importOPML(for account:Account, opmlFile: URL, completion: @escaping (Result<Void, Error>) -> Void) { } func addFolder(for account: Account, name: String, completion: @escaping (Result<Folder, Error>) -> Void) { if let folder = account.ensureFolder(with: name) { completion(.success(folder)) } else { completion(.failure(FeedbinAccountDelegateError.invalidParameter)) } } func renameFolder(for account: Account, with folder: Folder, to name: String, completion: @escaping (Result<Void, Error>) -> Void) { caller.renameTag(oldName: folder.name ?? "", newName: name) { result in switch result { case .success: DispatchQueue.main.async { folder.name = name completion(.success(())) } case .failure(let error): DispatchQueue.main.async { let wrappedError = AccountError.wrappedError(error: error, account: account) completion(.failure(wrappedError)) } } } } func removeFolder(for account: Account, with folder: Folder, completion: @escaping (Result<Void, Error>) -> Void) { let group = DispatchGroup() for feed in folder.topLevelFeeds { group.enter() removeFeed(for: account, with: feed, from: folder) { result in group.leave() switch result { case .success: break case .failure(let error): os_log(.error, log: self.log, "Remove feed error: %@.", error.localizedDescription) } } } group.notify(queue: DispatchQueue.main) { self.caller.deleteTag(name: folder.name!) { (result) in switch result { case .success: account.removeFolder(folder) completion(.success(())) case .failure(let error): os_log(.error, log: self.log, "Remove feed error: %@.", error.localizedDescription) } } } } func createFeed(for account: Account, url: String, name: String?, container: Container, completion: @escaping (Result<Feed, Error>) -> Void) { caller.createSubscription(url: url) { result in switch result { case .success(let subResult): switch subResult { case .created(let subscription): self.createFeed(account: account, subscription: subscription, name: name, container: container, completion: completion) case .alreadySubscribed: DispatchQueue.main.async { completion(.failure(AccountError.createErrorAlreadySubscribed)) } case .notFound: DispatchQueue.main.async { completion(.failure(AccountError.createErrorNotFound)) } } case .failure(let error): DispatchQueue.main.async { let wrappedError = AccountError.wrappedError(error: error, account: account) completion(.failure(wrappedError)) } } } } func renameFeed(for account: Account, with feed: Feed, to name: String, completion: @escaping (Result<Void, Error>) -> Void) { // This error should never happen guard let subscriptionID = feed.subscriptionID else { completion(.failure(FeedbinAccountDelegateError.invalidParameter)) return } caller.renameSubscription(subscriptionID: subscriptionID, newName: name) { result in switch result { case .success: DispatchQueue.main.async { feed.editedName = name completion(.success(())) } case .failure(let error): DispatchQueue.main.async { let wrappedError = AccountError.wrappedError(error: error, account: account) completion(.failure(wrappedError)) } } } } func removeFeed(for account: Account, with feed: Feed, from container: Container, completion: @escaping (Result<Void, Error>) -> Void) { if feed.folderRelationship?.count ?? 0 > 1 { deleteTagging(for: account, with: feed, from: container, completion: completion) } else { account.clearFeedMetadata(feed) deleteSubscription(for: account, with: feed, from: container, completion: completion) } } func moveFeed(for account: Account, with feed: Feed, from: Container, to: Container, completion: @escaping (Result<Void, Error>) -> Void) { if from is Account { addFeed(for: account, with: feed, to: to, completion: completion) } else { deleteTagging(for: account, with: feed, from: from) { result in switch result { case .success: self.addFeed(for: account, with: feed, to: to, completion: completion) case .failure(let error): completion(.failure(error)) } } } } func addFeed(for account: Account, with feed: Feed, to container: Container, completion: @escaping (Result<Void, Error>) -> Void) { if let folder = container as? Folder, let feedName = feed.subscriptionID { caller.createTagging(subscriptionID: feedName, tagName: folder.name ?? "") { result in switch result { case .success: DispatchQueue.main.async { self.saveFolderRelationship(for: feed, withFolderName: folder.name ?? "", id: feed.subscriptionID!) account.removeFeed(feed) folder.addFeed(feed) completion(.success(())) } case .failure(let error): DispatchQueue.main.async { let wrappedError = AccountError.wrappedError(error: error, account: account) completion(.failure(wrappedError)) } } } } else { DispatchQueue.main.async { if let account = container as? Account { account.addFeedIfNotInAnyFolder(feed) } completion(.success(())) } } } func restoreFeed(for account: Account, feed: Feed, container: Container, completion: @escaping (Result<Void, Error>) -> Void) { createFeed(for: account, url: feed.url, name: feed.editedName, container: container) { result in switch result { case .success: completion(.success(())) case .failure(let error): completion(.failure(error)) } } } func restoreFolder(for account: Account, folder: Folder, completion: @escaping (Result<Void, Error>) -> Void) { account.addFolder(folder) let group = DispatchGroup() for feed in folder.topLevelFeeds { group.enter() addFeed(for: account, with: feed, to: folder) { result in if account.topLevelFeeds.contains(feed) { account.removeFeed(feed) } group.leave() } } group.notify(queue: DispatchQueue.main) { completion(.success(())) } } func markArticles(for account: Account, articles: Set<Article>, statusKey: ArticleStatus.Key, flag: Bool) -> Set<Article>? { let syncStatuses = articles.map { article in return SyncStatus(articleID: article.articleID, key: statusKey, flag: flag) } database.insertStatuses(syncStatuses) if database.selectPendingCount() > 100 { sendArticleStatus(for: account) {} } return account.update(articles, statusKey: statusKey, flag: flag) } func accountDidInitialize(_ account: Account) { credentials = try? account.retrieveCredentials(type: .readerAPIKey) } static func validateCredentials(transport: Transport, credentials: Credentials, endpoint: URL?, completion: @escaping (Result<Credentials?, Error>) -> Void) { guard let endpoint = endpoint else { completion(.failure(TransportError.noURL)) return } let caller = ReaderAPICaller(transport: transport) caller.credentials = credentials caller.validateCredentials(endpoint: endpoint) { result in DispatchQueue.main.async { completion(result) } } } } // MARK: Private private extension ReaderAPIAccountDelegate { func refreshAccount(_ account: Account, completion: @escaping (Result<Void, Error>) -> Void) { caller.retrieveTags { result in switch result { case .success(let tags): BatchUpdate.shared.perform { self.syncFolders(account, tags) } self.refreshProgress.completeTask() self.refreshFeeds(account, completion: completion) case .failure(let error): completion(.failure(error)) } } } func syncFolders(_ account: Account, _ tags: [ReaderAPITag]?) { guard let tags = tags else { return } assert(Thread.isMainThread) os_log(.debug, log: log, "Syncing folders with %ld tags.", tags.count) let tagNames = tags.filter { $0.type == "folder" }.map { $0.tagID.replacingOccurrences(of: "user/-/label/", with: "") } // Delete any folders not at Reader if let folders = account.folders { folders.forEach { folder in if !tagNames.contains(folder.name ?? "") { for feed in folder.topLevelFeeds { account.addFeed(feed) clearFolderRelationship(for: feed, withFolderName: folder.name ?? "") } account.removeFolder(folder) } } } let folderNames: [String] = { if let folders = account.folders { return folders.map { $0.name ?? "" } } else { return [String]() } }() // Make any folders Reader has, but we don't tagNames.forEach { tagName in if !folderNames.contains(tagName) { _ = account.ensureFolder(with: tagName) } } } func refreshFeeds(_ account: Account, completion: @escaping (Result<Void, Error>) -> Void) { caller.retrieveSubscriptions { result in switch result { case .success(let subscriptions): self.refreshProgress.completeTask() BatchUpdate.shared.perform { self.syncFeeds(account, subscriptions) self.syncTaggings(account, subscriptions) } self.refreshProgress.completeTask() completion(.success(())) case .failure(let error): completion(.failure(error)) } } } func syncFeeds(_ account: Account, _ subscriptions: [ReaderAPISubscription]?) { guard let subscriptions = subscriptions else { return } assert(Thread.isMainThread) os_log(.debug, log: log, "Syncing feeds with %ld subscriptions.", subscriptions.count) let subFeedIds = subscriptions.map { String($0.feedID) } // Remove any feeds that are no longer in the subscriptions if let folders = account.folders { for folder in folders { for feed in folder.topLevelFeeds { if !subFeedIds.contains(feed.feedID) { folder.removeFeed(feed) } } } } for feed in account.topLevelFeeds { if !subFeedIds.contains(feed.feedID) { account.removeFeed(feed) } } // Add any feeds we don't have and update any we do subscriptions.forEach { subscription in let subFeedId = String(subscription.feedID) if let feed = account.existingFeed(withFeedID: subFeedId) { feed.name = subscription.name feed.homePageURL = subscription.homePageURL } else { let feed = account.createFeed(with: subscription.name, url: subscription.url, feedID: subFeedId, homePageURL: subscription.homePageURL) feed.iconURL = subscription.iconURL feed.subscriptionID = String(subscription.feedID) account.addFeed(feed) } } } func syncTaggings(_ account: Account, _ subscriptions: [ReaderAPISubscription]?) { guard let subscriptions = subscriptions else { return } assert(Thread.isMainThread) os_log(.debug, log: log, "Syncing taggings with %ld subscriptions.", subscriptions.count) // Set up some structures to make syncing easier let folderDict: [String: Folder] = { if let folders = account.folders { return Dictionary(uniqueKeysWithValues: folders.map { ($0.name ?? "", $0) } ) } else { return [String: Folder]() } }() let taggingsDict = subscriptions.reduce([String: [ReaderAPISubscription]]()) { (dict, subscription) in var taggedFeeds = dict // For each category that this feed belongs to, add the feed to that name in the dict subscription.categories.forEach({ (category) in let categoryName = category.categoryLabel.replacingOccurrences(of: "user/-/label/", with: "") if var taggedFeed = taggedFeeds[categoryName] { taggedFeed.append(subscription) taggedFeeds[categoryName] = taggedFeed } else { taggedFeeds[categoryName] = [subscription] } }) return taggedFeeds } // Sync the folders for (folderName, groupedTaggings) in taggingsDict { guard let folder = folderDict[folderName] else { return } let taggingFeedIDs = groupedTaggings.map { String($0.feedID) } // Move any feeds not in the folder to the account for feed in folder.topLevelFeeds { if !taggingFeedIDs.contains(feed.feedID) { folder.removeFeed(feed) clearFolderRelationship(for: feed, withFolderName: folder.name ?? "") account.addFeed(feed) } } // Add any feeds not in the folder let folderFeedIds = folder.topLevelFeeds.map { $0.feedID } for subscription in groupedTaggings { let taggingFeedID = String(subscription.feedID) if !folderFeedIds.contains(taggingFeedID) { guard let feed = account.existingFeed(withFeedID: taggingFeedID) else { continue } saveFolderRelationship(for: feed, withFolderName: folderName, id: String(subscription.feedID)) folder.addFeed(feed) } } } let taggedFeedIDs = Set(subscriptions.map { String($0.feedID) }) // Remove all feeds from the account container that have a tag for feed in account.topLevelFeeds { if taggedFeedIDs.contains(feed.feedID) { account.removeFeed(feed) } } } func sendArticleStatuses(_ statuses: [SyncStatus], apiCall: ([Int], @escaping (Result<Void, Error>) -> Void) -> Void, completion: @escaping (() -> Void)) { guard !statuses.isEmpty else { completion() return } let group = DispatchGroup() let articleIDs = statuses.compactMap { Int($0.articleID) } let articleIDGroups = articleIDs.chunked(into: 1000) for articleIDGroup in articleIDGroups { group.enter() apiCall(articleIDGroup) { result in switch result { case .success: self.database.deleteSelectedForProcessing(articleIDGroup.map { String($0) } ) group.leave() case .failure(let error): os_log(.error, log: self.log, "Article status sync call failed: %@.", error.localizedDescription) self.database.resetSelectedForProcessing(articleIDGroup.map { String($0) } ) group.leave() } } } group.notify(queue: DispatchQueue.main) { completion() } } func clearFolderRelationship(for feed: Feed, withFolderName folderName: String) { if var folderRelationship = feed.folderRelationship { folderRelationship[folderName] = nil feed.folderRelationship = folderRelationship } } func saveFolderRelationship(for feed: Feed, withFolderName folderName: String, id: String) { if var folderRelationship = feed.folderRelationship { folderRelationship[folderName] = id feed.folderRelationship = folderRelationship } else { feed.folderRelationship = [folderName: id] } } func decideBestFeedChoice(account: Account, url: String, name: String?, container: Container, choices: [ReaderAPISubscriptionChoice], completion: @escaping (Result<Feed, Error>) -> Void) { let feedSpecifiers: [FeedSpecifier] = choices.map { choice in let source = url == choice.url ? FeedSpecifier.Source.UserEntered : FeedSpecifier.Source.HTMLLink let specifier = FeedSpecifier(title: choice.name, urlString: choice.url, source: source) return specifier } if let bestSpecifier = FeedSpecifier.bestFeed(in: Set(feedSpecifiers)) { if let bestSubscription = choices.filter({ bestSpecifier.urlString == $0.url }).first { createFeed(for: account, url: bestSubscription.url, name: name, container: container, completion: completion) } else { DispatchQueue.main.async { completion(.failure(ReaderAPIAccountDelegateError.invalidParameter)) } } } else { DispatchQueue.main.async { completion(.failure(ReaderAPIAccountDelegateError.invalidParameter)) } } } func createFeed( account: Account, subscription sub: ReaderAPISubscription, name: String?, container: Container, completion: @escaping (Result<Feed, Error>) -> Void) { DispatchQueue.main.async { let feed = account.createFeed(with: sub.name, url: sub.url, feedID: String(sub.feedID), homePageURL: sub.homePageURL) feed.subscriptionID = String(sub.feedID) account.addFeed(feed, to: container) { result in switch result { case .success: if let name = name { account.renameFeed(feed, to: name) { result in switch result { case .success: self.initialFeedDownload(account: account, feed: feed, completion: completion) case .failure(let error): completion(.failure(error)) } } } else { self.initialFeedDownload(account: account, feed: feed, completion: completion) } case .failure(let error): completion(.failure(error)) } } } } func initialFeedDownload( account: Account, feed: Feed, completion: @escaping (Result<Feed, Error>) -> Void) { // Download the initial articles self.caller.retrieveEntries(feedID: feed.feedID) { result in switch result { case .success(let (entries, page)): self.processEntries(account: account, entries: entries) { self.refreshArticleStatus(for: account) { self.refreshArticles(account, page: page) { self.refreshMissingArticles(account) { DispatchQueue.main.async { completion(.success(feed)) } } } } } case .failure(let error): completion(.failure(error)) } } } func refreshArticles(_ account: Account, completion: @escaping (() -> Void)) { os_log(.debug, log: log, "Refreshing articles...") caller.retrieveEntries() { result in switch result { case .success(let (entries, page, lastPageNumber)): if let last = lastPageNumber { self.refreshProgress.addToNumberOfTasksAndRemaining(last - 1) } self.processEntries(account: account, entries: entries) { self.refreshProgress.completeTask() self.refreshArticles(account, page: page) { os_log(.debug, log: self.log, "Done refreshing articles.") completion() } } case .failure(let error): os_log(.error, log: self.log, "Refresh articles failed: %@.", error.localizedDescription) completion() } } } func refreshMissingArticles(_ account: Account, completion: @escaping (() -> Void)) { os_log(.debug, log: log, "Refreshing missing articles...") let group = DispatchGroup() let fetchedArticleIDs = account.fetchArticleIDsForStatusesWithoutArticles() let articleIDs = Array(fetchedArticleIDs) let chunkedArticleIDs = articleIDs.chunked(into: 100) for chunk in chunkedArticleIDs { group.enter() self.caller.retrieveEntries(articleIDs: chunk) { result in switch result { case .success(let entries): self.processEntries(account: account, entries: entries) { group.leave() } case .failure(let error): os_log(.error, log: self.log, "Refresh missing articles failed: %@.", error.localizedDescription) group.leave() } } } group.notify(queue: DispatchQueue.main) { self.refreshProgress.completeTask() os_log(.debug, log: self.log, "Done refreshing missing articles.") completion() } } func refreshArticles(_ account: Account, page: String?, completion: @escaping (() -> Void)) { guard let page = page else { completion() return } caller.retrieveEntries(page: page) { result in switch result { case .success(let (entries, nextPage)): self.processEntries(account: account, entries: entries) { self.refreshProgress.completeTask() self.refreshArticles(account, page: nextPage, completion: completion) } case .failure(let error): os_log(.error, log: self.log, "Refresh articles for additional pages failed: %@.", error.localizedDescription) completion() } } } func processEntries(account: Account, entries: [ReaderAPIEntry]?, completion: @escaping (() -> Void)) { let parsedItems = mapEntriesToParsedItems(account: account, entries: entries) let parsedMap = Dictionary(grouping: parsedItems, by: { item in item.feedURL } ) let group = DispatchGroup() for (feedID, mapItems) in parsedMap { group.enter() if let feed = account.existingFeed(withFeedID: feedID) { DispatchQueue.main.async { account.update(feed, parsedItems: Set(mapItems), defaultRead: true) { group.leave() } } } else { group.leave() } } group.notify(queue: DispatchQueue.main) { completion() } } func mapEntriesToParsedItems(account: Account, entries: [ReaderAPIEntry]?) -> Set<ParsedItem> { guard let entries = entries else { return Set<ParsedItem>() } let parsedItems: [ParsedItem] = entries.map { entry in // let authors = Set([ParsedAuthor(name: entry.authorName, url: entry.jsonFeed?.jsonFeedAuthor?.url, avatarURL: entry.jsonFeed?.jsonFeedAuthor?.avatarURL, emailAddress: nil)]) // let feed = account.idToFeedDictionary[entry.origin.streamId!]! // TODO clean this up return ParsedItem(syncServiceID: entry.uniqueID(), uniqueID: entry.uniqueID(), feedURL: entry.origin.streamId!, url: nil, externalURL: entry.alternates.first?.url, title: entry.title, contentHTML: entry.summary.content, contentText: nil, summary: entry.summary.content, imageURL: nil, bannerImageURL: nil, datePublished: entry.parseDatePublished(), dateModified: nil, authors: nil, tags: nil, attachments: nil) } return Set(parsedItems) } func syncArticleReadState(account: Account, articleIDs: [Int]?) { guard let articleIDs = articleIDs else { return } let feedbinUnreadArticleIDs = Set(articleIDs.map { String($0) } ) let currentUnreadArticleIDs = account.fetchUnreadArticleIDs() // Mark articles as unread let deltaUnreadArticleIDs = feedbinUnreadArticleIDs.subtracting(currentUnreadArticleIDs) let markUnreadArticles = account.fetchArticles(.articleIDs(deltaUnreadArticleIDs)) account.update(markUnreadArticles, statusKey: .read, flag: false) // Save any unread statuses for articles we haven't yet received let markUnreadArticleIDs = Set(markUnreadArticles.map { $0.articleID }) let missingUnreadArticleIDs = deltaUnreadArticleIDs.subtracting(markUnreadArticleIDs) account.ensureStatuses(missingUnreadArticleIDs, true, .read, false) // Mark articles as read let deltaReadArticleIDs = currentUnreadArticleIDs.subtracting(feedbinUnreadArticleIDs) let markReadArticles = account.fetchArticles(.articleIDs(deltaReadArticleIDs)) account.update(markReadArticles, statusKey: .read, flag: true) // Save any read statuses for articles we haven't yet received let markReadArticleIDs = Set(markReadArticles.map { $0.articleID }) let missingReadArticleIDs = deltaReadArticleIDs.subtracting(markReadArticleIDs) account.ensureStatuses(missingReadArticleIDs, true, .read, true) } func syncArticleStarredState(account: Account, articleIDs: [Int]?) { guard let articleIDs = articleIDs else { return } let feedbinStarredArticleIDs = Set(articleIDs.map { String($0) } ) let currentStarredArticleIDs = account.fetchStarredArticleIDs() // Mark articles as starred let deltaStarredArticleIDs = feedbinStarredArticleIDs.subtracting(currentStarredArticleIDs) let markStarredArticles = account.fetchArticles(.articleIDs(deltaStarredArticleIDs)) account.update(markStarredArticles, statusKey: .starred, flag: true) // Save any starred statuses for articles we haven't yet received let markStarredArticleIDs = Set(markStarredArticles.map { $0.articleID }) let missingStarredArticleIDs = deltaStarredArticleIDs.subtracting(markStarredArticleIDs) account.ensureStatuses(missingStarredArticleIDs, true, .starred, true) // Mark articles as unstarred let deltaUnstarredArticleIDs = currentStarredArticleIDs.subtracting(feedbinStarredArticleIDs) let markUnstarredArticles = account.fetchArticles(.articleIDs(deltaUnstarredArticleIDs)) account.update(markUnstarredArticles, statusKey: .starred, flag: false) // Save any unstarred statuses for articles we haven't yet received let markUnstarredArticleIDs = Set(markUnstarredArticles.map { $0.articleID }) let missingUnstarredArticleIDs = deltaUnstarredArticleIDs.subtracting(markUnstarredArticleIDs) account.ensureStatuses(missingUnstarredArticleIDs, true, .starred, false) } func deleteTagging(for account: Account, with feed: Feed, from container: Container?, completion: @escaping (Result<Void, Error>) -> Void) { if let folder = container as? Folder, let feedName = feed.subscriptionID { caller.deleteTagging(subscriptionID: feedName, tagName: folder.name ?? "") { result in switch result { case .success: DispatchQueue.main.async { self.clearFolderRelationship(for: feed, withFolderName: folder.name ?? "") folder.removeFeed(feed) account.addFeedIfNotInAnyFolder(feed) completion(.success(())) } case .failure(let error): DispatchQueue.main.async { let wrappedError = AccountError.wrappedError(error: error, account: account) completion(.failure(wrappedError)) } } } } else { if let account = container as? Account { account.removeFeed(feed) } completion(.success(())) } } func deleteSubscription(for account: Account, with feed: Feed, from container: Container?, completion: @escaping (Result<Void, Error>) -> Void) { // This error should never happen guard let subscriptionID = feed.subscriptionID else { completion(.failure(FeedbinAccountDelegateError.invalidParameter)) return } caller.deleteSubscription(subscriptionID: subscriptionID) { result in switch result { case .success: DispatchQueue.main.async { account.removeFeed(feed) if let folders = account.folders { for folder in folders { folder.removeFeed(feed) } } completion(.success(())) } case .failure(let error): DispatchQueue.main.async { let wrappedError = AccountError.wrappedError(error: error, account: account) completion(.failure(wrappedError)) } } } } }
[ -1 ]
84178bb80fa1bf6592e6357f58929073bf241449
4a7aa2776e5682c221b619be8930571b5497e5d4
/Source/BEBaseViewController.swift
ead18d819b441713197e132f08090912f1b249e9
[]
no_license
sahara108/BlogExample-AssociatedType
391388029fd45ed006986fcb8aff266a447e3e60
8886f667274482747f46a702f39d2296495bfaf0
refs/heads/master
2021-01-22T08:14:10.485644
2017-05-27T15:48:50
2017-05-27T15:48:50
92,608,304
0
0
null
null
null
null
UTF-8
Swift
false
false
1,458
swift
// // BEBaseViewController.swift // BlogExample-AssociatedType // // Created by Nguyen Tuan on 5/27/17. // Copyright © 2017 helo. All rights reserved. // import UIKit class BEBaseViewController<T : BECellDataSource>: UIViewController, UITableViewDataSource, UITableViewDelegate { var dataSource: [T] = [] var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. T.register(tableView: tableView) tableView.delegate = self tableView.dataSource = self tableView.separatorStyle = .none //clear empty cell tableView.tableFooterView = UIView() tableView.reloadData() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // MARK: - TableView func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return dataSource.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let content = dataSource[indexPath.row] let cell = tableView.dequeueReusableCell(withIdentifier: content.cellIdentifier())! if let signUpCell = cell as? BECellRender { signUpCell.renderCell(data: content) } return cell } }
[ -1 ]
3d2507eafd6e7e374487e060fbfe036616658f26
576733632dc3951634dba1aba4503bcfe5162f0b
/AmplifyTestCommon/Models/Deprecated/DeprecatedTodo.swift
09e424f73f5a01c9eaeef48c559e68dca50fbf4f
[ "Apache-2.0" ]
permissive
mschonvogel/amplify-ios
5f4eece792c24e875de8e555c9c5f82c9bff4130
6fb4841827b473111440e1184f2739072f89dcd6
refs/heads/main
2023-01-24T06:39:23.382316
2020-12-09T04:37:02
2020-12-09T04:37:02
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,643
swift
// // Copyright 2018-2020 Amazon.com, // Inc. or its affiliates. All Rights Reserved. // // SPDX-License-Identifier: Apache-2.0 // // swiftlint:disable all import Amplify import Foundation /* The schema used to codegen this model: type DeprecatedTodo @model { id: ID! description: String note: Note } type Note { name: String! color: String! } Amplify CLI version used is less than 4.21.4. `.customType` has since been replaced with `.embedded(type)` and `.embeddedCollection(of)`. Please use Amplify CLI 4.21.4 or newer to re-generate your Models to conform to Embeddable type. */ public struct DeprecatedTodo: Model { public let id: String public var description: String? public var note: Note? public init(id: String = UUID().uuidString, description: String? = nil, note: Note? = nil) { self.id = id self.description = description self.note = note } } extension DeprecatedTodo { // MARK: - CodingKeys public enum CodingKeys: String, ModelKey { case id case description case note } public static let keys = CodingKeys.self // MARK: - ModelSchema public static let schema = defineSchema { model in let deprecatedTodo = DeprecatedTodo.keys model.pluralName = "DeprecatedTodos" model.fields( .id(), .field(deprecatedTodo.description, is: .optional, ofType: .string), .field(deprecatedTodo.note, is: .optional, ofType: .customType(Note.self)) ) } } public struct Note: Codable { var name: String var color: String }
[ -1 ]
576cffb2ca518d60495788bd6711d22c1f444598
b5812faa536fa17c7234b00fb5ff7845d0eaef53
/MentorzSignUpAndLoginFlow/Views/CountryListButton.swift
27769c301e66fbaa6dce890a399ff6f1a524c08d
[]
no_license
isachinanand/MentorzSignupAndLogin
876584b13e47c2fdc61a6d8bc507ed7e5bbb70bb
15827602a16eefa5a1d1f6b18ff3c119390a3a00
refs/heads/master
2020-05-03T08:23:50.678100
2019-04-08T05:44:55
2019-04-08T05:44:55
178,525,203
0
1
null
null
null
null
UTF-8
Swift
false
false
428
swift
// // CountryListButton.swift // MentorzSignUpAndLoginFlow // // Created by Sachin Anand on 03/04/19. // Copyright © 2019 craterzone. All rights reserved. // import UIKit class CountryListButton: UIButton { override func awakeFromNib() { self.layer.backgroundColor = UIColor.white.cgColor self.tintColor = UIColor.black self.layer.cornerRadius = 5 self.layer.borderWidth = 0.5 } }
[ 213088 ]
699d4c2c8aaf30f05401a499a1c857d89f3590c8
19ce8a647c65debffc24f1089c97421c0de4b6fd
/Landmarks/CircleImage.swift
35bd7135a35f96dd82d7720e2c687fdb3a0ce7ce
[ "Apache-2.0" ]
permissive
oliveiraCode/Landmarks
862eb430be2dde2c3e3368e6bb90a82015a310c6
4e6ae3d4cecec90a97bc8bad966109abd7841bea
refs/heads/master
2020-08-05T18:46:39.249474
2019-10-03T19:30:09
2019-10-03T19:30:09
212,662,516
0
0
null
null
null
null
UTF-8
Swift
false
false
616
swift
// // CircleImage.swift // Landmarks // // Created by Leandro Fernandes De Oliveira on 2019-10-03. // Copyright © 2019 Leandro Oliveira. All rights reserved. // import SwiftUI struct CircleImage: View { var image: Image var body: some View { image .frame(width: 250, height: 250, alignment: .center) .clipShape(Circle()) .overlay(Circle().stroke(Color.white, lineWidth: 4)) .shadow(radius: 10) } } struct CircleImage_Previews: PreviewProvider { static var previews: some View { CircleImage(image: Image("imagex")) } }
[ -1 ]
cc1d1af83060adba5ccfdc7d406aeb569c4ad368
fefb021138677b862598e7e59a388b68698adebb
/Source/SwiftLintFramework/Rules/Style/VoidReturnRule.swift
c094995b1642189ef8350287c0de5c8e3c4993f2
[ "MIT" ]
permissive
rastersize/SwiftLint
995f072420ded0db74e4b5e072bd1cae6afefcc1
b9e6a9aed82720043aa6a515fb976b13d3b89049
refs/heads/main
2023-03-20T01:25:51.030245
2022-09-05T10:12:33
2022-09-05T10:12:33
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,357
swift
import Foundation import SourceKittenFramework public struct VoidReturnRule: ConfigurationProviderRule, SubstitutionCorrectableRule { public var configuration = SeverityConfiguration(.warning) public init() {} public static let description = RuleDescription( identifier: "void_return", name: "Void Return", description: "Prefer `-> Void` over `-> ()`.", kind: .style, nonTriggeringExamples: [ Example("let abc: () -> Void = {}\n"), Example("let abc: () -> (VoidVoid) = {}\n"), Example("func foo(completion: () -> Void)\n"), Example("let foo: (ConfigurationTests) -> () throws -> Void\n"), Example("let foo: (ConfigurationTests) -> () throws -> Void\n"), Example("let foo: (ConfigurationTests) ->() throws -> Void\n"), Example("let foo: (ConfigurationTests) -> () -> Void\n") ], triggeringExamples: [ Example("let abc: () -> ↓() = {}\n"), Example("let abc: () -> ↓(Void) = {}\n"), Example("let abc: () -> ↓( Void ) = {}\n"), Example("func foo(completion: () -> ↓())\n"), Example("func foo(completion: () -> ↓( ))\n"), Example("func foo(completion: () -> ↓(Void))\n"), Example("let foo: (ConfigurationTests) -> () throws -> ↓()\n") ], corrections: [ Example("let abc: () -> ↓() = {}\n"): Example("let abc: () -> Void = {}\n"), Example("let abc: () -> ↓(Void) = {}\n"): Example("let abc: () -> Void = {}\n"), Example("let abc: () -> ↓( Void ) = {}\n"): Example("let abc: () -> Void = {}\n"), Example("func foo(completion: () -> ↓())\n"): Example("func foo(completion: () -> Void)\n"), Example("func foo(completion: () -> ↓( ))\n"): Example("func foo(completion: () -> Void)\n"), Example("func foo(completion: () -> ↓(Void))\n"): Example("func foo(completion: () -> Void)\n"), Example("let foo: (ConfigurationTests) -> () throws -> ↓()\n"): Example("let foo: (ConfigurationTests) -> () throws -> Void\n") ] ) public func validate(file: SwiftLintFile) -> [StyleViolation] { return violationRanges(in: file).map { StyleViolation(ruleDescription: Self.description, severity: configuration.severity, location: Location(file: file, characterOffset: $0.location)) } } public func violationRanges(in file: SwiftLintFile) -> [NSRange] { let kinds = SyntaxKind.commentAndStringKinds let parensPattern = "\\(\\s*(?:Void)?\\s*\\)" let pattern = "->\\s*\(parensPattern)\\s*(?!->)" let excludingPattern = "(\(pattern))\\s*(throws\\s+)?->" return file.match(pattern: pattern, excludingSyntaxKinds: kinds, excludingPattern: excludingPattern, exclusionMapping: { $0.range(at: 1) }).compactMap { let parensRegex = regex(parensPattern) return parensRegex.firstMatch(in: file.contents, options: [], range: $0)?.range } } public func substitution(for violationRange: NSRange, in file: SwiftLintFile) -> (NSRange, String)? { return (violationRange, "Void") } }
[ 170113 ]
23200efed4220ef6678d9ec0015bb5a990c3730d
7a125455c9ce59efd1f53e03c99a1491519f6305
/MaterialDesignWidgets/MaterialDesignWidgets/Extensions.swift
c506f0a95143e0521b5b7118c3d05c16ca024894
[ "MIT" ]
permissive
mohsinalimat/material-design-widgets-lite-ios
4c38952658e7a2b57b7bed4905d37ba933fb8d9d
6faa4189d3cc73462c053fd4ec5fdf3ae3b86f7d
refs/heads/master
2022-09-06T01:38:42.528622
2020-04-29T04:11:51
2020-04-29T04:11:51
267,227,953
2
1
null
2020-05-27T05:20:49
2020-05-27T05:20:48
null
UTF-8
Swift
false
false
6,791
swift
// // Extensions.swift // MaterialDesignWidgets // // Created by Ho, Tsung Wei on 5/16/19. // Copyright © 2019 Michael Ho. All rights reserved. // public typealias BtnAction = (()->())? // MARK: - UIColor extension UIColor { /** Convert RGB value to CMYK value. - Parameters: - r: The red value of RGB. - g: The green value of RGB. - b: The blue value of RGB. Returns a 4-tuple that represents the CMYK value converted from input RGB. */ open func RGBtoCMYK(r: CGFloat, g: CGFloat, b: CGFloat) -> (c: CGFloat, m: CGFloat, y: CGFloat, k: CGFloat) { if r==0, g==0, b==0 { return (0, 0, 0, 1) } var c = 1 - r var m = 1 - g var y = 1 - b let minCMY = min(c, m, y) c = (c - minCMY) / (1 - minCMY) m = (m - minCMY) / (1 - minCMY) y = (y - minCMY) / (1 - minCMY) return (c, m, y, minCMY) } /** Convert CMYK value to RGB value. - Parameters: - c: The cyan value of CMYK. - m: The magenta value of CMYK. - y: The yellow value of CMYK. - k: The key/black value of CMYK. Returns a 3-tuple that represents the RGB value converted from input CMYK. */ open func CMYKtoRGB(c: CGFloat, m: CGFloat, y: CGFloat, k: CGFloat) -> (r: CGFloat, g: CGFloat, b: CGFloat) { let r = (1 - c) * (1 - k) let g = (1 - m) * (1 - k) let b = (1 - y) * (1 - k) return (r, g, b) } open func getColorTint() -> UIColor { let ciColor = CIColor(color: self) let originCMYK = RGBtoCMYK(r: ciColor.red, g: ciColor.green, b: ciColor.blue) let kVal = originCMYK.k > 0.3 ? originCMYK.k - 0.2 : originCMYK.k + 0.2 let tintRGB = CMYKtoRGB(c: originCMYK.c, m: originCMYK.m, y: originCMYK.y, k: kVal) return UIColor(red: tintRGB.r, green: tintRGB.g, blue: tintRGB.b, alpha: 1.0) } } // MARK: - UIButton extension UIButton { /** Set button image for all button states - Parameter image: The image to be set to the button. */ open func setImage(_ image: UIImage?) { for state : UIControl.State in [.normal, .highlighted, .disabled, .selected, .focused, .application, .reserved] { self.setImage(image, for: state) } } /** Set button title for all button states - Parameter text: The text to be set to the button title. */ open func setTitle(_ text: String?) { for state : UIControl.State in [.normal, .highlighted, .disabled, .selected, .focused, .application, .reserved] { self.setTitle(text, for: state) } } } // MARK: - UIImage extension UIImage { /** Create color rectangle as image. - Parameter color: The color to be created as an UIImage - Parameter size: The size of the UIImage, no need to be set when creating */ public convenience init?(color: UIColor, size: CGSize = CGSize(width: 1, height: 1)) { let rect = CGRect(origin: .zero, size: size) UIGraphicsBeginImageContextWithOptions(rect.size, true, 0.0) color.setFill() UIRectFill(rect) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() guard let cgImage = image?.cgImage else { return nil} self.init(cgImage: cgImage) } /** Change the color of the image. - Parameter color: The color to be set to the UIImage. Returns an UIImage with specified color */ public func colored(_ color: UIColor?) -> UIImage? { if let newColor = color { UIGraphicsBeginImageContextWithOptions(size, false, scale) let context = UIGraphicsGetCurrentContext()! context.translateBy(x: 0, y: size.height) context.scaleBy(x: 1.0, y: -1.0) context.setBlendMode(.normal) let rect = CGRect(x: 0, y: 0, width: size.width, height: size.height) context.clip(to: rect, mask: cgImage!) newColor.setFill() context.fill(rect) let newImage = UIGraphicsGetImageFromCurrentImageContext()! UIGraphicsEndImageContext() newImage.accessibilityIdentifier = accessibilityIdentifier return newImage } return self } } // MARK: UIView extension UIView { /** Set the corner radius of the view. - Parameter color: The color of the border. - Parameter cornerRadius: The radius of the rounded corner. - Parameter borderWidth: The width of the border. */ open func setCornerBorder(color: UIColor? = nil, cornerRadius: CGFloat = 15.0, borderWidth: CGFloat = 1.5) { self.layer.borderColor = color != nil ? color!.cgColor : UIColor.clear.cgColor self.layer.borderWidth = borderWidth self.layer.cornerRadius = cornerRadius self.clipsToBounds = true } /** Set the shadow layer of the view. - Parameter bounds: The bounds in CGRect of the shadow. - Parameter cornerRadius: The radius of the shadow path. - Parameter shadowRadius: The radius of the shadow. */ open func setAsShadow(bounds: CGRect, cornerRadius: CGFloat = 0.0, shadowRadius: CGFloat = 1) { self.backgroundColor = UIColor.clear self.layer.shadowColor = UIColor.lightGray.cgColor self.layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).cgPath self.layer.shadowOffset = CGSize(width: 2.0, height: 2.0) self.layer.shadowOpacity = 0.7 self.layer.shadowRadius = shadowRadius self.layer.masksToBounds = true self.clipsToBounds = false } /** Remove all subviews. */ public func removeSubviews() { self.subviews.forEach { $0.removeFromSuperview() } } } extension UIStackView { /** Convenient initializer. - Parameter arrangedSubviews: all arranged subviews to be put to the stack. - Parameter axis: The arranged axis of the stack view. - Parameter distribution: The distribution of the stack view. - Parameter spacing: The spacing between each view in the stack view. */ convenience init(arrangedSubviews: [UIView]? = nil, axis: NSLayoutConstraint.Axis, distribution: UIStackView.Distribution, spacing: CGFloat) { if let arrangedSubviews = arrangedSubviews { self.init(arrangedSubviews: arrangedSubviews) } else { self.init() } (self.axis, self.spacing, self.distribution) = (axis, spacing, distribution) } }
[ -1 ]
49b38e96ae51ac0617ac53fd10aa847ab2087e5d
9d48487efa8905208512b8cf58385c18d5393407
/UserListMVVMRxSwift/Protocols.swift
49ae20fd8b9f915351dd2050f8658ace4da1a2d0
[]
no_license
oasergei/UserListMVVMRxSwift
eed65ff0c402beb29106d3f0e35bc40f069a4156
3de559e2e117491d62aa88dcaf69b4aedff4a609
refs/heads/master
2022-12-06T00:00:13.424740
2020-08-14T09:32:21
2020-08-14T09:32:21
287,468,689
0
0
null
null
null
null
UTF-8
Swift
false
false
253
swift
// // Protocols.swift // UserListMVVMRxSwift // // Created by Sergey on 13.08.2020. // Copyright © 2020 Sergey. All rights reserved. // import Foundation import RxSwift protocol UserServiceProtocol { func fetchUsers() -> Observable<[User]> }
[ -1 ]
57a3123a2c91af31ba838990702d18d05f5baa39
8a6cac40a5dc106d496e9c6457893557017a4a98
/OrchardClient/Models-and-Networking-Layers/LogInNetworkingCode.swift
f180b69b621e15c4b83fa1a20327e0bda6e759f1
[]
no_license
matthewharrilal/Orchard
6b199afc509594a1261de0424a3ca34ceb6e9c91
51e6c0a9bc300a8d7e47632defbe9c7114b24811
refs/heads/master
2021-08-28T19:33:52.494151
2017-12-13T02:40:17
2017-12-13T02:40:17
107,761,788
0
0
null
null
null
null
UTF-8
Swift
false
false
1,815
swift
// // NetworkingLayer.swift // OrchardClient // // Created by Matthew Harrilal on 10/21/17. // Copyright © 2017 Matthew Harrilal. All rights reserved. // import Foundation import UIKit enum Route { // This will be the enum to account for the possible routes the user can take to log in case users() func path() -> String { switch self { case .users: return "/orchard_users" } } func createUser(user: User? = nil) -> Data { switch self { case .users(): var jsonBody = Data() do { jsonBody = try JSONEncoder().encode(user) } catch{ } return jsonBody } } } enum HttpsMethods: String { case get = "GET" case post = "POST" } class LogInNetworkingLayer { let session = URLSession.shared func network(route: Route, user: User? = nil, requestRoute: HttpsMethods, completionHandler: @escaping (Data, Int) -> Void) { let baseURL = "http://127.0.0.1:5000" let fullUrl = URL(string: baseURL.appending(route.path())) var request = URLRequest(url: fullUrl!) request.addValue("application/json", forHTTPHeaderField: "Content-Type") request.addValue((user?.credential)!, forHTTPHeaderField: "Authorization") if user != nil { request.httpBody = route.createUser(user: user) } request.httpMethod = requestRoute.rawValue session.dataTask(with: request) { (data, response, error) in print(error?.localizedDescription) let statusCode: Int = (response as! HTTPURLResponse).statusCode if let data = data { print(statusCode) completionHandler(data, statusCode) } }.resume() } }
[ -1 ]
edb5bd2c8d21bf9b6058d89837d78ce2721b39eb
c7ebcc988ef9be753e733876f489df28a0b16d90
/DungeonsDragonsCCTests/Models/Mapping/CoreRulebookFEMMappingTests.swift
661d01c052ea8fe70cac0c0c89239e53e3f459c1
[ "MIT" ]
permissive
achappell/dungeonsanddragonscharactersheet
1261f997b5b42a8b75ff7b79c9b33fc55ef5df8f
e6e2f8af23efec32c43c2e9bbd0dc2ed715f3cb4
refs/heads/develop
2020-04-06T07:02:26.890046
2016-10-16T04:42:29
2016-10-16T04:42:29
54,393,246
0
0
null
2016-09-02T23:39:05
2016-03-21T13:57:48
Swift
UTF-8
Swift
false
false
1,204
swift
// // CoreRulebook+FEMMappingTests.swift // DungeonsDragonsCC // // Created by Amanda Chappell on 3/4/16. // Copyright © 2016 AmplifiedProjects. All rights reserved. // import XCTest @testable import DungeonsDragonsCC class CoreRulebookFEMMappingTests: 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 testFEMMapping() { CoreRulebook.mr_truncateAll() Race.mr_truncateAll() let bundle = Bundle(for: CoreRulebookFEMMappingTests.self) let path = bundle.path(forResource: "testcorerulebook", ofType: "json") let data = try? Data(contentsOf: URL(fileURLWithPath: path!)) let deserializer = JSONDeserializer() let coreRulebook = deserializer.objectFromData(data!, classType: CoreRulebook.self)! as CoreRulebook XCTAssertEqual(coreRulebook.races.count, 1) XCTAssertEqual(coreRulebook.skills.count, 1) } }
[ -1 ]
eda343f4edc0a43e1e8b9742be5c9bf5c1a879af
57c373da0456087a8c8b1e510dc6969d18ffb4bc
/Today/TodayViewController.swift
ebe28588fd833e763c7e3d584815d9ae7bb554bd
[]
no_license
muzicaed/sl-smart
dc6f698de4964d1911b75e44b4e71692b91734f8
5155420223bb3ea0410e8d4786214e4a7e0acaf1
refs/heads/master
2021-09-25T07:43:06.700832
2018-10-19T14:33:05
2018-10-19T14:33:05
46,788,545
0
0
null
null
null
null
UTF-8
Swift
false
false
5,178
swift
// // TodayViewController.swift // Today // // Created by Mikael Hellman on 2016-01-08. // Copyright © 2016 Mikael Hellman. All rights reserved. // import UIKit import NotificationCenter import ResStockholmApiKit class TodayViewController: UIViewController, NCWidgetProviding { @IBOutlet weak var titleLabel: UILabel! @IBOutlet weak var departureTimeLabel: UILabel! @IBOutlet weak var departureStationLabel: UILabel! @IBOutlet weak var arrivalTimeLabel: UILabel! @IBOutlet weak var arrivalStationLabel: UILabel! @IBOutlet weak var inAboutLabel: UILabel! @IBOutlet weak var nextLabel: UILabel! var bestRoutine: RoutineTrip? var refreshTimmer: Timer? /** * View loaded for the first time. */ override func viewDidLoad() { super.viewDidLoad() MyLocationHelper.sharedInstance.requestLocationUpdate(nil) if #available(iOSApplicationExtension 10.0, *) { self.extensionContext?.widgetLargestAvailableDisplayMode = .compact } else { self.preferredContentSize = CGSize(width: 320, height: 160) } let gesture = UITapGestureRecognizer(target: self, action: #selector(onTap)) view.addGestureRecognizer(gesture) loadTripData() {} } /** * View did disappear */ override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) stopRefreshTimmer() } /** * View did appear */ override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) startRefreshTimmer() updateUI() } /** * Update data request. * OS Controlled. */ func widgetPerformUpdate(completionHandler: (@escaping (NCUpdateResult) -> Void)) { loadTripData(){ self.updateUI() completionHandler(.newData) } } /** * User tap widget */ @objc func onTap() { extensionContext?.open(URL(string: "ressmart://")!, completionHandler: nil) } /** * Starts the refresh timmer */ func startRefreshTimmer() { stopRefreshTimmer() refreshTimmer = Timer.scheduledTimer( timeInterval: 10.0, target: self, selector: #selector(updateUI), userInfo: nil, repeats: true) RunLoop.main.add(refreshTimmer!, forMode: RunLoop.Mode.common) } /** * Stop the refresh timmer */ func stopRefreshTimmer() { refreshTimmer?.invalidate() refreshTimmer = nil } // MARK: Private /** * Loads trip data and updates UI */ func loadTripData(callback: @escaping () -> ()) { RoutineService.findRoutineTrip({ routineTrips in self.bestRoutine = routineTrips.first DispatchQueue.main.async { if self.bestRoutine != nil { callback() } else { self.titleLabel.text = "Could not find any routines.".localized } } return }) } /** * Update widget UI */ @objc func updateUI() { if let bestRoutineTrip = self.bestRoutine { if let trip = bestRoutineTrip.trips.first { self.titleLabel.text = bestRoutineTrip.title if let first = trip.tripSegments.first, let last = trip.tripSegments.last { self.departureStationLabel.text = first.origin.name self.arrivalStationLabel.text = last.destination.name self.departureTimeLabel.text = DateUtils.dateAsTimeNoSecString(first.departureDateTime) self.arrivalTimeLabel.text = DateUtils.dateAsTimeNoSecString(last.arrivalDateTime) self.inAboutLabel.text = DateUtils.createAboutTimeText(segments: trip.tripSegments) } var second: Trip? = nil if bestRoutineTrip.trips.count > 1 { second = bestRoutineTrip.trips[1] } if let second = second?.tripSegments.first, let first = trip.tripSegments.first { let depTimeInterval = first.departureDateTime.timeIntervalSinceNow if depTimeInterval < (60 * 11) { let diffMin = Int(ceil(((second.departureDateTime.timeIntervalSince1970 - Date().timeIntervalSince1970) / 60)) + 0.5) if diffMin <= 60 { nextLabel.text = String(format: NSLocalizedString("Next: %d min", comment: ""), diffMin) nextLabel.isHidden = false } } } } } } /** * Set custom insets */ func widgetMarginInsets(forProposedMarginInsets defaultMarginInsets: UIEdgeInsets) -> UIEdgeInsets { var newDefaultMarginInsets = defaultMarginInsets newDefaultMarginInsets.top = 10 newDefaultMarginInsets.bottom = 10 return newDefaultMarginInsets } }
[ -1 ]
6c1dd015da9682afb9134febd0e0aa66f7b17af6
e8b92b853b4258cd38f6d933c966d90dd15ed882
/CoreImageKit/CoreImage+CICategoryGenerator.swift
f6c7ac503498eb14804d52f2558c81be55b0cd6a
[ "MIT" ]
permissive
huangxinping/CoreImageKit
5820cc75b11d44df375bb910ca38c0f0bcd4fe68
f9b1b4e5d7a6ef4deb7a6c424056caa6f7112423
refs/heads/master
2021-01-19T07:24:55.378594
2016-12-16T07:19:15
2016-12-16T07:19:15
60,956,478
4
0
null
null
null
null
UTF-8
Swift
false
false
11,302
swift
import CoreImage import CoreGraphics public extension CIImage { func aztecCodeGenerator(closure: ((inout message: NSData, inout correctionLevel: NSNumber, inout layers: NSNumber, inout compactStyle: NSNumber) -> Void)?) -> CIImage? { let filter = CIFilter(name: "CIAztecCodeGenerator") // print(filter?.attributes) filter?.setDefaults() if closure != nil { var _message: NSData = NSData() var _correctionLevel: NSNumber = 0 var _layers: NSNumber = 0 var _compactStyle: NSNumber = 0 closure!(message: &_message, correctionLevel: &_correctionLevel, layers: &_layers, compactStyle: &_compactStyle) filter?.setValue(_message, forKey: "inputMessage") filter?.setValue(_correctionLevel, forKey: "inputCorrectionLevel") filter?.setValue(_layers, forKey: "inputLayers") filter?.setValue(_compactStyle, forKey: "inputCompactStyle") } filter?.setValue(self, forKey: kCIInputImageKey) return filter?.outputImage } func checkerboardGenerator(closure: ((inout center: CIVector, inout color0: CIColor, inout color1: CIColor, inout width: NSNumber, inout sharpness: NSNumber) -> Void)?) -> CIImage? { let filter = CIFilter(name: "CICheckerboardGenerator") // print(filter?.attributes) filter?.setDefaults() if closure != nil { var _center: CIVector = CIVector() var _color0: CIColor = CIColor(red: 0, green: 0, blue: 0) var _color1: CIColor = CIColor(red: 0, green: 0, blue: 0) var _width: NSNumber = 0 var _sharpness: NSNumber = 0 closure!(center: &_center, color0: &_color0, color1: &_color1, width: &_width, sharpness: &_sharpness) filter?.setValue(_center, forKey: "inputCenter") filter?.setValue(_color0, forKey: "inputColor0") filter?.setValue(_color1, forKey: "inputColor1") filter?.setValue(_width, forKey: "inputWidth") filter?.setValue(_sharpness, forKey: "inputSharpness") } filter?.setValue(self, forKey: kCIInputImageKey) return filter?.outputImage } func code128BarcodeGenerator(closure: ((inout message: NSData, inout quietSpace: NSNumber) -> Void)?) -> CIImage? { let filter = CIFilter(name: "CICode128BarcodeGenerator") // print(filter?.attributes) filter?.setDefaults() if closure != nil { var _message: NSData = NSData() var _quietSpace: NSNumber = 0 closure!(message: &_message, quietSpace: &_quietSpace) filter?.setValue(_message, forKey: "inputMessage") filter?.setValue(_quietSpace, forKey: "inputQuietSpace") } filter?.setValue(self, forKey: kCIInputImageKey) return filter?.outputImage } func constantColorGenerator(closure: ((inout color: CIColor) -> Void)?) -> CIImage? { let filter = CIFilter(name: "CIConstantColorGenerator") // print(filter?.attributes) filter?.setDefaults() if closure != nil { var _color: CIColor = CIColor(red: 0, green: 0, blue: 0) closure!(color: &_color) filter?.setValue(_color, forKey: "inputColor") } filter?.setValue(self, forKey: kCIInputImageKey) return filter?.outputImage } func lenticularHaloGenerator(closure: ((inout center: CIVector, inout color: CIColor, inout haloRadius: NSNumber, inout haloWidth: NSNumber, inout haloOverlap: NSNumber, inout striationStrength: NSNumber, inout striationContrast: NSNumber, inout time: NSNumber) -> Void)?) -> CIImage? { let filter = CIFilter(name: "CILenticularHaloGenerator") // print(filter?.attributes) filter?.setDefaults() if closure != nil { var _center: CIVector = CIVector() var _color: CIColor = CIColor(red: 0, green: 0, blue: 0) var _haloRadius: NSNumber = 0 var _haloWidth: NSNumber = 0 var _haloOverlap: NSNumber = 0 var _striationStrength: NSNumber = 0 var _striationContrast: NSNumber = 0 var _time: NSNumber = 0 closure!(center: &_center, color: &_color, haloRadius: &_haloRadius, haloWidth: &_haloWidth, haloOverlap: &_haloOverlap, striationStrength: &_striationStrength, striationContrast: &_striationContrast, time: &_time) filter?.setValue(_center, forKey: "inputCenter") filter?.setValue(_color, forKey: "inputColor") filter?.setValue(_haloRadius, forKey: "inputHaloRadius") filter?.setValue(_haloWidth, forKey: "inputHaloWidth") filter?.setValue(_haloOverlap, forKey: "inputHaloOverlap") filter?.setValue(_striationStrength, forKey: "inputStriationStrength") filter?.setValue(_striationContrast, forKey: "inputStriationContrast") filter?.setValue(_time, forKey: "inputTime") } filter?.setValue(self, forKey: kCIInputImageKey) return filter?.outputImage } func pDF417BarcodeGenerator(closure: ((inout message: NSData, inout minWidth: NSNumber, inout maxWidth: NSNumber, inout minHeight: NSNumber, inout maxHeight: NSNumber, inout dataColumns: NSNumber, inout rows: NSNumber, inout preferredAspectRatio: NSNumber, inout compactionMode: NSNumber, inout compactStyle: NSNumber, inout correctionLevel: NSNumber, inout alwaysSpecifyCompaction: NSNumber) -> Void)?) -> CIImage? { let filter = CIFilter(name: "CIPDF417BarcodeGenerator") // print(filter?.attributes) filter?.setDefaults() if closure != nil { var _message: NSData = NSData() var _minWidth: NSNumber = 0 var _maxWidth: NSNumber = 0 var _minHeight: NSNumber = 0 var _maxHeight: NSNumber = 0 var _dataColumns: NSNumber = 0 var _rows: NSNumber = 0 var _preferredAspectRatio: NSNumber = 0 var _compactionMode: NSNumber = 0 var _compactStyle: NSNumber = 0 var _correctionLevel: NSNumber = 0 var _alwaysSpecifyCompaction: NSNumber = 0 closure!(message: &_message, minWidth: &_minWidth, maxWidth: &_maxWidth, minHeight: &_minHeight, maxHeight: &_maxHeight, dataColumns: &_dataColumns, rows: &_rows, preferredAspectRatio: &_preferredAspectRatio, compactionMode: &_compactionMode, compactStyle: &_compactStyle, correctionLevel: &_correctionLevel, alwaysSpecifyCompaction: &_alwaysSpecifyCompaction) filter?.setValue(_message, forKey: "inputMessage") filter?.setValue(_minWidth, forKey: "inputMinWidth") filter?.setValue(_maxWidth, forKey: "inputMaxWidth") filter?.setValue(_minHeight, forKey: "inputMinHeight") filter?.setValue(_maxHeight, forKey: "inputMaxHeight") filter?.setValue(_dataColumns, forKey: "inputDataColumns") filter?.setValue(_rows, forKey: "inputRows") filter?.setValue(_preferredAspectRatio, forKey: "inputPreferredAspectRatio") filter?.setValue(_compactionMode, forKey: "inputCompactionMode") filter?.setValue(_compactStyle, forKey: "inputCompactStyle") filter?.setValue(_correctionLevel, forKey: "inputCorrectionLevel") filter?.setValue(_alwaysSpecifyCompaction, forKey: "inputAlwaysSpecifyCompaction") } filter?.setValue(self, forKey: kCIInputImageKey) return filter?.outputImage } func qRCodeGenerator(closure: ((inout message: NSData, inout correctionLevel: NSString) -> Void)?) -> CIImage? { let filter = CIFilter(name: "CIQRCodeGenerator") // print(filter?.attributes) filter?.setDefaults() if closure != nil { var _message: NSData = NSData() var _correctionLevel: NSString = "" closure!(message: &_message, correctionLevel: &_correctionLevel) filter?.setValue(_message, forKey: "inputMessage") filter?.setValue(_correctionLevel, forKey: "inputCorrectionLevel") } filter?.setValue(self, forKey: kCIInputImageKey) return filter?.outputImage } func randomGenerator() -> CIImage? { let filter = CIFilter(name: "CIRandomGenerator") // print(filter?.attributes) filter?.setDefaults() filter?.setValue(self, forKey: kCIInputImageKey) return filter?.outputImage } func starShineGenerator(closure: ((inout center: CIVector, inout color: CIColor, inout radius: NSNumber, inout crossScale: NSNumber, inout crossAngle: NSNumber, inout crossOpacity: NSNumber, inout crossWidth: NSNumber, inout epsilon: NSNumber) -> Void)?) -> CIImage? { let filter = CIFilter(name: "CIStarShineGenerator") // print(filter?.attributes) filter?.setDefaults() if closure != nil { var _center: CIVector = CIVector() var _color: CIColor = CIColor(red: 0, green: 0, blue: 0) var _radius: NSNumber = 0 var _crossScale: NSNumber = 0 var _crossAngle: NSNumber = 0 var _crossOpacity: NSNumber = 0 var _crossWidth: NSNumber = 0 var _epsilon: NSNumber = 0 closure!(center: &_center, color: &_color, radius: &_radius, crossScale: &_crossScale, crossAngle: &_crossAngle, crossOpacity: &_crossOpacity, crossWidth: &_crossWidth, epsilon: &_epsilon) filter?.setValue(_center, forKey: "inputCenter") filter?.setValue(_color, forKey: "inputColor") filter?.setValue(_radius, forKey: "inputRadius") filter?.setValue(_crossScale, forKey: "inputCrossScale") filter?.setValue(_crossAngle, forKey: "inputCrossAngle") filter?.setValue(_crossOpacity, forKey: "inputCrossOpacity") filter?.setValue(_crossWidth, forKey: "inputCrossWidth") filter?.setValue(_epsilon, forKey: "inputEpsilon") } filter?.setValue(self, forKey: kCIInputImageKey) return filter?.outputImage } func stripesGenerator(closure: ((inout center: CIVector, inout color0: CIColor, inout color1: CIColor, inout width: NSNumber, inout sharpness: NSNumber) -> Void)?) -> CIImage? { let filter = CIFilter(name: "CIStripesGenerator") // print(filter?.attributes) filter?.setDefaults() if closure != nil { var _center: CIVector = CIVector() var _color0: CIColor = CIColor(red: 0, green: 0, blue: 0) var _color1: CIColor = CIColor(red: 0, green: 0, blue: 0) var _width: NSNumber = 0 var _sharpness: NSNumber = 0 closure!(center: &_center, color0: &_color0, color1: &_color1, width: &_width, sharpness: &_sharpness) filter?.setValue(_center, forKey: "inputCenter") filter?.setValue(_color0, forKey: "inputColor0") filter?.setValue(_color1, forKey: "inputColor1") filter?.setValue(_width, forKey: "inputWidth") filter?.setValue(_sharpness, forKey: "inputSharpness") } filter?.setValue(self, forKey: kCIInputImageKey) return filter?.outputImage } func sunbeamsGenerator(closure: ((inout center: CIVector, inout color: CIColor, inout sunRadius: NSNumber, inout maxStriationRadius: NSNumber, inout striationStrength: NSNumber, inout striationContrast: NSNumber, inout time: NSNumber) -> Void)?) -> CIImage? { let filter = CIFilter(name: "CISunbeamsGenerator") // print(filter?.attributes) filter?.setDefaults() if closure != nil { var _center: CIVector = CIVector() var _color: CIColor = CIColor(red: 0, green: 0, blue: 0) var _sunRadius: NSNumber = 0 var _maxStriationRadius: NSNumber = 0 var _striationStrength: NSNumber = 0 var _striationContrast: NSNumber = 0 var _time: NSNumber = 0 closure!(center: &_center, color: &_color, sunRadius: &_sunRadius, maxStriationRadius: &_maxStriationRadius, striationStrength: &_striationStrength, striationContrast: &_striationContrast, time: &_time) filter?.setValue(_center, forKey: "inputCenter") filter?.setValue(_color, forKey: "inputColor") filter?.setValue(_sunRadius, forKey: "inputSunRadius") filter?.setValue(_maxStriationRadius, forKey: "inputMaxStriationRadius") filter?.setValue(_striationStrength, forKey: "inputStriationStrength") filter?.setValue(_striationContrast, forKey: "inputStriationContrast") filter?.setValue(_time, forKey: "inputTime") } filter?.setValue(self, forKey: kCIInputImageKey) return filter?.outputImage } }
[ -1 ]
8d3888d3649f63055866bb8cac500c8d145640de
fd1de8734c68c98619246da90b66740205228c5c
/LinePreTest/LinePreTest/Components/LoadingTableViewCell.swift
7c05755978f2a8ca1d89efb1f795e9ae4d04ad10
[]
no_license
onsensei/LineCleanRxSwift
97bceb30ee3b8490094121b335dacfc4ef05f6ae
fa78463dac4c2d42be85ba3e9719b594b7c5c225
refs/heads/master
2021-07-08T09:45:36.262483
2020-01-01T18:57:19
2020-01-01T18:57:19
230,562,082
0
0
null
null
null
null
UTF-8
Swift
false
false
622
swift
// // LoadingTableViewCell.swift // LinePreTest // // Created by Thanaphat Suwannikornkul on 01/01/63 BE. // Copyright © 2563 Thanaphat Suwannikornkul. All rights reserved. // import UIKit class LoadingTableViewCell: UITableViewCell { // MARK: IBOutlet @IBOutlet weak var spinner: UIActivityIndicatorView! // MARK: Cell lifecycle override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } }
[ -1 ]
9cace51a74da6a7da39bdc1b2f6b3a48a542c7b6
a6f304b5e1ca24a76286516be49d90842f2f8ec4
/Day6-Get user's current location/Day6-Get user's current location/AppDelegate.swift
133c5c0909f4d2efe22373ebdff0e458b7ef3ec9
[]
no_license
gitkong/thirtyDaySwiftLearning
08675e57149132a6a007315ff9297cd0ac1e2ea8
9820714f7c6a1b060a8e7836953233468039ca3b
refs/heads/master
2020-04-06T07:13:09.499656
2016-08-28T00:18:17
2016-08-28T00:18:17
62,871,848
0
0
null
null
null
null
UTF-8
Swift
false
false
2,238
swift
// // AppDelegate.swift // Day6-Get user's current location // // Created by 孔凡列 on 16/7/11. // Copyright © 2016年 clarence. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { self.window = UIWindow.init() self.window?.rootViewController = ViewController.init() 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 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, 278542, 229391, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 278559, 278564, 229415, 229417, 327722, 229426, 229428, 286774, 229432, 286776, 286778, 319544, 286791, 237640, 278605, 196692, 311383, 319590, 311400, 278635, 278639, 278648, 131192, 327814, 131209, 303241, 311436, 319633, 286873, 286876, 311460, 311469, 327862, 286906, 180413, 286910, 286916, 286922, 286924, 286926, 286928, 278743, 278747, 155872, 319716, 237807, 303345, 286962, 229622, 327930, 278781, 278783, 278785, 278792, 286987, 319757, 286999, 287003, 287009, 287014, 287016, 287019, 262448, 155966, 278849, 319809, 319810, 319814, 319818, 311628, 287054, 319822, 278865, 196963, 196969, 106872, 311683, 319879, 65943, 319898, 311719, 278952, 139689, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 278983, 319945, 278986, 278990, 278994, 279003, 279006, 188895, 279010, 287202, 279015, 172520, 279020, 279023, 311791, 172529, 279027, 164343, 311804, 279040, 303617, 287234, 279045, 287238, 172550, 172552, 303623, 320007, 279051, 172558, 279055, 279058, 279063, 279067, 172572, 279072, 172577, 172581, 279082, 279084, 172591, 172598, 279095, 172607, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 279124, 172634, 262752, 311911, 189034, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 352905, 279178, 287371, 311946, 311951, 287377, 287381, 311957, 221850, 287386, 164509, 287390, 295583, 303773, 287394, 303780, 287398, 287400, 279208, 172714, 279212, 172721, 287409, 66227, 303797, 189114, 287419, 328381, 279231, 287423, 328384, 287427, 107212, 172748, 287436, 172755, 303827, 279255, 279258, 303835, 213724, 189149, 303838, 279267, 279272, 312050, 230131, 230146, 328453, 230154, 33548, 312077, 369433, 295707, 328476, 303914, 279340, 279353, 230202, 222018, 377676, 148302, 287569, 279390, 230241, 279394, 303976, 336744, 328563, 279413, 213895, 320391, 304013, 213902, 279438, 279445, 58262, 279452, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 304063, 238528, 304065, 189378, 213954, 156612, 295873, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 295928, 320505, 295945, 295949, 320528, 140312, 295961, 238620, 304164, 189479, 238641, 238652, 238655, 230465, 296004, 336964, 205895, 320584, 238666, 296021, 205931, 164973, 205934, 279661, 279669, 337018, 279679, 279683, 222340, 205968, 296084, 238745, 238756, 205991, 165035, 337067, 165038, 238766, 238770, 230592, 279750, 230600, 230607, 148690, 279769, 304348, 279777, 304354, 320740, 279781, 304360, 320748, 279790, 296189, 320771, 296205, 230674, 320786, 230677, 296213, 296215, 206123, 312622, 312630, 222522, 222525, 312639, 378181, 230727, 238919, 320840, 222545, 230739, 337244, 230752, 173418, 410987, 148843, 230768, 296305, 312692, 230773, 181626, 304506, 181631, 312711, 312712, 296331, 288140, 230800, 304533, 337306, 288160, 288162, 288164, 370092, 279983, 288176, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 230860, 288210, 370130, 288212, 280021, 288214, 239064, 288217, 288218, 280027, 288220, 329177, 239070, 288224, 288226, 370146, 280036, 288229, 280038, 288230, 288232, 280034, 288234, 288236, 288238, 288240, 288242, 288244, 288250, 402942, 370187, 304651, 304653, 230940, 108066, 296486, 157229, 288320, 124489, 280140, 288338, 280149, 280152, 239194, 280158, 403039, 370272, 312938, 280185, 280188, 280191, 280194, 280208, 288408, 280222, 321195, 321200, 337585, 296634, 313027, 280260, 280264, 206536, 206539, 206541, 206543, 280276, 321239, 280283, 313052, 288478, 313055, 313066, 280302, 288494, 419570, 321266, 288502, 280314, 288510, 67330, 280324, 198405, 288519, 280331, 198416, 296723, 116503, 329498, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 280388, 304968, 280393, 280402, 313176, 280419, 321381, 313201, 1920, 255873, 305028, 280454, 247688, 124817, 280468, 280473, 124827, 247709, 214944, 296883, 10170, 296890, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 231404, 124913, 239612, 313340, 313347, 313358, 321560, 313371, 223273, 313386, 124978, 124980, 321595, 313406, 288831, 67654, 280651, 288848, 280658, 215123, 288855, 288859, 280669, 313438, 280671, 321634, 280681, 313451, 223341, 280687, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 280823, 280825, 280830, 280831, 125187, 125191, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 280919, 354653, 313700, 280937, 280940, 190832, 280946, 313720, 280956, 239997, 280959, 199051, 240011, 240017, 190868, 297365, 297368, 297372, 141725, 297377, 289186, 240052, 289207, 305594, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 281084, 240124, 305662, 305664, 240129, 305666, 305668, 281095, 338440, 150025, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 158262, 289342, 281154, 322115, 199262, 338532, 281190, 281196, 158317, 313973, 281210, 158347, 133776, 314003, 117398, 314007, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 314047, 314051, 297671, 363234, 289522, 289525, 322310, 322314, 322318, 281361, 281372, 215850, 281388, 207661, 289593, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 297818, 281435, 281438, 224110, 207737, 183172, 158596, 240519, 322440, 183184, 289687, 297883, 289694, 289700, 52163, 281567, 322534, 297961, 183277, 281581, 322550, 134142, 322610, 314421, 281654, 314427, 207937, 322642, 281691, 314461, 281702, 281704, 281711, 289912, 248995, 306341, 306344, 306347, 306354, 142531, 199877, 289991, 306377, 363745, 330988, 216303, 322801, 199978, 314671, 298292, 298294, 298306, 380226, 224584, 224587, 224594, 216404, 306517, 314714, 224603, 159068, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 298358, 314743, 306552, 290171, 314747, 290174, 281987, 281990, 298377, 314763, 224657, 314785, 282025, 314793, 282027, 241070, 282034, 150966, 298424, 306618, 282044, 323015, 306640, 290275, 339431, 282089, 191985, 282098, 282101, 191992, 290298, 151036, 290302, 175621, 306694, 192008, 282127, 290321, 282130, 282133, 290325, 290328, 290332, 241181, 282142, 290344, 306731, 290349, 290351, 282186, 224849, 282195, 282199, 282201, 159324, 159330, 241260, 257658, 282249, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 323345, 282388, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 241450, 282410, 306988, 315184, 323376, 315190, 241464, 159545, 282425, 307009, 307027, 315221, 315223, 241496, 241498, 307035, 307040, 282465, 282481, 110450, 315251, 315249, 315253, 315255, 282499, 282505, 298896, 282514, 298898, 44948, 298901, 282520, 282531, 282537, 282547, 298975, 241640, 323574, 290807, 299003, 241661, 282623, 315396, 241669, 315397, 282632, 282639, 282645, 282654, 241701, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 192589, 307278, 307287, 315482, 217179, 315483, 192605, 200801, 299105, 217188, 299109, 307303, 45163, 307307, 315502, 192624, 307314, 299126, 233591, 307338, 233613, 241813, 307352, 299164, 184479, 184481, 307370, 168107, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 299200, 307394, 307396, 323784, 307409, 307411, 176343, 233701, 282881, 184586, 282893, 282906, 291104, 233766, 307508, 315701, 307510, 151864, 307512, 307515, 282942, 307518, 151874, 282947, 323917, 110926, 323921, 323926, 233815, 315739, 299357, 242024, 250231, 242043, 291202, 299398, 242057, 291212, 299405, 283033, 291226, 242075, 315801, 291231, 283042, 291238, 291241, 127405, 291247, 299444, 127413, 283062, 283069, 127424, 299457, 176592, 315860, 283095, 299481, 242143, 127455, 127457, 291299, 242152, 291305, 176620, 127469, 127474, 291314, 291317, 135672, 291330, 283142, 127494, 233994, 234003, 234006, 152087, 242202, 234010, 135707, 242206, 242208, 291361, 234038, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 373383, 316051, 299672, 135834, 373404, 299677, 299680, 225954, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 299723, 201444, 283368, 234219, 283372, 283382, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 226053, 234246, 226056, 234248, 234254, 291601, 242452, 234261, 201496, 283421, 234269, 234274, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 234292, 234298, 283452, 234307, 234309, 234313, 316233, 316235, 234316, 242511, 234321, 234324, 185173, 201557, 234333, 308063, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 324464, 234353, 152435, 234358, 234362, 234368, 234370, 201603, 226182, 234375, 234384, 234388, 234390, 226200, 324504, 234393, 209818, 308123, 324508, 291748, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 324527, 291760, 234417, 201650, 324531, 275384, 234428, 291773, 234431, 242623, 324544, 324546, 324548, 226245, 234437, 234439, 234443, 291788, 193486, 234446, 193488, 275406, 234449, 316370, 234452, 234455, 234459, 234461, 168935, 5096, 324585, 234478, 316400, 316403, 234484, 324599, 234490, 234496, 316416, 234501, 234504, 234507, 234515, 300054, 234519, 316439, 234523, 234528, 300066, 234532, 234537, 234540, 144430, 234543, 234549, 300085, 300088, 234556, 234558, 316479, 234561, 316483, 234568, 234570, 316491, 300108, 234581, 242777, 234590, 234595, 300133, 234601, 300139, 160879, 234607, 275569, 234614, 398455, 144506, 234618, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 275594, 177293, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 283805, 234653, 324766, 119967, 283813, 234661, 234664, 275626, 316596, 234687, 316610, 300226, 226500, 234692, 300229, 308420, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 300248, 300253, 300256, 300258, 300265, 161003, 300267, 300270, 300272, 300278, 316663, 300284, 275710, 300287, 300289, 300292, 283917, 300301, 177424, 283939, 259367, 283951, 243003, 283973, 300357, 283983, 316758, 357722, 316766, 292192, 316768, 292197, 316774, 243046, 284010, 136562, 275834, 275836, 275840, 316803, 316806, 316811, 226703, 300433, 234899, 226709, 316824, 316826, 144796, 300448, 144810, 144812, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 284099, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 333280, 292329, 300523, 259565, 259567, 300527, 226802, 292338, 308727, 316947, 308757, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 284218, 226877, 284223, 292421, 226886, 284231, 128584, 366155, 276043, 284238, 226895, 284241, 194130, 284243, 276052, 284245, 276053, 284247, 317015, 284249, 243290, 284251, 284253, 284255, 284258, 292452, 284263, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 276095, 284288, 292481, 284290, 325250, 284292, 284297, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 276122, 284316, 276127, 284320, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 284337, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 276177, 284370, 317138, 284372, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 276216, 284413, 284418, 358146, 317187, 284421, 317191, 300816, 284440, 186139, 300828, 276255, 325408, 300834, 317221, 358183, 276268, 194351, 243504, 284469, 276280, 325436, 276291, 276295, 358224, 276308, 284502, 317271, 276315, 292700, 284511, 227175, 284529, 300915, 284533, 292729, 317306, 284540, 276365, 284564, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 358326, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 276466, 227314, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 276496, 317458, 243733, 243751, 292904, 276528, 243762, 309298, 325685, 235579, 235581, 276544, 284739, 243785, 350295, 194649, 227418, 309337, 194654, 227423, 350302, 178273, 227426, 194657, 194660, 276579, 227430, 276583, 309346, 309348, 309350, 309352, 309354, 350308, 276590, 350313, 227440, 350316, 284786, 350321, 276595, 350328, 292993, 301185, 350339, 350342, 350345, 325777, 350354, 350359, 276638, 350366, 284837, 350375, 350379, 350381, 350385, 350387, 350389, 350395, 350399, 227520, 301252, 350406, 227529, 309450, 276685, 276689, 309462, 301272, 276699, 309468, 301283, 317672, 227571, 276725, 243960, 227583, 276735, 227587, 276739, 276742, 227593, 227596, 325910, 309530, 342298, 276762, 276766, 211232, 276775, 260421, 285002, 276811, 235853, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 285051, 211324, 227709, 285061, 317833, 285070, 285077, 317853, 276896, 317858, 285093, 317864, 276907, 276917, 293304, 317910, 293343, 227810, 293346, 293352, 236013, 317951, 309764, 121352, 236043, 342541, 113167, 317971, 309781, 227877, 227879, 227882, 309804, 105007, 236082, 285236, 277054, 129603, 318020, 277071, 285265, 309844, 277080, 309849, 285277, 285282, 326244, 277100, 121458, 277106, 170619, 277122, 285320, 277128, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 277177, 277181, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 228069, 277223, 342760, 56043, 277232, 56059, 285441, 310020, 285448, 228113, 285459, 277273, 326430, 228128, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301884, 310080, 277317, 277322, 301913, 301921, 400236, 236397, 162671, 310134, 277368, 15224, 236408, 416639, 416640, 310147, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293802, 236460, 277426, 293811, 293820, 203715, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 285686, 285690, 244731, 293887, 277504, 277507, 277519, 293939, 277561, 277564, 310336, 277573, 228422, 310344, 277577, 277583, 310355, 277594, 138332, 277598, 285792, 277601, 310374, 203879, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 392326, 285831, 294026, 285835, 285852, 302237, 285854, 285856, 277671, 302248, 277678, 302258, 277687, 318651, 277695, 244930, 302275, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 228606, 204031, 64768, 310531, 285958, 228617, 318742, 204067, 130345, 113964, 285999, 113969, 318773, 318776, 286016, 294211, 302403, 326991, 179547, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 310657, 351619, 294276, 253320, 310665, 318858, 310672, 351633, 310689, 277932, 310710, 310715, 228799, 64966, 245191, 163272, 302543, 310737, 286169, 310749, 310755, 187880, 310764, 40443, 286203, 40448, 228864, 228871, 65038, 302614, 286233, 146977, 286246, 286248, 278057, 310831, 212538, 40507, 228933, 40525, 212560, 228944, 400976, 147032, 40537, 40539, 278109, 40550, 286312, 286313, 40554, 310892, 40557, 294521, 343679, 310925, 286354, 278163, 278168, 327333, 229030, 278188, 278192, 319153, 302789, 294599, 278216, 343757, 212690, 278227, 286420, 319187, 319194, 278235, 229086, 278238, 286432, 294625, 286460, 171774, 278274, 278277, 302854, 294664, 311048, 311053, 302862, 278306, 294701, 278320, 229192, 302925, 327554, 40851, 294811, 294817, 319394, 294821, 311209, 180142, 188340, 294847, 393177, 294876, 294879, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
ce99c8f3604a5a12197ccb26be8dc019bc84cfa1
1ac4900fd3088d8c4b49c3a35175b2fdea4a4f84
/Tic Tac Toe/ViewController.swift
02e2557f7921946e187303ef487c47c7cddd18b5
[ "MIT" ]
permissive
dhruvshah8/Tic-Tac-Toe
947933798ae28bf2ca690b90ed2ef5160f4cbc24
3059eac30fb55ef7018c29909815167ab5e9abe8
refs/heads/master
2022-06-13T11:01:20.997077
2020-05-07T05:19:01
2020-05-07T05:19:01
261,956,191
0
0
null
2020-05-07T05:17:26
2020-05-07T05:17:25
null
UTF-8
Swift
false
false
4,435
swift
// // ViewController.swift // Tic Tac Toe // // Created by Harshil Patel on 3/11/19. // Copyright © 2019 Harshil Patel. All rights reserved. // import UIKit @available(iOS 10.3, *) class ViewController: UIViewController { var activePlayer = 1 // For player var img1 = UIImage(named: "New X.png") // Declaring symbol for player 1 var img2 = UIImage(named: "New O.png") // Declaring symbol for player 2 var grid = [0,0,0,0,0,0,0,0,0] // All buttons let winningCombinations = [[0, 1, 2], [3, 4, 5], [6, 7, 8], // Horizontal Combinations [0, 3, 6], [1, 4, 7], [2, 5, 8], // Vertical Combinations [2, 4, 6], [0, 4, 8] // Cross Combinations ] var gameStatus = true @IBOutlet weak var winningLabel: UILabel! @IBAction func actionCalled(_ sender: AnyObject) { if (grid[sender.tag-1] == 0 && gameStatus == true) { grid[sender.tag-1] = activePlayer if activePlayer == 1 { (sender as AnyObject).setImage(img1, for: .normal) activePlayer = 2 // Game turn change it to opposite } else { (sender as AnyObject).setImage(img2, for: .normal) activePlayer = 1 // Game turn change it to opposite } for combination in winningCombinations { if grid[combination[0]] != 0 && grid[combination[0]] == grid[combination[1]] && grid[combination[1]] == grid[combination[2]] { gameStatus = false // When someone win the game it will stop the game if grid[combination[0]] == 1 { winningLabel.text = "X Wins!" } else { winningLabel.text = "O Wins!" } AppStoreReviewManager.requestReviewIfAppropriate() //This will pop-up the review prompt after the condition check restartButton.isHidden = false winningLabel.isHidden = false homeButton.isHidden = true } } } var count = 1 if gameStatus == true{ for i in grid{ count = i*count } if count != 0 { winningLabel.text = "It's a tie, play again!" winningLabel.isHidden = false restartButton.isHidden = false homeButton.isHidden = true } } } //Haptic feedback for Start Button @IBAction func startButton(_ sender: Any) { let generator = UIImpactFeedbackGenerator (style: .heavy) generator.impactOccurred() } @IBOutlet weak var homeButton: UIButton! @IBOutlet weak var restartButton: UIButton! @IBAction func restartButton(_ sender: Any) // Everything will be disappeared and game will start from the top! { grid = [0,0,0,0,0,0,0,0,0] gameStatus = true activePlayer = 1 for i in 1...9 { let button = view.viewWithTag(i) as! UIButton button.setImage(nil, for: UIControl.State()) restartButton.isHidden = true // Restart button will disappear winningLabel.isHidden = true // Winning label will disappear homeButton.isHidden = false // After pressing the restart button home button will appear } } override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } }
[ -1 ]